diff --git a/.gitattributes b/.gitattributes index b2e324795aa..852eec4d638 100644 --- a/.gitattributes +++ b/.gitattributes @@ -9,6 +9,7 @@ *.cpp text *.h text *.test text +*.java text # These files should be checked out as is *.result -text -whitespace @@ -23,9 +24,11 @@ pcre/testdata/greppatN4 -text *.frm binary *.MYD binary *.MYI binary +*.class binary *.c diff=cpp *.h diff=cpp *.cc diff=cpp *.ic diff=cpp *.cpp diff=cpp +*.java diff=cpp diff --git a/.gitignore b/.gitignore index f2064537da4..279d3f59dc5 100644 --- a/.gitignore +++ b/.gitignore @@ -244,6 +244,8 @@ storage/mroonga/mysql-test/mroonga/storage/r/variable_version.result *.exp *.dep *.idb +*.res +*.tlog # Precompiled Headers *.gch diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000000..b09c348dfab --- /dev/null +++ b/.travis.yml @@ -0,0 +1,56 @@ +# vim ft=yaml +# travis-ci.org definition + +# non-container builds don't have enough RAM to reliably compile +sudo: required +dist: trusty + +language: cpp +compiler: + - gcc +# - clang # See commit f38808 if you want to re-enable clang builds +cache: + apt: + ccache: + +# Timing on build an test needs to be < 50 minutes. The compile is ~4-5minutes +# so here we group the tests such that this happens. + +addons: + apt: + packages: # make sure these match debian/control contents + - bison + - chrpath + - cmake + - debhelper + - dh-apparmor + - dpatch + - libaio-dev + - libboost-dev + - libjudy-dev + - libncurses5-dev + - libpam0g-dev + - libreadline-gplv2-dev + - libssl-dev + - lsb-release + - perl + - po-debconf + - psmisc + - zlib1g-dev + - libcrack2-dev # no effect as the package is disallowed on Travis-CI + - libjemalloc-dev + - devscripts # implicit for any build on Ubuntu + +script: + - ${CC} --version ; ${CXX} --version + - cd "${TRAVIS_BUILD_DIR}" + - env DEB_BUILD_OPTIONS="parallel=4" debian/autobake-deb.sh; + +notifications: + irc: + channels: + - "chat.freenode.net#maria" + on_success: never # [always|never|change] + on_failure: never + template: + - "%{repository}/%{branch} (%{commit} - %{author}): %{build_url}: %{message}" diff --git a/CMakeLists.txt b/CMakeLists.txt index 5f8ae5b2d9c..3ace4084acd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -153,6 +153,7 @@ INCLUDE(plugin) INCLUDE(install_macros) INCLUDE(systemd) INCLUDE(mysql_add_executable) +INCLUDE(crc32-vpmsum) # Handle options OPTION(DISABLE_SHARED diff --git a/VERSION b/VERSION index 368d3a7c331..b5cb47d0028 100644 --- a/VERSION +++ b/VERSION @@ -1,3 +1,3 @@ MYSQL_VERSION_MAJOR=10 MYSQL_VERSION_MINOR=2 -MYSQL_VERSION_PATCH=0 +MYSQL_VERSION_PATCH=2 diff --git a/client/client_priv.h b/client/client_priv.h index 656c8fcf32a..c0c4954cdf0 100644 --- a/client/client_priv.h +++ b/client/client_priv.h @@ -1,5 +1,6 @@ /* Copyright (c) 2001, 2012, Oracle and/or its affiliates. + Copyright (c) 2009, 2016, MariaDB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/client/mysql.cc b/client/mysql.cc index bea015d721e..2cc818bd6c1 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -1,7 +1,6 @@ /* Copyright (c) 2000, 2014, Oracle and/or its affiliates. - Copyright (c) 2009, 2013, Monty Program Ab. - Copyright (c) 2013, 2014, SkySQL Ab + Copyright (c) 2009, 2016, MariaDB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -96,9 +95,16 @@ extern "C" { #endif } -#if !defined(HAVE_VIDATTR) -#undef vidattr -#define vidattr(A) {} // Can't get this to work +#ifdef HAVE_VIDATTR +static int have_curses= 0; +static void my_vidattr(chtype attrs) +{ + if (have_curses) + vidattr(attrs); +} +#else +#undef HAVE_SETUPTERM +#define my_vidattr(A) {} // Can't get this to work #endif #ifdef FN_NO_CASE_SENSE @@ -4734,9 +4740,9 @@ com_status(String *buffer __attribute__((unused)), if (skip_updates) { - vidattr(A_BOLD); + my_vidattr(A_BOLD); tee_fprintf(stdout, "\nAll updates ignored to this database\n"); - vidattr(A_NORMAL); + my_vidattr(A_NORMAL); } #ifdef USE_POPEN tee_fprintf(stdout, "Current pager:\t\t%s\n", pager); @@ -4804,9 +4810,9 @@ com_status(String *buffer __attribute__((unused)), } if (safe_updates) { - vidattr(A_BOLD); + my_vidattr(A_BOLD); tee_fprintf(stdout, "\nNote that you are running in safe_update_mode:\n"); - vidattr(A_NORMAL); + my_vidattr(A_NORMAL); tee_fprintf(stdout, "\ UPDATEs and DELETEs that don't use a key in the WHERE clause are not allowed.\n\ (One can force an UPDATE/DELETE by adding LIMIT # at the end of the command.)\n\ @@ -4899,10 +4905,11 @@ put_info(const char *str,INFO_TYPE info_type, uint error, const char *sqlstate) { if (!inited) { - inited=1; #ifdef HAVE_SETUPTERM - (void) setupterm((char *)0, 1, (int *) 0); + int errret; + have_curses= setupterm((char *)0, 1, &errret) != ERR; #endif + inited=1; } if (info_type == INFO_ERROR) { @@ -4914,7 +4921,7 @@ put_info(const char *str,INFO_TYPE info_type, uint error, const char *sqlstate) putchar('\a'); /* This should make a bell */ #endif } - vidattr(A_STANDOUT); + my_vidattr(A_STANDOUT); if (error) { if (sqlstate) @@ -4933,9 +4940,9 @@ put_info(const char *str,INFO_TYPE info_type, uint error, const char *sqlstate) tee_fputs(": ", file); } else - vidattr(A_BOLD); + my_vidattr(A_BOLD); (void) tee_puts(str, file); - vidattr(A_NORMAL); + my_vidattr(A_NORMAL); } if (unbuffered) fflush(file); diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c index cdeaebf478f..e400087a2e8 100644 --- a/client/mysql_upgrade.c +++ b/client/mysql_upgrade.c @@ -1,6 +1,6 @@ /* Copyright (c) 2006, 2013, Oracle and/or its affiliates. - Copyright (c) 2010, 2015, MariaDB + Copyright (c) 2010, 2016, MariaDB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/client/mysqladmin.cc b/client/mysqladmin.cc index 0089e03ac93..fe9db6ea93d 100644 --- a/client/mysqladmin.cc +++ b/client/mysqladmin.cc @@ -1,6 +1,6 @@ /* Copyright (c) 2000, 2014, Oracle and/or its affiliates. - Copyright (c) 2010, 2015, MariaDB + Copyright (c) 2010, 2016, MariaDB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -235,8 +235,6 @@ my_bool get_one_option(int optid, const struct my_option *opt __attribute__((unused)), char *argument) { - int error = 0; - switch(optid) { case 'c': opt_count_iterations= 1; @@ -284,8 +282,8 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), break; case '?': case 'I': /* Info */ - error++; - break; + usage(); + exit(0); case OPT_CHARSETS_DIR: #if MYSQL_VERSION_ID > 32300 charsets_dir = argument; @@ -296,11 +294,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), opt->name); break; } - if (error) - { - usage(); - exit(1); - } return 0; } diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index 0463a9857bc..fa75c423d1b 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -34,6 +34,7 @@ #define TABLE TABLE_CLIENT #include "client_priv.h" #include +#include /* That one is necessary for defines of OPTION_NO_FOREIGN_KEY_CHECKS etc */ #include "sql_priv.h" #include "log_event.h" @@ -1403,6 +1404,7 @@ static struct my_option my_options[] = {"socket", 'S', "The socket file to use for connection.", &sock, &sock, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, +#include {"start-datetime", OPT_START_DATETIME, "Start reading the binlog at first event having a datetime equal or " "posterior to the argument; the argument must be a date and time " @@ -1621,6 +1623,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), DBUG_PUSH(argument ? argument : default_dbug_option); break; #endif +#include case 'd': one_database = 1; break; @@ -1773,6 +1776,18 @@ static Exit_status safe_connect() return ERROR_STOP; } +#ifdef HAVE_OPENSSL + if (opt_use_ssl) + { + mysql_ssl_set(mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca, + opt_ssl_capath, opt_ssl_cipher); + mysql_options(mysql, MYSQL_OPT_SSL_CRL, opt_ssl_crl); + mysql_options(mysql, MYSQL_OPT_SSL_CRLPATH, opt_ssl_crlpath); + } + mysql_options(mysql,MYSQL_OPT_SSL_VERIFY_SERVER_CERT, + (char*)&opt_ssl_verify_server_cert); +#endif /*HAVE_OPENSSL*/ + if (opt_plugindir && *opt_plugindir) mysql_options(mysql, MYSQL_PLUGIN_DIR, opt_plugindir); diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c index 627fbcb1873..3e821b183bd 100644 --- a/client/mysqlcheck.c +++ b/client/mysqlcheck.c @@ -1,6 +1,6 @@ /* Copyright (c) 2001, 2013, Oracle and/or its affiliates. - Copyright (c) 2010, 2015, MariaDB + Copyright (c) 2010, 2016, MariaDB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -246,7 +246,7 @@ static void dbDisconnect(char *host); static void DBerror(MYSQL *mysql, const char *when); static void safe_exit(int error); static void print_result(); -static uint fixed_name_length(const char *name); +static size_t fixed_name_length(const char *name); static char *fix_table_name(char *dest, char *src); int what_to_do = 0; @@ -594,10 +594,10 @@ static int process_selected_tables(char *db, char **table_names, int tables) } /* process_selected_tables */ -static uint fixed_name_length(const char *name) +static size_t fixed_name_length(const char *name) { const char *p; - uint extra_length= 2; /* count the first/last backticks */ + size_t extra_length= 2; /* count the first/last backticks */ DBUG_ENTER("fixed_name_length"); for (p= name; *p; p++) @@ -605,7 +605,7 @@ static uint fixed_name_length(const char *name) if (*p == '`') extra_length++; } - DBUG_RETURN((uint) ((p - name) + extra_length)); + DBUG_RETURN((size_t) ((p - name) + extra_length)); } @@ -664,7 +664,7 @@ static int process_all_tables_in_db(char *database) */ char *tables, *end; - uint tot_length = 0; + size_t tot_length = 0; char *views, *views_end; uint tot_views_length = 0; @@ -769,7 +769,9 @@ static int fix_table_storage_name(const char *name) if (strncmp(name, "#mysql50#", 9)) DBUG_RETURN(1); - sprintf(qbuf, "RENAME TABLE `%s` TO `%s`", name, name + 9); + my_snprintf(qbuf, sizeof(qbuf), "RENAME TABLE %`s TO %`s", + name, name + 9); + rc= run_query(qbuf, 1); if (verbose) printf("%-50s %s\n", name, rc ? "FAILED" : "OK"); @@ -784,7 +786,8 @@ static int fix_database_storage_name(const char *name) if (strncmp(name, "#mysql50#", 9)) DBUG_RETURN(1); - sprintf(qbuf, "ALTER DATABASE `%s` UPGRADE DATA DIRECTORY NAME", name); + my_snprintf(qbuf, sizeof(qbuf), "ALTER DATABASE %`s UPGRADE DATA DIRECTORY " + "NAME", name); rc= run_query(qbuf, 1); if (verbose) printf("%-50s %s\n", name, rc ? "FAILED" : "OK"); @@ -806,7 +809,7 @@ static int rebuild_table(char *name) ptr= strxmov(ptr, " FORCE", NullS); if (verbose >= 3) puts(query); - if (mysql_real_query(sock, query, (uint)(ptr - query))) + if (mysql_real_query(sock, query, (ulong)(ptr - query))) { fprintf(stderr, "Failed to %s\n", query); fprintf(stderr, "Error: %s\n", mysql_error(sock)); @@ -871,7 +874,7 @@ static int handle_request_for_tables(char *tables, size_t length, my_bool view) { char *query, *end, options[100], message[100]; char table_name_buff[NAME_CHAR_LEN*2*2+1], *table_name; - uint query_length= 0; + size_t query_length= 0, query_size= sizeof(char)*(length+110); const char *op = 0; const char *tab_view; DBUG_ENTER("handle_request_for_tables"); @@ -924,10 +927,12 @@ static int handle_request_for_tables(char *tables, size_t length, my_bool view) DBUG_RETURN(fix_table_storage_name(tables)); } - if (!(query =(char *) my_malloc((sizeof(char)*(length+110)), MYF(MY_WME)))) + if (!(query =(char *) my_malloc(query_size, MYF(MY_WME)))) DBUG_RETURN(1); if (opt_all_in_1) { + DBUG_ASSERT(strlen(op)+strlen(tables)+strlen(options)+8+1 <= query_size); + /* No backticks here as we added them before */ query_length= sprintf(query, "%s%s%s %s", op, tab_view, tables, options); @@ -943,7 +948,7 @@ static int handle_request_for_tables(char *tables, size_t length, my_bool view) (int) (ptr - org))); table_name= table_name_buff; ptr= strxmov(ptr, " ", options, NullS); - query_length= (uint) (ptr - query); + query_length= (size_t) (ptr - query); } if (verbose >= 3) puts(query); @@ -1209,7 +1214,7 @@ int main(int argc, char **argv) process_databases(argv); if (opt_auto_repair) { - uint i; + size_t i; if (!opt_silent && (tables4repair.elements || tables4rebuild.elements)) puts("\nRepairing tables"); diff --git a/client/mysqldump.c b/client/mysqldump.c index 1c939b87c65..60f244bf591 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -1,6 +1,6 @@ /* Copyright (c) 2000, 2013, Oracle and/or its affiliates. - Copyright (c) 2010, 2015, Monty Program Ab. + Copyright (c) 2010, 2016, MariaDB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -92,7 +92,7 @@ static void add_load_option(DYNAMIC_STRING *str, const char *option, const char *option_value); -static ulong find_set(TYPELIB *lib, const char *x, uint length, +static ulong find_set(TYPELIB *lib, const char *x, size_t length, char **err_pos, uint *err_len); static char *alloc_query_str(ulong size); @@ -896,7 +896,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), opt_set_charset= 0; opt_compatible_mode_str= argument; opt_compatible_mode= find_set(&compatible_mode_typelib, - argument, (uint) strlen(argument), + argument, strlen(argument), &err_ptr, &err_len); if (err_len) { @@ -906,7 +906,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), } #if !defined(DBUG_OFF) { - uint size_for_sql_mode= 0; + size_t size_for_sql_mode= 0; const char **ptr; for (ptr= compatible_mode_names; *ptr; ptr++) size_for_sql_mode+= strlen(*ptr); @@ -1177,8 +1177,8 @@ static int fetch_db_collation(const char *db_name, break; } - strncpy(db_cl_name, db_cl_row[0], db_cl_size); - db_cl_name[db_cl_size - 1]= 0; /* just in case. */ + strncpy(db_cl_name, db_cl_row[0], db_cl_size-1); + db_cl_name[db_cl_size - 1]= 0; } while (FALSE); @@ -1311,7 +1311,7 @@ get_gtid_pos(char *out_gtid_pos, int master) static char *my_case_str(const char *str, - uint str_len, + size_t str_len, const char *token, uint token_len) { @@ -1527,7 +1527,7 @@ static int switch_character_set_results(MYSQL *mysql, const char *cs_name) */ static char *cover_definer_clause(const char *stmt_str, - uint stmt_length, + size_t stmt_length, const char *definer_version_str, uint definer_version_length, const char *stmt_version_str, @@ -1727,14 +1727,14 @@ static void dbDisconnect(char *host) } /* dbDisconnect */ -static void unescape(FILE *file,char *pos,uint length) +static void unescape(FILE *file,char *pos, size_t length) { char *tmp; DBUG_ENTER("unescape"); if (!(tmp=(char*) my_malloc(length*2+1, MYF(MY_WME)))) die(EX_MYSQLERR, "Couldn't allocate memory"); - mysql_real_escape_string(&mysql_connection, tmp, pos, length); + mysql_real_escape_string(&mysql_connection, tmp, pos, (ulong)length); fputc('\'', file); fputs(tmp, file); fputc('\'', file); @@ -1868,7 +1868,7 @@ static char *quote_for_equal(const char *name, char *buff) Quote '<' '>' '&' '\"' chars and print a string to the xml_file. */ -static void print_quoted_xml(FILE *xml_file, const char *str, ulong len, +static void print_quoted_xml(FILE *xml_file, const char *str, size_t len, my_bool is_attribute_name) { const char *end; @@ -2129,7 +2129,7 @@ static void print_xml_row(FILE *xml_file, const char *row_name, squeezed to a single hyphen. */ -static void print_xml_comment(FILE *xml_file, ulong len, +static void print_xml_comment(FILE *xml_file, size_t len, const char *comment_string) { const char* end; @@ -2246,7 +2246,7 @@ static uint dump_events_for_db(char *db) DBUG_ENTER("dump_events_for_db"); DBUG_PRINT("enter", ("db: '%s'", db)); - mysql_real_escape_string(mysql, db_name_buff, db, strlen(db)); + mysql_real_escape_string(mysql, db_name_buff, db, (ulong)strlen(db)); /* nice comments */ print_comment(sql_file, 0, @@ -2366,7 +2366,6 @@ static uint dump_events_for_db(char *db) (const char *) delimiter); my_free(query_str); - restore_time_zone(sql_file, delimiter); restore_sql_mode(sql_file, delimiter); @@ -2459,7 +2458,7 @@ static uint dump_routines_for_db(char *db) DBUG_ENTER("dump_routines_for_db"); DBUG_PRINT("enter", ("db: '%s'", db)); - mysql_real_escape_string(mysql, db_name_buff, db, strlen(db)); + mysql_real_escape_string(mysql, db_name_buff, db, (ulong)strlen(db)); /* nice comments */ print_comment(sql_file, 0, @@ -2517,9 +2516,9 @@ static uint dump_routines_for_db(char *db) if the user has EXECUTE privilege he see routine names, but NOT the routine body of other routines that are not the creator of! */ - DBUG_PRINT("info",("length of body for %s row[2] '%s' is %d", + DBUG_PRINT("info",("length of body for %s row[2] '%s' is %zu", routine_name, row[2] ? row[2] : "(null)", - row[2] ? (int) strlen(row[2]) : 0)); + row[2] ? strlen(row[2]) : 0)); if (row[2] == NULL) { print_comment(sql_file, 1, "\n-- insufficient privileges to %s\n", @@ -4107,7 +4106,7 @@ static int dump_tablespaces_for_tables(char *db, char **table_names, int tables) int i; char name_buff[NAME_LEN*2+3]; - mysql_real_escape_string(mysql, name_buff, db, strlen(db)); + mysql_real_escape_string(mysql, name_buff, db, (ulong)strlen(db)); init_dynamic_string_checked(&dynamic_where, " AND TABLESPACE_NAME IN (" "SELECT DISTINCT TABLESPACE_NAME FROM" @@ -4120,7 +4119,7 @@ static int dump_tablespaces_for_tables(char *db, char **table_names, int tables) for (i=0 ; imax_length) length=field->max_length; @@ -505,7 +506,8 @@ static int list_tables(MYSQL *mysql,const char *db,const char *table) { const char *header; - uint head_length, counter = 0; + size_t head_length; + uint counter = 0; char query[NAME_LEN + 100], rows[NAME_LEN], fields[16]; MYSQL_FIELD *field; MYSQL_RES *result; @@ -542,7 +544,7 @@ list_tables(MYSQL *mysql,const char *db,const char *table) putchar('\n'); header="Tables"; - head_length=(uint) strlen(header); + head_length= strlen(header); field=mysql_fetch_field(result); if (head_length < field->max_length) head_length=field->max_length; @@ -660,7 +662,7 @@ list_table_status(MYSQL *mysql,const char *db,const char *wild) len= sizeof(query); len-= my_snprintf(query, len, "show table status from `%s`", db); if (wild && wild[0] && len) - strxnmov(query + strlen(query), len, " like '", wild, "'", NullS); + strxnmov(query + strlen(query), len - 1, " like '", wild, "'", NullS); if (mysql_query(mysql,query) || !(result=mysql_store_result(mysql))) { fprintf(stderr,"%s: Cannot get status for db: %s, table: %s: %s\n", @@ -693,7 +695,7 @@ list_fields(MYSQL *mysql,const char *db,const char *table, const char *wild) { char query[NAME_LEN + 100]; - int len; + size_t len; MYSQL_RES *result; MYSQL_ROW row; ulong UNINIT_VAR(rows); @@ -723,7 +725,7 @@ list_fields(MYSQL *mysql,const char *db,const char *table, len-= my_snprintf(query, len, "show /*!32332 FULL */ columns from `%s`", table); if (wild && wild[0] && len) - strxnmov(query + strlen(query), len, " like '", wild, "'", NullS); + strxnmov(query + strlen(query), len - 1, " like '", wild, "'", NullS); if (mysql_query(mysql,query) || !(result=mysql_store_result(mysql))) { fprintf(stderr,"%s: Cannot list columns in db: %s, table: %s: %s\n", @@ -771,10 +773,10 @@ list_fields(MYSQL *mysql,const char *db,const char *table, *****************************************************************************/ static void -print_header(const char *header,uint head_length,...) +print_header(const char *header,size_t head_length,...) { va_list args; - uint length,i,str_length,pre_space; + size_t length,i,str_length,pre_space; const char *field; va_start(args,head_length); @@ -797,10 +799,10 @@ print_header(const char *header,uint head_length,...) putchar('|'); for (;;) { - str_length=(uint) strlen(field); + str_length= strlen(field); if (str_length > length) str_length=length+1; - pre_space=(uint) (((int) length-(int) str_length)/2)+1; + pre_space= ((length- str_length)/2)+1; for (i=0 ; i < pre_space ; i++) putchar(' '); for (i = 0 ; i < str_length ; i++) @@ -834,11 +836,11 @@ print_header(const char *header,uint head_length,...) static void -print_row(const char *header,uint head_length,...) +print_row(const char *header,size_t head_length,...) { va_list args; const char *field; - uint i,length,field_length; + size_t i,length,field_length; va_start(args,head_length); field=header; length=head_length; @@ -847,7 +849,7 @@ print_row(const char *header,uint head_length,...) putchar('|'); putchar(' '); fputs(field,stdout); - field_length=(uint) strlen(field); + field_length= strlen(field); for (i=field_length ; i <= length ; i++) putchar(' '); if (!(field=va_arg(args,char *))) @@ -861,10 +863,10 @@ print_row(const char *header,uint head_length,...) static void -print_trailer(uint head_length,...) +print_trailer(size_t head_length,...) { va_list args; - uint length,i; + size_t length,i; va_start(args,head_length); length=head_length; @@ -907,7 +909,7 @@ static void print_res_top(MYSQL_RES *result) mysql_field_seek(result,0); while((field = mysql_fetch_field(result))) { - if ((length=(uint) strlen(field->name)) > field->max_length) + if ((length= strlen(field->name)) > field->max_length) field->max_length=length; else length=field->max_length; diff --git a/client/mysqlslap.c b/client/mysqlslap.c index 29919f3028d..b3229980e77 100644 --- a/client/mysqlslap.c +++ b/client/mysqlslap.c @@ -1,6 +1,6 @@ /* Copyright (c) 2005, 2015, Oracle and/or its affiliates. - Copyright (c) 2010, 2015, MariaDB + Copyright (c) 2010, 2016, MariaDB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/client/mysqltest.cc b/client/mysqltest.cc index afb746cd62f..4ff408bfa9d 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -1,5 +1,5 @@ /* Copyright (c) 2000, 2013, Oracle and/or its affiliates. - Copyright (c) 2009, 2013, Monty Program Ab. + Copyright (c) 2009, 2016, Monty Program Ab. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1027,7 +1027,7 @@ static void init_connection_thd(struct st_connection *cn) cn->has_thread=TRUE; } -#else /*EMBEDDED_LIBRARY*/ +#else /* ! EMBEDDED_LIBRARY*/ #define init_connection_thd(X) do { } while(0) #define do_send_query(cn,q,q_len) mysql_send_query(cn->mysql, q, q_len) @@ -6526,7 +6526,7 @@ int read_line(char *buf, int size) start_lineno)); } - /* Skip all space at begining of line */ + /* Skip all space at beginning of line */ skip_char= 1; } else if (end_of_query(c)) @@ -6538,10 +6538,10 @@ int read_line(char *buf, int size) } else if (c == '}') { - /* A "}" need to be by itself in the begining of a line to terminate */ + /* A "}" need to be by itself in the beginning of a line to terminate */ *p++= c; *p= 0; - DBUG_PRINT("exit", ("Found '}' in begining of a line at line: %d", + DBUG_PRINT("exit", ("Found '}' in beginning of a line at line: %d", cur_file->lineno)); DBUG_RETURN(0); } diff --git a/cmake/check_compiler_flag.cmake b/cmake/check_compiler_flag.cmake index 8192f077344..6b29ac5ab6b 100644 --- a/cmake/check_compiler_flag.cmake +++ b/cmake/check_compiler_flag.cmake @@ -15,7 +15,7 @@ SET(fail_patterns ) MACRO (MY_CHECK_C_COMPILER_FLAG flag) - STRING(REGEX REPLACE "[-,= ]" "_" result "have_C_${flag}") + STRING(REGEX REPLACE "[-,= +]" "_" result "have_C_${flag}") SET(SAVE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}") SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${flag}") CHECK_C_SOURCE_COMPILES("int main(void) { return 0; }" ${result} @@ -24,7 +24,7 @@ MACRO (MY_CHECK_C_COMPILER_FLAG flag) ENDMACRO() MACRO (MY_CHECK_CXX_COMPILER_FLAG flag) - STRING(REGEX REPLACE "[-,= ]" "_" result "have_CXX_${flag}") + STRING(REGEX REPLACE "[-,= +]" "_" result "have_CXX_${flag}") SET(SAVE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}") SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${flag}") CHECK_CXX_SOURCE_COMPILES("int main(void) { return 0; }" ${result} @@ -40,7 +40,7 @@ FUNCTION(MY_CHECK_AND_SET_COMPILER_FLAG flag) ENDIF() MY_CHECK_C_COMPILER_FLAG(${flag}) MY_CHECK_CXX_COMPILER_FLAG(${flag}) - STRING(REGEX REPLACE "[-,= ]" "_" result "${flag}") + STRING(REGEX REPLACE "[-,= +]" "_" result "${flag}") FOREACH(lang C CXX) IF (have_${lang}_${result}) IF(ARGN) diff --git a/cmake/cpu_info.cmake b/cmake/cpu_info.cmake index 32b98142ace..7c2c08a07db 100644 --- a/cmake/cpu_info.cmake +++ b/cmake/cpu_info.cmake @@ -24,7 +24,3 @@ IF(GETCONF) OUTPUT_VARIABLE CPU_LEVEL1_DCACHE_LINESIZE ) ENDIF() -IF(CPU_LEVEL1_DCACHE_LINESIZE AND CPU_LEVEL1_DCACHE_LINESIZE GREATER 0) -ELSE() - SET(CPU_LEVEL1_DCACHE_LINESIZE 64) -ENDIF() diff --git a/cmake/crc32-vpmsum.cmake b/cmake/crc32-vpmsum.cmake new file mode 100644 index 00000000000..c1a2dee56e2 --- /dev/null +++ b/cmake/crc32-vpmsum.cmake @@ -0,0 +1,5 @@ +IF(CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64le") + SET(HAVE_CRC32_VPMSUM 1) + SET(CRC32_VPMSUM_LIBRARY crc32-vpmsum) + ADD_SUBDIRECTORY(extra/crc32-vpmsum) +ENDIF() diff --git a/cmake/os/Windows.cmake b/cmake/os/Windows.cmake index 4c35c688a5d..1395c70e53c 100644 --- a/cmake/os/Windows.cmake +++ b/cmake/os/Windows.cmake @@ -50,7 +50,7 @@ IF(CMAKE_C_COMPILER MATCHES "icl") ENDIF() ADD_DEFINITIONS(-D_WINDOWS -D__WIN__ -D_CRT_SECURE_NO_DEPRECATE) -ADD_DEFINITIONS(-D_WIN32_WINNT=0x0501) +ADD_DEFINITIONS(-D_WIN32_WINNT=0x0600) # We do not want the windows.h macros min/max ADD_DEFINITIONS(-DNOMINMAX) # Speed up build process excluding unused header files diff --git a/cmake/plugin.cmake b/cmake/plugin.cmake index c4edd585a8d..7e9adfd1218 100644 --- a/cmake/plugin.cmake +++ b/cmake/plugin.cmake @@ -209,11 +209,16 @@ MACRO(MYSQL_ADD_PLUGIN) IF(ARG_COMPONENT) IF(CPACK_COMPONENTS_ALL AND NOT CPACK_COMPONENTS_ALL MATCHES ${ARG_COMPONENT}) - + IF (ARG_STORAGE_ENGINE) + SET(ver " = %{version}-%{release}") + ELSE() + SET(ver "") + ENDIF() SET(CPACK_COMPONENTS_ALL ${CPACK_COMPONENTS_ALL} ${ARG_COMPONENT}) - SET(CPACK_COMPONENTS_ALL ${CPACK_COMPONENTS_ALL} PARENT_SCOPE) + SET(CPACK_COMPONENTS_ALL ${CPACK_COMPONENTS_ALL} PARENT_SCOPE) + IF (NOT ARG_CLIENT) - SET(CPACK_RPM_${ARG_COMPONENT}_PACKAGE_REQUIRES "MariaDB" PARENT_SCOPE) + SET(CPACK_RPM_${ARG_COMPONENT}_PACKAGE_REQUIRES "MariaDB${ver}" PARENT_SCOPE) ENDIF() # workarounds for cmake issues #13248 and #12864: SET(CPACK_RPM_${ARG_COMPONENT}_PACKAGE_PROVIDES "cmake_bug_13248" PARENT_SCOPE) diff --git a/cmake/systemd.cmake b/cmake/systemd.cmake index e6094c7c5bc..1121fd64dce 100644 --- a/cmake/systemd.cmake +++ b/cmake/systemd.cmake @@ -55,9 +55,10 @@ MACRO(CHECK_SYSTEMD) IF(HAVE_SYSTEMD AND HAVE_SYSTEMD_SD_DAEMON_H AND HAVE_SYSTEMD_SD_LISTEN_FDS AND HAVE_SYSTEMD_SD_NOTIFY AND HAVE_SYSTEMD_SD_NOTIFYF) ADD_DEFINITIONS(-DHAVE_SYSTEMD) - SET(SYSTEMD_SCRIPTS mariadb-service-convert galera_new_cluster) + SET(SYSTEMD_SCRIPTS mariadb-service-convert galera_new_cluster galera_recovery) SET(SYSTEMD_DEB_FILES "usr/bin/mariadb-service-convert usr/bin/galera_new_cluster + usr/bin/galera_recovery ${INSTALL_SYSTEMD_UNITDIR}/mariadb.service ${INSTALL_SYSTEMD_UNITDIR}/mariadb@.service ${INSTALL_SYSTEMD_UNITDIR}/mariadb@bootstrap.service.d/use_galera_new_cluster.conf") diff --git a/config.h.cmake b/config.h.cmake index f35e33ebe1a..00aa03483ee 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -105,6 +105,8 @@ /* Libraries */ #cmakedefine HAVE_LIBWRAP 1 #cmakedefine HAVE_SYSTEMD 1 +#cmakedefine HAVE_CRC32_VPMSUM 1 + /* Does "struct timespec" have a "sec" and "nsec" field? */ #cmakedefine HAVE_TIMESPEC_TS_SEC 1 diff --git a/debian/autobake-deb.sh b/debian/autobake-deb.sh index 6f4109515e6..b597ec036b3 100755 --- a/debian/autobake-deb.sh +++ b/debian/autobake-deb.sh @@ -10,10 +10,16 @@ set -e # Debug script and command lines #set -x -# Don't run the mysql-test-run test suite as part of build. +# On Buildbot, don't run the mysql-test-run test suite as part of build. # It takes a lot of time, and we will do a better test anyway in # Buildbot, running the test suite from installed .debs on a clean VM. -export DEB_BUILD_OPTIONS="nocheck" +# On Travis-CI we want to simulate the full build, including tests. +# Also on Travis-CI it is useful not to override the DEB_BUILD_OPTIONS +# at this stage at all. +if [[ ! $TRAVIS ]] +then + export DEB_BUILD_OPTIONS="nocheck" +fi export MARIADB_OPTIONAL_DEBS="" @@ -32,8 +38,8 @@ LOGSTRING="MariaDB build" CODENAME="$(lsb_release -sc)" # add libcrack2 (>= 2.9.0) as a build dependency -# but only where the distribution can possibly satisfy it -if apt-cache madison cracklib2|grep 'cracklib2 *| *2\.[0-8]\.' >/dev/null 2>&1 +# but only where the distribution can possibly satisfy it and if not on Travis-CI +if $TRAVIS || apt-cache madison cracklib2|grep 'cracklib2 *| *2\.[0-8]\.' >/dev/null 2>&1 then # Anything in MARIADB_OPTIONAL_DEBS is omitted from the resulting # packages by snipped in rules file diff --git a/debian/control b/debian/control index 35d6c298071..8fa4b6e5a33 100644 --- a/debian/control +++ b/debian/control @@ -316,7 +316,7 @@ Description: MariaDB database regression test suite Package: mariadb-server-10.2 Architecture: any -Suggests: mailx, mariadb-test, netcat-openbsd, socat, tinyca +Suggests: mailx, mariadb-test, netcat-openbsd, tinyca Recommends: libhtml-template-perl Pre-Depends: mariadb-common, adduser (>= 3.40), debconf Depends: bsdutils, @@ -335,6 +335,7 @@ Depends: bsdutils, perl (>= 5.6), psmisc, rsync, + socat, tar, ${misc:Depends}, ${shlibs:Depends} @@ -415,10 +416,10 @@ Description: MariaDB database regression test suite (metapackage for the latest Package: mariadb-connect-engine-10.2 Architecture: any -Depends: libxml2, mariadb-server-10.2, unixODBC +Depends: libxml2, mariadb-server-10.2, unixodbc Build-Depends: libxml2-dev, mariadb-server-10.2, - unixODBC-dev, + unixodbc-dev, ${misc:Depends}, ${shlibs:Depends} Description: Connect storage engine for MariaDB diff --git a/debian/mariadb-server-10.2.mysql.init b/debian/mariadb-server-10.2.mysql.init index d5d0ab4ba93..d250ebd2e9e 100644 --- a/debian/mariadb-server-10.2.mysql.init +++ b/debian/mariadb-server-10.2.mysql.init @@ -25,7 +25,7 @@ SELF=$(cd $(dirname $0); pwd -P)/$(basename $0) CONF=/etc/mysql/my.cnf MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf" -# priority can be overriden and "-s" adds output to stderr +# priority can be overridden and "-s" adds output to stderr ERR_LOGGER="logger -p daemon.err -t /etc/init.d/mysql -i" # Safeguard (relative paths, core dumps..) diff --git a/debian/mariadb-server-10.2.postinst b/debian/mariadb-server-10.2.postinst index 83f5d5e3cd0..0244046c5a3 100644 --- a/debian/mariadb-server-10.2.postinst +++ b/debian/mariadb-server-10.2.postinst @@ -239,7 +239,7 @@ db_stop # in case invoke failes # dh_systemd_start doesn't emit anything since we still ship /etc/init.d/mysql. # Thus MariaDB server is started via init.d script, which in turn redirects to # systemctl. If we upgrade from MySQL mysql.service may be masked, which also -# means init.d script is disabled. Unmask mysql service explicitely. +# means init.d script is disabled. Unmask mysql service explicitly. # Check first that the command exists, to avoid emitting any warning messages. if [ -x "$(command -v deb-systemd-helper)" ]; then deb-systemd-helper unmask mysql.service > /dev/null diff --git a/debian/mariadb-test-10.2.dirs b/debian/mariadb-test-10.2.dirs index 1a488d98195..b21c5b780f7 100644 --- a/debian/mariadb-test-10.2.dirs +++ b/debian/mariadb-test-10.2.dirs @@ -44,8 +44,6 @@ usr/share/mysql/mysql-test/suite/jp/r usr/share/mysql/mysql-test/suite/jp/include usr/share/mysql/mysql-test/suite/jp/std_data usr/share/mysql/mysql-test/suite/maria -usr/share/mysql/mysql-test/suite/maria/t -usr/share/mysql/mysql-test/suite/maria/r usr/share/mysql/mysql-test/suite/funcs_2 usr/share/mysql/mysql-test/suite/funcs_2/lib usr/share/mysql/mysql-test/suite/funcs_2/t diff --git a/debian/rules b/debian/rules index 7f134af24a8..2591e0070a4 100755 --- a/debian/rules +++ b/debian/rules @@ -29,20 +29,15 @@ ifeq (${MAKE_J}, -j0) MAKE_J = -j1 endif -MAKE_TEST_TARGET=test-force -ifneq ($(findstring fulltest,$(DEB_BUILD_OPTIONS)),) -# make test-bt is the testsuite run by the MySQL build team -# before a release, but it is long - MAKE_TEST_TARGET=test-bt +# Parallel build support as advised +# at https://www.debian.org/doc/debian-policy/ch-source.html#s-debianrules-options +ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) + NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) + MAKEFLAGS += -j $(NUMJOBS) endif -USE_ASSEMBLER=--enable-assembler -ifneq (,$(filter $(ARCH), amd64 i386 ia64 s390)) - TESTSUITE_FAIL_CMD=exit 1 -else - TESTSUITE_FAIL_CMD=true -endif +USE_ASSEMBLER=--enable-assembler BUILDDIR = builddir builddir = $(BUILDDIR) @@ -88,7 +83,7 @@ build-stamp: configure ifeq ($(findstring nocheck,$(DEB_BUILD_OPTIONS)),) if [ ! -f testsuite-stamp ] ; then \ - cd $(builddir) && $(MAKE) $(MAKE_TEST_TARGET) || $(TESTSUITE_FAIL_CMD) ; \ + cd $(builddir)/mysql-test && ./mtr --force --parallel=$(NUMJOBS) --skip-rpl --suite=main; \ fi endif diff --git a/extra/CMakeLists.txt b/extra/CMakeLists.txt index 24090db6135..9c8d82d8537 100644 --- a/extra/CMakeLists.txt +++ b/extra/CMakeLists.txt @@ -80,13 +80,6 @@ IF(WITH_INNOBASE_STORAGE_ENGINE OR WITH_XTRADB_STORAGE_ENGINE) ../storage/innobase/page/page0zip.cc ) - IF(CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64le") - enable_language(ASM) - LIST(APPEND INNOBASE_SOURCES - ../storage/innobase/ut/crc32_power8/crc32.S - ../storage/innobase/ut/crc32_power8/crc32_wrapper.c - ) - ENDIF() MYSQL_ADD_EXECUTABLE(innochecksum innochecksum.cc ${INNOBASE_SOURCES}) TARGET_LINK_LIBRARIES(innochecksum mysys mysys_ssl) diff --git a/extra/comp_err.c b/extra/comp_err.c index 2bab6b60be7..a5530305317 100644 --- a/extra/comp_err.c +++ b/extra/comp_err.c @@ -327,7 +327,8 @@ static int create_sys_files(struct languages *lang_head, uint error_count) { FILE *to; - uint csnum= 0, length, i, row_nr; + uint csnum= 0, i, row_nr; + ulong length; uchar head[HEADER_LENGTH]; char outfile[FN_REFLEN], *outfile_end; long start_pos; @@ -397,8 +398,8 @@ static int create_sys_files(struct languages *lang_head, DBUG_ASSERT(error_count == row_nr); /* continue with header of the errmsg.sys file */ - length= (my_ftell(to, MYF(0)) - HEADER_LENGTH - - (error_count + section_count) * 2); + length= (ulong) (my_ftell(to, MYF(0)) - HEADER_LENGTH - + (error_count + section_count) * 2); bzero((uchar*) head, HEADER_LENGTH); bmove((uchar*) head, (uchar*) file_head, 4); head[4]= 1; diff --git a/extra/crc32-vpmsum/CMakeLists.txt b/extra/crc32-vpmsum/CMakeLists.txt new file mode 100644 index 00000000000..0bb254bea6a --- /dev/null +++ b/extra/crc32-vpmsum/CMakeLists.txt @@ -0,0 +1,2 @@ +ENABLE_LANGUAGE(ASM) +ADD_CONVENIENCE_LIBRARY(${CRC32_VPMSUM_LIBRARY} crc32c.S crc32c_wrapper.c crc32ieee.S crc32ieee_wrapper.c) diff --git a/storage/innobase/ut/crc32_power8/crc32.S b/extra/crc32-vpmsum/crc32.iS similarity index 91% rename from storage/innobase/ut/crc32_power8/crc32.S rename to extra/crc32-vpmsum/crc32.iS index b064ce3dc96..4e7c18922da 100644 --- a/storage/innobase/ut/crc32_power8/crc32.S +++ b/extra/crc32-vpmsum/crc32.iS @@ -46,19 +46,8 @@ /* byte reverse permute constant */ .octa 0x0F0E0D0C0B0A09080706050403020100 -#define __ASSEMBLY__ -#include "crc32_constants.h" - .text -#if defined(__BIG_ENDIAN__) && defined(REFLECT) -#define BYTESWAP_DATA -#elif defined(__LITTLE_ENDIAN__) && !defined(REFLECT) -#define BYTESWAP_DATA -#else -#undef BYTESWAP_DATA -#endif - #define off16 r25 #define off32 r26 #define off48 r27 @@ -82,7 +71,7 @@ #endif /* unsigned int __crc32_vpmsum(unsigned int crc, void *p, unsigned long len) */ -FUNC_START(__crc32_vpmsum) +FUNC_START(__F) std r31,-8(r1) std r30,-16(r1) std r29,-24(r1) @@ -126,19 +115,14 @@ FUNC_START(__crc32_vpmsum) /* Get the initial value into v8 */ vxor v8,v8,v8 MTVRD(v8, r3) -#ifdef REFLECT - vsldoi v8,zeroes,v8,8 /* shift into bottom 32 bits */ -#else - vsldoi v8,v8,zeroes,4 /* shift into top 32 bits */ -#endif -#ifdef BYTESWAP_DATA + vsldoi v8,zeroes,v8,8 /* shift into bottom 32 bits */ + addis r3,r2,.byteswap_constant@toc@ha addi r3,r3,.byteswap_constant@toc@l lvx byteswap,0,r3 addi r3,r3,16 -#endif cmpdi r5,256 blt .Lshort @@ -170,8 +154,8 @@ FUNC_START(__crc32_vpmsum) addi r7,r7,-1 mtctr r7 - addis r3,r2,.constants@toc@ha - addi r3,r3,.constants@toc@l + addis r3,r2,CONSTANTS@toc@ha + addi r3,r3,CONSTANTS@toc@l /* Find the start of our constants */ add r3,r3,r8 @@ -376,7 +360,6 @@ FUNC_START(__crc32_vpmsum) vxor v6,v6,v14 vxor v7,v7,v15 -#ifdef REFLECT /* * vpmsumd produces a 96 bit result in the least significant bits * of the register. Since we are bit reflected we have to shift it @@ -391,7 +374,6 @@ FUNC_START(__crc32_vpmsum) vsldoi v5,v5,zeroes,4 vsldoi v6,v6,zeroes,4 vsldoi v7,v7,zeroes,4 -#endif /* xor with last 1024 bits */ lvx v8,0,r4 @@ -526,8 +508,8 @@ FUNC_START(__crc32_vpmsum) .Lbarrett_reduction: /* Barrett constants */ - addis r3,r2,.barrett_constants@toc@ha - addi r3,r3,.barrett_constants@toc@l + addis r3,r2,BARRETT_CONSTANTS@toc@ha + addi r3,r3,BARRETT_CONSTANTS@toc@l lvx const1,0,r3 lvx const2,off16,r3 @@ -535,33 +517,12 @@ FUNC_START(__crc32_vpmsum) vsldoi v1,v0,v0,8 vxor v0,v0,v1 /* xor two 64 bit results together */ -#ifdef REFLECT /* shift left one bit */ vspltisb v1,1 vsl v0,v0,v1 -#endif vand v0,v0,mask_64bit -#ifndef REFLECT - /* - * Now for the Barrett reduction algorithm. The idea is to calculate q, - * the multiple of our polynomial that we need to subtract. By - * doing the computation 2x bits higher (ie 64 bits) and shifting the - * result back down 2x bits, we round down to the nearest multiple. - */ - VPMSUMD(v1,v0,const1) /* ma */ - vsldoi v1,zeroes,v1,8 /* q = floor(ma/(2^64)) */ - VPMSUMD(v1,v1,const2) /* qn */ - vxor v0,v0,v1 /* a - qn, subtraction is xor in GF(2) */ - - /* - * Get the result into r3. We need to shift it left 8 bytes: - * V0 [ 0 1 2 X ] - * V0 [ 0 X 2 3 ] - */ - vsldoi v0,v0,zeroes,8 /* shift result into top 64 bits */ -#else /* * The reflected version of Barrett reduction. Instead of bit * reflecting our data (which is expensive to do), we bit reflect our @@ -582,7 +543,6 @@ FUNC_START(__crc32_vpmsum) * V0 [ 0 X 2 3 ] */ vsldoi v0,v0,zeroes,4 /* shift result into top 64 bits of */ -#endif .Lout: subi r6,r1,56+10*16 @@ -631,8 +591,8 @@ FUNC_START(__crc32_vpmsum) cmpdi r5,0 beq .Lzero - addis r3,r2,.short_constants@toc@ha - addi r3,r3,.short_constants@toc@l + addis r3,r2,SHORT_CONSTANTS@toc@ha + addi r3,r3,SHORT_CONSTANTS@toc@l /* Calculate where in the constant table we need to start */ subfic r6,r5,256 @@ -767,9 +727,8 @@ FUNC_START(__crc32_vpmsum) .Lzero: mr r3,r10 - blr b .Lout -FUNC_END(__crc32_vpmsum) +FUNC_END(__F) #endif /* __powerpc__ */ diff --git a/storage/innobase/ut/crc32_power8/crc32_wrapper.c b/extra/crc32-vpmsum/crc32_wrapper.ic similarity index 64% rename from storage/innobase/ut/crc32_power8/crc32_wrapper.c rename to extra/crc32-vpmsum/crc32_wrapper.ic index d4c91371fa1..750e971f83e 100644 --- a/storage/innobase/ut/crc32_power8/crc32_wrapper.c +++ b/extra/crc32-vpmsum/crc32_wrapper.ic @@ -1,12 +1,9 @@ #ifdef __powerpc__ -#define CRC_TABLE -#include "crc32_constants.h" #define VMX_ALIGN 16 #define VMX_ALIGN_MASK (VMX_ALIGN-1) -#ifdef REFLECT static unsigned int crc32_align(unsigned int crc, unsigned char *p, unsigned long len) { @@ -14,28 +11,17 @@ static unsigned int crc32_align(unsigned int crc, unsigned char *p, crc = crc_table[(crc ^ *p++) & 0xff] ^ (crc >> 8); return crc; } -#else -static unsigned int crc32_align(unsigned int crc, unsigned char *p, - unsigned long len) -{ - while (len--) - crc = crc_table[((crc >> 24) ^ *p++) & 0xff] ^ (crc << 8); - return crc; -} -#endif -unsigned int __crc32_vpmsum(unsigned int crc, unsigned char *p, +unsigned int __F(unsigned int crc, unsigned char *p, unsigned long len); -unsigned int crc32_vpmsum(unsigned int crc, unsigned char *p, +unsigned int F(unsigned int crc, unsigned char *p, unsigned long len) { unsigned int prealign; unsigned int tail; -#ifdef CRC_XOR crc ^= 0xffffffff; -#endif if (len < VMX_ALIGN + VMX_ALIGN_MASK) { crc = crc32_align(crc, p, len); @@ -49,7 +35,7 @@ unsigned int crc32_vpmsum(unsigned int crc, unsigned char *p, p += prealign; } - crc = __crc32_vpmsum(crc, p, len & ~VMX_ALIGN_MASK); + crc = __F(crc, p, len & ~VMX_ALIGN_MASK); tail = len & VMX_ALIGN_MASK; if (tail) { @@ -58,9 +44,7 @@ unsigned int crc32_vpmsum(unsigned int crc, unsigned char *p, } out: -#ifdef CRC_XOR crc ^= 0xffffffff; -#endif return crc; } diff --git a/extra/crc32-vpmsum/crc32c.S b/extra/crc32-vpmsum/crc32c.S new file mode 100644 index 00000000000..390c4bf0660 --- /dev/null +++ b/extra/crc32-vpmsum/crc32c.S @@ -0,0 +1,14 @@ +#ifdef __powerpc__ + +#define CONSTANTS .crc32c_constants +#define SHORT_CONSTANTS .crc32c_short_constants +#define BARRETT_CONSTANTS .crc32c_barrett_constants + +#include "crc32c_constants.h" + +#define __F __crc32c_vpmsum + +#include "crc32.iS" + +#endif + diff --git a/storage/innobase/ut/crc32_power8/crc32_constants.h b/extra/crc32-vpmsum/crc32c_constants.h similarity index 89% rename from storage/innobase/ut/crc32_power8/crc32_constants.h rename to extra/crc32-vpmsum/crc32c_constants.h index ba2592b829c..555b785ce9f 100644 --- a/storage/innobase/ut/crc32_power8/crc32_constants.h +++ b/extra/crc32-vpmsum/crc32c_constants.h @@ -3,83 +3,10 @@ #ifdef __powerpc__ - #define CRC 0x1edc6f41 -#define CRC_XOR -#define REFLECT -#ifndef __ASSEMBLY__ -#ifdef CRC_TABLE -static const unsigned int crc_table[] = { - 0x00000000, 0xf26b8303, 0xe13b70f7, 0x1350f3f4, - 0xc79a971f, 0x35f1141c, 0x26a1e7e8, 0xd4ca64eb, - 0x8ad958cf, 0x78b2dbcc, 0x6be22838, 0x9989ab3b, - 0x4d43cfd0, 0xbf284cd3, 0xac78bf27, 0x5e133c24, - 0x105ec76f, 0xe235446c, 0xf165b798, 0x030e349b, - 0xd7c45070, 0x25afd373, 0x36ff2087, 0xc494a384, - 0x9a879fa0, 0x68ec1ca3, 0x7bbcef57, 0x89d76c54, - 0x5d1d08bf, 0xaf768bbc, 0xbc267848, 0x4e4dfb4b, - 0x20bd8ede, 0xd2d60ddd, 0xc186fe29, 0x33ed7d2a, - 0xe72719c1, 0x154c9ac2, 0x061c6936, 0xf477ea35, - 0xaa64d611, 0x580f5512, 0x4b5fa6e6, 0xb93425e5, - 0x6dfe410e, 0x9f95c20d, 0x8cc531f9, 0x7eaeb2fa, - 0x30e349b1, 0xc288cab2, 0xd1d83946, 0x23b3ba45, - 0xf779deae, 0x05125dad, 0x1642ae59, 0xe4292d5a, - 0xba3a117e, 0x4851927d, 0x5b016189, 0xa96ae28a, - 0x7da08661, 0x8fcb0562, 0x9c9bf696, 0x6ef07595, - 0x417b1dbc, 0xb3109ebf, 0xa0406d4b, 0x522bee48, - 0x86e18aa3, 0x748a09a0, 0x67dafa54, 0x95b17957, - 0xcba24573, 0x39c9c670, 0x2a993584, 0xd8f2b687, - 0x0c38d26c, 0xfe53516f, 0xed03a29b, 0x1f682198, - 0x5125dad3, 0xa34e59d0, 0xb01eaa24, 0x42752927, - 0x96bf4dcc, 0x64d4cecf, 0x77843d3b, 0x85efbe38, - 0xdbfc821c, 0x2997011f, 0x3ac7f2eb, 0xc8ac71e8, - 0x1c661503, 0xee0d9600, 0xfd5d65f4, 0x0f36e6f7, - 0x61c69362, 0x93ad1061, 0x80fde395, 0x72966096, - 0xa65c047d, 0x5437877e, 0x4767748a, 0xb50cf789, - 0xeb1fcbad, 0x197448ae, 0x0a24bb5a, 0xf84f3859, - 0x2c855cb2, 0xdeeedfb1, 0xcdbe2c45, 0x3fd5af46, - 0x7198540d, 0x83f3d70e, 0x90a324fa, 0x62c8a7f9, - 0xb602c312, 0x44694011, 0x5739b3e5, 0xa55230e6, - 0xfb410cc2, 0x092a8fc1, 0x1a7a7c35, 0xe811ff36, - 0x3cdb9bdd, 0xceb018de, 0xdde0eb2a, 0x2f8b6829, - 0x82f63b78, 0x709db87b, 0x63cd4b8f, 0x91a6c88c, - 0x456cac67, 0xb7072f64, 0xa457dc90, 0x563c5f93, - 0x082f63b7, 0xfa44e0b4, 0xe9141340, 0x1b7f9043, - 0xcfb5f4a8, 0x3dde77ab, 0x2e8e845f, 0xdce5075c, - 0x92a8fc17, 0x60c37f14, 0x73938ce0, 0x81f80fe3, - 0x55326b08, 0xa759e80b, 0xb4091bff, 0x466298fc, - 0x1871a4d8, 0xea1a27db, 0xf94ad42f, 0x0b21572c, - 0xdfeb33c7, 0x2d80b0c4, 0x3ed04330, 0xccbbc033, - 0xa24bb5a6, 0x502036a5, 0x4370c551, 0xb11b4652, - 0x65d122b9, 0x97baa1ba, 0x84ea524e, 0x7681d14d, - 0x2892ed69, 0xdaf96e6a, 0xc9a99d9e, 0x3bc21e9d, - 0xef087a76, 0x1d63f975, 0x0e330a81, 0xfc588982, - 0xb21572c9, 0x407ef1ca, 0x532e023e, 0xa145813d, - 0x758fe5d6, 0x87e466d5, 0x94b49521, 0x66df1622, - 0x38cc2a06, 0xcaa7a905, 0xd9f75af1, 0x2b9cd9f2, - 0xff56bd19, 0x0d3d3e1a, 0x1e6dcdee, 0xec064eed, - 0xc38d26c4, 0x31e6a5c7, 0x22b65633, 0xd0ddd530, - 0x0417b1db, 0xf67c32d8, 0xe52cc12c, 0x1747422f, - 0x49547e0b, 0xbb3ffd08, 0xa86f0efc, 0x5a048dff, - 0x8ecee914, 0x7ca56a17, 0x6ff599e3, 0x9d9e1ae0, - 0xd3d3e1ab, 0x21b862a8, 0x32e8915c, 0xc083125f, - 0x144976b4, 0xe622f5b7, 0xf5720643, 0x07198540, - 0x590ab964, 0xab613a67, 0xb831c993, 0x4a5a4a90, - 0x9e902e7b, 0x6cfbad78, 0x7fab5e8c, 0x8dc0dd8f, - 0xe330a81a, 0x115b2b19, 0x020bd8ed, 0xf0605bee, - 0x24aa3f05, 0xd6c1bc06, 0xc5914ff2, 0x37faccf1, - 0x69e9f0d5, 0x9b8273d6, 0x88d28022, 0x7ab90321, - 0xae7367ca, 0x5c18e4c9, 0x4f48173d, 0xbd23943e, - 0xf36e6f75, 0x0105ec76, 0x12551f82, 0xe03e9c81, - 0x34f4f86a, 0xc69f7b69, 0xd5cf889d, 0x27a40b9e, - 0x79b737ba, 0x8bdcb4b9, 0x988c474d, 0x6ae7c44e, - 0xbe2da0a5, 0x4c4623a6, 0x5f16d052, 0xad7d5351,}; - -#endif -#else #define MAX_SIZE 32768 -.constants: +CONSTANTS: /* Reduce 262144 kbits to 1024 bits */ /* x^261120 mod p(x)` << 1, x^261184 mod p(x)` << 1 */ @@ -847,7 +774,7 @@ static const unsigned int crc_table[] = { /* x^1024 mod p(x)` << 1, x^1088 mod p(x)` << 1 */ .octa 0x0000000171fb63ce00000001609bc4b4 -.short_constants: +SHORT_CONSTANTS: /* Reduce final 1024-2048 bits to 64 bits, shifting 32 bits to include the trailing 32 bits of zeros */ /* x^1952 mod p(x)`, x^1984 mod p(x)`, x^2016 mod p(x)`, x^2048 mod p(x)` */ @@ -899,12 +826,11 @@ static const unsigned int crc_table[] = { .octa 0x82f63b786ea2d55ca66805eb18b8ea18 -.barrett_constants: +BARRETT_CONSTANTS: /* 33 bit reflected Barrett constant m - (4^32)/n */ .octa 0x000000000000000000000000dea713f1 /* x^64 div p(x)` */ /* 33 bit reflected Barrett constant n */ .octa 0x00000000000000000000000105ec76f1 -#endif #endif /* __powerpc__ */ diff --git a/extra/crc32-vpmsum/crc32c_wrapper.c b/extra/crc32-vpmsum/crc32c_wrapper.c new file mode 100644 index 00000000000..b121d3e8c41 --- /dev/null +++ b/extra/crc32-vpmsum/crc32c_wrapper.c @@ -0,0 +1,78 @@ +#ifdef __powerpc__ + +#define F crc32c_vpmsum +#define __F __crc32c_vpmsum + +#define CRC 0x1edc6f41 + +static const unsigned int crc_table[] = { + 0x00000000, 0xf26b8303, 0xe13b70f7, 0x1350f3f4, + 0xc79a971f, 0x35f1141c, 0x26a1e7e8, 0xd4ca64eb, + 0x8ad958cf, 0x78b2dbcc, 0x6be22838, 0x9989ab3b, + 0x4d43cfd0, 0xbf284cd3, 0xac78bf27, 0x5e133c24, + 0x105ec76f, 0xe235446c, 0xf165b798, 0x030e349b, + 0xd7c45070, 0x25afd373, 0x36ff2087, 0xc494a384, + 0x9a879fa0, 0x68ec1ca3, 0x7bbcef57, 0x89d76c54, + 0x5d1d08bf, 0xaf768bbc, 0xbc267848, 0x4e4dfb4b, + 0x20bd8ede, 0xd2d60ddd, 0xc186fe29, 0x33ed7d2a, + 0xe72719c1, 0x154c9ac2, 0x061c6936, 0xf477ea35, + 0xaa64d611, 0x580f5512, 0x4b5fa6e6, 0xb93425e5, + 0x6dfe410e, 0x9f95c20d, 0x8cc531f9, 0x7eaeb2fa, + 0x30e349b1, 0xc288cab2, 0xd1d83946, 0x23b3ba45, + 0xf779deae, 0x05125dad, 0x1642ae59, 0xe4292d5a, + 0xba3a117e, 0x4851927d, 0x5b016189, 0xa96ae28a, + 0x7da08661, 0x8fcb0562, 0x9c9bf696, 0x6ef07595, + 0x417b1dbc, 0xb3109ebf, 0xa0406d4b, 0x522bee48, + 0x86e18aa3, 0x748a09a0, 0x67dafa54, 0x95b17957, + 0xcba24573, 0x39c9c670, 0x2a993584, 0xd8f2b687, + 0x0c38d26c, 0xfe53516f, 0xed03a29b, 0x1f682198, + 0x5125dad3, 0xa34e59d0, 0xb01eaa24, 0x42752927, + 0x96bf4dcc, 0x64d4cecf, 0x77843d3b, 0x85efbe38, + 0xdbfc821c, 0x2997011f, 0x3ac7f2eb, 0xc8ac71e8, + 0x1c661503, 0xee0d9600, 0xfd5d65f4, 0x0f36e6f7, + 0x61c69362, 0x93ad1061, 0x80fde395, 0x72966096, + 0xa65c047d, 0x5437877e, 0x4767748a, 0xb50cf789, + 0xeb1fcbad, 0x197448ae, 0x0a24bb5a, 0xf84f3859, + 0x2c855cb2, 0xdeeedfb1, 0xcdbe2c45, 0x3fd5af46, + 0x7198540d, 0x83f3d70e, 0x90a324fa, 0x62c8a7f9, + 0xb602c312, 0x44694011, 0x5739b3e5, 0xa55230e6, + 0xfb410cc2, 0x092a8fc1, 0x1a7a7c35, 0xe811ff36, + 0x3cdb9bdd, 0xceb018de, 0xdde0eb2a, 0x2f8b6829, + 0x82f63b78, 0x709db87b, 0x63cd4b8f, 0x91a6c88c, + 0x456cac67, 0xb7072f64, 0xa457dc90, 0x563c5f93, + 0x082f63b7, 0xfa44e0b4, 0xe9141340, 0x1b7f9043, + 0xcfb5f4a8, 0x3dde77ab, 0x2e8e845f, 0xdce5075c, + 0x92a8fc17, 0x60c37f14, 0x73938ce0, 0x81f80fe3, + 0x55326b08, 0xa759e80b, 0xb4091bff, 0x466298fc, + 0x1871a4d8, 0xea1a27db, 0xf94ad42f, 0x0b21572c, + 0xdfeb33c7, 0x2d80b0c4, 0x3ed04330, 0xccbbc033, + 0xa24bb5a6, 0x502036a5, 0x4370c551, 0xb11b4652, + 0x65d122b9, 0x97baa1ba, 0x84ea524e, 0x7681d14d, + 0x2892ed69, 0xdaf96e6a, 0xc9a99d9e, 0x3bc21e9d, + 0xef087a76, 0x1d63f975, 0x0e330a81, 0xfc588982, + 0xb21572c9, 0x407ef1ca, 0x532e023e, 0xa145813d, + 0x758fe5d6, 0x87e466d5, 0x94b49521, 0x66df1622, + 0x38cc2a06, 0xcaa7a905, 0xd9f75af1, 0x2b9cd9f2, + 0xff56bd19, 0x0d3d3e1a, 0x1e6dcdee, 0xec064eed, + 0xc38d26c4, 0x31e6a5c7, 0x22b65633, 0xd0ddd530, + 0x0417b1db, 0xf67c32d8, 0xe52cc12c, 0x1747422f, + 0x49547e0b, 0xbb3ffd08, 0xa86f0efc, 0x5a048dff, + 0x8ecee914, 0x7ca56a17, 0x6ff599e3, 0x9d9e1ae0, + 0xd3d3e1ab, 0x21b862a8, 0x32e8915c, 0xc083125f, + 0x144976b4, 0xe622f5b7, 0xf5720643, 0x07198540, + 0x590ab964, 0xab613a67, 0xb831c993, 0x4a5a4a90, + 0x9e902e7b, 0x6cfbad78, 0x7fab5e8c, 0x8dc0dd8f, + 0xe330a81a, 0x115b2b19, 0x020bd8ed, 0xf0605bee, + 0x24aa3f05, 0xd6c1bc06, 0xc5914ff2, 0x37faccf1, + 0x69e9f0d5, 0x9b8273d6, 0x88d28022, 0x7ab90321, + 0xae7367ca, 0x5c18e4c9, 0x4f48173d, 0xbd23943e, + 0xf36e6f75, 0x0105ec76, 0x12551f82, 0xe03e9c81, + 0x34f4f86a, 0xc69f7b69, 0xd5cf889d, 0x27a40b9e, + 0x79b737ba, 0x8bdcb4b9, 0x988c474d, 0x6ae7c44e, + 0xbe2da0a5, 0x4c4623a6, 0x5f16d052, 0xad7d5351,}; + + +#include "crc32_wrapper.ic" + +#endif + diff --git a/extra/crc32-vpmsum/crc32ieee.S b/extra/crc32-vpmsum/crc32ieee.S new file mode 100644 index 00000000000..42c4f77630f --- /dev/null +++ b/extra/crc32-vpmsum/crc32ieee.S @@ -0,0 +1,14 @@ +#ifdef __powerpc__ + +#define CONSTANTS .crc32_constants +#define SHORT_CONSTANTS .crc32_short_constants +#define BARRETT_CONSTANTS .crc32_barrett_constants + +#include "crc32ieee_constants.h" + +#define __F __crc32ieee_vpmsum + +#include "crc32.iS" + +#endif + diff --git a/extra/crc32-vpmsum/crc32ieee_constants.h b/extra/crc32-vpmsum/crc32ieee_constants.h new file mode 100644 index 00000000000..a99b1c0d859 --- /dev/null +++ b/extra/crc32-vpmsum/crc32ieee_constants.h @@ -0,0 +1,835 @@ +#ifndef CRC32_CONSTANTS_H +#define CRC32_CONSTANTS_H + +#ifdef __powerpc__ + +#define MAX_SIZE 32768 +CONSTANTS: + + /* Reduce 262144 kbits to 1024 bits */ + /* x^261120 mod p(x)` << 1, x^261184 mod p(x)` << 1 */ + .octa 0x00000001651797d20000000099ea94a8 + + /* x^260096 mod p(x)` << 1, x^260160 mod p(x)` << 1 */ + .octa 0x0000000021e0d56c00000000945a8420 + + /* x^259072 mod p(x)` << 1, x^259136 mod p(x)` << 1 */ + .octa 0x000000000f95ecaa0000000030762706 + + /* x^258048 mod p(x)` << 1, x^258112 mod p(x)` << 1 */ + .octa 0x00000001ebd224ac00000001a52fc582 + + /* x^257024 mod p(x)` << 1, x^257088 mod p(x)` << 1 */ + .octa 0x000000000ccb97ca00000001a4a7167a + + /* x^256000 mod p(x)` << 1, x^256064 mod p(x)` << 1 */ + .octa 0x00000001006ec8a8000000000c18249a + + /* x^254976 mod p(x)` << 1, x^255040 mod p(x)` << 1 */ + .octa 0x000000014f58f19600000000a924ae7c + + /* x^253952 mod p(x)` << 1, x^254016 mod p(x)` << 1 */ + .octa 0x00000001a7192ca600000001e12ccc12 + + /* x^252928 mod p(x)` << 1, x^252992 mod p(x)` << 1 */ + .octa 0x000000019a64bab200000000a0b9d4ac + + /* x^251904 mod p(x)` << 1, x^251968 mod p(x)` << 1 */ + .octa 0x0000000014f4ed2e0000000095e8ddfe + + /* x^250880 mod p(x)` << 1, x^250944 mod p(x)` << 1 */ + .octa 0x000000011092b6a200000000233fddc4 + + /* x^249856 mod p(x)` << 1, x^249920 mod p(x)` << 1 */ + .octa 0x00000000c8a1629c00000001b4529b62 + + /* x^248832 mod p(x)` << 1, x^248896 mod p(x)` << 1 */ + .octa 0x000000017bf32e8e00000001a7fa0e64 + + /* x^247808 mod p(x)` << 1, x^247872 mod p(x)` << 1 */ + .octa 0x00000001f8cc658200000001b5334592 + + /* x^246784 mod p(x)` << 1, x^246848 mod p(x)` << 1 */ + .octa 0x000000008631ddf0000000011f8ee1b4 + + /* x^245760 mod p(x)` << 1, x^245824 mod p(x)` << 1 */ + .octa 0x000000007e5a76d0000000006252e632 + + /* x^244736 mod p(x)` << 1, x^244800 mod p(x)` << 1 */ + .octa 0x000000002b09b31c00000000ab973e84 + + /* x^243712 mod p(x)` << 1, x^243776 mod p(x)` << 1 */ + .octa 0x00000001b2df1f84000000007734f5ec + + /* x^242688 mod p(x)` << 1, x^242752 mod p(x)` << 1 */ + .octa 0x00000001d6f56afc000000007c547798 + + /* x^241664 mod p(x)` << 1, x^241728 mod p(x)` << 1 */ + .octa 0x00000001b9b5e70c000000007ec40210 + + /* x^240640 mod p(x)` << 1, x^240704 mod p(x)` << 1 */ + .octa 0x0000000034b626d200000001ab1695a8 + + /* x^239616 mod p(x)` << 1, x^239680 mod p(x)` << 1 */ + .octa 0x000000014c53479a0000000090494bba + + /* x^238592 mod p(x)` << 1, x^238656 mod p(x)` << 1 */ + .octa 0x00000001a6d179a400000001123fb816 + + /* x^237568 mod p(x)` << 1, x^237632 mod p(x)` << 1 */ + .octa 0x000000015abd16b400000001e188c74c + + /* x^236544 mod p(x)` << 1, x^236608 mod p(x)` << 1 */ + .octa 0x00000000018f985200000001c2d3451c + + /* x^235520 mod p(x)` << 1, x^235584 mod p(x)` << 1 */ + .octa 0x000000001fb3084a00000000f55cf1ca + + /* x^234496 mod p(x)` << 1, x^234560 mod p(x)` << 1 */ + .octa 0x00000000c53dfb0400000001a0531540 + + /* x^233472 mod p(x)` << 1, x^233536 mod p(x)` << 1 */ + .octa 0x00000000e10c9ad60000000132cd7ebc + + /* x^232448 mod p(x)` << 1, x^232512 mod p(x)` << 1 */ + .octa 0x0000000025aa994a0000000073ab7f36 + + /* x^231424 mod p(x)` << 1, x^231488 mod p(x)` << 1 */ + .octa 0x00000000fa3a74c40000000041aed1c2 + + /* x^230400 mod p(x)` << 1, x^230464 mod p(x)` << 1 */ + .octa 0x0000000033eb3f400000000136c53800 + + /* x^229376 mod p(x)` << 1, x^229440 mod p(x)` << 1 */ + .octa 0x000000017193f2960000000126835a30 + + /* x^228352 mod p(x)` << 1, x^228416 mod p(x)` << 1 */ + .octa 0x0000000043f6c86a000000006241b502 + + /* x^227328 mod p(x)` << 1, x^227392 mod p(x)` << 1 */ + .octa 0x000000016b513ec600000000d5196ad4 + + /* x^226304 mod p(x)` << 1, x^226368 mod p(x)` << 1 */ + .octa 0x00000000c8f25b4e000000009cfa769a + + /* x^225280 mod p(x)` << 1, x^225344 mod p(x)` << 1 */ + .octa 0x00000001a45048ec00000000920e5df4 + + /* x^224256 mod p(x)` << 1, x^224320 mod p(x)` << 1 */ + .octa 0x000000000c4410040000000169dc310e + + /* x^223232 mod p(x)` << 1, x^223296 mod p(x)` << 1 */ + .octa 0x000000000e17cad60000000009fc331c + + /* x^222208 mod p(x)` << 1, x^222272 mod p(x)` << 1 */ + .octa 0x00000001253ae964000000010d94a81e + + /* x^221184 mod p(x)` << 1, x^221248 mod p(x)` << 1 */ + .octa 0x00000001d7c88ebc0000000027a20ab2 + + /* x^220160 mod p(x)` << 1, x^220224 mod p(x)` << 1 */ + .octa 0x00000001e7ca913a0000000114f87504 + + /* x^219136 mod p(x)` << 1, x^219200 mod p(x)` << 1 */ + .octa 0x0000000033ed078a000000004b076d96 + + /* x^218112 mod p(x)` << 1, x^218176 mod p(x)` << 1 */ + .octa 0x00000000e1839c7800000000da4d1e74 + + /* x^217088 mod p(x)` << 1, x^217152 mod p(x)` << 1 */ + .octa 0x00000001322b267e000000001b81f672 + + /* x^216064 mod p(x)` << 1, x^216128 mod p(x)` << 1 */ + .octa 0x00000000638231b6000000009367c988 + + /* x^215040 mod p(x)` << 1, x^215104 mod p(x)` << 1 */ + .octa 0x00000001ee7f16f400000001717214ca + + /* x^214016 mod p(x)` << 1, x^214080 mod p(x)` << 1 */ + .octa 0x0000000117d9924a000000009f47d820 + + /* x^212992 mod p(x)` << 1, x^213056 mod p(x)` << 1 */ + .octa 0x00000000e1a9e0c4000000010d9a47d2 + + /* x^211968 mod p(x)` << 1, x^212032 mod p(x)` << 1 */ + .octa 0x00000001403731dc00000000a696c58c + + /* x^210944 mod p(x)` << 1, x^211008 mod p(x)` << 1 */ + .octa 0x00000001a5ea9682000000002aa28ec6 + + /* x^209920 mod p(x)` << 1, x^209984 mod p(x)` << 1 */ + .octa 0x0000000101c5c57800000001fe18fd9a + + /* x^208896 mod p(x)` << 1, x^208960 mod p(x)` << 1 */ + .octa 0x00000000dddf6494000000019d4fc1ae + + /* x^207872 mod p(x)` << 1, x^207936 mod p(x)` << 1 */ + .octa 0x00000000f1c3db2800000001ba0e3dea + + /* x^206848 mod p(x)` << 1, x^206912 mod p(x)` << 1 */ + .octa 0x000000013112fb9c0000000074b59a5e + + /* x^205824 mod p(x)` << 1, x^205888 mod p(x)` << 1 */ + .octa 0x00000000b680b90600000000f2b5ea98 + + /* x^204800 mod p(x)` << 1, x^204864 mod p(x)` << 1 */ + .octa 0x000000001a2829320000000187132676 + + /* x^203776 mod p(x)` << 1, x^203840 mod p(x)` << 1 */ + .octa 0x0000000089406e7e000000010a8c6ad4 + + /* x^202752 mod p(x)` << 1, x^202816 mod p(x)` << 1 */ + .octa 0x00000001def6be8c00000001e21dfe70 + + /* x^201728 mod p(x)` << 1, x^201792 mod p(x)` << 1 */ + .octa 0x000000007525872800000001da0050e4 + + /* x^200704 mod p(x)` << 1, x^200768 mod p(x)` << 1 */ + .octa 0x000000019536090a00000000772172ae + + /* x^199680 mod p(x)` << 1, x^199744 mod p(x)` << 1 */ + .octa 0x00000000f2455bfc00000000e47724aa + + /* x^198656 mod p(x)` << 1, x^198720 mod p(x)` << 1 */ + .octa 0x000000018c40baf4000000003cd63ac4 + + /* x^197632 mod p(x)` << 1, x^197696 mod p(x)` << 1 */ + .octa 0x000000004cd390d400000001bf47d352 + + /* x^196608 mod p(x)` << 1, x^196672 mod p(x)` << 1 */ + .octa 0x00000001e4ece95a000000018dc1d708 + + /* x^195584 mod p(x)` << 1, x^195648 mod p(x)` << 1 */ + .octa 0x000000001a3ee918000000002d4620a4 + + /* x^194560 mod p(x)` << 1, x^194624 mod p(x)` << 1 */ + .octa 0x000000007c652fb80000000058fd1740 + + /* x^193536 mod p(x)` << 1, x^193600 mod p(x)` << 1 */ + .octa 0x000000011c67842c00000000dadd9bfc + + /* x^192512 mod p(x)` << 1, x^192576 mod p(x)` << 1 */ + .octa 0x00000000254f759c00000001ea2140be + + /* x^191488 mod p(x)` << 1, x^191552 mod p(x)` << 1 */ + .octa 0x000000007ece94ca000000009de128ba + + /* x^190464 mod p(x)` << 1, x^190528 mod p(x)` << 1 */ + .octa 0x0000000038f258c2000000013ac3aa8e + + /* x^189440 mod p(x)` << 1, x^189504 mod p(x)` << 1 */ + .octa 0x00000001cdf17b000000000099980562 + + /* x^188416 mod p(x)` << 1, x^188480 mod p(x)` << 1 */ + .octa 0x000000011f882c1600000001c1579c86 + + /* x^187392 mod p(x)` << 1, x^187456 mod p(x)` << 1 */ + .octa 0x0000000100093fc80000000068dbbf94 + + /* x^186368 mod p(x)` << 1, x^186432 mod p(x)` << 1 */ + .octa 0x00000001cd684f16000000004509fb04 + + /* x^185344 mod p(x)` << 1, x^185408 mod p(x)` << 1 */ + .octa 0x000000004bc6a70a00000001202f6398 + + /* x^184320 mod p(x)` << 1, x^184384 mod p(x)` << 1 */ + .octa 0x000000004fc7e8e4000000013aea243e + + /* x^183296 mod p(x)` << 1, x^183360 mod p(x)` << 1 */ + .octa 0x0000000130103f1c00000001b4052ae6 + + /* x^182272 mod p(x)` << 1, x^182336 mod p(x)` << 1 */ + .octa 0x0000000111b0024c00000001cd2a0ae8 + + /* x^181248 mod p(x)` << 1, x^181312 mod p(x)` << 1 */ + .octa 0x000000010b3079da00000001fe4aa8b4 + + /* x^180224 mod p(x)` << 1, x^180288 mod p(x)` << 1 */ + .octa 0x000000010192bcc200000001d1559a42 + + /* x^179200 mod p(x)` << 1, x^179264 mod p(x)` << 1 */ + .octa 0x0000000074838d5000000001f3e05ecc + + /* x^178176 mod p(x)` << 1, x^178240 mod p(x)` << 1 */ + .octa 0x000000001b20f5200000000104ddd2cc + + /* x^177152 mod p(x)` << 1, x^177216 mod p(x)` << 1 */ + .octa 0x0000000050c3590a000000015393153c + + /* x^176128 mod p(x)` << 1, x^176192 mod p(x)` << 1 */ + .octa 0x00000000b41cac8e0000000057e942c6 + + /* x^175104 mod p(x)` << 1, x^175168 mod p(x)` << 1 */ + .octa 0x000000000c72cc78000000012c633850 + + /* x^174080 mod p(x)` << 1, x^174144 mod p(x)` << 1 */ + .octa 0x0000000030cdb03200000000ebcaae4c + + /* x^173056 mod p(x)` << 1, x^173120 mod p(x)` << 1 */ + .octa 0x000000013e09fc32000000013ee532a6 + + /* x^172032 mod p(x)` << 1, x^172096 mod p(x)` << 1 */ + .octa 0x000000001ed624d200000001bf0cbc7e + + /* x^171008 mod p(x)` << 1, x^171072 mod p(x)` << 1 */ + .octa 0x00000000781aee1a00000000d50b7a5a + + /* x^169984 mod p(x)` << 1, x^170048 mod p(x)` << 1 */ + .octa 0x00000001c4d8348c0000000002fca6e8 + + /* x^168960 mod p(x)` << 1, x^169024 mod p(x)` << 1 */ + .octa 0x0000000057a40336000000007af40044 + + /* x^167936 mod p(x)` << 1, x^168000 mod p(x)` << 1 */ + .octa 0x00000000855449400000000016178744 + + /* x^166912 mod p(x)` << 1, x^166976 mod p(x)` << 1 */ + .octa 0x000000019cd21e80000000014c177458 + + /* x^165888 mod p(x)` << 1, x^165952 mod p(x)` << 1 */ + .octa 0x000000013eb95bc0000000011b6ddf04 + + /* x^164864 mod p(x)` << 1, x^164928 mod p(x)` << 1 */ + .octa 0x00000001dfc9fdfc00000001f3e29ccc + + /* x^163840 mod p(x)` << 1, x^163904 mod p(x)` << 1 */ + .octa 0x00000000cd028bc20000000135ae7562 + + /* x^162816 mod p(x)` << 1, x^162880 mod p(x)` << 1 */ + .octa 0x0000000090db8c440000000190ef812c + + /* x^161792 mod p(x)` << 1, x^161856 mod p(x)` << 1 */ + .octa 0x000000010010a4ce0000000067a2c786 + + /* x^160768 mod p(x)` << 1, x^160832 mod p(x)` << 1 */ + .octa 0x00000001c8f4c72c0000000048b9496c + + /* x^159744 mod p(x)` << 1, x^159808 mod p(x)` << 1 */ + .octa 0x000000001c26170c000000015a422de6 + + /* x^158720 mod p(x)` << 1, x^158784 mod p(x)` << 1 */ + .octa 0x00000000e3fccf6800000001ef0e3640 + + /* x^157696 mod p(x)` << 1, x^157760 mod p(x)` << 1 */ + .octa 0x00000000d513ed2400000001006d2d26 + + /* x^156672 mod p(x)` << 1, x^156736 mod p(x)` << 1 */ + .octa 0x00000000141beada00000001170d56d6 + + /* x^155648 mod p(x)` << 1, x^155712 mod p(x)` << 1 */ + .octa 0x000000011071aea000000000a5fb613c + + /* x^154624 mod p(x)` << 1, x^154688 mod p(x)` << 1 */ + .octa 0x000000012e19080a0000000040bbf7fc + + /* x^153600 mod p(x)` << 1, x^153664 mod p(x)` << 1 */ + .octa 0x0000000100ecf826000000016ac3a5b2 + + /* x^152576 mod p(x)` << 1, x^152640 mod p(x)` << 1 */ + .octa 0x0000000069b0941200000000abf16230 + + /* x^151552 mod p(x)` << 1, x^151616 mod p(x)` << 1 */ + .octa 0x0000000122297bac00000001ebe23fac + + /* x^150528 mod p(x)` << 1, x^150592 mod p(x)` << 1 */ + .octa 0x00000000e9e4b068000000008b6a0894 + + /* x^149504 mod p(x)` << 1, x^149568 mod p(x)` << 1 */ + .octa 0x000000004b38651a00000001288ea478 + + /* x^148480 mod p(x)` << 1, x^148544 mod p(x)` << 1 */ + .octa 0x00000001468360e2000000016619c442 + + /* x^147456 mod p(x)` << 1, x^147520 mod p(x)` << 1 */ + .octa 0x00000000121c24080000000086230038 + + /* x^146432 mod p(x)` << 1, x^146496 mod p(x)` << 1 */ + .octa 0x00000000da7e7d08000000017746a756 + + /* x^145408 mod p(x)` << 1, x^145472 mod p(x)` << 1 */ + .octa 0x00000001058d76520000000191b8f8f8 + + /* x^144384 mod p(x)` << 1, x^144448 mod p(x)` << 1 */ + .octa 0x000000014a098a90000000008e167708 + + /* x^143360 mod p(x)` << 1, x^143424 mod p(x)` << 1 */ + .octa 0x0000000020dbe72e0000000148b22d54 + + /* x^142336 mod p(x)` << 1, x^142400 mod p(x)` << 1 */ + .octa 0x000000011e7323e80000000044ba2c3c + + /* x^141312 mod p(x)` << 1, x^141376 mod p(x)` << 1 */ + .octa 0x00000000d5d4bf9400000000b54d2b52 + + /* x^140288 mod p(x)` << 1, x^140352 mod p(x)` << 1 */ + .octa 0x0000000199d8746c0000000005a4fd8a + + /* x^139264 mod p(x)` << 1, x^139328 mod p(x)` << 1 */ + .octa 0x00000000ce9ca8a00000000139f9fc46 + + /* x^138240 mod p(x)` << 1, x^138304 mod p(x)` << 1 */ + .octa 0x00000000136edece000000015a1fa824 + + /* x^137216 mod p(x)` << 1, x^137280 mod p(x)` << 1 */ + .octa 0x000000019b92a068000000000a61ae4c + + /* x^136192 mod p(x)` << 1, x^136256 mod p(x)` << 1 */ + .octa 0x0000000071d622060000000145e9113e + + /* x^135168 mod p(x)` << 1, x^135232 mod p(x)` << 1 */ + .octa 0x00000000dfc50158000000006a348448 + + /* x^134144 mod p(x)` << 1, x^134208 mod p(x)` << 1 */ + .octa 0x00000001517626bc000000004d80a08c + + /* x^133120 mod p(x)` << 1, x^133184 mod p(x)` << 1 */ + .octa 0x0000000148d1e4fa000000014b6837a0 + + /* x^132096 mod p(x)` << 1, x^132160 mod p(x)` << 1 */ + .octa 0x0000000094d8266e000000016896a7fc + + /* x^131072 mod p(x)` << 1, x^131136 mod p(x)` << 1 */ + .octa 0x00000000606c5e34000000014f187140 + + /* x^130048 mod p(x)` << 1, x^130112 mod p(x)` << 1 */ + .octa 0x000000019766beaa000000019581b9da + + /* x^129024 mod p(x)` << 1, x^129088 mod p(x)` << 1 */ + .octa 0x00000001d80c506c00000001091bc984 + + /* x^128000 mod p(x)` << 1, x^128064 mod p(x)` << 1 */ + .octa 0x000000001e73837c000000001067223c + + /* x^126976 mod p(x)` << 1, x^127040 mod p(x)` << 1 */ + .octa 0x0000000064d587de00000001ab16ea02 + + /* x^125952 mod p(x)` << 1, x^126016 mod p(x)` << 1 */ + .octa 0x00000000f4a507b0000000013c4598a8 + + /* x^124928 mod p(x)` << 1, x^124992 mod p(x)` << 1 */ + .octa 0x0000000040e342fc00000000b3735430 + + /* x^123904 mod p(x)` << 1, x^123968 mod p(x)` << 1 */ + .octa 0x00000001d5ad9c3a00000001bb3fc0c0 + + /* x^122880 mod p(x)` << 1, x^122944 mod p(x)` << 1 */ + .octa 0x0000000094a691a400000001570ae19c + + /* x^121856 mod p(x)` << 1, x^121920 mod p(x)` << 1 */ + .octa 0x00000001271ecdfa00000001ea910712 + + /* x^120832 mod p(x)` << 1, x^120896 mod p(x)` << 1 */ + .octa 0x000000009e54475a0000000167127128 + + /* x^119808 mod p(x)` << 1, x^119872 mod p(x)` << 1 */ + .octa 0x00000000c9c099ee0000000019e790a2 + + /* x^118784 mod p(x)` << 1, x^118848 mod p(x)` << 1 */ + .octa 0x000000009a2f736c000000003788f710 + + /* x^117760 mod p(x)` << 1, x^117824 mod p(x)` << 1 */ + .octa 0x00000000bb9f499600000001682a160e + + /* x^116736 mod p(x)` << 1, x^116800 mod p(x)` << 1 */ + .octa 0x00000001db688050000000007f0ebd2e + + /* x^115712 mod p(x)` << 1, x^115776 mod p(x)` << 1 */ + .octa 0x00000000e9b10af4000000002b032080 + + /* x^114688 mod p(x)` << 1, x^114752 mod p(x)` << 1 */ + .octa 0x000000012d4545e400000000cfd1664a + + /* x^113664 mod p(x)` << 1, x^113728 mod p(x)` << 1 */ + .octa 0x000000000361139c00000000aa1181c2 + + /* x^112640 mod p(x)` << 1, x^112704 mod p(x)` << 1 */ + .octa 0x00000001a5a1a3a800000000ddd08002 + + /* x^111616 mod p(x)` << 1, x^111680 mod p(x)` << 1 */ + .octa 0x000000006844e0b000000000e8dd0446 + + /* x^110592 mod p(x)` << 1, x^110656 mod p(x)` << 1 */ + .octa 0x00000000c3762f2800000001bbd94a00 + + /* x^109568 mod p(x)` << 1, x^109632 mod p(x)` << 1 */ + .octa 0x00000001d26287a200000000ab6cd180 + + /* x^108544 mod p(x)` << 1, x^108608 mod p(x)` << 1 */ + .octa 0x00000001f6f0bba80000000031803ce2 + + /* x^107520 mod p(x)` << 1, x^107584 mod p(x)` << 1 */ + .octa 0x000000002ffabd620000000024f40b0c + + /* x^106496 mod p(x)` << 1, x^106560 mod p(x)` << 1 */ + .octa 0x00000000fb4516b800000001ba1d9834 + + /* x^105472 mod p(x)` << 1, x^105536 mod p(x)` << 1 */ + .octa 0x000000018cfa961c0000000104de61aa + + /* x^104448 mod p(x)` << 1, x^104512 mod p(x)` << 1 */ + .octa 0x000000019e588d520000000113e40d46 + + /* x^103424 mod p(x)` << 1, x^103488 mod p(x)` << 1 */ + .octa 0x00000001180f0bbc00000001415598a0 + + /* x^102400 mod p(x)` << 1, x^102464 mod p(x)` << 1 */ + .octa 0x00000000e1d9177a00000000bf6c8c90 + + /* x^101376 mod p(x)` << 1, x^101440 mod p(x)` << 1 */ + .octa 0x0000000105abc27c00000001788b0504 + + /* x^100352 mod p(x)` << 1, x^100416 mod p(x)` << 1 */ + .octa 0x00000000972e4a580000000038385d02 + + /* x^99328 mod p(x)` << 1, x^99392 mod p(x)` << 1 */ + .octa 0x0000000183499a5e00000001b6c83844 + + /* x^98304 mod p(x)` << 1, x^98368 mod p(x)` << 1 */ + .octa 0x00000001c96a8cca0000000051061a8a + + /* x^97280 mod p(x)` << 1, x^97344 mod p(x)` << 1 */ + .octa 0x00000001a1a5b60c000000017351388a + + /* x^96256 mod p(x)` << 1, x^96320 mod p(x)` << 1 */ + .octa 0x00000000e4b6ac9c0000000132928f92 + + /* x^95232 mod p(x)` << 1, x^95296 mod p(x)` << 1 */ + .octa 0x00000001807e7f5a00000000e6b4f48a + + /* x^94208 mod p(x)` << 1, x^94272 mod p(x)` << 1 */ + .octa 0x000000017a7e3bc80000000039d15e90 + + /* x^93184 mod p(x)` << 1, x^93248 mod p(x)` << 1 */ + .octa 0x00000000d73975da00000000312d6074 + + /* x^92160 mod p(x)` << 1, x^92224 mod p(x)` << 1 */ + .octa 0x000000017375d038000000017bbb2cc4 + + /* x^91136 mod p(x)` << 1, x^91200 mod p(x)` << 1 */ + .octa 0x00000000193680bc000000016ded3e18 + + /* x^90112 mod p(x)` << 1, x^90176 mod p(x)` << 1 */ + .octa 0x00000000999b06f600000000f1638b16 + + /* x^89088 mod p(x)` << 1, x^89152 mod p(x)` << 1 */ + .octa 0x00000001f685d2b800000001d38b9ecc + + /* x^88064 mod p(x)` << 1, x^88128 mod p(x)` << 1 */ + .octa 0x00000001f4ecbed2000000018b8d09dc + + /* x^87040 mod p(x)` << 1, x^87104 mod p(x)` << 1 */ + .octa 0x00000000ba16f1a000000000e7bc27d2 + + /* x^86016 mod p(x)` << 1, x^86080 mod p(x)` << 1 */ + .octa 0x0000000115aceac400000000275e1e96 + + /* x^84992 mod p(x)` << 1, x^85056 mod p(x)` << 1 */ + .octa 0x00000001aeff629200000000e2e3031e + + /* x^83968 mod p(x)` << 1, x^84032 mod p(x)` << 1 */ + .octa 0x000000009640124c00000001041c84d8 + + /* x^82944 mod p(x)` << 1, x^83008 mod p(x)` << 1 */ + .octa 0x0000000114f41f0200000000706ce672 + + /* x^81920 mod p(x)` << 1, x^81984 mod p(x)` << 1 */ + .octa 0x000000009c5f3586000000015d5070da + + /* x^80896 mod p(x)` << 1, x^80960 mod p(x)` << 1 */ + .octa 0x00000001878275fa0000000038f9493a + + /* x^79872 mod p(x)` << 1, x^79936 mod p(x)` << 1 */ + .octa 0x00000000ddc42ce800000000a3348a76 + + /* x^78848 mod p(x)` << 1, x^78912 mod p(x)` << 1 */ + .octa 0x0000000181d2c73a00000001ad0aab92 + + /* x^77824 mod p(x)` << 1, x^77888 mod p(x)` << 1 */ + .octa 0x0000000141c9320a000000019e85f712 + + /* x^76800 mod p(x)` << 1, x^76864 mod p(x)` << 1 */ + .octa 0x000000015235719a000000005a871e76 + + /* x^75776 mod p(x)` << 1, x^75840 mod p(x)` << 1 */ + .octa 0x00000000be27d804000000017249c662 + + /* x^74752 mod p(x)` << 1, x^74816 mod p(x)` << 1 */ + .octa 0x000000006242d45a000000003a084712 + + /* x^73728 mod p(x)` << 1, x^73792 mod p(x)` << 1 */ + .octa 0x000000009a53638e00000000ed438478 + + /* x^72704 mod p(x)` << 1, x^72768 mod p(x)` << 1 */ + .octa 0x00000001001ecfb600000000abac34cc + + /* x^71680 mod p(x)` << 1, x^71744 mod p(x)` << 1 */ + .octa 0x000000016d7c2d64000000005f35ef3e + + /* x^70656 mod p(x)` << 1, x^70720 mod p(x)` << 1 */ + .octa 0x00000001d0ce46c00000000047d6608c + + /* x^69632 mod p(x)` << 1, x^69696 mod p(x)` << 1 */ + .octa 0x0000000124c907b4000000002d01470e + + /* x^68608 mod p(x)` << 1, x^68672 mod p(x)` << 1 */ + .octa 0x0000000018a555ca0000000158bbc7b0 + + /* x^67584 mod p(x)` << 1, x^67648 mod p(x)` << 1 */ + .octa 0x000000006b0980bc00000000c0a23e8e + + /* x^66560 mod p(x)` << 1, x^66624 mod p(x)` << 1 */ + .octa 0x000000008bbba96400000001ebd85c88 + + /* x^65536 mod p(x)` << 1, x^65600 mod p(x)` << 1 */ + .octa 0x00000001070a5a1e000000019ee20bb2 + + /* x^64512 mod p(x)` << 1, x^64576 mod p(x)` << 1 */ + .octa 0x000000002204322a00000001acabf2d6 + + /* x^63488 mod p(x)` << 1, x^63552 mod p(x)` << 1 */ + .octa 0x00000000a27524d000000001b7963d56 + + /* x^62464 mod p(x)` << 1, x^62528 mod p(x)` << 1 */ + .octa 0x0000000020b1e4ba000000017bffa1fe + + /* x^61440 mod p(x)` << 1, x^61504 mod p(x)` << 1 */ + .octa 0x0000000032cc27fc000000001f15333e + + /* x^60416 mod p(x)` << 1, x^60480 mod p(x)` << 1 */ + .octa 0x0000000044dd22b8000000018593129e + + /* x^59392 mod p(x)` << 1, x^59456 mod p(x)` << 1 */ + .octa 0x00000000dffc9e0a000000019cb32602 + + /* x^58368 mod p(x)` << 1, x^58432 mod p(x)` << 1 */ + .octa 0x00000001b7a0ed140000000142b05cc8 + + /* x^57344 mod p(x)` << 1, x^57408 mod p(x)` << 1 */ + .octa 0x00000000c784248800000001be49e7a4 + + /* x^56320 mod p(x)` << 1, x^56384 mod p(x)` << 1 */ + .octa 0x00000001c02a4fee0000000108f69d6c + + /* x^55296 mod p(x)` << 1, x^55360 mod p(x)` << 1 */ + .octa 0x000000003c273778000000006c0971f0 + + /* x^54272 mod p(x)` << 1, x^54336 mod p(x)` << 1 */ + .octa 0x00000001d63f8894000000005b16467a + + /* x^53248 mod p(x)` << 1, x^53312 mod p(x)` << 1 */ + .octa 0x000000006be557d600000001551a628e + + /* x^52224 mod p(x)` << 1, x^52288 mod p(x)` << 1 */ + .octa 0x000000006a7806ea000000019e42ea92 + + /* x^51200 mod p(x)` << 1, x^51264 mod p(x)` << 1 */ + .octa 0x000000016155aa0c000000012fa83ff2 + + /* x^50176 mod p(x)` << 1, x^50240 mod p(x)` << 1 */ + .octa 0x00000000908650ac000000011ca9cde0 + + /* x^49152 mod p(x)` << 1, x^49216 mod p(x)` << 1 */ + .octa 0x00000000aa5a808400000000c8e5cd74 + + /* x^48128 mod p(x)` << 1, x^48192 mod p(x)` << 1 */ + .octa 0x0000000191bb500a0000000096c27f0c + + /* x^47104 mod p(x)` << 1, x^47168 mod p(x)` << 1 */ + .octa 0x0000000064e9bed0000000002baed926 + + /* x^46080 mod p(x)` << 1, x^46144 mod p(x)` << 1 */ + .octa 0x000000009444f302000000017c8de8d2 + + /* x^45056 mod p(x)` << 1, x^45120 mod p(x)` << 1 */ + .octa 0x000000019db07d3c00000000d43d6068 + + /* x^44032 mod p(x)` << 1, x^44096 mod p(x)` << 1 */ + .octa 0x00000001359e3e6e00000000cb2c4b26 + + /* x^43008 mod p(x)` << 1, x^43072 mod p(x)` << 1 */ + .octa 0x00000001e4f10dd20000000145b8da26 + + /* x^41984 mod p(x)` << 1, x^42048 mod p(x)` << 1 */ + .octa 0x0000000124f5735e000000018fff4b08 + + /* x^40960 mod p(x)` << 1, x^41024 mod p(x)` << 1 */ + .octa 0x0000000124760a4c0000000150b58ed0 + + /* x^39936 mod p(x)` << 1, x^40000 mod p(x)` << 1 */ + .octa 0x000000000f1fc18600000001549f39bc + + /* x^38912 mod p(x)` << 1, x^38976 mod p(x)` << 1 */ + .octa 0x00000000150e4cc400000000ef4d2f42 + + /* x^37888 mod p(x)` << 1, x^37952 mod p(x)` << 1 */ + .octa 0x000000002a6204e800000001b1468572 + + /* x^36864 mod p(x)` << 1, x^36928 mod p(x)` << 1 */ + .octa 0x00000000beb1d432000000013d7403b2 + + /* x^35840 mod p(x)` << 1, x^35904 mod p(x)` << 1 */ + .octa 0x0000000135f3f1f000000001a4681842 + + /* x^34816 mod p(x)` << 1, x^34880 mod p(x)` << 1 */ + .octa 0x0000000074fe22320000000167714492 + + /* x^33792 mod p(x)` << 1, x^33856 mod p(x)` << 1 */ + .octa 0x000000001ac6e2ba00000001e599099a + + /* x^32768 mod p(x)` << 1, x^32832 mod p(x)` << 1 */ + .octa 0x0000000013fca91e00000000fe128194 + + /* x^31744 mod p(x)` << 1, x^31808 mod p(x)` << 1 */ + .octa 0x0000000183f4931e0000000077e8b990 + + /* x^30720 mod p(x)` << 1, x^30784 mod p(x)` << 1 */ + .octa 0x00000000b6d9b4e400000001a267f63a + + /* x^29696 mod p(x)` << 1, x^29760 mod p(x)` << 1 */ + .octa 0x00000000b518865600000001945c245a + + /* x^28672 mod p(x)` << 1, x^28736 mod p(x)` << 1 */ + .octa 0x0000000027a81a840000000149002e76 + + /* x^27648 mod p(x)` << 1, x^27712 mod p(x)` << 1 */ + .octa 0x000000012569925800000001bb8310a4 + + /* x^26624 mod p(x)` << 1, x^26688 mod p(x)` << 1 */ + .octa 0x00000001b23de796000000019ec60bcc + + /* x^25600 mod p(x)` << 1, x^25664 mod p(x)` << 1 */ + .octa 0x00000000fe4365dc000000012d8590ae + + /* x^24576 mod p(x)` << 1, x^24640 mod p(x)` << 1 */ + .octa 0x00000000c68f497a0000000065b00684 + + /* x^23552 mod p(x)` << 1, x^23616 mod p(x)` << 1 */ + .octa 0x00000000fbf521ee000000015e5aeadc + + /* x^22528 mod p(x)` << 1, x^22592 mod p(x)` << 1 */ + .octa 0x000000015eac337800000000b77ff2b0 + + /* x^21504 mod p(x)` << 1, x^21568 mod p(x)` << 1 */ + .octa 0x0000000134914b900000000188da2ff6 + + /* x^20480 mod p(x)` << 1, x^20544 mod p(x)` << 1 */ + .octa 0x0000000016335cfe0000000063da929a + + /* x^19456 mod p(x)` << 1, x^19520 mod p(x)` << 1 */ + .octa 0x000000010372d10c00000001389caa80 + + /* x^18432 mod p(x)` << 1, x^18496 mod p(x)` << 1 */ + .octa 0x000000015097b908000000013db599d2 + + /* x^17408 mod p(x)` << 1, x^17472 mod p(x)` << 1 */ + .octa 0x00000001227a75720000000122505a86 + + /* x^16384 mod p(x)` << 1, x^16448 mod p(x)` << 1 */ + .octa 0x000000009a8f75c0000000016bd72746 + + /* x^15360 mod p(x)` << 1, x^15424 mod p(x)` << 1 */ + .octa 0x00000000682c77a200000001c3faf1d4 + + /* x^14336 mod p(x)` << 1, x^14400 mod p(x)` << 1 */ + .octa 0x00000000231f091c00000001111c826c + + /* x^13312 mod p(x)` << 1, x^13376 mod p(x)` << 1 */ + .octa 0x000000007d4439f200000000153e9fb2 + + /* x^12288 mod p(x)` << 1, x^12352 mod p(x)` << 1 */ + .octa 0x000000017e221efc000000002b1f7b60 + + /* x^11264 mod p(x)` << 1, x^11328 mod p(x)` << 1 */ + .octa 0x0000000167457c3800000000b1dba570 + + /* x^10240 mod p(x)` << 1, x^10304 mod p(x)` << 1 */ + .octa 0x00000000bdf081c400000001f6397b76 + + /* x^9216 mod p(x)` << 1, x^9280 mod p(x)` << 1 */ + .octa 0x000000016286d6b00000000156335214 + + /* x^8192 mod p(x)` << 1, x^8256 mod p(x)` << 1 */ + .octa 0x00000000c84f001c00000001d70e3986 + + /* x^7168 mod p(x)` << 1, x^7232 mod p(x)` << 1 */ + .octa 0x0000000064efe7c0000000003701a774 + + /* x^6144 mod p(x)` << 1, x^6208 mod p(x)` << 1 */ + .octa 0x000000000ac2d90400000000ac81ef72 + + /* x^5120 mod p(x)` << 1, x^5184 mod p(x)` << 1 */ + .octa 0x00000000fd226d140000000133212464 + + /* x^4096 mod p(x)` << 1, x^4160 mod p(x)` << 1 */ + .octa 0x000000011cfd42e000000000e4e45610 + + /* x^3072 mod p(x)` << 1, x^3136 mod p(x)` << 1 */ + .octa 0x000000016e5a5678000000000c1bd370 + + /* x^2048 mod p(x)` << 1, x^2112 mod p(x)` << 1 */ + .octa 0x00000001d888fe2200000001a7b9e7a6 + + /* x^1024 mod p(x)` << 1, x^1088 mod p(x)` << 1 */ + .octa 0x00000001af77fcd4000000007d657a10 + +SHORT_CONSTANTS: + + /* Reduce final 1024-2048 bits to 64 bits, shifting 32 bits to include the trailing 32 bits of zeros */ + /* x^1952 mod p(x)`, x^1984 mod p(x)`, x^2016 mod p(x)`, x^2048 mod p(x)` */ + .octa 0xed837b2613e8221e99168a18ec447f11 + + /* x^1824 mod p(x)`, x^1856 mod p(x)`, x^1888 mod p(x)`, x^1920 mod p(x)` */ + .octa 0xc8acdd8147b9ce5ae23e954e8fd2cd3c + + /* x^1696 mod p(x)`, x^1728 mod p(x)`, x^1760 mod p(x)`, x^1792 mod p(x)` */ + .octa 0xd9ad6d87d4277e2592f8befe6b1d2b53 + + /* x^1568 mod p(x)`, x^1600 mod p(x)`, x^1632 mod p(x)`, x^1664 mod p(x)` */ + .octa 0xc10ec5e033fbca3bf38a3556291ea462 + + /* x^1440 mod p(x)`, x^1472 mod p(x)`, x^1504 mod p(x)`, x^1536 mod p(x)` */ + .octa 0xc0b55b0e82e02e2f974ac56262b6ca4b + + /* x^1312 mod p(x)`, x^1344 mod p(x)`, x^1376 mod p(x)`, x^1408 mod p(x)` */ + .octa 0x71aa1df0e172334d855712b3784d2a56 + + /* x^1184 mod p(x)`, x^1216 mod p(x)`, x^1248 mod p(x)`, x^1280 mod p(x)` */ + .octa 0xfee3053e3969324da5abe9f80eaee722 + + /* x^1056 mod p(x)`, x^1088 mod p(x)`, x^1120 mod p(x)`, x^1152 mod p(x)` */ + .octa 0xf44779b93eb2bd081fa0943ddb54814c + + /* x^928 mod p(x)`, x^960 mod p(x)`, x^992 mod p(x)`, x^1024 mod p(x)` */ + .octa 0xf5449b3f00cc3374a53ff440d7bbfe6a + + /* x^800 mod p(x)`, x^832 mod p(x)`, x^864 mod p(x)`, x^896 mod p(x)` */ + .octa 0x6f8346e1d777606eebe7e3566325605c + + /* x^672 mod p(x)`, x^704 mod p(x)`, x^736 mod p(x)`, x^768 mod p(x)` */ + .octa 0xe3ab4f2ac0b95347c65a272ce5b592b8 + + /* x^544 mod p(x)`, x^576 mod p(x)`, x^608 mod p(x)`, x^640 mod p(x)` */ + .octa 0xaa2215ea329ecc115705a9ca4721589f + + /* x^416 mod p(x)`, x^448 mod p(x)`, x^480 mod p(x)`, x^512 mod p(x)` */ + .octa 0x1ed8f66ed95efd26e3720acb88d14467 + + /* x^288 mod p(x)`, x^320 mod p(x)`, x^352 mod p(x)`, x^384 mod p(x)` */ + .octa 0x78ed02d5a700e96aba1aca0315141c31 + + /* x^160 mod p(x)`, x^192 mod p(x)`, x^224 mod p(x)`, x^256 mod p(x)` */ + .octa 0xba8ccbe832b39da3ad2a31b3ed627dae + + /* x^32 mod p(x)`, x^64 mod p(x)`, x^96 mod p(x)`, x^128 mod p(x)` */ + .octa 0xedb88320b1e6b0926655004fa06a2517 + + +BARRETT_CONSTANTS: + /* 33 bit reflected Barrett constant m - (4^32)/n */ + .octa 0x000000000000000000000001f7011641 /* x^64 div p(x)` */ + /* 33 bit reflected Barrett constant n */ + .octa 0x000000000000000000000001db710641 + +#endif /* __powerpc__ */ + +#endif diff --git a/extra/crc32-vpmsum/crc32ieee_wrapper.c b/extra/crc32-vpmsum/crc32ieee_wrapper.c new file mode 100644 index 00000000000..41c1f980097 --- /dev/null +++ b/extra/crc32-vpmsum/crc32ieee_wrapper.c @@ -0,0 +1,75 @@ +#ifdef __powerpc__ + +#define F crc32ieee_vpmsum +#define __F __crc32ieee_vpmsum + +static const unsigned int crc_table[] = { + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, + 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, + 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, + 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, + 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, + 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, + 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, + 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, + 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, + 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, + 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, + 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, + 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, + 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, + 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, + 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, + 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, + 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, + 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, + 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, + 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, + 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, + 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, + 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, + 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, + 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, + 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, + 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, + 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, + 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, + 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, + 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, + 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, + 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, + 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, + 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, + 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, + 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, + 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, + 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, + 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, + 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, + 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, + 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, + 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, + 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, + 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, + 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, + 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, + 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, + 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, + 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, + 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, + 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, + 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, + 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, + 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, + 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, + 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, + 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, + 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, + 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, + 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, + 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d,}; + +#include "crc32_wrapper.ic" + +#endif + diff --git a/storage/innobase/ut/crc32_power8/ppc-opcode.h b/extra/crc32-vpmsum/ppc-opcode.h similarity index 100% rename from storage/innobase/ut/crc32_power8/ppc-opcode.h rename to extra/crc32-vpmsum/ppc-opcode.h diff --git a/extra/innochecksum.cc b/extra/innochecksum.cc index 1ebcbf198ef..ae6ffdb582e 100644 --- a/extra/innochecksum.cc +++ b/extra/innochecksum.cc @@ -395,7 +395,7 @@ parse_page( } if (per_page_details) { printf("index %lu page %lu leaf %u n_recs %lu data_bytes %lu" - "\n", id, page_no, is_leaf, n_recs, data_bytes); + "\n", (ulong) id, (ulong) page_no, is_leaf, n_recs, data_bytes); } /* update per-index statistics */ { diff --git a/extra/mysql_waitpid.c b/extra/mysql_waitpid.c index 7777da25aa1..5cdf1dedc27 100644 --- a/extra/mysql_waitpid.c +++ b/extra/mysql_waitpid.c @@ -50,10 +50,11 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), switch(optid) { case 'V': printf("%s version %s by Jani Tolonen\n", progname, VER); - exit(-1); + exit(0); case 'I': case '?': usage(); + exit(0); } return 0; } @@ -69,7 +70,10 @@ int main(int argc, char *argv[]) exit(-1); if (!argv[0] || !argv[1] || (pid= atoi(argv[0])) <= 0 || (t= atoi(argv[1])) <= 0) + { usage(); + exit(-1); + } for (; t > 0; t--) { if (kill((pid_t) pid, sig)) @@ -100,5 +104,4 @@ void usage(void) printf("integer arguments.\n\n"); printf("Options:\n"); my_print_help(my_long_options); - exit(-1); } diff --git a/extra/yassl/README b/extra/yassl/README index 81d573d0b20..b5eb88824fb 100644 --- a/extra/yassl/README +++ b/extra/yassl/README @@ -12,6 +12,12 @@ before calling SSL_new(); *** end Note *** +yaSSL Release notes, version 2.3.9b (2/03/2016) + This release of yaSSL fixes the OpenSSL compatibility function + X509_NAME_get_index_by_NID() to use the actual index of the common name + instead of searching on the format prefix. Thanks for the report from + yashwant.sahu@oracle.com . Anyone using this function should update. + yaSSL Release notes, version 2.3.9 (12/01/2015) This release of yaSSL fixes two client side Diffie-Hellman problems. yaSSL was only handling the cases of zero or one leading zeros for the key diff --git a/extra/yassl/include/openssl/ssl.h b/extra/yassl/include/openssl/ssl.h index 84ce40b8415..c95eb1ed887 100644 --- a/extra/yassl/include/openssl/ssl.h +++ b/extra/yassl/include/openssl/ssl.h @@ -34,7 +34,7 @@ #include "rsa.h" -#define YASSL_VERSION "2.3.9" +#define YASSL_VERSION "2.3.9b" #if defined(__cplusplus) diff --git a/extra/yassl/include/yassl_int.hpp b/extra/yassl/include/yassl_int.hpp index 55b4b34f9c6..4f35c7e7c92 100644 --- a/extra/yassl/include/yassl_int.hpp +++ b/extra/yassl/include/yassl_int.hpp @@ -191,14 +191,18 @@ private: class X509_NAME { char* name_; size_t sz_; + int cnPosition_; // start of common name, -1 is none + int cnLen_; // length of above ASN1_STRING entry_; public: - X509_NAME(const char*, size_t sz); + X509_NAME(const char*, size_t sz, int pos, int len); ~X509_NAME(); const char* GetName() const; ASN1_STRING* GetEntry(int i); size_t GetLength() const; + int GetCnPosition() const { return cnPosition_; } + int GetCnLength() const { return cnLen_; } private: X509_NAME(const X509_NAME&); // hide copy X509_NAME& operator=(const X509_NAME&); // and assign @@ -226,7 +230,7 @@ class X509 { StringHolder afterDate_; // not valid after public: X509(const char* i, size_t, const char* s, size_t, - ASN1_STRING *b, ASN1_STRING *a); + ASN1_STRING *b, ASN1_STRING *a, int, int, int, int); ~X509() {} X509_NAME* GetIssuer(); diff --git a/extra/yassl/src/cert_wrapper.cpp b/extra/yassl/src/cert_wrapper.cpp index af94f5bc24f..1092e428351 100644 --- a/extra/yassl/src/cert_wrapper.cpp +++ b/extra/yassl/src/cert_wrapper.cpp @@ -304,7 +304,10 @@ int CertManager::Validate() afterDate.type= cert.GetAfterDateType(); afterDate.length= strlen((char *) afterDate.data) + 1; peerX509_ = NEW_YS X509(cert.GetIssuer(), iSz, cert.GetCommonName(), - sSz, &beforeDate, &afterDate); + sSz, &beforeDate, &afterDate, + cert.GetIssuerCnStart(), cert.GetIssuerCnLength(), + cert.GetSubjectCnStart(), cert.GetSubjectCnLength() + ); if (err == TaoCrypt::SIG_OTHER_E && verifyCallback_) { X509_STORE_CTX store; @@ -350,7 +353,9 @@ int CertManager::SetPrivateKey(const x509& key) afterDate.type= cd.GetAfterDateType(); afterDate.length= strlen((char *) afterDate.data) + 1; selfX509_ = NEW_YS X509(cd.GetIssuer(), iSz, cd.GetCommonName(), - sSz, &beforeDate, &afterDate); + sSz, &beforeDate, &afterDate, + cd.GetIssuerCnStart(), cd.GetIssuerCnLength(), + cd.GetSubjectCnStart(), cd.GetSubjectCnLength()); } return 0; } @@ -367,7 +372,9 @@ void CertManager::setPeerX509(X509* x) ASN1_STRING* after = x->GetAfter(); peerX509_ = NEW_YS X509(issuer->GetName(), issuer->GetLength(), - subject->GetName(), subject->GetLength(), before, after); + subject->GetName(), subject->GetLength(), before, after, + issuer->GetCnPosition(), issuer->GetCnLength(), + subject->GetCnPosition(), subject->GetCnLength()); } diff --git a/extra/yassl/src/log.cpp b/extra/yassl/src/log.cpp index 13c68295747..c4be306a7b8 100644 --- a/extra/yassl/src/log.cpp +++ b/extra/yassl/src/log.cpp @@ -1,6 +1,5 @@ /* - Copyright (C) 2000-2007 MySQL AB - Use is subject to license terms + Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/extra/yassl/src/ssl.cpp b/extra/yassl/src/ssl.cpp index 5603430a677..2a1f2fbe395 100644 --- a/extra/yassl/src/ssl.cpp +++ b/extra/yassl/src/ssl.cpp @@ -1351,15 +1351,13 @@ int ASN1_STRING_type(ASN1_STRING *x) int X509_NAME_get_index_by_NID(X509_NAME* name,int nid, int lastpos) { int idx = -1; // not found - const char* start = &name->GetName()[lastpos + 1]; + int cnPos = -1; switch (nid) { case NID_commonName: - const char* found = strstr(start, "/CN="); - if (found) { - found += 4; // advance to str - idx = found - start + lastpos + 1; - } + cnPos = name->GetCnPosition(); + if (lastpos < cnPos) + idx = cnPos; break; } @@ -1471,10 +1469,6 @@ int SSL_peek(SSL* ssl, void* buffer, int sz) int SSL_pending(SSL* ssl) { - // Just in case there's pending data that hasn't been processed yet... - char c; - SSL_peek(ssl, &c, 1); - return ssl->bufferedData(); } diff --git a/extra/yassl/src/yassl_int.cpp b/extra/yassl/src/yassl_int.cpp index 9b447547c56..edc89df4cfa 100644 --- a/extra/yassl/src/yassl_int.cpp +++ b/extra/yassl/src/yassl_int.cpp @@ -1554,8 +1554,9 @@ void SSL_SESSION::CopyX509(X509* x) ASN1_TIME* after = x->GetAfter(); peerX509_ = NEW_YS X509(issuer->GetName(), issuer->GetLength(), - subject->GetName(), subject->GetLength(), - before, after); + subject->GetName(), subject->GetLength(), before, after, + issuer->GetCnPosition(), issuer->GetCnLength(), + subject->GetCnPosition(), subject->GetCnLength()); } @@ -2477,8 +2478,8 @@ void Security::set_resuming(bool b) } -X509_NAME::X509_NAME(const char* n, size_t sz) - : name_(0), sz_(sz) +X509_NAME::X509_NAME(const char* n, size_t sz, int pos, int len) + : name_(0), sz_(sz), cnPosition_(pos), cnLen_(len) { if (sz) { name_ = NEW_YS char[sz]; @@ -2508,8 +2509,10 @@ size_t X509_NAME::GetLength() const X509::X509(const char* i, size_t iSz, const char* s, size_t sSz, - ASN1_STRING *b, ASN1_STRING *a) - : issuer_(i, iSz), subject_(s, sSz), + ASN1_STRING *b, ASN1_STRING *a, + int issPos, int issLen, + int subPos, int subLen) + : issuer_(i, iSz, issPos, issLen), subject_(s, sSz, subPos, subLen), beforeDate_((char *) b->data, b->length, b->type), afterDate_((char *) a->data, a->length, a->type) {} @@ -2544,17 +2547,19 @@ ASN1_STRING* X509_NAME::GetEntry(int i) if (i < 0 || i >= int(sz_)) return 0; + if (i != cnPosition_ || cnLen_ <= 0) // only entry currently supported + return 0; + + if (cnLen_ > int(sz_-i)) // make sure there's room in read buffer + return 0; + if (entry_.data) ysArrayDelete(entry_.data); - entry_.data = NEW_YS byte[sz_]; // max size; + entry_.data = NEW_YS byte[cnLen_+1]; // max size; - memcpy(entry_.data, &name_[i], sz_ - i); - if (entry_.data[sz_ -i - 1]) { - entry_.data[sz_ - i] = 0; - entry_.length = int(sz_) - i; - } - else - entry_.length = int(sz_) - i - 1; + memcpy(entry_.data, &name_[i], cnLen_); + entry_.data[cnLen_] = 0; + entry_.length = cnLen_; entry_.type = 0; return &entry_; diff --git a/extra/yassl/taocrypt/include/asn.hpp b/extra/yassl/taocrypt/include/asn.hpp index 2854b8fe06d..999e853b941 100644 --- a/extra/yassl/taocrypt/include/asn.hpp +++ b/extra/yassl/taocrypt/include/asn.hpp @@ -285,6 +285,10 @@ public: byte GetBeforeDateType() const { return beforeDateType_; } const char* GetAfterDate() const { return afterDate_; } byte GetAfterDateType() const { return afterDateType_; } + int GetSubjectCnStart() const { return subCnPos_; } + int GetIssuerCnStart() const { return issCnPos_; } + int GetSubjectCnLength() const { return subCnLen_; } + int GetIssuerCnLength() const { return issCnLen_; } void DecodeToKey(); private: @@ -294,6 +298,10 @@ private: word32 sigLength_; // length of signature word32 signatureOID_; // sum of algorithm object id word32 keyOID_; // sum of key algo object id + int subCnPos_; // subject common name start, -1 is none + int subCnLen_; // length of above + int issCnPos_; // issuer common name start, -1 is none + int issCnLen_; // length of above byte subjectHash_[SHA_SIZE]; // hash of all Names byte issuerHash_[SHA_SIZE]; // hash of all Names byte* signature_; diff --git a/extra/yassl/taocrypt/src/asn.cpp b/extra/yassl/taocrypt/src/asn.cpp index d8b133a3f0a..0474e7c21d5 100644 --- a/extra/yassl/taocrypt/src/asn.cpp +++ b/extra/yassl/taocrypt/src/asn.cpp @@ -482,8 +482,9 @@ void DH_Decoder::Decode(DH& key) CertDecoder::CertDecoder(Source& s, bool decode, SignerList* signers, bool noVerify, CertType ct) - : BER_Decoder(s), certBegin_(0), sigIndex_(0), sigLength_(0), - signature_(0), verify_(!noVerify) + : BER_Decoder(s), certBegin_(0), sigIndex_(0), sigLength_(0), subCnPos_(-1), + subCnLen_(0), issCnPos_(-1), issCnLen_(0), signature_(0), + verify_(!noVerify) { issuer_[0] = 0; subject_[0] = 0; @@ -804,6 +805,13 @@ void CertDecoder::GetName(NameType nt) case COMMON_NAME: if (!(ptr = AddTag(ptr, buf_end, "/CN=", 4, strLen))) return; + if (nt == ISSUER) { + issCnPos_ = (int)(ptr - strLen - issuer_); + issCnLen_ = (int)strLen; + } else { + subCnPos_ = (int)(ptr - strLen - subject_); + subCnLen_ = (int)strLen; + } break; case SUR_NAME: if (!(ptr = AddTag(ptr, buf_end, "/SN=", 4, strLen))) diff --git a/extra/yassl/taocrypt/src/random.cpp b/extra/yassl/taocrypt/src/random.cpp index 4b89b5b32c5..26dae7d1993 100644 --- a/extra/yassl/taocrypt/src/random.cpp +++ b/extra/yassl/taocrypt/src/random.cpp @@ -27,7 +27,6 @@ #include #if defined(_WIN32) - #define _WIN32_WINNT 0x0400 #include #include #else diff --git a/extra/yassl/testsuite/test.hpp b/extra/yassl/testsuite/test.hpp index 52f6ed79526..5374edd0e2a 100644 --- a/extra/yassl/testsuite/test.hpp +++ b/extra/yassl/testsuite/test.hpp @@ -470,10 +470,28 @@ inline void showPeer(SSL* ssl) char* issuer = X509_NAME_oneline(X509_get_issuer_name(peer), 0, 0); char* subject = X509_NAME_oneline(X509_get_subject_name(peer), 0, 0); - printf("peer's cert info:\n issuer : %s\n subject: %s\n", issuer, - subject); + X509_NAME_ENTRY* se = NULL; + ASN1_STRING* sd = NULL; + char* subCN = NULL; + + X509_NAME* sub = X509_get_subject_name(peer); + int lastpos = -1; + if (sub) + lastpos = X509_NAME_get_index_by_NID(sub, NID_commonName, lastpos); + if (lastpos >= 0) { + se = X509_NAME_get_entry(sub, lastpos); + if (se) + sd = X509_NAME_ENTRY_get_data(se); + if (sd) + subCN = (char*)ASN1_STRING_data(sd); + } + + printf("peer's cert info:\n issuer : %s\n subject: %s\n" + " subject cn: %s\n", issuer, subject, subCN); + free(subject); free(issuer); + } else printf("peer has no cert!\n"); diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index d7853a46ecb..d0c4768e882 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -76,3 +76,9 @@ INSTALL(DIRECTORY . DESTINATION ${INSTALL_INCLUDEDIR}/private COMPONENT Developm PATTERN CMakeFiles EXCLUDE PATTERN mysql EXCLUDE REGEX "\\./(${EXCL_RE}$)" EXCLUDE) + +INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/. DESTINATION ${INSTALL_INCLUDEDIR}/private COMPONENT Development + FILES_MATCHING PATTERN "*.h" + PATTERN CMakeFiles EXCLUDE + PATTERN mysql EXCLUDE + REGEX "\\./(${EXCL_RE}$)" EXCLUDE) diff --git a/include/lf.h b/include/lf.h index 19bdafce647..1825de62b43 100644 --- a/include/lf.h +++ b/include/lf.h @@ -68,11 +68,8 @@ typedef struct { void *purgatory; uint32 purgatory_count; uint32 volatile link; -/* we want sizeof(LF_PINS) to be 128 to avoid false sharing */ - char pad[128-sizeof(uint32)*2 - -sizeof(LF_PINBOX *) - -sizeof(void*) - -sizeof(void *)*(LF_PINBOX_PINS+1)]; + /* avoid false sharing */ + char pad[CPU_LEVEL1_DCACHE_LINESIZE]; } LF_PINS; /* compile-time assert to make sure we have enough pins. */ diff --git a/include/m_ctype.h b/include/m_ctype.h index 536d7fb4629..7a688f76acb 100644 --- a/include/m_ctype.h +++ b/include/m_ctype.h @@ -101,7 +101,7 @@ extern MY_UNICASE_INFO my_unicase_unicode520; */ #define MY_UCA_MAX_WEIGHT_SIZE (8+1) /* Including 0 terminator */ #define MY_UCA_CONTRACTION_MAX_WEIGHT_SIZE (2*8+1) /* Including 0 terminator */ -#define MY_UCA_WEIGHT_LEVELS 1 +#define MY_UCA_WEIGHT_LEVELS 2 typedef struct my_contraction_t { @@ -131,6 +131,7 @@ typedef struct my_uca_level_info_st uchar *lengths; uint16 **weights; MY_CONTRACTIONS contractions; + uint levelno; } MY_UCA_WEIGHT_LEVEL; diff --git a/include/m_string.h b/include/m_string.h index 969725e4631..0f3cd362b4d 100644 --- a/include/m_string.h +++ b/include/m_string.h @@ -23,6 +23,7 @@ #define _m_string_h #include "my_global.h" /* HAVE_* */ +#include "my_decimal_limits.h" #ifndef __USE_GNU #define __USE_GNU /* We want to use stpcpy */ @@ -138,14 +139,13 @@ size_t my_fcvt(double x, int precision, char *to, my_bool *error); size_t my_gcvt(double x, my_gcvt_arg_type type, int width, char *to, my_bool *error); -#define NOT_FIXED_DEC 31 - /* The longest string my_fcvt can return is 311 + "precision" bytes. - Here we assume that we never cal my_fcvt() with precision >= NOT_FIXED_DEC + Here we assume that we never cal my_fcvt() with + precision >= DECIMAL_NOT_SPECIFIED (+ 1 byte for the terminating '\0'). */ -#define FLOATING_POINT_BUFFER (311 + NOT_FIXED_DEC) +#define FLOATING_POINT_BUFFER (311 + DECIMAL_NOT_SPECIFIED) /* We want to use the 'e' format in some cases even if we have enough space diff --git a/include/my_decimal_limits.h b/include/my_decimal_limits.h index 50d70357c42..a287e82f989 100644 --- a/include/my_decimal_limits.h +++ b/include/my_decimal_limits.h @@ -31,10 +31,16 @@ digits * number of decimal digits in one our big digit - number of decimal digits in one our big digit decreased by 1 (because we always put decimal point on the border of our big digits)) + + With normal precession we can handle 65 digits. MariaDB can store in + the .frm up to 63 digits. By default we use DECIMAL_NOT_SPECIFIED digits + when converting strings to decimal, so we don't want to set this too high. + To not use up all digits for the scale we limit the number of decimals to + 38. */ #define DECIMAL_MAX_PRECISION (DECIMAL_MAX_POSSIBLE_PRECISION - 8*2) -#define DECIMAL_MAX_SCALE 30 -#define DECIMAL_NOT_SPECIFIED 31 +#define DECIMAL_MAX_SCALE 38 +#define DECIMAL_NOT_SPECIFIED 39 /** maximum length of string representation (number of maximum decimal diff --git a/include/my_global.h b/include/my_global.h index 7ed306b8b56..1cf3f217549 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -1232,4 +1232,22 @@ static inline double rint(double x) #undef __GNUG__ #endif +/* + Provide defaults for the CPU cache line size, if it has not been detected by + CMake using getconf +*/ +#if !defined(CPU_LEVEL1_DCACHE_LINESIZE) || CPU_LEVEL1_DCACHE_LINESIZE == 0 + #if CPU_LEVEL1_DCACHE_LINESIZE == 0 + #undef CPU_LEVEL1_DCACHE_LINESIZE + #endif + + #if defined(__s390__) + #define CPU_LEVEL1_DCACHE_LINESIZE 256 + #elif defined(__powerpc__) || defined(__aarch64__) + #define CPU_LEVEL1_DCACHE_LINESIZE 128 + #else + #define CPU_LEVEL1_DCACHE_LINESIZE 64 + #endif +#endif + #endif /* my_global_h */ diff --git a/include/my_pthread.h b/include/my_pthread.h index 991bc76c1ec..0d0e5d51bac 100644 --- a/include/my_pthread.h +++ b/include/my_pthread.h @@ -54,26 +54,7 @@ typedef struct st_pthread_link { We use native conditions on Vista and later, and fallback to own implementation on earlier OS version. */ -typedef union -{ - /* Native condition (used on Vista and later) */ - CONDITION_VARIABLE native_cond; - - /* Own implementation (used on XP) */ - struct - { - uint32 waiting; - CRITICAL_SECTION lock_waiting; - enum - { - SIGNAL= 0, - BROADCAST= 1, - MAX_EVENTS= 2 - } EVENTS; - HANDLE events[MAX_EVENTS]; - HANDLE broadcast_block_event; - }; -} pthread_cond_t; +typedef CONDITION_VARIABLE pthread_cond_t; typedef int pthread_mutexattr_t; @@ -81,10 +62,8 @@ typedef int pthread_mutexattr_t; #define pthread_handler_t EXTERNC void * __cdecl typedef void * (__cdecl *pthread_handler)(void *); -typedef volatile LONG my_pthread_once_t; -#define MY_PTHREAD_ONCE_INIT 0 -#define MY_PTHREAD_ONCE_INPROGRESS 1 -#define MY_PTHREAD_ONCE_DONE 2 +typedef INIT_ONCE my_pthread_once_t; +#define MY_PTHREAD_ONCE_INIT INIT_ONCE_STATIC_INIT; #if !STRUCT_TIMESPEC_HAS_TV_SEC || !STRUCT_TIMESPEC_HAS_TV_NSEC struct timespec { @@ -694,7 +673,7 @@ extern void my_mutex_end(void); We need to have at least 256K stack to handle calls to myisamchk_init() with the current number of keys and key parts. */ -#define DEFAULT_THREAD_STACK (290*1024L) +#define DEFAULT_THREAD_STACK (291*1024L) #endif #define MY_PTHREAD_LOCK_READ 0 @@ -712,7 +691,7 @@ struct st_my_thread_var mysql_mutex_t * volatile current_mutex; mysql_cond_t * volatile current_cond; pthread_t pthread_self; - my_thread_id id; + my_thread_id id, dbug_id; int volatile abort; my_bool init; struct st_my_thread_var *next,**prev; diff --git a/include/my_time.h b/include/my_time.h index 557dcdd5670..a5fe7858797 100644 --- a/include/my_time.h +++ b/include/my_time.h @@ -23,6 +23,7 @@ #define _my_time_h_ #include "my_global.h" #include "mysql_time.h" +#include "my_decimal_limits.h" C_MODE_START @@ -184,7 +185,7 @@ void set_zero_time(MYSQL_TIME *tm, enum enum_mysql_timestamp_type time_type); sent using binary protocol fit in this buffer. */ #define MAX_DATE_STRING_REP_LENGTH 30 -#define AUTO_SEC_PART_DIGITS 31 /* same as NOT_FIXED_DEC */ +#define AUTO_SEC_PART_DIGITS DECIMAL_NOT_SPECIFIED int my_time_to_str(const MYSQL_TIME *l_time, char *to, uint digits); int my_date_to_str(const MYSQL_TIME *l_time, char *to); diff --git a/include/my_tree.h b/include/my_tree.h index f8be55f84b2..02cab02b52e 100644 --- a/include/my_tree.h +++ b/include/my_tree.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/include/myisam.h b/include/myisam.h index 88ce401fabc..f7a3ae8cc8a 100644 --- a/include/myisam.h +++ b/include/myisam.h @@ -331,7 +331,8 @@ typedef struct st_sort_info my_off_t filelength, dupp, buff_length; ha_rows max_records; uint current_key, total_keys; - uint got_error, threads_running; + volatile uint got_error; + uint threads_running; myf myf_rw; enum data_file_type new_data_file_type; } MI_SORT_INFO; diff --git a/include/mysql.h b/include/mysql.h index f088ad668a1..19099b4f404 100644 --- a/include/mysql.h +++ b/include/mysql.h @@ -367,7 +367,7 @@ void STDCALL mysql_server_end(void); /* mysql_server_init/end need to be called when using libmysqld or libmysqlclient (exactly, mysql_server_init() is called by mysql_init() so - you don't need to call it explicitely; but you need to call + you don't need to call it explicitly; but you need to call mysql_server_end() to free memory). The names are a bit misleading (mysql_SERVER* to be used when using libmysqlCLIENT). So we add more general names which suit well whether you're using libmysqld or libmysqlclient. We diff --git a/include/mysql.h.pp b/include/mysql.h.pp index 0c06141df6c..b9018376876 100644 --- a/include/mysql.h.pp +++ b/include/mysql.h.pp @@ -10,7 +10,10 @@ enum enum_server_command COM_STMT_PREPARE, COM_STMT_EXECUTE, COM_STMT_SEND_LONG_DATA, COM_STMT_CLOSE, COM_STMT_RESET, COM_SET_OPTION, COM_STMT_FETCH, COM_DAEMON, COM_MDB_GAP_BEG, - COM_MDB_GAP_END=253, + COM_MDB_GAP_END=250, + COM_SLAVE_WORKER, + COM_SLAVE_IO, + COM_SLAVE_SQL, COM_MULTI, COM_END }; diff --git a/include/mysql/plugin_audit.h b/include/mysql/plugin_audit.h index 7fb6e816181..10039c4c1fa 100644 --- a/include/mysql/plugin_audit.h +++ b/include/mysql/plugin_audit.h @@ -23,6 +23,10 @@ #include "plugin.h" +#ifdef __cplusplus +extern "C" { +#endif + #define MYSQL_AUDIT_CLASS_MASK_SIZE 1 #define MYSQL_AUDIT_INTERFACE_VERSION 0x0302 @@ -175,4 +179,8 @@ struct st_mysql_audit }; +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/mysql/plugin_auth.h b/include/mysql/plugin_auth.h index 156fb386aae..d776ed79a61 100644 --- a/include/mysql/plugin_auth.h +++ b/include/mysql/plugin_auth.h @@ -31,6 +31,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + /* defines for MYSQL_SERVER_AUTH_INFO.password_used */ #define PASSWORD_USED_NO 0 @@ -122,5 +126,10 @@ struct st_mysql_auth */ int (*authenticate_user)(MYSQL_PLUGIN_VIO *vio, MYSQL_SERVER_AUTH_INFO *info); }; + +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/mysql/plugin_encryption.h b/include/mysql/plugin_encryption.h index 3f35c2bcf80..5d08f6d3067 100644 --- a/include/mysql/plugin_encryption.h +++ b/include/mysql/plugin_encryption.h @@ -27,6 +27,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + #define MariaDB_ENCRYPTION_INTERFACE_VERSION 0x0300 /** @@ -114,5 +118,9 @@ struct st_mariadb_encryption */ unsigned int (*encrypted_length)(unsigned int slen, unsigned int key_id, unsigned int key_version); }; + +#ifdef __cplusplus +} +#endif #endif diff --git a/include/mysql/plugin_ftparser.h b/include/mysql/plugin_ftparser.h index 324fce7ae86..4dace4ef3a6 100644 --- a/include/mysql/plugin_ftparser.h +++ b/include/mysql/plugin_ftparser.h @@ -18,6 +18,10 @@ #define _my_plugin_ftparser_h #include "plugin.h" +#ifdef __cplusplus +extern "C" { +#endif + /************************************************************************* API for Full-text parser plugin. (MYSQL_FTPARSER_PLUGIN) */ @@ -208,5 +212,9 @@ struct st_mysql_ftparser }; +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/mysql/plugin_password_validation.h b/include/mysql/plugin_password_validation.h index f3ca5c7e0cf..18c643e877b 100644 --- a/include/mysql/plugin_password_validation.h +++ b/include/mysql/plugin_password_validation.h @@ -26,6 +26,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + #define MariaDB_PASSWORD_VALIDATION_INTERFACE_VERSION 0x0100 /** @@ -41,5 +45,10 @@ struct st_mariadb_password_validation int (*validate_password)(MYSQL_LEX_STRING *username, MYSQL_LEX_STRING *password); }; + +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/mysql_com.h b/include/mysql_com.h index c13999a1028..8e7bf2337cc 100644 --- a/include/mysql_com.h +++ b/include/mysql_com.h @@ -21,6 +21,8 @@ #ifndef _mysql_com_h #define _mysql_com_h +#include "my_decimal_limits.h" + #define HOSTNAME_LENGTH 60 #define SYSTEM_CHARSET_MBMAXLEN 3 #define NAME_CHAR_LEN 64 /* Field/table name length */ @@ -103,7 +105,10 @@ enum enum_server_command COM_STMT_RESET, COM_SET_OPTION, COM_STMT_FETCH, COM_DAEMON, /* don't forget to update const char *command_name[] in sql_parse.cc */ COM_MDB_GAP_BEG, - COM_MDB_GAP_END=253, + COM_MDB_GAP_END=250, + COM_SLAVE_WORKER, + COM_SLAVE_IO, + COM_SLAVE_SQL, COM_MULTI, /* Must be last */ COM_END @@ -156,8 +161,6 @@ enum enum_server_command #define FIELD_FLAGS_COLUMN_FORMAT 24 /* Field column format, bit 24-25 */ #define FIELD_FLAGS_COLUMN_FORMAT_MASK (3 << FIELD_FLAGS_COLUMN_FORMAT) #define FIELD_IS_DROPPED (1<< 26) /* Intern: Field is being dropped */ -#define HAS_EXPLICIT_VALUE (1 << 27) /* An INSERT/UPDATE operation supplied - an explicit default value */ #define REFRESH_GRANT (1ULL << 0) /* Refresh grant tables */ #define REFRESH_LOG (1ULL << 1) /* Start on new log file */ @@ -648,5 +651,18 @@ uchar *safe_net_store_length(uchar *pkg, size_t pkg_len, ulonglong length); #define MYSQL_STMT_HEADER 4 #define MYSQL_LONG_DATA_HEADER 6 -#define NOT_FIXED_DEC 31 +/* + If a float or double field have more than this number of decimals, + it's regarded as floating point field without any specific number of + decimals +*/ + +#define FLOATING_POINT_DECIMALS 31 + +/* Keep client compatible with earlier versions */ +#ifdef MYSQL_SERVER +#define NOT_FIXED_DEC DECIMAL_NOT_SPECIFIED +#else +#define NOT_FIXED_DEC FLOATING_POINT_DECIMALS +#endif #endif diff --git a/include/thr_lock.h b/include/thr_lock.h index bc916b8ec9c..fb69d8a693e 100644 --- a/include/thr_lock.h +++ b/include/thr_lock.h @@ -139,9 +139,10 @@ typedef struct st_thr_lock { extern LIST *thr_lock_thread_list; extern mysql_mutex_t THR_LOCK_lock; +struct st_my_thread_var; my_bool init_thr_lock(void); /* Must be called once/thread */ -void thr_lock_info_init(THR_LOCK_INFO *info); +void thr_lock_info_init(THR_LOCK_INFO *info, struct st_my_thread_var *tmp); void thr_lock_init(THR_LOCK *lock); void thr_lock_delete(THR_LOCK *lock); void thr_lock_data_init(THR_LOCK *lock,THR_LOCK_DATA *data, diff --git a/include/violite.h b/include/violite.h index a7165ca91a9..8be9859ceb4 100644 --- a/include/violite.h +++ b/include/violite.h @@ -211,14 +211,6 @@ void vio_end(void); #define SHUT_RD SD_RECEIVE #endif -/* - Set thread id for io cancellation (required on Windows XP only, - and should to be removed if XP is no more supported) -*/ - -#define vio_set_thread_id(vio, tid) if(vio) vio->thread_id= tid -#else -#define vio_set_thread_id(vio, tid) #endif /* This enumerator is used in parser - should be always visible */ @@ -288,7 +280,6 @@ struct st_vio #ifdef _WIN32 HANDLE hPipe; OVERLAPPED overlapped; - DWORD thread_id; /* Used on XP only by vio_shutdown() */ DWORD read_timeout_ms; DWORD write_timeout_ms; #endif diff --git a/libmysql/CMakeLists.txt b/libmysql/CMakeLists.txt index 7dfc572b281..5eb89c19f45 100644 --- a/libmysql/CMakeLists.txt +++ b/libmysql/CMakeLists.txt @@ -274,6 +274,25 @@ SET(CLIENT_API_FUNCTIONS ) IF(CMAKE_SYSTEM_NAME MATCHES "Linux") + IF (NOT DISABLE_LIBMYSQLCLIENT_SYMBOL_VERSIONING) + + INCLUDE (CheckCSourceCompiles) + FILE(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.ld" + "VERSION {\nlibmysqlclient_18 {\nglobal: *;\n};\n}\n") + SET(CMAKE_REQUIRED_LIBRARIES "-Wl,src.ld") + CHECK_C_SOURCE_COMPILES("int main() { return 0; }" + SUPPORTS_VERSION_IN_LINK_SCRIPT) + SET(CMAKE_REQUIRED_LIBRARIES) + + IF (NOT SUPPORTS_VERSION_IN_LINK_SCRIPT) + # https://sourceware.org/bugzilla/show_bug.cgi?id=16895 + MESSAGE(SEND_ERROR "Your current linker does not support VERSION " + "command in linker scripts like a GNU ld or any compatible linker " + "should. Perhaps you're using gold? Either switch to GNU ld compatible " + "linker or run cmake with -DDISABLE_LIBMYSQLCLIENT_SYMBOL_VERSIONING=TRUE " + "to be able to complete the build") + ENDIF (NOT SUPPORTS_VERSION_IN_LINK_SCRIPT) + # When building RPM, or DEB package on Debian, use ELF symbol versioning # for compatibility with distribution packages, so client shared library can # painlessly replace the one supplied by the distribution. @@ -358,14 +377,26 @@ IF(CMAKE_SYSTEM_NAME MATCHES "Linux") make_scrambled_password_323 ) - # Linker script to version symbols in Fedora- and Debian- compatible way, MDEV-5529 - SET(VERSION_SCRIPT_TEMPLATE ${CMAKE_CURRENT_SOURCE_DIR}/libmysql_versions.ld.in) - # Generate version script. # Create semicolon separated lists of functions to export from # Since RPM packages use separate versioning for 5.1 API # and 5.5 API (libmysqlclient_16 vs libmysqlclient_18), # we need 2 lists. + SET (VERSION_HEADER +"VERSION { + libmysqlclient_18 { + global:") + SET (VERSION_FOOTER +" local: + *; + }; + + libmysqlclient_16 { + /* empty here. aliases are added above */ + }; +} +") + SET (CLIENT_API_5_1_LIST) SET (CLIENT_API_5_1_ALIASES) FOREACH (f ${CLIENT_API_FUNCTIONS_5_1} ${CLIENT_API_5_1_EXTRA}) @@ -378,6 +409,13 @@ IF(CMAKE_SYSTEM_NAME MATCHES "Linux") SET(CLIENT_API_5_5_LIST "${CLIENT_API_5_5_LIST}\t${f};\n") ENDFOREACH() + ELSE (NOT DISABLE_LIBMYSQLCLIENT_SYMBOL_VERSIONING) + SET (CLIENT_API_5_1_ALIASES "/* Versioning disabled per user request. MDEV-5982 */") + ENDIF (NOT DISABLE_LIBMYSQLCLIENT_SYMBOL_VERSIONING) + + # Linker script to version symbols in Fedora- and Debian- compatible way, MDEV-5529 + SET(VERSION_SCRIPT_TEMPLATE ${CMAKE_CURRENT_SOURCE_DIR}/libmysql_versions.ld.in) + CONFIGURE_FILE( ${VERSION_SCRIPT_TEMPLATE} ${CMAKE_CURRENT_BINARY_DIR}/libmysql_versions.ld @@ -386,7 +424,7 @@ IF(CMAKE_SYSTEM_NAME MATCHES "Linux") SET(VERSION_SCRIPT_LINK_FLAGS "-Wl,${CMAKE_CURRENT_BINARY_DIR}/libmysql_versions.ld") -ENDIF() +ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux") SET(CLIENT_SOURCES @@ -406,7 +444,7 @@ ADD_CONVENIENCE_LIBRARY(clientlib ${CLIENT_SOURCES}) DTRACE_INSTRUMENT(clientlib) ADD_DEPENDENCIES(clientlib GenError) -SET(LIBS clientlib dbug strings vio mysys mysys_ssl ${ZLIB_LIBRARY} ${SSL_LIBRARIES} ${LIBDL}) +SET(LIBS clientlib dbug strings vio mysys mysys_ssl ${ZLIB_LIBRARY} ${SSL_LIBRARIES} ${LIBDL} ${CRC32_VPMSUM_LIBRARY}) # Merge several convenience libraries into one big mysqlclient # and link them together into shared library. diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index d5d673bb895..de50acde2f4 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -220,7 +220,7 @@ void STDCALL mysql_server_end() } #ifdef NOT_NEEDED /* - The following is not needed as if the program explicitely called + The following is not needed as if the program explicitly called my_init() then we can assume it will also call my_end(). The reason to not also do it here is in that case we can't get statistics from my_end() to debug log. @@ -1510,9 +1510,8 @@ my_bool cli_read_prepare_result(MYSQL *mysql, MYSQL_STMT *stmt) */ #ifdef EMBEDDED_LIBRARY -#define STMT_INIT_PREALLOC(S) 0 -#else -#define STMT_INIT_PREALLOC(S) S +#undef MY_THREAD_SPECIFIC +#define MY_THREAD_SPECIFIC 0 #endif /*EMBEDDED_LIBRARY*/ MYSQL_STMT * STDCALL @@ -1533,10 +1532,8 @@ mysql_stmt_init(MYSQL *mysql) DBUG_RETURN(NULL); } - init_alloc_root(&stmt->mem_root, 2048, STMT_INIT_PREALLOC(2048), - MYF(MY_THREAD_SPECIFIC)); - init_alloc_root(&stmt->result.alloc, 4096, STMT_INIT_PREALLOC(4096), - MYF(MY_THREAD_SPECIFIC)); + init_alloc_root(&stmt->mem_root, 2048,2048, MYF(MY_THREAD_SPECIFIC)); + init_alloc_root(&stmt->result.alloc, 4096, 4096, MYF(MY_THREAD_SPECIFIC)); stmt->result.alloc.min_malloc= sizeof(MYSQL_ROWS); mysql->stmts= list_add(mysql->stmts, &stmt->list); stmt->list.data= stmt; @@ -1553,8 +1550,6 @@ mysql_stmt_init(MYSQL *mysql) DBUG_RETURN(stmt); } -#undef STMT_INIT_PREALLOC - /* Prepare server side statement with query. @@ -3479,7 +3474,7 @@ static void fetch_float_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field, */ char buff[FLOATING_POINT_BUFFER]; size_t len; - if (field->decimals >= NOT_FIXED_DEC) + if (field->decimals >= FLOATING_POINT_DECIMALS) len= my_gcvt(value, type, (int) MY_MIN(sizeof(buff)-1, param->buffer_length), buff, NULL); diff --git a/libmysql/libmysql_versions.ld.in b/libmysql/libmysql_versions.ld.in index 8d97da5b2eb..0cf5b45cc18 100644 --- a/libmysql/libmysql_versions.ld.in +++ b/libmysql/libmysql_versions.ld.in @@ -27,19 +27,7 @@ mysql_get_charset_by_csname = get_charset_by_csname; mysql_net_realloc = net_realloc; mysql_client_errors = client_errors; -VERSION { - -libmysqlclient_18 { - global: +@VERSION_HEADER@ @CLIENT_API_5_1_LIST@ @CLIENT_API_5_5_LIST@ - - local: - *; -}; - -libmysqlclient_16 { - /* empty here. aliases are added above */ -}; - -} +@VERSION_FOOTER@ diff --git a/libmysqld/CMakeLists.txt b/libmysqld/CMakeLists.txt index ad16584ec0e..368f30f8317 100644 --- a/libmysqld/CMakeLists.txt +++ b/libmysqld/CMakeLists.txt @@ -111,6 +111,7 @@ SET(SQL_EMBEDDED_SOURCES emb_qcache.cc libmysqld.c lib_sql.cc ../sql/wsrep_dummy.cc ../sql/encryption.cc ../sql/item_windowfunc.cc ../sql/sql_window.cc ../sql/sql_cte.cc + ../sql/temporary_tables.cc ${GEN_SOURCES} ${MYSYS_LIBWRAP_SOURCE} ) @@ -124,8 +125,12 @@ ADD_DEPENDENCIES(sql_embedded GenError GenServerSource) # On Unix, it is libmysqld.a IF(WIN32) SET(MYSQLSERVER_OUTPUT_NAME mysqlserver) + SET(COMPONENT_MYSQLSERVER "Embedded") + SET(COMPONENT_LIBMYSQLD "Embedded") ELSE() SET(MYSQLSERVER_OUTPUT_NAME mysqld) + SET(COMPONENT_MYSQLSERVER "Development") + SET(COMPONENT_LIBMYSQLD "Server") ENDIF() @@ -150,9 +155,9 @@ FOREACH(LIB ${LIBS}) ENDFOREACH() MERGE_LIBRARIES(mysqlserver STATIC ${EMBEDDED_LIBS} - OUTPUT_NAME ${MYSQLSERVER_OUTPUT_NAME} COMPONENT Development) + OUTPUT_NAME ${MYSQLSERVER_OUTPUT_NAME} COMPONENT ${COMPONENT_MYSQLSERVER}) -INSTALL(FILES embedded_priv.h DESTINATION ${INSTALL_INCLUDEDIR}/private COMPONENT Development) +INSTALL(FILES embedded_priv.h DESTINATION ${INSTALL_INCLUDEDIR}/private COMPONENT ${COMPONENT_MYSQLSERVER}) # Visual Studio users need debug static library IF(MSVC) @@ -179,7 +184,7 @@ ENDFOREACH() IF(NOT DISABLE_SHARED) MERGE_LIBRARIES(libmysqld SHARED mysqlserver EXPORTS ${EMBEDDED_API} - COMPONENT Server) + COMPONENT ${COMPONENT_LIBMYSQLD}) IF(UNIX) # Name the shared library, handle versioning (provides same api as client # library hence the same version) diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index bcb45aefbfb..4a84e63f222 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -426,7 +426,6 @@ static void emb_free_embedded_thd(MYSQL *mysql) THD *thd= (THD*)mysql->thd; mysql_mutex_lock(&LOCK_thread_count); thd->clear_data_list(); - thread_count--; thd->store_globals(); thd->unlink(); mysql_mutex_unlock(&LOCK_thread_count); @@ -667,8 +666,7 @@ void init_embedded_mysql(MYSQL *mysql, int client_flag) */ void *create_embedded_thd(int client_flag) { - THD * thd= new THD; - thd->thread_id= thd->variables.pseudo_thread_id= next_thread_id(); + THD * thd= new THD(next_thread_id()); thd->thread_stack= (char*) &thd; if (thd->store_globals()) @@ -701,7 +699,6 @@ void *create_embedded_thd(int client_flag) bzero((char*) &thd->net, sizeof(thd->net)); mysql_mutex_lock(&LOCK_thread_count); - thread_count++; threads.append(thd); mysql_mutex_unlock(&LOCK_thread_count); thd->mysys_var= 0; @@ -1070,6 +1067,10 @@ bool Protocol::send_result_set_metadata(List *list, uint flags) client_field->type= server_field.type; client_field->flags= (uint16) server_field.flags; client_field->decimals= server_field.decimals; + if (server_field.type == MYSQL_TYPE_FLOAT || + server_field.type == MYSQL_TYPE_DOUBLE) + set_if_smaller(client_field->decimals, FLOATING_POINT_DECIMALS); + client_field->db_length= strlen(client_field->db); client_field->table_length= strlen(client_field->table); client_field->name_length= strlen(client_field->name); diff --git a/mysql-test/extra/rpl_tests/rpl_extra_col_master.test b/mysql-test/extra/rpl_tests/rpl_extra_col_master.test index 18b6c0532f2..0559e93676b 100644 --- a/mysql-test/extra/rpl_tests/rpl_extra_col_master.test +++ b/mysql-test/extra/rpl_tests/rpl_extra_col_master.test @@ -126,7 +126,7 @@ SELECT f1,f2,f3,f4,f5,f6,f7,f8,f9, --disable_query_log call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 2 type mismatch.* 1535"); -call mtr.add_suppression("Slave.*Can.t DROP .c7.; check that column.key exists.* error.* 1091"); +call mtr.add_suppression("Slave.*Can.t DROP COLUMN .c7.; check that .* exists.* error.* 1091"); call mtr.add_suppression("Slave.*Unknown column .c7. in .t15.* error.* 1054"); call mtr.add_suppression("Slave.*Key column .c6. doesn.t exist in table.* error.* 1072"); call mtr.add_suppression("Slave SQL.*Column 2 of table .test.t1.. cannot be converted from type.* error.* 1677"); @@ -155,7 +155,7 @@ connection master; f6 ENUM('a', 'b', 'c') default 'a', f7 DECIMAL(17,9) default '1000.00', f8 MEDIUMBLOB, - f9 NUMERIC(6,4) default '2000.00', + f9 NUMERIC(6,2) default '2000.00', f10 VARCHAR(1024), f11 BINARY(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0', f12 SET('a', 'b', 'c') default 'b') @@ -178,7 +178,7 @@ connection master; f5 DOUBLE DEFAULT '2.00', f6 DECIMAL(17,9) default '1000.00', f7 MEDIUMBLOB, - f8 NUMERIC(6,4) default '2000.00', + f8 NUMERIC(6,2) default '2000.00', f9 VARCHAR(1024), f10 BINARY(20) not null default '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0', f11 CHAR(255)) diff --git a/mysql-test/extra/rpl_tests/rpl_row_tabledefs.test b/mysql-test/extra/rpl_tests/rpl_row_tabledefs.test index ddff3fa51f7..194079b160a 100644 --- a/mysql-test/extra/rpl_tests/rpl_row_tabledefs.test +++ b/mysql-test/extra/rpl_tests/rpl_row_tabledefs.test @@ -73,7 +73,7 @@ ALTER TABLE t8 ADD e1 INT NOT NULL DEFAULT 0, ADD e2 INT NOT NULL DEFAULT 0, # the following INSERTs to pass the mode is switched temprorarily set @@global.slave_exec_mode= 'IDEMPOTENT'; -# so the inserts are going to be overriden +# so the inserts are going to be overridden INSERT INTO t1_int VALUES (2, 4, 4711); INSERT INTO t1_char VALUES (2, 4, 'Foo is a bar'); INSERT INTO t1_bit VALUES (2, 4, b'101', b'11100', b'01'); diff --git a/mysql-test/include/ctype_numconv.inc b/mysql-test/include/ctype_numconv.inc index 1d675a5db6f..6bda2205c0e 100644 --- a/mysql-test/include/ctype_numconv.inc +++ b/mysql-test/include/ctype_numconv.inc @@ -1818,6 +1818,12 @@ SELECT f1() FROM t1 LEFT JOIN (SELECT 1 AS a FROM t1 LIMIT 0) AS d ON 1 GROUP BY DROP FUNCTION f1; DROP TABLE t1; +--echo # +--echo # MDEV-9662 Assertion `precision || !scale' failed in my_decimal_precision_to_length_no_truncation(uint, uint8, bool) +--echo # +SELECT @@collation_connection; +SELECT CASE 1 WHEN 2 THEN ( - '3' ) END; + --echo # --echo # MDEV-5702 Incorrect results are returned with NULLIF() --echo # diff --git a/mysql-test/include/ctype_thai.inc b/mysql-test/include/ctype_thai.inc new file mode 100644 index 00000000000..f72de9e93b6 --- /dev/null +++ b/mysql-test/include/ctype_thai.inc @@ -0,0 +1,156 @@ +--echo # +--echo # Start of ctype_thai.inc +--echo # + +# +# Test Unicode Thai collations based on libthai testcases +# + +CREATE TABLE t1 (a VARCHAR(30) CHARACTER SET utf8 COLLATE utf8_bin); + +INSERT INTO t1 VALUES ('-à¸à¸£à¸°à¹à¸¢à¹ˆà¸‡'); +INSERT INTO t1 VALUES ('à¸à¸'); +INSERT INTO t1 VALUES ('à¸à¸£à¸²à¸š'); +INSERT INTO t1 VALUES ('ข่าง'); +INSERT INTO t1 VALUES ('ข้าง'); +INSERT INTO t1 VALUES ('ข้างà¸à¸£à¸°à¸”าน'); +INSERT INTO t1 VALUES ('ข้างขึ้น'); +INSERT INTO t1 VALUES ('ข้างควาย'); +INSERT INTO t1 VALUES ('ข้างเงิน'); +INSERT INTO t1 VALUES ('ข้างà¹à¸£à¸¡'); +INSERT INTO t1 VALUES ('ข้างออà¸'); +INSERT INTO t1 VALUES ('ข้างๆ'); +INSERT INTO t1 VALUES ('ข้างๆ คูๆ'); +INSERT INTO t1 VALUES ('ขาง'); +INSERT INTO t1 VALUES ('à¹à¸‚็ง'); +INSERT INTO t1 VALUES ('à¹à¸‚่ง'); +INSERT INTO t1 VALUES ('à¹à¸‚่งขัน'); +INSERT INTO t1 VALUES ('à¹à¸‚้ง'); +INSERT INTO t1 VALUES ('à¹à¸‚้งขวา'); +INSERT INTO t1 VALUES ('à¹à¸‚็งขัน'); +INSERT INTO t1 VALUES ('ทูลเà¸à¸¥à¹‰à¸²'); +INSERT INTO t1 VALUES ('ทูลเà¸à¸¥à¹‰à¸²à¸—ูลà¸à¸£à¸°à¸«à¸¡à¹ˆà¸­à¸¡'); +INSERT INTO t1 VALUES ('ทูลเà¸à¸¥à¹‰à¸²à¸¯'); +INSERT INTO t1 VALUES ('บุà¸à¸à¸²'); +INSERT INTO t1 VALUES ('บุà¸-หลง'); +INSERT INTO t1 VALUES ('บุà¸à¸«à¸¥à¸‡'); +INSERT INTO t1 VALUES ('ป่า'); +INSERT INTO t1 VALUES ('ป่าน'); +INSERT INTO t1 VALUES ('ป้า'); +INSERT INTO t1 VALUES ('ป้าน'); +INSERT INTO t1 VALUES ('ป๊า'); +INSERT INTO t1 VALUES ('ป๊าน'); +INSERT INTO t1 VALUES ('ป๋า'); +INSERT INTO t1 VALUES ('ป๋าน'); +INSERT INTO t1 VALUES ('ปา'); +INSERT INTO t1 VALUES ('ปาน'); +INSERT INTO t1 VALUES ('à¹à¸›à¹‰à¸‡'); +INSERT INTO t1 VALUES ('พณิชย์'); +INSERT INTO t1 VALUES ('ม้า'); +INSERT INTO t1 VALUES ('ฯพณฯ'); +INSERT INTO t1 VALUES ('A'); +INSERT INTO t1 VALUES ('a'); +INSERT INTO t1 VALUES ('a\''); +INSERT INTO t1 VALUES ('A-'); +INSERT INTO t1 VALUES ('a-'); +INSERT INTO t1 VALUES ('-a'); +INSERT INTO t1 VALUES ('A.'); +INSERT INTO t1 VALUES ('a.'); +INSERT INTO t1 VALUES ('A-1'); +INSERT INTO t1 VALUES ('aa'); +INSERT INTO t1 VALUES ('AA'); +INSERT INTO t1 VALUES ('A.A.'); +INSERT INTO t1 VALUES ('a.a.'); +INSERT INTO t1 VALUES ('AAA'); +INSERT INTO t1 VALUES ('A.A.A.'); +INSERT INTO t1 VALUES ('AAAA'); +INSERT INTO t1 VALUES ('A.A.A.L.'); +INSERT INTO t1 VALUES ('A.A.A.S.'); +INSERT INTO t1 VALUES ('Aachen'); +INSERT INTO t1 VALUES ('A.A.E.'); +INSERT INTO t1 VALUES ('A.Ae.E.'); +INSERT INTO t1 VALUES ('A.A.E.E.'); +INSERT INTO t1 VALUES ('AAES'); +INSERT INTO t1 VALUES ('AAF'); +INSERT INTO t1 VALUES ('A.Agr'); +INSERT INTO t1 VALUES ('aah'); +INSERT INTO t1 VALUES ('@@@@@'); +INSERT INTO t1 VALUES ('0000'); +INSERT INTO t1 VALUES ('9999'); +INSERT INTO t1 VALUES ('Aalborg'); +INSERT INTO t1 VALUES ('aide'); +INSERT INTO t1 VALUES ('air'); +INSERT INTO t1 VALUES ('@@@air'); +INSERT INTO t1 VALUES ('air@@@'); +INSERT INTO t1 VALUES ('C.A.F'); +INSERT INTO t1 VALUES ('Canon'); +INSERT INTO t1 VALUES ('coop'); +INSERT INTO t1 VALUES ('co-op'); +INSERT INTO t1 VALUES ('COOP'); +INSERT INTO t1 VALUES ('CO-OP'); +INSERT INTO t1 VALUES ('Copenhegen'); +INSERT INTO t1 VALUES ('McArthur'); +INSERT INTO t1 VALUES ('Mc Arthur'); +INSERT INTO t1 VALUES ('Mc Mahon'); +INSERT INTO t1 VALUES ('vice-president'); +INSERT INTO t1 VALUES ('vice versa'); +INSERT INTO t1 VALUES ('vice-versa'); +INSERT INTO t1 VALUES ('10 ลิตร'); +INSERT INTO t1 VALUES ('๑๠ลิตร'); +INSERT INTO t1 VALUES ('10 litre'); +INSERT INTO t1 VALUES ('10 litre (10 ลิตร)'); +INSERT INTO t1 VALUES ('10 ลิตร (10 litre)'); +INSERT INTO t1 VALUES ('10 litre (๑๠ลิตร)'); +INSERT INTO t1 VALUES ('๑๠ลิตร (10 litre)'); +INSERT INTO t1 VALUES ('๑๠ลิตร [10 litre]'); +INSERT INTO t1 VALUES ('๑๠ลิตร {10 litre}'); + +# Sort the table according to binary 'a' +# To avoid problems with unpredictable order or 'AA' and 'aa' +ALTER TABLE t1 ORDER BY a; + +SET @backup_character_set_connection=@@character_set_connection; +SET @backup_collation_connection=@@collation_connection; +SET NAMES utf8; +SET @stmt= CONCAT('ALTER TABLE t1 MODIFY a VARCHAR(30)', + ' CHARACTER SET ', @backup_character_set_connection, + ' COLLATE ', @backup_collation_connection, + ' , ADD id INT NOT NULL AUTO_INCREMENT PRIMARY KEY' + ' , ADD KEY a_id (a, id)'); +PREPARE stmt FROM @stmt; +EXECUTE stmt; +DEALLOCATE PREPARE stmt; +SET collation_connection=@backup_collation_connection; + +SHOW CREATE TABLE t1; + +--echo # +--echo # Ascending sort, using filesort +--echo # +EXPLAIN SELECT a FROM t1 ORDER BY a, BINARY a; +SELECT a FROM t1 ORDER BY a, BINARY a; + +--echo # +--echo # Descending sort, using filesort +--echo # +EXPLAIN SELECT a FROM t1 ORDER BY a DESC, BINARY a DESC; +SELECT a FROM t1 ORDER BY a DESC, BINARY a DESC; + + +--echo # +--echo # Ascending sort, using index +--echo # +EXPLAIN SELECT a FROM t1 ORDER BY a, id; +SELECT a FROM t1 ORDER BY a, id; + +--echo # +--echo # Descending sort, using index +--echo # +EXPLAIN SELECT a FROM t1 ORDER BY a DESC, id DESC; +SELECT a FROM t1 ORDER BY a DESC, id DESC; + +DROP TABLE t1; + +--echo # +--echo # End of ctype_thai.inc +--echo # diff --git a/mysql-test/include/ctype_uca_w2.inc b/mysql-test/include/ctype_uca_w2.inc new file mode 100644 index 00000000000..b59f73b8a63 --- /dev/null +++ b/mysql-test/include/ctype_uca_w2.inc @@ -0,0 +1,65 @@ +--echo # +--echo # Start of ctype_uca_w2.inc +--echo # + +SELECT @@collation_connection; + +SELECT ID, SORTLEN, COLLATION_NAME, CHARACTER_SET_NAME +FROM INFORMATION_SCHEMA.COLLATIONS +WHERE COLLATION_NAME LIKE @@collation_connection; + +--echo # +--echo # Testing strnxfrm +--echo # + +CREATE TABLE t1 AS SELECT SPACE(3) AS a LIMIT 0; +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (SPACE(0)),(SPACE(1)),(SPACE(2)); +SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(8))) FROM t1; +SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(4))) FROM t1; +SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 1)) FROM t1; +SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 2)) FROM t1; +SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 3)) FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 AS SELECT SPACE(10) AS a LIMIT 0; +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (_ucs2 0x3400); +INSERT INTO t1 VALUES (_ucs2 0xF001); +SELECT HEX(CONVERT(a USING ucs2)) AS ucs2, HEX(a), HEX(WEIGHT_STRING(a)) FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 AS SELECT SPACE(10) AS a LIMIT 0; +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES ('A'),('À'),('Ã'),('Â'),('Ã'),('Ä'),('Ã…'); +SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a; +SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a DESC; + +SET @backup_character_set_connection=@@character_set_connection; +SET @backup_collation_connection=@@collation_connection; + +SET NAMES utf8; +SET @stmt= CONCAT('ALTER TABLE t1 MODIFY a CHAR(10)' COLLATE utf8_bin, + ' CHARACTER SET ', @backup_character_set_connection, + ' COLLATE ', @backup_collation_connection); +PREPARE stmt FROM @stmt; +EXECUTE stmt; +DEALLOCATE PREPARE stmt; +SET collation_connection=@backup_collation_connection; + +SHOW CREATE TABLE t1; +SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a; +SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a DESC; +DROP TABLE t1; + +CREATE TABLE t1 AS SELECT SPACE(10) AS a LIMIT 0; +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES ('cota'),('cote'),('cotz'); +INSERT INTO t1 VALUES ('coté'),('côte'),('côté'),('cotë'),('côtë'); +SELECT * FROM t1 ORDER BY a; +SELECT * FROM t1 ORDER BY a DESC; +DROP TABLE t1; + +--echo # +--echo # End of ctype_uca_w2.inc +--echo # diff --git a/mysql-test/include/function_defaults.inc b/mysql-test/include/function_defaults.inc index cb8e8f86f93..7c5d43b6e74 100644 --- a/mysql-test/include/function_defaults.inc +++ b/mysql-test/include/function_defaults.inc @@ -4,51 +4,43 @@ SET TIME_ZONE = "+00:00"; --echo # Test of errors for column data types that dont support function --echo # defaults. --echo # ---error ER_INVALID_DEFAULT -eval CREATE TABLE t1( a BIT DEFAULT $current_timestamp ); ---error ER_INVALID_DEFAULT -eval CREATE TABLE t1( a TINYINT DEFAULT $current_timestamp ); ---error ER_INVALID_DEFAULT -eval CREATE TABLE t1( a SMALLINT DEFAULT $current_timestamp ); ---error ER_INVALID_DEFAULT -eval CREATE TABLE t1( a MEDIUMINT DEFAULT $current_timestamp ); ---error ER_INVALID_DEFAULT -eval CREATE TABLE t1( a INT DEFAULT $current_timestamp ); ---error ER_INVALID_DEFAULT -eval CREATE TABLE t1( a BIGINT DEFAULT $current_timestamp ); ---error ER_INVALID_DEFAULT -eval CREATE TABLE t1( a FLOAT DEFAULT $current_timestamp ); ---error ER_INVALID_DEFAULT -eval CREATE TABLE t1( a DECIMAL DEFAULT $current_timestamp ); ---error ER_INVALID_DEFAULT -eval CREATE TABLE t1( a DATE DEFAULT $current_timestamp ); ---error ER_INVALID_DEFAULT -eval CREATE TABLE t1( a TIME DEFAULT $current_timestamp ); ---error ER_INVALID_DEFAULT -eval CREATE TABLE t1( a YEAR DEFAULT $current_timestamp ); + +eval CREATE OR REPLACE TABLE t1( a BIT DEFAULT $current_timestamp ); +eval CREATE OR REPLACE TABLE t1( a TINYINT DEFAULT $current_timestamp ); +eval CREATE OR REPLACE TABLE t1( a SMALLINT DEFAULT $current_timestamp ); +eval CREATE OR REPLACE TABLE t1( a MEDIUMINT DEFAULT $current_timestamp ); +eval CREATE OR REPLACE TABLE t1( a INT DEFAULT $current_timestamp ); +eval CREATE OR REPLACE TABLE t1( a BIGINT DEFAULT $current_timestamp ); +eval CREATE OR REPLACE TABLE t1( a FLOAT DEFAULT $current_timestamp ); +eval CREATE OR REPLACE TABLE t1( a DECIMAL DEFAULT $current_timestamp ); +eval CREATE OR REPLACE TABLE t1( a DATE DEFAULT $current_timestamp ); +eval CREATE OR REPLACE TABLE t1( a TIME DEFAULT $current_timestamp ); +eval CREATE OR REPLACE TABLE t1( a YEAR DEFAULT $current_timestamp ); --error ER_INVALID_ON_UPDATE -eval CREATE TABLE t1( a BIT ON UPDATE $current_timestamp ); +eval CREATE OR REPLACE TABLE t1( a BIT ON UPDATE $current_timestamp ); --error ER_INVALID_ON_UPDATE -eval CREATE TABLE t1( a TINYINT ON UPDATE $current_timestamp ); +eval CREATE OR REPLACE TABLE t1( a TINYINT ON UPDATE $current_timestamp ); --error ER_INVALID_ON_UPDATE -eval CREATE TABLE t1( a SMALLINT ON UPDATE $current_timestamp ); +eval CREATE OR REPLACE TABLE t1( a SMALLINT ON UPDATE $current_timestamp ); --error ER_INVALID_ON_UPDATE -eval CREATE TABLE t1( a MEDIUMINT ON UPDATE $current_timestamp ); +eval CREATE OR REPLACE TABLE t1( a MEDIUMINT ON UPDATE $current_timestamp ); --error ER_INVALID_ON_UPDATE -eval CREATE TABLE t1( a INT ON UPDATE $current_timestamp ); +eval CREATE OR REPLACE TABLE t1( a INT ON UPDATE $current_timestamp ); --error ER_INVALID_ON_UPDATE -eval CREATE TABLE t1( a BIGINT ON UPDATE $current_timestamp ); +eval CREATE OR REPLACE TABLE t1( a BIGINT ON UPDATE $current_timestamp ); --error ER_INVALID_ON_UPDATE -eval CREATE TABLE t1( a FLOAT ON UPDATE $current_timestamp ); +eval CREATE OR REPLACE TABLE t1( a FLOAT ON UPDATE $current_timestamp ); --error ER_INVALID_ON_UPDATE -eval CREATE TABLE t1( a DECIMAL ON UPDATE $current_timestamp ); +eval CREATE OR REPLACE TABLE t1( a DECIMAL ON UPDATE $current_timestamp ); --error ER_INVALID_ON_UPDATE -eval CREATE TABLE t1( a DATE ON UPDATE $current_timestamp ); +eval CREATE OR REPLACE TABLE t1( a DATE ON UPDATE $current_timestamp ); --error ER_INVALID_ON_UPDATE -eval CREATE TABLE t1( a TIME ON UPDATE $current_timestamp ); +eval CREATE OR REPLACE TABLE t1( a TIME ON UPDATE $current_timestamp ); --error ER_INVALID_ON_UPDATE -eval CREATE TABLE t1( a YEAR ON UPDATE $current_timestamp ); +eval CREATE OR REPLACE TABLE t1( a YEAR ON UPDATE $current_timestamp ); + +drop table if exists t1; --echo # --echo # Test that the default clause behaves like NOW() regarding time zones. diff --git a/mysql-test/include/have_crypt.inc b/mysql-test/include/have_crypt.inc index cbf0a7ac876..422f8922edc 100644 --- a/mysql-test/include/have_crypt.inc +++ b/mysql-test/include/have_crypt.inc @@ -1,4 +1,5 @@ --- require r/have_crypt.require -disable_query_log; -show variables like 'have_crypt'; -enable_query_log; +# encrypt('a') is NULL if crypt(3) is not available +# encrypt('a') is "*0" in fips mode +if (`select length(encrypt('a')) > 3 IS NOT TRUE`) { + skip No crypt(3); +} diff --git a/mysql-test/include/have_des.inc b/mysql-test/include/have_des.inc new file mode 100644 index 00000000000..5abdaf6e2aa --- /dev/null +++ b/mysql-test/include/have_des.inc @@ -0,0 +1,6 @@ +# in the FIPS mode, OpenSSL disables DES and other weak algorithms +source include/have_ssl_crypto_functs.inc; + +if (`select des_encrypt("a", "b") IS NULL`) { + skip DES is disabled (fips mode?); +} diff --git a/mysql-test/include/mix2.inc b/mysql-test/include/mix2.inc index cdc39f8407f..24097514c21 100644 --- a/mysql-test/include/mix2.inc +++ b/mysql-test/include/mix2.inc @@ -54,7 +54,7 @@ # Set the SESSION DEFAULT STORAGE ENGINE to a value <> storage engine # to be tested. This must not affect any CREATE TABLE statement, where -# the storage engine is assigned explicitely, +# the storage engine is assigned explicitly, eval SET SESSION STORAGE_ENGINE = $other_engine_type; # diff --git a/mysql-test/lib/t/testMyConfig.t b/mysql-test/lib/t/testMyConfig.t index f79e8776676..3de61af0bb9 100755 --- a/mysql-test/lib/t/testMyConfig.t +++ b/mysql-test/lib/t/testMyConfig.t @@ -129,10 +129,10 @@ my $config3= My::Config->new($test_include_cnf); isa_ok( $config3, "My::Config" ); print $config3; is( $config3->value('mysqld', 'basedir'), 'anotherbasedir', - "mysqld_basedir has been overriden by value in test_include.cnf"); + "mysqld_basedir has been overridden by value in test_include.cnf"); is( $config3->value('mysqld', 'option1'), 'values3', - "mysqld_option1 has been overriden by value in test_include.cnf"); + "mysqld_option1 has been overridden by value in test_include.cnf"); is( $config3->value('mysqld', 'option2'), 'value4', "mysqld_option2 is from included file"); diff --git a/mysql-test/lib/v1/mysql-test-run.pl b/mysql-test/lib/v1/mysql-test-run.pl index 79489d92742..386b50b2723 100755 --- a/mysql-test/lib/v1/mysql-test-run.pl +++ b/mysql-test/lib/v1/mysql-test-run.pl @@ -638,7 +638,7 @@ sub command_line_setup () { if (! -f $glob_scriptname) { mtr_error("Can't find the location for the mysql-test-run script\n" . - "Go to to the mysql-test directory and execute the script " . + "Go to the mysql-test directory and execute the script " . "as follows:\n./$glob_scriptname"); } @@ -4133,7 +4133,7 @@ sub valgrind_arguments { if -f "$glob_mysql_test_dir/valgrind.supp"; } - # Add valgrind options, can be overriden by user + # Add valgrind options, can be overridden by user mtr_add_arg($args, '%s', $_) for (@valgrind_args); mtr_add_arg($args, $$exe); diff --git a/mysql-test/mysql-stress-test.pl b/mysql-test/mysql-stress-test.pl index 74394e2afbd..18813c3a761 100755 --- a/mysql-test/mysql-stress-test.pl +++ b/mysql-test/mysql-stress-test.pl @@ -1079,7 +1079,7 @@ sub log_session_errors { lock ($log_file_lock); - #header in the begining of log file + #header in the beginning of log file if (!-e $stress_log_file) { stress_log($stress_log_file, diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 7e5292c1a8e..0cddff81960 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1385,7 +1385,7 @@ sub command_line_setup { if ( @opt_cases ) { - # Run big tests if explicitely specified on command line + # Run big tests if explicitly specified on command line $opt_big_test= 1; } @@ -1783,9 +1783,12 @@ sub set_build_thread_ports($) { if ( lc($opt_build_thread) eq 'auto' ) { my $found_free = 0; $build_thread = 300; # Start attempts from here + my $build_thread_upper = $build_thread + ($opt_parallel > 1500 + ? 3000 + : 2 * $opt_parallel) + 300; while (! $found_free) { - $build_thread= mtr_get_unique_id($build_thread, 349); + $build_thread= mtr_get_unique_id($build_thread, $build_thread_upper); if ( !defined $build_thread ) { mtr_error("Could not get a unique build thread id"); } @@ -1854,11 +1857,17 @@ sub collect_mysqld_features { $list =~ s/\n {22}(\S)/ $1/g; my @list= split '\n', $list; + + $mysql_version_id= 0; + while (defined(my $line = shift @list)){ + if ($line =~ /^\Q$exe_mysqld\E\s+Ver\s(\d+)\.(\d+)\.(\d+)(\S*)/ ) { + $mysql_version_id= $1*10000 + $2*100 + $3; + mtr_report("MariaDB Version $1.$2.$3$4"); + last; + } + } mtr_error("Could not find version of MariaDB") - unless shift(@list) =~ /^\Q$exe_mysqld\E\s+Ver\s(\d+)\.(\d+)\.(\d+)(\S*)/; - $mysql_version_id= $1*10000 + $2*100 + $3; - $mysql_version_extra= $4; - mtr_report("MariaDB Version $1.$2.$3$4"); + unless $mysql_version_id > 0; for (@list) { @@ -3222,7 +3231,7 @@ sub mysql_install_db { # Create mtr database mtr_tofile($bootstrap_sql_file, - "CREATE DATABASE mtr;\n"); + "CREATE DATABASE mtr CHARSET=latin1;\n"); # Add help tables and data for warning detection and supression mtr_tofile($bootstrap_sql_file, @@ -5841,7 +5850,7 @@ sub valgrind_arguments { } } - # Add valgrind options, can be overriden by user + # Add valgrind options, can be overridden by user mtr_add_arg($args, '%s', $_) for (@valgrind_args); mtr_add_arg($args, $$exe); @@ -5868,7 +5877,7 @@ sub strace_arguments { mtr_add_arg($args, "-f"); mtr_add_arg($args, "-o%s/var/log/%s.strace", $glob_mysql_test_dir, $mysqld_name); - # Add strace options, can be overriden by user + # Add strace options, can be overridden by user mtr_add_arg($args, '%s', $_) for (@strace_args); mtr_add_arg($args, $$exe); diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result index 3388e7fcdcd..0801890c384 100644 --- a/mysql-test/r/alter_table.result +++ b/mysql-test/r/alter_table.result @@ -393,15 +393,15 @@ default charset latin1 collate latin1_general_cs; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `myblob` longblob, - `mytext` longtext COLLATE latin1_general_cs + `myblob` longblob DEFAULT NULL, + `mytext` longtext COLLATE latin1_general_cs DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs alter table t1 character set latin2; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `myblob` longblob, - `mytext` longtext CHARACTER SET latin1 COLLATE latin1_general_cs + `myblob` longblob DEFAULT NULL, + `mytext` longtext CHARACTER SET latin1 COLLATE latin1_general_cs DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin2 drop table t1; CREATE TABLE t1 (a int PRIMARY KEY, b INT UNIQUE); @@ -414,12 +414,12 @@ t1 CREATE TABLE `t1` ( UNIQUE KEY `b` (`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 ALTER TABLE t1 DROP PRIMARY KEY; -ERROR 42000: Can't DROP 'PRIMARY'; check that column/key exists +ERROR 42000: Can't DROP INDEX `PRIMARY`; check that it exists DROP TABLE t1; create table t1 (a int, b int, key(a)); insert into t1 values (1,1), (2,2); alter table t1 drop key no_such_key; -ERROR 42000: Can't DROP 'no_such_key'; check that column/key exists +ERROR 42000: Can't DROP INDEX `no_such_key`; check that it exists alter table t1 drop key a; drop table t1; CREATE TABLE T12207(a int) ENGINE=MYISAM; @@ -900,7 +900,7 @@ alter table t1 convert to character set utf8; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` text + `a` text DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 drop table t1; create table t1 (a mediumtext character set latin1); @@ -908,7 +908,7 @@ alter table t1 convert to character set utf8; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` longtext + `a` longtext DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 drop table t1; End of 5.0 tests @@ -1374,7 +1374,7 @@ Note 1060 Duplicate column name 'lol' ALTER TABLE t1 DROP COLUMN IF EXISTS lol; ALTER TABLE t1 DROP COLUMN IF EXISTS lol; Warnings: -Note 1091 Can't DROP 'lol'; check that column/key exists +Note 1091 Can't DROP COLUMN `lol`; check that it exists ALTER TABLE t1 ADD KEY IF NOT EXISTS x_param(x_param); ALTER TABLE t1 ADD KEY IF NOT EXISTS x_param(x_param); Warnings: @@ -1385,7 +1385,7 @@ Note 1054 Unknown column 'lol' in 't1' DROP INDEX IF EXISTS x_param ON t1; DROP INDEX IF EXISTS x_param ON t1; Warnings: -Note 1091 Can't DROP 'x_param'; check that column/key exists +Note 1091 Can't DROP INDEX `x_param`; check that it exists CREATE INDEX IF NOT EXISTS x_param1 ON t1(x_param); CREATE INDEX IF NOT EXISTS x_param1 ON t1(x_param); Warnings: @@ -1416,7 +1416,7 @@ Note 1060 Duplicate column name 'lol' ALTER TABLE t1 DROP COLUMN IF EXISTS lol; ALTER TABLE t1 DROP COLUMN IF EXISTS lol; Warnings: -Note 1091 Can't DROP 'lol'; check that column/key exists +Note 1091 Can't DROP COLUMN `lol`; check that it exists ALTER TABLE t1 ADD KEY IF NOT EXISTS x_param(x_param); ALTER TABLE t1 ADD KEY IF NOT EXISTS x_param(x_param); Warnings: @@ -1427,7 +1427,7 @@ Note 1054 Unknown column 'lol' in 't1' DROP INDEX IF EXISTS x_param ON t1; DROP INDEX IF EXISTS x_param ON t1; Warnings: -Note 1091 Can't DROP 'x_param'; check that column/key exists +Note 1091 Can't DROP INDEX `x_param`; check that it exists CREATE INDEX IF NOT EXISTS x_param1 ON t1(x_param); CREATE INDEX IF NOT EXISTS x_param1 ON t1(x_param); Warnings: @@ -1447,7 +1447,7 @@ Note 1061 Duplicate key name 'fk' ALTER TABLE t2 DROP FOREIGN KEY IF EXISTS fk; ALTER TABLE t2 DROP FOREIGN KEY IF EXISTS fk; Warnings: -Note 1091 Can't DROP 'fk'; check that column/key exists +Note 1091 Can't DROP FOREIGN KEY `fk`; check that it exists SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( @@ -1461,7 +1461,7 @@ Note 1061 Duplicate key name 't2_ibfk_1' ALTER TABLE t2 DROP FOREIGN KEY IF EXISTS t2_ibfk_1; ALTER TABLE t2 DROP FOREIGN KEY IF EXISTS t2_ibfk_1; Warnings: -Note 1091 Can't DROP 't2_ibfk_1'; check that column/key exists +Note 1091 Can't DROP FOREIGN KEY `t2_ibfk_1`; check that it exists SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( @@ -1486,10 +1486,10 @@ t2 CREATE TABLE `t2` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 ALTER TABLE t2 DROP KEY k_id, DROP KEY IF EXISTS k_id; Warnings: -Note 1091 Can't DROP 'k_id'; check that column/key exists +Note 1091 Can't DROP INDEX `k_id`; check that it exists ALTER TABLE t2 DROP COLUMN a, DROP COLUMN IF EXISTS a; Warnings: -Note 1091 Can't DROP 'a'; check that column/key exists +Note 1091 Can't DROP COLUMN `a`; check that it exists SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( @@ -1504,7 +1504,7 @@ ALTER TABLE t1 DROP KEY IF EXISTS transaction_id, ADD PRIMARY KEY IF NOT EXISTS SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `transaction_id` int(11) NOT NULL DEFAULT '0', + `transaction_id` int(11) NOT NULL DEFAULT 0, PRIMARY KEY (`transaction_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -1667,6 +1667,8 @@ ALTER TABLE m1 ENABLE KEYS, ALGORITHM= INPLACE, LOCK= EXCLUSIVE; affected rows: 0 ALTER TABLE m1 ENABLE KEYS, ALGORITHM= COPY, LOCK= NONE; ERROR 0A000: LOCK=NONE is not supported. Reason: COPY algorithm requires a lock. Try LOCK=SHARED. +ALTER ONLINE TABLE m1 ADD COLUMN c int; +ERROR 0A000: LOCK=NONE is not supported for this operation. Try LOCK=SHARED. ALTER TABLE m1 ENABLE KEYS, ALGORITHM= COPY, LOCK= SHARED; affected rows: 2 info: Records: 2 Duplicates: 0 Warnings: 0 diff --git a/mysql-test/r/alter_table_mdev539_maria.result b/mysql-test/r/alter_table_mdev539_maria.result index 703908825d2..769c8b11b00 100644 --- a/mysql-test/r/alter_table_mdev539_maria.result +++ b/mysql-test/r/alter_table_mdev539_maria.result @@ -10,10 +10,10 @@ drop index `primary` on lineitem; show create table lineitem; Table Create Table lineitem CREATE TABLE `lineitem` ( - `l_orderkey` int(11) NOT NULL DEFAULT '0', + `l_orderkey` int(11) NOT NULL DEFAULT 0, `l_partkey` int(11) DEFAULT NULL, `l_suppkey` int(11) DEFAULT NULL, - `l_linenumber` int(11) NOT NULL DEFAULT '0', + `l_linenumber` int(11) NOT NULL DEFAULT 0, `l_quantity` double DEFAULT NULL, `l_extendedprice` double DEFAULT NULL, `l_discount` double DEFAULT NULL, @@ -39,10 +39,10 @@ alter table lineitem add primary key (l_orderkey, l_linenumber); show create table lineitem; Table Create Table lineitem CREATE TABLE `lineitem` ( - `l_orderkey` int(11) NOT NULL DEFAULT '0', + `l_orderkey` int(11) NOT NULL DEFAULT 0, `l_partkey` int(11) DEFAULT NULL, `l_suppkey` int(11) DEFAULT NULL, - `l_linenumber` int(11) NOT NULL DEFAULT '0', + `l_linenumber` int(11) NOT NULL DEFAULT 0, `l_quantity` double DEFAULT NULL, `l_extendedprice` double DEFAULT NULL, `l_discount` double DEFAULT NULL, @@ -80,10 +80,10 @@ ERROR 23000: Duplicate entry '1-2' for key 'PRIMARY' show create table lineitem; Table Create Table lineitem CREATE TABLE `lineitem` ( - `l_orderkey` int(11) NOT NULL DEFAULT '0', + `l_orderkey` int(11) NOT NULL DEFAULT 0, `l_partkey` int(11) DEFAULT NULL, `l_suppkey` int(11) DEFAULT NULL, - `l_linenumber` int(11) NOT NULL DEFAULT '0', + `l_linenumber` int(11) NOT NULL DEFAULT 0, `l_quantity` double DEFAULT NULL, `l_extendedprice` double DEFAULT NULL, `l_discount` double DEFAULT NULL, @@ -114,10 +114,10 @@ alter table lineitem add primary key (l_orderkey, l_linenumber); show create table lineitem; Table Create Table lineitem CREATE TABLE `lineitem` ( - `l_orderkey` int(11) NOT NULL DEFAULT '0', + `l_orderkey` int(11) NOT NULL DEFAULT 0, `l_partkey` int(11) DEFAULT NULL, `l_suppkey` int(11) DEFAULT NULL, - `l_linenumber` int(11) NOT NULL DEFAULT '0', + `l_linenumber` int(11) NOT NULL DEFAULT 0, `l_quantity` double DEFAULT NULL, `l_extendedprice` double DEFAULT NULL, `l_discount` double DEFAULT NULL, diff --git a/mysql-test/r/alter_table_mdev539_myisam.result b/mysql-test/r/alter_table_mdev539_myisam.result index 7140c544836..bf2a3f49203 100644 --- a/mysql-test/r/alter_table_mdev539_myisam.result +++ b/mysql-test/r/alter_table_mdev539_myisam.result @@ -10,10 +10,10 @@ drop index `primary` on lineitem; show create table lineitem; Table Create Table lineitem CREATE TABLE `lineitem` ( - `l_orderkey` int(11) NOT NULL DEFAULT '0', + `l_orderkey` int(11) NOT NULL DEFAULT 0, `l_partkey` int(11) DEFAULT NULL, `l_suppkey` int(11) DEFAULT NULL, - `l_linenumber` int(11) NOT NULL DEFAULT '0', + `l_linenumber` int(11) NOT NULL DEFAULT 0, `l_quantity` double DEFAULT NULL, `l_extendedprice` double DEFAULT NULL, `l_discount` double DEFAULT NULL, @@ -39,10 +39,10 @@ alter table lineitem add primary key (l_orderkey, l_linenumber); show create table lineitem; Table Create Table lineitem CREATE TABLE `lineitem` ( - `l_orderkey` int(11) NOT NULL DEFAULT '0', + `l_orderkey` int(11) NOT NULL DEFAULT 0, `l_partkey` int(11) DEFAULT NULL, `l_suppkey` int(11) DEFAULT NULL, - `l_linenumber` int(11) NOT NULL DEFAULT '0', + `l_linenumber` int(11) NOT NULL DEFAULT 0, `l_quantity` double DEFAULT NULL, `l_extendedprice` double DEFAULT NULL, `l_discount` double DEFAULT NULL, @@ -80,10 +80,10 @@ ERROR 23000: Duplicate entry '1-2' for key 'PRIMARY' show create table lineitem; Table Create Table lineitem CREATE TABLE `lineitem` ( - `l_orderkey` int(11) NOT NULL DEFAULT '0', + `l_orderkey` int(11) NOT NULL DEFAULT 0, `l_partkey` int(11) DEFAULT NULL, `l_suppkey` int(11) DEFAULT NULL, - `l_linenumber` int(11) NOT NULL DEFAULT '0', + `l_linenumber` int(11) NOT NULL DEFAULT 0, `l_quantity` double DEFAULT NULL, `l_extendedprice` double DEFAULT NULL, `l_discount` double DEFAULT NULL, @@ -114,10 +114,10 @@ alter table lineitem add primary key (l_orderkey, l_linenumber); show create table lineitem; Table Create Table lineitem CREATE TABLE `lineitem` ( - `l_orderkey` int(11) NOT NULL DEFAULT '0', + `l_orderkey` int(11) NOT NULL DEFAULT 0, `l_partkey` int(11) DEFAULT NULL, `l_suppkey` int(11) DEFAULT NULL, - `l_linenumber` int(11) NOT NULL DEFAULT '0', + `l_linenumber` int(11) NOT NULL DEFAULT 0, `l_quantity` double DEFAULT NULL, `l_extendedprice` double DEFAULT NULL, `l_discount` double DEFAULT NULL, diff --git a/mysql-test/r/alter_table_online.result b/mysql-test/r/alter_table_online.result index 05d03aeae11..e3f285437a7 100644 --- a/mysql-test/r/alter_table_online.result +++ b/mysql-test/r/alter_table_online.result @@ -1,4 +1,3 @@ -drop table if exists t1,t2,t3; create table t1 (a int not null primary key, b int, c varchar(80), e enum('a','b')); insert into t1 (a) values (1),(2),(3); alter online table t1 modify b int default 5; @@ -62,6 +61,18 @@ create table t3 (a int not null primary key, b int, c varchar(80)) engine=merge alter online table t3 union=(t1,t2); ERROR 0A000: LOCK=NONE/SHARED is not supported for this operation. Try LOCK=EXCLUSIVE. drop table t1,t2,t3; +create table t1 (i int) partition by hash(i) partitions 2; +alter online table t1 comment 'test'; +drop table t1; +create table t1 (a int); +alter online table t1 modify a int comment 'test'; +drop table t1; +create table t1 (a int) engine=innodb; +alter online table t1 modify a int comment 'test'; +drop table t1; +create table t1 (a int) partition by hash(a) partitions 2; +alter online table t1 modify a int comment 'test'; +drop table t1; # # MDEV-8948 ALTER ... INPLACE does work for BINARY, BLOB # diff --git a/mysql-test/r/bigint.result b/mysql-test/r/bigint.result index cc2ab456833..2c8b0b484ae 100644 --- a/mysql-test/r/bigint.result +++ b/mysql-test/r/bigint.result @@ -385,7 +385,7 @@ def -((9223372036854775808)) 8 20 20 N 32897 0 63 -9223372036854775808 select -(-(9223372036854775808)); Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def -(-(9223372036854775808)) 246 21 19 N 32897 0 63 +def -(-(9223372036854775808)) 246 20 19 N 32897 0 63 -(-(9223372036854775808)) 9223372036854775808 select --9223372036854775808, ---9223372036854775808, ----9223372036854775808; @@ -502,3 +502,9 @@ a SELECT * FROM t1 WHERE a IN (0.8,0.9); a DROP TABLE t1; +# +# MDEV-9372 select 100 between 1 and 9223372036854775808 returns false +# +SELECT 100 BETWEEN 1 AND 9223372036854775808; +100 BETWEEN 1 AND 9223372036854775808 +1 diff --git a/mysql-test/r/bug12427262.result b/mysql-test/r/bug12427262.result index c541ba0f664..8ec14efc45e 100644 --- a/mysql-test/r/bug12427262.result +++ b/mysql-test/r/bug12427262.result @@ -33,7 +33,7 @@ like "%show_table_lw_db%" AND FILE_NAME like "%.frm%" AND EVENT_NAME='wait/io/fi into @count_read_after; select @count_read_after-@count_read_before; @count_read_after-@count_read_before -0.000000000000000000000000000000 +0.00000000000000000000000000000000000000 show full tables; Tables_in_show_table_lw_db Table_type t1 BASE TABLE @@ -51,6 +51,6 @@ like "%show_table_lw_db%" AND FILE_NAME like "%.frm%" AND EVENT_NAME='wait/io/fi into @count_read_after; select @count_read_after-@count_read_before; @count_read_after-@count_read_before -10.000000000000000000000000000000 +10.00000000000000000000000000000000000000 drop table t1; drop database show_table_lw_db; diff --git a/mysql-test/r/bug46760.result b/mysql-test/r/bug46760.result index 46b8c23b95c..f05d6c5ef99 100644 --- a/mysql-test/r/bug46760.result +++ b/mysql-test/r/bug46760.result @@ -18,7 +18,7 @@ info: Records: 0 Duplicates: 0 Warnings: 0 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT '10' + `a` int(11) DEFAULT 10 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 DROP TABLE t1; # diff --git a/mysql-test/r/cache_temporal_4265.result b/mysql-test/r/cache_temporal_4265.result index b8f13e465de..980bb957e19 100644 --- a/mysql-test/r/cache_temporal_4265.result +++ b/mysql-test/r/cache_temporal_4265.result @@ -8,4 +8,17 @@ a Warnings: Note 1003 2000-01-01 Note 1003 2000-01-06 +set debug_dbug=''; +drop table t1; +create table t1 (id int not null, ut timestamp(6) not null); +insert into t1 values(1, '2001-01-01 00:00:00.2'); +insert into t1 values(1, '2001-01-01 00:00:00.1'); +select * from t1; +id ut +1 2001-01-01 00:00:00.200000 +1 2001-01-01 00:00:00.100000 +select (select max(m2.ut) from t1 m2 where m1.id <> 0) from t1 m1; +(select max(m2.ut) from t1 m2 where m1.id <> 0) +2001-01-01 00:00:00.200000 +2001-01-01 00:00:00.200000 drop table t1; diff --git a/mysql-test/r/case.result b/mysql-test/r/case.result index b1e928c5e30..9ceb7efde64 100644 --- a/mysql-test/r/case.result +++ b/mysql-test/r/case.result @@ -232,6 +232,19 @@ case t1.f1 when '00:00:00' then 1 end NULL drop table t1; # +# MDEV-9745 Crash with CASE WHEN TRUE THEN COALESCE(CAST(NULL AS UNSIGNED)) ELSE 4 END +# +CREATE TABLE t1 SELECT CASE WHEN TRUE THEN COALESCE(CAST(NULL AS UNSIGNED)) ELSE 4 END AS a; +DESCRIBE t1; +Field Type Null Key Default Extra +a decimal(1,0) YES NULL +DROP TABLE t1; +CREATE TABLE t1 SELECT CASE WHEN TRUE THEN COALESCE(CAST(NULL AS UNSIGNED)) ELSE 40 END AS a; +DESCRIBE t1; +Field Type Null Key Default Extra +a decimal(2,0) YES NULL +DROP TABLE t1; +# # Start of 10.1 test # # diff --git a/mysql-test/r/cast.result b/mysql-test/r/cast.result index da23f8af40c..e196ba294d7 100644 --- a/mysql-test/r/cast.result +++ b/mysql-test/r/cast.result @@ -390,9 +390,9 @@ ERROR 42000: Too big precision 66 specified for '1'. Maximum is 65. select cast(1 as decimal(66,6)); ERROR 42000: Too big precision 66 specified for '1'. Maximum is 65. select cast(1 as decimal(64,63)); -ERROR 42000: Too big scale 63 specified for '1'. Maximum is 30. +ERROR 42000: Too big scale 63 specified for '1'. Maximum is 38. select cast(1 as double(64,63)); -ERROR 42000: Too big scale 63 specified for '1'. Maximum is 30. +ERROR 42000: Too big scale 63 specified for '1'. Maximum is 38. set names binary; select cast(_latin1'test' as char character set latin2); cast(_latin1'test' as char character set latin2) @@ -601,8 +601,8 @@ double_val cast_val -1e30 -9223372036854775808 1e30 9223372036854775807 Warnings: -Warning 1292 Truncated incorrect INTEGER value: '-1e30' -Warning 1292 Truncated incorrect INTEGER value: '1e30' +Warning 1916 Got overflow when converting '-1e30' to INT. Value truncated. +Warning 1916 Got overflow when converting '1e30' to INT. Value truncated. DROP TABLE t1; select isnull(date(NULL)), isnull(cast(NULL as DATE)); isnull(date(NULL)) isnull(cast(NULL as DATE)) diff --git a/mysql-test/r/change_user.result b/mysql-test/r/change_user.result index 1de97ed02e6..fa934fbf09a 100644 --- a/mysql-test/r/change_user.result +++ b/mysql-test/r/change_user.result @@ -90,3 +90,14 @@ NULL FLUSH STATUS; Value of com_select did not change set global secure_auth=default; +set timestamp=unix_timestamp('2010-10-10 10:10:10'); +select now(); +now() +2010-10-10 10:10:10 +select year(now()) > 2011; +year(now()) > 2011 +0 +change_user +select year(now()) > 2011; +year(now()) > 2011 +1 diff --git a/mysql-test/r/check_constraint.result b/mysql-test/r/check_constraint.result new file mode 100644 index 00000000000..f3c1fda1eee --- /dev/null +++ b/mysql-test/r/check_constraint.result @@ -0,0 +1,133 @@ +set @save_check_constraint=@@check_constraint_checks; +create table t1 (a int check(a>10), b int check (b > 20), constraint `min` check (a+b > 100), constraint `max` check (a+b <500)) engine=myisam; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL CHECK (a>10), + `b` int(11) DEFAULT NULL CHECK (b > 20), + CONSTRAINT `min` CHECK (a+b > 100), + CONSTRAINT `max` CHECK (a+b <500) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (100,100); +insert into t1 values (1,1); +ERROR 23000: CONSTRAINT `a` failed for `test`.`t1` +insert into t1 values (20,1); +ERROR 23000: CONSTRAINT `b` failed for `test`.`t1` +insert into t1 values (20,30); +ERROR 23000: CONSTRAINT `min` failed for `test`.`t1` +insert into t1 values (500,500); +ERROR 23000: CONSTRAINT `max` failed for `test`.`t1` +insert into t1 values (101,101),(102,102),(600,600),(103,103); +ERROR 23000: CONSTRAINT `max` failed for `test`.`t1` +select * from t1; +a b +100 100 +101 101 +102 102 +truncate table t1; +insert ignore into t1 values (101,101),(102,102),(600,600),(103,103); +Warnings: +Warning 4025 CONSTRAINT `max` failed for `test`.`t1` +select * from t1; +a b +101 101 +102 102 +103 103 +set check_constraint_checks=0; +truncate table t1; +insert into t1 values (101,101),(102,102),(600,600),(103,103); +select * from t1; +a b +101 101 +102 102 +600 600 +103 103 +set check_constraint_checks=@save_check_constraint; +alter table t1 add c int default 0 check (c < 10); +ERROR 23000: CONSTRAINT `max` failed for table +set check_constraint_checks=0; +alter table t1 add c int default 0 check (c < 10); +alter table t1 add check (a+b+c < 500); +set check_constraint_checks=@save_check_constraint; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL CHECK (a>10), + `b` int(11) DEFAULT NULL CHECK (b > 20), + `c` int(11) DEFAULT 0 CHECK (c < 10), + CONSTRAINT `min` CHECK (a+b > 100), + CONSTRAINT `max` CHECK (a+b <500), + CONSTRAINT `CONSTRAINT_1` CHECK (a+b+c < 500) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values(105,105,105); +ERROR 23000: CONSTRAINT `c` failed for `test`.`t1` +insert into t1 values(249,249,9); +ERROR 23000: CONSTRAINT `CONSTRAINT_1` failed for `test`.`t1` +insert into t1 values(105,105,9); +select * from t1; +a b c +101 101 0 +102 102 0 +600 600 0 +103 103 0 +105 105 9 +create table t2 like t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL CHECK (a>10), + `b` int(11) DEFAULT NULL CHECK (b > 20), + `c` int(11) DEFAULT 0 CHECK (c < 10), + CONSTRAINT `min` CHECK (a+b > 100), + CONSTRAINT `max` CHECK (a+b <500), + CONSTRAINT `CONSTRAINT_1` CHECK (a+b+c < 500) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +alter table t2 drop constraint c; +ERROR 42000: Can't DROP CONSTRAINT `c`; check that it exists +alter table t2 drop constraint if exists c; +Warnings: +Note 1091 Can't DROP CONSTRAINT `c`; check that it exists +alter table t2 drop constraint min; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL CHECK (a>10), + `b` int(11) DEFAULT NULL CHECK (b > 20), + `c` int(11) DEFAULT 0 CHECK (c < 10), + CONSTRAINT `max` CHECK (a+b <500), + CONSTRAINT `CONSTRAINT_1` CHECK (a+b+c < 500) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1,t2; +create or replace table t1 (a int, b int, constraint check (a>b)); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + CONSTRAINT `CONSTRAINT_1` CHECK (a>b) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +create or replace table t1 (a int, b int, +constraint CONSTRAINT_1 check (a>1), +constraint check (b>1)); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + CONSTRAINT `CONSTRAINT_1` CHECK (a>1), + CONSTRAINT `CONSTRAINT_2` CHECK (b>1) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +create or replace table t1 (a int, b int, +constraint CONSTRAINT_1 check (a>1), +constraint check (b>1), +constraint CONSTRAINT_2 check (a>b)); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + CONSTRAINT `CONSTRAINT_1` CHECK (a>1), + CONSTRAINT `CONSTRAINT_3` CHECK (b>1), + CONSTRAINT `CONSTRAINT_2` CHECK (a>b) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; diff --git a/mysql-test/r/comment_column2.result b/mysql-test/r/comment_column2.result index 6fa5d73b70a..99402e7f5b4 100644 --- a/mysql-test/r/comment_column2.result +++ b/mysql-test/r/comment_column2.result @@ -249,7 +249,7 @@ abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghij SELECT comment,index_comment,char_length(index_comment) FROM information_schema.statistics WHERE table_name='t1'; comment index_comment char_length(index_comment) ALTER TABLE t1 ADD COLUMN c64 INTEGER COMMENT 'abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghij'; -ERROR HY000: Too many columns +ERROR HY000: Table definition is too large SELECT table_comment,char_length(table_comment) FROM information_schema.tables WHERE table_name='t1'; table_comment char_length(table_comment) 0 @@ -388,7 +388,7 @@ c63 INTEGER COMMENT 'abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghi c64 INTEGER COMMENT 'abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghij', c65 INTEGER COMMENT 'abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghij') ; -ERROR HY000: Too many columns +ERROR HY000: Table definition is too large SELECT table_comment,char_length(table_comment) FROM information_schema.tables WHERE table_name='t1'; table_comment char_length(table_comment) SELECT column_comment,char_length(column_comment) FROM information_schema.columns WHERE table_name='t1'; diff --git a/mysql-test/r/constraints.result b/mysql-test/r/constraints.result index 3bec2c3e16d..9fcb8a0f4d7 100644 --- a/mysql-test/r/constraints.result +++ b/mysql-test/r/constraints.result @@ -1,17 +1,44 @@ drop table if exists t1; create table t1 (a int check (a>0)); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL CHECK (a>0) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1); insert into t1 values (0); +ERROR 23000: CONSTRAINT `a` failed for `test`.`t1` drop table t1; create table t1 (a int, b int, check (a>b)); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + CONSTRAINT `CONSTRAINT_1` CHECK (a>b) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,0); insert into t1 values (0,1); +ERROR 23000: CONSTRAINT `CONSTRAINT_1` failed for `test`.`t1` drop table t1; create table t1 (a int ,b int, constraint abc check (a>b)); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + CONSTRAINT `abc` CHECK (a>b) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,0); insert into t1 values (0,1); +ERROR 23000: CONSTRAINT `abc` failed for `test`.`t1` drop table t1; create table t1 (a int null); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1),(NULL); drop table t1; create table t1 (a int null); diff --git a/mysql-test/r/contributors.result b/mysql-test/r/contributors.result index 1820c0a5f06..1e01ca81990 100644 --- a/mysql-test/r/contributors.result +++ b/mysql-test/r/contributors.result @@ -7,7 +7,7 @@ Visma http://visma.com Member of the MariaDB Foundation Nexedi http://www.nexedi.com Member of the MariaDB Foundation Acronis http://www.acronis.com Member of the MariaDB Foundation Verkkokauppa.com Finland Sponsor of the MariaDB Foundation -Webyog Bangalore Sponsor of the MariaDB Foundation +Virtuozzo https://virtuozzo.com/ Sponsor of the MariaDB Foundation Google USA Sponsoring encryption, parallel replication and GTID Facebook USA Sponsoring non-blocking API, LIMIT ROWS EXAMINED etc Ronald Bradford Brisbane, Australia EFF contribution for UC2006 Auction diff --git a/mysql-test/r/create-uca.result b/mysql-test/r/create-uca.result index 2d2522a36a3..f405cb72b40 100644 --- a/mysql-test/r/create-uca.result +++ b/mysql-test/r/create-uca.result @@ -10,7 +10,7 @@ COLLATE latin1_bin; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` int(11) DEFAULT '12' COMMENT 'column1', + `c1` int(11) DEFAULT 12 COMMENT 'column1', `c2` int(11) DEFAULT NULL COMMENT 'column2', `c3` int(11) NOT NULL COMMENT 'column3', `c4` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT 'a', @@ -21,7 +21,7 @@ CREATE TABLE t2 AS SELECT * FROM t1; SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( - `c1` int(11) DEFAULT '12' COMMENT 'column1', + `c1` int(11) DEFAULT 12 COMMENT 'column1', `c2` int(11) DEFAULT NULL COMMENT 'column2', `c3` int(11) NOT NULL COMMENT 'column3', `c4` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT 'a', diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result index 7b54f0633b5..e7dfa79c803 100644 --- a/mysql-test/r/create.result +++ b/mysql-test/r/create.result @@ -803,8 +803,8 @@ select a1,a2 from t1; show create table t2; Table Create Table t2 CREATE TABLE `t2` ( - `a` int(11) DEFAULT '3', - `b` int(11) DEFAULT '3', + `a` int(11) DEFAULT 3, + `b` int(11) DEFAULT 3, `a1` int(11) DEFAULT NULL, `a2` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 @@ -1133,46 +1133,46 @@ create table t1 like information_schema.processlist; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `ID` bigint(4) NOT NULL DEFAULT '0', + `ID` bigint(4) NOT NULL DEFAULT 0, `USER` varchar(128) NOT NULL DEFAULT '', `HOST` varchar(64) NOT NULL DEFAULT '', `DB` varchar(64) DEFAULT NULL, `COMMAND` varchar(16) NOT NULL DEFAULT '', - `TIME` int(7) NOT NULL DEFAULT '0', + `TIME` int(7) NOT NULL DEFAULT 0, `STATE` varchar(64) DEFAULT NULL, - `INFO` longtext, - `TIME_MS` decimal(22,3) NOT NULL DEFAULT '0.000', - `STAGE` tinyint(2) NOT NULL DEFAULT '0', - `MAX_STAGE` tinyint(2) NOT NULL DEFAULT '0', - `PROGRESS` decimal(7,3) NOT NULL DEFAULT '0.000', - `MEMORY_USED` int(7) NOT NULL DEFAULT '0', - `EXAMINED_ROWS` int(7) NOT NULL DEFAULT '0', - `QUERY_ID` bigint(4) NOT NULL DEFAULT '0', - `INFO_BINARY` blob, - `TID` bigint(4) NOT NULL DEFAULT '0' + `INFO` longtext DEFAULT NULL, + `TIME_MS` decimal(22,3) NOT NULL DEFAULT 0.000, + `STAGE` tinyint(2) NOT NULL DEFAULT 0, + `MAX_STAGE` tinyint(2) NOT NULL DEFAULT 0, + `PROGRESS` decimal(7,3) NOT NULL DEFAULT 0.000, + `MEMORY_USED` bigint(7) NOT NULL DEFAULT 0, + `EXAMINED_ROWS` int(7) NOT NULL DEFAULT 0, + `QUERY_ID` bigint(4) NOT NULL DEFAULT 0, + `INFO_BINARY` blob DEFAULT NULL, + `TID` bigint(4) NOT NULL DEFAULT 0 ) DEFAULT CHARSET=utf8 drop table t1; create temporary table t1 like information_schema.processlist; show create table t1; Table Create Table t1 CREATE TEMPORARY TABLE `t1` ( - `ID` bigint(4) NOT NULL DEFAULT '0', + `ID` bigint(4) NOT NULL DEFAULT 0, `USER` varchar(128) NOT NULL DEFAULT '', `HOST` varchar(64) NOT NULL DEFAULT '', `DB` varchar(64) DEFAULT NULL, `COMMAND` varchar(16) NOT NULL DEFAULT '', - `TIME` int(7) NOT NULL DEFAULT '0', + `TIME` int(7) NOT NULL DEFAULT 0, `STATE` varchar(64) DEFAULT NULL, - `INFO` longtext, - `TIME_MS` decimal(22,3) NOT NULL DEFAULT '0.000', - `STAGE` tinyint(2) NOT NULL DEFAULT '0', - `MAX_STAGE` tinyint(2) NOT NULL DEFAULT '0', - `PROGRESS` decimal(7,3) NOT NULL DEFAULT '0.000', - `MEMORY_USED` int(7) NOT NULL DEFAULT '0', - `EXAMINED_ROWS` int(7) NOT NULL DEFAULT '0', - `QUERY_ID` bigint(4) NOT NULL DEFAULT '0', - `INFO_BINARY` blob, - `TID` bigint(4) NOT NULL DEFAULT '0' + `INFO` longtext DEFAULT NULL, + `TIME_MS` decimal(22,3) NOT NULL DEFAULT 0.000, + `STAGE` tinyint(2) NOT NULL DEFAULT 0, + `MAX_STAGE` tinyint(2) NOT NULL DEFAULT 0, + `PROGRESS` decimal(7,3) NOT NULL DEFAULT 0.000, + `MEMORY_USED` bigint(7) NOT NULL DEFAULT 0, + `EXAMINED_ROWS` int(7) NOT NULL DEFAULT 0, + `QUERY_ID` bigint(4) NOT NULL DEFAULT 0, + `INFO_BINARY` blob DEFAULT NULL, + `TID` bigint(4) NOT NULL DEFAULT 0 ) DEFAULT CHARSET=utf8 drop table t1; create table t1 like information_schema.character_sets; @@ -1182,7 +1182,7 @@ t1 CREATE TABLE `t1` ( `CHARACTER_SET_NAME` varchar(32) NOT NULL DEFAULT '', `DEFAULT_COLLATE_NAME` varchar(32) NOT NULL DEFAULT '', `DESCRIPTION` varchar(60) NOT NULL DEFAULT '', - `MAXLEN` bigint(3) NOT NULL DEFAULT '0' + `MAXLEN` bigint(3) NOT NULL DEFAULT 0 ) ENGINE=MEMORY DEFAULT CHARSET=utf8 drop table t1; @@ -1241,8 +1241,8 @@ CREATE TABLE t1(c1 YEAR DEFAULT 2008, c2 YEAR DEFAULT 0); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` year(4) DEFAULT '2008', - `c2` year(4) DEFAULT '0000' + `c1` year(4) DEFAULT 2008, + `c2` year(4) DEFAULT 0000 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES(); @@ -1256,8 +1256,8 @@ ALTER TABLE t1 MODIFY c1 YEAR DEFAULT 0; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` year(4) DEFAULT '0000', - `c2` year(4) DEFAULT '0000' + `c1` year(4) DEFAULT 0000, + `c2` year(4) DEFAULT 0000 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES(); @@ -1736,7 +1736,8 @@ drop view t1; create table t1 (a int) select 1 as a; create temporary table if not exists t1 (a int) select * from t1; create temporary table if not exists t1 (a int) select * from t1; -ERROR HY000: Can't reopen table: 't1' +Warnings: +Note 1050 Table 't1' already exists select * from t1; a 1 @@ -1869,7 +1870,7 @@ t1 CREATE TABLE `t1` ( `cl` char(32) AS (COLUMN_GET(COLUMN_ADD(COLUMN_CREATE(1 , 'blue' as char), 2, 'ttt'), i as char)) PERSISTENT, `item_name` varchar(32) NOT NULL, `i` int(11) DEFAULT NULL, - `dynamic_cols` blob, + `dynamic_cols` blob DEFAULT NULL, PRIMARY KEY (`item_name`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; diff --git a/mysql-test/r/create_drop_binlog.result b/mysql-test/r/create_drop_binlog.result index 537a1bd4605..e330851bd6c 100644 --- a/mysql-test/r/create_drop_binlog.result +++ b/mysql-test/r/create_drop_binlog.result @@ -363,7 +363,7 @@ t1 CREATE TABLE `t1` ( DROP INDEX IF EXISTS i1 ON t1; DROP INDEX IF EXISTS i1 ON t1; Warnings: -Note 1091 Can't DROP 'i1'; check that column/key exists +Note 1091 Can't DROP INDEX `i1`; check that it exists DROP TABLE t1; DROP TABLE IF EXISTS t1; Warnings: diff --git a/mysql-test/r/create_drop_index.result b/mysql-test/r/create_drop_index.result index 113c32aca4d..7df6aeb5838 100644 --- a/mysql-test/r/create_drop_index.result +++ b/mysql-test/r/create_drop_index.result @@ -16,7 +16,7 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP INDEX IF EXISTS i1 ON t1; Warnings: -Note 1091 Can't DROP 'i1'; check that column/key exists +Note 1091 Can't DROP INDEX `i1`; check that it exists SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( diff --git a/mysql-test/r/create_or_replace.result b/mysql-test/r/create_or_replace.result index dc3d00aacc8..3f768535bdf 100644 --- a/mysql-test/r/create_or_replace.result +++ b/mysql-test/r/create_or_replace.result @@ -262,11 +262,11 @@ create table mysqltest2.t2 like test.t1; lock table test.t1 write, mysqltest2.t2 write; select * from information_schema.metadata_lock_info; THREAD_ID LOCK_MODE LOCK_DURATION LOCK_TYPE TABLE_SCHEMA TABLE_NAME -# MDL_INTENTION_EXCLUSIVE MDL_EXPLICIT Global read lock -# MDL_SHARED_NO_READ_WRITE MDL_EXPLICIT Table metadata lock test t1 -# MDL_INTENTION_EXCLUSIVE MDL_EXPLICIT Schema metadata lock mysqltest2 -# MDL_INTENTION_EXCLUSIVE MDL_EXPLICIT Schema metadata lock test -# MDL_SHARED_NO_READ_WRITE MDL_EXPLICIT Table metadata lock mysqltest2 t2 +# MDL_INTENTION_EXCLUSIVE NULL Global read lock +# MDL_INTENTION_EXCLUSIVE NULL Schema metadata lock mysqltest2 +# MDL_INTENTION_EXCLUSIVE NULL Schema metadata lock test +# MDL_SHARED_NO_READ_WRITE NULL Table metadata lock mysqltest2 t2 +# MDL_SHARED_NO_READ_WRITE NULL Table metadata lock test t1 create or replace table test.t1; ERROR 42000: A table must have at least 1 column show tables; @@ -274,10 +274,10 @@ Tables_in_test t2 select * from information_schema.metadata_lock_info; THREAD_ID LOCK_MODE LOCK_DURATION LOCK_TYPE TABLE_SCHEMA TABLE_NAME -# MDL_INTENTION_EXCLUSIVE MDL_EXPLICIT Global read lock -# MDL_INTENTION_EXCLUSIVE MDL_EXPLICIT Schema metadata lock mysqltest2 -# MDL_INTENTION_EXCLUSIVE MDL_EXPLICIT Schema metadata lock test -# MDL_SHARED_NO_READ_WRITE MDL_EXPLICIT Table metadata lock mysqltest2 t2 +# MDL_INTENTION_EXCLUSIVE NULL Global read lock +# MDL_INTENTION_EXCLUSIVE NULL Schema metadata lock mysqltest2 +# MDL_INTENTION_EXCLUSIVE NULL Schema metadata lock test +# MDL_SHARED_NO_READ_WRITE NULL Table metadata lock mysqltest2 t2 create or replace table mysqltest2.t2; ERROR 42000: A table must have at least 1 column select * from information_schema.metadata_lock_info; @@ -289,11 +289,11 @@ create table mysqltest2.t2 like test.t1; lock table test.t1 write, mysqltest2.t2 write; select * from information_schema.metadata_lock_info; THREAD_ID LOCK_MODE LOCK_DURATION LOCK_TYPE TABLE_SCHEMA TABLE_NAME -# MDL_INTENTION_EXCLUSIVE MDL_EXPLICIT Global read lock -# MDL_SHARED_NO_READ_WRITE MDL_EXPLICIT Table metadata lock test t1 -# MDL_INTENTION_EXCLUSIVE MDL_EXPLICIT Schema metadata lock mysqltest2 -# MDL_INTENTION_EXCLUSIVE MDL_EXPLICIT Schema metadata lock test -# MDL_SHARED_NO_READ_WRITE MDL_EXPLICIT Table metadata lock mysqltest2 t2 +# MDL_INTENTION_EXCLUSIVE NULL Global read lock +# MDL_INTENTION_EXCLUSIVE NULL Schema metadata lock mysqltest2 +# MDL_INTENTION_EXCLUSIVE NULL Schema metadata lock test +# MDL_SHARED_NO_READ_WRITE NULL Table metadata lock mysqltest2 t2 +# MDL_SHARED_NO_READ_WRITE NULL Table metadata lock test t1 create or replace table test.t1 (a int) select 1 as 'a', 2 as 'a'; ERROR 42S21: Duplicate column name 'a' show tables; @@ -301,10 +301,10 @@ Tables_in_test t2 select * from information_schema.metadata_lock_info; THREAD_ID LOCK_MODE LOCK_DURATION LOCK_TYPE TABLE_SCHEMA TABLE_NAME -# MDL_INTENTION_EXCLUSIVE MDL_EXPLICIT Global read lock -# MDL_INTENTION_EXCLUSIVE MDL_EXPLICIT Schema metadata lock mysqltest2 -# MDL_INTENTION_EXCLUSIVE MDL_EXPLICIT Schema metadata lock test -# MDL_SHARED_NO_READ_WRITE MDL_EXPLICIT Table metadata lock mysqltest2 t2 +# MDL_INTENTION_EXCLUSIVE NULL Global read lock +# MDL_INTENTION_EXCLUSIVE NULL Schema metadata lock mysqltest2 +# MDL_INTENTION_EXCLUSIVE NULL Schema metadata lock test +# MDL_SHARED_NO_READ_WRITE NULL Table metadata lock mysqltest2 t2 create or replace table mysqltest2.t2 (a int) select 1 as 'a', 2 as 'a'; ERROR 42S21: Duplicate column name 'a' select * from information_schema.metadata_lock_info; @@ -398,31 +398,31 @@ create table t1 (a int); lock table t1 write, t2 read; select * from information_schema.metadata_lock_info; THREAD_ID LOCK_MODE LOCK_DURATION LOCK_TYPE TABLE_SCHEMA TABLE_NAME -# MDL_INTENTION_EXCLUSIVE MDL_EXPLICIT Global read lock -# MDL_SHARED_NO_READ_WRITE MDL_EXPLICIT Table metadata lock test t1 -# MDL_SHARED_READ MDL_EXPLICIT Table metadata lock test t2 -# MDL_INTENTION_EXCLUSIVE MDL_EXPLICIT Schema metadata lock test +# MDL_INTENTION_EXCLUSIVE NULL Global read lock +# MDL_INTENTION_EXCLUSIVE NULL Schema metadata lock test +# MDL_SHARED_NO_READ_WRITE NULL Table metadata lock test t1 +# MDL_SHARED_READ NULL Table metadata lock test t2 create or replace table t1 (i int); select * from information_schema.metadata_lock_info; THREAD_ID LOCK_MODE LOCK_DURATION LOCK_TYPE TABLE_SCHEMA TABLE_NAME -# MDL_INTENTION_EXCLUSIVE MDL_EXPLICIT Global read lock -# MDL_SHARED_NO_READ_WRITE MDL_EXPLICIT Table metadata lock test t1 -# MDL_SHARED_READ MDL_EXPLICIT Table metadata lock test t2 -# MDL_INTENTION_EXCLUSIVE MDL_EXPLICIT Schema metadata lock test +# MDL_INTENTION_EXCLUSIVE NULL Global read lock +# MDL_INTENTION_EXCLUSIVE NULL Schema metadata lock test +# MDL_SHARED_NO_READ_WRITE NULL Table metadata lock test t1 +# MDL_SHARED_READ NULL Table metadata lock test t2 create or replace table t1 like t2; select * from information_schema.metadata_lock_info; THREAD_ID LOCK_MODE LOCK_DURATION LOCK_TYPE TABLE_SCHEMA TABLE_NAME -# MDL_INTENTION_EXCLUSIVE MDL_EXPLICIT Global read lock -# MDL_SHARED_NO_READ_WRITE MDL_EXPLICIT Table metadata lock test t1 -# MDL_SHARED_READ MDL_EXPLICIT Table metadata lock test t2 -# MDL_INTENTION_EXCLUSIVE MDL_EXPLICIT Schema metadata lock test +# MDL_INTENTION_EXCLUSIVE NULL Global read lock +# MDL_INTENTION_EXCLUSIVE NULL Schema metadata lock test +# MDL_SHARED_NO_READ_WRITE NULL Table metadata lock test t1 +# MDL_SHARED_READ NULL Table metadata lock test t2 create or replace table t1 select 1 as f1; select * from information_schema.metadata_lock_info; THREAD_ID LOCK_MODE LOCK_DURATION LOCK_TYPE TABLE_SCHEMA TABLE_NAME -# MDL_INTENTION_EXCLUSIVE MDL_EXPLICIT Global read lock -# MDL_SHARED_NO_READ_WRITE MDL_EXPLICIT Table metadata lock test t1 -# MDL_SHARED_READ MDL_EXPLICIT Table metadata lock test t2 -# MDL_INTENTION_EXCLUSIVE MDL_EXPLICIT Schema metadata lock test +# MDL_INTENTION_EXCLUSIVE NULL Global read lock +# MDL_INTENTION_EXCLUSIVE NULL Schema metadata lock test +# MDL_SHARED_NO_READ_WRITE NULL Table metadata lock test t1 +# MDL_SHARED_READ NULL Table metadata lock test t2 drop table t1; unlock tables; # diff --git a/mysql-test/r/cte_nonrecursive.result b/mysql-test/r/cte_nonrecursive.result index c9552f662a1..3b358747a56 100644 --- a/mysql-test/r/cte_nonrecursive.result +++ b/mysql-test/r/cte_nonrecursive.result @@ -578,9 +578,8 @@ c a explain select * from v1; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY ALL NULL NULL NULL NULL 32 -2 DERIVED t2 ALL NULL NULL NULL NULL 4 -2 DERIVED t1 ALL NULL NULL NULL NULL 8 Using where; Using join buffer (flat, BNL join) +1 SIMPLE t2 ALL NULL NULL NULL NULL 4 +1 SIMPLE t1 ALL NULL NULL NULL NULL 8 Using where; Using join buffer (flat, BNL join) # with claused in the specification of a materialized view create view v2 as with t as (select a, count(*) from t1 where b >= 'c' group by a) @@ -595,9 +594,8 @@ c a count(*) explain select * from v2; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY ALL NULL NULL NULL NULL 8 -2 DERIVED t2 ALL NULL NULL NULL NULL 4 Using where -2 DERIVED ref key0 key0 5 test.t2.c 2 +1 PRIMARY t2 ALL NULL NULL NULL NULL 4 Using where +1 PRIMARY ref key0 key0 5 test.t2.c 2 3 SUBQUERY t1 ALL NULL NULL NULL NULL 8 Using where; Using temporary; Using filesort # with clause in the specification of a view that whose definition # table alias for a with table @@ -628,9 +626,8 @@ c d explain select * from v4; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY ALL NULL NULL NULL NULL 64 -2 DERIVED t1 ALL NULL NULL NULL NULL 8 Using where -2 DERIVED t1 ALL NULL NULL NULL NULL 8 Using where; Using join buffer (flat, BNL join) +1 SIMPLE t1 ALL NULL NULL NULL NULL 8 Using where +1 SIMPLE t1 ALL NULL NULL NULL NULL 8 Using where; Using join buffer (flat, BNL join) drop view v1,v2,v3,v4; # currently any views containing with clause are not updatable create view v1(a) as diff --git a/mysql-test/r/ctype_binary.result b/mysql-test/r/ctype_binary.result index ac79a158943..e7c40b5ed91 100644 --- a/mysql-test/r/ctype_binary.result +++ b/mysql-test/r/ctype_binary.result @@ -658,7 +658,7 @@ create table t1 as select group_concat(1,2,3) as c1; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 as select 1 as c1 union select 'a'; @@ -914,7 +914,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` varbinary(83) DEFAULT NULL, - `c2` decimal(65,30) DEFAULT NULL + `c2` decimal(65,38) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; select hex(concat(@@ft_max_word_len)); @@ -1264,7 +1264,7 @@ create table t1 as select concat(AsText(GeomFromText('Point(1 2)'))) as c1; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; select hex(concat(period_add(200902, 2))); @@ -2621,7 +2621,7 @@ GROUP_CONCAT(CASE WHEN a THEN a ELSE '' END) 1234567 SELECT COALESCE(a,'') FROM t1 GROUP BY 1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(a,'') 253 9 7 Y 128 31 63 +def COALESCE(a,'') 253 9 7 Y 128 39 63 COALESCE(a,'') 1234567 # All columns must be VARCHAR(9) with the same length: @@ -2887,6 +2887,15 @@ f1() DROP FUNCTION f1; DROP TABLE t1; # +# MDEV-9662 Assertion `precision || !scale' failed in my_decimal_precision_to_length_no_truncation(uint, uint8, bool) +# +SELECT @@collation_connection; +@@collation_connection +binary +SELECT CASE 1 WHEN 2 THEN ( - '3' ) END; +CASE 1 WHEN 2 THEN ( - '3' ) END +NULL +# # MDEV-5702 Incorrect results are returned with NULLIF() # CREATE TABLE t1 (d DATE); diff --git a/mysql-test/r/ctype_cp1251.result b/mysql-test/r/ctype_cp1251.result index dc6d4750590..36dc23f33be 100644 --- a/mysql-test/r/ctype_cp1251.result +++ b/mysql-test/r/ctype_cp1251.result @@ -1067,7 +1067,7 @@ create table t1 as select group_concat(1,2,3) as c1; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text CHARACTER SET cp1251 + `c1` text CHARACTER SET cp1251 DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 as select 1 as c1 union select 'a'; @@ -1323,7 +1323,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` varchar(83) CHARACTER SET cp1251 DEFAULT NULL, - `c2` decimal(65,30) DEFAULT NULL + `c2` decimal(65,38) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; select hex(concat(@@ft_max_word_len)); @@ -1673,7 +1673,7 @@ create table t1 as select concat(AsText(GeomFromText('Point(1 2)'))) as c1; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext CHARACTER SET cp1251 + `c1` longtext CHARACTER SET cp1251 DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; select hex(concat(period_add(200902, 2))); @@ -3030,7 +3030,7 @@ GROUP_CONCAT(CASE WHEN a THEN a ELSE '' END) 1234567 SELECT COALESCE(a,'') FROM t1 GROUP BY 1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(a,'') 253 9 7 Y 0 31 51 +def COALESCE(a,'') 253 9 7 Y 0 39 51 COALESCE(a,'') 1234567 # All columns must be VARCHAR(9) with the same length: @@ -3296,6 +3296,15 @@ f1() DROP FUNCTION f1; DROP TABLE t1; # +# MDEV-9662 Assertion `precision || !scale' failed in my_decimal_precision_to_length_no_truncation(uint, uint8, bool) +# +SELECT @@collation_connection; +@@collation_connection +cp1251_general_ci +SELECT CASE 1 WHEN 2 THEN ( - '3' ) END; +CASE 1 WHEN 2 THEN ( - '3' ) END +NULL +# # MDEV-5702 Incorrect results are returned with NULLIF() # CREATE TABLE t1 (d DATE); diff --git a/mysql-test/r/ctype_cp850.result b/mysql-test/r/ctype_cp850.result new file mode 100644 index 00000000000..c028f72b58a --- /dev/null +++ b/mysql-test/r/ctype_cp850.result @@ -0,0 +1,14 @@ +# +# Start of 5.5 tests +# +# +# MDEV-9862 Illegal mix of collation, when comparing column with CASE expression +# +SET NAMES cp850; +CREATE TABLE t1 (a CHAR(1) CHARACTER SET latin1); +SELECT a FROM t1 WHERE CASE a WHEN 'aaaa' THEN 'Y' WHEN 'aaaa' THEN 'Y' ELSE NULL END <> a; +a +DROP TABLE t1; +# +# End of 5.5 tests +# diff --git a/mysql-test/r/ctype_latin1.result b/mysql-test/r/ctype_latin1.result index f2e519e4aef..b0bcc5d7bd2 100644 --- a/mysql-test/r/ctype_latin1.result +++ b/mysql-test/r/ctype_latin1.result @@ -1364,7 +1364,7 @@ create table t1 as select group_concat(1,2,3) as c1; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text + `c1` text DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 as select 1 as c1 union select 'a'; @@ -1620,7 +1620,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` varchar(83) DEFAULT NULL, - `c2` decimal(65,30) DEFAULT NULL + `c2` decimal(65,38) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; select hex(concat(@@ft_max_word_len)); @@ -1970,7 +1970,7 @@ create table t1 as select concat(AsText(GeomFromText('Point(1 2)'))) as c1; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; select hex(concat(period_add(200902, 2))); @@ -3327,7 +3327,7 @@ GROUP_CONCAT(CASE WHEN a THEN a ELSE '' END) 1234567 SELECT COALESCE(a,'') FROM t1 GROUP BY 1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(a,'') 253 9 7 Y 0 31 8 +def COALESCE(a,'') 253 9 7 Y 0 39 8 COALESCE(a,'') 1234567 # All columns must be VARCHAR(9) with the same length: @@ -3593,6 +3593,15 @@ f1() DROP FUNCTION f1; DROP TABLE t1; # +# MDEV-9662 Assertion `precision || !scale' failed in my_decimal_precision_to_length_no_truncation(uint, uint8, bool) +# +SELECT @@collation_connection; +@@collation_connection +latin1_swedish_ci +SELECT CASE 1 WHEN 2 THEN ( - '3' ) END; +CASE 1 WHEN 2 THEN ( - '3' ) END +NULL +# # MDEV-5702 Incorrect results are returned with NULLIF() # CREATE TABLE t1 (d DATE); diff --git a/mysql-test/r/ctype_ldml.result b/mysql-test/r/ctype_ldml.result index acb92a8363b..d333c03143b 100644 --- a/mysql-test/r/ctype_ldml.result +++ b/mysql-test/r/ctype_ldml.result @@ -460,6 +460,7 @@ utf8mb4_test_400_ci utf8mb4 328 8 latin1_test2 latin1 332 1 utf8_bengali_standard_ci utf8 336 8 utf8_bengali_traditional_ci utf8 337 8 +utf8_implicit_weights_ci utf8 338 8 utf8_phone_ci utf8 352 8 utf8_test_ci utf8 353 8 utf8_5624_1 utf8 354 8 @@ -1156,3 +1157,25 @@ Warning 1273 Expansion too long: 'a\u002Daaaaaa10' # # Search for occurrences of [ERROR] Syntax error at '[strength tertiary]' Occurances : 2 +# +# MDEV-8686 A user defined collation utf8_confusables doesn't work +# +CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf8 COLLATE utf8_implicit_weights_ci); +INSERT INTO t1 VALUES ('a'),('b'),('c'); +INSERT INTO t1 VALUES (_ucs2 0x1500),(_ucs2 0x1501); +INSERT INTO t1 VALUES (_ucs2 0x3400),(_ucs2 0x3560),(_ucs2 0x3561),(_ucs2 0x3600); +INSERT INTO t1 VALUES (_ucs2 0x3700),(_ucs2 0x3701); +SELECT HEX(CONVERT(a USING ucs2)) AS ch, HEX(WEIGHT_STRING(a)) AS w, HEX(WEIGHT_STRING(a COLLATE utf8_unicode_ci)) AS ducet FROM t1 ORDER BY a,ch; +ch w ducet +0061 0E33 0E33 +3561 0E33 FB80B561 +0063 0E60 0E60 +1500 0E60 1BAD +0062 FB80B400 0E4A +3400 FB80B400 FB80B400 +3560 FB80B560 FB80B560 +1501 FB80B600 1BAE +3600 FB80B600 FB80B600 +3700 FB80B700 FB80B700 +3701 FB80B700 FB80B701 +DROP TABLE t1; diff --git a/mysql-test/r/ctype_like_range.result b/mysql-test/r/ctype_like_range.result index 41080147908..176cfe3acf0 100644 --- a/mysql-test/r/ctype_like_range.result +++ b/mysql-test/r/ctype_like_range.result @@ -1,3 +1,4 @@ +SET NAMES utf8; DROP TABLE IF EXISTS t1; DROP VIEW IF EXISTS v1; CREATE TABLE t1 (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, a VARBINARY(32)); @@ -284,6 +285,8 @@ id name val 32 mx 63616161616161616161616161616161 32 sp -------------------------------- ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8; +INSERT INTO t1 (a) VALUES (_ucs2 0x0425),(_ucs2 0x045F); +INSERT INTO t1 (a) VALUES (_ucs2 0x2525),(_ucs2 0x5F5F); SELECT * FROM v1; id name val 1 a @@ -414,6 +417,22 @@ id name val 32 mn 6361616161 32 mx 6361616161 32 sp -------------------------------- +33 a Ð¥ +33 mn D0A5 +33 mx D0A5 +33 sp -------------------------------- +34 a ÑŸ +34 mn D19F +34 mx D19F +34 sp -------------------------------- +35 a ┥ +35 mn E294A5 +35 mx E294A5 +35 sp -------------------------------- +36 a 彟 +36 mn E5BD9F +36 mx E5BD9F +36 sp -------------------------------- ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_unicode_ci; SELECT * FROM v1; id name val @@ -545,6 +564,22 @@ id name val 32 mn 6361616161 32 mx 6361616161 32 sp -------------------------------- +33 a Ð¥ +33 mn D0A5 +33 mx D0A5 +33 sp -------------------------------- +34 a ÑŸ +34 mn D19F +34 mx D19F +34 sp -------------------------------- +35 a ┥ +35 mn E294A5 +35 mx E294A5 +35 sp -------------------------------- +36 a 彟 +36 mn E5BD9F +36 mx E5BD9F +36 sp -------------------------------- ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_czech_ci; SELECT * FROM v1; id name val @@ -676,6 +711,22 @@ id name val 32 mn 6361616161 32 mx 6361616161 32 sp -------------------------------- +33 a Ð¥ +33 mn D0A5 +33 mx D0A5 +33 sp -------------------------------- +34 a ÑŸ +34 mn D19F +34 mx D19F +34 sp -------------------------------- +35 a ┥ +35 mn E294A5 +35 mx E294A5 +35 sp -------------------------------- +36 a 彟 +36 mn E5BD9F +36 mx E5BD9F +36 sp -------------------------------- ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_danish_ci; SELECT * FROM v1; id name val @@ -807,6 +858,169 @@ id name val 32 mn 6361616161 32 mx 6361616161 32 sp -------------------------------- +33 a Ð¥ +33 mn D0A5 +33 mx D0A5 +33 sp -------------------------------- +34 a ÑŸ +34 mn D19F +34 mx D19F +34 sp -------------------------------- +35 a ┥ +35 mn E294A5 +35 mx E294A5 +35 sp -------------------------------- +36 a 彟 +36 mn E5BD9F +36 mx E5BD9F +36 sp -------------------------------- +ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_thai_520_w2; +SELECT * FROM v1; +id name val +1 a +1 mn +1 mx +1 sp -------------------------------- +2 a _ +2 mn 09 +2 mx EFBFBF +2 sp -------------------------------- +3 a % +3 mn 09090909090909090909090909090909 +3 mx EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF20 +3 sp -------------------------------- +4 a \_ +4 mn 5F +4 mx 5F +4 sp -------------------------------- +5 a \% +5 mn 25 +5 mx 25 +5 sp -------------------------------- +6 a \ +6 mn 5C +6 mx 5C +6 sp -------------------------------- +7 a a +7 mn 61 +7 mx 61 +7 sp -------------------------------- +8 a c +8 mn 63 +8 mx 63 +8 sp -------------------------------- +9 a a_ +9 mn 6109 +9 mx 61EFBFBF +9 sp -------------------------------- +10 a c_ +10 mn 6309 +10 mx 63EFBFBF +10 sp -------------------------------- +11 a a% +11 mn 61090909090909090909090909090909 +11 mx 61EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF +11 sp -------------------------------- +12 a c% +12 mn 63090909090909090909090909090909 +12 mx 63EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF +12 sp -------------------------------- +13 a aa +13 mn 6161 +13 mx 6161 +13 sp -------------------------------- +14 a cc +14 mn 6363 +14 mx 6363 +14 sp -------------------------------- +15 a ch +15 mn 6368 +15 mx 6368 +15 sp -------------------------------- +16 a aa_ +16 mn 616109 +16 mx 6161EFBFBF +16 sp -------------------------------- +17 a cc_ +17 mn 636309 +17 mx 6363EFBFBF +17 sp -------------------------------- +18 a ch_ +18 mn 636809 +18 mx 6368EFBFBF +18 sp -------------------------------- +19 a aa% +19 mn 61610909090909090909090909090909 +19 mx 6161EFBFBFEFBFBFEFBFBFEFBFBF2020 +19 sp -------------------------------- +20 a cc% +20 mn 63630909090909090909090909090909 +20 mx 6363EFBFBFEFBFBFEFBFBFEFBFBF2020 +20 sp -------------------------------- +21 a ch% +21 mn 63680909090909090909090909090909 +21 mx 6368EFBFBFEFBFBFEFBFBFEFBFBF2020 +21 sp -------------------------------- +22 a aaa +22 mn 616161 +22 mx 616161 +22 sp -------------------------------- +23 a ccc +23 mn 636363 +23 mx 636363 +23 sp -------------------------------- +24 a cch +24 mn 636368 +24 mx 636368 +24 sp -------------------------------- +25 a aaa_ +25 mn 61616109 +25 mx 616161EFBFBF +25 sp -------------------------------- +26 a ccc_ +26 mn 63636309 +26 mx 636363EFBFBF +26 sp -------------------------------- +27 a cch_ +27 mn 63636809 +27 mx 636368EFBFBF +27 sp -------------------------------- +28 a aaa% +28 mn 61616109090909090909090909090909 +28 mx 616161EFBFBFEFBFBFEFBFBFEFBFBF20 +28 sp -------------------------------- +29 a ccc% +29 mn 63636309090909090909090909090909 +29 mx 636363EFBFBFEFBFBFEFBFBFEFBFBF20 +29 sp -------------------------------- +30 a cch% +30 mn 63636809090909090909090909090909 +30 mx 636368EFBFBFEFBFBFEFBFBFEFBFBF20 +30 sp -------------------------------- +31 a aaaaaaaaaaaaaaaaaaaa +31 mn 6161616161 +31 mx 6161616161 +31 sp -------------------------------- +32 a caaaaaaaaaaaaaaaaaaa +32 mn 6361616161 +32 mx 6361616161 +32 sp -------------------------------- +33 a Ð¥ +33 mn D0A5 +33 mx D0A5 +33 sp -------------------------------- +34 a ÑŸ +34 mn D19F +34 mx D19F +34 sp -------------------------------- +35 a ┥ +35 mn E294A5 +35 mx E294A5 +35 sp -------------------------------- +36 a 彟 +36 mn E5BD9F +36 mx E5BD9F +36 sp -------------------------------- ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8mb4; SELECT * FROM v1; id name val @@ -938,6 +1152,22 @@ id name val 32 mn 63616161 32 mx 63616161 32 sp -------------------------------- +33 a Ð¥ +33 mn D0A5 +33 mx D0A5 +33 sp -------------------------------- +34 a ÑŸ +34 mn D19F +34 mx D19F +34 sp -------------------------------- +35 a ┥ +35 mn E294A5 +35 mx E294A5 +35 sp -------------------------------- +36 a 彟 +36 mn E5BD9F +36 mx E5BD9F +36 sp -------------------------------- ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; SELECT * FROM v1; id name val @@ -1069,6 +1299,22 @@ id name val 32 mn 63616161 32 mx 63616161 32 sp -------------------------------- +33 a Ð¥ +33 mn D0A5 +33 mx D0A5 +33 sp -------------------------------- +34 a ÑŸ +34 mn D19F +34 mx D19F +34 sp -------------------------------- +35 a ┥ +35 mn E294A5 +35 mx E294A5 +35 sp -------------------------------- +36 a 彟 +36 mn E5BD9F +36 mx E5BD9F +36 sp -------------------------------- ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_czech_ci; SELECT * FROM v1; id name val @@ -1200,6 +1446,22 @@ id name val 32 mn 63616161 32 mx 63616161 32 sp -------------------------------- +33 a Ð¥ +33 mn D0A5 +33 mx D0A5 +33 sp -------------------------------- +34 a ÑŸ +34 mn D19F +34 mx D19F +34 sp -------------------------------- +35 a ┥ +35 mn E294A5 +35 mx E294A5 +35 sp -------------------------------- +36 a 彟 +36 mn E5BD9F +36 mx E5BD9F +36 sp -------------------------------- ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_danish_ci; SELECT * FROM v1; id name val @@ -1331,6 +1593,169 @@ id name val 32 mn 63616109090909090909090909090909 32 mx 636161EFBFBFEFBFBFEFBFBFEFBFBF20 32 sp -------------------------------- +33 a Ð¥ +33 mn D0A5 +33 mx D0A5 +33 sp -------------------------------- +34 a ÑŸ +34 mn D19F +34 mx D19F +34 sp -------------------------------- +35 a ┥ +35 mn E294A5 +35 mx E294A5 +35 sp -------------------------------- +36 a 彟 +36 mn E5BD9F +36 mx E5BD9F +36 sp -------------------------------- +ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_thai_520_w2; +SELECT * FROM v1; +id name val +1 a +1 mn +1 mx +1 sp -------------------------------- +2 a _ +2 mn 09 +2 mx EFBFBF +2 sp -------------------------------- +3 a % +3 mn 09090909090909090909090909090909 +3 mx EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF20 +3 sp -------------------------------- +4 a \_ +4 mn 5F +4 mx 5F +4 sp -------------------------------- +5 a \% +5 mn 25 +5 mx 25 +5 sp -------------------------------- +6 a \ +6 mn 5C +6 mx 5C +6 sp -------------------------------- +7 a a +7 mn 61 +7 mx 61 +7 sp -------------------------------- +8 a c +8 mn 63 +8 mx 63 +8 sp -------------------------------- +9 a a_ +9 mn 6109 +9 mx 61EFBFBF +9 sp -------------------------------- +10 a c_ +10 mn 6309 +10 mx 63EFBFBF +10 sp -------------------------------- +11 a a% +11 mn 61090909090909090909090909090909 +11 mx 61EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF +11 sp -------------------------------- +12 a c% +12 mn 63090909090909090909090909090909 +12 mx 63EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF +12 sp -------------------------------- +13 a aa +13 mn 6161 +13 mx 6161 +13 sp -------------------------------- +14 a cc +14 mn 6363 +14 mx 6363 +14 sp -------------------------------- +15 a ch +15 mn 6368 +15 mx 6368 +15 sp -------------------------------- +16 a aa_ +16 mn 616109 +16 mx 6161EFBFBF +16 sp -------------------------------- +17 a cc_ +17 mn 636309 +17 mx 6363EFBFBF +17 sp -------------------------------- +18 a ch_ +18 mn 636809 +18 mx 6368EFBFBF +18 sp -------------------------------- +19 a aa% +19 mn 61610909090909090909090909090909 +19 mx 6161EFBFBFEFBFBFEFBFBFEFBFBF2020 +19 sp -------------------------------- +20 a cc% +20 mn 63630909090909090909090909090909 +20 mx 6363EFBFBFEFBFBFEFBFBFEFBFBF2020 +20 sp -------------------------------- +21 a ch% +21 mn 63680909090909090909090909090909 +21 mx 6368EFBFBFEFBFBFEFBFBFEFBFBF2020 +21 sp -------------------------------- +22 a aaa +22 mn 616161 +22 mx 616161 +22 sp -------------------------------- +23 a ccc +23 mn 636363 +23 mx 636363 +23 sp -------------------------------- +24 a cch +24 mn 636368 +24 mx 636368 +24 sp -------------------------------- +25 a aaa_ +25 mn 61616109 +25 mx 616161EFBFBF +25 sp -------------------------------- +26 a ccc_ +26 mn 63636309 +26 mx 636363EFBFBF +26 sp -------------------------------- +27 a cch_ +27 mn 63636809 +27 mx 636368EFBFBF +27 sp -------------------------------- +28 a aaa% +28 mn 61616109090909090909090909090909 +28 mx 616161EFBFBFEFBFBFEFBFBFEFBFBF20 +28 sp -------------------------------- +29 a ccc% +29 mn 63636309090909090909090909090909 +29 mx 636363EFBFBFEFBFBFEFBFBFEFBFBF20 +29 sp -------------------------------- +30 a cch% +30 mn 63636809090909090909090909090909 +30 mx 636368EFBFBFEFBFBFEFBFBFEFBFBF20 +30 sp -------------------------------- +31 a aaaaaaaaaaaaaaaaaaaa +31 mn 61616161 +31 mx 61616161 +31 sp -------------------------------- +32 a caaaaaaaaaaaaaaaaaaa +32 mn 63616161 +32 mx 63616161 +32 sp -------------------------------- +33 a Ð¥ +33 mn D0A5 +33 mx D0A5 +33 sp -------------------------------- +34 a ÑŸ +34 mn D19F +34 mx D19F +34 sp -------------------------------- +35 a ┥ +35 mn E294A5 +35 mx E294A5 +35 sp -------------------------------- +36 a 彟 +36 mn E5BD9F +36 mx E5BD9F +36 sp -------------------------------- ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci; SELECT * FROM v1; id name val @@ -1462,6 +1887,22 @@ id name val 32 mn 63616161 32 mx 63616161 32 sp -------------------------------- +33 a Ð¥ +33 mn D0A5 +33 mx D0A5 +33 sp -------------------------------- +34 a ÑŸ +34 mn D19F +34 mx D19F +34 sp -------------------------------- +35 a ┥ +35 mn E294A5 +35 mx E294A5 +35 sp -------------------------------- +36 a 彟 +36 mn E5BD9F +36 mx E5BD9F +36 sp -------------------------------- ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET ucs2; SELECT * FROM v1; id name val @@ -1593,6 +2034,22 @@ id name val 32 mn 00630061006100610061006100610061 32 mx 00630061006100610061006100610061 32 sp -------------------------------- +33 a Ð¥ +33 mn 0425 +33 mx 0425 +33 sp -------------------------------- +34 a ÑŸ +34 mn 045F +34 mx 045F +34 sp -------------------------------- +35 a ┥ +35 mn 2525 +35 mx 2525 +35 sp -------------------------------- +36 a 彟 +36 mn 5F5F +36 mx 5F5F +36 sp -------------------------------- ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET ucs2 COLLATE ucs2_unicode_ci; SELECT * FROM v1; id name val @@ -1724,6 +2181,22 @@ id name val 32 mn 00630061006100610061006100610061 32 mx 00630061006100610061006100610061 32 sp -------------------------------- +33 a Ð¥ +33 mn 0425 +33 mx 0425 +33 sp -------------------------------- +34 a ÑŸ +34 mn 045F +34 mx 045F +34 sp -------------------------------- +35 a ┥ +35 mn 2525 +35 mx 2525 +35 sp -------------------------------- +36 a 彟 +36 mn 5F5F +36 mx 5F5F +36 sp -------------------------------- ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET ucs2 COLLATE ucs2_czech_ci; SELECT * FROM v1; id name val @@ -1855,6 +2328,22 @@ id name val 32 mn 00630061006100610061006100610061 32 mx 00630061006100610061006100610061 32 sp -------------------------------- +33 a Ð¥ +33 mn 0425 +33 mx 0425 +33 sp -------------------------------- +34 a ÑŸ +34 mn 045F +34 mx 045F +34 sp -------------------------------- +35 a ┥ +35 mn 2525 +35 mx 2525 +35 sp -------------------------------- +36 a 彟 +36 mn 5F5F +36 mx 5F5F +36 sp -------------------------------- ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET ucs2 COLLATE ucs2_danish_ci; SELECT * FROM v1; id name val @@ -1986,6 +2475,169 @@ id name val 32 mn 00630061006100610061006100610009 32 mx 0063006100610061006100610061FFFF 32 sp -------------------------------- +33 a Ð¥ +33 mn 0425 +33 mx 0425 +33 sp -------------------------------- +34 a ÑŸ +34 mn 045F +34 mx 045F +34 sp -------------------------------- +35 a ┥ +35 mn 2525 +35 mx 2525 +35 sp -------------------------------- +36 a 彟 +36 mn 5F5F +36 mx 5F5F +36 sp -------------------------------- +ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET ucs2 COLLATE ucs2_thai_520_w2; +SELECT * FROM v1; +id name val +1 a +1 mn +1 mx +1 sp -------------------------------- +2 a _ +2 mn 0009 +2 mx FFFF +2 sp -------------------------------- +3 a % +3 mn 00090009000900090009000900090009 +3 mx FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +3 sp -------------------------------- +4 a \_ +4 mn 005F +4 mx 005F +4 sp -------------------------------- +5 a \% +5 mn 0025 +5 mx 0025 +5 sp -------------------------------- +6 a \ +6 mn 005C +6 mx 005C +6 sp -------------------------------- +7 a a +7 mn 0061 +7 mx 0061 +7 sp -------------------------------- +8 a c +8 mn 0063 +8 mx 0063 +8 sp -------------------------------- +9 a a_ +9 mn 00610009 +9 mx 0061FFFF +9 sp -------------------------------- +10 a c_ +10 mn 00630009 +10 mx 0063FFFF +10 sp -------------------------------- +11 a a% +11 mn 00610009000900090009000900090009 +11 mx 0061FFFFFFFFFFFFFFFFFFFFFFFFFFFF +11 sp -------------------------------- +12 a c% +12 mn 00630009000900090009000900090009 +12 mx 0063FFFFFFFFFFFFFFFFFFFFFFFFFFFF +12 sp -------------------------------- +13 a aa +13 mn 00610061 +13 mx 00610061 +13 sp -------------------------------- +14 a cc +14 mn 00630063 +14 mx 00630063 +14 sp -------------------------------- +15 a ch +15 mn 00630068 +15 mx 00630068 +15 sp -------------------------------- +16 a aa_ +16 mn 006100610009 +16 mx 00610061FFFF +16 sp -------------------------------- +17 a cc_ +17 mn 006300630009 +17 mx 00630063FFFF +17 sp -------------------------------- +18 a ch_ +18 mn 006300680009 +18 mx 00630068FFFF +18 sp -------------------------------- +19 a aa% +19 mn 00610061000900090009000900090009 +19 mx 00610061FFFFFFFFFFFFFFFFFFFFFFFF +19 sp -------------------------------- +20 a cc% +20 mn 00630063000900090009000900090009 +20 mx 00630063FFFFFFFFFFFFFFFFFFFFFFFF +20 sp -------------------------------- +21 a ch% +21 mn 00630068000900090009000900090009 +21 mx 00630068FFFFFFFFFFFFFFFFFFFFFFFF +21 sp -------------------------------- +22 a aaa +22 mn 006100610061 +22 mx 006100610061 +22 sp -------------------------------- +23 a ccc +23 mn 006300630063 +23 mx 006300630063 +23 sp -------------------------------- +24 a cch +24 mn 006300630068 +24 mx 006300630068 +24 sp -------------------------------- +25 a aaa_ +25 mn 0061006100610009 +25 mx 006100610061FFFF +25 sp -------------------------------- +26 a ccc_ +26 mn 0063006300630009 +26 mx 006300630063FFFF +26 sp -------------------------------- +27 a cch_ +27 mn 0063006300680009 +27 mx 006300630068FFFF +27 sp -------------------------------- +28 a aaa% +28 mn 00610061006100090009000900090009 +28 mx 006100610061FFFFFFFFFFFFFFFFFFFF +28 sp -------------------------------- +29 a ccc% +29 mn 00630063006300090009000900090009 +29 mx 006300630063FFFFFFFFFFFFFFFFFFFF +29 sp -------------------------------- +30 a cch% +30 mn 00630063006800090009000900090009 +30 mx 006300630068FFFFFFFFFFFFFFFFFFFF +30 sp -------------------------------- +31 a aaaaaaaaaaaaaaaaaaaa +31 mn 00610061006100610061006100610061 +31 mx 00610061006100610061006100610061 +31 sp -------------------------------- +32 a caaaaaaaaaaaaaaaaaaa +32 mn 00630061006100610061006100610061 +32 mx 00630061006100610061006100610061 +32 sp -------------------------------- +33 a Ð¥ +33 mn 0425 +33 mx 0425 +33 sp -------------------------------- +34 a ÑŸ +34 mn 045F +34 mx 045F +34 sp -------------------------------- +35 a ┥ +35 mn 2525 +35 mx 2525 +35 sp -------------------------------- +36 a 彟 +36 mn 5F5F +36 mx 5F5F +36 sp -------------------------------- ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf16; SELECT * FROM v1; id name val @@ -2117,6 +2769,22 @@ id name val 32 mn 0063006100610061 32 mx 0063006100610061 32 sp -------------------------------- +33 a Ð¥ +33 mn 0425 +33 mx 0425 +33 sp -------------------------------- +34 a ÑŸ +34 mn 045F +34 mx 045F +34 sp -------------------------------- +35 a ┥ +35 mn 2525 +35 mx 2525 +35 sp -------------------------------- +36 a 彟 +36 mn 5F5F +36 mx 5F5F +36 sp -------------------------------- ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf16 COLLATE utf16_unicode_ci; SELECT * FROM v1; id name val @@ -2248,6 +2916,22 @@ id name val 32 mn 0063006100610061 32 mx 0063006100610061 32 sp -------------------------------- +33 a Ð¥ +33 mn 0425 +33 mx 0425 +33 sp -------------------------------- +34 a ÑŸ +34 mn 045F +34 mx 045F +34 sp -------------------------------- +35 a ┥ +35 mn 2525 +35 mx 2525 +35 sp -------------------------------- +36 a 彟 +36 mn 5F5F +36 mx 5F5F +36 sp -------------------------------- ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf16 COLLATE utf16_czech_ci; SELECT * FROM v1; id name val @@ -2379,6 +3063,22 @@ id name val 32 mn 0063006100610061 32 mx 0063006100610061 32 sp -------------------------------- +33 a Ð¥ +33 mn 0425 +33 mx 0425 +33 sp -------------------------------- +34 a ÑŸ +34 mn 045F +34 mx 045F +34 sp -------------------------------- +35 a ┥ +35 mn 2525 +35 mx 2525 +35 sp -------------------------------- +36 a 彟 +36 mn 5F5F +36 mx 5F5F +36 sp -------------------------------- ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf16 COLLATE utf16_danish_ci; SELECT * FROM v1; id name val @@ -2510,6 +3210,169 @@ id name val 32 mn 00630061006100090009000900090009 32 mx 006300610061FFFFFFFFFFFFFFFFFFFF 32 sp -------------------------------- +33 a Ð¥ +33 mn 0425 +33 mx 0425 +33 sp -------------------------------- +34 a ÑŸ +34 mn 045F +34 mx 045F +34 sp -------------------------------- +35 a ┥ +35 mn 2525 +35 mx 2525 +35 sp -------------------------------- +36 a 彟 +36 mn 5F5F +36 mx 5F5F +36 sp -------------------------------- +ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf16 COLLATE utf16_thai_520_w2; +SELECT * FROM v1; +id name val +1 a +1 mn +1 mx +1 sp -------------------------------- +2 a _ +2 mn 0009 +2 mx FFFF +2 sp -------------------------------- +3 a % +3 mn 00090009000900090009000900090009 +3 mx FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +3 sp -------------------------------- +4 a \_ +4 mn 005F +4 mx 005F +4 sp -------------------------------- +5 a \% +5 mn 0025 +5 mx 0025 +5 sp -------------------------------- +6 a \ +6 mn 005C +6 mx 005C +6 sp -------------------------------- +7 a a +7 mn 0061 +7 mx 0061 +7 sp -------------------------------- +8 a c +8 mn 0063 +8 mx 0063 +8 sp -------------------------------- +9 a a_ +9 mn 00610009 +9 mx 0061FFFF +9 sp -------------------------------- +10 a c_ +10 mn 00630009 +10 mx 0063FFFF +10 sp -------------------------------- +11 a a% +11 mn 00610009000900090009000900090009 +11 mx 0061FFFFFFFFFFFFFFFFFFFFFFFFFFFF +11 sp -------------------------------- +12 a c% +12 mn 00630009000900090009000900090009 +12 mx 0063FFFFFFFFFFFFFFFFFFFFFFFFFFFF +12 sp -------------------------------- +13 a aa +13 mn 00610061 +13 mx 00610061 +13 sp -------------------------------- +14 a cc +14 mn 00630063 +14 mx 00630063 +14 sp -------------------------------- +15 a ch +15 mn 00630068 +15 mx 00630068 +15 sp -------------------------------- +16 a aa_ +16 mn 006100610009 +16 mx 00610061FFFF +16 sp -------------------------------- +17 a cc_ +17 mn 006300630009 +17 mx 00630063FFFF +17 sp -------------------------------- +18 a ch_ +18 mn 006300680009 +18 mx 00630068FFFF +18 sp -------------------------------- +19 a aa% +19 mn 00610061000900090009000900090009 +19 mx 00610061FFFFFFFFFFFFFFFFFFFFFFFF +19 sp -------------------------------- +20 a cc% +20 mn 00630063000900090009000900090009 +20 mx 00630063FFFFFFFFFFFFFFFFFFFFFFFF +20 sp -------------------------------- +21 a ch% +21 mn 00630068000900090009000900090009 +21 mx 00630068FFFFFFFFFFFFFFFFFFFFFFFF +21 sp -------------------------------- +22 a aaa +22 mn 006100610061 +22 mx 006100610061 +22 sp -------------------------------- +23 a ccc +23 mn 006300630063 +23 mx 006300630063 +23 sp -------------------------------- +24 a cch +24 mn 006300630068 +24 mx 006300630068 +24 sp -------------------------------- +25 a aaa_ +25 mn 0061006100610009 +25 mx 006100610061FFFF +25 sp -------------------------------- +26 a ccc_ +26 mn 0063006300630009 +26 mx 006300630063FFFF +26 sp -------------------------------- +27 a cch_ +27 mn 0063006300680009 +27 mx 006300630068FFFF +27 sp -------------------------------- +28 a aaa% +28 mn 00610061006100090009000900090009 +28 mx 006100610061FFFFFFFFFFFFFFFFFFFF +28 sp -------------------------------- +29 a ccc% +29 mn 00630063006300090009000900090009 +29 mx 006300630063FFFFFFFFFFFFFFFFFFFF +29 sp -------------------------------- +30 a cch% +30 mn 00630063006800090009000900090009 +30 mx 006300630068FFFFFFFFFFFFFFFFFFFF +30 sp -------------------------------- +31 a aaaaaaaaaaaaaaaaaaaa +31 mn 0061006100610061 +31 mx 0061006100610061 +31 sp -------------------------------- +32 a caaaaaaaaaaaaaaaaaaa +32 mn 0063006100610061 +32 mx 0063006100610061 +32 sp -------------------------------- +33 a Ð¥ +33 mn 0425 +33 mx 0425 +33 sp -------------------------------- +34 a ÑŸ +34 mn 045F +34 mx 045F +34 sp -------------------------------- +35 a ┥ +35 mn 2525 +35 mx 2525 +35 sp -------------------------------- +36 a 彟 +36 mn 5F5F +36 mx 5F5F +36 sp -------------------------------- ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf16 COLLATE utf16_unicode_520_ci; SELECT * FROM v1; id name val @@ -2641,6 +3504,22 @@ id name val 32 mn 0063006100610061 32 mx 0063006100610061 32 sp -------------------------------- +33 a Ð¥ +33 mn 0425 +33 mx 0425 +33 sp -------------------------------- +34 a ÑŸ +34 mn 045F +34 mx 045F +34 sp -------------------------------- +35 a ┥ +35 mn 2525 +35 mx 2525 +35 sp -------------------------------- +36 a 彟 +36 mn 5F5F +36 mx 5F5F +36 sp -------------------------------- ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf32; SELECT * FROM v1; id name val @@ -2772,6 +3651,22 @@ id name val 32 mn 00000063000000610000006100000061 32 mx 00000063000000610000006100000061 32 sp -------------------------------- +33 a Ð¥ +33 mn 00000425 +33 mx 00000425 +33 sp -------------------------------- +34 a ÑŸ +34 mn 0000045F +34 mx 0000045F +34 sp -------------------------------- +35 a ┥ +35 mn 00002525 +35 mx 00002525 +35 sp -------------------------------- +36 a 彟 +36 mn 00005F5F +36 mx 00005F5F +36 sp -------------------------------- ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf32 COLLATE utf32_unicode_ci; SELECT * FROM v1; id name val @@ -2903,6 +3798,22 @@ id name val 32 mn 00000063000000610000006100000061 32 mx 00000063000000610000006100000061 32 sp -------------------------------- +33 a Ð¥ +33 mn 00000425 +33 mx 00000425 +33 sp -------------------------------- +34 a ÑŸ +34 mn 0000045F +34 mx 0000045F +34 sp -------------------------------- +35 a ┥ +35 mn 00002525 +35 mx 00002525 +35 sp -------------------------------- +36 a 彟 +36 mn 00005F5F +36 mx 00005F5F +36 sp -------------------------------- ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf32 COLLATE utf32_czech_ci; SELECT * FROM v1; id name val @@ -3034,6 +3945,22 @@ id name val 32 mn 00000063000000610000006100000061 32 mx 00000063000000610000006100000061 32 sp -------------------------------- +33 a Ð¥ +33 mn 00000425 +33 mx 00000425 +33 sp -------------------------------- +34 a ÑŸ +34 mn 0000045F +34 mx 0000045F +34 sp -------------------------------- +35 a ┥ +35 mn 00002525 +35 mx 00002525 +35 sp -------------------------------- +36 a 彟 +36 mn 00005F5F +36 mx 00005F5F +36 sp -------------------------------- ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf32 COLLATE utf32_danish_ci; SELECT * FROM v1; id name val @@ -3165,6 +4092,169 @@ id name val 32 mn 00000063000000610000006100000009 32 mx 0000006300000061000000610000FFFF 32 sp -------------------------------- +33 a Ð¥ +33 mn 00000425 +33 mx 00000425 +33 sp -------------------------------- +34 a ÑŸ +34 mn 0000045F +34 mx 0000045F +34 sp -------------------------------- +35 a ┥ +35 mn 00002525 +35 mx 00002525 +35 sp -------------------------------- +36 a 彟 +36 mn 00005F5F +36 mx 00005F5F +36 sp -------------------------------- +ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf32 COLLATE utf32_thai_520_w2; +SELECT * FROM v1; +id name val +1 a +1 mn +1 mx +1 sp -------------------------------- +2 a _ +2 mn 00000009 +2 mx 0000FFFF +2 sp -------------------------------- +3 a % +3 mn 00000009000000090000000900000009 +3 mx 0000FFFF0000FFFF0000FFFF0000FFFF +3 sp -------------------------------- +4 a \_ +4 mn 0000005F +4 mx 0000005F +4 sp -------------------------------- +5 a \% +5 mn 00000025 +5 mx 00000025 +5 sp -------------------------------- +6 a \ +6 mn 0000005C +6 mx 0000005C +6 sp -------------------------------- +7 a a +7 mn 00000061 +7 mx 00000061 +7 sp -------------------------------- +8 a c +8 mn 00000063 +8 mx 00000063 +8 sp -------------------------------- +9 a a_ +9 mn 0000006100000009 +9 mx 000000610000FFFF +9 sp -------------------------------- +10 a c_ +10 mn 0000006300000009 +10 mx 000000630000FFFF +10 sp -------------------------------- +11 a a% +11 mn 00000061000000090000000900000009 +11 mx 000000610000FFFF0000FFFF0000FFFF +11 sp -------------------------------- +12 a c% +12 mn 00000063000000090000000900000009 +12 mx 000000630000FFFF0000FFFF0000FFFF +12 sp -------------------------------- +13 a aa +13 mn 0000006100000061 +13 mx 0000006100000061 +13 sp -------------------------------- +14 a cc +14 mn 0000006300000063 +14 mx 0000006300000063 +14 sp -------------------------------- +15 a ch +15 mn 0000006300000068 +15 mx 0000006300000068 +15 sp -------------------------------- +16 a aa_ +16 mn 000000610000006100000009 +16 mx 00000061000000610000FFFF +16 sp -------------------------------- +17 a cc_ +17 mn 000000630000006300000009 +17 mx 00000063000000630000FFFF +17 sp -------------------------------- +18 a ch_ +18 mn 000000630000006800000009 +18 mx 00000063000000680000FFFF +18 sp -------------------------------- +19 a aa% +19 mn 00000061000000610000000900000009 +19 mx 00000061000000610000FFFF0000FFFF +19 sp -------------------------------- +20 a cc% +20 mn 00000063000000630000000900000009 +20 mx 00000063000000630000FFFF0000FFFF +20 sp -------------------------------- +21 a ch% +21 mn 00000063000000680000000900000009 +21 mx 00000063000000680000FFFF0000FFFF +21 sp -------------------------------- +22 a aaa +22 mn 000000610000006100000061 +22 mx 000000610000006100000061 +22 sp -------------------------------- +23 a ccc +23 mn 000000630000006300000063 +23 mx 000000630000006300000063 +23 sp -------------------------------- +24 a cch +24 mn 000000630000006300000068 +24 mx 000000630000006300000068 +24 sp -------------------------------- +25 a aaa_ +25 mn 00000061000000610000006100000009 +25 mx 0000006100000061000000610000FFFF +25 sp -------------------------------- +26 a ccc_ +26 mn 00000063000000630000006300000009 +26 mx 0000006300000063000000630000FFFF +26 sp -------------------------------- +27 a cch_ +27 mn 00000063000000630000006800000009 +27 mx 0000006300000063000000680000FFFF +27 sp -------------------------------- +28 a aaa% +28 mn 00000061000000610000006100000009 +28 mx 0000006100000061000000610000FFFF +28 sp -------------------------------- +29 a ccc% +29 mn 00000063000000630000006300000009 +29 mx 0000006300000063000000630000FFFF +29 sp -------------------------------- +30 a cch% +30 mn 00000063000000630000006800000009 +30 mx 0000006300000063000000680000FFFF +30 sp -------------------------------- +31 a aaaaaaaaaaaaaaaaaaaa +31 mn 00000061000000610000006100000061 +31 mx 00000061000000610000006100000061 +31 sp -------------------------------- +32 a caaaaaaaaaaaaaaaaaaa +32 mn 00000063000000610000006100000061 +32 mx 00000063000000610000006100000061 +32 sp -------------------------------- +33 a Ð¥ +33 mn 00000425 +33 mx 00000425 +33 sp -------------------------------- +34 a ÑŸ +34 mn 0000045F +34 mx 0000045F +34 sp -------------------------------- +35 a ┥ +35 mn 00002525 +35 mx 00002525 +35 sp -------------------------------- +36 a 彟 +36 mn 00005F5F +36 mx 00005F5F +36 sp -------------------------------- ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf32 COLLATE utf32_unicode_520_ci; SELECT * FROM v1; id name val @@ -3296,5 +4386,49 @@ id name val 32 mn 00000063000000610000006100000061 32 mx 00000063000000610000006100000061 32 sp -------------------------------- +33 a Ð¥ +33 mn 00000425 +33 mx 00000425 +33 sp -------------------------------- +34 a ÑŸ +34 mn 0000045F +34 mx 0000045F +34 sp -------------------------------- +35 a ┥ +35 mn 00002525 +35 mx 00002525 +35 sp -------------------------------- +36 a 彟 +36 mn 00005F5F +36 mx 00005F5F +36 sp -------------------------------- DROP VIEW v1; DROP TABLE t1; +# +# Start of 10.2 tests +# +# +# MDEV-10134 Add full support for DEFAULT +# +CREATE TABLE t1 ( +a VARCHAR(10), +mn VARCHAR(10) DEFAULT LIKE_RANGE_MIN(a,10), +mx VARCHAR(10) DEFAULT LIKE_RANGE_MAX(a,10) +); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `mn` varchar(10) DEFAULT LIKE_RANGE_MIN(a,10), + `mx` varchar(10) DEFAULT LIKE_RANGE_MAX(a,10) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES ('a'),('a_'),('a%'); +SELECT a, HEX(mn), HEX(mx) FROM t1; +a HEX(mn) HEX(mx) +a 61 61 +a_ 6100 61FF +a% 61000000000000000000 61FFFFFFFFFFFFFFFFFF +DROP TABLE t1; +# +# End of 10.2 tests +# diff --git a/mysql-test/r/ctype_recoding.result b/mysql-test/r/ctype_recoding.result index c84da0d7496..93f1639e88d 100644 --- a/mysql-test/r/ctype_recoding.result +++ b/mysql-test/r/ctype_recoding.result @@ -30,7 +30,7 @@ CREATE TABLE t2 (a TEXT CHARACTER SET utf8); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` text CHARACTER SET cp1251 + `a` text CHARACTER SET cp1251 DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SELECT HEX(a) FROM t1; HEX(a) @@ -277,9 +277,40 @@ CREATE TABLE t1 ( a VARCHAR(1) ); INSERT INTO t1 VALUES ('m'),('n'); CREATE VIEW v1 AS SELECT 'w' ; SELECT * FROM t1 WHERE a < ALL ( SELECT * FROM v1 ); -ERROR HY000: Illegal mix of collations (utf8_general_ci,COERCIBLE) and (latin1_swedish_ci,IMPLICIT) for operation '<=' +a +m +n drop view v1; drop table t1; SET character_set_connection = default; SET optimizer_switch= default; #End of 5.3 tests +# +# Start of 5.5 tests +# +# +# MDEV-10181 Illegal mix of collation for a field and an ASCII string as a view field +# +SET NAMES utf8; +CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET latin1); +INSERT INTO t1 VALUES ('A'),('a'),('B'),('b'); +CREATE VIEW v1 AS SELECT 'a'; +SELECT * FROM v1,t1 where t1.a=v1.a; +a a +a A +a a +DROP VIEW v1; +DROP TABLE t1; +SET NAMES utf8; +CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET latin1); +INSERT INTO t1 VALUES ('a'),('b'),('c'); +CREATE VIEW v1 AS SELECT 'a' AS a UNION SELECT 'b'; +SELECT * FROM v1,t1 WHERE t1.a=v1.a; +a a +a a +b b +DROP VIEW v1; +DROP TABLE t1; +# +# End of 5.5 tests +# diff --git a/mysql-test/r/ctype_tis620.result b/mysql-test/r/ctype_tis620.result index 7c13aad40a0..f148902953a 100644 --- a/mysql-test/r/ctype_tis620.result +++ b/mysql-test/r/ctype_tis620.result @@ -121,7 +121,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `recid` int(11) NOT NULL AUTO_INCREMENT, - `dyninfo` text, + `dyninfo` text DEFAULT NULL, PRIMARY KEY (`recid`) ) ENGINE=MyISAM DEFAULT CHARSET=tis620 INSERT INTO t1 VALUES (1,'color=\"STB,NPG\"\r\nengine=\"J30A13\"\r\nframe=\"MRHCG1640YP4\"\r\ngrade=\"V6\"\r\nmodel=\"ACCORD\"\r\nmodelcode=\"CG164YEN\"\r\ntype=\"VT6\"\r\n'); diff --git a/mysql-test/r/ctype_uca.result b/mysql-test/r/ctype_uca.result index 08d87fa292d..cade3e4cd75 100644 --- a/mysql-test/r/ctype_uca.result +++ b/mysql-test/r/ctype_uca.result @@ -2706,6 +2706,261 @@ Z,z,Ź,ź,Å»,ż,Ž,ž Ç Ç‚ ǃ +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_thai_520_w2; +group_concat(c1 order by c1) +÷ +× +A,a +Ã,á +À,à +Ä‚,ă +Ắ,ắ +Ằ,ằ +Ẵ,ẵ +Ẳ,ẳ +Â,â +Ấ,ấ +Ầ,ầ +Ẫ,ẫ +Ẩ,ẩ +Ç,ÇŽ +Ã…,Ã¥ +Ǻ,Ç» +Ä,ä +Çž,ÇŸ +Ã,ã +Ç ,Ç¡ +Ä„,Ä… +Ä€,Ä +Ả,ả +Ạ,ạ +Ặ,ặ +Ậ,ậ +AA,Aa,aA,aa +AE,Ae,aE,ae +Æ,æ +Ǽ,ǽ +Ç¢,Ç£ +B,b +Æ€ +Æ +Æ‚,ƃ +C,c +Ć,ć +Ĉ,ĉ +ÄŒ,Ä +ÄŠ,Ä‹ +Ç,ç +CH,Ch,cH,ch +Ƈ,ƈ +D,d +ÄŽ,Ä +Ä,Ä‘ +Ã,ð +DZ,Dz,dZ,dz,DZ,Dz,dz +DŽ,Dž,dŽ,dž,Ç„,Ç…,dž +Ɖ +ÆŠ +Æ‹,ÆŒ +E,e +É,é +È,è +Ä”,Ä• +Ê,ê +Ế,ế +Ề,á» +Ễ,á»… +Ể,ể +Äš,Ä› +Ë,ë +Ẽ,ẽ +Ä–,Ä— +Ę,Ä™ +Ä’,Ä“ +Ẻ,ẻ +Ẹ,ẹ +Ệ,ệ +ÆŽ,Ç +Æ +Æ +F,f +Æ‘,Æ’ +G,g +Ç´,ǵ +Äž,ÄŸ +Äœ,Ä +Ǧ,ǧ +Ä ,Ä¡ +Ä¢,Ä£ +Ǥ,Ç¥ +Æ“ +Æ” +Æ¢,Æ£ +H,h +Ĥ,Ä¥ +Ħ,ħ +Æ•,Ƕ +I,i +Ã,í +ÃŒ,ì +Ĭ,Ä­ +ÃŽ,î +Ç,Ç +Ã,ï +Ĩ,Ä© +Ä° +Ä®,į +Ī,Ä« +Ỉ,ỉ +Ị,ị +IJ,Ij,iJ,ij,IJ,ij +ı +Æ— +Æ– +J,j +Ä´,ĵ +Ç° +K,k +Ǩ,Ç© +Ķ,Ä· +Ƙ,Æ™ +L,l +Ĺ,ĺ +Ľ,ľ +Ä»,ļ +Å,Å‚ +Ä¿,Å€ +LJ,Lj,lJ,lj,LJ,Lj,lj +LL,Ll,lL,ll +Æš +Æ› +M,m +N,n +Ń,Å„ +Ǹ,ǹ +Ň,ň +Ñ,ñ +Å…,ņ +NJ,Nj,nJ,nj,ÇŠ,Ç‹,ÇŒ +Æ +Æž +ÅŠ,Å‹ +O,o +Ó,ó +Ã’,ò +ÅŽ,Å +Ô,ô +á»,ố +á»’,ồ +á»–,á»— +á»”,ổ +Ç‘,Ç’ +Ö,ö +Å,Å‘ +Õ,õ +Ø,ø +Ǿ,Ç¿ +Ǫ,Ç« +Ǭ,Ç­ +ÅŒ,Å +Ỏ,á» +Æ ,Æ¡ +Ớ,á»› +Ờ,á» +á» ,ỡ +Ở,ở +Ợ,ợ +Ọ,á» +Ộ,á»™ +OE,Oe,oE,oe +Å’,Å“ +Ɔ +ÆŸ +P,p +Ƥ,Æ¥ +Q,q +ĸ +R,r +Å”,Å• +Ř,Å™ +Å–,Å— +RR,Rr,rR,rr +Ʀ +S,s +Åš,Å› +Åœ,Å +Å ,Å¡ +Åž,ÅŸ +Å¿ +SS,Ss,sS,ss +ß +Æ© +ƪ +T,t +Ť,Å¥ +Å¢,Å£ +ƾ +Ŧ,ŧ +Æ« +Ƭ,Æ­ +Æ® +U,u +Ú,ú +Ù,ù +Ŭ,Å­ +Û,û +Ç“,Ç” +Å®,ů +Ãœ,ü +Ç—,ǘ +Ç›,Çœ +Ç™,Çš +Ç•,Ç– +Å°,ű +Ũ,Å© +Ų,ų +Ū,Å« +Ủ,ủ +Ư,Æ° +Ứ,ứ +Ừ,ừ +á»®,ữ +Ử,á»­ +á»°,á»± +Ụ,ụ +Æœ +Ʊ +V,v +Ʋ +W,w +Å´,ŵ +X,x +Y,y +Ã,ý +Ŷ,Å· +ÿ,Ÿ +Ƴ,Æ´ +Z,z +Ź,ź +Ž,ž +Å»,ż +Æ +Ƶ,ƶ +Æ· +Ç®,ǯ +Ƹ,ƹ +ƺ +Þ,þ +Æ¿,Ç· +Æ» +Ƨ,ƨ +Ƽ,ƽ +Æ„,Æ… +ʼn +Ç€ +Ç +Ç‚ +ǃ ALTER TABLE t1 CONVERT TO CHARACTER SET ucs2 COLLATE ucs2_bin; SELECT GROUP_CONCAT(c1 ORDER BY c1) FROM t1 GROUP BY c1 COLLATE ucs2_unicode_ci; GROUP_CONCAT(c1 ORDER BY c1) @@ -13724,7 +13979,1393 @@ SELECT * FROM t1 WHERE a='a' AND a=_utf8'a'; a a DROP TABLE t1; +SET NAMES utf8 COLLATE utf8_thai_520_w2; +# +# Start of ctype_uca_w2.inc +# +SELECT @@collation_connection; +@@collation_connection +utf8_thai_520_w2 +SELECT ID, SORTLEN, COLLATION_NAME, CHARACTER_SET_NAME +FROM INFORMATION_SCHEMA.COLLATIONS +WHERE COLLATION_NAME LIKE @@collation_connection; +ID SORTLEN COLLATION_NAME CHARACTER_SET_NAME +578 4 utf8_thai_520_w2 utf8 +# +# Testing strnxfrm +# +CREATE TABLE t1 AS SELECT SPACE(3) AS a LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(3) CHARACTER SET utf8 COLLATE utf8_thai_520_w2 NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (SPACE(0)),(SPACE(1)),(SPACE(2)); +SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(8))) FROM t1; +HEX(a) HEX(WEIGHT_STRING(a AS CHAR(8))) + 020A020A020A020A020A020A020A020A00200020002000200020002000200020 +20 020A020A020A020A020A020A020A020A00200020002000200020002000200020 +2020 020A020A020A020A020A020A020A020A00200020002000200020002000200020 +SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(4))) FROM t1; +HEX(a) HEX(WEIGHT_STRING(a AS CHAR(4))) + 020A020A020A020A0020002000200020 +20 020A020A020A020A0020002000200020 +2020 020A020A020A020A0020002000200020 +SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 1)) FROM t1; +HEX(a) HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 1)) + 020A020A020A020A +20 020A020A020A020A +2020 020A020A020A020A +SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 2)) FROM t1; +HEX(a) HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 2)) + 0020002000200020 +20 0020002000200020 +2020 0020002000200020 +SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 3)) FROM t1; +HEX(a) HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 3)) + 0020002000200020 +20 0020002000200020 +2020 0020002000200020 +DROP TABLE t1; +CREATE TABLE t1 AS SELECT SPACE(10) AS a LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) CHARACTER SET utf8 COLLATE utf8_thai_520_w2 NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (_ucs2 0x3400); +INSERT INTO t1 VALUES (_ucs2 0xF001); +SELECT HEX(CONVERT(a USING ucs2)) AS ucs2, HEX(a), HEX(WEIGHT_STRING(a)) FROM t1; +ucs2 HEX(a) HEX(WEIGHT_STRING(a)) +3400 E39080 FB80B4000020 +F001 EF8081 FBC1F0010020 +DROP TABLE t1; +CREATE TABLE t1 AS SELECT SPACE(10) AS a LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) CHARACTER SET utf8 COLLATE utf8_thai_520_w2 NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES ('A'),('À'),('Ã'),('Â'),('Ã'),('Ä'),('Ã…'); +SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a; +a HEX(WEIGHT_STRING(a LEVEL 2)) +A 0020 +à 00200032 +À 00200035 + 0020003C +Ã… 00200043 +Ä 00200047 +à 0020004E +SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a DESC; +a HEX(WEIGHT_STRING(a LEVEL 2)) +à 0020004E +Ä 00200047 +Ã… 00200043 + 0020003C +À 00200035 +à 00200032 +A 0020 +SET @backup_character_set_connection=@@character_set_connection; +SET @backup_collation_connection=@@collation_connection; SET NAMES utf8; +SET @stmt= CONCAT('ALTER TABLE t1 MODIFY a CHAR(10)' COLLATE utf8_bin, +' CHARACTER SET ', @backup_character_set_connection, +' COLLATE ', @backup_collation_connection); +PREPARE stmt FROM @stmt; +EXECUTE stmt; +DEALLOCATE PREPARE stmt; +SET collation_connection=@backup_collation_connection; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(10) CHARACTER SET utf8 COLLATE utf8_thai_520_w2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a; +a HEX(WEIGHT_STRING(a LEVEL 2)) +A 0020 +à 00200032 +À 00200035 + 0020003C +Ã… 00200043 +Ä 00200047 +à 0020004E +SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a DESC; +a HEX(WEIGHT_STRING(a LEVEL 2)) +à 0020004E +Ä 00200047 +Ã… 00200043 + 0020003C +À 00200035 +à 00200032 +A 0020 +DROP TABLE t1; +CREATE TABLE t1 AS SELECT SPACE(10) AS a LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) CHARACTER SET utf8 COLLATE utf8_thai_520_w2 NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES ('cota'),('cote'),('cotz'); +INSERT INTO t1 VALUES ('coté'),('côte'),('côté'),('cotë'),('côtë'); +SELECT * FROM t1 ORDER BY a; +a +cota +cote +coté +cotë +côte +côté +côtë +cotz +SELECT * FROM t1 ORDER BY a DESC; +a +cotz +côtë +côté +côte +cotë +coté +cote +cota +DROP TABLE t1; +# +# End of ctype_uca_w2.inc +# +# +# Start of ctype_thai.inc +# +CREATE TABLE t1 (a VARCHAR(30) CHARACTER SET utf8 COLLATE utf8_bin); +INSERT INTO t1 VALUES ('-à¸à¸£à¸°à¹à¸¢à¹ˆà¸‡'); +INSERT INTO t1 VALUES ('à¸à¸'); +INSERT INTO t1 VALUES ('à¸à¸£à¸²à¸š'); +INSERT INTO t1 VALUES ('ข่าง'); +INSERT INTO t1 VALUES ('ข้าง'); +INSERT INTO t1 VALUES ('ข้างà¸à¸£à¸°à¸”าน'); +INSERT INTO t1 VALUES ('ข้างขึ้น'); +INSERT INTO t1 VALUES ('ข้างควาย'); +INSERT INTO t1 VALUES ('ข้างเงิน'); +INSERT INTO t1 VALUES ('ข้างà¹à¸£à¸¡'); +INSERT INTO t1 VALUES ('ข้างออà¸'); +INSERT INTO t1 VALUES ('ข้างๆ'); +INSERT INTO t1 VALUES ('ข้างๆ คูๆ'); +INSERT INTO t1 VALUES ('ขาง'); +INSERT INTO t1 VALUES ('à¹à¸‚็ง'); +INSERT INTO t1 VALUES ('à¹à¸‚่ง'); +INSERT INTO t1 VALUES ('à¹à¸‚่งขัน'); +INSERT INTO t1 VALUES ('à¹à¸‚้ง'); +INSERT INTO t1 VALUES ('à¹à¸‚้งขวา'); +INSERT INTO t1 VALUES ('à¹à¸‚็งขัน'); +INSERT INTO t1 VALUES ('ทูลเà¸à¸¥à¹‰à¸²'); +INSERT INTO t1 VALUES ('ทูลเà¸à¸¥à¹‰à¸²à¸—ูลà¸à¸£à¸°à¸«à¸¡à¹ˆà¸­à¸¡'); +INSERT INTO t1 VALUES ('ทูลเà¸à¸¥à¹‰à¸²à¸¯'); +INSERT INTO t1 VALUES ('บุà¸à¸à¸²'); +INSERT INTO t1 VALUES ('บุà¸-หลง'); +INSERT INTO t1 VALUES ('บุà¸à¸«à¸¥à¸‡'); +INSERT INTO t1 VALUES ('ป่า'); +INSERT INTO t1 VALUES ('ป่าน'); +INSERT INTO t1 VALUES ('ป้า'); +INSERT INTO t1 VALUES ('ป้าน'); +INSERT INTO t1 VALUES ('ป๊า'); +INSERT INTO t1 VALUES ('ป๊าน'); +INSERT INTO t1 VALUES ('ป๋า'); +INSERT INTO t1 VALUES ('ป๋าน'); +INSERT INTO t1 VALUES ('ปา'); +INSERT INTO t1 VALUES ('ปาน'); +INSERT INTO t1 VALUES ('à¹à¸›à¹‰à¸‡'); +INSERT INTO t1 VALUES ('พณิชย์'); +INSERT INTO t1 VALUES ('ม้า'); +INSERT INTO t1 VALUES ('ฯพณฯ'); +INSERT INTO t1 VALUES ('A'); +INSERT INTO t1 VALUES ('a'); +INSERT INTO t1 VALUES ('a\''); +INSERT INTO t1 VALUES ('A-'); +INSERT INTO t1 VALUES ('a-'); +INSERT INTO t1 VALUES ('-a'); +INSERT INTO t1 VALUES ('A.'); +INSERT INTO t1 VALUES ('a.'); +INSERT INTO t1 VALUES ('A-1'); +INSERT INTO t1 VALUES ('aa'); +INSERT INTO t1 VALUES ('AA'); +INSERT INTO t1 VALUES ('A.A.'); +INSERT INTO t1 VALUES ('a.a.'); +INSERT INTO t1 VALUES ('AAA'); +INSERT INTO t1 VALUES ('A.A.A.'); +INSERT INTO t1 VALUES ('AAAA'); +INSERT INTO t1 VALUES ('A.A.A.L.'); +INSERT INTO t1 VALUES ('A.A.A.S.'); +INSERT INTO t1 VALUES ('Aachen'); +INSERT INTO t1 VALUES ('A.A.E.'); +INSERT INTO t1 VALUES ('A.Ae.E.'); +INSERT INTO t1 VALUES ('A.A.E.E.'); +INSERT INTO t1 VALUES ('AAES'); +INSERT INTO t1 VALUES ('AAF'); +INSERT INTO t1 VALUES ('A.Agr'); +INSERT INTO t1 VALUES ('aah'); +INSERT INTO t1 VALUES ('@@@@@'); +INSERT INTO t1 VALUES ('0000'); +INSERT INTO t1 VALUES ('9999'); +INSERT INTO t1 VALUES ('Aalborg'); +INSERT INTO t1 VALUES ('aide'); +INSERT INTO t1 VALUES ('air'); +INSERT INTO t1 VALUES ('@@@air'); +INSERT INTO t1 VALUES ('air@@@'); +INSERT INTO t1 VALUES ('C.A.F'); +INSERT INTO t1 VALUES ('Canon'); +INSERT INTO t1 VALUES ('coop'); +INSERT INTO t1 VALUES ('co-op'); +INSERT INTO t1 VALUES ('COOP'); +INSERT INTO t1 VALUES ('CO-OP'); +INSERT INTO t1 VALUES ('Copenhegen'); +INSERT INTO t1 VALUES ('McArthur'); +INSERT INTO t1 VALUES ('Mc Arthur'); +INSERT INTO t1 VALUES ('Mc Mahon'); +INSERT INTO t1 VALUES ('vice-president'); +INSERT INTO t1 VALUES ('vice versa'); +INSERT INTO t1 VALUES ('vice-versa'); +INSERT INTO t1 VALUES ('10 ลิตร'); +INSERT INTO t1 VALUES ('๑๠ลิตร'); +INSERT INTO t1 VALUES ('10 litre'); +INSERT INTO t1 VALUES ('10 litre (10 ลิตร)'); +INSERT INTO t1 VALUES ('10 ลิตร (10 litre)'); +INSERT INTO t1 VALUES ('10 litre (๑๠ลิตร)'); +INSERT INTO t1 VALUES ('๑๠ลิตร (10 litre)'); +INSERT INTO t1 VALUES ('๑๠ลิตร [10 litre]'); +INSERT INTO t1 VALUES ('๑๠ลิตร {10 litre}'); +ALTER TABLE t1 ORDER BY a; +SET @backup_character_set_connection=@@character_set_connection; +SET @backup_collation_connection=@@collation_connection; +SET NAMES utf8; +SET @stmt= CONCAT('ALTER TABLE t1 MODIFY a VARCHAR(30)', +' CHARACTER SET ', @backup_character_set_connection, +' COLLATE ', @backup_collation_connection, +' , ADD id INT NOT NULL AUTO_INCREMENT PRIMARY KEY' + ' , ADD KEY a_id (a, id)'); +PREPARE stmt FROM @stmt; +EXECUTE stmt; +DEALLOCATE PREPARE stmt; +SET collation_connection=@backup_collation_connection; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(30) CHARACTER SET utf8 COLLATE utf8_thai_520_w2 DEFAULT NULL, + `id` int(11) NOT NULL AUTO_INCREMENT, + PRIMARY KEY (`id`), + KEY `a_id` (`a`,`id`) +) ENGINE=MyISAM AUTO_INCREMENT=97 DEFAULT CHARSET=latin1 +# +# Ascending sort, using filesort +# +EXPLAIN SELECT a FROM t1 ORDER BY a, BINARY a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL a_id 97 NULL 96 Using index; Using filesort +SELECT a FROM t1 ORDER BY a, BINARY a; +a +-a +-à¸à¸£à¸°à¹à¸¢à¹ˆà¸‡ +@@@@@ +@@@air +0000 +10 litre +10 litre (10 ลิตร) +10 litre (๑๠ลิตร) +10 ลิตร +๑๠ลิตร +10 ลิตร (10 litre) +๑๠ลิตร (10 litre) +๑๠ลิตร [10 litre] +๑๠ลิตร {10 litre} +9999 +A +a +A- +a- +A-1 +A. +a. +A.A. +a.a. +A.A.A. +A.A.A.L. +A.A.A.S. +A.A.E. +A.A.E.E. +A.Ae.E. +A.Agr +a' +AA +aa +AAA +AAAA +Aachen +AAES +AAF +aah +Aalborg +aide +air +air@@@ +C.A.F +Canon +CO-OP +co-op +COOP +coop +Copenhegen +Mc Arthur +Mc Mahon +McArthur +vice versa +vice-president +vice-versa +à¸à¸ +à¸à¸£à¸²à¸š +ขาง +ข่าง +ข้าง +ข้างๆ +ข้างๆ คูๆ +ข้างà¸à¸£à¸°à¸”าน +ข้างขึ้น +ข้างควาย +ข้างเงิน +ข้างà¹à¸£à¸¡ +ข้างออภ+à¹à¸‚็ง +à¹à¸‚่ง +à¹à¸‚้ง +à¹à¸‚้งขวา +à¹à¸‚็งขัน +à¹à¸‚่งขัน +ทูลเà¸à¸¥à¹‰à¸² +ทูลเà¸à¸¥à¹‰à¸²à¸—ูลà¸à¸£à¸°à¸«à¸¡à¹ˆà¸­à¸¡ +ทูลเà¸à¸¥à¹‰à¸²à¸¯ +บุà¸-หลง +บุà¸à¸à¸² +บุà¸à¸«à¸¥à¸‡ +ปา +ป่า +ป้า +ป๊า +ป๋า +ปาน +ป่าน +ป้าน +ป๊าน +ป๋าน +à¹à¸›à¹‰à¸‡ +พณิชย์ +ม้า +ฯพณฯ +# +# Descending sort, using filesort +# +EXPLAIN SELECT a FROM t1 ORDER BY a DESC, BINARY a DESC; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL a_id 97 NULL 96 Using index; Using filesort +SELECT a FROM t1 ORDER BY a DESC, BINARY a DESC; +a +ฯพณฯ +ม้า +พณิชย์ +à¹à¸›à¹‰à¸‡ +ป๋าน +ป๊าน +ป้าน +ป่าน +ปาน +ป๋า +ป๊า +ป้า +ป่า +ปา +บุà¸à¸«à¸¥à¸‡ +บุà¸à¸à¸² +บุà¸-หลง +ทูลเà¸à¸¥à¹‰à¸²à¸¯ +ทูลเà¸à¸¥à¹‰à¸²à¸—ูลà¸à¸£à¸°à¸«à¸¡à¹ˆà¸­à¸¡ +ทูลเà¸à¸¥à¹‰à¸² +à¹à¸‚่งขัน +à¹à¸‚็งขัน +à¹à¸‚้งขวา +à¹à¸‚้ง +à¹à¸‚่ง +à¹à¸‚็ง +ข้างออภ+ข้างà¹à¸£à¸¡ +ข้างเงิน +ข้างควาย +ข้างขึ้น +ข้างà¸à¸£à¸°à¸”าน +ข้างๆ คูๆ +ข้างๆ +ข้าง +ข่าง +ขาง +à¸à¸£à¸²à¸š +à¸à¸ +vice-versa +vice-president +vice versa +McArthur +Mc Mahon +Mc Arthur +Copenhegen +coop +COOP +co-op +CO-OP +Canon +C.A.F +air@@@ +air +aide +Aalborg +aah +AAF +AAES +Aachen +AAAA +AAA +aa +AA +a' +A.Agr +A.Ae.E. +A.A.E.E. +A.A.E. +A.A.A.S. +A.A.A.L. +A.A.A. +a.a. +A.A. +a. +A. +A-1 +a- +A- +a +A +9999 +๑๠ลิตร {10 litre} +๑๠ลิตร [10 litre] +๑๠ลิตร (10 litre) +10 ลิตร (10 litre) +๑๠ลิตร +10 ลิตร +10 litre (๑๠ลิตร) +10 litre (10 ลิตร) +10 litre +0000 +@@@air +@@@@@ +-à¸à¸£à¸°à¹à¸¢à¹ˆà¸‡ +-a +# +# Ascending sort, using index +# +EXPLAIN SELECT a FROM t1 ORDER BY a, id; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL a_id 97 NULL 96 Using index +SELECT a FROM t1 ORDER BY a, id; +a +-a +-à¸à¸£à¸°à¹à¸¢à¹ˆà¸‡ +@@@@@ +@@@air +0000 +10 litre +10 litre (10 ลิตร) +10 litre (๑๠ลิตร) +10 ลิตร +๑๠ลิตร +10 ลิตร (10 litre) +๑๠ลิตร (10 litre) +๑๠ลิตร [10 litre] +๑๠ลิตร {10 litre} +9999 +A +a +A- +a- +A-1 +A. +a. +A.A. +a.a. +A.A.A. +A.A.A.L. +A.A.A.S. +A.A.E. +A.A.E.E. +A.Ae.E. +A.Agr +a' +AA +aa +AAA +AAAA +Aachen +AAES +AAF +aah +Aalborg +aide +air +air@@@ +C.A.F +Canon +CO-OP +co-op +COOP +coop +Copenhegen +Mc Arthur +Mc Mahon +McArthur +vice versa +vice-president +vice-versa +à¸à¸ +à¸à¸£à¸²à¸š +ขาง +ข่าง +ข้าง +ข้างๆ +ข้างๆ คูๆ +ข้างà¸à¸£à¸°à¸”าน +ข้างขึ้น +ข้างควาย +ข้างเงิน +ข้างà¹à¸£à¸¡ +ข้างออภ+à¹à¸‚็ง +à¹à¸‚่ง +à¹à¸‚้ง +à¹à¸‚้งขวา +à¹à¸‚็งขัน +à¹à¸‚่งขัน +ทูลเà¸à¸¥à¹‰à¸² +ทูลเà¸à¸¥à¹‰à¸²à¸—ูลà¸à¸£à¸°à¸«à¸¡à¹ˆà¸­à¸¡ +ทูลเà¸à¸¥à¹‰à¸²à¸¯ +บุà¸-หลง +บุà¸à¸à¸² +บุà¸à¸«à¸¥à¸‡ +ปา +ป่า +ป้า +ป๊า +ป๋า +ปาน +ป่าน +ป้าน +ป๊าน +ป๋าน +à¹à¸›à¹‰à¸‡ +พณิชย์ +ม้า +ฯพณฯ +# +# Descending sort, using index +# +EXPLAIN SELECT a FROM t1 ORDER BY a DESC, id DESC; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL a_id 97 NULL 96 Using index +SELECT a FROM t1 ORDER BY a DESC, id DESC; +a +ฯพณฯ +ม้า +พณิชย์ +à¹à¸›à¹‰à¸‡ +ป๋าน +ป๊าน +ป้าน +ป่าน +ปาน +ป๋า +ป๊า +ป้า +ป่า +ปา +บุà¸à¸«à¸¥à¸‡ +บุà¸à¸à¸² +บุà¸-หลง +ทูลเà¸à¸¥à¹‰à¸²à¸¯ +ทูลเà¸à¸¥à¹‰à¸²à¸—ูลà¸à¸£à¸°à¸«à¸¡à¹ˆà¸­à¸¡ +ทูลเà¸à¸¥à¹‰à¸² +à¹à¸‚่งขัน +à¹à¸‚็งขัน +à¹à¸‚้งขวา +à¹à¸‚้ง +à¹à¸‚่ง +à¹à¸‚็ง +ข้างออภ+ข้างà¹à¸£à¸¡ +ข้างเงิน +ข้างควาย +ข้างขึ้น +ข้างà¸à¸£à¸°à¸”าน +ข้างๆ คูๆ +ข้างๆ +ข้าง +ข่าง +ขาง +à¸à¸£à¸²à¸š +à¸à¸ +vice-versa +vice-president +vice versa +McArthur +Mc Mahon +Mc Arthur +Copenhegen +coop +COOP +co-op +CO-OP +Canon +C.A.F +air@@@ +air +aide +Aalborg +aah +AAF +AAES +Aachen +AAAA +AAA +aa +AA +a' +A.Agr +A.Ae.E. +A.A.E.E. +A.A.E. +A.A.A.S. +A.A.A.L. +A.A.A. +a.a. +A.A. +a. +A. +A-1 +a- +A- +a +A +9999 +๑๠ลิตร {10 litre} +๑๠ลิตร [10 litre] +๑๠ลิตร (10 litre) +10 ลิตร (10 litre) +๑๠ลิตร +10 ลิตร +10 litre (๑๠ลิตร) +10 litre (10 ลิตร) +10 litre +0000 +@@@air +@@@@@ +-à¸à¸£à¸°à¹à¸¢à¹ˆà¸‡ +-a +DROP TABLE t1; +# +# End of ctype_thai.inc +# +SET NAMES utf8; +SET collation_connection=ucs2_thai_520_w2; +# +# Start of ctype_uca_w2.inc +# +SELECT @@collation_connection; +@@collation_connection +ucs2_thai_520_w2 +SELECT ID, SORTLEN, COLLATION_NAME, CHARACTER_SET_NAME +FROM INFORMATION_SCHEMA.COLLATIONS +WHERE COLLATION_NAME LIKE @@collation_connection; +ID SORTLEN COLLATION_NAME CHARACTER_SET_NAME +642 4 ucs2_thai_520_w2 ucs2 +# +# Testing strnxfrm +# +CREATE TABLE t1 AS SELECT SPACE(3) AS a LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(3) CHARACTER SET ucs2 COLLATE ucs2_thai_520_w2 NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (SPACE(0)),(SPACE(1)),(SPACE(2)); +SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(8))) FROM t1; +HEX(a) HEX(WEIGHT_STRING(a AS CHAR(8))) + 020A020A020A020A020A020A020A020A00200020002000200020002000200020 +0020 020A020A020A020A020A020A020A020A00200020002000200020002000200020 +00200020 020A020A020A020A020A020A020A020A00200020002000200020002000200020 +SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(4))) FROM t1; +HEX(a) HEX(WEIGHT_STRING(a AS CHAR(4))) + 020A020A020A020A0020002000200020 +0020 020A020A020A020A0020002000200020 +00200020 020A020A020A020A0020002000200020 +SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 1)) FROM t1; +HEX(a) HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 1)) + 020A020A020A020A +0020 020A020A020A020A +00200020 020A020A020A020A +SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 2)) FROM t1; +HEX(a) HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 2)) + 0020002000200020 +0020 0020002000200020 +00200020 0020002000200020 +SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 3)) FROM t1; +HEX(a) HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 3)) + 0020002000200020 +0020 0020002000200020 +00200020 0020002000200020 +DROP TABLE t1; +CREATE TABLE t1 AS SELECT SPACE(10) AS a LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) CHARACTER SET ucs2 COLLATE ucs2_thai_520_w2 NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (_ucs2 0x3400); +INSERT INTO t1 VALUES (_ucs2 0xF001); +SELECT HEX(CONVERT(a USING ucs2)) AS ucs2, HEX(a), HEX(WEIGHT_STRING(a)) FROM t1; +ucs2 HEX(a) HEX(WEIGHT_STRING(a)) +3400 3400 FB80B4000020 +F001 F001 FBC1F0010020 +DROP TABLE t1; +CREATE TABLE t1 AS SELECT SPACE(10) AS a LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) CHARACTER SET ucs2 COLLATE ucs2_thai_520_w2 NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES ('A'),('À'),('Ã'),('Â'),('Ã'),('Ä'),('Ã…'); +SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a; +a HEX(WEIGHT_STRING(a LEVEL 2)) +A 0020 +à 00200032 +À 00200035 + 0020003C +Ã… 00200043 +Ä 00200047 +à 0020004E +SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a DESC; +a HEX(WEIGHT_STRING(a LEVEL 2)) +à 0020004E +Ä 00200047 +Ã… 00200043 + 0020003C +À 00200035 +à 00200032 +A 0020 +SET @backup_character_set_connection=@@character_set_connection; +SET @backup_collation_connection=@@collation_connection; +SET NAMES utf8; +SET @stmt= CONCAT('ALTER TABLE t1 MODIFY a CHAR(10)' COLLATE utf8_bin, +' CHARACTER SET ', @backup_character_set_connection, +' COLLATE ', @backup_collation_connection); +PREPARE stmt FROM @stmt; +EXECUTE stmt; +DEALLOCATE PREPARE stmt; +SET collation_connection=@backup_collation_connection; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(10) CHARACTER SET ucs2 COLLATE ucs2_thai_520_w2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a; +a HEX(WEIGHT_STRING(a LEVEL 2)) +A 0020 +à 00200032 +À 00200035 + 0020003C +Ã… 00200043 +Ä 00200047 +à 0020004E +SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a DESC; +a HEX(WEIGHT_STRING(a LEVEL 2)) +à 0020004E +Ä 00200047 +Ã… 00200043 + 0020003C +À 00200035 +à 00200032 +A 0020 +DROP TABLE t1; +CREATE TABLE t1 AS SELECT SPACE(10) AS a LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) CHARACTER SET ucs2 COLLATE ucs2_thai_520_w2 NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES ('cota'),('cote'),('cotz'); +INSERT INTO t1 VALUES ('coté'),('côte'),('côté'),('cotë'),('côtë'); +SELECT * FROM t1 ORDER BY a; +a +cota +cote +coté +cotë +côte +côté +côtë +cotz +SELECT * FROM t1 ORDER BY a DESC; +a +cotz +côtë +côté +côte +cotë +coté +cote +cota +DROP TABLE t1; +# +# End of ctype_uca_w2.inc +# +# +# Start of ctype_thai.inc +# +CREATE TABLE t1 (a VARCHAR(30) CHARACTER SET utf8 COLLATE utf8_bin); +INSERT INTO t1 VALUES ('-à¸à¸£à¸°à¹à¸¢à¹ˆà¸‡'); +INSERT INTO t1 VALUES ('à¸à¸'); +INSERT INTO t1 VALUES ('à¸à¸£à¸²à¸š'); +INSERT INTO t1 VALUES ('ข่าง'); +INSERT INTO t1 VALUES ('ข้าง'); +INSERT INTO t1 VALUES ('ข้างà¸à¸£à¸°à¸”าน'); +INSERT INTO t1 VALUES ('ข้างขึ้น'); +INSERT INTO t1 VALUES ('ข้างควาย'); +INSERT INTO t1 VALUES ('ข้างเงิน'); +INSERT INTO t1 VALUES ('ข้างà¹à¸£à¸¡'); +INSERT INTO t1 VALUES ('ข้างออà¸'); +INSERT INTO t1 VALUES ('ข้างๆ'); +INSERT INTO t1 VALUES ('ข้างๆ คูๆ'); +INSERT INTO t1 VALUES ('ขาง'); +INSERT INTO t1 VALUES ('à¹à¸‚็ง'); +INSERT INTO t1 VALUES ('à¹à¸‚่ง'); +INSERT INTO t1 VALUES ('à¹à¸‚่งขัน'); +INSERT INTO t1 VALUES ('à¹à¸‚้ง'); +INSERT INTO t1 VALUES ('à¹à¸‚้งขวา'); +INSERT INTO t1 VALUES ('à¹à¸‚็งขัน'); +INSERT INTO t1 VALUES ('ทูลเà¸à¸¥à¹‰à¸²'); +INSERT INTO t1 VALUES ('ทูลเà¸à¸¥à¹‰à¸²à¸—ูลà¸à¸£à¸°à¸«à¸¡à¹ˆà¸­à¸¡'); +INSERT INTO t1 VALUES ('ทูลเà¸à¸¥à¹‰à¸²à¸¯'); +INSERT INTO t1 VALUES ('บุà¸à¸à¸²'); +INSERT INTO t1 VALUES ('บุà¸-หลง'); +INSERT INTO t1 VALUES ('บุà¸à¸«à¸¥à¸‡'); +INSERT INTO t1 VALUES ('ป่า'); +INSERT INTO t1 VALUES ('ป่าน'); +INSERT INTO t1 VALUES ('ป้า'); +INSERT INTO t1 VALUES ('ป้าน'); +INSERT INTO t1 VALUES ('ป๊า'); +INSERT INTO t1 VALUES ('ป๊าน'); +INSERT INTO t1 VALUES ('ป๋า'); +INSERT INTO t1 VALUES ('ป๋าน'); +INSERT INTO t1 VALUES ('ปา'); +INSERT INTO t1 VALUES ('ปาน'); +INSERT INTO t1 VALUES ('à¹à¸›à¹‰à¸‡'); +INSERT INTO t1 VALUES ('พณิชย์'); +INSERT INTO t1 VALUES ('ม้า'); +INSERT INTO t1 VALUES ('ฯพณฯ'); +INSERT INTO t1 VALUES ('A'); +INSERT INTO t1 VALUES ('a'); +INSERT INTO t1 VALUES ('a\''); +INSERT INTO t1 VALUES ('A-'); +INSERT INTO t1 VALUES ('a-'); +INSERT INTO t1 VALUES ('-a'); +INSERT INTO t1 VALUES ('A.'); +INSERT INTO t1 VALUES ('a.'); +INSERT INTO t1 VALUES ('A-1'); +INSERT INTO t1 VALUES ('aa'); +INSERT INTO t1 VALUES ('AA'); +INSERT INTO t1 VALUES ('A.A.'); +INSERT INTO t1 VALUES ('a.a.'); +INSERT INTO t1 VALUES ('AAA'); +INSERT INTO t1 VALUES ('A.A.A.'); +INSERT INTO t1 VALUES ('AAAA'); +INSERT INTO t1 VALUES ('A.A.A.L.'); +INSERT INTO t1 VALUES ('A.A.A.S.'); +INSERT INTO t1 VALUES ('Aachen'); +INSERT INTO t1 VALUES ('A.A.E.'); +INSERT INTO t1 VALUES ('A.Ae.E.'); +INSERT INTO t1 VALUES ('A.A.E.E.'); +INSERT INTO t1 VALUES ('AAES'); +INSERT INTO t1 VALUES ('AAF'); +INSERT INTO t1 VALUES ('A.Agr'); +INSERT INTO t1 VALUES ('aah'); +INSERT INTO t1 VALUES ('@@@@@'); +INSERT INTO t1 VALUES ('0000'); +INSERT INTO t1 VALUES ('9999'); +INSERT INTO t1 VALUES ('Aalborg'); +INSERT INTO t1 VALUES ('aide'); +INSERT INTO t1 VALUES ('air'); +INSERT INTO t1 VALUES ('@@@air'); +INSERT INTO t1 VALUES ('air@@@'); +INSERT INTO t1 VALUES ('C.A.F'); +INSERT INTO t1 VALUES ('Canon'); +INSERT INTO t1 VALUES ('coop'); +INSERT INTO t1 VALUES ('co-op'); +INSERT INTO t1 VALUES ('COOP'); +INSERT INTO t1 VALUES ('CO-OP'); +INSERT INTO t1 VALUES ('Copenhegen'); +INSERT INTO t1 VALUES ('McArthur'); +INSERT INTO t1 VALUES ('Mc Arthur'); +INSERT INTO t1 VALUES ('Mc Mahon'); +INSERT INTO t1 VALUES ('vice-president'); +INSERT INTO t1 VALUES ('vice versa'); +INSERT INTO t1 VALUES ('vice-versa'); +INSERT INTO t1 VALUES ('10 ลิตร'); +INSERT INTO t1 VALUES ('๑๠ลิตร'); +INSERT INTO t1 VALUES ('10 litre'); +INSERT INTO t1 VALUES ('10 litre (10 ลิตร)'); +INSERT INTO t1 VALUES ('10 ลิตร (10 litre)'); +INSERT INTO t1 VALUES ('10 litre (๑๠ลิตร)'); +INSERT INTO t1 VALUES ('๑๠ลิตร (10 litre)'); +INSERT INTO t1 VALUES ('๑๠ลิตร [10 litre]'); +INSERT INTO t1 VALUES ('๑๠ลิตร {10 litre}'); +ALTER TABLE t1 ORDER BY a; +SET @backup_character_set_connection=@@character_set_connection; +SET @backup_collation_connection=@@collation_connection; +SET NAMES utf8; +SET @stmt= CONCAT('ALTER TABLE t1 MODIFY a VARCHAR(30)', +' CHARACTER SET ', @backup_character_set_connection, +' COLLATE ', @backup_collation_connection, +' , ADD id INT NOT NULL AUTO_INCREMENT PRIMARY KEY' + ' , ADD KEY a_id (a, id)'); +PREPARE stmt FROM @stmt; +EXECUTE stmt; +DEALLOCATE PREPARE stmt; +SET collation_connection=@backup_collation_connection; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(30) CHARACTER SET ucs2 COLLATE ucs2_thai_520_w2 DEFAULT NULL, + `id` int(11) NOT NULL AUTO_INCREMENT, + PRIMARY KEY (`id`), + KEY `a_id` (`a`,`id`) +) ENGINE=MyISAM AUTO_INCREMENT=97 DEFAULT CHARSET=latin1 +# +# Ascending sort, using filesort +# +EXPLAIN SELECT a FROM t1 ORDER BY a, BINARY a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL a_id 67 NULL 96 Using index; Using filesort +SELECT a FROM t1 ORDER BY a, BINARY a; +a +-a +-à¸à¸£à¸°à¹à¸¢à¹ˆà¸‡ +@@@@@ +@@@air +0000 +10 litre +10 litre (10 ลิตร) +10 litre (๑๠ลิตร) +10 ลิตร +๑๠ลิตร +10 ลิตร (10 litre) +๑๠ลิตร (10 litre) +๑๠ลิตร [10 litre] +๑๠ลิตร {10 litre} +9999 +A +a +A- +a- +A-1 +A. +a. +A.A. +a.a. +A.A.A. +A.A.A.L. +A.A.A.S. +A.A.E. +A.A.E.E. +A.Ae.E. +A.Agr +a' +AA +aa +AAA +AAAA +Aachen +AAES +AAF +aah +Aalborg +aide +air +air@@@ +C.A.F +Canon +CO-OP +co-op +COOP +coop +Copenhegen +Mc Arthur +Mc Mahon +McArthur +vice versa +vice-president +vice-versa +à¸à¸ +à¸à¸£à¸²à¸š +ขาง +ข่าง +ข้าง +ข้างๆ +ข้างๆ คูๆ +ข้างà¸à¸£à¸°à¸”าน +ข้างขึ้น +ข้างควาย +ข้างเงิน +ข้างà¹à¸£à¸¡ +ข้างออภ+à¹à¸‚็ง +à¹à¸‚่ง +à¹à¸‚้ง +à¹à¸‚้งขวา +à¹à¸‚็งขัน +à¹à¸‚่งขัน +ทูลเà¸à¸¥à¹‰à¸² +ทูลเà¸à¸¥à¹‰à¸²à¸—ูลà¸à¸£à¸°à¸«à¸¡à¹ˆà¸­à¸¡ +ทูลเà¸à¸¥à¹‰à¸²à¸¯ +บุà¸-หลง +บุà¸à¸à¸² +บุà¸à¸«à¸¥à¸‡ +ปา +ป่า +ป้า +ป๊า +ป๋า +ปาน +ป่าน +ป้าน +ป๊าน +ป๋าน +à¹à¸›à¹‰à¸‡ +พณิชย์ +ม้า +ฯพณฯ +# +# Descending sort, using filesort +# +EXPLAIN SELECT a FROM t1 ORDER BY a DESC, BINARY a DESC; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL a_id 67 NULL 96 Using index; Using filesort +SELECT a FROM t1 ORDER BY a DESC, BINARY a DESC; +a +ฯพณฯ +ม้า +พณิชย์ +à¹à¸›à¹‰à¸‡ +ป๋าน +ป๊าน +ป้าน +ป่าน +ปาน +ป๋า +ป๊า +ป้า +ป่า +ปา +บุà¸à¸«à¸¥à¸‡ +บุà¸à¸à¸² +บุà¸-หลง +ทูลเà¸à¸¥à¹‰à¸²à¸¯ +ทูลเà¸à¸¥à¹‰à¸²à¸—ูลà¸à¸£à¸°à¸«à¸¡à¹ˆà¸­à¸¡ +ทูลเà¸à¸¥à¹‰à¸² +à¹à¸‚่งขัน +à¹à¸‚็งขัน +à¹à¸‚้งขวา +à¹à¸‚้ง +à¹à¸‚่ง +à¹à¸‚็ง +ข้างออภ+ข้างà¹à¸£à¸¡ +ข้างเงิน +ข้างควาย +ข้างขึ้น +ข้างà¸à¸£à¸°à¸”าน +ข้างๆ คูๆ +ข้างๆ +ข้าง +ข่าง +ขาง +à¸à¸£à¸²à¸š +à¸à¸ +vice-versa +vice-president +vice versa +McArthur +Mc Mahon +Mc Arthur +Copenhegen +coop +COOP +co-op +CO-OP +Canon +C.A.F +air@@@ +air +aide +Aalborg +aah +AAF +AAES +Aachen +AAAA +AAA +aa +AA +a' +A.Agr +A.Ae.E. +A.A.E.E. +A.A.E. +A.A.A.S. +A.A.A.L. +A.A.A. +a.a. +A.A. +a. +A. +A-1 +a- +A- +a +A +9999 +๑๠ลิตร {10 litre} +๑๠ลิตร [10 litre] +๑๠ลิตร (10 litre) +10 ลิตร (10 litre) +๑๠ลิตร +10 ลิตร +10 litre (๑๠ลิตร) +10 litre (10 ลิตร) +10 litre +0000 +@@@air +@@@@@ +-à¸à¸£à¸°à¹à¸¢à¹ˆà¸‡ +-a +# +# Ascending sort, using index +# +EXPLAIN SELECT a FROM t1 ORDER BY a, id; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL a_id 67 NULL 96 Using index +SELECT a FROM t1 ORDER BY a, id; +a +-a +-à¸à¸£à¸°à¹à¸¢à¹ˆà¸‡ +@@@@@ +@@@air +0000 +10 litre +10 litre (10 ลิตร) +10 litre (๑๠ลิตร) +10 ลิตร +๑๠ลิตร +10 ลิตร (10 litre) +๑๠ลิตร (10 litre) +๑๠ลิตร [10 litre] +๑๠ลิตร {10 litre} +9999 +A +a +A- +a- +A-1 +A. +a. +A.A. +a.a. +A.A.A. +A.A.A.L. +A.A.A.S. +A.A.E. +A.A.E.E. +A.Ae.E. +A.Agr +a' +AA +aa +AAA +AAAA +Aachen +AAES +AAF +aah +Aalborg +aide +air +air@@@ +C.A.F +Canon +CO-OP +co-op +COOP +coop +Copenhegen +Mc Arthur +Mc Mahon +McArthur +vice versa +vice-president +vice-versa +à¸à¸ +à¸à¸£à¸²à¸š +ขาง +ข่าง +ข้าง +ข้างๆ +ข้างๆ คูๆ +ข้างà¸à¸£à¸°à¸”าน +ข้างขึ้น +ข้างควาย +ข้างเงิน +ข้างà¹à¸£à¸¡ +ข้างออภ+à¹à¸‚็ง +à¹à¸‚่ง +à¹à¸‚้ง +à¹à¸‚้งขวา +à¹à¸‚็งขัน +à¹à¸‚่งขัน +ทูลเà¸à¸¥à¹‰à¸² +ทูลเà¸à¸¥à¹‰à¸²à¸—ูลà¸à¸£à¸°à¸«à¸¡à¹ˆà¸­à¸¡ +ทูลเà¸à¸¥à¹‰à¸²à¸¯ +บุà¸-หลง +บุà¸à¸à¸² +บุà¸à¸«à¸¥à¸‡ +ปา +ป่า +ป้า +ป๊า +ป๋า +ปาน +ป่าน +ป้าน +ป๊าน +ป๋าน +à¹à¸›à¹‰à¸‡ +พณิชย์ +ม้า +ฯพณฯ +# +# Descending sort, using index +# +EXPLAIN SELECT a FROM t1 ORDER BY a DESC, id DESC; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL a_id 67 NULL 96 Using index +SELECT a FROM t1 ORDER BY a DESC, id DESC; +a +ฯพณฯ +ม้า +พณิชย์ +à¹à¸›à¹‰à¸‡ +ป๋าน +ป๊าน +ป้าน +ป่าน +ปาน +ป๋า +ป๊า +ป้า +ป่า +ปา +บุà¸à¸«à¸¥à¸‡ +บุà¸à¸à¸² +บุà¸-หลง +ทูลเà¸à¸¥à¹‰à¸²à¸¯ +ทูลเà¸à¸¥à¹‰à¸²à¸—ูลà¸à¸£à¸°à¸«à¸¡à¹ˆà¸­à¸¡ +ทูลเà¸à¸¥à¹‰à¸² +à¹à¸‚่งขัน +à¹à¸‚็งขัน +à¹à¸‚้งขวา +à¹à¸‚้ง +à¹à¸‚่ง +à¹à¸‚็ง +ข้างออภ+ข้างà¹à¸£à¸¡ +ข้างเงิน +ข้างควาย +ข้างขึ้น +ข้างà¸à¸£à¸°à¸”าน +ข้างๆ คูๆ +ข้างๆ +ข้าง +ข่าง +ขาง +à¸à¸£à¸²à¸š +à¸à¸ +vice-versa +vice-president +vice versa +McArthur +Mc Mahon +Mc Arthur +Copenhegen +coop +COOP +co-op +CO-OP +Canon +C.A.F +air@@@ +air +aide +Aalborg +aah +AAF +AAES +Aachen +AAAA +AAA +aa +AA +a' +A.Agr +A.Ae.E. +A.A.E.E. +A.A.E. +A.A.A.S. +A.A.A.L. +A.A.A. +a.a. +A.A. +a. +A. +A-1 +a- +A- +a +A +9999 +๑๠ลิตร {10 litre} +๑๠ลิตร [10 litre] +๑๠ลิตร (10 litre) +10 ลิตร (10 litre) +๑๠ลิตร +10 ลิตร +10 litre (๑๠ลิตร) +10 litre (10 ลิตร) +10 litre +0000 +@@@air +@@@@@ +-à¸à¸£à¸°à¹à¸¢à¹ˆà¸‡ +-a +DROP TABLE t1; +# +# End of ctype_thai.inc +# # # End of MariaDB-10.1 tests # diff --git a/mysql-test/r/ctype_uca_partitions.result b/mysql-test/r/ctype_uca_partitions.result new file mode 100644 index 00000000000..11d4e82e27b --- /dev/null +++ b/mysql-test/r/ctype_uca_partitions.result @@ -0,0 +1,86 @@ +SET NAMES utf8; +CREATE TABLE t1 (c1 VARCHAR(10) CHARACTER SET utf8 COLLATE utf8_thai_520_w2) +PARTITION BY KEY(c1) PARTITIONS 3; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET utf8 COLLATE utf8_thai_520_w2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY KEY (c1) +PARTITIONS 3 */ +INSERT INTO t1 VALUES ('A'),('À'),('Ã'),('Â'),('Ã'),('Ä'),('Ã…'); +INSERT INTO t1 VALUES ('B'); +INSERT INTO t1 VALUES ('C'); +INSERT INTO t1 VALUES ('D'); +INSERT INTO t1 VALUES ('E'); +INSERT INTO t1 VALUES ('F'); +INSERT INTO t1 VALUES ('G'); +INSERT INTO t1 VALUES ('H'); +INSERT INTO t1 VALUES ('I'); +INSERT INTO t1 VALUES ('J'); +INSERT INTO t1 VALUES ('K'); +INSERT INTO t1 VALUES ('L'),('Ĺ'),('Ä»'),('Ľ'),('Ä¿'),('Å'); +INSERT INTO t1 VALUES ('M'); +INSERT INTO t1 VALUES ('N'); +INSERT INTO t1 VALUES ('O'),('Ã’'),('Ó'),('Ô'),('Õ'),('Ö'),('Ø'); +INSERT INTO t1 VALUES ('P'); +INSERT INTO t1 VALUES ('Q'); +INSERT INTO t1 VALUES ('R'); +INSERT INTO t1 VALUES ('S'); +INSERT INTO t1 VALUES ('T'); +INSERT INTO t1 VALUES ('U'); +INSERT INTO t1 VALUES ('V'); +INSERT INTO t1 VALUES ('W'); +INSERT INTO t1 VALUES ('X'); +INSERT INTO t1 VALUES ('Y'); +INSERT INTO t1 VALUES ('Z'); +SELECT * FROM t1 PARTITION (p0) ORDER BY c1; +c1 +J +K +L +Ĺ +Ľ +Ä» +Å +Ä¿ +M +Q +R +T +V +X +SELECT * FROM t1 PARTITION (p1) ORDER BY c1; +c1 +A +à +À + +Ã… +Ä +à +D +E +F +G +I +N +S +U +W +Z +SELECT * FROM t1 PARTITION (p2) ORDER BY c1; +c1 +B +C +H +O +Ó +Ã’ +Ô +Ö +Õ +Ø +P +Y +DROP TABLE t1; diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result index 56174311bf3..4a6d5fa1b41 100644 --- a/mysql-test/r/ctype_ucs.result +++ b/mysql-test/r/ctype_ucs.result @@ -2523,7 +2523,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` varchar(83) CHARACTER SET ucs2 DEFAULT NULL, - `c2` decimal(65,30) DEFAULT NULL + `c2` decimal(65,38) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; select hex(concat(@@ft_max_word_len)); @@ -2873,7 +2873,7 @@ create table t1 as select concat(AsText(GeomFromText('Point(1 2)'))) as c1; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext CHARACTER SET ucs2 + `c1` longtext CHARACTER SET ucs2 DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; select hex(concat(period_add(200902, 2))); @@ -4230,7 +4230,7 @@ GROUP_CONCAT(CASE WHEN a THEN a ELSE '' END) 1234567 SELECT COALESCE(a,'') FROM t1 GROUP BY 1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(a,'') 253 9 7 Y 0 31 8 +def COALESCE(a,'') 253 9 7 Y 0 39 8 COALESCE(a,'') 1234567 # All columns must be VARCHAR(9) with the same length: @@ -4496,6 +4496,15 @@ f1() DROP FUNCTION f1; DROP TABLE t1; # +# MDEV-9662 Assertion `precision || !scale' failed in my_decimal_precision_to_length_no_truncation(uint, uint8, bool) +# +SELECT @@collation_connection; +@@collation_connection +ucs2_general_ci +SELECT CASE 1 WHEN 2 THEN ( - '3' ) END; +CASE 1 WHEN 2 THEN ( - '3' ) END +NULL +# # MDEV-5702 Incorrect results are returned with NULLIF() # CREATE TABLE t1 (d DATE); diff --git a/mysql-test/r/ctype_utf16.result b/mysql-test/r/ctype_utf16.result index 3bd37255b59..74e264c375d 100644 --- a/mysql-test/r/ctype_utf16.result +++ b/mysql-test/r/ctype_utf16.result @@ -1280,7 +1280,7 @@ Note 1246 Converting column 'a' from VARCHAR to TEXT show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` mediumtext CHARACTER SET utf16 + `a` mediumtext CHARACTER SET utf16 DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 (a varchar(250) character set utf16 primary key); diff --git a/mysql-test/r/ctype_utf16_uca.result b/mysql-test/r/ctype_utf16_uca.result index ac2ed9b2c5b..1e4c77ea83d 100644 --- a/mysql-test/r/ctype_utf16_uca.result +++ b/mysql-test/r/ctype_utf16_uca.result @@ -6605,3 +6605,703 @@ DROP TABLE t1; # # End of MariaDB-10.0 tests # +# +# Start of 10.1 tests +# +SET NAMES utf8; +SET collation_connection=utf16_thai_520_w2; +# +# Start of ctype_uca_w2.inc +# +SELECT @@collation_connection; +@@collation_connection +utf16_thai_520_w2 +SELECT ID, SORTLEN, COLLATION_NAME, CHARACTER_SET_NAME +FROM INFORMATION_SCHEMA.COLLATIONS +WHERE COLLATION_NAME LIKE @@collation_connection; +ID SORTLEN COLLATION_NAME CHARACTER_SET_NAME +674 4 utf16_thai_520_w2 utf16 +# +# Testing strnxfrm +# +CREATE TABLE t1 AS SELECT SPACE(3) AS a LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(3) CHARACTER SET utf16 COLLATE utf16_thai_520_w2 NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (SPACE(0)),(SPACE(1)),(SPACE(2)); +SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(8))) FROM t1; +HEX(a) HEX(WEIGHT_STRING(a AS CHAR(8))) + 020A020A020A020A020A020A020A020A00200020002000200020002000200020 +0020 020A020A020A020A020A020A020A020A00200020002000200020002000200020 +00200020 020A020A020A020A020A020A020A020A00200020002000200020002000200020 +SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(4))) FROM t1; +HEX(a) HEX(WEIGHT_STRING(a AS CHAR(4))) + 020A020A020A020A0020002000200020 +0020 020A020A020A020A0020002000200020 +00200020 020A020A020A020A0020002000200020 +SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 1)) FROM t1; +HEX(a) HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 1)) + 020A020A020A020A +0020 020A020A020A020A +00200020 020A020A020A020A +SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 2)) FROM t1; +HEX(a) HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 2)) + 0020002000200020 +0020 0020002000200020 +00200020 0020002000200020 +SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 3)) FROM t1; +HEX(a) HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 3)) + 0020002000200020 +0020 0020002000200020 +00200020 0020002000200020 +DROP TABLE t1; +CREATE TABLE t1 AS SELECT SPACE(10) AS a LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) CHARACTER SET utf16 COLLATE utf16_thai_520_w2 NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (_ucs2 0x3400); +INSERT INTO t1 VALUES (_ucs2 0xF001); +SELECT HEX(CONVERT(a USING ucs2)) AS ucs2, HEX(a), HEX(WEIGHT_STRING(a)) FROM t1; +ucs2 HEX(a) HEX(WEIGHT_STRING(a)) +3400 3400 FB80B4000020 +F001 F001 FBC1F0010020 +DROP TABLE t1; +CREATE TABLE t1 AS SELECT SPACE(10) AS a LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) CHARACTER SET utf16 COLLATE utf16_thai_520_w2 NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES ('A'),('À'),('Ã'),('Â'),('Ã'),('Ä'),('Ã…'); +SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a; +a HEX(WEIGHT_STRING(a LEVEL 2)) +A 0020 +à 00200032 +À 00200035 + 0020003C +Ã… 00200043 +Ä 00200047 +à 0020004E +SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a DESC; +a HEX(WEIGHT_STRING(a LEVEL 2)) +à 0020004E +Ä 00200047 +Ã… 00200043 + 0020003C +À 00200035 +à 00200032 +A 0020 +SET @backup_character_set_connection=@@character_set_connection; +SET @backup_collation_connection=@@collation_connection; +SET NAMES utf8; +SET @stmt= CONCAT('ALTER TABLE t1 MODIFY a CHAR(10)' COLLATE utf8_bin, +' CHARACTER SET ', @backup_character_set_connection, +' COLLATE ', @backup_collation_connection); +PREPARE stmt FROM @stmt; +EXECUTE stmt; +DEALLOCATE PREPARE stmt; +SET collation_connection=@backup_collation_connection; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(10) CHARACTER SET utf16 COLLATE utf16_thai_520_w2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a; +a HEX(WEIGHT_STRING(a LEVEL 2)) +A 0020 +à 00200032 +À 00200035 + 0020003C +Ã… 00200043 +Ä 00200047 +à 0020004E +SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a DESC; +a HEX(WEIGHT_STRING(a LEVEL 2)) +à 0020004E +Ä 00200047 +Ã… 00200043 + 0020003C +À 00200035 +à 00200032 +A 0020 +DROP TABLE t1; +CREATE TABLE t1 AS SELECT SPACE(10) AS a LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) CHARACTER SET utf16 COLLATE utf16_thai_520_w2 NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES ('cota'),('cote'),('cotz'); +INSERT INTO t1 VALUES ('coté'),('côte'),('côté'),('cotë'),('côtë'); +SELECT * FROM t1 ORDER BY a; +a +cota +cote +coté +cotë +côte +côté +côtë +cotz +SELECT * FROM t1 ORDER BY a DESC; +a +cotz +côtë +côté +côte +cotë +coté +cote +cota +DROP TABLE t1; +# +# End of ctype_uca_w2.inc +# +# +# Start of ctype_thai.inc +# +CREATE TABLE t1 (a VARCHAR(30) CHARACTER SET utf8 COLLATE utf8_bin); +INSERT INTO t1 VALUES ('-à¸à¸£à¸°à¹à¸¢à¹ˆà¸‡'); +INSERT INTO t1 VALUES ('à¸à¸'); +INSERT INTO t1 VALUES ('à¸à¸£à¸²à¸š'); +INSERT INTO t1 VALUES ('ข่าง'); +INSERT INTO t1 VALUES ('ข้าง'); +INSERT INTO t1 VALUES ('ข้างà¸à¸£à¸°à¸”าน'); +INSERT INTO t1 VALUES ('ข้างขึ้น'); +INSERT INTO t1 VALUES ('ข้างควาย'); +INSERT INTO t1 VALUES ('ข้างเงิน'); +INSERT INTO t1 VALUES ('ข้างà¹à¸£à¸¡'); +INSERT INTO t1 VALUES ('ข้างออà¸'); +INSERT INTO t1 VALUES ('ข้างๆ'); +INSERT INTO t1 VALUES ('ข้างๆ คูๆ'); +INSERT INTO t1 VALUES ('ขาง'); +INSERT INTO t1 VALUES ('à¹à¸‚็ง'); +INSERT INTO t1 VALUES ('à¹à¸‚่ง'); +INSERT INTO t1 VALUES ('à¹à¸‚่งขัน'); +INSERT INTO t1 VALUES ('à¹à¸‚้ง'); +INSERT INTO t1 VALUES ('à¹à¸‚้งขวา'); +INSERT INTO t1 VALUES ('à¹à¸‚็งขัน'); +INSERT INTO t1 VALUES ('ทูลเà¸à¸¥à¹‰à¸²'); +INSERT INTO t1 VALUES ('ทูลเà¸à¸¥à¹‰à¸²à¸—ูลà¸à¸£à¸°à¸«à¸¡à¹ˆà¸­à¸¡'); +INSERT INTO t1 VALUES ('ทูลเà¸à¸¥à¹‰à¸²à¸¯'); +INSERT INTO t1 VALUES ('บุà¸à¸à¸²'); +INSERT INTO t1 VALUES ('บุà¸-หลง'); +INSERT INTO t1 VALUES ('บุà¸à¸«à¸¥à¸‡'); +INSERT INTO t1 VALUES ('ป่า'); +INSERT INTO t1 VALUES ('ป่าน'); +INSERT INTO t1 VALUES ('ป้า'); +INSERT INTO t1 VALUES ('ป้าน'); +INSERT INTO t1 VALUES ('ป๊า'); +INSERT INTO t1 VALUES ('ป๊าน'); +INSERT INTO t1 VALUES ('ป๋า'); +INSERT INTO t1 VALUES ('ป๋าน'); +INSERT INTO t1 VALUES ('ปา'); +INSERT INTO t1 VALUES ('ปาน'); +INSERT INTO t1 VALUES ('à¹à¸›à¹‰à¸‡'); +INSERT INTO t1 VALUES ('พณิชย์'); +INSERT INTO t1 VALUES ('ม้า'); +INSERT INTO t1 VALUES ('ฯพณฯ'); +INSERT INTO t1 VALUES ('A'); +INSERT INTO t1 VALUES ('a'); +INSERT INTO t1 VALUES ('a\''); +INSERT INTO t1 VALUES ('A-'); +INSERT INTO t1 VALUES ('a-'); +INSERT INTO t1 VALUES ('-a'); +INSERT INTO t1 VALUES ('A.'); +INSERT INTO t1 VALUES ('a.'); +INSERT INTO t1 VALUES ('A-1'); +INSERT INTO t1 VALUES ('aa'); +INSERT INTO t1 VALUES ('AA'); +INSERT INTO t1 VALUES ('A.A.'); +INSERT INTO t1 VALUES ('a.a.'); +INSERT INTO t1 VALUES ('AAA'); +INSERT INTO t1 VALUES ('A.A.A.'); +INSERT INTO t1 VALUES ('AAAA'); +INSERT INTO t1 VALUES ('A.A.A.L.'); +INSERT INTO t1 VALUES ('A.A.A.S.'); +INSERT INTO t1 VALUES ('Aachen'); +INSERT INTO t1 VALUES ('A.A.E.'); +INSERT INTO t1 VALUES ('A.Ae.E.'); +INSERT INTO t1 VALUES ('A.A.E.E.'); +INSERT INTO t1 VALUES ('AAES'); +INSERT INTO t1 VALUES ('AAF'); +INSERT INTO t1 VALUES ('A.Agr'); +INSERT INTO t1 VALUES ('aah'); +INSERT INTO t1 VALUES ('@@@@@'); +INSERT INTO t1 VALUES ('0000'); +INSERT INTO t1 VALUES ('9999'); +INSERT INTO t1 VALUES ('Aalborg'); +INSERT INTO t1 VALUES ('aide'); +INSERT INTO t1 VALUES ('air'); +INSERT INTO t1 VALUES ('@@@air'); +INSERT INTO t1 VALUES ('air@@@'); +INSERT INTO t1 VALUES ('C.A.F'); +INSERT INTO t1 VALUES ('Canon'); +INSERT INTO t1 VALUES ('coop'); +INSERT INTO t1 VALUES ('co-op'); +INSERT INTO t1 VALUES ('COOP'); +INSERT INTO t1 VALUES ('CO-OP'); +INSERT INTO t1 VALUES ('Copenhegen'); +INSERT INTO t1 VALUES ('McArthur'); +INSERT INTO t1 VALUES ('Mc Arthur'); +INSERT INTO t1 VALUES ('Mc Mahon'); +INSERT INTO t1 VALUES ('vice-president'); +INSERT INTO t1 VALUES ('vice versa'); +INSERT INTO t1 VALUES ('vice-versa'); +INSERT INTO t1 VALUES ('10 ลิตร'); +INSERT INTO t1 VALUES ('๑๠ลิตร'); +INSERT INTO t1 VALUES ('10 litre'); +INSERT INTO t1 VALUES ('10 litre (10 ลิตร)'); +INSERT INTO t1 VALUES ('10 ลิตร (10 litre)'); +INSERT INTO t1 VALUES ('10 litre (๑๠ลิตร)'); +INSERT INTO t1 VALUES ('๑๠ลิตร (10 litre)'); +INSERT INTO t1 VALUES ('๑๠ลิตร [10 litre]'); +INSERT INTO t1 VALUES ('๑๠ลิตร {10 litre}'); +ALTER TABLE t1 ORDER BY a; +SET @backup_character_set_connection=@@character_set_connection; +SET @backup_collation_connection=@@collation_connection; +SET NAMES utf8; +SET @stmt= CONCAT('ALTER TABLE t1 MODIFY a VARCHAR(30)', +' CHARACTER SET ', @backup_character_set_connection, +' COLLATE ', @backup_collation_connection, +' , ADD id INT NOT NULL AUTO_INCREMENT PRIMARY KEY' + ' , ADD KEY a_id (a, id)'); +PREPARE stmt FROM @stmt; +EXECUTE stmt; +DEALLOCATE PREPARE stmt; +SET collation_connection=@backup_collation_connection; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(30) CHARACTER SET utf16 COLLATE utf16_thai_520_w2 DEFAULT NULL, + `id` int(11) NOT NULL AUTO_INCREMENT, + PRIMARY KEY (`id`), + KEY `a_id` (`a`,`id`) +) ENGINE=MyISAM AUTO_INCREMENT=97 DEFAULT CHARSET=latin1 +# +# Ascending sort, using filesort +# +EXPLAIN SELECT a FROM t1 ORDER BY a, BINARY a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL a_id 127 NULL 96 Using index; Using filesort +SELECT a FROM t1 ORDER BY a, BINARY a; +a +-a +-à¸à¸£à¸°à¹à¸¢à¹ˆà¸‡ +@@@@@ +@@@air +0000 +10 litre +10 litre (10 ลิตร) +10 litre (๑๠ลิตร) +10 ลิตร +๑๠ลิตร +10 ลิตร (10 litre) +๑๠ลิตร (10 litre) +๑๠ลิตร [10 litre] +๑๠ลิตร {10 litre} +9999 +A +a +A- +a- +A-1 +A. +a. +A.A. +a.a. +A.A.A. +A.A.A.L. +A.A.A.S. +A.A.E. +A.A.E.E. +A.Ae.E. +A.Agr +a' +AA +aa +AAA +AAAA +Aachen +AAES +AAF +aah +Aalborg +aide +air +air@@@ +C.A.F +Canon +CO-OP +co-op +COOP +coop +Copenhegen +Mc Arthur +Mc Mahon +McArthur +vice versa +vice-president +vice-versa +à¸à¸ +à¸à¸£à¸²à¸š +ขาง +ข่าง +ข้าง +ข้างๆ +ข้างๆ คูๆ +ข้างà¸à¸£à¸°à¸”าน +ข้างขึ้น +ข้างควาย +ข้างเงิน +ข้างà¹à¸£à¸¡ +ข้างออภ+à¹à¸‚็ง +à¹à¸‚่ง +à¹à¸‚้ง +à¹à¸‚้งขวา +à¹à¸‚็งขัน +à¹à¸‚่งขัน +ทูลเà¸à¸¥à¹‰à¸² +ทูลเà¸à¸¥à¹‰à¸²à¸—ูลà¸à¸£à¸°à¸«à¸¡à¹ˆà¸­à¸¡ +ทูลเà¸à¸¥à¹‰à¸²à¸¯ +บุà¸-หลง +บุà¸à¸à¸² +บุà¸à¸«à¸¥à¸‡ +ปา +ป่า +ป้า +ป๊า +ป๋า +ปาน +ป่าน +ป้าน +ป๊าน +ป๋าน +à¹à¸›à¹‰à¸‡ +พณิชย์ +ม้า +ฯพณฯ +# +# Descending sort, using filesort +# +EXPLAIN SELECT a FROM t1 ORDER BY a DESC, BINARY a DESC; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL a_id 127 NULL 96 Using index; Using filesort +SELECT a FROM t1 ORDER BY a DESC, BINARY a DESC; +a +ฯพณฯ +ม้า +พณิชย์ +à¹à¸›à¹‰à¸‡ +ป๋าน +ป๊าน +ป้าน +ป่าน +ปาน +ป๋า +ป๊า +ป้า +ป่า +ปา +บุà¸à¸«à¸¥à¸‡ +บุà¸à¸à¸² +บุà¸-หลง +ทูลเà¸à¸¥à¹‰à¸²à¸¯ +ทูลเà¸à¸¥à¹‰à¸²à¸—ูลà¸à¸£à¸°à¸«à¸¡à¹ˆà¸­à¸¡ +ทูลเà¸à¸¥à¹‰à¸² +à¹à¸‚่งขัน +à¹à¸‚็งขัน +à¹à¸‚้งขวา +à¹à¸‚้ง +à¹à¸‚่ง +à¹à¸‚็ง +ข้างออภ+ข้างà¹à¸£à¸¡ +ข้างเงิน +ข้างควาย +ข้างขึ้น +ข้างà¸à¸£à¸°à¸”าน +ข้างๆ คูๆ +ข้างๆ +ข้าง +ข่าง +ขาง +à¸à¸£à¸²à¸š +à¸à¸ +vice-versa +vice-president +vice versa +McArthur +Mc Mahon +Mc Arthur +Copenhegen +coop +COOP +co-op +CO-OP +Canon +C.A.F +air@@@ +air +aide +Aalborg +aah +AAF +AAES +Aachen +AAAA +AAA +aa +AA +a' +A.Agr +A.Ae.E. +A.A.E.E. +A.A.E. +A.A.A.S. +A.A.A.L. +A.A.A. +a.a. +A.A. +a. +A. +A-1 +a- +A- +a +A +9999 +๑๠ลิตร {10 litre} +๑๠ลิตร [10 litre] +๑๠ลิตร (10 litre) +10 ลิตร (10 litre) +๑๠ลิตร +10 ลิตร +10 litre (๑๠ลิตร) +10 litre (10 ลิตร) +10 litre +0000 +@@@air +@@@@@ +-à¸à¸£à¸°à¹à¸¢à¹ˆà¸‡ +-a +# +# Ascending sort, using index +# +EXPLAIN SELECT a FROM t1 ORDER BY a, id; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL a_id 127 NULL 96 Using index +SELECT a FROM t1 ORDER BY a, id; +a +-a +-à¸à¸£à¸°à¹à¸¢à¹ˆà¸‡ +@@@@@ +@@@air +0000 +10 litre +10 litre (10 ลิตร) +10 litre (๑๠ลิตร) +10 ลิตร +๑๠ลิตร +10 ลิตร (10 litre) +๑๠ลิตร (10 litre) +๑๠ลิตร [10 litre] +๑๠ลิตร {10 litre} +9999 +A +a +A- +a- +A-1 +A. +a. +A.A. +a.a. +A.A.A. +A.A.A.L. +A.A.A.S. +A.A.E. +A.A.E.E. +A.Ae.E. +A.Agr +a' +AA +aa +AAA +AAAA +Aachen +AAES +AAF +aah +Aalborg +aide +air +air@@@ +C.A.F +Canon +CO-OP +co-op +COOP +coop +Copenhegen +Mc Arthur +Mc Mahon +McArthur +vice versa +vice-president +vice-versa +à¸à¸ +à¸à¸£à¸²à¸š +ขาง +ข่าง +ข้าง +ข้างๆ +ข้างๆ คูๆ +ข้างà¸à¸£à¸°à¸”าน +ข้างขึ้น +ข้างควาย +ข้างเงิน +ข้างà¹à¸£à¸¡ +ข้างออภ+à¹à¸‚็ง +à¹à¸‚่ง +à¹à¸‚้ง +à¹à¸‚้งขวา +à¹à¸‚็งขัน +à¹à¸‚่งขัน +ทูลเà¸à¸¥à¹‰à¸² +ทูลเà¸à¸¥à¹‰à¸²à¸—ูลà¸à¸£à¸°à¸«à¸¡à¹ˆà¸­à¸¡ +ทูลเà¸à¸¥à¹‰à¸²à¸¯ +บุà¸-หลง +บุà¸à¸à¸² +บุà¸à¸«à¸¥à¸‡ +ปา +ป่า +ป้า +ป๊า +ป๋า +ปาน +ป่าน +ป้าน +ป๊าน +ป๋าน +à¹à¸›à¹‰à¸‡ +พณิชย์ +ม้า +ฯพณฯ +# +# Descending sort, using index +# +EXPLAIN SELECT a FROM t1 ORDER BY a DESC, id DESC; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL a_id 127 NULL 96 Using index +SELECT a FROM t1 ORDER BY a DESC, id DESC; +a +ฯพณฯ +ม้า +พณิชย์ +à¹à¸›à¹‰à¸‡ +ป๋าน +ป๊าน +ป้าน +ป่าน +ปาน +ป๋า +ป๊า +ป้า +ป่า +ปา +บุà¸à¸«à¸¥à¸‡ +บุà¸à¸à¸² +บุà¸-หลง +ทูลเà¸à¸¥à¹‰à¸²à¸¯ +ทูลเà¸à¸¥à¹‰à¸²à¸—ูลà¸à¸£à¸°à¸«à¸¡à¹ˆà¸­à¸¡ +ทูลเà¸à¸¥à¹‰à¸² +à¹à¸‚่งขัน +à¹à¸‚็งขัน +à¹à¸‚้งขวา +à¹à¸‚้ง +à¹à¸‚่ง +à¹à¸‚็ง +ข้างออภ+ข้างà¹à¸£à¸¡ +ข้างเงิน +ข้างควาย +ข้างขึ้น +ข้างà¸à¸£à¸°à¸”าน +ข้างๆ คูๆ +ข้างๆ +ข้าง +ข่าง +ขาง +à¸à¸£à¸²à¸š +à¸à¸ +vice-versa +vice-president +vice versa +McArthur +Mc Mahon +Mc Arthur +Copenhegen +coop +COOP +co-op +CO-OP +Canon +C.A.F +air@@@ +air +aide +Aalborg +aah +AAF +AAES +Aachen +AAAA +AAA +aa +AA +a' +A.Agr +A.Ae.E. +A.A.E.E. +A.A.E. +A.A.A.S. +A.A.A.L. +A.A.A. +a.a. +A.A. +a. +A. +A-1 +a- +A- +a +A +9999 +๑๠ลิตร {10 litre} +๑๠ลิตร [10 litre] +๑๠ลิตร (10 litre) +10 ลิตร (10 litre) +๑๠ลิตร +10 ลิตร +10 litre (๑๠ลิตร) +10 litre (10 ลิตร) +10 litre +0000 +@@@air +@@@@@ +-à¸à¸£à¸°à¹à¸¢à¹ˆà¸‡ +-a +DROP TABLE t1; +# +# End of ctype_thai.inc +# +# +# End of 10.1 tests +# diff --git a/mysql-test/r/ctype_utf16le.result b/mysql-test/r/ctype_utf16le.result index 93fce843dc8..b93f67b5f6c 100644 --- a/mysql-test/r/ctype_utf16le.result +++ b/mysql-test/r/ctype_utf16le.result @@ -1541,7 +1541,7 @@ Note 1246 Converting column 'a' from VARCHAR to TEXT SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` mediumtext CHARACTER SET utf16le + `a` mediumtext CHARACTER SET utf16le DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; # diff --git a/mysql-test/r/ctype_utf32.result b/mysql-test/r/ctype_utf32.result index a0a8072265c..261209b2eec 100644 --- a/mysql-test/r/ctype_utf32.result +++ b/mysql-test/r/ctype_utf32.result @@ -1278,7 +1278,7 @@ Note 1246 Converting column 'a' from VARCHAR to TEXT show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` mediumtext CHARACTER SET utf32 + `a` mediumtext CHARACTER SET utf32 DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 (a varchar(250) character set utf32 primary key); @@ -1575,7 +1575,7 @@ CREATE TABLE t1 AS SELECT format(123,2,'no_NO'); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `format(123,2,'no_NO')` varchar(37) CHARACTER SET utf32 NOT NULL + `format(123,2,'no_NO')` varchar(45) CHARACTER SET utf32 NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SELECT * FROM t1; format(123,2,'no_NO') diff --git a/mysql-test/r/ctype_utf32_uca.result b/mysql-test/r/ctype_utf32_uca.result index 89a9e23bf45..234a01bb108 100644 --- a/mysql-test/r/ctype_utf32_uca.result +++ b/mysql-test/r/ctype_utf32_uca.result @@ -6625,3 +6625,703 @@ DROP TABLE t1; # # End of MariaDB-10.0 tests # +# +# Start of 10.1 tests +# +SET NAMES utf8; +SET collation_connection=utf32_thai_520_w2; +# +# Start of ctype_uca_w2.inc +# +SELECT @@collation_connection; +@@collation_connection +utf32_thai_520_w2 +SELECT ID, SORTLEN, COLLATION_NAME, CHARACTER_SET_NAME +FROM INFORMATION_SCHEMA.COLLATIONS +WHERE COLLATION_NAME LIKE @@collation_connection; +ID SORTLEN COLLATION_NAME CHARACTER_SET_NAME +738 4 utf32_thai_520_w2 utf32 +# +# Testing strnxfrm +# +CREATE TABLE t1 AS SELECT SPACE(3) AS a LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(3) CHARACTER SET utf32 COLLATE utf32_thai_520_w2 NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (SPACE(0)),(SPACE(1)),(SPACE(2)); +SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(8))) FROM t1; +HEX(a) HEX(WEIGHT_STRING(a AS CHAR(8))) + 020A020A020A020A020A020A020A020A00200020002000200020002000200020 +00000020 020A020A020A020A020A020A020A020A00200020002000200020002000200020 +0000002000000020 020A020A020A020A020A020A020A020A00200020002000200020002000200020 +SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(4))) FROM t1; +HEX(a) HEX(WEIGHT_STRING(a AS CHAR(4))) + 020A020A020A020A0020002000200020 +00000020 020A020A020A020A0020002000200020 +0000002000000020 020A020A020A020A0020002000200020 +SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 1)) FROM t1; +HEX(a) HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 1)) + 020A020A020A020A +00000020 020A020A020A020A +0000002000000020 020A020A020A020A +SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 2)) FROM t1; +HEX(a) HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 2)) + 0020002000200020 +00000020 0020002000200020 +0000002000000020 0020002000200020 +SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 3)) FROM t1; +HEX(a) HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 3)) + 0020002000200020 +00000020 0020002000200020 +0000002000000020 0020002000200020 +DROP TABLE t1; +CREATE TABLE t1 AS SELECT SPACE(10) AS a LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) CHARACTER SET utf32 COLLATE utf32_thai_520_w2 NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (_ucs2 0x3400); +INSERT INTO t1 VALUES (_ucs2 0xF001); +SELECT HEX(CONVERT(a USING ucs2)) AS ucs2, HEX(a), HEX(WEIGHT_STRING(a)) FROM t1; +ucs2 HEX(a) HEX(WEIGHT_STRING(a)) +3400 00003400 FB80B4000020 +F001 0000F001 FBC1F0010020 +DROP TABLE t1; +CREATE TABLE t1 AS SELECT SPACE(10) AS a LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) CHARACTER SET utf32 COLLATE utf32_thai_520_w2 NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES ('A'),('À'),('Ã'),('Â'),('Ã'),('Ä'),('Ã…'); +SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a; +a HEX(WEIGHT_STRING(a LEVEL 2)) +A 0020 +à 00200032 +À 00200035 + 0020003C +Ã… 00200043 +Ä 00200047 +à 0020004E +SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a DESC; +a HEX(WEIGHT_STRING(a LEVEL 2)) +à 0020004E +Ä 00200047 +Ã… 00200043 + 0020003C +À 00200035 +à 00200032 +A 0020 +SET @backup_character_set_connection=@@character_set_connection; +SET @backup_collation_connection=@@collation_connection; +SET NAMES utf8; +SET @stmt= CONCAT('ALTER TABLE t1 MODIFY a CHAR(10)' COLLATE utf8_bin, +' CHARACTER SET ', @backup_character_set_connection, +' COLLATE ', @backup_collation_connection); +PREPARE stmt FROM @stmt; +EXECUTE stmt; +DEALLOCATE PREPARE stmt; +SET collation_connection=@backup_collation_connection; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(10) CHARACTER SET utf32 COLLATE utf32_thai_520_w2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a; +a HEX(WEIGHT_STRING(a LEVEL 2)) +A 0020 +à 00200032 +À 00200035 + 0020003C +Ã… 00200043 +Ä 00200047 +à 0020004E +SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a DESC; +a HEX(WEIGHT_STRING(a LEVEL 2)) +à 0020004E +Ä 00200047 +Ã… 00200043 + 0020003C +À 00200035 +à 00200032 +A 0020 +DROP TABLE t1; +CREATE TABLE t1 AS SELECT SPACE(10) AS a LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) CHARACTER SET utf32 COLLATE utf32_thai_520_w2 NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES ('cota'),('cote'),('cotz'); +INSERT INTO t1 VALUES ('coté'),('côte'),('côté'),('cotë'),('côtë'); +SELECT * FROM t1 ORDER BY a; +a +cota +cote +coté +cotë +côte +côté +côtë +cotz +SELECT * FROM t1 ORDER BY a DESC; +a +cotz +côtë +côté +côte +cotë +coté +cote +cota +DROP TABLE t1; +# +# End of ctype_uca_w2.inc +# +# +# Start of ctype_thai.inc +# +CREATE TABLE t1 (a VARCHAR(30) CHARACTER SET utf8 COLLATE utf8_bin); +INSERT INTO t1 VALUES ('-à¸à¸£à¸°à¹à¸¢à¹ˆà¸‡'); +INSERT INTO t1 VALUES ('à¸à¸'); +INSERT INTO t1 VALUES ('à¸à¸£à¸²à¸š'); +INSERT INTO t1 VALUES ('ข่าง'); +INSERT INTO t1 VALUES ('ข้าง'); +INSERT INTO t1 VALUES ('ข้างà¸à¸£à¸°à¸”าน'); +INSERT INTO t1 VALUES ('ข้างขึ้น'); +INSERT INTO t1 VALUES ('ข้างควาย'); +INSERT INTO t1 VALUES ('ข้างเงิน'); +INSERT INTO t1 VALUES ('ข้างà¹à¸£à¸¡'); +INSERT INTO t1 VALUES ('ข้างออà¸'); +INSERT INTO t1 VALUES ('ข้างๆ'); +INSERT INTO t1 VALUES ('ข้างๆ คูๆ'); +INSERT INTO t1 VALUES ('ขาง'); +INSERT INTO t1 VALUES ('à¹à¸‚็ง'); +INSERT INTO t1 VALUES ('à¹à¸‚่ง'); +INSERT INTO t1 VALUES ('à¹à¸‚่งขัน'); +INSERT INTO t1 VALUES ('à¹à¸‚้ง'); +INSERT INTO t1 VALUES ('à¹à¸‚้งขวา'); +INSERT INTO t1 VALUES ('à¹à¸‚็งขัน'); +INSERT INTO t1 VALUES ('ทูลเà¸à¸¥à¹‰à¸²'); +INSERT INTO t1 VALUES ('ทูลเà¸à¸¥à¹‰à¸²à¸—ูลà¸à¸£à¸°à¸«à¸¡à¹ˆà¸­à¸¡'); +INSERT INTO t1 VALUES ('ทูลเà¸à¸¥à¹‰à¸²à¸¯'); +INSERT INTO t1 VALUES ('บุà¸à¸à¸²'); +INSERT INTO t1 VALUES ('บุà¸-หลง'); +INSERT INTO t1 VALUES ('บุà¸à¸«à¸¥à¸‡'); +INSERT INTO t1 VALUES ('ป่า'); +INSERT INTO t1 VALUES ('ป่าน'); +INSERT INTO t1 VALUES ('ป้า'); +INSERT INTO t1 VALUES ('ป้าน'); +INSERT INTO t1 VALUES ('ป๊า'); +INSERT INTO t1 VALUES ('ป๊าน'); +INSERT INTO t1 VALUES ('ป๋า'); +INSERT INTO t1 VALUES ('ป๋าน'); +INSERT INTO t1 VALUES ('ปา'); +INSERT INTO t1 VALUES ('ปาน'); +INSERT INTO t1 VALUES ('à¹à¸›à¹‰à¸‡'); +INSERT INTO t1 VALUES ('พณิชย์'); +INSERT INTO t1 VALUES ('ม้า'); +INSERT INTO t1 VALUES ('ฯพณฯ'); +INSERT INTO t1 VALUES ('A'); +INSERT INTO t1 VALUES ('a'); +INSERT INTO t1 VALUES ('a\''); +INSERT INTO t1 VALUES ('A-'); +INSERT INTO t1 VALUES ('a-'); +INSERT INTO t1 VALUES ('-a'); +INSERT INTO t1 VALUES ('A.'); +INSERT INTO t1 VALUES ('a.'); +INSERT INTO t1 VALUES ('A-1'); +INSERT INTO t1 VALUES ('aa'); +INSERT INTO t1 VALUES ('AA'); +INSERT INTO t1 VALUES ('A.A.'); +INSERT INTO t1 VALUES ('a.a.'); +INSERT INTO t1 VALUES ('AAA'); +INSERT INTO t1 VALUES ('A.A.A.'); +INSERT INTO t1 VALUES ('AAAA'); +INSERT INTO t1 VALUES ('A.A.A.L.'); +INSERT INTO t1 VALUES ('A.A.A.S.'); +INSERT INTO t1 VALUES ('Aachen'); +INSERT INTO t1 VALUES ('A.A.E.'); +INSERT INTO t1 VALUES ('A.Ae.E.'); +INSERT INTO t1 VALUES ('A.A.E.E.'); +INSERT INTO t1 VALUES ('AAES'); +INSERT INTO t1 VALUES ('AAF'); +INSERT INTO t1 VALUES ('A.Agr'); +INSERT INTO t1 VALUES ('aah'); +INSERT INTO t1 VALUES ('@@@@@'); +INSERT INTO t1 VALUES ('0000'); +INSERT INTO t1 VALUES ('9999'); +INSERT INTO t1 VALUES ('Aalborg'); +INSERT INTO t1 VALUES ('aide'); +INSERT INTO t1 VALUES ('air'); +INSERT INTO t1 VALUES ('@@@air'); +INSERT INTO t1 VALUES ('air@@@'); +INSERT INTO t1 VALUES ('C.A.F'); +INSERT INTO t1 VALUES ('Canon'); +INSERT INTO t1 VALUES ('coop'); +INSERT INTO t1 VALUES ('co-op'); +INSERT INTO t1 VALUES ('COOP'); +INSERT INTO t1 VALUES ('CO-OP'); +INSERT INTO t1 VALUES ('Copenhegen'); +INSERT INTO t1 VALUES ('McArthur'); +INSERT INTO t1 VALUES ('Mc Arthur'); +INSERT INTO t1 VALUES ('Mc Mahon'); +INSERT INTO t1 VALUES ('vice-president'); +INSERT INTO t1 VALUES ('vice versa'); +INSERT INTO t1 VALUES ('vice-versa'); +INSERT INTO t1 VALUES ('10 ลิตร'); +INSERT INTO t1 VALUES ('๑๠ลิตร'); +INSERT INTO t1 VALUES ('10 litre'); +INSERT INTO t1 VALUES ('10 litre (10 ลิตร)'); +INSERT INTO t1 VALUES ('10 ลิตร (10 litre)'); +INSERT INTO t1 VALUES ('10 litre (๑๠ลิตร)'); +INSERT INTO t1 VALUES ('๑๠ลิตร (10 litre)'); +INSERT INTO t1 VALUES ('๑๠ลิตร [10 litre]'); +INSERT INTO t1 VALUES ('๑๠ลิตร {10 litre}'); +ALTER TABLE t1 ORDER BY a; +SET @backup_character_set_connection=@@character_set_connection; +SET @backup_collation_connection=@@collation_connection; +SET NAMES utf8; +SET @stmt= CONCAT('ALTER TABLE t1 MODIFY a VARCHAR(30)', +' CHARACTER SET ', @backup_character_set_connection, +' COLLATE ', @backup_collation_connection, +' , ADD id INT NOT NULL AUTO_INCREMENT PRIMARY KEY' + ' , ADD KEY a_id (a, id)'); +PREPARE stmt FROM @stmt; +EXECUTE stmt; +DEALLOCATE PREPARE stmt; +SET collation_connection=@backup_collation_connection; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(30) CHARACTER SET utf32 COLLATE utf32_thai_520_w2 DEFAULT NULL, + `id` int(11) NOT NULL AUTO_INCREMENT, + PRIMARY KEY (`id`), + KEY `a_id` (`a`,`id`) +) ENGINE=MyISAM AUTO_INCREMENT=97 DEFAULT CHARSET=latin1 +# +# Ascending sort, using filesort +# +EXPLAIN SELECT a FROM t1 ORDER BY a, BINARY a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL a_id 127 NULL 96 Using index; Using filesort +SELECT a FROM t1 ORDER BY a, BINARY a; +a +-a +-à¸à¸£à¸°à¹à¸¢à¹ˆà¸‡ +@@@@@ +@@@air +0000 +10 litre +10 litre (10 ลิตร) +10 litre (๑๠ลิตร) +10 ลิตร +๑๠ลิตร +10 ลิตร (10 litre) +๑๠ลิตร (10 litre) +๑๠ลิตร [10 litre] +๑๠ลิตร {10 litre} +9999 +A +a +A- +a- +A-1 +A. +a. +A.A. +a.a. +A.A.A. +A.A.A.L. +A.A.A.S. +A.A.E. +A.A.E.E. +A.Ae.E. +A.Agr +a' +AA +aa +AAA +AAAA +Aachen +AAES +AAF +aah +Aalborg +aide +air +air@@@ +C.A.F +Canon +CO-OP +co-op +COOP +coop +Copenhegen +Mc Arthur +Mc Mahon +McArthur +vice versa +vice-president +vice-versa +à¸à¸ +à¸à¸£à¸²à¸š +ขาง +ข่าง +ข้าง +ข้างๆ +ข้างๆ คูๆ +ข้างà¸à¸£à¸°à¸”าน +ข้างขึ้น +ข้างควาย +ข้างเงิน +ข้างà¹à¸£à¸¡ +ข้างออภ+à¹à¸‚็ง +à¹à¸‚่ง +à¹à¸‚้ง +à¹à¸‚้งขวา +à¹à¸‚็งขัน +à¹à¸‚่งขัน +ทูลเà¸à¸¥à¹‰à¸² +ทูลเà¸à¸¥à¹‰à¸²à¸—ูลà¸à¸£à¸°à¸«à¸¡à¹ˆà¸­à¸¡ +ทูลเà¸à¸¥à¹‰à¸²à¸¯ +บุà¸-หลง +บุà¸à¸à¸² +บุà¸à¸«à¸¥à¸‡ +ปา +ป่า +ป้า +ป๊า +ป๋า +ปาน +ป่าน +ป้าน +ป๊าน +ป๋าน +à¹à¸›à¹‰à¸‡ +พณิชย์ +ม้า +ฯพณฯ +# +# Descending sort, using filesort +# +EXPLAIN SELECT a FROM t1 ORDER BY a DESC, BINARY a DESC; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL a_id 127 NULL 96 Using index; Using filesort +SELECT a FROM t1 ORDER BY a DESC, BINARY a DESC; +a +ฯพณฯ +ม้า +พณิชย์ +à¹à¸›à¹‰à¸‡ +ป๋าน +ป๊าน +ป้าน +ป่าน +ปาน +ป๋า +ป๊า +ป้า +ป่า +ปา +บุà¸à¸«à¸¥à¸‡ +บุà¸à¸à¸² +บุà¸-หลง +ทูลเà¸à¸¥à¹‰à¸²à¸¯ +ทูลเà¸à¸¥à¹‰à¸²à¸—ูลà¸à¸£à¸°à¸«à¸¡à¹ˆà¸­à¸¡ +ทูลเà¸à¸¥à¹‰à¸² +à¹à¸‚่งขัน +à¹à¸‚็งขัน +à¹à¸‚้งขวา +à¹à¸‚้ง +à¹à¸‚่ง +à¹à¸‚็ง +ข้างออภ+ข้างà¹à¸£à¸¡ +ข้างเงิน +ข้างควาย +ข้างขึ้น +ข้างà¸à¸£à¸°à¸”าน +ข้างๆ คูๆ +ข้างๆ +ข้าง +ข่าง +ขาง +à¸à¸£à¸²à¸š +à¸à¸ +vice-versa +vice-president +vice versa +McArthur +Mc Mahon +Mc Arthur +Copenhegen +coop +COOP +co-op +CO-OP +Canon +C.A.F +air@@@ +air +aide +Aalborg +aah +AAF +AAES +Aachen +AAAA +AAA +aa +AA +a' +A.Agr +A.Ae.E. +A.A.E.E. +A.A.E. +A.A.A.S. +A.A.A.L. +A.A.A. +a.a. +A.A. +a. +A. +A-1 +a- +A- +a +A +9999 +๑๠ลิตร {10 litre} +๑๠ลิตร [10 litre] +๑๠ลิตร (10 litre) +10 ลิตร (10 litre) +๑๠ลิตร +10 ลิตร +10 litre (๑๠ลิตร) +10 litre (10 ลิตร) +10 litre +0000 +@@@air +@@@@@ +-à¸à¸£à¸°à¹à¸¢à¹ˆà¸‡ +-a +# +# Ascending sort, using index +# +EXPLAIN SELECT a FROM t1 ORDER BY a, id; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL a_id 127 NULL 96 Using index +SELECT a FROM t1 ORDER BY a, id; +a +-a +-à¸à¸£à¸°à¹à¸¢à¹ˆà¸‡ +@@@@@ +@@@air +0000 +10 litre +10 litre (10 ลิตร) +10 litre (๑๠ลิตร) +10 ลิตร +๑๠ลิตร +10 ลิตร (10 litre) +๑๠ลิตร (10 litre) +๑๠ลิตร [10 litre] +๑๠ลิตร {10 litre} +9999 +A +a +A- +a- +A-1 +A. +a. +A.A. +a.a. +A.A.A. +A.A.A.L. +A.A.A.S. +A.A.E. +A.A.E.E. +A.Ae.E. +A.Agr +a' +AA +aa +AAA +AAAA +Aachen +AAES +AAF +aah +Aalborg +aide +air +air@@@ +C.A.F +Canon +CO-OP +co-op +COOP +coop +Copenhegen +Mc Arthur +Mc Mahon +McArthur +vice versa +vice-president +vice-versa +à¸à¸ +à¸à¸£à¸²à¸š +ขาง +ข่าง +ข้าง +ข้างๆ +ข้างๆ คูๆ +ข้างà¸à¸£à¸°à¸”าน +ข้างขึ้น +ข้างควาย +ข้างเงิน +ข้างà¹à¸£à¸¡ +ข้างออภ+à¹à¸‚็ง +à¹à¸‚่ง +à¹à¸‚้ง +à¹à¸‚้งขวา +à¹à¸‚็งขัน +à¹à¸‚่งขัน +ทูลเà¸à¸¥à¹‰à¸² +ทูลเà¸à¸¥à¹‰à¸²à¸—ูลà¸à¸£à¸°à¸«à¸¡à¹ˆà¸­à¸¡ +ทูลเà¸à¸¥à¹‰à¸²à¸¯ +บุà¸-หลง +บุà¸à¸à¸² +บุà¸à¸«à¸¥à¸‡ +ปา +ป่า +ป้า +ป๊า +ป๋า +ปาน +ป่าน +ป้าน +ป๊าน +ป๋าน +à¹à¸›à¹‰à¸‡ +พณิชย์ +ม้า +ฯพณฯ +# +# Descending sort, using index +# +EXPLAIN SELECT a FROM t1 ORDER BY a DESC, id DESC; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL a_id 127 NULL 96 Using index +SELECT a FROM t1 ORDER BY a DESC, id DESC; +a +ฯพณฯ +ม้า +พณิชย์ +à¹à¸›à¹‰à¸‡ +ป๋าน +ป๊าน +ป้าน +ป่าน +ปาน +ป๋า +ป๊า +ป้า +ป่า +ปา +บุà¸à¸«à¸¥à¸‡ +บุà¸à¸à¸² +บุà¸-หลง +ทูลเà¸à¸¥à¹‰à¸²à¸¯ +ทูลเà¸à¸¥à¹‰à¸²à¸—ูลà¸à¸£à¸°à¸«à¸¡à¹ˆà¸­à¸¡ +ทูลเà¸à¸¥à¹‰à¸² +à¹à¸‚่งขัน +à¹à¸‚็งขัน +à¹à¸‚้งขวา +à¹à¸‚้ง +à¹à¸‚่ง +à¹à¸‚็ง +ข้างออภ+ข้างà¹à¸£à¸¡ +ข้างเงิน +ข้างควาย +ข้างขึ้น +ข้างà¸à¸£à¸°à¸”าน +ข้างๆ คูๆ +ข้างๆ +ข้าง +ข่าง +ขาง +à¸à¸£à¸²à¸š +à¸à¸ +vice-versa +vice-president +vice versa +McArthur +Mc Mahon +Mc Arthur +Copenhegen +coop +COOP +co-op +CO-OP +Canon +C.A.F +air@@@ +air +aide +Aalborg +aah +AAF +AAES +Aachen +AAAA +AAA +aa +AA +a' +A.Agr +A.Ae.E. +A.A.E.E. +A.A.E. +A.A.A.S. +A.A.A.L. +A.A.A. +a.a. +A.A. +a. +A. +A-1 +a- +A- +a +A +9999 +๑๠ลิตร {10 litre} +๑๠ลิตร [10 litre] +๑๠ลิตร (10 litre) +10 ลิตร (10 litre) +๑๠ลิตร +10 ลิตร +10 litre (๑๠ลิตร) +10 litre (10 ลิตร) +10 litre +0000 +@@@air +@@@@@ +-à¸à¸£à¸°à¹à¸¢à¹ˆà¸‡ +-a +DROP TABLE t1; +# +# End of ctype_thai.inc +# +# +# End of 10.1 tests +# diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index 48a6eb02526..a9c4f2d754f 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -2275,8 +2275,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `clipid` int(11) NOT NULL, - `mos` tinyint(4) DEFAULT '0', - `Tape` tinytext, + `mos` tinyint(4) DEFAULT 0, + `Tape` tinytext DEFAULT NULL, PRIMARY KEY (`clipid`), KEY `tape` (`Tape`(255)) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 @@ -3109,7 +3109,7 @@ create table t1 as select group_concat(1,2,3) as c1; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text CHARACTER SET utf8 + `c1` text CHARACTER SET utf8 DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 as select 1 as c1 union select 'a'; @@ -3365,7 +3365,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` varchar(83) CHARACTER SET utf8 DEFAULT NULL, - `c2` decimal(65,30) DEFAULT NULL + `c2` decimal(65,38) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; select hex(concat(@@ft_max_word_len)); @@ -3715,7 +3715,7 @@ create table t1 as select concat(AsText(GeomFromText('Point(1 2)'))) as c1; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext CHARACTER SET utf8 + `c1` longtext CHARACTER SET utf8 DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; select hex(concat(period_add(200902, 2))); @@ -5072,7 +5072,7 @@ GROUP_CONCAT(CASE WHEN a THEN a ELSE '' END) 1234567 SELECT COALESCE(a,'') FROM t1 GROUP BY 1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(a,'') 253 27 7 Y 0 31 33 +def COALESCE(a,'') 253 27 7 Y 0 39 33 COALESCE(a,'') 1234567 # All columns must be VARCHAR(9) with the same length: @@ -5338,6 +5338,15 @@ f1() DROP FUNCTION f1; DROP TABLE t1; # +# MDEV-9662 Assertion `precision || !scale' failed in my_decimal_precision_to_length_no_truncation(uint, uint8, bool) +# +SELECT @@collation_connection; +@@collation_connection +utf8_general_ci +SELECT CASE 1 WHEN 2 THEN ( - '3' ) END; +CASE 1 WHEN 2 THEN ( - '3' ) END +NULL +# # MDEV-5702 Incorrect results are returned with NULLIF() # CREATE TABLE t1 (d DATE); @@ -6200,6 +6209,45 @@ OCTET_LENGTH(a) a 255 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA DROP TABLE t1; # +# MDEV-8402 Bug#77473 Bug#21317406 TRUNCATED DATA WITH SUBQUERY & UTF8 +# +# +SET NAMES utf8; +SELECT length(rpad(_utf8 0xD0B1, 65536, _utf8 0xD0B2)) AS data; +data +131072 +SELECT length(data) AS len FROM ( +SELECT rpad(_utf8 0xD0B1, 65536, _utf8 0xD0B2) AS data +) AS sub; +len +131072 +SELECT length(rpad(_utf8 0xD0B1, 65535, _utf8 0xD0B2)) AS data; +data +131070 +SELECT length(data) AS len FROM ( +SELECT rpad(_utf8 0xD0B1, 65535, _utf8 0xD0B2) AS data +) AS sub; +len +131070 +SELECT length(data) AS len FROM (SELECT REPEAT('ä', 36766) AS data) AS sub; +len +73532 +SELECT length(data) AS len FROM (SELECT REPEAT('ä', 36767) AS data) AS sub; +len +73534 +SELECT length(data) AS len FROM (SELECT REPEAT('ä', 36778) AS data) AS sub; +len +73556 +SELECT length(data) AS len FROM (SELECT REPEAT('ä', 65535) AS data) AS sub; +len +131070 +SELECT length(data) AS len FROM (SELECT REPEAT('ä', 65536) AS data) AS sub; +len +131072 +SELECT length(data) AS len FROM (SELECT REPEAT('ä', 65537) AS data) AS sub; +len +131074 +# # End of 5.5 tests # # @@ -10459,5 +10507,81 @@ HEX(a) 613F DROP TABLE t1; # +# MDEV-10134 Add full support for DEFAULT +# +SET NAMES latin1; +CREATE TABLE t1 (a VARCHAR(30) CHARACTER SET latin1 DEFAULT CONCAT('ß')); +SET NAMES utf8; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(30) DEFAULT CONCAT('ß') +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (DEFAULT); +SELECT HEX(a),a FROM t1; +HEX(a) a +C39F ß +SET NAMES latin1; +ALTER TABLE t1 ADD b VARCHAR(30) CHARACTER SET latin1 DEFAULT CONCAT('ß'); +SET NAMES utf8; +ALTER TABLE t1 ADD c VARCHAR(30) CHARACTER SET latin1 DEFAULT CONCAT('ß'); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(30) DEFAULT CONCAT('ß'), + `b` varchar(30) DEFAULT CONCAT('ß'), + `c` varchar(30) DEFAULT CONCAT('ß') +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DELETE FROM t1; +INSERT INTO t1 VALUES(); +SELECT * FROM t1; +a b c +ß ß ß +SET NAMES latin1; +DELETE FROM t1; +INSERT INTO t1 VALUES(); +SET NAMES utf8; +SELECT * FROM t1; +a b c +ß ß ß +DROP TABLE t1; +SET NAMES latin1; +CREATE TABLE t1 (a VARCHAR(30) CHARACTER SET utf8 DEFAULT CONCAT('ß')); +SET NAMES utf8; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(30) CHARACTER SET utf8 DEFAULT CONCAT('ß') +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (DEFAULT); +SELECT HEX(a), a FROM t1; +HEX(a) a +C383C5B8 ß +DROP TABLE t1; +SET NAMES utf8; +CREATE TABLE t1 (a VARCHAR(30) CHARACTER SET latin1 DEFAULT CONCAT('ß')); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(30) DEFAULT CONCAT('ß') +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (DEFAULT); +SELECT HEX(a) FROM t1; +HEX(a) +DF +DROP TABLE t1; +SET NAMES utf8; +CREATE TABLE t1 (a VARCHAR(30) CHARACTER SET utf8 DEFAULT CONCAT('ß')); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(30) CHARACTER SET utf8 DEFAULT CONCAT('ß') +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (DEFAULT); +SELECT HEX(a) FROM t1; +HEX(a) +C39F +DROP TABLE t1; +# # End of 10.2 tests # diff --git a/mysql-test/r/ctype_utf8mb4.result b/mysql-test/r/ctype_utf8mb4.result index 558aba9c466..67b659e25b4 100644 --- a/mysql-test/r/ctype_utf8mb4.result +++ b/mysql-test/r/ctype_utf8mb4.result @@ -2387,8 +2387,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `clipid` int(11) NOT NULL, - `mos` tinyint(4) DEFAULT '0', - `Tape` tinytext, + `mos` tinyint(4) DEFAULT 0, + `Tape` tinytext DEFAULT NULL, PRIMARY KEY (`clipid`), KEY `tape` (`Tape`(250)) ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 @@ -2825,6 +2825,40 @@ OCTET_LENGTH(a) a 252 😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎 DROP TABLE t1; # +# MDEV-8402 Bug#77473 Bug#21317406 TRUNCATED DATA WITH SUBQUERY & UTF8 +# +# +SET NAMES utf8mb4; +SELECT length(repeat(_utf8mb4 0xE29883, 21844)) AS data; +data +65532 +SELECT length(data) AS len +FROM ( SELECT repeat(_utf8mb4 0xE29883, 21844) AS data ) AS sub; +len +65532 +SELECT length(repeat(_utf8mb4 0xE29883, 21846)) AS data; +data +65538 +SELECT length(data) AS len +FROM ( SELECT repeat(_utf8mb4 0xE29883, 21846) AS data ) AS sub; +len +65538 +SELECT LENGTH(data) AS len FROM (SELECT REPEAT('☃', 21844) AS data ) AS sub; +len +65532 +SELECT LENGTH(data) AS len FROM (SELECT REPEAT('☃', 21845) AS data ) AS sub; +len +65535 +SELECT LENGTH(data) AS len FROM (SELECT REPEAT('☃', 21846) AS data ) AS sub; +len +65538 +SELECT LENGTH(data) AS len FROM (SELECT REPEAT('☃', 65535) AS data ) AS sub; +len +196605 +SELECT LENGTH(data) AS len FROM (SELECT REPEAT('☃', 65536) AS data ) AS sub; +len +196608 +# # End of 5.5 tests # # diff --git a/mysql-test/r/ctype_utf8mb4_innodb.result b/mysql-test/r/ctype_utf8mb4_innodb.result index 7d193f397ac..28b566c19eb 100644 --- a/mysql-test/r/ctype_utf8mb4_innodb.result +++ b/mysql-test/r/ctype_utf8mb4_innodb.result @@ -2347,8 +2347,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `clipid` int(11) NOT NULL, - `mos` tinyint(4) DEFAULT '0', - `Tape` tinytext, + `mos` tinyint(4) DEFAULT 0, + `Tape` tinytext DEFAULT NULL, PRIMARY KEY (`clipid`), KEY `tape` (`Tape`(191)) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 diff --git a/mysql-test/r/ctype_utf8mb4_myisam.result b/mysql-test/r/ctype_utf8mb4_myisam.result index 28cf36c7492..34145417966 100644 --- a/mysql-test/r/ctype_utf8mb4_myisam.result +++ b/mysql-test/r/ctype_utf8mb4_myisam.result @@ -2347,8 +2347,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `clipid` int(11) NOT NULL, - `mos` tinyint(4) DEFAULT '0', - `Tape` tinytext, + `mos` tinyint(4) DEFAULT 0, + `Tape` tinytext DEFAULT NULL, PRIMARY KEY (`clipid`), KEY `tape` (`Tape`(250)) ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 diff --git a/mysql-test/r/ctype_utf8mb4_uca.result b/mysql-test/r/ctype_utf8mb4_uca.result index 1057b9743f4..4792d746709 100644 --- a/mysql-test/r/ctype_utf8mb4_uca.result +++ b/mysql-test/r/ctype_utf8mb4_uca.result @@ -5315,3 +5315,703 @@ DROP TABLE t1; # # End of MariaDB-10.0 tests # +# +# Start of 10.1 tests +# +SET NAMES utf8; +SET collation_connection=utf8mb4_thai_520_w2; +# +# Start of ctype_uca_w2.inc +# +SELECT @@collation_connection; +@@collation_connection +utf8mb4_thai_520_w2 +SELECT ID, SORTLEN, COLLATION_NAME, CHARACTER_SET_NAME +FROM INFORMATION_SCHEMA.COLLATIONS +WHERE COLLATION_NAME LIKE @@collation_connection; +ID SORTLEN COLLATION_NAME CHARACTER_SET_NAME +610 4 utf8mb4_thai_520_w2 utf8mb4 +# +# Testing strnxfrm +# +CREATE TABLE t1 AS SELECT SPACE(3) AS a LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_thai_520_w2 NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (SPACE(0)),(SPACE(1)),(SPACE(2)); +SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(8))) FROM t1; +HEX(a) HEX(WEIGHT_STRING(a AS CHAR(8))) + 020A020A020A020A020A020A020A020A00200020002000200020002000200020 +20 020A020A020A020A020A020A020A020A00200020002000200020002000200020 +2020 020A020A020A020A020A020A020A020A00200020002000200020002000200020 +SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(4))) FROM t1; +HEX(a) HEX(WEIGHT_STRING(a AS CHAR(4))) + 020A020A020A020A0020002000200020 +20 020A020A020A020A0020002000200020 +2020 020A020A020A020A0020002000200020 +SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 1)) FROM t1; +HEX(a) HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 1)) + 020A020A020A020A +20 020A020A020A020A +2020 020A020A020A020A +SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 2)) FROM t1; +HEX(a) HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 2)) + 0020002000200020 +20 0020002000200020 +2020 0020002000200020 +SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 3)) FROM t1; +HEX(a) HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 3)) + 0020002000200020 +20 0020002000200020 +2020 0020002000200020 +DROP TABLE t1; +CREATE TABLE t1 AS SELECT SPACE(10) AS a LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_thai_520_w2 NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (_ucs2 0x3400); +INSERT INTO t1 VALUES (_ucs2 0xF001); +SELECT HEX(CONVERT(a USING ucs2)) AS ucs2, HEX(a), HEX(WEIGHT_STRING(a)) FROM t1; +ucs2 HEX(a) HEX(WEIGHT_STRING(a)) +3400 E39080 FB80B4000020 +F001 EF8081 FBC1F0010020 +DROP TABLE t1; +CREATE TABLE t1 AS SELECT SPACE(10) AS a LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_thai_520_w2 NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES ('A'),('À'),('Ã'),('Â'),('Ã'),('Ä'),('Ã…'); +SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a; +a HEX(WEIGHT_STRING(a LEVEL 2)) +A 0020 +à 00200032 +À 00200035 + 0020003C +Ã… 00200043 +Ä 00200047 +à 0020004E +SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a DESC; +a HEX(WEIGHT_STRING(a LEVEL 2)) +à 0020004E +Ä 00200047 +Ã… 00200043 + 0020003C +À 00200035 +à 00200032 +A 0020 +SET @backup_character_set_connection=@@character_set_connection; +SET @backup_collation_connection=@@collation_connection; +SET NAMES utf8; +SET @stmt= CONCAT('ALTER TABLE t1 MODIFY a CHAR(10)' COLLATE utf8_bin, +' CHARACTER SET ', @backup_character_set_connection, +' COLLATE ', @backup_collation_connection); +PREPARE stmt FROM @stmt; +EXECUTE stmt; +DEALLOCATE PREPARE stmt; +SET collation_connection=@backup_collation_connection; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_thai_520_w2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a; +a HEX(WEIGHT_STRING(a LEVEL 2)) +A 0020 +à 00200032 +À 00200035 + 0020003C +Ã… 00200043 +Ä 00200047 +à 0020004E +SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a DESC; +a HEX(WEIGHT_STRING(a LEVEL 2)) +à 0020004E +Ä 00200047 +Ã… 00200043 + 0020003C +À 00200035 +à 00200032 +A 0020 +DROP TABLE t1; +CREATE TABLE t1 AS SELECT SPACE(10) AS a LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_thai_520_w2 NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES ('cota'),('cote'),('cotz'); +INSERT INTO t1 VALUES ('coté'),('côte'),('côté'),('cotë'),('côtë'); +SELECT * FROM t1 ORDER BY a; +a +cota +cote +coté +cotë +côte +côté +côtë +cotz +SELECT * FROM t1 ORDER BY a DESC; +a +cotz +côtë +côté +côte +cotë +coté +cote +cota +DROP TABLE t1; +# +# End of ctype_uca_w2.inc +# +# +# Start of ctype_thai.inc +# +CREATE TABLE t1 (a VARCHAR(30) CHARACTER SET utf8 COLLATE utf8_bin); +INSERT INTO t1 VALUES ('-à¸à¸£à¸°à¹à¸¢à¹ˆà¸‡'); +INSERT INTO t1 VALUES ('à¸à¸'); +INSERT INTO t1 VALUES ('à¸à¸£à¸²à¸š'); +INSERT INTO t1 VALUES ('ข่าง'); +INSERT INTO t1 VALUES ('ข้าง'); +INSERT INTO t1 VALUES ('ข้างà¸à¸£à¸°à¸”าน'); +INSERT INTO t1 VALUES ('ข้างขึ้น'); +INSERT INTO t1 VALUES ('ข้างควาย'); +INSERT INTO t1 VALUES ('ข้างเงิน'); +INSERT INTO t1 VALUES ('ข้างà¹à¸£à¸¡'); +INSERT INTO t1 VALUES ('ข้างออà¸'); +INSERT INTO t1 VALUES ('ข้างๆ'); +INSERT INTO t1 VALUES ('ข้างๆ คูๆ'); +INSERT INTO t1 VALUES ('ขาง'); +INSERT INTO t1 VALUES ('à¹à¸‚็ง'); +INSERT INTO t1 VALUES ('à¹à¸‚่ง'); +INSERT INTO t1 VALUES ('à¹à¸‚่งขัน'); +INSERT INTO t1 VALUES ('à¹à¸‚้ง'); +INSERT INTO t1 VALUES ('à¹à¸‚้งขวา'); +INSERT INTO t1 VALUES ('à¹à¸‚็งขัน'); +INSERT INTO t1 VALUES ('ทูลเà¸à¸¥à¹‰à¸²'); +INSERT INTO t1 VALUES ('ทูลเà¸à¸¥à¹‰à¸²à¸—ูลà¸à¸£à¸°à¸«à¸¡à¹ˆà¸­à¸¡'); +INSERT INTO t1 VALUES ('ทูลเà¸à¸¥à¹‰à¸²à¸¯'); +INSERT INTO t1 VALUES ('บุà¸à¸à¸²'); +INSERT INTO t1 VALUES ('บุà¸-หลง'); +INSERT INTO t1 VALUES ('บุà¸à¸«à¸¥à¸‡'); +INSERT INTO t1 VALUES ('ป่า'); +INSERT INTO t1 VALUES ('ป่าน'); +INSERT INTO t1 VALUES ('ป้า'); +INSERT INTO t1 VALUES ('ป้าน'); +INSERT INTO t1 VALUES ('ป๊า'); +INSERT INTO t1 VALUES ('ป๊าน'); +INSERT INTO t1 VALUES ('ป๋า'); +INSERT INTO t1 VALUES ('ป๋าน'); +INSERT INTO t1 VALUES ('ปา'); +INSERT INTO t1 VALUES ('ปาน'); +INSERT INTO t1 VALUES ('à¹à¸›à¹‰à¸‡'); +INSERT INTO t1 VALUES ('พณิชย์'); +INSERT INTO t1 VALUES ('ม้า'); +INSERT INTO t1 VALUES ('ฯพณฯ'); +INSERT INTO t1 VALUES ('A'); +INSERT INTO t1 VALUES ('a'); +INSERT INTO t1 VALUES ('a\''); +INSERT INTO t1 VALUES ('A-'); +INSERT INTO t1 VALUES ('a-'); +INSERT INTO t1 VALUES ('-a'); +INSERT INTO t1 VALUES ('A.'); +INSERT INTO t1 VALUES ('a.'); +INSERT INTO t1 VALUES ('A-1'); +INSERT INTO t1 VALUES ('aa'); +INSERT INTO t1 VALUES ('AA'); +INSERT INTO t1 VALUES ('A.A.'); +INSERT INTO t1 VALUES ('a.a.'); +INSERT INTO t1 VALUES ('AAA'); +INSERT INTO t1 VALUES ('A.A.A.'); +INSERT INTO t1 VALUES ('AAAA'); +INSERT INTO t1 VALUES ('A.A.A.L.'); +INSERT INTO t1 VALUES ('A.A.A.S.'); +INSERT INTO t1 VALUES ('Aachen'); +INSERT INTO t1 VALUES ('A.A.E.'); +INSERT INTO t1 VALUES ('A.Ae.E.'); +INSERT INTO t1 VALUES ('A.A.E.E.'); +INSERT INTO t1 VALUES ('AAES'); +INSERT INTO t1 VALUES ('AAF'); +INSERT INTO t1 VALUES ('A.Agr'); +INSERT INTO t1 VALUES ('aah'); +INSERT INTO t1 VALUES ('@@@@@'); +INSERT INTO t1 VALUES ('0000'); +INSERT INTO t1 VALUES ('9999'); +INSERT INTO t1 VALUES ('Aalborg'); +INSERT INTO t1 VALUES ('aide'); +INSERT INTO t1 VALUES ('air'); +INSERT INTO t1 VALUES ('@@@air'); +INSERT INTO t1 VALUES ('air@@@'); +INSERT INTO t1 VALUES ('C.A.F'); +INSERT INTO t1 VALUES ('Canon'); +INSERT INTO t1 VALUES ('coop'); +INSERT INTO t1 VALUES ('co-op'); +INSERT INTO t1 VALUES ('COOP'); +INSERT INTO t1 VALUES ('CO-OP'); +INSERT INTO t1 VALUES ('Copenhegen'); +INSERT INTO t1 VALUES ('McArthur'); +INSERT INTO t1 VALUES ('Mc Arthur'); +INSERT INTO t1 VALUES ('Mc Mahon'); +INSERT INTO t1 VALUES ('vice-president'); +INSERT INTO t1 VALUES ('vice versa'); +INSERT INTO t1 VALUES ('vice-versa'); +INSERT INTO t1 VALUES ('10 ลิตร'); +INSERT INTO t1 VALUES ('๑๠ลิตร'); +INSERT INTO t1 VALUES ('10 litre'); +INSERT INTO t1 VALUES ('10 litre (10 ลิตร)'); +INSERT INTO t1 VALUES ('10 ลิตร (10 litre)'); +INSERT INTO t1 VALUES ('10 litre (๑๠ลิตร)'); +INSERT INTO t1 VALUES ('๑๠ลิตร (10 litre)'); +INSERT INTO t1 VALUES ('๑๠ลิตร [10 litre]'); +INSERT INTO t1 VALUES ('๑๠ลิตร {10 litre}'); +ALTER TABLE t1 ORDER BY a; +SET @backup_character_set_connection=@@character_set_connection; +SET @backup_collation_connection=@@collation_connection; +SET NAMES utf8; +SET @stmt= CONCAT('ALTER TABLE t1 MODIFY a VARCHAR(30)', +' CHARACTER SET ', @backup_character_set_connection, +' COLLATE ', @backup_collation_connection, +' , ADD id INT NOT NULL AUTO_INCREMENT PRIMARY KEY' + ' , ADD KEY a_id (a, id)'); +PREPARE stmt FROM @stmt; +EXECUTE stmt; +DEALLOCATE PREPARE stmt; +SET collation_connection=@backup_collation_connection; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_thai_520_w2 DEFAULT NULL, + `id` int(11) NOT NULL AUTO_INCREMENT, + PRIMARY KEY (`id`), + KEY `a_id` (`a`,`id`) +) ENGINE=MyISAM AUTO_INCREMENT=97 DEFAULT CHARSET=latin1 +# +# Ascending sort, using filesort +# +EXPLAIN SELECT a FROM t1 ORDER BY a, BINARY a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL a_id 127 NULL 96 Using index; Using filesort +SELECT a FROM t1 ORDER BY a, BINARY a; +a +-a +-à¸à¸£à¸°à¹à¸¢à¹ˆà¸‡ +@@@@@ +@@@air +0000 +10 litre +10 litre (10 ลิตร) +10 litre (๑๠ลิตร) +10 ลิตร +๑๠ลิตร +10 ลิตร (10 litre) +๑๠ลิตร (10 litre) +๑๠ลิตร [10 litre] +๑๠ลิตร {10 litre} +9999 +A +a +A- +a- +A-1 +A. +a. +A.A. +a.a. +A.A.A. +A.A.A.L. +A.A.A.S. +A.A.E. +A.A.E.E. +A.Ae.E. +A.Agr +a' +AA +aa +AAA +AAAA +Aachen +AAES +AAF +aah +Aalborg +aide +air +air@@@ +C.A.F +Canon +CO-OP +co-op +COOP +coop +Copenhegen +Mc Arthur +Mc Mahon +McArthur +vice versa +vice-president +vice-versa +à¸à¸ +à¸à¸£à¸²à¸š +ขาง +ข่าง +ข้าง +ข้างๆ +ข้างๆ คูๆ +ข้างà¸à¸£à¸°à¸”าน +ข้างขึ้น +ข้างควาย +ข้างเงิน +ข้างà¹à¸£à¸¡ +ข้างออภ+à¹à¸‚็ง +à¹à¸‚่ง +à¹à¸‚้ง +à¹à¸‚้งขวา +à¹à¸‚็งขัน +à¹à¸‚่งขัน +ทูลเà¸à¸¥à¹‰à¸² +ทูลเà¸à¸¥à¹‰à¸²à¸—ูลà¸à¸£à¸°à¸«à¸¡à¹ˆà¸­à¸¡ +ทูลเà¸à¸¥à¹‰à¸²à¸¯ +บุà¸-หลง +บุà¸à¸à¸² +บุà¸à¸«à¸¥à¸‡ +ปา +ป่า +ป้า +ป๊า +ป๋า +ปาน +ป่าน +ป้าน +ป๊าน +ป๋าน +à¹à¸›à¹‰à¸‡ +พณิชย์ +ม้า +ฯพณฯ +# +# Descending sort, using filesort +# +EXPLAIN SELECT a FROM t1 ORDER BY a DESC, BINARY a DESC; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL a_id 127 NULL 96 Using index; Using filesort +SELECT a FROM t1 ORDER BY a DESC, BINARY a DESC; +a +ฯพณฯ +ม้า +พณิชย์ +à¹à¸›à¹‰à¸‡ +ป๋าน +ป๊าน +ป้าน +ป่าน +ปาน +ป๋า +ป๊า +ป้า +ป่า +ปา +บุà¸à¸«à¸¥à¸‡ +บุà¸à¸à¸² +บุà¸-หลง +ทูลเà¸à¸¥à¹‰à¸²à¸¯ +ทูลเà¸à¸¥à¹‰à¸²à¸—ูลà¸à¸£à¸°à¸«à¸¡à¹ˆà¸­à¸¡ +ทูลเà¸à¸¥à¹‰à¸² +à¹à¸‚่งขัน +à¹à¸‚็งขัน +à¹à¸‚้งขวา +à¹à¸‚้ง +à¹à¸‚่ง +à¹à¸‚็ง +ข้างออภ+ข้างà¹à¸£à¸¡ +ข้างเงิน +ข้างควาย +ข้างขึ้น +ข้างà¸à¸£à¸°à¸”าน +ข้างๆ คูๆ +ข้างๆ +ข้าง +ข่าง +ขาง +à¸à¸£à¸²à¸š +à¸à¸ +vice-versa +vice-president +vice versa +McArthur +Mc Mahon +Mc Arthur +Copenhegen +coop +COOP +co-op +CO-OP +Canon +C.A.F +air@@@ +air +aide +Aalborg +aah +AAF +AAES +Aachen +AAAA +AAA +aa +AA +a' +A.Agr +A.Ae.E. +A.A.E.E. +A.A.E. +A.A.A.S. +A.A.A.L. +A.A.A. +a.a. +A.A. +a. +A. +A-1 +a- +A- +a +A +9999 +๑๠ลิตร {10 litre} +๑๠ลิตร [10 litre] +๑๠ลิตร (10 litre) +10 ลิตร (10 litre) +๑๠ลิตร +10 ลิตร +10 litre (๑๠ลิตร) +10 litre (10 ลิตร) +10 litre +0000 +@@@air +@@@@@ +-à¸à¸£à¸°à¹à¸¢à¹ˆà¸‡ +-a +# +# Ascending sort, using index +# +EXPLAIN SELECT a FROM t1 ORDER BY a, id; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL a_id 127 NULL 96 Using index +SELECT a FROM t1 ORDER BY a, id; +a +-a +-à¸à¸£à¸°à¹à¸¢à¹ˆà¸‡ +@@@@@ +@@@air +0000 +10 litre +10 litre (10 ลิตร) +10 litre (๑๠ลิตร) +10 ลิตร +๑๠ลิตร +10 ลิตร (10 litre) +๑๠ลิตร (10 litre) +๑๠ลิตร [10 litre] +๑๠ลิตร {10 litre} +9999 +A +a +A- +a- +A-1 +A. +a. +A.A. +a.a. +A.A.A. +A.A.A.L. +A.A.A.S. +A.A.E. +A.A.E.E. +A.Ae.E. +A.Agr +a' +AA +aa +AAA +AAAA +Aachen +AAES +AAF +aah +Aalborg +aide +air +air@@@ +C.A.F +Canon +CO-OP +co-op +COOP +coop +Copenhegen +Mc Arthur +Mc Mahon +McArthur +vice versa +vice-president +vice-versa +à¸à¸ +à¸à¸£à¸²à¸š +ขาง +ข่าง +ข้าง +ข้างๆ +ข้างๆ คูๆ +ข้างà¸à¸£à¸°à¸”าน +ข้างขึ้น +ข้างควาย +ข้างเงิน +ข้างà¹à¸£à¸¡ +ข้างออภ+à¹à¸‚็ง +à¹à¸‚่ง +à¹à¸‚้ง +à¹à¸‚้งขวา +à¹à¸‚็งขัน +à¹à¸‚่งขัน +ทูลเà¸à¸¥à¹‰à¸² +ทูลเà¸à¸¥à¹‰à¸²à¸—ูลà¸à¸£à¸°à¸«à¸¡à¹ˆà¸­à¸¡ +ทูลเà¸à¸¥à¹‰à¸²à¸¯ +บุà¸-หลง +บุà¸à¸à¸² +บุà¸à¸«à¸¥à¸‡ +ปา +ป่า +ป้า +ป๊า +ป๋า +ปาน +ป่าน +ป้าน +ป๊าน +ป๋าน +à¹à¸›à¹‰à¸‡ +พณิชย์ +ม้า +ฯพณฯ +# +# Descending sort, using index +# +EXPLAIN SELECT a FROM t1 ORDER BY a DESC, id DESC; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL a_id 127 NULL 96 Using index +SELECT a FROM t1 ORDER BY a DESC, id DESC; +a +ฯพณฯ +ม้า +พณิชย์ +à¹à¸›à¹‰à¸‡ +ป๋าน +ป๊าน +ป้าน +ป่าน +ปาน +ป๋า +ป๊า +ป้า +ป่า +ปา +บุà¸à¸«à¸¥à¸‡ +บุà¸à¸à¸² +บุà¸-หลง +ทูลเà¸à¸¥à¹‰à¸²à¸¯ +ทูลเà¸à¸¥à¹‰à¸²à¸—ูลà¸à¸£à¸°à¸«à¸¡à¹ˆà¸­à¸¡ +ทูลเà¸à¸¥à¹‰à¸² +à¹à¸‚่งขัน +à¹à¸‚็งขัน +à¹à¸‚้งขวา +à¹à¸‚้ง +à¹à¸‚่ง +à¹à¸‚็ง +ข้างออภ+ข้างà¹à¸£à¸¡ +ข้างเงิน +ข้างควาย +ข้างขึ้น +ข้างà¸à¸£à¸°à¸”าน +ข้างๆ คูๆ +ข้างๆ +ข้าง +ข่าง +ขาง +à¸à¸£à¸²à¸š +à¸à¸ +vice-versa +vice-president +vice versa +McArthur +Mc Mahon +Mc Arthur +Copenhegen +coop +COOP +co-op +CO-OP +Canon +C.A.F +air@@@ +air +aide +Aalborg +aah +AAF +AAES +Aachen +AAAA +AAA +aa +AA +a' +A.Agr +A.Ae.E. +A.A.E.E. +A.A.E. +A.A.A.S. +A.A.A.L. +A.A.A. +a.a. +A.A. +a. +A. +A-1 +a- +A- +a +A +9999 +๑๠ลิตร {10 litre} +๑๠ลิตร [10 litre] +๑๠ลิตร (10 litre) +10 ลิตร (10 litre) +๑๠ลิตร +10 ลิตร +10 litre (๑๠ลิตร) +10 litre (10 ลิตร) +10 litre +0000 +@@@air +@@@@@ +-à¸à¸£à¸°à¹à¸¢à¹ˆà¸‡ +-a +DROP TABLE t1; +# +# End of ctype_thai.inc +# +# +# End of 10.1 tests +# diff --git a/mysql-test/r/default.result b/mysql-test/r/default.result index 685b534b808..386837a84bb 100644 --- a/mysql-test/r/default.result +++ b/mysql-test/r/default.result @@ -72,31 +72,31 @@ t2 CREATE TABLE `t2` ( `a` varchar(30) COLLATE latin1_bin NOT NULL DEFAULT ' ', `b` varchar(1) COLLATE latin1_bin NOT NULL DEFAULT ' ', `c` varchar(4) COLLATE latin1_bin NOT NULL DEFAULT '0000', - `d` tinyblob, - `e` tinyblob, - `f` tinyblob, - `g` tinyblob, - `h` tinyblob, - `i` tinyblob, - `j` tinyblob, - `k` tinyblob, - `l` tinyblob, - `m` tinyblob, - `n` tinyblob, - `o` tinyblob, - `p` tinyblob, + `d` tinyblob DEFAULT NULL, + `e` tinyblob DEFAULT NULL, + `f` tinyblob DEFAULT NULL, + `g` tinyblob DEFAULT NULL, + `h` tinyblob DEFAULT NULL, + `i` tinyblob DEFAULT NULL, + `j` tinyblob DEFAULT NULL, + `k` tinyblob DEFAULT NULL, + `l` tinyblob DEFAULT NULL, + `m` tinyblob DEFAULT NULL, + `n` tinyblob DEFAULT NULL, + `o` tinyblob DEFAULT NULL, + `p` tinyblob DEFAULT NULL, `q` varchar(30) COLLATE latin1_bin NOT NULL DEFAULT ' ', `r` varchar(30) COLLATE latin1_bin NOT NULL DEFAULT ' ', - `s` tinyblob, + `s` tinyblob DEFAULT NULL, `t` varchar(4) COLLATE latin1_bin NOT NULL DEFAULT ' ', `u` varchar(1) COLLATE latin1_bin NOT NULL DEFAULT ' ', `v` varchar(30) COLLATE latin1_bin NOT NULL DEFAULT ' ', `w` varchar(30) COLLATE latin1_bin NOT NULL DEFAULT ' ', - `x` tinyblob, + `x` tinyblob DEFAULT NULL, `y` varchar(5) COLLATE latin1_bin NOT NULL DEFAULT ' ', `z` varchar(20) COLLATE latin1_bin NOT NULL DEFAULT ' ', `a1` varchar(30) COLLATE latin1_bin NOT NULL DEFAULT ' ', - `b1` tinyblob + `b1` tinyblob DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_bin INSERT into t2 (b) values ('1'); SHOW WARNINGS; @@ -221,7 +221,7 @@ a NULL 10 drop table t1, t2; -End of 5.0 tests. +# End of 5.0 tests # # Start of 10.1 tests # @@ -236,3 +236,2847 @@ DROP TABLE IF EXISTS t1; # # End of 10.1 tests # +# +# Start of 10.2 tests +# +SET timestamp=UNIX_TIMESTAMP('2001-01-01 10:20:30.123456'); +# +# Check that CURRENT_TIMESTAMP works as before +# +CREATE or replace TABLE t1 (event_time TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `event_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +CREATE or replace TABLE t1 (event_time TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(2) ON UPDATE CURRENT_TIMESTAMP); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `event_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(2) ON UPDATE CURRENT_TIMESTAMP(6) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +CREATE or replace TABLE t1 (event_time TIMESTAMP(6) NOT NULL DEFAULT SYSDATE(2) ON UPDATE CURRENT_TIMESTAMP); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `event_time` timestamp(6) NOT NULL DEFAULT SYSDATE(2) ON UPDATE CURRENT_TIMESTAMP(6) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +# +# Check default expressions +# +create or replace table t1 (a int default 1, b int default (a+1), c int default (a+b)) engine myisam; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT 1, + `b` int(11) DEFAULT (a+1), + `c` int(11) DEFAULT (a+b) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (); +insert into t1 (a) values (2); +insert into t1 (a,b) values (10,20); +insert into t1 (a,b,c) values (100,200,400); +select * from t1; +a b c +1 2 3 +2 3 5 +10 20 30 +100 200 400 +truncate table t1; +insert delayed into t1 values (); +insert delayed into t1 (a) values (2); +insert delayed into t1 (a,b) values (10,20); +insert delayed into t1 (a,b,c) values (100,200,400); +flush tables t1; +select * from t1; +a b c +1 2 3 +2 3 5 +10 20 30 +100 200 400 +create or replace table t1 (a int, b blob default (1), c blob default "hello", t text default concat(a,b,c)) engine=myisam; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` blob DEFAULT 1, + `c` blob DEFAULT "hello", + `t` text DEFAULT concat(a,b,c) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 (a) values (2); +insert into t1 (a,b) values (10,"test1"); +insert into t1 (a,b,c) values (10,"test2","test3"); +insert delayed into t1 (a,b) values (10,"test4"); +flush tables t1; +select * from t1; +a b c t +2 1 hello 21hello +10 test1 hello 10test1hello +10 test2 test3 10test2test3 +10 test4 hello 10test4hello +drop table t1; +create or replace table t1 (a bigint default uuid_short()); +insert into t1 values(); +select a > 0 from t1; +a > 0 +1 +drop table t1; +create or replace table t1 (param_list int DEFAULT (1+1) NOT NULL); +create or replace table t1 (param_list int DEFAULT 1+1 NOT NULL); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '+1 NOT NULL)' at line 1 +create or replace table t1 (param_list blob DEFAULT "" NOT NULL); +drop table t1; +create table t1 (a int); +insert into t1 values(-1); +alter table t1 add b int default 1, add c int default -1, add d int default (1+1), add e timestamp; +select a,b,c,d,e from t1; +a b c d e +-1 1 -1 2 2001-01-01 10:20:30 +insert into t1 values(10,10,10,10,0); +alter table t1 add f int default (1+1+1) null, add g int default (1+1+1+1) not null,add h int default (2+2+2+2); +select a,b,c,d,e,f,g,h from t1; +a b c d e f g h +-1 1 -1 2 2001-01-01 10:20:30 3 4 8 +10 10 10 10 0000-00-00 00:00:00 3 4 8 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT 1, + `c` int(11) DEFAULT -1, + `d` int(11) DEFAULT (1+1), + `e` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `f` int(11) DEFAULT (1+1+1), + `g` int(11) NOT NULL DEFAULT (1+1+1+1), + `h` int(11) DEFAULT (2+2+2+2) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +create table t2 like t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT 1, + `c` int(11) DEFAULT -1, + `d` int(11) DEFAULT (1+1), + `e` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `f` int(11) DEFAULT (1+1+1), + `g` int(11) NOT NULL DEFAULT (1+1+1+1), + `h` int(11) DEFAULT (2+2+2+2) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t2 (a) values (100); +select a,b,c,d,e,f,g,h from t2; +a b c d e f g h +100 1 -1 2 2001-01-01 10:20:30 3 4 8 +drop table t1,t2; +create table t1 (a int default (1----1), b int default - 1, c int default +1, e int default (--1)); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT (1----1), + `b` int(11) DEFAULT -1, + `c` int(11) DEFAULT 1, + `e` int(11) DEFAULT 1 +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values(); +insert into t1 values(); +select * from t1; +a b c e +2 -1 1 1 +2 -1 1 1 +drop table t1; +# +# Create or replace can delete a table on error +# +create table t1 (a int); +create or replace table t1 (a int default b, b int default a); +ERROR 01000: Expression for field `a` is refering to uninitialized field `b` +show create table t1; +ERROR 42S02: Table 'test.t1' doesn't exist +# +# Refering to other columns +# +create or replace table t1 (a int default 1, b int default a); +create or replace table t1 (a int default 1, b int as (a)); +create or replace table t1 (a int default b, b int default 1); +create or replace table t1 (a int as (b), b int default 1); +create or replace table t1 (a int as (b), b int default (1+1)); +create or replace table t1 (a int default 1, b int as (c), c int default (a+1)); +create or replace table t1 (a int default (1+1), b int as (c), c int default (a+1)); +create or replace table t1 (a varchar(128) default @@version); +create or replace table t1 (a int not null, b int as (a)); +create or replace table t1 (a int not null, b int default (a+1)); +create or replace table t1 (a int default a); +ERROR 01000: Expression for field `a` is refering to uninitialized field `a` +create or replace table t1 (a int default b, b int default (1+1)); +create or replace table t1 (a int default 1, b int as (c), c int as (a+1)); +ERROR 01000: Expression for field `b` is refering to uninitialized field `c` +CREATE TABLE t1 (a INT DEFAULT (DEFAULT(a))); +ERROR 01000: Expression for field `a` is refering to uninitialized field `a` +CREATE TABLE t1 (a INT DEFAULT(DEFAULT(b)), b INT DEFAULT(DEFAULT(a))); +ERROR 01000: Expression for field `a` is refering to uninitialized field `b` +CREATE TABLE t1 (a INT DEFAULT(DEFAULT(b)) NOT NULL, b INT DEFAULT(DEFAULT(a)) NOT NULL); +ERROR 01000: Expression for field `a` is refering to uninitialized field `b` +# +# Allow defaults to refer to not default fields +# +create or replace table t1 (a int default b, b int not null); +insert into t1 values(); +Warnings: +Warning 1364 Field 'b' doesn't have a default value +insert into t1 (a) values(1); +Warnings: +Warning 1364 Field 'b' doesn't have a default value +insert into t1 (b) values(2); +insert into t1 (a,b) values(3,4); +select * from t1; +a b +0 0 +1 0 +2 2 +3 4 +drop table t1; +# +# Error handling +# +create or replace table t1 (a bigint default xxx()); +ERROR HY000: Function or expression '`xxx`()' cannot be used in the DEFAULT clause of `a` +create or replace table t1 (a bigint default (select (1))); +ERROR HY000: Function or expression 'select ...' cannot be used in the DEFAULT clause of `a` +create or replace table t1 (a bigint default (1,2,3)); +ERROR 21000: Operand should contain 1 column(s) +create or replace table t1 (a bigint default ((1,2,3))); +ERROR 21000: Operand should contain 1 column(s) +CREATE TABLE t1 (a INT, b INT, c INT DEFAULT a DIV b); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'DIV b)' at line 1 +CREATE TABLE t1 (a INT, b INT DEFAULT -a); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'a)' at line 1 +# +# Invalid DEFAULT expressions +# +CREATE TABLE t1 (a INT DEFAULT ((SELECT 1))); +ERROR HY000: Function or expression 'select ...' cannot be used in the DEFAULT clause of `a` +CREATE TABLE t1 (a INT DEFAULT (EXISTS (SELECT 1))); +ERROR HY000: Function or expression 'select ...' cannot be used in the DEFAULT clause of `a` +CREATE TABLE t1 (a INT DEFAULT (1=ANY (SELECT 1))); +ERROR HY000: Function or expression 'select ...' cannot be used in the DEFAULT clause of `a` +CREATE TABLE t1 (a INT DEFAULT ROW(1,1)); +ERROR 21000: Operand should contain 1 column(s) +CREATE TABLE t1 (a INT DEFAULT (1,1)); +ERROR 21000: Operand should contain 1 column(s) +CREATE TABLE t1 (a INT DEFAULT ((1,1))); +ERROR 21000: Operand should contain 1 column(s) +CREATE TABLE t1 (a INT DEFAULT ?); +Got one of the listed errors +CREATE TABLE t1 (a INT DEFAULT(?)); +Got one of the listed errors +CREATE TABLE t1 (a INT DEFAULT (b), b INT DEFAULT(a)); +ERROR 01000: Expression for field `a` is refering to uninitialized field `b` +CREATE TABLE t1 (a INT DEFAULT @v); +ERROR HY000: Function or expression '@v' cannot be used in the DEFAULT clause of `a` +CREATE TABLE t1 (a INT DEFAULT @v:=1); +ERROR HY000: Function or expression '@v' cannot be used in the DEFAULT clause of `a` +CREATE TABLE t1 (a INT DEFAULT(NAME_CONST('xxx', 'yyy')); +ERROR HY000: Function or expression 'name_const()' cannot be used in the DEFAULT clause of `a` +CREATE TABLE t1 (a INT DEFAULT COUNT(*)); +ERROR HY000: Function or expression 'count()' cannot be used in the DEFAULT clause of `a` +CREATE TABLE t1 (a INT DEFAULT COUNT(1)); +ERROR HY000: Function or expression 'count()' cannot be used in the DEFAULT clause of `a` +CREATE TABLE t1 (a INT DEFAULT AVG(1)); +ERROR HY000: Function or expression 'avg()' cannot be used in the DEFAULT clause of `a` +CREATE TABLE t1 (a INT DEFAULT MIN(1)); +ERROR HY000: Function or expression 'min()' cannot be used in the DEFAULT clause of `a` +CREATE TABLE t1 (a INT DEFAULT GROUP_CONCAT(1)); +ERROR HY000: Function or expression 'group_concat()' cannot be used in the DEFAULT clause of `a` +CREATE TABLE t1 (a INT DEFAULT ROW_NUMBER() OVER ()); +ERROR HY000: Function or expression 'row_number()' cannot be used in the DEFAULT clause of `a` +CREATE FUNCTION f1() RETURNS INT RETURN 1; +CREATE TABLE t1 (a INT DEFAULT f1()); +ERROR HY000: Function or expression '`f1`()' cannot be used in the DEFAULT clause of `a` +DROP FUNCTION f1; +CREATE PROCEDURE p1(par INT) CREATE TABLE t1 (a INT DEFAULT par); +ERROR HY000: Function or expression 'par' cannot be used in the DEFAULT clause of `a` +CREATE TABLE t1 (a INT DEFAULT par); +ERROR 42S22: Unknown column 'par' in 'virtual column function' +CREATE PROCEDURE p1() CREATE TABLE t1 (a INT DEFAULT par); +CALL p1; +ERROR 42S22: Unknown column 'par' in 'virtual column function' +DROP PROCEDURE p1; +CREATE TABLE t1 (a INT DEFAULT VALUES(a)); +ERROR HY000: Function or expression 'values()' cannot be used in the DEFAULT clause of `a` +CREATE TABLE t1 (a INT); +CREATE TRIGGER tr1 AFTER INSERT ON t1 FOR EACH ROW CREATE TABLE t2 (a INT DEFAULT NEW.a); +ERROR HY000: Function or expression 'NEW.a' cannot be used in the DEFAULT clause of `a` +CREATE TRIGGER tr1 AFTER INSERT ON t1 FOR EACH ROW CREATE TEMPORARY TABLE t2 (a INT DEFAULT NEW.a); +ERROR HY000: Function or expression 'NEW.a' cannot be used in the DEFAULT clause of `a` +DROP TABLE t1; +# +# Prepared statements +# +PREPARE stmt FROM 'CREATE TABLE t1 (a INT DEFAULT(?))'; +set @a=1; +execute stmt using @a; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT 1 +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +set @a=-1; +execute stmt using @a; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT -1 +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +DEALLOCATE PREPARE stmt; +PREPARE stmt FROM 'CREATE TABLE t1 (a INT DEFAULT(?), b INT DEFAULT(?))'; +set @a=1, @b=2; +execute stmt using @a,@b; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT 1, + `b` int(11) DEFAULT 2 +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +DEALLOCATE PREPARE stmt; +PREPARE stmt FROM 'CREATE TABLE t1 (a INT DEFAULT(?+?))'; +set @a=1; +execute stmt using @a,@a; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '?+?)' at line 1 +DEALLOCATE PREPARE stmt; +# +# Parenthesized Item_basic_constant +# +CREATE TABLE t1 ( +i01 INT DEFAULT (((1))), +i02 INT DEFAULT (((0x3939))), +i03 INT DEFAULT (((1.0))), +i04 INT DEFAULT (((1e0))), +i05 INT DEFAULT (((NULL))), +f01 DOUBLE DEFAULT (((PI()))), +s01 VARCHAR(10) DEFAULT (((_latin1'test'))), +s02 VARCHAR(10) DEFAULT ((('test'))), +s03 VARCHAR(10) DEFAULT (((0x40))), +s04 VARCHAR(10) DEFAULT (((X'40'))), +s05 VARCHAR(10) DEFAULT (((B'1000000'))), +d01 TIME DEFAULT (((TIME'10:20:30'))), +d02 DATE DEFAULT (((DATE'2001-01-01'))), +d03 DATETIME DEFAULT (((TIMESTAMP'2001-01-01 10:20:30'))) +); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `i01` int(11) DEFAULT 1, + `i02` int(11) DEFAULT 14649, + `i03` int(11) DEFAULT 1, + `i04` int(11) DEFAULT 1, + `i05` int(11) DEFAULT NULL, + `f01` double DEFAULT 3.141592653589793, + `s01` varchar(10) DEFAULT 'test', + `s02` varchar(10) DEFAULT 'test', + `s03` varchar(10) DEFAULT '@', + `s04` varchar(10) DEFAULT '@', + `s05` varchar(10) DEFAULT '@', + `d01` time DEFAULT '10:20:30', + `d02` date DEFAULT '2001-01-01', + `d03` datetime DEFAULT '2001-01-01 10:20:30' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (); +SELECT * FROM t1; +i01 1 +i02 14649 +i03 1 +i04 1 +i05 NULL +f01 3.141592653589793 +s01 test +s02 test +s03 @ +s04 @ +s05 @ +d01 10:20:30 +d02 2001-01-01 +d03 2001-01-01 10:20:30 +DROP TABLE t1; +# +# COALESCE(Item_basic_constant) +# +CREATE TABLE t1 ( +i01 INT DEFAULT COALESCE(1), +i02 INT DEFAULT COALESCE(0x3939), +i03 INT DEFAULT COALESCE(1.0), +i04 INT DEFAULT COALESCE(1e0), +i05 INT DEFAULT COALESCE(NULL), +f01 DOUBLE DEFAULT COALESCE(PI()), +s01 VARCHAR(10) DEFAULT COALESCE(_latin1'test'), +s02 VARCHAR(10) DEFAULT COALESCE('test'), +s03 VARCHAR(10) DEFAULT COALESCE(0x40), +s04 VARCHAR(10) DEFAULT COALESCE(X'40'), +s05 VARCHAR(10) DEFAULT COALESCE(B'1000000'), +d01 TIME DEFAULT COALESCE(TIME'10:20:30'), +d02 DATE DEFAULT COALESCE(DATE'2001-01-01'), +d03 DATETIME DEFAULT COALESCE(TIMESTAMP'2001-01-01 10:20:30') +); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `i01` int(11) DEFAULT COALESCE(1), + `i02` int(11) DEFAULT COALESCE(0x3939), + `i03` int(11) DEFAULT COALESCE(1.0), + `i04` int(11) DEFAULT COALESCE(1e0), + `i05` int(11) DEFAULT COALESCE(NULL), + `f01` double DEFAULT COALESCE(PI()), + `s01` varchar(10) DEFAULT COALESCE(_latin1'test'), + `s02` varchar(10) DEFAULT COALESCE('test'), + `s03` varchar(10) DEFAULT COALESCE(0x40), + `s04` varchar(10) DEFAULT COALESCE(X'40'), + `s05` varchar(10) DEFAULT COALESCE(B'1000000'), + `d01` time DEFAULT COALESCE(TIME'10:20:30'), + `d02` date DEFAULT COALESCE(DATE'2001-01-01'), + `d03` datetime DEFAULT COALESCE(TIMESTAMP'2001-01-01 10:20:30') +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (); +SELECT * FROM t1; +i01 1 +i02 99 +i03 1 +i04 1 +i05 NULL +f01 3.141592653589793 +s01 test +s02 test +s03 @ +s04 @ +s05 @ +d01 10:20:30 +d02 2001-01-01 +d03 2001-01-01 10:20:30 +DROP TABLE t1; +# +# TINYINT: out of range +# +CREATE TABLE t1 (a TINYINT DEFAULT 300 NOT NULL); +ERROR 42000: Invalid default value for 'a' +CREATE TABLE t1 (a TINYINT DEFAULT 128 NOT NULL); +ERROR 42000: Invalid default value for 'a' +CREATE TABLE t1 (a TINYINT DEFAULT -500 NOT NULL); +ERROR 42000: Invalid default value for 'a' +# +# INT: simple numeric expressions +# +CREATE TABLE t1 (a INT DEFAULT 1 NOT NULL); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) NOT NULL DEFAULT 1 +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (DEFAULT); +SELECT * FROM t1; +a +1 +DROP TABLE t1; +CREATE TABLE t1 (a INT DEFAULT COALESCE(1) NOT NULL); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) NOT NULL DEFAULT COALESCE(1) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (DEFAULT); +SELECT * FROM t1; +a +1 +DROP TABLE t1; +# +# INT: simple string expressions +# +CREATE TABLE t1 (a INT DEFAULT '1' NOT NULL); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) NOT NULL DEFAULT 1 +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (DEFAULT); +SELECT * FROM t1; +a +1 +DROP TABLE t1; +CREATE TABLE t1 (a INT DEFAULT CONCAT('1') NOT NULL); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) NOT NULL DEFAULT CONCAT('1') +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (DEFAULT); +SELECT * FROM t1; +a +1 +DROP TABLE t1; +CREATE TABLE t1 (a INT DEFAULT COALESCE('1') NOT NULL); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) NOT NULL DEFAULT COALESCE('1') +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (DEFAULT); +SELECT * FROM t1; +a +1 +DROP TABLE t1; +# +# INT: string expressions with garbage +# +CREATE TABLE t1 (a INT DEFAULT 'x'); +ERROR 42000: Invalid default value for 'a' +CREATE TABLE t1 (a INT DEFAULT CONCAT('x')); +ERROR 42000: Invalid default value for 'a' +CREATE TABLE t1 (a INT DEFAULT COALESCE('x')); +ERROR 42000: Invalid default value for 'a' +CREATE TABLE t1 (a INT DEFAULT (((((COALESCE('x'))))))); +ERROR 42000: Invalid default value for 'a' +# +# INT: string expressions with numbers + garbage +# +CREATE TABLE t1 (a INT DEFAULT '1x'); +ERROR 42000: Invalid default value for 'a' +CREATE TABLE t1 (a INT DEFAULT COALESCE('1x')); +ERROR 42000: Invalid default value for 'a' +CREATE TABLE t1 (a INT DEFAULT CONCAT('1x')); +ERROR 42000: Invalid default value for 'a' +# +# INT: string expressions with numbers + trailing space +# +CREATE TABLE t1 (a INT DEFAULT '1 '); +Warnings: +Note 1265 Data truncated for column 'a' at row 1 +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT 1 +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (DEFAULT); +SELECT * FROM t1; +a +1 +DROP TABLE t1; +CREATE TABLE t1 (a INT DEFAULT CONCAT('1 ')); +Warnings: +Note 1265 Data truncated for column 'a' at row 1 +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT CONCAT('1 ') +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (DEFAULT); +Warnings: +Note 1265 Data truncated for column 'a' at row 1 +SELECT * FROM t1; +a +1 +DROP TABLE t1; +CREATE TABLE t1 (a INT DEFAULT COALESCE('1 ')); +Warnings: +Note 1265 Data truncated for column 'a' at row 1 +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT COALESCE('1 ') +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (DEFAULT); +Warnings: +Note 1265 Data truncated for column 'a' at row 1 +SELECT * FROM t1; +a +1 +DROP TABLE t1; +# +# INT: a HEX value +# +CREATE TABLE t1 (a INT DEFAULT 0x61 NOT NULL); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) NOT NULL DEFAULT 97 +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (DEFAULT); +SELECT * FROM t1; +a +97 +DROP TABLE t1; +# +# VARCHAR: good defaults +# +CREATE TABLE t1 (a VARCHAR(30) DEFAULT 'xxx' NOT NULL); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(30) NOT NULL DEFAULT 'xxx' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (DEFAULT); +SELECT * FROM t1; +a +xxx +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(2) DEFAULT 0x41 NOT NULL); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(2) NOT NULL DEFAULT 'A' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(2) DEFAULT CONCAT(0x41) NOT NULL); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(2) NOT NULL DEFAULT CONCAT(0x41) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (DEFAULT); +SELECT * FROM t1; +a +A +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(2) DEFAULT COALESCE(0x41) NOT NULL); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(2) NOT NULL DEFAULT COALESCE(0x41) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (DEFAULT); +SELECT * FROM t1; +a +A +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(2) DEFAULT CONCAT(_utf8 0x41) NOT NULL); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(2) NOT NULL DEFAULT CONCAT(_utf8 0x41) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (DEFAULT); +SELECT * FROM t1; +a +A +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(2) DEFAULT CONCAT(_utf8 X'41') NOT NULL); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(2) NOT NULL DEFAULT CONCAT(_utf8 X'41') +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (DEFAULT); +SELECT * FROM t1; +a +A +DROP TABLE t1; +# +# VARCHAR: Too long default +# +CREATE TABLE t1 (a VARCHAR(2) DEFAULT 'xxx' NOT NULL); +ERROR 42000: Invalid default value for 'a' +CREATE TABLE t1 (a VARCHAR(2) DEFAULT CONCAT('xxx') NOT NULL); +ERROR 42000: Invalid default value for 'a' +# +# VARCHAR: Too long default with non-important data +# +CREATE TABLE t1 (a VARCHAR(2) DEFAULT 'xx ' NOT NULL); +ERROR 42000: Invalid default value for 'a' +CREATE TABLE t1 (a VARCHAR(2) DEFAULT CONCAT('xx ') NOT NULL); +ERROR 42000: Invalid default value for 'a' +# +# VARCHAR: conversion failures +# +CREATE TABLE t1 (a VARCHAR(2) CHARACTER SET latin1 DEFAULT _utf8 X'D18F' NOT NULL); +ERROR 42000: Invalid default value for 'a' +CREATE TABLE t1 (a VARCHAR(2) CHARACTER SET latin1 DEFAULT CONCAT(_utf8 X'D18F') NOT NULL); +ERROR 42000: Invalid default value for 'a' +CREATE TABLE t1 (a VARCHAR(2) CHARACTER SET latin1 DEFAULT CONCAT(_utf8 0xD18F) NOT NULL); +ERROR 42000: Invalid default value for 'a' +# +# Field as a default value +# +CREATE TABLE t1 (a INT, b INT DEFAULT (a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT a +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (1, 1); +INSERT INTO t1 VALUES (DEFAULT, DEFAULT); +INSERT INTO t1 VALUES (1, DEFAULT); +INSERT INTO t1 VALUES (DEFAULT, 1); +SELECT * FROM t1; +a b +1 1 +NULL NULL +1 1 +NULL 1 +DROP TABLE t1; +# +# Function DEFAULT(field) +# +CREATE TABLE t1 (a INT DEFAULT(DEFAULT(b)), b INT DEFAULT 1); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT DEFAULT(b), + `b` int(11) DEFAULT 1 +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (DEFAULT, DEFAULT); +SELECT * FROM t1; +a b +1 1 +DROP TABLE t1; +CREATE TABLE t1 (a INT DEFAULT 1, b INT DEFAULT(DEFAULT(a))); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT 1, + `b` int(11) DEFAULT DEFAULT(a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (DEFAULT, DEFAULT); +SELECT * FROM t1; +a b +1 1 +DROP TABLE t1; +# +# SQL Standard as a +# +CREATE TABLE t1 (a DATETIME DEFAULT CURRENT_TIMESTAMP); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT CURRENT_TIMESTAMP +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a TIME DEFAULT CURRENT_TIME); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` time DEFAULT CURRENT_TIME +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a DATE DEFAULT CURRENT_DATE); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` date DEFAULT CURRENT_DATE +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +# +# DECIMAL + CURRENT_TIMESTAMP, no truncation +# +CREATE TABLE t1 (a DECIMAL(30,6) DEFAULT CURRENT_TIMESTAMP(6)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` decimal(30,6) DEFAULT CURRENT_TIMESTAMP(6) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (); +SELECT * FROM t1; +a +20010101102030.123456 +DROP TABLE t1; +CREATE TABLE t1 (a DECIMAL(30,6) DEFAULT COALESCE(CURRENT_TIMESTAMP(6))); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` decimal(30,6) DEFAULT COALESCE(CURRENT_TIMESTAMP(6)) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES(); +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +INSERT IGNORE INTO t1 VALUES(); +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +SET sql_mode = 'STRICT_ALL_TABLES'; +INSERT INTO t1 VALUES(); +ERROR 01000: Data truncated for column 'a' at row 1 +SET sql_mode = DEFAULT; +DROP TABLE t1; +# +# DECIMAL + CURRENT_TIME, no truncation +# +CREATE TABLE t1 (a DECIMAL(30,6) DEFAULT COALESCE(CURRENT_TIME(6))); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` decimal(30,6) DEFAULT COALESCE(CURRENT_TIME(6)) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES(); +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +DROP TABLE t1; +# +# DECIMAL + CURRENT_DATE, no truncation +# +CREATE TABLE t1 (a DECIMAL(30,6) DEFAULT COALESCE(CURRENT_DATE)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` decimal(30,6) DEFAULT COALESCE(CURRENT_DATE) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES(); +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +DROP TABLE t1; +# +# COALESCE for SQL Standard +# +CREATE TABLE t1 (a TIMESTAMP DEFAULT COALESCE(CURRENT_TIMESTAMP)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` timestamp NOT NULL DEFAULT COALESCE(CURRENT_TIMESTAMP) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a DATE DEFAULT COALESCE(CURRENT_DATE)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` date DEFAULT COALESCE(CURRENT_DATE) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a TIME DEFAULT COALESCE(CURRENT_TIME)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` time DEFAULT COALESCE(CURRENT_TIME) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 ( +a TIMESTAMP DEFAULT CURRENT_TIMESTAMP(6), +b TIMESTAMP DEFAULT COALESCE(CURRENT_TIMESTAMP(6)) +); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `b` timestamp NOT NULL DEFAULT COALESCE(CURRENT_TIMESTAMP(6)) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (); +SELECT CURRENT_TIMESTAMP(6); +CURRENT_TIMESTAMP(6) +2001-01-01 10:20:30.123456 +SELECT * FROM t1; +a b +2001-01-01 10:20:30 2001-01-01 10:20:30 +DROP TABLE t1; +CREATE TABLE t1 ( +a DECIMAL(30,0) DEFAULT CURRENT_TIMESTAMP(6), +b DECIMAL(30,0) DEFAULT COALESCE(CURRENT_TIMESTAMP(6)) +); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` decimal(30,0) DEFAULT CURRENT_TIMESTAMP(6), + `b` decimal(30,0) DEFAULT COALESCE(CURRENT_TIMESTAMP(6)) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (); +Warnings: +Note 1265 Data truncated for column 'a' at row 1 +Warning 1265 Data truncated for column 'b' at row 1 +SELECT * FROM t1; +a b +20010101102030 2001 +DROP TABLE t1; +# +# Check DEFAULT() function +# +CREATE TABLE `t1` (`a` int(11) DEFAULT (3+3),`b` int(11) DEFAULT '1000'); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT (3+3), + `b` int(11) DEFAULT 1000 +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (1,1),(2,2); +insert into t1 values (default,default); +select * from t1; +a b +1 1 +2 2 +6 1000 +select default(a),b from t1; +default(a) b +6 1 +6 2 +6 1000 +select a,default(b) from t1; +a default(b) +1 1000 +2 1000 +6 1000 +drop table t1; +# +# Real functions +# +CREATE TABLE t1 (a DECIMAL(10,1), b DOUBLE DEFAULT CAST(a AS DOUBLE)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` decimal(10,1) DEFAULT NULL, + `b` double DEFAULT (CAST(a AS DOUBLE)) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (10.1, DEFAULT); +SELECT * FROM t1; +a b +10.1 10.1 +DROP TABLE t1; +CREATE TABLE t1 (a DOUBLE, b DOUBLE DEFAULT EXP(a), c DOUBLE DEFAULT LOG(b), d DOUBLE DEFAULT LOG(4, b)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `b` double DEFAULT EXP(a), + `c` double DEFAULT LOG(b), + `d` double DEFAULT LOG(4, b) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (2, DEFAULT, DEFAULT, DEFAULT); +SELECT * FROM t1; +a b c d +2 7.38905609893065 2 1.4426950408889634 +DROP TABLE t1; +CREATE TABLE t1 (a INT, b DOUBLE DEFAULT LOG2(a), c DOUBLE DEFAULT LOG10(a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` double DEFAULT LOG2(a), + `c` double DEFAULT LOG10(a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (4, DEFAULT, DEFAULT); +INSERT INTO t1 VALUES (100, DEFAULT, DEFAULT); +SELECT * FROM t1; +a b c +4 2 0.6020599913279624 +100 6.643856189774725 2 +DROP TABLE t1; +CREATE TABLE t1 (a DOUBLE, b DOUBLE DEFAULT SQRT(a), c DOUBLE DEFAULT POW(a,3)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `b` double DEFAULT SQRT(a), + `c` double DEFAULT POW(a,3) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (4, DEFAULT, DEFAULT); +SELECT * FROM t1; +a b c +4 2 64 +DROP TABLE t1; +CREATE TABLE t1 (a DOUBLE, b DOUBLE DEFAULT ACOS(a), c DOUBLE DEFAULT ASIN(a), d DOUBLE DEFAULT ATAN(a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `b` double DEFAULT ACOS(a), + `c` double DEFAULT ASIN(a), + `d` double DEFAULT ATAN(a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (1, DEFAULT, DEFAULT, DEFAULT); +SELECT a, b/PI(), c/PI(), d/PI() FROM t1; +a b/PI() c/PI() d/PI() +1 0 0.5 0.25 +DROP TABLE t1; +CREATE TABLE t1 (a DOUBLE, b DOUBLE DEFAULT COS(a), c DOUBLE DEFAULT SIN(a), d DOUBLE DEFAULT TAN(a), e DOUBLE DEFAULT COT(a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `b` double DEFAULT COS(a), + `c` double DEFAULT SIN(a), + `d` double DEFAULT TAN(a), + `e` double DEFAULT COT(a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES (PI()/3); +SELECT ROUND(a,3), ROUND(b,3), ROUND(c,3), ROUND(d,3), ROUND(e,3) FROM t1; +ROUND(a,3) ROUND(b,3) ROUND(c,3) ROUND(d,3) ROUND(e,3) +1.047 0.500 0.866 1.732 0.577 +DROP TABLE t1; +CREATE TABLE t1 (a DOUBLE DEFAULT RAND()); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT RAND() +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (DEFAULT); +DROP TABLE t1; +CREATE TABLE t1 (a DOUBLE, b DOUBLE DEFAULT DEGREES(a), c DOUBLE DEFAULT RADIANS(b)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `b` double DEFAULT DEGREES(a), + `c` double DEFAULT RADIANS(b) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (PI(), DEFAULT, DEFAULT); +SELECT * FROM t1; +a b c +3.141592653589793 180 3.141592653589793 +DROP TABLE t1; +# +# INT result functions +# +CREATE TABLE t1 (a INT, b INT DEFAULT INTERVAL(a, 10, 20, 30, 40)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT INTERVAL(a, 10, 20, 30, 40) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES (34); +SELECT * FROM t1; +a b +34 3 +DROP TABLE t1; +CREATE TABLE t1 (a INT, b INT, c INT DEFAULT (a DIV b)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT (a DIV b) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a, b) VALUES (13, 3); +SELECT * FROM t1; +a b c +13 3 4 +DROP TABLE t1; +CREATE TABLE t1 (a INT, b INT DEFAULT SIGN(a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT SIGN(a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES (-10),(0), (10); +SELECT * FROM t1; +a b +-10 -1 +0 0 +10 1 +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(30), b INT DEFAULT FIELD(a, 'Hej', 'ej', 'Heja', 'hej', 'foo')); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(30) DEFAULT NULL, + `b` int(11) DEFAULT FIELD(a, 'Hej', 'ej', 'Heja', 'hej', 'foo') +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES ('ej'); +SELECT * FROM t1; +a b +ej 2 +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(30), b INT DEFAULT FIND_IN_SET(a, 'Hej,ej,Heja,hej,foo')); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(30) DEFAULT NULL, + `b` int(11) DEFAULT FIND_IN_SET(a, 'Hej,ej,Heja,hej,foo') +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES ('ej'); +SELECT * FROM t1; +a b +ej 2 +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(30), b INT DEFAULT ASCII(a), c INT DEFAULT ORD(a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(30) DEFAULT NULL, + `b` int(11) DEFAULT ASCII(a), + `c` int(11) DEFAULT ORD(a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES ('a'); +SELECT * FROM t1; +a b c +a 97 97 +DROP TABLE t1; +CREATE TABLE t1 (a TEXT DEFAULT UUID_SHORT()); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` text DEFAULT UUID_SHORT() +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (); +SELECT a>0 FROM t1; +a>0 +1 +DROP TABLE t1; +CREATE TABLE t1 (a INT DEFAULT BENCHMARK(1,1)); +ERROR HY000: Function or expression 'benchmark()' cannot be used in the DEFAULT clause of `a` +CREATE TABLE t1 (a INT DEFAULT GET_LOCK('a',1)); +ERROR HY000: Function or expression 'get_lock()' cannot be used in the DEFAULT clause of `a` +CREATE TABLE t1 (a INT DEFAULT RELEASE_LOCK('a')); +ERROR HY000: Function or expression 'release_lock()' cannot be used in the DEFAULT clause of `a` +CREATE TABLE t1 (a INT DEFAULT IS_USED_LOCK('a')); +ERROR HY000: Function or expression 'is_used_lock()' cannot be used in the DEFAULT clause of `a` +CREATE TABLE t1 (a INT DEFAULT IS_FREE_LOCK('a')); +ERROR HY000: Function or expression 'is_free_lock()' cannot be used in the DEFAULT clause of `a` +CREATE TABLE t1 (a INT DEFAULT SLEEP(1)); +ERROR HY000: Function or expression 'sleep()' cannot be used in the DEFAULT clause of `a` +CREATE TABLE t1 (a INT DEFAULT ROW_COUNT()); +ERROR HY000: Function or expression 'row_count()' cannot be used in the DEFAULT clause of `a` +CREATE TABLE t1 (a INT DEFAULT FOUND_ROWS()); +ERROR HY000: Function or expression 'found_rows()' cannot be used in the DEFAULT clause of `a` +CREATE TABLE t1 (a INT DEFAULT MASTER_POS_WAIT('test',100)); +ERROR HY000: Function or expression 'master_pos_wait()' cannot be used in the DEFAULT clause of `a` +CREATE TABLE t1 (a INT DEFAULT MASTER_GTID_WAIT('test')); +ERROR HY000: Function or expression 'master_gtid_wait()' cannot be used in the DEFAULT clause of `a` +CREATE TABLE t1 (a VARCHAR(30), b DOUBLE DEFAULT MATCH (a) AGAINST('bbbb' IN BOOLEAN MODE)); +ERROR HY000: Function or expression 'match ... against()' cannot be used in the DEFAULT clause of `b` +# +# Temporal functions +# +# Item_temporal_hybrid_func +CREATE TABLE t1 (a DATE, b INT, c DATE DEFAULT DATE_ADD(a, INTERVAL b DAY)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` date DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` date DEFAULT (DATE_ADD(a, INTERVAL b DAY)) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES ('2001-01-01', 30, DEFAULT); +SELECT * FROM t1; +a b c +2001-01-01 30 2001-01-31 +DROP TABLE t1; +CREATE TABLE t1 (a DATE, b TIME, c DATETIME DEFAULT ADDTIME(a, b)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` date DEFAULT NULL, + `b` time DEFAULT NULL, + `c` datetime DEFAULT ADDTIME(a, b) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES ('2001-01-01', '10:20:30', DEFAULT); +SELECT * FROM t1; +a b c +2001-01-01 10:20:30 2001-01-01 10:20:30 +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(32), b VARCHAR(32), c DATE DEFAULT STR_TO_DATE(a,b)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(32) DEFAULT NULL, + `b` varchar(32) DEFAULT NULL, + `c` date DEFAULT STR_TO_DATE(a,b) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES ('01,5,2013','%d,%m,%Y', DEFAULT); +SELECT * FROM t1; +a b c +01,5,2013 %d,%m,%Y 2013-05-01 +DROP TABLE t1; +# Item_datefunc +SET time_zone='-10:00'; +SET timestamp=UNIX_TIMESTAMP('2001-01-01 23:59:59'); +CREATE TABLE t1 (a DATE DEFAULT CURDATE(), b DATE DEFAULT UTC_DATE()); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` date DEFAULT CURDATE(), + `b` date DEFAULT UTC_DATE() +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (); +SELECT * FROM t1; +a b +2001-01-01 2001-01-02 +DROP TABLE t1; +SET time_zone=DEFAULT, timestamp= DEFAULT; +CREATE TABLE t1 (a INT, b DATE DEFAULT FROM_DAYS(a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` date DEFAULT FROM_DAYS(a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (730669, DEFAULT); +SELECT * FROM t1; +a b +730669 2000-07-03 +DROP TABLE t1; +CREATE TABLE t1 (a DATE, b DATE DEFAULT LAST_DAY(a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` date DEFAULT NULL, + `b` date DEFAULT LAST_DAY(a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES ('2003-02-05', DEFAULT); +SELECT * FROM t1; +a b +2003-02-05 2003-02-28 +DROP TABLE t1; +CREATE TABLE t1 (yy INT, yd INT, d DATE DEFAULT MAKEDATE(yy, yd)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `yy` int(11) DEFAULT NULL, + `yd` int(11) DEFAULT NULL, + `d` date DEFAULT MAKEDATE(yy, yd) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (2011,32,DEFAULT); +SELECT * FROM t1; +yy yd d +2011 32 2011-02-01 +DROP TABLE t1; +# Item_timefunc +SET time_zone='-10:00'; +SET timestamp=UNIX_TIMESTAMP('2001-01-01 23:59:59'); +CREATE TABLE t1 (a TIME DEFAULT CURTIME(), b TIME DEFAULT UTC_TIME()); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` time DEFAULT CURTIME(), + `b` time DEFAULT UTC_TIME() +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (); +SELECT * FROM t1; +a b +23:59:59 09:59:59 +DROP TABLE t1; +SET time_zone=DEFAULT, timestamp= DEFAULT; +CREATE TABLE t1 (a INT, b TIME DEFAULT SEC_TO_TIME(a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` time DEFAULT SEC_TO_TIME(a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (2378, DEFAULT); +SELECT * FROM t1; +a b +2378 00:39:38 +DROP TABLE t1; +CREATE TABLE t1 (a DATETIME, b DATETIME, c TIME DEFAULT TIMEDIFF(a,b)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` datetime DEFAULT NULL, + `c` time DEFAULT TIMEDIFF(a,b) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES ('2000:01:01 00:00:00', '2000:01:02 10:20:30', DEFAULT); +SELECT * FROM t1; +a b c +2000-01-01 00:00:00 2000-01-02 10:20:30 -34:20:30 +DROP TABLE t1; +CREATE TABLE t1 (hh INT, mm INT, ss INT, t TIME DEFAULT MAKETIME(hh,mm,ss)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `hh` int(11) DEFAULT NULL, + `mm` int(11) DEFAULT NULL, + `ss` int(11) DEFAULT NULL, + `t` time DEFAULT MAKETIME(hh,mm,ss) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (10,20,30,DEFAULT); +SELECT * FROM t1; +hh mm ss t +10 20 30 10:20:30 +DROP TABLE t1; +# Item_datetimefunc +SET time_zone='-10:00'; +SET timestamp=UNIX_TIMESTAMP('2001-01-01 23:59:59'); +CREATE TABLE t1 (a TIMESTAMP DEFAULT NOW(), b TIMESTAMP DEFAULT UTC_TIMESTAMP()); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `b` timestamp NOT NULL DEFAULT UTC_TIMESTAMP() +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (); +SELECT * FROM t1; +a b +2001-01-01 23:59:59 2001-01-02 09:59:59 +DROP TABLE t1; +SET time_zone=DEFAULT, timestamp= DEFAULT; +CREATE TABLE t1 (a TIMESTAMP(6) DEFAULT SYSDATE(6), s INT, b TIMESTAMP(6) DEFAULT SYSDATE(6)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` timestamp(6) NOT NULL DEFAULT SYSDATE(6), + `s` int(11) DEFAULT NULL, + `b` timestamp(6) NOT NULL DEFAULT SYSDATE(6) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (DEFAULT, SLEEP(0.1), DEFAULT); +SELECT b>a FROM t1; +b>a +1 +DROP TABLE t1; +SET time_zone='+00:00'; +CREATE TABLE t1 (a INT, b TIMESTAMP DEFAULT FROM_UNIXTIME(a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` timestamp NOT NULL DEFAULT FROM_UNIXTIME(a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (1447430881, DEFAULT); +SELECT * FROM t1; +a b +1447430881 2015-11-13 16:08:01 +DROP TABLE t1; +SET time_zone=DEFAULT; +CREATE TABLE t1 (a TIMESTAMP, b TIMESTAMP DEFAULT CONVERT_TZ(a, '-10:00', '+10:00')); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `b` timestamp NOT NULL DEFAULT CONVERT_TZ(a, '-10:00', '+10:00') +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES ('2001-01-01 10:20:30', DEFAULT); +SELECT * FROM t1; +a b +2001-01-01 10:20:30 2001-01-02 06:20:30 +DROP TABLE t1; +# Item_temporal_typecast +CREATE TABLE t1 (a INT, b DATE DEFAULT CAST(a AS DATE)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` date DEFAULT CAST(a AS DATE) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (20010203, DEFAULT); +SELECT * FROM t1; +a b +20010203 2001-02-03 +DROP TABLE t1; +CREATE TABLE t1 (a INT, b TIME DEFAULT CAST(a AS TIME)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` time DEFAULT CAST(a AS TIME) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (102030, DEFAULT); +SELECT * FROM t1; +a b +102030 10:20:30 +DROP TABLE t1; +CREATE TABLE t1 (a BIGINT, b DATETIME DEFAULT CAST(a AS DATETIME)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` bigint(20) DEFAULT NULL, + `b` datetime DEFAULT CAST(a AS DATETIME) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (20010203102030, DEFAULT); +SELECT * FROM t1; +a b +20010203102030 2001-02-03 10:20:30 +DROP TABLE t1; +# +# Functions with temporal input +# +CREATE TABLE t1 (a INT, b INT, c INT DEFAULT PERIOD_ADD(a,b)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT PERIOD_ADD(a,b) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a,b) VALUES (200801, 2); +SELECT * FROM t1; +a b c +200801 2 200803 +DROP TABLE t1; +CREATE TABLE t1 (a INT, b INT, c INT DEFAULT PERIOD_DIFF(a,b)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT PERIOD_DIFF(a,b) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a,b) VALUES (200802, 200703); +SELECT * FROM t1; +a b c +200802 200703 11 +DROP TABLE t1; +CREATE TABLE t1 (a INT, b INT DEFAULT TO_DAYS(a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT TO_DAYS(a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES (950501); +SELECT * FROM t1; +a b +950501 728779 +DROP TABLE t1; +CREATE TABLE t1 (a DATE, b INT DEFAULT TO_DAYS(a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` date DEFAULT NULL, + `b` int(11) DEFAULT TO_DAYS(a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES ('2007-10-07'); +SELECT * FROM t1; +a b +2007-10-07 733321 +DROP TABLE t1; +CREATE TABLE t1 (a INT, b BIGINT DEFAULT TO_SECONDS(a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` bigint(20) DEFAULT TO_SECONDS(a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES (950501); +SELECT * FROM t1; +a b +950501 62966505600 +DROP TABLE t1; +CREATE TABLE t1 (a DATE, b BIGINT DEFAULT TO_SECONDS(a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` date DEFAULT NULL, + `b` bigint(20) DEFAULT TO_SECONDS(a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES ('2009-11-29'); +SELECT * FROM t1; +a b +2009-11-29 63426672000 +DROP TABLE t1; +CREATE TABLE t1 (a DATETIME, b BIGINT DEFAULT TO_SECONDS(a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` bigint(20) DEFAULT TO_SECONDS(a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES ('2009-11-29 13:43:32'); +SELECT * FROM t1; +a b +2009-11-29 13:43:32 63426721412 +DROP TABLE t1; +CREATE TABLE t1 (a DATE, b BIGINT DEFAULT DAYOFMONTH(a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` date DEFAULT NULL, + `b` bigint(20) DEFAULT DAYOFMONTH(a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES ('2007-02-03'); +SELECT * FROM t1; +a b +2007-02-03 3 +DROP TABLE t1; +CREATE TABLE t1 (a DATE, b BIGINT DEFAULT DAYOFWEEK(a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` date DEFAULT NULL, + `b` bigint(20) DEFAULT DAYOFWEEK(a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES ('2007-02-03'); +SELECT * FROM t1; +a b +2007-02-03 7 +DROP TABLE t1; +CREATE TABLE t1 (a DATE, b BIGINT DEFAULT DAYOFYEAR(a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` date DEFAULT NULL, + `b` bigint(20) DEFAULT DAYOFYEAR(a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES ('2007-02-03'); +SELECT * FROM t1; +a b +2007-02-03 34 +DROP TABLE t1; +CREATE TABLE t1 (a TIME, b INT DEFAULT HOUR(a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` time DEFAULT NULL, + `b` int(11) DEFAULT HOUR(a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES ('10:05:03'); +SELECT * FROM t1; +a b +10:05:03 10 +DROP TABLE t1; +CREATE TABLE t1 (a TIME, b INT DEFAULT MINUTE(a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` time DEFAULT NULL, + `b` int(11) DEFAULT MINUTE(a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES ('10:05:03'); +SELECT * FROM t1; +a b +10:05:03 5 +DROP TABLE t1; +CREATE TABLE t1 (a TIME, b INT DEFAULT SECOND(a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` time DEFAULT NULL, + `b` int(11) DEFAULT SECOND(a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES ('10:05:03'); +SELECT * FROM t1; +a b +10:05:03 3 +DROP TABLE t1; +CREATE TABLE t1 (a DATETIME(6), b INT DEFAULT MICROSECOND(a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime(6) DEFAULT NULL, + `b` int(11) DEFAULT MICROSECOND(a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES ('2009-12-31 23:59:59.000010'); +SELECT * FROM t1; +a b +2009-12-31 23:59:59.000010 10 +DROP TABLE t1; +CREATE TABLE t1 (a DATE, b INT DEFAULT YEAR(a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` date DEFAULT NULL, + `b` int(11) DEFAULT YEAR(a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES ('1987-01-01'); +SELECT * FROM t1; +a b +1987-01-01 1987 +DROP TABLE t1; +CREATE TABLE t1 (a DATE, b INT DEFAULT MONTH(a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` date DEFAULT NULL, + `b` int(11) DEFAULT MONTH(a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES ('1987-01-01'); +SELECT * FROM t1; +a b +1987-01-01 1 +DROP TABLE t1; +CREATE TABLE t1 (a DATE, b INT DEFAULT WEEK(a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` date DEFAULT NULL, + `b` int(11) DEFAULT WEEK(a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES ('1987-02-01'); +SELECT * FROM t1; +a b +1987-02-01 5 +DROP TABLE t1; +CREATE TABLE t1 (a DATE, b INT DEFAULT YEARWEEK(a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` date DEFAULT NULL, + `b` int(11) DEFAULT YEARWEEK(a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES ('2000-01-01'); +SELECT * FROM t1; +a b +2000-01-01 199952 +DROP TABLE t1; +CREATE TABLE t1 (a DATE, b INT DEFAULT QUARTER(a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` date DEFAULT NULL, + `b` int(11) DEFAULT QUARTER(a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES ('2008-04-01'); +SELECT * FROM t1; +a b +2008-04-01 2 +DROP TABLE t1; +CREATE TABLE t1 (a DATE, b INT DEFAULT EXTRACT(YEAR FROM a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` date DEFAULT NULL, + `b` int(11) DEFAULT EXTRACT(YEAR FROM a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES ('2009-07-02'); +SELECT * FROM t1; +a b +2009-07-02 2009 +DROP TABLE t1; +CREATE TABLE t1 (a DATETIME, b INT DEFAULT EXTRACT(YEAR_MONTH FROM a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` int(11) DEFAULT EXTRACT(YEAR_MONTH FROM a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES ('2009-07-02 01:02:03'); +SELECT * FROM t1; +a b +2009-07-02 01:02:03 200907 +DROP TABLE t1; +CREATE TABLE t1 (a DATETIME, b INT DEFAULT EXTRACT(DAY_MINUTE FROM a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` int(11) DEFAULT EXTRACT(DAY_MINUTE FROM a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES ('2009-07-02 01:02:03'); +SELECT * FROM t1; +a b +2009-07-02 01:02:03 20102 +DROP TABLE t1; +CREATE TABLE t1 (a DATETIME(6), b INT DEFAULT EXTRACT(MICROSECOND FROM a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime(6) DEFAULT NULL, + `b` int(11) DEFAULT EXTRACT(MICROSECOND FROM a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES ('2009-07-02 01:02:03.000123'); +SELECT * FROM t1; +a b +2009-07-02 01:02:03.000123 123 +DROP TABLE t1; +CREATE TABLE t1 (a DATE, b DATE, c INT DEFAULT TIMESTAMPDIFF(MONTH,a,b)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` date DEFAULT NULL, + `b` date DEFAULT NULL, + `c` int(11) DEFAULT TIMESTAMPDIFF(MONTH,a,b) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a,b) VALUES ('2003-02-01','2003-05-01'); +SELECT * FROM t1; +a b c +2003-02-01 2003-05-01 3 +DROP TABLE t1; +CREATE TABLE t1 (a DATE, b DATE, c INT DEFAULT TIMESTAMPDIFF(YEAR,a,b)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` date DEFAULT NULL, + `b` date DEFAULT NULL, + `c` int(11) DEFAULT TIMESTAMPDIFF(YEAR,a,b) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a,b) VALUES ('2002-05-01','2001-01-01'); +SELECT * FROM t1; +a b c +2002-05-01 2001-01-01 -1 +DROP TABLE t1; +CREATE TABLE t1 (a DATE, b DATETIME, c INT DEFAULT TIMESTAMPDIFF(MINUTE,a,b)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` date DEFAULT NULL, + `b` datetime DEFAULT NULL, + `c` int(11) DEFAULT TIMESTAMPDIFF(MINUTE,a,b) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a,b) VALUES ('2003-02-01','2003-05-01 12:05:55'); +SELECT * FROM t1; +a b c +2003-02-01 2003-05-01 12:05:55 128885 +DROP TABLE t1; +# +# Hybrid type functions +# +CREATE TABLE t1 (a INT, b INT, c INT DEFAULT COALESCE(a,b)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT COALESCE(a,b) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (NULL, 1, DEFAULT); +SELECT * FROM t1; +a b c +NULL 1 1 +DROP TABLE t1; +CREATE TABLE t1 (a INT, b INT, c INT DEFAULT IFNULL(a,b)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT IFNULL(a,b) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (NULL, 2, DEFAULT); +INSERT INTO t1 VALUES (1, 2, DEFAULT); +SELECT * FROM t1; +a b c +NULL 2 2 +1 2 1 +DROP TABLE t1; +CREATE TABLE t1 (a INT, b INT, c INT DEFAULT NULLIF(a,b)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULLIF(a,b) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (1, 1, DEFAULT); +INSERT INTO t1 VALUES (1, 2, DEFAULT); +SELECT * FROM t1; +a b c +1 1 NULL +1 2 1 +DROP TABLE t1; +CREATE TABLE t1 (a INT, b INT, c INT DEFAULT IF(a,b,2)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT IF(a,b,2) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (0, 1, DEFAULT); +INSERT INTO t1 VALUES (1, 1, DEFAULT); +SELECT * FROM t1; +a b c +0 1 2 +1 1 1 +DROP TABLE t1; +CREATE TABLE t1 (a INT, b INT, c INT DEFAULT CASE WHEN a THEN b ELSE 2 END); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT (CASE WHEN a THEN b ELSE 2 END) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (0, 1, DEFAULT); +INSERT INTO t1 VALUES (1, 1, DEFAULT); +SELECT * FROM t1; +a b c +0 1 2 +1 1 1 +DROP TABLE t1; +CREATE TABLE t1 (a INT, b INT DEFAULT (-a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT (-a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT (-a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (10, DEFAULT); +SELECT * FROM t1; +a b +10 -10 +DROP TABLE t1; +CREATE TABLE t1 (a INT, b INT DEFAULT ABS(a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT ABS(a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (-10, DEFAULT); +SELECT * FROM t1; +a b +-10 10 +DROP TABLE t1; +CREATE TABLE t1 (a DOUBLE, b INT DEFAULT CEILING(a), c INT DEFAULT FLOOR(a), d INT DEFAULT ROUND(a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double DEFAULT NULL, + `b` int(11) DEFAULT CEILING(a), + `c` int(11) DEFAULT FLOOR(a), + `d` int(11) DEFAULT ROUND(a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (1.5, DEFAULT, DEFAULT, DEFAULT); +INSERT INTO t1 VALUES (-1.5, DEFAULT, DEFAULT, DEFAULT); +SELECT * FROM t1; +a b c d +1.5 2 1 2 +-1.5 -1 -2 -2 +DROP TABLE t1; +CREATE TABLE t1 (a INT, b INT, c INT DEFAULT (a+b), d INT DEFAULT (a-b)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT (a+b), + `d` int(11) DEFAULT (a-b) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (2, 1, DEFAULT, DEFAULT); +SELECT * FROM t1; +a b c d +2 1 3 1 +DROP TABLE t1; +CREATE TABLE t1 (a INT, b INT, c INT DEFAULT (a*b), d INT DEFAULT (a/b), e INT DEFAULT (a MOD b)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT (a*b), + `d` int(11) DEFAULT (a/b), + `e` int(11) DEFAULT (a MOD b) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT (a*b), + `d` int(11) DEFAULT (a/b), + `e` int(11) DEFAULT (a MOD b) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (7, 3, DEFAULT, DEFAULT, DEFAULT); +SELECT * FROM t1; +a b c d e +7 3 21 2 1 +DROP TABLE t1; +SET time_zone='+00:00'; +CREATE TABLE t1 (a DATETIME, b INT DEFAULT UNIX_TIMESTAMP(a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` int(11) DEFAULT UNIX_TIMESTAMP(a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES ('2001-01-01 10:20:30', DEFAULT); +SELECT * FROM t1; +a b +2001-01-01 10:20:30 978344430 +DROP TABLE t1; +SET time_zone=DEFAULT; +CREATE TABLE t1 (a TIME, b INT DEFAULT TIME_TO_SEC(a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` time DEFAULT NULL, + `b` int(11) DEFAULT TIME_TO_SEC(a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES ('22:23:00', DEFAULT); +SELECT * FROM t1; +a b +22:23:00 80580 +DROP TABLE t1; +CREATE TABLE t1 (a INT, b INT, c INT DEFAULT LEAST(a,b), d INT DEFAULT GREATEST(a,b)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT LEAST(a,b), + `d` int(11) DEFAULT GREATEST(a,b) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (0, 1, DEFAULT, DEFAULT); +INSERT INTO t1 VALUES (1, 1, DEFAULT, DEFAULT); +SELECT * FROM t1; +a b c d +0 1 0 1 +1 1 1 1 +DROP TABLE t1; +CREATE TABLE t1 (a INT, b INT, c INT DEFAULT LAST_VALUE(a,b)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT LAST_VALUE(a,b) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (1, 2, DEFAULT); +SELECT * FROM t1; +a b c +1 2 2 +DROP TABLE t1; +# +# CAST +# +CREATE TABLE t1 (a VARCHAR(30), b DECIMAL(10,6) DEFAULT CAST(a AS DECIMAL(10,1))); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(30) DEFAULT NULL, + `b` decimal(10,6) DEFAULT (CAST(a AS DECIMAL(10,1))) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES ('123.456'); +SELECT * FROM t1; +a b +123.456 123.500000 +DROP TABLE t1; +CREATE TABLE t1 (a DECIMAL(10,3), +b VARCHAR(10) DEFAULT CAST(a AS CHAR(10)), +c VARCHAR(10) DEFAULT CAST(a AS CHAR(4))); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` decimal(10,3) DEFAULT NULL, + `b` varchar(10) DEFAULT (CAST(a AS CHAR(10))), + `c` varchar(10) DEFAULT (CAST(a AS CHAR(4))) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES (123.456); +Warnings: +Warning 1292 Truncated incorrect CHAR(4) value: '123.456' +SELECT * FROM t1; +a b c +123.456 123.456 123. +DROP TABLE t1; +CREATE TABLE t1 (a INT, b INT UNSIGNED DEFAULT CAST(a AS UNSIGNED)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(10) unsigned DEFAULT (CAST(a AS UNSIGNED)) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES (-1); +Warnings: +Note 1105 Cast to unsigned converted negative integer to it's positive complement +Warning 1264 Out of range value for column 'b' at row 1 +SELECT * FROM t1; +a b +-1 4294967295 +DROP TABLE t1; +CREATE TABLE t1 (a BIGINT UNSIGNED, b BIGINT SIGNED DEFAULT CAST(a AS SIGNED)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` bigint(20) unsigned DEFAULT NULL, + `b` bigint(20) DEFAULT (CAST(a AS SIGNED)) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES (0xFFFFFFFFFFFFFFFF); +SELECT * FROM t1; +a b +18446744073709551615 -1 +DROP TABLE t1; +CREATE TABLE t1 ( +a VARCHAR(10) CHARACTER SET latin1, +b VARCHAR(10) CHARACTER SET latin1 DEFAULT a COLLATE latin1_bin, +c VARCHAR(10) CHARACTER SET utf8 DEFAULT CONVERT(a USING utf8), +d VARBINARY(10) DEFAULT (BINARY(a)) +); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT a, + `c` varchar(10) CHARACTER SET utf8 DEFAULT CONVERT(a USING utf8), + `d` varbinary(10) DEFAULT (BINARY(a)) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES ('a'); +SELECT * FROM t1; +a b c d +a a a a +DROP TABLE t1; +# +# Bit functions +# +CREATE TABLE t1 (a INT, b INT DEFAULT BIT_COUNT(a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT BIT_COUNT(a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES (7); +SELECT * FROM t1; +a b +7 3 +DROP TABLE t1; +CREATE TABLE t1 (a INT, b INT, c INT DEFAULT (a|b)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT (a|b) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a,b) VALUES (1,2); +SELECT * FROM t1; +a b c +1 2 3 +DROP TABLE t1; +CREATE TABLE t1 (a INT, b INT, c INT DEFAULT (a&b)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT (a&b) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a,b) VALUES (5,4); +SELECT * FROM t1; +a b c +5 4 4 +DROP TABLE t1; +CREATE TABLE t1 (a INT, b INT, c INT DEFAULT (a^b)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT (a^b) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a,b) VALUES (11,3); +SELECT * FROM t1; +a b c +11 3 8 +DROP TABLE t1; +CREATE TABLE t1 (a INT, b INT, c INT DEFAULT (a&~b)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT (a&~b) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a,b) VALUES (5,1); +SELECT * FROM t1; +a b c +5 1 4 +DROP TABLE t1; +CREATE TABLE t1 (a INT, b INT, c INT DEFAULT (a<>b)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT (a<>b) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a,b) VALUES (5,1); +SELECT * FROM t1; +a b c d +5 1 10 2 +DROP TABLE t1; +# +# String functions +# +CREATE TABLE t1 (a VARCHAR(10), b VARCHAR(20) DEFAULT REVERSE(a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(20) DEFAULT REVERSE(a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES ('abcd'); +SELECT * FROM t1; +a b +abcd dcba +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10), b VARCHAR(10) DEFAULT UPPER(a), c VARCHAR(10) DEFAULT LOWER(a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) DEFAULT UPPER(a), + `c` varchar(10) DEFAULT LOWER(a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES ('ABcd'); +SELECT * FROM t1; +a b c +ABcd ABCD abcd +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10), b VARCHAR(10) DEFAULT LEFT(a,1), c VARCHAR(10) DEFAULT RIGHT(a,1), d VARCHAR(10) DEFAULT SUBSTR(a,2,2)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) DEFAULT LEFT(a,1), + `c` varchar(10) DEFAULT RIGHT(a,1), + `d` varchar(10) DEFAULT SUBSTR(a,2,2) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES ('abcd'); +SELECT * FROM t1; +a b c d +abcd a d bc +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(20), b VARCHAR(20) DEFAULT SUBSTRING_INDEX(a,'.',2)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(20) DEFAULT NULL, + `b` varchar(20) DEFAULT SUBSTRING_INDEX(a,'.',2) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES ('www.mariadb.org'); +SELECT * FROM t1; +a b +www.mariadb.org www.mariadb +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10), b VARCHAR(10), c VARCHAR(20) DEFAULT CONCAT(a,b)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) DEFAULT NULL, + `c` varchar(20) DEFAULT CONCAT(a,b) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a,b) VALUES ('a','b'); +SELECT * FROM t1; +a b c +a b ab +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10), b VARCHAR(10), c VARCHAR(20) DEFAULT CONCAT_WS(',',a,b)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) DEFAULT NULL, + `c` varchar(20) DEFAULT CONCAT_WS(',',a,b) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a,b) VALUES ('a','b'); +SELECT * FROM t1; +a b c +a b a,b +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10), b VARCHAR(10) DEFAULT REPLACE(a,'a','A')); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) DEFAULT REPLACE(a,'a','A') +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES ('abc'); +SELECT * FROM t1; +a b +abc Abc +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10), b VARCHAR(10) DEFAULT REGEXP_REPLACE(a,'[0-9]','.')); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) DEFAULT REGEXP_REPLACE(a,'[0-9]','.') +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES ('a1b2c'); +SELECT * FROM t1; +a b +a1b2c a.b.c +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10), b VARCHAR(10) DEFAULT REGEXP_SUBSTR(a,'[0-9]+')); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) DEFAULT REGEXP_SUBSTR(a,'[0-9]+') +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES ('ab12cd'); +SELECT * FROM t1; +a b +ab12cd 12 +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(20), b VARCHAR(20) DEFAULT SOUNDEX(a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(20) DEFAULT NULL, + `b` varchar(20) DEFAULT SOUNDEX(a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES ('tester'); +SELECT * FROM t1; +a b +tester T236 +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(20), b VARCHAR(20) DEFAULT QUOTE(a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(20) DEFAULT NULL, + `b` varchar(20) DEFAULT QUOTE(a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES ('a\'b'); +SELECT * FROM t1; +a b +a'b 'a\'b' +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10), b VARCHAR(10) DEFAULT LPAD(a,10,'.'), c VARCHAR(10) DEFAULT RPAD(a,10,'.')); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) DEFAULT LPAD(a,10,'.'), + `c` varchar(10) DEFAULT RPAD(a,10,'.') +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES ('ab'); +SELECT * FROM t1; +a b c +ab ........ab ab........ +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10), b VARCHAR(10) DEFAULT LTRIM(a), c VARCHAR(10) DEFAULT RTRIM(a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) DEFAULT LTRIM(a), + `c` varchar(10) DEFAULT RTRIM(a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES (' ab '); +SELECT a, HEX(b), HEX(c) FROM t1; +a HEX(b) HEX(c) + ab 616220 206162 +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10), b VARCHAR(10) DEFAULT TRIM(BOTH 'a' FROM a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) DEFAULT TRIM(BOTH 'a' FROM a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES ('abba'); +SELECT a, b FROM t1; +a b +abba bb +DROP TABLE t1; +CREATE TABLE t1 (a INT, b VARCHAR(10) DEFAULT SPACE(a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` varchar(10) DEFAULT SPACE(a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES (3); +SELECT a, HEX(b) FROM t1; +a HEX(b) +3 202020 +DROP TABLE t1; +CREATE TABLE t1 (a INT, b VARCHAR(10), c VARCHAR(10) DEFAULT REPEAT(b,a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` varchar(10) DEFAULT NULL, + `c` varchar(10) DEFAULT REPEAT(b,a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a,b) VALUES (3,'x'); +SELECT a, b, c FROM t1; +a b c +3 x xxx +DROP TABLE t1; +CREATE TABLE t1 (str VARCHAR(10), pos INT, len INT, newstr VARCHAR(10), result VARCHAR(10) DEFAULT INSERT(str,pos,len,newstr)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `str` varchar(10) DEFAULT NULL, + `pos` int(11) DEFAULT NULL, + `len` int(11) DEFAULT NULL, + `newstr` varchar(10) DEFAULT NULL, + `result` varchar(10) DEFAULT INSERT(str,pos,len,newstr) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (str,pos,len,newstr) VALUES ('Quadratic', 3, 4, 'What'); +SELECT * FROM t1; +str pos len newstr result +Quadratic 3 4 What QuWhattic +DROP TABLE t1; +CREATE TABLE t1 (n INT, res VARCHAR(10) DEFAULT ELT(n,'ej', 'Heja', 'hej', 'foo')); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `n` int(11) DEFAULT NULL, + `res` varchar(10) DEFAULT ELT(n,'ej', 'Heja', 'hej', 'foo') +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (n) VALUES (1); +SELECT * FROM t1; +n res +1 ej +DROP TABLE t1; +CREATE TABLE t1 (bits INT, res VARCHAR(10) DEFAULT MAKE_SET(bits,'a','b','c','d')); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `bits` int(11) DEFAULT NULL, + `res` varchar(10) DEFAULT MAKE_SET(bits,'a','b','c','d') +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (bits) VALUES (1|4); +SELECT * FROM t1; +bits res +5 a,c +DROP TABLE t1; +CREATE TABLE t1 (a INT, b VARCHAR(10) DEFAULT CHAR(a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` varchar(10) DEFAULT CHAR(a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES (77); +SELECT * FROM t1; +a b +77 M +DROP TABLE t1; +CREATE TABLE t1 (a INT, b VARCHAR(10) DEFAULT CONV(a,10,16)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` varchar(10) DEFAULT CONV(a,10,16) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES (64); +SELECT * FROM t1; +a b +64 40 +DROP TABLE t1; +CREATE TABLE t1 (a INT, b INT, c VARCHAR(30) DEFAULT FORMAT(a,b)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` varchar(30) DEFAULT FORMAT(a,b) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a,b) VALUES (10000,3); +SELECT * FROM t1; +a b c +10000 3 10,000.000 +DROP TABLE t1; +CREATE TABLE t1 (a INT, b INT, l VARCHAR(10), c VARCHAR(30) DEFAULT FORMAT(a,b,l)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `l` varchar(10) DEFAULT NULL, + `c` varchar(30) DEFAULT FORMAT(a,b,l) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a,b,l) VALUES (10000,2,'no_NO'),(10000,2,'ru_RU'),(10000,2,'ar_BH'); +SELECT * FROM t1; +a b l c +10000 2 no_NO 10.000,00 +10000 2 ru_RU 10 000,00 +10000 2 ar_BH 10,000.00 +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10), b VARCHAR(20) DEFAULT GET_FORMAT(DATE,a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(20) DEFAULT GET_FORMAT(DATE,a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES ('EUR'),('USA'),('JIS'),('ISO'),('INTERNAL'); +SELECT * FROM t1; +a b +EUR %d.%m.%Y +USA %m.%d.%Y +JIS %Y-%m-%d +ISO %Y-%m-%d +INTERNAL %Y%m%d +DROP TABLE t1; +CREATE TABLE t1 ( +bits INT, +v_on VARCHAR(10), +v_off VARCHAR(10), +v_separator VARCHAR(10), +number_of_bits INT, +x VARCHAR(30) DEFAULT EXPORT_SET(bits, v_on, v_off, v_separator, number_of_bits) +); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `bits` int(11) DEFAULT NULL, + `v_on` varchar(10) DEFAULT NULL, + `v_off` varchar(10) DEFAULT NULL, + `v_separator` varchar(10) DEFAULT NULL, + `number_of_bits` int(11) DEFAULT NULL, + `x` varchar(30) DEFAULT EXPORT_SET(bits, v_on, v_off, v_separator, number_of_bits) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (0x50006,'Y','N','',64,DEFAULT); +Warnings: +Warning 1265 Data truncated for column 'x' at row 1 +SELECT * FROM t1; +bits v_on v_off v_separator number_of_bits x +327686 Y N 64 NYYNNNNNNNNNNNNNYNYNNNNNNNNNNN +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(30), b BLOB DEFAULT LOAD_FILE(a)); +ERROR HY000: Function or expression 'load_file()' cannot be used in the DEFAULT clause of `b` +# +# Predicates +# +CREATE TABLE t1 (a INT, b INT DEFAULT (NOT a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT (NOT a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES (NULL),(0),(1); +SELECT * FROM t1; +a b +NULL NULL +0 1 +1 0 +DROP TABLE t1; +CREATE TABLE t1 (a INT, b INT, x INT DEFAULT (a XOR b)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `x` int(11) DEFAULT (a XOR b) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a,b) VALUES (0,0),(0,1),(1,0),(1,1); +SELECT * FROM t1; +a b x +0 0 0 +0 1 1 +1 0 1 +1 1 0 +DROP TABLE t1; +CREATE TABLE t1 (a INT, b INT DEFAULT (a IS TRUE), c INT DEFAULT (a IS NOT TRUE)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT (a IS TRUE), + `c` int(11) DEFAULT (a IS NOT TRUE) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES (NULL),(0),(1); +SELECT * FROM t1; +a b c +NULL 0 1 +0 0 1 +1 1 0 +DROP TABLE t1; +CREATE TABLE t1 (a INT, b INT DEFAULT (a IS FALSE), c INT DEFAULT (a IS NOT FALSE)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT (a IS FALSE), + `c` int(11) DEFAULT (a IS NOT FALSE) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES (NULL),(0),(1); +SELECT * FROM t1; +a b c +NULL 0 1 +0 1 0 +1 0 1 +DROP TABLE t1; +CREATE TABLE t1 (a INT, b INT DEFAULT (a IS NULL), c INT DEFAULT (a IS NOT NULL)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT (a IS NULL), + `c` int(11) DEFAULT (a IS NOT NULL) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES (NULL),(0),(1); +SELECT * FROM t1; +a b c +NULL 1 0 +0 0 1 +1 0 1 +DROP TABLE t1; +CREATE TABLE t1 (a INT, b INT DEFAULT (a IS UNKNOWN), c INT DEFAULT (a IS NOT UNKNOWN)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT (a IS UNKNOWN), + `c` int(11) DEFAULT (a IS NOT UNKNOWN) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES (NULL),(0),(1); +SELECT * FROM t1; +a b c +NULL 1 0 +0 0 1 +1 0 1 +DROP TABLE t1; +CREATE TABLE t1 (a INT, +eq INT DEFAULT (a=0), equal INT DEFAULT (a<=>0), +ne INT DEFAULT (a<>0), +lt INT DEFAULT (a<0), le INT DEFAULT (a<=0), +gt INT DEFAULT (a>0), ge INT DEFAULT (a>=0)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `eq` int(11) DEFAULT (a=0), + `equal` int(11) DEFAULT (a<=>0), + `ne` int(11) DEFAULT (a<>0), + `lt` int(11) DEFAULT (a<0), + `le` int(11) DEFAULT (a<=0), + `gt` int(11) DEFAULT (a>0), + `ge` int(11) DEFAULT (a>=0) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES (NULL),(-1),(0),(1); +SELECT * FROM t1; +a eq equal ne lt le gt ge +NULL NULL 0 NULL NULL NULL NULL NULL +-1 0 0 1 1 1 0 0 +0 1 1 0 0 1 0 1 +1 0 0 1 0 0 1 1 +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10), b INT DEFAULT (a LIKE 'a%')); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` int(11) DEFAULT (a LIKE 'a%') +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES ('AAA'),('aaa'),('bbb'); +SELECT * FROM t1; +a b +AAA 1 +aaa 1 +bbb 0 +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10), b INT DEFAULT (a RLIKE 'a$')); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` int(11) DEFAULT (a RLIKE 'a$') +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES ('AAA'),('aaa'),('bbb'); +SELECT * FROM t1; +a b +AAA 1 +aaa 1 +bbb 0 +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10), b INT DEFAULT (a IN ('aaa','bbb'))); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` int(11) DEFAULT (a IN ('aaa','bbb')) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES ('AAA'),('aaa'),('bbb'),('ccc'); +SELECT * FROM t1; +a b +AAA 1 +aaa 1 +bbb 1 +ccc 0 +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10), b INT DEFAULT (a NOT IN ('aaa','bbb'))); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` int(11) DEFAULT (a NOT IN ('aaa','bbb')) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES ('AAA'),('aaa'),('bbb'),('ccc'); +SELECT * FROM t1; +a b +AAA 0 +aaa 0 +bbb 0 +ccc 1 +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10), b INT DEFAULT (a BETWEEN 'aaa' AND 'bbb')); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` int(11) DEFAULT (a BETWEEN 'aaa' AND 'bbb') +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES ('AAA'),('aaa'),('bbb'),('ccc'); +SELECT * FROM t1; +a b +AAA 1 +aaa 1 +bbb 1 +ccc 0 +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10), b INT DEFAULT (a NOT BETWEEN 'aaa' AND 'bbb')); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` int(11) DEFAULT (a NOT BETWEEN 'aaa' AND 'bbb') +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES ('AAA'),('aaa'),('bbb'),('ccc'); +SELECT * FROM t1; +a b +AAA 0 +aaa 0 +bbb 0 +ccc 1 +DROP TABLE t1; +CREATE TABLE t1 (a TEXT DEFAULT UUID()); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` text DEFAULT UUID() +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (); +SELECT LENGTH(a)>0 FROM t1; +LENGTH(a)>0 +1 +DROP TABLE t1; +# +# Numeric result functions with string input +# +CREATE TABLE t1 (a VARCHAR(10), b INT DEFAULT STRCMP(a,'b')); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` int(11) DEFAULT STRCMP(a,'b') +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES ('A'),('a'),('B'),('b'),('C'),('c'); +SELECT * FROM t1; +a b +A -1 +a -1 +B 0 +b 0 +C 1 +c 1 +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10), b INT DEFAULT LENGTH(a), c INT DEFAULT CHAR_LENGTH(a), d INT DEFAULT BIT_LENGTH(a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` int(11) DEFAULT LENGTH(a), + `c` int(11) DEFAULT CHAR_LENGTH(a), + `d` int(11) DEFAULT BIT_LENGTH(a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES ('a'),('aa'),('aaa'); +SELECT * FROM t1; +a b c d +a 1 1 8 +aa 2 2 16 +aaa 3 3 24 +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10), b INT DEFAULT LOCATE('a',a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` int(11) DEFAULT LOCATE('a',a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES ('xa'),('xxa'),('xxxa'); +SELECT * FROM t1; +a b +xa 2 +xxa 3 +xxxa 4 +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10), b INT DEFAULT REGEXP_INSTR(a, 'a')); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` int(11) DEFAULT REGEXP_INSTR(a, 'a') +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES ('xa'),('xxa'),('xxxa'); +SELECT * FROM t1; +a b +xa 2 +xxa 3 +xxxa 4 +DROP TABLE t1; +# +# INT result metadata functions +# +CREATE TABLE t1 +( +id SERIAL PRIMARY KEY, +b INT DEFAULT LAST_INSERT_ID() +); +ERROR HY000: Function or expression 'last_insert_id()' cannot be used in the DEFAULT clause of `b` +CREATE TABLE t1 (a INT DEFAULT CONNECTION_ID()); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT CONNECTION_ID() +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES(); +SELECT a>0 FROM t1; +a>0 +1 +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10), b INT DEFAULT COERCIBILITY(a), c INT DEFAULT COERCIBILITY(b)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` int(11) DEFAULT COERCIBILITY(a), + `c` int(11) DEFAULT COERCIBILITY(b) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES ('test'); +SELECT * FROM t1; +a b c +test 2 5 +DROP TABLE t1; +# +# String result metadata functions +# +CREATE TABLE t1 ( +a VARCHAR(10) CHARACTER SET latin1, +b VARCHAR(20) DEFAULT CHARSET(a), +c VARCHAR(20) DEFAULT COLLATION(a) +); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(20) DEFAULT CHARSET(a), + `c` varchar(20) DEFAULT COLLATION(a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES ('test'); +SELECT * FROM t1; +a b c +test latin1 latin1_swedish_ci +DROP TABLE t1; +# +# Hash, compression, encode/decode +# +CREATE TABLE t1 (a VARCHAR(10), b BIGINT DEFAULT CRC32(a), c TEXT DEFAULT MD5(a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` bigint(20) DEFAULT CRC32(a), + `c` text DEFAULT MD5(a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES ('a'); +SELECT * FROM t1; +a b c +a 3904355907 0cc175b9c0f1b6a831c399e269772661 +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10), b TEXT DEFAULT TO_BASE64(a), c TEXT DEFAULT FROM_BASE64(b)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` text DEFAULT TO_BASE64(a), + `c` text DEFAULT FROM_BASE64(b) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES ('aaaabbbb'); +SELECT * FROM t1; +a b c +aaaabbbb YWFhYWJiYmI= aaaabbbb +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10), b TEXT DEFAULT HEX(a), c TEXT DEFAULT UNHEX(b)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` text DEFAULT HEX(a), + `c` text DEFAULT UNHEX(b) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES ('aaaabbbb'); +SELECT * FROM t1; +a b c +aaaabbbb 6161616162626262 aaaabbbb +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10), b TEXT DEFAULT ENCODE(a,'test'), c TEXT DEFAULT DECODE(b,'test')); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` text DEFAULT ENCODE(a,'test'), + `c` text DEFAULT DECODE(b,'test') +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES ('aaaabbbb'); +SELECT a, HEX(b), c FROM t1; +a HEX(b) c +aaaabbbb 059AEEE33E4AF848 aaaabbbb +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(30), b TEXT DEFAULT PASSWORD(a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(30) DEFAULT NULL, + `b` text DEFAULT PASSWORD(a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES ('notagoodpwd'); +SELECT * FROM t1; +a b +notagoodpwd *3A70EE9FC6594F88CE9E959CD51C5A1C002DC937 +DROP TABLE t1; +CREATE TABLE t1 ( +a VARCHAR(30), +b BLOB DEFAULT AES_ENCRYPT(a, 'passwd'), +c TEXT DEFAULT AES_DECRYPT(b, 'passwd') +); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(30) DEFAULT NULL, + `b` blob DEFAULT AES_ENCRYPT(a, 'passwd'), + `c` text DEFAULT AES_DECRYPT(b, 'passwd') +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES ('test'); +SELECT c FROM t1; +c +test +DROP TABLE t1; +# +# Collations +# +CREATE TABLE t1 (a VARCHAR(20) CHARACTER SET latin1 DEFAULT CONCAT('ö')) CHARACTER SET koi8r COLLATE koi8r_bin; +ERROR 22007: Encountered illegal value 'ö' when converting to koi8r +CREATE OR REPLACE TABLE t1 (a char(2) default concat('A') COLLATE utf8mb4_unicode_ci); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT concat('A') +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +create table t1 (a int default 1, b int default (rand()*0+2), c int); +insert t1 (c) values (a); +insert t1 (c) values (b); +select * from t1; +a b c +1 2 1 +1 2 NULL +drop table t1; +create table t1 (a int default 1, b int default (1+1), c int); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT 1, + `b` int(11) DEFAULT (1+1), + `c` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +alter table t1 alter a set default (2+3), alter b set default 4, +alter c set default (-a); +alter table t1 alter a set default 1+2; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '+2' at line 1 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT (2+3), + `b` int(11) DEFAULT 4, + `c` int(11) DEFAULT (-a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 (a int default 5 check (a>10), b int default (5+5), c int as (a+b)); +create table t2 as select a, b, c from t1; +create table t3 as select max(a), max(b), max(c) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT 5 CHECK (a>10), + `b` int(11) DEFAULT (5+5), + `c` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +show create table t3; +Table Create Table +t3 CREATE TABLE `t3` ( + `max(a)` int(11) DEFAULT NULL, + `max(b)` int(11) DEFAULT NULL, + `max(c)` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2, t3; diff --git a/mysql-test/r/default_session.result b/mysql-test/r/default_session.result new file mode 100644 index 00000000000..b00bf27dcf3 --- /dev/null +++ b/mysql-test/r/default_session.result @@ -0,0 +1,94 @@ +create database mysqltest1; +create user ''@localhost; +create user foo@localhost; +create role bar; +grant select on *.* to ''@localhost; +grant select,insert on *.* to foo@localhost; +grant select,insert on *.* to bar; +grant bar to ''@localhost; +create table t1 (n varchar(100), +u varchar(100) default user(), +cu varchar(100) default current_user(), +cr varchar(100) default current_role(), +d varchar(100) default database()); +create definer=foo@localhost view mysqltest1.v1 as select * from t1; +create definer=bar view v2 as select * from t1; +create view v3 as select * from v2; +create definer=foo@localhost view mysqltest1.v4 as select default(n),default(u),default(cu),default(cr), default(d) from t1; +create definer=bar view v5 as select default(n),default(u),default(cu),default(cr), default(d) from t1; +create view v6 as select * from v5; +insert t1 (n) values ('t1'); +insert mysqltest1.v1 (n) values ('v1'); +insert v2 (n) values ('v2'); +insert v3 (n) values ('v3'); +select default(n),default(u),default(cu),default(cr), default(d) from t1 limit 1; +default(n) default(u) default(cu) default(cr) default(d) +NULL root@localhost root@localhost NULL test +select * from mysqltest1.v4 limit 1; +default(n) default(u) default(cu) default(cr) default(d) +NULL root@localhost foo@localhost NULL test +select * from v5 limit 1; +default(n) default(u) default(cu) default(cr) default(d) +NULL root@localhost @ bar test +select * from v6 limit 1; +default(n) default(u) default(cu) default(cr) default(d) +NULL root@localhost @ bar test +connect conn,localhost,conn,,mysqltest1; +set role bar; +insert test.t1 (n) values ('t1'); +insert v1 (n) values ('v1'); +insert test.v2 (n) values ('v2'); +insert test.v3 (n) values ('v3'); +select default(n),default(u),default(cu),default(cr), default(d) from test.t1 limit 1; +default(n) default(u) default(cu) default(cr) default(d) +NULL conn@localhost @localhost bar mysqltest1 +select * from v4 limit 1; +default(n) default(u) default(cu) default(cr) default(d) +NULL conn@localhost foo@localhost NULL mysqltest1 +select * from test.v5 limit 1; +default(n) default(u) default(cu) default(cr) default(d) +NULL conn@localhost @ bar mysqltest1 +select * from test.v6 limit 1; +default(n) default(u) default(cu) default(cr) default(d) +NULL conn@localhost @ bar mysqltest1 +connection default; +disconnect conn; +select * from t1; +n u cu cr d +t1 root@localhost root@localhost NULL test +v1 root@localhost foo@localhost NULL test +v2 root@localhost @ bar test +v3 root@localhost @ bar test +t1 conn@localhost @localhost bar mysqltest1 +v1 conn@localhost foo@localhost NULL mysqltest1 +v2 conn@localhost @ bar mysqltest1 +v3 conn@localhost @ bar mysqltest1 +drop database mysqltest1; +drop view v2, v3, v5, v6; +drop table t1; +drop user ''@localhost; +drop user foo@localhost; +drop role bar; +create table t1 (a date, +mn varchar(100) default monthname(a), +dn varchar(100) default dayname(a), +df varchar(100) default date_format(a, "%a, %b")); +insert t1 (a) values ('2010-12-2'); +set lc_time_names=de_DE; +insert t1 (a) values ('2010-12-2'); +set lc_time_names=default; +select * from t1; +a mn dn df +2010-12-02 December Thursday Thu, Dec +2010-12-02 Dezember Donnerstag Do, Dez +drop table t1; +create table t1 (a varchar(100) default @@sql_mode); +insert t1 () values (); +set sql_mode=ansi; +insert t1 () values (); +set sql_mode=default; +select * from t1; +a +NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION +REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI +drop table t1; diff --git a/mysql-test/r/derived_view.result b/mysql-test/r/derived_view.result index 639942f0da9..5783247b673 100644 --- a/mysql-test/r/derived_view.result +++ b/mysql-test/r/derived_view.result @@ -1101,7 +1101,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 system NULL NULL NULL NULL 1 100.00 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select 6 AS `a`,5 AS `b` from `test`.`t3` where (not(<6,5>(((6,5),(select 7,5 having (trigcond((((6) = 7) or isnull(7))) and trigcond((((5) = 5) or isnull(5))) and trigcond((7)) and trigcond((5)))))))) +Note 1003 select 6 AS `a`,5 AS `b` from `test`.`t3` where 1 SELECT t.a,t.b FROM t3 RIGHT JOIN ((SELECT * FROM t1) AS t, t2) ON t2.b != 0 WHERE (t.a,t.b) NOT IN (SELECT 7, 5); a b @@ -1115,7 +1115,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 system NULL NULL NULL NULL 1 100.00 3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select 6 AS `a`,5 AS `b` from `test`.`t3` where (not(<6,5>(((6,5),(select 7,5 having (trigcond((((6) = 7) or isnull(7))) and trigcond((((5) = 5) or isnull(5))) and trigcond((7)) and trigcond((5)))))))) +Note 1003 select 6 AS `a`,5 AS `b` from `test`.`t3` where 1 SELECT t.a,t.b FROM t3 RIGHT JOIN (v1 AS t, t2) ON t2.b != 0 WHERE (t.a,t.b) NOT IN (SELECT 7, 5); a b @@ -1129,7 +1129,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 system NULL NULL NULL NULL 1 100.00 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select 6 AS `a`,5 AS `b` from `test`.`t3` where (not(<6,5>(((6,5),(select 7,5 having (trigcond((((6) = 7) or isnull(7))) and trigcond((((5) = 5) or isnull(5))) and trigcond((7)) and trigcond((5)))))))) +Note 1003 select 6 AS `a`,5 AS `b` from `test`.`t3` where 1 DROP VIEW v1; DROP TABLE t1,t2,t3; # diff --git a/mysql-test/r/dyncol.result b/mysql-test/r/dyncol.result index b0d28a81043..ad46cddb785 100644 --- a/mysql-test/r/dyncol.result +++ b/mysql-test/r/dyncol.result @@ -91,19 +91,19 @@ hex(COLUMN_CREATE(1, NULL AS decimal)) 000000 select hex(COLUMN_CREATE(1, 1212 AS decimal)); hex(COLUMN_CREATE(1, 1212 AS decimal)) -0001000100040900800004BC +000100010004040084BC select hex(COLUMN_CREATE(1, 7 AS decimal)); hex(COLUMN_CREATE(1, 7 AS decimal)) -000100010004090080000007 +000100010004010087 select hex(COLUMN_CREATE(1, 8 AS decimal)); hex(COLUMN_CREATE(1, 8 AS decimal)) -000100010004090080000008 +000100010004010088 select hex(COLUMN_CREATE(1, 127 AS decimal)); hex(COLUMN_CREATE(1, 127 AS decimal)) -00010001000409008000007F +0001000100040300807F select hex(COLUMN_CREATE(1, 128 AS decimal)); hex(COLUMN_CREATE(1, 128 AS decimal)) -000100010004090080000080 +00010001000403008080 select hex(COLUMN_CREATE(1, 12.12 AS decimal)); hex(COLUMN_CREATE(1, 12.12 AS decimal)) 00010001000402028C0C @@ -236,7 +236,7 @@ select column_get(column_create(1, 99999999999999999999999999999 AS double), 1 a column_get(column_create(1, 99999999999999999999999999999 AS double), 1 as unsigned int) 18446744073709551615 Warnings: -Warning 1916 Got overflow when converting '1e+29' to UNSIGNED INT. Value truncated. +Warning 1916 Got overflow when converting '1e29' to UNSIGNED INT. Value truncated. select column_get(column_create(1, 999.9 AS double), 1 as unsigned int); column_get(column_create(1, 999.9 AS double), 1 as unsigned int) 1000 @@ -330,7 +330,7 @@ select column_get(column_create(1, -99999999999999999999999999999 AS double), 1 column_get(column_create(1, -99999999999999999999999999999 AS double), 1 as int) -9223372036854775808 Warnings: -Warning 1916 Got overflow when converting '-1e+29' to INT. Value truncated. +Warning 1916 Got overflow when converting '-1e29' to INT. Value truncated. select column_get(column_create(1, "-1212III" AS char), 1 as int); column_get(column_create(1, "-1212III" AS char), 1 as int) -1212 @@ -1458,8 +1458,8 @@ Note 1105 Cast to signed converted positive out-of-range integer to it's negativ # MDEV-7505 - Too large scale in DECIMAL dynamic column getter crashes # mysqld # -SELECT COLUMN_GET(`x`, 'y' AS DECIMAL(5,34)); -ERROR 42000: Too big scale 34 specified for ''y''. Maximum is 30. +SELECT COLUMN_GET(`x`, 'y' AS DECIMAL(5,50)); +ERROR 42000: Too big scale 50 specified for ''y''. Maximum is 38. # # test of symbolic names # @@ -1875,3 +1875,56 @@ COLUMN_JSON(COLUMN_CREATE('a',1 AS DECIMAL,'b',1 AS DECIMAL)) # # end of 10.0 tests # +# +# Start of 10.2 tests +# +# +# MDEV-10134 Add full support for DEFAULT +# +CREATE TABLE t1 ( +name VARCHAR(10), +value VARCHAR(10), +dyncol0 BLOB DEFAULT COLUMN_CREATE(name, value), +value_dyncol0_name0 VARCHAR(10) DEFAULT COLUMN_GET(dyncol0, 'name0' AS CHAR), +dyncol1 BLOB DEFAULT COLUMN_ADD(dyncol0, 'name1', 'value1'), +value_dyncol1_name1 VARCHAR(10) DEFAULT COLUMN_GET(dyncol1, 'name1' AS CHAR), +dyncol2 BLOB DEFAULT COLUMN_DELETE(dyncol1, 'name1'), +dyncol2_exists_name0 INT DEFAULT COLUMN_EXISTS(dyncol2, 'name0'), +dyncol2_exists_name1 INT DEFAULT COLUMN_EXISTS(dyncol2, 'name1'), +dyncol2_check INT DEFAULT COLUMN_CHECK(dyncol2), +dyncol1_list TEXT DEFAULT COLUMN_LIST(dyncol1), +dyncol1_json TEXT DEFAULT COLUMN_JSON(dyncol1) +); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `name` varchar(10) DEFAULT NULL, + `value` varchar(10) DEFAULT NULL, + `dyncol0` blob DEFAULT COLUMN_CREATE(name, value), + `value_dyncol0_name0` varchar(10) DEFAULT (COLUMN_GET(dyncol0, 'name0' AS CHAR)), + `dyncol1` blob DEFAULT COLUMN_ADD(dyncol0, 'name1', 'value1'), + `value_dyncol1_name1` varchar(10) DEFAULT (COLUMN_GET(dyncol1, 'name1' AS CHAR)), + `dyncol2` blob DEFAULT COLUMN_DELETE(dyncol1, 'name1'), + `dyncol2_exists_name0` int(11) DEFAULT COLUMN_EXISTS(dyncol2, 'name0'), + `dyncol2_exists_name1` int(11) DEFAULT COLUMN_EXISTS(dyncol2, 'name1'), + `dyncol2_check` int(11) DEFAULT COLUMN_CHECK(dyncol2), + `dyncol1_list` text DEFAULT COLUMN_LIST(dyncol1), + `dyncol1_json` text DEFAULT COLUMN_JSON(dyncol1) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (name,value) VALUES ('name0', 'value0'); +SELECT value_dyncol0_name0, value_dyncol1_name1 FROM t1; +value_dyncol0_name0 value_dyncol1_name1 +value0 value1 +SELECT dyncol2_check, dyncol2_exists_name0, dyncol2_exists_name1 FROM t1; +dyncol2_check dyncol2_exists_name0 dyncol2_exists_name1 +1 1 0 +SELECT dyncol1_list FROM t1; +dyncol1_list +`name0`,`name1` +SELECT dyncol1_json FROM t1; +dyncol1_json +{"name0":"value0","name1":"value1"} +DROP TABLE t1; +# +# End of 10.2 tests +# diff --git a/mysql-test/r/errors.result b/mysql-test/r/errors.result index 23c77d3978c..3f5ad20fe6e 100644 --- a/mysql-test/r/errors.result +++ b/mysql-test/r/errors.result @@ -142,7 +142,7 @@ SELECT (CONVERT('0' USING latin1) IN (CHAR(COT('v') USING utf8),'')); ERROR 22003: DOUBLE value is out of range in 'cot('v')' SET NAMES utf8 COLLATE utf8_latvian_ci ; SELECT UPDATEXML(-73 * -2465717823867977728,@@global.auto_increment_increment,null); -ERROR 22003: BIGINT value is out of range in '(-(73) * -(2465717823867977728))' +ERROR 22003: BIGINT value is out of range in '(-73 * -2465717823867977728)' # # End Bug#57882 # diff --git a/mysql-test/r/events_1.result b/mysql-test/r/events_1.result index 70443604f41..fc8d02e5e93 100644 --- a/mysql-test/r/events_1.result +++ b/mysql-test/r/events_1.result @@ -475,6 +475,26 @@ DROP EVENT ev1; SHOW EVENTS; Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation +# +# MDEV-9524 Cannot load from mysql.event when sql_mode is set to PAD_CHAR_TO_FULL_LENGTH +# +CREATE TABLE t1 (a INT); +CREATE EVENT ev1 ON SCHEDULE EVERY 5 SECOND DO DELETE FROM t1; +SHOW EVENTS; +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation +events_test ev1 root@localhost SYSTEM RECURRING NULL 5 # # NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci +SET sql_mode=PAD_CHAR_TO_FULL_LENGTH; +SHOW EVENTS; +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation +events_test ev1 root@localhost SYSTEM RECURRING NULL 5 # # NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci +DROP EVENT ev1; +CREATE EVENT ev1 ON SCHEDULE EVERY 5 SECOND DO DELETE FROM t1; +SHOW EVENTS; +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation +events_test ev1 root@localhost SYSTEM RECURRING NULL 5 # # NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci +DROP EVENT ev1; +DROP TABLE t1; +SET sql_mode=DEFAULT; # # End of tests diff --git a/mysql-test/r/features.result b/mysql-test/r/features.result index 52650d118b3..615ab2368d9 100644 --- a/mysql-test/r/features.result +++ b/mysql-test/r/features.result @@ -3,6 +3,7 @@ set sql_mode=""; flush status; show status like "feature%"; Variable_name Value +Feature_check_constraint 0 Feature_delay_key_write 0 Feature_dynamic_columns 0 Feature_fulltext 0 @@ -158,3 +159,9 @@ drop table t1; show status like "feature_delay_key_write"; Variable_name Value Feature_delay_key_write 2 +create table t1 (a int check (a > 5)); +create table t2 (b int, constraint foo check (b < 10)); +drop table t1, t2; +show status like "feature_check_constraint"; +Variable_name Value +Feature_check_constraint 2 diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result index 8bf948e0d72..a81faeebaf2 100644 --- a/mysql-test/r/fulltext.result +++ b/mysql-test/r/fulltext.result @@ -249,7 +249,7 @@ show create table t2; Table Create Table t2 CREATE TABLE `t2` ( `ticket` int(11) DEFAULT NULL, - `inhalt` text, + `inhalt` text DEFAULT NULL, KEY `tig` (`ticket`), FULLTEXT KEY `tix` (`inhalt`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 diff --git a/mysql-test/r/fulltext3.result b/mysql-test/r/fulltext3.result index 4ec48369ad1..c0b871cd5a7 100644 --- a/mysql-test/r/fulltext3.result +++ b/mysql-test/r/fulltext3.result @@ -15,3 +15,15 @@ CREATE TABLE t1(a VARCHAR(2) CHARACTER SET big5 COLLATE big5_chinese_ci, FULLTEXT(a)); INSERT INTO t1 VALUES(0xA3C2); DROP TABLE t1; +create table t1 ( +id varchar(255), +business_name text null collate utf8mb4_unicode_ci, +street_address text, +fulltext index ft (business_name), +fulltext index ft2 (street_address) +); +select * from t1 where match (business_name, street_address) against ('some business name and address here'); +ERROR HY000: Can't find FULLTEXT index matching the column list +select * from t1 where match (business_name, street_address) against ('some business name and address here' in boolean mode); +id business_name street_address +drop table t1; diff --git a/mysql-test/r/fulltext_distinct.result b/mysql-test/r/fulltext_distinct.result index 7fd42fab646..de0668ff28c 100644 --- a/mysql-test/r/fulltext_distinct.result +++ b/mysql-test/r/fulltext_distinct.result @@ -8,8 +8,6 @@ KEY kt(tag), KEY kv(value(15)), FULLTEXT KEY kvf(value) ) ENGINE=MyISAM; -Warnings: -Warning 1101 BLOB/TEXT column 'value' can't have a default value CREATE TABLE t2 ( id_t2 mediumint unsigned NOT NULL default '0', id_t1 mediumint unsigned NOT NULL default '0', diff --git a/mysql-test/r/fulltext_update.result b/mysql-test/r/fulltext_update.result index 4a615c88fdd..5d3f95b318c 100644 --- a/mysql-test/r/fulltext_update.result +++ b/mysql-test/r/fulltext_update.result @@ -9,8 +9,6 @@ name VARCHAR(80) DEFAULT '' NOT NULL, FULLTEXT(url,description,shortdesc,longdesc), PRIMARY KEY(gnr) ); -Warnings: -Warning 1101 BLOB/TEXT column 'longdesc' can't have a default value insert into test (url,shortdesc,longdesc,description,name) VALUES ("http:/test.at", "kurz", "lang","desc", "name"); insert into test (url,shortdesc,longdesc,description,name) VALUES diff --git a/mysql-test/r/func_compress.result b/mysql-test/r/func_compress.result index 9bedddd7740..9ef7f13487f 100644 --- a/mysql-test/r/func_compress.result +++ b/mysql-test/r/func_compress.result @@ -167,3 +167,26 @@ set global max_allowed_packet=default; # # End of 5.5 tests # +# +# Start of 10.2 tests +# +# +# MDEV-10134 Add full support for DEFAULT +# +CREATE TABLE t1 (a TEXT, b BLOB DEFAULT COMPRESS(a), bl INT DEFAULT UNCOMPRESSED_LENGTH(b), a1 TEXT DEFAULT UNCOMPRESS(b)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` text DEFAULT NULL, + `b` blob DEFAULT COMPRESS(a), + `bl` int(11) DEFAULT UNCOMPRESSED_LENGTH(b), + `a1` text DEFAULT UNCOMPRESS(b) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES (REPEAT('a',100)); +SELECT bl, a1 FROM t1; +bl a1 +100 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +DROP TABLE t1; +# +# End of 10.2 tests +# diff --git a/mysql-test/r/func_crypt.result b/mysql-test/r/func_crypt.result index 1eda56ac114..85c1cb2ce94 100644 --- a/mysql-test/r/func_crypt.result +++ b/mysql-test/r/func_crypt.result @@ -106,3 +106,16 @@ OLD_PASSWORD(c1) PASSWORD(c1) 77023ffe214c04ff *82E58A2C08AAFE72C8EB523069CD8ADB33F78F58 DROP TABLE t1; End of 5.0 tests +Start of 10.2 tests +CREATE TABLE t1 (a VARCHAR(10), b VARCHAR(30) DEFAULT ENCRYPT(a,123)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(30) DEFAULT ENCRYPT(a,123) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES ('hello'); +SELECT * FROM t1; +a b +hello 12NKz5XM5JeKI +DROP TABLE t1; diff --git a/mysql-test/r/func_default.result b/mysql-test/r/func_default.result index 8f486d87d47..535be10da86 100644 --- a/mysql-test/r/func_default.result +++ b/mysql-test/r/func_default.result @@ -21,3 +21,14 @@ INSERT INTO t1 VALUES (1, 'one'), (2, 'two'), (3, 'three'); SELECT s, 32 AS mi FROM t1 GROUP BY s HAVING DEFAULT(mi) IS NULL; ERROR HY000: Field 'mi' doesn't have a default value DROP TABLE t1; +set timestamp=unix_timestamp('2001-01-01 10:20:30.123456'); +create table t1 (a int default 1, b int default (a+1), +c varchar(100) default 'foo', d text default 'bar', +e timestamp default now(), f timestamp(6) default now(2)); +insert t1 () values (); +insert t1 (a) values (10); +select default(a),default(b),default(c),default(d),default(e),default(f) from t1; +default(a) default(b) default(c) default(d) default(e) default(f) +1 2 foo bar 2001-01-01 10:20:30 2001-01-01 10:20:30.120000 +1 11 foo bar 2001-01-01 10:20:30 2001-01-01 10:20:30.120000 +drop table t1; diff --git a/mysql-test/r/func_digest.result b/mysql-test/r/func_digest.result index 095b69363ce..31a32da72ed 100644 --- a/mysql-test/r/func_digest.result +++ b/mysql-test/r/func_digest.result @@ -1411,18 +1411,44 @@ LENGTH(SHA2( 'computed', 512 )) / 2 * 8 = 512 SET NAMES binary; SELECT sha2('1',224); Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def sha2('1',224) 253 56 56 Y 128 31 63 +def sha2('1',224) 253 56 56 Y 128 39 63 sha2('1',224) e25388fde8290dc286a6164fa2d97e551b53498dcbf7bc378eb1f178 SET NAMES utf8; SELECT sha2('1',224); Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def sha2('1',224) 253 168 56 Y 0 31 33 +def sha2('1',224) 253 168 56 Y 0 39 33 sha2('1',224) e25388fde8290dc286a6164fa2d97e551b53498dcbf7bc378eb1f178 SET NAMES latin1; SELECT sha2('1',224); Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def sha2('1',224) 253 56 56 Y 0 31 8 +def sha2('1',224) 253 56 56 Y 0 39 8 sha2('1',224) e25388fde8290dc286a6164fa2d97e551b53498dcbf7bc378eb1f178 +# +# Start of 10.2 tests +# +# +# MDEV-10134 Add full support for DEFAULT +# +CREATE TABLE t1 ( +a VARCHAR(30), +b TEXT DEFAULT SHA(a), +c TEXT DEFAULT SHA2(a,224) +); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(30) DEFAULT NULL, + `b` text DEFAULT SHA(a), + `c` text DEFAULT SHA2(a,224) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES ('abc'); +SELECT * FROM t1; +a b c +abc a9993e364706816aba3e25717850c26c9cd0d89d 23097d223405d8228642a477bda255b32aadbce4bda0b3f7e36c9da7 +DROP TABLE t1; +# +# End of 10.2 tests +# diff --git a/mysql-test/r/func_encrypt.result b/mysql-test/r/func_encrypt.result index f5e03a90327..34dff598452 100644 --- a/mysql-test/r/func_encrypt.result +++ b/mysql-test/r/func_encrypt.result @@ -208,3 +208,29 @@ DROP TABLE t1; # # End of 10.1 tests # +# +# Start of 10.2 tests +# +# +# MDEV-10134 Add full support for DEFAULT +# +CREATE TABLE t1 ( +a VARCHAR(30), +b BLOB DEFAULT DES_ENCRYPT(a, 'passwd'), +c TEXT DEFAULT DES_DECRYPT(b, 'passwd') +); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(30) DEFAULT NULL, + `b` blob DEFAULT DES_ENCRYPT(a, 'passwd'), + `c` text DEFAULT DES_DECRYPT(b, 'passwd') +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES ('test'); +SELECT c FROM t1; +c +test +DROP TABLE t1; +# +# End of 10.2 tests +# diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result index 9014450bef3..4c4ad4da051 100644 --- a/mysql-test/r/func_gconcat.result +++ b/mysql-test/r/func_gconcat.result @@ -473,9 +473,9 @@ select collation(group_concat(a,_koi8r'test')) from t1; collation(group_concat(a,_koi8r'test')) cp1250_general_ci select collation(group_concat(a,_koi8r 0xC1C2)) from t1; -ERROR HY000: Illegal mix of collations (cp1250_general_ci,IMPLICIT) and (koi8r_general_ci,COERCIBLE) for operation 'group_concat' +ERROR HY000: Illegal mix of collations (cp1250_general_ci,IMPLICIT) and (koi8r_general_ci,COERCIBLE) for operation 'group_concat(' select collation(group_concat(a,b)) from t1; -ERROR HY000: Illegal mix of collations (cp1250_general_ci,IMPLICIT) and (koi8r_general_ci,IMPLICIT) for operation 'group_concat' +ERROR HY000: Illegal mix of collations (cp1250_general_ci,IMPLICIT) and (koi8r_general_ci,IMPLICIT) for operation 'group_concat(' drop table t1; drop table t2; CREATE TABLE t1 (a CHAR(10) CHARACTER SET cp850); @@ -1154,14 +1154,14 @@ CREATE TABLE t2 SELECT GROUP_CONCAT(f1 order by f2) FROM t1; SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( - `GROUP_CONCAT(f1 order by f2)` mediumtext + `GROUP_CONCAT(f1 order by f2)` mediumtext DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t2; CREATE TABLE t2 SELECT GROUP_CONCAT(UPPER(f1) ORDER BY f2) FROM t1; SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( - `GROUP_CONCAT(UPPER(f1) ORDER BY f2)` mediumtext + `GROUP_CONCAT(UPPER(f1) ORDER BY f2)` mediumtext DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t2; SET group_concat_max_len= DEFAULT; @@ -1200,3 +1200,57 @@ Warning 1260 Row 3 was cut by GROUP_CONCAT() Warning 1260 Row 5 was cut by GROUP_CONCAT() DROP TABLE t1; SET group_concat_max_len= DEFAULT; +# +# Start of 10.2 tests +# +# +# MDEV-10124 Incorrect usage of CUBE/ROLLUP and ORDER BY with GROUP_CONCAT(a ORDER BY a) +# +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (10),(20),(30); +SELECT a,GROUP_CONCAT(a ORDER BY a) FROM t1 GROUP BY a WITH ROLLUP; +a GROUP_CONCAT(a ORDER BY a) +10 10 +20 20 +30 30 +NULL 10,20,30 +CREATE VIEW v1 AS +SELECT a,GROUP_CONCAT(a ORDER BY a) FROM t1 GROUP BY a WITH ROLLUP; +SELECT * FROM v1; +a GROUP_CONCAT(a ORDER BY a) +10 10 +20 20 +30 30 +NULL 10,20,30 +DROP VIEW v1; +SELECT a,GROUP_CONCAT(a ORDER BY a) FROM t1 GROUP BY a WITH ROLLUP HAVING GROUP_CONCAT(a ORDER BY a)='10,20,30'; +a GROUP_CONCAT(a ORDER BY a) +NULL 10,20,30 +CREATE VIEW v1 AS +SELECT a,GROUP_CONCAT(a ORDER BY a) FROM t1 GROUP BY a WITH ROLLUP HAVING GROUP_CONCAT(a ORDER BY a)='10,20,30'; +SELECT * FROM v1; +a GROUP_CONCAT(a ORDER BY a) +NULL 10,20,30 +DROP VIEW v1; +SELECT * FROM (SELECT a,GROUP_CONCAT(a ORDER BY a) FROM t1 GROUP BY a WITH ROLLUP HAVING GROUP_CONCAT(a ORDER BY a)='10,20,30') t1; +a GROUP_CONCAT(a ORDER BY a) +NULL 10,20,30 +CREATE VIEW v1 AS +SELECT * FROM (SELECT a,GROUP_CONCAT(a ORDER BY a) FROM t1 GROUP BY a WITH ROLLUP HAVING GROUP_CONCAT(a ORDER BY a)='10,20,30') t1; +SELECT * FROM v1; +a GROUP_CONCAT(a ORDER BY a) +NULL 10,20,30 +DROP VIEW v1; +SELECT (SELECT GROUP_CONCAT(a ORDER BY a) FROM t1 GROUP BY a WITH ROLLUP HAVING GROUP_CONCAT(a ORDER BY a)='10,20,30'); +(SELECT GROUP_CONCAT(a ORDER BY a) FROM t1 GROUP BY a WITH ROLLUP HAVING GROUP_CONCAT(a ORDER BY a)='10,20,30') +10,20,30 +CREATE VIEW v1 AS +SELECT (SELECT GROUP_CONCAT(a ORDER BY a) FROM t1 GROUP BY a WITH ROLLUP HAVING GROUP_CONCAT(a ORDER BY a)='10,20,30'); +SELECT * FROM v1; +Name_exp_1 +10,20,30 +DROP VIEW v1; +DROP TABLE t1; +# +# End of 10.2 tests +# diff --git a/mysql-test/r/func_hybrid_type.result b/mysql-test/r/func_hybrid_type.result index eeaa79e7dce..ea9c203e3f6 100644 --- a/mysql-test/r/func_hybrid_type.result +++ b/mysql-test/r/func_hybrid_type.result @@ -1592,21 +1592,21 @@ GREATEST(b, b) AS greatest_b_b FROM t1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def test t1 t1 a ___________a 253 10 1 Y 0 0 8 -def case_______a 253 10 1 Y 0 31 8 -def case_____a_a 253 10 1 Y 0 31 8 -def coalesce___a 253 10 1 Y 0 31 8 -def coalesce_a_a 253 10 1 Y 0 31 8 -def if_______a_a 253 10 1 Y 0 31 8 -def ifnull___a_a 253 10 1 Y 0 31 8 -def least____a_a 253 10 1 Y 0 31 8 -def greatest_a_a 253 10 1 Y 0 31 8 +def case_______a 253 10 1 Y 0 39 8 +def case_____a_a 253 10 1 Y 0 39 8 +def coalesce___a 253 10 1 Y 0 39 8 +def coalesce_a_a 253 10 1 Y 0 39 8 +def if_______a_a 253 10 1 Y 0 39 8 +def ifnull___a_a 253 10 1 Y 0 39 8 +def least____a_a 253 10 1 Y 0 39 8 +def greatest_a_a 253 10 1 Y 0 39 8 def test t1 t1 b ___________b 254 1 1 Y 256 0 8 -def case_______b 254 1 1 Y 0 31 8 -def case_____b_b 254 1 1 Y 0 31 8 -def coalesce___b 254 1 1 Y 0 31 8 -def coalesce_b_b 254 1 1 Y 0 31 8 -def if_______b_b 254 1 1 Y 0 31 8 -def ifnull___b_b 254 1 1 Y 0 31 8 +def case_______b 254 1 1 Y 0 39 8 +def case_____b_b 254 1 1 Y 0 39 8 +def coalesce___b 254 1 1 Y 0 39 8 +def coalesce_b_b 254 1 1 Y 0 39 8 +def if_______b_b 254 1 1 Y 0 39 8 +def ifnull___b_b 254 1 1 Y 0 39 8 def least____b_b 254 1 1 Y 0 0 8 def greatest_b_b 254 1 1 Y 0 0 8 ___________a a @@ -1642,18 +1642,18 @@ GREATEST(a, b) AS greatest_a_b, GREATEST(b, a) AS greatest_b_a FROM t1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def case_____a_b 253 10 1 Y 0 31 8 -def case_____b_a 253 10 1 Y 0 31 8 -def coalesce_a_b 253 10 1 Y 0 31 8 -def coalesce_b_a 253 10 1 Y 0 31 8 -def if_______a_b 253 10 1 Y 0 31 8 -def if_______b_a 253 10 1 Y 0 31 8 -def ifnull___a_b 253 10 1 Y 0 31 8 -def ifnull___b_a 253 10 1 Y 0 31 8 -def least____a_b 253 10 1 Y 0 31 8 -def least____b_a 253 10 1 Y 0 31 8 -def greatest_a_b 253 10 1 Y 0 31 8 -def greatest_b_a 253 10 1 Y 0 31 8 +def case_____a_b 253 10 1 Y 0 39 8 +def case_____b_a 253 10 1 Y 0 39 8 +def coalesce_a_b 253 10 1 Y 0 39 8 +def coalesce_b_a 253 10 1 Y 0 39 8 +def if_______a_b 253 10 1 Y 0 39 8 +def if_______b_a 253 10 1 Y 0 39 8 +def ifnull___a_b 253 10 1 Y 0 39 8 +def ifnull___b_a 253 10 1 Y 0 39 8 +def least____a_b 253 10 1 Y 0 39 8 +def least____b_a 253 10 1 Y 0 39 8 +def greatest_a_b 253 10 1 Y 0 39 8 +def greatest_b_a 253 10 1 Y 0 39 8 case_____a_b a case_____b_a b coalesce_a_b a @@ -2843,14 +2843,14 @@ def ifnull___a_a 3 11 11 Y 32896 0 63 def least____a_a 3 11 11 Y 32896 0 63 def greatest_a_a 3 11 11 Y 32896 0 63 def test t1 t1 b ___________b 253 10 4 Y 0 0 8 -def case_______b 253 10 4 Y 0 31 8 -def case_____b_b 253 10 4 Y 0 31 8 -def coalesce___b 253 10 4 Y 0 31 8 -def coalesce_b_b 253 10 4 Y 0 31 8 -def if_______b_b 253 10 4 Y 0 31 8 -def ifnull___b_b 253 10 4 Y 0 31 8 -def least____b_b 253 10 4 Y 0 31 8 -def greatest_b_b 253 10 4 Y 0 31 8 +def case_______b 253 10 4 Y 0 39 8 +def case_____b_b 253 10 4 Y 0 39 8 +def coalesce___b 253 10 4 Y 0 39 8 +def coalesce_b_b 253 10 4 Y 0 39 8 +def if_______b_b 253 10 4 Y 0 39 8 +def ifnull___b_b 253 10 4 Y 0 39 8 +def least____b_b 253 10 4 Y 0 39 8 +def greatest_b_b 253 10 4 Y 0 39 8 ___________a -2147483648 case_______a -2147483648 case_____a_a -2147483648 @@ -2884,14 +2884,14 @@ GREATEST(a, b) AS greatest_a_b, GREATEST(b, a) AS greatest_b_a FROM t1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def case_____a_b 253 11 11 Y 0 31 8 -def case_____b_a 253 11 4 Y 0 31 8 -def coalesce_a_b 253 11 11 Y 0 31 8 -def coalesce_b_a 253 11 4 Y 0 31 8 -def if_______a_b 253 11 4 Y 0 31 8 -def if_______b_a 253 11 11 Y 0 31 8 -def ifnull___a_b 253 11 11 Y 0 31 8 -def ifnull___b_a 253 11 4 Y 0 31 8 +def case_____a_b 253 11 11 Y 0 39 8 +def case_____b_a 253 11 4 Y 0 39 8 +def coalesce_a_b 253 11 11 Y 0 39 8 +def coalesce_b_a 253 11 4 Y 0 39 8 +def if_______a_b 253 11 4 Y 0 39 8 +def if_______b_a 253 11 11 Y 0 39 8 +def ifnull___a_b 253 11 11 Y 0 39 8 +def ifnull___b_a 253 11 4 Y 0 39 8 def least____a_b 5 23 11 Y 32896 31 63 def least____b_a 5 23 11 Y 32896 31 63 def greatest_a_b 5 23 3 Y 32896 31 63 @@ -3073,9 +3073,9 @@ SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( `c1` varbinary(255) DEFAULT NULL, - `c2` mediumblob, - `c3` blob, - `c4` longblob + `c2` mediumblob DEFAULT NULL, + `c3` blob DEFAULT NULL, + `c4` longblob DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SELECT MAX(COALESCE(c1)) AS c1, @@ -3084,10 +3084,10 @@ MAX(COALESCE(c3)) AS c3, MAX(COALESCE(c4)) AS c4 FROM t1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def c1 253 255 0 Y 128 31 63 -def c2 250 16777215 0 Y 128 31 63 -def c3 252 65535 0 Y 128 31 63 -def c4 251 4294967295 0 Y 128 31 63 +def c1 253 255 0 Y 128 39 63 +def c2 250 16777215 0 Y 128 39 63 +def c3 252 65535 0 Y 128 39 63 +def c4 251 4294967295 0 Y 128 39 63 c1 c2 c3 c4 NULL NULL NULL NULL DROP TABLE t2; @@ -3109,8 +3109,8 @@ MAX(COALESCE(c1)) AS c1, MAX(COALESCE(c2)) AS c2 FROM t1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def c1 253 1 0 Y 0 31 8 -def c2 253 255 0 Y 0 31 8 +def c1 253 1 0 Y 0 39 8 +def c2 253 255 0 Y 0 39 8 c1 c2 NULL NULL DROP TABLE t2; @@ -3132,8 +3132,8 @@ MAX(COALESCE(c1)) AS c1, MAX(COALESCE(c2)) AS c2 FROM t1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def c1 253 1 0 Y 0 31 8 -def c2 253 255 0 Y 0 31 8 +def c1 253 1 0 Y 0 39 8 +def c2 253 255 0 Y 0 39 8 c1 c2 NULL NULL DROP TABLE t2; @@ -3150,7 +3150,7 @@ Table Create Table t2 CREATE TABLE `t2` ( `c1` varchar(1) DEFAULT NULL, `c2` varchar(255) DEFAULT NULL, - `c3` text + `c3` text DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SELECT MAX(COALESCE(c1)) AS c1, @@ -3158,9 +3158,9 @@ MAX(COALESCE(c2)) AS c2, MAX(COALESCE(c3)) AS c3 FROM t1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def c1 253 1 0 Y 0 31 8 -def c2 253 255 0 Y 0 31 8 -def c3 252 20000 0 Y 0 31 8 +def c1 253 1 0 Y 0 39 8 +def c2 253 255 0 Y 0 39 8 +def c3 252 20000 0 Y 0 39 8 c1 c2 c3 NULL NULL NULL DROP TABLE t2; @@ -3177,7 +3177,7 @@ Table Create Table t2 CREATE TABLE `t2` ( `c1` varchar(1) CHARACTER SET utf8 DEFAULT NULL, `c2` varchar(255) CHARACTER SET utf8 DEFAULT NULL, - `c3` text CHARACTER SET utf8 + `c3` text CHARACTER SET utf8 DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SELECT MAX(COALESCE(c1)) AS c1, @@ -3185,9 +3185,9 @@ MAX(COALESCE(c2)) AS c2, MAX(COALESCE(c3)) AS c3 FROM t1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def c1 253 1 0 Y 0 31 8 -def c2 253 255 0 Y 0 31 8 -def c3 252 60000 0 Y 0 31 8 +def c1 253 1 0 Y 0 39 8 +def c2 253 255 0 Y 0 39 8 +def c3 252 60000 0 Y 0 39 8 c1 c2 c3 NULL NULL NULL DROP TABLE t2; @@ -3206,7 +3206,7 @@ SELECT MAX(COALESCE(c1)) AS c1 FROM t1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def c1 253 1 0 Y 0 31 8 +def c1 253 1 0 Y 0 39 8 c1 NULL DROP TABLE t2; @@ -3225,7 +3225,7 @@ SELECT MAX(COALESCE(c1)) AS c1 FROM t1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def c1 253 1 0 Y 0 31 8 +def c1 253 1 0 Y 0 39 8 c1 NULL DROP TABLE t2; @@ -3245,9 +3245,9 @@ SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( `c1` varbinary(255) DEFAULT NULL, - `c2` blob, - `c3` mediumblob, - `c4` longblob + `c2` blob DEFAULT NULL, + `c3` mediumblob DEFAULT NULL, + `c4` longblob DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SELECT @c1:=c1 AS c1, @@ -3256,10 +3256,10 @@ SELECT @c4:=c4 AS c4 FROM t1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def c1 253 255 0 Y 128 31 63 -def c2 252 65535 0 Y 128 31 63 -def c3 250 16777215 0 Y 128 31 63 -def c4 251 4294967295 0 Y 128 31 63 +def c1 253 255 0 Y 128 39 63 +def c2 252 65535 0 Y 128 39 63 +def c3 250 16777215 0 Y 128 39 63 +def c4 251 4294967295 0 Y 128 39 63 c1 c2 c3 c4 DROP TABLE t2; DROP TABLE t1; @@ -3280,8 +3280,8 @@ SELECT @c2:=c2 AS c2 FROM t1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def c1 253 1 0 Y 0 31 8 -def c2 253 255 0 Y 0 31 8 +def c1 253 1 0 Y 0 39 8 +def c2 253 255 0 Y 0 39 8 c1 c2 DROP TABLE t2; DROP TABLE t1; @@ -3302,8 +3302,8 @@ SELECT @c2:=c2 AS c2 FROM t1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def c1 253 1 0 Y 0 31 8 -def c2 253 255 0 Y 0 31 8 +def c1 253 1 0 Y 0 39 8 +def c2 253 255 0 Y 0 39 8 c1 c2 DROP TABLE t2; DROP TABLE t1; @@ -3319,7 +3319,7 @@ Table Create Table t2 CREATE TABLE `t2` ( `c1` varchar(1) DEFAULT NULL, `c2` varchar(255) DEFAULT NULL, - `c3` text + `c3` text DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SELECT @c:=c1 AS c1, @@ -3327,9 +3327,9 @@ SELECT @c:=c3 AS c3 FROM t1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def c1 253 1 0 Y 0 31 8 -def c2 253 255 0 Y 0 31 8 -def c3 252 20000 0 Y 0 31 8 +def c1 253 1 0 Y 0 39 8 +def c2 253 255 0 Y 0 39 8 +def c3 252 20000 0 Y 0 39 8 c1 c2 c3 DROP TABLE t2; DROP TABLE t1; @@ -3345,7 +3345,7 @@ Table Create Table t2 CREATE TABLE `t2` ( `c1` varchar(1) CHARACTER SET utf8 DEFAULT NULL, `c2` varchar(255) CHARACTER SET utf8 DEFAULT NULL, - `c3` text CHARACTER SET utf8 + `c3` text CHARACTER SET utf8 DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SELECT @c:=c1 AS c1, @@ -3353,9 +3353,9 @@ SELECT @c:=c3 AS c3 FROM t1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def c1 253 1 0 Y 0 31 8 -def c2 253 255 0 Y 0 31 8 -def c3 252 60000 0 Y 0 31 8 +def c1 253 1 0 Y 0 39 8 +def c2 253 255 0 Y 0 39 8 +def c3 252 60000 0 Y 0 39 8 c1 c2 c3 DROP TABLE t2; DROP TABLE t1; diff --git a/mysql-test/r/func_in.result b/mysql-test/r/func_in.result index 33a997c8004..1855fa72523 100644 --- a/mysql-test/r/func_in.result +++ b/mysql-test/r/func_in.result @@ -813,6 +813,25 @@ EXECUTE s; DROP TABLE t1; # End of 5.3 tests # +# Start of 10.0 tests +# +# +# MDEV-10020 InnoDB NOT IN Query Crash When One Item Is NULL +# +CREATE TABLE t1 +( +a INT(11), +b VARCHAR(10), +KEY (b) +); +INSERT INTO t1 VALUES (1,'x'),(2,'y'),(3,'z'); +SELECT * FROM t1 WHERE b NOT IN (NULL, '', 'A'); +a b +DROP TABLE t1; +# +# Start of 10.1 tests +# +# # MDEV-8755 Equal field propagation is not performed any longer for the IN list when multiple comparison types # CREATE TABLE t1 (a INT); diff --git a/mysql-test/r/func_math.result b/mysql-test/r/func_math.result index d768672efe4..703d9816f8b 100644 --- a/mysql-test/r/func_math.result +++ b/mysql-test/r/func_math.result @@ -6,7 +6,7 @@ explain extended select floor(5.5),floor(-5.5); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select floor(5.5) AS `floor(5.5)`,floor(-(5.5)) AS `floor(-5.5)` +Note 1003 select floor(5.5) AS `floor(5.5)`,floor(-5.5) AS `floor(-5.5)` select ceiling(5.5),ceiling(-5.5); ceiling(5.5) ceiling(-5.5) 6 -5 @@ -14,7 +14,7 @@ explain extended select ceiling(5.5),ceiling(-5.5); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select ceiling(5.5) AS `ceiling(5.5)`,ceiling(-(5.5)) AS `ceiling(-5.5)` +Note 1003 select ceiling(5.5) AS `ceiling(5.5)`,ceiling(-5.5) AS `ceiling(-5.5)` select truncate(52.64,1),truncate(52.64,2),truncate(52.64,-1),truncate(52.64,-2), truncate(-52.64,1),truncate(-52.64,-1); truncate(52.64,1) truncate(52.64,2) truncate(52.64,-1) truncate(52.64,-2) truncate(-52.64,1) truncate(-52.64,-1) 52.6 52.64 50 0 -52.6 -50 @@ -22,7 +22,7 @@ explain extended select truncate(52.64,1),truncate(52.64,2),truncate(52.64,-1),t id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select truncate(52.64,1) AS `truncate(52.64,1)`,truncate(52.64,2) AS `truncate(52.64,2)`,truncate(52.64,-(1)) AS `truncate(52.64,-1)`,truncate(52.64,-(2)) AS `truncate(52.64,-2)`,truncate(-(52.64),1) AS `truncate(-52.64,1)`,truncate(-(52.64),-(1)) AS `truncate(-52.64,-1)` +Note 1003 select truncate(52.64,1) AS `truncate(52.64,1)`,truncate(52.64,2) AS `truncate(52.64,2)`,truncate(52.64,-1) AS `truncate(52.64,-1)`,truncate(52.64,-2) AS `truncate(52.64,-2)`,truncate(-52.64,1) AS `truncate(-52.64,1)`,truncate(-52.64,-1) AS `truncate(-52.64,-1)` select round(5.5),round(-5.5); round(5.5) round(-5.5) 6 -6 @@ -30,7 +30,7 @@ explain extended select round(5.5),round(-5.5); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select round(5.5,0) AS `round(5.5)`,round(-(5.5),0) AS `round(-5.5)` +Note 1003 select round(5.5,0) AS `round(5.5)`,round(-5.5,0) AS `round(-5.5)` select round(5.64,1),round(5.64,2),round(5.64,-1),round(5.64,-2); round(5.64,1) round(5.64,2) round(5.64,-1) round(5.64,-2) 5.6 5.64 10 0 @@ -41,7 +41,7 @@ explain extended select abs(-10), sign(-5), sign(5), sign(0); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select abs(-(10)) AS `abs(-10)`,sign(-(5)) AS `sign(-5)`,sign(5) AS `sign(5)`,sign(0) AS `sign(0)` +Note 1003 select abs(-10) AS `abs(-10)`,sign(-5) AS `sign(-5)`,sign(5) AS `sign(5)`,sign(0) AS `sign(0)` select log(exp(10)),exp(log(sqrt(10))*2),log(-1),log(NULL),log(1,1),log(3,9),log(-1,2),log(NULL,2); log(exp(10)) exp(log(sqrt(10))*2) log(-1) log(NULL) log(1,1) log(3,9) log(-1,2) log(NULL,2) 10 10.000000000000002 NULL NULL NULL 2 NULL NULL @@ -49,7 +49,7 @@ explain extended select log(exp(10)),exp(log(sqrt(10))*2),log(-1),log(NULL),log( id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select log(exp(10)) AS `log(exp(10))`,exp((log(sqrt(10)) * 2)) AS `exp(log(sqrt(10))*2)`,log(-(1)) AS `log(-1)`,log(NULL) AS `log(NULL)`,log(1,1) AS `log(1,1)`,log(3,9) AS `log(3,9)`,log(-(1),2) AS `log(-1,2)`,log(NULL,2) AS `log(NULL,2)` +Note 1003 select log(exp(10)) AS `log(exp(10))`,exp((log(sqrt(10)) * 2)) AS `exp(log(sqrt(10))*2)`,log(-1) AS `log(-1)`,log(NULL) AS `log(NULL)`,log(1,1) AS `log(1,1)`,log(3,9) AS `log(3,9)`,log(-1,2) AS `log(-1,2)`,log(NULL,2) AS `log(NULL,2)` select ln(exp(10)),exp(ln(sqrt(10))*2),ln(-1),ln(0),ln(NULL); ln(exp(10)) exp(ln(sqrt(10))*2) ln(-1) ln(0) ln(NULL) 10 10.000000000000002 NULL NULL NULL @@ -57,7 +57,7 @@ explain extended select ln(exp(10)),exp(ln(sqrt(10))*2),ln(-1),ln(0),ln(NULL); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select ln(exp(10)) AS `ln(exp(10))`,exp((ln(sqrt(10)) * 2)) AS `exp(ln(sqrt(10))*2)`,ln(-(1)) AS `ln(-1)`,ln(0) AS `ln(0)`,ln(NULL) AS `ln(NULL)` +Note 1003 select ln(exp(10)) AS `ln(exp(10))`,exp((ln(sqrt(10)) * 2)) AS `exp(ln(sqrt(10))*2)`,ln(-1) AS `ln(-1)`,ln(0) AS `ln(0)`,ln(NULL) AS `ln(NULL)` select log2(8),log2(15),log2(-2),log2(0),log2(NULL); log2(8) log2(15) log2(-2) log2(0) log2(NULL) 3 3.9068905956085187 NULL NULL NULL @@ -65,7 +65,7 @@ explain extended select log2(8),log2(15),log2(-2),log2(0),log2(NULL); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select log2(8) AS `log2(8)`,log2(15) AS `log2(15)`,log2(-(2)) AS `log2(-2)`,log2(0) AS `log2(0)`,log2(NULL) AS `log2(NULL)` +Note 1003 select log2(8) AS `log2(8)`,log2(15) AS `log2(15)`,log2(-2) AS `log2(-2)`,log2(0) AS `log2(0)`,log2(NULL) AS `log2(NULL)` select log10(100),log10(18),log10(-4),log10(0),log10(NULL); log10(100) log10(18) log10(-4) log10(0) log10(NULL) 2 1.255272505103306 NULL NULL NULL @@ -73,7 +73,7 @@ explain extended select log10(100),log10(18),log10(-4),log10(0),log10(NULL); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select log10(100) AS `log10(100)`,log10(18) AS `log10(18)`,log10(-(4)) AS `log10(-4)`,log10(0) AS `log10(0)`,log10(NULL) AS `log10(NULL)` +Note 1003 select log10(100) AS `log10(100)`,log10(18) AS `log10(18)`,log10(-4) AS `log10(-4)`,log10(0) AS `log10(0)`,log10(NULL) AS `log10(NULL)` select pow(10,log10(10)),power(2,4); pow(10,log10(10)) power(2,4) 10 16 @@ -356,28 +356,28 @@ round(1.12e1, 4294967296) truncate(1.12e1, 4294967296) 11.2 11.2 select round(1.5, 2147483640), truncate(1.5, 2147483640); round(1.5, 2147483640) truncate(1.5, 2147483640) -1.500000000000000000000000000000 1.500000000000000000000000000000 +1.50000000000000000000000000000000000000 1.50000000000000000000000000000000000000 select round(1.5, -2147483649), round(1.5, 2147483648); round(1.5, -2147483649) round(1.5, 2147483648) -0 1.500000000000000000000000000000 +0 1.50000000000000000000000000000000000000 select truncate(1.5, -2147483649), truncate(1.5, 2147483648); truncate(1.5, -2147483649) truncate(1.5, 2147483648) -0 1.500000000000000000000000000000 +0 1.50000000000000000000000000000000000000 select round(1.5, -4294967296), round(1.5, 4294967296); round(1.5, -4294967296) round(1.5, 4294967296) -0 1.500000000000000000000000000000 +0 1.50000000000000000000000000000000000000 select truncate(1.5, -4294967296), truncate(1.5, 4294967296); truncate(1.5, -4294967296) truncate(1.5, 4294967296) -0 1.500000000000000000000000000000 +0 1.50000000000000000000000000000000000000 select round(1.5, -9223372036854775808), round(1.5, 9223372036854775808); round(1.5, -9223372036854775808) round(1.5, 9223372036854775808) -0 1.500000000000000000000000000000 +0 1.50000000000000000000000000000000000000 select truncate(1.5, -9223372036854775808), truncate(1.5, 9223372036854775808); truncate(1.5, -9223372036854775808) truncate(1.5, 9223372036854775808) -0 1.500000000000000000000000000000 +0 1.50000000000000000000000000000000000000 select round(1.5, 18446744073709551615), truncate(1.5, 18446744073709551615); round(1.5, 18446744073709551615) truncate(1.5, 18446744073709551615) -1.500000000000000000000000000000 1.500000000000000000000000000000 +1.50000000000000000000000000000000000000 1.50000000000000000000000000000000000000 select round(18446744073709551614, -1), truncate(18446744073709551614, -1); round(18446744073709551614, -1) truncate(18446744073709551614, -1) 18446744073709551610 18446744073709551610 @@ -488,7 +488,7 @@ End of 5.0 tests SELECT 1e308 + 1e308; ERROR 22003: DOUBLE value is out of range in '(1e308 + 1e308)' SELECT -1e308 - 1e308; -ERROR 22003: DOUBLE value is out of range in '(-(1e308) - 1e308)' +ERROR 22003: DOUBLE value is out of range in '(-1e308 - 1e308)' SELECT 1e300 * 1e300; ERROR 22003: DOUBLE value is out of range in '(1e300 * 1e300)' SELECT 1e300 / 1e-300; @@ -519,9 +519,9 @@ DROP TABLE t1; # Bug#57477 SIGFPE when dividing a huge number a negative number # SELECT -9999999999999999991 DIV -1; -ERROR 22003: BIGINT value is out of range in '(-(9999999999999999991) DIV -(1))' +ERROR 22003: BIGINT value is out of range in '(-9999999999999999991 DIV -1)' SELECT -9223372036854775808 DIV -1; -ERROR 22003: BIGINT value is out of range in '(-(9223372036854775808) DIV -(1))' +ERROR 22003: BIGINT value is out of range in '(-9223372036854775808 DIV -1)' SELECT -9223372036854775808 MOD -1; -9223372036854775808 MOD -1 0 @@ -591,7 +591,7 @@ End of 5.1 tests SELECT 1e308 + 1e308; ERROR 22003: DOUBLE value is out of range in '(1e308 + 1e308)' SELECT -1e308 - 1e308; -ERROR 22003: DOUBLE value is out of range in '(-(1e308) - 1e308)' +ERROR 22003: DOUBLE value is out of range in '(-1e308 - 1e308)' SELECT 1e300 * 1e300; ERROR 22003: DOUBLE value is out of range in '(1e300 * 1e300)' SELECT 1e300 / 1e-300; @@ -611,11 +611,11 @@ ERROR 22003: BIGINT UNSIGNED value is out of range in '(18446744073709551615 + 1 SELECT 1 + 18446744073709551615; ERROR 22003: BIGINT UNSIGNED value is out of range in '(1 + 18446744073709551615)' SELECT -2 + CAST(1 AS UNSIGNED); -ERROR 22003: BIGINT UNSIGNED value is out of range in '(-(2) + cast(1 as unsigned))' +ERROR 22003: BIGINT UNSIGNED value is out of range in '(-2 + cast(1 as unsigned))' SELECT CAST(1 AS UNSIGNED) + -2; -ERROR 22003: BIGINT UNSIGNED value is out of range in '(cast(1 as unsigned) + -(2))' +ERROR 22003: BIGINT UNSIGNED value is out of range in '(cast(1 as unsigned) + -2)' SELECT -9223372036854775808 + -9223372036854775808; -ERROR 22003: BIGINT value is out of range in '(-(9223372036854775808) + -(9223372036854775808))' +ERROR 22003: BIGINT value is out of range in '(-9223372036854775808 + -9223372036854775808)' SELECT 9223372036854775807 + 9223372036854775807; ERROR 22003: BIGINT value is out of range in '(9223372036854775807 + 9223372036854775807)' SELECT CAST(0 AS UNSIGNED) - 9223372036854775809; @@ -625,24 +625,24 @@ ERROR 22003: BIGINT UNSIGNED value is out of range in '(9223372036854775808 - 92 SELECT CAST(1 AS UNSIGNED) - 2; ERROR 22003: BIGINT UNSIGNED value is out of range in '(cast(1 as unsigned) - 2)' SELECT 18446744073709551615 - (-1); -ERROR 22003: BIGINT UNSIGNED value is out of range in '(18446744073709551615 - -(1))' +ERROR 22003: BIGINT UNSIGNED value is out of range in '(18446744073709551615 - -1)' SELECT -1 - 9223372036854775808; -ERROR 22003: BIGINT UNSIGNED value is out of range in '(-(1) - 9223372036854775808)' +ERROR 22003: BIGINT UNSIGNED value is out of range in '(-1 - 9223372036854775808)' SELECT -1 - CAST(1 AS UNSIGNED); -ERROR 22003: BIGINT UNSIGNED value is out of range in '(-(1) - cast(1 as unsigned))' +ERROR 22003: BIGINT UNSIGNED value is out of range in '(-1 - cast(1 as unsigned))' SELECT -9223372036854775808 - 1; -ERROR 22003: BIGINT value is out of range in '(-(9223372036854775808) - 1)' +ERROR 22003: BIGINT value is out of range in '(-9223372036854775808 - 1)' SELECT 9223372036854775807 - -9223372036854775808; -ERROR 22003: BIGINT value is out of range in '(9223372036854775807 - -(9223372036854775808))' +ERROR 22003: BIGINT value is out of range in '(9223372036854775807 - -9223372036854775808)' set SQL_MODE='NO_UNSIGNED_SUBTRACTION'; SELECT 18446744073709551615 - 1; ERROR 22003: BIGINT value is out of range in '(18446744073709551615 - 1)' SELECT 18446744073709551615 - CAST(1 AS UNSIGNED); ERROR 22003: BIGINT value is out of range in '(18446744073709551615 - cast(1 as unsigned))' SELECT 18446744073709551614 - (-1); -ERROR 22003: BIGINT value is out of range in '(18446744073709551614 - -(1))' +ERROR 22003: BIGINT value is out of range in '(18446744073709551614 - -1)' SELECT 9223372036854775807 - -1; -ERROR 22003: BIGINT value is out of range in '(9223372036854775807 - -(1))' +ERROR 22003: BIGINT value is out of range in '(9223372036854775807 - -1)' set SQL_MODE=default; SELECT 4294967296 * 4294967296; ERROR 22003: BIGINT value is out of range in '(4294967296 * 4294967296)' @@ -653,23 +653,28 @@ ERROR 22003: BIGINT UNSIGNED value is out of range in '(9223372036854775808 * 2) SELECT 7158278827 * 3221225472; ERROR 22003: BIGINT value is out of range in '(7158278827 * 3221225472)' SELECT 9223372036854775807 * (-2); -ERROR 22003: BIGINT value is out of range in '(9223372036854775807 * -(2))' +ERROR 22003: BIGINT value is out of range in '(9223372036854775807 * -2)' SELECT CAST(1 as UNSIGNED) * (-1); -ERROR 22003: BIGINT UNSIGNED value is out of range in '(cast(1 as unsigned) * -(1))' +ERROR 22003: BIGINT UNSIGNED value is out of range in '(cast(1 as unsigned) * -1)' SELECT 9223372036854775807 * 2; ERROR 22003: BIGINT value is out of range in '(9223372036854775807 * 2)' SELECT ABS(-9223372036854775808); -ERROR 22003: BIGINT value is out of range in 'abs(-(9223372036854775808))' +ERROR 22003: BIGINT value is out of range in 'abs(-9223372036854775808)' SELECT -9223372036854775808 DIV -1; -ERROR 22003: BIGINT value is out of range in '(-(9223372036854775808) DIV -(1))' +ERROR 22003: BIGINT value is out of range in '(-9223372036854775808 DIV -1)' SELECT 18446744073709551615 DIV -1; -ERROR 22003: BIGINT UNSIGNED value is out of range in '(18446744073709551615 DIV -(1))' +ERROR 22003: BIGINT UNSIGNED value is out of range in '(18446744073709551615 DIV -1)' CREATE TABLE t1(a BIGINT, b BIGINT UNSIGNED); INSERT INTO t1 VALUES(-9223372036854775808, 9223372036854775809); SELECT -a FROM t1; -ERROR 22003: BIGINT value is out of range in '-(-9223372036854775808)' +ERROR 22003: BIGINT value is out of range in '-(`test`.`t1`.`a`)' SELECT -b FROM t1; -ERROR 22003: BIGINT value is out of range in '-(9223372036854775809)' +ERROR 22003: BIGINT value is out of range in '-(`test`.`t1`.`b`)' +INSERT INTO t1 VALUES(0,0); +SELECT -a FROM t1; +ERROR 22003: BIGINT value is out of range in '-(`test`.`t1`.`a`)' +SELECT -b FROM t1; +ERROR 22003: BIGINT value is out of range in '-(`test`.`t1`.`b`)' DROP TABLE t1; SET @a:=999999999999999999999999999999999999999999999999999999999999999999999999999999999; SELECT @a + @a; @@ -794,5 +799,15 @@ SELECT STDDEV_POP(ROUND(0,@A:=2009)) FROM (SELECT 1 UNION SELECT 2) fake_table; STDDEV_POP(ROUND(0,@A:=2009)) 0.0000 # -# End of 10.0 tests +# Start of 10.2 tests # +# Test zero +select 0=0, 0=-0, 0.0= -0.0, 0.0 = -(0.0), 0.0E1=-0.0E1, 0.0E1=-(0.0E1); +0=0 0=-0 0.0= -0.0 0.0 = -(0.0) 0.0E1=-0.0E1 0.0E1=-(0.0E1) +1 1 1 1 1 1 +# +# CRC32 tests +# +select CRC32(NULL), CRC32(''), CRC32('MySQL'), CRC32('mysql'), CRC32('01234567'), CRC32('012345678'); +CRC32(NULL) CRC32('') CRC32('MySQL') CRC32('mysql') CRC32('01234567') CRC32('012345678') +NULL 0 3259397556 2501908538 763378421 939184570 diff --git a/mysql-test/r/func_misc.result b/mysql-test/r/func_misc.result index 6590e3ef982..4e38754788c 100644 --- a/mysql-test/r/func_misc.result +++ b/mysql-test/r/func_misc.result @@ -1433,3 +1433,57 @@ release_lock('test') # -- Done. +# +# Start of 10.2 tests +# +# +# MDEV-10134 Add full support for DEFAULT +# +CREATE TABLE t1 ( +a VARCHAR(30), +b BIGINT DEFAULT INET_ATON(a), +a1 VARCHAR(30) DEFAULT INET_NTOA(b), +c INT DEFAULT IS_IPV4(a), +d INT DEFAULT IS_IPV6(a) +); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(30) DEFAULT NULL, + `b` bigint(20) DEFAULT INET_ATON(a), + `a1` varchar(30) DEFAULT INET_NTOA(b), + `c` int(11) DEFAULT IS_IPV4(a), + `d` int(11) DEFAULT IS_IPV6(a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES ('192.168.001.001'),('::1'),('xxx'); +SELECT * FROM t1; +a b a1 c d +192.168.001.001 3232235777 192.168.1.1 1 0 +::1 NULL NULL 0 1 +xxx NULL NULL 0 0 +DROP TABLE t1; +CREATE TABLE t1 ( +str VARCHAR(128), +addr VARBINARY(16) DEFAULT INET6_ATON(str), +str1 VARCHAR(128) DEFAULT INET6_NTOA(addr), +b INT DEFAULT IS_IPV4_COMPAT(addr), +c INT DEFAULT IS_IPV4_MAPPED(addr) +); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `str` varchar(128) DEFAULT NULL, + `addr` varbinary(16) DEFAULT INET6_ATON(str), + `str1` varchar(128) DEFAULT INET6_NTOA(addr), + `b` int(11) DEFAULT IS_IPV4_COMPAT(addr), + `c` int(11) DEFAULT IS_IPV4_MAPPED(addr) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (str) VALUES ('::FFFF:192.168.0.1'),('::10.0.5.9'); +SELECT str, str1, b,c FROM t1; +str str1 b c +::FFFF:192.168.0.1 ::ffff:192.168.0.1 0 1 +::10.0.5.9 ::10.0.5.9 1 0 +DROP TABLE t1; +# +# End of 10.2 tests +# diff --git a/mysql-test/r/func_op.result b/mysql-test/r/func_op.result index ce755e86b4c..0d738570035 100644 --- a/mysql-test/r/func_op.result +++ b/mysql-test/r/func_op.result @@ -5,7 +5,7 @@ explain extended select 1+1,1-1,1+1*2,8/5,8%5,mod(8,5),mod(8,5)|0,-(1+1)*-2; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select (1 + 1) AS `1+1`,(1 - 1) AS `1-1`,(1 + (1 * 2)) AS `1+1*2`,(8 / 5) AS `8/5`,(8 % 5) AS `8%5`,(8 % 5) AS `mod(8,5)`,((8 % 5) | 0) AS `mod(8,5)|0`,(-((1 + 1)) * -(2)) AS `-(1+1)*-2` +Note 1003 select (1 + 1) AS `1+1`,(1 - 1) AS `1-1`,(1 + (1 * 2)) AS `1+1*2`,(8 / 5) AS `8/5`,(8 % 5) AS `8%5`,(8 % 5) AS `mod(8,5)`,((8 % 5) | 0) AS `mod(8,5)|0`,(-((1 + 1)) * -2) AS `-(1+1)*-2` select 1 | (1+1),5 & 3,bit_count(7) ; 1 | (1+1) 5 & 3 bit_count(7) 3 1 3 diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index d8ad6d7edb6..d3429b4360f 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -731,7 +731,7 @@ t1 CREATE TABLE `t1` ( `conv(130,16,10)` varchar(64) DEFAULT NULL, `hex(130)` varchar(6) NOT NULL, `char(130)` varbinary(4) NOT NULL, - `format(130,10)` varchar(37) NOT NULL, + `format(130,10)` varchar(45) NOT NULL, `left(_latin2'a',1)` varchar(1) CHARACTER SET latin2 NOT NULL, `right(_latin2'a',1)` varchar(1) CHARACTER SET latin2 NOT NULL, `lcase(_latin2'a')` varchar(1) CHARACTER SET latin2 NOT NULL, @@ -1237,13 +1237,13 @@ create table t1 (i int); insert into t1 values (1000000000),(1); select lpad(i, 7, ' ') as t from t1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def t 253 7 7 Y 0 31 8 +def t 253 7 7 Y 0 39 8 t 1000000 1 select rpad(i, 7, ' ') as t from t1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def t 253 7 7 Y 0 31 8 +def t 253 7 7 Y 0 39 8 t 1000000 1 @@ -2527,7 +2527,7 @@ create table t1(a float); insert into t1 values (1.33); select format(a, 2) from t1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def format(a, 2) 253 49 4 Y 0 31 8 +def format(a, 2) 253 57 4 Y 0 39 8 format(a, 2) 1.33 drop table t1; @@ -2855,7 +2855,7 @@ CREATE TABLE t1 AS SELECT format(123,2,'no_NO'); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `format(123,2,'no_NO')` varchar(37) NOT NULL + `format(123,2,'no_NO')` varchar(45) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SELECT * FROM t1; format(123,2,'no_NO') diff --git a/mysql-test/r/func_test.result b/mysql-test/r/func_test.result index 387b8545f59..ddd71e5d110 100644 --- a/mysql-test/r/func_test.result +++ b/mysql-test/r/func_test.result @@ -319,6 +319,9 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 4 100.00 Using where Warnings: Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (not((`test`.`t1`.`a` + 0))) +select not 1, not null, not not null, 1 is not null; +not 1 not null not not null 1 is not null +0 NULL NULL 1 drop table t1; # # Start of 10.0 tests diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result index ad51010de30..9a9ab76883e 100644 --- a/mysql-test/r/func_time.result +++ b/mysql-test/r/func_time.result @@ -874,7 +874,7 @@ explain extended select period_add("9602",-12),period_diff(199505,"9404"),from_d id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select period_add('9602',-(12)) AS `period_add("9602",-12)`,period_diff(199505,'9404') AS `period_diff(199505,"9404")`,from_days(to_days('960101')) AS `from_days(to_days("960101"))`,dayofmonth('1997-01-02') AS `dayofmonth("1997-01-02")`,month('1997-01-02') AS `month("1997-01-02")`,monthname('1972-03-04') AS `monthname("1972-03-04")`,dayofyear('0000-00-00') AS `dayofyear("0000-00-00")`,hour('1997-03-03 23:03:22') AS `HOUR("1997-03-03 23:03:22")`,minute('23:03:22') AS `MINUTE("23:03:22")`,second(230322) AS `SECOND(230322)`,quarter(980303) AS `QUARTER(980303)`,week('1998-03-03',@@default_week_format) AS `WEEK("1998-03-03")`,yearweek('2000-01-01',1) AS `yearweek("2000-01-01",1)`,week(19950101,1) AS `week(19950101,1)`,year('98-02-03') AS `year("98-02-03")`,(weekday(curdate()) - weekday(now())) AS `weekday(curdate())-weekday(now())`,dayname('1962-03-03') AS `dayname("1962-03-03")`,unix_timestamp() AS `unix_timestamp()`,sec_to_time((time_to_sec('0:30:47') / 6.21)) AS `sec_to_time(time_to_sec("0:30:47")/6.21)`,curtime() AS `curtime()`,utc_time() AS `utc_time()`,curdate() AS `curdate()`,utc_date() AS `utc_date()`,utc_timestamp() AS `utc_timestamp()`,date_format('1997-01-02 03:04:05','%M %W %D %Y %y %m %d %h %i %s %w') AS `date_format("1997-01-02 03:04:05", "%M %W %D %Y %y %m %d %h %i %s %w")`,from_unixtime(unix_timestamp('1994-03-02 10:11:12')) AS `from_unixtime(unix_timestamp("1994-03-02 10:11:12"))`,('1997-12-31 23:59:59' + interval 1 second) AS `"1997-12-31 23:59:59" + INTERVAL 1 SECOND`,('1998-01-01 00:00:00' - interval 1 second) AS `"1998-01-01 00:00:00" - INTERVAL 1 SECOND`,('1997-12-31' + interval 1 day) AS `INTERVAL 1 DAY + "1997-12-31"`,extract(year from '1999-01-02 10:11:12') AS `extract(YEAR FROM "1999-01-02 10:11:12")`,('1997-12-31 23:59:59' + interval 1 second) AS `date_add("1997-12-31 23:59:59",INTERVAL 1 SECOND)` +Note 1003 select period_add('9602',-12) AS `period_add("9602",-12)`,period_diff(199505,'9404') AS `period_diff(199505,"9404")`,from_days(to_days('960101')) AS `from_days(to_days("960101"))`,dayofmonth('1997-01-02') AS `dayofmonth("1997-01-02")`,month('1997-01-02') AS `month("1997-01-02")`,monthname('1972-03-04') AS `monthname("1972-03-04")`,dayofyear('0000-00-00') AS `dayofyear("0000-00-00")`,hour('1997-03-03 23:03:22') AS `HOUR("1997-03-03 23:03:22")`,minute('23:03:22') AS `MINUTE("23:03:22")`,second(230322) AS `SECOND(230322)`,quarter(980303) AS `QUARTER(980303)`,week('1998-03-03',@@default_week_format) AS `WEEK("1998-03-03")`,yearweek('2000-01-01',1) AS `yearweek("2000-01-01",1)`,week(19950101,1) AS `week(19950101,1)`,year('98-02-03') AS `year("98-02-03")`,(weekday(curdate()) - weekday(now())) AS `weekday(curdate())-weekday(now())`,dayname('1962-03-03') AS `dayname("1962-03-03")`,unix_timestamp() AS `unix_timestamp()`,sec_to_time((time_to_sec('0:30:47') / 6.21)) AS `sec_to_time(time_to_sec("0:30:47")/6.21)`,curtime() AS `curtime()`,utc_time() AS `utc_time()`,curdate() AS `curdate()`,utc_date() AS `utc_date()`,utc_timestamp() AS `utc_timestamp()`,date_format('1997-01-02 03:04:05','%M %W %D %Y %y %m %d %h %i %s %w') AS `date_format("1997-01-02 03:04:05", "%M %W %D %Y %y %m %d %h %i %s %w")`,from_unixtime(unix_timestamp('1994-03-02 10:11:12')) AS `from_unixtime(unix_timestamp("1994-03-02 10:11:12"))`,('1997-12-31 23:59:59' + interval 1 second) AS `"1997-12-31 23:59:59" + INTERVAL 1 SECOND`,('1998-01-01 00:00:00' - interval 1 second) AS `"1998-01-01 00:00:00" - INTERVAL 1 SECOND`,('1997-12-31' + interval 1 day) AS `INTERVAL 1 DAY + "1997-12-31"`,extract(year from '1999-01-02 10:11:12') AS `extract(YEAR FROM "1999-01-02 10:11:12")`,('1997-12-31 23:59:59' + interval 1 second) AS `date_add("1997-12-31 23:59:59",INTERVAL 1 SECOND)` SET @TMP='2007-08-01 12:22:49'; CREATE TABLE t1 (d DATETIME); INSERT INTO t1 VALUES ('2007-08-01 12:22:59'); diff --git a/mysql-test/r/func_weight_string.result b/mysql-test/r/func_weight_string.result index df5b552d9ab..0f52e793843 100644 --- a/mysql-test/r/func_weight_string.result +++ b/mysql-test/r/func_weight_string.result @@ -57,7 +57,7 @@ create table t1 select weight_string(repeat('t',66000)) as w; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `w` longblob + `w` longblob DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; select weight_string(NULL); @@ -144,3 +144,24 @@ DROP TABLE t1; # # End of 10.1 tests # +# +# Start of 10.2 tests +# +# +# MDEV-10134 Add full support for DEFAULT +# +CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET latin1, b VARBINARY(10) DEFAULT WEIGHT_STRING(a AS CHAR(10))); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varbinary(10) DEFAULT WEIGHT_STRING(a AS CHAR(10)) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES ('a'); +SELECT a, HEX(b) FROM t1; +a HEX(b) +a 41202020202020202020 +DROP TABLE t1; +# +# End of 10.2 tests +# diff --git a/mysql-test/r/function_defaults.result b/mysql-test/r/function_defaults.result index b8f42b86c1f..987c505f1fb 100644 --- a/mysql-test/r/function_defaults.result +++ b/mysql-test/r/function_defaults.result @@ -9,50 +9,40 @@ SET TIME_ZONE = "+00:00"; # Test of errors for column data types that dont support function # defaults. # -CREATE TABLE t1( a BIT DEFAULT CURRENT_TIMESTAMP ); -ERROR 42000: Invalid default value for 'a' -CREATE TABLE t1( a TINYINT DEFAULT CURRENT_TIMESTAMP ); -ERROR 42000: Invalid default value for 'a' -CREATE TABLE t1( a SMALLINT DEFAULT CURRENT_TIMESTAMP ); -ERROR 42000: Invalid default value for 'a' -CREATE TABLE t1( a MEDIUMINT DEFAULT CURRENT_TIMESTAMP ); -ERROR 42000: Invalid default value for 'a' -CREATE TABLE t1( a INT DEFAULT CURRENT_TIMESTAMP ); -ERROR 42000: Invalid default value for 'a' -CREATE TABLE t1( a BIGINT DEFAULT CURRENT_TIMESTAMP ); -ERROR 42000: Invalid default value for 'a' -CREATE TABLE t1( a FLOAT DEFAULT CURRENT_TIMESTAMP ); -ERROR 42000: Invalid default value for 'a' -CREATE TABLE t1( a DECIMAL DEFAULT CURRENT_TIMESTAMP ); -ERROR 42000: Invalid default value for 'a' -CREATE TABLE t1( a DATE DEFAULT CURRENT_TIMESTAMP ); -ERROR 42000: Invalid default value for 'a' -CREATE TABLE t1( a TIME DEFAULT CURRENT_TIMESTAMP ); -ERROR 42000: Invalid default value for 'a' -CREATE TABLE t1( a YEAR DEFAULT CURRENT_TIMESTAMP ); -ERROR 42000: Invalid default value for 'a' -CREATE TABLE t1( a BIT ON UPDATE CURRENT_TIMESTAMP ); +CREATE OR REPLACE TABLE t1( a BIT DEFAULT CURRENT_TIMESTAMP ); +CREATE OR REPLACE TABLE t1( a TINYINT DEFAULT CURRENT_TIMESTAMP ); +CREATE OR REPLACE TABLE t1( a SMALLINT DEFAULT CURRENT_TIMESTAMP ); +CREATE OR REPLACE TABLE t1( a MEDIUMINT DEFAULT CURRENT_TIMESTAMP ); +CREATE OR REPLACE TABLE t1( a INT DEFAULT CURRENT_TIMESTAMP ); +CREATE OR REPLACE TABLE t1( a BIGINT DEFAULT CURRENT_TIMESTAMP ); +CREATE OR REPLACE TABLE t1( a FLOAT DEFAULT CURRENT_TIMESTAMP ); +CREATE OR REPLACE TABLE t1( a DECIMAL DEFAULT CURRENT_TIMESTAMP ); +CREATE OR REPLACE TABLE t1( a DATE DEFAULT CURRENT_TIMESTAMP ); +CREATE OR REPLACE TABLE t1( a TIME DEFAULT CURRENT_TIMESTAMP ); +CREATE OR REPLACE TABLE t1( a YEAR DEFAULT CURRENT_TIMESTAMP ); +CREATE OR REPLACE TABLE t1( a BIT ON UPDATE CURRENT_TIMESTAMP ); ERROR HY000: Invalid ON UPDATE clause for 'a' column -CREATE TABLE t1( a TINYINT ON UPDATE CURRENT_TIMESTAMP ); +CREATE OR REPLACE TABLE t1( a TINYINT ON UPDATE CURRENT_TIMESTAMP ); ERROR HY000: Invalid ON UPDATE clause for 'a' column -CREATE TABLE t1( a SMALLINT ON UPDATE CURRENT_TIMESTAMP ); +CREATE OR REPLACE TABLE t1( a SMALLINT ON UPDATE CURRENT_TIMESTAMP ); ERROR HY000: Invalid ON UPDATE clause for 'a' column -CREATE TABLE t1( a MEDIUMINT ON UPDATE CURRENT_TIMESTAMP ); +CREATE OR REPLACE TABLE t1( a MEDIUMINT ON UPDATE CURRENT_TIMESTAMP ); ERROR HY000: Invalid ON UPDATE clause for 'a' column -CREATE TABLE t1( a INT ON UPDATE CURRENT_TIMESTAMP ); +CREATE OR REPLACE TABLE t1( a INT ON UPDATE CURRENT_TIMESTAMP ); ERROR HY000: Invalid ON UPDATE clause for 'a' column -CREATE TABLE t1( a BIGINT ON UPDATE CURRENT_TIMESTAMP ); +CREATE OR REPLACE TABLE t1( a BIGINT ON UPDATE CURRENT_TIMESTAMP ); ERROR HY000: Invalid ON UPDATE clause for 'a' column -CREATE TABLE t1( a FLOAT ON UPDATE CURRENT_TIMESTAMP ); +CREATE OR REPLACE TABLE t1( a FLOAT ON UPDATE CURRENT_TIMESTAMP ); ERROR HY000: Invalid ON UPDATE clause for 'a' column -CREATE TABLE t1( a DECIMAL ON UPDATE CURRENT_TIMESTAMP ); +CREATE OR REPLACE TABLE t1( a DECIMAL ON UPDATE CURRENT_TIMESTAMP ); ERROR HY000: Invalid ON UPDATE clause for 'a' column -CREATE TABLE t1( a DATE ON UPDATE CURRENT_TIMESTAMP ); +CREATE OR REPLACE TABLE t1( a DATE ON UPDATE CURRENT_TIMESTAMP ); ERROR HY000: Invalid ON UPDATE clause for 'a' column -CREATE TABLE t1( a TIME ON UPDATE CURRENT_TIMESTAMP ); +CREATE OR REPLACE TABLE t1( a TIME ON UPDATE CURRENT_TIMESTAMP ); ERROR HY000: Invalid ON UPDATE clause for 'a' column -CREATE TABLE t1( a YEAR ON UPDATE CURRENT_TIMESTAMP ); +CREATE OR REPLACE TABLE t1( a YEAR ON UPDATE CURRENT_TIMESTAMP ); ERROR HY000: Invalid ON UPDATE clause for 'a' column +drop table if exists t1; # # Test that the default clause behaves like NOW() regarding time zones. # @@ -864,8 +854,8 @@ SET TIMESTAMP = 2000.876543; INSERT INTO t2( a ) VALUES ( 3 ); SELECT * FROM t2; b a -0000-00-00 00:00:00 1 -0000-00-00 00:00:00 2 +1970-01-01 00:16:40 1 +1970-01-01 00:16:40 2 1970-01-01 00:33:20 3 DROP TABLE t1, t2; # @@ -1242,7 +1232,7 @@ t1 CREATE TABLE `t1` ( `f` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `g` timestamp NULL DEFAULT NULL, `h` int(11) DEFAULT NULL, - `i` int(11) NOT NULL DEFAULT '42' + `i` int(11) NOT NULL DEFAULT 42 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 LOAD DATA INFILE "file1.dat" INTO table t1; Warnings: @@ -1294,7 +1284,7 @@ t1 CREATE TABLE `t1` ( `f` timestamp NULL DEFAULT CURRENT_TIMESTAMP, `g` timestamp NULL DEFAULT NULL, `h` int(11) DEFAULT NULL, - `i` int(11) NOT NULL DEFAULT '42' + `i` int(11) NOT NULL DEFAULT 42 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 LOAD DATA INFILE "file1.dat" INTO table t1; Warnings: @@ -1361,7 +1351,7 @@ t1 CREATE TABLE `t1` ( `f` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `g` timestamp NULL DEFAULT NULL, `h` int(11) DEFAULT NULL, - `i` int(11) NOT NULL DEFAULT '42' + `i` int(11) NOT NULL DEFAULT 42 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 LOAD DATA INFILE "file2.dat" INTO table t1; Warnings: @@ -1399,7 +1389,7 @@ t1 CREATE TABLE `t1` ( `f` timestamp NULL DEFAULT CURRENT_TIMESTAMP, `g` timestamp NULL DEFAULT NULL, `h` int(11) DEFAULT NULL, - `i` int(11) NOT NULL DEFAULT '42' + `i` int(11) NOT NULL DEFAULT 42 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 LOAD DATA INFILE "file2.dat" INTO table t1; Warnings: @@ -1453,7 +1443,7 @@ a b # 1970-01-01 03:33:20 SET TIMESTAMP = 2000.000234; UPDATE v1 SET a = 2; -ERROR HY000: CHECK OPTION failed 'test.v1' +ERROR 44000: CHECK OPTION failed `test`.`v1` SELECT * FROM t1; a b 1 1970-01-01 03:16:40 @@ -1476,7 +1466,7 @@ a c 1973-08-14 09:11:22 1 SET TIMESTAMP = 1.126789; INSERT INTO v1 ( c ) VALUES ( 1 ) ON DUPLICATE KEY UPDATE c = 2; -ERROR HY000: CHECK OPTION failed 'test.v1' +ERROR 44000: CHECK OPTION failed `test`.`v1` SELECT * FROM v1; a c 1973-08-14 09:11:22 1 @@ -1565,50 +1555,40 @@ SET TIME_ZONE = "+00:00"; # Test of errors for column data types that dont support function # defaults. # -CREATE TABLE t1( a BIT DEFAULT CURRENT_TIMESTAMP(6) ); -ERROR 42000: Invalid default value for 'a' -CREATE TABLE t1( a TINYINT DEFAULT CURRENT_TIMESTAMP(6) ); -ERROR 42000: Invalid default value for 'a' -CREATE TABLE t1( a SMALLINT DEFAULT CURRENT_TIMESTAMP(6) ); -ERROR 42000: Invalid default value for 'a' -CREATE TABLE t1( a MEDIUMINT DEFAULT CURRENT_TIMESTAMP(6) ); -ERROR 42000: Invalid default value for 'a' -CREATE TABLE t1( a INT DEFAULT CURRENT_TIMESTAMP(6) ); -ERROR 42000: Invalid default value for 'a' -CREATE TABLE t1( a BIGINT DEFAULT CURRENT_TIMESTAMP(6) ); -ERROR 42000: Invalid default value for 'a' -CREATE TABLE t1( a FLOAT DEFAULT CURRENT_TIMESTAMP(6) ); -ERROR 42000: Invalid default value for 'a' -CREATE TABLE t1( a DECIMAL DEFAULT CURRENT_TIMESTAMP(6) ); -ERROR 42000: Invalid default value for 'a' -CREATE TABLE t1( a DATE DEFAULT CURRENT_TIMESTAMP(6) ); -ERROR 42000: Invalid default value for 'a' -CREATE TABLE t1( a TIME DEFAULT CURRENT_TIMESTAMP(6) ); -ERROR 42000: Invalid default value for 'a' -CREATE TABLE t1( a YEAR DEFAULT CURRENT_TIMESTAMP(6) ); -ERROR 42000: Invalid default value for 'a' -CREATE TABLE t1( a BIT ON UPDATE CURRENT_TIMESTAMP(6) ); +CREATE OR REPLACE TABLE t1( a BIT DEFAULT CURRENT_TIMESTAMP(6) ); +CREATE OR REPLACE TABLE t1( a TINYINT DEFAULT CURRENT_TIMESTAMP(6) ); +CREATE OR REPLACE TABLE t1( a SMALLINT DEFAULT CURRENT_TIMESTAMP(6) ); +CREATE OR REPLACE TABLE t1( a MEDIUMINT DEFAULT CURRENT_TIMESTAMP(6) ); +CREATE OR REPLACE TABLE t1( a INT DEFAULT CURRENT_TIMESTAMP(6) ); +CREATE OR REPLACE TABLE t1( a BIGINT DEFAULT CURRENT_TIMESTAMP(6) ); +CREATE OR REPLACE TABLE t1( a FLOAT DEFAULT CURRENT_TIMESTAMP(6) ); +CREATE OR REPLACE TABLE t1( a DECIMAL DEFAULT CURRENT_TIMESTAMP(6) ); +CREATE OR REPLACE TABLE t1( a DATE DEFAULT CURRENT_TIMESTAMP(6) ); +CREATE OR REPLACE TABLE t1( a TIME DEFAULT CURRENT_TIMESTAMP(6) ); +CREATE OR REPLACE TABLE t1( a YEAR DEFAULT CURRENT_TIMESTAMP(6) ); +CREATE OR REPLACE TABLE t1( a BIT ON UPDATE CURRENT_TIMESTAMP(6) ); ERROR HY000: Invalid ON UPDATE clause for 'a' column -CREATE TABLE t1( a TINYINT ON UPDATE CURRENT_TIMESTAMP(6) ); +CREATE OR REPLACE TABLE t1( a TINYINT ON UPDATE CURRENT_TIMESTAMP(6) ); ERROR HY000: Invalid ON UPDATE clause for 'a' column -CREATE TABLE t1( a SMALLINT ON UPDATE CURRENT_TIMESTAMP(6) ); +CREATE OR REPLACE TABLE t1( a SMALLINT ON UPDATE CURRENT_TIMESTAMP(6) ); ERROR HY000: Invalid ON UPDATE clause for 'a' column -CREATE TABLE t1( a MEDIUMINT ON UPDATE CURRENT_TIMESTAMP(6) ); +CREATE OR REPLACE TABLE t1( a MEDIUMINT ON UPDATE CURRENT_TIMESTAMP(6) ); ERROR HY000: Invalid ON UPDATE clause for 'a' column -CREATE TABLE t1( a INT ON UPDATE CURRENT_TIMESTAMP(6) ); +CREATE OR REPLACE TABLE t1( a INT ON UPDATE CURRENT_TIMESTAMP(6) ); ERROR HY000: Invalid ON UPDATE clause for 'a' column -CREATE TABLE t1( a BIGINT ON UPDATE CURRENT_TIMESTAMP(6) ); +CREATE OR REPLACE TABLE t1( a BIGINT ON UPDATE CURRENT_TIMESTAMP(6) ); ERROR HY000: Invalid ON UPDATE clause for 'a' column -CREATE TABLE t1( a FLOAT ON UPDATE CURRENT_TIMESTAMP(6) ); +CREATE OR REPLACE TABLE t1( a FLOAT ON UPDATE CURRENT_TIMESTAMP(6) ); ERROR HY000: Invalid ON UPDATE clause for 'a' column -CREATE TABLE t1( a DECIMAL ON UPDATE CURRENT_TIMESTAMP(6) ); +CREATE OR REPLACE TABLE t1( a DECIMAL ON UPDATE CURRENT_TIMESTAMP(6) ); ERROR HY000: Invalid ON UPDATE clause for 'a' column -CREATE TABLE t1( a DATE ON UPDATE CURRENT_TIMESTAMP(6) ); +CREATE OR REPLACE TABLE t1( a DATE ON UPDATE CURRENT_TIMESTAMP(6) ); ERROR HY000: Invalid ON UPDATE clause for 'a' column -CREATE TABLE t1( a TIME ON UPDATE CURRENT_TIMESTAMP(6) ); +CREATE OR REPLACE TABLE t1( a TIME ON UPDATE CURRENT_TIMESTAMP(6) ); ERROR HY000: Invalid ON UPDATE clause for 'a' column -CREATE TABLE t1( a YEAR ON UPDATE CURRENT_TIMESTAMP(6) ); +CREATE OR REPLACE TABLE t1( a YEAR ON UPDATE CURRENT_TIMESTAMP(6) ); ERROR HY000: Invalid ON UPDATE clause for 'a' column +drop table if exists t1; # # Test that the default clause behaves like NOW() regarding time zones. # @@ -2420,8 +2400,8 @@ SET TIMESTAMP = 2000.876543; INSERT INTO t2( a ) VALUES ( 3 ); SELECT * FROM t2; b a -0000-00-00 00:00:00.000000 1 -0000-00-00 00:00:00.000000 2 +1970-01-01 00:16:40.987654 1 +1970-01-01 00:16:40.987654 2 1970-01-01 00:33:20.876543 3 DROP TABLE t1, t2; # @@ -2798,7 +2778,7 @@ t1 CREATE TABLE `t1` ( `f` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), `g` timestamp(6) NULL DEFAULT NULL, `h` int(11) DEFAULT NULL, - `i` int(11) NOT NULL DEFAULT '42' + `i` int(11) NOT NULL DEFAULT 42 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 LOAD DATA INFILE "file1.dat" INTO table t1; Warnings: @@ -2850,7 +2830,7 @@ t1 CREATE TABLE `t1` ( `f` timestamp NULL DEFAULT CURRENT_TIMESTAMP, `g` timestamp(6) NULL DEFAULT NULL, `h` int(11) DEFAULT NULL, - `i` int(11) NOT NULL DEFAULT '42' + `i` int(11) NOT NULL DEFAULT 42 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 LOAD DATA INFILE "file1.dat" INTO table t1; Warnings: @@ -2917,7 +2897,7 @@ t1 CREATE TABLE `t1` ( `f` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), `g` timestamp(6) NULL DEFAULT NULL, `h` int(11) DEFAULT NULL, - `i` int(11) NOT NULL DEFAULT '42' + `i` int(11) NOT NULL DEFAULT 42 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 LOAD DATA INFILE "file2.dat" INTO table t1; Warnings: @@ -2955,7 +2935,7 @@ t1 CREATE TABLE `t1` ( `f` timestamp NULL DEFAULT CURRENT_TIMESTAMP, `g` timestamp(6) NULL DEFAULT NULL, `h` int(11) DEFAULT NULL, - `i` int(11) NOT NULL DEFAULT '42' + `i` int(11) NOT NULL DEFAULT 42 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 LOAD DATA INFILE "file2.dat" INTO table t1; Warnings: @@ -3009,7 +2989,7 @@ a b # 1970-01-01 03:33:20 SET TIMESTAMP = 2000.000234; UPDATE v1 SET a = 2; -ERROR HY000: CHECK OPTION failed 'test.v1' +ERROR 44000: CHECK OPTION failed `test`.`v1` SELECT * FROM t1; a b 1 1970-01-01 03:16:40.123456 @@ -3032,7 +3012,7 @@ a c 1973-08-14 09:11:22.089786 1 SET TIMESTAMP = 1.126789; INSERT INTO v1 ( c ) VALUES ( 1 ) ON DUPLICATE KEY UPDATE c = 2; -ERROR HY000: CHECK OPTION failed 'test.v1' +ERROR 44000: CHECK OPTION failed `test`.`v1` SELECT * FROM v1; a c 1973-08-14 09:11:22.089786 1 diff --git a/mysql-test/r/function_defaults_innodb.result b/mysql-test/r/function_defaults_innodb.result index 2525d4e948a..b539f70a3cb 100644 --- a/mysql-test/r/function_defaults_innodb.result +++ b/mysql-test/r/function_defaults_innodb.result @@ -10,50 +10,40 @@ SET TIME_ZONE = "+00:00"; # Test of errors for column data types that dont support function # defaults. # -CREATE TABLE t1( a BIT DEFAULT CURRENT_TIMESTAMP ); -ERROR 42000: Invalid default value for 'a' -CREATE TABLE t1( a TINYINT DEFAULT CURRENT_TIMESTAMP ); -ERROR 42000: Invalid default value for 'a' -CREATE TABLE t1( a SMALLINT DEFAULT CURRENT_TIMESTAMP ); -ERROR 42000: Invalid default value for 'a' -CREATE TABLE t1( a MEDIUMINT DEFAULT CURRENT_TIMESTAMP ); -ERROR 42000: Invalid default value for 'a' -CREATE TABLE t1( a INT DEFAULT CURRENT_TIMESTAMP ); -ERROR 42000: Invalid default value for 'a' -CREATE TABLE t1( a BIGINT DEFAULT CURRENT_TIMESTAMP ); -ERROR 42000: Invalid default value for 'a' -CREATE TABLE t1( a FLOAT DEFAULT CURRENT_TIMESTAMP ); -ERROR 42000: Invalid default value for 'a' -CREATE TABLE t1( a DECIMAL DEFAULT CURRENT_TIMESTAMP ); -ERROR 42000: Invalid default value for 'a' -CREATE TABLE t1( a DATE DEFAULT CURRENT_TIMESTAMP ); -ERROR 42000: Invalid default value for 'a' -CREATE TABLE t1( a TIME DEFAULT CURRENT_TIMESTAMP ); -ERROR 42000: Invalid default value for 'a' -CREATE TABLE t1( a YEAR DEFAULT CURRENT_TIMESTAMP ); -ERROR 42000: Invalid default value for 'a' -CREATE TABLE t1( a BIT ON UPDATE CURRENT_TIMESTAMP ); +CREATE OR REPLACE TABLE t1( a BIT DEFAULT CURRENT_TIMESTAMP ); +CREATE OR REPLACE TABLE t1( a TINYINT DEFAULT CURRENT_TIMESTAMP ); +CREATE OR REPLACE TABLE t1( a SMALLINT DEFAULT CURRENT_TIMESTAMP ); +CREATE OR REPLACE TABLE t1( a MEDIUMINT DEFAULT CURRENT_TIMESTAMP ); +CREATE OR REPLACE TABLE t1( a INT DEFAULT CURRENT_TIMESTAMP ); +CREATE OR REPLACE TABLE t1( a BIGINT DEFAULT CURRENT_TIMESTAMP ); +CREATE OR REPLACE TABLE t1( a FLOAT DEFAULT CURRENT_TIMESTAMP ); +CREATE OR REPLACE TABLE t1( a DECIMAL DEFAULT CURRENT_TIMESTAMP ); +CREATE OR REPLACE TABLE t1( a DATE DEFAULT CURRENT_TIMESTAMP ); +CREATE OR REPLACE TABLE t1( a TIME DEFAULT CURRENT_TIMESTAMP ); +CREATE OR REPLACE TABLE t1( a YEAR DEFAULT CURRENT_TIMESTAMP ); +CREATE OR REPLACE TABLE t1( a BIT ON UPDATE CURRENT_TIMESTAMP ); ERROR HY000: Invalid ON UPDATE clause for 'a' column -CREATE TABLE t1( a TINYINT ON UPDATE CURRENT_TIMESTAMP ); +CREATE OR REPLACE TABLE t1( a TINYINT ON UPDATE CURRENT_TIMESTAMP ); ERROR HY000: Invalid ON UPDATE clause for 'a' column -CREATE TABLE t1( a SMALLINT ON UPDATE CURRENT_TIMESTAMP ); +CREATE OR REPLACE TABLE t1( a SMALLINT ON UPDATE CURRENT_TIMESTAMP ); ERROR HY000: Invalid ON UPDATE clause for 'a' column -CREATE TABLE t1( a MEDIUMINT ON UPDATE CURRENT_TIMESTAMP ); +CREATE OR REPLACE TABLE t1( a MEDIUMINT ON UPDATE CURRENT_TIMESTAMP ); ERROR HY000: Invalid ON UPDATE clause for 'a' column -CREATE TABLE t1( a INT ON UPDATE CURRENT_TIMESTAMP ); +CREATE OR REPLACE TABLE t1( a INT ON UPDATE CURRENT_TIMESTAMP ); ERROR HY000: Invalid ON UPDATE clause for 'a' column -CREATE TABLE t1( a BIGINT ON UPDATE CURRENT_TIMESTAMP ); +CREATE OR REPLACE TABLE t1( a BIGINT ON UPDATE CURRENT_TIMESTAMP ); ERROR HY000: Invalid ON UPDATE clause for 'a' column -CREATE TABLE t1( a FLOAT ON UPDATE CURRENT_TIMESTAMP ); +CREATE OR REPLACE TABLE t1( a FLOAT ON UPDATE CURRENT_TIMESTAMP ); ERROR HY000: Invalid ON UPDATE clause for 'a' column -CREATE TABLE t1( a DECIMAL ON UPDATE CURRENT_TIMESTAMP ); +CREATE OR REPLACE TABLE t1( a DECIMAL ON UPDATE CURRENT_TIMESTAMP ); ERROR HY000: Invalid ON UPDATE clause for 'a' column -CREATE TABLE t1( a DATE ON UPDATE CURRENT_TIMESTAMP ); +CREATE OR REPLACE TABLE t1( a DATE ON UPDATE CURRENT_TIMESTAMP ); ERROR HY000: Invalid ON UPDATE clause for 'a' column -CREATE TABLE t1( a TIME ON UPDATE CURRENT_TIMESTAMP ); +CREATE OR REPLACE TABLE t1( a TIME ON UPDATE CURRENT_TIMESTAMP ); ERROR HY000: Invalid ON UPDATE clause for 'a' column -CREATE TABLE t1( a YEAR ON UPDATE CURRENT_TIMESTAMP ); +CREATE OR REPLACE TABLE t1( a YEAR ON UPDATE CURRENT_TIMESTAMP ); ERROR HY000: Invalid ON UPDATE clause for 'a' column +drop table if exists t1; # # Test that the default clause behaves like NOW() regarding time zones. # @@ -865,8 +855,8 @@ SET TIMESTAMP = 2000.876543; INSERT INTO t2( a ) VALUES ( 3 ); SELECT * FROM t2; b a -0000-00-00 00:00:00 1 -0000-00-00 00:00:00 2 +1970-01-01 00:16:40 1 +1970-01-01 00:16:40 2 1970-01-01 00:33:20 3 DROP TABLE t1, t2; # @@ -1243,7 +1233,7 @@ t1 CREATE TABLE `t1` ( `f` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `g` timestamp NULL DEFAULT NULL, `h` int(11) DEFAULT NULL, - `i` int(11) NOT NULL DEFAULT '42' + `i` int(11) NOT NULL DEFAULT 42 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 LOAD DATA INFILE "file1.dat" INTO table t1; Warnings: @@ -1295,7 +1285,7 @@ t1 CREATE TABLE `t1` ( `f` timestamp NULL DEFAULT CURRENT_TIMESTAMP, `g` timestamp NULL DEFAULT NULL, `h` int(11) DEFAULT NULL, - `i` int(11) NOT NULL DEFAULT '42' + `i` int(11) NOT NULL DEFAULT 42 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 LOAD DATA INFILE "file1.dat" INTO table t1; Warnings: @@ -1362,7 +1352,7 @@ t1 CREATE TABLE `t1` ( `f` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `g` timestamp NULL DEFAULT NULL, `h` int(11) DEFAULT NULL, - `i` int(11) NOT NULL DEFAULT '42' + `i` int(11) NOT NULL DEFAULT 42 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 LOAD DATA INFILE "file2.dat" INTO table t1; Warnings: @@ -1400,7 +1390,7 @@ t1 CREATE TABLE `t1` ( `f` timestamp NULL DEFAULT CURRENT_TIMESTAMP, `g` timestamp NULL DEFAULT NULL, `h` int(11) DEFAULT NULL, - `i` int(11) NOT NULL DEFAULT '42' + `i` int(11) NOT NULL DEFAULT 42 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 LOAD DATA INFILE "file2.dat" INTO table t1; Warnings: @@ -1454,7 +1444,7 @@ a b # 1970-01-01 03:33:20 SET TIMESTAMP = 2000.000234; UPDATE v1 SET a = 2; -ERROR HY000: CHECK OPTION failed 'test.v1' +ERROR 44000: CHECK OPTION failed `test`.`v1` SELECT * FROM t1; a b 1 1970-01-01 03:16:40 @@ -1477,7 +1467,7 @@ a c 1973-08-14 09:11:22 1 SET TIMESTAMP = 1.126789; INSERT INTO v1 ( c ) VALUES ( 1 ) ON DUPLICATE KEY UPDATE c = 2; -ERROR HY000: CHECK OPTION failed 'test.v1' +ERROR 44000: CHECK OPTION failed `test`.`v1` SELECT * FROM v1; a c 1973-08-14 09:11:22 1 @@ -1566,50 +1556,40 @@ SET TIME_ZONE = "+00:00"; # Test of errors for column data types that dont support function # defaults. # -CREATE TABLE t1( a BIT DEFAULT CURRENT_TIMESTAMP(6) ); -ERROR 42000: Invalid default value for 'a' -CREATE TABLE t1( a TINYINT DEFAULT CURRENT_TIMESTAMP(6) ); -ERROR 42000: Invalid default value for 'a' -CREATE TABLE t1( a SMALLINT DEFAULT CURRENT_TIMESTAMP(6) ); -ERROR 42000: Invalid default value for 'a' -CREATE TABLE t1( a MEDIUMINT DEFAULT CURRENT_TIMESTAMP(6) ); -ERROR 42000: Invalid default value for 'a' -CREATE TABLE t1( a INT DEFAULT CURRENT_TIMESTAMP(6) ); -ERROR 42000: Invalid default value for 'a' -CREATE TABLE t1( a BIGINT DEFAULT CURRENT_TIMESTAMP(6) ); -ERROR 42000: Invalid default value for 'a' -CREATE TABLE t1( a FLOAT DEFAULT CURRENT_TIMESTAMP(6) ); -ERROR 42000: Invalid default value for 'a' -CREATE TABLE t1( a DECIMAL DEFAULT CURRENT_TIMESTAMP(6) ); -ERROR 42000: Invalid default value for 'a' -CREATE TABLE t1( a DATE DEFAULT CURRENT_TIMESTAMP(6) ); -ERROR 42000: Invalid default value for 'a' -CREATE TABLE t1( a TIME DEFAULT CURRENT_TIMESTAMP(6) ); -ERROR 42000: Invalid default value for 'a' -CREATE TABLE t1( a YEAR DEFAULT CURRENT_TIMESTAMP(6) ); -ERROR 42000: Invalid default value for 'a' -CREATE TABLE t1( a BIT ON UPDATE CURRENT_TIMESTAMP(6) ); +CREATE OR REPLACE TABLE t1( a BIT DEFAULT CURRENT_TIMESTAMP(6) ); +CREATE OR REPLACE TABLE t1( a TINYINT DEFAULT CURRENT_TIMESTAMP(6) ); +CREATE OR REPLACE TABLE t1( a SMALLINT DEFAULT CURRENT_TIMESTAMP(6) ); +CREATE OR REPLACE TABLE t1( a MEDIUMINT DEFAULT CURRENT_TIMESTAMP(6) ); +CREATE OR REPLACE TABLE t1( a INT DEFAULT CURRENT_TIMESTAMP(6) ); +CREATE OR REPLACE TABLE t1( a BIGINT DEFAULT CURRENT_TIMESTAMP(6) ); +CREATE OR REPLACE TABLE t1( a FLOAT DEFAULT CURRENT_TIMESTAMP(6) ); +CREATE OR REPLACE TABLE t1( a DECIMAL DEFAULT CURRENT_TIMESTAMP(6) ); +CREATE OR REPLACE TABLE t1( a DATE DEFAULT CURRENT_TIMESTAMP(6) ); +CREATE OR REPLACE TABLE t1( a TIME DEFAULT CURRENT_TIMESTAMP(6) ); +CREATE OR REPLACE TABLE t1( a YEAR DEFAULT CURRENT_TIMESTAMP(6) ); +CREATE OR REPLACE TABLE t1( a BIT ON UPDATE CURRENT_TIMESTAMP(6) ); ERROR HY000: Invalid ON UPDATE clause for 'a' column -CREATE TABLE t1( a TINYINT ON UPDATE CURRENT_TIMESTAMP(6) ); +CREATE OR REPLACE TABLE t1( a TINYINT ON UPDATE CURRENT_TIMESTAMP(6) ); ERROR HY000: Invalid ON UPDATE clause for 'a' column -CREATE TABLE t1( a SMALLINT ON UPDATE CURRENT_TIMESTAMP(6) ); +CREATE OR REPLACE TABLE t1( a SMALLINT ON UPDATE CURRENT_TIMESTAMP(6) ); ERROR HY000: Invalid ON UPDATE clause for 'a' column -CREATE TABLE t1( a MEDIUMINT ON UPDATE CURRENT_TIMESTAMP(6) ); +CREATE OR REPLACE TABLE t1( a MEDIUMINT ON UPDATE CURRENT_TIMESTAMP(6) ); ERROR HY000: Invalid ON UPDATE clause for 'a' column -CREATE TABLE t1( a INT ON UPDATE CURRENT_TIMESTAMP(6) ); +CREATE OR REPLACE TABLE t1( a INT ON UPDATE CURRENT_TIMESTAMP(6) ); ERROR HY000: Invalid ON UPDATE clause for 'a' column -CREATE TABLE t1( a BIGINT ON UPDATE CURRENT_TIMESTAMP(6) ); +CREATE OR REPLACE TABLE t1( a BIGINT ON UPDATE CURRENT_TIMESTAMP(6) ); ERROR HY000: Invalid ON UPDATE clause for 'a' column -CREATE TABLE t1( a FLOAT ON UPDATE CURRENT_TIMESTAMP(6) ); +CREATE OR REPLACE TABLE t1( a FLOAT ON UPDATE CURRENT_TIMESTAMP(6) ); ERROR HY000: Invalid ON UPDATE clause for 'a' column -CREATE TABLE t1( a DECIMAL ON UPDATE CURRENT_TIMESTAMP(6) ); +CREATE OR REPLACE TABLE t1( a DECIMAL ON UPDATE CURRENT_TIMESTAMP(6) ); ERROR HY000: Invalid ON UPDATE clause for 'a' column -CREATE TABLE t1( a DATE ON UPDATE CURRENT_TIMESTAMP(6) ); +CREATE OR REPLACE TABLE t1( a DATE ON UPDATE CURRENT_TIMESTAMP(6) ); ERROR HY000: Invalid ON UPDATE clause for 'a' column -CREATE TABLE t1( a TIME ON UPDATE CURRENT_TIMESTAMP(6) ); +CREATE OR REPLACE TABLE t1( a TIME ON UPDATE CURRENT_TIMESTAMP(6) ); ERROR HY000: Invalid ON UPDATE clause for 'a' column -CREATE TABLE t1( a YEAR ON UPDATE CURRENT_TIMESTAMP(6) ); +CREATE OR REPLACE TABLE t1( a YEAR ON UPDATE CURRENT_TIMESTAMP(6) ); ERROR HY000: Invalid ON UPDATE clause for 'a' column +drop table if exists t1; # # Test that the default clause behaves like NOW() regarding time zones. # @@ -2421,8 +2401,8 @@ SET TIMESTAMP = 2000.876543; INSERT INTO t2( a ) VALUES ( 3 ); SELECT * FROM t2; b a -0000-00-00 00:00:00.000000 1 -0000-00-00 00:00:00.000000 2 +1970-01-01 00:16:40.987654 1 +1970-01-01 00:16:40.987654 2 1970-01-01 00:33:20.876543 3 DROP TABLE t1, t2; # @@ -2799,7 +2779,7 @@ t1 CREATE TABLE `t1` ( `f` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), `g` timestamp(6) NULL DEFAULT NULL, `h` int(11) DEFAULT NULL, - `i` int(11) NOT NULL DEFAULT '42' + `i` int(11) NOT NULL DEFAULT 42 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 LOAD DATA INFILE "file1.dat" INTO table t1; Warnings: @@ -2851,7 +2831,7 @@ t1 CREATE TABLE `t1` ( `f` timestamp NULL DEFAULT CURRENT_TIMESTAMP, `g` timestamp(6) NULL DEFAULT NULL, `h` int(11) DEFAULT NULL, - `i` int(11) NOT NULL DEFAULT '42' + `i` int(11) NOT NULL DEFAULT 42 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 LOAD DATA INFILE "file1.dat" INTO table t1; Warnings: @@ -2918,7 +2898,7 @@ t1 CREATE TABLE `t1` ( `f` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), `g` timestamp(6) NULL DEFAULT NULL, `h` int(11) DEFAULT NULL, - `i` int(11) NOT NULL DEFAULT '42' + `i` int(11) NOT NULL DEFAULT 42 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 LOAD DATA INFILE "file2.dat" INTO table t1; Warnings: @@ -2956,7 +2936,7 @@ t1 CREATE TABLE `t1` ( `f` timestamp NULL DEFAULT CURRENT_TIMESTAMP, `g` timestamp(6) NULL DEFAULT NULL, `h` int(11) DEFAULT NULL, - `i` int(11) NOT NULL DEFAULT '42' + `i` int(11) NOT NULL DEFAULT 42 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 LOAD DATA INFILE "file2.dat" INTO table t1; Warnings: @@ -3010,7 +2990,7 @@ a b # 1970-01-01 03:33:20 SET TIMESTAMP = 2000.000234; UPDATE v1 SET a = 2; -ERROR HY000: CHECK OPTION failed 'test.v1' +ERROR 44000: CHECK OPTION failed `test`.`v1` SELECT * FROM t1; a b 1 1970-01-01 03:16:40.123456 @@ -3033,7 +3013,7 @@ a c 1973-08-14 09:11:22.089786 1 SET TIMESTAMP = 1.126789; INSERT INTO v1 ( c ) VALUES ( 1 ) ON DUPLICATE KEY UPDATE c = 2; -ERROR HY000: CHECK OPTION failed 'test.v1' +ERROR 44000: CHECK OPTION failed `test`.`v1` SELECT * FROM v1; a c 1973-08-14 09:11:22.089786 1 diff --git a/mysql-test/r/gis-debug.result b/mysql-test/r/gis-debug.result index 5e8b4747f6d..79adef34b98 100644 --- a/mysql-test/r/gis-debug.result +++ b/mysql-test/r/gis-debug.result @@ -294,3 +294,14 @@ SRID(GEOMETRYFROMTEXT(' MULTIPOINT(8 4,5 0,7 8,6 9,3 4,7 3,5 5) ')))); ASTEXT(ST_BUFFER(POLYGONFROMTEXT(' POLYGON((9 9,5 2,4 5,9 9))'), SRID(GEOMETRYFROMTEXT(' MULTIPOINT(8 4,5 0,7 8,6 9,3 4,7 3,5 5) ')))) POLYGON((9 9,5 2,4 5,9 9)) +# +# Start of 10.2 tests +# +# +# MDEV-10134 Add full support for DEFAULT +# +CREATE TABLE t1 (a INT DEFAULT ST_GIS_DEBUG(1)); +ERROR HY000: Function or expression 'st_gis_debug()' cannot be used in the DEFAULT clause of `a` +# +# End of 10.2 tests +# diff --git a/mysql-test/r/gis-rtree.result b/mysql-test/r/gis-rtree.result index 0506a0b2a0a..43c51b838e2 100644 --- a/mysql-test/r/gis-rtree.result +++ b/mysql-test/r/gis-rtree.result @@ -804,8 +804,6 @@ INSERT INTO t2 SELECT GeomFromText(st) FROM t1; ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field drop table t1, t2; CREATE TABLE t1 (`geometry` geometry NOT NULL default '',SPATIAL KEY `gndx` (`geometry`)) ENGINE=MyISAM DEFAULT CHARSET=latin1; -Warnings: -Warning 1101 BLOB/TEXT column 'geometry' can't have a default value INSERT INTO t1 (geometry) VALUES (PolygonFromText('POLYGON((-18.6086111000 -66.9327777000, -18.6055555000 -66.8158332999, -18.7186111000 -66.8102777000, -18.7211111000 -66.9269443999, @@ -822,8 +820,6 @@ CREATE TABLE t1 ( c1 geometry NOT NULL default '', SPATIAL KEY i1 (c1) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -Warnings: -Warning 1101 BLOB/TEXT column 'c1' can't have a default value INSERT INTO t1 (c1) VALUES ( PolygonFromText('POLYGON((-18.6086111000 -66.9327777000, -18.6055555000 -66.8158332999, @@ -838,8 +834,6 @@ CREATE TABLE t1 ( c1 geometry NOT NULL default '', SPATIAL KEY i1 (c1) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -Warnings: -Warning 1101 BLOB/TEXT column 'c1' can't have a default value INSERT INTO t1 (c1) VALUES ( PolygonFromText('POLYGON((-18.6086111000 -66.9327777000, -18.6055555000 -66.8158332999, diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result index 33080509114..d10cfec6003 100644 --- a/mysql-test/r/gis.result +++ b/mysql-test/r/gis.result @@ -614,8 +614,6 @@ t1 CREATE TABLE `t1` ( drop table t1; CREATE TABLE `t1` (`object_id` bigint(20) unsigned NOT NULL default '0', `geo` geometry NOT NULL default '') ENGINE=MyISAM ; -Warnings: -Warning 1101 BLOB/TEXT column 'geo' can't have a default value insert into t1 values ('85984',GeomFromText('MULTIPOLYGON(((-115.006363 36.305435,-114.992394 36.305202,-114.991219 36.305975,-114.991163 36.306845,-114.989432 36.309452,-114.978275 36.312642,-114.977363 @@ -1716,18 +1714,18 @@ GEOMETRY_COLUMNS CREATE TEMPORARY TABLE `GEOMETRY_COLUMNS` ( `G_TABLE_SCHEMA` varchar(64) NOT NULL DEFAULT '', `G_TABLE_NAME` varchar(64) NOT NULL DEFAULT '', `G_GEOMETRY_COLUMN` varchar(64) NOT NULL DEFAULT '', - `STORAGE_TYPE` tinyint(2) NOT NULL DEFAULT '0', - `GEOMETRY_TYPE` int(7) NOT NULL DEFAULT '0', - `COORD_DIMENSION` tinyint(2) NOT NULL DEFAULT '0', - `MAX_PPR` tinyint(2) NOT NULL DEFAULT '0', - `SRID` smallint(5) NOT NULL DEFAULT '0' + `STORAGE_TYPE` tinyint(2) NOT NULL DEFAULT 0, + `GEOMETRY_TYPE` int(7) NOT NULL DEFAULT 0, + `COORD_DIMENSION` tinyint(2) NOT NULL DEFAULT 0, + `MAX_PPR` tinyint(2) NOT NULL DEFAULT 0, + `SRID` smallint(5) NOT NULL DEFAULT 0 ) ENGINE=MEMORY DEFAULT CHARSET=utf8 SHOW CREATE TABLE information_schema.spatial_ref_sys; Table Create Table SPATIAL_REF_SYS CREATE TEMPORARY TABLE `SPATIAL_REF_SYS` ( - `SRID` smallint(5) NOT NULL DEFAULT '0', + `SRID` smallint(5) NOT NULL DEFAULT 0, `AUTH_NAME` varchar(512) NOT NULL DEFAULT '', - `AUTH_SRID` int(5) NOT NULL DEFAULT '0', + `AUTH_SRID` int(5) NOT NULL DEFAULT 0, `SRTEXT` varchar(2048) NOT NULL DEFAULT '' ) ENGINE=MEMORY DEFAULT CHARSET=utf8 create table t1(g GEOMETRY, pt POINT); @@ -1831,3 +1829,367 @@ t2 CREATE TABLE `t2` ( `w2` int(1) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1,t2; +# +# Start of 10.2 tests +# +# +# MDEV-10134 Add full support for DEFAULT +# +CREATE TABLE t1 (a POINT, x DOUBLE DEFAULT x(a), y DOUBLE DEFAULT y(a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` point DEFAULT NULL, + `x` double DEFAULT x(a), + `y` double DEFAULT y(a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES (Point(1,2)); +SELECT x,y FROM t1; +x y +1 2 +DROP TABLE t1; +CREATE TABLE t1 (g GEOMETRY, area DOUBLE DEFAULT ST_AREA(g)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `g` geometry DEFAULT NULL, + `area` double DEFAULT ST_AREA(g) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (g) VALUES (GeomFromText('POLYGON((0 0,20 0,20 20,0 20,0 0))')); +SELECT area FROM t1; +area +400 +DROP TABLE t1; +CREATE TABLE t1 (g GEOMETRY, length DOUBLE DEFAULT ST_LENGTH(g)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `g` geometry DEFAULT NULL, + `length` double DEFAULT ST_LENGTH(g) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (g) VALUES (GeomFromText('LINESTRING(0 0,20 0,20 20,0 20,0 0)')); +SELECT length FROM t1; +length +80 +DROP TABLE t1; +CREATE TABLE t1 (g POINT, distance DOUBLE DEFAULT ST_DISTANCE(g, POINT(0,0))); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `g` point DEFAULT NULL, + `distance` double DEFAULT ST_DISTANCE(g, POINT(0,0)) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (g) VALUES (Point(1,0)); +SELECT distance FROM t1; +distance +1 +DROP TABLE t1; +CREATE TABLE t1 (a TEXT, g GEOMETRY DEFAULT GeomFromText(a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` text DEFAULT NULL, + `g` geometry DEFAULT GeomFromText(a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES ('point(1 1)'); +SELECT AsText(g) FROM t1; +AsText(g) +POINT(1 1) +DROP TABLE t1; +CREATE TABLE t1 (x INT, y INT, g GEOMETRY DEFAULT POINT(x,y)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `x` int(11) DEFAULT NULL, + `y` int(11) DEFAULT NULL, + `g` geometry DEFAULT POINT(x,y) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (x,y) VALUES (10,20); +SELECT AsText(g) FROM t1; +AsText(g) +POINT(10 20) +DROP TABLE t1; +CREATE TABLE t1 (a GEOMETRY, b GEOMETRY DEFAULT PointN(a,2)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` geometry DEFAULT NULL, + `b` geometry DEFAULT PointN(a,2) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES (GeomFromText('LineString(1 1,2 2,3 3)')); +SELECT AsText(b) FROM t1; +AsText(b) +POINT(2 2) +DROP TABLE t1; +CREATE TABLE t1 (a GEOMETRY, b GEOMETRY DEFAULT StartPoint(a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` geometry DEFAULT NULL, + `b` geometry DEFAULT StartPoint(a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES (GeomFromText('LineString(1 1,2 2,3 3)')); +SELECT AsText(b) FROM t1; +AsText(b) +POINT(1 1) +DROP TABLE t1; +CREATE TABLE t1 (a GEOMETRY, b GEOMETRY, c GEOMETRY DEFAULT GeometryCollection(a,b)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` geometry DEFAULT NULL, + `b` geometry DEFAULT NULL, + `c` geometry DEFAULT GeometryCollection(a,b) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a,b) VALUES (Point(1,1), Point(2,2)); +SELECT AsText(c) FROM t1; +AsText(c) +GEOMETRYCOLLECTION(POINT(1 1),POINT(2 2)) +DROP TABLE t1; +CREATE TABLE t1 (a GEOMETRY, b GEOMETRY DEFAULT GeomFromWKB(AsBinary(a),20)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` geometry DEFAULT NULL, + `b` geometry DEFAULT GeomFromWKB(AsBinary(a),20) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES (GeomFromText('POINT(1 1)', 10)); +SELECT AsText(a), SRID(a), AsText(b), SRID(b) FROM t1; +AsText(a) SRID(a) AsText(b) SRID(b) +POINT(1 1) 10 POINT(1 1) 20 +DROP TABLE t1; +CREATE TABLE t1 (a GEOMETRY, b GEOMETRY DEFAULT BOUNDARY(a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` geometry DEFAULT NULL, + `b` geometry DEFAULT BOUNDARY(a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES (GeomFromText('POLYGON((10 10, 10 20, 20 20, 20 10, 10 10))')); +SELECT AsText(b) FROM t1; +AsText(b) +LINESTRING(10 10,10 20,20 20,20 10,10 10) +DROP TABLE t1; +CREATE TABLE t1 (a GEOMETRY, b GEOMETRY DEFAULT BUFFER(a,10)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` geometry DEFAULT NULL, + `b` geometry DEFAULT BUFFER(a,10) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES (GeomFromText('POLYGON((10 10, 10 20, 20 20, 20 10, 10 10))')); +SELECT GeometryType(b) FROM t1; +GeometryType(b) +POLYGON +DROP TABLE t1; +CREATE TABLE t1 (a GEOMETRY, b GEOMETRY DEFAULT CENTROID(a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` geometry DEFAULT NULL, + `b` geometry DEFAULT CENTROID(a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES (GeomFromText('POLYGON((10 10, 10 20, 20 20, 20 10, 10 10))')); +SELECT AsText(b) FROM t1; +AsText(b) +POINT(15 15) +DROP TABLE t1; +CREATE TABLE t1 (a GEOMETRY, b GEOMETRY DEFAULT ENVELOPE(a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` geometry DEFAULT NULL, + `b` geometry DEFAULT ENVELOPE(a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES (GeomFromText('LineString(1 1,4 4)')); +SELECT AsText(b) FROM t1; +AsText(b) +POLYGON((1 1,4 1,4 4,1 4,1 1)) +DROP TABLE t1; +CREATE TABLE t1 (a GEOMETRY, b GEOMETRY DEFAULT PointOnSurface(a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` geometry DEFAULT NULL, + `b` geometry DEFAULT PointOnSurface(a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES (GeomFromText('POLYGON((10 10, 10 20, 20 20, 20 10, 10 10))')); +SELECT GeometryType(b) FROM t1; +GeometryType(b) +POINT +DROP TABLE t1; +CREATE TABLE t1 (a GEOMETRY, b GEOMETRY DEFAULT Point(1,1), c GEOMETRY DEFAULT ST_UNION(a,b)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` geometry DEFAULT NULL, + `b` geometry DEFAULT Point(1,1), + `c` geometry DEFAULT ST_UNION(a,b) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES (Point(0,0)); +SELECT AsText(c) FROM t1; +AsText(c) +MULTIPOINT(0 0,1 1) +DROP TABLE t1; +CREATE TABLE t1 (a GEOMETRY, b VARCHAR(20) DEFAULT GeometryType(a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` geometry DEFAULT NULL, + `b` varchar(20) DEFAULT GeometryType(a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES (Point(0, 0)); +SELECT b FROM t1; +b +POINT +DROP TABLE t1; +CREATE TABLE t1 (a GEOMETRY, b INT DEFAULT IsSimple(a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` geometry DEFAULT NULL, + `b` int(11) DEFAULT IsSimple(a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES (Point(0, 0)); +SELECT b FROM t1; +b +1 +DROP TABLE t1; +CREATE TABLE t1 (a GEOMETRY, b INT DEFAULT IsEmpty(a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` geometry DEFAULT NULL, + `b` int(11) DEFAULT IsEmpty(a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES (Point(0, 0)); +SELECT b FROM t1; +b +0 +DROP TABLE t1; +CREATE TABLE t1 (a GEOMETRY, b INT DEFAULT IsRing(a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` geometry DEFAULT NULL, + `b` int(11) DEFAULT IsRing(a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES (GeomFromText('LineString(0 0,0 1,1 1,1 0,0 0)')); +SELECT b FROM t1; +b +1 +DROP TABLE t1; +CREATE TABLE t1 (a GEOMETRY, b INT DEFAULT IsClosed(a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` geometry DEFAULT NULL, + `b` int(11) DEFAULT IsClosed(a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES (GeomFromText('LineString(0 0,0 1,1 1,1 0,0 0)')); +SELECT b FROM t1; +b +1 +DROP TABLE t1; +CREATE TABLE t1 (a GEOMETRY, b INT DEFAULT Dimension(a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` geometry DEFAULT NULL, + `b` int(11) DEFAULT Dimension(a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES (Buffer(Point(1,1),1)); +SELECT b FROM t1; +b +2 +DROP TABLE t1; +CREATE TABLE t1 (a GEOMETRY, b INT DEFAULT NumGeometries(a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` geometry DEFAULT NULL, + `b` int(11) DEFAULT NumGeometries(a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES (ST_UNION(Point(1,1),Point(0,0))); +SELECT b FROM t1; +b +2 +DROP TABLE t1; +CREATE TABLE t1 (a GEOMETRY, b INT DEFAULT NumInteriorRings(a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` geometry DEFAULT NULL, + `b` int(11) DEFAULT NumInteriorRings(a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES (GeomFromText('Polygon((0 0,0 3,3 3,3 0,0 0),(1 1,1 2,2 2,2 1,1 1))')); +SELECT b FROM t1; +b +1 +DROP TABLE t1; +CREATE TABLE t1 (a GEOMETRY, b INT DEFAULT NumPoints(a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` geometry DEFAULT NULL, + `b` int(11) DEFAULT NumPoints(a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES (LineString(Point(1,1),Point(0,0))); +SELECT b FROM t1; +b +2 +DROP TABLE t1; +CREATE TABLE t1 (a GEOMETRY, b INT DEFAULT SRID(a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` geometry DEFAULT NULL, + `b` int(11) DEFAULT SRID(a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES (GeomFromText('Point(1 1)', 100)); +SELECT b FROM t1; +b +100 +DROP TABLE t1; +CREATE TABLE t1 (a GEOMETRY, b GEOMETRY, c INT DEFAULT MBRDisjoint(a,b)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` geometry DEFAULT NULL, + `b` geometry DEFAULT NULL, + `c` int(11) DEFAULT MBRDisjoint(a,b) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a,b) VALUES (Point(1,1),Point(1,1)); +SELECT c FROM t1; +c +0 +DROP TABLE t1; +CREATE TABLE t1 (a GEOMETRY, b GEOMETRY, c INT DEFAULT ST_Disjoint(a,b)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` geometry DEFAULT NULL, + `b` geometry DEFAULT NULL, + `c` int(11) DEFAULT ST_Disjoint(a,b) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a,b) VALUES (Point(1,1),Point(1,1)); +SELECT c FROM t1; +c +0 +DROP TABLE t1; +CREATE TABLE t1 (a GEOMETRY, b GEOMETRY, c INT DEFAULT ST_Relate(a,b,'T*F**FFF*')); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` geometry DEFAULT NULL, + `b` geometry DEFAULT NULL, + `c` int(11) DEFAULT ST_Relate(a,b,'T*F**FFF*') +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a,b) VALUES (Point(1,1),Point(1,1)); +SELECT c FROM t1; +c +1 +DROP TABLE t1; +# +# End of 10.2 tests +# diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result index 5d44f47dede..8442f7fc401 100644 --- a/mysql-test/r/grant.result +++ b/mysql-test/r/grant.result @@ -2665,3 +2665,33 @@ GRANT USAGE ON *.* TO 'mysqltest_u1'@'%' drop database mysqltest_db1; drop user mysqltest_u1; set GLOBAL sql_mode=default; +# +# Start of 10.2 tests +# +# +# MDEV-10134 Add full support for DEFAULT +# +CREATE TABLE t1 (a VARCHAR(30) DEFAULT USER()); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(30) DEFAULT USER() +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (); +GRANT ALL PRIVILEGES ON test.* TO dummy@localhost IDENTIFIED BY 'pwd'; +connect conn1,localhost,dummy,pwd,test; +connection conn1; +INSERT INTO t1 VALUES (); +connection default; +disconnect conn1; +INSERT INTO t1 VALUES (); +SELECT * FROM t1; +a +root@localhost +dummy@localhost +root@localhost +DROP TABLE t1; +DROP USER dummy@localhost; +# +# End of 10.2 tests +# diff --git a/mysql-test/r/grant5.result b/mysql-test/r/grant5.result index 2df394c0432..24abc61a348 100644 --- a/mysql-test/r/grant5.result +++ b/mysql-test/r/grant5.result @@ -1,2 +1,20 @@ SHOW GRANTS FOR root@invalid_host; ERROR 42000: There is no such grant defined for user 'root' on host 'invalid_host' +create user test; +create user foo; +create role foo; +grant foo to test; +connect conn_1, localhost, test,,; +set role foo; +show grants for test; +Grants for test@% +GRANT foo TO 'test'@'%' +GRANT USAGE ON *.* TO 'test'@'%' +show grants for foo; +Grants for foo +GRANT USAGE ON *.* TO 'foo' +show grants for foo@'%'; +ERROR 42000: Access denied for user 'test'@'%' to database 'mysql' +connection default; +drop user test, foo; +drop role foo; diff --git a/mysql-test/r/grant_4332.result b/mysql-test/r/grant_4332.result index 93c0a24d164..b62ca1a20cc 100644 --- a/mysql-test/r/grant_4332.result +++ b/mysql-test/r/grant_4332.result @@ -10,7 +10,7 @@ alter table mysql.event modify definer char(77) collate utf8_bin not null defaul flush privileges; select user(); Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def user() 253 77 14 N 1 31 8 +def user() 253 77 14 N 1 39 8 user() root@localhost create user a17aaaaaaaaaaaaa0@localhost; @@ -29,7 +29,7 @@ alter table mysql.event modify definer char(141) collate utf8_bin not null defau flush privileges; select user(); Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def user() 253 141 14 N 1 31 8 +def user() 253 141 14 N 1 39 8 user() root@localhost set GLOBAL sql_mode=default; diff --git a/mysql-test/r/have_crypt.require b/mysql-test/r/have_crypt.require deleted file mode 100644 index 739fbb738f0..00000000000 --- a/mysql-test/r/have_crypt.require +++ /dev/null @@ -1,2 +0,0 @@ -Variable_name Value -have_crypt YES diff --git a/mysql-test/r/help.result b/mysql-test/r/help.result index 3a266567175..aefe6f8381e 100644 --- a/mysql-test/r/help.result +++ b/mysql-test/r/help.result @@ -148,6 +148,21 @@ help 'impossible_category_1'; source_category_name name is_it_category impossible_category_1 impossible_function_1 N impossible_category_1 impossible_function_2 N +# MDEV-9524 Cannot load from mysql.event when sql_mode is set to PAD_CHAR_TO_FULL_LENGTH +help 'impossible_function_1'; +name description example +impossible_function_1 description of + impossible_function1 + example of + impossible_function1 +SET sql_mode=PAD_CHAR_TO_FULL_LENGTH; +help 'impossible_function_1'; +name description example +impossible_function_1 description of + impossible_function1 + example of + impossible_function1 +SET sql_mode=DEFAULT; set sql_mode=""; alter table mysql.help_relation engine=innodb; alter table mysql.help_keyword engine=innodb; diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result index fba04812a5b..db2e77636d2 100644 --- a/mysql-test/r/information_schema.result +++ b/mysql-test/r/information_schema.result @@ -576,6 +576,7 @@ select s1 from t1 where s1 in (select version from information_schema.tables) union select version from information_schema.tables; s1 +11 10 drop table t1; SHOW CREATE TABLE INFORMATION_SCHEMA.character_sets; @@ -584,7 +585,7 @@ CHARACTER_SETS CREATE TEMPORARY TABLE `CHARACTER_SETS` ( `CHARACTER_SET_NAME` varchar(32) NOT NULL DEFAULT '', `DEFAULT_COLLATE_NAME` varchar(32) NOT NULL DEFAULT '', `DESCRIPTION` varchar(60) NOT NULL DEFAULT '', - `MAXLEN` bigint(3) NOT NULL DEFAULT '0' + `MAXLEN` bigint(3) NOT NULL DEFAULT 0 ) ENGINE=MEMORY DEFAULT CHARSET=utf8 set names latin2; SHOW CREATE TABLE INFORMATION_SCHEMA.character_sets; @@ -593,7 +594,7 @@ CHARACTER_SETS CREATE TEMPORARY TABLE `CHARACTER_SETS` ( `CHARACTER_SET_NAME` varchar(32) NOT NULL DEFAULT '', `DEFAULT_COLLATE_NAME` varchar(32) NOT NULL DEFAULT '', `DESCRIPTION` varchar(60) NOT NULL DEFAULT '', - `MAXLEN` bigint(3) NOT NULL DEFAULT '0' + `MAXLEN` bigint(3) NOT NULL DEFAULT 0 ) ENGINE=MEMORY DEFAULT CHARSET=utf8 set names latin1; create table t1 select * from information_schema.CHARACTER_SETS @@ -608,7 +609,7 @@ t1 CREATE TABLE `t1` ( `CHARACTER_SET_NAME` varchar(32) NOT NULL DEFAULT '', `DEFAULT_COLLATE_NAME` varchar(32) NOT NULL DEFAULT '', `DESCRIPTION` varchar(60) NOT NULL DEFAULT '', - `MAXLEN` bigint(3) NOT NULL DEFAULT '0' + `MAXLEN` bigint(3) NOT NULL DEFAULT 0 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 drop table t1; create view v1 as select * from information_schema.TABLES; diff --git a/mysql-test/r/information_schema_parameters.result b/mysql-test/r/information_schema_parameters.result index 93c7634a910..4643b26a259 100644 --- a/mysql-test/r/information_schema_parameters.result +++ b/mysql-test/r/information_schema_parameters.result @@ -6,7 +6,7 @@ PARAMETERS CREATE TEMPORARY TABLE `PARAMETERS` ( `SPECIFIC_CATALOG` varchar(512) NOT NULL DEFAULT '', `SPECIFIC_SCHEMA` varchar(64) NOT NULL DEFAULT '', `SPECIFIC_NAME` varchar(64) NOT NULL DEFAULT '', - `ORDINAL_POSITION` int(21) NOT NULL DEFAULT '0', + `ORDINAL_POSITION` int(21) NOT NULL DEFAULT 0, `PARAMETER_MODE` varchar(5) DEFAULT NULL, `PARAMETER_NAME` varchar(64) DEFAULT NULL, `DATA_TYPE` varchar(64) NOT NULL DEFAULT '', @@ -17,7 +17,7 @@ PARAMETERS CREATE TEMPORARY TABLE `PARAMETERS` ( `DATETIME_PRECISION` bigint(21) unsigned DEFAULT NULL, `CHARACTER_SET_NAME` varchar(64) DEFAULT NULL, `COLLATION_NAME` varchar(64) DEFAULT NULL, - `DTD_IDENTIFIER` longtext NOT NULL, + `DTD_IDENTIFIER` longtext NOT NULL DEFAULT '', `ROUTINE_TYPE` varchar(9) NOT NULL DEFAULT '' ) DEFAULT CHARSET=utf8 SELECT * FROM information_schema.columns @@ -309,7 +309,7 @@ TABLE_SCHEMA information_schema TABLE_NAME PARAMETERS COLUMN_NAME DTD_IDENTIFIER ORDINAL_POSITION 15 -COLUMN_DEFAULT NULL +COLUMN_DEFAULT IS_NULLABLE NO DATA_TYPE longtext CHARACTER_MAXIMUM_LENGTH 4294967295 @@ -360,7 +360,7 @@ NUMERIC_SCALE int(21) YES NULL DATETIME_PRECISION bigint(21) unsigned YES NULL CHARACTER_SET_NAME varchar(64) YES NULL COLLATION_NAME varchar(64) YES NULL -DTD_IDENTIFIER longtext NO NULL +DTD_IDENTIFIER longtext NO ROUTINE_TYPE varchar(9) NO # ========== parameters.2 ========== DROP DATABASE IF EXISTS i_s_parameters_test; diff --git a/mysql-test/r/information_schema_routines.result b/mysql-test/r/information_schema_routines.result index 65e352e3af3..0ea2e7bc9b4 100644 --- a/mysql-test/r/information_schema_routines.result +++ b/mysql-test/r/information_schema_routines.result @@ -18,9 +18,9 @@ ROUTINES CREATE TEMPORARY TABLE `ROUTINES` ( `DATETIME_PRECISION` bigint(21) unsigned DEFAULT NULL, `CHARACTER_SET_NAME` varchar(64) DEFAULT NULL, `COLLATION_NAME` varchar(64) DEFAULT NULL, - `DTD_IDENTIFIER` longtext, + `DTD_IDENTIFIER` longtext DEFAULT NULL, `ROUTINE_BODY` varchar(8) NOT NULL DEFAULT '', - `ROUTINE_DEFINITION` longtext, + `ROUTINE_DEFINITION` longtext DEFAULT NULL, `EXTERNAL_NAME` varchar(64) DEFAULT NULL, `EXTERNAL_LANGUAGE` varchar(64) DEFAULT NULL, `PARAMETER_STYLE` varchar(8) NOT NULL DEFAULT '', @@ -31,7 +31,7 @@ ROUTINES CREATE TEMPORARY TABLE `ROUTINES` ( `CREATED` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `LAST_ALTERED` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `SQL_MODE` varchar(8192) NOT NULL DEFAULT '', - `ROUTINE_COMMENT` longtext NOT NULL, + `ROUTINE_COMMENT` longtext NOT NULL DEFAULT '', `DEFINER` varchar(189) NOT NULL DEFAULT '', `CHARACTER_SET_CLIENT` varchar(32) NOT NULL DEFAULT '', `COLLATION_CONNECTION` varchar(32) NOT NULL DEFAULT '', @@ -566,7 +566,7 @@ TABLE_SCHEMA information_schema TABLE_NAME ROUTINES COLUMN_NAME ROUTINE_COMMENT ORDINAL_POSITION 27 -COLUMN_DEFAULT NULL +COLUMN_DEFAULT IS_NULLABLE NO DATA_TYPE longtext CHARACTER_MAXIMUM_LENGTH 4294967295 @@ -689,7 +689,7 @@ SECURITY_TYPE varchar(7) NO CREATED datetime NO 0000-00-00 00:00:00 LAST_ALTERED datetime NO 0000-00-00 00:00:00 SQL_MODE varchar(8192) NO -ROUTINE_COMMENT longtext NO NULL +ROUTINE_COMMENT longtext NO DEFINER varchar(189) NO CHARACTER_SET_CLIENT varchar(32) NO COLLATION_CONNECTION varchar(32) NO diff --git a/mysql-test/r/information_schema_stats.result b/mysql-test/r/information_schema_stats.result new file mode 100644 index 00000000000..cd73636879c --- /dev/null +++ b/mysql-test/r/information_schema_stats.result @@ -0,0 +1,70 @@ +set global userstat=1; +create table just_a_test(id int,first_name varchar(10),last_name varchar(10),address varchar(100),phone bigint,email varchar(30), state varchar(30)); +insert into just_a_test values(1,'fa','la','china_a',11111111,'fa_la@163.com','California'), +(2,'fb','lb','china_b',22222222,'fb_lb@163.com','Arizona'), +(3,'fc','lc','china_c',33333333,'fc_lc@163.com','California'), +(4,'fd','ld','china_d',44444444,'fd_ld@163.com','Utah'), +(5,'fe','le','china_e',55555555,'fe_le@163.com','Arizona'); +alter table just_a_test add primary key (id); +alter table just_a_test add key IND_just_a_test_first_name_last_name(first_name,last_name); +alter table just_a_test add key IND_just_a_test_state(state); +select count(*) from just_a_test where first_name='fc' and last_name='lc'; +count(*) +1 +select count(*) from just_a_test where state = 'California'; +count(*) +2 +select * from information_schema.index_statistics where table_schema='test' and table_name='just_a_test'; +TABLE_SCHEMA TABLE_NAME INDEX_NAME ROWS_READ +test just_a_test IND_just_a_test_state 2 +test just_a_test IND_just_a_test_first_name_last_name 1 +select * from information_schema.table_statistics where table_schema='test' and table_name='just_a_test'; +TABLE_SCHEMA TABLE_NAME ROWS_READ ROWS_CHANGED ROWS_CHANGED_X_INDEXES +test just_a_test 18 5 5 +alter table just_a_test drop key IND_just_a_test_first_name_last_name; +select * from information_schema.index_statistics where table_schema='test' and table_name='just_a_test'; +TABLE_SCHEMA TABLE_NAME INDEX_NAME ROWS_READ +test just_a_test IND_just_a_test_state 2 +select * from information_schema.table_statistics where table_schema='test' and table_name='just_a_test'; +TABLE_SCHEMA TABLE_NAME ROWS_READ ROWS_CHANGED ROWS_CHANGED_X_INDEXES +test just_a_test 23 5 5 +alter table just_a_test drop column state; +select * from information_schema.index_statistics where table_schema='test' and table_name='just_a_test'; +TABLE_SCHEMA TABLE_NAME INDEX_NAME ROWS_READ +select * from information_schema.table_statistics where table_schema='test' and table_name='just_a_test'; +TABLE_SCHEMA TABLE_NAME ROWS_READ ROWS_CHANGED ROWS_CHANGED_X_INDEXES +test just_a_test 28 5 5 +drop table just_a_test; +select * from information_schema.index_statistics where table_schema='test' and table_name='just_a_test'; +TABLE_SCHEMA TABLE_NAME INDEX_NAME ROWS_READ +select * from information_schema.table_statistics where table_schema='test' and table_name='just_a_test'; +TABLE_SCHEMA TABLE_NAME ROWS_READ ROWS_CHANGED ROWS_CHANGED_X_INDEXES +create table just_a_test(id int not null primary key,first_name varchar(10),last_name varchar(10),address varchar(100),phone bigint,email varchar(30), state varchar(30),key(first_name,last_name),key(state)); +insert into just_a_test values(1,'fa','la','china_a',11111111,'fa_la@163.com','California'), +(2,'fb','lb','china_b',22222222,'fb_lb@163.com','Arizona'), +(3,'fc','lc','china_c',33333333,'fc_lc@163.com','California'), +(4,'fd','ld','china_d',44444444,'fd_ld@163.com','Utah'), +(5,'fe','le','china_e',55555555,'fe_le@163.com','Arizona'); +select count(*) from just_a_test where first_name='fc' and last_name='lc'; +count(*) +1 +select count(*) from just_a_test where state = 'California'; +count(*) +2 +select count(*) from just_a_test where id between 2 and 4; +count(*) +3 +select * from information_schema.index_statistics where table_schema='test' and table_name='just_a_test'; +TABLE_SCHEMA TABLE_NAME INDEX_NAME ROWS_READ +test just_a_test first_name 1 +test just_a_test state 2 +test just_a_test PRIMARY 5 +select * from information_schema.table_statistics where table_schema='test' and table_name='just_a_test'; +TABLE_SCHEMA TABLE_NAME ROWS_READ ROWS_CHANGED ROWS_CHANGED_X_INDEXES +test just_a_test 8 5 15 +drop table just_a_test; +select * from information_schema.index_statistics where table_schema='test' and table_name='just_a_test'; +TABLE_SCHEMA TABLE_NAME INDEX_NAME ROWS_READ +select * from information_schema.table_statistics where table_schema='test' and table_name='just_a_test'; +TABLE_SCHEMA TABLE_NAME ROWS_READ ROWS_CHANGED ROWS_CHANGED_X_INDEXES +set global userstat=0; diff --git a/mysql-test/r/insert_innodb.result b/mysql-test/r/insert_innodb.result new file mode 100644 index 00000000000..e5e2b4b8623 --- /dev/null +++ b/mysql-test/r/insert_innodb.result @@ -0,0 +1,45 @@ +# +# BUG#22037930: INSERT IGNORE FAILS TO IGNORE +# FOREIGN KEY CONSTRAINT +# Setup. +CREATE TABLE t1 (fld1 INT PRIMARY KEY) ENGINE=INNODB; +CREATE TABLE t2 (fld2 INT, FOREIGN KEY (fld2) REFERENCES t1 (fld1)) +ENGINE=INNODB; +INSERT INTO t1 VALUES(0); +INSERT INTO t2 VALUES(0); +# Without fix, an error is reported. +INSERT IGNORE INTO t2 VALUES(1); +Warnings: +Warning 1452 Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`fld2`) REFERENCES `t1` (`fld1`)) +UPDATE IGNORE t2 SET fld2=20 WHERE fld2=0; +UPDATE IGNORE t1 SET fld1=20 WHERE fld1=0; +# Test for multi update. +UPDATE IGNORE t1, t2 SET t2.fld2= t2.fld2 + 3; +UPDATE IGNORE t1, t2 SET t1.fld1= t1.fld1 + 3; +# Reports an error since IGNORE is not used. +INSERT INTO t2 VALUES(1); +ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`fld2`) REFERENCES `t1` (`fld1`)) +UPDATE t2 SET fld2=20 WHERE fld2=0; +ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`fld2`) REFERENCES `t1` (`fld1`)) +UPDATE t1 SET fld1=20 WHERE fld1=0; +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`fld2`) REFERENCES `t1` (`fld1`)) +UPDATE t1, t2 SET t2.fld2= t2.fld2 + 3; +ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`fld2`) REFERENCES `t1` (`fld1`)) +UPDATE t1, t2 SET t1.fld1= t1.fld1 + 3; +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`fld2`) REFERENCES `t1` (`fld1`)) +DROP TABLE t2, t1; +# +# BUG#22037930: INSERT IGNORE FAILS TO IGNORE FOREIGN +# KEY CONSTRAINT +CREATE TABLE t1 (fld1 INT PRIMARY KEY) ENGINE= INNODB; +CREATE TABLE t2 (fld1 VARCHAR(10), fld2 INT NOT NULL, +CONSTRAINT fk FOREIGN KEY (fld2) REFERENCES t1(fld1)) ENGINE= INNODB; +# Without patch, reports incorrect error. +INSERT INTO t2 VALUES('abc', 2) ON DUPLICATE KEY UPDATE fld1= 'def'; +ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `fk` FOREIGN KEY (`fld2`) REFERENCES `t1` (`fld1`)) +REPLACE INTO t2 VALUES('abc', 2); +ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `fk` FOREIGN KEY (`fld2`) REFERENCES `t1` (`fld1`)) +INSERT IGNORE INTO t2 VALUES('abc', 2) ON DUPLICATE KEY UPDATE fld1= 'def'; +Warnings: +Warning 1452 Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `fk` FOREIGN KEY (`fld2`) REFERENCES `t1` (`fld1`)) +DROP TABLE t2, t1; diff --git a/mysql-test/r/join_outer.result b/mysql-test/r/join_outer.result index ca544f40aa8..2602181f234 100644 --- a/mysql-test/r/join_outer.result +++ b/mysql-test/r/join_outer.result @@ -601,8 +601,6 @@ id int(11) DEFAULT '0' NOT NULL, name tinytext DEFAULT '' NOT NULL, UNIQUE id (id) ); -Warnings: -Warning 1101 BLOB/TEXT column 'name' can't have a default value INSERT INTO t1 VALUES (1,'yes'),(2,'no'); CREATE TABLE t2 ( id int(11) DEFAULT '0' NOT NULL, @@ -2273,4 +2271,67 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 9 1 SIMPLE t2 ref c c 5 const 393 Using where drop table t1,t2; +# +# MDEV-10006: optimizer doesn't convert outer join to inner on views with WHERE clause +# +CREATE TABLE t1(i1 int primary key, v1 int, key(v1)); +INSERT INTO t1 VALUES (1, 1); +INSERT INTO t1 VALUES (2, 2); +INSERT INTO t1 VALUES (3, 3); +INSERT INTO t1 VALUES (4, 4); +INSERT INTO t1 VALUES (5, 3); +INSERT INTO t1 VALUES (6, 6); +INSERT INTO t1 VALUES (7, 7); +INSERT INTO t1 VALUES (8, 8); +INSERT INTO t1 VALUES (9, 9); +CREATE TABLE t2(i2 int primary key, v2 int, key(v2)); +INSERT INTO t2 VALUES (1, 1); +INSERT INTO t2 VALUES (2, 2); +INSERT INTO t2 VALUES (3, 3); +INSERT INTO t2 VALUES (4, 4); +INSERT INTO t2 VALUES (5, 3); +INSERT INTO t2 VALUES (6, 6); +INSERT INTO t2 VALUES (7, 7); +INSERT INTO t2 VALUES (8, 8); +INSERT INTO t2 VALUES (9, 9); +CREATE TABLE t3(i3 int primary key, v3 int, key(v3)); +INSERT INTO t3 VALUES (2, 2); +INSERT INTO t3 VALUES (4, 4); +INSERT INTO t3 VALUES (6, 6); +INSERT INTO t3 VALUES (8, 8); +# This should have a join order of t3,t1,t2 (or t3,t2,t1, the idea is that t3 is the first one) +EXPLAIN EXTENDED +SELECT * FROM +(SELECT t1.i1 as i1, t1.v1 as v1, +t2.i2 as i2, t2.v2 as v2, +t3.i3 as i3, t3.v3 as v3 +FROM t1 JOIN t2 on t1.i1 = t2.i2 +LEFT JOIN t3 on t2.i2 = t3.i3 +) as w1 +WHERE v3 = 4; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t3 ref PRIMARY,v3 v3 5 const 1 100.00 +1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t3.i3 1 100.00 +1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t3.i3 1 100.00 +Warnings: +Note 1003 select `test`.`t1`.`i1` AS `i1`,`test`.`t1`.`v1` AS `v1`,`test`.`t2`.`i2` AS `i2`,`test`.`t2`.`v2` AS `v2`,`test`.`t3`.`i3` AS `i3`,`test`.`t3`.`v3` AS `v3` from `test`.`t1` join `test`.`t2` join `test`.`t3` where ((`test`.`t3`.`v3` = 4) and (`test`.`t1`.`i1` = `test`.`t3`.`i3`) and (`test`.`t2`.`i2` = `test`.`t3`.`i3`)) +# This should have the same join order like the query above: +EXPLAIN EXTENDED +SELECT * FROM +(SELECT t1.i1 as i1, t1.v1 as v1, +t2.i2 as i2, t2.v2 as v2, +t3.i3 as i3, t3.v3 as v3 +FROM t1 JOIN t2 on t1.i1 = t2.i2 +LEFT JOIN t3 on t2.i2 = t3.i3 +WHERE t1.i1 = t2.i2 +AND 1 = 1 +) as w2 +WHERE v3 = 4; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t3 ref PRIMARY,v3 v3 5 const 1 100.00 +1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t3.i3 1 100.00 +1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t3.i3 1 100.00 +Warnings: +Note 1003 select `test`.`t1`.`i1` AS `i1`,`test`.`t1`.`v1` AS `v1`,`test`.`t2`.`i2` AS `i2`,`test`.`t2`.`v2` AS `v2`,`test`.`t3`.`i3` AS `i3`,`test`.`t3`.`v3` AS `v3` from `test`.`t1` join `test`.`t2` join `test`.`t3` where ((`test`.`t3`.`v3` = 4) and (`test`.`t1`.`i1` = `test`.`t3`.`i3`) and (`test`.`t2`.`i2` = `test`.`t3`.`i3`)) +drop table t1,t2,t3; SET optimizer_switch=@save_optimizer_switch; diff --git a/mysql-test/r/join_outer_jcl6.result b/mysql-test/r/join_outer_jcl6.result index 3616deaee9c..51f43f1404e 100644 --- a/mysql-test/r/join_outer_jcl6.result +++ b/mysql-test/r/join_outer_jcl6.result @@ -612,8 +612,6 @@ id int(11) DEFAULT '0' NOT NULL, name tinytext DEFAULT '' NOT NULL, UNIQUE id (id) ); -Warnings: -Warning 1101 BLOB/TEXT column 'name' can't have a default value INSERT INTO t1 VALUES (1,'yes'),(2,'no'); CREATE TABLE t2 ( id int(11) DEFAULT '0' NOT NULL, @@ -2284,6 +2282,69 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 9 1 SIMPLE t2 ref c c 5 const 393 Using where drop table t1,t2; +# +# MDEV-10006: optimizer doesn't convert outer join to inner on views with WHERE clause +# +CREATE TABLE t1(i1 int primary key, v1 int, key(v1)); +INSERT INTO t1 VALUES (1, 1); +INSERT INTO t1 VALUES (2, 2); +INSERT INTO t1 VALUES (3, 3); +INSERT INTO t1 VALUES (4, 4); +INSERT INTO t1 VALUES (5, 3); +INSERT INTO t1 VALUES (6, 6); +INSERT INTO t1 VALUES (7, 7); +INSERT INTO t1 VALUES (8, 8); +INSERT INTO t1 VALUES (9, 9); +CREATE TABLE t2(i2 int primary key, v2 int, key(v2)); +INSERT INTO t2 VALUES (1, 1); +INSERT INTO t2 VALUES (2, 2); +INSERT INTO t2 VALUES (3, 3); +INSERT INTO t2 VALUES (4, 4); +INSERT INTO t2 VALUES (5, 3); +INSERT INTO t2 VALUES (6, 6); +INSERT INTO t2 VALUES (7, 7); +INSERT INTO t2 VALUES (8, 8); +INSERT INTO t2 VALUES (9, 9); +CREATE TABLE t3(i3 int primary key, v3 int, key(v3)); +INSERT INTO t3 VALUES (2, 2); +INSERT INTO t3 VALUES (4, 4); +INSERT INTO t3 VALUES (6, 6); +INSERT INTO t3 VALUES (8, 8); +# This should have a join order of t3,t1,t2 (or t3,t2,t1, the idea is that t3 is the first one) +EXPLAIN EXTENDED +SELECT * FROM +(SELECT t1.i1 as i1, t1.v1 as v1, +t2.i2 as i2, t2.v2 as v2, +t3.i3 as i3, t3.v3 as v3 +FROM t1 JOIN t2 on t1.i1 = t2.i2 +LEFT JOIN t3 on t2.i2 = t3.i3 +) as w1 +WHERE v3 = 4; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t3 ref PRIMARY,v3 v3 5 const 1 100.00 +1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t3.i3 1 100.00 +1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t3.i3 1 100.00 +Warnings: +Note 1003 select `test`.`t1`.`i1` AS `i1`,`test`.`t1`.`v1` AS `v1`,`test`.`t2`.`i2` AS `i2`,`test`.`t2`.`v2` AS `v2`,`test`.`t3`.`i3` AS `i3`,`test`.`t3`.`v3` AS `v3` from `test`.`t1` join `test`.`t2` join `test`.`t3` where ((`test`.`t3`.`v3` = 4) and (`test`.`t1`.`i1` = `test`.`t3`.`i3`) and (`test`.`t2`.`i2` = `test`.`t3`.`i3`)) +# This should have the same join order like the query above: +EXPLAIN EXTENDED +SELECT * FROM +(SELECT t1.i1 as i1, t1.v1 as v1, +t2.i2 as i2, t2.v2 as v2, +t3.i3 as i3, t3.v3 as v3 +FROM t1 JOIN t2 on t1.i1 = t2.i2 +LEFT JOIN t3 on t2.i2 = t3.i3 +WHERE t1.i1 = t2.i2 +AND 1 = 1 +) as w2 +WHERE v3 = 4; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t3 ref PRIMARY,v3 v3 5 const 1 100.00 +1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t3.i3 1 100.00 +1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t3.i3 1 100.00 +Warnings: +Note 1003 select `test`.`t1`.`i1` AS `i1`,`test`.`t1`.`v1` AS `v1`,`test`.`t2`.`i2` AS `i2`,`test`.`t2`.`v2` AS `v2`,`test`.`t3`.`i3` AS `i3`,`test`.`t3`.`v3` AS `v3` from `test`.`t1` join `test`.`t2` join `test`.`t3` where ((`test`.`t3`.`v3` = 4) and (`test`.`t1`.`i1` = `test`.`t3`.`i3`) and (`test`.`t2`.`i2` = `test`.`t3`.`i3`)) +drop table t1,t2,t3; SET optimizer_switch=@save_optimizer_switch; set join_cache_level=default; show variables like 'join_cache_level'; diff --git a/mysql-test/r/key.result b/mysql-test/r/key.result index 9b3dcedf7be..26af6320e79 100644 --- a/mysql-test/r/key.result +++ b/mysql-test/r/key.result @@ -243,7 +243,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `c` varchar(30) CHARACTER SET utf8 DEFAULT NULL, - `t` text CHARACTER SET utf8, + `t` text CHARACTER SET utf8 DEFAULT NULL, UNIQUE KEY `c` (`c`(2)), UNIQUE KEY `t` (`t`(3)) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 @@ -467,7 +467,7 @@ alter table t1 drop index c2, add index (c2(4),c3(7)); alter table t1 add primary key (c1, c2), drop primary key; alter table t1 drop primary key; alter table t1 add primary key (c1, c2), drop primary key; -ERROR 42000: Can't DROP 'PRIMARY'; check that column/key exists +ERROR 42000: Can't DROP INDEX `PRIMARY`; check that it exists show create table t1; Table Create Table t1 CREATE TABLE `t1` ( diff --git a/mysql-test/r/last_value.result b/mysql-test/r/last_value.result index 6222eacd4f0..b11ee6eaadb 100644 --- a/mysql-test/r/last_value.result +++ b/mysql-test/r/last_value.result @@ -36,17 +36,17 @@ LAST_VALUE(@last_a:=1,@last_b:=1.0) 1.0 select @last_b; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def @last_b 246 83 3 Y 32896 30 63 +def @last_b 246 83 3 Y 32896 38 63 @last_b 1.0 SELECT LAST_VALUE(@last_a:=1,@last_b:="hello"); Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def LAST_VALUE(@last_a:=1,@last_b:="hello") 253 5 5 N 1 31 8 +def LAST_VALUE(@last_a:=1,@last_b:="hello") 253 5 5 N 1 39 8 LAST_VALUE(@last_a:=1,@last_b:="hello") hello select @last_b; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def @last_b 250 16777215 5 Y 0 31 8 +def @last_b 250 16777215 5 Y 0 39 8 @last_b hello SELECT date(LAST_VALUE(@last_a:=1,@last_b:="2001-02-03")); @@ -56,7 +56,7 @@ date(LAST_VALUE(@last_a:=1,@last_b:="2001-02-03")) 2001-02-03 select @last_b; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def @last_b 250 16777215 10 Y 0 31 8 +def @last_b 250 16777215 10 Y 0 39 8 @last_b 2001-02-03 SELECT LAST_VALUE(@last_a:=1,@last_b:="2001-02-03",NULL); @@ -66,7 +66,7 @@ LAST_VALUE(@last_a:=1,@last_b:="2001-02-03",NULL) NULL select @last_b; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def @last_b 250 16777215 10 Y 0 31 8 +def @last_b 250 16777215 10 Y 0 39 8 @last_b 2001-02-03 SELECT LAST_VALUE(); diff --git a/mysql-test/r/locale.result b/mysql-test/r/locale.result index 1335f1ec9d5..95c1f51fd87 100644 --- a/mysql-test/r/locale.result +++ b/mysql-test/r/locale.result @@ -90,6 +90,45 @@ SELECT DATE_FORMAT('2001-01-07', '%w %a %W'); DATE_FORMAT('2001-01-07', '%w %a %W') 0 Du Duminică End of 5.4 tests +SET NAMES utf8; +SET lc_time_names=de_AT; +SELECT monthname('2001-01-01'); +monthname('2001-01-01') +Jänner +SELECT monthname('2001-02-01'); +monthname('2001-02-01') +Februar +SELECT monthname('2001-03-01'); +monthname('2001-03-01') +März +# +# MDEV-10052 Illegal mix of collations with DAYNAME(date_field)<>varchar_field +# +SET NAMES utf8; +CREATE TABLE t1 (c VARCHAR(8) CHARACTER SET latin1, d DATE); +INSERT INTO t1 VALUES ('test',now()); +Warnings: +Note 1265 Data truncated for column 'd' at row 1 +SET lc_time_names=ru_RU; +SELECT c FROM t1 WHERE DAYNAME(d)<>c; +ERROR HY000: Illegal mix of collations (utf8_general_ci,COERCIBLE) and (latin1_swedish_ci,IMPLICIT) for operation '<>' +SELECT c FROM t1 WHERE MONTHNAME(d)<>c; +ERROR HY000: Illegal mix of collations (utf8_general_ci,COERCIBLE) and (latin1_swedish_ci,IMPLICIT) for operation '<>' +SET lc_time_names=en_US; +SELECT c FROM t1 WHERE DAYNAME(d)<>c; +c +test +SELECT c FROM t1 WHERE MONTHNAME(d)<>c; +c +test +SET NAMES latin1; +SELECT c FROM t1 WHERE DAYNAME(d)<>c; +c +test +SELECT c FROM t1 WHERE MONTHNAME(d)<>c; +c +test +DROP TABLE t1; # # Start of 5.6 tests # diff --git a/mysql-test/r/lock.result b/mysql-test/r/lock.result index 381667745d8..0313666d2a5 100644 --- a/mysql-test/r/lock.result +++ b/mysql-test/r/lock.result @@ -380,12 +380,7 @@ alter table t1 add column j int; unlock tables; drop table t1; create temporary table t1 (i int); -# -# This is just for test coverage purposes, -# when this is allowed, remove the --error. -# lock tables t1 write, t1 as a read, t1 as b read; -ERROR HY000: Can't reopen table: 't1' alter table t1 add column j int; unlock tables; drop table t1; diff --git a/mysql-test/r/mdev6830.result b/mysql-test/r/mdev6830.result index 0570659e860..d1cf8c98ac1 100644 --- a/mysql-test/r/mdev6830.result +++ b/mysql-test/r/mdev6830.result @@ -1,5 +1,4 @@ -drop table if exists t1,t2,t3; -drop view if exists v2,v3; +set @@debug_dbug= 'd,opt'; CREATE TABLE t1 (pk INT PRIMARY KEY) ENGINE=MyISAM; CREATE TABLE t2 ( f1 DATE, diff --git a/mysql-test/r/metadata.result b/mysql-test/r/metadata.result index ffdab244f31..3db3bcd450f 100644 --- a/mysql-test/r/metadata.result +++ b/mysql-test/r/metadata.result @@ -4,7 +4,7 @@ Catalog Database Table Table_alias Column Column_alias Type Length Max length Is def 1 8 1 1 N 32897 0 63 def 1.0 246 4 3 N 32897 1 63 def -1 8 2 2 N 32897 0 63 -def hello 253 5 5 N 1 31 8 +def hello 253 5 5 N 1 39 8 def NULL 6 0 0 Y 32896 0 63 1 1.0 -1 hello NULL 1 1.0 -1 hello NULL diff --git a/mysql-test/r/mix2_myisam.result b/mysql-test/r/mix2_myisam.result index 25434b71ca2..cfb193ccb1a 100644 --- a/mysql-test/r/mix2_myisam.result +++ b/mysql-test/r/mix2_myisam.result @@ -1428,7 +1428,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `v` varchar(10) DEFAULT NULL, `c` char(10) DEFAULT NULL, - `t` text + `t` text DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 create table t2 like t1; show create table t2; @@ -1436,7 +1436,7 @@ Table Create Table t2 CREATE TABLE `t2` ( `v` varchar(10) DEFAULT NULL, `c` char(10) DEFAULT NULL, - `t` text + `t` text DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 create table t3 select * from t1; show create table t3; @@ -1444,7 +1444,7 @@ Table Create Table t3 CREATE TABLE `t3` ( `v` varchar(10) DEFAULT NULL, `c` char(10) DEFAULT NULL, - `t` text + `t` text DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 alter table t1 modify c varchar(10); show create table t1; @@ -1452,7 +1452,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `v` varchar(10) DEFAULT NULL, `c` varchar(10) DEFAULT NULL, - `t` text + `t` text DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 alter table t1 modify v char(10); show create table t1; @@ -1460,7 +1460,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `v` char(10) DEFAULT NULL, `c` varchar(10) DEFAULT NULL, - `t` text + `t` text DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 alter table t1 modify t varchar(10); Warnings: @@ -1483,7 +1483,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `v` varchar(10) DEFAULT NULL, `c` char(10) DEFAULT NULL, - `t` text, + `t` text DEFAULT NULL, KEY `v` (`v`), KEY `c` (`c`), KEY `t` (`t`(10)) @@ -1704,7 +1704,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `v` varchar(300) DEFAULT NULL, `c` char(10) DEFAULT NULL, - `t` text, + `t` text DEFAULT NULL, KEY `c` (`c`), KEY `t` (`t`(10)), KEY `v` (`v`) @@ -1784,7 +1784,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `v` varchar(300) DEFAULT NULL, `c` char(10) DEFAULT NULL, - `t` text, + `t` text DEFAULT NULL, KEY `c` (`c`), KEY `t` (`t`(10)), KEY `v` (`v`(30)) @@ -1864,7 +1864,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `v` varchar(600) DEFAULT NULL, `c` char(10) DEFAULT NULL, - `t` text, + `t` text DEFAULT NULL, KEY `c` (`c`), KEY `t` (`t`(10)), KEY `v` (`v`) @@ -1942,7 +1942,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `v` varchar(10) DEFAULT NULL, `c` char(10) DEFAULT NULL, - `t` text, + `t` text DEFAULT NULL, KEY `v` (`v`(5)), KEY `c` (`c`(5)), KEY `t` (`t`(5)) @@ -1993,7 +1993,7 @@ Note 1246 Converting column 'v' from VARCHAR to TEXT show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `v` mediumtext + `v` mediumtext DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 (v varchar(65530) character set utf8); @@ -2002,7 +2002,7 @@ Note 1246 Converting column 'v' from VARCHAR to TEXT show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `v` mediumtext CHARACTER SET utf8 + `v` mediumtext CHARACTER SET utf8 DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; set storage_engine=MEMORY; diff --git a/mysql-test/r/mrr_icp_extra.result b/mysql-test/r/mrr_icp_extra.result index 855ac4beab5..975be1d6785 100644 --- a/mysql-test/r/mrr_icp_extra.result +++ b/mysql-test/r/mrr_icp_extra.result @@ -229,7 +229,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `v` varchar(10) DEFAULT NULL, `c` char(10) DEFAULT NULL, - `t` text + `t` text DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 create table t2 like t1; show create table t2; @@ -237,7 +237,7 @@ Table Create Table t2 CREATE TABLE `t2` ( `v` varchar(10) DEFAULT NULL, `c` char(10) DEFAULT NULL, - `t` text + `t` text DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 create table t3 select * from t1; show create table t3; @@ -245,7 +245,7 @@ Table Create Table t3 CREATE TABLE `t3` ( `v` varchar(10) DEFAULT NULL, `c` char(10) DEFAULT NULL, - `t` text + `t` text DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 alter table t1 modify c varchar(10); show create table t1; @@ -253,7 +253,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `v` varchar(10) DEFAULT NULL, `c` varchar(10) DEFAULT NULL, - `t` text + `t` text DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 alter table t1 modify v char(10); show create table t1; @@ -261,7 +261,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `v` char(10) DEFAULT NULL, `c` varchar(10) DEFAULT NULL, - `t` text + `t` text DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 alter table t1 modify t varchar(10); Warnings: @@ -284,7 +284,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `v` varchar(10) DEFAULT NULL, `c` char(10) DEFAULT NULL, - `t` text, + `t` text DEFAULT NULL, KEY `v` (`v`), KEY `c` (`c`), KEY `t` (`t`(10)) @@ -505,7 +505,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `v` varchar(300) DEFAULT NULL, `c` char(10) DEFAULT NULL, - `t` text, + `t` text DEFAULT NULL, KEY `c` (`c`), KEY `t` (`t`(10)), KEY `v` (`v`) @@ -585,7 +585,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `v` varchar(300) DEFAULT NULL, `c` char(10) DEFAULT NULL, - `t` text, + `t` text DEFAULT NULL, KEY `c` (`c`), KEY `t` (`t`(10)), KEY `v` (`v`(30)) @@ -665,7 +665,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `v` varchar(600) DEFAULT NULL, `c` char(10) DEFAULT NULL, - `t` text, + `t` text DEFAULT NULL, KEY `c` (`c`), KEY `t` (`t`(10)), KEY `v` (`v`) @@ -743,7 +743,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `v` varchar(10) DEFAULT NULL, `c` char(10) DEFAULT NULL, - `t` text, + `t` text DEFAULT NULL, KEY `v` (`v`(5)), KEY `c` (`c`(5)), KEY `t` (`t`(5)) diff --git a/mysql-test/r/multi_update.result b/mysql-test/r/multi_update.result index 204596bf20b..b9c12be8d0d 100644 --- a/mysql-test/r/multi_update.result +++ b/mysql-test/r/multi_update.result @@ -1061,4 +1061,36 @@ f1 f2 1 97 DROP TABLE t1, t2; DROP VIEW v1; +# +# MDEV-5973: MySQL Bug#11757486:49539: NON-DESCRIPTIVE ERR (ERROR 0 +# FROM STORAGE ENGINE) WITH MULTI-TABLE UPDATE +# +CREATE TABLE table_11757486 (field1 tinyint) ENGINE=INNODB; +INSERT INTO table_11757486 VALUES (0),(0); +SET SESSION SQL_MODE='STRICT_ALL_TABLES'; +UPDATE IGNORE (SELECT 128 as col1) x, table_11757486 SET field1=x.col1; +Warnings: +Warning 1264 Out of range value for column 'field1' at row 1 +Warning 1264 Out of range value for column 'field1' at row 2 +UPDATE IGNORE table_11757486 SET field1=128; +Warnings: +Warning 1264 Out of range value for column 'field1' at row 1 +Warning 1264 Out of range value for column 'field1' at row 2 +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. UPDATE IGNORE is unsafe because the order in which rows are updated determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slave. +UPDATE (SELECT 128 as col1) x, table_11757486 SET field1=x.col1; +ERROR 22003: Out of range value for column 'field1' at row 1 +UPDATE table_11757486 SET field1=128; +ERROR 22003: Out of range value for column 'field1' at row 1 +SET SESSION SQL_MODE=''; +UPDATE IGNORE (SELECT 128 as col1) x, table_11757486 SET field1=x.col1; +Warnings: +Warning 1264 Out of range value for column 'field1' at row 1 +Warning 1264 Out of range value for column 'field1' at row 2 +UPDATE IGNORE table_11757486 SET field1=128; +Warnings: +Warning 1264 Out of range value for column 'field1' at row 1 +Warning 1264 Out of range value for column 'field1' at row 2 +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. UPDATE IGNORE is unsafe because the order in which rows are updated determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slave. +DROP TABLE table_11757486; +SET SESSION SQL_MODE=default; end of 10.0 tests diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result index 1eef64be640..424adf318bb 100644 --- a/mysql-test/r/myisam.result +++ b/mysql-test/r/myisam.result @@ -1132,7 +1132,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `v` varchar(10) DEFAULT NULL, `c` char(10) DEFAULT NULL, - `t` text + `t` text DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 create table t2 like t1; show create table t2; @@ -1140,7 +1140,7 @@ Table Create Table t2 CREATE TABLE `t2` ( `v` varchar(10) DEFAULT NULL, `c` char(10) DEFAULT NULL, - `t` text + `t` text DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 create table t3 select * from t1; show create table t3; @@ -1148,7 +1148,7 @@ Table Create Table t3 CREATE TABLE `t3` ( `v` varchar(10) DEFAULT NULL, `c` char(10) DEFAULT NULL, - `t` text + `t` text DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 alter table t1 modify c varchar(10); show create table t1; @@ -1156,7 +1156,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `v` varchar(10) DEFAULT NULL, `c` varchar(10) DEFAULT NULL, - `t` text + `t` text DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 alter table t1 modify v char(10); show create table t1; @@ -1164,7 +1164,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `v` char(10) DEFAULT NULL, `c` varchar(10) DEFAULT NULL, - `t` text + `t` text DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 alter table t1 modify t varchar(10); Warnings: @@ -1187,7 +1187,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `v` varchar(10) DEFAULT NULL, `c` char(10) DEFAULT NULL, - `t` text, + `t` text DEFAULT NULL, KEY `v` (`v`), KEY `c` (`c`), KEY `t` (`t`(10)) @@ -1408,7 +1408,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `v` varchar(300) DEFAULT NULL, `c` char(10) DEFAULT NULL, - `t` text, + `t` text DEFAULT NULL, KEY `c` (`c`), KEY `t` (`t`(10)), KEY `v` (`v`) @@ -1488,7 +1488,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `v` varchar(300) DEFAULT NULL, `c` char(10) DEFAULT NULL, - `t` text, + `t` text DEFAULT NULL, KEY `c` (`c`), KEY `t` (`t`(10)), KEY `v` (`v`(30)) @@ -1568,7 +1568,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `v` varchar(600) DEFAULT NULL, `c` char(10) DEFAULT NULL, - `t` text, + `t` text DEFAULT NULL, KEY `c` (`c`), KEY `t` (`t`(10)), KEY `v` (`v`) @@ -1646,7 +1646,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `v` varchar(10) DEFAULT NULL, `c` char(10) DEFAULT NULL, - `t` text, + `t` text DEFAULT NULL, KEY `v` (`v`(5)), KEY `c` (`c`(5)), KEY `t` (`t`(5)) @@ -1697,7 +1697,7 @@ Note 1246 Converting column 'v' from VARCHAR to TEXT show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `v` mediumtext + `v` mediumtext DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 (v varchar(65530) character set utf8); @@ -1706,7 +1706,7 @@ Note 1246 Converting column 'v' from VARCHAR to TEXT show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `v` mediumtext CHARACTER SET utf8 + `v` mediumtext CHARACTER SET utf8 DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 (v varchar(65535)); diff --git a/mysql-test/r/mysql5613mysql.result b/mysql-test/r/mysql5613mysql.result index 501c723f711..1d2c3b97baf 100644 --- a/mysql-test/r/mysql5613mysql.result +++ b/mysql-test/r/mysql5613mysql.result @@ -72,7 +72,7 @@ event CREATE TABLE `event` ( `character_set_client` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `collation_connection` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `db_collation` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, - `body_utf8` longblob, + `body_utf8` longblob DEFAULT NULL, PRIMARY KEY (`db`,`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Events' SELECT * FROM event LIMIT 0; @@ -82,7 +82,7 @@ SHOW CREATE TABLE func; Table Create Table func CREATE TABLE `func` ( `name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '', - `ret` tinyint(1) NOT NULL DEFAULT '0', + `ret` tinyint(1) NOT NULL DEFAULT 0, `dl` char(128) COLLATE utf8_bin NOT NULL DEFAULT '', `type` enum('function','aggregate') CHARACTER SET utf8 NOT NULL, PRIMARY KEY (`name`) @@ -112,7 +112,7 @@ proc CREATE TABLE `proc` ( `is_deterministic` enum('YES','NO') NOT NULL DEFAULT 'NO', `security_type` enum('INVOKER','DEFINER') NOT NULL DEFAULT 'DEFINER', `param_list` blob NOT NULL, - `returns` longblob NOT NULL, + `returns` longblob NOT NULL DEFAULT '', `body` longblob NOT NULL, `definer` char(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '', `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, @@ -122,7 +122,7 @@ proc CREATE TABLE `proc` ( `character_set_client` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `collation_connection` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `db_collation` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, - `body_utf8` longblob, + `body_utf8` longblob DEFAULT NULL, PRIMARY KEY (`db`,`name`,`type`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Stored Procedures' SELECT * FROM proc LIMIT 0; @@ -152,7 +152,7 @@ proxies_priv CREATE TABLE `proxies_priv` ( `User` char(16) COLLATE utf8_bin NOT NULL DEFAULT '', `Proxied_host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '', `Proxied_user` char(16) COLLATE utf8_bin NOT NULL DEFAULT '', - `With_grant` tinyint(1) NOT NULL DEFAULT '0', + `With_grant` tinyint(1) NOT NULL DEFAULT 0, `Grantor` char(77) COLLATE utf8_bin NOT NULL DEFAULT '', `Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`Host`,`User`,`Proxied_host`,`Proxied_user`), @@ -169,7 +169,7 @@ servers CREATE TABLE `servers` ( `Db` char(64) NOT NULL DEFAULT '', `Username` char(64) NOT NULL DEFAULT '', `Password` char(64) NOT NULL DEFAULT '', - `Port` int(4) NOT NULL DEFAULT '0', + `Port` int(4) NOT NULL DEFAULT 0, `Socket` char(64) NOT NULL DEFAULT '', `Wrapper` char(64) NOT NULL DEFAULT '', `Owner` char(64) NOT NULL DEFAULT '', @@ -241,8 +241,8 @@ Table Create Table time_zone_transition_type CREATE TABLE `time_zone_transition_type` ( `Time_zone_id` int(10) unsigned NOT NULL, `Transition_type_id` int(10) unsigned NOT NULL, - `Offset` int(11) NOT NULL DEFAULT '0', - `Is_DST` tinyint(3) unsigned NOT NULL DEFAULT '0', + `Offset` int(11) NOT NULL DEFAULT 0, + `Is_DST` tinyint(3) unsigned NOT NULL DEFAULT 0, `Abbreviation` char(8) NOT NULL DEFAULT '', PRIMARY KEY (`Time_zone_id`,`Transition_type_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Time zone transition types' @@ -288,12 +288,12 @@ user CREATE TABLE `user` ( `ssl_cipher` blob NOT NULL, `x509_issuer` blob NOT NULL, `x509_subject` blob NOT NULL, - `max_questions` int(11) unsigned NOT NULL DEFAULT '0', - `max_updates` int(11) unsigned NOT NULL DEFAULT '0', - `max_connections` int(11) unsigned NOT NULL DEFAULT '0', - `max_user_connections` int(11) unsigned NOT NULL DEFAULT '0', + `max_questions` int(11) unsigned NOT NULL DEFAULT 0, + `max_updates` int(11) unsigned NOT NULL DEFAULT 0, + `max_connections` int(11) unsigned NOT NULL DEFAULT 0, + `max_user_connections` int(11) unsigned NOT NULL DEFAULT 0, `plugin` char(64) COLLATE utf8_bin DEFAULT '', - `authentication_string` text COLLATE utf8_bin, + `authentication_string` text COLLATE utf8_bin DEFAULT NULL, `password_expired` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', PRIMARY KEY (`Host`,`User`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Users and global privileges' diff --git a/mysql-test/r/mysql57_virtual.result b/mysql-test/r/mysql57_virtual.result new file mode 100644 index 00000000000..a473a85cb3b --- /dev/null +++ b/mysql-test/r/mysql57_virtual.result @@ -0,0 +1,38 @@ +# +# Test that we can use tables created in MySQL 5.7 +# +SHOW CREATE TABLE mysql57_virtual; +Table Create Table +mysql57_virtual CREATE TABLE `mysql57_virtual` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS ((`a` + 1)) VIRTUAL, + `c` int(11) AS ((`a` + 3)) PERSISTENT +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into mysql57_virtual (a) values (1),(2); +select * from mysql57_virtual; +a b c +1 2 4 +2 3 5 +alter online table mysql57_virtual comment "I am now a MariaDB table"; +ERROR 0A000: LOCK=NONE is not supported. Reason: COPY algorithm requires a lock. Try LOCK=SHARED. +alter table mysql57_virtual comment "I am now a MariaDB table"; +SHOW CREATE TABLE mysql57_virtual; +Table Create Table +mysql57_virtual CREATE TABLE `mysql57_virtual` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS ((`a` + 1)) VIRTUAL, + `c` int(11) AS ((`a` + 3)) PERSISTENT +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='I am now a MariaDB table' +DROP TABLE mysql57_virtual; +# +# Check MySQL 5.7 syntax +# +create table t1 (a int, b int generated always as (a+1) STORED, c int generated always as (a+2) VIRTUAL); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) AS (a+1) PERSISTENT, + `c` int(11) AS (a+2) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; diff --git a/mysql-test/r/mysqlbinlog-innodb.result b/mysql-test/r/mysqlbinlog-innodb.result index 2704be9e3ed..9508f725ec4 100644 --- a/mysql-test/r/mysqlbinlog-innodb.result +++ b/mysql-test/r/mysqlbinlog-innodb.result @@ -29,7 +29,7 @@ BEGIN use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=1342177280/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -60,7 +60,7 @@ BEGIN use `foo`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=1342177280/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; diff --git a/mysql-test/r/mysqlbinlog.result b/mysql-test/r/mysqlbinlog.result index c7da070a622..108e03e5a47 100644 --- a/mysql-test/r/mysqlbinlog.result +++ b/mysql-test/r/mysqlbinlog.result @@ -22,7 +22,7 @@ ROLLBACK/*!*/; use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=1342177280/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -102,7 +102,7 @@ BEGIN use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=1342177280/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -138,7 +138,7 @@ BEGIN /*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=1342177280/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -189,7 +189,7 @@ BEGIN use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=1342177280/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -216,7 +216,7 @@ ROLLBACK/*!*/; use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=1342177280/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -296,7 +296,7 @@ BEGIN use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=1342177280/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -332,7 +332,7 @@ BEGIN /*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=1342177280/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -383,7 +383,7 @@ BEGIN use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=1342177280/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -492,7 +492,7 @@ DELIMITER /*!*/; use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=1342177280/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -544,7 +544,7 @@ DELIMITER /*!*/; use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=1342177280/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -724,7 +724,7 @@ ROLLBACK/*!*/; use `test`/*!*/; SET TIMESTAMP=1253783037/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=0/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -778,7 +778,7 @@ DELIMITER /*!*/; ROLLBACK/*!*/; SET TIMESTAMP=1253783037/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=0/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -813,7 +813,7 @@ ROLLBACK /* added by mysqlbinlog */; DELIMITER /*!*/; SET TIMESTAMP=1266652094/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=0/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -855,7 +855,7 @@ ROLLBACK /* added by mysqlbinlog */; DELIMITER /*!*/; SET TIMESTAMP=1266652094/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=0/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -964,7 +964,7 @@ AAAAAAAAAAAAAAAAAAAgrgJSFzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC # Event: Query thread_id=1 exec_time=0 error_code=0 SET TIMESTAMP=1375907364/*!*/; SET @@session.pseudo_thread_id=1/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=0/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -1047,7 +1047,7 @@ AAAAAAAAAAAAAAAAAAA/rQJSGzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC # Event: Query thread_id=1 exec_time=1 error_code=0 SET TIMESTAMP=1375907141/*!*/; SET @@session.pseudo_thread_id=1/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=0/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -1130,7 +1130,7 @@ AAAAAAAAAAAAAAAAAAAnrAJSHzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC # Event: Query thread_id=1 exec_time=0 error_code=0 SET TIMESTAMP=1375906879/*!*/; SET @@session.pseudo_thread_id=1/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=0/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -1213,7 +1213,7 @@ AAAAAAAAAAAAAAAAAABbsAJSEzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC # Event: Query thread_id=1 exec_time=0 error_code=0 SET TIMESTAMP=1375907933/*!*/; SET @@session.pseudo_thread_id=1/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=0/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; diff --git a/mysql-test/r/mysqlbinlog_row_minimal.result b/mysql-test/r/mysqlbinlog_row_minimal.result index 20837aeec24..84c0e668981 100644 --- a/mysql-test/r/mysqlbinlog_row_minimal.result +++ b/mysql-test/r/mysqlbinlog_row_minimal.result @@ -31,7 +31,7 @@ ROLLBACK/*!*/; use `test`/*!*/; SET TIMESTAMP=X/*!*/; SET @@session.pseudo_thread_id=4/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=1342177280/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; diff --git a/mysql-test/r/mysqlcheck.result b/mysql-test/r/mysqlcheck.result index 033b4086985..e0d93b02ecd 100644 --- a/mysql-test/r/mysqlcheck.result +++ b/mysql-test/r/mysqlcheck.result @@ -376,6 +376,11 @@ Repairing views test.v1 OK drop view v1; drop table t1; +create table `#mysql50#t1``1` (a int) engine=myisam; +show tables; +Tables_in_test +t1`1 +drop table `t1``1`; # #MDEV-7384 [PATCH] add PERSISENT FOR ALL option to mysqlanalyze/mysqlcheck # diff --git a/mysql-test/r/mysqld--help,win.rdiff b/mysql-test/r/mysqld--help,win.rdiff index 4de251832e3..aff42e2fa2d 100644 --- a/mysql-test/r/mysqld--help,win.rdiff +++ b/mysql-test/r/mysqld--help,win.rdiff @@ -126,13 +126,13 @@ table-definition-cache 400 -table-open-cache 431 +table-open-cache 2000 - tc-heuristic-recover COMMIT + tc-heuristic-recover OFF thread-cache-size 151 -thread-pool-idle-timeout 60 thread-pool-max-threads 1000 -thread-pool-oversubscribe 3 -thread-pool-stall-limit 500 +thread-pool-min-threads 1 - thread-stack 296960 + thread-stack 297984 time-format %H:%i:%s timed-mutexes FALSE diff --git a/mysql-test/r/mysqld--help.result b/mysql-test/r/mysqld--help.result index 38075ef8520..0cb8fcaff1c 100644 --- a/mysql-test/r/mysqld--help.result +++ b/mysql-test/r/mysqld--help.result @@ -580,7 +580,7 @@ The following options may be given as the first argument: semijoin_with_cache, join_cache_incremental, join_cache_hashed, join_cache_bka, optimize_join_buffer_size, table_elimination, - extended_keys, exists_to_in + extended_keys, exists_to_in, orderby_uses_equalities --optimizer-use-condition-selectivity=# Controls selectivity of which conditions the optimizer takes into account to calculate cardinality of a partial @@ -1071,7 +1071,7 @@ The following options may be given as the first argument: --table-open-cache=# The number of cached open tables --tc-heuristic-recover=name - Decision to use in heuristic recover process. One of: + Decision to use in heuristic recover process. One of: OFF, COMMIT, ROLLBACK --thread-cache-size=# How many threads we should keep in a cache for reuse. @@ -1162,10 +1162,8 @@ bulk-insert-buffer-size 8388608 changed-page-bitmaps ON character-set-client-handshake TRUE character-set-filesystem binary -character-set-server latin1 character-sets-dir MYSQL_CHARSETSDIR/ chroot (No default value) -collation-server latin1_swedish_ci completion-type NO_CHAIN concurrent-insert AUTO console FALSE @@ -1348,7 +1346,7 @@ performance-schema-max-rwlock-instances -1 performance-schema-max-socket-classes 10 performance-schema-max-socket-instances -1 performance-schema-max-stage-classes 150 -performance-schema-max-statement-classes 181 +performance-schema-max-statement-classes 184 performance-schema-max-table-handles -1 performance-schema-max-table-instances -1 performance-schema-max-thread-classes 50 @@ -1393,7 +1391,7 @@ rowid-merge-buff-size 8388608 safe-user-create FALSE secure-auth TRUE secure-file-priv (No default value) -server-id 0 +server-id 1 show-slave-auth-info FALSE silent-startup FALSE skip-grant-tables TRUE @@ -1434,13 +1432,13 @@ sysdate-is-now FALSE table-cache 431 table-definition-cache 400 table-open-cache 431 -tc-heuristic-recover COMMIT +tc-heuristic-recover OFF thread-cache-size 151 thread-pool-idle-timeout 60 thread-pool-max-threads 1000 thread-pool-oversubscribe 3 thread-pool-stall-limit 500 -thread-stack 296960 +thread-stack 297984 time-format %H:%i:%s timed-mutexes FALSE tmp-table-size 16777216 diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index ef124e74a76..98594973467 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -514,7 +514,7 @@ drop database mysqldump_test_db; # Check that we don't dump in UTF8 in compatible mode by default, # but use the default compiled values, or the values given in # --default-character-set=xxx. However, we should dump in UTF8 -# if it is explicitely set. +# if it is explicitly set. CREATE TABLE t1 (a CHAR(10)); INSERT INTO t1 VALUES (_latin1 'ÄÖÜß'); @@ -691,7 +691,7 @@ DROP TABLE IF EXISTS `t1`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `t1` ( - `b` blob + `b` blob DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; @@ -1785,8 +1785,8 @@ CREATE TABLE `t2` ( `a` int(10) DEFAULT NULL, `b` varchar(30) DEFAULT NULL, `c` datetime DEFAULT NULL, - `d` blob, - `e` text, + `d` blob DEFAULT NULL, + `e` text DEFAULT NULL, PRIMARY KEY (`pk`) ) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; @@ -3287,7 +3287,7 @@ DROP TABLE IF EXISTS `t1`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `t1` ( `a` binary(1) DEFAULT NULL, - `b` blob + `b` blob DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; @@ -3322,7 +3322,7 @@ DROP TABLE IF EXISTS `t1`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `t1` ( `a` binary(1) DEFAULT NULL, - `b` blob + `b` blob DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; @@ -3885,7 +3885,7 @@ INSERT INTO t1 SET c1=11, c2=REPEAT('q',509); /*!40101 SET character_set_client = utf8 */; CREATE TABLE `t1` ( `c1` int(11) DEFAULT NULL, - `c2` longblob + `c2` longblob DEFAULT NULL ); /*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO `t1` VALUES (11,0x7171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171); diff --git a/mysql-test/r/mysqltest_ps.result b/mysql-test/r/mysqltest_ps.result index dcf73455055..153098ff088 100644 --- a/mysql-test/r/mysqltest_ps.result +++ b/mysql-test/r/mysqltest_ps.result @@ -4,8 +4,6 @@ select 1 + "2 a"; Warnings: Warning 1292 Truncated incorrect DOUBLE value: '2 a' create table t (a int primary key, b blob default ''); -Warnings: -Warning 1101 BLOB/TEXT column 'b' can't have a default value select a, (2*a) AS a from t group by a; a a Warnings: @@ -17,8 +15,6 @@ select 1 + "2 a"; Warnings: Warning 1292 Truncated incorrect DOUBLE value: '2 a' create table t (a int primary key, b blob default ''); -Warnings: -Warning 1101 BLOB/TEXT column 'b' can't have a default value select a, (2*a) AS a from t group by a; a a Warnings: @@ -31,8 +27,6 @@ select 1 + "2 a"; Warnings: Warning 1292 Truncated incorrect DOUBLE value: '2 a' create table t (a int primary key, b blob default ''); -Warnings: -Warning 1101 BLOB/TEXT column 'b' can't have a default value select a, (2*a) AS a from t group by a; a a Warnings: diff --git a/mysql-test/r/null.result b/mysql-test/r/null.result index 3da7e4805c2..222ccc809b1 100644 --- a/mysql-test/r/null.result +++ b/mysql-test/r/null.result @@ -50,6 +50,9 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: Note 1003 select inet_ntoa(NULL) AS `inet_ntoa(null)`,inet_aton(NULL) AS `inet_aton(null)`,inet_aton('122.256') AS `inet_aton("122.256")`,inet_aton('122.226.') AS `inet_aton("122.226.")`,inet_aton('') AS `inet_aton("")` +select not null is true, not null or true, not null and false, not null <=> null; +not null is true not null or true not null and false not null <=> null +1 1 0 0 create table t1 (x int); insert into t1 values (null); select * from t1 where x != 0; @@ -906,22 +909,22 @@ FROM t1; SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( - `NULLIF(c_text, 1)` longtext, - `NULLIF(c_text, c_smallint)` longtext, - `NULLIF(c_text, c_tinyint)` longtext, - `NULLIF(c_text, c_int)` longtext, - `NULLIF(c_text, c_bigint)` longtext, - `NULLIF(c_text, c_float)` longtext, - `NULLIF(c_text, c_double)` longtext, - `NULLIF(c_text, c_decimal103)` longtext, - `NULLIF(c_text, c_varchar10)` longtext, - `NULLIF(c_text, c_text)` longtext, - `NULLIF(c_text, c_blob)` longtext, - `NULLIF(c_text, c_enum)` longtext, - `NULLIF(c_text, c_datetime3)` longtext, - `NULLIF(c_text, c_timestamp3)` longtext, - `NULLIF(c_text, c_date)` longtext, - `NULLIF(c_text, c_time)` longtext + `NULLIF(c_text, 1)` longtext DEFAULT NULL, + `NULLIF(c_text, c_smallint)` longtext DEFAULT NULL, + `NULLIF(c_text, c_tinyint)` longtext DEFAULT NULL, + `NULLIF(c_text, c_int)` longtext DEFAULT NULL, + `NULLIF(c_text, c_bigint)` longtext DEFAULT NULL, + `NULLIF(c_text, c_float)` longtext DEFAULT NULL, + `NULLIF(c_text, c_double)` longtext DEFAULT NULL, + `NULLIF(c_text, c_decimal103)` longtext DEFAULT NULL, + `NULLIF(c_text, c_varchar10)` longtext DEFAULT NULL, + `NULLIF(c_text, c_text)` longtext DEFAULT NULL, + `NULLIF(c_text, c_blob)` longtext DEFAULT NULL, + `NULLIF(c_text, c_enum)` longtext DEFAULT NULL, + `NULLIF(c_text, c_datetime3)` longtext DEFAULT NULL, + `NULLIF(c_text, c_timestamp3)` longtext DEFAULT NULL, + `NULLIF(c_text, c_date)` longtext DEFAULT NULL, + `NULLIF(c_text, c_time)` longtext DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t2; CREATE TABLE t2 AS SELECT @@ -945,22 +948,22 @@ FROM t1; SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( - `NULLIF(c_blob, 1)` longblob, - `NULLIF(c_blob, c_smallint)` longblob, - `NULLIF(c_blob, c_tinyint)` longblob, - `NULLIF(c_blob, c_int)` longblob, - `NULLIF(c_blob, c_bigint)` longblob, - `NULLIF(c_blob, c_float)` longblob, - `NULLIF(c_blob, c_double)` longblob, - `NULLIF(c_blob, c_decimal103)` longblob, - `NULLIF(c_blob, c_varchar10)` longblob, - `NULLIF(c_blob, c_text)` longblob, - `NULLIF(c_blob, c_blob)` longblob, - `NULLIF(c_blob, c_enum)` longblob, - `NULLIF(c_blob, c_datetime3)` longblob, - `NULLIF(c_blob, c_timestamp3)` longblob, - `NULLIF(c_blob, c_date)` longblob, - `NULLIF(c_blob, c_time)` longblob + `NULLIF(c_blob, 1)` longblob DEFAULT NULL, + `NULLIF(c_blob, c_smallint)` longblob DEFAULT NULL, + `NULLIF(c_blob, c_tinyint)` longblob DEFAULT NULL, + `NULLIF(c_blob, c_int)` longblob DEFAULT NULL, + `NULLIF(c_blob, c_bigint)` longblob DEFAULT NULL, + `NULLIF(c_blob, c_float)` longblob DEFAULT NULL, + `NULLIF(c_blob, c_double)` longblob DEFAULT NULL, + `NULLIF(c_blob, c_decimal103)` longblob DEFAULT NULL, + `NULLIF(c_blob, c_varchar10)` longblob DEFAULT NULL, + `NULLIF(c_blob, c_text)` longblob DEFAULT NULL, + `NULLIF(c_blob, c_blob)` longblob DEFAULT NULL, + `NULLIF(c_blob, c_enum)` longblob DEFAULT NULL, + `NULLIF(c_blob, c_datetime3)` longblob DEFAULT NULL, + `NULLIF(c_blob, c_timestamp3)` longblob DEFAULT NULL, + `NULLIF(c_blob, c_date)` longblob DEFAULT NULL, + `NULLIF(c_blob, c_time)` longblob DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t2; CREATE TABLE t2 AS SELECT @@ -1556,7 +1559,7 @@ set names utf8; create table t1 (f1 varchar(10)); insert into t1 values ('2015-12-31'); select power( timestamp( nullif( '2002-09-08', f1 ) ), 24 ) from t1; -ERROR 22003: DOUBLE value is out of range in 'pow(cast((case when '2002-09-08' = '2015-12-31' then NULL else '2002-09-08' end) as datetime(6)),24)' +ERROR 22003: DOUBLE value is out of range in 'pow(cast((case when '2002-09-08' = `test`.`t1`.`f1` then NULL else '2002-09-08' end) as datetime(6)),24)' drop table t1; CREATE TABLE t1 (f1 INT); INSERT INTO t1 VALUES (1),(2); @@ -1572,5 +1575,22 @@ SELECT * FROM t1 WHERE NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(N i DROP TABLE t1; # +# MDEV-10236 Where expression with NOT function gives incorrect result +# +CREATE TABLE t1 (c1 INT); +INSERT INTO t1 VALUES (1),(2),(3); +EXPLAIN EXTENDED +SELECT * FROM t1 WHERE ((c1 IS NOT NULL) >= (NOT TRUE)) IS NOT NULL; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where +Warnings: +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (((`test`.`t1`.`c1` is not null) >= ((not(1)))) is not null) +SELECT * FROM t1 WHERE ((c1 IS NOT NULL) >= (NOT TRUE)) IS NOT NULL; +c1 +1 +2 +3 +DROP TABLE t1; +# # End of 10.1 tests # diff --git a/mysql-test/r/openssl_1.result b/mysql-test/r/openssl_1.result index 0aa4acb431c..12c91721381 100644 --- a/mysql-test/r/openssl_1.result +++ b/mysql-test/r/openssl_1.result @@ -228,3 +228,12 @@ connection default; DROP USER bug42158@localhost; set global sql_mode=default; End of 5.1 tests +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; +/*!40019 SET @@session.max_insert_delayed_threads=0*/; +/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; +DELIMITER /*!*/; +DELIMITER ; +# End of log file +ROLLBACK /* added by mysqlbinlog */; +/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; diff --git a/mysql-test/r/order_by.result b/mysql-test/r/order_by.result index a015819e480..3897184f3b1 100644 --- a/mysql-test/r/order_by.result +++ b/mysql-test/r/order_by.result @@ -284,11 +284,7 @@ info text NOT NULL default '', ipnr varchar(30) NOT NULL default '', PRIMARY KEY (member_id) ) ENGINE=MyISAM PACK_KEYS=1; -Warnings: -Warning 1101 BLOB/TEXT column 'info' can't have a default value insert into t1 (member_id) values (1),(2),(3); -Warnings: -Warning 1364 Field 'info' doesn't have a default value select member_id, nickname, voornaam FROM t1 ORDER by lastchange_datum DESC LIMIT 2; member_id nickname voornaam @@ -2987,3 +2983,148 @@ EXPLAIN SELECT id1 FROM t2 WHERE id2=1 AND id3=1 ORDER BY date DESC LIMIT 0,4; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ref id_23_date,id_234_date id_23_date 2 const,const 3 Using where drop table t1,t2; +# +# MDEV-8989: ORDER BY optimizer ignores equality propagation +# +set @tmp_8989=@@optimizer_switch; +set optimizer_switch='orderby_uses_equalities=on'; +create table t0(a int); +insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +create table t1(a int); +insert into t1 select A.a + B.a* 10 + C.a * 100 from t0 A, t0 B, t0 C; +create table t2 ( +pk int primary key, +a int, b int, +filler char(200), +key(a) +); +insert into t2 select a, 1000-a, 1000-a, repeat('abc-',50) from t1 where a<200 limit 200; +create table t3 ( +pk int primary key, +a int, b int, +filler char(200), +key(a) +); +insert into t3 select a, 1000-a, 1000-a, repeat('abc-',50) from t1; +insert into t3 select a+1000, 1000+a, 1000+a, repeat('abc-',50) from t1; +# The optimizer produces an order of 't2,t3' for this join +# +# Case #1 (from the bug report): +# Q1 can take advantage of t2.a to resolve ORDER BY limit w/o sorting +explain +select t2.pk,t2.a,t2.b,t3.pk,t3.a,t3.b +from t2, t3 where t2.a=t3.a order by t2.a limit 5; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 index a a 5 NULL 5 Using where +1 SIMPLE t3 ref a a 5 test.t2.a 1 +# +# This is Q2 which used to have "Using temporary; using filesort" but +# has the same query plan as Q1: +# +explain +select t2.pk,t2.a,t2.b,t3.pk,t3.a,t3.b +from t2, t3 where t2.a=t3.a order by t3.a limit 5; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 index a a 5 NULL 5 Using where +1 SIMPLE t3 ref a a 5 test.t2.a 1 +select t2.pk,t2.a,t2.b,t3.pk,t3.a,t3.b +from t2, t3 where t2.a=t3.a order by t2.a limit 5; +pk a b pk a b +199 801 801 199 801 801 +198 802 802 198 802 802 +197 803 803 197 803 803 +196 804 804 196 804 804 +195 805 805 195 805 805 +select t2.pk,t2.a,t2.b,t3.pk,t3.a,t3.b +from t2, t3 where t2.a=t3.a order by t3.a limit 5; +pk a b pk a b +199 801 801 199 801 801 +198 802 802 198 802 802 +197 803 803 197 803 803 +196 804 804 196 804 804 +195 805 805 195 805 805 +# +# Case #2: here, only "Using temporary" is removed. "Using filesort" remains. +# +explain +select t2.pk,t2.a,t2.b,t3.pk,t3.a,t3.b +from t2, t3 where t2.a=t3.a order by t2.a limit 25; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL a NULL NULL NULL 200 Using where; Using filesort +1 SIMPLE t3 ref a a 5 test.t2.a 1 +explain +select t2.pk,t2.a,t2.b,t3.pk,t3.a,t3.b +from t2, t3 where t2.a=t3.a order by t3.a limit 25; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL a NULL NULL NULL 200 Using where; Using filesort +1 SIMPLE t3 ref a a 5 test.t2.a 1 +select t2.pk,t2.a,t2.b,t3.pk,t3.a,t3.b +from t2, t3 where t2.a=t3.a order by t2.a limit 25; +pk a b pk a b +199 801 801 199 801 801 +198 802 802 198 802 802 +197 803 803 197 803 803 +196 804 804 196 804 804 +195 805 805 195 805 805 +194 806 806 194 806 806 +193 807 807 193 807 807 +192 808 808 192 808 808 +191 809 809 191 809 809 +190 810 810 190 810 810 +189 811 811 189 811 811 +188 812 812 188 812 812 +187 813 813 187 813 813 +186 814 814 186 814 814 +185 815 815 185 815 815 +184 816 816 184 816 816 +183 817 817 183 817 817 +182 818 818 182 818 818 +181 819 819 181 819 819 +180 820 820 180 820 820 +179 821 821 179 821 821 +178 822 822 178 822 822 +177 823 823 177 823 823 +176 824 824 176 824 824 +175 825 825 175 825 825 +select t2.pk,t2.a,t2.b,t3.pk,t3.a,t3.b +from t2, t3 where t2.a=t3.a order by t3.a limit 25; +pk a b pk a b +199 801 801 199 801 801 +198 802 802 198 802 802 +197 803 803 197 803 803 +196 804 804 196 804 804 +195 805 805 195 805 805 +194 806 806 194 806 806 +193 807 807 193 807 807 +192 808 808 192 808 808 +191 809 809 191 809 809 +190 810 810 190 810 810 +189 811 811 189 811 811 +188 812 812 188 812 812 +187 813 813 187 813 813 +186 814 814 186 814 814 +185 815 815 185 815 815 +184 816 816 184 816 816 +183 817 817 183 817 817 +182 818 818 182 818 818 +181 819 819 181 819 819 +180 820 820 180 820 820 +179 821 821 179 821 821 +178 822 822 178 822 822 +177 823 823 177 823 823 +176 824 824 176 824 824 +175 825 825 175 825 825 +# +# Case #3: single table access (the code that decides whether we need +# "Using temporary" is not invoked) +# +explain select * from t3 where b=a order by a limit 10; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 index NULL a 5 NULL 10 Using where +# This must not use filesort. The query plan should be like the query above: +explain select * from t3 where b=a order by b limit 10; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 index NULL a 5 NULL 10 Using where +drop table t0,t1,t2,t3; +set @@optimizer_switch=@tmp_8989; +set optimizer_switch='orderby_uses_equalities=on'; diff --git a/mysql-test/r/parser.result b/mysql-test/r/parser.result index efb9ff07565..499f37e6dfb 100644 --- a/mysql-test/r/parser.result +++ b/mysql-test/r/parser.result @@ -643,6 +643,26 @@ CREATE TRIGGER trigger1 BEFORE INSERT ON t1 FOR EACH ROW SET default_storage_engine = NEW.INNODB; ERROR 42S22: Unknown column 'INNODB' in 'NEW' DROP TABLE t1; +select 0==0; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '=0' at line 1 +select 1=!0, 1 = ! 0; +1=!0 1 = ! 0 +1 1 +select !!0, ! ! 0; +!!0 ! ! 0 +0 0 +select 2>!0, 2 > ! 0; +2>!0 2 > ! 0 +1 1 +select 0<=!0, 0 <= !0; +0<=!0 0 <= !0 +1 1 +select 1< 0; VARIABLE_NAME VARIABLE_VALUE @@ -135,7 +135,7 @@ HANDLER_TMP_WRITE 22 # 2 locks (1 table, all partitions pruned) FLUSH STATUS; INSERT INTO v1 VALUES (32); -ERROR HY000: CHECK OPTION failed 'test.v1' +ERROR 44000: CHECK OPTION failed `test`.`v1` SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME LIKE 'HANDLER_%' AND VARIABLE_VALUE > 0; VARIABLE_NAME VARIABLE_VALUE diff --git a/mysql-test/r/plugin_auth.result b/mysql-test/r/plugin_auth.result index 345d6861ad4..436db33af36 100644 --- a/mysql-test/r/plugin_auth.result +++ b/mysql-test/r/plugin_auth.result @@ -25,7 +25,7 @@ proxies_priv CREATE TABLE `proxies_priv` ( `User` char(80) COLLATE utf8_bin NOT NULL DEFAULT '', `Proxied_host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '', `Proxied_user` char(80) COLLATE utf8_bin NOT NULL DEFAULT '', - `With_grant` tinyint(1) NOT NULL DEFAULT '0', + `With_grant` tinyint(1) NOT NULL DEFAULT 0, `Grantor` char(141) COLLATE utf8_bin NOT NULL DEFAULT '', `Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`Host`,`User`,`Proxied_host`,`Proxied_user`), diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result index d72ecd65547..6f66ae31a39 100644 --- a/mysql-test/r/ps.result +++ b/mysql-test/r/ps.result @@ -3397,7 +3397,7 @@ CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; SHOW CREATE TABLE tmp1; Table Create Table tmp1 CREATE TEMPORARY TABLE `tmp1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SELECT @a, @a = '2007-11-18 15:01:02'; @a @a = '2007-11-18 15:01:02' @@ -3415,7 +3415,7 @@ CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; SHOW CREATE TABLE tmp1; Table Create Table tmp1 CREATE TEMPORARY TABLE `tmp1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SELECT @a, @a = '1234-11-12 12:34:59'; @a @a = '1234-11-12 12:34:59' @@ -3433,7 +3433,7 @@ CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; SHOW CREATE TABLE tmp1; Table Create Table tmp1 CREATE TEMPORARY TABLE `tmp1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SELECT @a, @a = '123:45:01'; @a @a = '123:45:01' @@ -3451,7 +3451,7 @@ CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; SHOW CREATE TABLE tmp1; Table Create Table tmp1 CREATE TEMPORARY TABLE `tmp1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SELECT @a, @a = '1234-11-12'; @a @a = '1234-11-12' @@ -3523,7 +3523,7 @@ CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; SHOW CREATE TABLE tmp1; Table Create Table tmp1 CREATE TEMPORARY TABLE `tmp1` ( - `c1` decimal(65,30) DEFAULT NULL + `c1` decimal(65,38) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SELECT @a, @a = 123.456789; @a @a = 123.456789 @@ -3541,7 +3541,7 @@ CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; SHOW CREATE TABLE tmp1; Table Create Table tmp1 CREATE TEMPORARY TABLE `tmp1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SELECT @a, @a = REPEAT('a', 16); @a @a = REPEAT('a', 16) @@ -3559,7 +3559,7 @@ CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; SHOW CREATE TABLE tmp1; Table Create Table tmp1 CREATE TEMPORARY TABLE `tmp1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SELECT @a, @a = REPEAT('b', 16); @a @a = REPEAT('b', 16) @@ -3577,7 +3577,7 @@ CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; SHOW CREATE TABLE tmp1; Table Create Table tmp1 CREATE TEMPORARY TABLE `tmp1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SELECT @a, @a = REPEAT('c', 16); @a @a = REPEAT('c', 16) @@ -3595,7 +3595,7 @@ CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; SHOW CREATE TABLE tmp1; Table Create Table tmp1 CREATE TEMPORARY TABLE `tmp1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SELECT @a, @a = REPEAT('d', 16); @a @a = REPEAT('d', 16) @@ -3613,7 +3613,7 @@ CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; SHOW CREATE TABLE tmp1; Table Create Table tmp1 CREATE TEMPORARY TABLE `tmp1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SELECT @a, @a = REPEAT('e', 16); @a @a = REPEAT('e', 16) @@ -3631,7 +3631,7 @@ CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; SHOW CREATE TABLE tmp1; Table Create Table tmp1 CREATE TEMPORARY TABLE `tmp1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SELECT @a, @a = REPEAT('f', 16); @a @a = REPEAT('f', 16) @@ -3649,7 +3649,7 @@ CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; SHOW CREATE TABLE tmp1; Table Create Table tmp1 CREATE TEMPORARY TABLE `tmp1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SELECT @a, @a = REPEAT('g', 32); @a @a = REPEAT('g', 32) @@ -3667,7 +3667,7 @@ CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; SHOW CREATE TABLE tmp1; Table Create Table tmp1 CREATE TEMPORARY TABLE `tmp1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SELECT @a, @a = REPEAT('h', 16); @a @a = REPEAT('h', 16) @@ -3685,7 +3685,7 @@ CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; SHOW CREATE TABLE tmp1; Table Create Table tmp1 CREATE TEMPORARY TABLE `tmp1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SELECT @a, @a = REPEAT('i', 16); @a @a = REPEAT('i', 16) @@ -3703,7 +3703,7 @@ CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; SHOW CREATE TABLE tmp1; Table Create Table tmp1 CREATE TEMPORARY TABLE `tmp1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SELECT @a, @a = REPEAT('j', 16); @a @a = REPEAT('j', 16) @@ -3721,7 +3721,7 @@ CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; SHOW CREATE TABLE tmp1; Table Create Table tmp1 CREATE TEMPORARY TABLE `tmp1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SELECT @a, @a = REPEAT('k', 16); @a @a = REPEAT('k', 16) @@ -3739,7 +3739,7 @@ CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; SHOW CREATE TABLE tmp1; Table Create Table tmp1 CREATE TEMPORARY TABLE `tmp1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SELECT @a, @a = REPEAT('l', 16); @a @a = REPEAT('l', 16) @@ -3757,7 +3757,7 @@ CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; SHOW CREATE TABLE tmp1; Table Create Table tmp1 CREATE TEMPORARY TABLE `tmp1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SELECT @a, @a = 'aaa'; @a @a = 'aaa' @@ -3775,7 +3775,7 @@ CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; SHOW CREATE TABLE tmp1; Table Create Table tmp1 CREATE TEMPORARY TABLE `tmp1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SELECT @a, @a = 'aaa'; @a @a = 'aaa' diff --git a/mysql-test/r/ps_1general.result b/mysql-test/r/ps_1general.result index 326d37ee560..0fa12287080 100644 --- a/mysql-test/r/ps_1general.result +++ b/mysql-test/r/ps_1general.result @@ -444,15 +444,15 @@ prepare stmt1 from ' explain select a from t1 order by b '; execute stmt1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def id 8 3 1 Y 32928 0 63 -def select_type 253 19 6 N 1 31 8 -def table 253 64 2 Y 0 31 8 -def type 253 10 3 Y 0 31 8 -def possible_keys 253 4_OR_8_K 0 Y 0 31 8 -def key 253 64 0 Y 0 31 8 -def key_len 253 4_OR_8_K 0 Y 0 31 8 -def ref 253 2048 0 Y 0 31 8 +def select_type 253 19 6 N 1 39 8 +def table 253 64 2 Y 0 39 8 +def type 253 10 3 Y 0 39 8 +def possible_keys 253 4_OR_8_K 0 Y 0 39 8 +def key 253 64 0 Y 0 39 8 +def key_len 253 4_OR_8_K 0 Y 0 39 8 +def ref 253 2048 0 Y 0 39 8 def rows 8 10 1 Y 32928 0 63 -def Extra 253 255 14 N 1 31 8 +def Extra 253 255 14 N 1 39 8 id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using filesort SET @arg00=1 ; @@ -460,15 +460,15 @@ prepare stmt1 from ' explain select a from t1 where a > ? order by b '; execute stmt1 using @arg00; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def id 8 3 1 Y 32928 0 63 -def select_type 253 19 6 N 1 31 8 -def table 253 64 2 Y 0 31 8 -def type 253 10 5 Y 0 31 8 -def possible_keys 253 4_OR_8_K 7 Y 0 31 8 -def key 253 64 7 Y 0 31 8 -def key_len 253 4_OR_8_K 1 Y 0 31 8 -def ref 253 2048 0 Y 0 31 8 +def select_type 253 19 6 N 1 39 8 +def table 253 64 2 Y 0 39 8 +def type 253 10 5 Y 0 39 8 +def possible_keys 253 4_OR_8_K 7 Y 0 39 8 +def key 253 64 7 Y 0 39 8 +def key_len 253 4_OR_8_K 1 Y 0 39 8 +def ref 253 2048 0 Y 0 39 8 def rows 8 10 1 Y 32928 0 63 -def Extra 253 255 37 N 1 31 8 +def Extra 253 255 37 N 1 39 8 id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 3 Using index condition; Using filesort drop table if exists t2; diff --git a/mysql-test/r/ps_2myisam.result b/mysql-test/r/ps_2myisam.result index 6d7544deb4e..5ed5fa727fb 100644 --- a/mysql-test/r/ps_2myisam.result +++ b/mysql-test/r/ps_2myisam.result @@ -1154,15 +1154,15 @@ prepare stmt1 from ' explain select * from t9 ' ; execute stmt1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def id 8 3 1 Y 32928 0 63 -def select_type 253 19 6 N 1 31 8 -def table 253 64 2 Y 0 31 8 -def type 253 10 3 Y 0 31 8 -def possible_keys 253 4_OR_8_K 0 Y 0 31 8 -def key 253 64 0 Y 0 31 8 -def key_len 253 4_OR_8_K 0 Y 0 31 8 -def ref 253 2048 0 Y 0 31 8 +def select_type 253 19 6 N 1 39 8 +def table 253 64 2 Y 0 39 8 +def type 253 10 3 Y 0 39 8 +def possible_keys 253 4_OR_8_K 0 Y 0 39 8 +def key 253 64 0 Y 0 39 8 +def key_len 253 4_OR_8_K 0 Y 0 39 8 +def ref 253 2048 0 Y 0 39 8 def rows 8 10 1 Y 32928 0 63 -def Extra 253 255 0 N 1 31 8 +def Extra 253 255 0 N 1 39 8 id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t9 ALL NULL NULL NULL NULL 2 drop table if exists t2 ; @@ -1779,37 +1779,37 @@ t5 CREATE TABLE `t5` ( `const01` int(1) NOT NULL, `param01` bigint(20) DEFAULT NULL, `const02` decimal(2,1) NOT NULL, - `param02` decimal(65,30) DEFAULT NULL, + `param02` decimal(65,38) DEFAULT NULL, `const03` double NOT NULL, `param03` double DEFAULT NULL, `const04` varchar(3) NOT NULL, - `param04` longtext, + `param04` longtext DEFAULT NULL, `const05` varbinary(3) NOT NULL, - `param05` longblob, + `param05` longblob DEFAULT NULL, `const06` varchar(10) NOT NULL, - `param06` longtext, + `param06` longtext DEFAULT NULL, `const07` date DEFAULT NULL, - `param07` longtext, + `param07` longtext DEFAULT NULL, `const08` varchar(19) NOT NULL, - `param08` longtext, + `param08` longtext DEFAULT NULL, `const09` datetime DEFAULT NULL, - `param09` longtext, + `param09` longtext DEFAULT NULL, `const10` bigint(17) DEFAULT NULL, `param10` bigint(20) DEFAULT NULL, `const11` int(4) DEFAULT NULL, `param11` bigint(20) DEFAULT NULL, `const12` binary(0) DEFAULT NULL, `param12` bigint(20) DEFAULT NULL, - `param13` decimal(65,30) DEFAULT NULL, - `param14` longtext, - `param15` longblob + `param13` decimal(65,38) DEFAULT NULL, + `param14` longtext DEFAULT NULL, + `param15` longblob DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 select * from t5 ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def test t5 t5 const01 const01 3 1 1 N 36865 0 63 def test t5 t5 param01 param01 8 20 1 Y 32768 0 63 def test t5 t5 const02 const02 246 4 3 N 36865 1 63 -def test t5 t5 param02 param02 246 67 32 Y 32768 30 63 +def test t5 t5 param02 param02 246 67 40 Y 32768 38 63 def test t5 t5 const03 const03 5 17 1 N 36865 31 63 def test t5 t5 param03 param03 5 23 1 Y 32768 31 63 def test t5 t5 const04 const04 253 3 3 N 4097 0 8 @@ -1830,13 +1830,13 @@ def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 def test t5 t5 const12 const12 254 0 0 Y 128 0 63 def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 -def test t5 t5 param13 param13 246 67 0 Y 32768 30 63 +def test t5 t5 param13 param13 246 67 0 Y 32768 38 63 def test t5 t5 param14 param14 252 4294967295 0 Y 16 0 8 def test t5 t5 param15 param15 252 4294967295 0 Y 144 0 63 const01 8 param01 8 const02 8.0 -param02 8.000000000000000000000000000000 +param02 8.00000000000000000000000000000000000000 const03 8 param03 8 const04 abc @@ -1928,28 +1928,28 @@ def @arg07 5 23 1 Y 32896 31 63 def @arg08 5 23 1 Y 32896 31 63 def @arg09 5 23 1 Y 32896 31 63 def @arg10 5 23 1 Y 32896 31 63 -def @arg11 246 83 6 Y 32896 30 63 -def @arg12 246 83 6 Y 32896 30 63 -def @arg13 250 16777215 10 Y 0 31 8 -def @arg14 250 16777215 19 Y 0 31 8 -def @arg15 250 16777215 19 Y 0 31 8 -def @arg16 250 16777215 8 Y 0 31 8 +def @arg11 246 83 6 Y 32896 38 63 +def @arg12 246 83 6 Y 32896 38 63 +def @arg13 250 16777215 10 Y 0 39 8 +def @arg14 250 16777215 19 Y 0 39 8 +def @arg15 250 16777215 19 Y 0 39 8 +def @arg16 250 16777215 8 Y 0 39 8 def @arg17 8 20 4 Y 32928 0 63 def @arg18 8 20 1 Y 32896 0 63 def @arg19 8 20 1 Y 32896 0 63 -def @arg20 250 16777215 1 Y 0 31 8 -def @arg21 250 16777215 10 Y 0 31 8 -def @arg22 250 16777215 30 Y 0 31 8 -def @arg23 250 16777215 8 Y 128 31 63 -def @arg24 250 16777215 8 Y 0 31 8 -def @arg25 250 16777215 4 Y 128 31 63 -def @arg26 250 16777215 4 Y 0 31 8 -def @arg27 250 16777215 10 Y 128 31 63 -def @arg28 250 16777215 10 Y 0 31 8 -def @arg29 250 16777215 8 Y 128 31 63 -def @arg30 250 16777215 8 Y 0 31 8 -def @arg31 250 16777215 3 Y 0 31 8 -def @arg32 250 16777215 6 Y 0 31 8 +def @arg20 250 16777215 1 Y 0 39 8 +def @arg21 250 16777215 10 Y 0 39 8 +def @arg22 250 16777215 30 Y 0 39 8 +def @arg23 250 16777215 8 Y 128 39 63 +def @arg24 250 16777215 8 Y 0 39 8 +def @arg25 250 16777215 4 Y 128 39 63 +def @arg26 250 16777215 4 Y 0 39 8 +def @arg27 250 16777215 10 Y 128 39 63 +def @arg28 250 16777215 10 Y 0 39 8 +def @arg29 250 16777215 8 Y 128 39 63 +def @arg30 250 16777215 8 Y 0 39 8 +def @arg31 250 16777215 3 Y 0 39 8 +def @arg32 250 16777215 6 Y 0 39 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, @@ -1975,28 +1975,28 @@ def @arg07 5 23 0 Y 32896 31 63 def @arg08 5 23 0 Y 32896 31 63 def @arg09 5 23 0 Y 32896 31 63 def @arg10 5 23 0 Y 32896 31 63 -def @arg11 246 83 0 Y 32896 30 63 -def @arg12 246 83 0 Y 32896 30 63 -def @arg13 250 16777215 0 Y 0 31 8 -def @arg14 250 16777215 0 Y 0 31 8 -def @arg15 250 16777215 19 Y 0 31 8 -def @arg16 250 16777215 0 Y 0 31 8 +def @arg11 246 83 0 Y 32896 38 63 +def @arg12 246 83 0 Y 32896 38 63 +def @arg13 250 16777215 0 Y 0 39 8 +def @arg14 250 16777215 0 Y 0 39 8 +def @arg15 250 16777215 19 Y 0 39 8 +def @arg16 250 16777215 0 Y 0 39 8 def @arg17 8 20 0 Y 32928 0 63 def @arg18 8 20 0 Y 32896 0 63 def @arg19 8 20 0 Y 32896 0 63 -def @arg20 250 16777215 0 Y 0 31 8 -def @arg21 250 16777215 0 Y 0 31 8 -def @arg22 250 16777215 0 Y 0 31 8 -def @arg23 250 16777215 0 Y 128 31 63 -def @arg24 250 16777215 0 Y 0 31 8 -def @arg25 250 16777215 0 Y 128 31 63 -def @arg26 250 16777215 0 Y 0 31 8 -def @arg27 250 16777215 0 Y 128 31 63 -def @arg28 250 16777215 0 Y 0 31 8 -def @arg29 250 16777215 0 Y 128 31 63 -def @arg30 250 16777215 0 Y 0 31 8 -def @arg31 250 16777215 0 Y 0 31 8 -def @arg32 250 16777215 0 Y 0 31 8 +def @arg20 250 16777215 0 Y 0 39 8 +def @arg21 250 16777215 0 Y 0 39 8 +def @arg22 250 16777215 0 Y 0 39 8 +def @arg23 250 16777215 0 Y 128 39 63 +def @arg24 250 16777215 0 Y 0 39 8 +def @arg25 250 16777215 0 Y 128 39 63 +def @arg26 250 16777215 0 Y 0 39 8 +def @arg27 250 16777215 0 Y 128 39 63 +def @arg28 250 16777215 0 Y 0 39 8 +def @arg29 250 16777215 0 Y 128 39 63 +def @arg30 250 16777215 0 Y 0 39 8 +def @arg31 250 16777215 0 Y 0 39 8 +def @arg32 250 16777215 0 Y 0 39 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select @@ -2025,28 +2025,28 @@ def @arg07 5 23 1 Y 32896 31 63 def @arg08 5 23 1 Y 32896 31 63 def @arg09 5 23 1 Y 32896 31 63 def @arg10 5 23 1 Y 32896 31 63 -def @arg11 246 83 6 Y 32896 30 63 -def @arg12 246 83 6 Y 32896 30 63 -def @arg13 250 16777215 10 Y 0 31 8 -def @arg14 250 16777215 19 Y 0 31 8 -def @arg15 250 16777215 19 Y 0 31 8 -def @arg16 250 16777215 8 Y 0 31 8 +def @arg11 246 83 6 Y 32896 38 63 +def @arg12 246 83 6 Y 32896 38 63 +def @arg13 250 16777215 10 Y 0 39 8 +def @arg14 250 16777215 19 Y 0 39 8 +def @arg15 250 16777215 19 Y 0 39 8 +def @arg16 250 16777215 8 Y 0 39 8 def @arg17 8 20 4 Y 32928 0 63 def @arg18 8 20 1 Y 32896 0 63 def @arg19 8 20 1 Y 32896 0 63 -def @arg20 250 16777215 1 Y 0 31 8 -def @arg21 250 16777215 10 Y 0 31 8 -def @arg22 250 16777215 30 Y 0 31 8 -def @arg23 250 16777215 8 Y 128 31 63 -def @arg24 250 16777215 8 Y 0 31 8 -def @arg25 250 16777215 4 Y 128 31 63 -def @arg26 250 16777215 4 Y 0 31 8 -def @arg27 250 16777215 10 Y 128 31 63 -def @arg28 250 16777215 10 Y 0 31 8 -def @arg29 250 16777215 8 Y 128 31 63 -def @arg30 250 16777215 8 Y 0 31 8 -def @arg31 250 16777215 3 Y 0 31 8 -def @arg32 250 16777215 6 Y 0 31 8 +def @arg20 250 16777215 1 Y 0 39 8 +def @arg21 250 16777215 10 Y 0 39 8 +def @arg22 250 16777215 30 Y 0 39 8 +def @arg23 250 16777215 8 Y 128 39 63 +def @arg24 250 16777215 8 Y 0 39 8 +def @arg25 250 16777215 4 Y 128 39 63 +def @arg26 250 16777215 4 Y 0 39 8 +def @arg27 250 16777215 10 Y 128 39 63 +def @arg28 250 16777215 10 Y 0 39 8 +def @arg29 250 16777215 8 Y 128 39 63 +def @arg30 250 16777215 8 Y 0 39 8 +def @arg31 250 16777215 3 Y 0 39 8 +def @arg32 250 16777215 6 Y 0 39 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; @@ -2065,28 +2065,28 @@ def @arg07 5 23 0 Y 32896 31 63 def @arg08 5 23 0 Y 32896 31 63 def @arg09 5 23 0 Y 32896 31 63 def @arg10 5 23 0 Y 32896 31 63 -def @arg11 246 83 0 Y 32896 30 63 -def @arg12 246 83 0 Y 32896 30 63 -def @arg13 250 16777215 0 Y 0 31 8 -def @arg14 250 16777215 0 Y 0 31 8 -def @arg15 250 16777215 19 Y 0 31 8 -def @arg16 250 16777215 0 Y 0 31 8 +def @arg11 246 83 0 Y 32896 38 63 +def @arg12 246 83 0 Y 32896 38 63 +def @arg13 250 16777215 0 Y 0 39 8 +def @arg14 250 16777215 0 Y 0 39 8 +def @arg15 250 16777215 19 Y 0 39 8 +def @arg16 250 16777215 0 Y 0 39 8 def @arg17 8 20 0 Y 32928 0 63 def @arg18 8 20 0 Y 32896 0 63 def @arg19 8 20 0 Y 32896 0 63 -def @arg20 250 16777215 0 Y 0 31 8 -def @arg21 250 16777215 0 Y 0 31 8 -def @arg22 250 16777215 0 Y 0 31 8 -def @arg23 250 16777215 0 Y 128 31 63 -def @arg24 250 16777215 0 Y 0 31 8 -def @arg25 250 16777215 0 Y 128 31 63 -def @arg26 250 16777215 0 Y 0 31 8 -def @arg27 250 16777215 0 Y 128 31 63 -def @arg28 250 16777215 0 Y 0 31 8 -def @arg29 250 16777215 0 Y 128 31 63 -def @arg30 250 16777215 0 Y 0 31 8 -def @arg31 250 16777215 0 Y 0 31 8 -def @arg32 250 16777215 0 Y 0 31 8 +def @arg20 250 16777215 0 Y 0 39 8 +def @arg21 250 16777215 0 Y 0 39 8 +def @arg22 250 16777215 0 Y 0 39 8 +def @arg23 250 16777215 0 Y 128 39 63 +def @arg24 250 16777215 0 Y 0 39 8 +def @arg25 250 16777215 0 Y 128 39 63 +def @arg26 250 16777215 0 Y 0 39 8 +def @arg27 250 16777215 0 Y 128 39 63 +def @arg28 250 16777215 0 Y 0 39 8 +def @arg29 250 16777215 0 Y 128 39 63 +def @arg30 250 16777215 0 Y 0 39 8 +def @arg31 250 16777215 0 Y 0 39 8 +def @arg32 250 16777215 0 Y 0 39 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select ? := c1 from t9 where c1= 1" ; @@ -2113,28 +2113,28 @@ def @arg07 5 23 1 Y 32896 31 63 def @arg08 5 23 1 Y 32896 31 63 def @arg09 5 23 1 Y 32896 31 63 def @arg10 5 23 1 Y 32896 31 63 -def @arg11 246 83 6 Y 32896 30 63 -def @arg12 246 83 6 Y 32896 30 63 -def @arg13 250 16777215 10 Y 0 31 8 -def @arg14 250 16777215 19 Y 0 31 8 -def @arg15 250 16777215 19 Y 0 31 8 -def @arg16 250 16777215 8 Y 0 31 8 +def @arg11 246 83 6 Y 32896 38 63 +def @arg12 246 83 6 Y 32896 38 63 +def @arg13 250 16777215 10 Y 0 39 8 +def @arg14 250 16777215 19 Y 0 39 8 +def @arg15 250 16777215 19 Y 0 39 8 +def @arg16 250 16777215 8 Y 0 39 8 def @arg17 8 20 4 Y 32928 0 63 def @arg18 8 20 1 Y 32896 0 63 def @arg19 8 20 1 Y 32896 0 63 -def @arg20 250 16777215 1 Y 0 31 8 -def @arg21 250 16777215 10 Y 0 31 8 -def @arg22 250 16777215 30 Y 0 31 8 -def @arg23 250 16777215 8 Y 128 31 63 -def @arg24 250 16777215 8 Y 0 31 8 -def @arg25 250 16777215 4 Y 128 31 63 -def @arg26 250 16777215 4 Y 0 31 8 -def @arg27 250 16777215 10 Y 128 31 63 -def @arg28 250 16777215 10 Y 0 31 8 -def @arg29 250 16777215 8 Y 128 31 63 -def @arg30 250 16777215 8 Y 0 31 8 -def @arg31 250 16777215 3 Y 0 31 8 -def @arg32 250 16777215 6 Y 0 31 8 +def @arg20 250 16777215 1 Y 0 39 8 +def @arg21 250 16777215 10 Y 0 39 8 +def @arg22 250 16777215 30 Y 0 39 8 +def @arg23 250 16777215 8 Y 128 39 63 +def @arg24 250 16777215 8 Y 0 39 8 +def @arg25 250 16777215 4 Y 128 39 63 +def @arg26 250 16777215 4 Y 0 39 8 +def @arg27 250 16777215 10 Y 128 39 63 +def @arg28 250 16777215 10 Y 0 39 8 +def @arg29 250 16777215 8 Y 128 39 63 +def @arg30 250 16777215 8 Y 0 39 8 +def @arg31 250 16777215 3 Y 0 39 8 +def @arg32 250 16777215 6 Y 0 39 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, @@ -2157,28 +2157,28 @@ def @arg07 5 23 0 Y 32896 31 63 def @arg08 5 23 0 Y 32896 31 63 def @arg09 5 23 0 Y 32896 31 63 def @arg10 5 23 0 Y 32896 31 63 -def @arg11 246 83 0 Y 32896 30 63 -def @arg12 246 83 0 Y 32896 30 63 -def @arg13 250 16777215 0 Y 0 31 8 -def @arg14 250 16777215 0 Y 0 31 8 -def @arg15 250 16777215 19 Y 0 31 8 -def @arg16 250 16777215 0 Y 0 31 8 +def @arg11 246 83 0 Y 32896 38 63 +def @arg12 246 83 0 Y 32896 38 63 +def @arg13 250 16777215 0 Y 0 39 8 +def @arg14 250 16777215 0 Y 0 39 8 +def @arg15 250 16777215 19 Y 0 39 8 +def @arg16 250 16777215 0 Y 0 39 8 def @arg17 8 20 0 Y 32928 0 63 def @arg18 8 20 0 Y 32896 0 63 def @arg19 8 20 0 Y 32896 0 63 -def @arg20 250 16777215 0 Y 0 31 8 -def @arg21 250 16777215 0 Y 0 31 8 -def @arg22 250 16777215 0 Y 0 31 8 -def @arg23 250 16777215 0 Y 128 31 63 -def @arg24 250 16777215 0 Y 0 31 8 -def @arg25 250 16777215 0 Y 128 31 63 -def @arg26 250 16777215 0 Y 0 31 8 -def @arg27 250 16777215 0 Y 128 31 63 -def @arg28 250 16777215 0 Y 0 31 8 -def @arg29 250 16777215 0 Y 128 31 63 -def @arg30 250 16777215 0 Y 0 31 8 -def @arg31 250 16777215 0 Y 0 31 8 -def @arg32 250 16777215 0 Y 0 31 8 +def @arg20 250 16777215 0 Y 0 39 8 +def @arg21 250 16777215 0 Y 0 39 8 +def @arg22 250 16777215 0 Y 0 39 8 +def @arg23 250 16777215 0 Y 128 39 63 +def @arg24 250 16777215 0 Y 0 39 8 +def @arg25 250 16777215 0 Y 128 39 63 +def @arg26 250 16777215 0 Y 0 39 8 +def @arg27 250 16777215 0 Y 128 39 63 +def @arg28 250 16777215 0 Y 0 39 8 +def @arg29 250 16777215 0 Y 128 39 63 +def @arg30 250 16777215 0 Y 0 39 8 +def @arg31 250 16777215 0 Y 0 39 8 +def @arg32 250 16777215 0 Y 0 39 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, @@ -2203,28 +2203,28 @@ def @arg07 5 23 1 Y 32896 31 63 def @arg08 5 23 1 Y 32896 31 63 def @arg09 5 23 1 Y 32896 31 63 def @arg10 5 23 1 Y 32896 31 63 -def @arg11 246 83 6 Y 32896 30 63 -def @arg12 246 83 6 Y 32896 30 63 -def @arg13 250 16777215 10 Y 0 31 8 -def @arg14 250 16777215 19 Y 0 31 8 -def @arg15 250 16777215 19 Y 0 31 8 -def @arg16 250 16777215 8 Y 0 31 8 +def @arg11 246 83 6 Y 32896 38 63 +def @arg12 246 83 6 Y 32896 38 63 +def @arg13 250 16777215 10 Y 0 39 8 +def @arg14 250 16777215 19 Y 0 39 8 +def @arg15 250 16777215 19 Y 0 39 8 +def @arg16 250 16777215 8 Y 0 39 8 def @arg17 8 20 4 Y 32928 0 63 def @arg18 8 20 1 Y 32896 0 63 def @arg19 8 20 1 Y 32896 0 63 -def @arg20 250 16777215 1 Y 0 31 8 -def @arg21 250 16777215 10 Y 0 31 8 -def @arg22 250 16777215 30 Y 0 31 8 -def @arg23 250 16777215 8 Y 128 31 63 -def @arg24 250 16777215 8 Y 0 31 8 -def @arg25 250 16777215 4 Y 128 31 63 -def @arg26 250 16777215 4 Y 0 31 8 -def @arg27 250 16777215 10 Y 128 31 63 -def @arg28 250 16777215 10 Y 0 31 8 -def @arg29 250 16777215 8 Y 128 31 63 -def @arg30 250 16777215 8 Y 0 31 8 -def @arg31 250 16777215 3 Y 0 31 8 -def @arg32 250 16777215 6 Y 0 31 8 +def @arg20 250 16777215 1 Y 0 39 8 +def @arg21 250 16777215 10 Y 0 39 8 +def @arg22 250 16777215 30 Y 0 39 8 +def @arg23 250 16777215 8 Y 128 39 63 +def @arg24 250 16777215 8 Y 0 39 8 +def @arg25 250 16777215 4 Y 128 39 63 +def @arg26 250 16777215 4 Y 0 39 8 +def @arg27 250 16777215 10 Y 128 39 63 +def @arg28 250 16777215 10 Y 0 39 8 +def @arg29 250 16777215 8 Y 128 39 63 +def @arg30 250 16777215 8 Y 0 39 8 +def @arg31 250 16777215 3 Y 0 39 8 +def @arg32 250 16777215 6 Y 0 39 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; @@ -2241,28 +2241,28 @@ def @arg07 5 23 0 Y 32896 31 63 def @arg08 5 23 0 Y 32896 31 63 def @arg09 5 23 0 Y 32896 31 63 def @arg10 5 23 0 Y 32896 31 63 -def @arg11 246 83 0 Y 32896 30 63 -def @arg12 246 83 0 Y 32896 30 63 -def @arg13 250 16777215 0 Y 0 31 8 -def @arg14 250 16777215 0 Y 0 31 8 -def @arg15 250 16777215 19 Y 0 31 8 -def @arg16 250 16777215 0 Y 0 31 8 +def @arg11 246 83 0 Y 32896 38 63 +def @arg12 246 83 0 Y 32896 38 63 +def @arg13 250 16777215 0 Y 0 39 8 +def @arg14 250 16777215 0 Y 0 39 8 +def @arg15 250 16777215 19 Y 0 39 8 +def @arg16 250 16777215 0 Y 0 39 8 def @arg17 8 20 0 Y 32928 0 63 def @arg18 8 20 0 Y 32896 0 63 def @arg19 8 20 0 Y 32896 0 63 -def @arg20 250 16777215 0 Y 0 31 8 -def @arg21 250 16777215 0 Y 0 31 8 -def @arg22 250 16777215 0 Y 0 31 8 -def @arg23 250 16777215 0 Y 128 31 63 -def @arg24 250 16777215 0 Y 0 31 8 -def @arg25 250 16777215 0 Y 128 31 63 -def @arg26 250 16777215 0 Y 0 31 8 -def @arg27 250 16777215 0 Y 128 31 63 -def @arg28 250 16777215 0 Y 0 31 8 -def @arg29 250 16777215 0 Y 128 31 63 -def @arg30 250 16777215 0 Y 0 31 8 -def @arg31 250 16777215 0 Y 0 31 8 -def @arg32 250 16777215 0 Y 0 31 8 +def @arg20 250 16777215 0 Y 0 39 8 +def @arg21 250 16777215 0 Y 0 39 8 +def @arg22 250 16777215 0 Y 0 39 8 +def @arg23 250 16777215 0 Y 128 39 63 +def @arg24 250 16777215 0 Y 0 39 8 +def @arg25 250 16777215 0 Y 128 39 63 +def @arg26 250 16777215 0 Y 0 39 8 +def @arg27 250 16777215 0 Y 128 39 63 +def @arg28 250 16777215 0 Y 0 39 8 +def @arg29 250 16777215 0 Y 128 39 63 +def @arg30 250 16777215 0 Y 0 39 8 +def @arg31 250 16777215 0 Y 0 39 8 +def @arg32 250 16777215 0 Y 0 39 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select c1 into ? from t9 where c1= 1" ; diff --git a/mysql-test/r/ps_3innodb.result b/mysql-test/r/ps_3innodb.result index a22135d30c0..eac8e5d4efd 100644 --- a/mysql-test/r/ps_3innodb.result +++ b/mysql-test/r/ps_3innodb.result @@ -1154,15 +1154,15 @@ prepare stmt1 from ' explain select * from t9 ' ; execute stmt1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def id 8 3 1 Y 32928 0 63 -def select_type 253 19 6 N 1 31 8 -def table 253 64 2 Y 0 31 8 -def type 253 10 3 Y 0 31 8 -def possible_keys 253 4_OR_8_K 0 Y 0 31 8 -def key 253 64 0 Y 0 31 8 -def key_len 253 4_OR_8_K 0 Y 0 31 8 -def ref 253 2048 0 Y 0 31 8 +def select_type 253 19 6 N 1 39 8 +def table 253 64 2 Y 0 39 8 +def type 253 10 3 Y 0 39 8 +def possible_keys 253 4_OR_8_K 0 Y 0 39 8 +def key 253 64 0 Y 0 39 8 +def key_len 253 4_OR_8_K 0 Y 0 39 8 +def ref 253 2048 0 Y 0 39 8 def rows 8 10 1 Y 32928 0 63 -def Extra 253 255 0 N 1 31 8 +def Extra 253 255 0 N 1 39 8 id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t9 ALL NULL NULL NULL NULL 2 test_sequence @@ -1762,37 +1762,37 @@ t5 CREATE TABLE `t5` ( `const01` int(1) NOT NULL, `param01` bigint(20) DEFAULT NULL, `const02` decimal(2,1) NOT NULL, - `param02` decimal(65,30) DEFAULT NULL, + `param02` decimal(65,38) DEFAULT NULL, `const03` double NOT NULL, `param03` double DEFAULT NULL, `const04` varchar(3) NOT NULL, - `param04` longtext, + `param04` longtext DEFAULT NULL, `const05` varbinary(3) NOT NULL, - `param05` longblob, + `param05` longblob DEFAULT NULL, `const06` varchar(10) NOT NULL, - `param06` longtext, + `param06` longtext DEFAULT NULL, `const07` date DEFAULT NULL, - `param07` longtext, + `param07` longtext DEFAULT NULL, `const08` varchar(19) NOT NULL, - `param08` longtext, + `param08` longtext DEFAULT NULL, `const09` datetime DEFAULT NULL, - `param09` longtext, + `param09` longtext DEFAULT NULL, `const10` bigint(17) DEFAULT NULL, `param10` bigint(20) DEFAULT NULL, `const11` int(4) DEFAULT NULL, `param11` bigint(20) DEFAULT NULL, `const12` binary(0) DEFAULT NULL, `param12` bigint(20) DEFAULT NULL, - `param13` decimal(65,30) DEFAULT NULL, - `param14` longtext, - `param15` longblob + `param13` decimal(65,38) DEFAULT NULL, + `param14` longtext DEFAULT NULL, + `param15` longblob DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 select * from t5 ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def test t5 t5 const01 const01 3 1 1 N 36865 0 63 def test t5 t5 param01 param01 8 20 1 Y 32768 0 63 def test t5 t5 const02 const02 246 4 3 N 36865 1 63 -def test t5 t5 param02 param02 246 67 32 Y 32768 30 63 +def test t5 t5 param02 param02 246 67 40 Y 32768 38 63 def test t5 t5 const03 const03 5 17 1 N 36865 31 63 def test t5 t5 param03 param03 5 23 1 Y 32768 31 63 def test t5 t5 const04 const04 253 3 3 N 4097 0 8 @@ -1813,13 +1813,13 @@ def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 def test t5 t5 const12 const12 254 0 0 Y 128 0 63 def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 -def test t5 t5 param13 param13 246 67 0 Y 32768 30 63 +def test t5 t5 param13 param13 246 67 0 Y 32768 38 63 def test t5 t5 param14 param14 252 4294967295 0 Y 16 0 8 def test t5 t5 param15 param15 252 4294967295 0 Y 144 0 63 const01 8 param01 8 const02 8.0 -param02 8.000000000000000000000000000000 +param02 8.00000000000000000000000000000000000000 const03 8 param03 8 const04 abc @@ -1911,28 +1911,28 @@ def @arg07 5 23 1 Y 32896 31 63 def @arg08 5 23 1 Y 32896 31 63 def @arg09 5 23 1 Y 32896 31 63 def @arg10 5 23 1 Y 32896 31 63 -def @arg11 246 83 6 Y 32896 30 63 -def @arg12 246 83 6 Y 32896 30 63 -def @arg13 250 16777215 10 Y 0 31 8 -def @arg14 250 16777215 19 Y 0 31 8 -def @arg15 250 16777215 19 Y 0 31 8 -def @arg16 250 16777215 8 Y 0 31 8 +def @arg11 246 83 6 Y 32896 38 63 +def @arg12 246 83 6 Y 32896 38 63 +def @arg13 250 16777215 10 Y 0 39 8 +def @arg14 250 16777215 19 Y 0 39 8 +def @arg15 250 16777215 19 Y 0 39 8 +def @arg16 250 16777215 8 Y 0 39 8 def @arg17 8 20 4 Y 32928 0 63 def @arg18 8 20 1 Y 32896 0 63 def @arg19 8 20 1 Y 32896 0 63 -def @arg20 250 16777215 1 Y 0 31 8 -def @arg21 250 16777215 10 Y 0 31 8 -def @arg22 250 16777215 30 Y 0 31 8 -def @arg23 250 16777215 8 Y 128 31 63 -def @arg24 250 16777215 8 Y 0 31 8 -def @arg25 250 16777215 4 Y 128 31 63 -def @arg26 250 16777215 4 Y 0 31 8 -def @arg27 250 16777215 10 Y 128 31 63 -def @arg28 250 16777215 10 Y 0 31 8 -def @arg29 250 16777215 8 Y 128 31 63 -def @arg30 250 16777215 8 Y 0 31 8 -def @arg31 250 16777215 3 Y 0 31 8 -def @arg32 250 16777215 6 Y 0 31 8 +def @arg20 250 16777215 1 Y 0 39 8 +def @arg21 250 16777215 10 Y 0 39 8 +def @arg22 250 16777215 30 Y 0 39 8 +def @arg23 250 16777215 8 Y 128 39 63 +def @arg24 250 16777215 8 Y 0 39 8 +def @arg25 250 16777215 4 Y 128 39 63 +def @arg26 250 16777215 4 Y 0 39 8 +def @arg27 250 16777215 10 Y 128 39 63 +def @arg28 250 16777215 10 Y 0 39 8 +def @arg29 250 16777215 8 Y 128 39 63 +def @arg30 250 16777215 8 Y 0 39 8 +def @arg31 250 16777215 3 Y 0 39 8 +def @arg32 250 16777215 6 Y 0 39 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, @@ -1958,28 +1958,28 @@ def @arg07 5 23 0 Y 32896 31 63 def @arg08 5 23 0 Y 32896 31 63 def @arg09 5 23 0 Y 32896 31 63 def @arg10 5 23 0 Y 32896 31 63 -def @arg11 246 83 0 Y 32896 30 63 -def @arg12 246 83 0 Y 32896 30 63 -def @arg13 250 16777215 0 Y 0 31 8 -def @arg14 250 16777215 0 Y 0 31 8 -def @arg15 250 16777215 19 Y 0 31 8 -def @arg16 250 16777215 0 Y 0 31 8 +def @arg11 246 83 0 Y 32896 38 63 +def @arg12 246 83 0 Y 32896 38 63 +def @arg13 250 16777215 0 Y 0 39 8 +def @arg14 250 16777215 0 Y 0 39 8 +def @arg15 250 16777215 19 Y 0 39 8 +def @arg16 250 16777215 0 Y 0 39 8 def @arg17 8 20 0 Y 32928 0 63 def @arg18 8 20 0 Y 32896 0 63 def @arg19 8 20 0 Y 32896 0 63 -def @arg20 250 16777215 0 Y 0 31 8 -def @arg21 250 16777215 0 Y 0 31 8 -def @arg22 250 16777215 0 Y 0 31 8 -def @arg23 250 16777215 0 Y 128 31 63 -def @arg24 250 16777215 0 Y 0 31 8 -def @arg25 250 16777215 0 Y 128 31 63 -def @arg26 250 16777215 0 Y 0 31 8 -def @arg27 250 16777215 0 Y 128 31 63 -def @arg28 250 16777215 0 Y 0 31 8 -def @arg29 250 16777215 0 Y 128 31 63 -def @arg30 250 16777215 0 Y 0 31 8 -def @arg31 250 16777215 0 Y 0 31 8 -def @arg32 250 16777215 0 Y 0 31 8 +def @arg20 250 16777215 0 Y 0 39 8 +def @arg21 250 16777215 0 Y 0 39 8 +def @arg22 250 16777215 0 Y 0 39 8 +def @arg23 250 16777215 0 Y 128 39 63 +def @arg24 250 16777215 0 Y 0 39 8 +def @arg25 250 16777215 0 Y 128 39 63 +def @arg26 250 16777215 0 Y 0 39 8 +def @arg27 250 16777215 0 Y 128 39 63 +def @arg28 250 16777215 0 Y 0 39 8 +def @arg29 250 16777215 0 Y 128 39 63 +def @arg30 250 16777215 0 Y 0 39 8 +def @arg31 250 16777215 0 Y 0 39 8 +def @arg32 250 16777215 0 Y 0 39 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select @@ -2008,28 +2008,28 @@ def @arg07 5 23 1 Y 32896 31 63 def @arg08 5 23 1 Y 32896 31 63 def @arg09 5 23 1 Y 32896 31 63 def @arg10 5 23 1 Y 32896 31 63 -def @arg11 246 83 6 Y 32896 30 63 -def @arg12 246 83 6 Y 32896 30 63 -def @arg13 250 16777215 10 Y 0 31 8 -def @arg14 250 16777215 19 Y 0 31 8 -def @arg15 250 16777215 19 Y 0 31 8 -def @arg16 250 16777215 8 Y 0 31 8 +def @arg11 246 83 6 Y 32896 38 63 +def @arg12 246 83 6 Y 32896 38 63 +def @arg13 250 16777215 10 Y 0 39 8 +def @arg14 250 16777215 19 Y 0 39 8 +def @arg15 250 16777215 19 Y 0 39 8 +def @arg16 250 16777215 8 Y 0 39 8 def @arg17 8 20 4 Y 32928 0 63 def @arg18 8 20 1 Y 32896 0 63 def @arg19 8 20 1 Y 32896 0 63 -def @arg20 250 16777215 1 Y 0 31 8 -def @arg21 250 16777215 10 Y 0 31 8 -def @arg22 250 16777215 30 Y 0 31 8 -def @arg23 250 16777215 8 Y 128 31 63 -def @arg24 250 16777215 8 Y 0 31 8 -def @arg25 250 16777215 4 Y 128 31 63 -def @arg26 250 16777215 4 Y 0 31 8 -def @arg27 250 16777215 10 Y 128 31 63 -def @arg28 250 16777215 10 Y 0 31 8 -def @arg29 250 16777215 8 Y 128 31 63 -def @arg30 250 16777215 8 Y 0 31 8 -def @arg31 250 16777215 3 Y 0 31 8 -def @arg32 250 16777215 6 Y 0 31 8 +def @arg20 250 16777215 1 Y 0 39 8 +def @arg21 250 16777215 10 Y 0 39 8 +def @arg22 250 16777215 30 Y 0 39 8 +def @arg23 250 16777215 8 Y 128 39 63 +def @arg24 250 16777215 8 Y 0 39 8 +def @arg25 250 16777215 4 Y 128 39 63 +def @arg26 250 16777215 4 Y 0 39 8 +def @arg27 250 16777215 10 Y 128 39 63 +def @arg28 250 16777215 10 Y 0 39 8 +def @arg29 250 16777215 8 Y 128 39 63 +def @arg30 250 16777215 8 Y 0 39 8 +def @arg31 250 16777215 3 Y 0 39 8 +def @arg32 250 16777215 6 Y 0 39 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; @@ -2048,28 +2048,28 @@ def @arg07 5 23 0 Y 32896 31 63 def @arg08 5 23 0 Y 32896 31 63 def @arg09 5 23 0 Y 32896 31 63 def @arg10 5 23 0 Y 32896 31 63 -def @arg11 246 83 0 Y 32896 30 63 -def @arg12 246 83 0 Y 32896 30 63 -def @arg13 250 16777215 0 Y 0 31 8 -def @arg14 250 16777215 0 Y 0 31 8 -def @arg15 250 16777215 19 Y 0 31 8 -def @arg16 250 16777215 0 Y 0 31 8 +def @arg11 246 83 0 Y 32896 38 63 +def @arg12 246 83 0 Y 32896 38 63 +def @arg13 250 16777215 0 Y 0 39 8 +def @arg14 250 16777215 0 Y 0 39 8 +def @arg15 250 16777215 19 Y 0 39 8 +def @arg16 250 16777215 0 Y 0 39 8 def @arg17 8 20 0 Y 32928 0 63 def @arg18 8 20 0 Y 32896 0 63 def @arg19 8 20 0 Y 32896 0 63 -def @arg20 250 16777215 0 Y 0 31 8 -def @arg21 250 16777215 0 Y 0 31 8 -def @arg22 250 16777215 0 Y 0 31 8 -def @arg23 250 16777215 0 Y 128 31 63 -def @arg24 250 16777215 0 Y 0 31 8 -def @arg25 250 16777215 0 Y 128 31 63 -def @arg26 250 16777215 0 Y 0 31 8 -def @arg27 250 16777215 0 Y 128 31 63 -def @arg28 250 16777215 0 Y 0 31 8 -def @arg29 250 16777215 0 Y 128 31 63 -def @arg30 250 16777215 0 Y 0 31 8 -def @arg31 250 16777215 0 Y 0 31 8 -def @arg32 250 16777215 0 Y 0 31 8 +def @arg20 250 16777215 0 Y 0 39 8 +def @arg21 250 16777215 0 Y 0 39 8 +def @arg22 250 16777215 0 Y 0 39 8 +def @arg23 250 16777215 0 Y 128 39 63 +def @arg24 250 16777215 0 Y 0 39 8 +def @arg25 250 16777215 0 Y 128 39 63 +def @arg26 250 16777215 0 Y 0 39 8 +def @arg27 250 16777215 0 Y 128 39 63 +def @arg28 250 16777215 0 Y 0 39 8 +def @arg29 250 16777215 0 Y 128 39 63 +def @arg30 250 16777215 0 Y 0 39 8 +def @arg31 250 16777215 0 Y 0 39 8 +def @arg32 250 16777215 0 Y 0 39 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select ? := c1 from t9 where c1= 1" ; @@ -2096,28 +2096,28 @@ def @arg07 5 23 1 Y 32896 31 63 def @arg08 5 23 1 Y 32896 31 63 def @arg09 5 23 1 Y 32896 31 63 def @arg10 5 23 1 Y 32896 31 63 -def @arg11 246 83 6 Y 32896 30 63 -def @arg12 246 83 6 Y 32896 30 63 -def @arg13 250 16777215 10 Y 0 31 8 -def @arg14 250 16777215 19 Y 0 31 8 -def @arg15 250 16777215 19 Y 0 31 8 -def @arg16 250 16777215 8 Y 0 31 8 +def @arg11 246 83 6 Y 32896 38 63 +def @arg12 246 83 6 Y 32896 38 63 +def @arg13 250 16777215 10 Y 0 39 8 +def @arg14 250 16777215 19 Y 0 39 8 +def @arg15 250 16777215 19 Y 0 39 8 +def @arg16 250 16777215 8 Y 0 39 8 def @arg17 8 20 4 Y 32928 0 63 def @arg18 8 20 1 Y 32896 0 63 def @arg19 8 20 1 Y 32896 0 63 -def @arg20 250 16777215 1 Y 0 31 8 -def @arg21 250 16777215 10 Y 0 31 8 -def @arg22 250 16777215 30 Y 0 31 8 -def @arg23 250 16777215 8 Y 128 31 63 -def @arg24 250 16777215 8 Y 0 31 8 -def @arg25 250 16777215 4 Y 128 31 63 -def @arg26 250 16777215 4 Y 0 31 8 -def @arg27 250 16777215 10 Y 128 31 63 -def @arg28 250 16777215 10 Y 0 31 8 -def @arg29 250 16777215 8 Y 128 31 63 -def @arg30 250 16777215 8 Y 0 31 8 -def @arg31 250 16777215 3 Y 0 31 8 -def @arg32 250 16777215 6 Y 0 31 8 +def @arg20 250 16777215 1 Y 0 39 8 +def @arg21 250 16777215 10 Y 0 39 8 +def @arg22 250 16777215 30 Y 0 39 8 +def @arg23 250 16777215 8 Y 128 39 63 +def @arg24 250 16777215 8 Y 0 39 8 +def @arg25 250 16777215 4 Y 128 39 63 +def @arg26 250 16777215 4 Y 0 39 8 +def @arg27 250 16777215 10 Y 128 39 63 +def @arg28 250 16777215 10 Y 0 39 8 +def @arg29 250 16777215 8 Y 128 39 63 +def @arg30 250 16777215 8 Y 0 39 8 +def @arg31 250 16777215 3 Y 0 39 8 +def @arg32 250 16777215 6 Y 0 39 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, @@ -2140,28 +2140,28 @@ def @arg07 5 23 0 Y 32896 31 63 def @arg08 5 23 0 Y 32896 31 63 def @arg09 5 23 0 Y 32896 31 63 def @arg10 5 23 0 Y 32896 31 63 -def @arg11 246 83 0 Y 32896 30 63 -def @arg12 246 83 0 Y 32896 30 63 -def @arg13 250 16777215 0 Y 0 31 8 -def @arg14 250 16777215 0 Y 0 31 8 -def @arg15 250 16777215 19 Y 0 31 8 -def @arg16 250 16777215 0 Y 0 31 8 +def @arg11 246 83 0 Y 32896 38 63 +def @arg12 246 83 0 Y 32896 38 63 +def @arg13 250 16777215 0 Y 0 39 8 +def @arg14 250 16777215 0 Y 0 39 8 +def @arg15 250 16777215 19 Y 0 39 8 +def @arg16 250 16777215 0 Y 0 39 8 def @arg17 8 20 0 Y 32928 0 63 def @arg18 8 20 0 Y 32896 0 63 def @arg19 8 20 0 Y 32896 0 63 -def @arg20 250 16777215 0 Y 0 31 8 -def @arg21 250 16777215 0 Y 0 31 8 -def @arg22 250 16777215 0 Y 0 31 8 -def @arg23 250 16777215 0 Y 128 31 63 -def @arg24 250 16777215 0 Y 0 31 8 -def @arg25 250 16777215 0 Y 128 31 63 -def @arg26 250 16777215 0 Y 0 31 8 -def @arg27 250 16777215 0 Y 128 31 63 -def @arg28 250 16777215 0 Y 0 31 8 -def @arg29 250 16777215 0 Y 128 31 63 -def @arg30 250 16777215 0 Y 0 31 8 -def @arg31 250 16777215 0 Y 0 31 8 -def @arg32 250 16777215 0 Y 0 31 8 +def @arg20 250 16777215 0 Y 0 39 8 +def @arg21 250 16777215 0 Y 0 39 8 +def @arg22 250 16777215 0 Y 0 39 8 +def @arg23 250 16777215 0 Y 128 39 63 +def @arg24 250 16777215 0 Y 0 39 8 +def @arg25 250 16777215 0 Y 128 39 63 +def @arg26 250 16777215 0 Y 0 39 8 +def @arg27 250 16777215 0 Y 128 39 63 +def @arg28 250 16777215 0 Y 0 39 8 +def @arg29 250 16777215 0 Y 128 39 63 +def @arg30 250 16777215 0 Y 0 39 8 +def @arg31 250 16777215 0 Y 0 39 8 +def @arg32 250 16777215 0 Y 0 39 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, @@ -2186,28 +2186,28 @@ def @arg07 5 23 1 Y 32896 31 63 def @arg08 5 23 1 Y 32896 31 63 def @arg09 5 23 1 Y 32896 31 63 def @arg10 5 23 1 Y 32896 31 63 -def @arg11 246 83 6 Y 32896 30 63 -def @arg12 246 83 6 Y 32896 30 63 -def @arg13 250 16777215 10 Y 0 31 8 -def @arg14 250 16777215 19 Y 0 31 8 -def @arg15 250 16777215 19 Y 0 31 8 -def @arg16 250 16777215 8 Y 0 31 8 +def @arg11 246 83 6 Y 32896 38 63 +def @arg12 246 83 6 Y 32896 38 63 +def @arg13 250 16777215 10 Y 0 39 8 +def @arg14 250 16777215 19 Y 0 39 8 +def @arg15 250 16777215 19 Y 0 39 8 +def @arg16 250 16777215 8 Y 0 39 8 def @arg17 8 20 4 Y 32928 0 63 def @arg18 8 20 1 Y 32896 0 63 def @arg19 8 20 1 Y 32896 0 63 -def @arg20 250 16777215 1 Y 0 31 8 -def @arg21 250 16777215 10 Y 0 31 8 -def @arg22 250 16777215 30 Y 0 31 8 -def @arg23 250 16777215 8 Y 128 31 63 -def @arg24 250 16777215 8 Y 0 31 8 -def @arg25 250 16777215 4 Y 128 31 63 -def @arg26 250 16777215 4 Y 0 31 8 -def @arg27 250 16777215 10 Y 128 31 63 -def @arg28 250 16777215 10 Y 0 31 8 -def @arg29 250 16777215 8 Y 128 31 63 -def @arg30 250 16777215 8 Y 0 31 8 -def @arg31 250 16777215 3 Y 0 31 8 -def @arg32 250 16777215 6 Y 0 31 8 +def @arg20 250 16777215 1 Y 0 39 8 +def @arg21 250 16777215 10 Y 0 39 8 +def @arg22 250 16777215 30 Y 0 39 8 +def @arg23 250 16777215 8 Y 128 39 63 +def @arg24 250 16777215 8 Y 0 39 8 +def @arg25 250 16777215 4 Y 128 39 63 +def @arg26 250 16777215 4 Y 0 39 8 +def @arg27 250 16777215 10 Y 128 39 63 +def @arg28 250 16777215 10 Y 0 39 8 +def @arg29 250 16777215 8 Y 128 39 63 +def @arg30 250 16777215 8 Y 0 39 8 +def @arg31 250 16777215 3 Y 0 39 8 +def @arg32 250 16777215 6 Y 0 39 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; @@ -2224,28 +2224,28 @@ def @arg07 5 23 0 Y 32896 31 63 def @arg08 5 23 0 Y 32896 31 63 def @arg09 5 23 0 Y 32896 31 63 def @arg10 5 23 0 Y 32896 31 63 -def @arg11 246 83 0 Y 32896 30 63 -def @arg12 246 83 0 Y 32896 30 63 -def @arg13 250 16777215 0 Y 0 31 8 -def @arg14 250 16777215 0 Y 0 31 8 -def @arg15 250 16777215 19 Y 0 31 8 -def @arg16 250 16777215 0 Y 0 31 8 +def @arg11 246 83 0 Y 32896 38 63 +def @arg12 246 83 0 Y 32896 38 63 +def @arg13 250 16777215 0 Y 0 39 8 +def @arg14 250 16777215 0 Y 0 39 8 +def @arg15 250 16777215 19 Y 0 39 8 +def @arg16 250 16777215 0 Y 0 39 8 def @arg17 8 20 0 Y 32928 0 63 def @arg18 8 20 0 Y 32896 0 63 def @arg19 8 20 0 Y 32896 0 63 -def @arg20 250 16777215 0 Y 0 31 8 -def @arg21 250 16777215 0 Y 0 31 8 -def @arg22 250 16777215 0 Y 0 31 8 -def @arg23 250 16777215 0 Y 128 31 63 -def @arg24 250 16777215 0 Y 0 31 8 -def @arg25 250 16777215 0 Y 128 31 63 -def @arg26 250 16777215 0 Y 0 31 8 -def @arg27 250 16777215 0 Y 128 31 63 -def @arg28 250 16777215 0 Y 0 31 8 -def @arg29 250 16777215 0 Y 128 31 63 -def @arg30 250 16777215 0 Y 0 31 8 -def @arg31 250 16777215 0 Y 0 31 8 -def @arg32 250 16777215 0 Y 0 31 8 +def @arg20 250 16777215 0 Y 0 39 8 +def @arg21 250 16777215 0 Y 0 39 8 +def @arg22 250 16777215 0 Y 0 39 8 +def @arg23 250 16777215 0 Y 128 39 63 +def @arg24 250 16777215 0 Y 0 39 8 +def @arg25 250 16777215 0 Y 128 39 63 +def @arg26 250 16777215 0 Y 0 39 8 +def @arg27 250 16777215 0 Y 128 39 63 +def @arg28 250 16777215 0 Y 0 39 8 +def @arg29 250 16777215 0 Y 128 39 63 +def @arg30 250 16777215 0 Y 0 39 8 +def @arg31 250 16777215 0 Y 0 39 8 +def @arg32 250 16777215 0 Y 0 39 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select c1 into ? from t9 where c1= 1" ; diff --git a/mysql-test/r/ps_4heap.result b/mysql-test/r/ps_4heap.result index bbdb3ea7b23..d1ee954bbba 100644 --- a/mysql-test/r/ps_4heap.result +++ b/mysql-test/r/ps_4heap.result @@ -1155,15 +1155,15 @@ prepare stmt1 from ' explain select * from t9 ' ; execute stmt1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def id 8 3 1 Y 32928 0 63 -def select_type 253 19 6 N 1 31 8 -def table 253 64 2 Y 0 31 8 -def type 253 10 3 Y 0 31 8 -def possible_keys 253 4_OR_8_K 0 Y 0 31 8 -def key 253 64 0 Y 0 31 8 -def key_len 253 4_OR_8_K 0 Y 0 31 8 -def ref 253 2048 0 Y 0 31 8 +def select_type 253 19 6 N 1 39 8 +def table 253 64 2 Y 0 39 8 +def type 253 10 3 Y 0 39 8 +def possible_keys 253 4_OR_8_K 0 Y 0 39 8 +def key 253 64 0 Y 0 39 8 +def key_len 253 4_OR_8_K 0 Y 0 39 8 +def ref 253 2048 0 Y 0 39 8 def rows 8 10 1 Y 32928 0 63 -def Extra 253 255 0 N 1 31 8 +def Extra 253 255 0 N 1 39 8 id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t9 ALL NULL NULL NULL NULL 2 test_sequence @@ -1763,37 +1763,37 @@ t5 CREATE TABLE `t5` ( `const01` int(1) NOT NULL, `param01` bigint(20) DEFAULT NULL, `const02` decimal(2,1) NOT NULL, - `param02` decimal(65,30) DEFAULT NULL, + `param02` decimal(65,38) DEFAULT NULL, `const03` double NOT NULL, `param03` double DEFAULT NULL, `const04` varchar(3) NOT NULL, - `param04` longtext, + `param04` longtext DEFAULT NULL, `const05` varbinary(3) NOT NULL, - `param05` longblob, + `param05` longblob DEFAULT NULL, `const06` varchar(10) NOT NULL, - `param06` longtext, + `param06` longtext DEFAULT NULL, `const07` date DEFAULT NULL, - `param07` longtext, + `param07` longtext DEFAULT NULL, `const08` varchar(19) NOT NULL, - `param08` longtext, + `param08` longtext DEFAULT NULL, `const09` datetime DEFAULT NULL, - `param09` longtext, + `param09` longtext DEFAULT NULL, `const10` bigint(17) DEFAULT NULL, `param10` bigint(20) DEFAULT NULL, `const11` int(4) DEFAULT NULL, `param11` bigint(20) DEFAULT NULL, `const12` binary(0) DEFAULT NULL, `param12` bigint(20) DEFAULT NULL, - `param13` decimal(65,30) DEFAULT NULL, - `param14` longtext, - `param15` longblob + `param13` decimal(65,38) DEFAULT NULL, + `param14` longtext DEFAULT NULL, + `param15` longblob DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 select * from t5 ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def test t5 t5 const01 const01 3 1 1 N 36865 0 63 def test t5 t5 param01 param01 8 20 1 Y 32768 0 63 def test t5 t5 const02 const02 246 4 3 N 36865 1 63 -def test t5 t5 param02 param02 246 67 32 Y 32768 30 63 +def test t5 t5 param02 param02 246 67 40 Y 32768 38 63 def test t5 t5 const03 const03 5 17 1 N 36865 31 63 def test t5 t5 param03 param03 5 23 1 Y 32768 31 63 def test t5 t5 const04 const04 253 3 3 N 4097 0 8 @@ -1814,13 +1814,13 @@ def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 def test t5 t5 const12 const12 254 0 0 Y 128 0 63 def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 -def test t5 t5 param13 param13 246 67 0 Y 32768 30 63 +def test t5 t5 param13 param13 246 67 0 Y 32768 38 63 def test t5 t5 param14 param14 252 4294967295 0 Y 16 0 8 def test t5 t5 param15 param15 252 4294967295 0 Y 144 0 63 const01 8 param01 8 const02 8.0 -param02 8.000000000000000000000000000000 +param02 8.00000000000000000000000000000000000000 const03 8 param03 8 const04 abc @@ -1912,28 +1912,28 @@ def @arg07 5 23 1 Y 32896 31 63 def @arg08 5 23 1 Y 32896 31 63 def @arg09 5 23 1 Y 32896 31 63 def @arg10 5 23 1 Y 32896 31 63 -def @arg11 246 83 6 Y 32896 30 63 -def @arg12 246 83 6 Y 32896 30 63 -def @arg13 250 16777215 10 Y 0 31 8 -def @arg14 250 16777215 19 Y 0 31 8 -def @arg15 250 16777215 19 Y 0 31 8 -def @arg16 250 16777215 8 Y 0 31 8 +def @arg11 246 83 6 Y 32896 38 63 +def @arg12 246 83 6 Y 32896 38 63 +def @arg13 250 16777215 10 Y 0 39 8 +def @arg14 250 16777215 19 Y 0 39 8 +def @arg15 250 16777215 19 Y 0 39 8 +def @arg16 250 16777215 8 Y 0 39 8 def @arg17 8 20 4 Y 32928 0 63 def @arg18 8 20 1 Y 32896 0 63 def @arg19 8 20 1 Y 32896 0 63 -def @arg20 250 16777215 1 Y 0 31 8 -def @arg21 250 16777215 10 Y 0 31 8 -def @arg22 250 16777215 30 Y 0 31 8 -def @arg23 250 16777215 8 Y 0 31 8 -def @arg24 250 16777215 8 Y 0 31 8 -def @arg25 250 16777215 4 Y 0 31 8 -def @arg26 250 16777215 4 Y 0 31 8 -def @arg27 250 16777215 10 Y 0 31 8 -def @arg28 250 16777215 10 Y 0 31 8 -def @arg29 250 16777215 8 Y 0 31 8 -def @arg30 250 16777215 8 Y 0 31 8 -def @arg31 250 16777215 3 Y 0 31 8 -def @arg32 250 16777215 6 Y 0 31 8 +def @arg20 250 16777215 1 Y 0 39 8 +def @arg21 250 16777215 10 Y 0 39 8 +def @arg22 250 16777215 30 Y 0 39 8 +def @arg23 250 16777215 8 Y 0 39 8 +def @arg24 250 16777215 8 Y 0 39 8 +def @arg25 250 16777215 4 Y 0 39 8 +def @arg26 250 16777215 4 Y 0 39 8 +def @arg27 250 16777215 10 Y 0 39 8 +def @arg28 250 16777215 10 Y 0 39 8 +def @arg29 250 16777215 8 Y 0 39 8 +def @arg30 250 16777215 8 Y 0 39 8 +def @arg31 250 16777215 3 Y 0 39 8 +def @arg32 250 16777215 6 Y 0 39 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, @@ -1959,28 +1959,28 @@ def @arg07 5 23 0 Y 32896 31 63 def @arg08 5 23 0 Y 32896 31 63 def @arg09 5 23 0 Y 32896 31 63 def @arg10 5 23 0 Y 32896 31 63 -def @arg11 246 83 0 Y 32896 30 63 -def @arg12 246 83 0 Y 32896 30 63 -def @arg13 250 16777215 0 Y 0 31 8 -def @arg14 250 16777215 0 Y 0 31 8 -def @arg15 250 16777215 19 Y 0 31 8 -def @arg16 250 16777215 0 Y 0 31 8 +def @arg11 246 83 0 Y 32896 38 63 +def @arg12 246 83 0 Y 32896 38 63 +def @arg13 250 16777215 0 Y 0 39 8 +def @arg14 250 16777215 0 Y 0 39 8 +def @arg15 250 16777215 19 Y 0 39 8 +def @arg16 250 16777215 0 Y 0 39 8 def @arg17 8 20 0 Y 32928 0 63 def @arg18 8 20 0 Y 32896 0 63 def @arg19 8 20 0 Y 32896 0 63 -def @arg20 250 16777215 0 Y 0 31 8 -def @arg21 250 16777215 0 Y 0 31 8 -def @arg22 250 16777215 0 Y 0 31 8 -def @arg23 250 16777215 0 Y 0 31 8 -def @arg24 250 16777215 0 Y 0 31 8 -def @arg25 250 16777215 0 Y 0 31 8 -def @arg26 250 16777215 0 Y 0 31 8 -def @arg27 250 16777215 0 Y 0 31 8 -def @arg28 250 16777215 0 Y 0 31 8 -def @arg29 250 16777215 0 Y 0 31 8 -def @arg30 250 16777215 0 Y 0 31 8 -def @arg31 250 16777215 0 Y 0 31 8 -def @arg32 250 16777215 0 Y 0 31 8 +def @arg20 250 16777215 0 Y 0 39 8 +def @arg21 250 16777215 0 Y 0 39 8 +def @arg22 250 16777215 0 Y 0 39 8 +def @arg23 250 16777215 0 Y 0 39 8 +def @arg24 250 16777215 0 Y 0 39 8 +def @arg25 250 16777215 0 Y 0 39 8 +def @arg26 250 16777215 0 Y 0 39 8 +def @arg27 250 16777215 0 Y 0 39 8 +def @arg28 250 16777215 0 Y 0 39 8 +def @arg29 250 16777215 0 Y 0 39 8 +def @arg30 250 16777215 0 Y 0 39 8 +def @arg31 250 16777215 0 Y 0 39 8 +def @arg32 250 16777215 0 Y 0 39 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select @@ -2009,28 +2009,28 @@ def @arg07 5 23 1 Y 32896 31 63 def @arg08 5 23 1 Y 32896 31 63 def @arg09 5 23 1 Y 32896 31 63 def @arg10 5 23 1 Y 32896 31 63 -def @arg11 246 83 6 Y 32896 30 63 -def @arg12 246 83 6 Y 32896 30 63 -def @arg13 250 16777215 10 Y 0 31 8 -def @arg14 250 16777215 19 Y 0 31 8 -def @arg15 250 16777215 19 Y 0 31 8 -def @arg16 250 16777215 8 Y 0 31 8 +def @arg11 246 83 6 Y 32896 38 63 +def @arg12 246 83 6 Y 32896 38 63 +def @arg13 250 16777215 10 Y 0 39 8 +def @arg14 250 16777215 19 Y 0 39 8 +def @arg15 250 16777215 19 Y 0 39 8 +def @arg16 250 16777215 8 Y 0 39 8 def @arg17 8 20 4 Y 32928 0 63 def @arg18 8 20 1 Y 32896 0 63 def @arg19 8 20 1 Y 32896 0 63 -def @arg20 250 16777215 1 Y 0 31 8 -def @arg21 250 16777215 10 Y 0 31 8 -def @arg22 250 16777215 30 Y 0 31 8 -def @arg23 250 16777215 8 Y 0 31 8 -def @arg24 250 16777215 8 Y 0 31 8 -def @arg25 250 16777215 4 Y 0 31 8 -def @arg26 250 16777215 4 Y 0 31 8 -def @arg27 250 16777215 10 Y 0 31 8 -def @arg28 250 16777215 10 Y 0 31 8 -def @arg29 250 16777215 8 Y 0 31 8 -def @arg30 250 16777215 8 Y 0 31 8 -def @arg31 250 16777215 3 Y 0 31 8 -def @arg32 250 16777215 6 Y 0 31 8 +def @arg20 250 16777215 1 Y 0 39 8 +def @arg21 250 16777215 10 Y 0 39 8 +def @arg22 250 16777215 30 Y 0 39 8 +def @arg23 250 16777215 8 Y 0 39 8 +def @arg24 250 16777215 8 Y 0 39 8 +def @arg25 250 16777215 4 Y 0 39 8 +def @arg26 250 16777215 4 Y 0 39 8 +def @arg27 250 16777215 10 Y 0 39 8 +def @arg28 250 16777215 10 Y 0 39 8 +def @arg29 250 16777215 8 Y 0 39 8 +def @arg30 250 16777215 8 Y 0 39 8 +def @arg31 250 16777215 3 Y 0 39 8 +def @arg32 250 16777215 6 Y 0 39 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; @@ -2049,28 +2049,28 @@ def @arg07 5 23 0 Y 32896 31 63 def @arg08 5 23 0 Y 32896 31 63 def @arg09 5 23 0 Y 32896 31 63 def @arg10 5 23 0 Y 32896 31 63 -def @arg11 246 83 0 Y 32896 30 63 -def @arg12 246 83 0 Y 32896 30 63 -def @arg13 250 16777215 0 Y 0 31 8 -def @arg14 250 16777215 0 Y 0 31 8 -def @arg15 250 16777215 19 Y 0 31 8 -def @arg16 250 16777215 0 Y 0 31 8 +def @arg11 246 83 0 Y 32896 38 63 +def @arg12 246 83 0 Y 32896 38 63 +def @arg13 250 16777215 0 Y 0 39 8 +def @arg14 250 16777215 0 Y 0 39 8 +def @arg15 250 16777215 19 Y 0 39 8 +def @arg16 250 16777215 0 Y 0 39 8 def @arg17 8 20 0 Y 32928 0 63 def @arg18 8 20 0 Y 32896 0 63 def @arg19 8 20 0 Y 32896 0 63 -def @arg20 250 16777215 0 Y 0 31 8 -def @arg21 250 16777215 0 Y 0 31 8 -def @arg22 250 16777215 0 Y 0 31 8 -def @arg23 250 16777215 0 Y 0 31 8 -def @arg24 250 16777215 0 Y 0 31 8 -def @arg25 250 16777215 0 Y 0 31 8 -def @arg26 250 16777215 0 Y 0 31 8 -def @arg27 250 16777215 0 Y 0 31 8 -def @arg28 250 16777215 0 Y 0 31 8 -def @arg29 250 16777215 0 Y 0 31 8 -def @arg30 250 16777215 0 Y 0 31 8 -def @arg31 250 16777215 0 Y 0 31 8 -def @arg32 250 16777215 0 Y 0 31 8 +def @arg20 250 16777215 0 Y 0 39 8 +def @arg21 250 16777215 0 Y 0 39 8 +def @arg22 250 16777215 0 Y 0 39 8 +def @arg23 250 16777215 0 Y 0 39 8 +def @arg24 250 16777215 0 Y 0 39 8 +def @arg25 250 16777215 0 Y 0 39 8 +def @arg26 250 16777215 0 Y 0 39 8 +def @arg27 250 16777215 0 Y 0 39 8 +def @arg28 250 16777215 0 Y 0 39 8 +def @arg29 250 16777215 0 Y 0 39 8 +def @arg30 250 16777215 0 Y 0 39 8 +def @arg31 250 16777215 0 Y 0 39 8 +def @arg32 250 16777215 0 Y 0 39 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select ? := c1 from t9 where c1= 1" ; @@ -2097,28 +2097,28 @@ def @arg07 5 23 1 Y 32896 31 63 def @arg08 5 23 1 Y 32896 31 63 def @arg09 5 23 1 Y 32896 31 63 def @arg10 5 23 1 Y 32896 31 63 -def @arg11 246 83 6 Y 32896 30 63 -def @arg12 246 83 6 Y 32896 30 63 -def @arg13 250 16777215 10 Y 0 31 8 -def @arg14 250 16777215 19 Y 0 31 8 -def @arg15 250 16777215 19 Y 0 31 8 -def @arg16 250 16777215 8 Y 0 31 8 +def @arg11 246 83 6 Y 32896 38 63 +def @arg12 246 83 6 Y 32896 38 63 +def @arg13 250 16777215 10 Y 0 39 8 +def @arg14 250 16777215 19 Y 0 39 8 +def @arg15 250 16777215 19 Y 0 39 8 +def @arg16 250 16777215 8 Y 0 39 8 def @arg17 8 20 4 Y 32928 0 63 def @arg18 8 20 1 Y 32896 0 63 def @arg19 8 20 1 Y 32896 0 63 -def @arg20 250 16777215 1 Y 0 31 8 -def @arg21 250 16777215 10 Y 0 31 8 -def @arg22 250 16777215 30 Y 0 31 8 -def @arg23 250 16777215 8 Y 0 31 8 -def @arg24 250 16777215 8 Y 0 31 8 -def @arg25 250 16777215 4 Y 0 31 8 -def @arg26 250 16777215 4 Y 0 31 8 -def @arg27 250 16777215 10 Y 0 31 8 -def @arg28 250 16777215 10 Y 0 31 8 -def @arg29 250 16777215 8 Y 0 31 8 -def @arg30 250 16777215 8 Y 0 31 8 -def @arg31 250 16777215 3 Y 0 31 8 -def @arg32 250 16777215 6 Y 0 31 8 +def @arg20 250 16777215 1 Y 0 39 8 +def @arg21 250 16777215 10 Y 0 39 8 +def @arg22 250 16777215 30 Y 0 39 8 +def @arg23 250 16777215 8 Y 0 39 8 +def @arg24 250 16777215 8 Y 0 39 8 +def @arg25 250 16777215 4 Y 0 39 8 +def @arg26 250 16777215 4 Y 0 39 8 +def @arg27 250 16777215 10 Y 0 39 8 +def @arg28 250 16777215 10 Y 0 39 8 +def @arg29 250 16777215 8 Y 0 39 8 +def @arg30 250 16777215 8 Y 0 39 8 +def @arg31 250 16777215 3 Y 0 39 8 +def @arg32 250 16777215 6 Y 0 39 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, @@ -2141,28 +2141,28 @@ def @arg07 5 23 0 Y 32896 31 63 def @arg08 5 23 0 Y 32896 31 63 def @arg09 5 23 0 Y 32896 31 63 def @arg10 5 23 0 Y 32896 31 63 -def @arg11 246 83 0 Y 32896 30 63 -def @arg12 246 83 0 Y 32896 30 63 -def @arg13 250 16777215 0 Y 0 31 8 -def @arg14 250 16777215 0 Y 0 31 8 -def @arg15 250 16777215 19 Y 0 31 8 -def @arg16 250 16777215 0 Y 0 31 8 +def @arg11 246 83 0 Y 32896 38 63 +def @arg12 246 83 0 Y 32896 38 63 +def @arg13 250 16777215 0 Y 0 39 8 +def @arg14 250 16777215 0 Y 0 39 8 +def @arg15 250 16777215 19 Y 0 39 8 +def @arg16 250 16777215 0 Y 0 39 8 def @arg17 8 20 0 Y 32928 0 63 def @arg18 8 20 0 Y 32896 0 63 def @arg19 8 20 0 Y 32896 0 63 -def @arg20 250 16777215 0 Y 0 31 8 -def @arg21 250 16777215 0 Y 0 31 8 -def @arg22 250 16777215 0 Y 0 31 8 -def @arg23 250 16777215 0 Y 0 31 8 -def @arg24 250 16777215 0 Y 0 31 8 -def @arg25 250 16777215 0 Y 0 31 8 -def @arg26 250 16777215 0 Y 0 31 8 -def @arg27 250 16777215 0 Y 0 31 8 -def @arg28 250 16777215 0 Y 0 31 8 -def @arg29 250 16777215 0 Y 0 31 8 -def @arg30 250 16777215 0 Y 0 31 8 -def @arg31 250 16777215 0 Y 0 31 8 -def @arg32 250 16777215 0 Y 0 31 8 +def @arg20 250 16777215 0 Y 0 39 8 +def @arg21 250 16777215 0 Y 0 39 8 +def @arg22 250 16777215 0 Y 0 39 8 +def @arg23 250 16777215 0 Y 0 39 8 +def @arg24 250 16777215 0 Y 0 39 8 +def @arg25 250 16777215 0 Y 0 39 8 +def @arg26 250 16777215 0 Y 0 39 8 +def @arg27 250 16777215 0 Y 0 39 8 +def @arg28 250 16777215 0 Y 0 39 8 +def @arg29 250 16777215 0 Y 0 39 8 +def @arg30 250 16777215 0 Y 0 39 8 +def @arg31 250 16777215 0 Y 0 39 8 +def @arg32 250 16777215 0 Y 0 39 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, @@ -2187,28 +2187,28 @@ def @arg07 5 23 1 Y 32896 31 63 def @arg08 5 23 1 Y 32896 31 63 def @arg09 5 23 1 Y 32896 31 63 def @arg10 5 23 1 Y 32896 31 63 -def @arg11 246 83 6 Y 32896 30 63 -def @arg12 246 83 6 Y 32896 30 63 -def @arg13 250 16777215 10 Y 0 31 8 -def @arg14 250 16777215 19 Y 0 31 8 -def @arg15 250 16777215 19 Y 0 31 8 -def @arg16 250 16777215 8 Y 0 31 8 +def @arg11 246 83 6 Y 32896 38 63 +def @arg12 246 83 6 Y 32896 38 63 +def @arg13 250 16777215 10 Y 0 39 8 +def @arg14 250 16777215 19 Y 0 39 8 +def @arg15 250 16777215 19 Y 0 39 8 +def @arg16 250 16777215 8 Y 0 39 8 def @arg17 8 20 4 Y 32928 0 63 def @arg18 8 20 1 Y 32896 0 63 def @arg19 8 20 1 Y 32896 0 63 -def @arg20 250 16777215 1 Y 0 31 8 -def @arg21 250 16777215 10 Y 0 31 8 -def @arg22 250 16777215 30 Y 0 31 8 -def @arg23 250 16777215 8 Y 0 31 8 -def @arg24 250 16777215 8 Y 0 31 8 -def @arg25 250 16777215 4 Y 0 31 8 -def @arg26 250 16777215 4 Y 0 31 8 -def @arg27 250 16777215 10 Y 0 31 8 -def @arg28 250 16777215 10 Y 0 31 8 -def @arg29 250 16777215 8 Y 0 31 8 -def @arg30 250 16777215 8 Y 0 31 8 -def @arg31 250 16777215 3 Y 0 31 8 -def @arg32 250 16777215 6 Y 0 31 8 +def @arg20 250 16777215 1 Y 0 39 8 +def @arg21 250 16777215 10 Y 0 39 8 +def @arg22 250 16777215 30 Y 0 39 8 +def @arg23 250 16777215 8 Y 0 39 8 +def @arg24 250 16777215 8 Y 0 39 8 +def @arg25 250 16777215 4 Y 0 39 8 +def @arg26 250 16777215 4 Y 0 39 8 +def @arg27 250 16777215 10 Y 0 39 8 +def @arg28 250 16777215 10 Y 0 39 8 +def @arg29 250 16777215 8 Y 0 39 8 +def @arg30 250 16777215 8 Y 0 39 8 +def @arg31 250 16777215 3 Y 0 39 8 +def @arg32 250 16777215 6 Y 0 39 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; @@ -2225,28 +2225,28 @@ def @arg07 5 23 0 Y 32896 31 63 def @arg08 5 23 0 Y 32896 31 63 def @arg09 5 23 0 Y 32896 31 63 def @arg10 5 23 0 Y 32896 31 63 -def @arg11 246 83 0 Y 32896 30 63 -def @arg12 246 83 0 Y 32896 30 63 -def @arg13 250 16777215 0 Y 0 31 8 -def @arg14 250 16777215 0 Y 0 31 8 -def @arg15 250 16777215 19 Y 0 31 8 -def @arg16 250 16777215 0 Y 0 31 8 +def @arg11 246 83 0 Y 32896 38 63 +def @arg12 246 83 0 Y 32896 38 63 +def @arg13 250 16777215 0 Y 0 39 8 +def @arg14 250 16777215 0 Y 0 39 8 +def @arg15 250 16777215 19 Y 0 39 8 +def @arg16 250 16777215 0 Y 0 39 8 def @arg17 8 20 0 Y 32928 0 63 def @arg18 8 20 0 Y 32896 0 63 def @arg19 8 20 0 Y 32896 0 63 -def @arg20 250 16777215 0 Y 0 31 8 -def @arg21 250 16777215 0 Y 0 31 8 -def @arg22 250 16777215 0 Y 0 31 8 -def @arg23 250 16777215 0 Y 0 31 8 -def @arg24 250 16777215 0 Y 0 31 8 -def @arg25 250 16777215 0 Y 0 31 8 -def @arg26 250 16777215 0 Y 0 31 8 -def @arg27 250 16777215 0 Y 0 31 8 -def @arg28 250 16777215 0 Y 0 31 8 -def @arg29 250 16777215 0 Y 0 31 8 -def @arg30 250 16777215 0 Y 0 31 8 -def @arg31 250 16777215 0 Y 0 31 8 -def @arg32 250 16777215 0 Y 0 31 8 +def @arg20 250 16777215 0 Y 0 39 8 +def @arg21 250 16777215 0 Y 0 39 8 +def @arg22 250 16777215 0 Y 0 39 8 +def @arg23 250 16777215 0 Y 0 39 8 +def @arg24 250 16777215 0 Y 0 39 8 +def @arg25 250 16777215 0 Y 0 39 8 +def @arg26 250 16777215 0 Y 0 39 8 +def @arg27 250 16777215 0 Y 0 39 8 +def @arg28 250 16777215 0 Y 0 39 8 +def @arg29 250 16777215 0 Y 0 39 8 +def @arg30 250 16777215 0 Y 0 39 8 +def @arg31 250 16777215 0 Y 0 39 8 +def @arg32 250 16777215 0 Y 0 39 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select c1 into ? from t9 where c1= 1" ; diff --git a/mysql-test/r/ps_5merge.result b/mysql-test/r/ps_5merge.result index 0262c52d948..a0baa842e4a 100644 --- a/mysql-test/r/ps_5merge.result +++ b/mysql-test/r/ps_5merge.result @@ -1198,15 +1198,15 @@ prepare stmt1 from ' explain select * from t9 ' ; execute stmt1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def id 8 3 1 Y 32928 0 63 -def select_type 253 19 6 N 1 31 8 -def table 253 64 2 Y 0 31 8 -def type 253 10 3 Y 0 31 8 -def possible_keys 253 4_OR_8_K 0 Y 0 31 8 -def key 253 64 0 Y 0 31 8 -def key_len 253 4_OR_8_K 0 Y 0 31 8 -def ref 253 2048 0 Y 0 31 8 +def select_type 253 19 6 N 1 39 8 +def table 253 64 2 Y 0 39 8 +def type 253 10 3 Y 0 39 8 +def possible_keys 253 4_OR_8_K 0 Y 0 39 8 +def key 253 64 0 Y 0 39 8 +def key_len 253 4_OR_8_K 0 Y 0 39 8 +def ref 253 2048 0 Y 0 39 8 def rows 8 10 1 Y 32928 0 63 -def Extra 253 255 0 N 1 31 8 +def Extra 253 255 0 N 1 39 8 id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t9 ALL NULL NULL NULL NULL 2 test_sequence @@ -1700,37 +1700,37 @@ t5 CREATE TABLE `t5` ( `const01` int(1) NOT NULL, `param01` bigint(20) DEFAULT NULL, `const02` decimal(2,1) NOT NULL, - `param02` decimal(65,30) DEFAULT NULL, + `param02` decimal(65,38) DEFAULT NULL, `const03` double NOT NULL, `param03` double DEFAULT NULL, `const04` varchar(3) NOT NULL, - `param04` longtext, + `param04` longtext DEFAULT NULL, `const05` varbinary(3) NOT NULL, - `param05` longblob, + `param05` longblob DEFAULT NULL, `const06` varchar(10) NOT NULL, - `param06` longtext, + `param06` longtext DEFAULT NULL, `const07` date DEFAULT NULL, - `param07` longtext, + `param07` longtext DEFAULT NULL, `const08` varchar(19) NOT NULL, - `param08` longtext, + `param08` longtext DEFAULT NULL, `const09` datetime DEFAULT NULL, - `param09` longtext, + `param09` longtext DEFAULT NULL, `const10` bigint(17) DEFAULT NULL, `param10` bigint(20) DEFAULT NULL, `const11` int(4) DEFAULT NULL, `param11` bigint(20) DEFAULT NULL, `const12` binary(0) DEFAULT NULL, `param12` bigint(20) DEFAULT NULL, - `param13` decimal(65,30) DEFAULT NULL, - `param14` longtext, - `param15` longblob + `param13` decimal(65,38) DEFAULT NULL, + `param14` longtext DEFAULT NULL, + `param15` longblob DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 select * from t5 ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def test t5 t5 const01 const01 3 1 1 N 36865 0 63 def test t5 t5 param01 param01 8 20 1 Y 32768 0 63 def test t5 t5 const02 const02 246 4 3 N 36865 1 63 -def test t5 t5 param02 param02 246 67 32 Y 32768 30 63 +def test t5 t5 param02 param02 246 67 40 Y 32768 38 63 def test t5 t5 const03 const03 5 17 1 N 36865 31 63 def test t5 t5 param03 param03 5 23 1 Y 32768 31 63 def test t5 t5 const04 const04 253 3 3 N 4097 0 8 @@ -1751,13 +1751,13 @@ def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 def test t5 t5 const12 const12 254 0 0 Y 128 0 63 def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 -def test t5 t5 param13 param13 246 67 0 Y 32768 30 63 +def test t5 t5 param13 param13 246 67 0 Y 32768 38 63 def test t5 t5 param14 param14 252 4294967295 0 Y 16 0 8 def test t5 t5 param15 param15 252 4294967295 0 Y 144 0 63 const01 8 param01 8 const02 8.0 -param02 8.000000000000000000000000000000 +param02 8.00000000000000000000000000000000000000 const03 8 param03 8 const04 abc @@ -1849,28 +1849,28 @@ def @arg07 5 23 1 Y 32896 31 63 def @arg08 5 23 1 Y 32896 31 63 def @arg09 5 23 1 Y 32896 31 63 def @arg10 5 23 1 Y 32896 31 63 -def @arg11 246 83 6 Y 32896 30 63 -def @arg12 246 83 6 Y 32896 30 63 -def @arg13 250 16777215 10 Y 0 31 8 -def @arg14 250 16777215 19 Y 0 31 8 -def @arg15 250 16777215 19 Y 0 31 8 -def @arg16 250 16777215 8 Y 0 31 8 +def @arg11 246 83 6 Y 32896 38 63 +def @arg12 246 83 6 Y 32896 38 63 +def @arg13 250 16777215 10 Y 0 39 8 +def @arg14 250 16777215 19 Y 0 39 8 +def @arg15 250 16777215 19 Y 0 39 8 +def @arg16 250 16777215 8 Y 0 39 8 def @arg17 8 20 4 Y 32928 0 63 def @arg18 8 20 1 Y 32896 0 63 def @arg19 8 20 1 Y 32896 0 63 -def @arg20 250 16777215 1 Y 0 31 8 -def @arg21 250 16777215 10 Y 0 31 8 -def @arg22 250 16777215 30 Y 0 31 8 -def @arg23 250 16777215 8 Y 128 31 63 -def @arg24 250 16777215 8 Y 0 31 8 -def @arg25 250 16777215 4 Y 128 31 63 -def @arg26 250 16777215 4 Y 0 31 8 -def @arg27 250 16777215 10 Y 128 31 63 -def @arg28 250 16777215 10 Y 0 31 8 -def @arg29 250 16777215 8 Y 128 31 63 -def @arg30 250 16777215 8 Y 0 31 8 -def @arg31 250 16777215 3 Y 0 31 8 -def @arg32 250 16777215 6 Y 0 31 8 +def @arg20 250 16777215 1 Y 0 39 8 +def @arg21 250 16777215 10 Y 0 39 8 +def @arg22 250 16777215 30 Y 0 39 8 +def @arg23 250 16777215 8 Y 128 39 63 +def @arg24 250 16777215 8 Y 0 39 8 +def @arg25 250 16777215 4 Y 128 39 63 +def @arg26 250 16777215 4 Y 0 39 8 +def @arg27 250 16777215 10 Y 128 39 63 +def @arg28 250 16777215 10 Y 0 39 8 +def @arg29 250 16777215 8 Y 128 39 63 +def @arg30 250 16777215 8 Y 0 39 8 +def @arg31 250 16777215 3 Y 0 39 8 +def @arg32 250 16777215 6 Y 0 39 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, @@ -1896,28 +1896,28 @@ def @arg07 5 23 0 Y 32896 31 63 def @arg08 5 23 0 Y 32896 31 63 def @arg09 5 23 0 Y 32896 31 63 def @arg10 5 23 0 Y 32896 31 63 -def @arg11 246 83 0 Y 32896 30 63 -def @arg12 246 83 0 Y 32896 30 63 -def @arg13 250 16777215 0 Y 0 31 8 -def @arg14 250 16777215 0 Y 0 31 8 -def @arg15 250 16777215 19 Y 0 31 8 -def @arg16 250 16777215 0 Y 0 31 8 +def @arg11 246 83 0 Y 32896 38 63 +def @arg12 246 83 0 Y 32896 38 63 +def @arg13 250 16777215 0 Y 0 39 8 +def @arg14 250 16777215 0 Y 0 39 8 +def @arg15 250 16777215 19 Y 0 39 8 +def @arg16 250 16777215 0 Y 0 39 8 def @arg17 8 20 0 Y 32928 0 63 def @arg18 8 20 0 Y 32896 0 63 def @arg19 8 20 0 Y 32896 0 63 -def @arg20 250 16777215 0 Y 0 31 8 -def @arg21 250 16777215 0 Y 0 31 8 -def @arg22 250 16777215 0 Y 0 31 8 -def @arg23 250 16777215 0 Y 128 31 63 -def @arg24 250 16777215 0 Y 0 31 8 -def @arg25 250 16777215 0 Y 128 31 63 -def @arg26 250 16777215 0 Y 0 31 8 -def @arg27 250 16777215 0 Y 128 31 63 -def @arg28 250 16777215 0 Y 0 31 8 -def @arg29 250 16777215 0 Y 128 31 63 -def @arg30 250 16777215 0 Y 0 31 8 -def @arg31 250 16777215 0 Y 0 31 8 -def @arg32 250 16777215 0 Y 0 31 8 +def @arg20 250 16777215 0 Y 0 39 8 +def @arg21 250 16777215 0 Y 0 39 8 +def @arg22 250 16777215 0 Y 0 39 8 +def @arg23 250 16777215 0 Y 128 39 63 +def @arg24 250 16777215 0 Y 0 39 8 +def @arg25 250 16777215 0 Y 128 39 63 +def @arg26 250 16777215 0 Y 0 39 8 +def @arg27 250 16777215 0 Y 128 39 63 +def @arg28 250 16777215 0 Y 0 39 8 +def @arg29 250 16777215 0 Y 128 39 63 +def @arg30 250 16777215 0 Y 0 39 8 +def @arg31 250 16777215 0 Y 0 39 8 +def @arg32 250 16777215 0 Y 0 39 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select @@ -1946,28 +1946,28 @@ def @arg07 5 23 1 Y 32896 31 63 def @arg08 5 23 1 Y 32896 31 63 def @arg09 5 23 1 Y 32896 31 63 def @arg10 5 23 1 Y 32896 31 63 -def @arg11 246 83 6 Y 32896 30 63 -def @arg12 246 83 6 Y 32896 30 63 -def @arg13 250 16777215 10 Y 0 31 8 -def @arg14 250 16777215 19 Y 0 31 8 -def @arg15 250 16777215 19 Y 0 31 8 -def @arg16 250 16777215 8 Y 0 31 8 +def @arg11 246 83 6 Y 32896 38 63 +def @arg12 246 83 6 Y 32896 38 63 +def @arg13 250 16777215 10 Y 0 39 8 +def @arg14 250 16777215 19 Y 0 39 8 +def @arg15 250 16777215 19 Y 0 39 8 +def @arg16 250 16777215 8 Y 0 39 8 def @arg17 8 20 4 Y 32928 0 63 def @arg18 8 20 1 Y 32896 0 63 def @arg19 8 20 1 Y 32896 0 63 -def @arg20 250 16777215 1 Y 0 31 8 -def @arg21 250 16777215 10 Y 0 31 8 -def @arg22 250 16777215 30 Y 0 31 8 -def @arg23 250 16777215 8 Y 128 31 63 -def @arg24 250 16777215 8 Y 0 31 8 -def @arg25 250 16777215 4 Y 128 31 63 -def @arg26 250 16777215 4 Y 0 31 8 -def @arg27 250 16777215 10 Y 128 31 63 -def @arg28 250 16777215 10 Y 0 31 8 -def @arg29 250 16777215 8 Y 128 31 63 -def @arg30 250 16777215 8 Y 0 31 8 -def @arg31 250 16777215 3 Y 0 31 8 -def @arg32 250 16777215 6 Y 0 31 8 +def @arg20 250 16777215 1 Y 0 39 8 +def @arg21 250 16777215 10 Y 0 39 8 +def @arg22 250 16777215 30 Y 0 39 8 +def @arg23 250 16777215 8 Y 128 39 63 +def @arg24 250 16777215 8 Y 0 39 8 +def @arg25 250 16777215 4 Y 128 39 63 +def @arg26 250 16777215 4 Y 0 39 8 +def @arg27 250 16777215 10 Y 128 39 63 +def @arg28 250 16777215 10 Y 0 39 8 +def @arg29 250 16777215 8 Y 128 39 63 +def @arg30 250 16777215 8 Y 0 39 8 +def @arg31 250 16777215 3 Y 0 39 8 +def @arg32 250 16777215 6 Y 0 39 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; @@ -1986,28 +1986,28 @@ def @arg07 5 23 0 Y 32896 31 63 def @arg08 5 23 0 Y 32896 31 63 def @arg09 5 23 0 Y 32896 31 63 def @arg10 5 23 0 Y 32896 31 63 -def @arg11 246 83 0 Y 32896 30 63 -def @arg12 246 83 0 Y 32896 30 63 -def @arg13 250 16777215 0 Y 0 31 8 -def @arg14 250 16777215 0 Y 0 31 8 -def @arg15 250 16777215 19 Y 0 31 8 -def @arg16 250 16777215 0 Y 0 31 8 +def @arg11 246 83 0 Y 32896 38 63 +def @arg12 246 83 0 Y 32896 38 63 +def @arg13 250 16777215 0 Y 0 39 8 +def @arg14 250 16777215 0 Y 0 39 8 +def @arg15 250 16777215 19 Y 0 39 8 +def @arg16 250 16777215 0 Y 0 39 8 def @arg17 8 20 0 Y 32928 0 63 def @arg18 8 20 0 Y 32896 0 63 def @arg19 8 20 0 Y 32896 0 63 -def @arg20 250 16777215 0 Y 0 31 8 -def @arg21 250 16777215 0 Y 0 31 8 -def @arg22 250 16777215 0 Y 0 31 8 -def @arg23 250 16777215 0 Y 128 31 63 -def @arg24 250 16777215 0 Y 0 31 8 -def @arg25 250 16777215 0 Y 128 31 63 -def @arg26 250 16777215 0 Y 0 31 8 -def @arg27 250 16777215 0 Y 128 31 63 -def @arg28 250 16777215 0 Y 0 31 8 -def @arg29 250 16777215 0 Y 128 31 63 -def @arg30 250 16777215 0 Y 0 31 8 -def @arg31 250 16777215 0 Y 0 31 8 -def @arg32 250 16777215 0 Y 0 31 8 +def @arg20 250 16777215 0 Y 0 39 8 +def @arg21 250 16777215 0 Y 0 39 8 +def @arg22 250 16777215 0 Y 0 39 8 +def @arg23 250 16777215 0 Y 128 39 63 +def @arg24 250 16777215 0 Y 0 39 8 +def @arg25 250 16777215 0 Y 128 39 63 +def @arg26 250 16777215 0 Y 0 39 8 +def @arg27 250 16777215 0 Y 128 39 63 +def @arg28 250 16777215 0 Y 0 39 8 +def @arg29 250 16777215 0 Y 128 39 63 +def @arg30 250 16777215 0 Y 0 39 8 +def @arg31 250 16777215 0 Y 0 39 8 +def @arg32 250 16777215 0 Y 0 39 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select ? := c1 from t9 where c1= 1" ; @@ -2034,28 +2034,28 @@ def @arg07 5 23 1 Y 32896 31 63 def @arg08 5 23 1 Y 32896 31 63 def @arg09 5 23 1 Y 32896 31 63 def @arg10 5 23 1 Y 32896 31 63 -def @arg11 246 83 6 Y 32896 30 63 -def @arg12 246 83 6 Y 32896 30 63 -def @arg13 250 16777215 10 Y 0 31 8 -def @arg14 250 16777215 19 Y 0 31 8 -def @arg15 250 16777215 19 Y 0 31 8 -def @arg16 250 16777215 8 Y 0 31 8 +def @arg11 246 83 6 Y 32896 38 63 +def @arg12 246 83 6 Y 32896 38 63 +def @arg13 250 16777215 10 Y 0 39 8 +def @arg14 250 16777215 19 Y 0 39 8 +def @arg15 250 16777215 19 Y 0 39 8 +def @arg16 250 16777215 8 Y 0 39 8 def @arg17 8 20 4 Y 32928 0 63 def @arg18 8 20 1 Y 32896 0 63 def @arg19 8 20 1 Y 32896 0 63 -def @arg20 250 16777215 1 Y 0 31 8 -def @arg21 250 16777215 10 Y 0 31 8 -def @arg22 250 16777215 30 Y 0 31 8 -def @arg23 250 16777215 8 Y 128 31 63 -def @arg24 250 16777215 8 Y 0 31 8 -def @arg25 250 16777215 4 Y 128 31 63 -def @arg26 250 16777215 4 Y 0 31 8 -def @arg27 250 16777215 10 Y 128 31 63 -def @arg28 250 16777215 10 Y 0 31 8 -def @arg29 250 16777215 8 Y 128 31 63 -def @arg30 250 16777215 8 Y 0 31 8 -def @arg31 250 16777215 3 Y 0 31 8 -def @arg32 250 16777215 6 Y 0 31 8 +def @arg20 250 16777215 1 Y 0 39 8 +def @arg21 250 16777215 10 Y 0 39 8 +def @arg22 250 16777215 30 Y 0 39 8 +def @arg23 250 16777215 8 Y 128 39 63 +def @arg24 250 16777215 8 Y 0 39 8 +def @arg25 250 16777215 4 Y 128 39 63 +def @arg26 250 16777215 4 Y 0 39 8 +def @arg27 250 16777215 10 Y 128 39 63 +def @arg28 250 16777215 10 Y 0 39 8 +def @arg29 250 16777215 8 Y 128 39 63 +def @arg30 250 16777215 8 Y 0 39 8 +def @arg31 250 16777215 3 Y 0 39 8 +def @arg32 250 16777215 6 Y 0 39 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, @@ -2078,28 +2078,28 @@ def @arg07 5 23 0 Y 32896 31 63 def @arg08 5 23 0 Y 32896 31 63 def @arg09 5 23 0 Y 32896 31 63 def @arg10 5 23 0 Y 32896 31 63 -def @arg11 246 83 0 Y 32896 30 63 -def @arg12 246 83 0 Y 32896 30 63 -def @arg13 250 16777215 0 Y 0 31 8 -def @arg14 250 16777215 0 Y 0 31 8 -def @arg15 250 16777215 19 Y 0 31 8 -def @arg16 250 16777215 0 Y 0 31 8 +def @arg11 246 83 0 Y 32896 38 63 +def @arg12 246 83 0 Y 32896 38 63 +def @arg13 250 16777215 0 Y 0 39 8 +def @arg14 250 16777215 0 Y 0 39 8 +def @arg15 250 16777215 19 Y 0 39 8 +def @arg16 250 16777215 0 Y 0 39 8 def @arg17 8 20 0 Y 32928 0 63 def @arg18 8 20 0 Y 32896 0 63 def @arg19 8 20 0 Y 32896 0 63 -def @arg20 250 16777215 0 Y 0 31 8 -def @arg21 250 16777215 0 Y 0 31 8 -def @arg22 250 16777215 0 Y 0 31 8 -def @arg23 250 16777215 0 Y 128 31 63 -def @arg24 250 16777215 0 Y 0 31 8 -def @arg25 250 16777215 0 Y 128 31 63 -def @arg26 250 16777215 0 Y 0 31 8 -def @arg27 250 16777215 0 Y 128 31 63 -def @arg28 250 16777215 0 Y 0 31 8 -def @arg29 250 16777215 0 Y 128 31 63 -def @arg30 250 16777215 0 Y 0 31 8 -def @arg31 250 16777215 0 Y 0 31 8 -def @arg32 250 16777215 0 Y 0 31 8 +def @arg20 250 16777215 0 Y 0 39 8 +def @arg21 250 16777215 0 Y 0 39 8 +def @arg22 250 16777215 0 Y 0 39 8 +def @arg23 250 16777215 0 Y 128 39 63 +def @arg24 250 16777215 0 Y 0 39 8 +def @arg25 250 16777215 0 Y 128 39 63 +def @arg26 250 16777215 0 Y 0 39 8 +def @arg27 250 16777215 0 Y 128 39 63 +def @arg28 250 16777215 0 Y 0 39 8 +def @arg29 250 16777215 0 Y 128 39 63 +def @arg30 250 16777215 0 Y 0 39 8 +def @arg31 250 16777215 0 Y 0 39 8 +def @arg32 250 16777215 0 Y 0 39 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, @@ -2124,28 +2124,28 @@ def @arg07 5 23 1 Y 32896 31 63 def @arg08 5 23 1 Y 32896 31 63 def @arg09 5 23 1 Y 32896 31 63 def @arg10 5 23 1 Y 32896 31 63 -def @arg11 246 83 6 Y 32896 30 63 -def @arg12 246 83 6 Y 32896 30 63 -def @arg13 250 16777215 10 Y 0 31 8 -def @arg14 250 16777215 19 Y 0 31 8 -def @arg15 250 16777215 19 Y 0 31 8 -def @arg16 250 16777215 8 Y 0 31 8 +def @arg11 246 83 6 Y 32896 38 63 +def @arg12 246 83 6 Y 32896 38 63 +def @arg13 250 16777215 10 Y 0 39 8 +def @arg14 250 16777215 19 Y 0 39 8 +def @arg15 250 16777215 19 Y 0 39 8 +def @arg16 250 16777215 8 Y 0 39 8 def @arg17 8 20 4 Y 32928 0 63 def @arg18 8 20 1 Y 32896 0 63 def @arg19 8 20 1 Y 32896 0 63 -def @arg20 250 16777215 1 Y 0 31 8 -def @arg21 250 16777215 10 Y 0 31 8 -def @arg22 250 16777215 30 Y 0 31 8 -def @arg23 250 16777215 8 Y 128 31 63 -def @arg24 250 16777215 8 Y 0 31 8 -def @arg25 250 16777215 4 Y 128 31 63 -def @arg26 250 16777215 4 Y 0 31 8 -def @arg27 250 16777215 10 Y 128 31 63 -def @arg28 250 16777215 10 Y 0 31 8 -def @arg29 250 16777215 8 Y 128 31 63 -def @arg30 250 16777215 8 Y 0 31 8 -def @arg31 250 16777215 3 Y 0 31 8 -def @arg32 250 16777215 6 Y 0 31 8 +def @arg20 250 16777215 1 Y 0 39 8 +def @arg21 250 16777215 10 Y 0 39 8 +def @arg22 250 16777215 30 Y 0 39 8 +def @arg23 250 16777215 8 Y 128 39 63 +def @arg24 250 16777215 8 Y 0 39 8 +def @arg25 250 16777215 4 Y 128 39 63 +def @arg26 250 16777215 4 Y 0 39 8 +def @arg27 250 16777215 10 Y 128 39 63 +def @arg28 250 16777215 10 Y 0 39 8 +def @arg29 250 16777215 8 Y 128 39 63 +def @arg30 250 16777215 8 Y 0 39 8 +def @arg31 250 16777215 3 Y 0 39 8 +def @arg32 250 16777215 6 Y 0 39 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; @@ -2162,28 +2162,28 @@ def @arg07 5 23 0 Y 32896 31 63 def @arg08 5 23 0 Y 32896 31 63 def @arg09 5 23 0 Y 32896 31 63 def @arg10 5 23 0 Y 32896 31 63 -def @arg11 246 83 0 Y 32896 30 63 -def @arg12 246 83 0 Y 32896 30 63 -def @arg13 250 16777215 0 Y 0 31 8 -def @arg14 250 16777215 0 Y 0 31 8 -def @arg15 250 16777215 19 Y 0 31 8 -def @arg16 250 16777215 0 Y 0 31 8 +def @arg11 246 83 0 Y 32896 38 63 +def @arg12 246 83 0 Y 32896 38 63 +def @arg13 250 16777215 0 Y 0 39 8 +def @arg14 250 16777215 0 Y 0 39 8 +def @arg15 250 16777215 19 Y 0 39 8 +def @arg16 250 16777215 0 Y 0 39 8 def @arg17 8 20 0 Y 32928 0 63 def @arg18 8 20 0 Y 32896 0 63 def @arg19 8 20 0 Y 32896 0 63 -def @arg20 250 16777215 0 Y 0 31 8 -def @arg21 250 16777215 0 Y 0 31 8 -def @arg22 250 16777215 0 Y 0 31 8 -def @arg23 250 16777215 0 Y 128 31 63 -def @arg24 250 16777215 0 Y 0 31 8 -def @arg25 250 16777215 0 Y 128 31 63 -def @arg26 250 16777215 0 Y 0 31 8 -def @arg27 250 16777215 0 Y 128 31 63 -def @arg28 250 16777215 0 Y 0 31 8 -def @arg29 250 16777215 0 Y 128 31 63 -def @arg30 250 16777215 0 Y 0 31 8 -def @arg31 250 16777215 0 Y 0 31 8 -def @arg32 250 16777215 0 Y 0 31 8 +def @arg20 250 16777215 0 Y 0 39 8 +def @arg21 250 16777215 0 Y 0 39 8 +def @arg22 250 16777215 0 Y 0 39 8 +def @arg23 250 16777215 0 Y 128 39 63 +def @arg24 250 16777215 0 Y 0 39 8 +def @arg25 250 16777215 0 Y 128 39 63 +def @arg26 250 16777215 0 Y 0 39 8 +def @arg27 250 16777215 0 Y 128 39 63 +def @arg28 250 16777215 0 Y 0 39 8 +def @arg29 250 16777215 0 Y 128 39 63 +def @arg30 250 16777215 0 Y 0 39 8 +def @arg31 250 16777215 0 Y 0 39 8 +def @arg32 250 16777215 0 Y 0 39 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select c1 into ? from t9 where c1= 1" ; @@ -4552,15 +4552,15 @@ prepare stmt1 from ' explain select * from t9 ' ; execute stmt1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def id 8 3 1 Y 32928 0 63 -def select_type 253 19 6 N 1 31 8 -def table 253 64 2 Y 0 31 8 -def type 253 10 3 Y 0 31 8 -def possible_keys 253 4_OR_8_K 0 Y 0 31 8 -def key 253 64 0 Y 0 31 8 -def key_len 253 4_OR_8_K 0 Y 0 31 8 -def ref 253 2048 0 Y 0 31 8 +def select_type 253 19 6 N 1 39 8 +def table 253 64 2 Y 0 39 8 +def type 253 10 3 Y 0 39 8 +def possible_keys 253 4_OR_8_K 0 Y 0 39 8 +def key 253 64 0 Y 0 39 8 +def key_len 253 4_OR_8_K 0 Y 0 39 8 +def ref 253 2048 0 Y 0 39 8 def rows 8 10 1 Y 32928 0 63 -def Extra 253 255 0 N 1 31 8 +def Extra 253 255 0 N 1 39 8 id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t9 ALL NULL NULL NULL NULL 2 test_sequence @@ -5054,37 +5054,37 @@ t5 CREATE TABLE `t5` ( `const01` int(1) NOT NULL, `param01` bigint(20) DEFAULT NULL, `const02` decimal(2,1) NOT NULL, - `param02` decimal(65,30) DEFAULT NULL, + `param02` decimal(65,38) DEFAULT NULL, `const03` double NOT NULL, `param03` double DEFAULT NULL, `const04` varchar(3) NOT NULL, - `param04` longtext, + `param04` longtext DEFAULT NULL, `const05` varbinary(3) NOT NULL, - `param05` longblob, + `param05` longblob DEFAULT NULL, `const06` varchar(10) NOT NULL, - `param06` longtext, + `param06` longtext DEFAULT NULL, `const07` date DEFAULT NULL, - `param07` longtext, + `param07` longtext DEFAULT NULL, `const08` varchar(19) NOT NULL, - `param08` longtext, + `param08` longtext DEFAULT NULL, `const09` datetime DEFAULT NULL, - `param09` longtext, + `param09` longtext DEFAULT NULL, `const10` bigint(17) DEFAULT NULL, `param10` bigint(20) DEFAULT NULL, `const11` int(4) DEFAULT NULL, `param11` bigint(20) DEFAULT NULL, `const12` binary(0) DEFAULT NULL, `param12` bigint(20) DEFAULT NULL, - `param13` decimal(65,30) DEFAULT NULL, - `param14` longtext, - `param15` longblob + `param13` decimal(65,38) DEFAULT NULL, + `param14` longtext DEFAULT NULL, + `param15` longblob DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 select * from t5 ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def test t5 t5 const01 const01 3 1 1 N 36865 0 63 def test t5 t5 param01 param01 8 20 1 Y 32768 0 63 def test t5 t5 const02 const02 246 4 3 N 36865 1 63 -def test t5 t5 param02 param02 246 67 32 Y 32768 30 63 +def test t5 t5 param02 param02 246 67 40 Y 32768 38 63 def test t5 t5 const03 const03 5 17 1 N 36865 31 63 def test t5 t5 param03 param03 5 23 1 Y 32768 31 63 def test t5 t5 const04 const04 253 3 3 N 4097 0 8 @@ -5105,13 +5105,13 @@ def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 def test t5 t5 const12 const12 254 0 0 Y 128 0 63 def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 -def test t5 t5 param13 param13 246 67 0 Y 32768 30 63 +def test t5 t5 param13 param13 246 67 0 Y 32768 38 63 def test t5 t5 param14 param14 252 4294967295 0 Y 16 0 8 def test t5 t5 param15 param15 252 4294967295 0 Y 144 0 63 const01 8 param01 8 const02 8.0 -param02 8.000000000000000000000000000000 +param02 8.00000000000000000000000000000000000000 const03 8 param03 8 const04 abc @@ -5203,28 +5203,28 @@ def @arg07 5 23 1 Y 32896 31 63 def @arg08 5 23 1 Y 32896 31 63 def @arg09 5 23 1 Y 32896 31 63 def @arg10 5 23 1 Y 32896 31 63 -def @arg11 246 83 6 Y 32896 30 63 -def @arg12 246 83 6 Y 32896 30 63 -def @arg13 250 16777215 10 Y 0 31 8 -def @arg14 250 16777215 19 Y 0 31 8 -def @arg15 250 16777215 19 Y 0 31 8 -def @arg16 250 16777215 8 Y 0 31 8 +def @arg11 246 83 6 Y 32896 38 63 +def @arg12 246 83 6 Y 32896 38 63 +def @arg13 250 16777215 10 Y 0 39 8 +def @arg14 250 16777215 19 Y 0 39 8 +def @arg15 250 16777215 19 Y 0 39 8 +def @arg16 250 16777215 8 Y 0 39 8 def @arg17 8 20 4 Y 32928 0 63 def @arg18 8 20 1 Y 32896 0 63 def @arg19 8 20 1 Y 32896 0 63 -def @arg20 250 16777215 1 Y 0 31 8 -def @arg21 250 16777215 10 Y 0 31 8 -def @arg22 250 16777215 30 Y 0 31 8 -def @arg23 250 16777215 8 Y 128 31 63 -def @arg24 250 16777215 8 Y 0 31 8 -def @arg25 250 16777215 4 Y 128 31 63 -def @arg26 250 16777215 4 Y 0 31 8 -def @arg27 250 16777215 10 Y 128 31 63 -def @arg28 250 16777215 10 Y 0 31 8 -def @arg29 250 16777215 8 Y 128 31 63 -def @arg30 250 16777215 8 Y 0 31 8 -def @arg31 250 16777215 3 Y 0 31 8 -def @arg32 250 16777215 6 Y 0 31 8 +def @arg20 250 16777215 1 Y 0 39 8 +def @arg21 250 16777215 10 Y 0 39 8 +def @arg22 250 16777215 30 Y 0 39 8 +def @arg23 250 16777215 8 Y 128 39 63 +def @arg24 250 16777215 8 Y 0 39 8 +def @arg25 250 16777215 4 Y 128 39 63 +def @arg26 250 16777215 4 Y 0 39 8 +def @arg27 250 16777215 10 Y 128 39 63 +def @arg28 250 16777215 10 Y 0 39 8 +def @arg29 250 16777215 8 Y 128 39 63 +def @arg30 250 16777215 8 Y 0 39 8 +def @arg31 250 16777215 3 Y 0 39 8 +def @arg32 250 16777215 6 Y 0 39 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, @@ -5250,28 +5250,28 @@ def @arg07 5 23 0 Y 32896 31 63 def @arg08 5 23 0 Y 32896 31 63 def @arg09 5 23 0 Y 32896 31 63 def @arg10 5 23 0 Y 32896 31 63 -def @arg11 246 83 0 Y 32896 30 63 -def @arg12 246 83 0 Y 32896 30 63 -def @arg13 250 16777215 0 Y 0 31 8 -def @arg14 250 16777215 0 Y 0 31 8 -def @arg15 250 16777215 19 Y 0 31 8 -def @arg16 250 16777215 0 Y 0 31 8 +def @arg11 246 83 0 Y 32896 38 63 +def @arg12 246 83 0 Y 32896 38 63 +def @arg13 250 16777215 0 Y 0 39 8 +def @arg14 250 16777215 0 Y 0 39 8 +def @arg15 250 16777215 19 Y 0 39 8 +def @arg16 250 16777215 0 Y 0 39 8 def @arg17 8 20 0 Y 32928 0 63 def @arg18 8 20 0 Y 32896 0 63 def @arg19 8 20 0 Y 32896 0 63 -def @arg20 250 16777215 0 Y 0 31 8 -def @arg21 250 16777215 0 Y 0 31 8 -def @arg22 250 16777215 0 Y 0 31 8 -def @arg23 250 16777215 0 Y 128 31 63 -def @arg24 250 16777215 0 Y 0 31 8 -def @arg25 250 16777215 0 Y 128 31 63 -def @arg26 250 16777215 0 Y 0 31 8 -def @arg27 250 16777215 0 Y 128 31 63 -def @arg28 250 16777215 0 Y 0 31 8 -def @arg29 250 16777215 0 Y 128 31 63 -def @arg30 250 16777215 0 Y 0 31 8 -def @arg31 250 16777215 0 Y 0 31 8 -def @arg32 250 16777215 0 Y 0 31 8 +def @arg20 250 16777215 0 Y 0 39 8 +def @arg21 250 16777215 0 Y 0 39 8 +def @arg22 250 16777215 0 Y 0 39 8 +def @arg23 250 16777215 0 Y 128 39 63 +def @arg24 250 16777215 0 Y 0 39 8 +def @arg25 250 16777215 0 Y 128 39 63 +def @arg26 250 16777215 0 Y 0 39 8 +def @arg27 250 16777215 0 Y 128 39 63 +def @arg28 250 16777215 0 Y 0 39 8 +def @arg29 250 16777215 0 Y 128 39 63 +def @arg30 250 16777215 0 Y 0 39 8 +def @arg31 250 16777215 0 Y 0 39 8 +def @arg32 250 16777215 0 Y 0 39 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select @@ -5300,28 +5300,28 @@ def @arg07 5 23 1 Y 32896 31 63 def @arg08 5 23 1 Y 32896 31 63 def @arg09 5 23 1 Y 32896 31 63 def @arg10 5 23 1 Y 32896 31 63 -def @arg11 246 83 6 Y 32896 30 63 -def @arg12 246 83 6 Y 32896 30 63 -def @arg13 250 16777215 10 Y 0 31 8 -def @arg14 250 16777215 19 Y 0 31 8 -def @arg15 250 16777215 19 Y 0 31 8 -def @arg16 250 16777215 8 Y 0 31 8 +def @arg11 246 83 6 Y 32896 38 63 +def @arg12 246 83 6 Y 32896 38 63 +def @arg13 250 16777215 10 Y 0 39 8 +def @arg14 250 16777215 19 Y 0 39 8 +def @arg15 250 16777215 19 Y 0 39 8 +def @arg16 250 16777215 8 Y 0 39 8 def @arg17 8 20 4 Y 32928 0 63 def @arg18 8 20 1 Y 32896 0 63 def @arg19 8 20 1 Y 32896 0 63 -def @arg20 250 16777215 1 Y 0 31 8 -def @arg21 250 16777215 10 Y 0 31 8 -def @arg22 250 16777215 30 Y 0 31 8 -def @arg23 250 16777215 8 Y 128 31 63 -def @arg24 250 16777215 8 Y 0 31 8 -def @arg25 250 16777215 4 Y 128 31 63 -def @arg26 250 16777215 4 Y 0 31 8 -def @arg27 250 16777215 10 Y 128 31 63 -def @arg28 250 16777215 10 Y 0 31 8 -def @arg29 250 16777215 8 Y 128 31 63 -def @arg30 250 16777215 8 Y 0 31 8 -def @arg31 250 16777215 3 Y 0 31 8 -def @arg32 250 16777215 6 Y 0 31 8 +def @arg20 250 16777215 1 Y 0 39 8 +def @arg21 250 16777215 10 Y 0 39 8 +def @arg22 250 16777215 30 Y 0 39 8 +def @arg23 250 16777215 8 Y 128 39 63 +def @arg24 250 16777215 8 Y 0 39 8 +def @arg25 250 16777215 4 Y 128 39 63 +def @arg26 250 16777215 4 Y 0 39 8 +def @arg27 250 16777215 10 Y 128 39 63 +def @arg28 250 16777215 10 Y 0 39 8 +def @arg29 250 16777215 8 Y 128 39 63 +def @arg30 250 16777215 8 Y 0 39 8 +def @arg31 250 16777215 3 Y 0 39 8 +def @arg32 250 16777215 6 Y 0 39 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; @@ -5340,28 +5340,28 @@ def @arg07 5 23 0 Y 32896 31 63 def @arg08 5 23 0 Y 32896 31 63 def @arg09 5 23 0 Y 32896 31 63 def @arg10 5 23 0 Y 32896 31 63 -def @arg11 246 83 0 Y 32896 30 63 -def @arg12 246 83 0 Y 32896 30 63 -def @arg13 250 16777215 0 Y 0 31 8 -def @arg14 250 16777215 0 Y 0 31 8 -def @arg15 250 16777215 19 Y 0 31 8 -def @arg16 250 16777215 0 Y 0 31 8 +def @arg11 246 83 0 Y 32896 38 63 +def @arg12 246 83 0 Y 32896 38 63 +def @arg13 250 16777215 0 Y 0 39 8 +def @arg14 250 16777215 0 Y 0 39 8 +def @arg15 250 16777215 19 Y 0 39 8 +def @arg16 250 16777215 0 Y 0 39 8 def @arg17 8 20 0 Y 32928 0 63 def @arg18 8 20 0 Y 32896 0 63 def @arg19 8 20 0 Y 32896 0 63 -def @arg20 250 16777215 0 Y 0 31 8 -def @arg21 250 16777215 0 Y 0 31 8 -def @arg22 250 16777215 0 Y 0 31 8 -def @arg23 250 16777215 0 Y 128 31 63 -def @arg24 250 16777215 0 Y 0 31 8 -def @arg25 250 16777215 0 Y 128 31 63 -def @arg26 250 16777215 0 Y 0 31 8 -def @arg27 250 16777215 0 Y 128 31 63 -def @arg28 250 16777215 0 Y 0 31 8 -def @arg29 250 16777215 0 Y 128 31 63 -def @arg30 250 16777215 0 Y 0 31 8 -def @arg31 250 16777215 0 Y 0 31 8 -def @arg32 250 16777215 0 Y 0 31 8 +def @arg20 250 16777215 0 Y 0 39 8 +def @arg21 250 16777215 0 Y 0 39 8 +def @arg22 250 16777215 0 Y 0 39 8 +def @arg23 250 16777215 0 Y 128 39 63 +def @arg24 250 16777215 0 Y 0 39 8 +def @arg25 250 16777215 0 Y 128 39 63 +def @arg26 250 16777215 0 Y 0 39 8 +def @arg27 250 16777215 0 Y 128 39 63 +def @arg28 250 16777215 0 Y 0 39 8 +def @arg29 250 16777215 0 Y 128 39 63 +def @arg30 250 16777215 0 Y 0 39 8 +def @arg31 250 16777215 0 Y 0 39 8 +def @arg32 250 16777215 0 Y 0 39 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select ? := c1 from t9 where c1= 1" ; @@ -5388,28 +5388,28 @@ def @arg07 5 23 1 Y 32896 31 63 def @arg08 5 23 1 Y 32896 31 63 def @arg09 5 23 1 Y 32896 31 63 def @arg10 5 23 1 Y 32896 31 63 -def @arg11 246 83 6 Y 32896 30 63 -def @arg12 246 83 6 Y 32896 30 63 -def @arg13 250 16777215 10 Y 0 31 8 -def @arg14 250 16777215 19 Y 0 31 8 -def @arg15 250 16777215 19 Y 0 31 8 -def @arg16 250 16777215 8 Y 0 31 8 +def @arg11 246 83 6 Y 32896 38 63 +def @arg12 246 83 6 Y 32896 38 63 +def @arg13 250 16777215 10 Y 0 39 8 +def @arg14 250 16777215 19 Y 0 39 8 +def @arg15 250 16777215 19 Y 0 39 8 +def @arg16 250 16777215 8 Y 0 39 8 def @arg17 8 20 4 Y 32928 0 63 def @arg18 8 20 1 Y 32896 0 63 def @arg19 8 20 1 Y 32896 0 63 -def @arg20 250 16777215 1 Y 0 31 8 -def @arg21 250 16777215 10 Y 0 31 8 -def @arg22 250 16777215 30 Y 0 31 8 -def @arg23 250 16777215 8 Y 128 31 63 -def @arg24 250 16777215 8 Y 0 31 8 -def @arg25 250 16777215 4 Y 128 31 63 -def @arg26 250 16777215 4 Y 0 31 8 -def @arg27 250 16777215 10 Y 128 31 63 -def @arg28 250 16777215 10 Y 0 31 8 -def @arg29 250 16777215 8 Y 128 31 63 -def @arg30 250 16777215 8 Y 0 31 8 -def @arg31 250 16777215 3 Y 0 31 8 -def @arg32 250 16777215 6 Y 0 31 8 +def @arg20 250 16777215 1 Y 0 39 8 +def @arg21 250 16777215 10 Y 0 39 8 +def @arg22 250 16777215 30 Y 0 39 8 +def @arg23 250 16777215 8 Y 128 39 63 +def @arg24 250 16777215 8 Y 0 39 8 +def @arg25 250 16777215 4 Y 128 39 63 +def @arg26 250 16777215 4 Y 0 39 8 +def @arg27 250 16777215 10 Y 128 39 63 +def @arg28 250 16777215 10 Y 0 39 8 +def @arg29 250 16777215 8 Y 128 39 63 +def @arg30 250 16777215 8 Y 0 39 8 +def @arg31 250 16777215 3 Y 0 39 8 +def @arg32 250 16777215 6 Y 0 39 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, @@ -5432,28 +5432,28 @@ def @arg07 5 23 0 Y 32896 31 63 def @arg08 5 23 0 Y 32896 31 63 def @arg09 5 23 0 Y 32896 31 63 def @arg10 5 23 0 Y 32896 31 63 -def @arg11 246 83 0 Y 32896 30 63 -def @arg12 246 83 0 Y 32896 30 63 -def @arg13 250 16777215 0 Y 0 31 8 -def @arg14 250 16777215 0 Y 0 31 8 -def @arg15 250 16777215 19 Y 0 31 8 -def @arg16 250 16777215 0 Y 0 31 8 +def @arg11 246 83 0 Y 32896 38 63 +def @arg12 246 83 0 Y 32896 38 63 +def @arg13 250 16777215 0 Y 0 39 8 +def @arg14 250 16777215 0 Y 0 39 8 +def @arg15 250 16777215 19 Y 0 39 8 +def @arg16 250 16777215 0 Y 0 39 8 def @arg17 8 20 0 Y 32928 0 63 def @arg18 8 20 0 Y 32896 0 63 def @arg19 8 20 0 Y 32896 0 63 -def @arg20 250 16777215 0 Y 0 31 8 -def @arg21 250 16777215 0 Y 0 31 8 -def @arg22 250 16777215 0 Y 0 31 8 -def @arg23 250 16777215 0 Y 128 31 63 -def @arg24 250 16777215 0 Y 0 31 8 -def @arg25 250 16777215 0 Y 128 31 63 -def @arg26 250 16777215 0 Y 0 31 8 -def @arg27 250 16777215 0 Y 128 31 63 -def @arg28 250 16777215 0 Y 0 31 8 -def @arg29 250 16777215 0 Y 128 31 63 -def @arg30 250 16777215 0 Y 0 31 8 -def @arg31 250 16777215 0 Y 0 31 8 -def @arg32 250 16777215 0 Y 0 31 8 +def @arg20 250 16777215 0 Y 0 39 8 +def @arg21 250 16777215 0 Y 0 39 8 +def @arg22 250 16777215 0 Y 0 39 8 +def @arg23 250 16777215 0 Y 128 39 63 +def @arg24 250 16777215 0 Y 0 39 8 +def @arg25 250 16777215 0 Y 128 39 63 +def @arg26 250 16777215 0 Y 0 39 8 +def @arg27 250 16777215 0 Y 128 39 63 +def @arg28 250 16777215 0 Y 0 39 8 +def @arg29 250 16777215 0 Y 128 39 63 +def @arg30 250 16777215 0 Y 0 39 8 +def @arg31 250 16777215 0 Y 0 39 8 +def @arg32 250 16777215 0 Y 0 39 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, @@ -5478,28 +5478,28 @@ def @arg07 5 23 1 Y 32896 31 63 def @arg08 5 23 1 Y 32896 31 63 def @arg09 5 23 1 Y 32896 31 63 def @arg10 5 23 1 Y 32896 31 63 -def @arg11 246 83 6 Y 32896 30 63 -def @arg12 246 83 6 Y 32896 30 63 -def @arg13 250 16777215 10 Y 0 31 8 -def @arg14 250 16777215 19 Y 0 31 8 -def @arg15 250 16777215 19 Y 0 31 8 -def @arg16 250 16777215 8 Y 0 31 8 +def @arg11 246 83 6 Y 32896 38 63 +def @arg12 246 83 6 Y 32896 38 63 +def @arg13 250 16777215 10 Y 0 39 8 +def @arg14 250 16777215 19 Y 0 39 8 +def @arg15 250 16777215 19 Y 0 39 8 +def @arg16 250 16777215 8 Y 0 39 8 def @arg17 8 20 4 Y 32928 0 63 def @arg18 8 20 1 Y 32896 0 63 def @arg19 8 20 1 Y 32896 0 63 -def @arg20 250 16777215 1 Y 0 31 8 -def @arg21 250 16777215 10 Y 0 31 8 -def @arg22 250 16777215 30 Y 0 31 8 -def @arg23 250 16777215 8 Y 128 31 63 -def @arg24 250 16777215 8 Y 0 31 8 -def @arg25 250 16777215 4 Y 128 31 63 -def @arg26 250 16777215 4 Y 0 31 8 -def @arg27 250 16777215 10 Y 128 31 63 -def @arg28 250 16777215 10 Y 0 31 8 -def @arg29 250 16777215 8 Y 128 31 63 -def @arg30 250 16777215 8 Y 0 31 8 -def @arg31 250 16777215 3 Y 0 31 8 -def @arg32 250 16777215 6 Y 0 31 8 +def @arg20 250 16777215 1 Y 0 39 8 +def @arg21 250 16777215 10 Y 0 39 8 +def @arg22 250 16777215 30 Y 0 39 8 +def @arg23 250 16777215 8 Y 128 39 63 +def @arg24 250 16777215 8 Y 0 39 8 +def @arg25 250 16777215 4 Y 128 39 63 +def @arg26 250 16777215 4 Y 0 39 8 +def @arg27 250 16777215 10 Y 128 39 63 +def @arg28 250 16777215 10 Y 0 39 8 +def @arg29 250 16777215 8 Y 128 39 63 +def @arg30 250 16777215 8 Y 0 39 8 +def @arg31 250 16777215 3 Y 0 39 8 +def @arg32 250 16777215 6 Y 0 39 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; @@ -5516,28 +5516,28 @@ def @arg07 5 23 0 Y 32896 31 63 def @arg08 5 23 0 Y 32896 31 63 def @arg09 5 23 0 Y 32896 31 63 def @arg10 5 23 0 Y 32896 31 63 -def @arg11 246 83 0 Y 32896 30 63 -def @arg12 246 83 0 Y 32896 30 63 -def @arg13 250 16777215 0 Y 0 31 8 -def @arg14 250 16777215 0 Y 0 31 8 -def @arg15 250 16777215 19 Y 0 31 8 -def @arg16 250 16777215 0 Y 0 31 8 +def @arg11 246 83 0 Y 32896 38 63 +def @arg12 246 83 0 Y 32896 38 63 +def @arg13 250 16777215 0 Y 0 39 8 +def @arg14 250 16777215 0 Y 0 39 8 +def @arg15 250 16777215 19 Y 0 39 8 +def @arg16 250 16777215 0 Y 0 39 8 def @arg17 8 20 0 Y 32928 0 63 def @arg18 8 20 0 Y 32896 0 63 def @arg19 8 20 0 Y 32896 0 63 -def @arg20 250 16777215 0 Y 0 31 8 -def @arg21 250 16777215 0 Y 0 31 8 -def @arg22 250 16777215 0 Y 0 31 8 -def @arg23 250 16777215 0 Y 128 31 63 -def @arg24 250 16777215 0 Y 0 31 8 -def @arg25 250 16777215 0 Y 128 31 63 -def @arg26 250 16777215 0 Y 0 31 8 -def @arg27 250 16777215 0 Y 128 31 63 -def @arg28 250 16777215 0 Y 0 31 8 -def @arg29 250 16777215 0 Y 128 31 63 -def @arg30 250 16777215 0 Y 0 31 8 -def @arg31 250 16777215 0 Y 0 31 8 -def @arg32 250 16777215 0 Y 0 31 8 +def @arg20 250 16777215 0 Y 0 39 8 +def @arg21 250 16777215 0 Y 0 39 8 +def @arg22 250 16777215 0 Y 0 39 8 +def @arg23 250 16777215 0 Y 128 39 63 +def @arg24 250 16777215 0 Y 0 39 8 +def @arg25 250 16777215 0 Y 128 39 63 +def @arg26 250 16777215 0 Y 0 39 8 +def @arg27 250 16777215 0 Y 128 39 63 +def @arg28 250 16777215 0 Y 0 39 8 +def @arg29 250 16777215 0 Y 128 39 63 +def @arg30 250 16777215 0 Y 0 39 8 +def @arg31 250 16777215 0 Y 0 39 8 +def @arg32 250 16777215 0 Y 0 39 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select c1 into ? from t9 where c1= 1" ; diff --git a/mysql-test/r/range.result b/mysql-test/r/range.result index a0e44f91d44..268bd184c58 100644 --- a/mysql-test/r/range.result +++ b/mysql-test/r/range.result @@ -2288,5 +2288,16 @@ Warnings: Warning 1366 Incorrect string value: '\xF0\x9F\x98\x8E' for column 'a' at row 1 DROP TABLE t1; # +# MDEV-10185: Assertion `tree1->keys[key_no] && tree2->keys[key_no]' failed in +# sel_trees_can_be_ored(RANGE_OPT_PARAM*, SEL_TREE*, SEL_TREE*, key_map*) +# +CREATE TABLE t1 (pk INT PRIMARY KEY); +INSERT INTO t1 VALUES (1),(2); +SELECT * FROM t1 WHERE pk != 1000 OR pk IN ( 1000, 0, 1, 100, 2 ) OR pk >= 5; +pk +1 +2 +DROP TABLE t1; +# # End of 10.1 tests # diff --git a/mysql-test/r/range_mrr_icp.result b/mysql-test/r/range_mrr_icp.result index c16d3b4adae..5c6930f4323 100644 --- a/mysql-test/r/range_mrr_icp.result +++ b/mysql-test/r/range_mrr_icp.result @@ -2290,6 +2290,17 @@ Warnings: Warning 1366 Incorrect string value: '\xF0\x9F\x98\x8E' for column 'a' at row 1 DROP TABLE t1; # +# MDEV-10185: Assertion `tree1->keys[key_no] && tree2->keys[key_no]' failed in +# sel_trees_can_be_ored(RANGE_OPT_PARAM*, SEL_TREE*, SEL_TREE*, key_map*) +# +CREATE TABLE t1 (pk INT PRIMARY KEY); +INSERT INTO t1 VALUES (1),(2); +SELECT * FROM t1 WHERE pk != 1000 OR pk IN ( 1000, 0, 1, 100, 2 ) OR pk >= 5; +pk +1 +2 +DROP TABLE t1; +# # End of 10.1 tests # set optimizer_switch=@mrr_icp_extra_tmp; diff --git a/mysql-test/r/reopen_temp_table.result b/mysql-test/r/reopen_temp_table.result new file mode 100644 index 00000000000..217aa3c8bad --- /dev/null +++ b/mysql-test/r/reopen_temp_table.result @@ -0,0 +1,192 @@ +# +# MDEV-5535: Cannot reopen temporary table +# +DROP DATABASE IF EXISTS temp_db; +CREATE DATABASE temp_db; +USE temp_db; +# +# Reopen temporary table +# +CREATE TEMPORARY TABLE t1(i int)ENGINE=INNODB; +INSERT INTO t1 VALUES(1), (2); +SELECT * FROM t1 a, t1 b; +i i +1 1 +2 1 +1 2 +2 2 +DROP TABLE t1; +# +# CREATE & Stored routines +# +CREATE FUNCTION f1() RETURNS INT +BEGIN +DROP TEMPORARY TABLE t1; +RETURN 1; +END| +CREATE TEMPORARY TABLE t1 AS SELECT f1(); +ERROR 42S02: Unknown table 'temp_db.t1' +DROP FUNCTION f1; +CREATE FUNCTION f2() RETURNS INT +BEGIN +CREATE TEMPORARY TABLE t2(i INT); +INSERT INTO t2 VALUES(1), (2); +RETURN 1; +END| +CREATE TEMPORARY TABLE t2 AS SELECT f2(); +ERROR 42S01: Table 't2' already exists +SELECT * FROM t2; +i +1 +2 +DROP TABLE t2; +DROP FUNCTION f2; +CREATE TEMPORARY TABLE t3 AS SELECT 1 AS a; +CREATE PROCEDURE p1() +BEGIN +DROP TEMPORARY TABLE t3; +end| +CREATE FUNCTION f3() RETURNS INT +BEGIN +CALL p1(); +RETURN 1; +END| +PREPARE STMT FROM "SELECT f3() AS my_Column, a FROM t3"; +EXECUTE STMT; +ERROR HY000: Can't reopen table: 't3' +DROP TABLE t3; +DROP FUNCTION f3; +DROP PROCEDURE p1; +CREATE TEMPORARY TABLE t4 (i INT); +INSERT INTO t4 VALUES(1), (2); +CREATE FUNCTION f4() RETURNS INT +BEGIN +DROP TEMPORARY TABLE t4; +RETURN 1; +END| +SELECT f4() FROM t4; +ERROR HY000: Can't reopen table: 't4' +SELECT * FROM t4; +i +1 +2 +DROP TABLE t4; +DROP FUNCTION f4; +CREATE TEMPORARY TABLE t5 AS SELECT 1 AS a; +CREATE PROCEDURE p2() +BEGIN +DROP TEMPORARY TABLE t5; +END| +CREATE FUNCTION f5() RETURNS INT +BEGIN +CALL p2(); +RETURN 1; +END| +SELECT f5() AS my_column, a FROM t5; +ERROR HY000: Can't reopen table: 't5' +DROP TABLE t5; +DROP FUNCTION f5; +DROP PROCEDURE p2; +# +# CTAS +# +CREATE TABLE t1(i INT); +INSERT INTO t1 VALUES(1), (2); +CREATE TEMPORARY TABLE t1 +SELECT temp_1.i a, temp_2.i b FROM t1 AS temp_1, t1 AS temp_2; +SELECT * FROM t1; +a b +1 1 +2 1 +1 2 +2 2 +DROP TABLE t1; +SELECT * FROM t1; +i +1 +2 +DROP TABLE t1; +# +# HANDLER +# +CREATE TABLE t1 (a INT, KEY a(a)); +INSERT INTO t1 (a) VALUES (1), (2), (3), (4), (5); +CREATE TABLE t2 (a INT, KEY a (a)) SELECT * FROM t1; +CREATE TEMPORARY TABLE t3 (a INT, KEY a (a)) SELECT * FROM t2; +HANDLER t3 OPEN; +SELECT * FROM t1; +a +1 +2 +3 +4 +5 +LOCK TABLE t1 READ; +HANDLER t3 OPEN; +ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction +UNLOCK TABLES; +HANDLER t3 OPEN; +ERROR 42000: Not unique table/alias: 't3' +HANDLER t3 READ NEXT; +a +1 +HANDLER t3 OPEN AS t3_1; +HANDLER t3_1 READ NEXT; +a +1 +HANDLER t3_1 READ NEXT; +a +2 +HANDLER t3 CLOSE; +HANDLER t3_1 CLOSE; +DROP TEMPORARY TABLE t3; +DROP TABLE t1, t2; +# +# INSERT-SELECT +# +CREATE TEMPORARY TABLE t4 (a INT) ENGINE=MYISAM; +INSERT INTO t4 VALUES(1), (2); +INSERT INTO t4 SELECT * FROM t4; +SELECT COUNT(*) FROM t4; +COUNT(*) +4 +DROP TABLE t4; +CREATE TABLE t5 (a INT) ENGINE=INNODB; +CREATE TEMPORARY TABLE t6 (a INT) ENGINE=INNODB; +INSERT INTO t5 VALUES(1), (2); +INSERT INTO t6 SELECT * FROM t5; +INSERT INTO t6 SELECT * FROM t6; +INSERT INTO t5 SELECT * FROM t6; +SELECT COUNT(*)=6 FROM t5; +COUNT(*)=6 +1 +SELECT COUNT(*)=4 FROM t6; +COUNT(*)=4 +1 +DROP TABLE t5, t6; +# +# MDEV-10216: Assertion `strcmp(share->unique_file_name,filename) || +# share->last_version' failed in myisam/mi_open.c:67: test_if_reopen +# +CREATE TEMPORARY TABLE t7 (i INT) ENGINE=MYISAM; +INSERT INTO t7 VALUES(1); +ALTER TABLE t7 RENAME TO t; +SELECT * FROM t a, t b; +i i +1 1 +DROP TABLE t; +CREATE TEMPORARY TABLE t7 (i INT) ENGINE=ARIA; +INSERT INTO t7 VALUES(1); +ALTER TABLE t7 RENAME TO t; +SELECT * FROM t a, t b; +i i +1 1 +DROP TABLE t; +CREATE TEMPORARY TABLE t8 (i INT) ENGINE=ARIA; +ALTER TABLE t8 rename to t; +SELECT (SELECT 1 FROM t a1, t a2 ) AS f1, ( SELECT 2 FROM t a3 ) AS f2 FROM DUAL; +f1 f2 +NULL NULL +DROP TABLE t; +# Cleanup +DROP DATABASE temp_db; diff --git a/mysql-test/r/replace.result b/mysql-test/r/replace.result index 59b8565f671..9590a97e10a 100644 --- a/mysql-test/r/replace.result +++ b/mysql-test/r/replace.result @@ -27,6 +27,6 @@ drop table t1; CREATE TABLE t1 (f1 INT); CREATE VIEW v1 AS SELECT f1 FROM t1 WHERE f1 = 0 WITH CHECK OPTION; REPLACE INTO v1 (f1) VALUES (1); -ERROR HY000: CHECK OPTION failed 'test.v1' +ERROR 44000: CHECK OPTION failed `test`.`v1` DROP TABLE t1; DROP VIEW v1; diff --git a/mysql-test/r/select_debug.result b/mysql-test/r/select_debug.result index a056affc2cd..55882ad337a 100644 --- a/mysql-test/r/select_debug.result +++ b/mysql-test/r/select_debug.result @@ -6,7 +6,7 @@ insert into t1 values (2,2), (1,1); create table t2 (a int); insert into t2 values (2), (3); set session join_cache_level=3; -set @@debug_dbug= 'd:t:O,/tmp/trace.out'; +set @@debug_dbug= 'd,opt'; explain select t1.b from t1,t2 where t1.b=t2.a; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where diff --git a/mysql-test/r/selectivity_no_engine.result b/mysql-test/r/selectivity_no_engine.result index 31037e90a84..da210b09c23 100644 --- a/mysql-test/r/selectivity_no_engine.result +++ b/mysql-test/r/selectivity_no_engine.result @@ -83,7 +83,7 @@ explain extended select * from t1 where a=-1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 1000 9.52 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = (-(1))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = -1) drop table t0, t1; # # MDEV-4362: Selectivity estimates for IN (...) do not depend on whether the values are in range @@ -110,12 +110,12 @@ explain extended select * from t1 where col1 in (-1,-2,-3); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 10000 5.94 Using where Warnings: -Note 1003 select `test`.`t1`.`col1` AS `col1` from `test`.`t1` where (`test`.`t1`.`col1` in ((-(1)),(-(2)),(-(3)))) +Note 1003 select `test`.`t1`.`col1` AS `col1` from `test`.`t1` where (`test`.`t1`.`col1` in (-1,-2,-3)) explain extended select * from t1 where col1<=-1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 10000 1.00 Using where Warnings: -Note 1003 select `test`.`t1`.`col1` AS `col1` from `test`.`t1` where (`test`.`t1`.`col1` <= (-(1))) +Note 1003 select `test`.`t1`.`col1` AS `col1` from `test`.`t1` where (`test`.`t1`.`col1` <= -1) drop table t1, t2; # # MDEV-5984: EITS: Incorrect filtered% value for single-table select with range access diff --git a/mysql-test/r/set_password_plugin-9835.result b/mysql-test/r/set_password_plugin-9835.result new file mode 100644 index 00000000000..3cc723957d8 --- /dev/null +++ b/mysql-test/r/set_password_plugin-9835.result @@ -0,0 +1,160 @@ +set global secure_auth=0; +create user natauth@localhost identified via 'mysql_native_password' using '*94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29'; +create user newpass@localhost identified by password '*94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29'; +create user newpassnat@localhost identified via 'mysql_native_password'; +set password for newpassnat@localhost = '*94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29'; +create user oldauth@localhost identified with 'mysql_old_password' using '378b243e220ca493'; +create user oldpass@localhost identified by password '378b243e220ca493'; +create user oldpassold@localhost identified with 'mysql_old_password'; +set password for oldpassold@localhost = '378b243e220ca493'; +select user, host, password, plugin, authentication_string from mysql.user where user != 'root'; +user host password plugin authentication_string +natauth localhost *94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29 +newpass localhost *94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29 +newpassnat localhost *94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29 +oldauth localhost 378b243e220ca493 +oldpass localhost 378b243e220ca493 +oldpassold localhost 378b243e220ca493 +connect con,localhost,natauth,test,; +select current_user(); +current_user() +natauth@localhost +disconnect con; +connect con,localhost,newpass,test,; +select current_user(); +current_user() +newpass@localhost +disconnect con; +connect con,localhost,newpassnat,test,; +select current_user(); +current_user() +newpassnat@localhost +disconnect con; +connect con,localhost,oldauth,test,; +select current_user(); +current_user() +oldauth@localhost +disconnect con; +connect con,localhost,oldpass,test,; +select current_user(); +current_user() +oldpass@localhost +disconnect con; +connect con,localhost,oldpassold,test,; +select current_user(); +current_user() +oldpassold@localhost +disconnect con; +connection default; +flush privileges; +connect con,localhost,natauth,test,; +select current_user(); +current_user() +natauth@localhost +disconnect con; +connect con,localhost,newpass,test,; +select current_user(); +current_user() +newpass@localhost +disconnect con; +connect con,localhost,newpassnat,test,; +select current_user(); +current_user() +newpassnat@localhost +disconnect con; +connect con,localhost,oldauth,test,; +select current_user(); +current_user() +oldauth@localhost +disconnect con; +connect con,localhost,oldpass,test,; +select current_user(); +current_user() +oldpass@localhost +disconnect con; +connect con,localhost,oldpassold,test,; +select current_user(); +current_user() +oldpassold@localhost +disconnect con; +connection default; +set password for natauth@localhost = PASSWORD('test2'); +set password for newpass@localhost = PASSWORD('test2'); +set password for newpassnat@localhost = PASSWORD('test2'); +set password for oldauth@localhost = PASSWORD('test2'); +set password for oldpass@localhost = PASSWORD('test2'); +set password for oldpassold@localhost = PASSWORD('test2'); +select user, host, password, plugin, authentication_string from mysql.user where user != 'root'; +user host password plugin authentication_string +natauth localhost *7CEB3FDE5F7A9C4CE5FBE610D7D8EDA62EBE5F4E +newpass localhost *7CEB3FDE5F7A9C4CE5FBE610D7D8EDA62EBE5F4E +newpassnat localhost *7CEB3FDE5F7A9C4CE5FBE610D7D8EDA62EBE5F4E +oldauth localhost *7CEB3FDE5F7A9C4CE5FBE610D7D8EDA62EBE5F4E +oldpass localhost *7CEB3FDE5F7A9C4CE5FBE610D7D8EDA62EBE5F4E +oldpassold localhost *7CEB3FDE5F7A9C4CE5FBE610D7D8EDA62EBE5F4E +connect con,localhost,natauth,test2,; +select current_user(); +current_user() +natauth@localhost +disconnect con; +connect con,localhost,newpass,test2,; +select current_user(); +current_user() +newpass@localhost +disconnect con; +connect con,localhost,newpassnat,test2,; +select current_user(); +current_user() +newpassnat@localhost +disconnect con; +connect con,localhost,oldauth,test2,; +select current_user(); +current_user() +oldauth@localhost +disconnect con; +connect con,localhost,oldpass,test2,; +select current_user(); +current_user() +oldpass@localhost +disconnect con; +connect con,localhost,oldpassold,test2,; +select current_user(); +current_user() +oldpassold@localhost +disconnect con; +connection default; +flush privileges; +connect con,localhost,natauth,test2,; +select current_user(); +current_user() +natauth@localhost +disconnect con; +connect con,localhost,newpass,test2,; +select current_user(); +current_user() +newpass@localhost +disconnect con; +connect con,localhost,newpassnat,test2,; +select current_user(); +current_user() +newpassnat@localhost +disconnect con; +connect con,localhost,oldauth,test2,; +select current_user(); +current_user() +oldauth@localhost +disconnect con; +connect con,localhost,oldpass,test2,; +select current_user(); +current_user() +oldpass@localhost +disconnect con; +connect con,localhost,oldpassold,test2,; +select current_user(); +current_user() +oldpassold@localhost +disconnect con; +connection default; +drop user natauth@localhost, newpass@localhost, newpassnat@localhost; +drop user oldauth@localhost, oldpass@localhost, oldpassold@localhost; +set global secure_auth=default; diff --git a/mysql-test/r/set_statement.result b/mysql-test/r/set_statement.result index ad6f3b7bf2e..adb50afde99 100644 --- a/mysql-test/r/set_statement.result +++ b/mysql-test/r/set_statement.result @@ -1056,7 +1056,7 @@ set statement slow_query_log=default for select @@slow_query_log; truncate table mysql.slow_log; set slow_query_log= 1; set global log_output='TABLE'; -select sql_text from mysql.slow_log; +select sql_text from mysql.slow_log where sql_text not like 'set @@long_query_time%'; sql_text set @@long_query_time=0.01; #should be written @@ -1064,7 +1064,7 @@ select sleep(0.1); sleep(0.1) 0 set @@long_query_time=@save_long_query_time; -select sql_text from mysql.slow_log; +select sql_text from mysql.slow_log where sql_text not like 'set @@long_query_time%'; sql_text select sleep(0.1) #--- @@ -1072,7 +1072,7 @@ select sleep(0.1) set statement long_query_time=0.01 for select sleep(0.1); sleep(0.1) 0 -select sql_text from mysql.slow_log; +select sql_text from mysql.slow_log where sql_text not like 'set @@long_query_time%'; sql_text select sleep(0.1) set statement long_query_time=0.01 for select sleep(0.1) @@ -1083,7 +1083,7 @@ set statement slow_query_log=0 for select sleep(0.1); sleep(0.1) 0 set @@long_query_time=@save_long_query_time; -select sql_text from mysql.slow_log; +select sql_text from mysql.slow_log where sql_text not like 'set @@long_query_time%'; sql_text select sleep(0.1) set statement long_query_time=0.01 for select sleep(0.1) @@ -1092,7 +1092,7 @@ set statement long_query_time=0.01 for select sleep(0.1) set statement long_query_time=0.01,log_slow_filter='full_scan' for select sleep(0.1); sleep(0.1) 0 -select sql_text from mysql.slow_log; +select sql_text from mysql.slow_log where sql_text not like 'set @@long_query_time%'; sql_text select sleep(0.1) set statement long_query_time=0.01 for select sleep(0.1) @@ -1101,7 +1101,7 @@ set statement long_query_time=0.01 for select sleep(0.1) set statement long_query_time=0.01,log_slow_rate_limit=9999 for select sleep(0.1); sleep(0.1) 0 -select sql_text from mysql.slow_log; +select sql_text from mysql.slow_log where sql_text not like 'set @@long_query_time%'; sql_text select sleep(0.1) set statement long_query_time=0.01 for select sleep(0.1) @@ -1110,7 +1110,7 @@ set statement long_query_time=0.01 for select sleep(0.1) set statement long_query_time=0.01,min_examined_row_limit=50 for select sleep(0.1); sleep(0.1) 0 -select sql_text from mysql.slow_log; +select sql_text from mysql.slow_log where sql_text not like 'set @@long_query_time%'; sql_text select sleep(0.1) set statement long_query_time=0.01 for select sleep(0.1) diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result index c3e7588a56d..d3c4ec94cb7 100644 --- a/mysql-test/r/show_check.result +++ b/mysql-test/r/show_check.result @@ -12,51 +12,51 @@ insert into t1 values (1,2,2),(2,2,3),(3,2,4),(4,2,4); -- after Bug#29394 is implemented. check table t1 fast; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def Table 253 128 7 Y 0 31 8 -def Op 253 10 5 Y 0 31 8 -def Msg_type 253 10 6 Y 0 31 8 -def Msg_text 250 393216 27 Y 0 31 8 +def Table 253 128 7 Y 0 39 8 +def Op 253 10 5 Y 0 39 8 +def Msg_type 253 10 6 Y 0 39 8 +def Msg_text 250 393216 27 Y 0 39 8 Table Op Msg_type Msg_text test.t1 check status Table is already up to date check table t1 fast; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def Table 253 128 7 Y 0 31 8 -def Op 253 10 5 Y 0 31 8 -def Msg_type 253 10 6 Y 0 31 8 -def Msg_text 250 393216 27 Y 0 31 8 +def Table 253 128 7 Y 0 39 8 +def Op 253 10 5 Y 0 39 8 +def Msg_type 253 10 6 Y 0 39 8 +def Msg_text 250 393216 27 Y 0 39 8 Table Op Msg_type Msg_text test.t1 check status Table is already up to date check table t1 changed; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def Table 253 128 7 Y 0 31 8 -def Op 253 10 5 Y 0 31 8 -def Msg_type 253 10 6 Y 0 31 8 -def Msg_text 250 393216 2 Y 0 31 8 +def Table 253 128 7 Y 0 39 8 +def Op 253 10 5 Y 0 39 8 +def Msg_type 253 10 6 Y 0 39 8 +def Msg_text 250 393216 2 Y 0 39 8 Table Op Msg_type Msg_text test.t1 check status OK insert into t1 values (5,5,5); check table t1 changed; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def Table 253 128 7 Y 0 31 8 -def Op 253 10 5 Y 0 31 8 -def Msg_type 253 10 6 Y 0 31 8 -def Msg_text 250 393216 2 Y 0 31 8 +def Table 253 128 7 Y 0 39 8 +def Op 253 10 5 Y 0 39 8 +def Msg_type 253 10 6 Y 0 39 8 +def Msg_text 250 393216 2 Y 0 39 8 Table Op Msg_type Msg_text test.t1 check status OK check table t1 medium; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def Table 253 128 7 Y 0 31 8 -def Op 253 10 5 Y 0 31 8 -def Msg_type 253 10 6 Y 0 31 8 -def Msg_text 250 393216 2 Y 0 31 8 +def Table 253 128 7 Y 0 39 8 +def Op 253 10 5 Y 0 39 8 +def Msg_type 253 10 6 Y 0 39 8 +def Msg_text 250 393216 2 Y 0 39 8 Table Op Msg_type Msg_text test.t1 check status OK check table t1 extended; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def Table 253 128 7 Y 0 31 8 -def Op 253 10 5 Y 0 31 8 -def Msg_type 253 10 6 Y 0 31 8 -def Msg_text 250 393216 2 Y 0 31 8 +def Table 253 128 7 Y 0 39 8 +def Op 253 10 5 Y 0 39 8 +def Msg_type 253 10 6 Y 0 39 8 +def Msg_text 250 393216 2 Y 0 39 8 Table Op Msg_type Msg_text test.t1 check status OK show index from t1; @@ -85,10 +85,10 @@ ERROR 23000: Duplicate entry '5' for key 'PRIMARY' -- after Bug#29394 is implemented. optimize table t1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def Table 253 128 7 Y 0 31 8 -def Op 253 10 8 Y 0 31 8 -def Msg_type 253 10 6 Y 0 31 8 -def Msg_text 250 393216 2 Y 0 31 8 +def Table 253 128 7 Y 0 39 8 +def Op 253 10 8 Y 0 39 8 +def Msg_type 253 10 6 Y 0 39 8 +def Msg_text 250 393216 2 Y 0 39 8 Table Op Msg_type Msg_text test.t1 optimize status OK optimize table t1; @@ -157,10 +157,10 @@ insert into t1 values (1,1,1,0),(1,1,2,0),(1,1,3,0),(1,2,1,0),(1,2,2,0),(1,2,3,0 -- after Bug#29394 is implemented. analyze table t1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def Table 253 128 7 Y 0 31 8 -def Op 253 10 7 Y 0 31 8 -def Msg_type 253 10 6 Y 0 31 8 -def Msg_text 250 393216 2 Y 0 31 8 +def Table 253 128 7 Y 0 39 8 +def Op 253 10 7 Y 0 39 8 +def Msg_type 253 10 6 Y 0 39 8 +def Msg_text 250 393216 2 Y 0 39 8 Table Op Msg_type Msg_text test.t1 analyze status OK show index from t1; @@ -174,10 +174,10 @@ t1 0 PRIMARY 4 f4 A 18 NULL NULL BTREE -- after Bug#29394 is implemented. repair table t1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def Table 253 128 7 Y 0 31 8 -def Op 253 10 6 Y 0 31 8 -def Msg_type 253 10 6 Y 0 31 8 -def Msg_text 250 393216 2 Y 0 31 8 +def Table 253 128 7 Y 0 39 8 +def Op 253 10 6 Y 0 39 8 +def Msg_type 253 10 6 Y 0 39 8 +def Msg_text 250 393216 2 Y 0 39 8 Table Op Msg_type Msg_text test.t1 repair status OK show index from t1; @@ -332,7 +332,7 @@ index(type_short) show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `type_bool` tinyint(1) NOT NULL DEFAULT '0', + `type_bool` tinyint(1) NOT NULL DEFAULT 0, `type_tiny` tinyint(4) NOT NULL AUTO_INCREMENT, `type_short` smallint(3) DEFAULT NULL, `type_mediumint` mediumint(9) DEFAULT NULL, @@ -349,10 +349,10 @@ t1 CREATE TABLE `t1` ( `type_year` year(4) DEFAULT NULL, `type_enum` enum('red','green','blue') DEFAULT NULL, `type_set` enum('red','green','blue') DEFAULT NULL, - `type_tinyblob` tinyblob, - `type_blob` blob, - `type_medium_blob` mediumblob, - `type_long_blob` longblob, + `type_tinyblob` tinyblob DEFAULT NULL, + `type_blob` blob DEFAULT NULL, + `type_medium_blob` mediumblob DEFAULT NULL, + `type_long_blob` longblob DEFAULT NULL, PRIMARY KEY (`type_tiny`), KEY `type_short` (`type_short`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 MIN_ROWS=10 MAX_ROWS=100 AVG_ROW_LENGTH=10 PACK_KEYS=1 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=FIXED COMMENT='test' @@ -886,8 +886,8 @@ latin1_bin latin1 47 Yes 1 ---------------------------------------------------------------- SHOW CREATE DATABASE mysqltest1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def Database 253 192 10 N 1 31 33 -def Create Database 253 3072 69 N 1 31 33 +def Database 253 192 10 N 1 39 33 +def Create Database 253 3072 69 N 1 39 33 Database Create Database mysqltest1 CREATE DATABASE `mysqltest1` /*!40100 DEFAULT CHARACTER SET latin1 */ ---------------------------------------------------------------- @@ -899,8 +899,8 @@ mysqltest1 ---------------------------------------------------------------- SHOW CREATE TABLE t1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def Table 253 192 2 N 1 31 33 -def Create Table 253 3072 102 N 1 31 33 +def Table 253 192 2 N 1 39 33 +def Create Table 253 3072 102 N 1 39 33 Table Create Table t1 CREATE TABLE `t1` ( `c` int(11) NOT NULL, @@ -1061,10 +1061,10 @@ def test t1_bi INSERT def test t1 NULL SET @a = 1 ROW BEFORE NULL NULL OLD NEW N ---------------------------------------------------------------- SHOW CREATE VIEW v1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def View 253 192 2 N 1 31 33 -def Create View 253 3072 103 N 1 31 33 -def character_set_client 253 96 6 N 1 31 33 -def collation_connection 253 96 6 N 1 31 33 +def View 253 192 2 N 1 39 33 +def Create View 253 3072 103 N 1 39 33 +def character_set_client 253 96 6 N 1 39 33 +def collation_connection 253 96 6 N 1 39 33 View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 1 AS `1` binary binary ---------------------------------------------------------------- @@ -1088,12 +1088,12 @@ def test v1 select 1 AS `1` NONE NO root@localhost DEFINER binary binary UNDEFIN ---------------------------------------------------------------- SHOW CREATE PROCEDURE p1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def Procedure 253 192 2 N 1 31 33 -def sql_mode 253 126 42 N 1 31 33 -def Create Procedure 253 3072 59 Y 0 31 33 -def character_set_client 253 96 6 N 1 31 33 -def collation_connection 253 96 6 N 1 31 33 -def Database Collation 253 96 17 N 1 31 33 +def Procedure 253 192 2 N 1 39 33 +def sql_mode 253 126 42 N 1 39 33 +def Create Procedure 253 3072 59 Y 0 39 33 +def character_set_client 253 96 6 N 1 39 33 +def collation_connection 253 96 6 N 1 39 33 +def Database Collation 253 96 17 N 1 39 33 Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation p1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`() SELECT 1 binary binary latin1_swedish_ci @@ -1143,12 +1143,12 @@ p1 def test p1 PROCEDURE NULL SQL SELECT 1 NULL NULL SQL NO CONTAINS SQL NULL DE ---------------------------------------------------------------- SHOW CREATE FUNCTION f1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def Function 253 192 2 N 1 31 33 -def sql_mode 253 126 42 N 1 31 33 -def Create Function 253 3072 74 Y 0 31 33 -def character_set_client 253 96 6 N 1 31 33 -def collation_connection 253 96 6 N 1 31 33 -def Database Collation 253 96 17 N 1 31 33 +def Function 253 192 2 N 1 39 33 +def sql_mode 253 126 42 N 1 39 33 +def Create Function 253 3072 74 Y 0 39 33 +def character_set_client 253 96 6 N 1 39 33 +def collation_connection 253 96 6 N 1 39 33 +def Database Collation 253 96 17 N 1 39 33 Function sql_mode Create Function character_set_client collation_connection Database Collation f1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11) RETURN 1 binary binary latin1_swedish_ci @@ -1268,14 +1268,14 @@ PRIMARY KEY (Codigo) ) ENGINE=MyISAM AUTO_INCREMENT=11 DEFAULT CHARSET=utf8; show create table t1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def Table 253 64 2 N 1 31 7 -def Create Table 253 1024 445 N 1 31 7 +def Table 253 64 2 N 1 39 7 +def Create Table 253 1024 458 N 1 39 7 Table Create Table t1 CREATE TABLE `t1` ( `Codigo` int(10) unsigned NOT NULL AUTO_INCREMENT, `Nombre` varchar(255) DEFAULT NULL, `Telefono` varchar(255) DEFAULT NULL, - `Observaciones` longtext, + `Observaciones` longtext DEFAULT NULL, `Direccion` varchar(255) DEFAULT NULL, `Dni` varchar(255) DEFAULT NULL, `CP` int(11) DEFAULT NULL, diff --git a/mysql-test/r/sp-error.result b/mysql-test/r/sp-error.result index 447afe3d330..18484c98162 100644 --- a/mysql-test/r/sp-error.result +++ b/mysql-test/r/sp-error.result @@ -1235,8 +1235,8 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp CREATE PROCEDURE bug20953() CREATE VIEW v AS SELECT i FROM t1 PROCEDURE ANALYSE(); ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'PROCEDURE ANALYSE()' at line 2 -CREATE PROCEDURE bug20953() CREATE VIEW v AS SELECT 1 FROM (SELECT 1) AS d1; -ERROR HY000: View's SELECT contains a subquery in the FROM clause +CREATE PROCEDURE bug20953() CREATE VIEW v AS SELECT 1 FROM (SELECT 1) AS d1 into @w; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'into @w' at line 1 CREATE PROCEDURE bug20953(i INT) CREATE VIEW v AS SELECT i; ERROR HY000: View's SELECT contains a variable or parameter CREATE PROCEDURE bug20953() @@ -1524,14 +1524,14 @@ drop temporary table t1; return 1; end| create temporary table t1 as select f1(); -ERROR HY000: Can't reopen table: 't1' +ERROR 42S02: Unknown table 'test.t1' create function f2() returns int begin create temporary table t2 as select f1(); return 1; end| create temporary table t1 as select f2(); -ERROR HY000: Can't reopen table: 't1' +ERROR 42S02: Unknown table 'test.t1' drop function f1; drop function f2; create function f1() returns int @@ -1545,7 +1545,7 @@ create temporary table t2 as select f1(); return 1; end| create temporary table t1 as select f2(); -ERROR HY000: Can't reopen table: 't2' +ERROR 42S02: Unknown table 'test.t2,test.t1' drop function f1; drop function f2; create temporary table t2(a int); diff --git a/mysql-test/r/sp-threads.result b/mysql-test/r/sp-threads.result index eb1c0beff65..886cbd812f2 100644 --- a/mysql-test/r/sp-threads.result +++ b/mysql-test/r/sp-threads.result @@ -43,12 +43,9 @@ lock tables t2 write; connection con1root; call bug9486(); connection con2root; -show processlist; -Id User Host db Command Time State Info Progress -# root localhost test Sleep # NULL 0.000 -# root localhost test Query # Waiting for table metadata lock update t1, t2 set val= 1 where id1=id2 0.000 -# root localhost test Query # init show processlist 0.000 -# root localhost test Sleep # NULL 0.000 +SELECT state,info FROM information_schema.processlist WHERE id=con1root_id; +state info +Waiting for table metadata lock update t1, t2 set val= 1 where id1=id2 unlock tables; connection con1root; drop procedure bug9486; diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index de6b87d67cd..ce23fe1693e 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -1140,9 +1140,12 @@ insert into t3 values (1), (2), (3); return (select count(*) from t3 as a, t3 as b); end| select f11()| -ERROR HY000: Can't reopen table: 'a' +f11() +9 select f11() from t1| -ERROR HY000: Can't reopen table: 'a' +f11() +9 +9 create function f12_1() returns int begin drop temporary table if exists t3; @@ -1156,6 +1159,7 @@ drop temporary table t3| select f12_1()| f12_1() 3 +drop temporary table t3| select f12_1() from t1 limit 1| f12_1() 3 @@ -6933,7 +6937,7 @@ CREATE TEMPORARY TABLE t3 LIKE t1; CREATE PROCEDURE p1 () BEGIN SELECT f1 FROM t3 AS A WHERE A.f1 IN ( SELECT f1 FROM t3 ) ; END| CALL p1; -ERROR HY000: Can't reopen table: 'A' +f1 CREATE VIEW t3 AS SELECT f1 FROM t2 A WHERE A.f1 IN ( SELECT f1 FROM t2 ); DROP TABLE t3; CALL p1; diff --git a/mysql-test/r/sql_mode.result b/mysql-test/r/sql_mode.result index ac1ad1c625b..e1afb964f0a 100644 --- a/mysql-test/r/sql_mode.result +++ b/mysql-test/r/sql_mode.result @@ -121,7 +121,7 @@ create table t1 ( min_num dec(6,6) default .000001); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `min_num` decimal(6,6) DEFAULT '0.000001' + `min_num` decimal(6,6) DEFAULT 0.000001 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1 ; set session sql_mode = 'IGNORE_SPACE'; @@ -129,14 +129,14 @@ create table t1 ( min_num dec(6,6) default 0.000001); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `min_num` decimal(6,6) DEFAULT '0.000001' + `min_num` decimal(6,6) DEFAULT 0.000001 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1 ; create table t1 ( min_num dec(6,6) default .000001); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `min_num` decimal(6,6) DEFAULT '0.000001' + `min_num` decimal(6,6) DEFAULT 0.000001 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1 ; set @@SQL_MODE=NULL; diff --git a/mysql-test/r/ssl.result b/mysql-test/r/ssl.result index c36b5c666cb..7cd18fbf539 100644 --- a/mysql-test/r/ssl.result +++ b/mysql-test/r/ssl.result @@ -2175,3 +2175,8 @@ still connected? still connected? connection default; disconnect ssl_con; +create user mysqltest_1@localhost; +grant usage on mysqltest.* to mysqltest_1@localhost require cipher "EDH-RSA-DES-CBC3-SHA"; +Variable_name Value +Ssl_cipher EDH-RSA-DES-CBC3-SHA +drop user mysqltest_1@localhost; diff --git a/mysql-test/r/ssl_ca.result b/mysql-test/r/ssl_ca.result new file mode 100644 index 00000000000..ffc5671f85f --- /dev/null +++ b/mysql-test/r/ssl_ca.result @@ -0,0 +1,24 @@ +# +# Bug#21920657: SSL-CA FAILS SILENTLY IF THE PATH CANNOT BE FOUND +# +# try to connect with wrong '--ssl-ca' path : should fail +ERROR 2026 (HY000): SSL connection error: SSL_CTX_set_default_verify_paths failed +# try to connect with correct '--ssl-ca' path : should connect +Variable_name Value +Ssl_cipher DHE-RSA-AES256-SHA +# +# Bug#21920678: SSL-CA DOES NOT ACCEPT ~USER TILDE HOME DIRECTORY +# PATH SUBSTITUTION +# +# try to connect with '--ssl-ca' option using tilde home directoy +# path substitution : should connect +Variable_name Value +Ssl_cipher DHE-RSA-AES256-SHA +# try to connect with '--ssl-key' option using tilde home directoy +# path substitution : should connect +Variable_name Value +Ssl_cipher DHE-RSA-AES256-SHA +# try to connect with '--ssl-cert' option using tilde home directoy +# path substitution : should connect +Variable_name Value +Ssl_cipher DHE-RSA-AES256-SHA diff --git a/mysql-test/r/ssl_timeout-9836.result b/mysql-test/r/ssl_timeout-9836.result new file mode 100644 index 00000000000..7e21a8a435b --- /dev/null +++ b/mysql-test/r/ssl_timeout-9836.result @@ -0,0 +1,9 @@ +connect con1,localhost,root,,,,,SSL; +SET @@net_read_timeout=1; +SELECT 1; +1 +1 +SELECT 1; +1 +1 +disconnect con1; diff --git a/mysql-test/r/stat_tables_innodb_debug.result b/mysql-test/r/stat_tables_innodb_debug.result new file mode 100644 index 00000000000..e0c4c78cd29 --- /dev/null +++ b/mysql-test/r/stat_tables_innodb_debug.result @@ -0,0 +1,25 @@ +# +# MDEV-7901: re-implement analyze table for low impact +# +create table t1 (a int, b int, c int, key IDX1(a), key IDX2(a,b)) engine=innodb; +insert into t1 select seq/10, seq/2, seq from seq_0_to_9; +SET DEBUG_SYNC='statistics_collection_start1 SIGNAL analyzing WAIT_FOR written'; +analyze table t1 persistent for all; +connect con1, localhost, root,,; +connection con1; +SET DEBUG_SYNC= 'now WAIT_FOR analyzing'; +select count(*) from t1; +count(*) +10 +insert into t1 values (333,333,333); +update t1 set a=1; +SET DEBUG_SYNC= 'now SIGNAL written'; +connection default; +Table Op Msg_type Msg_text +test.t1 analyze status Engine-independent statistics collected +test.t1 analyze status OK +select count(*) from t1; +count(*) +11 +set debug_sync='RESET'; +drop table t1; diff --git a/mysql-test/r/stat_tables_myisam_debug.result b/mysql-test/r/stat_tables_myisam_debug.result new file mode 100644 index 00000000000..ae9a001bdfa --- /dev/null +++ b/mysql-test/r/stat_tables_myisam_debug.result @@ -0,0 +1,24 @@ +# +# MDEV-7901: re-implement analyze table for low impact +# +create table t1 (a int, b int, c int, key IDX1(a), key IDX2(a,b)) engine=myisam; +insert into t1 select seq/10, seq/2, seq from seq_0_to_9; +SET DEBUG_SYNC='statistics_collection_start1 SIGNAL analyzing WAIT_FOR written'; +analyze table t1 persistent for all; +connect con1, localhost, root,,; +connection con1; +SET DEBUG_SYNC= 'now WAIT_FOR analyzing'; +select count(*) from t1; +count(*) +10 +insert into t1 values (333,333,333); +SET DEBUG_SYNC= 'now SIGNAL written'; +connection default; +Table Op Msg_type Msg_text +test.t1 analyze status Engine-independent statistics collected +test.t1 analyze status Table is already up to date +select count(*) from t1; +count(*) +11 +set debug_sync='RESET'; +drop table t1; diff --git a/mysql-test/r/statistics.result b/mysql-test/r/statistics.result index be2e39665b3..52986fa9a6b 100644 --- a/mysql-test/r/statistics.result +++ b/mysql-test/r/statistics.result @@ -1677,3 +1677,24 @@ Table Op Msg_type Msg_text test.t1 analyze status Table is already up to date drop table t1; set use_stat_tables=@save_use_stat_tables; +# +# Start of 10.2 tests +# +# +# MDEV-10134 Add full support for DEFAULT +# +CREATE TABLE t1 (a BLOB, b TEXT DEFAULT DECODE_HISTOGRAM('SINGLE_PREC_HB',a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` blob DEFAULT NULL, + `b` text DEFAULT DECODE_HISTOGRAM('SINGLE_PREC_HB',a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES (0x0000000000000000000000000101010101010101010202020303030304040404050505050606070707080809090A0A0B0C0D0D0E0E0F10111213131415161718191B1C1E202224292A2E33373B4850575F6A76818C9AA7B9C4CFDADFE5EBF0F4F8FAFCFF); +SELECT b FROM t1; +b +0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.004,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.004,0.000,0.000,0.004,0.000,0.000,0.000,0.004,0.000,0.000,0.000,0.004,0.000,0.000,0.000,0.004,0.000,0.004,0.000,0.000,0.004,0.000,0.004,0.000,0.004,0.000,0.004,0.004,0.004,0.000,0.004,0.000,0.004,0.004,0.004,0.004,0.004,0.000,0.004,0.004,0.004,0.004,0.004,0.004,0.008,0.004,0.008,0.008,0.008,0.008,0.020,0.004,0.016,0.020,0.016,0.016,0.051,0.031,0.027,0.031,0.043,0.047,0.043,0.043,0.055,0.051,0.071,0.043,0.043,0.043,0.020,0.024,0.024,0.020,0.016,0.016,0.008,0.008,0.012,0.000 +DROP TABLE t1; +# +# End of 10.2 tests +# diff --git a/mysql-test/r/strict.result b/mysql-test/r/strict.result index 9dcd5975411..4da77f21792 100644 --- a/mysql-test/r/strict.result +++ b/mysql-test/r/strict.result @@ -1015,7 +1015,7 @@ CREATE TABLE t1 (col1 INT NOT NULL default 99, col2 CHAR(6) NOT NULL); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE "t1" ( - "col1" int(11) NOT NULL DEFAULT '99', + "col1" int(11) NOT NULL DEFAULT 99, "col2" char(6) NOT NULL ) INSERT INTO t1 VALUES (1, 'hello'); diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index c973bbe11d5..92e75c5088d 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -1232,24 +1232,24 @@ CREATE TABLE t1 SELECT * FROM (SELECT 1 as a,(SELECT 1)) a; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` int(1) NOT NULL DEFAULT '0', - `(SELECT 1)` int(1) NOT NULL DEFAULT '0' + `a` int(1) NOT NULL DEFAULT 0, + `(SELECT 1)` int(1) NOT NULL DEFAULT 0 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; CREATE TABLE t1 SELECT * FROM (SELECT 1 as a,(SELECT a)) a; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` int(1) NOT NULL DEFAULT '0', - `(SELECT a)` int(1) NOT NULL DEFAULT '0' + `a` int(1) NOT NULL DEFAULT 0, + `(SELECT a)` int(1) NOT NULL DEFAULT 0 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; CREATE TABLE t1 SELECT * FROM (SELECT 1 as a,(SELECT a+0)) a; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` int(1) NOT NULL DEFAULT '0', - `(SELECT a+0)` int(3) NOT NULL DEFAULT '0' + `a` int(1) NOT NULL DEFAULT 0, + `(SELECT a+0)` int(3) NOT NULL DEFAULT 0 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; CREATE TABLE t1 SELECT (SELECT 1 as a UNION SELECT 1+1 limit 1,1) as a; @@ -5001,7 +5001,7 @@ CREATE VIEW v2 (a,b) AS SELECT t2.id, t2.c AS c FROM t1, t2 WHERE t1.id=t2.id AND 1 IN (SELECT id FROM t1) WITH CHECK OPTION; INSERT INTO v2(a,b) VALUES (2,2); -ERROR HY000: CHECK OPTION failed 'test.v2' +ERROR 44000: CHECK OPTION failed `test`.`v2` SELECT * FROM v1; c 1 @@ -7151,3 +7151,15 @@ sq NULL drop view v2; drop table t1,t2; +# +# MDEV-9487: Server crashes in Time_and_counter_tracker::incr_loops +# with UNION in ALL subquery +# +SET NAMES utf8; +CREATE TABLE t1 (f VARCHAR(8)) ENGINE=MyISAM; +INSERT INTO t1 VALUES ('foo'); +SELECT f FROM t1 WHERE f > ALL ( SELECT 'bar' UNION SELECT 'baz' ); +f +foo +drop table t1; +SET NAMES default; diff --git a/mysql-test/r/subselect_no_exists_to_in.result b/mysql-test/r/subselect_no_exists_to_in.result index 8ad01c0816c..1802ff59ea2 100644 --- a/mysql-test/r/subselect_no_exists_to_in.result +++ b/mysql-test/r/subselect_no_exists_to_in.result @@ -1236,24 +1236,24 @@ CREATE TABLE t1 SELECT * FROM (SELECT 1 as a,(SELECT 1)) a; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` int(1) NOT NULL DEFAULT '0', - `(SELECT 1)` int(1) NOT NULL DEFAULT '0' + `a` int(1) NOT NULL DEFAULT 0, + `(SELECT 1)` int(1) NOT NULL DEFAULT 0 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; CREATE TABLE t1 SELECT * FROM (SELECT 1 as a,(SELECT a)) a; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` int(1) NOT NULL DEFAULT '0', - `(SELECT a)` int(1) NOT NULL DEFAULT '0' + `a` int(1) NOT NULL DEFAULT 0, + `(SELECT a)` int(1) NOT NULL DEFAULT 0 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; CREATE TABLE t1 SELECT * FROM (SELECT 1 as a,(SELECT a+0)) a; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` int(1) NOT NULL DEFAULT '0', - `(SELECT a+0)` int(3) NOT NULL DEFAULT '0' + `a` int(1) NOT NULL DEFAULT 0, + `(SELECT a+0)` int(3) NOT NULL DEFAULT 0 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; CREATE TABLE t1 SELECT (SELECT 1 as a UNION SELECT 1+1 limit 1,1) as a; @@ -5003,7 +5003,7 @@ CREATE VIEW v2 (a,b) AS SELECT t2.id, t2.c AS c FROM t1, t2 WHERE t1.id=t2.id AND 1 IN (SELECT id FROM t1) WITH CHECK OPTION; INSERT INTO v2(a,b) VALUES (2,2); -ERROR HY000: CHECK OPTION failed 'test.v2' +ERROR 44000: CHECK OPTION failed `test`.`v2` SELECT * FROM v1; c 1 @@ -7151,6 +7151,18 @@ sq NULL drop view v2; drop table t1,t2; +# +# MDEV-9487: Server crashes in Time_and_counter_tracker::incr_loops +# with UNION in ALL subquery +# +SET NAMES utf8; +CREATE TABLE t1 (f VARCHAR(8)) ENGINE=MyISAM; +INSERT INTO t1 VALUES ('foo'); +SELECT f FROM t1 WHERE f > ALL ( SELECT 'bar' UNION SELECT 'baz' ); +f +foo +drop table t1; +SET NAMES default; set optimizer_switch=default; select @@optimizer_switch like '%exists_to_in=off%'; @@optimizer_switch like '%exists_to_in=off%' diff --git a/mysql-test/r/subselect_no_mat.result b/mysql-test/r/subselect_no_mat.result index 6dc3cba5a77..1eb33fc80e7 100644 --- a/mysql-test/r/subselect_no_mat.result +++ b/mysql-test/r/subselect_no_mat.result @@ -1239,24 +1239,24 @@ CREATE TABLE t1 SELECT * FROM (SELECT 1 as a,(SELECT 1)) a; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` int(1) NOT NULL DEFAULT '0', - `(SELECT 1)` int(1) NOT NULL DEFAULT '0' + `a` int(1) NOT NULL DEFAULT 0, + `(SELECT 1)` int(1) NOT NULL DEFAULT 0 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; CREATE TABLE t1 SELECT * FROM (SELECT 1 as a,(SELECT a)) a; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` int(1) NOT NULL DEFAULT '0', - `(SELECT a)` int(1) NOT NULL DEFAULT '0' + `a` int(1) NOT NULL DEFAULT 0, + `(SELECT a)` int(1) NOT NULL DEFAULT 0 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; CREATE TABLE t1 SELECT * FROM (SELECT 1 as a,(SELECT a+0)) a; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` int(1) NOT NULL DEFAULT '0', - `(SELECT a+0)` int(3) NOT NULL DEFAULT '0' + `a` int(1) NOT NULL DEFAULT 0, + `(SELECT a+0)` int(3) NOT NULL DEFAULT 0 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; CREATE TABLE t1 SELECT (SELECT 1 as a UNION SELECT 1+1 limit 1,1) as a; @@ -5001,7 +5001,7 @@ CREATE VIEW v2 (a,b) AS SELECT t2.id, t2.c AS c FROM t1, t2 WHERE t1.id=t2.id AND 1 IN (SELECT id FROM t1) WITH CHECK OPTION; INSERT INTO v2(a,b) VALUES (2,2); -ERROR HY000: CHECK OPTION failed 'test.v2' +ERROR 44000: CHECK OPTION failed `test`.`v2` SELECT * FROM v1; c 1 @@ -7144,6 +7144,18 @@ sq NULL drop view v2; drop table t1,t2; +# +# MDEV-9487: Server crashes in Time_and_counter_tracker::incr_loops +# with UNION in ALL subquery +# +SET NAMES utf8; +CREATE TABLE t1 (f VARCHAR(8)) ENGINE=MyISAM; +INSERT INTO t1 VALUES ('foo'); +SELECT f FROM t1 WHERE f > ALL ( SELECT 'bar' UNION SELECT 'baz' ); +f +foo +drop table t1; +SET NAMES default; set optimizer_switch=default; select @@optimizer_switch like '%materialization=on%'; @@optimizer_switch like '%materialization=on%' diff --git a/mysql-test/r/subselect_no_opts.result b/mysql-test/r/subselect_no_opts.result index 843adafe2b9..f65b505eeca 100644 --- a/mysql-test/r/subselect_no_opts.result +++ b/mysql-test/r/subselect_no_opts.result @@ -1235,24 +1235,24 @@ CREATE TABLE t1 SELECT * FROM (SELECT 1 as a,(SELECT 1)) a; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` int(1) NOT NULL DEFAULT '0', - `(SELECT 1)` int(1) NOT NULL DEFAULT '0' + `a` int(1) NOT NULL DEFAULT 0, + `(SELECT 1)` int(1) NOT NULL DEFAULT 0 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; CREATE TABLE t1 SELECT * FROM (SELECT 1 as a,(SELECT a)) a; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` int(1) NOT NULL DEFAULT '0', - `(SELECT a)` int(1) NOT NULL DEFAULT '0' + `a` int(1) NOT NULL DEFAULT 0, + `(SELECT a)` int(1) NOT NULL DEFAULT 0 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; CREATE TABLE t1 SELECT * FROM (SELECT 1 as a,(SELECT a+0)) a; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` int(1) NOT NULL DEFAULT '0', - `(SELECT a+0)` int(3) NOT NULL DEFAULT '0' + `a` int(1) NOT NULL DEFAULT 0, + `(SELECT a+0)` int(3) NOT NULL DEFAULT 0 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; CREATE TABLE t1 SELECT (SELECT 1 as a UNION SELECT 1+1 limit 1,1) as a; @@ -4997,7 +4997,7 @@ CREATE VIEW v2 (a,b) AS SELECT t2.id, t2.c AS c FROM t1, t2 WHERE t1.id=t2.id AND 1 IN (SELECT id FROM t1) WITH CHECK OPTION; INSERT INTO v2(a,b) VALUES (2,2); -ERROR HY000: CHECK OPTION failed 'test.v2' +ERROR 44000: CHECK OPTION failed `test`.`v2` SELECT * FROM v1; c 1 @@ -7142,4 +7142,16 @@ sq NULL drop view v2; drop table t1,t2; +# +# MDEV-9487: Server crashes in Time_and_counter_tracker::incr_loops +# with UNION in ALL subquery +# +SET NAMES utf8; +CREATE TABLE t1 (f VARCHAR(8)) ENGINE=MyISAM; +INSERT INTO t1 VALUES ('foo'); +SELECT f FROM t1 WHERE f > ALL ( SELECT 'bar' UNION SELECT 'baz' ); +f +foo +drop table t1; +SET NAMES default; set @optimizer_switch_for_subselect_test=null; diff --git a/mysql-test/r/subselect_no_scache.result b/mysql-test/r/subselect_no_scache.result index 348258f5ee1..21ea53bf1b1 100644 --- a/mysql-test/r/subselect_no_scache.result +++ b/mysql-test/r/subselect_no_scache.result @@ -1238,24 +1238,24 @@ CREATE TABLE t1 SELECT * FROM (SELECT 1 as a,(SELECT 1)) a; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` int(1) NOT NULL DEFAULT '0', - `(SELECT 1)` int(1) NOT NULL DEFAULT '0' + `a` int(1) NOT NULL DEFAULT 0, + `(SELECT 1)` int(1) NOT NULL DEFAULT 0 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; CREATE TABLE t1 SELECT * FROM (SELECT 1 as a,(SELECT a)) a; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` int(1) NOT NULL DEFAULT '0', - `(SELECT a)` int(1) NOT NULL DEFAULT '0' + `a` int(1) NOT NULL DEFAULT 0, + `(SELECT a)` int(1) NOT NULL DEFAULT 0 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; CREATE TABLE t1 SELECT * FROM (SELECT 1 as a,(SELECT a+0)) a; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` int(1) NOT NULL DEFAULT '0', - `(SELECT a+0)` int(3) NOT NULL DEFAULT '0' + `a` int(1) NOT NULL DEFAULT 0, + `(SELECT a+0)` int(3) NOT NULL DEFAULT 0 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; CREATE TABLE t1 SELECT (SELECT 1 as a UNION SELECT 1+1 limit 1,1) as a; @@ -5007,7 +5007,7 @@ CREATE VIEW v2 (a,b) AS SELECT t2.id, t2.c AS c FROM t1, t2 WHERE t1.id=t2.id AND 1 IN (SELECT id FROM t1) WITH CHECK OPTION; INSERT INTO v2(a,b) VALUES (2,2); -ERROR HY000: CHECK OPTION failed 'test.v2' +ERROR 44000: CHECK OPTION failed `test`.`v2` SELECT * FROM v1; c 1 @@ -7157,6 +7157,18 @@ sq NULL drop view v2; drop table t1,t2; +# +# MDEV-9487: Server crashes in Time_and_counter_tracker::incr_loops +# with UNION in ALL subquery +# +SET NAMES utf8; +CREATE TABLE t1 (f VARCHAR(8)) ENGINE=MyISAM; +INSERT INTO t1 VALUES ('foo'); +SELECT f FROM t1 WHERE f > ALL ( SELECT 'bar' UNION SELECT 'baz' ); +f +foo +drop table t1; +SET NAMES default; set optimizer_switch=default; select @@optimizer_switch like '%subquery_cache=on%'; @@optimizer_switch like '%subquery_cache=on%' diff --git a/mysql-test/r/subselect_no_semijoin.result b/mysql-test/r/subselect_no_semijoin.result index cd28339e4c9..aabf0674b2f 100644 --- a/mysql-test/r/subselect_no_semijoin.result +++ b/mysql-test/r/subselect_no_semijoin.result @@ -1235,24 +1235,24 @@ CREATE TABLE t1 SELECT * FROM (SELECT 1 as a,(SELECT 1)) a; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` int(1) NOT NULL DEFAULT '0', - `(SELECT 1)` int(1) NOT NULL DEFAULT '0' + `a` int(1) NOT NULL DEFAULT 0, + `(SELECT 1)` int(1) NOT NULL DEFAULT 0 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; CREATE TABLE t1 SELECT * FROM (SELECT 1 as a,(SELECT a)) a; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` int(1) NOT NULL DEFAULT '0', - `(SELECT a)` int(1) NOT NULL DEFAULT '0' + `a` int(1) NOT NULL DEFAULT 0, + `(SELECT a)` int(1) NOT NULL DEFAULT 0 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; CREATE TABLE t1 SELECT * FROM (SELECT 1 as a,(SELECT a+0)) a; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` int(1) NOT NULL DEFAULT '0', - `(SELECT a+0)` int(3) NOT NULL DEFAULT '0' + `a` int(1) NOT NULL DEFAULT 0, + `(SELECT a+0)` int(3) NOT NULL DEFAULT 0 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; CREATE TABLE t1 SELECT (SELECT 1 as a UNION SELECT 1+1 limit 1,1) as a; @@ -4997,7 +4997,7 @@ CREATE VIEW v2 (a,b) AS SELECT t2.id, t2.c AS c FROM t1, t2 WHERE t1.id=t2.id AND 1 IN (SELECT id FROM t1) WITH CHECK OPTION; INSERT INTO v2(a,b) VALUES (2,2); -ERROR HY000: CHECK OPTION failed 'test.v2' +ERROR 44000: CHECK OPTION failed `test`.`v2` SELECT * FROM v1; c 1 @@ -7142,5 +7142,17 @@ sq NULL drop view v2; drop table t1,t2; +# +# MDEV-9487: Server crashes in Time_and_counter_tracker::incr_loops +# with UNION in ALL subquery +# +SET NAMES utf8; +CREATE TABLE t1 (f VARCHAR(8)) ENGINE=MyISAM; +INSERT INTO t1 VALUES ('foo'); +SELECT f FROM t1 WHERE f > ALL ( SELECT 'bar' UNION SELECT 'baz' ); +f +foo +drop table t1; +SET NAMES default; set @optimizer_switch_for_subselect_test=null; set @join_cache_level_for_subselect_test=NULL; diff --git a/mysql-test/r/system_mysql_db.result b/mysql-test/r/system_mysql_db.result index bc4de8b4171..414815f02b7 100644 --- a/mysql-test/r/system_mysql_db.result +++ b/mysql-test/r/system_mysql_db.result @@ -122,23 +122,23 @@ user CREATE TABLE `user` ( `ssl_cipher` blob NOT NULL, `x509_issuer` blob NOT NULL, `x509_subject` blob NOT NULL, - `max_questions` int(11) unsigned NOT NULL DEFAULT '0', - `max_updates` int(11) unsigned NOT NULL DEFAULT '0', - `max_connections` int(11) unsigned NOT NULL DEFAULT '0', - `max_user_connections` int(11) NOT NULL DEFAULT '0', + `max_questions` int(11) unsigned NOT NULL DEFAULT 0, + `max_updates` int(11) unsigned NOT NULL DEFAULT 0, + `max_connections` int(11) unsigned NOT NULL DEFAULT 0, + `max_user_connections` int(11) NOT NULL DEFAULT 0, `plugin` char(64) CHARACTER SET latin1 NOT NULL DEFAULT '', `authentication_string` text COLLATE utf8_bin NOT NULL, `password_expired` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', `is_role` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', `default_role` char(80) COLLATE utf8_bin NOT NULL DEFAULT '', - `max_statement_time` decimal(12,6) NOT NULL DEFAULT '0.000000', + `max_statement_time` decimal(12,6) NOT NULL DEFAULT 0.000000, PRIMARY KEY (`Host`,`User`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Users and global privileges' show create table func; Table Create Table func CREATE TABLE `func` ( `name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '', - `ret` tinyint(1) NOT NULL DEFAULT '0', + `ret` tinyint(1) NOT NULL DEFAULT 0, `dl` char(128) COLLATE utf8_bin NOT NULL DEFAULT '', `type` enum('function','aggregate') CHARACTER SET utf8 NOT NULL, PRIMARY KEY (`name`) @@ -191,7 +191,7 @@ servers CREATE TABLE `servers` ( `Db` char(64) NOT NULL DEFAULT '', `Username` char(80) NOT NULL DEFAULT '', `Password` char(64) NOT NULL DEFAULT '', - `Port` int(4) NOT NULL DEFAULT '0', + `Port` int(4) NOT NULL DEFAULT 0, `Socket` char(64) NOT NULL DEFAULT '', `Wrapper` char(64) NOT NULL DEFAULT '', `Owner` char(64) NOT NULL DEFAULT '', @@ -219,7 +219,7 @@ proc CREATE TABLE `proc` ( `character_set_client` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `collation_connection` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `db_collation` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, - `body_utf8` longblob, + `body_utf8` longblob DEFAULT NULL, PRIMARY KEY (`db`,`name`,`type`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Stored Procedures' show create table event; @@ -246,7 +246,7 @@ event CREATE TABLE `event` ( `character_set_client` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `collation_connection` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `db_collation` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, - `body_utf8` longblob, + `body_utf8` longblob DEFAULT NULL, PRIMARY KEY (`db`,`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Events' show create table general_log; diff --git a/mysql-test/r/system_mysql_db_fix40123.result b/mysql-test/r/system_mysql_db_fix40123.result index bc4de8b4171..414815f02b7 100644 --- a/mysql-test/r/system_mysql_db_fix40123.result +++ b/mysql-test/r/system_mysql_db_fix40123.result @@ -122,23 +122,23 @@ user CREATE TABLE `user` ( `ssl_cipher` blob NOT NULL, `x509_issuer` blob NOT NULL, `x509_subject` blob NOT NULL, - `max_questions` int(11) unsigned NOT NULL DEFAULT '0', - `max_updates` int(11) unsigned NOT NULL DEFAULT '0', - `max_connections` int(11) unsigned NOT NULL DEFAULT '0', - `max_user_connections` int(11) NOT NULL DEFAULT '0', + `max_questions` int(11) unsigned NOT NULL DEFAULT 0, + `max_updates` int(11) unsigned NOT NULL DEFAULT 0, + `max_connections` int(11) unsigned NOT NULL DEFAULT 0, + `max_user_connections` int(11) NOT NULL DEFAULT 0, `plugin` char(64) CHARACTER SET latin1 NOT NULL DEFAULT '', `authentication_string` text COLLATE utf8_bin NOT NULL, `password_expired` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', `is_role` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', `default_role` char(80) COLLATE utf8_bin NOT NULL DEFAULT '', - `max_statement_time` decimal(12,6) NOT NULL DEFAULT '0.000000', + `max_statement_time` decimal(12,6) NOT NULL DEFAULT 0.000000, PRIMARY KEY (`Host`,`User`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Users and global privileges' show create table func; Table Create Table func CREATE TABLE `func` ( `name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '', - `ret` tinyint(1) NOT NULL DEFAULT '0', + `ret` tinyint(1) NOT NULL DEFAULT 0, `dl` char(128) COLLATE utf8_bin NOT NULL DEFAULT '', `type` enum('function','aggregate') CHARACTER SET utf8 NOT NULL, PRIMARY KEY (`name`) @@ -191,7 +191,7 @@ servers CREATE TABLE `servers` ( `Db` char(64) NOT NULL DEFAULT '', `Username` char(80) NOT NULL DEFAULT '', `Password` char(64) NOT NULL DEFAULT '', - `Port` int(4) NOT NULL DEFAULT '0', + `Port` int(4) NOT NULL DEFAULT 0, `Socket` char(64) NOT NULL DEFAULT '', `Wrapper` char(64) NOT NULL DEFAULT '', `Owner` char(64) NOT NULL DEFAULT '', @@ -219,7 +219,7 @@ proc CREATE TABLE `proc` ( `character_set_client` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `collation_connection` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `db_collation` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, - `body_utf8` longblob, + `body_utf8` longblob DEFAULT NULL, PRIMARY KEY (`db`,`name`,`type`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Stored Procedures' show create table event; @@ -246,7 +246,7 @@ event CREATE TABLE `event` ( `character_set_client` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `collation_connection` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `db_collation` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, - `body_utf8` longblob, + `body_utf8` longblob DEFAULT NULL, PRIMARY KEY (`db`,`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Events' show create table general_log; diff --git a/mysql-test/r/system_mysql_db_fix50030.result b/mysql-test/r/system_mysql_db_fix50030.result index bc4de8b4171..ed86a35c910 100644 --- a/mysql-test/r/system_mysql_db_fix50030.result +++ b/mysql-test/r/system_mysql_db_fix50030.result @@ -122,23 +122,23 @@ user CREATE TABLE `user` ( `ssl_cipher` blob NOT NULL, `x509_issuer` blob NOT NULL, `x509_subject` blob NOT NULL, - `max_questions` int(11) unsigned NOT NULL DEFAULT '0', - `max_updates` int(11) unsigned NOT NULL DEFAULT '0', - `max_connections` int(11) unsigned NOT NULL DEFAULT '0', - `max_user_connections` int(11) NOT NULL DEFAULT '0', + `max_questions` int(11) unsigned NOT NULL DEFAULT 0, + `max_updates` int(11) unsigned NOT NULL DEFAULT 0, + `max_connections` int(11) unsigned NOT NULL DEFAULT 0, + `max_user_connections` int(11) NOT NULL DEFAULT 0, `plugin` char(64) CHARACTER SET latin1 NOT NULL DEFAULT '', `authentication_string` text COLLATE utf8_bin NOT NULL, `password_expired` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', `is_role` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', `default_role` char(80) COLLATE utf8_bin NOT NULL DEFAULT '', - `max_statement_time` decimal(12,6) NOT NULL DEFAULT '0.000000', + `max_statement_time` decimal(12,6) NOT NULL DEFAULT 0.000000, PRIMARY KEY (`Host`,`User`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Users and global privileges' show create table func; Table Create Table func CREATE TABLE `func` ( `name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '', - `ret` tinyint(1) NOT NULL DEFAULT '0', + `ret` tinyint(1) NOT NULL DEFAULT 0, `dl` char(128) COLLATE utf8_bin NOT NULL DEFAULT '', `type` enum('function','aggregate') CHARACTER SET utf8 NOT NULL, PRIMARY KEY (`name`) @@ -191,7 +191,7 @@ servers CREATE TABLE `servers` ( `Db` char(64) NOT NULL DEFAULT '', `Username` char(80) NOT NULL DEFAULT '', `Password` char(64) NOT NULL DEFAULT '', - `Port` int(4) NOT NULL DEFAULT '0', + `Port` int(4) NOT NULL DEFAULT 0, `Socket` char(64) NOT NULL DEFAULT '', `Wrapper` char(64) NOT NULL DEFAULT '', `Owner` char(64) NOT NULL DEFAULT '', @@ -208,7 +208,7 @@ proc CREATE TABLE `proc` ( `sql_data_access` enum('CONTAINS_SQL','NO_SQL','READS_SQL_DATA','MODIFIES_SQL_DATA') NOT NULL DEFAULT 'CONTAINS_SQL', `is_deterministic` enum('YES','NO') NOT NULL DEFAULT 'NO', `security_type` enum('INVOKER','DEFINER') NOT NULL DEFAULT 'DEFINER', - `param_list` blob NOT NULL, + `param_list` blob NOT NULL DEFAULT '', `returns` longblob NOT NULL, `body` longblob NOT NULL, `definer` char(141) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '', @@ -219,7 +219,7 @@ proc CREATE TABLE `proc` ( `character_set_client` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `collation_connection` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `db_collation` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, - `body_utf8` longblob, + `body_utf8` longblob DEFAULT NULL, PRIMARY KEY (`db`,`name`,`type`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Stored Procedures' show create table event; @@ -246,7 +246,7 @@ event CREATE TABLE `event` ( `character_set_client` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `collation_connection` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `db_collation` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, - `body_utf8` longblob, + `body_utf8` longblob DEFAULT NULL, PRIMARY KEY (`db`,`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Events' show create table general_log; diff --git a/mysql-test/r/system_mysql_db_fix50117.result b/mysql-test/r/system_mysql_db_fix50117.result index bc4de8b4171..414815f02b7 100644 --- a/mysql-test/r/system_mysql_db_fix50117.result +++ b/mysql-test/r/system_mysql_db_fix50117.result @@ -122,23 +122,23 @@ user CREATE TABLE `user` ( `ssl_cipher` blob NOT NULL, `x509_issuer` blob NOT NULL, `x509_subject` blob NOT NULL, - `max_questions` int(11) unsigned NOT NULL DEFAULT '0', - `max_updates` int(11) unsigned NOT NULL DEFAULT '0', - `max_connections` int(11) unsigned NOT NULL DEFAULT '0', - `max_user_connections` int(11) NOT NULL DEFAULT '0', + `max_questions` int(11) unsigned NOT NULL DEFAULT 0, + `max_updates` int(11) unsigned NOT NULL DEFAULT 0, + `max_connections` int(11) unsigned NOT NULL DEFAULT 0, + `max_user_connections` int(11) NOT NULL DEFAULT 0, `plugin` char(64) CHARACTER SET latin1 NOT NULL DEFAULT '', `authentication_string` text COLLATE utf8_bin NOT NULL, `password_expired` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', `is_role` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', `default_role` char(80) COLLATE utf8_bin NOT NULL DEFAULT '', - `max_statement_time` decimal(12,6) NOT NULL DEFAULT '0.000000', + `max_statement_time` decimal(12,6) NOT NULL DEFAULT 0.000000, PRIMARY KEY (`Host`,`User`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Users and global privileges' show create table func; Table Create Table func CREATE TABLE `func` ( `name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '', - `ret` tinyint(1) NOT NULL DEFAULT '0', + `ret` tinyint(1) NOT NULL DEFAULT 0, `dl` char(128) COLLATE utf8_bin NOT NULL DEFAULT '', `type` enum('function','aggregate') CHARACTER SET utf8 NOT NULL, PRIMARY KEY (`name`) @@ -191,7 +191,7 @@ servers CREATE TABLE `servers` ( `Db` char(64) NOT NULL DEFAULT '', `Username` char(80) NOT NULL DEFAULT '', `Password` char(64) NOT NULL DEFAULT '', - `Port` int(4) NOT NULL DEFAULT '0', + `Port` int(4) NOT NULL DEFAULT 0, `Socket` char(64) NOT NULL DEFAULT '', `Wrapper` char(64) NOT NULL DEFAULT '', `Owner` char(64) NOT NULL DEFAULT '', @@ -219,7 +219,7 @@ proc CREATE TABLE `proc` ( `character_set_client` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `collation_connection` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `db_collation` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, - `body_utf8` longblob, + `body_utf8` longblob DEFAULT NULL, PRIMARY KEY (`db`,`name`,`type`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Stored Procedures' show create table event; @@ -246,7 +246,7 @@ event CREATE TABLE `event` ( `character_set_client` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `collation_connection` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `db_collation` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, - `body_utf8` longblob, + `body_utf8` longblob DEFAULT NULL, PRIMARY KEY (`db`,`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Events' show create table general_log; diff --git a/mysql-test/r/temp_table.result b/mysql-test/r/temp_table.result index c674113e909..73396b53413 100644 --- a/mysql-test/r/temp_table.result +++ b/mysql-test/r/temp_table.result @@ -311,3 +311,229 @@ show status like 'com_drop%table'; Variable_name Value Com_drop_table 2 Com_drop_temporary_table 1 +# +# Some more generic temporary table tests +# added during MDEV-5535. +# +DROP DATABASE IF EXISTS temp_db; +CREATE DATABASE temp_db; +USE temp_db; +# +# SHOW TABLES do not list temporary tables. +# +CREATE TEMPORARY TABLE temp_t1(i INT) ENGINE=INNODB; +INSERT INTO temp_t1 VALUES(1); +SELECT * FROM temp_t1; +i +1 +SHOW TABLES; +Tables_in_temp_db +DROP TABLE temp_t1; +# +# Create and drop a temporary table. +# +CREATE TEMPORARY TABLE temp_t1(i INT) ENGINE=INNODB; +INSERT INTO temp_t1 VALUES(1); +SELECT * FROM temp_t1; +i +1 +DROP TABLE temp_t1; +SELECT * FROM temp_t1; +ERROR 42S02: Table 'temp_db.temp_t1' doesn't exist +# +# Create a temporary table and base table with same name and DROP TABLE. +# +CREATE TABLE t1(c1 VARCHAR(20)) ENGINE=INNODB; +INSERT INTO t1 VALUES("BASE TABLE"); +CREATE TEMPORARY TABLE t1(c1 VARCHAR(20)) ENGINE=INNODB; +INSERT INTO t1 VALUES("TEMPORARY TABLE"); +SELECT * FROM t1; +c1 +TEMPORARY TABLE +DROP TABLE t1; +SELECT * FROM t1; +c1 +BASE TABLE +DROP TABLE t1; +SELECT * FROM t1; +ERROR 42S02: Table 'temp_db.t1' doesn't exist +# +# Create a temporary table and base table with same name and DROP TEMPORARY +# TABLE. +# +CREATE TABLE t1(c1 VARCHAR(20)) ENGINE=INNODB; +INSERT INTO t1 VALUES("BASE TABLE"); +CREATE TEMPORARY TABLE t1(c1 VARCHAR(20)) ENGINE=INNODB; +INSERT INTO t1 VALUES("TEMPORARY TABLE"); +SELECT * FROM t1; +c1 +TEMPORARY TABLE +DROP TEMPORARY TABLE t1; +SELECT * FROM t1; +c1 +BASE TABLE +DROP TEMPORARY TABLE t1; +ERROR 42S02: Unknown table 'temp_db.t1' +SELECT * FROM t1; +c1 +BASE TABLE +DROP TABLE t1; +# +# Create a temporary table and drop its parent database. +# +USE temp_db; +CREATE TEMPORARY TABLE temp_t1(i INT) ENGINE=INNODB; +INSERT INTO temp_t1 VALUES (1); +DROP DATABASE temp_db; +CREATE DATABASE temp_db; +USE temp_db; +DROP TEMPORARY TABLE temp_t1; +# +# Similar to above, but this time with a base table with same name. +# +USE temp_db; +CREATE TABLE t1(i INT)ENGINE=INNODB; +CREATE TEMPORARY TABLE t1(i INT) ENGINE=INNODB; +INSERT INTO t1 VALUES (1); +DROP DATABASE temp_db; +CREATE DATABASE temp_db; +USE temp_db; +DROP TEMPORARY TABLE t1; +DROP TABLE t1; +ERROR 42S02: Unknown table 'temp_db.t1' +# +# Create a temporary table within a function. +# +USE temp_db; +CREATE FUNCTION f1() RETURNS INT +BEGIN +DROP TEMPORARY TABLE IF EXISTS temp_t1; +CREATE TEMPORARY TABLE temp_t1(i INT) ENGINE=INNODB; +INSERT INTO `temp_t1` VALUES(1); +RETURN (SELECT COUNT(*) FROM temp_t1); +END| +SELECT f1(); +f1() +1 +SELECT * FROM temp_t1; +i +1 +DROP TABLE temp_t1; +CREATE TEMPORARY TABLE `temp_t1`(i INT) ENGINE=INNODB; +SELECT f1(); +f1() +1 +SELECT * FROM temp_t1; +i +1 +DROP FUNCTION f1; +# +# Create and drop a temporary table within a function. +# +CREATE FUNCTION f2() RETURNS INT +BEGIN +DROP TEMPORARY TABLE IF EXISTS temp_t1; +CREATE TEMPORARY TABLE temp_t1(i INT) ENGINE=INNODB; +INSERT INTO temp_t1 VALUES(1); +DROP TABLE temp_t1; +RETURN 0; +END| +ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger. +CREATE FUNCTION f2() RETURNS INT +BEGIN +DROP TEMPORARY TABLE IF EXISTS temp_t1; +CREATE TEMPORARY TABLE temp_t1(i INT) ENGINE=INNODB; +INSERT INTO temp_t1 VALUES(1); +DROP TEMPORARY TABLE temp_t1; +RETURN 0; +END| +SELECT f2(); +f2() +0 +DROP FUNCTION f2; +# +# Create a temporary table within a function and select it from another +# function. +# +CREATE FUNCTION f2() RETURNS INT +BEGIN +DROP TEMPORARY TABLE IF EXISTS temp_t1; +CREATE TEMPORARY TABLE temp_t1 (i INT) ENGINE=INNODB; +INSERT INTO temp_t1 VALUES (1); +RETURN f2_1(); +END| +CREATE FUNCTION f2_1() RETURNS INT +RETURN (SELECT COUNT(*) FROM temp_t1)| +SELECT f2(); +f2() +1 +DROP TEMPORARY TABLE temp_t1; +DROP FUNCTION f2; +# +# Create temporary table like base table. +# +CREATE TABLE t1(i INT) ENGINE=INNODB; +INSERT INTO t1 VALUES(1); +CREATE TEMPORARY TABLE temp_t1 LIKE t1; +SELECT * FROM temp_t1; +i +CREATE TEMPORARY TABLE t1 LIKE t1; +ERROR 42000: Not unique table/alias: 't1' +DROP TABLE temp_t1, t1; +# +# Create temporary table as base table. +# +CREATE TABLE t1(i INT) ENGINE=INNODB; +INSERT INTO t1 VALUES(1); +CREATE TEMPORARY TABLE temp_t1 AS SELECT * FROM t1; +SELECT * FROM temp_t1; +i +1 +DROP TABLE temp_t1, t1; +# +# ALTER TABLE RENAME & ENABLE/DISABLE KEYS (shortcuts) +# +CREATE TEMPORARY TABLE t1(i INT PRIMARY KEY) ENGINE=MYISAM; +INSERT INTO t1 VALUES(1); +SELECT COUNT(*)=1 FROM t1; +COUNT(*)=1 +1 +ALTER TABLE t1 RENAME t2; +SELECT COUNT(*)=1 FROM t2; +COUNT(*)=1 +1 +ALTER TABLE t2 RENAME t1; +ALTER TABLE t1 DISABLE KEYS; +ALTER TABLE t1 ENABLE KEYS; +LOCK TABLES t1 WRITE; +ALTER TABLE t1 RENAME t2; +SELECT COUNT(*)=1 FROM t2; +COUNT(*)=1 +1 +ALTER TABLE t2 RENAME t1; +ALTER TABLE t1 DISABLE KEYS; +ALTER TABLE t1 ENABLE KEYS; +UNLOCK TABLES; +LOCK TABLES t1 READ; +ALTER TABLE t1 RENAME t2; +SELECT COUNT(*)=1 FROM t2; +COUNT(*)=1 +1 +ALTER TABLE t2 RENAME t1; +ALTER TABLE t1 DISABLE KEYS; +ALTER TABLE t1 ENABLE KEYS; +UNLOCK TABLES; +FLUSH TABLES WITH READ LOCK; +ALTER TABLE t1 RENAME t2; +SELECT COUNT(*)=1 FROM t2; +COUNT(*)=1 +1 +ALTER TABLE t2 RENAME t1; +ALTER TABLE t1 DISABLE KEYS; +ALTER TABLE t1 ENABLE KEYS; +UNLOCK TABLES; +ALTER TABLE t1 RENAME t2, LOCK SHARED; +ALTER TABLE t2 RENAME t1, LOCK EXCLUSIVE; +DROP TABLE t1; +# Cleanup +DROP DATABASE temp_db; diff --git a/mysql-test/r/trigger_null-8605.result b/mysql-test/r/trigger_null-8605.result index e024bc6b7d2..b187fc19554 100644 --- a/mysql-test/r/trigger_null-8605.result +++ b/mysql-test/r/trigger_null-8605.result @@ -318,9 +318,8 @@ id delete from t1; create trigger t1_bi before insert on t1 for each row begin end; insert t1 values (0); -select * from t1; -id -0 +insert t1 (id) values (0); +ERROR 23000: Duplicate entry '0' for key 'PRIMARY' drop table t1; create table t1 (a int not null, b int); create trigger trgi before update on t1 for each row do 1; diff --git a/mysql-test/r/type_blob.result b/mysql-test/r/type_blob.result index 132de86e27b..5249c89e4a4 100644 --- a/mysql-test/r/type_blob.result +++ b/mysql-test/r/type_blob.result @@ -23,8 +23,8 @@ create table t3 (a long, b long byte); show create TABLE t3; Table Create Table t3 CREATE TABLE `t3` ( - `a` mediumtext, - `b` mediumblob + `a` mediumtext DEFAULT NULL, + `b` mediumblob DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 show create TABLE t4; Table Create Table @@ -37,10 +37,20 @@ ERROR 42000: Column length too big for column 'a' (max = 255); use BLOB or TEXT CREATE TABLE t2 (a char(256)); ERROR 42000: Column length too big for column 'a' (max = 255); use BLOB or TEXT instead CREATE TABLE t1 (a varchar(70000) default "hello"); -ERROR 42000: Column length too big for column 'a' (max = 65535); use BLOB or TEXT instead +Warnings: +Note 1246 Converting column 'a' from VARCHAR to TEXT +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` mediumtext DEFAULT "hello" +) ENGINE=MyISAM DEFAULT CHARSET=latin1 CREATE TABLE t2 (a blob default "hello"); -ERROR 42000: BLOB/TEXT column 'a' can't have a default value -drop table if exists t1,t2; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` blob DEFAULT "hello" +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1,t2; create table t1 (nr int(5) not null auto_increment,b blob,str char(10), primary key (nr)); insert into t1 values (null,"a","A"); insert into t1 values (null,"bbb","BBB"); @@ -364,7 +374,7 @@ Warning 1071 Specified key was too long; max key length is 1000 bytes show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` text, + `a` text DEFAULT NULL, KEY `a` (`a`(1000)) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; @@ -503,11 +513,7 @@ foobar boggle fish 10 drop table t1; create table t1 (id integer auto_increment unique,imagem LONGBLOB not null default ''); -Warnings: -Warning 1101 BLOB/TEXT column 'imagem' can't have a default value insert into t1 (id) values (1); -Warnings: -Warning 1364 Field 'imagem' doesn't have a default value select charset(load_file('../../std_data/words.dat')), collation(load_file('../../std_data/words.dat')), @@ -793,21 +799,24 @@ NULL 620000000000 drop table t1; create table t1 (a text default ''); -Warnings: -Warning 1101 BLOB/TEXT column 'a' can't have a default value show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` text + `a` text DEFAULT '' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (default); select * from t1; a -NULL + drop table t1; set @@sql_mode='TRADITIONAL'; create table t1 (a text default ''); -ERROR 42000: BLOB/TEXT column 'a' can't have a default value +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` text DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; set @@sql_mode=''; CREATE TABLE t (c TEXT CHARSET ASCII); INSERT INTO t (c) VALUES (REPEAT('1',65537)); @@ -878,17 +887,22 @@ ERROR 42000: Column length too big for column 'a' (max = 255); use BLOB or TEXT CREATE TABLE b15776 (a char(4294967295)); ERROR 42000: Column length too big for column 'a' (max = 255); use BLOB or TEXT instead CREATE TABLE b15776 (a char(4294967296)); -ERROR 42000: Display width out of range for 'a' (max = 4294967295) -CREATE TABLE b15776 (a year(4294967295)); +ERROR 42000: Column length too big for column 'a' (max = 255); use BLOB or TEXT instead +CREATE TABLE b15776 (a year(?)); Warnings: -Note 1287 'YEAR(4294967295)' is deprecated and will be removed in a future release. Please use YEAR(4) instead +Note 1287 'YEAR(?)' is deprecated and will be removed in a future release. Please use YEAR(4) instead INSERT INTO b15776 VALUES (42); SELECT * FROM b15776; a 2042 DROP TABLE b15776; CREATE TABLE b15776 (a year(4294967296)); -ERROR 42000: Display width out of range for 'a' (max = 4294967295) +SHOW CREATE TABLE b15776; +Table Create Table +b15776 CREATE TABLE `b15776` ( + `a` year(4) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE b15776; CREATE TABLE b15776 (a year(0)); Warnings: Note 1287 'YEAR(0)' is deprecated and will be removed in a future release. Please use YEAR(4) instead @@ -900,17 +914,22 @@ ERROR 42000: Too big precision 4294967294 specified for 'a'. Maximum is 6. CREATE TABLE b15776 (a timestamp(4294967295)); ERROR 42000: Too big precision 4294967295 specified for 'a'. Maximum is 6. CREATE TABLE b15776 (a timestamp(4294967296)); -ERROR 42000: Display width out of range for 'a' (max = 4294967295) +ERROR 42000: Too big precision 4294967296 specified for 'a'. Maximum is 6. CREATE TABLE b15776 (a timestamp(-1)); ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '-1))' at line 1 CREATE TABLE b15776 (a timestamp(-2)); ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '-2))' at line 1 CREATE TABLE b15776 (a int(999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999)); -ERROR 42000: Display width out of range for 'a' (max = 4294967295) +ERROR 42000: Display width out of range for 'a' (max = 255) CREATE TABLE b15776 (a char(999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999)); -ERROR 42000: Display width out of range for 'a' (max = 4294967295) +ERROR 42000: Column length too big for column 'a' (max = 255); use BLOB or TEXT instead CREATE TABLE b15776 (a year(999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999)); -ERROR 42000: Display width out of range for 'a' (max = 4294967295) +SHOW CREATE TABLE b15776; +Table Create Table +b15776 CREATE TABLE `b15776` ( + `a` year(4) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE b15776; CREATE TABLE b15776 select cast(null as char(4294967295)); show columns from b15776; Field Type Null Key Default Extra diff --git a/mysql-test/r/type_date.result b/mysql-test/r/type_date.result index 54f2aa91f2c..a1eeda063e4 100644 --- a/mysql-test/r/type_date.result +++ b/mysql-test/r/type_date.result @@ -439,6 +439,42 @@ select 1 from t1 as t1_0 inner join t1 as t2 on (t1_0.a <=> now()) join t1 on 1; 1 drop table t1; # +# MDEV-9521 Least function returns 0000-00-00 for null date columns instead of null +# MDEV-9972 Least function retuns date in date time format +# +CREATE TABLE t1 ( +id BIGINT NOT NULL, +date_debut DATE NOT NULL, +date_fin DATE DEFAULT NULL); +CREATE TABLE t2( +id BIGINT NOT NULL, +date_debut DATE NOT NULL, +date_fin DATE DEFAULT NULL); +INSERT INTO t1 VALUES (1,'2016-01-01','2016-01-31'); +INSERT INTO t1 VALUES (2,'2016-02-01',null); +INSERT INTO t1 VALUES (3,'2016-03-01','2016-03-31'); +INSERT INTO t1 VALUES (4,'2016-04-01',null); +INSERT INTO t2 VALUES (1,'2016-01-01','2016-01-31'); +INSERT INTO t2 VALUES (2,'2016-02-01','2016-01-28'); +INSERT INTO t2 VALUES (3,'2016-03-01',null); +INSERT INTO t2 VALUES (4,'2016-04-01',null); +SELECT t1.id, +GREATEST(t2.date_debut, t1.date_debut) AS date_debut, +LEAST(IFNULL(t2.date_fin, IFNULL(t1.date_fin, NULL)), +IFNULL(t1.date_fin, IFNULL(t2.date_fin, NULL))) AS date_fin +FROM t1 LEFT JOIN t2 ON (t1.id=t2.id); +id date_debut date_fin +1 2016-01-01 2016-01-31 +2 2016-02-01 2016-01-28 +3 2016-03-01 2016-03-31 +4 2016-04-01 NULL +DROP TABLE t1,t2; +SELECT +LEAST(COALESCE(DATE(NULL), DATE(NULL)), COALESCE(DATE(NULL), DATE(NULL))) AS d0, +LEAST(IFNULL(DATE(NULL), DATE(NULL)), IFNULL(DATE(NULL), DATE(NULL))) AS d1; +d0 d1 +NULL NULL +# # MDEV-9511 Valgrind warnings 'Invalid read' in Field_newdate::cmp and Field_newdate::val_str # CREATE TABLE t1 (f1 DATE, f2 VARCHAR(1)); diff --git a/mysql-test/r/type_datetime.result b/mysql-test/r/type_datetime.result index bf3b6a6b7da..41696aa2d7d 100644 --- a/mysql-test/r/type_datetime.result +++ b/mysql-test/r/type_datetime.result @@ -834,6 +834,14 @@ a b a b DEALLOCATE PREPARE stmt1; DROP TABLE t1,t2; # +# MDEV-9374 having '2015-01-01 01:00:00.000001' > coalesce(NULL) returns true +# +CREATE TABLE t1 (c1 DATETIME(0)); +INSERT INTO t1 VALUES (NULL); +SELECT * FROM t1 HAVING '2015-01-01 01:00:00.000001' > COALESCE(c1); +c1 +DROP TABLE t1; +# # End of 5.5 tests # # diff --git a/mysql-test/r/type_decimal.result b/mysql-test/r/type_decimal.result index 85ea43752a5..c1cf49cc65e 100644 --- a/mysql-test/r/type_decimal.result +++ b/mysql-test/r/type_decimal.result @@ -221,7 +221,6 @@ drop table t1; create table t1 (a decimal(10,2) unsigned); insert into t1 values ("0.0"),("-0.0"),("+0.0"),("01.0"),("+01.0"),("-01.0"); Warnings: -Warning 1264 Out of range value for column 'a' at row 2 Warning 1264 Out of range value for column 'a' at row 6 insert into t1 values ("-.1"),("+.1"),(".1"); Warnings: @@ -280,7 +279,6 @@ drop table t1; create table t1 (a decimal(10,2) zerofill); insert into t1 values ("0.0"),("-0.0"),("+0.0"),("01.0"),("+01.0"),("-01.0"); Warnings: -Warning 1264 Out of range value for column 'a' at row 2 Warning 1264 Out of range value for column 'a' at row 6 insert into t1 values ("-.1"),("+.1"),(".1"); Warnings: @@ -813,10 +811,10 @@ c1 drop table t1; SELECT 1 % .123456789123456789123456789123456789123456789123456789123456789123456789123456789 AS '%'; % -0.012345687012345687012345687012 +0.01234568701234568701234568701234568701 SELECT MOD(1, .123456789123456789123456789123456789123456789123456789123456789123456789123456789) AS 'MOD()'; MOD() -0.012345687012345687012345687012 +0.01234568701234568701234568701234568701 create table t1 (f1 decimal(6,6),f2 decimal(6,6) zerofill); insert into t1 values (-0.123456,0.123456); select group_concat(f1),group_concat(f2) from t1; @@ -847,8 +845,8 @@ c 123456 SELECT ROUND( a, 100 ) AS c FROM t1 ORDER BY c; c -123456.000000000000000000000000000000 -123456.000000000000000000000000000000 +123456.00000000000000000000000000000000000000 +123456.00000000000000000000000000000000000000 CREATE TABLE t2( a NUMERIC, b INT ); INSERT INTO t2 VALUES (123456, 100); SELECT TRUNCATE( a, b ) AS c FROM t2 ORDER BY c; @@ -869,8 +867,8 @@ c 123456 SELECT ROUND( a, 100 ) AS c FROM t3 ORDER BY c; c -123456.000000000000000000000000000000 -123456.000000000000000000000000000000 +123456.00000000000000000000000000000000000000 +123456.00000000000000000000000000000000000000 CREATE TABLE t4( a DECIMAL, b INT ); INSERT INTO t4 VALUES (123456, 40), (123456, 40); SELECT TRUNCATE( a, b ) AS c FROM t4 ORDER BY c; @@ -883,8 +881,8 @@ c 123456 SELECT ROUND( a, 100 ) AS c FROM t4 ORDER BY c; c -123456.000000000000000000000000000000 -123456.000000000000000000000000000000 +123456.00000000000000000000000000000000000000 +123456.00000000000000000000000000000000000000 delete from t1; INSERT INTO t1 VALUES (1234567890, 20), (999.99, 5); Warnings: diff --git a/mysql-test/r/type_enum.result b/mysql-test/r/type_enum.result index f0152d08c32..5c5821da110 100644 --- a/mysql-test/r/type_enum.result +++ b/mysql-test/r/type_enum.result @@ -1669,7 +1669,7 @@ b ENUM('value',' show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT '1', + `a` int(11) DEFAULT 1, `b` enum('value','öäü_value','ÊÃÕ') NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 show columns from t1; @@ -2151,7 +2151,7 @@ CREATE TABLE t1 (a DOUBLE); INSERT INTO t1 VALUES (9e100); ALTER TABLE t1 MODIFY a ENUM('9e200','9e100'); Warnings: -Warning 1292 Truncated incorrect INTEGER value: '9e100' +Warning 1916 Got overflow when converting '9e100' to INT. Value truncated. Warning 1265 Data truncated for column 'a' at row 1 SELECT * FROM t1; a diff --git a/mysql-test/r/type_float.result b/mysql-test/r/type_float.result index e6f02d50f4c..4f4c36561dd 100644 --- a/mysql-test/r/type_float.result +++ b/mysql-test/r/type_float.result @@ -723,5 +723,54 @@ d2_2 0.99 DROP TABLE t1,t2; # +# Test of using wrong scale +# +create or replace table t1 (a double(40,30)); +create or replace table t1 (a double(40,31)); +ERROR 42000: Too big scale 31 specified for 'a'. Maximum is 30. +create or replace table t1 as select 1.01e1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `1.01e1` double NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +create or replace table t1 as select truncate(10.000000000001e1, 30) as t; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `t` double(47,30) NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +create or replace table t1 as select truncate(10.000000000001e1, 31) as t; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `t` double NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +create or replace table t1 as select truncate(10.000000000001e1, 39) as t; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `t` double NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +create or replace table t1 as select truncate(10.000000000001e1, 51) as t; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `t` double NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +create or replace table t1 as select truncate(10.000000000001e1, 20)/2 as t; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `t` double(41,24) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +create or replace table t1 as select truncate(10.000000000001e1, 28)/2 as t; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `t` double DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table if exists t1; +# # End of 10.2 tests # diff --git a/mysql-test/r/type_newdecimal.result b/mysql-test/r/type_newdecimal.result index 1942d07c9ab..ed837dda975 100644 --- a/mysql-test/r/type_newdecimal.result +++ b/mysql-test/r/type_newdecimal.result @@ -176,7 +176,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `round(15.4,-1)` decimal(3,0) NOT NULL, `truncate(-5678.123451,-3)` decimal(4,0) NOT NULL, - `abs(-1.1)` decimal(3,1) NOT NULL, + `abs(-1.1)` decimal(2,1) NOT NULL, `-(-1.1)` decimal(2,1) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; @@ -700,10 +700,10 @@ select .7777777777777777777777777777777777777 * 1000000000000000000; .7777777777777777777777777777777777777 * 1000000000000000000 -777777777777777777.777777777777777777700000000000 +777777777777777777.7777777777777777777000000000000000000 select .7777777777777777777777777777777777777 - 0.1; .7777777777777777777777777777777777777 - 0.1 -0.677777777777777777777777777778 +0.6777777777777777777777777777777777777 select .343434343434343434 + .343434343434343434; .343434343434343434 + .343434343434343434 0.686868686868686868 @@ -758,12 +758,12 @@ round(99999999999999999.999,3) select round(-99999999999999999.999,3); round(-99999999999999999.999,3) -99999999999999999.999 -select truncate(99999999999999999999999999999999999999,31); -truncate(99999999999999999999999999999999999999,31) -99999999999999999999999999999999999999.000000000000000000000000000000 -select truncate(99.999999999999999999999999999999999999,31); -truncate(99.999999999999999999999999999999999999,31) -99.999999999999999999999999999999 +select truncate(99999999999999999999999999999999999999,49); +truncate(99999999999999999999999999999999999999,49) +99999999999999999999999999999999999999.000000000000000000000000000000000000 +select truncate(99.999999999999999999999999999999999999,49); +truncate(99.999999999999999999999999999999999999,49) +99.99999999999999999999999999999999999900 select truncate(99999999999999999999999999999999999999,-31); truncate(99999999999999999999999999999999999999,-31) 99999990000000000000000000000000000000 @@ -889,7 +889,7 @@ create table t1 (col1 int, col2 decimal(30,25), col3 numeric(30,25)); insert into t1 values (1,0.0123456789012345678912345,0.0123456789012345678912345); select col2/9999999999 from t1 where col1=1; col2/9999999999 -0.000000000001234567890246913578 +0.00000000000123456789024691357814814136 select 9999999999/col2 from t1 where col1=1; 9999999999/col2 810000007209.000065537105051 @@ -924,10 +924,12 @@ select cast(ln(14000) as decimal(2,3)) c1; ERROR 42000: For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column ''). create table t1 (sl decimal(70,30)); ERROR 42000: Too big precision 70 specified for 'sl'. Maximum is 65. -create table t1 (sl decimal(32,31)); -ERROR 42000: Too big scale 31 specified for 'sl'. Maximum is 30. -create table t1 (sl decimal(0,38)); -ERROR 42000: Too big scale 38 specified for 'sl'. Maximum is 30. +create table t1 (sl decimal(32,39)); +ERROR 42000: Too big scale 39 specified for 'sl'. Maximum is 38. +create table t1 (sl decimal(67,38)); +ERROR 42000: Too big precision 67 specified for 'sl'. Maximum is 65. +create table t1 (sl decimal(0,50)); +ERROR 42000: Too big scale 50 specified for 'sl'. Maximum is 38. create table t1 (sl decimal(0,30)); ERROR 42000: For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column 'sl'). create table t1 (sl decimal(5, 5)); @@ -937,11 +939,11 @@ t1 CREATE TABLE `t1` ( `sl` decimal(5,5) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; -create table t1 (sl decimal(65, 30)); +create table t1 (sl decimal(65, 38)); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `sl` decimal(65,30) DEFAULT NULL + `sl` decimal(65,38) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 ( @@ -973,8 +975,8 @@ f1 decimal (0,0) zerofill not null default 0); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `f0` decimal(30,30) unsigned zerofill NOT NULL DEFAULT '0.000000000000000000000000000000', - `f1` decimal(10,0) unsigned zerofill NOT NULL DEFAULT '0000000000' + `f0` decimal(30,30) unsigned zerofill NOT NULL DEFAULT 0.000000000000000000000000000000, + `f1` decimal(10,0) unsigned zerofill NOT NULL DEFAULT 0000000000 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; drop procedure if exists wg2; @@ -1481,11 +1483,11 @@ CAST(1 AS decimal(65,10)) 1.0000000000 SELECT CAST(1 AS decimal(66,10)); ERROR 42000: Too big precision 66 specified for '1'. Maximum is 65. -SELECT CAST(1 AS decimal(65,30)); -CAST(1 AS decimal(65,30)) -1.000000000000000000000000000000 -SELECT CAST(1 AS decimal(65,31)); -ERROR 42000: Too big scale 31 specified for '1'. Maximum is 30. +SELECT CAST(1 AS decimal(65,38)); +CAST(1 AS decimal(65,38)) +1.00000000000000000000000000000000000000 +SELECT CAST(1 AS decimal(65,39)); +ERROR 42000: Too big scale 39 specified for '1'. Maximum is 38. CREATE TABLE t1 (a int DEFAULT NULL, b int DEFAULT NULL); INSERT INTO t1 VALUES (3,30), (1,10), (2,10); SELECT a+CAST(1 AS decimal(65,30)) AS aa, SUM(b) FROM t1 GROUP BY aa; @@ -1493,8 +1495,8 @@ aa SUM(b) 2.000000000000000000000000000000 10 3.000000000000000000000000000000 10 4.000000000000000000000000000000 30 -SELECT a+CAST(1 AS decimal(65,31)) AS aa, SUM(b) FROM t1 GROUP BY aa; -ERROR 42000: Too big scale 31 specified for '1'. Maximum is 30. +SELECT a+CAST(1 AS decimal(65,49)) AS aa, SUM(b) FROM t1 GROUP BY aa; +ERROR 42000: Too big scale 49 specified for '1'. Maximum is 38. DROP TABLE t1; CREATE TABLE t1 (a int DEFAULT NULL, b int DEFAULT NULL); INSERT INTO t1 VALUES (3,30), (1,10), (2,10); @@ -1504,31 +1506,31 @@ SELECT 1 FROM t1 GROUP BY @b := @a, @b; 1 1 DROP TABLE t1; -CREATE TABLE t1 SELECT 0.123456789012345678901234567890123456 AS f1; +CREATE TABLE t1 SELECT 0.1234567890123456789012345678901234567890123456789 AS f1; Warnings: Note 1265 Data truncated for column 'f1' at row 1 DESC t1; Field Type Null Key Default Extra -f1 decimal(31,30) NO NULL +f1 decimal(39,38) NO NULL SELECT f1 FROM t1; f1 -0.123456789012345678901234567890 +0.12345678901234567890123456789012345679 DROP TABLE t1; CREATE TABLE t1 SELECT 123451234512345123451234512345123451234512345.678906789067890678906789067890678906789067890 AS f1; Warnings: Warning 1264 Out of range value for column 'f1' at row 1 DESC t1; Field Type Null Key Default Extra -f1 decimal(65,30) NO NULL +f1 decimal(65,36) NO NULL SELECT f1 FROM t1; f1 -99999999999999999999999999999999999.999999999999999999999999999999 +99999999999999999999999999999.999999999999999999999999999999999999 DROP TABLE t1; select (1.20396873 * 0.89550000 * 0.68000000 * 1.08721696 * 0.99500000 * 1.01500000 * 1.01500000 * 0.99500000); (1.20396873 * 0.89550000 * 0.68000000 * 1.08721696 * 0.99500000 * 1.01500000 * 1.01500000 * 0.99500000) -0.812988073953673124592306939480 +0.81298807395367312459230693948000000000 create table t1 as select 5.05 / 0.014; Warnings: Note 1265 Data truncated for column '5.05 / 0.014' at row 1 @@ -1623,30 +1625,30 @@ Warnings: Note 1265 Data truncated for column 'my_col' at row 1 DESCRIBE t1; Field Type Null Key Default Extra -my_col decimal(30,30) NO NULL +my_col decimal(38,38) NO NULL SELECT my_col FROM t1; my_col -0.123456789123456789123456789123 +0.12345678912345678912345678912345678912 DROP TABLE t1; CREATE TABLE t1 SELECT 1 + .123456789123456789123456789123456789123456789123456789123456789123456789123456789 AS my_col; Warnings: Note 1265 Data truncated for column 'my_col' at row 1 DESCRIBE t1; Field Type Null Key Default Extra -my_col decimal(65,30) NO NULL +my_col decimal(65,38) NO NULL SELECT my_col FROM t1; my_col -1.123456789123456789123456789123 +1.12345678912345678912345678912345678912 DROP TABLE t1; CREATE TABLE t1 SELECT 1 * .123456789123456789123456789123456789123456789123456789123456789123456789123456789 AS my_col; Warnings: Note 1265 Data truncated for column 'my_col' at row 1 DESCRIBE t1; Field Type Null Key Default Extra -my_col decimal(65,30) NO NULL +my_col decimal(65,38) NO NULL SELECT my_col FROM t1; my_col -0.123456789123456789123456789123 +0.12345678912345678912345678912345678912 DROP TABLE t1; CREATE TABLE t1 SELECT 1 / .123456789123456789123456789123456789123456789123456789123456789123456789123456789 AS my_col; Warnings: @@ -1663,10 +1665,10 @@ Warnings: Note 1265 Data truncated for column 'my_col' at row 1 DESCRIBE t1; Field Type Null Key Default Extra -my_col decimal(65,30) YES NULL +my_col decimal(65,38) YES NULL SELECT my_col FROM t1; my_col -0.012345687012345687012345687012 +0.01234568701234568701234568701234568701 DROP TABLE t1; # # Bug#45261: Crash, stored procedure + decimal @@ -1727,30 +1729,30 @@ Warnings: Warning 1264 Out of range value for column 'c1' at row 1 DESC t1; Field Type Null Key Default Extra -c1 decimal(65,30) NO NULL +c1 decimal(65,36) NO NULL SELECT * FROM t1; c1 -99999999999999999999999999999999999.999999999999999999999999999999 +99999999999999999999999999999.999999999999999999999999999999999999 DROP TABLE t1; CREATE TABLE t1 SELECT /* 1 */ 1.10000000000000000000000000000000000000000000000000000000000000000000000000000001 /* 80 */ AS c1; DESC t1; Field Type Null Key Default Extra -c1 decimal(31,30) NO NULL +c1 decimal(39,38) NO NULL SELECT * FROM t1; c1 -1.100000000000000000000000000000 +1.10000000000000000000000000000000000000 DROP TABLE t1; CREATE TABLE t1 SELECT /* 1 */ 1.100000000000000000000000000000000000000000000000000000000000000000000000000000001 /* 81 */ AS c1; DESC t1; Field Type Null Key Default Extra -c1 decimal(31,30) NO NULL +c1 decimal(39,38) NO NULL SELECT * FROM t1; c1 -1.100000000000000000000000000000 +1.10000000000000000000000000000000000000 DROP TABLE t1; CREATE TABLE t1 SELECT .100000000000000000000000000000000000000000000000000000000000000000000000000000001 /* 81 */ @@ -1759,10 +1761,10 @@ Warnings: Note 1265 Data truncated for column 'c1' at row 1 DESC t1; Field Type Null Key Default Extra -c1 decimal(30,30) NO NULL +c1 decimal(38,38) NO NULL SELECT * FROM t1; c1 -0.100000000000000000000000000000 +0.10000000000000000000000000000000000000 DROP TABLE t1; CREATE TABLE t1 SELECT /* 45 */ 123456789012345678901234567890123456789012345.123456789012345678901234567890123456789012345 /* 45 */ @@ -1771,10 +1773,10 @@ Warnings: Warning 1264 Out of range value for column 'c1' at row 1 DESC t1; Field Type Null Key Default Extra -c1 decimal(65,30) NO NULL +c1 decimal(65,36) NO NULL SELECT * FROM t1; c1 -99999999999999999999999999999999999.999999999999999999999999999999 +99999999999999999999999999999.999999999999999999999999999999999999 DROP TABLE t1; CREATE TABLE t1 SELECT /* 65 */ 12345678901234567890123456789012345678901234567890123456789012345.1 /* 1 */ @@ -1807,20 +1809,18 @@ Warnings: Note 1265 Data truncated for column 'c1' at row 1 DESC t1; Field Type Null Key Default Extra -c1 decimal(30,30) NO NULL +c1 decimal(38,38) NO NULL SELECT * FROM t1; c1 -0.123456789012345678901234567890 +0.12345678901234567890123456789012345679 DROP TABLE t1; CREATE TABLE t1 AS SELECT 123.1234567890123456789012345678901 /* 31 */ AS c1; -Warnings: -Note 1265 Data truncated for column 'c1' at row 1 DESC t1; Field Type Null Key Default Extra -c1 decimal(33,30) NO NULL +c1 decimal(34,31) NO NULL SELECT * FROM t1; c1 -123.123456789012345678901234567890 +123.1234567890123456789012345678901 DROP TABLE t1; CREATE TABLE t1 SELECT 1.1 + CAST(1 AS DECIMAL(65,30)) AS c1; DESC t1; @@ -1836,22 +1836,20 @@ DROP TABLE t1; CREATE TABLE t1 (a DECIMAL(30,30)); INSERT INTO t1 VALUES (0.1),(0.2),(0.3); CREATE TABLE t2 SELECT MIN(a + 0.0000000000000000000000000000001) AS c1 FROM t1; -Warnings: -Note 1265 Data truncated for column 'c1' at row 4 DESC t2; Field Type Null Key Default Extra -c1 decimal(33,30) YES NULL +c1 decimal(33,31) YES NULL DROP TABLE t1,t2; CREATE TABLE t1 (a DECIMAL(30,30)); INSERT INTO t1 VALUES (0.1),(0.2),(0.3); -CREATE TABLE t2 SELECT IFNULL(a + 0.0000000000000000000000000000001, NULL) AS c1 FROM t1; +CREATE TABLE t2 SELECT IFNULL(a + 0.00000000000000000000000000000000000000000000000001, NULL) AS c1 FROM t1; Warnings: Note 1265 Data truncated for column 'c1' at row 1 Note 1265 Data truncated for column 'c1' at row 2 Note 1265 Data truncated for column 'c1' at row 3 DESC t2; Field Type Null Key Default Extra -c1 decimal(33,30) YES NULL +c1 decimal(52,38) YES NULL DROP TABLE t1,t2; CREATE TABLE t1 (a DECIMAL(30,30)); INSERT INTO t1 VALUES (0.1),(0.2),(0.3); @@ -1860,7 +1858,7 @@ Warnings: Note 1265 Data truncated for column 'c1' at row 1 DESC t2; Field Type Null Key Default Extra -c1 decimal(65,30) YES NULL +c1 decimal(65,38) YES NULL DROP TABLE t1,t2; # # Test that variables get maximum precision. @@ -1869,10 +1867,10 @@ SET @decimal= 1.1; CREATE TABLE t1 SELECT @decimal AS c1; DESC t1; Field Type Null Key Default Extra -c1 decimal(65,30) YES NULL +c1 decimal(65,38) YES NULL SELECT * FROM t1; c1 -1.100000000000000000000000000000 +1.10000000000000000000000000000000000000 DROP TABLE t1; # # Bug #45261 : Crash, stored procedure + decimal @@ -1990,7 +1988,7 @@ d1 * d2 DROP TABLE t1; select 0.000000000000000000000000000000000000000000000000001 mod 1; 0.000000000000000000000000000000000000000000000000001 mod 1 -0.000000000000000000000000000000 +0.00000000000000000000000000000000000000 select 0.0000000001 mod 1; 0.0000000001 mod 1 0.0000000001 @@ -2151,5 +2149,120 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref a a 6 const 1 Using where; Using index; Using filesort DROP TABLE t1; # +# MDEV-8502 DECIMAL accepts out of range DEFAULT values +# +CREATE TABLE t1 (a DECIMAL(2,1) DEFAULT 10000); +ERROR 42000: Invalid default value for 'a' +CREATE TABLE t1 (a DECIMAL(2,1) DEFAULT 10000.0); +ERROR 42000: Invalid default value for 'a' +CREATE TABLE t1 (a DECIMAL(2,1) DEFAULT 10000e0); +ERROR 42000: Invalid default value for 'a' +CREATE TABLE t1 (a DECIMAL(2,1) DEFAULT '10000.0'); +ERROR 42000: Invalid default value for 'a' +CREATE TABLE t1 (a DECIMAL(2,1) DEFAULT '10000.1'); +ERROR 42000: Invalid default value for 'a' +# +# MDEV-10277 Redundant NOTE when inserting '0.00001 ' into a DECIMAL(2,1) column +# +CREATE TABLE t1 (a DECIMAL(2,1)); +INSERT INTO t1 VALUES ('0.00001 '); +Warnings: +Note 1265 Data truncated for column 'a' at row 1 +INSERT INTO t1 VALUES ('1e-10000 '); +Warnings: +Note 1265 Data truncated for column 'a' at row 1 +INSERT INTO t1 VALUES ('0.1 '); +Warnings: +Note 1265 Data truncated for column 'a' at row 1 +INSERT INTO t1 VALUES ('0.111 '); +Warnings: +Note 1265 Data truncated for column 'a' at row 1 +SELECT * FROM t1; +a +0.0 +0.0 +0.1 +0.1 +DROP TABLE t1; +CREATE TABLE t1 (a DECIMAL(2,1) DEFAULT '1e-10000'); +Warnings: +Note 1265 Data truncated for column 'a' at row 1 +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` decimal(2,1) DEFAULT 0.0 +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a DECIMAL(2,1) DEFAULT '0.1 '); +Warnings: +Note 1265 Data truncated for column 'a' at row 1 +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` decimal(2,1) DEFAULT 0.1 +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a DECIMAL(2,1) DEFAULT '0.10001 '); +Warnings: +Note 1265 Data truncated for column 'a' at row 1 +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` decimal(2,1) DEFAULT 0.1 +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a DECIMAL(2,1) DEFAULT '0.10001'); +Warnings: +Note 1265 Data truncated for column 'a' at row 1 +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` decimal(2,1) DEFAULT 0.1 +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a DECIMAL(2,1) DEFAULT 0.10001); +Warnings: +Note 1265 Data truncated for column 'a' at row 1 +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` decimal(2,1) DEFAULT 0.1 +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a DECIMAL(2,1) DEFAULT 0.10001e0); +Warnings: +Note 1265 Data truncated for column 'a' at row 1 +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` decimal(2,1) DEFAULT 0.1 +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +# # End of 10.1 tests # +# +# Test CREATE .. SELECT + +create or replace table t1 as select 1.000000000000000000000000000000000 as a; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` decimal(34,33) NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +create or replace table t1 as select 1.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 as a; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` decimal(39,38) NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +create or replace table t1 as select 1.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 as a; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` decimal(39,38) NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +# +# End of 10.2 tests +# diff --git a/mysql-test/r/type_ranges.result b/mysql-test/r/type_ranges.result index c998c28ebd9..9984d6dddff 100644 --- a/mysql-test/r/type_ranges.result +++ b/mysql-test/r/type_ranges.result @@ -38,9 +38,6 @@ KEY (ulong), KEY (ulonglong,ulong), KEY (options,flags) ); -Warnings: -Warning 1101 BLOB/TEXT column 'mediumblob_col' can't have a default value -Warning 1101 BLOB/TEXT column 'longblob_col' can't have a default value show full fields from t1; Field Type Collation Null Key Default Extra Privileges Comment auto int(5) unsigned NULL NO PRI NULL auto_increment # @@ -63,8 +60,8 @@ time_field time NULL YES NULL # date_time datetime NULL YES NULL # blob_col blob NULL YES NULL # tinyblob_col tinyblob NULL YES NULL # -mediumblob_col mediumblob NULL NO NULL # -longblob_col longblob NULL NO NULL # +mediumblob_col mediumblob NULL NO '' # +longblob_col longblob NULL NO '' # options enum('one','two','tree') latin1_swedish_ci NO MUL NULL # flags set('one','two','tree') latin1_swedish_ci NO # show keys from t1; @@ -129,9 +126,6 @@ Warning 1264 Out of range value for column 'ushort' at row 1 Warning 1264 Out of range value for column 'umedium' at row 1 Warning 1265 Data truncated for column 'options' at row 1 insert into t1 (tiny) values (1); -Warnings: -Warning 1364 Field 'mediumblob_col' doesn't have a default value -Warning 1364 Field 'longblob_col' doesn't have a default value select auto,string,tiny,short,medium,long_int,longlong,real_float,real_double,utiny,ushort,umedium,ulong,ulonglong,mod(floor(time_stamp/1000000),1000000)-mod(curdate(),1000000),date_field,time_field,date_time,blob_col,tinyblob_col,mediumblob_col,longblob_col from t1; auto string tiny short medium long_int longlong real_float real_double utiny ushort umedium ulong ulonglong mod(floor(time_stamp/1000000),1000000)-mod(curdate(),1000000) date_field time_field date_time blob_col tinyblob_col mediumblob_col longblob_col 10 1 1 1 1 1 1 1.0 1.0000 1 00001 1 1 1 0 0000-00-00 00:00:00 0000-00-00 00:00:00 1 1 1 1 @@ -238,7 +232,7 @@ time_field time NULL YES NULL # date_time datetime NULL YES NULL # new_blob_col varchar(20) latin1_swedish_ci YES NULL # tinyblob_col tinyblob NULL YES NULL # -mediumblob_col mediumblob NULL NO NULL # +mediumblob_col mediumblob NULL NO '' # options enum('one','two','tree') latin1_swedish_ci NO MUL NULL # flags set('one','two','tree') latin1_swedish_ci NO # new_field char(10) latin1_swedish_ci NO new # @@ -264,7 +258,7 @@ time_field time NULL YES NULL # date_time datetime NULL YES NULL # new_blob_col varchar(20) latin1_swedish_ci YES NULL # tinyblob_col tinyblob NULL YES NULL # -mediumblob_col mediumblob NULL NO NULL # +mediumblob_col mediumblob NULL NO '' # options enum('one','two','tree') latin1_swedish_ci NO NULL # flags set('one','two','tree') latin1_swedish_ci NO # new_field char(10) latin1_swedish_ci NO new # diff --git a/mysql-test/r/type_timestamp.result b/mysql-test/r/type_timestamp.result index a579f6930a0..69c9f68811d 100644 --- a/mysql-test/r/type_timestamp.result +++ b/mysql-test/r/type_timestamp.result @@ -644,6 +644,15 @@ SELECT MAX(dt) = '2011-01-06 12:34:30' FROM t1; MAX(dt) = '2011-01-06 12:34:30' 1 DROP TABLE t1; +# +# MDEV-9413 "datetime >= coalesce(c1(NULL))" doesn't return expected NULL +# +CREATE TABLE t1(c1 TIMESTAMP(6) NULL DEFAULT NULL); +INSERT INTO t1 VALUES(NULL); +SELECT c1, '2016-06-13 20:00:00.000003' >= COALESCE( c1 ) FROM t1; +c1 '2016-06-13 20:00:00.000003' >= COALESCE( c1 ) +NULL NULL +DROP TABLE t1; End of 5.5 tests # # MDEV-7254: Assigned expression is evaluated twice when updating column TIMESTAMP NOT NULL diff --git a/mysql-test/r/type_timestamp_hires.result b/mysql-test/r/type_timestamp_hires.result index 573ebbeb709..3b88454ba00 100644 --- a/mysql-test/r/type_timestamp_hires.result +++ b/mysql-test/r/type_timestamp_hires.result @@ -272,23 +272,64 @@ select * from t1; a 2011-01-01 01:01:01.12345 drop table t1; -create table t1 (a timestamp(5) default current_timestamp); -drop table t1; -create table t1 (a timestamp(5) default current_timestamp()); -drop table t1; -create table t1 (a timestamp(5) default current_timestamp(2)); -ERROR 42000: Invalid default value for 'a' -create table t1 (a timestamp(5) default current_timestamp(5)); -drop table t1; -create table t1 (a timestamp(5) default current_timestamp(6)); -drop table t1; -create table t1 (a timestamp(5) on update current_timestamp); -drop table t1; -create table t1 (a timestamp(5) on update current_timestamp()); -drop table t1; -create table t1 (a timestamp(5) on update current_timestamp(3)); +create or replace table t1 (a timestamp(5) default current_timestamp); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` timestamp(5) NOT NULL DEFAULT CURRENT_TIMESTAMP(5) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +create or replace table t1 (a timestamp(5) default current_timestamp()); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` timestamp(5) NOT NULL DEFAULT CURRENT_TIMESTAMP(5) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +create or replace table t1 (a timestamp(5) default current_timestamp(2)); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` timestamp(5) NOT NULL DEFAULT current_timestamp(2) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert t1 () values (); +select * from t1; +a +2011-01-01 01:01:01.12000 +create or replace table t1 (a timestamp(5) default current_timestamp(5)); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` timestamp(5) NOT NULL DEFAULT CURRENT_TIMESTAMP(5) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +create or replace table t1 (a timestamp(5) default current_timestamp(6)); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` timestamp(5) NOT NULL DEFAULT CURRENT_TIMESTAMP(5) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +create or replace table t1 (a timestamp(5) on update current_timestamp); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` timestamp(5) NOT NULL DEFAULT '0000-00-00 00:00:00.00000' ON UPDATE CURRENT_TIMESTAMP(5) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +create or replace table t1 (a timestamp(5) on update current_timestamp()); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` timestamp(5) NOT NULL DEFAULT '0000-00-00 00:00:00.00000' ON UPDATE CURRENT_TIMESTAMP(5) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +create or replace table t1 (a timestamp(5) on update current_timestamp(3)); ERROR HY000: Invalid ON UPDATE clause for 'a' column -create table t1 (a timestamp(5) on update current_timestamp(5)); -drop table t1; -create table t1 (a timestamp(5) on update current_timestamp(6)); +create or replace table t1 (a timestamp(5) on update current_timestamp(5)); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` timestamp(5) NOT NULL DEFAULT '0000-00-00 00:00:00.00000' ON UPDATE CURRENT_TIMESTAMP(5) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +create or replace table t1 (a timestamp(5) on update current_timestamp(6)); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` timestamp(5) NOT NULL DEFAULT '0000-00-00 00:00:00.00000' ON UPDATE CURRENT_TIMESTAMP(5) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; diff --git a/mysql-test/r/type_varchar.result b/mysql-test/r/type_varchar.result index e15b029e9c6..110c07c37a9 100644 --- a/mysql-test/r/type_varchar.result +++ b/mysql-test/r/type_varchar.result @@ -7,7 +7,7 @@ t1 CREATE TABLE `t1` ( `v` varchar(30) DEFAULT NULL, `c` char(3) DEFAULT NULL, `e` enum('abc','def','ghi') DEFAULT NULL, - `t` text + `t` text DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 show create table vchar; Table Create Table @@ -15,7 +15,7 @@ vchar CREATE TABLE `vchar` ( `v` varchar(30) DEFAULT NULL, `c` char(3) DEFAULT NULL, `e` enum('abc','def','ghi') DEFAULT NULL, - `t` text + `t` text DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('abc', 'de', 'ghi', 'jkl'); insert into t1 values ('abc ', 'de ', 'ghi', 'jkl '); @@ -40,7 +40,7 @@ vchar CREATE TABLE `vchar` ( `v` varchar(30) DEFAULT NULL, `c` char(3) DEFAULT NULL, `e` enum('abc','def','ghi') DEFAULT NULL, - `t` text, + `t` text DEFAULT NULL, `i` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 select length(v),length(c),length(e),length(t) from vchar; @@ -411,7 +411,7 @@ alter table t1 modify f1 tinytext; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `f1` tinytext, + `f1` tinytext DEFAULT NULL, KEY `index1` (`f1`(10)) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; diff --git a/mysql-test/r/type_year.result b/mysql-test/r/type_year.result index 4d28a7b8d25..5d4aa24c9c6 100644 --- a/mysql-test/r/type_year.result +++ b/mysql-test/r/type_year.result @@ -387,6 +387,7 @@ a 00 select a from t1 where a=(select 2000 from dual where 1); a +00 select a from t1 where a=y2k(); a 00 diff --git a/mysql-test/r/udf.result b/mysql-test/r/udf.result index bcfc9941db9..dc9806bb7d1 100644 --- a/mysql-test/r/udf.result +++ b/mysql-test/r/udf.result @@ -445,3 +445,23 @@ DROP FUNCTION myfunc_double; DROP TABLE t1; # End of 5.1 tests. +# +# MDEV-10134 Add full support for DEFAULT +# +CREATE FUNCTION metaphon RETURNS STRING SONAME "UDF_EXAMPLE_LIB"; +SELECT METAPHON('Hello'); +METAPHON('Hello') +HL +CREATE TABLE t1 (a VARCHAR(10), b VARCHAR(10) DEFAULT METAPHON(a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL, + `b` varchar(10) DEFAULT METAPHON(a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (a) VALUES ('Hello'); +SELECT * FROM t1; +a b +Hello HL +DROP FUNCTION METAPHON; +DROP TABLE t1; diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result index 74eb3e069df..a692af93b37 100644 --- a/mysql-test/r/union.result +++ b/mysql-test/r/union.result @@ -629,7 +629,7 @@ a show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` decimal(3,1) NOT NULL DEFAULT '0.0' + `a` decimal(3,1) NOT NULL DEFAULT 0.0 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t2 (it1 tinyint, it2 tinyint not null, i int not null, ib bigint, f float, d double, y year, da date, dt datetime, sc char(10), sv varchar(10), b blob, tx text); @@ -653,7 +653,7 @@ it2 show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `it2` int(11) NOT NULL DEFAULT '0' + `it2` int(11) NOT NULL DEFAULT 0 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 SELECT i from t2 UNION select f from t2; @@ -796,7 +796,7 @@ tetetetetest show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `dt` blob + `dt` blob DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 SELECT sv from t2 UNION select b from t2; @@ -807,7 +807,7 @@ tetetetetest show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `sv` blob + `sv` blob DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 SELECT i from t2 UNION select d from t2 UNION select b from t2; @@ -819,7 +819,7 @@ tetetetetest show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `i` blob + `i` blob DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 SELECT sv from t2 UNION select tx from t2; @@ -830,7 +830,7 @@ teeeeeeeeeeeest show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `sv` text + `sv` text DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 SELECT b from t2 UNION select tx from t2; @@ -841,7 +841,7 @@ teeeeeeeeeeeest show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `b` blob + `b` blob DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1,t2; create table t1 select 1 union select -1; @@ -852,7 +852,7 @@ select * from t1; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `1` bigint(20) NOT NULL DEFAULT '0' + `1` bigint(20) NOT NULL DEFAULT 0 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 select _latin1"test" union select _latin2"testt" ; @@ -1354,7 +1354,7 @@ create table t3 SELECT left(a,100000000) FROM t1 UNION SELECT b FROM t2; show create table t3; Table Create Table t3 CREATE TABLE `t3` ( - `left(a,100000000)` mediumtext + `left(a,100000000)` mediumtext DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop tables t1,t2,t3; CREATE TABLE t1 (a longtext); @@ -1368,7 +1368,7 @@ create table t3 SELECT left(a,100000000) FROM t1 UNION SELECT b FROM t2; show create table t3; Table Create Table t3 CREATE TABLE `t3` ( - `left(a,100000000)` longtext + `left(a,100000000)` longtext DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop tables t1,t2,t3; SELECT @tmp_max:= @@global.max_allowed_packet; @@ -1385,7 +1385,7 @@ CREATE TABLE t3 SELECT REPEAT(a,20000000) AS a FROM t1 UNION SELECT b FROM t2; SHOW CREATE TABLE t3; Table Create Table t3 CREATE TABLE `t3` ( - `a` longtext + `a` longtext DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLES t1,t3; CREATE TABLE t1 (a tinytext); @@ -1403,7 +1403,7 @@ CREATE TABLE t3 SELECT REPEAT(a,2) AS a FROM t1 UNION SELECT b FROM t2; SHOW CREATE TABLE t3; Table Create Table t3 CREATE TABLE `t3` ( - `a` longtext + `a` longtext DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLES t1,t3; CREATE TABLE t1 (a tinyblob); @@ -1448,8 +1448,8 @@ t2 CREATE TABLE `t2` ( `f4` binary(5) DEFAULT NULL, `f5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `f6` varchar(1) CHARACTER SET utf8 DEFAULT NULL, - `f7` text, - `f8` mediumtext CHARACTER SET utf8 + `f7` text DEFAULT NULL, + `f8` mediumtext CHARACTER SET utf8 DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1, t2; (select avg(1)) union (select avg(1)) union (select avg(1)) union diff --git a/mysql-test/r/user_var-binlog.result b/mysql-test/r/user_var-binlog.result index 2e1eb15cad4..9f4762776a6 100644 --- a/mysql-test/r/user_var-binlog.result +++ b/mysql-test/r/user_var-binlog.result @@ -29,7 +29,7 @@ SET @`a b`:=_latin1 X'68656C6C6F' COLLATE `latin1_swedish_ci`/*!*/; use `test`/*!*/; SET TIMESTAMP=10000/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=1342177280/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; diff --git a/mysql-test/r/user_var.result b/mysql-test/r/user_var.result index 178f9fb7db4..e01d4f1a54b 100644 --- a/mysql-test/r/user_var.result +++ b/mysql-test/r/user_var.result @@ -219,7 +219,7 @@ create table t1 select @first_var; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `@first_var` longblob + `@first_var` longblob DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; set @first_var= cast(NULL as signed integer); @@ -243,7 +243,7 @@ create table t1 select @first_var; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `@first_var` longblob + `@first_var` longblob DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; set @first_var=1; @@ -252,7 +252,7 @@ create table t1 select @first_var; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `@first_var` longtext + `@first_var` longtext DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; set @a=18446744071710965857; diff --git a/mysql-test/r/userstat.result b/mysql-test/r/userstat.result index 351f69f3031..a56ff5771f6 100644 --- a/mysql-test/r/userstat.result +++ b/mysql-test/r/userstat.result @@ -138,16 +138,12 @@ disconnect ssl_con; set @@global.userstat=0; select * from information_schema.index_statistics; TABLE_SCHEMA TABLE_NAME INDEX_NAME ROWS_READ -test t1 PRIMARY 2 select * from information_schema.table_statistics; TABLE_SCHEMA TABLE_NAME ROWS_READ ROWS_CHANGED ROWS_CHANGED_X_INDEXES -test t1 6 13 13 show table_statistics; Table_schema Table_name Rows_read Rows_changed Rows_changed_x_#indexes -test t1 6 13 13 show index_statistics; Table_schema Table_name Index_name Rows_read -test t1 PRIMARY 2 select TOTAL_CONNECTIONS, TOTAL_SSL_CONNECTIONS, CONCURRENT_CONNECTIONS, ROWS_READ, ROWS_SENT, ROWS_DELETED, ROWS_INSERTED, ROWS_UPDATED, SELECT_COMMANDS, UPDATE_COMMANDS, OTHER_COMMANDS, COMMIT_TRANSACTIONS, ROLLBACK_TRANSACTIONS, DENIED_CONNECTIONS, LOST_CONNECTIONS, ACCESS_DENIED, EMPTY_QUERIES from information_schema.client_statistics;; TOTAL_CONNECTIONS 2 TOTAL_SSL_CONNECTIONS 1 diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index a38cf57189c..b78b3caa58d 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -731,8 +731,8 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` bigint(20) DEFAULT NULL, - `c2` decimal(65,30) DEFAULT NULL, - `c3` longtext, + `c2` decimal(65,38) DEFAULT NULL, + `c3` longtext DEFAULT NULL, `c4` double DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; @@ -1445,7 +1445,7 @@ Warnings: Warning 1292 Truncated incorrect auto_increment_offset value: '0' select @@default_storage_engine; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def @@default_storage_engine 253 6 6 Y 0 31 8 +def @@default_storage_engine 253 6 6 Y 0 39 8 @@default_storage_engine MyISAM SET @old_server_id = @@GLOBAL.server_id; @@ -1466,15 +1466,17 @@ SELECT @@GLOBAL.server_id; @@GLOBAL.server_id 4294967295 SET GLOBAL server_id = 0; +Warnings: +Warning 1292 Truncated incorrect server_id value: '0' SELECT @@GLOBAL.server_id; @@GLOBAL.server_id -0 +1 SET GLOBAL server_id = -1; Warnings: Warning 1292 Truncated incorrect server_id value: '-1' SELECT @@GLOBAL.server_id; @@GLOBAL.server_id -0 +1 SET GLOBAL server_id = @old_server_id; # # BUG#10206 - InnoDB: Transaction requiring Max_BinLog_Cache_size > 4GB always rollsback diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index ca1a1dfa48a..8ab215fd99a 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -253,7 +253,7 @@ drop view v1; drop table t1; create table t1 (a int); create view v1 as select distinct a from t1 WITH CHECK OPTION; -ERROR HY000: CHECK OPTION on non-updatable view 'test.v1' +ERROR HY000: CHECK OPTION on non-updatable view `test`.`v1` create view v1 as select a from t1 WITH CHECK OPTION; create view v2 as select a from t1 WITH CASCADED CHECK OPTION; create view v3 as select a from t1 WITH LOCAL CHECK OPTION; @@ -930,7 +930,7 @@ create table t1 (a int); create view v1 as select a from t1 procedure analyse(); ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'procedure analyse()' at line 1 create view v1 as select 1 from (select 1) as d1; -ERROR HY000: View's SELECT contains a subquery in the FROM clause +drop view v1; drop table t1; create table t1 (s1 int, primary key (s1)); create view v1 as select * from t1; @@ -1134,11 +1134,11 @@ create table t1 (a int); create view v1 as select * from t1 where a < 2 with check option; insert into v1 values(1); insert into v1 values(3); -ERROR HY000: CHECK OPTION failed 'test.v1' +ERROR 44000: CHECK OPTION failed `test`.`v1` insert ignore into v1 values (2),(3),(0); Warnings: -Warning 1369 CHECK OPTION failed 'test.v1' -Warning 1369 CHECK OPTION failed 'test.v1' +Warning 1369 CHECK OPTION failed `test`.`v1` +Warning 1369 CHECK OPTION failed `test`.`v1` select * from t1; a 1 @@ -1146,20 +1146,20 @@ a delete from t1; insert into v1 SELECT 1; insert into v1 SELECT 3; -ERROR HY000: CHECK OPTION failed 'test.v1' +ERROR 44000: CHECK OPTION failed `test`.`v1` create table t2 (a int); insert into t2 values (2),(3),(0); insert ignore into v1 SELECT a from t2; Warnings: -Warning 1369 CHECK OPTION failed 'test.v1' -Warning 1369 CHECK OPTION failed 'test.v1' +Warning 1369 CHECK OPTION failed `test`.`v1` +Warning 1369 CHECK OPTION failed `test`.`v1` select * from t1 order by a desc; a 1 0 update v1 set a=-1 where a=0; update v1 set a=2 where a=1; -ERROR HY000: CHECK OPTION failed 'test.v1' +ERROR 44000: CHECK OPTION failed `test`.`v1` select * from t1 order by a desc; a 1 @@ -1174,7 +1174,7 @@ a update v1 set a=a+1; update ignore v1,t2 set v1.a=v1.a+1 where v1.a=t2.a; Warnings: -Warning 1369 CHECK OPTION failed 'test.v1' +Warning 1369 CHECK OPTION failed `test`.`v1` select * from t1; a 1 @@ -1188,12 +1188,12 @@ create view v3 as select * from v1 where a > 0 with cascaded check option; insert into v2 values (1); insert into v3 values (1); insert into v2 values (0); -ERROR HY000: CHECK OPTION failed 'test.v2' +ERROR 44000: CHECK OPTION failed `test`.`v2` insert into v3 values (0); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` insert into v2 values (2); insert into v3 values (2); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` select * from t1; a 1 @@ -1205,10 +1205,10 @@ create table t1 (a int, primary key (a)); create view v1 as select * from t1 where a < 2 with check option; insert into v1 values (1) on duplicate key update a=2; insert into v1 values (1) on duplicate key update a=2; -ERROR HY000: CHECK OPTION failed 'test.v1' +ERROR 44000: CHECK OPTION failed `test`.`v1` insert ignore into v1 values (1) on duplicate key update a=2; Warnings: -Warning 1369 CHECK OPTION failed 'test.v1' +Warning 1369 CHECK OPTION failed `test`.`v1` select * from t1; a 1 @@ -1263,7 +1263,7 @@ s1 alter view v2 as select * from t2 where s1 in (select s1 from t1) with check option; insert into v2 values (5); update v2 set s1 = 1; -ERROR HY000: CHECK OPTION failed 'test.v2' +ERROR 44000: CHECK OPTION failed `test`.`v2` insert into t1 values (1); update v2 set s1 = 1; select * from v2; @@ -1300,16 +1300,16 @@ create table t1 (s1 tinyint); create view v1 as select * from t1 where s1 <> 0 with local check option; create view v2 as select * from v1 with cascaded check option; insert into v2 values (0); -ERROR HY000: CHECK OPTION failed 'test.v2' +ERROR 44000: CHECK OPTION failed `test`.`v2` drop view v2, v1; drop table t1; create table t1 (s1 int); create view v1 as select * from t1 where s1 < 5 with check option; insert ignore into v1 values (6); -ERROR HY000: CHECK OPTION failed 'test.v1' +ERROR 44000: CHECK OPTION failed `test`.`v1` insert ignore into v1 values (6),(3); Warnings: -Warning 1369 CHECK OPTION failed 'test.v1' +Warning 1369 CHECK OPTION failed `test`.`v1` select * from t1; s1 3 @@ -1319,7 +1319,7 @@ create table t1 (s1 tinyint); create trigger t1_bi before insert on t1 for each row set new.s1 = 500; create view v1 as select * from t1 where s1 <> 127 with check option; insert into v1 values (0); -ERROR HY000: CHECK OPTION failed 'test.v1' +ERROR 44000: CHECK OPTION failed `test`.`v1` select * from v1; s1 select * from t1; @@ -1331,7 +1331,7 @@ create table t1 (s1 tinyint); create view v1 as select * from t1 where s1 <> 0; create view v2 as select * from v1 where s1 <> 1 with cascaded check option; insert into v2 values (0); -ERROR HY000: CHECK OPTION failed 'test.v2' +ERROR 44000: CHECK OPTION failed `test`.`v2` select * from v2; s1 select * from t1; @@ -1341,7 +1341,7 @@ drop table t1; create table t1 (a int, b char(10)); create view v1 as select * from t1 where a != 0 with check option; load data infile '../../std_data/loaddata3.dat' into table v1 fields terminated by '' enclosed by '' ignore 1 lines; -ERROR HY000: CHECK OPTION failed 'test.v1' +ERROR 44000: CHECK OPTION failed `test`.`v1` select * from t1; a b 1 row 1 @@ -1356,10 +1356,10 @@ Warnings: Note 1265 Data truncated for column 'a' at row 1 Note 1265 Data truncated for column 'a' at row 2 Warning 1366 Incorrect integer value: 'error ' for column 'a' at row 3 -Warning 1369 CHECK OPTION failed 'test.v1' +Warning 1369 CHECK OPTION failed `test`.`v1` Note 1265 Data truncated for column 'a' at row 3 Warning 1366 Incorrect integer value: 'wrong end ' for column 'a' at row 4 -Warning 1369 CHECK OPTION failed 'test.v1' +Warning 1369 CHECK OPTION failed `test`.`v1` select * from t1 order by a,b; a b 1 row 1 @@ -1375,7 +1375,7 @@ drop table t1; create table t1 (a text, b text); create view v1 as select * from t1 where a <> 'Field A' with check option; load data infile '../../std_data/loaddata2.dat' into table v1 fields terminated by ',' enclosed by ''''; -ERROR HY000: CHECK OPTION failed 'test.v1' +ERROR 44000: CHECK OPTION failed `test`.`v1` select concat('|',a,'|'), concat('|',b,'|') from t1; concat('|',a,'|') concat('|',b,'|') select concat('|',a,'|'), concat('|',b,'|') from v1; @@ -1383,7 +1383,7 @@ concat('|',a,'|') concat('|',b,'|') delete from t1; load data infile '../../std_data/loaddata2.dat' ignore into table v1 fields terminated by ',' enclosed by ''''; Warnings: -Warning 1369 CHECK OPTION failed 'test.v1' +Warning 1369 CHECK OPTION failed `test`.`v1` Warning 1261 Row 2 doesn't contain data for all columns select concat('|',a,'|'), concat('|',b,'|') from t1; concat('|',a,'|') concat('|',b,'|') @@ -1494,7 +1494,7 @@ a create view v2 (a,b) as select t1.b as a, t2.a as b from t1, t2; set updatable_views_with_limit=NO; update v2 set a= 10 where a=200 limit 1; -ERROR HY000: The target table t1 of the UPDATE is not updatable +ERROR HY000: The target table v2 of the UPDATE is not updatable set updatable_views_with_limit=DEFAULT; select * from v3; a b @@ -3047,9 +3047,9 @@ CREATE VIEW v1 AS SELECT id, val FROM t1 WHERE val >= 1 AND val <= 5 WITH CHECK INSERT INTO v1 (val) VALUES (2); INSERT INTO v1 (val) VALUES (4); INSERT INTO v1 (val) VALUES (6); -ERROR HY000: CHECK OPTION failed 'test.v1' +ERROR 44000: CHECK OPTION failed `test`.`v1` UPDATE v1 SET val=6 WHERE id=2; -ERROR HY000: CHECK OPTION failed 'test.v1' +ERROR 44000: CHECK OPTION failed `test`.`v1` DROP VIEW v1; DROP TABLE t1; DROP VIEW IF EXISTS v1, v2; @@ -3135,7 +3135,7 @@ b 1 2 UPDATE v1 SET b=3; -ERROR HY000: CHECK OPTION failed 'test.v1' +ERROR 44000: CHECK OPTION failed `test`.`v1` SELECT * FROM v1; b 1 @@ -3209,15 +3209,11 @@ code COUNT(DISTINCT country) DROP VIEW v1; DROP TABLE t1; DROP VIEW IF EXISTS v1; -SELECT * FROM (SELECT 1) AS t; -1 -1 -CREATE VIEW v1 AS SELECT * FROM (SELECT 1) AS t; -ERROR HY000: View's SELECT contains a subquery in the FROM clause +SELECT * FROM (SELECT 1) AS t into @w; +CREATE VIEW v1 AS SELECT * FROM (SELECT 1) AS t into @w; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'into @w' at line 1 # Previously the following would fail. -SELECT * FROM (SELECT 1) AS t; -1 -1 +SELECT * FROM (SELECT 1) AS t into @w; drop view if exists view_24532_a; drop view if exists view_24532_b; drop table if exists table_24532; @@ -3471,14 +3467,14 @@ a1 c 1 0 2 0 UPDATE v1 SET c=3; -ERROR HY000: CHECK OPTION failed 'test.v1' +ERROR 44000: CHECK OPTION failed `test`.`v1` PREPARE t FROM 'UPDATE v1 SET c=3'; EXECUTE t; -ERROR HY000: CHECK OPTION failed 'test.v1' +ERROR 44000: CHECK OPTION failed `test`.`v1` EXECUTE t; -ERROR HY000: CHECK OPTION failed 'test.v1' +ERROR 44000: CHECK OPTION failed `test`.`v1` INSERT INTO v1(a1, c) VALUES (3, 3); -ERROR HY000: CHECK OPTION failed 'test.v1' +ERROR 44000: CHECK OPTION failed `test`.`v1` UPDATE v1 SET c=1 WHERE a1=1; SELECT * FROM v1; a1 c @@ -3497,14 +3493,14 @@ a1 c 1 1 2 0 UPDATE v2 SET c=3; -ERROR HY000: CHECK OPTION failed 'test.v2' +ERROR 44000: CHECK OPTION failed `test`.`v2` PREPARE t FROM 'UPDATE v2 SET c=3'; EXECUTE t; -ERROR HY000: CHECK OPTION failed 'test.v2' +ERROR 44000: CHECK OPTION failed `test`.`v2` EXECUTE t; -ERROR HY000: CHECK OPTION failed 'test.v2' +ERROR 44000: CHECK OPTION failed `test`.`v2` INSERT INTO v2(a1, c) VALUES (3, 3); -ERROR HY000: CHECK OPTION failed 'test.v2' +ERROR 44000: CHECK OPTION failed `test`.`v2` UPDATE v2 SET c=2 WHERE a1=1; SELECT * FROM v2; a1 c @@ -4100,7 +4096,7 @@ ERROR HY000: The target table v1 of the INSERT is not insertable-into DELETE from v1; ERROR HY000: The target table v1 of the DELETE is not updatable UPDATE v3 SET b= 10; -ERROR HY000: The target table v2 of the UPDATE is not updatable +ERROR HY000: The target table v3 of the UPDATE is not updatable REPLACE v3 SET b= 10; ERROR HY000: The target table v3 of the INSERT is not insertable-into INSERT into v3(b) values (20); @@ -4408,7 +4404,7 @@ SELECT * FROM v1 WHERE a > -1 OR a > 6 AND a = 3; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 7 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` > (-(1))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` > -1) SELECT * FROM v1 WHERE a > -1 OR a AND a = 0; a 2 @@ -4423,7 +4419,7 @@ SELECT * FROM v1 WHERE a > -1 OR a AND a = 0; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 7 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` > (-(1))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` > -1) CREATE VIEW v2 AS SELECT * FROM v1; SELECT * FROM v2 WHERE a > -1 OR a AND a = 0; a @@ -4439,7 +4435,7 @@ SELECT * FROM v2 WHERE a > -1 OR a AND a = 0; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 7 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` > (-(1))) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` > -1) DROP VIEW v1,v2; DROP TABLE t1; CREATE TABLE t1 (a varchar(10), KEY (a)) ; @@ -4750,13 +4746,13 @@ drop view if exists v_9801; create table t_9801 (s1 int); create view v_9801 as select sum(s1) from t_9801 with check option; -ERROR HY000: CHECK OPTION on non-updatable view 'test.v_9801' +ERROR HY000: CHECK OPTION on non-updatable view `test`.`v_9801` create view v_9801 as select sum(s1) from t_9801 group by s1 with check option; -ERROR HY000: CHECK OPTION on non-updatable view 'test.v_9801' +ERROR HY000: CHECK OPTION on non-updatable view `test`.`v_9801` create view v_9801 as select sum(s1) from t_9801 group by s1 with rollup with check option; -ERROR HY000: CHECK OPTION on non-updatable view 'test.v_9801' +ERROR HY000: CHECK OPTION on non-updatable view `test`.`v_9801` drop table t_9801; # # Bug #47335 assert in get_table_share @@ -5922,6 +5918,57 @@ drop table t1; # # Start of 10.2 tests # +# Checking that SHOW CREATE VIEW preserve parentheses +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (10),(20),(30); +CREATE VIEW v1 AS SELECT 1 AS a UNION SELECT a FROM t1; +SHOW CREATE VIEW v1; +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 1 AS `a` union select `t1`.`a` AS `a` from `t1` latin1 latin1_swedish_ci +SELECT * FROM v1; +a +1 +10 +20 +30 +DROP VIEW v1; +CREATE VIEW v1 AS SELECT 1 AS a UNION SELECT a FROM t1 LIMIT 1; +SHOW CREATE VIEW v1; +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 1 AS `a` union select `t1`.`a` AS `a` from `t1` limit 1 latin1 latin1_swedish_ci +SELECT * FROM v1; +a +1 +DROP VIEW v1; +CREATE VIEW v1 AS SELECT 1 AS a UNION (SELECT a FROM t1); +SHOW CREATE VIEW v1; +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 1 AS `a` union (select `t1`.`a` AS `a` from `t1`) latin1 latin1_swedish_ci +SELECT * FROM v1; +a +1 +10 +20 +30 +DROP VIEW v1; +CREATE VIEW v1 AS SELECT 1 AS a UNION (SELECT a FROM t1 LIMIT 1); +SHOW CREATE VIEW v1; +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 1 AS `a` union (select `t1`.`a` AS `a` from `t1` limit 1) latin1 latin1_swedish_ci +SELECT * FROM v1; +a +1 +10 +DROP VIEW v1; +CREATE VIEW v1 AS SELECT 1 AS a UNION (SELECT a FROM t1) LIMIT 1; +SHOW CREATE VIEW v1; +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 1 AS `a` union (select `t1`.`a` AS `a` from `t1`) limit 1 latin1 latin1_swedish_ci +SELECT * FROM v1; +a +1 +DROP VIEW v1; +DROP TABLE t1; # # MDEV-9408 CREATE TABLE SELECT MAX(int_column) creates different columns for table vs view # @@ -5953,5 +6000,241 @@ t3 CREATE TABLE `t3` ( DROP VIEW v1; DROP TABLE t1,t2,t3; # +# MDEV-3944: Allow derived tables in VIEWS +# +create table t1 (s1 int); +insert into t1 values (1),(2),(3); +CREATE VIEW v1 AS SELECT * FROM (SELECT s1 FROM t1 WHERE s1>1) AS x; +CREATE VIEW v2 AS SELECT * FROM (SELECT s1 FROM t1 WHERE s1<3) AS x; +select * from v1; +s1 +2 +3 +select * from v2; +s1 +1 +2 +select * from v1 natural join v2; +s1 +2 +select * from v1 natural join t1; +s1 +2 +3 +select * from v1 natural join (SELECT s1 FROM t1 WHERE s1<3) as x; +s1 +2 +select * from v1 left join v2 on (v1.s1=v2.s1); +s1 s1 +2 2 +3 NULL +select * from v1 left join t1 on (v1.s1=t1.s1); +s1 s1 +2 2 +3 3 +select * from t1 left join v2 on (t1.s1=v2.s1); +s1 s1 +1 1 +2 2 +3 NULL +select * from v1 left join (SELECT s1 FROM t1 WHERE s1<3) as x on (v1.s1=x.s1); +s1 s1 +2 2 +3 NULL +select * from (SELECT s1 FROM t1 WHERE s1>1) AS x left join v2 on (x.s1=v2.s1); +s1 s1 +2 2 +3 NULL +drop view v1,v2; +CREATE VIEW v1 AS SELECT * FROM (SELECT s1 FROM (SELECT s1 FROM t1 WHERE s1 +< 100) as xx WHERE s1>1) AS x; +CREATE VIEW v2 AS SELECT * FROM (SELECT s1 FROM (SELECT s1 FROM t1 WHERE s1 +> -100) as xx WHERE s1<3) AS x; +insert into t1 values (200),(-200); +select * from t1; +s1 +-200 +1 +2 +200 +3 +select * from v1; +s1 +2 +3 +select * from v2; +s1 +1 +2 +select * from v1 natural join v2; +s1 +2 +select * from v1 natural join t1; +s1 +2 +3 +select * from v1 natural join (SELECT s1 FROM t1 WHERE s1<3) as x; +s1 +2 +select * from v1 left join v2 on (v1.s1=v2.s1); +s1 s1 +2 2 +3 NULL +select * from v1 left join t1 on (v1.s1=t1.s1); +s1 s1 +2 2 +3 3 +select * from t1 left join v2 on (t1.s1=v2.s1); +s1 s1 +-200 NULL +1 1 +2 2 +200 NULL +3 NULL +select * from v1 left join (SELECT s1 FROM t1 WHERE s1<3) as x on (v1.s1=x.s1); +s1 s1 +2 2 +3 NULL +select * from (SELECT s1 FROM t1 WHERE s1>1) AS x left join v2 on (x.s1=v2.s1); +s1 s1 +2 2 +200 NULL +3 NULL +drop view v1,v2; +CREATE algorithm=temptable VIEW v1 AS SELECT * FROM (SELECT s1 FROM (SELECT s1 FROM t1 WHERE s1 +< 100) as xx WHERE s1>1) AS x; +CREATE algorithm=temptable VIEW v2 AS SELECT * FROM (SELECT s1 FROM (SELECT s1 FROM t1 WHERE s1 +> -100) as xx WHERE s1<3) AS x; +select * from t1; +s1 +-200 +1 +2 +200 +3 +select * from v1; +s1 +2 +3 +select * from v2; +s1 +1 +2 +select * from v1 natural join v2; +s1 +2 +select * from v1 natural join t1; +s1 +2 +3 +select * from v1 natural join (SELECT s1 FROM t1 WHERE s1<3) as x; +s1 +2 +select * from v1 left join v2 on (v1.s1=v2.s1); +s1 s1 +2 2 +3 NULL +select * from v1 left join t1 on (v1.s1=t1.s1); +s1 s1 +2 2 +3 3 +select * from t1 left join v2 on (t1.s1=v2.s1); +s1 s1 +-200 NULL +1 1 +2 2 +200 NULL +3 NULL +select * from v1 left join (SELECT s1 FROM t1 WHERE s1<3) as x on (v1.s1=x.s1); +s1 s1 +2 2 +3 NULL +select * from (SELECT s1 FROM t1 WHERE s1>1) AS x left join v2 on (x.s1=v2.s1); +s1 s1 +2 2 +200 NULL +3 NULL +drop view v1,v2; +CREATE VIEW v1 AS SELECT * FROM (SELECT s1 FROM (SELECT s1 FROM t1 WHERE s1 +< 100) as xx WHERE s1>1) AS x; +insert into v1 values (-300); +ERROR HY000: The target table v1 of the INSERT is not insertable-into +update v1 set s1=s1+1; +ERROR HY000: The target table v1 of the UPDATE is not updatable +drop view v1; +CREATE VIEW v1 AS SELECT s1,s2 FROM (SELECT s1 as s2 FROM t1 WHERE s1 < +100) x, t1 WHERE t1.s1=x.s2; +select * from v1; +s1 s2 +1 1 +2 2 +3 3 +-200 -200 +insert into v1 (s1) values (-300); +update v1 set s1=s1+1; +select * from v1; +s1 s2 +2 2 +3 3 +4 4 +-199 -199 +-299 -299 +select * from t1; +s1 +2 +3 +4 +200 +-199 +-299 +insert into v1(s2) values (-300); +ERROR HY000: The target table v1 of the INSERT is not insertable-into +update v1 set s2=s2+1; +ERROR HY000: The target table v1 of the UPDATE is not updatable +drop view v1; +CREATE VIEW v1 AS SELECT * FROM (SELECT s1 FROM t1 WHERE s1 +< 100) AS x; +insert into v1 values (-300); +ERROR HY000: The target table v1 of the INSERT is not insertable-into +update v1 set s1=s1+1; +ERROR HY000: The target table v1 of the UPDATE is not updatable +drop view v1; +CREATE VIEW v1 AS SELECT * FROM (SELECT s1 FROM (SELECT s1 FROM t1 WHERE s1 +< 100) as xx WHERE s1>1) AS x; +insert into v1 values (-300); +ERROR HY000: The target table v1 of the INSERT is not insertable-into +update v1 set s1=s1+1; +ERROR HY000: The target table v1 of the UPDATE is not updatable +create view v2 as select * from v1; +insert into v2 values (-300); +ERROR HY000: The target table v2 of the INSERT is not insertable-into +update v2 set s1=s1+1; +ERROR HY000: The target table v2 of the UPDATE is not updatable +drop view v1, v2; +drop table t1; +# +# MDEV-9671:Wrong result upon select from a view with a FROM subquery +# +CREATE TABLE t1 (i INT); +INSERT INTO t1 VALUES (3),(2); +CREATE TABLE t2 (j INT); +INSERT INTO t2 VALUES (8),(3),(3); +CREATE TABLE t3 (k INT); +INSERT INTO t3 VALUES (1),(8); +CREATE VIEW v1 AS SELECT * FROM t1 LEFT JOIN ( SELECT t2.* FROM t2 INNER JOIN t3 ON ( k = j ) ) AS alias1 ON ( i = j ); +show create view v1; +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `test`.`t1`.`i` AS `i`,`alias1`.`j` AS `j` from (`test`.`t1` left join (select `test`.`t2`.`j` AS `j` from (`test`.`t2` join `test`.`t3` on((`test`.`t3`.`k` = `test`.`t2`.`j`)))) `alias1` on((`test`.`t1`.`i` = `alias1`.`j`))) latin1 latin1_swedish_ci +SELECT * FROM t1 LEFT JOIN ( SELECT t2.* FROM t2 INNER JOIN t3 ON ( k = j ) ) AS alias1 ON ( i = j ); +i j +3 NULL +2 NULL +SELECT * FROM v1; +i j +3 NULL +2 NULL +DROP VIEW v1; +DROP TABLE t1, t2, t3; +# # End of 10.2 tests # diff --git a/mysql-test/r/wait_timeout_not_windows.result b/mysql-test/r/wait_timeout_not_windows.result new file mode 100644 index 00000000000..7b129ce5f12 --- /dev/null +++ b/mysql-test/r/wait_timeout_not_windows.result @@ -0,0 +1,6 @@ +set global log_warnings=2; +connect foo,localhost,root; +set @@wait_timeout=1; +connection default; +FOUND /Aborted.*Got timeout reading communication packets/ in mysqld.1.err +set global log_warnings=@@log_warnings; diff --git a/mysql-test/r/win.result b/mysql-test/r/win.result index a6b43788ffe..ad99453ea1c 100644 --- a/mysql-test/r/win.result +++ b/mysql-test/r/win.result @@ -456,7 +456,7 @@ pk, c, row_number() over (partition by c order by pk range between unbounded preceding and current row) as r from t1; -ERROR HY000: Window frame is not allowed with 'row_number' +ERROR HY000: Window frame is not allowed with 'row_number(' select pk, c, rank() over w1 as r diff --git a/mysql-test/r/xml.result b/mysql-test/r/xml.result index 41dbc744228..23a2f8b62b8 100644 --- a/mysql-test/r/xml.result +++ b/mysql-test/r/xml.result @@ -1276,3 +1276,24 @@ DROP TABLE t1; # # End of 10.0 tests # +# +# Start of 10.2 tests +# +# +# MDEV-10134 Add full support for DEFAULT +# +CREATE TABLE t1 (a TEXT, b TEXT DEFAULT ExtractValue(a, '/a/b')); +INSERT INTO t1 (a) VALUES ('bbb'); +SELECT b FROM t1; +b +bbb +DROP TABLE t1; +CREATE TABLE t1 (a TEXT, b TEXT DEFAULT UpdateXML(a, '/a/b','xxx')); +INSERT INTO t1 (a) VALUES ('bbb'); +SELECT b FROM t1; +b +xxx +DROP TABLE t1; +# +# End of 10.2 tests +# diff --git a/mysql-test/std_data/Index.xml b/mysql-test/std_data/Index.xml index 5139db0554a..b66fdfee55c 100644 --- a/mysql-test/std_data/Index.xml +++ b/mysql-test/std_data/Index.xml @@ -1117,6 +1117,16 @@ + + + \u3400b + a\u3561 + c\u1500 + \u3600\u1501 + \u3700\u3701 + + + diff --git a/storage/tokudb/mysql-test/tokudb_add_index/disabled.def b/mysql-test/std_data/mysql57_virtual.MYD similarity index 100% rename from storage/tokudb/mysql-test/tokudb_add_index/disabled.def rename to mysql-test/std_data/mysql57_virtual.MYD diff --git a/mysql-test/std_data/mysql57_virtual.MYI b/mysql-test/std_data/mysql57_virtual.MYI new file mode 100644 index 00000000000..348ce135656 Binary files /dev/null and b/mysql-test/std_data/mysql57_virtual.MYI differ diff --git a/mysql-test/std_data/mysql57_virtual.frm b/mysql-test/std_data/mysql57_virtual.frm new file mode 100644 index 00000000000..5b7dfb243c5 Binary files /dev/null and b/mysql-test/std_data/mysql57_virtual.frm differ diff --git a/mysql-test/suite/archive/archive.result b/mysql-test/suite/archive/archive.result index 1cbaa0a31ea..603621abf2a 100644 --- a/mysql-test/suite/archive/archive.result +++ b/mysql-test/suite/archive/archive.result @@ -11136,8 +11136,8 @@ SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( `auto` int(11) DEFAULT NULL, - `fld1` int(6) unsigned zerofill NOT NULL DEFAULT '000000', - `companynr` tinyint(2) unsigned zerofill NOT NULL DEFAULT '00', + `fld1` int(6) unsigned zerofill NOT NULL DEFAULT 000000, + `companynr` tinyint(2) unsigned zerofill NOT NULL DEFAULT 00, `fld3` char(30) NOT NULL DEFAULT '', `fld4` char(35) NOT NULL DEFAULT '', `fld5` char(35) NOT NULL DEFAULT '' @@ -12664,7 +12664,7 @@ SHOW CREATE TABLE t6; Table Create Table t6 CREATE TABLE `t6` ( `a` int(11) NOT NULL AUTO_INCREMENT, - `b` tinyblob, + `b` tinyblob DEFAULT NULL, `c` int(11) DEFAULT NULL, KEY `a` (`a`) ) ENGINE=ARCHIVE AUTO_INCREMENT=36 DEFAULT CHARSET=latin1 @@ -12792,10 +12792,10 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` text, + `b` text DEFAULT NULL, `c` varchar(255) DEFAULT NULL, - `d` blob, - `e` blob + `d` blob DEFAULT NULL, + `e` blob DEFAULT NULL ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 SELECT * FROM t1; a b c d e diff --git a/mysql-test/suite/binlog/r/binlog_base64_flag.result b/mysql-test/suite/binlog/r/binlog_base64_flag.result index d13e13c97b0..34b5d2d419c 100644 --- a/mysql-test/suite/binlog/r/binlog_base64_flag.result +++ b/mysql-test/suite/binlog/r/binlog_base64_flag.result @@ -38,7 +38,7 @@ DELIMITER /*!*/; # at 102 <#>use `test`/*!*/; SET TIMESTAMP=1196959712/*!*/; -<#>SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +<#>SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=0/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; diff --git a/mysql-test/suite/binlog/r/binlog_mdev717.result b/mysql-test/suite/binlog/r/binlog_mdev717.result new file mode 100644 index 00000000000..5fe80be651a --- /dev/null +++ b/mysql-test/suite/binlog/r/binlog_mdev717.result @@ -0,0 +1,48 @@ +RESET MASTER; +connect con1,localhost,root; +connection default; +CREATE DATABASE mysqltest; +SET DEBUG_SYNC= "after_wait_locked_schema_name SIGNAL locked WAIT_FOR release"; +DROP DATABASE mysqltest;; +connection con1; +SET DEBUG_SYNC= "now WAIT_FOR locked"; +SET DEBUG_SYNC= "before_wait_locked_pname SIGNAL release"; +CREATE FUNCTION mysqltest.f1() RETURNS INT RETURN 1; +ERROR 42000: Unknown database 'mysqltest' +connection default; +CREATE DATABASE mysqltest; +SET DEBUG_SYNC= "after_wait_locked_schema_name SIGNAL locked WAIT_FOR release"; +DROP DATABASE mysqltest;; +connection con1; +SET DEBUG_SYNC= "now WAIT_FOR locked"; +SET DEBUG_SYNC= "before_wait_locked_pname SIGNAL release"; +CREATE EVENT mysqltest.e1 ON SCHEDULE EVERY 15 MINUTE DO BEGIN END; +ERROR 42000: Unknown database 'mysqltest' +connection default; +CREATE DATABASE mysqltest; +CREATE EVENT mysqltest.e1 ON SCHEDULE EVERY 15 MINUTE DO BEGIN END; +SET DEBUG_SYNC= "after_wait_locked_schema_name SIGNAL locked WAIT_FOR release"; +DROP DATABASE mysqltest;; +connection con1; +SET DEBUG_SYNC= "now WAIT_FOR locked"; +SET DEBUG_SYNC= "before_wait_locked_pname SIGNAL release"; +ALTER EVENT mysqltest.e1 ON SCHEDULE EVERY 20 MINUTE DO BEGIN END; +ERROR 42000: Unknown database 'mysqltest' +connection default; +SET DEBUG_SYNC= "RESET"; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # CREATE DATABASE mysqltest +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # DROP DATABASE mysqltest +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # CREATE DATABASE mysqltest +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # DROP DATABASE mysqltest +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # CREATE DATABASE mysqltest +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` EVENT mysqltest.e1 ON SCHEDULE EVERY 15 MINUTE DO BEGIN END +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # DROP DATABASE mysqltest diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog2.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog2.result index 0f90f721cd6..432f108e538 100644 --- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog2.result +++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog2.result @@ -25,7 +25,7 @@ ROLLBACK/*!*/; use `test`/*!*/; SET TIMESTAMP=1579609942/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -97,7 +97,7 @@ SET INSERT_ID=1/*!*/; use `test`/*!*/; SET TIMESTAMP=1579609942/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -163,7 +163,7 @@ SET INSERT_ID=3/*!*/; use `test`/*!*/; SET TIMESTAMP=1579609944/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -208,7 +208,7 @@ ROLLBACK/*!*/; use `test`/*!*/; SET TIMESTAMP=1579609942/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -253,7 +253,7 @@ SET INSERT_ID=3/*!*/; use `test`/*!*/; SET TIMESTAMP=1579609944/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -280,7 +280,7 @@ SET INSERT_ID=3/*!*/; use `test`/*!*/; SET TIMESTAMP=1579609944/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -325,7 +325,7 @@ ROLLBACK/*!*/; use `test`/*!*/; SET TIMESTAMP=1579609942/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -368,7 +368,7 @@ ROLLBACK/*!*/; use `test`/*!*/; SET TIMESTAMP=1579609942/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -430,7 +430,7 @@ SET INSERT_ID=6/*!*/; use `test`/*!*/; SET TIMESTAMP=1579609943/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -460,7 +460,7 @@ SET INSERT_ID=1/*!*/; use `test`/*!*/; SET TIMESTAMP=1579609942/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -516,7 +516,7 @@ SET INSERT_ID=6/*!*/; use `test`/*!*/; SET TIMESTAMP=1579609943/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -546,7 +546,7 @@ SET INSERT_ID=3/*!*/; use `test`/*!*/; SET TIMESTAMP=1579609944/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -584,7 +584,7 @@ SET INSERT_ID=6/*!*/; use `test`/*!*/; SET TIMESTAMP=1579609943/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -611,7 +611,7 @@ ROLLBACK/*!*/; use `test`/*!*/; SET TIMESTAMP=1579609942/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -687,7 +687,7 @@ SET INSERT_ID=3/*!*/; use `test`/*!*/; SET TIMESTAMP=1579609944/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -725,7 +725,7 @@ SET INSERT_ID=6/*!*/; use `test`/*!*/; SET TIMESTAMP=1579609943/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -752,7 +752,7 @@ ROLLBACK/*!*/; use `test`/*!*/; SET TIMESTAMP=1579609942/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -794,7 +794,7 @@ ROLLBACK/*!*/; use `test`/*!*/; SET TIMESTAMP=1579609942/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -866,7 +866,7 @@ SET INSERT_ID=1/*!*/; use `test`/*!*/; SET TIMESTAMP=1579609942/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -931,7 +931,7 @@ SET INSERT_ID=3/*!*/; use `test`/*!*/; SET TIMESTAMP=1579609944/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -976,7 +976,7 @@ ROLLBACK/*!*/; use `test`/*!*/; SET TIMESTAMP=1579609942/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -1020,7 +1020,7 @@ SET INSERT_ID=3/*!*/; use `test`/*!*/; SET TIMESTAMP=1579609944/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -1047,7 +1047,7 @@ SET INSERT_ID=3/*!*/; use `test`/*!*/; SET TIMESTAMP=1579609944/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -1092,7 +1092,7 @@ ROLLBACK/*!*/; use `test`/*!*/; SET TIMESTAMP=1579609942/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -1134,7 +1134,7 @@ ROLLBACK/*!*/; use `test`/*!*/; SET TIMESTAMP=1579609942/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -1196,7 +1196,7 @@ SET INSERT_ID=6/*!*/; use `test`/*!*/; SET TIMESTAMP=1579609943/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -1226,7 +1226,7 @@ SET INSERT_ID=1/*!*/; use `test`/*!*/; SET TIMESTAMP=1579609942/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -1282,7 +1282,7 @@ SET INSERT_ID=6/*!*/; use `test`/*!*/; SET TIMESTAMP=1579609943/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -1311,7 +1311,7 @@ SET INSERT_ID=3/*!*/; use `test`/*!*/; SET TIMESTAMP=1579609944/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -1349,7 +1349,7 @@ SET INSERT_ID=6/*!*/; use `test`/*!*/; SET TIMESTAMP=1579609943/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -1376,7 +1376,7 @@ ROLLBACK/*!*/; use `test`/*!*/; SET TIMESTAMP=1579609942/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -1450,7 +1450,7 @@ SET INSERT_ID=3/*!*/; use `test`/*!*/; SET TIMESTAMP=1579609944/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -1488,7 +1488,7 @@ SET INSERT_ID=6/*!*/; use `test`/*!*/; SET TIMESTAMP=1579609943/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -1515,7 +1515,7 @@ ROLLBACK/*!*/; use `test`/*!*/; SET TIMESTAMP=1579609942/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -1557,7 +1557,7 @@ ROLLBACK/*!*/; use `test`/*!*/; SET TIMESTAMP=1579609942/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result index 9e3d44952ef..4255d17fda7 100644 --- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result +++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result @@ -362,7 +362,7 @@ ROLLBACK/*!*/; use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=1342177280/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result index b1d3c166fd5..8320a4655dd 100644 --- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result +++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result @@ -2268,7 +2268,7 @@ ROLLBACK/*!*/; use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C utf8 *//*!*/; @@ -3902,7 +3902,7 @@ ROLLBACK/*!*/; use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C utf8 *//*!*/; @@ -4281,7 +4281,7 @@ ROLLBACK/*!*/; use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C utf8 *//*!*/; @@ -4867,7 +4867,7 @@ ROLLBACK/*!*/; use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C utf8 *//*!*/; diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result index 7f927622631..e668481212d 100644 --- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result +++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result @@ -2268,7 +2268,7 @@ ROLLBACK/*!*/; use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C utf8 *//*!*/; @@ -3925,7 +3925,7 @@ ROLLBACK/*!*/; use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C utf8 *//*!*/; @@ -4310,7 +4310,7 @@ ROLLBACK/*!*/; use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C utf8 *//*!*/; @@ -4906,7 +4906,7 @@ ROLLBACK/*!*/; use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C utf8 *//*!*/; diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_trans.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_trans.result index 98ed0196554..9d8de92efdf 100644 --- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_trans.result +++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_trans.result @@ -146,7 +146,7 @@ ROLLBACK/*!*/; use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=1342177280/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; diff --git a/mysql-test/suite/binlog/r/binlog_row_annotate.result b/mysql-test/suite/binlog/r/binlog_row_annotate.result index 6070f2da608..ffd8c530a44 100644 --- a/mysql-test/suite/binlog/r/binlog_row_annotate.result +++ b/mysql-test/suite/binlog/r/binlog_row_annotate.result @@ -89,7 +89,7 @@ ROLLBACK/*!*/; #010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -342,7 +342,7 @@ ROLLBACK/*!*/; #010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -514,7 +514,7 @@ ROLLBACK/*!*/; #010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -757,7 +757,7 @@ ROLLBACK/*!*/; #010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -1010,7 +1010,7 @@ ROLLBACK/*!*/; #010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -1182,7 +1182,7 @@ ROLLBACK/*!*/; #010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; diff --git a/mysql-test/suite/binlog/r/binlog_row_binlog.result b/mysql-test/suite/binlog/r/binlog_row_binlog.result index 710c95546fd..25b6e7351a2 100644 --- a/mysql-test/suite/binlog/r/binlog_row_binlog.result +++ b/mysql-test/suite/binlog/r/binlog_row_binlog.result @@ -681,7 +681,7 @@ master-bin.000001 # Query # # COMMIT master-bin.000001 # Gtid # # GTID #-#-# master-bin.000001 # Query # # use `test`; CREATE TABLE IF NOT EXISTS `t3` ( `a` int(11) DEFAULT NULL -) +) ENGINE=MyISAM master-bin.000001 # Gtid # # BEGIN GTID #-#-# master-bin.000001 # Table_map # # table_id: # (mysql.user) master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F diff --git a/mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result b/mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result index 6b56c006518..6a8e18ae5bf 100644 --- a/mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result +++ b/mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result @@ -19,7 +19,7 @@ BEGIN /*!*/; SET TIMESTAMP=10000/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=1342177280/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; diff --git a/mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_options.result b/mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_options.result index 9d55f1f145d..5991fd6f37f 100644 --- a/mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_options.result +++ b/mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_options.result @@ -50,7 +50,7 @@ use `new_test1`/*!*/; #010909 4:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=1342177280/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -262,7 +262,7 @@ use `new_test1`/*!*/; #010909 4:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=1342177280/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; diff --git a/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result b/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result index 825b9bf05a0..a3bcf6cd79d 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result +++ b/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result @@ -21,7 +21,7 @@ SET @`v`:=_ucs2 X'006100620063' COLLATE `ucs2_general_ci`/*!*/; use `test`/*!*/; SET TIMESTAMP=10000/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=1342177280/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; diff --git a/mysql-test/suite/binlog/t/binlog_mdev717.test b/mysql-test/suite/binlog/t/binlog_mdev717.test new file mode 100644 index 00000000000..61d3aa715d2 --- /dev/null +++ b/mysql-test/suite/binlog/t/binlog_mdev717.test @@ -0,0 +1,46 @@ +# MDEV-717 LP:1003679 - Wrong binlog order on concurrent DROP schema and CREATE function. + +--source include/have_debug_sync.inc +--source include/have_log_bin.inc +RESET MASTER; + +connect(con1,localhost,root); +connection default; + +CREATE DATABASE mysqltest; +SET DEBUG_SYNC= "after_wait_locked_schema_name SIGNAL locked WAIT_FOR release"; +--send DROP DATABASE mysqltest; +connection con1; +SET DEBUG_SYNC= "now WAIT_FOR locked"; +SET DEBUG_SYNC= "before_wait_locked_pname SIGNAL release"; +--error ER_BAD_DB_ERROR +CREATE FUNCTION mysqltest.f1() RETURNS INT RETURN 1; +connection default; +--reap + +CREATE DATABASE mysqltest; +SET DEBUG_SYNC= "after_wait_locked_schema_name SIGNAL locked WAIT_FOR release"; +--send DROP DATABASE mysqltest; +connection con1; +SET DEBUG_SYNC= "now WAIT_FOR locked"; +SET DEBUG_SYNC= "before_wait_locked_pname SIGNAL release"; +--error ER_BAD_DB_ERROR +CREATE EVENT mysqltest.e1 ON SCHEDULE EVERY 15 MINUTE DO BEGIN END; +connection default; +--reap + +CREATE DATABASE mysqltest; +CREATE EVENT mysqltest.e1 ON SCHEDULE EVERY 15 MINUTE DO BEGIN END; +SET DEBUG_SYNC= "after_wait_locked_schema_name SIGNAL locked WAIT_FOR release"; +--send DROP DATABASE mysqltest; +connection con1; +SET DEBUG_SYNC= "now WAIT_FOR locked"; +SET DEBUG_SYNC= "before_wait_locked_pname SIGNAL release"; +--error ER_BAD_DB_ERROR +ALTER EVENT mysqltest.e1 ON SCHEDULE EVERY 20 MINUTE DO BEGIN END; +connection default; +--reap + +SET DEBUG_SYNC= "RESET"; +--source include/show_binlog_events.inc + diff --git a/mysql-test/suite/encryption/r/innodb_onlinealter_encryption.result b/mysql-test/suite/encryption/r/innodb_onlinealter_encryption.result index a3a3ab3fed6..47bcfea87c8 100644 --- a/mysql-test/suite/encryption/r/innodb_onlinealter_encryption.result +++ b/mysql-test/suite/encryption/r/innodb_onlinealter_encryption.result @@ -59,7 +59,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `id` int(11) NOT NULL, `a` varchar(255) DEFAULT NULL, - `b` int(11) DEFAULT '2', + `b` int(11) DEFAULT 2, PRIMARY KEY (`id`), KEY `a` (`a`), KEY `b` (`b`) @@ -69,7 +69,7 @@ Table Create Table t2 CREATE TABLE `t2` ( `id` int(11) NOT NULL, `a` varchar(255) DEFAULT NULL, - `b` int(11) DEFAULT '2', + `b` int(11) DEFAULT 2, PRIMARY KEY (`id`), KEY `a` (`a`), KEY `b` (`b`) @@ -79,7 +79,7 @@ Table Create Table t3 CREATE TABLE `t3` ( `id` int(11) DEFAULT NULL, `a` varchar(255) DEFAULT NULL, - `c` int(11) DEFAULT '5', + `c` int(11) DEFAULT 5, KEY `a` (`a`), KEY `c` (`c`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encrypted`=yes @@ -88,7 +88,7 @@ Table Create Table t4 CREATE TABLE `t4` ( `id` int(11) DEFAULT NULL, `a` varchar(255) DEFAULT NULL, - `c` int(11) DEFAULT '5', + `c` int(11) DEFAULT 5, KEY `a` (`a`), KEY `c` (`c`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 @@ -96,7 +96,7 @@ SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( `id` int(11) NOT NULL, - `a` text, + `a` text DEFAULT NULL, `b` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `b` (`b`), @@ -106,7 +106,7 @@ SHOW CREATE TABLE t6; Table Create Table t6 CREATE TABLE `t6` ( `id` int(11) DEFAULT NULL, - `a` text, + `a` text DEFAULT NULL, `b` varchar(255) DEFAULT NULL, FULLTEXT KEY `b` (`b`), FULLTEXT KEY `a` (`a`) @@ -116,7 +116,7 @@ Table Create Table t7 CREATE TABLE `t7` ( `id` int(11) NOT NULL, `a` varchar(255) DEFAULT NULL, - `b` int(11) DEFAULT '2', + `b` int(11) DEFAULT 2, PRIMARY KEY (`id`), KEY `a` (`a`), KEY `b` (`b`) diff --git a/mysql-test/suite/encryption/t/innodb-log-encrypt-crash.test b/mysql-test/suite/encryption/t/innodb-log-encrypt-crash.test index 8bb5f9f2c49..cb9a69d036b 100644 --- a/mysql-test/suite/encryption/t/innodb-log-encrypt-crash.test +++ b/mysql-test/suite/encryption/t/innodb-log-encrypt-crash.test @@ -1,5 +1,8 @@ -- source include/have_innodb.inc -- source include/not_embedded.inc +# test takes very long time on debug build +-- source include/not_debug.inc +-- source include/big_test.inc -- source filekeys_plugin.inc call mtr.add_suppression("InnoDB: New log files created, LSN=.*"); diff --git a/mysql-test/suite/engines/funcs/r/comment_column2.result b/mysql-test/suite/engines/funcs/r/comment_column2.result index 6fa5d73b70a..99402e7f5b4 100644 --- a/mysql-test/suite/engines/funcs/r/comment_column2.result +++ b/mysql-test/suite/engines/funcs/r/comment_column2.result @@ -249,7 +249,7 @@ abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghij SELECT comment,index_comment,char_length(index_comment) FROM information_schema.statistics WHERE table_name='t1'; comment index_comment char_length(index_comment) ALTER TABLE t1 ADD COLUMN c64 INTEGER COMMENT 'abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghij'; -ERROR HY000: Too many columns +ERROR HY000: Table definition is too large SELECT table_comment,char_length(table_comment) FROM information_schema.tables WHERE table_name='t1'; table_comment char_length(table_comment) 0 @@ -388,7 +388,7 @@ c63 INTEGER COMMENT 'abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghi c64 INTEGER COMMENT 'abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghij', c65 INTEGER COMMENT 'abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghij') ; -ERROR HY000: Too many columns +ERROR HY000: Table definition is too large SELECT table_comment,char_length(table_comment) FROM information_schema.tables WHERE table_name='t1'; table_comment char_length(table_comment) SELECT column_comment,char_length(column_comment) FROM information_schema.columns WHERE table_name='t1'; diff --git a/mysql-test/suite/engines/funcs/r/db_alter_collate_ascii.result b/mysql-test/suite/engines/funcs/r/db_alter_collate_ascii.result index 02805c41cf7..ee127d76bcc 100644 --- a/mysql-test/suite/engines/funcs/r/db_alter_collate_ascii.result +++ b/mysql-test/suite/engines/funcs/r/db_alter_collate_ascii.result @@ -84,6 +84,7 @@ utf8_vietnamese_ci utf8 215 # # utf8_general_mysql500_ci utf8 223 # # utf8_croatian_ci utf8 576 # # utf8_myanmar_ci utf8 577 # # +utf8_thai_520_w2 utf8 578 # # ucs2_general_ci ucs2 35 Yes # # ucs2_bin ucs2 90 # # ucs2_unicode_ci ucs2 128 # # @@ -113,6 +114,7 @@ ucs2_vietnamese_ci ucs2 151 # # ucs2_general_mysql500_ci ucs2 159 # # ucs2_croatian_ci ucs2 640 # # ucs2_myanmar_ci ucs2 641 # # +ucs2_thai_520_w2 ucs2 642 # # cp866_general_ci cp866 36 Yes # # cp866_bin cp866 68 # # keybcs2_general_ci keybcs2 37 Yes # # @@ -155,6 +157,7 @@ utf8mb4_unicode_520_ci utf8mb4 246 # # utf8mb4_vietnamese_ci utf8mb4 247 # # utf8mb4_croatian_ci utf8mb4 608 # # utf8mb4_myanmar_ci utf8mb4 609 # # +utf8mb4_thai_520_w2 utf8mb4 610 # # cp1251_bulgarian_ci cp1251 14 # # cp1251_ukrainian_ci cp1251 23 # # cp1251_bin cp1251 50 # # @@ -188,6 +191,7 @@ utf16_unicode_520_ci utf16 123 # # utf16_vietnamese_ci utf16 124 # # utf16_croatian_ci utf16 672 # # utf16_myanmar_ci utf16 673 # # +utf16_thai_520_w2 utf16 674 # # utf16le_general_ci utf16le 56 Yes # # utf16le_bin utf16le 62 # # cp1256_general_ci cp1256 57 Yes # # @@ -223,6 +227,7 @@ utf32_unicode_520_ci utf32 182 # # utf32_vietnamese_ci utf32 183 # # utf32_croatian_ci utf32 736 # # utf32_myanmar_ci utf32 737 # # +utf32_thai_520_w2 utf32 738 # # binary binary 63 Yes # # geostd8_general_ci geostd8 92 Yes # # geostd8_bin geostd8 93 # # diff --git a/mysql-test/suite/engines/funcs/r/db_alter_collate_utf8.result b/mysql-test/suite/engines/funcs/r/db_alter_collate_utf8.result index 501bd95cf55..46921fcaa8c 100644 --- a/mysql-test/suite/engines/funcs/r/db_alter_collate_utf8.result +++ b/mysql-test/suite/engines/funcs/r/db_alter_collate_utf8.result @@ -84,6 +84,7 @@ utf8_vietnamese_ci utf8 215 # # utf8_general_mysql500_ci utf8 223 # # utf8_croatian_ci utf8 576 # # utf8_myanmar_ci utf8 577 # # +utf8_thai_520_w2 utf8 578 # # ucs2_general_ci ucs2 35 Yes # # ucs2_bin ucs2 90 # # ucs2_unicode_ci ucs2 128 # # @@ -113,6 +114,7 @@ ucs2_vietnamese_ci ucs2 151 # # ucs2_general_mysql500_ci ucs2 159 # # ucs2_croatian_ci ucs2 640 # # ucs2_myanmar_ci ucs2 641 # # +ucs2_thai_520_w2 ucs2 642 # # cp866_general_ci cp866 36 Yes # # cp866_bin cp866 68 # # keybcs2_general_ci keybcs2 37 Yes # # @@ -155,6 +157,7 @@ utf8mb4_unicode_520_ci utf8mb4 246 # # utf8mb4_vietnamese_ci utf8mb4 247 # # utf8mb4_croatian_ci utf8mb4 608 # # utf8mb4_myanmar_ci utf8mb4 609 # # +utf8mb4_thai_520_w2 utf8mb4 610 # # cp1251_bulgarian_ci cp1251 14 # # cp1251_ukrainian_ci cp1251 23 # # cp1251_bin cp1251 50 # # @@ -188,6 +191,7 @@ utf16_unicode_520_ci utf16 123 # # utf16_vietnamese_ci utf16 124 # # utf16_croatian_ci utf16 672 # # utf16_myanmar_ci utf16 673 # # +utf16_thai_520_w2 utf16 674 # # utf16le_general_ci utf16le 56 Yes # # utf16le_bin utf16le 62 # # cp1256_general_ci cp1256 57 Yes # # @@ -223,6 +227,7 @@ utf32_unicode_520_ci utf32 182 # # utf32_vietnamese_ci utf32 183 # # utf32_croatian_ci utf32 736 # # utf32_myanmar_ci utf32 737 # # +utf32_thai_520_w2 utf32 738 # # binary binary 63 Yes # # geostd8_general_ci geostd8 92 Yes # # geostd8_bin geostd8 93 # # diff --git a/mysql-test/suite/engines/funcs/r/ix_drop_error.result b/mysql-test/suite/engines/funcs/r/ix_drop_error.result index d0364ec67b4..61d9fa69379 100644 --- a/mysql-test/suite/engines/funcs/r/ix_drop_error.result +++ b/mysql-test/suite/engines/funcs/r/ix_drop_error.result @@ -1,7 +1,7 @@ DROP TABLE IF EXISTS t9; CREATE TABLE t9(c1 INTEGER NOT NULL); DROP INDEX i1 ON t9; -ERROR 42000: Can't DROP 'i1'; check that column/key exists +ERROR 42000: Can't DROP INDEX `i1`; check that it exists DROP TABLE t9; SHOW TABLES; Tables_in_test diff --git a/mysql-test/suite/engines/funcs/r/ix_index_lob.result b/mysql-test/suite/engines/funcs/r/ix_index_lob.result index 612378bcc94..cbc421d092d 100644 --- a/mysql-test/suite/engines/funcs/r/ix_index_lob.result +++ b/mysql-test/suite/engines/funcs/r/ix_index_lob.result @@ -7,7 +7,7 @@ t4 SHOW CREATE TABLE t4; Table Create Table t4 CREATE TABLE `t4` ( - `c1` tinyblob, + `c1` tinyblob DEFAULT NULL, KEY `i1` (`c1`(100)) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t4; @@ -21,7 +21,7 @@ t4 SHOW CREATE TABLE t4; Table Create Table t4 CREATE TABLE `t4` ( - `c1` blob, + `c1` blob DEFAULT NULL, KEY `i1` (`c1`(100)) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t4; @@ -35,7 +35,7 @@ t4 SHOW CREATE TABLE t4; Table Create Table t4 CREATE TABLE `t4` ( - `c1` mediumblob, + `c1` mediumblob DEFAULT NULL, KEY `i1` (`c1`(100)) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t4; @@ -49,7 +49,7 @@ t4 SHOW CREATE TABLE t4; Table Create Table t4 CREATE TABLE `t4` ( - `c1` longblob, + `c1` longblob DEFAULT NULL, KEY `i1` (`c1`(100)) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t4; @@ -63,7 +63,7 @@ t4 SHOW CREATE TABLE t4; Table Create Table t4 CREATE TABLE `t4` ( - `c1` tinytext, + `c1` tinytext DEFAULT NULL, KEY `i1` (`c1`(100)) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t4; @@ -77,7 +77,7 @@ t4 SHOW CREATE TABLE t4; Table Create Table t4 CREATE TABLE `t4` ( - `c1` text, + `c1` text DEFAULT NULL, KEY `i1` (`c1`(100)) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t4; @@ -91,7 +91,7 @@ t4 SHOW CREATE TABLE t4; Table Create Table t4 CREATE TABLE `t4` ( - `c1` mediumtext, + `c1` mediumtext DEFAULT NULL, KEY `i1` (`c1`(100)) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t4; @@ -105,7 +105,7 @@ t4 SHOW CREATE TABLE t4; Table Create Table t4 CREATE TABLE `t4` ( - `c1` longtext, + `c1` longtext DEFAULT NULL, KEY `i1` (`c1`(100)) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t4; diff --git a/mysql-test/suite/engines/funcs/r/ld_unique_error3.result b/mysql-test/suite/engines/funcs/r/ld_unique_error3.result index ff29614d6d6..371e88d2c2e 100644 --- a/mysql-test/suite/engines/funcs/r/ld_unique_error3.result +++ b/mysql-test/suite/engines/funcs/r/ld_unique_error3.result @@ -4,7 +4,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` text, + `c2` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 SHOW TABLES; diff --git a/mysql-test/suite/engines/funcs/r/rpl_row_until.result b/mysql-test/suite/engines/funcs/r/rpl_row_until.result index 5629f5c8cdd..457d83496bc 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_row_until.result +++ b/mysql-test/suite/engines/funcs/r/rpl_row_until.result @@ -1,14 +1,19 @@ include/master-slave.inc [connection master] +connection master; CREATE TABLE t1(n INT NOT NULL AUTO_INCREMENT PRIMARY KEY); INSERT INTO t1 VALUES (1),(2),(3),(4); DROP TABLE t1; CREATE TABLE t2(n INT NOT NULL AUTO_INCREMENT PRIMARY KEY); INSERT INTO t2 VALUES (1),(2); +connection slave; +connection master; INSERT INTO t2 VALUES (3),(4); DROP TABLE t2; +connection slave; include/stop_slave.inc RESET SLAVE; +connection slave; START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=master_pos_drop_t1 include/wait_for_slave_sql_to_stop.inc SELECT * FROM t1; @@ -36,6 +41,8 @@ n include/check_slave_param.inc [Exec_Master_Log_Pos] START SLAVE; include/wait_for_slave_to_start.inc +connection master; +connection slave; include/stop_slave.inc START SLAVE SQL_THREAD UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=master_pos_create_t2 include/wait_for_slave_param.inc [Until_Log_Pos] diff --git a/mysql-test/suite/engines/funcs/r/ta_add_column.result b/mysql-test/suite/engines/funcs/r/ta_add_column.result index 746fe39d08d..2dcbc272464 100644 --- a/mysql-test/suite/engines/funcs/r/ta_add_column.result +++ b/mysql-test/suite/engines/funcs/r/ta_add_column.result @@ -358,7 +358,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 BIT NULL; SHOW TABLES; @@ -367,7 +367,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob, + `c1` tinyblob DEFAULT NULL, `c2` bit(1) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -380,7 +380,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 BIT NULL; SHOW TABLES; @@ -389,7 +389,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob, + `c1` blob DEFAULT NULL, `c2` bit(1) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -402,7 +402,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 BIT NULL; SHOW TABLES; @@ -411,7 +411,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob, + `c1` mediumblob DEFAULT NULL, `c2` bit(1) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -424,7 +424,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 BIT NULL; SHOW TABLES; @@ -433,7 +433,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob, + `c1` longblob DEFAULT NULL, `c2` bit(1) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -446,7 +446,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 BIT NULL; SHOW TABLES; @@ -455,7 +455,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext, + `c1` tinytext DEFAULT NULL, `c2` bit(1) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -468,7 +468,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 BIT NULL; SHOW TABLES; @@ -477,7 +477,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text, + `c1` text DEFAULT NULL, `c2` bit(1) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -490,7 +490,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 BIT NULL; SHOW TABLES; @@ -499,7 +499,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext, + `c1` mediumtext DEFAULT NULL, `c2` bit(1) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -512,7 +512,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 BIT NULL; SHOW TABLES; @@ -521,7 +521,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext, + `c1` longtext DEFAULT NULL, `c2` bit(1) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -1414,7 +1414,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TINYINT NULL; SHOW TABLES; @@ -1423,7 +1423,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob, + `c1` tinyblob DEFAULT NULL, `c2` tinyint(4) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -1436,7 +1436,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TINYINT NULL; SHOW TABLES; @@ -1445,7 +1445,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob, + `c1` blob DEFAULT NULL, `c2` tinyint(4) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -1458,7 +1458,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TINYINT NULL; SHOW TABLES; @@ -1467,7 +1467,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob, + `c1` mediumblob DEFAULT NULL, `c2` tinyint(4) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -1480,7 +1480,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TINYINT NULL; SHOW TABLES; @@ -1489,7 +1489,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob, + `c1` longblob DEFAULT NULL, `c2` tinyint(4) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -1502,7 +1502,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TINYINT NULL; SHOW TABLES; @@ -1511,7 +1511,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext, + `c1` tinytext DEFAULT NULL, `c2` tinyint(4) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -1524,7 +1524,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TINYINT NULL; SHOW TABLES; @@ -1533,7 +1533,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text, + `c1` text DEFAULT NULL, `c2` tinyint(4) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -1546,7 +1546,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TINYINT NULL; SHOW TABLES; @@ -1555,7 +1555,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext, + `c1` mediumtext DEFAULT NULL, `c2` tinyint(4) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -1568,7 +1568,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TINYINT NULL; SHOW TABLES; @@ -1577,7 +1577,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext, + `c1` longtext DEFAULT NULL, `c2` tinyint(4) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -2470,7 +2470,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 SMALLINT NULL; SHOW TABLES; @@ -2479,7 +2479,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob, + `c1` tinyblob DEFAULT NULL, `c2` smallint(6) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -2492,7 +2492,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 SMALLINT NULL; SHOW TABLES; @@ -2501,7 +2501,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob, + `c1` blob DEFAULT NULL, `c2` smallint(6) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -2514,7 +2514,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 SMALLINT NULL; SHOW TABLES; @@ -2523,7 +2523,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob, + `c1` mediumblob DEFAULT NULL, `c2` smallint(6) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -2536,7 +2536,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 SMALLINT NULL; SHOW TABLES; @@ -2545,7 +2545,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob, + `c1` longblob DEFAULT NULL, `c2` smallint(6) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -2558,7 +2558,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 SMALLINT NULL; SHOW TABLES; @@ -2567,7 +2567,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext, + `c1` tinytext DEFAULT NULL, `c2` smallint(6) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -2580,7 +2580,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 SMALLINT NULL; SHOW TABLES; @@ -2589,7 +2589,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text, + `c1` text DEFAULT NULL, `c2` smallint(6) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -2602,7 +2602,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 SMALLINT NULL; SHOW TABLES; @@ -2611,7 +2611,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext, + `c1` mediumtext DEFAULT NULL, `c2` smallint(6) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -2624,7 +2624,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 SMALLINT NULL; SHOW TABLES; @@ -2633,7 +2633,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext, + `c1` longtext DEFAULT NULL, `c2` smallint(6) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -3526,7 +3526,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 MEDIUMINT NULL; SHOW TABLES; @@ -3535,7 +3535,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob, + `c1` tinyblob DEFAULT NULL, `c2` mediumint(9) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -3548,7 +3548,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 MEDIUMINT NULL; SHOW TABLES; @@ -3557,7 +3557,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob, + `c1` blob DEFAULT NULL, `c2` mediumint(9) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -3570,7 +3570,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 MEDIUMINT NULL; SHOW TABLES; @@ -3579,7 +3579,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob, + `c1` mediumblob DEFAULT NULL, `c2` mediumint(9) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -3592,7 +3592,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 MEDIUMINT NULL; SHOW TABLES; @@ -3601,7 +3601,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob, + `c1` longblob DEFAULT NULL, `c2` mediumint(9) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -3614,7 +3614,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 MEDIUMINT NULL; SHOW TABLES; @@ -3623,7 +3623,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext, + `c1` tinytext DEFAULT NULL, `c2` mediumint(9) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -3636,7 +3636,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 MEDIUMINT NULL; SHOW TABLES; @@ -3645,7 +3645,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text, + `c1` text DEFAULT NULL, `c2` mediumint(9) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -3658,7 +3658,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 MEDIUMINT NULL; SHOW TABLES; @@ -3667,7 +3667,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext, + `c1` mediumtext DEFAULT NULL, `c2` mediumint(9) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -3680,7 +3680,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 MEDIUMINT NULL; SHOW TABLES; @@ -3689,7 +3689,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext, + `c1` longtext DEFAULT NULL, `c2` mediumint(9) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -4582,7 +4582,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 INT NULL; SHOW TABLES; @@ -4591,7 +4591,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob, + `c1` tinyblob DEFAULT NULL, `c2` int(11) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -4604,7 +4604,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 INT NULL; SHOW TABLES; @@ -4613,7 +4613,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob, + `c1` blob DEFAULT NULL, `c2` int(11) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -4626,7 +4626,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 INT NULL; SHOW TABLES; @@ -4635,7 +4635,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob, + `c1` mediumblob DEFAULT NULL, `c2` int(11) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -4648,7 +4648,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 INT NULL; SHOW TABLES; @@ -4657,7 +4657,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob, + `c1` longblob DEFAULT NULL, `c2` int(11) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -4670,7 +4670,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 INT NULL; SHOW TABLES; @@ -4679,7 +4679,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext, + `c1` tinytext DEFAULT NULL, `c2` int(11) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -4692,7 +4692,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 INT NULL; SHOW TABLES; @@ -4701,7 +4701,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text, + `c1` text DEFAULT NULL, `c2` int(11) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -4714,7 +4714,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 INT NULL; SHOW TABLES; @@ -4723,7 +4723,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext, + `c1` mediumtext DEFAULT NULL, `c2` int(11) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -4736,7 +4736,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 INT NULL; SHOW TABLES; @@ -4745,7 +4745,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext, + `c1` longtext DEFAULT NULL, `c2` int(11) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -5638,7 +5638,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 INTEGER NULL; SHOW TABLES; @@ -5647,7 +5647,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob, + `c1` tinyblob DEFAULT NULL, `c2` int(11) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -5660,7 +5660,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 INTEGER NULL; SHOW TABLES; @@ -5669,7 +5669,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob, + `c1` blob DEFAULT NULL, `c2` int(11) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -5682,7 +5682,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 INTEGER NULL; SHOW TABLES; @@ -5691,7 +5691,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob, + `c1` mediumblob DEFAULT NULL, `c2` int(11) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -5704,7 +5704,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 INTEGER NULL; SHOW TABLES; @@ -5713,7 +5713,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob, + `c1` longblob DEFAULT NULL, `c2` int(11) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -5726,7 +5726,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 INTEGER NULL; SHOW TABLES; @@ -5735,7 +5735,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext, + `c1` tinytext DEFAULT NULL, `c2` int(11) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -5748,7 +5748,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 INTEGER NULL; SHOW TABLES; @@ -5757,7 +5757,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text, + `c1` text DEFAULT NULL, `c2` int(11) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -5770,7 +5770,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 INTEGER NULL; SHOW TABLES; @@ -5779,7 +5779,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext, + `c1` mediumtext DEFAULT NULL, `c2` int(11) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -5792,7 +5792,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 INTEGER NULL; SHOW TABLES; @@ -5801,7 +5801,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext, + `c1` longtext DEFAULT NULL, `c2` int(11) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -6694,7 +6694,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 BIGINT NULL; SHOW TABLES; @@ -6703,7 +6703,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob, + `c1` tinyblob DEFAULT NULL, `c2` bigint(20) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -6716,7 +6716,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 BIGINT NULL; SHOW TABLES; @@ -6725,7 +6725,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob, + `c1` blob DEFAULT NULL, `c2` bigint(20) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -6738,7 +6738,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 BIGINT NULL; SHOW TABLES; @@ -6747,7 +6747,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob, + `c1` mediumblob DEFAULT NULL, `c2` bigint(20) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -6760,7 +6760,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 BIGINT NULL; SHOW TABLES; @@ -6769,7 +6769,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob, + `c1` longblob DEFAULT NULL, `c2` bigint(20) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -6782,7 +6782,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 BIGINT NULL; SHOW TABLES; @@ -6791,7 +6791,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext, + `c1` tinytext DEFAULT NULL, `c2` bigint(20) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -6804,7 +6804,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 BIGINT NULL; SHOW TABLES; @@ -6813,7 +6813,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text, + `c1` text DEFAULT NULL, `c2` bigint(20) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -6826,7 +6826,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 BIGINT NULL; SHOW TABLES; @@ -6835,7 +6835,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext, + `c1` mediumtext DEFAULT NULL, `c2` bigint(20) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -6848,7 +6848,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 BIGINT NULL; SHOW TABLES; @@ -6857,7 +6857,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext, + `c1` longtext DEFAULT NULL, `c2` bigint(20) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -7750,7 +7750,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 REAL NULL; SHOW TABLES; @@ -7759,7 +7759,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob, + `c1` tinyblob DEFAULT NULL, `c2` double DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -7772,7 +7772,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 REAL NULL; SHOW TABLES; @@ -7781,7 +7781,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob, + `c1` blob DEFAULT NULL, `c2` double DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -7794,7 +7794,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 REAL NULL; SHOW TABLES; @@ -7803,7 +7803,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob, + `c1` mediumblob DEFAULT NULL, `c2` double DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -7816,7 +7816,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 REAL NULL; SHOW TABLES; @@ -7825,7 +7825,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob, + `c1` longblob DEFAULT NULL, `c2` double DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -7838,7 +7838,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 REAL NULL; SHOW TABLES; @@ -7847,7 +7847,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext, + `c1` tinytext DEFAULT NULL, `c2` double DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -7860,7 +7860,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 REAL NULL; SHOW TABLES; @@ -7869,7 +7869,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text, + `c1` text DEFAULT NULL, `c2` double DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -7882,7 +7882,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 REAL NULL; SHOW TABLES; @@ -7891,7 +7891,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext, + `c1` mediumtext DEFAULT NULL, `c2` double DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -7904,7 +7904,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 REAL NULL; SHOW TABLES; @@ -7913,7 +7913,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext, + `c1` longtext DEFAULT NULL, `c2` double DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -8806,7 +8806,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 DOUBLE NULL; SHOW TABLES; @@ -8815,7 +8815,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob, + `c1` tinyblob DEFAULT NULL, `c2` double DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -8828,7 +8828,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 DOUBLE NULL; SHOW TABLES; @@ -8837,7 +8837,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob, + `c1` blob DEFAULT NULL, `c2` double DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -8850,7 +8850,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 DOUBLE NULL; SHOW TABLES; @@ -8859,7 +8859,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob, + `c1` mediumblob DEFAULT NULL, `c2` double DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -8872,7 +8872,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 DOUBLE NULL; SHOW TABLES; @@ -8881,7 +8881,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob, + `c1` longblob DEFAULT NULL, `c2` double DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -8894,7 +8894,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 DOUBLE NULL; SHOW TABLES; @@ -8903,7 +8903,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext, + `c1` tinytext DEFAULT NULL, `c2` double DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -8916,7 +8916,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 DOUBLE NULL; SHOW TABLES; @@ -8925,7 +8925,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text, + `c1` text DEFAULT NULL, `c2` double DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -8938,7 +8938,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 DOUBLE NULL; SHOW TABLES; @@ -8947,7 +8947,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext, + `c1` mediumtext DEFAULT NULL, `c2` double DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -8960,7 +8960,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 DOUBLE NULL; SHOW TABLES; @@ -8969,7 +8969,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext, + `c1` longtext DEFAULT NULL, `c2` double DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -9862,7 +9862,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 FLOAT NULL; SHOW TABLES; @@ -9871,7 +9871,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob, + `c1` tinyblob DEFAULT NULL, `c2` float DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -9884,7 +9884,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 FLOAT NULL; SHOW TABLES; @@ -9893,7 +9893,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob, + `c1` blob DEFAULT NULL, `c2` float DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -9906,7 +9906,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 FLOAT NULL; SHOW TABLES; @@ -9915,7 +9915,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob, + `c1` mediumblob DEFAULT NULL, `c2` float DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -9928,7 +9928,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 FLOAT NULL; SHOW TABLES; @@ -9937,7 +9937,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob, + `c1` longblob DEFAULT NULL, `c2` float DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -9950,7 +9950,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 FLOAT NULL; SHOW TABLES; @@ -9959,7 +9959,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext, + `c1` tinytext DEFAULT NULL, `c2` float DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -9972,7 +9972,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 FLOAT NULL; SHOW TABLES; @@ -9981,7 +9981,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text, + `c1` text DEFAULT NULL, `c2` float DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -9994,7 +9994,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 FLOAT NULL; SHOW TABLES; @@ -10003,7 +10003,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext, + `c1` mediumtext DEFAULT NULL, `c2` float DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -10016,7 +10016,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 FLOAT NULL; SHOW TABLES; @@ -10025,7 +10025,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext, + `c1` longtext DEFAULT NULL, `c2` float DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -10918,7 +10918,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 DECIMAL NULL; SHOW TABLES; @@ -10927,7 +10927,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob, + `c1` tinyblob DEFAULT NULL, `c2` decimal(10,0) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -10940,7 +10940,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 DECIMAL NULL; SHOW TABLES; @@ -10949,7 +10949,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob, + `c1` blob DEFAULT NULL, `c2` decimal(10,0) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -10962,7 +10962,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 DECIMAL NULL; SHOW TABLES; @@ -10971,7 +10971,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob, + `c1` mediumblob DEFAULT NULL, `c2` decimal(10,0) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -10984,7 +10984,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 DECIMAL NULL; SHOW TABLES; @@ -10993,7 +10993,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob, + `c1` longblob DEFAULT NULL, `c2` decimal(10,0) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -11006,7 +11006,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 DECIMAL NULL; SHOW TABLES; @@ -11015,7 +11015,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext, + `c1` tinytext DEFAULT NULL, `c2` decimal(10,0) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -11028,7 +11028,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 DECIMAL NULL; SHOW TABLES; @@ -11037,7 +11037,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text, + `c1` text DEFAULT NULL, `c2` decimal(10,0) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -11050,7 +11050,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 DECIMAL NULL; SHOW TABLES; @@ -11059,7 +11059,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext, + `c1` mediumtext DEFAULT NULL, `c2` decimal(10,0) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -11072,7 +11072,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 DECIMAL NULL; SHOW TABLES; @@ -11081,7 +11081,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext, + `c1` longtext DEFAULT NULL, `c2` decimal(10,0) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -11974,7 +11974,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 NUMERIC NULL; SHOW TABLES; @@ -11983,7 +11983,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob, + `c1` tinyblob DEFAULT NULL, `c2` decimal(10,0) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -11996,7 +11996,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 NUMERIC NULL; SHOW TABLES; @@ -12005,7 +12005,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob, + `c1` blob DEFAULT NULL, `c2` decimal(10,0) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -12018,7 +12018,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 NUMERIC NULL; SHOW TABLES; @@ -12027,7 +12027,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob, + `c1` mediumblob DEFAULT NULL, `c2` decimal(10,0) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -12040,7 +12040,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 NUMERIC NULL; SHOW TABLES; @@ -12049,7 +12049,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob, + `c1` longblob DEFAULT NULL, `c2` decimal(10,0) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -12062,7 +12062,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 NUMERIC NULL; SHOW TABLES; @@ -12071,7 +12071,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext, + `c1` tinytext DEFAULT NULL, `c2` decimal(10,0) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -12084,7 +12084,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 NUMERIC NULL; SHOW TABLES; @@ -12093,7 +12093,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text, + `c1` text DEFAULT NULL, `c2` decimal(10,0) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -12106,7 +12106,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 NUMERIC NULL; SHOW TABLES; @@ -12115,7 +12115,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext, + `c1` mediumtext DEFAULT NULL, `c2` decimal(10,0) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -12128,7 +12128,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 NUMERIC NULL; SHOW TABLES; @@ -12137,7 +12137,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext, + `c1` longtext DEFAULT NULL, `c2` decimal(10,0) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -13030,7 +13030,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 DATE NULL; SHOW TABLES; @@ -13039,7 +13039,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob, + `c1` tinyblob DEFAULT NULL, `c2` date DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -13052,7 +13052,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 DATE NULL; SHOW TABLES; @@ -13061,7 +13061,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob, + `c1` blob DEFAULT NULL, `c2` date DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -13074,7 +13074,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 DATE NULL; SHOW TABLES; @@ -13083,7 +13083,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob, + `c1` mediumblob DEFAULT NULL, `c2` date DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -13096,7 +13096,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 DATE NULL; SHOW TABLES; @@ -13105,7 +13105,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob, + `c1` longblob DEFAULT NULL, `c2` date DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -13118,7 +13118,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 DATE NULL; SHOW TABLES; @@ -13127,7 +13127,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext, + `c1` tinytext DEFAULT NULL, `c2` date DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -13140,7 +13140,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 DATE NULL; SHOW TABLES; @@ -13149,7 +13149,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text, + `c1` text DEFAULT NULL, `c2` date DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -13162,7 +13162,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 DATE NULL; SHOW TABLES; @@ -13171,7 +13171,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext, + `c1` mediumtext DEFAULT NULL, `c2` date DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -13184,7 +13184,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 DATE NULL; SHOW TABLES; @@ -13193,7 +13193,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext, + `c1` longtext DEFAULT NULL, `c2` date DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -14086,7 +14086,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TIME NULL; SHOW TABLES; @@ -14095,7 +14095,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob, + `c1` tinyblob DEFAULT NULL, `c2` time DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -14108,7 +14108,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TIME NULL; SHOW TABLES; @@ -14117,7 +14117,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob, + `c1` blob DEFAULT NULL, `c2` time DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -14130,7 +14130,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TIME NULL; SHOW TABLES; @@ -14139,7 +14139,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob, + `c1` mediumblob DEFAULT NULL, `c2` time DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -14152,7 +14152,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TIME NULL; SHOW TABLES; @@ -14161,7 +14161,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob, + `c1` longblob DEFAULT NULL, `c2` time DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -14174,7 +14174,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TIME NULL; SHOW TABLES; @@ -14183,7 +14183,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext, + `c1` tinytext DEFAULT NULL, `c2` time DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -14196,7 +14196,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TIME NULL; SHOW TABLES; @@ -14205,7 +14205,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text, + `c1` text DEFAULT NULL, `c2` time DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -14218,7 +14218,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TIME NULL; SHOW TABLES; @@ -14227,7 +14227,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext, + `c1` mediumtext DEFAULT NULL, `c2` time DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -14240,7 +14240,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TIME NULL; SHOW TABLES; @@ -14249,7 +14249,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext, + `c1` longtext DEFAULT NULL, `c2` time DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -15142,7 +15142,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TIMESTAMP NULL; SHOW TABLES; @@ -15151,7 +15151,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob, + `c1` tinyblob DEFAULT NULL, `c2` timestamp NULL DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -15164,7 +15164,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TIMESTAMP NULL; SHOW TABLES; @@ -15173,7 +15173,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob, + `c1` blob DEFAULT NULL, `c2` timestamp NULL DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -15186,7 +15186,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TIMESTAMP NULL; SHOW TABLES; @@ -15195,7 +15195,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob, + `c1` mediumblob DEFAULT NULL, `c2` timestamp NULL DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -15208,7 +15208,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TIMESTAMP NULL; SHOW TABLES; @@ -15217,7 +15217,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob, + `c1` longblob DEFAULT NULL, `c2` timestamp NULL DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -15230,7 +15230,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TIMESTAMP NULL; SHOW TABLES; @@ -15239,7 +15239,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext, + `c1` tinytext DEFAULT NULL, `c2` timestamp NULL DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -15252,7 +15252,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TIMESTAMP NULL; SHOW TABLES; @@ -15261,7 +15261,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text, + `c1` text DEFAULT NULL, `c2` timestamp NULL DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -15274,7 +15274,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TIMESTAMP NULL; SHOW TABLES; @@ -15283,7 +15283,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext, + `c1` mediumtext DEFAULT NULL, `c2` timestamp NULL DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -15296,7 +15296,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TIMESTAMP NULL; SHOW TABLES; @@ -15305,7 +15305,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext, + `c1` longtext DEFAULT NULL, `c2` timestamp NULL DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -16198,7 +16198,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 YEAR NULL; SHOW TABLES; @@ -16207,7 +16207,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob, + `c1` tinyblob DEFAULT NULL, `c2` year(4) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -16220,7 +16220,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 YEAR NULL; SHOW TABLES; @@ -16229,7 +16229,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob, + `c1` blob DEFAULT NULL, `c2` year(4) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -16242,7 +16242,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 YEAR NULL; SHOW TABLES; @@ -16251,7 +16251,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob, + `c1` mediumblob DEFAULT NULL, `c2` year(4) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -16264,7 +16264,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 YEAR NULL; SHOW TABLES; @@ -16273,7 +16273,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob, + `c1` longblob DEFAULT NULL, `c2` year(4) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -16286,7 +16286,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 YEAR NULL; SHOW TABLES; @@ -16295,7 +16295,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext, + `c1` tinytext DEFAULT NULL, `c2` year(4) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -16308,7 +16308,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 YEAR NULL; SHOW TABLES; @@ -16317,7 +16317,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text, + `c1` text DEFAULT NULL, `c2` year(4) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -16330,7 +16330,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 YEAR NULL; SHOW TABLES; @@ -16339,7 +16339,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext, + `c1` mediumtext DEFAULT NULL, `c2` year(4) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -16352,7 +16352,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 YEAR NULL; SHOW TABLES; @@ -16361,7 +16361,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext, + `c1` longtext DEFAULT NULL, `c2` year(4) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -16912,7 +16912,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` bit(1) DEFAULT NULL, - `c2` tinyblob + `c2` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -16934,7 +16934,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` tinyint(4) DEFAULT NULL, - `c2` tinyblob + `c2` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -16956,7 +16956,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` smallint(6) DEFAULT NULL, - `c2` tinyblob + `c2` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -16978,7 +16978,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` mediumint(9) DEFAULT NULL, - `c2` tinyblob + `c2` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -17000,7 +17000,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) DEFAULT NULL, - `c2` tinyblob + `c2` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -17022,7 +17022,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) DEFAULT NULL, - `c2` tinyblob + `c2` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -17044,7 +17044,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` bigint(20) DEFAULT NULL, - `c2` tinyblob + `c2` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -17066,7 +17066,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` double DEFAULT NULL, - `c2` tinyblob + `c2` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -17088,7 +17088,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` double DEFAULT NULL, - `c2` tinyblob + `c2` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -17110,7 +17110,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` float DEFAULT NULL, - `c2` tinyblob + `c2` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -17132,7 +17132,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` decimal(10,0) DEFAULT NULL, - `c2` tinyblob + `c2` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -17154,7 +17154,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` decimal(10,0) DEFAULT NULL, - `c2` tinyblob + `c2` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -17176,7 +17176,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` date DEFAULT NULL, - `c2` tinyblob + `c2` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -17198,7 +17198,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` time DEFAULT NULL, - `c2` tinyblob + `c2` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -17220,7 +17220,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` timestamp NULL DEFAULT NULL, - `c2` tinyblob + `c2` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -17242,7 +17242,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` year(4) DEFAULT NULL, - `c2` tinyblob + `c2` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -17254,7 +17254,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TINYBLOB NULL; SHOW TABLES; @@ -17263,8 +17263,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob, - `c2` tinyblob + `c1` tinyblob DEFAULT NULL, + `c2` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -17276,7 +17276,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TINYBLOB NULL; SHOW TABLES; @@ -17285,8 +17285,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob, - `c2` tinyblob + `c1` blob DEFAULT NULL, + `c2` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -17298,7 +17298,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TINYBLOB NULL; SHOW TABLES; @@ -17307,8 +17307,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob, - `c2` tinyblob + `c1` mediumblob DEFAULT NULL, + `c2` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -17320,7 +17320,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TINYBLOB NULL; SHOW TABLES; @@ -17329,8 +17329,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob, - `c2` tinyblob + `c1` longblob DEFAULT NULL, + `c2` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -17342,7 +17342,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TINYBLOB NULL; SHOW TABLES; @@ -17351,8 +17351,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext, - `c2` tinyblob + `c1` tinytext DEFAULT NULL, + `c2` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -17364,7 +17364,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TINYBLOB NULL; SHOW TABLES; @@ -17373,8 +17373,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text, - `c2` tinyblob + `c1` text DEFAULT NULL, + `c2` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -17386,7 +17386,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TINYBLOB NULL; SHOW TABLES; @@ -17395,8 +17395,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext, - `c2` tinyblob + `c1` mediumtext DEFAULT NULL, + `c2` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -17408,7 +17408,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TINYBLOB NULL; SHOW TABLES; @@ -17417,8 +17417,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext, - `c2` tinyblob + `c1` longtext DEFAULT NULL, + `c2` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -17968,7 +17968,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` bit(1) DEFAULT NULL, - `c2` blob + `c2` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -17990,7 +17990,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` tinyint(4) DEFAULT NULL, - `c2` blob + `c2` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -18012,7 +18012,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` smallint(6) DEFAULT NULL, - `c2` blob + `c2` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -18034,7 +18034,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` mediumint(9) DEFAULT NULL, - `c2` blob + `c2` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -18056,7 +18056,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) DEFAULT NULL, - `c2` blob + `c2` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -18078,7 +18078,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) DEFAULT NULL, - `c2` blob + `c2` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -18100,7 +18100,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` bigint(20) DEFAULT NULL, - `c2` blob + `c2` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -18122,7 +18122,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` double DEFAULT NULL, - `c2` blob + `c2` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -18144,7 +18144,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` double DEFAULT NULL, - `c2` blob + `c2` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -18166,7 +18166,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` float DEFAULT NULL, - `c2` blob + `c2` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -18188,7 +18188,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` decimal(10,0) DEFAULT NULL, - `c2` blob + `c2` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -18210,7 +18210,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` decimal(10,0) DEFAULT NULL, - `c2` blob + `c2` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -18232,7 +18232,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` date DEFAULT NULL, - `c2` blob + `c2` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -18254,7 +18254,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` time DEFAULT NULL, - `c2` blob + `c2` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -18276,7 +18276,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` timestamp NULL DEFAULT NULL, - `c2` blob + `c2` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -18298,7 +18298,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` year(4) DEFAULT NULL, - `c2` blob + `c2` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -18310,7 +18310,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 BLOB NULL; SHOW TABLES; @@ -18319,8 +18319,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob, - `c2` blob + `c1` tinyblob DEFAULT NULL, + `c2` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -18332,7 +18332,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 BLOB NULL; SHOW TABLES; @@ -18341,8 +18341,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob, - `c2` blob + `c1` blob DEFAULT NULL, + `c2` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -18354,7 +18354,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 BLOB NULL; SHOW TABLES; @@ -18363,8 +18363,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob, - `c2` blob + `c1` mediumblob DEFAULT NULL, + `c2` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -18376,7 +18376,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 BLOB NULL; SHOW TABLES; @@ -18385,8 +18385,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob, - `c2` blob + `c1` longblob DEFAULT NULL, + `c2` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -18398,7 +18398,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 BLOB NULL; SHOW TABLES; @@ -18407,8 +18407,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext, - `c2` blob + `c1` tinytext DEFAULT NULL, + `c2` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -18420,7 +18420,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 BLOB NULL; SHOW TABLES; @@ -18429,8 +18429,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text, - `c2` blob + `c1` text DEFAULT NULL, + `c2` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -18442,7 +18442,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 BLOB NULL; SHOW TABLES; @@ -18451,8 +18451,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext, - `c2` blob + `c1` mediumtext DEFAULT NULL, + `c2` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -18464,7 +18464,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 BLOB NULL; SHOW TABLES; @@ -18473,8 +18473,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext, - `c2` blob + `c1` longtext DEFAULT NULL, + `c2` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -19024,7 +19024,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` bit(1) DEFAULT NULL, - `c2` mediumblob + `c2` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -19046,7 +19046,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` tinyint(4) DEFAULT NULL, - `c2` mediumblob + `c2` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -19068,7 +19068,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` smallint(6) DEFAULT NULL, - `c2` mediumblob + `c2` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -19090,7 +19090,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` mediumint(9) DEFAULT NULL, - `c2` mediumblob + `c2` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -19112,7 +19112,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) DEFAULT NULL, - `c2` mediumblob + `c2` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -19134,7 +19134,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) DEFAULT NULL, - `c2` mediumblob + `c2` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -19156,7 +19156,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` bigint(20) DEFAULT NULL, - `c2` mediumblob + `c2` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -19178,7 +19178,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` double DEFAULT NULL, - `c2` mediumblob + `c2` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -19200,7 +19200,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` double DEFAULT NULL, - `c2` mediumblob + `c2` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -19222,7 +19222,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` float DEFAULT NULL, - `c2` mediumblob + `c2` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -19244,7 +19244,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` decimal(10,0) DEFAULT NULL, - `c2` mediumblob + `c2` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -19266,7 +19266,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` decimal(10,0) DEFAULT NULL, - `c2` mediumblob + `c2` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -19288,7 +19288,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` date DEFAULT NULL, - `c2` mediumblob + `c2` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -19310,7 +19310,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` time DEFAULT NULL, - `c2` mediumblob + `c2` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -19332,7 +19332,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` timestamp NULL DEFAULT NULL, - `c2` mediumblob + `c2` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -19354,7 +19354,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` year(4) DEFAULT NULL, - `c2` mediumblob + `c2` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -19366,7 +19366,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 MEDIUMBLOB NULL; SHOW TABLES; @@ -19375,8 +19375,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob, - `c2` mediumblob + `c1` tinyblob DEFAULT NULL, + `c2` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -19388,7 +19388,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 MEDIUMBLOB NULL; SHOW TABLES; @@ -19397,8 +19397,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob, - `c2` mediumblob + `c1` blob DEFAULT NULL, + `c2` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -19410,7 +19410,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 MEDIUMBLOB NULL; SHOW TABLES; @@ -19419,8 +19419,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob, - `c2` mediumblob + `c1` mediumblob DEFAULT NULL, + `c2` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -19432,7 +19432,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 MEDIUMBLOB NULL; SHOW TABLES; @@ -19441,8 +19441,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob, - `c2` mediumblob + `c1` longblob DEFAULT NULL, + `c2` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -19454,7 +19454,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 MEDIUMBLOB NULL; SHOW TABLES; @@ -19463,8 +19463,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext, - `c2` mediumblob + `c1` tinytext DEFAULT NULL, + `c2` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -19476,7 +19476,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 MEDIUMBLOB NULL; SHOW TABLES; @@ -19485,8 +19485,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text, - `c2` mediumblob + `c1` text DEFAULT NULL, + `c2` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -19498,7 +19498,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 MEDIUMBLOB NULL; SHOW TABLES; @@ -19507,8 +19507,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext, - `c2` mediumblob + `c1` mediumtext DEFAULT NULL, + `c2` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -19520,7 +19520,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 MEDIUMBLOB NULL; SHOW TABLES; @@ -19529,8 +19529,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext, - `c2` mediumblob + `c1` longtext DEFAULT NULL, + `c2` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -20080,7 +20080,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` bit(1) DEFAULT NULL, - `c2` longblob + `c2` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -20102,7 +20102,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` tinyint(4) DEFAULT NULL, - `c2` longblob + `c2` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -20124,7 +20124,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` smallint(6) DEFAULT NULL, - `c2` longblob + `c2` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -20146,7 +20146,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` mediumint(9) DEFAULT NULL, - `c2` longblob + `c2` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -20168,7 +20168,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) DEFAULT NULL, - `c2` longblob + `c2` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -20190,7 +20190,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) DEFAULT NULL, - `c2` longblob + `c2` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -20212,7 +20212,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` bigint(20) DEFAULT NULL, - `c2` longblob + `c2` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -20234,7 +20234,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` double DEFAULT NULL, - `c2` longblob + `c2` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -20256,7 +20256,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` double DEFAULT NULL, - `c2` longblob + `c2` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -20278,7 +20278,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` float DEFAULT NULL, - `c2` longblob + `c2` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -20300,7 +20300,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` decimal(10,0) DEFAULT NULL, - `c2` longblob + `c2` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -20322,7 +20322,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` decimal(10,0) DEFAULT NULL, - `c2` longblob + `c2` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -20344,7 +20344,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` date DEFAULT NULL, - `c2` longblob + `c2` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -20366,7 +20366,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` time DEFAULT NULL, - `c2` longblob + `c2` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -20388,7 +20388,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` timestamp NULL DEFAULT NULL, - `c2` longblob + `c2` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -20410,7 +20410,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` year(4) DEFAULT NULL, - `c2` longblob + `c2` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -20422,7 +20422,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 LONGBLOB NULL; SHOW TABLES; @@ -20431,8 +20431,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob, - `c2` longblob + `c1` tinyblob DEFAULT NULL, + `c2` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -20444,7 +20444,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 LONGBLOB NULL; SHOW TABLES; @@ -20453,8 +20453,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob, - `c2` longblob + `c1` blob DEFAULT NULL, + `c2` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -20466,7 +20466,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 LONGBLOB NULL; SHOW TABLES; @@ -20475,8 +20475,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob, - `c2` longblob + `c1` mediumblob DEFAULT NULL, + `c2` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -20488,7 +20488,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 LONGBLOB NULL; SHOW TABLES; @@ -20497,8 +20497,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob, - `c2` longblob + `c1` longblob DEFAULT NULL, + `c2` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -20510,7 +20510,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 LONGBLOB NULL; SHOW TABLES; @@ -20519,8 +20519,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext, - `c2` longblob + `c1` tinytext DEFAULT NULL, + `c2` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -20532,7 +20532,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 LONGBLOB NULL; SHOW TABLES; @@ -20541,8 +20541,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text, - `c2` longblob + `c1` text DEFAULT NULL, + `c2` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -20554,7 +20554,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 LONGBLOB NULL; SHOW TABLES; @@ -20563,8 +20563,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext, - `c2` longblob + `c1` mediumtext DEFAULT NULL, + `c2` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -20576,7 +20576,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 LONGBLOB NULL; SHOW TABLES; @@ -20585,8 +20585,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext, - `c2` longblob + `c1` longtext DEFAULT NULL, + `c2` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -21136,7 +21136,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` bit(1) DEFAULT NULL, - `c2` tinytext + `c2` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -21158,7 +21158,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` tinyint(4) DEFAULT NULL, - `c2` tinytext + `c2` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -21180,7 +21180,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` smallint(6) DEFAULT NULL, - `c2` tinytext + `c2` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -21202,7 +21202,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` mediumint(9) DEFAULT NULL, - `c2` tinytext + `c2` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -21224,7 +21224,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) DEFAULT NULL, - `c2` tinytext + `c2` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -21246,7 +21246,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) DEFAULT NULL, - `c2` tinytext + `c2` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -21268,7 +21268,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` bigint(20) DEFAULT NULL, - `c2` tinytext + `c2` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -21290,7 +21290,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` double DEFAULT NULL, - `c2` tinytext + `c2` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -21312,7 +21312,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` double DEFAULT NULL, - `c2` tinytext + `c2` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -21334,7 +21334,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` float DEFAULT NULL, - `c2` tinytext + `c2` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -21356,7 +21356,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` decimal(10,0) DEFAULT NULL, - `c2` tinytext + `c2` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -21378,7 +21378,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` decimal(10,0) DEFAULT NULL, - `c2` tinytext + `c2` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -21400,7 +21400,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` date DEFAULT NULL, - `c2` tinytext + `c2` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -21422,7 +21422,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` time DEFAULT NULL, - `c2` tinytext + `c2` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -21444,7 +21444,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` timestamp NULL DEFAULT NULL, - `c2` tinytext + `c2` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -21466,7 +21466,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` year(4) DEFAULT NULL, - `c2` tinytext + `c2` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -21478,7 +21478,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TINYTEXT NULL; SHOW TABLES; @@ -21487,8 +21487,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob, - `c2` tinytext + `c1` tinyblob DEFAULT NULL, + `c2` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -21500,7 +21500,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TINYTEXT NULL; SHOW TABLES; @@ -21509,8 +21509,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob, - `c2` tinytext + `c1` blob DEFAULT NULL, + `c2` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -21522,7 +21522,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TINYTEXT NULL; SHOW TABLES; @@ -21531,8 +21531,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob, - `c2` tinytext + `c1` mediumblob DEFAULT NULL, + `c2` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -21544,7 +21544,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TINYTEXT NULL; SHOW TABLES; @@ -21553,8 +21553,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob, - `c2` tinytext + `c1` longblob DEFAULT NULL, + `c2` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -21566,7 +21566,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TINYTEXT NULL; SHOW TABLES; @@ -21575,8 +21575,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext, - `c2` tinytext + `c1` tinytext DEFAULT NULL, + `c2` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -21588,7 +21588,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TINYTEXT NULL; SHOW TABLES; @@ -21597,8 +21597,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text, - `c2` tinytext + `c1` text DEFAULT NULL, + `c2` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -21610,7 +21610,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TINYTEXT NULL; SHOW TABLES; @@ -21619,8 +21619,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext, - `c2` tinytext + `c1` mediumtext DEFAULT NULL, + `c2` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -21632,7 +21632,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TINYTEXT NULL; SHOW TABLES; @@ -21641,8 +21641,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext, - `c2` tinytext + `c1` longtext DEFAULT NULL, + `c2` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -22192,7 +22192,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` bit(1) DEFAULT NULL, - `c2` text + `c2` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -22214,7 +22214,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` tinyint(4) DEFAULT NULL, - `c2` text + `c2` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -22236,7 +22236,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` smallint(6) DEFAULT NULL, - `c2` text + `c2` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -22258,7 +22258,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` mediumint(9) DEFAULT NULL, - `c2` text + `c2` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -22280,7 +22280,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) DEFAULT NULL, - `c2` text + `c2` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -22302,7 +22302,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) DEFAULT NULL, - `c2` text + `c2` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -22324,7 +22324,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` bigint(20) DEFAULT NULL, - `c2` text + `c2` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -22346,7 +22346,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` double DEFAULT NULL, - `c2` text + `c2` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -22368,7 +22368,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` double DEFAULT NULL, - `c2` text + `c2` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -22390,7 +22390,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` float DEFAULT NULL, - `c2` text + `c2` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -22412,7 +22412,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` decimal(10,0) DEFAULT NULL, - `c2` text + `c2` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -22434,7 +22434,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` decimal(10,0) DEFAULT NULL, - `c2` text + `c2` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -22456,7 +22456,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` date DEFAULT NULL, - `c2` text + `c2` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -22478,7 +22478,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` time DEFAULT NULL, - `c2` text + `c2` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -22500,7 +22500,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` timestamp NULL DEFAULT NULL, - `c2` text + `c2` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -22522,7 +22522,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` year(4) DEFAULT NULL, - `c2` text + `c2` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -22534,7 +22534,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TEXT NULL; SHOW TABLES; @@ -22543,8 +22543,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob, - `c2` text + `c1` tinyblob DEFAULT NULL, + `c2` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -22556,7 +22556,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TEXT NULL; SHOW TABLES; @@ -22565,8 +22565,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob, - `c2` text + `c1` blob DEFAULT NULL, + `c2` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -22578,7 +22578,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TEXT NULL; SHOW TABLES; @@ -22587,8 +22587,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob, - `c2` text + `c1` mediumblob DEFAULT NULL, + `c2` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -22600,7 +22600,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TEXT NULL; SHOW TABLES; @@ -22609,8 +22609,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob, - `c2` text + `c1` longblob DEFAULT NULL, + `c2` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -22622,7 +22622,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TEXT NULL; SHOW TABLES; @@ -22631,8 +22631,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext, - `c2` text + `c1` tinytext DEFAULT NULL, + `c2` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -22644,7 +22644,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TEXT NULL; SHOW TABLES; @@ -22653,8 +22653,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text, - `c2` text + `c1` text DEFAULT NULL, + `c2` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -22666,7 +22666,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TEXT NULL; SHOW TABLES; @@ -22675,8 +22675,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext, - `c2` text + `c1` mediumtext DEFAULT NULL, + `c2` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -22688,7 +22688,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TEXT NULL; SHOW TABLES; @@ -22697,8 +22697,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext, - `c2` text + `c1` longtext DEFAULT NULL, + `c2` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -23248,7 +23248,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` bit(1) DEFAULT NULL, - `c2` mediumtext + `c2` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -23270,7 +23270,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` tinyint(4) DEFAULT NULL, - `c2` mediumtext + `c2` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -23292,7 +23292,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` smallint(6) DEFAULT NULL, - `c2` mediumtext + `c2` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -23314,7 +23314,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` mediumint(9) DEFAULT NULL, - `c2` mediumtext + `c2` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -23336,7 +23336,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) DEFAULT NULL, - `c2` mediumtext + `c2` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -23358,7 +23358,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) DEFAULT NULL, - `c2` mediumtext + `c2` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -23380,7 +23380,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` bigint(20) DEFAULT NULL, - `c2` mediumtext + `c2` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -23402,7 +23402,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` double DEFAULT NULL, - `c2` mediumtext + `c2` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -23424,7 +23424,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` double DEFAULT NULL, - `c2` mediumtext + `c2` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -23446,7 +23446,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` float DEFAULT NULL, - `c2` mediumtext + `c2` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -23468,7 +23468,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` decimal(10,0) DEFAULT NULL, - `c2` mediumtext + `c2` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -23490,7 +23490,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` decimal(10,0) DEFAULT NULL, - `c2` mediumtext + `c2` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -23512,7 +23512,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` date DEFAULT NULL, - `c2` mediumtext + `c2` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -23534,7 +23534,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` time DEFAULT NULL, - `c2` mediumtext + `c2` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -23556,7 +23556,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` timestamp NULL DEFAULT NULL, - `c2` mediumtext + `c2` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -23578,7 +23578,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` year(4) DEFAULT NULL, - `c2` mediumtext + `c2` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -23590,7 +23590,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 MEDIUMTEXT NULL; SHOW TABLES; @@ -23599,8 +23599,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob, - `c2` mediumtext + `c1` tinyblob DEFAULT NULL, + `c2` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -23612,7 +23612,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 MEDIUMTEXT NULL; SHOW TABLES; @@ -23621,8 +23621,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob, - `c2` mediumtext + `c1` blob DEFAULT NULL, + `c2` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -23634,7 +23634,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 MEDIUMTEXT NULL; SHOW TABLES; @@ -23643,8 +23643,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob, - `c2` mediumtext + `c1` mediumblob DEFAULT NULL, + `c2` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -23656,7 +23656,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 MEDIUMTEXT NULL; SHOW TABLES; @@ -23665,8 +23665,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob, - `c2` mediumtext + `c1` longblob DEFAULT NULL, + `c2` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -23678,7 +23678,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 MEDIUMTEXT NULL; SHOW TABLES; @@ -23687,8 +23687,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext, - `c2` mediumtext + `c1` tinytext DEFAULT NULL, + `c2` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -23700,7 +23700,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 MEDIUMTEXT NULL; SHOW TABLES; @@ -23709,8 +23709,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text, - `c2` mediumtext + `c1` text DEFAULT NULL, + `c2` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -23722,7 +23722,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 MEDIUMTEXT NULL; SHOW TABLES; @@ -23731,8 +23731,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext, - `c2` mediumtext + `c1` mediumtext DEFAULT NULL, + `c2` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -23744,7 +23744,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 MEDIUMTEXT NULL; SHOW TABLES; @@ -23753,8 +23753,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext, - `c2` mediumtext + `c1` longtext DEFAULT NULL, + `c2` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -24304,7 +24304,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` bit(1) DEFAULT NULL, - `c2` longtext + `c2` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -24326,7 +24326,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` tinyint(4) DEFAULT NULL, - `c2` longtext + `c2` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -24348,7 +24348,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` smallint(6) DEFAULT NULL, - `c2` longtext + `c2` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -24370,7 +24370,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` mediumint(9) DEFAULT NULL, - `c2` longtext + `c2` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -24392,7 +24392,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) DEFAULT NULL, - `c2` longtext + `c2` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -24414,7 +24414,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) DEFAULT NULL, - `c2` longtext + `c2` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -24436,7 +24436,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` bigint(20) DEFAULT NULL, - `c2` longtext + `c2` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -24458,7 +24458,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` double DEFAULT NULL, - `c2` longtext + `c2` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -24480,7 +24480,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` double DEFAULT NULL, - `c2` longtext + `c2` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -24502,7 +24502,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` float DEFAULT NULL, - `c2` longtext + `c2` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -24524,7 +24524,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` decimal(10,0) DEFAULT NULL, - `c2` longtext + `c2` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -24546,7 +24546,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` decimal(10,0) DEFAULT NULL, - `c2` longtext + `c2` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -24568,7 +24568,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` date DEFAULT NULL, - `c2` longtext + `c2` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -24590,7 +24590,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` time DEFAULT NULL, - `c2` longtext + `c2` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -24612,7 +24612,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` timestamp NULL DEFAULT NULL, - `c2` longtext + `c2` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -24634,7 +24634,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` year(4) DEFAULT NULL, - `c2` longtext + `c2` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -24646,7 +24646,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 LONGTEXT NULL; SHOW TABLES; @@ -24655,8 +24655,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob, - `c2` longtext + `c1` tinyblob DEFAULT NULL, + `c2` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -24668,7 +24668,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 LONGTEXT NULL; SHOW TABLES; @@ -24677,8 +24677,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob, - `c2` longtext + `c1` blob DEFAULT NULL, + `c2` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -24690,7 +24690,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 LONGTEXT NULL; SHOW TABLES; @@ -24699,8 +24699,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob, - `c2` longtext + `c1` mediumblob DEFAULT NULL, + `c2` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -24712,7 +24712,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 LONGTEXT NULL; SHOW TABLES; @@ -24721,8 +24721,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob, - `c2` longtext + `c1` longblob DEFAULT NULL, + `c2` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -24734,7 +24734,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 LONGTEXT NULL; SHOW TABLES; @@ -24743,8 +24743,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext, - `c2` longtext + `c1` tinytext DEFAULT NULL, + `c2` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -24756,7 +24756,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 LONGTEXT NULL; SHOW TABLES; @@ -24765,8 +24765,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text, - `c2` longtext + `c1` text DEFAULT NULL, + `c2` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -24778,7 +24778,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 LONGTEXT NULL; SHOW TABLES; @@ -24787,8 +24787,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext, - `c2` longtext + `c1` mediumtext DEFAULT NULL, + `c2` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -24800,7 +24800,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 LONGTEXT NULL; SHOW TABLES; @@ -24809,8 +24809,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext, - `c2` longtext + `c1` longtext DEFAULT NULL, + `c2` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; diff --git a/mysql-test/suite/engines/funcs/r/ta_add_column2.result b/mysql-test/suite/engines/funcs/r/ta_add_column2.result index d2ba3b66369..1a1d074af21 100644 --- a/mysql-test/suite/engines/funcs/r/ta_add_column2.result +++ b/mysql-test/suite/engines/funcs/r/ta_add_column2.result @@ -2832,7 +2832,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` char(15) DEFAULT NULL, - `c2` tinyblob + `c2` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -2854,7 +2854,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` varchar(15) DEFAULT NULL, - `c2` tinyblob + `c2` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -2876,7 +2876,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` binary(15) DEFAULT NULL, - `c2` tinyblob + `c2` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -2898,7 +2898,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` varbinary(15) DEFAULT NULL, - `c2` tinyblob + `c2` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -3008,7 +3008,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` char(15) DEFAULT NULL, - `c2` blob + `c2` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -3030,7 +3030,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` varchar(15) DEFAULT NULL, - `c2` blob + `c2` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -3052,7 +3052,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` binary(15) DEFAULT NULL, - `c2` blob + `c2` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -3074,7 +3074,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` varbinary(15) DEFAULT NULL, - `c2` blob + `c2` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -3184,7 +3184,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` char(15) DEFAULT NULL, - `c2` mediumblob + `c2` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -3206,7 +3206,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` varchar(15) DEFAULT NULL, - `c2` mediumblob + `c2` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -3228,7 +3228,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` binary(15) DEFAULT NULL, - `c2` mediumblob + `c2` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -3250,7 +3250,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` varbinary(15) DEFAULT NULL, - `c2` mediumblob + `c2` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -3360,7 +3360,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` char(15) DEFAULT NULL, - `c2` longblob + `c2` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -3382,7 +3382,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` varchar(15) DEFAULT NULL, - `c2` longblob + `c2` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -3404,7 +3404,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` binary(15) DEFAULT NULL, - `c2` longblob + `c2` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -3426,7 +3426,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` varbinary(15) DEFAULT NULL, - `c2` longblob + `c2` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -3536,7 +3536,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` char(15) DEFAULT NULL, - `c2` tinytext + `c2` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -3558,7 +3558,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` varchar(15) DEFAULT NULL, - `c2` tinytext + `c2` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -3580,7 +3580,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` binary(15) DEFAULT NULL, - `c2` tinytext + `c2` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -3602,7 +3602,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` varbinary(15) DEFAULT NULL, - `c2` tinytext + `c2` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -3712,7 +3712,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` char(15) DEFAULT NULL, - `c2` text + `c2` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -3734,7 +3734,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` varchar(15) DEFAULT NULL, - `c2` text + `c2` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -3756,7 +3756,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` binary(15) DEFAULT NULL, - `c2` text + `c2` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -3778,7 +3778,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` varbinary(15) DEFAULT NULL, - `c2` text + `c2` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -3888,7 +3888,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` char(15) DEFAULT NULL, - `c2` mediumtext + `c2` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -3910,7 +3910,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` varchar(15) DEFAULT NULL, - `c2` mediumtext + `c2` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -3932,7 +3932,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` binary(15) DEFAULT NULL, - `c2` mediumtext + `c2` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -3954,7 +3954,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` varbinary(15) DEFAULT NULL, - `c2` mediumtext + `c2` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -4064,7 +4064,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` char(15) DEFAULT NULL, - `c2` longtext + `c2` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -4086,7 +4086,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` varchar(15) DEFAULT NULL, - `c2` longtext + `c2` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -4108,7 +4108,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` binary(15) DEFAULT NULL, - `c2` longtext + `c2` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -4130,7 +4130,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` varbinary(15) DEFAULT NULL, - `c2` longtext + `c2` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; diff --git a/mysql-test/suite/engines/funcs/r/ta_add_column_first.result b/mysql-test/suite/engines/funcs/r/ta_add_column_first.result index 7f1a39168c5..1fd73d3507d 100644 --- a/mysql-test/suite/engines/funcs/r/ta_add_column_first.result +++ b/mysql-test/suite/engines/funcs/r/ta_add_column_first.result @@ -358,7 +358,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 BIT NULL FIRST; SHOW TABLES; @@ -368,7 +368,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` bit(1) DEFAULT NULL, - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -380,7 +380,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 BIT NULL FIRST; SHOW TABLES; @@ -390,7 +390,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` bit(1) DEFAULT NULL, - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -402,7 +402,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 BIT NULL FIRST; SHOW TABLES; @@ -412,7 +412,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` bit(1) DEFAULT NULL, - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -424,7 +424,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 BIT NULL FIRST; SHOW TABLES; @@ -434,7 +434,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` bit(1) DEFAULT NULL, - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -446,7 +446,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 BIT NULL FIRST; SHOW TABLES; @@ -456,7 +456,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` bit(1) DEFAULT NULL, - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -468,7 +468,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 BIT NULL FIRST; SHOW TABLES; @@ -478,7 +478,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` bit(1) DEFAULT NULL, - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -490,7 +490,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 BIT NULL FIRST; SHOW TABLES; @@ -500,7 +500,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` bit(1) DEFAULT NULL, - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -512,7 +512,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 BIT NULL FIRST; SHOW TABLES; @@ -522,7 +522,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` bit(1) DEFAULT NULL, - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -1414,7 +1414,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TINYINT NULL FIRST; SHOW TABLES; @@ -1424,7 +1424,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` tinyint(4) DEFAULT NULL, - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -1436,7 +1436,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TINYINT NULL FIRST; SHOW TABLES; @@ -1446,7 +1446,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` tinyint(4) DEFAULT NULL, - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -1458,7 +1458,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TINYINT NULL FIRST; SHOW TABLES; @@ -1468,7 +1468,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` tinyint(4) DEFAULT NULL, - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -1480,7 +1480,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TINYINT NULL FIRST; SHOW TABLES; @@ -1490,7 +1490,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` tinyint(4) DEFAULT NULL, - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -1502,7 +1502,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TINYINT NULL FIRST; SHOW TABLES; @@ -1512,7 +1512,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` tinyint(4) DEFAULT NULL, - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -1524,7 +1524,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TINYINT NULL FIRST; SHOW TABLES; @@ -1534,7 +1534,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` tinyint(4) DEFAULT NULL, - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -1546,7 +1546,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TINYINT NULL FIRST; SHOW TABLES; @@ -1556,7 +1556,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` tinyint(4) DEFAULT NULL, - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -1568,7 +1568,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TINYINT NULL FIRST; SHOW TABLES; @@ -1578,7 +1578,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` tinyint(4) DEFAULT NULL, - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -2470,7 +2470,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 SMALLINT NULL FIRST; SHOW TABLES; @@ -2480,7 +2480,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` smallint(6) DEFAULT NULL, - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -2492,7 +2492,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 SMALLINT NULL FIRST; SHOW TABLES; @@ -2502,7 +2502,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` smallint(6) DEFAULT NULL, - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -2514,7 +2514,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 SMALLINT NULL FIRST; SHOW TABLES; @@ -2524,7 +2524,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` smallint(6) DEFAULT NULL, - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -2536,7 +2536,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 SMALLINT NULL FIRST; SHOW TABLES; @@ -2546,7 +2546,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` smallint(6) DEFAULT NULL, - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -2558,7 +2558,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 SMALLINT NULL FIRST; SHOW TABLES; @@ -2568,7 +2568,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` smallint(6) DEFAULT NULL, - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -2580,7 +2580,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 SMALLINT NULL FIRST; SHOW TABLES; @@ -2590,7 +2590,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` smallint(6) DEFAULT NULL, - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -2602,7 +2602,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 SMALLINT NULL FIRST; SHOW TABLES; @@ -2612,7 +2612,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` smallint(6) DEFAULT NULL, - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -2624,7 +2624,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 SMALLINT NULL FIRST; SHOW TABLES; @@ -2634,7 +2634,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` smallint(6) DEFAULT NULL, - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -3526,7 +3526,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 MEDIUMINT NULL FIRST; SHOW TABLES; @@ -3536,7 +3536,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` mediumint(9) DEFAULT NULL, - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -3548,7 +3548,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 MEDIUMINT NULL FIRST; SHOW TABLES; @@ -3558,7 +3558,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` mediumint(9) DEFAULT NULL, - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -3570,7 +3570,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 MEDIUMINT NULL FIRST; SHOW TABLES; @@ -3580,7 +3580,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` mediumint(9) DEFAULT NULL, - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -3592,7 +3592,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 MEDIUMINT NULL FIRST; SHOW TABLES; @@ -3602,7 +3602,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` mediumint(9) DEFAULT NULL, - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -3614,7 +3614,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 MEDIUMINT NULL FIRST; SHOW TABLES; @@ -3624,7 +3624,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` mediumint(9) DEFAULT NULL, - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -3636,7 +3636,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 MEDIUMINT NULL FIRST; SHOW TABLES; @@ -3646,7 +3646,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` mediumint(9) DEFAULT NULL, - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -3658,7 +3658,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 MEDIUMINT NULL FIRST; SHOW TABLES; @@ -3668,7 +3668,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` mediumint(9) DEFAULT NULL, - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -3680,7 +3680,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 MEDIUMINT NULL FIRST; SHOW TABLES; @@ -3690,7 +3690,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` mediumint(9) DEFAULT NULL, - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -4582,7 +4582,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 INT NULL FIRST; SHOW TABLES; @@ -4592,7 +4592,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` int(11) DEFAULT NULL, - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -4604,7 +4604,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 INT NULL FIRST; SHOW TABLES; @@ -4614,7 +4614,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` int(11) DEFAULT NULL, - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -4626,7 +4626,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 INT NULL FIRST; SHOW TABLES; @@ -4636,7 +4636,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` int(11) DEFAULT NULL, - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -4648,7 +4648,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 INT NULL FIRST; SHOW TABLES; @@ -4658,7 +4658,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` int(11) DEFAULT NULL, - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -4670,7 +4670,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 INT NULL FIRST; SHOW TABLES; @@ -4680,7 +4680,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` int(11) DEFAULT NULL, - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -4692,7 +4692,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 INT NULL FIRST; SHOW TABLES; @@ -4702,7 +4702,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` int(11) DEFAULT NULL, - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -4714,7 +4714,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 INT NULL FIRST; SHOW TABLES; @@ -4724,7 +4724,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` int(11) DEFAULT NULL, - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -4736,7 +4736,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 INT NULL FIRST; SHOW TABLES; @@ -4746,7 +4746,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` int(11) DEFAULT NULL, - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -5638,7 +5638,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 INTEGER NULL FIRST; SHOW TABLES; @@ -5648,7 +5648,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` int(11) DEFAULT NULL, - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -5660,7 +5660,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 INTEGER NULL FIRST; SHOW TABLES; @@ -5670,7 +5670,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` int(11) DEFAULT NULL, - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -5682,7 +5682,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 INTEGER NULL FIRST; SHOW TABLES; @@ -5692,7 +5692,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` int(11) DEFAULT NULL, - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -5704,7 +5704,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 INTEGER NULL FIRST; SHOW TABLES; @@ -5714,7 +5714,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` int(11) DEFAULT NULL, - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -5726,7 +5726,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 INTEGER NULL FIRST; SHOW TABLES; @@ -5736,7 +5736,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` int(11) DEFAULT NULL, - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -5748,7 +5748,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 INTEGER NULL FIRST; SHOW TABLES; @@ -5758,7 +5758,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` int(11) DEFAULT NULL, - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -5770,7 +5770,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 INTEGER NULL FIRST; SHOW TABLES; @@ -5780,7 +5780,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` int(11) DEFAULT NULL, - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -5792,7 +5792,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 INTEGER NULL FIRST; SHOW TABLES; @@ -5802,7 +5802,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` int(11) DEFAULT NULL, - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -6694,7 +6694,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 BIGINT NULL FIRST; SHOW TABLES; @@ -6704,7 +6704,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` bigint(20) DEFAULT NULL, - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -6716,7 +6716,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 BIGINT NULL FIRST; SHOW TABLES; @@ -6726,7 +6726,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` bigint(20) DEFAULT NULL, - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -6738,7 +6738,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 BIGINT NULL FIRST; SHOW TABLES; @@ -6748,7 +6748,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` bigint(20) DEFAULT NULL, - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -6760,7 +6760,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 BIGINT NULL FIRST; SHOW TABLES; @@ -6770,7 +6770,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` bigint(20) DEFAULT NULL, - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -6782,7 +6782,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 BIGINT NULL FIRST; SHOW TABLES; @@ -6792,7 +6792,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` bigint(20) DEFAULT NULL, - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -6804,7 +6804,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 BIGINT NULL FIRST; SHOW TABLES; @@ -6814,7 +6814,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` bigint(20) DEFAULT NULL, - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -6826,7 +6826,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 BIGINT NULL FIRST; SHOW TABLES; @@ -6836,7 +6836,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` bigint(20) DEFAULT NULL, - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -6848,7 +6848,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 BIGINT NULL FIRST; SHOW TABLES; @@ -6858,7 +6858,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` bigint(20) DEFAULT NULL, - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -7750,7 +7750,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 REAL NULL FIRST; SHOW TABLES; @@ -7760,7 +7760,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` double DEFAULT NULL, - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -7772,7 +7772,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 REAL NULL FIRST; SHOW TABLES; @@ -7782,7 +7782,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` double DEFAULT NULL, - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -7794,7 +7794,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 REAL NULL FIRST; SHOW TABLES; @@ -7804,7 +7804,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` double DEFAULT NULL, - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -7816,7 +7816,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 REAL NULL FIRST; SHOW TABLES; @@ -7826,7 +7826,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` double DEFAULT NULL, - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -7838,7 +7838,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 REAL NULL FIRST; SHOW TABLES; @@ -7848,7 +7848,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` double DEFAULT NULL, - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -7860,7 +7860,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 REAL NULL FIRST; SHOW TABLES; @@ -7870,7 +7870,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` double DEFAULT NULL, - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -7882,7 +7882,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 REAL NULL FIRST; SHOW TABLES; @@ -7892,7 +7892,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` double DEFAULT NULL, - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -7904,7 +7904,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 REAL NULL FIRST; SHOW TABLES; @@ -7914,7 +7914,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` double DEFAULT NULL, - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -8806,7 +8806,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 DOUBLE NULL FIRST; SHOW TABLES; @@ -8816,7 +8816,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` double DEFAULT NULL, - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -8828,7 +8828,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 DOUBLE NULL FIRST; SHOW TABLES; @@ -8838,7 +8838,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` double DEFAULT NULL, - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -8850,7 +8850,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 DOUBLE NULL FIRST; SHOW TABLES; @@ -8860,7 +8860,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` double DEFAULT NULL, - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -8872,7 +8872,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 DOUBLE NULL FIRST; SHOW TABLES; @@ -8882,7 +8882,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` double DEFAULT NULL, - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -8894,7 +8894,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 DOUBLE NULL FIRST; SHOW TABLES; @@ -8904,7 +8904,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` double DEFAULT NULL, - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -8916,7 +8916,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 DOUBLE NULL FIRST; SHOW TABLES; @@ -8926,7 +8926,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` double DEFAULT NULL, - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -8938,7 +8938,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 DOUBLE NULL FIRST; SHOW TABLES; @@ -8948,7 +8948,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` double DEFAULT NULL, - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -8960,7 +8960,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 DOUBLE NULL FIRST; SHOW TABLES; @@ -8970,7 +8970,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` double DEFAULT NULL, - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -9862,7 +9862,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 FLOAT NULL FIRST; SHOW TABLES; @@ -9872,7 +9872,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` float DEFAULT NULL, - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -9884,7 +9884,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 FLOAT NULL FIRST; SHOW TABLES; @@ -9894,7 +9894,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` float DEFAULT NULL, - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -9906,7 +9906,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 FLOAT NULL FIRST; SHOW TABLES; @@ -9916,7 +9916,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` float DEFAULT NULL, - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -9928,7 +9928,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 FLOAT NULL FIRST; SHOW TABLES; @@ -9938,7 +9938,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` float DEFAULT NULL, - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -9950,7 +9950,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 FLOAT NULL FIRST; SHOW TABLES; @@ -9960,7 +9960,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` float DEFAULT NULL, - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -9972,7 +9972,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 FLOAT NULL FIRST; SHOW TABLES; @@ -9982,7 +9982,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` float DEFAULT NULL, - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -9994,7 +9994,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 FLOAT NULL FIRST; SHOW TABLES; @@ -10004,7 +10004,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` float DEFAULT NULL, - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -10016,7 +10016,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 FLOAT NULL FIRST; SHOW TABLES; @@ -10026,7 +10026,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` float DEFAULT NULL, - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -10918,7 +10918,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 DECIMAL NULL FIRST; SHOW TABLES; @@ -10928,7 +10928,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` decimal(10,0) DEFAULT NULL, - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -10940,7 +10940,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 DECIMAL NULL FIRST; SHOW TABLES; @@ -10950,7 +10950,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` decimal(10,0) DEFAULT NULL, - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -10962,7 +10962,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 DECIMAL NULL FIRST; SHOW TABLES; @@ -10972,7 +10972,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` decimal(10,0) DEFAULT NULL, - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -10984,7 +10984,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 DECIMAL NULL FIRST; SHOW TABLES; @@ -10994,7 +10994,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` decimal(10,0) DEFAULT NULL, - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -11006,7 +11006,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 DECIMAL NULL FIRST; SHOW TABLES; @@ -11016,7 +11016,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` decimal(10,0) DEFAULT NULL, - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -11028,7 +11028,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 DECIMAL NULL FIRST; SHOW TABLES; @@ -11038,7 +11038,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` decimal(10,0) DEFAULT NULL, - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -11050,7 +11050,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 DECIMAL NULL FIRST; SHOW TABLES; @@ -11060,7 +11060,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` decimal(10,0) DEFAULT NULL, - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -11072,7 +11072,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 DECIMAL NULL FIRST; SHOW TABLES; @@ -11082,7 +11082,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` decimal(10,0) DEFAULT NULL, - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -11974,7 +11974,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 NUMERIC NULL FIRST; SHOW TABLES; @@ -11984,7 +11984,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` decimal(10,0) DEFAULT NULL, - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -11996,7 +11996,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 NUMERIC NULL FIRST; SHOW TABLES; @@ -12006,7 +12006,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` decimal(10,0) DEFAULT NULL, - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -12018,7 +12018,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 NUMERIC NULL FIRST; SHOW TABLES; @@ -12028,7 +12028,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` decimal(10,0) DEFAULT NULL, - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -12040,7 +12040,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 NUMERIC NULL FIRST; SHOW TABLES; @@ -12050,7 +12050,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` decimal(10,0) DEFAULT NULL, - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -12062,7 +12062,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 NUMERIC NULL FIRST; SHOW TABLES; @@ -12072,7 +12072,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` decimal(10,0) DEFAULT NULL, - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -12084,7 +12084,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 NUMERIC NULL FIRST; SHOW TABLES; @@ -12094,7 +12094,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` decimal(10,0) DEFAULT NULL, - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -12106,7 +12106,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 NUMERIC NULL FIRST; SHOW TABLES; @@ -12116,7 +12116,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` decimal(10,0) DEFAULT NULL, - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -12128,7 +12128,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 NUMERIC NULL FIRST; SHOW TABLES; @@ -12138,7 +12138,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` decimal(10,0) DEFAULT NULL, - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -13030,7 +13030,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 DATE NULL FIRST; SHOW TABLES; @@ -13040,7 +13040,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` date DEFAULT NULL, - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -13052,7 +13052,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 DATE NULL FIRST; SHOW TABLES; @@ -13062,7 +13062,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` date DEFAULT NULL, - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -13074,7 +13074,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 DATE NULL FIRST; SHOW TABLES; @@ -13084,7 +13084,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` date DEFAULT NULL, - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -13096,7 +13096,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 DATE NULL FIRST; SHOW TABLES; @@ -13106,7 +13106,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` date DEFAULT NULL, - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -13118,7 +13118,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 DATE NULL FIRST; SHOW TABLES; @@ -13128,7 +13128,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` date DEFAULT NULL, - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -13140,7 +13140,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 DATE NULL FIRST; SHOW TABLES; @@ -13150,7 +13150,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` date DEFAULT NULL, - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -13162,7 +13162,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 DATE NULL FIRST; SHOW TABLES; @@ -13172,7 +13172,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` date DEFAULT NULL, - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -13184,7 +13184,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 DATE NULL FIRST; SHOW TABLES; @@ -13194,7 +13194,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` date DEFAULT NULL, - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -14086,7 +14086,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TIME NULL FIRST; SHOW TABLES; @@ -14096,7 +14096,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` time DEFAULT NULL, - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -14108,7 +14108,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TIME NULL FIRST; SHOW TABLES; @@ -14118,7 +14118,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` time DEFAULT NULL, - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -14130,7 +14130,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TIME NULL FIRST; SHOW TABLES; @@ -14140,7 +14140,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` time DEFAULT NULL, - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -14152,7 +14152,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TIME NULL FIRST; SHOW TABLES; @@ -14162,7 +14162,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` time DEFAULT NULL, - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -14174,7 +14174,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TIME NULL FIRST; SHOW TABLES; @@ -14184,7 +14184,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` time DEFAULT NULL, - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -14196,7 +14196,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TIME NULL FIRST; SHOW TABLES; @@ -14206,7 +14206,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` time DEFAULT NULL, - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -14218,7 +14218,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TIME NULL FIRST; SHOW TABLES; @@ -14228,7 +14228,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` time DEFAULT NULL, - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -14240,7 +14240,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TIME NULL FIRST; SHOW TABLES; @@ -14250,7 +14250,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` time DEFAULT NULL, - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -15142,7 +15142,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 YEAR NULL FIRST; SHOW TABLES; @@ -15152,7 +15152,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` year(4) DEFAULT NULL, - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -15164,7 +15164,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 YEAR NULL FIRST; SHOW TABLES; @@ -15174,7 +15174,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` year(4) DEFAULT NULL, - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -15186,7 +15186,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 YEAR NULL FIRST; SHOW TABLES; @@ -15196,7 +15196,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` year(4) DEFAULT NULL, - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -15208,7 +15208,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 YEAR NULL FIRST; SHOW TABLES; @@ -15218,7 +15218,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` year(4) DEFAULT NULL, - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -15230,7 +15230,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 YEAR NULL FIRST; SHOW TABLES; @@ -15240,7 +15240,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` year(4) DEFAULT NULL, - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -15252,7 +15252,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 YEAR NULL FIRST; SHOW TABLES; @@ -15262,7 +15262,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` year(4) DEFAULT NULL, - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -15274,7 +15274,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 YEAR NULL FIRST; SHOW TABLES; @@ -15284,7 +15284,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` year(4) DEFAULT NULL, - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -15296,7 +15296,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 YEAR NULL FIRST; SHOW TABLES; @@ -15306,7 +15306,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c2` year(4) DEFAULT NULL, - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -15855,7 +15855,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` tinyblob, + `c2` tinyblob DEFAULT NULL, `c1` bit(1) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -15877,7 +15877,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` tinyblob, + `c2` tinyblob DEFAULT NULL, `c1` tinyint(4) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -15899,7 +15899,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` tinyblob, + `c2` tinyblob DEFAULT NULL, `c1` smallint(6) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -15921,7 +15921,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` tinyblob, + `c2` tinyblob DEFAULT NULL, `c1` mediumint(9) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -15943,7 +15943,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` tinyblob, + `c2` tinyblob DEFAULT NULL, `c1` int(11) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -15965,7 +15965,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` tinyblob, + `c2` tinyblob DEFAULT NULL, `c1` int(11) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -15987,7 +15987,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` tinyblob, + `c2` tinyblob DEFAULT NULL, `c1` bigint(20) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -16009,7 +16009,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` tinyblob, + `c2` tinyblob DEFAULT NULL, `c1` double DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -16031,7 +16031,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` tinyblob, + `c2` tinyblob DEFAULT NULL, `c1` double DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -16053,7 +16053,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` tinyblob, + `c2` tinyblob DEFAULT NULL, `c1` float DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -16075,7 +16075,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` tinyblob, + `c2` tinyblob DEFAULT NULL, `c1` decimal(10,0) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -16097,7 +16097,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` tinyblob, + `c2` tinyblob DEFAULT NULL, `c1` decimal(10,0) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -16119,7 +16119,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` tinyblob, + `c2` tinyblob DEFAULT NULL, `c1` date DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -16141,7 +16141,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` tinyblob, + `c2` tinyblob DEFAULT NULL, `c1` time DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -16163,7 +16163,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` tinyblob, + `c2` tinyblob DEFAULT NULL, `c1` timestamp NULL DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -16185,7 +16185,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` tinyblob, + `c2` tinyblob DEFAULT NULL, `c1` year(4) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -16198,7 +16198,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TINYBLOB NULL FIRST; SHOW TABLES; @@ -16207,8 +16207,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` tinyblob, - `c1` tinyblob + `c2` tinyblob DEFAULT NULL, + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -16220,7 +16220,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TINYBLOB NULL FIRST; SHOW TABLES; @@ -16229,8 +16229,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` tinyblob, - `c1` blob + `c2` tinyblob DEFAULT NULL, + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -16242,7 +16242,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TINYBLOB NULL FIRST; SHOW TABLES; @@ -16251,8 +16251,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` tinyblob, - `c1` mediumblob + `c2` tinyblob DEFAULT NULL, + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -16264,7 +16264,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TINYBLOB NULL FIRST; SHOW TABLES; @@ -16273,8 +16273,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` tinyblob, - `c1` longblob + `c2` tinyblob DEFAULT NULL, + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -16286,7 +16286,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TINYBLOB NULL FIRST; SHOW TABLES; @@ -16295,8 +16295,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` tinyblob, - `c1` tinytext + `c2` tinyblob DEFAULT NULL, + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -16308,7 +16308,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TINYBLOB NULL FIRST; SHOW TABLES; @@ -16317,8 +16317,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` tinyblob, - `c1` text + `c2` tinyblob DEFAULT NULL, + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -16330,7 +16330,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TINYBLOB NULL FIRST; SHOW TABLES; @@ -16339,8 +16339,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` tinyblob, - `c1` mediumtext + `c2` tinyblob DEFAULT NULL, + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -16352,7 +16352,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TINYBLOB NULL FIRST; SHOW TABLES; @@ -16361,8 +16361,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` tinyblob, - `c1` longtext + `c2` tinyblob DEFAULT NULL, + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -16911,7 +16911,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` blob, + `c2` blob DEFAULT NULL, `c1` bit(1) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -16933,7 +16933,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` blob, + `c2` blob DEFAULT NULL, `c1` tinyint(4) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -16955,7 +16955,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` blob, + `c2` blob DEFAULT NULL, `c1` smallint(6) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -16977,7 +16977,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` blob, + `c2` blob DEFAULT NULL, `c1` mediumint(9) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -16999,7 +16999,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` blob, + `c2` blob DEFAULT NULL, `c1` int(11) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -17021,7 +17021,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` blob, + `c2` blob DEFAULT NULL, `c1` int(11) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -17043,7 +17043,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` blob, + `c2` blob DEFAULT NULL, `c1` bigint(20) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -17065,7 +17065,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` blob, + `c2` blob DEFAULT NULL, `c1` double DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -17087,7 +17087,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` blob, + `c2` blob DEFAULT NULL, `c1` double DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -17109,7 +17109,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` blob, + `c2` blob DEFAULT NULL, `c1` float DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -17131,7 +17131,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` blob, + `c2` blob DEFAULT NULL, `c1` decimal(10,0) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -17153,7 +17153,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` blob, + `c2` blob DEFAULT NULL, `c1` decimal(10,0) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -17175,7 +17175,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` blob, + `c2` blob DEFAULT NULL, `c1` date DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -17197,7 +17197,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` blob, + `c2` blob DEFAULT NULL, `c1` time DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -17219,7 +17219,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` blob, + `c2` blob DEFAULT NULL, `c1` timestamp NULL DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -17241,7 +17241,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` blob, + `c2` blob DEFAULT NULL, `c1` year(4) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -17254,7 +17254,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 BLOB NULL FIRST; SHOW TABLES; @@ -17263,8 +17263,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` blob, - `c1` tinyblob + `c2` blob DEFAULT NULL, + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -17276,7 +17276,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 BLOB NULL FIRST; SHOW TABLES; @@ -17285,8 +17285,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` blob, - `c1` blob + `c2` blob DEFAULT NULL, + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -17298,7 +17298,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 BLOB NULL FIRST; SHOW TABLES; @@ -17307,8 +17307,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` blob, - `c1` mediumblob + `c2` blob DEFAULT NULL, + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -17320,7 +17320,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 BLOB NULL FIRST; SHOW TABLES; @@ -17329,8 +17329,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` blob, - `c1` longblob + `c2` blob DEFAULT NULL, + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -17342,7 +17342,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 BLOB NULL FIRST; SHOW TABLES; @@ -17351,8 +17351,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` blob, - `c1` tinytext + `c2` blob DEFAULT NULL, + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -17364,7 +17364,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 BLOB NULL FIRST; SHOW TABLES; @@ -17373,8 +17373,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` blob, - `c1` text + `c2` blob DEFAULT NULL, + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -17386,7 +17386,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 BLOB NULL FIRST; SHOW TABLES; @@ -17395,8 +17395,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` blob, - `c1` mediumtext + `c2` blob DEFAULT NULL, + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -17408,7 +17408,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 BLOB NULL FIRST; SHOW TABLES; @@ -17417,8 +17417,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` blob, - `c1` longtext + `c2` blob DEFAULT NULL, + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -17967,7 +17967,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` mediumblob, + `c2` mediumblob DEFAULT NULL, `c1` bit(1) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -17989,7 +17989,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` mediumblob, + `c2` mediumblob DEFAULT NULL, `c1` tinyint(4) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -18011,7 +18011,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` mediumblob, + `c2` mediumblob DEFAULT NULL, `c1` smallint(6) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -18033,7 +18033,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` mediumblob, + `c2` mediumblob DEFAULT NULL, `c1` mediumint(9) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -18055,7 +18055,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` mediumblob, + `c2` mediumblob DEFAULT NULL, `c1` int(11) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -18077,7 +18077,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` mediumblob, + `c2` mediumblob DEFAULT NULL, `c1` int(11) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -18099,7 +18099,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` mediumblob, + `c2` mediumblob DEFAULT NULL, `c1` bigint(20) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -18121,7 +18121,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` mediumblob, + `c2` mediumblob DEFAULT NULL, `c1` double DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -18143,7 +18143,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` mediumblob, + `c2` mediumblob DEFAULT NULL, `c1` double DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -18165,7 +18165,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` mediumblob, + `c2` mediumblob DEFAULT NULL, `c1` float DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -18187,7 +18187,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` mediumblob, + `c2` mediumblob DEFAULT NULL, `c1` decimal(10,0) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -18209,7 +18209,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` mediumblob, + `c2` mediumblob DEFAULT NULL, `c1` decimal(10,0) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -18231,7 +18231,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` mediumblob, + `c2` mediumblob DEFAULT NULL, `c1` date DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -18253,7 +18253,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` mediumblob, + `c2` mediumblob DEFAULT NULL, `c1` time DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -18275,7 +18275,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` mediumblob, + `c2` mediumblob DEFAULT NULL, `c1` timestamp NULL DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -18297,7 +18297,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` mediumblob, + `c2` mediumblob DEFAULT NULL, `c1` year(4) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -18310,7 +18310,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 MEDIUMBLOB NULL FIRST; SHOW TABLES; @@ -18319,8 +18319,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` mediumblob, - `c1` tinyblob + `c2` mediumblob DEFAULT NULL, + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -18332,7 +18332,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 MEDIUMBLOB NULL FIRST; SHOW TABLES; @@ -18341,8 +18341,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` mediumblob, - `c1` blob + `c2` mediumblob DEFAULT NULL, + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -18354,7 +18354,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 MEDIUMBLOB NULL FIRST; SHOW TABLES; @@ -18363,8 +18363,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` mediumblob, - `c1` mediumblob + `c2` mediumblob DEFAULT NULL, + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -18376,7 +18376,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 MEDIUMBLOB NULL FIRST; SHOW TABLES; @@ -18385,8 +18385,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` mediumblob, - `c1` longblob + `c2` mediumblob DEFAULT NULL, + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -18398,7 +18398,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 MEDIUMBLOB NULL FIRST; SHOW TABLES; @@ -18407,8 +18407,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` mediumblob, - `c1` tinytext + `c2` mediumblob DEFAULT NULL, + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -18420,7 +18420,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 MEDIUMBLOB NULL FIRST; SHOW TABLES; @@ -18429,8 +18429,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` mediumblob, - `c1` text + `c2` mediumblob DEFAULT NULL, + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -18442,7 +18442,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 MEDIUMBLOB NULL FIRST; SHOW TABLES; @@ -18451,8 +18451,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` mediumblob, - `c1` mediumtext + `c2` mediumblob DEFAULT NULL, + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -18464,7 +18464,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 MEDIUMBLOB NULL FIRST; SHOW TABLES; @@ -18473,8 +18473,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` mediumblob, - `c1` longtext + `c2` mediumblob DEFAULT NULL, + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -19023,7 +19023,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` longblob, + `c2` longblob DEFAULT NULL, `c1` bit(1) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -19045,7 +19045,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` longblob, + `c2` longblob DEFAULT NULL, `c1` tinyint(4) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -19067,7 +19067,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` longblob, + `c2` longblob DEFAULT NULL, `c1` smallint(6) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -19089,7 +19089,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` longblob, + `c2` longblob DEFAULT NULL, `c1` mediumint(9) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -19111,7 +19111,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` longblob, + `c2` longblob DEFAULT NULL, `c1` int(11) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -19133,7 +19133,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` longblob, + `c2` longblob DEFAULT NULL, `c1` int(11) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -19155,7 +19155,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` longblob, + `c2` longblob DEFAULT NULL, `c1` bigint(20) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -19177,7 +19177,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` longblob, + `c2` longblob DEFAULT NULL, `c1` double DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -19199,7 +19199,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` longblob, + `c2` longblob DEFAULT NULL, `c1` double DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -19221,7 +19221,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` longblob, + `c2` longblob DEFAULT NULL, `c1` float DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -19243,7 +19243,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` longblob, + `c2` longblob DEFAULT NULL, `c1` decimal(10,0) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -19265,7 +19265,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` longblob, + `c2` longblob DEFAULT NULL, `c1` decimal(10,0) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -19287,7 +19287,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` longblob, + `c2` longblob DEFAULT NULL, `c1` date DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -19309,7 +19309,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` longblob, + `c2` longblob DEFAULT NULL, `c1` time DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -19331,7 +19331,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` longblob, + `c2` longblob DEFAULT NULL, `c1` timestamp NULL DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -19353,7 +19353,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` longblob, + `c2` longblob DEFAULT NULL, `c1` year(4) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -19366,7 +19366,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 LONGBLOB NULL FIRST; SHOW TABLES; @@ -19375,8 +19375,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` longblob, - `c1` tinyblob + `c2` longblob DEFAULT NULL, + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -19388,7 +19388,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 LONGBLOB NULL FIRST; SHOW TABLES; @@ -19397,8 +19397,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` longblob, - `c1` blob + `c2` longblob DEFAULT NULL, + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -19410,7 +19410,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 LONGBLOB NULL FIRST; SHOW TABLES; @@ -19419,8 +19419,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` longblob, - `c1` mediumblob + `c2` longblob DEFAULT NULL, + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -19432,7 +19432,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 LONGBLOB NULL FIRST; SHOW TABLES; @@ -19441,8 +19441,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` longblob, - `c1` longblob + `c2` longblob DEFAULT NULL, + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -19454,7 +19454,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 LONGBLOB NULL FIRST; SHOW TABLES; @@ -19463,8 +19463,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` longblob, - `c1` tinytext + `c2` longblob DEFAULT NULL, + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -19476,7 +19476,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 LONGBLOB NULL FIRST; SHOW TABLES; @@ -19485,8 +19485,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` longblob, - `c1` text + `c2` longblob DEFAULT NULL, + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -19498,7 +19498,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 LONGBLOB NULL FIRST; SHOW TABLES; @@ -19507,8 +19507,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` longblob, - `c1` mediumtext + `c2` longblob DEFAULT NULL, + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -19520,7 +19520,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 LONGBLOB NULL FIRST; SHOW TABLES; @@ -19529,8 +19529,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` longblob, - `c1` longtext + `c2` longblob DEFAULT NULL, + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -20079,7 +20079,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` tinytext, + `c2` tinytext DEFAULT NULL, `c1` bit(1) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -20101,7 +20101,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` tinytext, + `c2` tinytext DEFAULT NULL, `c1` tinyint(4) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -20123,7 +20123,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` tinytext, + `c2` tinytext DEFAULT NULL, `c1` smallint(6) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -20145,7 +20145,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` tinytext, + `c2` tinytext DEFAULT NULL, `c1` mediumint(9) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -20167,7 +20167,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` tinytext, + `c2` tinytext DEFAULT NULL, `c1` int(11) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -20189,7 +20189,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` tinytext, + `c2` tinytext DEFAULT NULL, `c1` int(11) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -20211,7 +20211,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` tinytext, + `c2` tinytext DEFAULT NULL, `c1` bigint(20) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -20233,7 +20233,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` tinytext, + `c2` tinytext DEFAULT NULL, `c1` double DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -20255,7 +20255,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` tinytext, + `c2` tinytext DEFAULT NULL, `c1` double DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -20277,7 +20277,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` tinytext, + `c2` tinytext DEFAULT NULL, `c1` float DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -20299,7 +20299,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` tinytext, + `c2` tinytext DEFAULT NULL, `c1` decimal(10,0) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -20321,7 +20321,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` tinytext, + `c2` tinytext DEFAULT NULL, `c1` decimal(10,0) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -20343,7 +20343,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` tinytext, + `c2` tinytext DEFAULT NULL, `c1` date DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -20365,7 +20365,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` tinytext, + `c2` tinytext DEFAULT NULL, `c1` time DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -20387,7 +20387,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` tinytext, + `c2` tinytext DEFAULT NULL, `c1` timestamp NULL DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -20409,7 +20409,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` tinytext, + `c2` tinytext DEFAULT NULL, `c1` year(4) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -20422,7 +20422,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TINYTEXT NULL FIRST; SHOW TABLES; @@ -20431,8 +20431,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` tinytext, - `c1` tinyblob + `c2` tinytext DEFAULT NULL, + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -20444,7 +20444,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TINYTEXT NULL FIRST; SHOW TABLES; @@ -20453,8 +20453,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` tinytext, - `c1` blob + `c2` tinytext DEFAULT NULL, + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -20466,7 +20466,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TINYTEXT NULL FIRST; SHOW TABLES; @@ -20475,8 +20475,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` tinytext, - `c1` mediumblob + `c2` tinytext DEFAULT NULL, + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -20488,7 +20488,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TINYTEXT NULL FIRST; SHOW TABLES; @@ -20497,8 +20497,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` tinytext, - `c1` longblob + `c2` tinytext DEFAULT NULL, + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -20510,7 +20510,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TINYTEXT NULL FIRST; SHOW TABLES; @@ -20519,8 +20519,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` tinytext, - `c1` tinytext + `c2` tinytext DEFAULT NULL, + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -20532,7 +20532,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TINYTEXT NULL FIRST; SHOW TABLES; @@ -20541,8 +20541,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` tinytext, - `c1` text + `c2` tinytext DEFAULT NULL, + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -20554,7 +20554,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TINYTEXT NULL FIRST; SHOW TABLES; @@ -20563,8 +20563,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` tinytext, - `c1` mediumtext + `c2` tinytext DEFAULT NULL, + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -20576,7 +20576,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TINYTEXT NULL FIRST; SHOW TABLES; @@ -20585,8 +20585,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` tinytext, - `c1` longtext + `c2` tinytext DEFAULT NULL, + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -21135,7 +21135,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` text, + `c2` text DEFAULT NULL, `c1` bit(1) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -21157,7 +21157,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` text, + `c2` text DEFAULT NULL, `c1` tinyint(4) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -21179,7 +21179,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` text, + `c2` text DEFAULT NULL, `c1` smallint(6) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -21201,7 +21201,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` text, + `c2` text DEFAULT NULL, `c1` mediumint(9) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -21223,7 +21223,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` text, + `c2` text DEFAULT NULL, `c1` int(11) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -21245,7 +21245,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` text, + `c2` text DEFAULT NULL, `c1` int(11) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -21267,7 +21267,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` text, + `c2` text DEFAULT NULL, `c1` bigint(20) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -21289,7 +21289,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` text, + `c2` text DEFAULT NULL, `c1` double DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -21311,7 +21311,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` text, + `c2` text DEFAULT NULL, `c1` double DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -21333,7 +21333,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` text, + `c2` text DEFAULT NULL, `c1` float DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -21355,7 +21355,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` text, + `c2` text DEFAULT NULL, `c1` decimal(10,0) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -21377,7 +21377,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` text, + `c2` text DEFAULT NULL, `c1` decimal(10,0) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -21399,7 +21399,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` text, + `c2` text DEFAULT NULL, `c1` date DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -21421,7 +21421,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` text, + `c2` text DEFAULT NULL, `c1` time DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -21443,7 +21443,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` text, + `c2` text DEFAULT NULL, `c1` timestamp NULL DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -21465,7 +21465,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` text, + `c2` text DEFAULT NULL, `c1` year(4) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -21478,7 +21478,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TEXT NULL FIRST; SHOW TABLES; @@ -21487,8 +21487,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` text, - `c1` tinyblob + `c2` text DEFAULT NULL, + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -21500,7 +21500,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TEXT NULL FIRST; SHOW TABLES; @@ -21509,8 +21509,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` text, - `c1` blob + `c2` text DEFAULT NULL, + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -21522,7 +21522,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TEXT NULL FIRST; SHOW TABLES; @@ -21531,8 +21531,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` text, - `c1` mediumblob + `c2` text DEFAULT NULL, + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -21544,7 +21544,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TEXT NULL FIRST; SHOW TABLES; @@ -21553,8 +21553,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` text, - `c1` longblob + `c2` text DEFAULT NULL, + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -21566,7 +21566,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TEXT NULL FIRST; SHOW TABLES; @@ -21575,8 +21575,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` text, - `c1` tinytext + `c2` text DEFAULT NULL, + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -21588,7 +21588,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TEXT NULL FIRST; SHOW TABLES; @@ -21597,8 +21597,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` text, - `c1` text + `c2` text DEFAULT NULL, + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -21610,7 +21610,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TEXT NULL FIRST; SHOW TABLES; @@ -21619,8 +21619,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` text, - `c1` mediumtext + `c2` text DEFAULT NULL, + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -21632,7 +21632,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 TEXT NULL FIRST; SHOW TABLES; @@ -21641,8 +21641,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` text, - `c1` longtext + `c2` text DEFAULT NULL, + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -22191,7 +22191,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` mediumtext, + `c2` mediumtext DEFAULT NULL, `c1` bit(1) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -22213,7 +22213,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` mediumtext, + `c2` mediumtext DEFAULT NULL, `c1` tinyint(4) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -22235,7 +22235,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` mediumtext, + `c2` mediumtext DEFAULT NULL, `c1` smallint(6) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -22257,7 +22257,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` mediumtext, + `c2` mediumtext DEFAULT NULL, `c1` mediumint(9) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -22279,7 +22279,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` mediumtext, + `c2` mediumtext DEFAULT NULL, `c1` int(11) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -22301,7 +22301,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` mediumtext, + `c2` mediumtext DEFAULT NULL, `c1` int(11) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -22323,7 +22323,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` mediumtext, + `c2` mediumtext DEFAULT NULL, `c1` bigint(20) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -22345,7 +22345,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` mediumtext, + `c2` mediumtext DEFAULT NULL, `c1` double DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -22367,7 +22367,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` mediumtext, + `c2` mediumtext DEFAULT NULL, `c1` double DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -22389,7 +22389,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` mediumtext, + `c2` mediumtext DEFAULT NULL, `c1` float DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -22411,7 +22411,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` mediumtext, + `c2` mediumtext DEFAULT NULL, `c1` decimal(10,0) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -22433,7 +22433,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` mediumtext, + `c2` mediumtext DEFAULT NULL, `c1` decimal(10,0) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -22455,7 +22455,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` mediumtext, + `c2` mediumtext DEFAULT NULL, `c1` date DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -22477,7 +22477,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` mediumtext, + `c2` mediumtext DEFAULT NULL, `c1` time DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -22499,7 +22499,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` mediumtext, + `c2` mediumtext DEFAULT NULL, `c1` timestamp NULL DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -22521,7 +22521,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` mediumtext, + `c2` mediumtext DEFAULT NULL, `c1` year(4) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -22534,7 +22534,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 MEDIUMTEXT NULL FIRST; SHOW TABLES; @@ -22543,8 +22543,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` mediumtext, - `c1` tinyblob + `c2` mediumtext DEFAULT NULL, + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -22556,7 +22556,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 MEDIUMTEXT NULL FIRST; SHOW TABLES; @@ -22565,8 +22565,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` mediumtext, - `c1` blob + `c2` mediumtext DEFAULT NULL, + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -22578,7 +22578,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 MEDIUMTEXT NULL FIRST; SHOW TABLES; @@ -22587,8 +22587,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` mediumtext, - `c1` mediumblob + `c2` mediumtext DEFAULT NULL, + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -22600,7 +22600,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 MEDIUMTEXT NULL FIRST; SHOW TABLES; @@ -22609,8 +22609,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` mediumtext, - `c1` longblob + `c2` mediumtext DEFAULT NULL, + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -22622,7 +22622,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 MEDIUMTEXT NULL FIRST; SHOW TABLES; @@ -22631,8 +22631,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` mediumtext, - `c1` tinytext + `c2` mediumtext DEFAULT NULL, + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -22644,7 +22644,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 MEDIUMTEXT NULL FIRST; SHOW TABLES; @@ -22653,8 +22653,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` mediumtext, - `c1` text + `c2` mediumtext DEFAULT NULL, + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -22666,7 +22666,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 MEDIUMTEXT NULL FIRST; SHOW TABLES; @@ -22675,8 +22675,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` mediumtext, - `c1` mediumtext + `c2` mediumtext DEFAULT NULL, + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -22688,7 +22688,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 MEDIUMTEXT NULL FIRST; SHOW TABLES; @@ -22697,8 +22697,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` mediumtext, - `c1` longtext + `c2` mediumtext DEFAULT NULL, + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -23247,7 +23247,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` longtext, + `c2` longtext DEFAULT NULL, `c1` bit(1) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -23269,7 +23269,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` longtext, + `c2` longtext DEFAULT NULL, `c1` tinyint(4) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -23291,7 +23291,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` longtext, + `c2` longtext DEFAULT NULL, `c1` smallint(6) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -23313,7 +23313,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` longtext, + `c2` longtext DEFAULT NULL, `c1` mediumint(9) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -23335,7 +23335,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` longtext, + `c2` longtext DEFAULT NULL, `c1` int(11) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -23357,7 +23357,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` longtext, + `c2` longtext DEFAULT NULL, `c1` int(11) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -23379,7 +23379,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` longtext, + `c2` longtext DEFAULT NULL, `c1` bigint(20) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -23401,7 +23401,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` longtext, + `c2` longtext DEFAULT NULL, `c1` double DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -23423,7 +23423,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` longtext, + `c2` longtext DEFAULT NULL, `c1` double DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -23445,7 +23445,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` longtext, + `c2` longtext DEFAULT NULL, `c1` float DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -23467,7 +23467,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` longtext, + `c2` longtext DEFAULT NULL, `c1` decimal(10,0) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -23489,7 +23489,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` longtext, + `c2` longtext DEFAULT NULL, `c1` decimal(10,0) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -23511,7 +23511,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` longtext, + `c2` longtext DEFAULT NULL, `c1` date DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -23533,7 +23533,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` longtext, + `c2` longtext DEFAULT NULL, `c1` time DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -23555,7 +23555,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` longtext, + `c2` longtext DEFAULT NULL, `c1` timestamp NULL DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -23577,7 +23577,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` longtext, + `c2` longtext DEFAULT NULL, `c1` year(4) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -23590,7 +23590,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 LONGTEXT NULL FIRST; SHOW TABLES; @@ -23599,8 +23599,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` longtext, - `c1` tinyblob + `c2` longtext DEFAULT NULL, + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -23612,7 +23612,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 LONGTEXT NULL FIRST; SHOW TABLES; @@ -23621,8 +23621,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` longtext, - `c1` blob + `c2` longtext DEFAULT NULL, + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -23634,7 +23634,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 LONGTEXT NULL FIRST; SHOW TABLES; @@ -23643,8 +23643,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` longtext, - `c1` mediumblob + `c2` longtext DEFAULT NULL, + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -23656,7 +23656,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 LONGTEXT NULL FIRST; SHOW TABLES; @@ -23665,8 +23665,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` longtext, - `c1` longblob + `c2` longtext DEFAULT NULL, + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -23678,7 +23678,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 LONGTEXT NULL FIRST; SHOW TABLES; @@ -23687,8 +23687,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` longtext, - `c1` tinytext + `c2` longtext DEFAULT NULL, + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -23700,7 +23700,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 LONGTEXT NULL FIRST; SHOW TABLES; @@ -23709,8 +23709,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` longtext, - `c1` text + `c2` longtext DEFAULT NULL, + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -23722,7 +23722,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 LONGTEXT NULL FIRST; SHOW TABLES; @@ -23731,8 +23731,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` longtext, - `c1` mediumtext + `c2` longtext DEFAULT NULL, + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -23744,7 +23744,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c2 LONGTEXT NULL FIRST; SHOW TABLES; @@ -23753,8 +23753,8 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` longtext, - `c1` longtext + `c2` longtext DEFAULT NULL, + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; diff --git a/mysql-test/suite/engines/funcs/r/ta_add_column_first2.result b/mysql-test/suite/engines/funcs/r/ta_add_column_first2.result index 382e62f5c04..8c0871e4f77 100644 --- a/mysql-test/suite/engines/funcs/r/ta_add_column_first2.result +++ b/mysql-test/suite/engines/funcs/r/ta_add_column_first2.result @@ -2831,7 +2831,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` tinyblob, + `c2` tinyblob DEFAULT NULL, `c1` char(15) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -2853,7 +2853,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` tinyblob, + `c2` tinyblob DEFAULT NULL, `c1` varchar(15) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -2875,7 +2875,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` tinyblob, + `c2` tinyblob DEFAULT NULL, `c1` binary(15) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -2897,7 +2897,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` tinyblob, + `c2` tinyblob DEFAULT NULL, `c1` varbinary(15) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -3007,7 +3007,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` blob, + `c2` blob DEFAULT NULL, `c1` char(15) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -3029,7 +3029,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` blob, + `c2` blob DEFAULT NULL, `c1` varchar(15) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -3051,7 +3051,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` blob, + `c2` blob DEFAULT NULL, `c1` binary(15) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -3073,7 +3073,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` blob, + `c2` blob DEFAULT NULL, `c1` varbinary(15) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -3183,7 +3183,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` mediumblob, + `c2` mediumblob DEFAULT NULL, `c1` char(15) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -3205,7 +3205,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` mediumblob, + `c2` mediumblob DEFAULT NULL, `c1` varchar(15) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -3227,7 +3227,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` mediumblob, + `c2` mediumblob DEFAULT NULL, `c1` binary(15) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -3249,7 +3249,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` mediumblob, + `c2` mediumblob DEFAULT NULL, `c1` varbinary(15) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -3359,7 +3359,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` longblob, + `c2` longblob DEFAULT NULL, `c1` char(15) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -3381,7 +3381,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` longblob, + `c2` longblob DEFAULT NULL, `c1` varchar(15) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -3403,7 +3403,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` longblob, + `c2` longblob DEFAULT NULL, `c1` binary(15) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -3425,7 +3425,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` longblob, + `c2` longblob DEFAULT NULL, `c1` varbinary(15) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -3535,7 +3535,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` tinytext, + `c2` tinytext DEFAULT NULL, `c1` char(15) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -3557,7 +3557,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` tinytext, + `c2` tinytext DEFAULT NULL, `c1` varchar(15) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -3579,7 +3579,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` tinytext, + `c2` tinytext DEFAULT NULL, `c1` binary(15) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -3601,7 +3601,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` tinytext, + `c2` tinytext DEFAULT NULL, `c1` varbinary(15) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -3711,7 +3711,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` text, + `c2` text DEFAULT NULL, `c1` char(15) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -3733,7 +3733,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` text, + `c2` text DEFAULT NULL, `c1` varchar(15) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -3755,7 +3755,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` text, + `c2` text DEFAULT NULL, `c1` binary(15) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -3777,7 +3777,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` text, + `c2` text DEFAULT NULL, `c1` varbinary(15) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -3887,7 +3887,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` mediumtext, + `c2` mediumtext DEFAULT NULL, `c1` char(15) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -3909,7 +3909,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` mediumtext, + `c2` mediumtext DEFAULT NULL, `c1` varchar(15) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -3931,7 +3931,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` mediumtext, + `c2` mediumtext DEFAULT NULL, `c1` binary(15) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -3953,7 +3953,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` mediumtext, + `c2` mediumtext DEFAULT NULL, `c1` varbinary(15) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -4063,7 +4063,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` longtext, + `c2` longtext DEFAULT NULL, `c1` char(15) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -4085,7 +4085,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` longtext, + `c2` longtext DEFAULT NULL, `c1` varchar(15) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -4107,7 +4107,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` longtext, + `c2` longtext DEFAULT NULL, `c1` binary(15) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -4129,7 +4129,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c2` longtext, + `c2` longtext DEFAULT NULL, `c1` varbinary(15) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; diff --git a/mysql-test/suite/engines/funcs/r/ta_add_column_middle.result b/mysql-test/suite/engines/funcs/r/ta_add_column_middle.result index 6f900ca7b29..75deecf05b7 100644 --- a/mysql-test/suite/engines/funcs/r/ta_add_column_middle.result +++ b/mysql-test/suite/engines/funcs/r/ta_add_column_middle.result @@ -455,8 +455,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinyblob, - `c3` tinyblob, + `c2` tinyblob DEFAULT NULL, + `c3` tinyblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 BIT NULL AFTER c2; @@ -467,9 +467,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinyblob, + `c2` tinyblob DEFAULT NULL, `c4` bit(1) DEFAULT NULL, - `c3` tinyblob, + `c3` tinyblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -483,8 +483,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` blob, - `c3` blob, + `c2` blob DEFAULT NULL, + `c3` blob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 BIT NULL AFTER c2; @@ -495,9 +495,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` blob, + `c2` blob DEFAULT NULL, `c4` bit(1) DEFAULT NULL, - `c3` blob, + `c3` blob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -511,8 +511,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumblob, - `c3` mediumblob, + `c2` mediumblob DEFAULT NULL, + `c3` mediumblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 BIT NULL AFTER c2; @@ -523,9 +523,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumblob, + `c2` mediumblob DEFAULT NULL, `c4` bit(1) DEFAULT NULL, - `c3` mediumblob, + `c3` mediumblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -539,8 +539,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longblob, - `c3` longblob, + `c2` longblob DEFAULT NULL, + `c3` longblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 BIT NULL AFTER c2; @@ -551,9 +551,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longblob, + `c2` longblob DEFAULT NULL, `c4` bit(1) DEFAULT NULL, - `c3` longblob, + `c3` longblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -567,8 +567,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinytext, - `c3` tinytext, + `c2` tinytext DEFAULT NULL, + `c3` tinytext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 BIT NULL AFTER c2; @@ -579,9 +579,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinytext, + `c2` tinytext DEFAULT NULL, `c4` bit(1) DEFAULT NULL, - `c3` tinytext, + `c3` tinytext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -595,8 +595,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` text, - `c3` text, + `c2` text DEFAULT NULL, + `c3` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 BIT NULL AFTER c2; @@ -607,9 +607,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` text, + `c2` text DEFAULT NULL, `c4` bit(1) DEFAULT NULL, - `c3` text, + `c3` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -623,8 +623,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumtext, - `c3` mediumtext, + `c2` mediumtext DEFAULT NULL, + `c3` mediumtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 BIT NULL AFTER c2; @@ -635,9 +635,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumtext, + `c2` mediumtext DEFAULT NULL, `c4` bit(1) DEFAULT NULL, - `c3` mediumtext, + `c3` mediumtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -651,8 +651,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longtext, - `c3` longtext, + `c2` longtext DEFAULT NULL, + `c3` longtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 BIT NULL AFTER c2; @@ -663,9 +663,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longtext, + `c2` longtext DEFAULT NULL, `c4` bit(1) DEFAULT NULL, - `c3` longtext, + `c3` longtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -1799,8 +1799,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinyblob, - `c3` tinyblob, + `c2` tinyblob DEFAULT NULL, + `c3` tinyblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 TINYINT NULL AFTER c2; @@ -1811,9 +1811,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinyblob, + `c2` tinyblob DEFAULT NULL, `c4` tinyint(4) DEFAULT NULL, - `c3` tinyblob, + `c3` tinyblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -1827,8 +1827,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` blob, - `c3` blob, + `c2` blob DEFAULT NULL, + `c3` blob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 TINYINT NULL AFTER c2; @@ -1839,9 +1839,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` blob, + `c2` blob DEFAULT NULL, `c4` tinyint(4) DEFAULT NULL, - `c3` blob, + `c3` blob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -1855,8 +1855,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumblob, - `c3` mediumblob, + `c2` mediumblob DEFAULT NULL, + `c3` mediumblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 TINYINT NULL AFTER c2; @@ -1867,9 +1867,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumblob, + `c2` mediumblob DEFAULT NULL, `c4` tinyint(4) DEFAULT NULL, - `c3` mediumblob, + `c3` mediumblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -1883,8 +1883,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longblob, - `c3` longblob, + `c2` longblob DEFAULT NULL, + `c3` longblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 TINYINT NULL AFTER c2; @@ -1895,9 +1895,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longblob, + `c2` longblob DEFAULT NULL, `c4` tinyint(4) DEFAULT NULL, - `c3` longblob, + `c3` longblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -1911,8 +1911,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinytext, - `c3` tinytext, + `c2` tinytext DEFAULT NULL, + `c3` tinytext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 TINYINT NULL AFTER c2; @@ -1923,9 +1923,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinytext, + `c2` tinytext DEFAULT NULL, `c4` tinyint(4) DEFAULT NULL, - `c3` tinytext, + `c3` tinytext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -1939,8 +1939,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` text, - `c3` text, + `c2` text DEFAULT NULL, + `c3` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 TINYINT NULL AFTER c2; @@ -1951,9 +1951,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` text, + `c2` text DEFAULT NULL, `c4` tinyint(4) DEFAULT NULL, - `c3` text, + `c3` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -1967,8 +1967,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumtext, - `c3` mediumtext, + `c2` mediumtext DEFAULT NULL, + `c3` mediumtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 TINYINT NULL AFTER c2; @@ -1979,9 +1979,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumtext, + `c2` mediumtext DEFAULT NULL, `c4` tinyint(4) DEFAULT NULL, - `c3` mediumtext, + `c3` mediumtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -1995,8 +1995,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longtext, - `c3` longtext, + `c2` longtext DEFAULT NULL, + `c3` longtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 TINYINT NULL AFTER c2; @@ -2007,9 +2007,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longtext, + `c2` longtext DEFAULT NULL, `c4` tinyint(4) DEFAULT NULL, - `c3` longtext, + `c3` longtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -3143,8 +3143,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinyblob, - `c3` tinyblob, + `c2` tinyblob DEFAULT NULL, + `c3` tinyblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 SMALLINT NULL AFTER c2; @@ -3155,9 +3155,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinyblob, + `c2` tinyblob DEFAULT NULL, `c4` smallint(6) DEFAULT NULL, - `c3` tinyblob, + `c3` tinyblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -3171,8 +3171,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` blob, - `c3` blob, + `c2` blob DEFAULT NULL, + `c3` blob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 SMALLINT NULL AFTER c2; @@ -3183,9 +3183,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` blob, + `c2` blob DEFAULT NULL, `c4` smallint(6) DEFAULT NULL, - `c3` blob, + `c3` blob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -3199,8 +3199,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumblob, - `c3` mediumblob, + `c2` mediumblob DEFAULT NULL, + `c3` mediumblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 SMALLINT NULL AFTER c2; @@ -3211,9 +3211,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumblob, + `c2` mediumblob DEFAULT NULL, `c4` smallint(6) DEFAULT NULL, - `c3` mediumblob, + `c3` mediumblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -3227,8 +3227,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longblob, - `c3` longblob, + `c2` longblob DEFAULT NULL, + `c3` longblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 SMALLINT NULL AFTER c2; @@ -3239,9 +3239,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longblob, + `c2` longblob DEFAULT NULL, `c4` smallint(6) DEFAULT NULL, - `c3` longblob, + `c3` longblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -3255,8 +3255,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinytext, - `c3` tinytext, + `c2` tinytext DEFAULT NULL, + `c3` tinytext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 SMALLINT NULL AFTER c2; @@ -3267,9 +3267,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinytext, + `c2` tinytext DEFAULT NULL, `c4` smallint(6) DEFAULT NULL, - `c3` tinytext, + `c3` tinytext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -3283,8 +3283,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` text, - `c3` text, + `c2` text DEFAULT NULL, + `c3` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 SMALLINT NULL AFTER c2; @@ -3295,9 +3295,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` text, + `c2` text DEFAULT NULL, `c4` smallint(6) DEFAULT NULL, - `c3` text, + `c3` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -3311,8 +3311,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumtext, - `c3` mediumtext, + `c2` mediumtext DEFAULT NULL, + `c3` mediumtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 SMALLINT NULL AFTER c2; @@ -3323,9 +3323,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumtext, + `c2` mediumtext DEFAULT NULL, `c4` smallint(6) DEFAULT NULL, - `c3` mediumtext, + `c3` mediumtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -3339,8 +3339,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longtext, - `c3` longtext, + `c2` longtext DEFAULT NULL, + `c3` longtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 SMALLINT NULL AFTER c2; @@ -3351,9 +3351,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longtext, + `c2` longtext DEFAULT NULL, `c4` smallint(6) DEFAULT NULL, - `c3` longtext, + `c3` longtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -4487,8 +4487,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinyblob, - `c3` tinyblob, + `c2` tinyblob DEFAULT NULL, + `c3` tinyblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 MEDIUMINT NULL AFTER c2; @@ -4499,9 +4499,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinyblob, + `c2` tinyblob DEFAULT NULL, `c4` mediumint(9) DEFAULT NULL, - `c3` tinyblob, + `c3` tinyblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -4515,8 +4515,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` blob, - `c3` blob, + `c2` blob DEFAULT NULL, + `c3` blob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 MEDIUMINT NULL AFTER c2; @@ -4527,9 +4527,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` blob, + `c2` blob DEFAULT NULL, `c4` mediumint(9) DEFAULT NULL, - `c3` blob, + `c3` blob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -4543,8 +4543,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumblob, - `c3` mediumblob, + `c2` mediumblob DEFAULT NULL, + `c3` mediumblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 MEDIUMINT NULL AFTER c2; @@ -4555,9 +4555,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumblob, + `c2` mediumblob DEFAULT NULL, `c4` mediumint(9) DEFAULT NULL, - `c3` mediumblob, + `c3` mediumblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -4571,8 +4571,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longblob, - `c3` longblob, + `c2` longblob DEFAULT NULL, + `c3` longblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 MEDIUMINT NULL AFTER c2; @@ -4583,9 +4583,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longblob, + `c2` longblob DEFAULT NULL, `c4` mediumint(9) DEFAULT NULL, - `c3` longblob, + `c3` longblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -4599,8 +4599,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinytext, - `c3` tinytext, + `c2` tinytext DEFAULT NULL, + `c3` tinytext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 MEDIUMINT NULL AFTER c2; @@ -4611,9 +4611,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinytext, + `c2` tinytext DEFAULT NULL, `c4` mediumint(9) DEFAULT NULL, - `c3` tinytext, + `c3` tinytext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -4627,8 +4627,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` text, - `c3` text, + `c2` text DEFAULT NULL, + `c3` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 MEDIUMINT NULL AFTER c2; @@ -4639,9 +4639,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` text, + `c2` text DEFAULT NULL, `c4` mediumint(9) DEFAULT NULL, - `c3` text, + `c3` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -4655,8 +4655,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumtext, - `c3` mediumtext, + `c2` mediumtext DEFAULT NULL, + `c3` mediumtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 MEDIUMINT NULL AFTER c2; @@ -4667,9 +4667,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumtext, + `c2` mediumtext DEFAULT NULL, `c4` mediumint(9) DEFAULT NULL, - `c3` mediumtext, + `c3` mediumtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -4683,8 +4683,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longtext, - `c3` longtext, + `c2` longtext DEFAULT NULL, + `c3` longtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 MEDIUMINT NULL AFTER c2; @@ -4695,9 +4695,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longtext, + `c2` longtext DEFAULT NULL, `c4` mediumint(9) DEFAULT NULL, - `c3` longtext, + `c3` longtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -5831,8 +5831,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinyblob, - `c3` tinyblob, + `c2` tinyblob DEFAULT NULL, + `c3` tinyblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 INT NULL AFTER c2; @@ -5843,9 +5843,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinyblob, + `c2` tinyblob DEFAULT NULL, `c4` int(11) DEFAULT NULL, - `c3` tinyblob, + `c3` tinyblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -5859,8 +5859,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` blob, - `c3` blob, + `c2` blob DEFAULT NULL, + `c3` blob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 INT NULL AFTER c2; @@ -5871,9 +5871,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` blob, + `c2` blob DEFAULT NULL, `c4` int(11) DEFAULT NULL, - `c3` blob, + `c3` blob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -5887,8 +5887,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumblob, - `c3` mediumblob, + `c2` mediumblob DEFAULT NULL, + `c3` mediumblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 INT NULL AFTER c2; @@ -5899,9 +5899,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumblob, + `c2` mediumblob DEFAULT NULL, `c4` int(11) DEFAULT NULL, - `c3` mediumblob, + `c3` mediumblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -5915,8 +5915,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longblob, - `c3` longblob, + `c2` longblob DEFAULT NULL, + `c3` longblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 INT NULL AFTER c2; @@ -5927,9 +5927,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longblob, + `c2` longblob DEFAULT NULL, `c4` int(11) DEFAULT NULL, - `c3` longblob, + `c3` longblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -5943,8 +5943,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinytext, - `c3` tinytext, + `c2` tinytext DEFAULT NULL, + `c3` tinytext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 INT NULL AFTER c2; @@ -5955,9 +5955,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinytext, + `c2` tinytext DEFAULT NULL, `c4` int(11) DEFAULT NULL, - `c3` tinytext, + `c3` tinytext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -5971,8 +5971,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` text, - `c3` text, + `c2` text DEFAULT NULL, + `c3` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 INT NULL AFTER c2; @@ -5983,9 +5983,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` text, + `c2` text DEFAULT NULL, `c4` int(11) DEFAULT NULL, - `c3` text, + `c3` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -5999,8 +5999,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumtext, - `c3` mediumtext, + `c2` mediumtext DEFAULT NULL, + `c3` mediumtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 INT NULL AFTER c2; @@ -6011,9 +6011,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumtext, + `c2` mediumtext DEFAULT NULL, `c4` int(11) DEFAULT NULL, - `c3` mediumtext, + `c3` mediumtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -6027,8 +6027,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longtext, - `c3` longtext, + `c2` longtext DEFAULT NULL, + `c3` longtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 INT NULL AFTER c2; @@ -6039,9 +6039,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longtext, + `c2` longtext DEFAULT NULL, `c4` int(11) DEFAULT NULL, - `c3` longtext, + `c3` longtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -7175,8 +7175,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinyblob, - `c3` tinyblob, + `c2` tinyblob DEFAULT NULL, + `c3` tinyblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 INTEGER NULL AFTER c2; @@ -7187,9 +7187,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinyblob, + `c2` tinyblob DEFAULT NULL, `c4` int(11) DEFAULT NULL, - `c3` tinyblob, + `c3` tinyblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -7203,8 +7203,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` blob, - `c3` blob, + `c2` blob DEFAULT NULL, + `c3` blob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 INTEGER NULL AFTER c2; @@ -7215,9 +7215,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` blob, + `c2` blob DEFAULT NULL, `c4` int(11) DEFAULT NULL, - `c3` blob, + `c3` blob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -7231,8 +7231,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumblob, - `c3` mediumblob, + `c2` mediumblob DEFAULT NULL, + `c3` mediumblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 INTEGER NULL AFTER c2; @@ -7243,9 +7243,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumblob, + `c2` mediumblob DEFAULT NULL, `c4` int(11) DEFAULT NULL, - `c3` mediumblob, + `c3` mediumblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -7259,8 +7259,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longblob, - `c3` longblob, + `c2` longblob DEFAULT NULL, + `c3` longblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 INTEGER NULL AFTER c2; @@ -7271,9 +7271,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longblob, + `c2` longblob DEFAULT NULL, `c4` int(11) DEFAULT NULL, - `c3` longblob, + `c3` longblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -7287,8 +7287,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinytext, - `c3` tinytext, + `c2` tinytext DEFAULT NULL, + `c3` tinytext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 INTEGER NULL AFTER c2; @@ -7299,9 +7299,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinytext, + `c2` tinytext DEFAULT NULL, `c4` int(11) DEFAULT NULL, - `c3` tinytext, + `c3` tinytext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -7315,8 +7315,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` text, - `c3` text, + `c2` text DEFAULT NULL, + `c3` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 INTEGER NULL AFTER c2; @@ -7327,9 +7327,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` text, + `c2` text DEFAULT NULL, `c4` int(11) DEFAULT NULL, - `c3` text, + `c3` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -7343,8 +7343,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumtext, - `c3` mediumtext, + `c2` mediumtext DEFAULT NULL, + `c3` mediumtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 INTEGER NULL AFTER c2; @@ -7355,9 +7355,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumtext, + `c2` mediumtext DEFAULT NULL, `c4` int(11) DEFAULT NULL, - `c3` mediumtext, + `c3` mediumtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -7371,8 +7371,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longtext, - `c3` longtext, + `c2` longtext DEFAULT NULL, + `c3` longtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 INTEGER NULL AFTER c2; @@ -7383,9 +7383,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longtext, + `c2` longtext DEFAULT NULL, `c4` int(11) DEFAULT NULL, - `c3` longtext, + `c3` longtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -8519,8 +8519,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinyblob, - `c3` tinyblob, + `c2` tinyblob DEFAULT NULL, + `c3` tinyblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 BIGINT NULL AFTER c2; @@ -8531,9 +8531,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinyblob, + `c2` tinyblob DEFAULT NULL, `c4` bigint(20) DEFAULT NULL, - `c3` tinyblob, + `c3` tinyblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -8547,8 +8547,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` blob, - `c3` blob, + `c2` blob DEFAULT NULL, + `c3` blob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 BIGINT NULL AFTER c2; @@ -8559,9 +8559,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` blob, + `c2` blob DEFAULT NULL, `c4` bigint(20) DEFAULT NULL, - `c3` blob, + `c3` blob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -8575,8 +8575,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumblob, - `c3` mediumblob, + `c2` mediumblob DEFAULT NULL, + `c3` mediumblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 BIGINT NULL AFTER c2; @@ -8587,9 +8587,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumblob, + `c2` mediumblob DEFAULT NULL, `c4` bigint(20) DEFAULT NULL, - `c3` mediumblob, + `c3` mediumblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -8603,8 +8603,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longblob, - `c3` longblob, + `c2` longblob DEFAULT NULL, + `c3` longblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 BIGINT NULL AFTER c2; @@ -8615,9 +8615,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longblob, + `c2` longblob DEFAULT NULL, `c4` bigint(20) DEFAULT NULL, - `c3` longblob, + `c3` longblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -8631,8 +8631,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinytext, - `c3` tinytext, + `c2` tinytext DEFAULT NULL, + `c3` tinytext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 BIGINT NULL AFTER c2; @@ -8643,9 +8643,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinytext, + `c2` tinytext DEFAULT NULL, `c4` bigint(20) DEFAULT NULL, - `c3` tinytext, + `c3` tinytext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -8659,8 +8659,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` text, - `c3` text, + `c2` text DEFAULT NULL, + `c3` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 BIGINT NULL AFTER c2; @@ -8671,9 +8671,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` text, + `c2` text DEFAULT NULL, `c4` bigint(20) DEFAULT NULL, - `c3` text, + `c3` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -8687,8 +8687,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumtext, - `c3` mediumtext, + `c2` mediumtext DEFAULT NULL, + `c3` mediumtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 BIGINT NULL AFTER c2; @@ -8699,9 +8699,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumtext, + `c2` mediumtext DEFAULT NULL, `c4` bigint(20) DEFAULT NULL, - `c3` mediumtext, + `c3` mediumtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -8715,8 +8715,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longtext, - `c3` longtext, + `c2` longtext DEFAULT NULL, + `c3` longtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 BIGINT NULL AFTER c2; @@ -8727,9 +8727,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longtext, + `c2` longtext DEFAULT NULL, `c4` bigint(20) DEFAULT NULL, - `c3` longtext, + `c3` longtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -9863,8 +9863,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinyblob, - `c3` tinyblob, + `c2` tinyblob DEFAULT NULL, + `c3` tinyblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 REAL NULL AFTER c2; @@ -9875,9 +9875,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinyblob, + `c2` tinyblob DEFAULT NULL, `c4` double DEFAULT NULL, - `c3` tinyblob, + `c3` tinyblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -9891,8 +9891,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` blob, - `c3` blob, + `c2` blob DEFAULT NULL, + `c3` blob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 REAL NULL AFTER c2; @@ -9903,9 +9903,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` blob, + `c2` blob DEFAULT NULL, `c4` double DEFAULT NULL, - `c3` blob, + `c3` blob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -9919,8 +9919,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumblob, - `c3` mediumblob, + `c2` mediumblob DEFAULT NULL, + `c3` mediumblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 REAL NULL AFTER c2; @@ -9931,9 +9931,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumblob, + `c2` mediumblob DEFAULT NULL, `c4` double DEFAULT NULL, - `c3` mediumblob, + `c3` mediumblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -9947,8 +9947,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longblob, - `c3` longblob, + `c2` longblob DEFAULT NULL, + `c3` longblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 REAL NULL AFTER c2; @@ -9959,9 +9959,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longblob, + `c2` longblob DEFAULT NULL, `c4` double DEFAULT NULL, - `c3` longblob, + `c3` longblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -9975,8 +9975,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinytext, - `c3` tinytext, + `c2` tinytext DEFAULT NULL, + `c3` tinytext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 REAL NULL AFTER c2; @@ -9987,9 +9987,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinytext, + `c2` tinytext DEFAULT NULL, `c4` double DEFAULT NULL, - `c3` tinytext, + `c3` tinytext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -10003,8 +10003,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` text, - `c3` text, + `c2` text DEFAULT NULL, + `c3` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 REAL NULL AFTER c2; @@ -10015,9 +10015,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` text, + `c2` text DEFAULT NULL, `c4` double DEFAULT NULL, - `c3` text, + `c3` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -10031,8 +10031,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumtext, - `c3` mediumtext, + `c2` mediumtext DEFAULT NULL, + `c3` mediumtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 REAL NULL AFTER c2; @@ -10043,9 +10043,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumtext, + `c2` mediumtext DEFAULT NULL, `c4` double DEFAULT NULL, - `c3` mediumtext, + `c3` mediumtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -10059,8 +10059,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longtext, - `c3` longtext, + `c2` longtext DEFAULT NULL, + `c3` longtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 REAL NULL AFTER c2; @@ -10071,9 +10071,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longtext, + `c2` longtext DEFAULT NULL, `c4` double DEFAULT NULL, - `c3` longtext, + `c3` longtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -11207,8 +11207,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinyblob, - `c3` tinyblob, + `c2` tinyblob DEFAULT NULL, + `c3` tinyblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 DOUBLE NULL AFTER c2; @@ -11219,9 +11219,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinyblob, + `c2` tinyblob DEFAULT NULL, `c4` double DEFAULT NULL, - `c3` tinyblob, + `c3` tinyblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -11235,8 +11235,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` blob, - `c3` blob, + `c2` blob DEFAULT NULL, + `c3` blob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 DOUBLE NULL AFTER c2; @@ -11247,9 +11247,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` blob, + `c2` blob DEFAULT NULL, `c4` double DEFAULT NULL, - `c3` blob, + `c3` blob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -11263,8 +11263,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumblob, - `c3` mediumblob, + `c2` mediumblob DEFAULT NULL, + `c3` mediumblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 DOUBLE NULL AFTER c2; @@ -11275,9 +11275,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumblob, + `c2` mediumblob DEFAULT NULL, `c4` double DEFAULT NULL, - `c3` mediumblob, + `c3` mediumblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -11291,8 +11291,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longblob, - `c3` longblob, + `c2` longblob DEFAULT NULL, + `c3` longblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 DOUBLE NULL AFTER c2; @@ -11303,9 +11303,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longblob, + `c2` longblob DEFAULT NULL, `c4` double DEFAULT NULL, - `c3` longblob, + `c3` longblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -11319,8 +11319,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinytext, - `c3` tinytext, + `c2` tinytext DEFAULT NULL, + `c3` tinytext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 DOUBLE NULL AFTER c2; @@ -11331,9 +11331,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinytext, + `c2` tinytext DEFAULT NULL, `c4` double DEFAULT NULL, - `c3` tinytext, + `c3` tinytext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -11347,8 +11347,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` text, - `c3` text, + `c2` text DEFAULT NULL, + `c3` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 DOUBLE NULL AFTER c2; @@ -11359,9 +11359,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` text, + `c2` text DEFAULT NULL, `c4` double DEFAULT NULL, - `c3` text, + `c3` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -11375,8 +11375,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumtext, - `c3` mediumtext, + `c2` mediumtext DEFAULT NULL, + `c3` mediumtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 DOUBLE NULL AFTER c2; @@ -11387,9 +11387,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumtext, + `c2` mediumtext DEFAULT NULL, `c4` double DEFAULT NULL, - `c3` mediumtext, + `c3` mediumtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -11403,8 +11403,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longtext, - `c3` longtext, + `c2` longtext DEFAULT NULL, + `c3` longtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 DOUBLE NULL AFTER c2; @@ -11415,9 +11415,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longtext, + `c2` longtext DEFAULT NULL, `c4` double DEFAULT NULL, - `c3` longtext, + `c3` longtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -12551,8 +12551,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinyblob, - `c3` tinyblob, + `c2` tinyblob DEFAULT NULL, + `c3` tinyblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 FLOAT NULL AFTER c2; @@ -12563,9 +12563,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinyblob, + `c2` tinyblob DEFAULT NULL, `c4` float DEFAULT NULL, - `c3` tinyblob, + `c3` tinyblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -12579,8 +12579,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` blob, - `c3` blob, + `c2` blob DEFAULT NULL, + `c3` blob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 FLOAT NULL AFTER c2; @@ -12591,9 +12591,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` blob, + `c2` blob DEFAULT NULL, `c4` float DEFAULT NULL, - `c3` blob, + `c3` blob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -12607,8 +12607,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumblob, - `c3` mediumblob, + `c2` mediumblob DEFAULT NULL, + `c3` mediumblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 FLOAT NULL AFTER c2; @@ -12619,9 +12619,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumblob, + `c2` mediumblob DEFAULT NULL, `c4` float DEFAULT NULL, - `c3` mediumblob, + `c3` mediumblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -12635,8 +12635,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longblob, - `c3` longblob, + `c2` longblob DEFAULT NULL, + `c3` longblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 FLOAT NULL AFTER c2; @@ -12647,9 +12647,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longblob, + `c2` longblob DEFAULT NULL, `c4` float DEFAULT NULL, - `c3` longblob, + `c3` longblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -12663,8 +12663,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinytext, - `c3` tinytext, + `c2` tinytext DEFAULT NULL, + `c3` tinytext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 FLOAT NULL AFTER c2; @@ -12675,9 +12675,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinytext, + `c2` tinytext DEFAULT NULL, `c4` float DEFAULT NULL, - `c3` tinytext, + `c3` tinytext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -12691,8 +12691,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` text, - `c3` text, + `c2` text DEFAULT NULL, + `c3` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 FLOAT NULL AFTER c2; @@ -12703,9 +12703,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` text, + `c2` text DEFAULT NULL, `c4` float DEFAULT NULL, - `c3` text, + `c3` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -12719,8 +12719,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumtext, - `c3` mediumtext, + `c2` mediumtext DEFAULT NULL, + `c3` mediumtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 FLOAT NULL AFTER c2; @@ -12731,9 +12731,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumtext, + `c2` mediumtext DEFAULT NULL, `c4` float DEFAULT NULL, - `c3` mediumtext, + `c3` mediumtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -12747,8 +12747,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longtext, - `c3` longtext, + `c2` longtext DEFAULT NULL, + `c3` longtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 FLOAT NULL AFTER c2; @@ -12759,9 +12759,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longtext, + `c2` longtext DEFAULT NULL, `c4` float DEFAULT NULL, - `c3` longtext, + `c3` longtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -13895,8 +13895,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinyblob, - `c3` tinyblob, + `c2` tinyblob DEFAULT NULL, + `c3` tinyblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 DECIMAL NULL AFTER c2; @@ -13907,9 +13907,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinyblob, + `c2` tinyblob DEFAULT NULL, `c4` decimal(10,0) DEFAULT NULL, - `c3` tinyblob, + `c3` tinyblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -13923,8 +13923,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` blob, - `c3` blob, + `c2` blob DEFAULT NULL, + `c3` blob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 DECIMAL NULL AFTER c2; @@ -13935,9 +13935,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` blob, + `c2` blob DEFAULT NULL, `c4` decimal(10,0) DEFAULT NULL, - `c3` blob, + `c3` blob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -13951,8 +13951,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumblob, - `c3` mediumblob, + `c2` mediumblob DEFAULT NULL, + `c3` mediumblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 DECIMAL NULL AFTER c2; @@ -13963,9 +13963,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumblob, + `c2` mediumblob DEFAULT NULL, `c4` decimal(10,0) DEFAULT NULL, - `c3` mediumblob, + `c3` mediumblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -13979,8 +13979,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longblob, - `c3` longblob, + `c2` longblob DEFAULT NULL, + `c3` longblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 DECIMAL NULL AFTER c2; @@ -13991,9 +13991,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longblob, + `c2` longblob DEFAULT NULL, `c4` decimal(10,0) DEFAULT NULL, - `c3` longblob, + `c3` longblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -14007,8 +14007,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinytext, - `c3` tinytext, + `c2` tinytext DEFAULT NULL, + `c3` tinytext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 DECIMAL NULL AFTER c2; @@ -14019,9 +14019,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinytext, + `c2` tinytext DEFAULT NULL, `c4` decimal(10,0) DEFAULT NULL, - `c3` tinytext, + `c3` tinytext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -14035,8 +14035,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` text, - `c3` text, + `c2` text DEFAULT NULL, + `c3` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 DECIMAL NULL AFTER c2; @@ -14047,9 +14047,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` text, + `c2` text DEFAULT NULL, `c4` decimal(10,0) DEFAULT NULL, - `c3` text, + `c3` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -14063,8 +14063,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumtext, - `c3` mediumtext, + `c2` mediumtext DEFAULT NULL, + `c3` mediumtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 DECIMAL NULL AFTER c2; @@ -14075,9 +14075,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumtext, + `c2` mediumtext DEFAULT NULL, `c4` decimal(10,0) DEFAULT NULL, - `c3` mediumtext, + `c3` mediumtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -14091,8 +14091,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longtext, - `c3` longtext, + `c2` longtext DEFAULT NULL, + `c3` longtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 DECIMAL NULL AFTER c2; @@ -14103,9 +14103,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longtext, + `c2` longtext DEFAULT NULL, `c4` decimal(10,0) DEFAULT NULL, - `c3` longtext, + `c3` longtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -15239,8 +15239,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinyblob, - `c3` tinyblob, + `c2` tinyblob DEFAULT NULL, + `c3` tinyblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 NUMERIC NULL AFTER c2; @@ -15251,9 +15251,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinyblob, + `c2` tinyblob DEFAULT NULL, `c4` decimal(10,0) DEFAULT NULL, - `c3` tinyblob, + `c3` tinyblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -15267,8 +15267,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` blob, - `c3` blob, + `c2` blob DEFAULT NULL, + `c3` blob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 NUMERIC NULL AFTER c2; @@ -15279,9 +15279,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` blob, + `c2` blob DEFAULT NULL, `c4` decimal(10,0) DEFAULT NULL, - `c3` blob, + `c3` blob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -15295,8 +15295,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumblob, - `c3` mediumblob, + `c2` mediumblob DEFAULT NULL, + `c3` mediumblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 NUMERIC NULL AFTER c2; @@ -15307,9 +15307,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumblob, + `c2` mediumblob DEFAULT NULL, `c4` decimal(10,0) DEFAULT NULL, - `c3` mediumblob, + `c3` mediumblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -15323,8 +15323,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longblob, - `c3` longblob, + `c2` longblob DEFAULT NULL, + `c3` longblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 NUMERIC NULL AFTER c2; @@ -15335,9 +15335,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longblob, + `c2` longblob DEFAULT NULL, `c4` decimal(10,0) DEFAULT NULL, - `c3` longblob, + `c3` longblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -15351,8 +15351,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinytext, - `c3` tinytext, + `c2` tinytext DEFAULT NULL, + `c3` tinytext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 NUMERIC NULL AFTER c2; @@ -15363,9 +15363,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinytext, + `c2` tinytext DEFAULT NULL, `c4` decimal(10,0) DEFAULT NULL, - `c3` tinytext, + `c3` tinytext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -15379,8 +15379,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` text, - `c3` text, + `c2` text DEFAULT NULL, + `c3` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 NUMERIC NULL AFTER c2; @@ -15391,9 +15391,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` text, + `c2` text DEFAULT NULL, `c4` decimal(10,0) DEFAULT NULL, - `c3` text, + `c3` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -15407,8 +15407,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumtext, - `c3` mediumtext, + `c2` mediumtext DEFAULT NULL, + `c3` mediumtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 NUMERIC NULL AFTER c2; @@ -15419,9 +15419,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumtext, + `c2` mediumtext DEFAULT NULL, `c4` decimal(10,0) DEFAULT NULL, - `c3` mediumtext, + `c3` mediumtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -15435,8 +15435,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longtext, - `c3` longtext, + `c2` longtext DEFAULT NULL, + `c3` longtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 NUMERIC NULL AFTER c2; @@ -15447,9 +15447,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longtext, + `c2` longtext DEFAULT NULL, `c4` decimal(10,0) DEFAULT NULL, - `c3` longtext, + `c3` longtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -16583,8 +16583,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinyblob, - `c3` tinyblob, + `c2` tinyblob DEFAULT NULL, + `c3` tinyblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 DATE NULL AFTER c2; @@ -16595,9 +16595,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinyblob, + `c2` tinyblob DEFAULT NULL, `c4` date DEFAULT NULL, - `c3` tinyblob, + `c3` tinyblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -16611,8 +16611,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` blob, - `c3` blob, + `c2` blob DEFAULT NULL, + `c3` blob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 DATE NULL AFTER c2; @@ -16623,9 +16623,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` blob, + `c2` blob DEFAULT NULL, `c4` date DEFAULT NULL, - `c3` blob, + `c3` blob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -16639,8 +16639,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumblob, - `c3` mediumblob, + `c2` mediumblob DEFAULT NULL, + `c3` mediumblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 DATE NULL AFTER c2; @@ -16651,9 +16651,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumblob, + `c2` mediumblob DEFAULT NULL, `c4` date DEFAULT NULL, - `c3` mediumblob, + `c3` mediumblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -16667,8 +16667,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longblob, - `c3` longblob, + `c2` longblob DEFAULT NULL, + `c3` longblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 DATE NULL AFTER c2; @@ -16679,9 +16679,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longblob, + `c2` longblob DEFAULT NULL, `c4` date DEFAULT NULL, - `c3` longblob, + `c3` longblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -16695,8 +16695,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinytext, - `c3` tinytext, + `c2` tinytext DEFAULT NULL, + `c3` tinytext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 DATE NULL AFTER c2; @@ -16707,9 +16707,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinytext, + `c2` tinytext DEFAULT NULL, `c4` date DEFAULT NULL, - `c3` tinytext, + `c3` tinytext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -16723,8 +16723,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` text, - `c3` text, + `c2` text DEFAULT NULL, + `c3` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 DATE NULL AFTER c2; @@ -16735,9 +16735,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` text, + `c2` text DEFAULT NULL, `c4` date DEFAULT NULL, - `c3` text, + `c3` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -16751,8 +16751,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumtext, - `c3` mediumtext, + `c2` mediumtext DEFAULT NULL, + `c3` mediumtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 DATE NULL AFTER c2; @@ -16763,9 +16763,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumtext, + `c2` mediumtext DEFAULT NULL, `c4` date DEFAULT NULL, - `c3` mediumtext, + `c3` mediumtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -16779,8 +16779,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longtext, - `c3` longtext, + `c2` longtext DEFAULT NULL, + `c3` longtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 DATE NULL AFTER c2; @@ -16791,9 +16791,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longtext, + `c2` longtext DEFAULT NULL, `c4` date DEFAULT NULL, - `c3` longtext, + `c3` longtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -17927,8 +17927,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinyblob, - `c3` tinyblob, + `c2` tinyblob DEFAULT NULL, + `c3` tinyblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 TIME NULL AFTER c2; @@ -17939,9 +17939,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinyblob, + `c2` tinyblob DEFAULT NULL, `c4` time DEFAULT NULL, - `c3` tinyblob, + `c3` tinyblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -17955,8 +17955,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` blob, - `c3` blob, + `c2` blob DEFAULT NULL, + `c3` blob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 TIME NULL AFTER c2; @@ -17967,9 +17967,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` blob, + `c2` blob DEFAULT NULL, `c4` time DEFAULT NULL, - `c3` blob, + `c3` blob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -17983,8 +17983,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumblob, - `c3` mediumblob, + `c2` mediumblob DEFAULT NULL, + `c3` mediumblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 TIME NULL AFTER c2; @@ -17995,9 +17995,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumblob, + `c2` mediumblob DEFAULT NULL, `c4` time DEFAULT NULL, - `c3` mediumblob, + `c3` mediumblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -18011,8 +18011,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longblob, - `c3` longblob, + `c2` longblob DEFAULT NULL, + `c3` longblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 TIME NULL AFTER c2; @@ -18023,9 +18023,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longblob, + `c2` longblob DEFAULT NULL, `c4` time DEFAULT NULL, - `c3` longblob, + `c3` longblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -18039,8 +18039,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinytext, - `c3` tinytext, + `c2` tinytext DEFAULT NULL, + `c3` tinytext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 TIME NULL AFTER c2; @@ -18051,9 +18051,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinytext, + `c2` tinytext DEFAULT NULL, `c4` time DEFAULT NULL, - `c3` tinytext, + `c3` tinytext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -18067,8 +18067,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` text, - `c3` text, + `c2` text DEFAULT NULL, + `c3` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 TIME NULL AFTER c2; @@ -18079,9 +18079,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` text, + `c2` text DEFAULT NULL, `c4` time DEFAULT NULL, - `c3` text, + `c3` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -18095,8 +18095,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumtext, - `c3` mediumtext, + `c2` mediumtext DEFAULT NULL, + `c3` mediumtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 TIME NULL AFTER c2; @@ -18107,9 +18107,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumtext, + `c2` mediumtext DEFAULT NULL, `c4` time DEFAULT NULL, - `c3` mediumtext, + `c3` mediumtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -18123,8 +18123,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longtext, - `c3` longtext, + `c2` longtext DEFAULT NULL, + `c3` longtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 TIME NULL AFTER c2; @@ -18135,9 +18135,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longtext, + `c2` longtext DEFAULT NULL, `c4` time DEFAULT NULL, - `c3` longtext, + `c3` longtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -19271,8 +19271,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinyblob, - `c3` tinyblob, + `c2` tinyblob DEFAULT NULL, + `c3` tinyblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 TIMESTAMP NULL AFTER c2; @@ -19283,9 +19283,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinyblob, + `c2` tinyblob DEFAULT NULL, `c4` timestamp NULL DEFAULT NULL, - `c3` tinyblob, + `c3` tinyblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -19299,8 +19299,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` blob, - `c3` blob, + `c2` blob DEFAULT NULL, + `c3` blob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 TIMESTAMP NULL AFTER c2; @@ -19311,9 +19311,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` blob, + `c2` blob DEFAULT NULL, `c4` timestamp NULL DEFAULT NULL, - `c3` blob, + `c3` blob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -19327,8 +19327,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumblob, - `c3` mediumblob, + `c2` mediumblob DEFAULT NULL, + `c3` mediumblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 TIMESTAMP NULL AFTER c2; @@ -19339,9 +19339,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumblob, + `c2` mediumblob DEFAULT NULL, `c4` timestamp NULL DEFAULT NULL, - `c3` mediumblob, + `c3` mediumblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -19355,8 +19355,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longblob, - `c3` longblob, + `c2` longblob DEFAULT NULL, + `c3` longblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 TIMESTAMP NULL AFTER c2; @@ -19367,9 +19367,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longblob, + `c2` longblob DEFAULT NULL, `c4` timestamp NULL DEFAULT NULL, - `c3` longblob, + `c3` longblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -19383,8 +19383,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinytext, - `c3` tinytext, + `c2` tinytext DEFAULT NULL, + `c3` tinytext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 TIMESTAMP NULL AFTER c2; @@ -19395,9 +19395,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinytext, + `c2` tinytext DEFAULT NULL, `c4` timestamp NULL DEFAULT NULL, - `c3` tinytext, + `c3` tinytext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -19411,8 +19411,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` text, - `c3` text, + `c2` text DEFAULT NULL, + `c3` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 TIMESTAMP NULL AFTER c2; @@ -19423,9 +19423,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` text, + `c2` text DEFAULT NULL, `c4` timestamp NULL DEFAULT NULL, - `c3` text, + `c3` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -19439,8 +19439,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumtext, - `c3` mediumtext, + `c2` mediumtext DEFAULT NULL, + `c3` mediumtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 TIMESTAMP NULL AFTER c2; @@ -19451,9 +19451,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumtext, + `c2` mediumtext DEFAULT NULL, `c4` timestamp NULL DEFAULT NULL, - `c3` mediumtext, + `c3` mediumtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -19467,8 +19467,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longtext, - `c3` longtext, + `c2` longtext DEFAULT NULL, + `c3` longtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 TIMESTAMP NULL AFTER c2; @@ -19479,9 +19479,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longtext, + `c2` longtext DEFAULT NULL, `c4` timestamp NULL DEFAULT NULL, - `c3` longtext, + `c3` longtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -20615,8 +20615,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinyblob, - `c3` tinyblob, + `c2` tinyblob DEFAULT NULL, + `c3` tinyblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 YEAR NULL AFTER c2; @@ -20627,9 +20627,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinyblob, + `c2` tinyblob DEFAULT NULL, `c4` year(4) DEFAULT NULL, - `c3` tinyblob, + `c3` tinyblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -20643,8 +20643,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` blob, - `c3` blob, + `c2` blob DEFAULT NULL, + `c3` blob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 YEAR NULL AFTER c2; @@ -20655,9 +20655,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` blob, + `c2` blob DEFAULT NULL, `c4` year(4) DEFAULT NULL, - `c3` blob, + `c3` blob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -20671,8 +20671,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumblob, - `c3` mediumblob, + `c2` mediumblob DEFAULT NULL, + `c3` mediumblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 YEAR NULL AFTER c2; @@ -20683,9 +20683,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumblob, + `c2` mediumblob DEFAULT NULL, `c4` year(4) DEFAULT NULL, - `c3` mediumblob, + `c3` mediumblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -20699,8 +20699,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longblob, - `c3` longblob, + `c2` longblob DEFAULT NULL, + `c3` longblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 YEAR NULL AFTER c2; @@ -20711,9 +20711,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longblob, + `c2` longblob DEFAULT NULL, `c4` year(4) DEFAULT NULL, - `c3` longblob, + `c3` longblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -20727,8 +20727,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinytext, - `c3` tinytext, + `c2` tinytext DEFAULT NULL, + `c3` tinytext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 YEAR NULL AFTER c2; @@ -20739,9 +20739,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinytext, + `c2` tinytext DEFAULT NULL, `c4` year(4) DEFAULT NULL, - `c3` tinytext, + `c3` tinytext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -20755,8 +20755,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` text, - `c3` text, + `c2` text DEFAULT NULL, + `c3` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 YEAR NULL AFTER c2; @@ -20767,9 +20767,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` text, + `c2` text DEFAULT NULL, `c4` year(4) DEFAULT NULL, - `c3` text, + `c3` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -20783,8 +20783,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumtext, - `c3` mediumtext, + `c2` mediumtext DEFAULT NULL, + `c3` mediumtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 YEAR NULL AFTER c2; @@ -20795,9 +20795,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumtext, + `c2` mediumtext DEFAULT NULL, `c4` year(4) DEFAULT NULL, - `c3` mediumtext, + `c3` mediumtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -20811,8 +20811,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longtext, - `c3` longtext, + `c2` longtext DEFAULT NULL, + `c3` longtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 YEAR NULL AFTER c2; @@ -20823,9 +20823,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longtext, + `c2` longtext DEFAULT NULL, `c4` year(4) DEFAULT NULL, - `c3` longtext, + `c3` longtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -21524,7 +21524,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` bit(1) DEFAULT NULL, - `c4` tinyblob, + `c4` tinyblob DEFAULT NULL, `c3` bit(1) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21552,7 +21552,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` tinyint(4) DEFAULT NULL, - `c4` tinyblob, + `c4` tinyblob DEFAULT NULL, `c3` tinyint(4) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21580,7 +21580,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` smallint(6) DEFAULT NULL, - `c4` tinyblob, + `c4` tinyblob DEFAULT NULL, `c3` smallint(6) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21608,7 +21608,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` mediumint(9) DEFAULT NULL, - `c4` tinyblob, + `c4` tinyblob DEFAULT NULL, `c3` mediumint(9) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21636,7 +21636,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` int(11) DEFAULT NULL, - `c4` tinyblob, + `c4` tinyblob DEFAULT NULL, `c3` int(11) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21664,7 +21664,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` int(11) DEFAULT NULL, - `c4` tinyblob, + `c4` tinyblob DEFAULT NULL, `c3` int(11) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21692,7 +21692,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` bigint(20) DEFAULT NULL, - `c4` tinyblob, + `c4` tinyblob DEFAULT NULL, `c3` bigint(20) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21720,7 +21720,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` double DEFAULT NULL, - `c4` tinyblob, + `c4` tinyblob DEFAULT NULL, `c3` double DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21748,7 +21748,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` double DEFAULT NULL, - `c4` tinyblob, + `c4` tinyblob DEFAULT NULL, `c3` double DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21776,7 +21776,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` float DEFAULT NULL, - `c4` tinyblob, + `c4` tinyblob DEFAULT NULL, `c3` float DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21804,7 +21804,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` decimal(10,0) DEFAULT NULL, - `c4` tinyblob, + `c4` tinyblob DEFAULT NULL, `c3` decimal(10,0) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21832,7 +21832,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` decimal(10,0) DEFAULT NULL, - `c4` tinyblob, + `c4` tinyblob DEFAULT NULL, `c3` decimal(10,0) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21860,7 +21860,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` date DEFAULT NULL, - `c4` tinyblob, + `c4` tinyblob DEFAULT NULL, `c3` date DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21888,7 +21888,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` time DEFAULT NULL, - `c4` tinyblob, + `c4` tinyblob DEFAULT NULL, `c3` time DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21916,7 +21916,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` timestamp NULL DEFAULT NULL, - `c4` tinyblob, + `c4` tinyblob DEFAULT NULL, `c3` timestamp NULL DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21944,7 +21944,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` year(4) DEFAULT NULL, - `c4` tinyblob, + `c4` tinyblob DEFAULT NULL, `c3` year(4) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21959,8 +21959,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinyblob, - `c3` tinyblob, + `c2` tinyblob DEFAULT NULL, + `c3` tinyblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 TINYBLOB NULL AFTER c2; @@ -21971,9 +21971,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinyblob, - `c4` tinyblob, - `c3` tinyblob, + `c2` tinyblob DEFAULT NULL, + `c4` tinyblob DEFAULT NULL, + `c3` tinyblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -21987,8 +21987,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` blob, - `c3` blob, + `c2` blob DEFAULT NULL, + `c3` blob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 TINYBLOB NULL AFTER c2; @@ -21999,9 +21999,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` blob, - `c4` tinyblob, - `c3` blob, + `c2` blob DEFAULT NULL, + `c4` tinyblob DEFAULT NULL, + `c3` blob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -22015,8 +22015,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumblob, - `c3` mediumblob, + `c2` mediumblob DEFAULT NULL, + `c3` mediumblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 TINYBLOB NULL AFTER c2; @@ -22027,9 +22027,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumblob, - `c4` tinyblob, - `c3` mediumblob, + `c2` mediumblob DEFAULT NULL, + `c4` tinyblob DEFAULT NULL, + `c3` mediumblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -22043,8 +22043,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longblob, - `c3` longblob, + `c2` longblob DEFAULT NULL, + `c3` longblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 TINYBLOB NULL AFTER c2; @@ -22055,9 +22055,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longblob, - `c4` tinyblob, - `c3` longblob, + `c2` longblob DEFAULT NULL, + `c4` tinyblob DEFAULT NULL, + `c3` longblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -22071,8 +22071,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinytext, - `c3` tinytext, + `c2` tinytext DEFAULT NULL, + `c3` tinytext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 TINYBLOB NULL AFTER c2; @@ -22083,9 +22083,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinytext, - `c4` tinyblob, - `c3` tinytext, + `c2` tinytext DEFAULT NULL, + `c4` tinyblob DEFAULT NULL, + `c3` tinytext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -22099,8 +22099,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` text, - `c3` text, + `c2` text DEFAULT NULL, + `c3` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 TINYBLOB NULL AFTER c2; @@ -22111,9 +22111,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` text, - `c4` tinyblob, - `c3` text, + `c2` text DEFAULT NULL, + `c4` tinyblob DEFAULT NULL, + `c3` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -22127,8 +22127,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumtext, - `c3` mediumtext, + `c2` mediumtext DEFAULT NULL, + `c3` mediumtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 TINYBLOB NULL AFTER c2; @@ -22139,9 +22139,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumtext, - `c4` tinyblob, - `c3` mediumtext, + `c2` mediumtext DEFAULT NULL, + `c4` tinyblob DEFAULT NULL, + `c3` mediumtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -22155,8 +22155,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longtext, - `c3` longtext, + `c2` longtext DEFAULT NULL, + `c3` longtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 TINYBLOB NULL AFTER c2; @@ -22167,9 +22167,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longtext, - `c4` tinyblob, - `c3` longtext, + `c2` longtext DEFAULT NULL, + `c4` tinyblob DEFAULT NULL, + `c3` longtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -22868,7 +22868,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` bit(1) DEFAULT NULL, - `c4` blob, + `c4` blob DEFAULT NULL, `c3` bit(1) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -22896,7 +22896,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` tinyint(4) DEFAULT NULL, - `c4` blob, + `c4` blob DEFAULT NULL, `c3` tinyint(4) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -22924,7 +22924,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` smallint(6) DEFAULT NULL, - `c4` blob, + `c4` blob DEFAULT NULL, `c3` smallint(6) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -22952,7 +22952,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` mediumint(9) DEFAULT NULL, - `c4` blob, + `c4` blob DEFAULT NULL, `c3` mediumint(9) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -22980,7 +22980,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` int(11) DEFAULT NULL, - `c4` blob, + `c4` blob DEFAULT NULL, `c3` int(11) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -23008,7 +23008,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` int(11) DEFAULT NULL, - `c4` blob, + `c4` blob DEFAULT NULL, `c3` int(11) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -23036,7 +23036,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` bigint(20) DEFAULT NULL, - `c4` blob, + `c4` blob DEFAULT NULL, `c3` bigint(20) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -23064,7 +23064,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` double DEFAULT NULL, - `c4` blob, + `c4` blob DEFAULT NULL, `c3` double DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -23092,7 +23092,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` double DEFAULT NULL, - `c4` blob, + `c4` blob DEFAULT NULL, `c3` double DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -23120,7 +23120,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` float DEFAULT NULL, - `c4` blob, + `c4` blob DEFAULT NULL, `c3` float DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -23148,7 +23148,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` decimal(10,0) DEFAULT NULL, - `c4` blob, + `c4` blob DEFAULT NULL, `c3` decimal(10,0) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -23176,7 +23176,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` decimal(10,0) DEFAULT NULL, - `c4` blob, + `c4` blob DEFAULT NULL, `c3` decimal(10,0) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -23204,7 +23204,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` date DEFAULT NULL, - `c4` blob, + `c4` blob DEFAULT NULL, `c3` date DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -23232,7 +23232,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` time DEFAULT NULL, - `c4` blob, + `c4` blob DEFAULT NULL, `c3` time DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -23260,7 +23260,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` timestamp NULL DEFAULT NULL, - `c4` blob, + `c4` blob DEFAULT NULL, `c3` timestamp NULL DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -23288,7 +23288,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` year(4) DEFAULT NULL, - `c4` blob, + `c4` blob DEFAULT NULL, `c3` year(4) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -23303,8 +23303,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinyblob, - `c3` tinyblob, + `c2` tinyblob DEFAULT NULL, + `c3` tinyblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 BLOB NULL AFTER c2; @@ -23315,9 +23315,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinyblob, - `c4` blob, - `c3` tinyblob, + `c2` tinyblob DEFAULT NULL, + `c4` blob DEFAULT NULL, + `c3` tinyblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -23331,8 +23331,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` blob, - `c3` blob, + `c2` blob DEFAULT NULL, + `c3` blob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 BLOB NULL AFTER c2; @@ -23343,9 +23343,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` blob, - `c4` blob, - `c3` blob, + `c2` blob DEFAULT NULL, + `c4` blob DEFAULT NULL, + `c3` blob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -23359,8 +23359,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumblob, - `c3` mediumblob, + `c2` mediumblob DEFAULT NULL, + `c3` mediumblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 BLOB NULL AFTER c2; @@ -23371,9 +23371,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumblob, - `c4` blob, - `c3` mediumblob, + `c2` mediumblob DEFAULT NULL, + `c4` blob DEFAULT NULL, + `c3` mediumblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -23387,8 +23387,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longblob, - `c3` longblob, + `c2` longblob DEFAULT NULL, + `c3` longblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 BLOB NULL AFTER c2; @@ -23399,9 +23399,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longblob, - `c4` blob, - `c3` longblob, + `c2` longblob DEFAULT NULL, + `c4` blob DEFAULT NULL, + `c3` longblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -23415,8 +23415,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinytext, - `c3` tinytext, + `c2` tinytext DEFAULT NULL, + `c3` tinytext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 BLOB NULL AFTER c2; @@ -23427,9 +23427,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinytext, - `c4` blob, - `c3` tinytext, + `c2` tinytext DEFAULT NULL, + `c4` blob DEFAULT NULL, + `c3` tinytext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -23443,8 +23443,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` text, - `c3` text, + `c2` text DEFAULT NULL, + `c3` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 BLOB NULL AFTER c2; @@ -23455,9 +23455,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` text, - `c4` blob, - `c3` text, + `c2` text DEFAULT NULL, + `c4` blob DEFAULT NULL, + `c3` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -23471,8 +23471,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumtext, - `c3` mediumtext, + `c2` mediumtext DEFAULT NULL, + `c3` mediumtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 BLOB NULL AFTER c2; @@ -23483,9 +23483,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumtext, - `c4` blob, - `c3` mediumtext, + `c2` mediumtext DEFAULT NULL, + `c4` blob DEFAULT NULL, + `c3` mediumtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -23499,8 +23499,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longtext, - `c3` longtext, + `c2` longtext DEFAULT NULL, + `c3` longtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 BLOB NULL AFTER c2; @@ -23511,9 +23511,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longtext, - `c4` blob, - `c3` longtext, + `c2` longtext DEFAULT NULL, + `c4` blob DEFAULT NULL, + `c3` longtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -24212,7 +24212,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` bit(1) DEFAULT NULL, - `c4` mediumblob, + `c4` mediumblob DEFAULT NULL, `c3` bit(1) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24240,7 +24240,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` tinyint(4) DEFAULT NULL, - `c4` mediumblob, + `c4` mediumblob DEFAULT NULL, `c3` tinyint(4) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24268,7 +24268,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` smallint(6) DEFAULT NULL, - `c4` mediumblob, + `c4` mediumblob DEFAULT NULL, `c3` smallint(6) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24296,7 +24296,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` mediumint(9) DEFAULT NULL, - `c4` mediumblob, + `c4` mediumblob DEFAULT NULL, `c3` mediumint(9) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24324,7 +24324,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` int(11) DEFAULT NULL, - `c4` mediumblob, + `c4` mediumblob DEFAULT NULL, `c3` int(11) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24352,7 +24352,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` int(11) DEFAULT NULL, - `c4` mediumblob, + `c4` mediumblob DEFAULT NULL, `c3` int(11) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24380,7 +24380,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` bigint(20) DEFAULT NULL, - `c4` mediumblob, + `c4` mediumblob DEFAULT NULL, `c3` bigint(20) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24408,7 +24408,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` double DEFAULT NULL, - `c4` mediumblob, + `c4` mediumblob DEFAULT NULL, `c3` double DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24436,7 +24436,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` double DEFAULT NULL, - `c4` mediumblob, + `c4` mediumblob DEFAULT NULL, `c3` double DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24464,7 +24464,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` float DEFAULT NULL, - `c4` mediumblob, + `c4` mediumblob DEFAULT NULL, `c3` float DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24492,7 +24492,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` decimal(10,0) DEFAULT NULL, - `c4` mediumblob, + `c4` mediumblob DEFAULT NULL, `c3` decimal(10,0) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24520,7 +24520,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` decimal(10,0) DEFAULT NULL, - `c4` mediumblob, + `c4` mediumblob DEFAULT NULL, `c3` decimal(10,0) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24548,7 +24548,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` date DEFAULT NULL, - `c4` mediumblob, + `c4` mediumblob DEFAULT NULL, `c3` date DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24576,7 +24576,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` time DEFAULT NULL, - `c4` mediumblob, + `c4` mediumblob DEFAULT NULL, `c3` time DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24604,7 +24604,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` timestamp NULL DEFAULT NULL, - `c4` mediumblob, + `c4` mediumblob DEFAULT NULL, `c3` timestamp NULL DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24632,7 +24632,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` year(4) DEFAULT NULL, - `c4` mediumblob, + `c4` mediumblob DEFAULT NULL, `c3` year(4) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24647,8 +24647,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinyblob, - `c3` tinyblob, + `c2` tinyblob DEFAULT NULL, + `c3` tinyblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 MEDIUMBLOB NULL AFTER c2; @@ -24659,9 +24659,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinyblob, - `c4` mediumblob, - `c3` tinyblob, + `c2` tinyblob DEFAULT NULL, + `c4` mediumblob DEFAULT NULL, + `c3` tinyblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -24675,8 +24675,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` blob, - `c3` blob, + `c2` blob DEFAULT NULL, + `c3` blob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 MEDIUMBLOB NULL AFTER c2; @@ -24687,9 +24687,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` blob, - `c4` mediumblob, - `c3` blob, + `c2` blob DEFAULT NULL, + `c4` mediumblob DEFAULT NULL, + `c3` blob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -24703,8 +24703,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumblob, - `c3` mediumblob, + `c2` mediumblob DEFAULT NULL, + `c3` mediumblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 MEDIUMBLOB NULL AFTER c2; @@ -24715,9 +24715,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumblob, - `c4` mediumblob, - `c3` mediumblob, + `c2` mediumblob DEFAULT NULL, + `c4` mediumblob DEFAULT NULL, + `c3` mediumblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -24731,8 +24731,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longblob, - `c3` longblob, + `c2` longblob DEFAULT NULL, + `c3` longblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 MEDIUMBLOB NULL AFTER c2; @@ -24743,9 +24743,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longblob, - `c4` mediumblob, - `c3` longblob, + `c2` longblob DEFAULT NULL, + `c4` mediumblob DEFAULT NULL, + `c3` longblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -24759,8 +24759,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinytext, - `c3` tinytext, + `c2` tinytext DEFAULT NULL, + `c3` tinytext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 MEDIUMBLOB NULL AFTER c2; @@ -24771,9 +24771,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinytext, - `c4` mediumblob, - `c3` tinytext, + `c2` tinytext DEFAULT NULL, + `c4` mediumblob DEFAULT NULL, + `c3` tinytext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -24787,8 +24787,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` text, - `c3` text, + `c2` text DEFAULT NULL, + `c3` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 MEDIUMBLOB NULL AFTER c2; @@ -24799,9 +24799,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` text, - `c4` mediumblob, - `c3` text, + `c2` text DEFAULT NULL, + `c4` mediumblob DEFAULT NULL, + `c3` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -24815,8 +24815,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumtext, - `c3` mediumtext, + `c2` mediumtext DEFAULT NULL, + `c3` mediumtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 MEDIUMBLOB NULL AFTER c2; @@ -24827,9 +24827,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumtext, - `c4` mediumblob, - `c3` mediumtext, + `c2` mediumtext DEFAULT NULL, + `c4` mediumblob DEFAULT NULL, + `c3` mediumtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -24843,8 +24843,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longtext, - `c3` longtext, + `c2` longtext DEFAULT NULL, + `c3` longtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 MEDIUMBLOB NULL AFTER c2; @@ -24855,9 +24855,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longtext, - `c4` mediumblob, - `c3` longtext, + `c2` longtext DEFAULT NULL, + `c4` mediumblob DEFAULT NULL, + `c3` longtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -25556,7 +25556,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` bit(1) DEFAULT NULL, - `c4` longblob, + `c4` longblob DEFAULT NULL, `c3` bit(1) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25584,7 +25584,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` tinyint(4) DEFAULT NULL, - `c4` longblob, + `c4` longblob DEFAULT NULL, `c3` tinyint(4) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25612,7 +25612,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` smallint(6) DEFAULT NULL, - `c4` longblob, + `c4` longblob DEFAULT NULL, `c3` smallint(6) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25640,7 +25640,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` mediumint(9) DEFAULT NULL, - `c4` longblob, + `c4` longblob DEFAULT NULL, `c3` mediumint(9) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25668,7 +25668,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` int(11) DEFAULT NULL, - `c4` longblob, + `c4` longblob DEFAULT NULL, `c3` int(11) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25696,7 +25696,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` int(11) DEFAULT NULL, - `c4` longblob, + `c4` longblob DEFAULT NULL, `c3` int(11) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25724,7 +25724,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` bigint(20) DEFAULT NULL, - `c4` longblob, + `c4` longblob DEFAULT NULL, `c3` bigint(20) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25752,7 +25752,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` double DEFAULT NULL, - `c4` longblob, + `c4` longblob DEFAULT NULL, `c3` double DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25780,7 +25780,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` double DEFAULT NULL, - `c4` longblob, + `c4` longblob DEFAULT NULL, `c3` double DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25808,7 +25808,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` float DEFAULT NULL, - `c4` longblob, + `c4` longblob DEFAULT NULL, `c3` float DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25836,7 +25836,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` decimal(10,0) DEFAULT NULL, - `c4` longblob, + `c4` longblob DEFAULT NULL, `c3` decimal(10,0) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25864,7 +25864,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` decimal(10,0) DEFAULT NULL, - `c4` longblob, + `c4` longblob DEFAULT NULL, `c3` decimal(10,0) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25892,7 +25892,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` date DEFAULT NULL, - `c4` longblob, + `c4` longblob DEFAULT NULL, `c3` date DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25920,7 +25920,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` time DEFAULT NULL, - `c4` longblob, + `c4` longblob DEFAULT NULL, `c3` time DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25948,7 +25948,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` timestamp NULL DEFAULT NULL, - `c4` longblob, + `c4` longblob DEFAULT NULL, `c3` timestamp NULL DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25976,7 +25976,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` year(4) DEFAULT NULL, - `c4` longblob, + `c4` longblob DEFAULT NULL, `c3` year(4) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25991,8 +25991,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinyblob, - `c3` tinyblob, + `c2` tinyblob DEFAULT NULL, + `c3` tinyblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 LONGBLOB NULL AFTER c2; @@ -26003,9 +26003,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinyblob, - `c4` longblob, - `c3` tinyblob, + `c2` tinyblob DEFAULT NULL, + `c4` longblob DEFAULT NULL, + `c3` tinyblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -26019,8 +26019,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` blob, - `c3` blob, + `c2` blob DEFAULT NULL, + `c3` blob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 LONGBLOB NULL AFTER c2; @@ -26031,9 +26031,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` blob, - `c4` longblob, - `c3` blob, + `c2` blob DEFAULT NULL, + `c4` longblob DEFAULT NULL, + `c3` blob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -26047,8 +26047,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumblob, - `c3` mediumblob, + `c2` mediumblob DEFAULT NULL, + `c3` mediumblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 LONGBLOB NULL AFTER c2; @@ -26059,9 +26059,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumblob, - `c4` longblob, - `c3` mediumblob, + `c2` mediumblob DEFAULT NULL, + `c4` longblob DEFAULT NULL, + `c3` mediumblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -26075,8 +26075,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longblob, - `c3` longblob, + `c2` longblob DEFAULT NULL, + `c3` longblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 LONGBLOB NULL AFTER c2; @@ -26087,9 +26087,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longblob, - `c4` longblob, - `c3` longblob, + `c2` longblob DEFAULT NULL, + `c4` longblob DEFAULT NULL, + `c3` longblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -26103,8 +26103,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinytext, - `c3` tinytext, + `c2` tinytext DEFAULT NULL, + `c3` tinytext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 LONGBLOB NULL AFTER c2; @@ -26115,9 +26115,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinytext, - `c4` longblob, - `c3` tinytext, + `c2` tinytext DEFAULT NULL, + `c4` longblob DEFAULT NULL, + `c3` tinytext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -26131,8 +26131,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` text, - `c3` text, + `c2` text DEFAULT NULL, + `c3` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 LONGBLOB NULL AFTER c2; @@ -26143,9 +26143,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` text, - `c4` longblob, - `c3` text, + `c2` text DEFAULT NULL, + `c4` longblob DEFAULT NULL, + `c3` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -26159,8 +26159,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumtext, - `c3` mediumtext, + `c2` mediumtext DEFAULT NULL, + `c3` mediumtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 LONGBLOB NULL AFTER c2; @@ -26171,9 +26171,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumtext, - `c4` longblob, - `c3` mediumtext, + `c2` mediumtext DEFAULT NULL, + `c4` longblob DEFAULT NULL, + `c3` mediumtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -26187,8 +26187,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longtext, - `c3` longtext, + `c2` longtext DEFAULT NULL, + `c3` longtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 LONGBLOB NULL AFTER c2; @@ -26199,9 +26199,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longtext, - `c4` longblob, - `c3` longtext, + `c2` longtext DEFAULT NULL, + `c4` longblob DEFAULT NULL, + `c3` longtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -26900,7 +26900,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` bit(1) DEFAULT NULL, - `c4` tinytext, + `c4` tinytext DEFAULT NULL, `c3` bit(1) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -26928,7 +26928,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` tinyint(4) DEFAULT NULL, - `c4` tinytext, + `c4` tinytext DEFAULT NULL, `c3` tinyint(4) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -26956,7 +26956,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` smallint(6) DEFAULT NULL, - `c4` tinytext, + `c4` tinytext DEFAULT NULL, `c3` smallint(6) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -26984,7 +26984,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` mediumint(9) DEFAULT NULL, - `c4` tinytext, + `c4` tinytext DEFAULT NULL, `c3` mediumint(9) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -27012,7 +27012,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` int(11) DEFAULT NULL, - `c4` tinytext, + `c4` tinytext DEFAULT NULL, `c3` int(11) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -27040,7 +27040,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` int(11) DEFAULT NULL, - `c4` tinytext, + `c4` tinytext DEFAULT NULL, `c3` int(11) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -27068,7 +27068,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` bigint(20) DEFAULT NULL, - `c4` tinytext, + `c4` tinytext DEFAULT NULL, `c3` bigint(20) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -27096,7 +27096,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` double DEFAULT NULL, - `c4` tinytext, + `c4` tinytext DEFAULT NULL, `c3` double DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -27124,7 +27124,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` double DEFAULT NULL, - `c4` tinytext, + `c4` tinytext DEFAULT NULL, `c3` double DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -27152,7 +27152,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` float DEFAULT NULL, - `c4` tinytext, + `c4` tinytext DEFAULT NULL, `c3` float DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -27180,7 +27180,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` decimal(10,0) DEFAULT NULL, - `c4` tinytext, + `c4` tinytext DEFAULT NULL, `c3` decimal(10,0) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -27208,7 +27208,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` decimal(10,0) DEFAULT NULL, - `c4` tinytext, + `c4` tinytext DEFAULT NULL, `c3` decimal(10,0) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -27236,7 +27236,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` date DEFAULT NULL, - `c4` tinytext, + `c4` tinytext DEFAULT NULL, `c3` date DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -27264,7 +27264,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` time DEFAULT NULL, - `c4` tinytext, + `c4` tinytext DEFAULT NULL, `c3` time DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -27292,7 +27292,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` timestamp NULL DEFAULT NULL, - `c4` tinytext, + `c4` tinytext DEFAULT NULL, `c3` timestamp NULL DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -27320,7 +27320,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` year(4) DEFAULT NULL, - `c4` tinytext, + `c4` tinytext DEFAULT NULL, `c3` year(4) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -27335,8 +27335,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinyblob, - `c3` tinyblob, + `c2` tinyblob DEFAULT NULL, + `c3` tinyblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 TINYTEXT NULL AFTER c2; @@ -27347,9 +27347,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinyblob, - `c4` tinytext, - `c3` tinyblob, + `c2` tinyblob DEFAULT NULL, + `c4` tinytext DEFAULT NULL, + `c3` tinyblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -27363,8 +27363,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` blob, - `c3` blob, + `c2` blob DEFAULT NULL, + `c3` blob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 TINYTEXT NULL AFTER c2; @@ -27375,9 +27375,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` blob, - `c4` tinytext, - `c3` blob, + `c2` blob DEFAULT NULL, + `c4` tinytext DEFAULT NULL, + `c3` blob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -27391,8 +27391,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumblob, - `c3` mediumblob, + `c2` mediumblob DEFAULT NULL, + `c3` mediumblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 TINYTEXT NULL AFTER c2; @@ -27403,9 +27403,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumblob, - `c4` tinytext, - `c3` mediumblob, + `c2` mediumblob DEFAULT NULL, + `c4` tinytext DEFAULT NULL, + `c3` mediumblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -27419,8 +27419,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longblob, - `c3` longblob, + `c2` longblob DEFAULT NULL, + `c3` longblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 TINYTEXT NULL AFTER c2; @@ -27431,9 +27431,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longblob, - `c4` tinytext, - `c3` longblob, + `c2` longblob DEFAULT NULL, + `c4` tinytext DEFAULT NULL, + `c3` longblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -27447,8 +27447,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinytext, - `c3` tinytext, + `c2` tinytext DEFAULT NULL, + `c3` tinytext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 TINYTEXT NULL AFTER c2; @@ -27459,9 +27459,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinytext, - `c4` tinytext, - `c3` tinytext, + `c2` tinytext DEFAULT NULL, + `c4` tinytext DEFAULT NULL, + `c3` tinytext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -27475,8 +27475,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` text, - `c3` text, + `c2` text DEFAULT NULL, + `c3` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 TINYTEXT NULL AFTER c2; @@ -27487,9 +27487,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` text, - `c4` tinytext, - `c3` text, + `c2` text DEFAULT NULL, + `c4` tinytext DEFAULT NULL, + `c3` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -27503,8 +27503,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumtext, - `c3` mediumtext, + `c2` mediumtext DEFAULT NULL, + `c3` mediumtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 TINYTEXT NULL AFTER c2; @@ -27515,9 +27515,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumtext, - `c4` tinytext, - `c3` mediumtext, + `c2` mediumtext DEFAULT NULL, + `c4` tinytext DEFAULT NULL, + `c3` mediumtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -27531,8 +27531,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longtext, - `c3` longtext, + `c2` longtext DEFAULT NULL, + `c3` longtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 TINYTEXT NULL AFTER c2; @@ -27543,9 +27543,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longtext, - `c4` tinytext, - `c3` longtext, + `c2` longtext DEFAULT NULL, + `c4` tinytext DEFAULT NULL, + `c3` longtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -28244,7 +28244,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` bit(1) DEFAULT NULL, - `c4` text, + `c4` text DEFAULT NULL, `c3` bit(1) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28272,7 +28272,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` tinyint(4) DEFAULT NULL, - `c4` text, + `c4` text DEFAULT NULL, `c3` tinyint(4) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28300,7 +28300,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` smallint(6) DEFAULT NULL, - `c4` text, + `c4` text DEFAULT NULL, `c3` smallint(6) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28328,7 +28328,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` mediumint(9) DEFAULT NULL, - `c4` text, + `c4` text DEFAULT NULL, `c3` mediumint(9) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28356,7 +28356,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` int(11) DEFAULT NULL, - `c4` text, + `c4` text DEFAULT NULL, `c3` int(11) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28384,7 +28384,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` int(11) DEFAULT NULL, - `c4` text, + `c4` text DEFAULT NULL, `c3` int(11) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28412,7 +28412,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` bigint(20) DEFAULT NULL, - `c4` text, + `c4` text DEFAULT NULL, `c3` bigint(20) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28440,7 +28440,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` double DEFAULT NULL, - `c4` text, + `c4` text DEFAULT NULL, `c3` double DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28468,7 +28468,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` double DEFAULT NULL, - `c4` text, + `c4` text DEFAULT NULL, `c3` double DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28496,7 +28496,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` float DEFAULT NULL, - `c4` text, + `c4` text DEFAULT NULL, `c3` float DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28524,7 +28524,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` decimal(10,0) DEFAULT NULL, - `c4` text, + `c4` text DEFAULT NULL, `c3` decimal(10,0) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28552,7 +28552,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` decimal(10,0) DEFAULT NULL, - `c4` text, + `c4` text DEFAULT NULL, `c3` decimal(10,0) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28580,7 +28580,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` date DEFAULT NULL, - `c4` text, + `c4` text DEFAULT NULL, `c3` date DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28608,7 +28608,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` time DEFAULT NULL, - `c4` text, + `c4` text DEFAULT NULL, `c3` time DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28636,7 +28636,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` timestamp NULL DEFAULT NULL, - `c4` text, + `c4` text DEFAULT NULL, `c3` timestamp NULL DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28664,7 +28664,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` year(4) DEFAULT NULL, - `c4` text, + `c4` text DEFAULT NULL, `c3` year(4) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28679,8 +28679,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinyblob, - `c3` tinyblob, + `c2` tinyblob DEFAULT NULL, + `c3` tinyblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 TEXT NULL AFTER c2; @@ -28691,9 +28691,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinyblob, - `c4` text, - `c3` tinyblob, + `c2` tinyblob DEFAULT NULL, + `c4` text DEFAULT NULL, + `c3` tinyblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -28707,8 +28707,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` blob, - `c3` blob, + `c2` blob DEFAULT NULL, + `c3` blob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 TEXT NULL AFTER c2; @@ -28719,9 +28719,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` blob, - `c4` text, - `c3` blob, + `c2` blob DEFAULT NULL, + `c4` text DEFAULT NULL, + `c3` blob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -28735,8 +28735,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumblob, - `c3` mediumblob, + `c2` mediumblob DEFAULT NULL, + `c3` mediumblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 TEXT NULL AFTER c2; @@ -28747,9 +28747,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumblob, - `c4` text, - `c3` mediumblob, + `c2` mediumblob DEFAULT NULL, + `c4` text DEFAULT NULL, + `c3` mediumblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -28763,8 +28763,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longblob, - `c3` longblob, + `c2` longblob DEFAULT NULL, + `c3` longblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 TEXT NULL AFTER c2; @@ -28775,9 +28775,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longblob, - `c4` text, - `c3` longblob, + `c2` longblob DEFAULT NULL, + `c4` text DEFAULT NULL, + `c3` longblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -28791,8 +28791,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinytext, - `c3` tinytext, + `c2` tinytext DEFAULT NULL, + `c3` tinytext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 TEXT NULL AFTER c2; @@ -28803,9 +28803,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinytext, - `c4` text, - `c3` tinytext, + `c2` tinytext DEFAULT NULL, + `c4` text DEFAULT NULL, + `c3` tinytext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -28819,8 +28819,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` text, - `c3` text, + `c2` text DEFAULT NULL, + `c3` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 TEXT NULL AFTER c2; @@ -28831,9 +28831,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` text, - `c4` text, - `c3` text, + `c2` text DEFAULT NULL, + `c4` text DEFAULT NULL, + `c3` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -28847,8 +28847,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumtext, - `c3` mediumtext, + `c2` mediumtext DEFAULT NULL, + `c3` mediumtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 TEXT NULL AFTER c2; @@ -28859,9 +28859,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumtext, - `c4` text, - `c3` mediumtext, + `c2` mediumtext DEFAULT NULL, + `c4` text DEFAULT NULL, + `c3` mediumtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -28875,8 +28875,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longtext, - `c3` longtext, + `c2` longtext DEFAULT NULL, + `c3` longtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 TEXT NULL AFTER c2; @@ -28887,9 +28887,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longtext, - `c4` text, - `c3` longtext, + `c2` longtext DEFAULT NULL, + `c4` text DEFAULT NULL, + `c3` longtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -29588,7 +29588,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` bit(1) DEFAULT NULL, - `c4` mediumtext, + `c4` mediumtext DEFAULT NULL, `c3` bit(1) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29616,7 +29616,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` tinyint(4) DEFAULT NULL, - `c4` mediumtext, + `c4` mediumtext DEFAULT NULL, `c3` tinyint(4) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29644,7 +29644,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` smallint(6) DEFAULT NULL, - `c4` mediumtext, + `c4` mediumtext DEFAULT NULL, `c3` smallint(6) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29672,7 +29672,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` mediumint(9) DEFAULT NULL, - `c4` mediumtext, + `c4` mediumtext DEFAULT NULL, `c3` mediumint(9) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29700,7 +29700,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` int(11) DEFAULT NULL, - `c4` mediumtext, + `c4` mediumtext DEFAULT NULL, `c3` int(11) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29728,7 +29728,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` int(11) DEFAULT NULL, - `c4` mediumtext, + `c4` mediumtext DEFAULT NULL, `c3` int(11) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29756,7 +29756,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` bigint(20) DEFAULT NULL, - `c4` mediumtext, + `c4` mediumtext DEFAULT NULL, `c3` bigint(20) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29784,7 +29784,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` double DEFAULT NULL, - `c4` mediumtext, + `c4` mediumtext DEFAULT NULL, `c3` double DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29812,7 +29812,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` double DEFAULT NULL, - `c4` mediumtext, + `c4` mediumtext DEFAULT NULL, `c3` double DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29840,7 +29840,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` float DEFAULT NULL, - `c4` mediumtext, + `c4` mediumtext DEFAULT NULL, `c3` float DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29868,7 +29868,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` decimal(10,0) DEFAULT NULL, - `c4` mediumtext, + `c4` mediumtext DEFAULT NULL, `c3` decimal(10,0) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29896,7 +29896,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` decimal(10,0) DEFAULT NULL, - `c4` mediumtext, + `c4` mediumtext DEFAULT NULL, `c3` decimal(10,0) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29924,7 +29924,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` date DEFAULT NULL, - `c4` mediumtext, + `c4` mediumtext DEFAULT NULL, `c3` date DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29952,7 +29952,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` time DEFAULT NULL, - `c4` mediumtext, + `c4` mediumtext DEFAULT NULL, `c3` time DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29980,7 +29980,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` timestamp NULL DEFAULT NULL, - `c4` mediumtext, + `c4` mediumtext DEFAULT NULL, `c3` timestamp NULL DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -30008,7 +30008,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` year(4) DEFAULT NULL, - `c4` mediumtext, + `c4` mediumtext DEFAULT NULL, `c3` year(4) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -30023,8 +30023,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinyblob, - `c3` tinyblob, + `c2` tinyblob DEFAULT NULL, + `c3` tinyblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 MEDIUMTEXT NULL AFTER c2; @@ -30035,9 +30035,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinyblob, - `c4` mediumtext, - `c3` tinyblob, + `c2` tinyblob DEFAULT NULL, + `c4` mediumtext DEFAULT NULL, + `c3` tinyblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -30051,8 +30051,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` blob, - `c3` blob, + `c2` blob DEFAULT NULL, + `c3` blob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 MEDIUMTEXT NULL AFTER c2; @@ -30063,9 +30063,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` blob, - `c4` mediumtext, - `c3` blob, + `c2` blob DEFAULT NULL, + `c4` mediumtext DEFAULT NULL, + `c3` blob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -30079,8 +30079,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumblob, - `c3` mediumblob, + `c2` mediumblob DEFAULT NULL, + `c3` mediumblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 MEDIUMTEXT NULL AFTER c2; @@ -30091,9 +30091,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumblob, - `c4` mediumtext, - `c3` mediumblob, + `c2` mediumblob DEFAULT NULL, + `c4` mediumtext DEFAULT NULL, + `c3` mediumblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -30107,8 +30107,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longblob, - `c3` longblob, + `c2` longblob DEFAULT NULL, + `c3` longblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 MEDIUMTEXT NULL AFTER c2; @@ -30119,9 +30119,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longblob, - `c4` mediumtext, - `c3` longblob, + `c2` longblob DEFAULT NULL, + `c4` mediumtext DEFAULT NULL, + `c3` longblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -30135,8 +30135,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinytext, - `c3` tinytext, + `c2` tinytext DEFAULT NULL, + `c3` tinytext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 MEDIUMTEXT NULL AFTER c2; @@ -30147,9 +30147,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinytext, - `c4` mediumtext, - `c3` tinytext, + `c2` tinytext DEFAULT NULL, + `c4` mediumtext DEFAULT NULL, + `c3` tinytext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -30163,8 +30163,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` text, - `c3` text, + `c2` text DEFAULT NULL, + `c3` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 MEDIUMTEXT NULL AFTER c2; @@ -30175,9 +30175,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` text, - `c4` mediumtext, - `c3` text, + `c2` text DEFAULT NULL, + `c4` mediumtext DEFAULT NULL, + `c3` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -30191,8 +30191,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumtext, - `c3` mediumtext, + `c2` mediumtext DEFAULT NULL, + `c3` mediumtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 MEDIUMTEXT NULL AFTER c2; @@ -30203,9 +30203,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumtext, - `c4` mediumtext, - `c3` mediumtext, + `c2` mediumtext DEFAULT NULL, + `c4` mediumtext DEFAULT NULL, + `c3` mediumtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -30219,8 +30219,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longtext, - `c3` longtext, + `c2` longtext DEFAULT NULL, + `c3` longtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 MEDIUMTEXT NULL AFTER c2; @@ -30231,9 +30231,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longtext, - `c4` mediumtext, - `c3` longtext, + `c2` longtext DEFAULT NULL, + `c4` mediumtext DEFAULT NULL, + `c3` longtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -30932,7 +30932,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` bit(1) DEFAULT NULL, - `c4` longtext, + `c4` longtext DEFAULT NULL, `c3` bit(1) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -30960,7 +30960,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` tinyint(4) DEFAULT NULL, - `c4` longtext, + `c4` longtext DEFAULT NULL, `c3` tinyint(4) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -30988,7 +30988,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` smallint(6) DEFAULT NULL, - `c4` longtext, + `c4` longtext DEFAULT NULL, `c3` smallint(6) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31016,7 +31016,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` mediumint(9) DEFAULT NULL, - `c4` longtext, + `c4` longtext DEFAULT NULL, `c3` mediumint(9) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31044,7 +31044,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` int(11) DEFAULT NULL, - `c4` longtext, + `c4` longtext DEFAULT NULL, `c3` int(11) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31072,7 +31072,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` int(11) DEFAULT NULL, - `c4` longtext, + `c4` longtext DEFAULT NULL, `c3` int(11) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31100,7 +31100,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` bigint(20) DEFAULT NULL, - `c4` longtext, + `c4` longtext DEFAULT NULL, `c3` bigint(20) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31128,7 +31128,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` double DEFAULT NULL, - `c4` longtext, + `c4` longtext DEFAULT NULL, `c3` double DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31156,7 +31156,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` double DEFAULT NULL, - `c4` longtext, + `c4` longtext DEFAULT NULL, `c3` double DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31184,7 +31184,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` float DEFAULT NULL, - `c4` longtext, + `c4` longtext DEFAULT NULL, `c3` float DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31212,7 +31212,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` decimal(10,0) DEFAULT NULL, - `c4` longtext, + `c4` longtext DEFAULT NULL, `c3` decimal(10,0) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31240,7 +31240,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` decimal(10,0) DEFAULT NULL, - `c4` longtext, + `c4` longtext DEFAULT NULL, `c3` decimal(10,0) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31268,7 +31268,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` date DEFAULT NULL, - `c4` longtext, + `c4` longtext DEFAULT NULL, `c3` date DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31296,7 +31296,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` time DEFAULT NULL, - `c4` longtext, + `c4` longtext DEFAULT NULL, `c3` time DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31324,7 +31324,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` timestamp NULL DEFAULT NULL, - `c4` longtext, + `c4` longtext DEFAULT NULL, `c3` timestamp NULL DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31352,7 +31352,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` year(4) DEFAULT NULL, - `c4` longtext, + `c4` longtext DEFAULT NULL, `c3` year(4) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31367,8 +31367,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinyblob, - `c3` tinyblob, + `c2` tinyblob DEFAULT NULL, + `c3` tinyblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 LONGTEXT NULL AFTER c2; @@ -31379,9 +31379,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinyblob, - `c4` longtext, - `c3` tinyblob, + `c2` tinyblob DEFAULT NULL, + `c4` longtext DEFAULT NULL, + `c3` tinyblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -31395,8 +31395,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` blob, - `c3` blob, + `c2` blob DEFAULT NULL, + `c3` blob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 LONGTEXT NULL AFTER c2; @@ -31407,9 +31407,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` blob, - `c4` longtext, - `c3` blob, + `c2` blob DEFAULT NULL, + `c4` longtext DEFAULT NULL, + `c3` blob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -31423,8 +31423,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumblob, - `c3` mediumblob, + `c2` mediumblob DEFAULT NULL, + `c3` mediumblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 LONGTEXT NULL AFTER c2; @@ -31435,9 +31435,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumblob, - `c4` longtext, - `c3` mediumblob, + `c2` mediumblob DEFAULT NULL, + `c4` longtext DEFAULT NULL, + `c3` mediumblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -31451,8 +31451,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longblob, - `c3` longblob, + `c2` longblob DEFAULT NULL, + `c3` longblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 LONGTEXT NULL AFTER c2; @@ -31463,9 +31463,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longblob, - `c4` longtext, - `c3` longblob, + `c2` longblob DEFAULT NULL, + `c4` longtext DEFAULT NULL, + `c3` longblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -31479,8 +31479,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinytext, - `c3` tinytext, + `c2` tinytext DEFAULT NULL, + `c3` tinytext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 LONGTEXT NULL AFTER c2; @@ -31491,9 +31491,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` tinytext, - `c4` longtext, - `c3` tinytext, + `c2` tinytext DEFAULT NULL, + `c4` longtext DEFAULT NULL, + `c3` tinytext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -31507,8 +31507,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` text, - `c3` text, + `c2` text DEFAULT NULL, + `c3` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 LONGTEXT NULL AFTER c2; @@ -31519,9 +31519,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` text, - `c4` longtext, - `c3` text, + `c2` text DEFAULT NULL, + `c4` longtext DEFAULT NULL, + `c3` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -31535,8 +31535,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumtext, - `c3` mediumtext, + `c2` mediumtext DEFAULT NULL, + `c3` mediumtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 LONGTEXT NULL AFTER c2; @@ -31547,9 +31547,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` mediumtext, - `c4` longtext, - `c3` mediumtext, + `c2` mediumtext DEFAULT NULL, + `c4` longtext DEFAULT NULL, + `c3` mediumtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; @@ -31563,8 +31563,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longtext, - `c3` longtext, + `c2` longtext DEFAULT NULL, + `c3` longtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ADD c4 LONGTEXT NULL AFTER c2; @@ -31575,9 +31575,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` longtext, - `c4` longtext, - `c3` longtext, + `c2` longtext DEFAULT NULL, + `c4` longtext DEFAULT NULL, + `c3` longtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; diff --git a/mysql-test/suite/engines/funcs/r/ta_add_column_middle2.result b/mysql-test/suite/engines/funcs/r/ta_add_column_middle2.result index 4c40d7c3ee7..5303ee0ce71 100644 --- a/mysql-test/suite/engines/funcs/r/ta_add_column_middle2.result +++ b/mysql-test/suite/engines/funcs/r/ta_add_column_middle2.result @@ -3604,7 +3604,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` char(15) NOT NULL, `c2` int(11) NOT NULL, - `c4` tinyblob, + `c4` tinyblob DEFAULT NULL, `c3` char(20) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -3632,7 +3632,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` varchar(15) NOT NULL, `c2` int(11) NOT NULL, - `c4` tinyblob, + `c4` tinyblob DEFAULT NULL, `c3` varchar(20) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -3660,7 +3660,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` binary(15) NOT NULL, `c2` int(11) NOT NULL, - `c4` tinyblob, + `c4` tinyblob DEFAULT NULL, `c3` binary(20) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -3688,7 +3688,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` varbinary(15) NOT NULL, `c2` int(11) NOT NULL, - `c4` tinyblob, + `c4` tinyblob DEFAULT NULL, `c3` varbinary(20) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -3828,7 +3828,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` char(15) NOT NULL, `c2` int(11) NOT NULL, - `c4` blob, + `c4` blob DEFAULT NULL, `c3` char(20) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -3856,7 +3856,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` varchar(15) NOT NULL, `c2` int(11) NOT NULL, - `c4` blob, + `c4` blob DEFAULT NULL, `c3` varchar(20) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -3884,7 +3884,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` binary(15) NOT NULL, `c2` int(11) NOT NULL, - `c4` blob, + `c4` blob DEFAULT NULL, `c3` binary(20) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -3912,7 +3912,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` varbinary(15) NOT NULL, `c2` int(11) NOT NULL, - `c4` blob, + `c4` blob DEFAULT NULL, `c3` varbinary(20) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4052,7 +4052,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` char(15) NOT NULL, `c2` int(11) NOT NULL, - `c4` mediumblob, + `c4` mediumblob DEFAULT NULL, `c3` char(20) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4080,7 +4080,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` varchar(15) NOT NULL, `c2` int(11) NOT NULL, - `c4` mediumblob, + `c4` mediumblob DEFAULT NULL, `c3` varchar(20) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4108,7 +4108,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` binary(15) NOT NULL, `c2` int(11) NOT NULL, - `c4` mediumblob, + `c4` mediumblob DEFAULT NULL, `c3` binary(20) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4136,7 +4136,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` varbinary(15) NOT NULL, `c2` int(11) NOT NULL, - `c4` mediumblob, + `c4` mediumblob DEFAULT NULL, `c3` varbinary(20) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4276,7 +4276,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` char(15) NOT NULL, `c2` int(11) NOT NULL, - `c4` longblob, + `c4` longblob DEFAULT NULL, `c3` char(20) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4304,7 +4304,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` varchar(15) NOT NULL, `c2` int(11) NOT NULL, - `c4` longblob, + `c4` longblob DEFAULT NULL, `c3` varchar(20) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4332,7 +4332,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` binary(15) NOT NULL, `c2` int(11) NOT NULL, - `c4` longblob, + `c4` longblob DEFAULT NULL, `c3` binary(20) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4360,7 +4360,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` varbinary(15) NOT NULL, `c2` int(11) NOT NULL, - `c4` longblob, + `c4` longblob DEFAULT NULL, `c3` varbinary(20) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4500,7 +4500,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` char(15) NOT NULL, `c2` int(11) NOT NULL, - `c4` tinytext, + `c4` tinytext DEFAULT NULL, `c3` char(20) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4528,7 +4528,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` varchar(15) NOT NULL, `c2` int(11) NOT NULL, - `c4` tinytext, + `c4` tinytext DEFAULT NULL, `c3` varchar(20) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4556,7 +4556,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` binary(15) NOT NULL, `c2` int(11) NOT NULL, - `c4` tinytext, + `c4` tinytext DEFAULT NULL, `c3` binary(20) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4584,7 +4584,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` varbinary(15) NOT NULL, `c2` int(11) NOT NULL, - `c4` tinytext, + `c4` tinytext DEFAULT NULL, `c3` varbinary(20) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4724,7 +4724,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` char(15) NOT NULL, `c2` int(11) NOT NULL, - `c4` text, + `c4` text DEFAULT NULL, `c3` char(20) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4752,7 +4752,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` varchar(15) NOT NULL, `c2` int(11) NOT NULL, - `c4` text, + `c4` text DEFAULT NULL, `c3` varchar(20) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4780,7 +4780,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` binary(15) NOT NULL, `c2` int(11) NOT NULL, - `c4` text, + `c4` text DEFAULT NULL, `c3` binary(20) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4808,7 +4808,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` varbinary(15) NOT NULL, `c2` int(11) NOT NULL, - `c4` text, + `c4` text DEFAULT NULL, `c3` varbinary(20) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4948,7 +4948,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` char(15) NOT NULL, `c2` int(11) NOT NULL, - `c4` mediumtext, + `c4` mediumtext DEFAULT NULL, `c3` char(20) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4976,7 +4976,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` varchar(15) NOT NULL, `c2` int(11) NOT NULL, - `c4` mediumtext, + `c4` mediumtext DEFAULT NULL, `c3` varchar(20) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -5004,7 +5004,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` binary(15) NOT NULL, `c2` int(11) NOT NULL, - `c4` mediumtext, + `c4` mediumtext DEFAULT NULL, `c3` binary(20) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -5032,7 +5032,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` varbinary(15) NOT NULL, `c2` int(11) NOT NULL, - `c4` mediumtext, + `c4` mediumtext DEFAULT NULL, `c3` varbinary(20) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -5172,7 +5172,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` char(15) NOT NULL, `c2` int(11) NOT NULL, - `c4` longtext, + `c4` longtext DEFAULT NULL, `c3` char(20) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -5200,7 +5200,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` varchar(15) NOT NULL, `c2` int(11) NOT NULL, - `c4` longtext, + `c4` longtext DEFAULT NULL, `c3` varchar(20) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -5228,7 +5228,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` binary(15) NOT NULL, `c2` int(11) NOT NULL, - `c4` longtext, + `c4` longtext DEFAULT NULL, `c3` binary(20) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -5256,7 +5256,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` varbinary(15) NOT NULL, `c2` int(11) NOT NULL, - `c4` longtext, + `c4` longtext DEFAULT NULL, `c3` varbinary(20) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 diff --git a/mysql-test/suite/engines/funcs/r/ta_add_string2.result b/mysql-test/suite/engines/funcs/r/ta_add_string2.result index 0735019a706..82c4f5ff75b 100644 --- a/mysql-test/suite/engines/funcs/r/ta_add_string2.result +++ b/mysql-test/suite/engines/funcs/r/ta_add_string2.result @@ -358,7 +358,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 CHAR(5) NULL; SHOW TABLES; @@ -367,7 +367,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` tinyblob, + `c1` tinyblob DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; @@ -380,7 +380,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 CHAR(5) NULL; SHOW TABLES; @@ -389,7 +389,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` blob, + `c1` blob DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; @@ -402,7 +402,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 CHAR(5) NULL; SHOW TABLES; @@ -411,7 +411,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` mediumblob, + `c1` mediumblob DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; @@ -424,7 +424,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 CHAR(5) NULL; SHOW TABLES; @@ -433,7 +433,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` longblob, + `c1` longblob DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; @@ -446,7 +446,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 CHAR(5) NULL; SHOW TABLES; @@ -455,7 +455,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` tinytext, + `c1` tinytext DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; @@ -468,7 +468,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 CHAR(5) NULL; SHOW TABLES; @@ -477,7 +477,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` text, + `c1` text DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; @@ -490,7 +490,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 CHAR(5) NULL; SHOW TABLES; @@ -499,7 +499,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` mediumtext, + `c1` mediumtext DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; @@ -512,7 +512,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 CHAR(5) NULL; SHOW TABLES; @@ -521,7 +521,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` longtext, + `c1` longtext DEFAULT NULL, `c2` char(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; @@ -1414,7 +1414,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 VARCHAR(5) NULL; SHOW TABLES; @@ -1423,7 +1423,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` tinyblob, + `c1` tinyblob DEFAULT NULL, `c2` varchar(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; @@ -1436,7 +1436,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 VARCHAR(5) NULL; SHOW TABLES; @@ -1445,7 +1445,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` blob, + `c1` blob DEFAULT NULL, `c2` varchar(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; @@ -1458,7 +1458,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 VARCHAR(5) NULL; SHOW TABLES; @@ -1467,7 +1467,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` mediumblob, + `c1` mediumblob DEFAULT NULL, `c2` varchar(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; @@ -1480,7 +1480,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 VARCHAR(5) NULL; SHOW TABLES; @@ -1489,7 +1489,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` longblob, + `c1` longblob DEFAULT NULL, `c2` varchar(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; @@ -1502,7 +1502,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 VARCHAR(5) NULL; SHOW TABLES; @@ -1511,7 +1511,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` tinytext, + `c1` tinytext DEFAULT NULL, `c2` varchar(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; @@ -1524,7 +1524,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 VARCHAR(5) NULL; SHOW TABLES; @@ -1533,7 +1533,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` text, + `c1` text DEFAULT NULL, `c2` varchar(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; @@ -1546,7 +1546,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 VARCHAR(5) NULL; SHOW TABLES; @@ -1555,7 +1555,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` mediumtext, + `c1` mediumtext DEFAULT NULL, `c2` varchar(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; @@ -1568,7 +1568,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 VARCHAR(5) NULL; SHOW TABLES; @@ -1577,7 +1577,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` longtext, + `c1` longtext DEFAULT NULL, `c2` varchar(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; @@ -2470,7 +2470,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 BINARY(5) NULL; SHOW TABLES; @@ -2479,7 +2479,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` tinyblob, + `c1` tinyblob DEFAULT NULL, `c2` binary(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; @@ -2492,7 +2492,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 BINARY(5) NULL; SHOW TABLES; @@ -2501,7 +2501,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` blob, + `c1` blob DEFAULT NULL, `c2` binary(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; @@ -2514,7 +2514,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 BINARY(5) NULL; SHOW TABLES; @@ -2523,7 +2523,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` mediumblob, + `c1` mediumblob DEFAULT NULL, `c2` binary(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; @@ -2536,7 +2536,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 BINARY(5) NULL; SHOW TABLES; @@ -2545,7 +2545,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` longblob, + `c1` longblob DEFAULT NULL, `c2` binary(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; @@ -2558,7 +2558,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 BINARY(5) NULL; SHOW TABLES; @@ -2567,7 +2567,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` tinytext, + `c1` tinytext DEFAULT NULL, `c2` binary(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; @@ -2580,7 +2580,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 BINARY(5) NULL; SHOW TABLES; @@ -2589,7 +2589,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` text, + `c1` text DEFAULT NULL, `c2` binary(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; @@ -2602,7 +2602,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 BINARY(5) NULL; SHOW TABLES; @@ -2611,7 +2611,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` mediumtext, + `c1` mediumtext DEFAULT NULL, `c2` binary(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; @@ -2624,7 +2624,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 BINARY(5) NULL; SHOW TABLES; @@ -2633,7 +2633,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` longtext, + `c1` longtext DEFAULT NULL, `c2` binary(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; @@ -3526,7 +3526,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 VARBINARY(5) NULL; SHOW TABLES; @@ -3535,7 +3535,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` tinyblob, + `c1` tinyblob DEFAULT NULL, `c2` varbinary(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; @@ -3548,7 +3548,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 VARBINARY(5) NULL; SHOW TABLES; @@ -3557,7 +3557,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` blob, + `c1` blob DEFAULT NULL, `c2` varbinary(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; @@ -3570,7 +3570,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 VARBINARY(5) NULL; SHOW TABLES; @@ -3579,7 +3579,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` mediumblob, + `c1` mediumblob DEFAULT NULL, `c2` varbinary(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; @@ -3592,7 +3592,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 VARBINARY(5) NULL; SHOW TABLES; @@ -3601,7 +3601,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` longblob, + `c1` longblob DEFAULT NULL, `c2` varbinary(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; @@ -3614,7 +3614,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 VARBINARY(5) NULL; SHOW TABLES; @@ -3623,7 +3623,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` tinytext, + `c1` tinytext DEFAULT NULL, `c2` varbinary(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; @@ -3636,7 +3636,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 VARBINARY(5) NULL; SHOW TABLES; @@ -3645,7 +3645,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` text, + `c1` text DEFAULT NULL, `c2` varbinary(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; @@ -3658,7 +3658,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 VARBINARY(5) NULL; SHOW TABLES; @@ -3667,7 +3667,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` mediumtext, + `c1` mediumtext DEFAULT NULL, `c2` varbinary(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; @@ -3680,7 +3680,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 VARBINARY(5) NULL; SHOW TABLES; @@ -3689,7 +3689,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` longtext, + `c1` longtext DEFAULT NULL, `c2` varbinary(5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; diff --git a/mysql-test/suite/engines/funcs/r/ta_add_string_first2.result b/mysql-test/suite/engines/funcs/r/ta_add_string_first2.result index 0c016fcd3ab..8b2ad0d98b9 100644 --- a/mysql-test/suite/engines/funcs/r/ta_add_string_first2.result +++ b/mysql-test/suite/engines/funcs/r/ta_add_string_first2.result @@ -358,7 +358,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 CHAR(5) NULL FIRST; SHOW TABLES; @@ -368,7 +368,7 @@ SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( `c2` char(5) DEFAULT NULL, - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; SHOW TABLES; @@ -380,7 +380,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 CHAR(5) NULL FIRST; SHOW TABLES; @@ -390,7 +390,7 @@ SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( `c2` char(5) DEFAULT NULL, - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; SHOW TABLES; @@ -402,7 +402,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 CHAR(5) NULL FIRST; SHOW TABLES; @@ -412,7 +412,7 @@ SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( `c2` char(5) DEFAULT NULL, - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; SHOW TABLES; @@ -424,7 +424,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 CHAR(5) NULL FIRST; SHOW TABLES; @@ -434,7 +434,7 @@ SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( `c2` char(5) DEFAULT NULL, - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; SHOW TABLES; @@ -446,7 +446,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 CHAR(5) NULL FIRST; SHOW TABLES; @@ -456,7 +456,7 @@ SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( `c2` char(5) DEFAULT NULL, - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; SHOW TABLES; @@ -468,7 +468,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 CHAR(5) NULL FIRST; SHOW TABLES; @@ -478,7 +478,7 @@ SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( `c2` char(5) DEFAULT NULL, - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; SHOW TABLES; @@ -490,7 +490,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 CHAR(5) NULL FIRST; SHOW TABLES; @@ -500,7 +500,7 @@ SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( `c2` char(5) DEFAULT NULL, - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; SHOW TABLES; @@ -512,7 +512,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 CHAR(5) NULL FIRST; SHOW TABLES; @@ -522,7 +522,7 @@ SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( `c2` char(5) DEFAULT NULL, - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; SHOW TABLES; @@ -1414,7 +1414,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 VARCHAR(5) NULL FIRST; SHOW TABLES; @@ -1424,7 +1424,7 @@ SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( `c2` varchar(5) DEFAULT NULL, - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; SHOW TABLES; @@ -1436,7 +1436,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 VARCHAR(5) NULL FIRST; SHOW TABLES; @@ -1446,7 +1446,7 @@ SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( `c2` varchar(5) DEFAULT NULL, - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; SHOW TABLES; @@ -1458,7 +1458,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 VARCHAR(5) NULL FIRST; SHOW TABLES; @@ -1468,7 +1468,7 @@ SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( `c2` varchar(5) DEFAULT NULL, - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; SHOW TABLES; @@ -1480,7 +1480,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 VARCHAR(5) NULL FIRST; SHOW TABLES; @@ -1490,7 +1490,7 @@ SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( `c2` varchar(5) DEFAULT NULL, - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; SHOW TABLES; @@ -1502,7 +1502,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 VARCHAR(5) NULL FIRST; SHOW TABLES; @@ -1512,7 +1512,7 @@ SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( `c2` varchar(5) DEFAULT NULL, - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; SHOW TABLES; @@ -1524,7 +1524,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 VARCHAR(5) NULL FIRST; SHOW TABLES; @@ -1534,7 +1534,7 @@ SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( `c2` varchar(5) DEFAULT NULL, - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; SHOW TABLES; @@ -1546,7 +1546,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 VARCHAR(5) NULL FIRST; SHOW TABLES; @@ -1556,7 +1556,7 @@ SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( `c2` varchar(5) DEFAULT NULL, - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; SHOW TABLES; @@ -1568,7 +1568,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 VARCHAR(5) NULL FIRST; SHOW TABLES; @@ -1578,7 +1578,7 @@ SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( `c2` varchar(5) DEFAULT NULL, - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; SHOW TABLES; @@ -2470,7 +2470,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 BINARY(5) NULL FIRST; SHOW TABLES; @@ -2480,7 +2480,7 @@ SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( `c2` binary(5) DEFAULT NULL, - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; SHOW TABLES; @@ -2492,7 +2492,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 BINARY(5) NULL FIRST; SHOW TABLES; @@ -2502,7 +2502,7 @@ SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( `c2` binary(5) DEFAULT NULL, - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; SHOW TABLES; @@ -2514,7 +2514,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 BINARY(5) NULL FIRST; SHOW TABLES; @@ -2524,7 +2524,7 @@ SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( `c2` binary(5) DEFAULT NULL, - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; SHOW TABLES; @@ -2536,7 +2536,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 BINARY(5) NULL FIRST; SHOW TABLES; @@ -2546,7 +2546,7 @@ SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( `c2` binary(5) DEFAULT NULL, - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; SHOW TABLES; @@ -2558,7 +2558,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 BINARY(5) NULL FIRST; SHOW TABLES; @@ -2568,7 +2568,7 @@ SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( `c2` binary(5) DEFAULT NULL, - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; SHOW TABLES; @@ -2580,7 +2580,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 BINARY(5) NULL FIRST; SHOW TABLES; @@ -2590,7 +2590,7 @@ SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( `c2` binary(5) DEFAULT NULL, - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; SHOW TABLES; @@ -2602,7 +2602,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 BINARY(5) NULL FIRST; SHOW TABLES; @@ -2612,7 +2612,7 @@ SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( `c2` binary(5) DEFAULT NULL, - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; SHOW TABLES; @@ -2624,7 +2624,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 BINARY(5) NULL FIRST; SHOW TABLES; @@ -2634,7 +2634,7 @@ SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( `c2` binary(5) DEFAULT NULL, - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; SHOW TABLES; @@ -3526,7 +3526,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 VARBINARY(5) NULL FIRST; SHOW TABLES; @@ -3536,7 +3536,7 @@ SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( `c2` varbinary(5) DEFAULT NULL, - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; SHOW TABLES; @@ -3548,7 +3548,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 VARBINARY(5) NULL FIRST; SHOW TABLES; @@ -3558,7 +3558,7 @@ SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( `c2` varbinary(5) DEFAULT NULL, - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; SHOW TABLES; @@ -3570,7 +3570,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 VARBINARY(5) NULL FIRST; SHOW TABLES; @@ -3580,7 +3580,7 @@ SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( `c2` varbinary(5) DEFAULT NULL, - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; SHOW TABLES; @@ -3592,7 +3592,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 VARBINARY(5) NULL FIRST; SHOW TABLES; @@ -3602,7 +3602,7 @@ SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( `c2` varbinary(5) DEFAULT NULL, - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; SHOW TABLES; @@ -3614,7 +3614,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 VARBINARY(5) NULL FIRST; SHOW TABLES; @@ -3624,7 +3624,7 @@ SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( `c2` varbinary(5) DEFAULT NULL, - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; SHOW TABLES; @@ -3636,7 +3636,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 VARBINARY(5) NULL FIRST; SHOW TABLES; @@ -3646,7 +3646,7 @@ SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( `c2` varbinary(5) DEFAULT NULL, - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; SHOW TABLES; @@ -3658,7 +3658,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 VARBINARY(5) NULL FIRST; SHOW TABLES; @@ -3668,7 +3668,7 @@ SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( `c2` varbinary(5) DEFAULT NULL, - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; SHOW TABLES; @@ -3680,7 +3680,7 @@ t5 SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t5 ADD c2 VARBINARY(5) NULL FIRST; SHOW TABLES; @@ -3690,7 +3690,7 @@ SHOW CREATE TABLE t5; Table Create Table t5 CREATE TABLE `t5` ( `c2` varbinary(5) DEFAULT NULL, - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t5; SHOW TABLES; diff --git a/mysql-test/suite/engines/funcs/r/ta_column_to_not_null.result b/mysql-test/suite/engines/funcs/r/ta_column_to_not_null.result index 9707999ea23..6538ebe1102 100644 --- a/mysql-test/suite/engines/funcs/r/ta_column_to_not_null.result +++ b/mysql-test/suite/engines/funcs/r/ta_column_to_not_null.result @@ -342,7 +342,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 MODIFY c1 TINYBLOB NOT NULL; SHOW TABLES; @@ -363,7 +363,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 MODIFY c1 BLOB NOT NULL; SHOW TABLES; @@ -384,7 +384,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 MODIFY c1 MEDIUMBLOB NOT NULL; SHOW TABLES; @@ -405,7 +405,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 MODIFY c1 LONGBLOB NOT NULL; SHOW TABLES; @@ -426,7 +426,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 MODIFY c1 TINYTEXT NOT NULL; SHOW TABLES; @@ -447,7 +447,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 MODIFY c1 TEXT NOT NULL; SHOW TABLES; @@ -468,7 +468,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 MODIFY c1 MEDIUMTEXT NOT NULL; SHOW TABLES; @@ -489,7 +489,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 MODIFY c1 LONGTEXT NOT NULL; SHOW TABLES; @@ -846,7 +846,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 CHANGE c1 c1 TINYBLOB NOT NULL; SHOW TABLES; @@ -867,7 +867,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 CHANGE c1 c1 BLOB NOT NULL; SHOW TABLES; @@ -888,7 +888,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 CHANGE c1 c1 MEDIUMBLOB NOT NULL; SHOW TABLES; @@ -909,7 +909,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 CHANGE c1 c1 LONGBLOB NOT NULL; SHOW TABLES; @@ -930,7 +930,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 CHANGE c1 c1 TINYTEXT NOT NULL; SHOW TABLES; @@ -951,7 +951,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 CHANGE c1 c1 TEXT NOT NULL; SHOW TABLES; @@ -972,7 +972,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 CHANGE c1 c1 MEDIUMTEXT NOT NULL; SHOW TABLES; @@ -993,7 +993,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 CHANGE c1 c1 LONGTEXT NOT NULL; SHOW TABLES; diff --git a/mysql-test/suite/engines/funcs/r/ta_column_to_null.result b/mysql-test/suite/engines/funcs/r/ta_column_to_null.result index ddb587d4cb8..55f9d589185 100644 --- a/mysql-test/suite/engines/funcs/r/ta_column_to_null.result +++ b/mysql-test/suite/engines/funcs/r/ta_column_to_null.result @@ -351,7 +351,7 @@ t2 SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t2; SHOW TABLES; @@ -372,7 +372,7 @@ t2 SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t2; SHOW TABLES; @@ -393,7 +393,7 @@ t2 SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t2; SHOW TABLES; @@ -414,7 +414,7 @@ t2 SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t2; SHOW TABLES; @@ -435,7 +435,7 @@ t2 SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t2; SHOW TABLES; @@ -456,7 +456,7 @@ t2 SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t2; SHOW TABLES; @@ -477,7 +477,7 @@ t2 SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t2; SHOW TABLES; @@ -498,7 +498,7 @@ t2 SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t2; SHOW TABLES; @@ -855,7 +855,7 @@ t2 SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t2; SHOW TABLES; @@ -876,7 +876,7 @@ t2 SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t2; SHOW TABLES; @@ -897,7 +897,7 @@ t2 SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t2; SHOW TABLES; @@ -918,7 +918,7 @@ t2 SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t2; SHOW TABLES; @@ -939,7 +939,7 @@ t2 SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t2; SHOW TABLES; @@ -960,7 +960,7 @@ t2 SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t2; SHOW TABLES; @@ -981,7 +981,7 @@ t2 SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t2; SHOW TABLES; @@ -1002,7 +1002,7 @@ t2 SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t2; SHOW TABLES; diff --git a/mysql-test/suite/engines/funcs/r/ta_set_drop_default.result b/mysql-test/suite/engines/funcs/r/ta_set_drop_default.result index 2b45626f08d..ffd3c000c7d 100644 --- a/mysql-test/suite/engines/funcs/r/ta_set_drop_default.result +++ b/mysql-test/suite/engines/funcs/r/ta_set_drop_default.result @@ -19,7 +19,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` tinyint(4) NOT NULL, - `c2` tinyint(4) DEFAULT '10', + `c2` tinyint(4) DEFAULT 10, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ALTER c2 DROP DEFAULT; @@ -60,7 +60,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` smallint(6) NOT NULL, - `c2` smallint(6) DEFAULT '10', + `c2` smallint(6) DEFAULT 10, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ALTER c2 DROP DEFAULT; @@ -101,7 +101,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` mediumint(9) NOT NULL, - `c2` mediumint(9) DEFAULT '10', + `c2` mediumint(9) DEFAULT 10, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ALTER c2 DROP DEFAULT; @@ -142,7 +142,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` int(11) DEFAULT '10', + `c2` int(11) DEFAULT 10, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ALTER c2 DROP DEFAULT; @@ -183,7 +183,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` int(11) DEFAULT '10', + `c2` int(11) DEFAULT 10, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ALTER c2 DROP DEFAULT; @@ -224,7 +224,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` bigint(20) NOT NULL, - `c2` bigint(20) DEFAULT '10', + `c2` bigint(20) DEFAULT 10, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ALTER c2 DROP DEFAULT; @@ -265,7 +265,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` double NOT NULL, - `c2` double DEFAULT '10', + `c2` double DEFAULT 10, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ALTER c2 DROP DEFAULT; @@ -306,7 +306,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` double NOT NULL, - `c2` double DEFAULT '10', + `c2` double DEFAULT 10, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ALTER c2 DROP DEFAULT; @@ -347,7 +347,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` float NOT NULL, - `c2` float DEFAULT '10', + `c2` float DEFAULT 10, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ALTER c2 DROP DEFAULT; @@ -388,7 +388,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` decimal(10,0) NOT NULL, - `c2` decimal(10,0) DEFAULT '10', + `c2` decimal(10,0) DEFAULT 10, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ALTER c2 DROP DEFAULT; @@ -429,7 +429,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` decimal(10,0) NOT NULL, - `c2` decimal(10,0) DEFAULT '10', + `c2` decimal(10,0) DEFAULT 10, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ALTER c2 DROP DEFAULT; @@ -470,7 +470,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` tinyint(4) NOT NULL, - `c2` tinyint(4) DEFAULT '10', + `c2` tinyint(4) DEFAULT 10, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ALTER COLUMN c2 DROP DEFAULT; @@ -511,7 +511,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` smallint(6) NOT NULL, - `c2` smallint(6) DEFAULT '10', + `c2` smallint(6) DEFAULT 10, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ALTER COLUMN c2 DROP DEFAULT; @@ -552,7 +552,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` mediumint(9) NOT NULL, - `c2` mediumint(9) DEFAULT '10', + `c2` mediumint(9) DEFAULT 10, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ALTER COLUMN c2 DROP DEFAULT; @@ -593,7 +593,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` int(11) DEFAULT '10', + `c2` int(11) DEFAULT 10, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ALTER COLUMN c2 DROP DEFAULT; @@ -634,7 +634,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` int(11) DEFAULT '10', + `c2` int(11) DEFAULT 10, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ALTER COLUMN c2 DROP DEFAULT; @@ -675,7 +675,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` bigint(20) NOT NULL, - `c2` bigint(20) DEFAULT '10', + `c2` bigint(20) DEFAULT 10, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ALTER COLUMN c2 DROP DEFAULT; @@ -716,7 +716,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` double NOT NULL, - `c2` double DEFAULT '10', + `c2` double DEFAULT 10, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ALTER COLUMN c2 DROP DEFAULT; @@ -757,7 +757,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` double NOT NULL, - `c2` double DEFAULT '10', + `c2` double DEFAULT 10, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ALTER COLUMN c2 DROP DEFAULT; @@ -798,7 +798,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` float NOT NULL, - `c2` float DEFAULT '10', + `c2` float DEFAULT 10, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ALTER COLUMN c2 DROP DEFAULT; @@ -839,7 +839,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` decimal(10,0) NOT NULL, - `c2` decimal(10,0) DEFAULT '10', + `c2` decimal(10,0) DEFAULT 10, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ALTER COLUMN c2 DROP DEFAULT; @@ -880,7 +880,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` decimal(10,0) NOT NULL, - `c2` decimal(10,0) DEFAULT '10', + `c2` decimal(10,0) DEFAULT 10, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 ALTER TABLE t1 ALTER COLUMN c2 DROP DEFAULT; diff --git a/mysql-test/suite/engines/funcs/r/tc_column_comment.result b/mysql-test/suite/engines/funcs/r/tc_column_comment.result index eadb29a7057..991d26c3366 100644 --- a/mysql-test/suite/engines/funcs/r/tc_column_comment.result +++ b/mysql-test/suite/engines/funcs/r/tc_column_comment.result @@ -246,7 +246,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob COMMENT 'This is a TINYBLOB column' + `c1` tinyblob DEFAULT NULL COMMENT 'This is a TINYBLOB column' ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -258,7 +258,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob COMMENT 'This is a BLOB column' + `c1` blob DEFAULT NULL COMMENT 'This is a BLOB column' ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -270,7 +270,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob COMMENT 'This is a MEDIUMBLOB column' + `c1` mediumblob DEFAULT NULL COMMENT 'This is a MEDIUMBLOB column' ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -282,7 +282,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob COMMENT 'This is a LONGBLOB column' + `c1` longblob DEFAULT NULL COMMENT 'This is a LONGBLOB column' ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -294,7 +294,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext COMMENT 'This is a TINYTEXT column' + `c1` tinytext DEFAULT NULL COMMENT 'This is a TINYTEXT column' ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -306,7 +306,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text COMMENT 'This is a TEXT column' + `c1` text DEFAULT NULL COMMENT 'This is a TEXT column' ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -318,7 +318,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext COMMENT 'This is a MEDIUMTEXT column' + `c1` mediumtext DEFAULT NULL COMMENT 'This is a MEDIUMTEXT column' ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -330,7 +330,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext COMMENT 'This is a LONGTEXT column' + `c1` longtext DEFAULT NULL COMMENT 'This is a LONGTEXT column' ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; diff --git a/mysql-test/suite/engines/funcs/r/tc_column_default_decimal.result b/mysql-test/suite/engines/funcs/r/tc_column_default_decimal.result index 8a70602c0cc..b049451b2b7 100644 --- a/mysql-test/suite/engines/funcs/r/tc_column_default_decimal.result +++ b/mysql-test/suite/engines/funcs/r/tc_column_default_decimal.result @@ -7,7 +7,7 @@ t12 SHOW CREATE TABLE t12; Table Create Table t12 CREATE TABLE `t12` ( - `c1` decimal(5,0) DEFAULT '2' + `c1` decimal(5,0) DEFAULT 2 ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t12; SHOW TABLES; @@ -19,7 +19,7 @@ t13 SHOW CREATE TABLE t13; Table Create Table t13 CREATE TABLE `t13` ( - `c1` decimal(5,4) DEFAULT '3.1234' + `c1` decimal(5,4) DEFAULT 3.1234 ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t13; SHOW TABLES; @@ -31,7 +31,7 @@ t12 SHOW CREATE TABLE t12; Table Create Table t12 CREATE TABLE `t12` ( - `c1` decimal(5,0) DEFAULT '2' + `c1` decimal(5,0) DEFAULT 2 ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t12; SHOW TABLES; @@ -43,7 +43,7 @@ t13 SHOW CREATE TABLE t13; Table Create Table t13 CREATE TABLE `t13` ( - `c1` decimal(5,4) DEFAULT '3.1234' + `c1` decimal(5,4) DEFAULT 3.1234 ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t13; SHOW TABLES; @@ -55,7 +55,7 @@ t12 SHOW CREATE TABLE t12; Table Create Table t12 CREATE TABLE `t12` ( - `c1` decimal(5,0) DEFAULT '2' + `c1` decimal(5,0) DEFAULT 2 ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t12; SHOW TABLES; @@ -67,7 +67,7 @@ t13 SHOW CREATE TABLE t13; Table Create Table t13 CREATE TABLE `t13` ( - `c1` decimal(5,4) DEFAULT '3.1234' + `c1` decimal(5,4) DEFAULT 3.1234 ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t13; SHOW TABLES; @@ -79,7 +79,7 @@ t12 SHOW CREATE TABLE t12; Table Create Table t12 CREATE TABLE `t12` ( - `c1` decimal(5,0) DEFAULT '2' + `c1` decimal(5,0) DEFAULT 2 ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t12; SHOW TABLES; @@ -91,7 +91,7 @@ t13 SHOW CREATE TABLE t13; Table Create Table t13 CREATE TABLE `t13` ( - `c1` decimal(5,4) DEFAULT '3.1234' + `c1` decimal(5,4) DEFAULT 3.1234 ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t13; SHOW TABLES; @@ -103,7 +103,7 @@ t12 SHOW CREATE TABLE t12; Table Create Table t12 CREATE TABLE `t12` ( - `c1` decimal(5,0) NOT NULL DEFAULT '2' + `c1` decimal(5,0) NOT NULL DEFAULT 2 ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t12; SHOW TABLES; @@ -115,7 +115,7 @@ t13 SHOW CREATE TABLE t13; Table Create Table t13 CREATE TABLE `t13` ( - `c1` decimal(5,4) NOT NULL DEFAULT '3.1234' + `c1` decimal(5,4) NOT NULL DEFAULT 3.1234 ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t13; SHOW TABLES; @@ -127,7 +127,7 @@ t12 SHOW CREATE TABLE t12; Table Create Table t12 CREATE TABLE `t12` ( - `c1` decimal(5,0) NOT NULL DEFAULT '2' + `c1` decimal(5,0) NOT NULL DEFAULT 2 ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t12; SHOW TABLES; @@ -139,7 +139,7 @@ t13 SHOW CREATE TABLE t13; Table Create Table t13 CREATE TABLE `t13` ( - `c1` decimal(5,4) NOT NULL DEFAULT '3.1234' + `c1` decimal(5,4) NOT NULL DEFAULT 3.1234 ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t13; SHOW TABLES; @@ -151,7 +151,7 @@ t12 SHOW CREATE TABLE t12; Table Create Table t12 CREATE TABLE `t12` ( - `c1` decimal(5,0) NOT NULL DEFAULT '2' + `c1` decimal(5,0) NOT NULL DEFAULT 2 ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t12; SHOW TABLES; @@ -163,7 +163,7 @@ t13 SHOW CREATE TABLE t13; Table Create Table t13 CREATE TABLE `t13` ( - `c1` decimal(5,4) NOT NULL DEFAULT '3.1234' + `c1` decimal(5,4) NOT NULL DEFAULT 3.1234 ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t13; SHOW TABLES; @@ -175,7 +175,7 @@ t12 SHOW CREATE TABLE t12; Table Create Table t12 CREATE TABLE `t12` ( - `c1` decimal(5,0) NOT NULL DEFAULT '2' + `c1` decimal(5,0) NOT NULL DEFAULT 2 ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t12; SHOW TABLES; @@ -187,7 +187,7 @@ t13 SHOW CREATE TABLE t13; Table Create Table t13 CREATE TABLE `t13` ( - `c1` decimal(5,4) NOT NULL DEFAULT '3.1234' + `c1` decimal(5,4) NOT NULL DEFAULT 3.1234 ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t13; SHOW TABLES; diff --git a/mysql-test/suite/engines/funcs/r/tc_column_default_number.result b/mysql-test/suite/engines/funcs/r/tc_column_default_number.result index 96326634a49..3cfb17f7e6b 100644 --- a/mysql-test/suite/engines/funcs/r/tc_column_default_number.result +++ b/mysql-test/suite/engines/funcs/r/tc_column_default_number.result @@ -6,7 +6,7 @@ t11 SHOW CREATE TABLE t11; Table Create Table t11 CREATE TABLE `t11` ( - `c1` tinyint(5) DEFAULT '1' + `c1` tinyint(5) DEFAULT 1 ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t11; SHOW TABLES; @@ -18,7 +18,7 @@ t11 SHOW CREATE TABLE t11; Table Create Table t11 CREATE TABLE `t11` ( - `c1` smallint(5) DEFAULT '1' + `c1` smallint(5) DEFAULT 1 ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t11; SHOW TABLES; @@ -30,7 +30,7 @@ t11 SHOW CREATE TABLE t11; Table Create Table t11 CREATE TABLE `t11` ( - `c1` mediumint(5) DEFAULT '1' + `c1` mediumint(5) DEFAULT 1 ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t11; SHOW TABLES; @@ -42,7 +42,7 @@ t11 SHOW CREATE TABLE t11; Table Create Table t11 CREATE TABLE `t11` ( - `c1` int(5) DEFAULT '1' + `c1` int(5) DEFAULT 1 ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t11; SHOW TABLES; @@ -54,7 +54,7 @@ t11 SHOW CREATE TABLE t11; Table Create Table t11 CREATE TABLE `t11` ( - `c1` int(5) DEFAULT '1' + `c1` int(5) DEFAULT 1 ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t11; SHOW TABLES; @@ -66,7 +66,7 @@ t11 SHOW CREATE TABLE t11; Table Create Table t11 CREATE TABLE `t11` ( - `c1` bigint(5) DEFAULT '1' + `c1` bigint(5) DEFAULT 1 ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t11; SHOW TABLES; @@ -78,7 +78,7 @@ t11 SHOW CREATE TABLE t11; Table Create Table t11 CREATE TABLE `t11` ( - `c1` tinyint(5) NOT NULL DEFAULT '1' + `c1` tinyint(5) NOT NULL DEFAULT 1 ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t11; SHOW TABLES; @@ -90,7 +90,7 @@ t11 SHOW CREATE TABLE t11; Table Create Table t11 CREATE TABLE `t11` ( - `c1` smallint(5) NOT NULL DEFAULT '1' + `c1` smallint(5) NOT NULL DEFAULT 1 ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t11; SHOW TABLES; @@ -102,7 +102,7 @@ t11 SHOW CREATE TABLE t11; Table Create Table t11 CREATE TABLE `t11` ( - `c1` mediumint(5) NOT NULL DEFAULT '1' + `c1` mediumint(5) NOT NULL DEFAULT 1 ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t11; SHOW TABLES; @@ -114,7 +114,7 @@ t11 SHOW CREATE TABLE t11; Table Create Table t11 CREATE TABLE `t11` ( - `c1` int(5) NOT NULL DEFAULT '1' + `c1` int(5) NOT NULL DEFAULT 1 ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t11; SHOW TABLES; @@ -126,7 +126,7 @@ t11 SHOW CREATE TABLE t11; Table Create Table t11 CREATE TABLE `t11` ( - `c1` int(5) NOT NULL DEFAULT '1' + `c1` int(5) NOT NULL DEFAULT 1 ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t11; SHOW TABLES; @@ -138,7 +138,7 @@ t11 SHOW CREATE TABLE t11; Table Create Table t11 CREATE TABLE `t11` ( - `c1` bigint(5) NOT NULL DEFAULT '1' + `c1` bigint(5) NOT NULL DEFAULT 1 ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t11; SHOW TABLES; diff --git a/mysql-test/suite/engines/funcs/r/tc_column_null.result b/mysql-test/suite/engines/funcs/r/tc_column_null.result index 67b26781aa8..406c814cabb 100644 --- a/mysql-test/suite/engines/funcs/r/tc_column_null.result +++ b/mysql-test/suite/engines/funcs/r/tc_column_null.result @@ -246,7 +246,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -258,7 +258,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -270,7 +270,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -282,7 +282,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -294,7 +294,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -306,7 +306,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -318,7 +318,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -330,7 +330,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; diff --git a/mysql-test/suite/engines/funcs/r/tc_multicolumn_different.result b/mysql-test/suite/engines/funcs/r/tc_multicolumn_different.result index af518d114e3..16be4f4b08c 100644 --- a/mysql-test/suite/engines/funcs/r/tc_multicolumn_different.result +++ b/mysql-test/suite/engines/funcs/r/tc_multicolumn_different.result @@ -11,7 +11,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -30,7 +30,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -49,7 +49,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -68,7 +68,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -87,7 +87,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -106,7 +106,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -125,7 +125,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -144,7 +144,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -163,7 +163,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -182,7 +182,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -201,7 +201,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -220,7 +220,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -239,7 +239,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -258,7 +258,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -277,7 +277,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -296,7 +296,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -315,7 +315,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -334,7 +334,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -353,7 +353,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -372,7 +372,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -391,7 +391,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -410,7 +410,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -429,7 +429,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -448,7 +448,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -467,7 +467,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -486,7 +486,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -505,7 +505,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -524,7 +524,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -543,7 +543,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -562,7 +562,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -581,7 +581,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -600,7 +600,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -619,7 +619,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -638,7 +638,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -657,7 +657,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -676,7 +676,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -695,7 +695,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -714,7 +714,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -733,7 +733,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -752,7 +752,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -771,7 +771,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -790,7 +790,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -809,7 +809,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -828,7 +828,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -847,7 +847,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -866,7 +866,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -885,7 +885,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -904,7 +904,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -923,7 +923,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -942,7 +942,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -961,7 +961,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -980,7 +980,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -999,7 +999,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -1018,7 +1018,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -1037,7 +1037,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -1056,7 +1056,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -1075,7 +1075,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -1094,7 +1094,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -1113,7 +1113,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -1132,7 +1132,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -1151,7 +1151,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -1170,7 +1170,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -1189,7 +1189,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -1208,7 +1208,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -1227,7 +1227,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -1246,7 +1246,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -1265,7 +1265,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -1284,7 +1284,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -1303,7 +1303,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -1322,7 +1322,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -1341,7 +1341,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -1360,7 +1360,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -1379,7 +1379,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -1398,7 +1398,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -1417,7 +1417,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -1436,7 +1436,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -1455,7 +1455,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -1474,7 +1474,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -1493,7 +1493,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -1512,7 +1512,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -1531,7 +1531,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -1550,7 +1550,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -1569,7 +1569,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -1588,7 +1588,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -1607,7 +1607,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -1626,7 +1626,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -1645,7 +1645,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -1664,7 +1664,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -1683,7 +1683,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -1702,7 +1702,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -1721,7 +1721,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -1740,7 +1740,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -1759,7 +1759,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -1778,7 +1778,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -1797,7 +1797,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -1816,7 +1816,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -1835,7 +1835,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -1854,7 +1854,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -1873,7 +1873,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -1892,7 +1892,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -1911,7 +1911,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -1930,7 +1930,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -1949,7 +1949,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -1968,7 +1968,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -1987,7 +1987,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -2006,7 +2006,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -2025,7 +2025,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -2044,7 +2044,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -2063,7 +2063,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -2082,7 +2082,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -2101,7 +2101,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -2120,7 +2120,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -2139,7 +2139,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -2158,7 +2158,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -2177,7 +2177,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -2196,7 +2196,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -2215,7 +2215,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -2234,7 +2234,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -2253,7 +2253,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -2272,7 +2272,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -2291,7 +2291,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -2310,7 +2310,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -2329,7 +2329,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -2348,7 +2348,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -2367,7 +2367,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -2386,7 +2386,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -2405,7 +2405,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -2424,7 +2424,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -2443,7 +2443,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -2462,7 +2462,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -2481,7 +2481,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -2500,7 +2500,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -2519,7 +2519,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -2538,7 +2538,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -2557,7 +2557,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -2576,7 +2576,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -2595,7 +2595,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -2614,7 +2614,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -2633,7 +2633,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -2652,7 +2652,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -2671,7 +2671,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -2690,7 +2690,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -2709,7 +2709,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -2728,7 +2728,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -2747,7 +2747,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -2766,7 +2766,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -2785,7 +2785,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -2804,7 +2804,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -2823,7 +2823,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -2842,7 +2842,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -2861,7 +2861,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -2880,7 +2880,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -2899,7 +2899,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -2918,7 +2918,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -2937,7 +2937,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -2956,7 +2956,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -2975,7 +2975,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -2994,7 +2994,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -3013,7 +3013,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -3032,7 +3032,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -3051,7 +3051,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -3070,7 +3070,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -3089,7 +3089,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -3108,7 +3108,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -3127,7 +3127,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -3146,7 +3146,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -3165,7 +3165,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -3184,7 +3184,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -3203,7 +3203,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -3222,7 +3222,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -3241,7 +3241,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -3260,7 +3260,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -3279,7 +3279,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -3298,7 +3298,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -3317,7 +3317,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -3336,7 +3336,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -3355,7 +3355,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -3374,7 +3374,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -3393,7 +3393,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -3412,7 +3412,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -3431,7 +3431,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -3450,7 +3450,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -3469,7 +3469,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -3488,7 +3488,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -3507,7 +3507,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -3526,7 +3526,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -3545,7 +3545,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -3564,7 +3564,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -3583,7 +3583,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -3602,7 +3602,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -3621,7 +3621,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -3640,7 +3640,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -3659,7 +3659,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -3678,7 +3678,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -3697,7 +3697,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -3716,7 +3716,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -3735,7 +3735,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -3754,7 +3754,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -3773,7 +3773,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -3792,7 +3792,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -3811,7 +3811,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -3830,7 +3830,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -3849,7 +3849,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -3868,7 +3868,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -3887,7 +3887,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -3906,7 +3906,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -3925,7 +3925,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -3944,7 +3944,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -3963,7 +3963,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -3982,7 +3982,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4001,7 +4001,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4020,7 +4020,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4039,7 +4039,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4058,7 +4058,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4077,7 +4077,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4096,7 +4096,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4115,7 +4115,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4134,7 +4134,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4153,7 +4153,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4172,7 +4172,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4191,7 +4191,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4210,7 +4210,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4229,7 +4229,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4248,7 +4248,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4267,7 +4267,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4286,7 +4286,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4305,7 +4305,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4324,7 +4324,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4343,7 +4343,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4362,7 +4362,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4381,7 +4381,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4400,7 +4400,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4419,7 +4419,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4438,7 +4438,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4457,7 +4457,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4476,7 +4476,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4495,7 +4495,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4514,7 +4514,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4533,7 +4533,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4552,7 +4552,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4571,7 +4571,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4590,7 +4590,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4609,7 +4609,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4628,7 +4628,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4647,7 +4647,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4666,7 +4666,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4685,7 +4685,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4704,7 +4704,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4723,7 +4723,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4742,7 +4742,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4761,7 +4761,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4780,7 +4780,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4799,7 +4799,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4818,7 +4818,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4837,7 +4837,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4856,7 +4856,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4875,7 +4875,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4894,7 +4894,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4913,7 +4913,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4932,7 +4932,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4951,7 +4951,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4970,7 +4970,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -4989,7 +4989,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -5008,7 +5008,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -5027,7 +5027,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -5046,7 +5046,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -5065,7 +5065,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -5084,7 +5084,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -5103,7 +5103,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -5122,7 +5122,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -5141,7 +5141,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -5160,7 +5160,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -5179,7 +5179,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -5198,7 +5198,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -5217,7 +5217,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -5236,7 +5236,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -5255,7 +5255,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -5274,7 +5274,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -5293,7 +5293,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -5312,7 +5312,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -5331,7 +5331,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -5350,7 +5350,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -5369,7 +5369,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -5388,7 +5388,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -5407,7 +5407,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -5426,7 +5426,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -5445,7 +5445,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -5464,7 +5464,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -5483,7 +5483,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -5502,7 +5502,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -5521,7 +5521,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -5540,7 +5540,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -5559,7 +5559,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -5578,7 +5578,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -5597,7 +5597,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -5616,7 +5616,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -5635,7 +5635,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -5654,7 +5654,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -5673,7 +5673,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -5692,7 +5692,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -5711,7 +5711,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -5730,7 +5730,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -5749,7 +5749,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -5768,7 +5768,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -5787,7 +5787,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -5806,7 +5806,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -5825,7 +5825,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -5844,7 +5844,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -5863,7 +5863,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -5882,7 +5882,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -5901,7 +5901,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -5920,7 +5920,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -5939,7 +5939,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -5958,7 +5958,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -5977,7 +5977,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -5996,7 +5996,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6015,7 +6015,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6034,7 +6034,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6053,7 +6053,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6072,7 +6072,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6091,7 +6091,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6110,7 +6110,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6129,7 +6129,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6148,7 +6148,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6167,7 +6167,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6186,7 +6186,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6205,7 +6205,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6224,7 +6224,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6243,7 +6243,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6262,7 +6262,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6281,7 +6281,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6300,7 +6300,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6319,7 +6319,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6338,7 +6338,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6357,7 +6357,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6376,7 +6376,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6395,7 +6395,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6414,7 +6414,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6433,7 +6433,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6452,7 +6452,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6471,7 +6471,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6490,7 +6490,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6509,7 +6509,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6528,7 +6528,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6547,7 +6547,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6566,7 +6566,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6585,7 +6585,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6604,7 +6604,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6623,7 +6623,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6642,7 +6642,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6661,7 +6661,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6680,7 +6680,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6699,7 +6699,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6718,7 +6718,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6737,7 +6737,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6756,7 +6756,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6775,7 +6775,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6794,7 +6794,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6813,7 +6813,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6832,7 +6832,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6851,7 +6851,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6870,7 +6870,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6889,7 +6889,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6908,7 +6908,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6927,7 +6927,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6946,7 +6946,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6965,7 +6965,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -6984,7 +6984,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -7003,7 +7003,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -7022,7 +7022,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -7041,7 +7041,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -7060,7 +7060,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -7079,7 +7079,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -7098,7 +7098,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -7117,7 +7117,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -7136,7 +7136,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -7155,7 +7155,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -7174,7 +7174,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -7193,7 +7193,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -7212,7 +7212,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -7231,7 +7231,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -7250,7 +7250,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -7269,7 +7269,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -7288,7 +7288,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -7307,7 +7307,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -7326,7 +7326,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -7345,7 +7345,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -7364,7 +7364,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -7383,7 +7383,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -7402,7 +7402,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -7421,7 +7421,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -7440,7 +7440,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -7459,7 +7459,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -7478,7 +7478,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -7497,7 +7497,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -7516,7 +7516,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -7535,7 +7535,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -7554,7 +7554,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -7573,7 +7573,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -7592,7 +7592,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -7611,7 +7611,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -7630,7 +7630,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -7649,7 +7649,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -7668,7 +7668,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -7687,7 +7687,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -7706,7 +7706,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -7725,7 +7725,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -7744,7 +7744,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -7763,7 +7763,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -7782,7 +7782,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -7801,7 +7801,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -7820,7 +7820,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -7839,7 +7839,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -7858,7 +7858,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -7877,7 +7877,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -7896,7 +7896,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -7915,7 +7915,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -7934,7 +7934,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -7953,7 +7953,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -7972,7 +7972,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -7991,7 +7991,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -8010,7 +8010,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -8029,7 +8029,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -8048,7 +8048,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -8067,7 +8067,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -8086,7 +8086,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -8105,7 +8105,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -8124,7 +8124,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -8143,7 +8143,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -8162,7 +8162,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -8181,7 +8181,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -8200,7 +8200,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -8219,7 +8219,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -8238,7 +8238,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -8257,7 +8257,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -8276,7 +8276,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -8295,7 +8295,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -8314,7 +8314,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -8333,7 +8333,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -8352,7 +8352,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -8371,7 +8371,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -8390,7 +8390,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -8409,7 +8409,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -8428,7 +8428,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -8447,7 +8447,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -8466,7 +8466,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -8485,7 +8485,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -8504,7 +8504,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -8523,7 +8523,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -8542,7 +8542,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -8561,7 +8561,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -8580,7 +8580,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -8599,7 +8599,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -8618,7 +8618,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -8637,7 +8637,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -8656,7 +8656,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -8675,7 +8675,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -8694,7 +8694,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -8713,7 +8713,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -8732,7 +8732,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -8751,7 +8751,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -8770,7 +8770,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -8789,7 +8789,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -8808,7 +8808,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -8827,7 +8827,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -8846,7 +8846,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -8865,7 +8865,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -8884,7 +8884,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -8903,7 +8903,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -8922,7 +8922,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -8941,7 +8941,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -8960,7 +8960,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -8979,7 +8979,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -8998,7 +8998,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -9017,7 +9017,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -9036,7 +9036,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -9055,7 +9055,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -9074,7 +9074,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -9093,7 +9093,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -9112,7 +9112,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -9131,7 +9131,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -9150,7 +9150,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -9169,7 +9169,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -9188,7 +9188,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -9207,7 +9207,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -9226,7 +9226,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -9245,7 +9245,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -9264,7 +9264,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -9283,7 +9283,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -9302,7 +9302,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -9321,7 +9321,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -9340,7 +9340,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -9359,7 +9359,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -9378,7 +9378,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -9397,7 +9397,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -9416,7 +9416,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -9435,7 +9435,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -9454,7 +9454,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -9473,7 +9473,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -9492,7 +9492,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -9511,7 +9511,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -9530,7 +9530,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -9549,7 +9549,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -9568,7 +9568,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -9587,7 +9587,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -9606,7 +9606,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -9625,7 +9625,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -9644,7 +9644,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -9663,7 +9663,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -9682,7 +9682,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -9701,7 +9701,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -9720,7 +9720,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -9739,7 +9739,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -9758,7 +9758,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -9777,7 +9777,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -9796,7 +9796,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -9815,7 +9815,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -9834,7 +9834,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -9853,7 +9853,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -9872,7 +9872,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -9891,7 +9891,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -9910,7 +9910,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -9929,7 +9929,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -9948,7 +9948,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -9967,7 +9967,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -9986,7 +9986,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -10005,7 +10005,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -10024,7 +10024,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -10043,7 +10043,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -10062,7 +10062,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -10081,7 +10081,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -10100,7 +10100,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -10119,7 +10119,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -10138,7 +10138,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -10157,7 +10157,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -10176,7 +10176,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -10195,7 +10195,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -10214,7 +10214,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -10233,7 +10233,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -10252,7 +10252,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -10271,7 +10271,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -10290,7 +10290,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -10309,7 +10309,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -10328,7 +10328,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -10347,7 +10347,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -10366,7 +10366,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -10385,7 +10385,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -10404,7 +10404,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -10423,7 +10423,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -10442,7 +10442,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -10461,7 +10461,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -10480,7 +10480,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -10499,7 +10499,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -10518,7 +10518,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -10537,7 +10537,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -10556,7 +10556,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -10575,7 +10575,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -10594,7 +10594,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -10613,7 +10613,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -10632,7 +10632,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -10651,7 +10651,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -10670,7 +10670,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -10689,7 +10689,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -10708,7 +10708,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -10727,7 +10727,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -10746,7 +10746,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -10765,7 +10765,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -10784,7 +10784,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -10803,7 +10803,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -10822,7 +10822,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -10841,7 +10841,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -10860,7 +10860,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -10879,7 +10879,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -10898,7 +10898,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -10917,7 +10917,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -10936,7 +10936,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -10955,7 +10955,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -10974,7 +10974,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -10993,7 +10993,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -11012,7 +11012,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -11031,7 +11031,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -11050,7 +11050,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -11069,7 +11069,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -11088,7 +11088,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -11107,7 +11107,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -11126,7 +11126,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -11145,7 +11145,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -11164,7 +11164,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -11183,7 +11183,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -11202,7 +11202,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -11221,7 +11221,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -11240,7 +11240,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -11259,7 +11259,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -11278,7 +11278,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -11297,7 +11297,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -11316,7 +11316,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -11335,7 +11335,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -11354,7 +11354,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -11373,7 +11373,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -11392,7 +11392,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -11411,7 +11411,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -11430,7 +11430,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -11449,7 +11449,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -11468,7 +11468,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -11487,7 +11487,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -11506,7 +11506,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -11525,7 +11525,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -11544,7 +11544,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -11563,7 +11563,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -11582,7 +11582,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -11601,7 +11601,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -11620,7 +11620,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -11639,7 +11639,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -11658,7 +11658,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -11677,7 +11677,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -11696,7 +11696,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -11715,7 +11715,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -11734,7 +11734,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -11753,7 +11753,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -11772,7 +11772,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -11791,7 +11791,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -11810,7 +11810,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -11829,7 +11829,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -11848,7 +11848,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -11867,7 +11867,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -11886,7 +11886,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -11905,7 +11905,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -11924,7 +11924,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -11943,7 +11943,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -11962,7 +11962,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -11981,7 +11981,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -12000,7 +12000,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -12019,7 +12019,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -12038,7 +12038,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -12057,7 +12057,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -12076,7 +12076,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -12095,7 +12095,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -12114,7 +12114,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -12133,7 +12133,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -12152,7 +12152,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -12171,7 +12171,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -12190,7 +12190,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -12209,7 +12209,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -12228,7 +12228,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -12247,7 +12247,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -12266,7 +12266,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -12285,7 +12285,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -12304,7 +12304,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -12323,7 +12323,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -12342,7 +12342,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -12361,7 +12361,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -12380,7 +12380,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -12399,7 +12399,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -12418,7 +12418,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -12437,7 +12437,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -12456,7 +12456,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -12475,7 +12475,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -12494,7 +12494,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -12513,7 +12513,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -12532,7 +12532,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -12551,7 +12551,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -12570,7 +12570,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -12589,7 +12589,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -12608,7 +12608,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -12627,7 +12627,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -12646,7 +12646,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -12665,7 +12665,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -12684,7 +12684,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -12703,7 +12703,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -12722,7 +12722,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -12741,7 +12741,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -12760,7 +12760,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -12779,7 +12779,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -12798,7 +12798,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -12817,7 +12817,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -12836,7 +12836,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -12855,7 +12855,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -12874,7 +12874,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -12893,7 +12893,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -12912,7 +12912,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -12931,7 +12931,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -12950,7 +12950,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -12969,7 +12969,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -12988,7 +12988,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -13007,7 +13007,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -13026,7 +13026,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -13045,7 +13045,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -13064,7 +13064,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -13083,7 +13083,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -13102,7 +13102,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -13121,7 +13121,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -13140,7 +13140,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -13159,7 +13159,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -13178,7 +13178,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -13197,7 +13197,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -13216,7 +13216,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -13235,7 +13235,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -13254,7 +13254,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -13273,7 +13273,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -13292,7 +13292,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -13311,7 +13311,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -13330,7 +13330,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -13349,7 +13349,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -13368,7 +13368,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -13387,7 +13387,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -13406,7 +13406,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -13425,7 +13425,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -13444,7 +13444,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -13463,7 +13463,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -13482,7 +13482,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -13501,7 +13501,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -13520,7 +13520,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -13539,7 +13539,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -13558,7 +13558,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -13577,7 +13577,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -13596,7 +13596,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -13615,7 +13615,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -13634,7 +13634,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -13653,7 +13653,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -13672,7 +13672,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -13691,7 +13691,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -13710,7 +13710,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -13729,7 +13729,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -13748,7 +13748,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -13767,7 +13767,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -13786,7 +13786,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -13805,7 +13805,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -13824,7 +13824,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -13843,7 +13843,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -13862,7 +13862,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -13881,7 +13881,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -13900,7 +13900,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -13919,7 +13919,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -13938,7 +13938,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -13957,7 +13957,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -13976,7 +13976,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -13995,7 +13995,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -14014,7 +14014,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -14033,7 +14033,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -14052,7 +14052,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -14071,7 +14071,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -14090,7 +14090,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -14109,7 +14109,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -14128,7 +14128,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -14147,7 +14147,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -14166,7 +14166,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -14185,7 +14185,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -14204,7 +14204,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -14223,7 +14223,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -14242,7 +14242,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -14261,7 +14261,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -14280,7 +14280,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -14299,7 +14299,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -14318,7 +14318,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -14337,7 +14337,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -14356,7 +14356,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -14375,7 +14375,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -14394,7 +14394,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -14413,7 +14413,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -14432,7 +14432,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -14451,7 +14451,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -14470,7 +14470,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -14489,7 +14489,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -14508,7 +14508,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -14527,7 +14527,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -14546,7 +14546,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -14565,7 +14565,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -14584,7 +14584,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -14603,7 +14603,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -14622,7 +14622,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -14641,7 +14641,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -14660,7 +14660,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -14679,7 +14679,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -14698,7 +14698,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -14717,7 +14717,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -14736,7 +14736,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -14755,7 +14755,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -14774,7 +14774,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -14793,7 +14793,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -14812,7 +14812,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -14831,7 +14831,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -14850,7 +14850,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -14869,7 +14869,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -14888,7 +14888,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -14907,7 +14907,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -14926,7 +14926,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -14945,7 +14945,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -14964,7 +14964,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -14983,7 +14983,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -15002,7 +15002,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -15021,7 +15021,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -15040,7 +15040,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -15059,7 +15059,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -15078,7 +15078,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -15097,7 +15097,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -15116,7 +15116,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -15135,7 +15135,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -15154,7 +15154,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -15173,7 +15173,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -15192,7 +15192,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -15211,7 +15211,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -15230,7 +15230,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -15249,7 +15249,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -15268,7 +15268,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -15287,7 +15287,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -15306,7 +15306,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -15325,7 +15325,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -15344,7 +15344,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -15363,7 +15363,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -15382,7 +15382,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -15401,7 +15401,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -15420,7 +15420,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -15439,7 +15439,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -15458,7 +15458,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -15477,7 +15477,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -15496,7 +15496,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -15515,7 +15515,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -15534,7 +15534,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -15553,7 +15553,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -15572,7 +15572,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -15591,7 +15591,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -15610,7 +15610,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -15629,7 +15629,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -15648,7 +15648,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -15667,7 +15667,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -15686,7 +15686,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -15705,7 +15705,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -15724,7 +15724,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -15743,7 +15743,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -15762,7 +15762,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -15781,7 +15781,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -15800,7 +15800,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -15819,7 +15819,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -15838,7 +15838,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -15857,7 +15857,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -15876,7 +15876,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -15895,7 +15895,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -15914,7 +15914,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -15933,7 +15933,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -15952,7 +15952,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -15971,7 +15971,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -15990,7 +15990,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -16009,7 +16009,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -16028,7 +16028,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -16047,7 +16047,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -16066,7 +16066,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -16085,7 +16085,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -16104,7 +16104,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -16123,7 +16123,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -16142,7 +16142,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -16161,7 +16161,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -16180,7 +16180,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -16199,7 +16199,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -16218,7 +16218,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -16237,7 +16237,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -16256,7 +16256,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -16275,7 +16275,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -16294,7 +16294,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -16313,7 +16313,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -16332,7 +16332,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -16351,7 +16351,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -16370,7 +16370,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -16389,7 +16389,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -16408,7 +16408,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -16427,7 +16427,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -16446,7 +16446,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -16465,7 +16465,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -16484,7 +16484,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -16503,7 +16503,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -16522,7 +16522,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -16541,7 +16541,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -16560,7 +16560,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -16579,7 +16579,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -16598,7 +16598,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -16617,7 +16617,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -16636,7 +16636,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -16655,7 +16655,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -16674,7 +16674,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -16693,7 +16693,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -16712,7 +16712,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -16731,7 +16731,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -16750,7 +16750,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -16769,7 +16769,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -16788,7 +16788,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -16807,7 +16807,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -16826,7 +16826,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -16845,7 +16845,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -16864,7 +16864,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -16883,7 +16883,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -16902,7 +16902,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -16921,7 +16921,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -16940,7 +16940,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -16959,7 +16959,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -16978,7 +16978,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -16997,7 +16997,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -17016,7 +17016,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -17035,7 +17035,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -17054,7 +17054,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -17073,7 +17073,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -17092,7 +17092,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -17111,7 +17111,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -17130,7 +17130,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -17149,7 +17149,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -17168,7 +17168,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -17187,7 +17187,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -17206,7 +17206,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -17225,7 +17225,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -17244,7 +17244,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -17263,7 +17263,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -17282,7 +17282,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -17301,7 +17301,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -17320,7 +17320,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -17339,7 +17339,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -17358,7 +17358,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -17377,7 +17377,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -17396,7 +17396,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -17415,7 +17415,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -17434,7 +17434,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -17453,7 +17453,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -17472,7 +17472,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -17491,7 +17491,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -17510,7 +17510,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -17529,7 +17529,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -17548,7 +17548,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -17567,7 +17567,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -17586,7 +17586,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -17605,7 +17605,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -17624,7 +17624,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -17643,7 +17643,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -17662,7 +17662,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -17681,7 +17681,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -17700,7 +17700,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -17719,7 +17719,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -17738,7 +17738,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -17757,7 +17757,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -17776,7 +17776,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -17795,7 +17795,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -17814,7 +17814,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -17833,7 +17833,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -17852,7 +17852,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -17871,7 +17871,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -17890,7 +17890,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -17909,7 +17909,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -17928,7 +17928,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -17947,7 +17947,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -17966,7 +17966,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -17985,7 +17985,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -18004,7 +18004,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -18023,7 +18023,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -18042,7 +18042,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -18061,7 +18061,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -18080,7 +18080,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -18099,7 +18099,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -18118,7 +18118,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -18137,7 +18137,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -18156,7 +18156,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -18175,7 +18175,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -18194,7 +18194,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -18213,7 +18213,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -18232,7 +18232,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -18251,7 +18251,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -18270,7 +18270,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -18289,7 +18289,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -18308,7 +18308,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -18327,7 +18327,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -18346,7 +18346,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -18365,7 +18365,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -18384,7 +18384,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -18403,7 +18403,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -18422,7 +18422,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -18441,7 +18441,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -18460,7 +18460,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -18479,7 +18479,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -18498,7 +18498,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -18517,7 +18517,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -18536,7 +18536,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -18555,7 +18555,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -18574,7 +18574,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -18593,7 +18593,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -18612,7 +18612,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -18631,7 +18631,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -18650,7 +18650,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -18669,7 +18669,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -18688,7 +18688,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -18707,7 +18707,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -18726,7 +18726,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -18745,7 +18745,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -18764,7 +18764,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -18783,7 +18783,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -18802,7 +18802,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -18821,7 +18821,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -18840,7 +18840,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -18859,7 +18859,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -18878,7 +18878,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -18897,7 +18897,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -18916,7 +18916,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -18935,7 +18935,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -18954,7 +18954,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -18973,7 +18973,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -18992,7 +18992,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19011,7 +19011,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19030,7 +19030,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19049,7 +19049,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19068,7 +19068,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19087,7 +19087,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19106,7 +19106,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19125,7 +19125,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19144,7 +19144,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19163,7 +19163,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19182,7 +19182,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19201,7 +19201,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19220,7 +19220,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19239,7 +19239,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19258,7 +19258,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19277,7 +19277,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19296,7 +19296,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19315,7 +19315,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19334,7 +19334,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19353,7 +19353,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19372,7 +19372,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19391,7 +19391,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19410,7 +19410,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19429,7 +19429,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19448,7 +19448,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19467,7 +19467,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19486,7 +19486,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19505,7 +19505,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19524,7 +19524,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19543,7 +19543,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19562,7 +19562,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19581,7 +19581,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19600,7 +19600,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19619,7 +19619,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19638,7 +19638,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19657,7 +19657,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19676,7 +19676,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19695,7 +19695,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19714,7 +19714,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19733,7 +19733,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19752,7 +19752,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19771,7 +19771,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19790,7 +19790,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19809,7 +19809,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19828,7 +19828,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19847,7 +19847,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19866,7 +19866,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19885,7 +19885,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19904,7 +19904,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19923,7 +19923,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19942,7 +19942,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19961,7 +19961,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19980,7 +19980,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -19999,7 +19999,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -20018,7 +20018,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -20037,7 +20037,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -20056,7 +20056,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -20075,7 +20075,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -20094,7 +20094,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -20113,7 +20113,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -20132,7 +20132,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -20151,7 +20151,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -20170,7 +20170,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -20189,7 +20189,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -20208,7 +20208,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -20227,7 +20227,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -20246,7 +20246,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -20265,7 +20265,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -20284,7 +20284,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -20303,7 +20303,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -20322,7 +20322,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -20341,7 +20341,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -20360,7 +20360,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -20379,7 +20379,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -20398,7 +20398,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -20417,7 +20417,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -20436,7 +20436,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -20455,7 +20455,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -20474,7 +20474,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -20493,7 +20493,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -20512,7 +20512,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -20531,7 +20531,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -20550,7 +20550,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -20569,7 +20569,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -20588,7 +20588,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -20607,7 +20607,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -20626,7 +20626,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -20645,7 +20645,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -20664,7 +20664,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -20683,7 +20683,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -20702,7 +20702,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -20721,7 +20721,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -20740,7 +20740,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -20759,7 +20759,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -20778,7 +20778,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -20797,7 +20797,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -20816,7 +20816,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -20835,7 +20835,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -20854,7 +20854,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -20873,7 +20873,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -20892,7 +20892,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -20911,7 +20911,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -20930,7 +20930,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -20949,7 +20949,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -20968,7 +20968,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -20987,7 +20987,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21006,7 +21006,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21025,7 +21025,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21044,7 +21044,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21063,7 +21063,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21082,7 +21082,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21101,7 +21101,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21120,7 +21120,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21139,7 +21139,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21158,7 +21158,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21177,7 +21177,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21196,7 +21196,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21215,7 +21215,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21234,7 +21234,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21253,7 +21253,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21272,7 +21272,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21291,7 +21291,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21310,7 +21310,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21329,7 +21329,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21348,7 +21348,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21367,7 +21367,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21386,7 +21386,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21405,7 +21405,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21424,7 +21424,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21443,7 +21443,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21462,7 +21462,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21481,7 +21481,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21500,7 +21500,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21519,7 +21519,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21538,7 +21538,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21557,7 +21557,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21576,7 +21576,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21595,7 +21595,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21614,7 +21614,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21633,7 +21633,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21652,7 +21652,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21671,7 +21671,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21690,7 +21690,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21709,7 +21709,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21728,7 +21728,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21747,7 +21747,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21766,7 +21766,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21785,7 +21785,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21804,7 +21804,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21823,7 +21823,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21842,7 +21842,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21861,7 +21861,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21880,7 +21880,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21899,7 +21899,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21918,7 +21918,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21937,7 +21937,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21956,7 +21956,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21975,7 +21975,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -21994,7 +21994,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -22013,7 +22013,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -22032,7 +22032,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -22051,7 +22051,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -22070,7 +22070,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -22089,7 +22089,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -22108,7 +22108,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -22127,7 +22127,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -22146,7 +22146,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -22165,7 +22165,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -22184,7 +22184,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -22203,7 +22203,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -22222,7 +22222,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -22241,7 +22241,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -22260,7 +22260,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -22279,7 +22279,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -22298,7 +22298,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -22317,7 +22317,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -22336,7 +22336,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -22355,7 +22355,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -22374,7 +22374,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -22393,7 +22393,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -22412,7 +22412,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -22431,7 +22431,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -22450,7 +22450,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -22469,7 +22469,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -22488,7 +22488,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -22507,7 +22507,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -22526,7 +22526,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -22545,7 +22545,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -22564,7 +22564,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -22583,7 +22583,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -22602,7 +22602,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -22621,7 +22621,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -22640,7 +22640,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -22659,7 +22659,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -22678,7 +22678,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -22697,7 +22697,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -22716,7 +22716,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -22735,7 +22735,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -22754,7 +22754,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -22773,7 +22773,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -22792,7 +22792,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -22811,7 +22811,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -22830,7 +22830,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -22849,7 +22849,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -22868,7 +22868,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -22887,7 +22887,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -22906,7 +22906,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -22925,7 +22925,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -22944,7 +22944,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -22963,7 +22963,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -22982,7 +22982,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -23001,7 +23001,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -23020,7 +23020,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -23039,7 +23039,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -23058,7 +23058,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -23077,7 +23077,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -23096,7 +23096,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -23115,7 +23115,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -23134,7 +23134,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -23153,7 +23153,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -23172,7 +23172,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -23191,7 +23191,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -23210,7 +23210,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -23229,7 +23229,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -23248,7 +23248,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -23267,7 +23267,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -23286,7 +23286,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -23305,7 +23305,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -23324,7 +23324,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -23343,7 +23343,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -23362,7 +23362,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -23381,7 +23381,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -23400,7 +23400,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -23419,7 +23419,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -23438,7 +23438,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -23457,7 +23457,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -23476,7 +23476,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -23495,7 +23495,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -23514,7 +23514,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -23533,7 +23533,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -23552,7 +23552,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -23571,7 +23571,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -23590,7 +23590,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -23609,7 +23609,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -23628,7 +23628,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -23647,7 +23647,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -23666,7 +23666,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -23685,7 +23685,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -23704,7 +23704,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -23723,7 +23723,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -23742,7 +23742,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -23761,7 +23761,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -23780,7 +23780,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -23799,7 +23799,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -23818,7 +23818,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -23837,7 +23837,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -23856,7 +23856,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -23875,7 +23875,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -23894,7 +23894,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -23913,7 +23913,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -23932,7 +23932,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -23951,7 +23951,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -23970,7 +23970,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -23989,7 +23989,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24008,7 +24008,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24027,7 +24027,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24046,7 +24046,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24065,7 +24065,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24084,7 +24084,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24103,7 +24103,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24122,7 +24122,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24141,7 +24141,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24160,7 +24160,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24179,7 +24179,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24198,7 +24198,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24217,7 +24217,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24236,7 +24236,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24255,7 +24255,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24274,7 +24274,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24293,7 +24293,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24312,7 +24312,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24331,7 +24331,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24350,7 +24350,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24369,7 +24369,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24388,7 +24388,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24407,7 +24407,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24426,7 +24426,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24445,7 +24445,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24464,7 +24464,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24483,7 +24483,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24502,7 +24502,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24521,7 +24521,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24540,7 +24540,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24559,7 +24559,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24578,7 +24578,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24597,7 +24597,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24616,7 +24616,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24635,7 +24635,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24654,7 +24654,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24673,7 +24673,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24692,7 +24692,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24711,7 +24711,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24730,7 +24730,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24749,7 +24749,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24768,7 +24768,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24787,7 +24787,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24806,7 +24806,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24825,7 +24825,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24844,7 +24844,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24863,7 +24863,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24882,7 +24882,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24901,7 +24901,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24920,7 +24920,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24939,7 +24939,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24958,7 +24958,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24977,7 +24977,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -24996,7 +24996,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25015,7 +25015,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25034,7 +25034,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25053,7 +25053,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25072,7 +25072,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25091,7 +25091,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25110,7 +25110,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25129,7 +25129,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25148,7 +25148,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25167,7 +25167,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25186,7 +25186,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25205,7 +25205,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25224,7 +25224,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25243,7 +25243,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25262,7 +25262,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25281,7 +25281,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25300,7 +25300,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25319,7 +25319,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25338,7 +25338,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25357,7 +25357,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25376,7 +25376,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25395,7 +25395,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25414,7 +25414,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25433,7 +25433,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25452,7 +25452,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25471,7 +25471,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25490,7 +25490,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25509,7 +25509,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25528,7 +25528,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25547,7 +25547,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25566,7 +25566,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25585,7 +25585,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25604,7 +25604,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25623,7 +25623,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25642,7 +25642,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25661,7 +25661,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25680,7 +25680,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25699,7 +25699,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25718,7 +25718,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25737,7 +25737,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25756,7 +25756,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25775,7 +25775,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25794,7 +25794,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25813,7 +25813,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25832,7 +25832,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25851,7 +25851,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25870,7 +25870,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25889,7 +25889,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25908,7 +25908,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25927,7 +25927,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25946,7 +25946,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25965,7 +25965,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -25984,7 +25984,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -26003,7 +26003,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -26022,7 +26022,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -26041,7 +26041,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -26060,7 +26060,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -26079,7 +26079,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -26098,7 +26098,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -26117,7 +26117,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -26136,7 +26136,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -26155,7 +26155,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -26174,7 +26174,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -26193,7 +26193,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -26212,7 +26212,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -26231,7 +26231,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -26250,7 +26250,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -26269,7 +26269,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -26288,7 +26288,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -26307,7 +26307,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -26326,7 +26326,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -26345,7 +26345,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -26364,7 +26364,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -26383,7 +26383,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -26402,7 +26402,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -26421,7 +26421,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -26440,7 +26440,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -26459,7 +26459,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -26478,7 +26478,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -26497,7 +26497,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -26516,7 +26516,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -26535,7 +26535,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -26554,7 +26554,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -26573,7 +26573,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -26592,7 +26592,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -26611,7 +26611,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -26630,7 +26630,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -26649,7 +26649,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -26668,7 +26668,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -26687,7 +26687,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -26706,7 +26706,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -26725,7 +26725,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -26744,7 +26744,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -26763,7 +26763,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -26782,7 +26782,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -26801,7 +26801,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -26820,7 +26820,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -26839,7 +26839,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -26858,7 +26858,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -26877,7 +26877,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -26896,7 +26896,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -26915,7 +26915,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -26934,7 +26934,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -26953,7 +26953,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -26972,7 +26972,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -26991,7 +26991,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -27010,7 +27010,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -27029,7 +27029,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -27048,7 +27048,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -27067,7 +27067,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -27086,7 +27086,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -27105,7 +27105,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -27124,7 +27124,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -27143,7 +27143,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -27162,7 +27162,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -27181,7 +27181,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -27200,7 +27200,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -27219,7 +27219,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -27238,7 +27238,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -27257,7 +27257,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -27276,7 +27276,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -27295,7 +27295,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -27314,7 +27314,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -27333,7 +27333,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -27352,7 +27352,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -27371,7 +27371,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -27390,7 +27390,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -27409,7 +27409,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -27428,7 +27428,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -27447,7 +27447,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -27466,7 +27466,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -27485,7 +27485,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -27504,7 +27504,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -27523,7 +27523,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -27542,7 +27542,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -27561,7 +27561,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -27580,7 +27580,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -27599,7 +27599,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -27618,7 +27618,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -27637,7 +27637,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -27656,7 +27656,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -27675,7 +27675,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -27694,7 +27694,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -27713,7 +27713,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -27732,7 +27732,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -27751,7 +27751,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -27770,7 +27770,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -27789,7 +27789,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -27808,7 +27808,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -27827,7 +27827,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -27846,7 +27846,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -27865,7 +27865,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -27884,7 +27884,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -27903,7 +27903,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -27922,7 +27922,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -27941,7 +27941,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -27960,7 +27960,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -27979,7 +27979,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -27998,7 +27998,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28017,7 +28017,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28036,7 +28036,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28055,7 +28055,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28074,7 +28074,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28093,7 +28093,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28112,7 +28112,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28131,7 +28131,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28150,7 +28150,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28169,7 +28169,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28188,7 +28188,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28207,7 +28207,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28226,7 +28226,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28245,7 +28245,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28264,7 +28264,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28283,7 +28283,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28302,7 +28302,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28321,7 +28321,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28340,7 +28340,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28359,7 +28359,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28378,7 +28378,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28397,7 +28397,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28416,7 +28416,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28435,7 +28435,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28454,7 +28454,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28473,7 +28473,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28492,7 +28492,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28511,7 +28511,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28530,7 +28530,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28549,7 +28549,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28568,7 +28568,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28587,7 +28587,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28606,7 +28606,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28625,7 +28625,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28644,7 +28644,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28663,7 +28663,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28682,7 +28682,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28701,7 +28701,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28720,7 +28720,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28739,7 +28739,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28758,7 +28758,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28777,7 +28777,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28796,7 +28796,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28815,7 +28815,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28834,7 +28834,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28853,7 +28853,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28872,7 +28872,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28891,7 +28891,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28910,7 +28910,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28929,7 +28929,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28948,7 +28948,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28967,7 +28967,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -28986,7 +28986,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29005,7 +29005,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29024,7 +29024,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29043,7 +29043,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29062,7 +29062,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29081,7 +29081,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29100,7 +29100,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29119,7 +29119,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29138,7 +29138,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29157,7 +29157,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29176,7 +29176,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29195,7 +29195,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29214,7 +29214,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29233,7 +29233,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29252,7 +29252,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29271,7 +29271,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29290,7 +29290,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29309,7 +29309,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29328,7 +29328,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29347,7 +29347,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29366,7 +29366,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29385,7 +29385,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29404,7 +29404,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29423,7 +29423,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29442,7 +29442,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29461,7 +29461,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29480,7 +29480,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29499,7 +29499,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29518,7 +29518,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29537,7 +29537,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29556,7 +29556,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29575,7 +29575,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29594,7 +29594,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29613,7 +29613,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29632,7 +29632,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` char(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29651,7 +29651,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29670,7 +29670,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29689,7 +29689,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29708,7 +29708,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29727,7 +29727,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29746,7 +29746,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29765,7 +29765,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29784,7 +29784,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29803,7 +29803,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29822,7 +29822,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29841,7 +29841,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29860,7 +29860,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29879,7 +29879,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29898,7 +29898,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29917,7 +29917,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29936,7 +29936,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29955,7 +29955,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29974,7 +29974,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -29993,7 +29993,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -30012,7 +30012,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -30031,7 +30031,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -30050,7 +30050,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -30069,7 +30069,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -30088,7 +30088,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -30107,7 +30107,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -30126,7 +30126,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -30145,7 +30145,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -30164,7 +30164,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -30183,7 +30183,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -30202,7 +30202,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -30221,7 +30221,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -30240,7 +30240,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -30259,7 +30259,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -30278,7 +30278,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -30297,7 +30297,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -30316,7 +30316,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -30335,7 +30335,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -30354,7 +30354,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -30373,7 +30373,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -30392,7 +30392,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -30411,7 +30411,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -30430,7 +30430,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -30449,7 +30449,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -30468,7 +30468,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -30487,7 +30487,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -30506,7 +30506,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -30525,7 +30525,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -30544,7 +30544,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -30563,7 +30563,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -30582,7 +30582,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -30601,7 +30601,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -30620,7 +30620,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -30639,7 +30639,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -30658,7 +30658,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -30677,7 +30677,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -30696,7 +30696,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -30715,7 +30715,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -30734,7 +30734,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -30753,7 +30753,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -30772,7 +30772,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -30791,7 +30791,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -30810,7 +30810,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -30829,7 +30829,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -30848,7 +30848,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -30867,7 +30867,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -30886,7 +30886,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -30905,7 +30905,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -30924,7 +30924,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -30943,7 +30943,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -30962,7 +30962,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -30981,7 +30981,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31000,7 +31000,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31019,7 +31019,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31038,7 +31038,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31057,7 +31057,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31076,7 +31076,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31095,7 +31095,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31114,7 +31114,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31133,7 +31133,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31152,7 +31152,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31171,7 +31171,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31190,7 +31190,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31209,7 +31209,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31228,7 +31228,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31247,7 +31247,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31266,7 +31266,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31285,7 +31285,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31304,7 +31304,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31323,7 +31323,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31342,7 +31342,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31361,7 +31361,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31380,7 +31380,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31399,7 +31399,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31418,7 +31418,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31437,7 +31437,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31456,7 +31456,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31475,7 +31475,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31494,7 +31494,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31513,7 +31513,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31532,7 +31532,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31551,7 +31551,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31570,7 +31570,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31589,7 +31589,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31608,7 +31608,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31627,7 +31627,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31646,7 +31646,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31665,7 +31665,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31684,7 +31684,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31703,7 +31703,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31722,7 +31722,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31741,7 +31741,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31760,7 +31760,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31779,7 +31779,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31798,7 +31798,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31817,7 +31817,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31836,7 +31836,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31855,7 +31855,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31874,7 +31874,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31893,7 +31893,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31912,7 +31912,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varchar(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31931,7 +31931,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31950,7 +31950,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31969,7 +31969,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -31988,7 +31988,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -32007,7 +32007,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -32026,7 +32026,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -32045,7 +32045,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -32064,7 +32064,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -32083,7 +32083,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -32102,7 +32102,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -32121,7 +32121,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -32140,7 +32140,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -32159,7 +32159,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -32178,7 +32178,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -32197,7 +32197,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -32216,7 +32216,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -32235,7 +32235,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -32254,7 +32254,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -32273,7 +32273,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -32292,7 +32292,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -32311,7 +32311,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -32330,7 +32330,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -32349,7 +32349,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -32368,7 +32368,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -32387,7 +32387,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -32406,7 +32406,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -32425,7 +32425,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -32444,7 +32444,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -32463,7 +32463,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -32482,7 +32482,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -32501,7 +32501,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -32520,7 +32520,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -32539,7 +32539,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -32558,7 +32558,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -32577,7 +32577,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -32596,7 +32596,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -32615,7 +32615,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -32634,7 +32634,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -32653,7 +32653,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -32672,7 +32672,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -32691,7 +32691,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -32710,7 +32710,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -32729,7 +32729,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -32748,7 +32748,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -32767,7 +32767,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -32786,7 +32786,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -32805,7 +32805,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -32824,7 +32824,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -32843,7 +32843,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -32862,7 +32862,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -32881,7 +32881,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -32900,7 +32900,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -32919,7 +32919,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -32938,7 +32938,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -32957,7 +32957,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -32976,7 +32976,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -32995,7 +32995,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -33014,7 +33014,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -33033,7 +33033,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -33052,7 +33052,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -33071,7 +33071,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -33090,7 +33090,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -33109,7 +33109,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -33128,7 +33128,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -33147,7 +33147,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -33166,7 +33166,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -33185,7 +33185,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -33204,7 +33204,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -33223,7 +33223,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -33242,7 +33242,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -33261,7 +33261,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -33280,7 +33280,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -33299,7 +33299,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -33318,7 +33318,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -33337,7 +33337,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -33356,7 +33356,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -33375,7 +33375,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -33394,7 +33394,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -33413,7 +33413,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -33432,7 +33432,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -33451,7 +33451,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -33470,7 +33470,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -33489,7 +33489,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -33508,7 +33508,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -33527,7 +33527,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -33546,7 +33546,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -33565,7 +33565,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -33584,7 +33584,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -33603,7 +33603,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -33622,7 +33622,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -33641,7 +33641,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -33660,7 +33660,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -33679,7 +33679,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -33698,7 +33698,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -33717,7 +33717,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -33736,7 +33736,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -33755,7 +33755,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -33774,7 +33774,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -33793,7 +33793,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -33812,7 +33812,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -33831,7 +33831,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -33850,7 +33850,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -33869,7 +33869,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -33888,7 +33888,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -33907,7 +33907,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -33926,7 +33926,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -33945,7 +33945,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -33964,7 +33964,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -33983,7 +33983,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -34002,7 +34002,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -34021,7 +34021,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -34040,7 +34040,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -34059,7 +34059,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -34078,7 +34078,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -34097,7 +34097,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -34116,7 +34116,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -34135,7 +34135,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -34154,7 +34154,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -34173,7 +34173,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -34192,7 +34192,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` binary(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -34211,7 +34211,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -34230,7 +34230,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -34249,7 +34249,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -34268,7 +34268,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -34287,7 +34287,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -34306,7 +34306,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -34325,7 +34325,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -34344,7 +34344,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -34363,7 +34363,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -34382,7 +34382,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -34401,7 +34401,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -34420,7 +34420,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -34439,7 +34439,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -34458,7 +34458,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -34477,7 +34477,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -34496,7 +34496,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -34515,7 +34515,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -34534,7 +34534,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -34553,7 +34553,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -34572,7 +34572,7 @@ m3 CREATE TABLE `m3` ( `c3` tinyint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -34591,7 +34591,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -34610,7 +34610,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -34629,7 +34629,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -34648,7 +34648,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -34667,7 +34667,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -34686,7 +34686,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -34705,7 +34705,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -34724,7 +34724,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -34743,7 +34743,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -34762,7 +34762,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -34781,7 +34781,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -34800,7 +34800,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -34819,7 +34819,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -34838,7 +34838,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -34857,7 +34857,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -34876,7 +34876,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -34895,7 +34895,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -34914,7 +34914,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -34933,7 +34933,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -34952,7 +34952,7 @@ m3 CREATE TABLE `m3` ( `c3` smallint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -34971,7 +34971,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -34990,7 +34990,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -35009,7 +35009,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -35028,7 +35028,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -35047,7 +35047,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -35066,7 +35066,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -35085,7 +35085,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -35104,7 +35104,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -35123,7 +35123,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -35142,7 +35142,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -35161,7 +35161,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -35180,7 +35180,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -35199,7 +35199,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -35218,7 +35218,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -35237,7 +35237,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -35256,7 +35256,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -35275,7 +35275,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -35294,7 +35294,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -35313,7 +35313,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -35332,7 +35332,7 @@ m3 CREATE TABLE `m3` ( `c3` mediumint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -35351,7 +35351,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -35370,7 +35370,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -35389,7 +35389,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -35408,7 +35408,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -35427,7 +35427,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -35446,7 +35446,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -35465,7 +35465,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -35484,7 +35484,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -35503,7 +35503,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -35522,7 +35522,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -35541,7 +35541,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -35560,7 +35560,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -35579,7 +35579,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -35598,7 +35598,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -35617,7 +35617,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -35636,7 +35636,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -35655,7 +35655,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -35674,7 +35674,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -35693,7 +35693,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -35712,7 +35712,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -35731,7 +35731,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -35750,7 +35750,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -35769,7 +35769,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -35788,7 +35788,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -35807,7 +35807,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -35826,7 +35826,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -35845,7 +35845,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -35864,7 +35864,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -35883,7 +35883,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -35902,7 +35902,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -35921,7 +35921,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -35940,7 +35940,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -35959,7 +35959,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -35978,7 +35978,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -35997,7 +35997,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -36016,7 +36016,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -36035,7 +36035,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -36054,7 +36054,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -36073,7 +36073,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -36092,7 +36092,7 @@ m3 CREATE TABLE `m3` ( `c3` int(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -36111,7 +36111,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` bit(1) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -36130,7 +36130,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` tinyint(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -36149,7 +36149,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` smallint(6) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -36168,7 +36168,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` mediumint(9) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -36187,7 +36187,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -36206,7 +36206,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` int(11) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -36225,7 +36225,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` bigint(20) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -36244,7 +36244,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -36263,7 +36263,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -36282,7 +36282,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -36301,7 +36301,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` decimal(10,0) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -36320,7 +36320,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -36339,7 +36339,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -36358,7 +36358,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` double NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -36377,7 +36377,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` float NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -36396,7 +36396,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` date NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -36415,7 +36415,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` time NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -36434,7 +36434,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -36453,7 +36453,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` datetime NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 @@ -36472,7 +36472,7 @@ m3 CREATE TABLE `m3` ( `c3` bigint(4) DEFAULT NULL, `c4` varbinary(15) NOT NULL, `c5` year(4) NOT NULL, - `c6` decimal(10,8) NOT NULL DEFAULT '3.14159200', + `c6` decimal(10,8) NOT NULL DEFAULT 3.14159200, PRIMARY KEY (`c4`), UNIQUE KEY `c5` (`c5`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 diff --git a/mysql-test/suite/engines/funcs/r/tc_structure_comment.result b/mysql-test/suite/engines/funcs/r/tc_structure_comment.result index 69217795cb8..0a8e5c83dec 100644 --- a/mysql-test/suite/engines/funcs/r/tc_structure_comment.result +++ b/mysql-test/suite/engines/funcs/r/tc_structure_comment.result @@ -210,7 +210,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 COMMENT='This table has a TINYBLOB column' DROP TABLE t1; SHOW TABLES; @@ -222,7 +222,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 COMMENT='This table has a BLOB column' DROP TABLE t1; SHOW TABLES; @@ -234,7 +234,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 COMMENT='This table has a MEDIUMBLOB column' DROP TABLE t1; SHOW TABLES; @@ -246,7 +246,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 COMMENT='This table has a LONGBLOB column' DROP TABLE t1; SHOW TABLES; @@ -258,7 +258,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 COMMENT='This table has a TINYTEXT column' DROP TABLE t1; SHOW TABLES; @@ -270,7 +270,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 COMMENT='This table has a TEXT column' DROP TABLE t1; SHOW TABLES; @@ -282,7 +282,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 COMMENT='This table has a MEDIUMTEXT column' DROP TABLE t1; SHOW TABLES; @@ -294,7 +294,7 @@ t1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 COMMENT='This table has a LONGTEXT column' DROP TABLE t1; SHOW TABLES; diff --git a/mysql-test/suite/engines/funcs/r/tc_structure_create_like.result b/mysql-test/suite/engines/funcs/r/tc_structure_create_like.result index 7036fcc31fc..0454271fdb1 100644 --- a/mysql-test/suite/engines/funcs/r/tc_structure_create_like.result +++ b/mysql-test/suite/engines/funcs/r/tc_structure_create_like.result @@ -315,7 +315,7 @@ SHOW CREATE TABLE dst; Table Create Table dst CREATE TABLE `dst` ( `c1` int(11) NOT NULL AUTO_INCREMENT, - `c2` tinyblob, + `c2` tinyblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE dst; @@ -333,7 +333,7 @@ SHOW CREATE TABLE dst; Table Create Table dst CREATE TABLE `dst` ( `c1` int(11) NOT NULL AUTO_INCREMENT, - `c2` blob, + `c2` blob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE dst; @@ -351,7 +351,7 @@ SHOW CREATE TABLE dst; Table Create Table dst CREATE TABLE `dst` ( `c1` int(11) NOT NULL AUTO_INCREMENT, - `c2` mediumblob, + `c2` mediumblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE dst; @@ -369,7 +369,7 @@ SHOW CREATE TABLE dst; Table Create Table dst CREATE TABLE `dst` ( `c1` int(11) NOT NULL AUTO_INCREMENT, - `c2` longblob, + `c2` longblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE dst; @@ -387,7 +387,7 @@ SHOW CREATE TABLE dst; Table Create Table dst CREATE TABLE `dst` ( `c1` int(11) NOT NULL AUTO_INCREMENT, - `c2` tinytext, + `c2` tinytext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE dst; @@ -405,7 +405,7 @@ SHOW CREATE TABLE dst; Table Create Table dst CREATE TABLE `dst` ( `c1` int(11) NOT NULL AUTO_INCREMENT, - `c2` text, + `c2` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE dst; @@ -423,7 +423,7 @@ SHOW CREATE TABLE dst; Table Create Table dst CREATE TABLE `dst` ( `c1` int(11) NOT NULL AUTO_INCREMENT, - `c2` mediumtext, + `c2` mediumtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE dst; @@ -441,7 +441,7 @@ SHOW CREATE TABLE dst; Table Create Table dst CREATE TABLE `dst` ( `c1` int(11) NOT NULL AUTO_INCREMENT, - `c2` longtext, + `c2` longtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE dst; diff --git a/mysql-test/suite/engines/funcs/r/tc_structure_create_select.result b/mysql-test/suite/engines/funcs/r/tc_structure_create_select.result index a38c47fc04a..c6deaaef786 100644 --- a/mysql-test/suite/engines/funcs/r/tc_structure_create_select.result +++ b/mysql-test/suite/engines/funcs/r/tc_structure_create_select.result @@ -587,7 +587,7 @@ SHOW CREATE TABLE dst; Table Create Table dst CREATE TABLE `dst` ( `c1` int(11) NOT NULL AUTO_INCREMENT, - `c2` tinyblob, + `c2` tinyblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE dst; @@ -603,7 +603,7 @@ SHOW CREATE TABLE dst; Table Create Table dst CREATE TABLE `dst` ( `c1` int(11) NOT NULL AUTO_INCREMENT, - `c2` tinyblob, + `c2` tinyblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE dst; @@ -621,7 +621,7 @@ SHOW CREATE TABLE dst; Table Create Table dst CREATE TABLE `dst` ( `c1` int(11) NOT NULL AUTO_INCREMENT, - `c2` blob, + `c2` blob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE dst; @@ -637,7 +637,7 @@ SHOW CREATE TABLE dst; Table Create Table dst CREATE TABLE `dst` ( `c1` int(11) NOT NULL AUTO_INCREMENT, - `c2` blob, + `c2` blob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE dst; @@ -655,7 +655,7 @@ SHOW CREATE TABLE dst; Table Create Table dst CREATE TABLE `dst` ( `c1` int(11) NOT NULL AUTO_INCREMENT, - `c2` mediumblob, + `c2` mediumblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE dst; @@ -671,7 +671,7 @@ SHOW CREATE TABLE dst; Table Create Table dst CREATE TABLE `dst` ( `c1` int(11) NOT NULL AUTO_INCREMENT, - `c2` mediumblob, + `c2` mediumblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE dst; @@ -689,7 +689,7 @@ SHOW CREATE TABLE dst; Table Create Table dst CREATE TABLE `dst` ( `c1` int(11) NOT NULL AUTO_INCREMENT, - `c2` longblob, + `c2` longblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE dst; @@ -705,7 +705,7 @@ SHOW CREATE TABLE dst; Table Create Table dst CREATE TABLE `dst` ( `c1` int(11) NOT NULL AUTO_INCREMENT, - `c2` longblob, + `c2` longblob DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE dst; @@ -723,7 +723,7 @@ SHOW CREATE TABLE dst; Table Create Table dst CREATE TABLE `dst` ( `c1` int(11) NOT NULL AUTO_INCREMENT, - `c2` tinytext, + `c2` tinytext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE dst; @@ -739,7 +739,7 @@ SHOW CREATE TABLE dst; Table Create Table dst CREATE TABLE `dst` ( `c1` int(11) NOT NULL AUTO_INCREMENT, - `c2` tinytext, + `c2` tinytext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE dst; @@ -757,7 +757,7 @@ SHOW CREATE TABLE dst; Table Create Table dst CREATE TABLE `dst` ( `c1` int(11) NOT NULL AUTO_INCREMENT, - `c2` text, + `c2` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE dst; @@ -773,7 +773,7 @@ SHOW CREATE TABLE dst; Table Create Table dst CREATE TABLE `dst` ( `c1` int(11) NOT NULL AUTO_INCREMENT, - `c2` text, + `c2` text DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE dst; @@ -791,7 +791,7 @@ SHOW CREATE TABLE dst; Table Create Table dst CREATE TABLE `dst` ( `c1` int(11) NOT NULL AUTO_INCREMENT, - `c2` mediumtext, + `c2` mediumtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE dst; @@ -807,7 +807,7 @@ SHOW CREATE TABLE dst; Table Create Table dst CREATE TABLE `dst` ( `c1` int(11) NOT NULL AUTO_INCREMENT, - `c2` mediumtext, + `c2` mediumtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE dst; @@ -825,7 +825,7 @@ SHOW CREATE TABLE dst; Table Create Table dst CREATE TABLE `dst` ( `c1` int(11) NOT NULL AUTO_INCREMENT, - `c2` longtext, + `c2` longtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE dst; @@ -841,7 +841,7 @@ SHOW CREATE TABLE dst; Table Create Table dst CREATE TABLE `dst` ( `c1` int(11) NOT NULL AUTO_INCREMENT, - `c2` longtext, + `c2` longtext DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE dst; diff --git a/mysql-test/suite/engines/funcs/r/tc_temporary_column.result b/mysql-test/suite/engines/funcs/r/tc_temporary_column.result index fc6789b92b8..84eae4fc468 100644 --- a/mysql-test/suite/engines/funcs/r/tc_temporary_column.result +++ b/mysql-test/suite/engines/funcs/r/tc_temporary_column.result @@ -225,7 +225,7 @@ Tables_in_test SHOW CREATE TABLE t1; Table Create Table t1 CREATE TEMPORARY TABLE `t1` ( - `c1` tinyblob + `c1` tinyblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -236,7 +236,7 @@ Tables_in_test SHOW CREATE TABLE t1; Table Create Table t1 CREATE TEMPORARY TABLE `t1` ( - `c1` blob + `c1` blob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -247,7 +247,7 @@ Tables_in_test SHOW CREATE TABLE t1; Table Create Table t1 CREATE TEMPORARY TABLE `t1` ( - `c1` mediumblob + `c1` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -258,7 +258,7 @@ Tables_in_test SHOW CREATE TABLE t1; Table Create Table t1 CREATE TEMPORARY TABLE `t1` ( - `c1` longblob + `c1` longblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -269,7 +269,7 @@ Tables_in_test SHOW CREATE TABLE t1; Table Create Table t1 CREATE TEMPORARY TABLE `t1` ( - `c1` tinytext + `c1` tinytext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -280,7 +280,7 @@ Tables_in_test SHOW CREATE TABLE t1; Table Create Table t1 CREATE TEMPORARY TABLE `t1` ( - `c1` text + `c1` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -291,7 +291,7 @@ Tables_in_test SHOW CREATE TABLE t1; Table Create Table t1 CREATE TEMPORARY TABLE `t1` ( - `c1` mediumtext + `c1` mediumtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; @@ -302,7 +302,7 @@ Tables_in_test SHOW CREATE TABLE t1; Table Create Table t1 CREATE TEMPORARY TABLE `t1` ( - `c1` longtext + `c1` longtext DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; SHOW TABLES; diff --git a/mysql-test/suite/engines/funcs/t/rpl_user_variables.test b/mysql-test/suite/engines/funcs/t/rpl_user_variables.test index 08717fce114..530cda3d87a 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_user_variables.test +++ b/mysql-test/suite/engines/funcs/t/rpl_user_variables.test @@ -35,7 +35,7 @@ insert into t1 values (@i1), (@i2), (@i3), (@i4); insert into t1 values (@r1), (@r2); insert into t1 values (@s1), (@s2), (@s3), (@s4), (@s5); insert into t1 values (@n1); -insert into t1 values (@n2); # not explicitely set before +insert into t1 values (@n2); # not explicitly set before insert into t1 values (@a:=0), (@a:=@a+1), (@a:=@a+1); insert into t1 values (@a+(@b:=@a+1)); set @q:='abc'; diff --git a/mysql-test/suite/engines/iuds/r/insert_decimal.result b/mysql-test/suite/engines/iuds/r/insert_decimal.result index 50fde80d81d..eab8592c4ee 100644 --- a/mysql-test/suite/engines/iuds/r/insert_decimal.result +++ b/mysql-test/suite/engines/iuds/r/insert_decimal.result @@ -48,7 +48,6 @@ Warning 1264 Out of range value for column 'c2' at row 1 Note 1265 Data truncated for column 'c3' at row 1 insert into t2 values ("0.0","0.0","0.0",7),("-0.0","-0.0","-0.0",8),("+0.0","+0.0","+0.0",9),("01.0","01.0","01.0",10),("+01.0","+01.0","+01.0",11),("-01.0","-01.0","-01.0",12); Warnings: -Warning 1264 Out of range value for column 'c2' at row 2 Warning 1264 Out of range value for column 'c2' at row 6 insert into t2 values ("-.1","-.1","-.1",13),("+.1","+.1","+.1",14),(".1",".1",".1",15); Warnings: diff --git a/mysql-test/suite/engines/rr_trx/r/init_innodb.result b/mysql-test/suite/engines/rr_trx/r/init_innodb.result index b4d11879521..516147976ce 100644 --- a/mysql-test/suite/engines/rr_trx/r/init_innodb.result +++ b/mysql-test/suite/engines/rr_trx/r/init_innodb.result @@ -42,12 +42,12 @@ t1 CREATE TABLE `t1` ( `int2` int(11) DEFAULT NULL, `int2_key` int(11) DEFAULT NULL, `int2_unique` int(11) DEFAULT NULL, - `for_update` tinyint(1) DEFAULT '0', + `for_update` tinyint(1) DEFAULT 0, `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `connection_id` int(11) DEFAULT NULL, - `thread_id` int(11) DEFAULT '0', - `is_uncommitted` tinyint(1) DEFAULT '0', - `is_consistent` tinyint(1) DEFAULT '0', + `thread_id` int(11) DEFAULT 0, + `is_uncommitted` tinyint(1) DEFAULT 0, + `is_consistent` tinyint(1) DEFAULT 0, PRIMARY KEY (`pk`), UNIQUE KEY `int1_unique` (`int1_unique`), UNIQUE KEY `int2_unique` (`int2_unique`), diff --git a/mysql-test/suite/federated/assisted_discovery.result b/mysql-test/suite/federated/assisted_discovery.result index 76ac6e422cd..f79e47da8b4 100644 --- a/mysql-test/suite/federated/assisted_discovery.result +++ b/mysql-test/suite/federated/assisted_discovery.result @@ -19,8 +19,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `id` int(20) NOT NULL, - `group` int(11) NOT NULL DEFAULT '1', - `a\\b` int(11) NOT NULL DEFAULT '2', + `group` int(11) NOT NULL DEFAULT 1, + `a\\b` int(11) NOT NULL DEFAULT 2, `a\\` int(10) unsigned DEFAULT NULL, `name` varchar(32) DEFAULT 'name', PRIMARY KEY (`id`) diff --git a/mysql-test/suite/federated/federatedx.result b/mysql-test/suite/federated/federatedx.result index 06992038668..84dcb0d0a8c 100644 --- a/mysql-test/suite/federated/federatedx.result +++ b/mysql-test/suite/federated/federatedx.result @@ -1019,8 +1019,6 @@ CREATE TABLE federated.t1 ( `blurb` text default '', PRIMARY KEY (blurb_id)) DEFAULT CHARSET=latin1; -Warnings: -Warning 1101 BLOB/TEXT column 'blurb' can't have a default value connection master; DROP TABLE IF EXISTS federated.t1; CREATE TABLE federated.t1 ( @@ -1030,8 +1028,6 @@ PRIMARY KEY (blurb_id)) ENGINE="FEDERATED" DEFAULT CHARSET=latin1 CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1'; -Warnings: -Warning 1101 BLOB/TEXT column 'blurb' can't have a default value INSERT INTO federated.t1 VALUES (1, " MySQL supports a number of column types in several categories: numeric types, date and time types, and string (character) types. This chapter first gives an overview of these column types, and then provides a more detailed description of the properties of the types in each category, and a summary of the column type storage requirements. The overview is intentionally brief. The more detailed descriptions should be consulted for additional information about particular column types, such as the allowable formats in which you can specify values."); INSERT INTO federated.t1 VALUES (2, "All arithmetic is done using signed BIGINT or DOUBLE values, so you should not use unsigned big integers larger than 9223372036854775807 (63 bits) except with bit functions! If you do that, some of the last digits in the result may be wrong because of rounding errors when converting a BIGINT value to a DOUBLE."); INSERT INTO federated.t1 VALUES (3, " A floating-point number. p represents the precision. It can be from 0 to 24 for a single-precision floating-point number and from 25 to 53 for a double-precision floating-point number. These types are like the FLOAT and DOUBLE types described immediately following. FLOAT(p) has the same range as the corresponding FLOAT and DOUBLE types, but the display size and number of decimals are undefined. "); diff --git a/mysql-test/suite/funcs_1/r/innodb_func_view.result b/mysql-test/suite/funcs_1/r/innodb_func_view.result index 357c8200f34..1264342fa8a 100644 --- a/mysql-test/suite/funcs_1/r/innodb_func_view.result +++ b/mysql-test/suite/funcs_1/r/innodb_func_view.result @@ -916,8 +916,8 @@ AaBbCcDdEeFfGgHhIiJjÄäÜüÖö 1.7976931348623e308 3 0 4 -1 5 Warnings: -Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e308' -Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e308' +Warning 1916 Got overflow when converting '-1.7976931348623e308' to INT. Value truncated. +Warning 1916 Got overflow when converting '1.7976931348623e308' to INT. Value truncated. SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select left('AaBbCcDdEeFfGgHhIiJjÄäÜüÖö',`t1_values`.`my_double`) AS `LEFT('AaBbCcDdEeFfGgHhIiJjÄäÜüÖö', my_double)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci @@ -931,8 +931,8 @@ AaBbCcDdEeFfGgHhIiJjÄäÜüÖö 1.7976931348623e308 3 0 4 -1 5 Warnings: -Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e308' -Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e308' +Warning 1916 Got overflow when converting '-1.7976931348623e308' to INT. Value truncated. +Warning 1916 Got overflow when converting '1.7976931348623e308' to INT. Value truncated. DROP VIEW v1; @@ -2586,9 +2586,9 @@ NULL NULL 1 0 0 4 18446744073709551615 -1 5 Warnings: -Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e308' +Warning 1916 Got overflow when converting '-1.7976931348623e308' to INT. Value truncated. Note 1105 Cast to unsigned converted negative integer to it's positive complement -Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e308' +Warning 1916 Got overflow when converting '1.7976931348623e308' to INT. Value truncated. Note 1105 Cast to unsigned converted negative integer to it's positive complement SHOW CREATE VIEW v1; View Create View character_set_client collation_connection @@ -2603,9 +2603,9 @@ NULL NULL 1 0 0 4 18446744073709551615 -1 5 Warnings: -Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e308' +Warning 1916 Got overflow when converting '-1.7976931348623e308' to INT. Value truncated. Note 1105 Cast to unsigned converted negative integer to it's positive complement -Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e308' +Warning 1916 Got overflow when converting '1.7976931348623e308' to INT. Value truncated. Note 1105 Cast to unsigned converted negative integer to it's positive complement DROP VIEW v1; @@ -2964,8 +2964,8 @@ NULL NULL 1 0 0 4 -1 -1 5 Warnings: -Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e308' -Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e308' +Warning 1916 Got overflow when converting '-1.7976931348623e308' to INT. Value truncated. +Warning 1916 Got overflow when converting '1.7976931348623e308' to INT. Value truncated. SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as signed) AS `CAST(my_double AS SIGNED INTEGER)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci @@ -2979,8 +2979,8 @@ NULL NULL 1 0 0 4 -1 -1 5 Warnings: -Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e308' -Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e308' +Warning 1916 Got overflow when converting '-1.7976931348623e308' to INT. Value truncated. +Warning 1916 Got overflow when converting '1.7976931348623e308' to INT. Value truncated. DROP VIEW v1; diff --git a/mysql-test/suite/funcs_1/r/innodb_views.result b/mysql-test/suite/funcs_1/r/innodb_views.result index 45de9534df2..93fe4dc6b5f 100644 --- a/mysql-test/suite/funcs_1/r/innodb_views.result +++ b/mysql-test/suite/funcs_1/r/innodb_views.result @@ -3503,7 +3503,7 @@ Select @x; 0 CREATE or REPLACE VIEW v1 AS Select 1 FROM (SELECT 1 FROM t1) my_table; -ERROR HY000: View's SELECT contains a subquery in the FROM clause +DROP VIEW v1; CREATE VIEW v1 AS SELECT f1 FROM t1; CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET @a:=1 ; SET @a:=0 ; @@ -7535,7 +7535,7 @@ Testcase 3.3.1.39 Drop view if exists test.v1 ; CREATE VIEW test.v1 AS Select f59 from (Select * FROM tb2 limit 20) tx ; -ERROR HY000: View's SELECT contains a subquery in the FROM clause +DROP VIEW test.v1; SELECT * FROM test.v1 order by f59 ; ERROR 42S02: Table 'test.v1' doesn't exist Drop view if exists test.v1 ; @@ -8001,7 +8001,7 @@ Drop view if exists test.v1 ; CREATE VIEW test.v1 AS SELECT f59,f60 FROM test.tb2 where f59 = 195 WITH CHECK OPTION ; UPDATE test.v1 SET f59 = 198 where f59=195 ; -ERROR HY000: CHECK OPTION failed 'test.v1' +ERROR 44000: CHECK OPTION failed `test`.`v1` SELECT * FROM test.v1 order by f59 ; f59 f60 195 87 @@ -8015,7 +8015,7 @@ CREATE VIEW test.v1 AS SELECT f59,f60 FROM test.tb2 where F59 = 0987 WITH LOCAL CHECK OPTION ; CREATE VIEW test.v2 as SELECT * FROM test.v1 ; UPDATE test.v1 SET F59 = 919 where f59 = 0987 ; -ERROR HY000: CHECK OPTION failed 'test.v1' +ERROR 44000: CHECK OPTION failed `test`.`v1` SELECT * FROM test.v1 order by f59 ; f59 f60 987 41 @@ -8050,9 +8050,9 @@ f1 f2 A 2 B 2 UPDATE v1 SET f2 = 4; -ERROR HY000: CHECK OPTION failed 'test.v1' +ERROR 44000: CHECK OPTION failed `test`.`v1` INSERT INTO v1 VALUES('B',3); -ERROR HY000: CHECK OPTION failed 'test.v1' +ERROR 44000: CHECK OPTION failed `test`.`v1` SELECT * FROM v1 order by f1, f2; f1 f2 A 2 @@ -8166,7 +8166,7 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -8200,7 +8200,7 @@ affected rows: 1 INSERT INTO v3 VALUES(0, 'zero'); affected rows: 1 INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -8278,21 +8278,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -8306,11 +8306,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -8386,21 +8386,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -8414,11 +8414,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -8611,7 +8611,7 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -8645,7 +8645,7 @@ affected rows: 1 INSERT INTO v3 VALUES(0, 'zero'); affected rows: 1 INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -8723,21 +8723,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -8751,11 +8751,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -8831,21 +8831,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -8859,11 +8859,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -9056,7 +9056,7 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -9090,7 +9090,7 @@ affected rows: 1 INSERT INTO v3 VALUES(0, 'zero'); affected rows: 1 INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -9168,21 +9168,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -9196,11 +9196,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -9276,21 +9276,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -9304,11 +9304,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -9501,7 +9501,7 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -9535,7 +9535,7 @@ affected rows: 1 INSERT INTO v3 VALUES(0, 'zero'); affected rows: 1 INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -9613,21 +9613,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -9641,11 +9641,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -9721,21 +9721,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -9749,11 +9749,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -9949,7 +9949,7 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -9983,7 +9983,7 @@ affected rows: 1 INSERT INTO v3 VALUES(0, 'zero'); affected rows: 1 INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -10061,21 +10061,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -10089,11 +10089,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -10169,21 +10169,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -10197,11 +10197,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -10394,7 +10394,7 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -10428,7 +10428,7 @@ affected rows: 1 INSERT INTO v3 VALUES(0, 'zero'); affected rows: 1 INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -10506,21 +10506,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -10534,11 +10534,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -10614,21 +10614,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -10642,11 +10642,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -10839,7 +10839,7 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -10873,7 +10873,7 @@ affected rows: 1 INSERT INTO v3 VALUES(0, 'zero'); affected rows: 1 INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -10951,21 +10951,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -10979,11 +10979,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -11059,21 +11059,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -11087,11 +11087,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -11284,7 +11284,7 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -11318,7 +11318,7 @@ affected rows: 1 INSERT INTO v3 VALUES(0, 'zero'); affected rows: 1 INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -11396,21 +11396,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -11424,11 +11424,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -11504,21 +11504,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -11532,11 +11532,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -11732,7 +11732,7 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -11766,7 +11766,7 @@ affected rows: 1 INSERT INTO v3 VALUES(0, 'zero'); affected rows: 1 INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -11844,21 +11844,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -11872,11 +11872,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -11952,21 +11952,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -11980,11 +11980,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -12177,7 +12177,7 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -12211,7 +12211,7 @@ affected rows: 1 INSERT INTO v3 VALUES(0, 'zero'); affected rows: 1 INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -12289,21 +12289,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -12317,11 +12317,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -12397,21 +12397,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -12425,11 +12425,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -12622,7 +12622,7 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -12656,7 +12656,7 @@ affected rows: 1 INSERT INTO v3 VALUES(0, 'zero'); affected rows: 1 INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -12734,21 +12734,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -12762,11 +12762,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -12842,21 +12842,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -12870,11 +12870,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -13067,7 +13067,7 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -13101,7 +13101,7 @@ affected rows: 1 INSERT INTO v3 VALUES(0, 'zero'); affected rows: 1 INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -13179,21 +13179,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -13207,11 +13207,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -13287,21 +13287,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -13315,11 +13315,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -13515,7 +13515,7 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -13549,7 +13549,7 @@ affected rows: 1 INSERT INTO v3 VALUES(0, 'zero'); affected rows: 1 INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -13627,21 +13627,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -13655,11 +13655,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -13735,21 +13735,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -13763,11 +13763,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -13960,7 +13960,7 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -13994,7 +13994,7 @@ affected rows: 1 INSERT INTO v3 VALUES(0, 'zero'); affected rows: 1 INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -14072,21 +14072,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -14100,11 +14100,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -14180,21 +14180,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -14208,11 +14208,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -14405,7 +14405,7 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -14439,7 +14439,7 @@ affected rows: 1 INSERT INTO v3 VALUES(0, 'zero'); affected rows: 1 INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -14517,21 +14517,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -14545,11 +14545,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -14625,21 +14625,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -14653,11 +14653,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -14850,7 +14850,7 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -14884,7 +14884,7 @@ affected rows: 1 INSERT INTO v3 VALUES(0, 'zero'); affected rows: 1 INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -14962,21 +14962,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -14990,11 +14990,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -15070,21 +15070,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -15098,11 +15098,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; diff --git a/mysql-test/suite/funcs_1/r/is_character_sets.result b/mysql-test/suite/funcs_1/r/is_character_sets.result index 2aaa1985020..caff08ae1e4 100644 --- a/mysql-test/suite/funcs_1/r/is_character_sets.result +++ b/mysql-test/suite/funcs_1/r/is_character_sets.result @@ -38,7 +38,7 @@ CHARACTER_SETS CREATE TEMPORARY TABLE `CHARACTER_SETS` ( `CHARACTER_SET_NAME` varchar(32) NOT NULL DEFAULT '', `DEFAULT_COLLATE_NAME` varchar(32) NOT NULL DEFAULT '', `DESCRIPTION` varchar(60) NOT NULL DEFAULT '', - `MAXLEN` bigint(3) NOT NULL DEFAULT '0' + `MAXLEN` bigint(3) NOT NULL DEFAULT 0 ) ENGINE=MEMORY DEFAULT CHARSET=utf8 SHOW COLUMNS FROM information_schema.CHARACTER_SETS; Field Type Null Key Default Extra diff --git a/mysql-test/suite/funcs_1/r/is_collations.result b/mysql-test/suite/funcs_1/r/is_collations.result index 234aeff8ff2..c017bbd4eaf 100644 --- a/mysql-test/suite/funcs_1/r/is_collations.result +++ b/mysql-test/suite/funcs_1/r/is_collations.result @@ -39,10 +39,10 @@ Table Create Table COLLATIONS CREATE TEMPORARY TABLE `COLLATIONS` ( `COLLATION_NAME` varchar(32) NOT NULL DEFAULT '', `CHARACTER_SET_NAME` varchar(32) NOT NULL DEFAULT '', - `ID` bigint(11) NOT NULL DEFAULT '0', + `ID` bigint(11) NOT NULL DEFAULT 0, `IS_DEFAULT` varchar(3) NOT NULL DEFAULT '', `IS_COMPILED` varchar(3) NOT NULL DEFAULT '', - `SORTLEN` bigint(3) NOT NULL DEFAULT '0' + `SORTLEN` bigint(3) NOT NULL DEFAULT 0 ) ENGINE=MEMORY DEFAULT CHARSET=utf8 SHOW COLUMNS FROM information_schema.COLLATIONS; Field Type Null Key Default Extra diff --git a/mysql-test/suite/funcs_1/r/is_columns.result b/mysql-test/suite/funcs_1/r/is_columns.result index ff833b092d1..4b028e1da3d 100644 --- a/mysql-test/suite/funcs_1/r/is_columns.result +++ b/mysql-test/suite/funcs_1/r/is_columns.result @@ -43,7 +43,7 @@ NUMERIC_SCALE bigint(21) unsigned YES NULL DATETIME_PRECISION bigint(21) unsigned YES NULL CHARACTER_SET_NAME varchar(32) YES NULL COLLATION_NAME varchar(32) YES NULL -COLUMN_TYPE longtext NO NULL +COLUMN_TYPE longtext NO COLUMN_KEY varchar(3) NO EXTRA varchar(27) NO PRIVILEGES varchar(80) NO @@ -55,8 +55,8 @@ COLUMNS CREATE TEMPORARY TABLE `COLUMNS` ( `TABLE_SCHEMA` varchar(64) NOT NULL DEFAULT '', `TABLE_NAME` varchar(64) NOT NULL DEFAULT '', `COLUMN_NAME` varchar(64) NOT NULL DEFAULT '', - `ORDINAL_POSITION` bigint(21) unsigned NOT NULL DEFAULT '0', - `COLUMN_DEFAULT` longtext, + `ORDINAL_POSITION` bigint(21) unsigned NOT NULL DEFAULT 0, + `COLUMN_DEFAULT` longtext DEFAULT NULL, `IS_NULLABLE` varchar(3) NOT NULL DEFAULT '', `DATA_TYPE` varchar(64) NOT NULL DEFAULT '', `CHARACTER_MAXIMUM_LENGTH` bigint(21) unsigned DEFAULT NULL, @@ -66,7 +66,7 @@ COLUMNS CREATE TEMPORARY TABLE `COLUMNS` ( `DATETIME_PRECISION` bigint(21) unsigned DEFAULT NULL, `CHARACTER_SET_NAME` varchar(32) DEFAULT NULL, `COLLATION_NAME` varchar(32) DEFAULT NULL, - `COLUMN_TYPE` longtext NOT NULL, + `COLUMN_TYPE` longtext NOT NULL DEFAULT '', `COLUMN_KEY` varchar(3) NOT NULL DEFAULT '', `EXTRA` varchar(27) NOT NULL DEFAULT '', `PRIVILEGES` varchar(80) NOT NULL DEFAULT '', @@ -89,7 +89,7 @@ NUMERIC_SCALE bigint(21) unsigned YES NULL DATETIME_PRECISION bigint(21) unsigned YES NULL CHARACTER_SET_NAME varchar(32) YES NULL COLLATION_NAME varchar(32) YES NULL -COLUMN_TYPE longtext NO NULL +COLUMN_TYPE longtext NO COLUMN_KEY varchar(3) NO EXTRA varchar(27) NO PRIVILEGES varchar(80) NO diff --git a/mysql-test/suite/funcs_1/r/is_columns_is.result b/mysql-test/suite/funcs_1/r/is_columns_is.result index e992b79321e..d21cefa7c57 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_is.result +++ b/mysql-test/suite/funcs_1/r/is_columns_is.result @@ -65,7 +65,7 @@ def information_schema COLUMNS COLUMN_COMMENT 20 NO varchar 1024 3072 NULL NULL def information_schema COLUMNS COLUMN_DEFAULT 6 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext select def information_schema COLUMNS COLUMN_KEY 17 NO varchar 3 9 NULL NULL NULL utf8 utf8_general_ci varchar(3) select def information_schema COLUMNS COLUMN_NAME 4 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select -def information_schema COLUMNS COLUMN_TYPE 16 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext select +def information_schema COLUMNS COLUMN_TYPE 16 NO longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext select def information_schema COLUMNS DATA_TYPE 8 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select def information_schema COLUMNS DATETIME_PRECISION 13 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select def information_schema COLUMNS EXTRA 18 NO varchar 27 81 NULL NULL NULL utf8 utf8_general_ci varchar(27) select @@ -100,7 +100,7 @@ def information_schema EVENTS ENDS 14 NULL YES datetime NULL NULL NULL NULL 0 NU def information_schema EVENTS EVENT_BODY 6 NO varchar 8 24 NULL NULL NULL utf8 utf8_general_ci varchar(8) select def information_schema EVENTS EVENT_CATALOG 1 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select def information_schema EVENTS EVENT_COMMENT 20 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select -def information_schema EVENTS EVENT_DEFINITION 7 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext select +def information_schema EVENTS EVENT_DEFINITION 7 NO longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext select def information_schema EVENTS EVENT_NAME 3 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select def information_schema EVENTS EVENT_SCHEMA 2 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select def information_schema EVENTS EVENT_TYPE 8 NO varchar 9 27 NULL NULL NULL utf8 utf8_general_ci varchar(9) select @@ -204,7 +204,7 @@ def information_schema PARAMETERS CHARACTER_SET_NAME 13 NULL YES varchar 64 192 def information_schema PARAMETERS COLLATION_NAME 14 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select def information_schema PARAMETERS DATA_TYPE 7 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select def information_schema PARAMETERS DATETIME_PRECISION 12 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select -def information_schema PARAMETERS DTD_IDENTIFIER 15 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext select +def information_schema PARAMETERS DTD_IDENTIFIER 15 NO longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext select def information_schema PARAMETERS NUMERIC_PRECISION 10 NULL YES int NULL NULL 10 0 NULL NULL NULL int(21) select def information_schema PARAMETERS NUMERIC_SCALE 11 NULL YES int NULL NULL 10 0 NULL NULL NULL int(21) select def information_schema PARAMETERS ORDINAL_POSITION 4 0 NO int NULL NULL 10 0 NULL NULL NULL int(21) select @@ -260,7 +260,7 @@ def information_schema PROCESSLIST ID 1 0 NO bigint NULL NULL 19 0 NULL NULL NUL def information_schema PROCESSLIST INFO 8 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext select def information_schema PROCESSLIST INFO_BINARY 16 NULL YES blob 65535 65535 NULL NULL NULL NULL NULL blob select def information_schema PROCESSLIST MAX_STAGE 11 0 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(2) select -def information_schema PROCESSLIST MEMORY_USED 13 0 NO int NULL NULL 10 0 NULL NULL NULL int(7) select +def information_schema PROCESSLIST MEMORY_USED 13 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(7) select def information_schema PROCESSLIST PROGRESS 12 0.000 NO decimal NULL NULL 7 3 NULL NULL NULL decimal(7,3) select def information_schema PROCESSLIST QUERY_ID 15 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(4) select def information_schema PROCESSLIST STAGE 10 0 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(2) select @@ -301,7 +301,7 @@ def information_schema ROUTINES NUMERIC_SCALE 10 NULL YES int NULL NULL 10 0 NUL def information_schema ROUTINES PARAMETER_STYLE 19 NO varchar 8 24 NULL NULL NULL utf8 utf8_general_ci varchar(8) select def information_schema ROUTINES ROUTINE_BODY 15 NO varchar 8 24 NULL NULL NULL utf8 utf8_general_ci varchar(8) select def information_schema ROUTINES ROUTINE_CATALOG 2 NO varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512) select -def information_schema ROUTINES ROUTINE_COMMENT 27 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext select +def information_schema ROUTINES ROUTINE_COMMENT 27 NO longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext select def information_schema ROUTINES ROUTINE_DEFINITION 16 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext select def information_schema ROUTINES ROUTINE_NAME 4 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select def information_schema ROUTINES ROUTINE_SCHEMA 3 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select @@ -413,7 +413,7 @@ def information_schema TRIGGERS ACTION_REFERENCE_NEW_ROW 16 NO varchar 3 9 NULL def information_schema TRIGGERS ACTION_REFERENCE_NEW_TABLE 14 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select def information_schema TRIGGERS ACTION_REFERENCE_OLD_ROW 15 NO varchar 3 9 NULL NULL NULL utf8 utf8_general_ci varchar(3) select def information_schema TRIGGERS ACTION_REFERENCE_OLD_TABLE 13 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select -def information_schema TRIGGERS ACTION_STATEMENT 10 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext select +def information_schema TRIGGERS ACTION_STATEMENT 10 NO longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext select def information_schema TRIGGERS ACTION_TIMING 12 NO varchar 6 18 NULL NULL NULL utf8 utf8_general_ci varchar(6) select def information_schema TRIGGERS CHARACTER_SET_CLIENT 20 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) select def information_schema TRIGGERS COLLATION_CONNECTION 21 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) select @@ -467,7 +467,7 @@ def information_schema VIEWS SECURITY_TYPE 8 NO varchar 7 21 NULL NULL NULL utf def information_schema VIEWS TABLE_CATALOG 1 NO varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512) select def information_schema VIEWS TABLE_NAME 3 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select def information_schema VIEWS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select -def information_schema VIEWS VIEW_DEFINITION 4 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext select +def information_schema VIEWS VIEW_DEFINITION 4 NO longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext select ########################################################################## # Show the quotient of CHARACTER_OCTET_LENGTH and CHARACTER_MAXIMUM_LENGTH ########################################################################## @@ -792,7 +792,7 @@ NULL information_schema PROCESSLIST TIME_MS decimal NULL NULL NULL NULL decimal( NULL information_schema PROCESSLIST STAGE tinyint NULL NULL NULL NULL tinyint(2) NULL information_schema PROCESSLIST MAX_STAGE tinyint NULL NULL NULL NULL tinyint(2) NULL information_schema PROCESSLIST PROGRESS decimal NULL NULL NULL NULL decimal(7,3) -NULL information_schema PROCESSLIST MEMORY_USED int NULL NULL NULL NULL int(7) +NULL information_schema PROCESSLIST MEMORY_USED bigint NULL NULL NULL NULL bigint(7) NULL information_schema PROCESSLIST EXAMINED_ROWS int NULL NULL NULL NULL int(7) NULL information_schema PROCESSLIST QUERY_ID bigint NULL NULL NULL NULL bigint(4) 1.0000 information_schema PROCESSLIST INFO_BINARY blob 65535 65535 NULL NULL blob diff --git a/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result b/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result index 87eecaf41e9..15c94e52478 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result +++ b/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result @@ -65,7 +65,7 @@ def information_schema COLUMNS COLUMN_COMMENT 20 NO varchar 1024 3072 NULL NULL def information_schema COLUMNS COLUMN_DEFAULT 6 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext def information_schema COLUMNS COLUMN_KEY 17 NO varchar 3 9 NULL NULL NULL utf8 utf8_general_ci varchar(3) def information_schema COLUMNS COLUMN_NAME 4 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) -def information_schema COLUMNS COLUMN_TYPE 16 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext +def information_schema COLUMNS COLUMN_TYPE 16 NO longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext def information_schema COLUMNS DATA_TYPE 8 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) def information_schema COLUMNS DATETIME_PRECISION 13 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned def information_schema COLUMNS EXTRA 18 NO varchar 27 81 NULL NULL NULL utf8 utf8_general_ci varchar(27) @@ -100,7 +100,7 @@ def information_schema EVENTS ENDS 14 NULL YES datetime NULL NULL NULL NULL 0 NU def information_schema EVENTS EVENT_BODY 6 NO varchar 8 24 NULL NULL NULL utf8 utf8_general_ci varchar(8) def information_schema EVENTS EVENT_CATALOG 1 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) def information_schema EVENTS EVENT_COMMENT 20 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) -def information_schema EVENTS EVENT_DEFINITION 7 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext +def information_schema EVENTS EVENT_DEFINITION 7 NO longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext def information_schema EVENTS EVENT_NAME 3 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) def information_schema EVENTS EVENT_SCHEMA 2 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) def information_schema EVENTS EVENT_TYPE 8 NO varchar 9 27 NULL NULL NULL utf8 utf8_general_ci varchar(9) @@ -204,7 +204,7 @@ def information_schema PARAMETERS CHARACTER_SET_NAME 13 NULL YES varchar 64 192 def information_schema PARAMETERS COLLATION_NAME 14 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) def information_schema PARAMETERS DATA_TYPE 7 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) def information_schema PARAMETERS DATETIME_PRECISION 12 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned -def information_schema PARAMETERS DTD_IDENTIFIER 15 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext +def information_schema PARAMETERS DTD_IDENTIFIER 15 NO longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext def information_schema PARAMETERS NUMERIC_PRECISION 10 NULL YES int NULL NULL 10 0 NULL NULL NULL int(21) def information_schema PARAMETERS NUMERIC_SCALE 11 NULL YES int NULL NULL 10 0 NULL NULL NULL int(21) def information_schema PARAMETERS ORDINAL_POSITION 4 0 NO int NULL NULL 10 0 NULL NULL NULL int(21) @@ -260,7 +260,7 @@ def information_schema PROCESSLIST ID 1 0 NO bigint NULL NULL 19 0 NULL NULL NUL def information_schema PROCESSLIST INFO 8 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext def information_schema PROCESSLIST INFO_BINARY 16 NULL YES blob 65535 65535 NULL NULL NULL NULL NULL blob def information_schema PROCESSLIST MAX_STAGE 11 0 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(2) -def information_schema PROCESSLIST MEMORY_USED 13 0 NO int NULL NULL 10 0 NULL NULL NULL int(7) +def information_schema PROCESSLIST MEMORY_USED 13 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(7) def information_schema PROCESSLIST PROGRESS 12 0.000 NO decimal NULL NULL 7 3 NULL NULL NULL decimal(7,3) def information_schema PROCESSLIST QUERY_ID 15 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(4) def information_schema PROCESSLIST STAGE 10 0 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(2) @@ -301,7 +301,7 @@ def information_schema ROUTINES NUMERIC_SCALE 10 NULL YES int NULL NULL 10 0 NUL def information_schema ROUTINES PARAMETER_STYLE 19 NO varchar 8 24 NULL NULL NULL utf8 utf8_general_ci varchar(8) def information_schema ROUTINES ROUTINE_BODY 15 NO varchar 8 24 NULL NULL NULL utf8 utf8_general_ci varchar(8) def information_schema ROUTINES ROUTINE_CATALOG 2 NO varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512) -def information_schema ROUTINES ROUTINE_COMMENT 27 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext +def information_schema ROUTINES ROUTINE_COMMENT 27 NO longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext def information_schema ROUTINES ROUTINE_DEFINITION 16 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext def information_schema ROUTINES ROUTINE_NAME 4 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) def information_schema ROUTINES ROUTINE_SCHEMA 3 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) @@ -413,7 +413,7 @@ def information_schema TRIGGERS ACTION_REFERENCE_NEW_ROW 16 NO varchar 3 9 NULL def information_schema TRIGGERS ACTION_REFERENCE_NEW_TABLE 14 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) def information_schema TRIGGERS ACTION_REFERENCE_OLD_ROW 15 NO varchar 3 9 NULL NULL NULL utf8 utf8_general_ci varchar(3) def information_schema TRIGGERS ACTION_REFERENCE_OLD_TABLE 13 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) -def information_schema TRIGGERS ACTION_STATEMENT 10 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext +def information_schema TRIGGERS ACTION_STATEMENT 10 NO longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext def information_schema TRIGGERS ACTION_TIMING 12 NO varchar 6 18 NULL NULL NULL utf8 utf8_general_ci varchar(6) def information_schema TRIGGERS CHARACTER_SET_CLIENT 20 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) def information_schema TRIGGERS COLLATION_CONNECTION 21 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) @@ -467,7 +467,7 @@ def information_schema VIEWS SECURITY_TYPE 8 NO varchar 7 21 NULL NULL NULL utf def information_schema VIEWS TABLE_CATALOG 1 NO varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512) def information_schema VIEWS TABLE_NAME 3 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) def information_schema VIEWS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) -def information_schema VIEWS VIEW_DEFINITION 4 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext +def information_schema VIEWS VIEW_DEFINITION 4 NO longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext ########################################################################## # Show the quotient of CHARACTER_OCTET_LENGTH and CHARACTER_MAXIMUM_LENGTH ########################################################################## @@ -792,7 +792,7 @@ NULL information_schema PROCESSLIST TIME_MS decimal NULL NULL NULL NULL decimal( NULL information_schema PROCESSLIST STAGE tinyint NULL NULL NULL NULL tinyint(2) NULL information_schema PROCESSLIST MAX_STAGE tinyint NULL NULL NULL NULL tinyint(2) NULL information_schema PROCESSLIST PROGRESS decimal NULL NULL NULL NULL decimal(7,3) -NULL information_schema PROCESSLIST MEMORY_USED int NULL NULL NULL NULL int(7) +NULL information_schema PROCESSLIST MEMORY_USED bigint NULL NULL NULL NULL bigint(7) NULL information_schema PROCESSLIST EXAMINED_ROWS int NULL NULL NULL NULL int(7) NULL information_schema PROCESSLIST QUERY_ID bigint NULL NULL NULL NULL bigint(4) 1.0000 information_schema PROCESSLIST INFO_BINARY blob 65535 65535 NULL NULL blob diff --git a/mysql-test/suite/funcs_1/r/is_events.result b/mysql-test/suite/funcs_1/r/is_events.result index 79f60821347..3db6cc5e61d 100644 --- a/mysql-test/suite/funcs_1/r/is_events.result +++ b/mysql-test/suite/funcs_1/r/is_events.result @@ -34,7 +34,7 @@ EVENT_NAME varchar(64) NO DEFINER varchar(189) NO TIME_ZONE varchar(64) NO EVENT_BODY varchar(8) NO -EVENT_DEFINITION longtext NO NULL +EVENT_DEFINITION longtext NO EVENT_TYPE varchar(9) NO EXECUTE_AT datetime YES NULL INTERVAL_VALUE varchar(256) YES NULL @@ -61,7 +61,7 @@ EVENTS CREATE TEMPORARY TABLE `EVENTS` ( `DEFINER` varchar(189) NOT NULL DEFAULT '', `TIME_ZONE` varchar(64) NOT NULL DEFAULT '', `EVENT_BODY` varchar(8) NOT NULL DEFAULT '', - `EVENT_DEFINITION` longtext NOT NULL, + `EVENT_DEFINITION` longtext NOT NULL DEFAULT '', `EVENT_TYPE` varchar(9) NOT NULL DEFAULT '', `EXECUTE_AT` datetime DEFAULT NULL, `INTERVAL_VALUE` varchar(256) DEFAULT NULL, @@ -75,7 +75,7 @@ EVENTS CREATE TEMPORARY TABLE `EVENTS` ( `LAST_ALTERED` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `LAST_EXECUTED` datetime DEFAULT NULL, `EVENT_COMMENT` varchar(64) NOT NULL DEFAULT '', - `ORIGINATOR` bigint(10) NOT NULL DEFAULT '0', + `ORIGINATOR` bigint(10) NOT NULL DEFAULT 0, `CHARACTER_SET_CLIENT` varchar(32) NOT NULL DEFAULT '', `COLLATION_CONNECTION` varchar(32) NOT NULL DEFAULT '', `DATABASE_COLLATION` varchar(32) NOT NULL DEFAULT '' @@ -88,7 +88,7 @@ EVENT_NAME varchar(64) NO DEFINER varchar(189) NO TIME_ZONE varchar(64) NO EVENT_BODY varchar(8) NO -EVENT_DEFINITION longtext NO NULL +EVENT_DEFINITION longtext NO EVENT_TYPE varchar(9) NO EXECUTE_AT datetime YES NULL INTERVAL_VALUE varchar(256) YES NULL diff --git a/mysql-test/suite/funcs_1/r/is_key_column_usage.result b/mysql-test/suite/funcs_1/r/is_key_column_usage.result index 79310904d0f..80dd2db5441 100644 --- a/mysql-test/suite/funcs_1/r/is_key_column_usage.result +++ b/mysql-test/suite/funcs_1/r/is_key_column_usage.result @@ -50,7 +50,7 @@ KEY_COLUMN_USAGE CREATE TEMPORARY TABLE `KEY_COLUMN_USAGE` ( `TABLE_SCHEMA` varchar(64) NOT NULL DEFAULT '', `TABLE_NAME` varchar(64) NOT NULL DEFAULT '', `COLUMN_NAME` varchar(64) NOT NULL DEFAULT '', - `ORDINAL_POSITION` bigint(10) NOT NULL DEFAULT '0', + `ORDINAL_POSITION` bigint(10) NOT NULL DEFAULT 0, `POSITION_IN_UNIQUE_CONSTRAINT` bigint(10) DEFAULT NULL, `REFERENCED_TABLE_SCHEMA` varchar(64) DEFAULT NULL, `REFERENCED_TABLE_NAME` varchar(64) DEFAULT NULL, diff --git a/mysql-test/suite/funcs_1/r/is_routines.result b/mysql-test/suite/funcs_1/r/is_routines.result index 0afb6a3a7ae..aadf89d89f5 100644 --- a/mysql-test/suite/funcs_1/r/is_routines.result +++ b/mysql-test/suite/funcs_1/r/is_routines.result @@ -55,7 +55,7 @@ SECURITY_TYPE varchar(7) NO CREATED datetime NO 0000-00-00 00:00:00 LAST_ALTERED datetime NO 0000-00-00 00:00:00 SQL_MODE varchar(8192) NO -ROUTINE_COMMENT longtext NO NULL +ROUTINE_COMMENT longtext NO DEFINER varchar(189) NO CHARACTER_SET_CLIENT varchar(32) NO COLLATION_CONNECTION varchar(32) NO @@ -76,9 +76,9 @@ ROUTINES CREATE TEMPORARY TABLE `ROUTINES` ( `DATETIME_PRECISION` bigint(21) unsigned DEFAULT NULL, `CHARACTER_SET_NAME` varchar(64) DEFAULT NULL, `COLLATION_NAME` varchar(64) DEFAULT NULL, - `DTD_IDENTIFIER` longtext, + `DTD_IDENTIFIER` longtext DEFAULT NULL, `ROUTINE_BODY` varchar(8) NOT NULL DEFAULT '', - `ROUTINE_DEFINITION` longtext, + `ROUTINE_DEFINITION` longtext DEFAULT NULL, `EXTERNAL_NAME` varchar(64) DEFAULT NULL, `EXTERNAL_LANGUAGE` varchar(64) DEFAULT NULL, `PARAMETER_STYLE` varchar(8) NOT NULL DEFAULT '', @@ -89,7 +89,7 @@ ROUTINES CREATE TEMPORARY TABLE `ROUTINES` ( `CREATED` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `LAST_ALTERED` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `SQL_MODE` varchar(8192) NOT NULL DEFAULT '', - `ROUTINE_COMMENT` longtext NOT NULL, + `ROUTINE_COMMENT` longtext NOT NULL DEFAULT '', `DEFINER` varchar(189) NOT NULL DEFAULT '', `CHARACTER_SET_CLIENT` varchar(32) NOT NULL DEFAULT '', `COLLATION_CONNECTION` varchar(32) NOT NULL DEFAULT '', @@ -123,7 +123,7 @@ SECURITY_TYPE varchar(7) NO CREATED datetime NO 0000-00-00 00:00:00 LAST_ALTERED datetime NO 0000-00-00 00:00:00 SQL_MODE varchar(8192) NO -ROUTINE_COMMENT longtext NO NULL +ROUTINE_COMMENT longtext NO DEFINER varchar(189) NO CHARACTER_SET_CLIENT varchar(32) NO COLLATION_CONNECTION varchar(32) NO diff --git a/mysql-test/suite/funcs_1/r/is_statistics.result b/mysql-test/suite/funcs_1/r/is_statistics.result index f58c3e56772..8197f043e48 100644 --- a/mysql-test/suite/funcs_1/r/is_statistics.result +++ b/mysql-test/suite/funcs_1/r/is_statistics.result @@ -50,10 +50,10 @@ STATISTICS CREATE TEMPORARY TABLE `STATISTICS` ( `TABLE_CATALOG` varchar(512) NOT NULL DEFAULT '', `TABLE_SCHEMA` varchar(64) NOT NULL DEFAULT '', `TABLE_NAME` varchar(64) NOT NULL DEFAULT '', - `NON_UNIQUE` bigint(1) NOT NULL DEFAULT '0', + `NON_UNIQUE` bigint(1) NOT NULL DEFAULT 0, `INDEX_SCHEMA` varchar(64) NOT NULL DEFAULT '', `INDEX_NAME` varchar(64) NOT NULL DEFAULT '', - `SEQ_IN_INDEX` bigint(2) NOT NULL DEFAULT '0', + `SEQ_IN_INDEX` bigint(2) NOT NULL DEFAULT 0, `COLUMN_NAME` varchar(64) NOT NULL DEFAULT '', `COLLATION` varchar(1) DEFAULT NULL, `CARDINALITY` bigint(21) DEFAULT NULL, diff --git a/mysql-test/suite/funcs_1/r/is_tables_is.result b/mysql-test/suite/funcs_1/r/is_tables_is.result index a0f2424c07c..54bc727fb74 100644 --- a/mysql-test/suite/funcs_1/r/is_tables_is.result +++ b/mysql-test/suite/funcs_1/r/is_tables_is.result @@ -17,7 +17,7 @@ TABLE_SCHEMA information_schema TABLE_NAME ALL_PLUGINS TABLE_TYPE SYSTEM VIEW ENGINE MYISAM_OR_MARIA -VERSION 10 +VERSION 11 ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -40,7 +40,7 @@ TABLE_SCHEMA information_schema TABLE_NAME APPLICABLE_ROLES TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -63,7 +63,7 @@ TABLE_SCHEMA information_schema TABLE_NAME CHARACTER_SETS TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -86,7 +86,7 @@ TABLE_SCHEMA information_schema TABLE_NAME CLIENT_STATISTICS TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -109,7 +109,7 @@ TABLE_SCHEMA information_schema TABLE_NAME COLLATIONS TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -132,7 +132,7 @@ TABLE_SCHEMA information_schema TABLE_NAME COLLATION_CHARACTER_SET_APPLICABILITY TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -155,7 +155,7 @@ TABLE_SCHEMA information_schema TABLE_NAME COLUMNS TABLE_TYPE SYSTEM VIEW ENGINE MYISAM_OR_MARIA -VERSION 10 +VERSION 11 ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -178,7 +178,7 @@ TABLE_SCHEMA information_schema TABLE_NAME COLUMN_PRIVILEGES TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -201,7 +201,7 @@ TABLE_SCHEMA information_schema TABLE_NAME ENABLED_ROLES TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -224,7 +224,7 @@ TABLE_SCHEMA information_schema TABLE_NAME ENGINES TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -247,7 +247,7 @@ TABLE_SCHEMA information_schema TABLE_NAME EVENTS TABLE_TYPE SYSTEM VIEW ENGINE MYISAM_OR_MARIA -VERSION 10 +VERSION 11 ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -270,7 +270,7 @@ TABLE_SCHEMA information_schema TABLE_NAME FILES TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -293,7 +293,7 @@ TABLE_SCHEMA information_schema TABLE_NAME GEOMETRY_COLUMNS TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -316,7 +316,7 @@ TABLE_SCHEMA information_schema TABLE_NAME GLOBAL_STATUS TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -339,7 +339,7 @@ TABLE_SCHEMA information_schema TABLE_NAME GLOBAL_VARIABLES TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -362,7 +362,7 @@ TABLE_SCHEMA information_schema TABLE_NAME INDEX_STATISTICS TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -385,7 +385,7 @@ TABLE_SCHEMA information_schema TABLE_NAME KEY_CACHES TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -408,7 +408,7 @@ TABLE_SCHEMA information_schema TABLE_NAME KEY_COLUMN_USAGE TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -431,7 +431,7 @@ TABLE_SCHEMA information_schema TABLE_NAME PARAMETERS TABLE_TYPE SYSTEM VIEW ENGINE MYISAM_OR_MARIA -VERSION 10 +VERSION 11 ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -454,7 +454,7 @@ TABLE_SCHEMA information_schema TABLE_NAME PARTITIONS TABLE_TYPE SYSTEM VIEW ENGINE MYISAM_OR_MARIA -VERSION 10 +VERSION 11 ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -477,7 +477,7 @@ TABLE_SCHEMA information_schema TABLE_NAME PLUGINS TABLE_TYPE SYSTEM VIEW ENGINE MYISAM_OR_MARIA -VERSION 10 +VERSION 11 ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -500,7 +500,7 @@ TABLE_SCHEMA information_schema TABLE_NAME PROCESSLIST TABLE_TYPE SYSTEM VIEW ENGINE MYISAM_OR_MARIA -VERSION 10 +VERSION 11 ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -523,7 +523,7 @@ TABLE_SCHEMA information_schema TABLE_NAME REFERENTIAL_CONSTRAINTS TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -546,7 +546,7 @@ TABLE_SCHEMA information_schema TABLE_NAME ROUTINES TABLE_TYPE SYSTEM VIEW ENGINE MYISAM_OR_MARIA -VERSION 10 +VERSION 11 ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -569,7 +569,7 @@ TABLE_SCHEMA information_schema TABLE_NAME SCHEMATA TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -592,7 +592,7 @@ TABLE_SCHEMA information_schema TABLE_NAME SCHEMA_PRIVILEGES TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -615,7 +615,7 @@ TABLE_SCHEMA information_schema TABLE_NAME SESSION_STATUS TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -638,7 +638,7 @@ TABLE_SCHEMA information_schema TABLE_NAME SESSION_VARIABLES TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -661,7 +661,7 @@ TABLE_SCHEMA information_schema TABLE_NAME SPATIAL_REF_SYS TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -684,7 +684,7 @@ TABLE_SCHEMA information_schema TABLE_NAME STATISTICS TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -707,7 +707,7 @@ TABLE_SCHEMA information_schema TABLE_NAME SYSTEM_VARIABLES TABLE_TYPE SYSTEM VIEW ENGINE MYISAM_OR_MARIA -VERSION 10 +VERSION 11 ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -730,7 +730,7 @@ TABLE_SCHEMA information_schema TABLE_NAME TABLES TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -753,7 +753,7 @@ TABLE_SCHEMA information_schema TABLE_NAME TABLESPACES TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -776,7 +776,7 @@ TABLE_SCHEMA information_schema TABLE_NAME TABLE_CONSTRAINTS TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -799,7 +799,7 @@ TABLE_SCHEMA information_schema TABLE_NAME TABLE_PRIVILEGES TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -822,7 +822,7 @@ TABLE_SCHEMA information_schema TABLE_NAME TABLE_STATISTICS TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -845,7 +845,7 @@ TABLE_SCHEMA information_schema TABLE_NAME TRIGGERS TABLE_TYPE SYSTEM VIEW ENGINE MYISAM_OR_MARIA -VERSION 10 +VERSION 11 ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -868,7 +868,7 @@ TABLE_SCHEMA information_schema TABLE_NAME USER_PRIVILEGES TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -891,7 +891,7 @@ TABLE_SCHEMA information_schema TABLE_NAME USER_STATISTICS TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -914,7 +914,7 @@ TABLE_SCHEMA information_schema TABLE_NAME VIEWS TABLE_TYPE SYSTEM VIEW ENGINE MYISAM_OR_MARIA -VERSION 10 +VERSION 11 ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -953,7 +953,7 @@ TABLE_SCHEMA information_schema TABLE_NAME ALL_PLUGINS TABLE_TYPE SYSTEM VIEW ENGINE MYISAM_OR_MARIA -VERSION 10 +VERSION 11 ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -976,7 +976,7 @@ TABLE_SCHEMA information_schema TABLE_NAME APPLICABLE_ROLES TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -999,7 +999,7 @@ TABLE_SCHEMA information_schema TABLE_NAME CHARACTER_SETS TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1022,7 +1022,7 @@ TABLE_SCHEMA information_schema TABLE_NAME CLIENT_STATISTICS TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1045,7 +1045,7 @@ TABLE_SCHEMA information_schema TABLE_NAME COLLATIONS TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1068,7 +1068,7 @@ TABLE_SCHEMA information_schema TABLE_NAME COLLATION_CHARACTER_SET_APPLICABILITY TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1091,7 +1091,7 @@ TABLE_SCHEMA information_schema TABLE_NAME COLUMNS TABLE_TYPE SYSTEM VIEW ENGINE MYISAM_OR_MARIA -VERSION 10 +VERSION 11 ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1114,7 +1114,7 @@ TABLE_SCHEMA information_schema TABLE_NAME COLUMN_PRIVILEGES TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1137,7 +1137,7 @@ TABLE_SCHEMA information_schema TABLE_NAME ENABLED_ROLES TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1160,7 +1160,7 @@ TABLE_SCHEMA information_schema TABLE_NAME ENGINES TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1183,7 +1183,7 @@ TABLE_SCHEMA information_schema TABLE_NAME EVENTS TABLE_TYPE SYSTEM VIEW ENGINE MYISAM_OR_MARIA -VERSION 10 +VERSION 11 ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1206,7 +1206,7 @@ TABLE_SCHEMA information_schema TABLE_NAME FILES TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1229,7 +1229,7 @@ TABLE_SCHEMA information_schema TABLE_NAME GEOMETRY_COLUMNS TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1252,7 +1252,7 @@ TABLE_SCHEMA information_schema TABLE_NAME GLOBAL_STATUS TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1275,7 +1275,7 @@ TABLE_SCHEMA information_schema TABLE_NAME GLOBAL_VARIABLES TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1298,7 +1298,7 @@ TABLE_SCHEMA information_schema TABLE_NAME INDEX_STATISTICS TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1321,7 +1321,7 @@ TABLE_SCHEMA information_schema TABLE_NAME KEY_CACHES TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1344,7 +1344,7 @@ TABLE_SCHEMA information_schema TABLE_NAME KEY_COLUMN_USAGE TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1367,7 +1367,7 @@ TABLE_SCHEMA information_schema TABLE_NAME PARAMETERS TABLE_TYPE SYSTEM VIEW ENGINE MYISAM_OR_MARIA -VERSION 10 +VERSION 11 ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1390,7 +1390,7 @@ TABLE_SCHEMA information_schema TABLE_NAME PARTITIONS TABLE_TYPE SYSTEM VIEW ENGINE MYISAM_OR_MARIA -VERSION 10 +VERSION 11 ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1413,7 +1413,7 @@ TABLE_SCHEMA information_schema TABLE_NAME PLUGINS TABLE_TYPE SYSTEM VIEW ENGINE MYISAM_OR_MARIA -VERSION 10 +VERSION 11 ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1436,7 +1436,7 @@ TABLE_SCHEMA information_schema TABLE_NAME PROCESSLIST TABLE_TYPE SYSTEM VIEW ENGINE MYISAM_OR_MARIA -VERSION 10 +VERSION 11 ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1459,7 +1459,7 @@ TABLE_SCHEMA information_schema TABLE_NAME REFERENTIAL_CONSTRAINTS TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1482,7 +1482,7 @@ TABLE_SCHEMA information_schema TABLE_NAME ROUTINES TABLE_TYPE SYSTEM VIEW ENGINE MYISAM_OR_MARIA -VERSION 10 +VERSION 11 ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1505,7 +1505,7 @@ TABLE_SCHEMA information_schema TABLE_NAME SCHEMATA TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1528,7 +1528,7 @@ TABLE_SCHEMA information_schema TABLE_NAME SCHEMA_PRIVILEGES TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1551,7 +1551,7 @@ TABLE_SCHEMA information_schema TABLE_NAME SESSION_STATUS TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1574,7 +1574,7 @@ TABLE_SCHEMA information_schema TABLE_NAME SESSION_VARIABLES TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1597,7 +1597,7 @@ TABLE_SCHEMA information_schema TABLE_NAME SPATIAL_REF_SYS TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1620,7 +1620,7 @@ TABLE_SCHEMA information_schema TABLE_NAME STATISTICS TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1643,7 +1643,7 @@ TABLE_SCHEMA information_schema TABLE_NAME SYSTEM_VARIABLES TABLE_TYPE SYSTEM VIEW ENGINE MYISAM_OR_MARIA -VERSION 10 +VERSION 11 ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1666,7 +1666,7 @@ TABLE_SCHEMA information_schema TABLE_NAME TABLES TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1689,7 +1689,7 @@ TABLE_SCHEMA information_schema TABLE_NAME TABLESPACES TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1712,7 +1712,7 @@ TABLE_SCHEMA information_schema TABLE_NAME TABLE_CONSTRAINTS TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1735,7 +1735,7 @@ TABLE_SCHEMA information_schema TABLE_NAME TABLE_PRIVILEGES TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1758,7 +1758,7 @@ TABLE_SCHEMA information_schema TABLE_NAME TABLE_STATISTICS TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1781,7 +1781,7 @@ TABLE_SCHEMA information_schema TABLE_NAME TRIGGERS TABLE_TYPE SYSTEM VIEW ENGINE MYISAM_OR_MARIA -VERSION 10 +VERSION 11 ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1804,7 +1804,7 @@ TABLE_SCHEMA information_schema TABLE_NAME USER_PRIVILEGES TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1827,7 +1827,7 @@ TABLE_SCHEMA information_schema TABLE_NAME USER_STATISTICS TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1850,7 +1850,7 @@ TABLE_SCHEMA information_schema TABLE_NAME VIEWS TABLE_TYPE SYSTEM VIEW ENGINE MYISAM_OR_MARIA -VERSION 10 +VERSION 11 ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# diff --git a/mysql-test/suite/funcs_1/r/is_tables_is_embedded.result b/mysql-test/suite/funcs_1/r/is_tables_is_embedded.result index a0f2424c07c..54bc727fb74 100644 --- a/mysql-test/suite/funcs_1/r/is_tables_is_embedded.result +++ b/mysql-test/suite/funcs_1/r/is_tables_is_embedded.result @@ -17,7 +17,7 @@ TABLE_SCHEMA information_schema TABLE_NAME ALL_PLUGINS TABLE_TYPE SYSTEM VIEW ENGINE MYISAM_OR_MARIA -VERSION 10 +VERSION 11 ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -40,7 +40,7 @@ TABLE_SCHEMA information_schema TABLE_NAME APPLICABLE_ROLES TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -63,7 +63,7 @@ TABLE_SCHEMA information_schema TABLE_NAME CHARACTER_SETS TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -86,7 +86,7 @@ TABLE_SCHEMA information_schema TABLE_NAME CLIENT_STATISTICS TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -109,7 +109,7 @@ TABLE_SCHEMA information_schema TABLE_NAME COLLATIONS TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -132,7 +132,7 @@ TABLE_SCHEMA information_schema TABLE_NAME COLLATION_CHARACTER_SET_APPLICABILITY TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -155,7 +155,7 @@ TABLE_SCHEMA information_schema TABLE_NAME COLUMNS TABLE_TYPE SYSTEM VIEW ENGINE MYISAM_OR_MARIA -VERSION 10 +VERSION 11 ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -178,7 +178,7 @@ TABLE_SCHEMA information_schema TABLE_NAME COLUMN_PRIVILEGES TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -201,7 +201,7 @@ TABLE_SCHEMA information_schema TABLE_NAME ENABLED_ROLES TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -224,7 +224,7 @@ TABLE_SCHEMA information_schema TABLE_NAME ENGINES TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -247,7 +247,7 @@ TABLE_SCHEMA information_schema TABLE_NAME EVENTS TABLE_TYPE SYSTEM VIEW ENGINE MYISAM_OR_MARIA -VERSION 10 +VERSION 11 ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -270,7 +270,7 @@ TABLE_SCHEMA information_schema TABLE_NAME FILES TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -293,7 +293,7 @@ TABLE_SCHEMA information_schema TABLE_NAME GEOMETRY_COLUMNS TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -316,7 +316,7 @@ TABLE_SCHEMA information_schema TABLE_NAME GLOBAL_STATUS TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -339,7 +339,7 @@ TABLE_SCHEMA information_schema TABLE_NAME GLOBAL_VARIABLES TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -362,7 +362,7 @@ TABLE_SCHEMA information_schema TABLE_NAME INDEX_STATISTICS TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -385,7 +385,7 @@ TABLE_SCHEMA information_schema TABLE_NAME KEY_CACHES TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -408,7 +408,7 @@ TABLE_SCHEMA information_schema TABLE_NAME KEY_COLUMN_USAGE TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -431,7 +431,7 @@ TABLE_SCHEMA information_schema TABLE_NAME PARAMETERS TABLE_TYPE SYSTEM VIEW ENGINE MYISAM_OR_MARIA -VERSION 10 +VERSION 11 ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -454,7 +454,7 @@ TABLE_SCHEMA information_schema TABLE_NAME PARTITIONS TABLE_TYPE SYSTEM VIEW ENGINE MYISAM_OR_MARIA -VERSION 10 +VERSION 11 ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -477,7 +477,7 @@ TABLE_SCHEMA information_schema TABLE_NAME PLUGINS TABLE_TYPE SYSTEM VIEW ENGINE MYISAM_OR_MARIA -VERSION 10 +VERSION 11 ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -500,7 +500,7 @@ TABLE_SCHEMA information_schema TABLE_NAME PROCESSLIST TABLE_TYPE SYSTEM VIEW ENGINE MYISAM_OR_MARIA -VERSION 10 +VERSION 11 ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -523,7 +523,7 @@ TABLE_SCHEMA information_schema TABLE_NAME REFERENTIAL_CONSTRAINTS TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -546,7 +546,7 @@ TABLE_SCHEMA information_schema TABLE_NAME ROUTINES TABLE_TYPE SYSTEM VIEW ENGINE MYISAM_OR_MARIA -VERSION 10 +VERSION 11 ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -569,7 +569,7 @@ TABLE_SCHEMA information_schema TABLE_NAME SCHEMATA TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -592,7 +592,7 @@ TABLE_SCHEMA information_schema TABLE_NAME SCHEMA_PRIVILEGES TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -615,7 +615,7 @@ TABLE_SCHEMA information_schema TABLE_NAME SESSION_STATUS TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -638,7 +638,7 @@ TABLE_SCHEMA information_schema TABLE_NAME SESSION_VARIABLES TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -661,7 +661,7 @@ TABLE_SCHEMA information_schema TABLE_NAME SPATIAL_REF_SYS TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -684,7 +684,7 @@ TABLE_SCHEMA information_schema TABLE_NAME STATISTICS TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -707,7 +707,7 @@ TABLE_SCHEMA information_schema TABLE_NAME SYSTEM_VARIABLES TABLE_TYPE SYSTEM VIEW ENGINE MYISAM_OR_MARIA -VERSION 10 +VERSION 11 ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -730,7 +730,7 @@ TABLE_SCHEMA information_schema TABLE_NAME TABLES TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -753,7 +753,7 @@ TABLE_SCHEMA information_schema TABLE_NAME TABLESPACES TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -776,7 +776,7 @@ TABLE_SCHEMA information_schema TABLE_NAME TABLE_CONSTRAINTS TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -799,7 +799,7 @@ TABLE_SCHEMA information_schema TABLE_NAME TABLE_PRIVILEGES TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -822,7 +822,7 @@ TABLE_SCHEMA information_schema TABLE_NAME TABLE_STATISTICS TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -845,7 +845,7 @@ TABLE_SCHEMA information_schema TABLE_NAME TRIGGERS TABLE_TYPE SYSTEM VIEW ENGINE MYISAM_OR_MARIA -VERSION 10 +VERSION 11 ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -868,7 +868,7 @@ TABLE_SCHEMA information_schema TABLE_NAME USER_PRIVILEGES TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -891,7 +891,7 @@ TABLE_SCHEMA information_schema TABLE_NAME USER_STATISTICS TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -914,7 +914,7 @@ TABLE_SCHEMA information_schema TABLE_NAME VIEWS TABLE_TYPE SYSTEM VIEW ENGINE MYISAM_OR_MARIA -VERSION 10 +VERSION 11 ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -953,7 +953,7 @@ TABLE_SCHEMA information_schema TABLE_NAME ALL_PLUGINS TABLE_TYPE SYSTEM VIEW ENGINE MYISAM_OR_MARIA -VERSION 10 +VERSION 11 ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -976,7 +976,7 @@ TABLE_SCHEMA information_schema TABLE_NAME APPLICABLE_ROLES TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -999,7 +999,7 @@ TABLE_SCHEMA information_schema TABLE_NAME CHARACTER_SETS TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1022,7 +1022,7 @@ TABLE_SCHEMA information_schema TABLE_NAME CLIENT_STATISTICS TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1045,7 +1045,7 @@ TABLE_SCHEMA information_schema TABLE_NAME COLLATIONS TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1068,7 +1068,7 @@ TABLE_SCHEMA information_schema TABLE_NAME COLLATION_CHARACTER_SET_APPLICABILITY TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1091,7 +1091,7 @@ TABLE_SCHEMA information_schema TABLE_NAME COLUMNS TABLE_TYPE SYSTEM VIEW ENGINE MYISAM_OR_MARIA -VERSION 10 +VERSION 11 ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1114,7 +1114,7 @@ TABLE_SCHEMA information_schema TABLE_NAME COLUMN_PRIVILEGES TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1137,7 +1137,7 @@ TABLE_SCHEMA information_schema TABLE_NAME ENABLED_ROLES TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1160,7 +1160,7 @@ TABLE_SCHEMA information_schema TABLE_NAME ENGINES TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1183,7 +1183,7 @@ TABLE_SCHEMA information_schema TABLE_NAME EVENTS TABLE_TYPE SYSTEM VIEW ENGINE MYISAM_OR_MARIA -VERSION 10 +VERSION 11 ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1206,7 +1206,7 @@ TABLE_SCHEMA information_schema TABLE_NAME FILES TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1229,7 +1229,7 @@ TABLE_SCHEMA information_schema TABLE_NAME GEOMETRY_COLUMNS TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1252,7 +1252,7 @@ TABLE_SCHEMA information_schema TABLE_NAME GLOBAL_STATUS TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1275,7 +1275,7 @@ TABLE_SCHEMA information_schema TABLE_NAME GLOBAL_VARIABLES TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1298,7 +1298,7 @@ TABLE_SCHEMA information_schema TABLE_NAME INDEX_STATISTICS TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1321,7 +1321,7 @@ TABLE_SCHEMA information_schema TABLE_NAME KEY_CACHES TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1344,7 +1344,7 @@ TABLE_SCHEMA information_schema TABLE_NAME KEY_COLUMN_USAGE TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1367,7 +1367,7 @@ TABLE_SCHEMA information_schema TABLE_NAME PARAMETERS TABLE_TYPE SYSTEM VIEW ENGINE MYISAM_OR_MARIA -VERSION 10 +VERSION 11 ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1390,7 +1390,7 @@ TABLE_SCHEMA information_schema TABLE_NAME PARTITIONS TABLE_TYPE SYSTEM VIEW ENGINE MYISAM_OR_MARIA -VERSION 10 +VERSION 11 ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1413,7 +1413,7 @@ TABLE_SCHEMA information_schema TABLE_NAME PLUGINS TABLE_TYPE SYSTEM VIEW ENGINE MYISAM_OR_MARIA -VERSION 10 +VERSION 11 ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1436,7 +1436,7 @@ TABLE_SCHEMA information_schema TABLE_NAME PROCESSLIST TABLE_TYPE SYSTEM VIEW ENGINE MYISAM_OR_MARIA -VERSION 10 +VERSION 11 ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1459,7 +1459,7 @@ TABLE_SCHEMA information_schema TABLE_NAME REFERENTIAL_CONSTRAINTS TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1482,7 +1482,7 @@ TABLE_SCHEMA information_schema TABLE_NAME ROUTINES TABLE_TYPE SYSTEM VIEW ENGINE MYISAM_OR_MARIA -VERSION 10 +VERSION 11 ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1505,7 +1505,7 @@ TABLE_SCHEMA information_schema TABLE_NAME SCHEMATA TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1528,7 +1528,7 @@ TABLE_SCHEMA information_schema TABLE_NAME SCHEMA_PRIVILEGES TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1551,7 +1551,7 @@ TABLE_SCHEMA information_schema TABLE_NAME SESSION_STATUS TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1574,7 +1574,7 @@ TABLE_SCHEMA information_schema TABLE_NAME SESSION_VARIABLES TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1597,7 +1597,7 @@ TABLE_SCHEMA information_schema TABLE_NAME SPATIAL_REF_SYS TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1620,7 +1620,7 @@ TABLE_SCHEMA information_schema TABLE_NAME STATISTICS TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1643,7 +1643,7 @@ TABLE_SCHEMA information_schema TABLE_NAME SYSTEM_VARIABLES TABLE_TYPE SYSTEM VIEW ENGINE MYISAM_OR_MARIA -VERSION 10 +VERSION 11 ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1666,7 +1666,7 @@ TABLE_SCHEMA information_schema TABLE_NAME TABLES TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1689,7 +1689,7 @@ TABLE_SCHEMA information_schema TABLE_NAME TABLESPACES TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1712,7 +1712,7 @@ TABLE_SCHEMA information_schema TABLE_NAME TABLE_CONSTRAINTS TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1735,7 +1735,7 @@ TABLE_SCHEMA information_schema TABLE_NAME TABLE_PRIVILEGES TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1758,7 +1758,7 @@ TABLE_SCHEMA information_schema TABLE_NAME TABLE_STATISTICS TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1781,7 +1781,7 @@ TABLE_SCHEMA information_schema TABLE_NAME TRIGGERS TABLE_TYPE SYSTEM VIEW ENGINE MYISAM_OR_MARIA -VERSION 10 +VERSION 11 ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1804,7 +1804,7 @@ TABLE_SCHEMA information_schema TABLE_NAME USER_PRIVILEGES TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1827,7 +1827,7 @@ TABLE_SCHEMA information_schema TABLE_NAME USER_STATISTICS TABLE_TYPE SYSTEM VIEW ENGINE MEMORY -VERSION 10 +VERSION 11 ROW_FORMAT Fixed TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1850,7 +1850,7 @@ TABLE_SCHEMA information_schema TABLE_NAME VIEWS TABLE_TYPE SYSTEM VIEW ENGINE MYISAM_OR_MARIA -VERSION 10 +VERSION 11 ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# diff --git a/mysql-test/suite/funcs_1/r/is_triggers.result b/mysql-test/suite/funcs_1/r/is_triggers.result index e64086431e3..ac6372b1d84 100644 --- a/mysql-test/suite/funcs_1/r/is_triggers.result +++ b/mysql-test/suite/funcs_1/r/is_triggers.result @@ -38,7 +38,7 @@ EVENT_OBJECT_SCHEMA varchar(64) NO EVENT_OBJECT_TABLE varchar(64) NO ACTION_ORDER bigint(4) NO 0 ACTION_CONDITION longtext YES NULL -ACTION_STATEMENT longtext NO NULL +ACTION_STATEMENT longtext NO ACTION_ORIENTATION varchar(9) NO ACTION_TIMING varchar(6) NO ACTION_REFERENCE_OLD_TABLE varchar(64) YES NULL @@ -61,9 +61,9 @@ TRIGGERS CREATE TEMPORARY TABLE `TRIGGERS` ( `EVENT_OBJECT_CATALOG` varchar(512) NOT NULL DEFAULT '', `EVENT_OBJECT_SCHEMA` varchar(64) NOT NULL DEFAULT '', `EVENT_OBJECT_TABLE` varchar(64) NOT NULL DEFAULT '', - `ACTION_ORDER` bigint(4) NOT NULL DEFAULT '0', - `ACTION_CONDITION` longtext, - `ACTION_STATEMENT` longtext NOT NULL, + `ACTION_ORDER` bigint(4) NOT NULL DEFAULT 0, + `ACTION_CONDITION` longtext DEFAULT NULL, + `ACTION_STATEMENT` longtext NOT NULL DEFAULT '', `ACTION_ORIENTATION` varchar(9) NOT NULL DEFAULT '', `ACTION_TIMING` varchar(6) NOT NULL DEFAULT '', `ACTION_REFERENCE_OLD_TABLE` varchar(64) DEFAULT NULL, @@ -88,7 +88,7 @@ EVENT_OBJECT_SCHEMA varchar(64) NO EVENT_OBJECT_TABLE varchar(64) NO ACTION_ORDER bigint(4) NO 0 ACTION_CONDITION longtext YES NULL -ACTION_STATEMENT longtext NO NULL +ACTION_STATEMENT longtext NO ACTION_ORIENTATION varchar(9) NO ACTION_TIMING varchar(6) NO ACTION_REFERENCE_OLD_TABLE varchar(64) YES NULL diff --git a/mysql-test/suite/funcs_1/r/is_views.result b/mysql-test/suite/funcs_1/r/is_views.result index 6c22fed6379..cf7b2693b1e 100644 --- a/mysql-test/suite/funcs_1/r/is_views.result +++ b/mysql-test/suite/funcs_1/r/is_views.result @@ -31,7 +31,7 @@ Field Type Null Key Default Extra TABLE_CATALOG varchar(512) NO TABLE_SCHEMA varchar(64) NO TABLE_NAME varchar(64) NO -VIEW_DEFINITION longtext NO NULL +VIEW_DEFINITION longtext NO CHECK_OPTION varchar(8) NO IS_UPDATABLE varchar(3) NO DEFINER varchar(189) NO @@ -45,7 +45,7 @@ VIEWS CREATE TEMPORARY TABLE `VIEWS` ( `TABLE_CATALOG` varchar(512) NOT NULL DEFAULT '', `TABLE_SCHEMA` varchar(64) NOT NULL DEFAULT '', `TABLE_NAME` varchar(64) NOT NULL DEFAULT '', - `VIEW_DEFINITION` longtext NOT NULL, + `VIEW_DEFINITION` longtext NOT NULL DEFAULT '', `CHECK_OPTION` varchar(8) NOT NULL DEFAULT '', `IS_UPDATABLE` varchar(3) NOT NULL DEFAULT '', `DEFINER` varchar(189) NOT NULL DEFAULT '', @@ -59,7 +59,7 @@ Field Type Null Key Default Extra TABLE_CATALOG varchar(512) NO TABLE_SCHEMA varchar(64) NO TABLE_NAME varchar(64) NO -VIEW_DEFINITION longtext NO NULL +VIEW_DEFINITION longtext NO CHECK_OPTION varchar(8) NO IS_UPDATABLE varchar(3) NO DEFINER varchar(189) NO diff --git a/mysql-test/suite/funcs_1/r/memory_func_view.result b/mysql-test/suite/funcs_1/r/memory_func_view.result index df57c83164e..c78cf163ada 100644 --- a/mysql-test/suite/funcs_1/r/memory_func_view.result +++ b/mysql-test/suite/funcs_1/r/memory_func_view.result @@ -917,8 +917,8 @@ AaBbCcDdEeFfGgHhIiJjÄäÜüÖö 1.7976931348623e308 3 0 4 -1 5 Warnings: -Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e308' -Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e308' +Warning 1916 Got overflow when converting '-1.7976931348623e308' to INT. Value truncated. +Warning 1916 Got overflow when converting '1.7976931348623e308' to INT. Value truncated. SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select left('AaBbCcDdEeFfGgHhIiJjÄäÜüÖö',`t1_values`.`my_double`) AS `LEFT('AaBbCcDdEeFfGgHhIiJjÄäÜüÖö', my_double)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci @@ -932,8 +932,8 @@ AaBbCcDdEeFfGgHhIiJjÄäÜüÖö 1.7976931348623e308 3 0 4 -1 5 Warnings: -Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e308' -Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e308' +Warning 1916 Got overflow when converting '-1.7976931348623e308' to INT. Value truncated. +Warning 1916 Got overflow when converting '1.7976931348623e308' to INT. Value truncated. DROP VIEW v1; @@ -2587,9 +2587,9 @@ NULL NULL 1 0 0 4 18446744073709551615 -1 5 Warnings: -Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e308' +Warning 1916 Got overflow when converting '-1.7976931348623e308' to INT. Value truncated. Note 1105 Cast to unsigned converted negative integer to it's positive complement -Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e308' +Warning 1916 Got overflow when converting '1.7976931348623e308' to INT. Value truncated. Note 1105 Cast to unsigned converted negative integer to it's positive complement SHOW CREATE VIEW v1; View Create View character_set_client collation_connection @@ -2604,9 +2604,9 @@ NULL NULL 1 0 0 4 18446744073709551615 -1 5 Warnings: -Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e308' +Warning 1916 Got overflow when converting '-1.7976931348623e308' to INT. Value truncated. Note 1105 Cast to unsigned converted negative integer to it's positive complement -Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e308' +Warning 1916 Got overflow when converting '1.7976931348623e308' to INT. Value truncated. Note 1105 Cast to unsigned converted negative integer to it's positive complement DROP VIEW v1; @@ -2965,8 +2965,8 @@ NULL NULL 1 0 0 4 -1 -1 5 Warnings: -Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e308' -Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e308' +Warning 1916 Got overflow when converting '-1.7976931348623e308' to INT. Value truncated. +Warning 1916 Got overflow when converting '1.7976931348623e308' to INT. Value truncated. SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as signed) AS `CAST(my_double AS SIGNED INTEGER)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci @@ -2980,8 +2980,8 @@ NULL NULL 1 0 0 4 -1 -1 5 Warnings: -Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e308' -Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e308' +Warning 1916 Got overflow when converting '-1.7976931348623e308' to INT. Value truncated. +Warning 1916 Got overflow when converting '1.7976931348623e308' to INT. Value truncated. DROP VIEW v1; diff --git a/mysql-test/suite/funcs_1/r/memory_views.result b/mysql-test/suite/funcs_1/r/memory_views.result index ab4e2a9933c..885e2a7dfe7 100644 --- a/mysql-test/suite/funcs_1/r/memory_views.result +++ b/mysql-test/suite/funcs_1/r/memory_views.result @@ -3504,7 +3504,7 @@ Select @x; 0 CREATE or REPLACE VIEW v1 AS Select 1 FROM (SELECT 1 FROM t1) my_table; -ERROR HY000: View's SELECT contains a subquery in the FROM clause +DROP VIEW v1; CREATE VIEW v1 AS SELECT f1 FROM t1; CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET @a:=1 ; SET @a:=0 ; @@ -7536,7 +7536,7 @@ Testcase 3.3.1.39 Drop view if exists test.v1 ; CREATE VIEW test.v1 AS Select f59 from (Select * FROM tb2 limit 20) tx ; -ERROR HY000: View's SELECT contains a subquery in the FROM clause +DROP VIEW test.v1; SELECT * FROM test.v1 order by f59 ; ERROR 42S02: Table 'test.v1' doesn't exist Drop view if exists test.v1 ; @@ -8003,7 +8003,7 @@ Drop view if exists test.v1 ; CREATE VIEW test.v1 AS SELECT f59,f60 FROM test.tb2 where f59 = 195 WITH CHECK OPTION ; UPDATE test.v1 SET f59 = 198 where f59=195 ; -ERROR HY000: CHECK OPTION failed 'test.v1' +ERROR 44000: CHECK OPTION failed `test`.`v1` SELECT * FROM test.v1 order by f59 ; f59 f60 195 87 @@ -8017,7 +8017,7 @@ CREATE VIEW test.v1 AS SELECT f59,f60 FROM test.tb2 where F59 = 0987 WITH LOCAL CHECK OPTION ; CREATE VIEW test.v2 as SELECT * FROM test.v1 ; UPDATE test.v1 SET F59 = 919 where f59 = 0987 ; -ERROR HY000: CHECK OPTION failed 'test.v1' +ERROR 44000: CHECK OPTION failed `test`.`v1` SELECT * FROM test.v1 order by f59 ; f59 f60 987 41 @@ -8052,9 +8052,9 @@ f1 f2 A 2 B 2 UPDATE v1 SET f2 = 4; -ERROR HY000: CHECK OPTION failed 'test.v1' +ERROR 44000: CHECK OPTION failed `test`.`v1` INSERT INTO v1 VALUES('B',3); -ERROR HY000: CHECK OPTION failed 'test.v1' +ERROR 44000: CHECK OPTION failed `test`.`v1` SELECT * FROM v1 order by f1, f2; f1 f2 A 2 @@ -8168,7 +8168,7 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -8202,7 +8202,7 @@ affected rows: 1 INSERT INTO v3 VALUES(0, 'zero'); affected rows: 1 INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -8280,21 +8280,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -8308,11 +8308,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -8388,21 +8388,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -8416,11 +8416,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -8613,7 +8613,7 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -8647,7 +8647,7 @@ affected rows: 1 INSERT INTO v3 VALUES(0, 'zero'); affected rows: 1 INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -8725,21 +8725,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -8753,11 +8753,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -8833,21 +8833,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -8861,11 +8861,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -9058,7 +9058,7 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -9092,7 +9092,7 @@ affected rows: 1 INSERT INTO v3 VALUES(0, 'zero'); affected rows: 1 INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -9170,21 +9170,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -9198,11 +9198,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -9278,21 +9278,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -9306,11 +9306,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -9503,7 +9503,7 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -9537,7 +9537,7 @@ affected rows: 1 INSERT INTO v3 VALUES(0, 'zero'); affected rows: 1 INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -9615,21 +9615,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -9643,11 +9643,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -9723,21 +9723,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -9751,11 +9751,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -9951,7 +9951,7 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -9985,7 +9985,7 @@ affected rows: 1 INSERT INTO v3 VALUES(0, 'zero'); affected rows: 1 INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -10063,21 +10063,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -10091,11 +10091,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -10171,21 +10171,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -10199,11 +10199,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -10396,7 +10396,7 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -10430,7 +10430,7 @@ affected rows: 1 INSERT INTO v3 VALUES(0, 'zero'); affected rows: 1 INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -10508,21 +10508,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -10536,11 +10536,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -10616,21 +10616,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -10644,11 +10644,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -10841,7 +10841,7 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -10875,7 +10875,7 @@ affected rows: 1 INSERT INTO v3 VALUES(0, 'zero'); affected rows: 1 INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -10953,21 +10953,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -10981,11 +10981,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -11061,21 +11061,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -11089,11 +11089,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -11286,7 +11286,7 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -11320,7 +11320,7 @@ affected rows: 1 INSERT INTO v3 VALUES(0, 'zero'); affected rows: 1 INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -11398,21 +11398,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -11426,11 +11426,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -11506,21 +11506,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -11534,11 +11534,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -11734,7 +11734,7 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -11768,7 +11768,7 @@ affected rows: 1 INSERT INTO v3 VALUES(0, 'zero'); affected rows: 1 INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -11846,21 +11846,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -11874,11 +11874,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -11954,21 +11954,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -11982,11 +11982,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -12179,7 +12179,7 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -12213,7 +12213,7 @@ affected rows: 1 INSERT INTO v3 VALUES(0, 'zero'); affected rows: 1 INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -12291,21 +12291,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -12319,11 +12319,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -12399,21 +12399,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -12427,11 +12427,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -12624,7 +12624,7 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -12658,7 +12658,7 @@ affected rows: 1 INSERT INTO v3 VALUES(0, 'zero'); affected rows: 1 INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -12736,21 +12736,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -12764,11 +12764,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -12844,21 +12844,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -12872,11 +12872,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -13069,7 +13069,7 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -13103,7 +13103,7 @@ affected rows: 1 INSERT INTO v3 VALUES(0, 'zero'); affected rows: 1 INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -13181,21 +13181,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -13209,11 +13209,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -13289,21 +13289,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -13317,11 +13317,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -13517,7 +13517,7 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -13551,7 +13551,7 @@ affected rows: 1 INSERT INTO v3 VALUES(0, 'zero'); affected rows: 1 INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -13629,21 +13629,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -13657,11 +13657,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -13737,21 +13737,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -13765,11 +13765,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -13962,7 +13962,7 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -13996,7 +13996,7 @@ affected rows: 1 INSERT INTO v3 VALUES(0, 'zero'); affected rows: 1 INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -14074,21 +14074,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -14102,11 +14102,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -14182,21 +14182,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -14210,11 +14210,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -14407,7 +14407,7 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -14441,7 +14441,7 @@ affected rows: 1 INSERT INTO v3 VALUES(0, 'zero'); affected rows: 1 INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -14519,21 +14519,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -14547,11 +14547,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -14627,21 +14627,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -14655,11 +14655,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -14852,7 +14852,7 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -14886,7 +14886,7 @@ affected rows: 1 INSERT INTO v3 VALUES(0, 'zero'); affected rows: 1 INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -14964,21 +14964,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -14992,11 +14992,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -15072,21 +15072,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -15100,11 +15100,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; diff --git a/mysql-test/suite/funcs_1/r/myisam_func_view.result b/mysql-test/suite/funcs_1/r/myisam_func_view.result index df57c83164e..c78cf163ada 100644 --- a/mysql-test/suite/funcs_1/r/myisam_func_view.result +++ b/mysql-test/suite/funcs_1/r/myisam_func_view.result @@ -917,8 +917,8 @@ AaBbCcDdEeFfGgHhIiJjÄäÜüÖö 1.7976931348623e308 3 0 4 -1 5 Warnings: -Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e308' -Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e308' +Warning 1916 Got overflow when converting '-1.7976931348623e308' to INT. Value truncated. +Warning 1916 Got overflow when converting '1.7976931348623e308' to INT. Value truncated. SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select left('AaBbCcDdEeFfGgHhIiJjÄäÜüÖö',`t1_values`.`my_double`) AS `LEFT('AaBbCcDdEeFfGgHhIiJjÄäÜüÖö', my_double)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci @@ -932,8 +932,8 @@ AaBbCcDdEeFfGgHhIiJjÄäÜüÖö 1.7976931348623e308 3 0 4 -1 5 Warnings: -Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e308' -Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e308' +Warning 1916 Got overflow when converting '-1.7976931348623e308' to INT. Value truncated. +Warning 1916 Got overflow when converting '1.7976931348623e308' to INT. Value truncated. DROP VIEW v1; @@ -2587,9 +2587,9 @@ NULL NULL 1 0 0 4 18446744073709551615 -1 5 Warnings: -Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e308' +Warning 1916 Got overflow when converting '-1.7976931348623e308' to INT. Value truncated. Note 1105 Cast to unsigned converted negative integer to it's positive complement -Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e308' +Warning 1916 Got overflow when converting '1.7976931348623e308' to INT. Value truncated. Note 1105 Cast to unsigned converted negative integer to it's positive complement SHOW CREATE VIEW v1; View Create View character_set_client collation_connection @@ -2604,9 +2604,9 @@ NULL NULL 1 0 0 4 18446744073709551615 -1 5 Warnings: -Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e308' +Warning 1916 Got overflow when converting '-1.7976931348623e308' to INT. Value truncated. Note 1105 Cast to unsigned converted negative integer to it's positive complement -Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e308' +Warning 1916 Got overflow when converting '1.7976931348623e308' to INT. Value truncated. Note 1105 Cast to unsigned converted negative integer to it's positive complement DROP VIEW v1; @@ -2965,8 +2965,8 @@ NULL NULL 1 0 0 4 -1 -1 5 Warnings: -Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e308' -Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e308' +Warning 1916 Got overflow when converting '-1.7976931348623e308' to INT. Value truncated. +Warning 1916 Got overflow when converting '1.7976931348623e308' to INT. Value truncated. SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as signed) AS `CAST(my_double AS SIGNED INTEGER)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci @@ -2980,8 +2980,8 @@ NULL NULL 1 0 0 4 -1 -1 5 Warnings: -Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e308' -Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e308' +Warning 1916 Got overflow when converting '-1.7976931348623e308' to INT. Value truncated. +Warning 1916 Got overflow when converting '1.7976931348623e308' to INT. Value truncated. DROP VIEW v1; diff --git a/mysql-test/suite/funcs_1/r/myisam_views-big.result b/mysql-test/suite/funcs_1/r/myisam_views-big.result index 49f3c8fb133..0fbbfab9c1f 100644 --- a/mysql-test/suite/funcs_1/r/myisam_views-big.result +++ b/mysql-test/suite/funcs_1/r/myisam_views-big.result @@ -4006,7 +4006,7 @@ Select @x; 0 CREATE or REPLACE VIEW v1 AS Select 1 FROM (SELECT 1 FROM t1) my_table; -ERROR HY000: View's SELECT contains a subquery in the FROM clause +DROP VIEW v1; CREATE VIEW v1 AS SELECT f1 FROM t1; CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET @a:=1 ; SET @a:=0 ; @@ -8356,7 +8356,7 @@ Testcase 3.3.1.39 Drop view if exists test.v1 ; CREATE VIEW test.v1 AS Select f59 from (Select * FROM tb2 limit 20) tx ; -ERROR HY000: View's SELECT contains a subquery in the FROM clause +DROP VIEW test.v1; SELECT * FROM test.v1 order by f59 ; ERROR 42S02: Table 'test.v1' doesn't exist Drop view if exists test.v1 ; @@ -8870,7 +8870,7 @@ Drop view if exists test.v1 ; CREATE VIEW test.v1 AS SELECT f59,f60 FROM test.tb2 where f59 = 195 WITH CHECK OPTION ; UPDATE test.v1 SET f59 = 198 where f59=195 ; -ERROR HY000: CHECK OPTION failed 'test.v1' +ERROR 44000: CHECK OPTION failed `test`.`v1` SELECT * FROM test.v1 order by f59 ; f59 f60 195 87 @@ -8884,7 +8884,7 @@ CREATE VIEW test.v1 AS SELECT f59,f60 FROM test.tb2 where F59 = 0987 WITH LOCAL CHECK OPTION ; CREATE VIEW test.v2 as SELECT * FROM test.v1 ; UPDATE test.v1 SET F59 = 919 where f59 = 0987 ; -ERROR HY000: CHECK OPTION failed 'test.v1' +ERROR 44000: CHECK OPTION failed `test`.`v1` SELECT * FROM test.v1 order by f59 ; f59 f60 987 41 @@ -8919,9 +8919,9 @@ f1 f2 A 2 B 2 UPDATE v1 SET f2 = 4; -ERROR HY000: CHECK OPTION failed 'test.v1' +ERROR 44000: CHECK OPTION failed `test`.`v1` INSERT INTO v1 VALUES('B',3); -ERROR HY000: CHECK OPTION failed 'test.v1' +ERROR 44000: CHECK OPTION failed `test`.`v1` SELECT * FROM v1 order by f1, f2; f1 f2 A 2 @@ -9035,7 +9035,7 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -9069,7 +9069,7 @@ affected rows: 1 INSERT INTO v3 VALUES(0, 'zero'); affected rows: 1 INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -9147,21 +9147,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -9175,11 +9175,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -9255,21 +9255,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -9283,11 +9283,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -9480,7 +9480,7 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -9514,7 +9514,7 @@ affected rows: 1 INSERT INTO v3 VALUES(0, 'zero'); affected rows: 1 INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -9592,21 +9592,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -9620,11 +9620,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -9700,21 +9700,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -9728,11 +9728,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -9925,7 +9925,7 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -9959,7 +9959,7 @@ affected rows: 1 INSERT INTO v3 VALUES(0, 'zero'); affected rows: 1 INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -10037,21 +10037,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -10065,11 +10065,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -10145,21 +10145,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -10173,11 +10173,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -10370,7 +10370,7 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -10404,7 +10404,7 @@ affected rows: 1 INSERT INTO v3 VALUES(0, 'zero'); affected rows: 1 INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -10482,21 +10482,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -10510,11 +10510,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -10590,21 +10590,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -10618,11 +10618,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -10818,7 +10818,7 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -10852,7 +10852,7 @@ affected rows: 1 INSERT INTO v3 VALUES(0, 'zero'); affected rows: 1 INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -10930,21 +10930,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -10958,11 +10958,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -11038,21 +11038,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -11066,11 +11066,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -11263,7 +11263,7 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -11297,7 +11297,7 @@ affected rows: 1 INSERT INTO v3 VALUES(0, 'zero'); affected rows: 1 INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -11375,21 +11375,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -11403,11 +11403,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -11483,21 +11483,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -11511,11 +11511,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -11708,7 +11708,7 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -11742,7 +11742,7 @@ affected rows: 1 INSERT INTO v3 VALUES(0, 'zero'); affected rows: 1 INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -11820,21 +11820,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -11848,11 +11848,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -11928,21 +11928,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -11956,11 +11956,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -12153,7 +12153,7 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -12187,7 +12187,7 @@ affected rows: 1 INSERT INTO v3 VALUES(0, 'zero'); affected rows: 1 INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -12265,21 +12265,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -12293,11 +12293,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -12373,21 +12373,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -12401,11 +12401,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -12601,7 +12601,7 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -12635,7 +12635,7 @@ affected rows: 1 INSERT INTO v3 VALUES(0, 'zero'); affected rows: 1 INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -12713,21 +12713,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -12741,11 +12741,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -12821,21 +12821,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -12849,11 +12849,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -13046,7 +13046,7 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -13080,7 +13080,7 @@ affected rows: 1 INSERT INTO v3 VALUES(0, 'zero'); affected rows: 1 INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -13158,21 +13158,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -13186,11 +13186,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -13266,21 +13266,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -13294,11 +13294,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -13491,7 +13491,7 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -13525,7 +13525,7 @@ affected rows: 1 INSERT INTO v3 VALUES(0, 'zero'); affected rows: 1 INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -13603,21 +13603,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -13631,11 +13631,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -13711,21 +13711,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -13739,11 +13739,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -13936,7 +13936,7 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -13970,7 +13970,7 @@ affected rows: 1 INSERT INTO v3 VALUES(0, 'zero'); affected rows: 1 INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -14048,21 +14048,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -14076,11 +14076,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -14156,21 +14156,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -14184,11 +14184,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -14384,7 +14384,7 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -14418,7 +14418,7 @@ affected rows: 1 INSERT INTO v3 VALUES(0, 'zero'); affected rows: 1 INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -14496,21 +14496,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -14524,11 +14524,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -14604,21 +14604,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -14632,11 +14632,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -14829,7 +14829,7 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -14863,7 +14863,7 @@ affected rows: 1 INSERT INTO v3 VALUES(0, 'zero'); affected rows: 1 INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -14941,21 +14941,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -14969,11 +14969,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -15049,21 +15049,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -15077,11 +15077,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -15274,7 +15274,7 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -15308,7 +15308,7 @@ affected rows: 1 INSERT INTO v3 VALUES(0, 'zero'); affected rows: 1 INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -15386,21 +15386,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -15414,11 +15414,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -15494,21 +15494,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -15522,11 +15522,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -15719,7 +15719,7 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -15753,7 +15753,7 @@ affected rows: 1 INSERT INTO v3 VALUES(0, 'zero'); affected rows: 1 INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -15831,21 +15831,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -15859,11 +15859,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; @@ -15939,21 +15939,21 @@ f1 f2 DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight DELETE FROM t1; INSERT INTO t1 VALUES(8, 'eight'); UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8; -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` SELECT * FROM t1; f1 f2 8 eight @@ -15967,11 +15967,11 @@ f1 f2 10 eight DELETE FROM t1; INSERT INTO v3 VALUES(16, 'sixteen'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(0, 'zero'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(7, 'seven'); -ERROR HY000: CHECK OPTION failed 'test.v3' +ERROR 44000: CHECK OPTION failed `test`.`v3` INSERT INTO v3 VALUES(8, 'eight'); affected rows: 1 SELECT * FROM t1; diff --git a/mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result b/mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result index b937f94d0f3..6680e045558 100644 --- a/mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result +++ b/mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result @@ -24,23 +24,23 @@ connection default; SHOW CREATE TABLE processlist; Table Create Table PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` ( - `ID` bigint(4) NOT NULL DEFAULT '0', + `ID` bigint(4) NOT NULL DEFAULT 0, `USER` varchar(128) NOT NULL DEFAULT '', `HOST` varchar(64) NOT NULL DEFAULT '', `DB` varchar(64) DEFAULT NULL, `COMMAND` varchar(16) NOT NULL DEFAULT '', - `TIME` int(7) NOT NULL DEFAULT '0', + `TIME` int(7) NOT NULL DEFAULT 0, `STATE` varchar(64) DEFAULT NULL, - `INFO` longtext, - `TIME_MS` decimal(22,3) NOT NULL DEFAULT '0.000', - `STAGE` tinyint(2) NOT NULL DEFAULT '0', - `MAX_STAGE` tinyint(2) NOT NULL DEFAULT '0', - `PROGRESS` decimal(7,3) NOT NULL DEFAULT '0.000', - `MEMORY_USED` int(7) NOT NULL DEFAULT '0', - `EXAMINED_ROWS` int(7) NOT NULL DEFAULT '0', - `QUERY_ID` bigint(4) NOT NULL DEFAULT '0', - `INFO_BINARY` blob, - `TID` bigint(4) NOT NULL DEFAULT '0' + `INFO` longtext DEFAULT NULL, + `TIME_MS` decimal(22,3) NOT NULL DEFAULT 0.000, + `STAGE` tinyint(2) NOT NULL DEFAULT 0, + `MAX_STAGE` tinyint(2) NOT NULL DEFAULT 0, + `PROGRESS` decimal(7,3) NOT NULL DEFAULT 0.000, + `MEMORY_USED` bigint(7) NOT NULL DEFAULT 0, + `EXAMINED_ROWS` int(7) NOT NULL DEFAULT 0, + `QUERY_ID` bigint(4) NOT NULL DEFAULT 0, + `INFO_BINARY` blob DEFAULT NULL, + `TID` bigint(4) NOT NULL DEFAULT 0 ) DEFAULT CHARSET=utf8 SHOW processlist; Id User Host db Command Time State Info Progress @@ -60,7 +60,7 @@ INSERT INTO processlist SELECT * FROM test.t_processlist; ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' DROP TABLE test.t_processlist; CREATE VIEW test.v_processlist (ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY) AS SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY FROM processlist WITH CHECK OPTION; -ERROR HY000: CHECK OPTION on non-updatable view 'test.v_processlist' +ERROR HY000: CHECK OPTION on non-updatable view `test`.`v_processlist` CREATE VIEW test.v_processlist (ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY) AS SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY FROM processlist; DROP VIEW test.v_processlist; UPDATE processlist SET user='any_user' WHERE id=1 ; @@ -103,23 +103,23 @@ SHOW/SELECT shows only the processes (1) of the user. SHOW CREATE TABLE processlist; Table Create Table PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` ( - `ID` bigint(4) NOT NULL DEFAULT '0', + `ID` bigint(4) NOT NULL DEFAULT 0, `USER` varchar(128) NOT NULL DEFAULT '', `HOST` varchar(64) NOT NULL DEFAULT '', `DB` varchar(64) DEFAULT NULL, `COMMAND` varchar(16) NOT NULL DEFAULT '', - `TIME` int(7) NOT NULL DEFAULT '0', + `TIME` int(7) NOT NULL DEFAULT 0, `STATE` varchar(64) DEFAULT NULL, - `INFO` longtext, - `TIME_MS` decimal(22,3) NOT NULL DEFAULT '0.000', - `STAGE` tinyint(2) NOT NULL DEFAULT '0', - `MAX_STAGE` tinyint(2) NOT NULL DEFAULT '0', - `PROGRESS` decimal(7,3) NOT NULL DEFAULT '0.000', - `MEMORY_USED` int(7) NOT NULL DEFAULT '0', - `EXAMINED_ROWS` int(7) NOT NULL DEFAULT '0', - `QUERY_ID` bigint(4) NOT NULL DEFAULT '0', - `INFO_BINARY` blob, - `TID` bigint(4) NOT NULL DEFAULT '0' + `INFO` longtext DEFAULT NULL, + `TIME_MS` decimal(22,3) NOT NULL DEFAULT 0.000, + `STAGE` tinyint(2) NOT NULL DEFAULT 0, + `MAX_STAGE` tinyint(2) NOT NULL DEFAULT 0, + `PROGRESS` decimal(7,3) NOT NULL DEFAULT 0.000, + `MEMORY_USED` bigint(7) NOT NULL DEFAULT 0, + `EXAMINED_ROWS` int(7) NOT NULL DEFAULT 0, + `QUERY_ID` bigint(4) NOT NULL DEFAULT 0, + `INFO_BINARY` blob DEFAULT NULL, + `TID` bigint(4) NOT NULL DEFAULT 0 ) DEFAULT CHARSET=utf8 SHOW processlist; Id User Host db Command Time State Info Progress @@ -136,7 +136,7 @@ INSERT INTO processlist SELECT * FROM test.t_processlist; ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema' DROP TABLE test.t_processlist; CREATE VIEW test.v_processlist (ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY) AS SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY FROM processlist WITH CHECK OPTION; -ERROR HY000: CHECK OPTION on non-updatable view 'test.v_processlist' +ERROR HY000: CHECK OPTION on non-updatable view `test`.`v_processlist` CREATE VIEW test.v_processlist (ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY) AS SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY FROM processlist; DROP VIEW test.v_processlist; UPDATE processlist SET user='any_user' WHERE id=1 ; diff --git a/mysql-test/suite/funcs_1/r/processlist_priv_ps.result b/mysql-test/suite/funcs_1/r/processlist_priv_ps.result index e312b1c60ef..09f9d231144 100644 --- a/mysql-test/suite/funcs_1/r/processlist_priv_ps.result +++ b/mysql-test/suite/funcs_1/r/processlist_priv_ps.result @@ -24,23 +24,23 @@ connection default; SHOW CREATE TABLE processlist; Table Create Table PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` ( - `ID` bigint(4) NOT NULL DEFAULT '0', + `ID` bigint(4) NOT NULL DEFAULT 0, `USER` varchar(128) NOT NULL DEFAULT '', `HOST` varchar(64) NOT NULL DEFAULT '', `DB` varchar(64) DEFAULT NULL, `COMMAND` varchar(16) NOT NULL DEFAULT '', - `TIME` int(7) NOT NULL DEFAULT '0', + `TIME` int(7) NOT NULL DEFAULT 0, `STATE` varchar(64) DEFAULT NULL, - `INFO` longtext, - `TIME_MS` decimal(22,3) NOT NULL DEFAULT '0.000', - `STAGE` tinyint(2) NOT NULL DEFAULT '0', - `MAX_STAGE` tinyint(2) NOT NULL DEFAULT '0', - `PROGRESS` decimal(7,3) NOT NULL DEFAULT '0.000', - `MEMORY_USED` int(7) NOT NULL DEFAULT '0', - `EXAMINED_ROWS` int(7) NOT NULL DEFAULT '0', - `QUERY_ID` bigint(4) NOT NULL DEFAULT '0', - `INFO_BINARY` blob, - `TID` bigint(4) NOT NULL DEFAULT '0' + `INFO` longtext DEFAULT NULL, + `TIME_MS` decimal(22,3) NOT NULL DEFAULT 0.000, + `STAGE` tinyint(2) NOT NULL DEFAULT 0, + `MAX_STAGE` tinyint(2) NOT NULL DEFAULT 0, + `PROGRESS` decimal(7,3) NOT NULL DEFAULT 0.000, + `MEMORY_USED` bigint(7) NOT NULL DEFAULT 0, + `EXAMINED_ROWS` int(7) NOT NULL DEFAULT 0, + `QUERY_ID` bigint(4) NOT NULL DEFAULT 0, + `INFO_BINARY` blob DEFAULT NULL, + `TID` bigint(4) NOT NULL DEFAULT 0 ) DEFAULT CHARSET=utf8 SHOW processlist; Id User Host db Command Time State Info Progress @@ -60,7 +60,7 @@ INSERT INTO processlist SELECT * FROM test.t_processlist; ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' DROP TABLE test.t_processlist; CREATE VIEW test.v_processlist (ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY) AS SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY FROM processlist WITH CHECK OPTION; -ERROR HY000: CHECK OPTION on non-updatable view 'test.v_processlist' +ERROR HY000: CHECK OPTION on non-updatable view `test`.`v_processlist` CREATE VIEW test.v_processlist (ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY) AS SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY FROM processlist; DROP VIEW test.v_processlist; UPDATE processlist SET user='any_user' WHERE id=1 ; @@ -103,23 +103,23 @@ SHOW/SELECT shows only the processes (1) of the user. SHOW CREATE TABLE processlist; Table Create Table PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` ( - `ID` bigint(4) NOT NULL DEFAULT '0', + `ID` bigint(4) NOT NULL DEFAULT 0, `USER` varchar(128) NOT NULL DEFAULT '', `HOST` varchar(64) NOT NULL DEFAULT '', `DB` varchar(64) DEFAULT NULL, `COMMAND` varchar(16) NOT NULL DEFAULT '', - `TIME` int(7) NOT NULL DEFAULT '0', + `TIME` int(7) NOT NULL DEFAULT 0, `STATE` varchar(64) DEFAULT NULL, - `INFO` longtext, - `TIME_MS` decimal(22,3) NOT NULL DEFAULT '0.000', - `STAGE` tinyint(2) NOT NULL DEFAULT '0', - `MAX_STAGE` tinyint(2) NOT NULL DEFAULT '0', - `PROGRESS` decimal(7,3) NOT NULL DEFAULT '0.000', - `MEMORY_USED` int(7) NOT NULL DEFAULT '0', - `EXAMINED_ROWS` int(7) NOT NULL DEFAULT '0', - `QUERY_ID` bigint(4) NOT NULL DEFAULT '0', - `INFO_BINARY` blob, - `TID` bigint(4) NOT NULL DEFAULT '0' + `INFO` longtext DEFAULT NULL, + `TIME_MS` decimal(22,3) NOT NULL DEFAULT 0.000, + `STAGE` tinyint(2) NOT NULL DEFAULT 0, + `MAX_STAGE` tinyint(2) NOT NULL DEFAULT 0, + `PROGRESS` decimal(7,3) NOT NULL DEFAULT 0.000, + `MEMORY_USED` bigint(7) NOT NULL DEFAULT 0, + `EXAMINED_ROWS` int(7) NOT NULL DEFAULT 0, + `QUERY_ID` bigint(4) NOT NULL DEFAULT 0, + `INFO_BINARY` blob DEFAULT NULL, + `TID` bigint(4) NOT NULL DEFAULT 0 ) DEFAULT CHARSET=utf8 SHOW processlist; Id User Host db Command Time State Info Progress @@ -136,7 +136,7 @@ INSERT INTO processlist SELECT * FROM test.t_processlist; ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema' DROP TABLE test.t_processlist; CREATE VIEW test.v_processlist (ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY) AS SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY FROM processlist WITH CHECK OPTION; -ERROR HY000: CHECK OPTION on non-updatable view 'test.v_processlist' +ERROR HY000: CHECK OPTION on non-updatable view `test`.`v_processlist` CREATE VIEW test.v_processlist (ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY) AS SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY FROM processlist; DROP VIEW test.v_processlist; UPDATE processlist SET user='any_user' WHERE id=1 ; diff --git a/mysql-test/suite/funcs_1/r/processlist_val_no_prot.result b/mysql-test/suite/funcs_1/r/processlist_val_no_prot.result index 170ba0c2efb..f935f7770b8 100644 --- a/mysql-test/suite/funcs_1/r/processlist_val_no_prot.result +++ b/mysql-test/suite/funcs_1/r/processlist_val_no_prot.result @@ -12,23 +12,23 @@ USE test; SHOW CREATE TABLE INFORMATION_SCHEMA.PROCESSLIST; Table Create Table PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` ( - `ID` bigint(4) NOT NULL DEFAULT '0', + `ID` bigint(4) NOT NULL DEFAULT 0, `USER` varchar(128) NOT NULL DEFAULT '', `HOST` varchar(64) NOT NULL DEFAULT '', `DB` varchar(64) DEFAULT NULL, `COMMAND` varchar(16) NOT NULL DEFAULT '', - `TIME` int(7) NOT NULL DEFAULT '0', + `TIME` int(7) NOT NULL DEFAULT 0, `STATE` varchar(64) DEFAULT NULL, - `INFO` longtext, - `TIME_MS` decimal(22,3) NOT NULL DEFAULT '0.000', - `STAGE` tinyint(2) NOT NULL DEFAULT '0', - `MAX_STAGE` tinyint(2) NOT NULL DEFAULT '0', - `PROGRESS` decimal(7,3) NOT NULL DEFAULT '0.000', - `MEMORY_USED` int(7) NOT NULL DEFAULT '0', - `EXAMINED_ROWS` int(7) NOT NULL DEFAULT '0', - `QUERY_ID` bigint(4) NOT NULL DEFAULT '0', - `INFO_BINARY` blob, - `TID` bigint(4) NOT NULL DEFAULT '0' + `INFO` longtext DEFAULT NULL, + `TIME_MS` decimal(22,3) NOT NULL DEFAULT 0.000, + `STAGE` tinyint(2) NOT NULL DEFAULT 0, + `MAX_STAGE` tinyint(2) NOT NULL DEFAULT 0, + `PROGRESS` decimal(7,3) NOT NULL DEFAULT 0.000, + `MEMORY_USED` bigint(7) NOT NULL DEFAULT 0, + `EXAMINED_ROWS` int(7) NOT NULL DEFAULT 0, + `QUERY_ID` bigint(4) NOT NULL DEFAULT 0, + `INFO_BINARY` blob DEFAULT NULL, + `TID` bigint(4) NOT NULL DEFAULT 0 ) DEFAULT CHARSET=utf8 # Ensure that the information about the own connection is correct. #-------------------------------------------------------------------------- diff --git a/mysql-test/suite/funcs_1/r/processlist_val_ps.result b/mysql-test/suite/funcs_1/r/processlist_val_ps.result index 5914c8e7844..48fcc0a5553 100644 --- a/mysql-test/suite/funcs_1/r/processlist_val_ps.result +++ b/mysql-test/suite/funcs_1/r/processlist_val_ps.result @@ -12,23 +12,23 @@ USE test; SHOW CREATE TABLE INFORMATION_SCHEMA.PROCESSLIST; Table Create Table PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` ( - `ID` bigint(4) NOT NULL DEFAULT '0', + `ID` bigint(4) NOT NULL DEFAULT 0, `USER` varchar(128) NOT NULL DEFAULT '', `HOST` varchar(64) NOT NULL DEFAULT '', `DB` varchar(64) DEFAULT NULL, `COMMAND` varchar(16) NOT NULL DEFAULT '', - `TIME` int(7) NOT NULL DEFAULT '0', + `TIME` int(7) NOT NULL DEFAULT 0, `STATE` varchar(64) DEFAULT NULL, - `INFO` longtext, - `TIME_MS` decimal(22,3) NOT NULL DEFAULT '0.000', - `STAGE` tinyint(2) NOT NULL DEFAULT '0', - `MAX_STAGE` tinyint(2) NOT NULL DEFAULT '0', - `PROGRESS` decimal(7,3) NOT NULL DEFAULT '0.000', - `MEMORY_USED` int(7) NOT NULL DEFAULT '0', - `EXAMINED_ROWS` int(7) NOT NULL DEFAULT '0', - `QUERY_ID` bigint(4) NOT NULL DEFAULT '0', - `INFO_BINARY` blob, - `TID` bigint(4) NOT NULL DEFAULT '0' + `INFO` longtext DEFAULT NULL, + `TIME_MS` decimal(22,3) NOT NULL DEFAULT 0.000, + `STAGE` tinyint(2) NOT NULL DEFAULT 0, + `MAX_STAGE` tinyint(2) NOT NULL DEFAULT 0, + `PROGRESS` decimal(7,3) NOT NULL DEFAULT 0.000, + `MEMORY_USED` bigint(7) NOT NULL DEFAULT 0, + `EXAMINED_ROWS` int(7) NOT NULL DEFAULT 0, + `QUERY_ID` bigint(4) NOT NULL DEFAULT 0, + `INFO_BINARY` blob DEFAULT NULL, + `TID` bigint(4) NOT NULL DEFAULT 0 ) DEFAULT CHARSET=utf8 # Ensure that the information about the own connection is correct. #-------------------------------------------------------------------------- diff --git a/mysql-test/suite/funcs_1/r/storedproc.result b/mysql-test/suite/funcs_1/r/storedproc.result index b995fa730c0..47abc84ec57 100644 --- a/mysql-test/suite/funcs_1/r/storedproc.result +++ b/mysql-test/suite/funcs_1/r/storedproc.result @@ -1543,13 +1543,13 @@ SHOW FUNCTION STATUS LIKE 'fn1'; Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation db_storedproc fn1 FUNCTION root@localhost INVOKER this is simple latin1 latin1_swedish_ci latin1_swedish_ci DROP FUNCTION IF EXISTS fn1; -CREATE FUNCTION fn1( f1 DECIMAL(63, 31) ) RETURNS DECIMAL(63, 31) +CREATE FUNCTION fn1( f1 DECIMAL(63, 61) ) RETURNS DECIMAL(63, 61) LANGUAGE SQL NOT DETERMINISTIC SQL SECURITY INVOKER COMMENT 'this is simple' BEGIN SET f1 = 1000000 + f1; RETURN f1; END// -ERROR 42000: Too big scale 31 specified for 'f1'. Maximum is 30. +ERROR 42000: Too big scale 61 specified for 'f1'. Maximum is 38. SELECT fn1( 1.3326e+8 ); ERROR 42000: FUNCTION db_storedproc.fn1 does not exist CREATE FUNCTION fn1( f1 DECIMAL(63, 30) ) RETURNS DECIMAL(63, 30) @@ -5839,7 +5839,7 @@ fetch cur1 into e; SELECT x, y, z, a, b, c, d, e; close cur1; END// -ERROR 42000: Too big scale 255 specified for 'b'. Maximum is 30. +ERROR 42000: Too big scale 255 specified for 'b'. Maximum is 38. CALL sp6(); ERROR 42000: PROCEDURE db_storedproc.sp6 does not exist DROP PROCEDURE IF EXISTS sp6; diff --git a/mysql-test/suite/funcs_1/t/storedproc.test b/mysql-test/suite/funcs_1/t/storedproc.test index ca9dfcbbe2d..98385d42b22 100644 --- a/mysql-test/suite/funcs_1/t/storedproc.test +++ b/mysql-test/suite/funcs_1/t/storedproc.test @@ -417,9 +417,9 @@ DROP FUNCTION IF EXISTS fn1; --enable_warnings delimiter //; -# 1425: Too big scale 63 specified for column ''. Maximum is 30. +# 1425: Too big scale 63 specified for column ''. Maximum is 39. --error ER_TOO_BIG_SCALE -CREATE FUNCTION fn1( f1 DECIMAL(63, 31) ) RETURNS DECIMAL(63, 31) +CREATE FUNCTION fn1( f1 DECIMAL(63, 61) ) RETURNS DECIMAL(63, 61) LANGUAGE SQL NOT DETERMINISTIC SQL SECURITY INVOKER COMMENT 'this is simple' BEGIN SET f1 = 1000000 + f1; diff --git a/mysql-test/suite/funcs_1/views/views_master.inc b/mysql-test/suite/funcs_1/views/views_master.inc index f55788de6c6..54e7f2af54b 100644 --- a/mysql-test/suite/funcs_1/views/views_master.inc +++ b/mysql-test/suite/funcs_1/views/views_master.inc @@ -271,9 +271,9 @@ CREATE or REPLACE VIEW v1 AS Select 1 INTO @x; Select @x; # Subquery in the FROM clause is illegal ---error ER_VIEW_SELECT_DERIVED CREATE or REPLACE VIEW v1 AS Select 1 FROM (SELECT 1 FROM t1) my_table; +DROP VIEW v1; # Triggers cannot be associated with VIEWs CREATE VIEW v1 AS SELECT f1 FROM t1; @@ -1557,9 +1557,9 @@ let $message= Testcase 3.3.1.39 ; --disable_warnings Drop view if exists test.v1 ; --enable_warnings ---error ER_VIEW_SELECT_DERIVED CREATE VIEW test.v1 AS Select f59 from (Select * FROM tb2 limit 20) tx ; +DROP VIEW test.v1; --error ER_NO_SUCH_TABLE SELECT * FROM test.v1 order by f59 ; --disable_warnings diff --git a/mysql-test/suite/galera/galera_2nodes.cnf b/mysql-test/suite/galera/galera_2nodes.cnf index 1dbaad4f699..b8c61bc814d 100644 --- a/mysql-test/suite/galera/galera_2nodes.cnf +++ b/mysql-test/suite/galera/galera_2nodes.cnf @@ -9,7 +9,6 @@ default-storage-engine=innodb wsrep-provider=@ENV.WSREP_PROVIDER wsrep_node_address=127.0.0.1 # enforce read-committed characteristics across the cluster -wsrep-causal-reads=ON wsrep-sync-wait=7 [mysqld.1] diff --git a/mysql-test/suite/galera/r/MW-284.result b/mysql-test/suite/galera/r/MW-284.result new file mode 100644 index 00000000000..ad227390526 --- /dev/null +++ b/mysql-test/suite/galera/r/MW-284.result @@ -0,0 +1,22 @@ +connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3; +connection node_1; +CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; +SET GLOBAL wsrep_provider_options='gmcast.isolate=1'; +SET SESSION wsrep_on = OFF; +SET SESSION wsrep_on = ON; +connection node_3; +START SLAVE; +include/wait_for_slave_param.inc [Slave_IO_Running] +connection node_1; +SET GLOBAL wsrep_provider_options='gmcast.isolate=0'; +connection node_3; +include/wait_for_slave_to_start.inc +connection node_1; +INSERT INTO t1 VALUES (1); +connection node_3; +connection node_1; +DROP TABLE t1; +connection node_3; +STOP SLAVE; +RESET SLAVE ALL; +CALL mtr.add_suppression('failed registering on master'); diff --git a/mysql-test/suite/galera/r/create.result b/mysql-test/suite/galera/r/create.result index 20bc9a3958e..b93cd7b9496 100644 --- a/mysql-test/suite/galera/r/create.result +++ b/mysql-test/suite/galera/r/create.result @@ -62,4 +62,27 @@ t2 CREATE TABLE `t2` ( KEY `idx` (`i`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 DROP TABLE t1, t2; +# +# MDEV-9853: WSREP says it cannot get fake InnoDB transaction ID +# followed by segmentation fault +# +CREATE TABLE `t1`(`c1` INT) ENGINE=INNODB; +SET autocommit=0; +CREATE TABLE `t2` (`c1` INT) ENGINE=INNODB SELECT * FROM t1; +COMMIT; +SET autocommit=1; +DROP TABLE t1, t2; +# +# MDEV-10235: Deadlock in CREATE TABLE ... AS SELECT .. if result set +# is empty in Galera +# +CREATE TABLE t1(c1 INT) ENGINE=INNODB; +INSERT INTO t1 VALUES(1); +CREATE TABLE t2 AS SELECT * FROM t1 WHERE c1=2; +SELECT * FROM t1; +c1 +1 +SELECT * FROM t2; +c1 +DROP TABLE t1, t2; # End of tests diff --git a/mysql-test/suite/galera/r/galera_ftwrl_drain.result b/mysql-test/suite/galera/r/galera_ftwrl_drain.result index d704699925b..751811b88fd 100644 --- a/mysql-test/suite/galera/r/galera_ftwrl_drain.result +++ b/mysql-test/suite/galera/r/galera_ftwrl_drain.result @@ -1,25 +1,37 @@ +connection node_1; CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB; +connection node_2; SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync'; +connection node_1; INSERT INTO t1 VALUES (1); +connection node_2; SET SESSION wsrep_sync_wait = 0; SET SESSION wsrep_on = 0; SET SESSION wsrep_on = 1; SELECT COUNT(*) = 0 FROM t1; COUNT(*) = 0 1 +connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2; +connection node_2a; FLUSH TABLES WITH READ LOCK;; +connection node_2; SET GLOBAL wsrep_provider_options = 'dbug='; SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync'; +connection node_2a; +connection node_2; SET SESSION lock_wait_timeout = 1; SET SESSION innodb_lock_wait_timeout=1; SET SESSION wait_timeout=1; INSERT INTO t2 VALUES (2); ERROR HY000: Lock wait timeout exceeded; try restarting transaction +connection node_2a; UNLOCK TABLES; +connection node_2; SELECT COUNT(*) = 1 FROM t1; COUNT(*) = 1 1 INSERT INTO t1 VALUES (3); +connection node_1; SELECT COUNT(*) = 2 FROM t1; COUNT(*) = 2 1 diff --git a/mysql-test/suite/galera/r/galera_ist_restart_joiner.result b/mysql-test/suite/galera/r/galera_ist_restart_joiner.result index f7a1386e7f8..01544843d2d 100644 --- a/mysql-test/suite/galera/r/galera_ist_restart_joiner.result +++ b/mysql-test/suite/galera/r/galera_ist_restart_joiner.result @@ -1,22 +1,31 @@ CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1)); INSERT INTO t1 VALUES (1, 'a'), (2, 'a'), (3, 'a'), (4, 'a'), (5, 'a'),(6, 'a'); +connection node_2; Unloading wsrep provider ... SET GLOBAL wsrep_provider = 'none'; +connection node_1; UPDATE t1 SET f2 = 'b' WHERE f1 > 1; UPDATE t1 SET f2 = 'c' WHERE f1 > 2; +connection node_2; SET GLOBAL wsrep_provider_options = 'dbug=d,recv_IST_after_apply_trx'; SET SESSION wsrep_sync_wait = 0; Loading wsrep_provider ... SHOW STATUS LIKE 'wsrep_debug_sync_waiters'; Variable_name Value wsrep_debug_sync_waiters recv_IST_after_apply_trx +connection node_1; +connection node_1; UPDATE t1 SET f2 = 'd' WHERE f1 > 3; CREATE TABLE t2 (f1 INTEGER); +connection node_2; +connection node_1; UPDATE t1 SET f2 = 'e' WHERE f1 > 4; CREATE TABLE t3 (f1 INTEGER); +connection node_2; Performing --wsrep-recover ... Starting server ... Using --wsrep-start-position when starting mysqld ... +connection node_1; UPDATE t1 SET f2 = 'f' WHERE f1 > 5; SELECT * FROM t1; f1 f2 @@ -26,6 +35,7 @@ f1 f2 4 d 5 e 6 f +connection node_2; SELECT * FROM t1; f1 f2 1 a @@ -40,4 +50,5 @@ COUNT(*) = 0 SELECT COUNT(*) = 0 FROM t3; COUNT(*) = 0 1 +connection node_1; DROP TABLE t1, t2, t3; diff --git a/mysql-test/suite/galera/r/galera_transaction_replay.result b/mysql-test/suite/galera/r/galera_transaction_replay.result index bfafa506fe6..d2c9a6b357a 100644 --- a/mysql-test/suite/galera/r/galera_transaction_replay.result +++ b/mysql-test/suite/galera/r/galera_transaction_replay.result @@ -1,20 +1,28 @@ CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1)); INSERT INTO t1 VALUES (1, 'a'); INSERT INTO t1 VALUES (2, 'a'); +connection node_1; SET AUTOCOMMIT=ON; START TRANSACTION; UPDATE t1 SET f2 = 'b' WHERE f1 = 1; SELECT * FROM t1 WHERE f1 = 2 FOR UPDATE; f1 f2 2 a +connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; SET GLOBAL wsrep_provider_options = 'dbug=d,commit_monitor_enter_sync'; +connection node_1; COMMIT;; +connection node_1a; SET SESSION wsrep_sync_wait = 0; SET SESSION wsrep_on = 0; SET SESSION wsrep_on = 1; +connection node_2; UPDATE t1 SET f2 = 'c' WHERE f1 = 2; +connection node_1a; +connection node_1a; SET GLOBAL wsrep_provider_options = 'dbug='; SET GLOBAL wsrep_provider_options = 'signal=commit_monitor_enter_sync'; +connection node_1; SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'b'; COUNT(*) = 1 1 @@ -23,6 +31,7 @@ COUNT(*) = 1 1 wsrep_local_replays 1 +connection node_2; SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'b'; COUNT(*) = 1 1 diff --git a/mysql-test/suite/galera/r/galera_var_sst_auth.result b/mysql-test/suite/galera/r/galera_var_sst_auth.result new file mode 100644 index 00000000000..1db83197870 --- /dev/null +++ b/mysql-test/suite/galera/r/galera_var_sst_auth.result @@ -0,0 +1,12 @@ +# +# MDEV-10492: Assertion failure on shutdown when wsrep_sst_auth set in config +# +SELECT @@global.wsrep_sst_auth; +@@global.wsrep_sst_auth +******** +SET @@global.wsrep_sst_auth='foo:bar'; +SELECT @@global.wsrep_sst_auth; +@@global.wsrep_sst_auth +******** +disconnect node_2; +disconnect node_1; diff --git a/mysql-test/suite/galera/r/galera_var_sync_wait.result b/mysql-test/suite/galera/r/galera_var_sync_wait.result index 40a6290374f..7f3afa77ecd 100644 --- a/mysql-test/suite/galera/r/galera_var_sync_wait.result +++ b/mysql-test/suite/galera/r/galera_var_sync_wait.result @@ -1,3 +1,12 @@ +# +# MDEV-10161: wsrep_sync_wait not enabled when set to 1 in config file +# +SELECT @@global.wsrep_sync_wait; +@@global.wsrep_sync_wait +7 +SELECT @@global.wsrep_causal_reads; +@@global.wsrep_causal_reads +1 connection node_1; CREATE TABLE t1 (f1 INT PRIMARY KEY) Engine=InnoDB; connection node_2; diff --git a/mysql-test/suite/galera/t/MW-284.cnf b/mysql-test/suite/galera/t/MW-284.cnf new file mode 100644 index 00000000000..52fd3093931 --- /dev/null +++ b/mysql-test/suite/galera/t/MW-284.cnf @@ -0,0 +1 @@ +!include ../galera_2nodes_as_master.cnf diff --git a/mysql-test/suite/galera/t/MW-284.test b/mysql-test/suite/galera/t/MW-284.test new file mode 100644 index 00000000000..5998e22ed1e --- /dev/null +++ b/mysql-test/suite/galera/t/MW-284.test @@ -0,0 +1,57 @@ +# +# MW-284 Slave I/O retry on ER_COM_UNKNOWN_ERROR +# + +--source include/galera_cluster.inc +--source include/have_innodb.inc + +--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3 +--disable_query_log +--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$NODE_MYPORT_1, MASTER_USER='root', MASTER_CONNECT_RETRY=1; +--enable_query_log + +--connection node_1 +CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; +SET GLOBAL wsrep_provider_options='gmcast.isolate=1'; +SET SESSION wsrep_on = OFF; +--let $wait_condition = SELECT VARIABLE_VALUE = 'non-Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status' +--source include/wait_condition.inc +SET SESSION wsrep_on = ON; + +--connection node_3 +START SLAVE; +--sleep 1 +--let $slave_param= Slave_IO_Running +--let $slave_param_value= Connecting +--source include/wait_for_slave_param.inc + +--connection node_1 +SET GLOBAL wsrep_provider_options='gmcast.isolate=0'; + +# We expect the slave to reconnect and resume replication + +--connection node_3 +--source include/wait_for_slave_to_start.inc + +--connection node_1 +INSERT INTO t1 VALUES (1); + +--connection node_3 +--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1' +--source include/wait_condition.inc +--let $wait_condition = SELECT COUNT(*) > 0 FROM t1 +--source include/wait_condition.inc + +# Cleanup + +--connection node_1 +DROP TABLE t1; + +--connection node_3 +--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1' +--source include/wait_condition.inc + +STOP SLAVE; +RESET SLAVE ALL; + +CALL mtr.add_suppression('failed registering on master'); diff --git a/mysql-test/suite/galera/t/create.test b/mysql-test/suite/galera/t/create.test index fb9b0935288..96a6640c21f 100644 --- a/mysql-test/suite/galera/t/create.test +++ b/mysql-test/suite/galera/t/create.test @@ -54,5 +54,36 @@ SHOW CREATE TABLE t2; # Cleanup DROP TABLE t1, t2; +--echo # +--echo # MDEV-9853: WSREP says it cannot get fake InnoDB transaction ID +--echo # followed by segmentation fault +--echo # +CREATE TABLE `t1`(`c1` INT) ENGINE=INNODB; + +SET autocommit=0; +CREATE TABLE `t2` (`c1` INT) ENGINE=INNODB SELECT * FROM t1; +COMMIT; +SET autocommit=1; + +# Cleanup +DROP TABLE t1, t2; + + +--echo # +--echo # MDEV-10235: Deadlock in CREATE TABLE ... AS SELECT .. if result set +--echo # is empty in Galera +--echo # +--connection node_1 +CREATE TABLE t1(c1 INT) ENGINE=INNODB; +INSERT INTO t1 VALUES(1); +CREATE TABLE t2 AS SELECT * FROM t1 WHERE c1=2; + +--connection node_2 +SELECT * FROM t1; +SELECT * FROM t2; +# Cleanup +DROP TABLE t1, t2; + +--source include/galera_end.inc --echo # End of tests diff --git a/mysql-test/suite/galera/t/galera_transaction_replay.test b/mysql-test/suite/galera/t/galera_transaction_replay.test index bd5288a51c6..f99c0b1979f 100644 --- a/mysql-test/suite/galera/t/galera_transaction_replay.test +++ b/mysql-test/suite/galera/t/galera_transaction_replay.test @@ -40,7 +40,7 @@ UPDATE t1 SET f2 = 'c' WHERE f1 = 2; # Wait for both transactions to be blocked --connection node_1a ---let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'System lock'; +--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE 'Update_rows_log_event::find_row%'; --source include/wait_condition.inc --let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'init' AND INFO = 'COMMIT'; diff --git a/mysql-test/suite/galera/t/galera_var_sst_auth.opt b/mysql-test/suite/galera/t/galera_var_sst_auth.opt new file mode 100644 index 00000000000..67babbb1ae7 --- /dev/null +++ b/mysql-test/suite/galera/t/galera_var_sst_auth.opt @@ -0,0 +1 @@ +--wsrep_sst_auth=root: diff --git a/mysql-test/suite/galera/t/galera_var_sst_auth.test b/mysql-test/suite/galera/t/galera_var_sst_auth.test new file mode 100644 index 00000000000..5c9b3f5a61e --- /dev/null +++ b/mysql-test/suite/galera/t/galera_var_sst_auth.test @@ -0,0 +1,12 @@ +--source include/galera_cluster.inc +--source include/have_innodb.inc + +--echo # +--echo # MDEV-10492: Assertion failure on shutdown when wsrep_sst_auth set in config +--echo # + +SELECT @@global.wsrep_sst_auth; +SET @@global.wsrep_sst_auth='foo:bar'; +SELECT @@global.wsrep_sst_auth; + +--source include/galera_end.inc diff --git a/mysql-test/suite/galera/t/galera_var_sync_wait.test b/mysql-test/suite/galera/t/galera_var_sync_wait.test index 935c271a4d6..288ad62226f 100644 --- a/mysql-test/suite/galera/t/galera_var_sync_wait.test +++ b/mysql-test/suite/galera/t/galera_var_sync_wait.test @@ -5,6 +5,13 @@ --source include/galera_cluster.inc --source include/have_innodb.inc +--echo # +--echo # MDEV-10161: wsrep_sync_wait not enabled when set to 1 in config file +--echo # +# galera_2nodes.cnf sets wsrep_sync_wait to 7 +SELECT @@global.wsrep_sync_wait; +SELECT @@global.wsrep_causal_reads; + --let $wsrep_sync_wait_orig = `SELECT @@wsrep_sync_wait` --connection node_1 diff --git a/mysql-test/suite/galera/t/mysql-wsrep#237.test b/mysql-test/suite/galera/t/mysql-wsrep#237.test index f2dd6bce711..cba8dfeb275 100644 --- a/mysql-test/suite/galera/t/mysql-wsrep#237.test +++ b/mysql-test/suite/galera/t/mysql-wsrep#237.test @@ -28,6 +28,7 @@ SET DEBUG_SYNC= 'now SIGNAL continue'; --connection node_1 --reap +# Cleanup DROP TABLE t; --connection node_1a SET DEBUG_SYNC= 'RESET'; diff --git a/mysql-test/suite/handler/aria.result b/mysql-test/suite/handler/aria.result index 43720eaa4bb..b8ed1fd98c8 100644 --- a/mysql-test/suite/handler/aria.result +++ b/mysql-test/suite/handler/aria.result @@ -632,7 +632,18 @@ handler a1 read a next; a b 3 d select a,b from t1; -ERROR HY000: Can't reopen table: 'a1' +a b +0 a +1 b +2 c +3 d +4 e +5 f +6 g +7 h +8 i +9 j +9 k handler a1 read a prev; a b 2 c @@ -745,7 +756,7 @@ ERROR HY000: Can't execute the given command because you have active locked tabl handler t2 close; ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction handler t3 open; -ERROR HY000: Can't reopen table: 't3' +ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction # After UNLOCK TABLES handlers should be around and # we should be able to continue reading through them. unlock tables; @@ -1396,7 +1407,12 @@ handler t2 read a next; a b 3 NULL select * from t2; -ERROR HY000: Can't reopen table: 't2' +a b +1 NULL +2 NULL +3 NULL +4 NULL +5 NULL handler t2 read a next; a b 4 NULL diff --git a/mysql-test/suite/handler/handler.inc b/mysql-test/suite/handler/handler.inc index b1e881f1bd8..a4ab5f1ed32 100644 --- a/mysql-test/suite/handler/handler.inc +++ b/mysql-test/suite/handler/handler.inc @@ -460,9 +460,6 @@ drop table t1; # # Bug#30882 Dropping a temporary table inside a stored function may cause a server crash # -# Test HANDLER statements in conjunction with temporary tables. While the temporary table -# is open by a HANDLER, no other statement can access it. -# create temporary table t1 (a int, b char(1), key a using btree (a), key b using btree (a,b)); insert into t1 values (0,"a"),(1,"b"),(2,"c"),(3,"d"),(4,"e"), @@ -472,7 +469,6 @@ handler t1 open as a1; handler a1 read a=(1); handler a1 read a next; handler a1 read a next; ---error ER_CANT_REOPEN_TABLE select a,b from t1; handler a1 read a prev; handler a1 read a prev; @@ -564,7 +560,7 @@ handler t1 open; handler t1 read next; --error ER_LOCK_OR_ACTIVE_TRANSACTION handler t2 close; ---error ER_CANT_REOPEN_TABLE +--error ER_LOCK_OR_ACTIVE_TRANSACTION handler t3 open; --echo # After UNLOCK TABLES handlers should be around and --echo # we should be able to continue reading through them. @@ -1182,7 +1178,6 @@ handler t1 read a next; select * from t1; --echo # Sic: the position is not lost handler t2 read a next; ---error ER_CANT_REOPEN_TABLE select * from t2; handler t2 read a next; drop table t1; diff --git a/mysql-test/suite/handler/heap.result b/mysql-test/suite/handler/heap.result index e558911e2e1..70dcefe4ff3 100644 --- a/mysql-test/suite/handler/heap.result +++ b/mysql-test/suite/handler/heap.result @@ -632,7 +632,18 @@ handler a1 read a next; a b 3 d select a,b from t1; -ERROR HY000: Can't reopen table: 'a1' +a b +0 a +1 b +2 c +3 d +4 e +5 f +6 g +7 h +8 i +9 j +9 k handler a1 read a prev; a b 2 c @@ -745,7 +756,7 @@ ERROR HY000: Can't execute the given command because you have active locked tabl handler t2 close; ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction handler t3 open; -ERROR HY000: Can't reopen table: 't3' +ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction # After UNLOCK TABLES handlers should be around and # we should be able to continue reading through them. unlock tables; @@ -1396,7 +1407,12 @@ handler t2 read a next; a b 3 NULL select * from t2; -ERROR HY000: Can't reopen table: 't2' +a b +1 NULL +2 NULL +3 NULL +4 NULL +5 NULL handler t2 read a next; a b 4 NULL diff --git a/mysql-test/suite/handler/innodb.result b/mysql-test/suite/handler/innodb.result index fc1089ee445..102237617fd 100644 --- a/mysql-test/suite/handler/innodb.result +++ b/mysql-test/suite/handler/innodb.result @@ -545,7 +545,6 @@ optimize table t1; connection default; handler t1 read next; c1 -1 handler t1 close; connection con2; Table Op Msg_type Msg_text @@ -633,7 +632,18 @@ handler a1 read a next; a b 3 d select a,b from t1; -ERROR HY000: Can't reopen table: 'a1' +a b +0 a +1 b +2 c +3 d +4 e +5 f +6 g +7 h +8 i +9 j +9 k handler a1 read a prev; a b 2 c @@ -747,7 +757,7 @@ ERROR HY000: Can't execute the given command because you have active locked tabl handler t2 close; ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction handler t3 open; -ERROR HY000: Can't reopen table: 't3' +ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction # After UNLOCK TABLES handlers should be around and # we should be able to continue reading through them. unlock tables; @@ -1400,7 +1410,12 @@ handler t2 read a next; a b 3 NULL select * from t2; -ERROR HY000: Can't reopen table: 't2' +a b +1 NULL +2 NULL +3 NULL +4 NULL +5 NULL handler t2 read a next; a b 4 NULL diff --git a/mysql-test/suite/handler/myisam.result b/mysql-test/suite/handler/myisam.result index 84cd8bbd5d2..fca75f3b7a6 100644 --- a/mysql-test/suite/handler/myisam.result +++ b/mysql-test/suite/handler/myisam.result @@ -632,7 +632,18 @@ handler a1 read a next; a b 3 d select a,b from t1; -ERROR HY000: Can't reopen table: 'a1' +a b +0 a +1 b +2 c +3 d +4 e +5 f +6 g +7 h +8 i +9 j +9 k handler a1 read a prev; a b 2 c @@ -745,7 +756,7 @@ ERROR HY000: Can't execute the given command because you have active locked tabl handler t2 close; ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction handler t3 open; -ERROR HY000: Can't reopen table: 't3' +ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction # After UNLOCK TABLES handlers should be around and # we should be able to continue reading through them. unlock tables; @@ -1396,7 +1407,12 @@ handler t2 read a next; a b 3 NULL select * from t2; -ERROR HY000: Can't reopen table: 't2' +a b +1 NULL +2 NULL +3 NULL +4 NULL +5 NULL handler t2 read a next; a b 4 NULL diff --git a/mysql-test/suite/innodb/r/create_isl_with_direct.result b/mysql-test/suite/innodb/r/create_isl_with_direct.result new file mode 100644 index 00000000000..87544e6dcdf --- /dev/null +++ b/mysql-test/suite/innodb/r/create_isl_with_direct.result @@ -0,0 +1,10 @@ +SHOW VARIABLES LIKE 'innodb_flush_method'; +Variable_name Value +innodb_flush_method O_DIRECT +CREATE TABLE t1 (x INT) ENGINE=INNODB, DATA DIRECTORY='MYSQL_TMP_DIR'; +# Contents of tmp/test directory containing .ibd file +t1.ibd +# Contents of the 'test' database directory containing .isl and .frm files +t1.frm +t1.isl +DROP TABLE t1; diff --git a/mysql-test/suite/innodb/r/defrag_mdl-9155.result b/mysql-test/suite/innodb/r/defrag_mdl-9155.result new file mode 100644 index 00000000000..18b71f42381 --- /dev/null +++ b/mysql-test/suite/innodb/r/defrag_mdl-9155.result @@ -0,0 +1,18 @@ +set global innodb_defragment=1; +create table t1 (a int not null primary key auto_increment, b varchar(256), key second(a, b)) engine=innodb; +insert t1 select null, repeat('a', 256) from seq_1_to_100; +select count(*) from t1; +count(*) +100 +connect con1,localhost,root; +start transaction; +select count(*) from t1; +count(*) +100 +connection default; +optimize table t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +connection con1; +drop table t1; +set global innodb_defragment=default; diff --git a/mysql-test/suite/innodb/r/innodb-16k.result b/mysql-test/suite/innodb/r/innodb-16k.result index 9e6e5145fa0..0537315122c 100644 --- a/mysql-test/suite/innodb/r/innodb-16k.result +++ b/mysql-test/suite/innodb/r/innodb-16k.result @@ -376,27 +376,27 @@ CREATE INDEX t1st ON t1 (s(767), t(767)); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` blob, - `b` blob, - `c` blob, - `d` blob, - `e` blob, - `f` blob, - `g` blob, - `h` blob, - `i` blob, - `j` blob, - `k` blob, - `l` blob, - `m` blob, - `n` blob, - `o` blob, - `p` blob, - `q` blob, - `r` blob, - `s` blob, - `t` blob, - `u` blob, + `a` blob DEFAULT NULL, + `b` blob DEFAULT NULL, + `c` blob DEFAULT NULL, + `d` blob DEFAULT NULL, + `e` blob DEFAULT NULL, + `f` blob DEFAULT NULL, + `g` blob DEFAULT NULL, + `h` blob DEFAULT NULL, + `i` blob DEFAULT NULL, + `j` blob DEFAULT NULL, + `k` blob DEFAULT NULL, + `l` blob DEFAULT NULL, + `m` blob DEFAULT NULL, + `n` blob DEFAULT NULL, + `o` blob DEFAULT NULL, + `p` blob DEFAULT NULL, + `q` blob DEFAULT NULL, + `r` blob DEFAULT NULL, + `s` blob DEFAULT NULL, + `t` blob DEFAULT NULL, + `u` blob DEFAULT NULL, KEY `t1a` (`a`(767)), KEY `t1b` (`b`(767)), KEY `t1c` (`c`(767)), @@ -508,22 +508,22 @@ CREATE INDEX ndx_p ON tlong2 (p(500)); SHOW CREATE TABLE tlong2; Table Create Table tlong2 CREATE TABLE `tlong2` ( - `a` blob, - `b` blob, - `c` blob, - `d` blob, - `e` blob, - `f` blob, - `g` blob, - `h` blob, - `i` blob, - `j` blob, - `k` blob, - `l` blob, - `m` blob, - `n` blob, - `o` blob, - `p` blob, + `a` blob DEFAULT NULL, + `b` blob DEFAULT NULL, + `c` blob DEFAULT NULL, + `d` blob DEFAULT NULL, + `e` blob DEFAULT NULL, + `f` blob DEFAULT NULL, + `g` blob DEFAULT NULL, + `h` blob DEFAULT NULL, + `i` blob DEFAULT NULL, + `j` blob DEFAULT NULL, + `k` blob DEFAULT NULL, + `l` blob DEFAULT NULL, + `m` blob DEFAULT NULL, + `n` blob DEFAULT NULL, + `o` blob DEFAULT NULL, + `p` blob DEFAULT NULL, KEY `ndx_c` (`c`(500)), KEY `ndx_d` (`d`(500)), KEY `ndx_e` (`e`(500)), diff --git a/mysql-test/suite/innodb/r/innodb-alter-table.result b/mysql-test/suite/innodb/r/innodb-alter-table.result index 514b8b7935f..4f4d628a1ee 100644 --- a/mysql-test/suite/innodb/r/innodb-alter-table.result +++ b/mysql-test/suite/innodb/r/innodb-alter-table.result @@ -72,7 +72,7 @@ Level Code Message SHOW CREATE TABLE `w_findispmon05u`; Table Create Table w_findispmon05u CREATE TABLE `w_findispmon05u` ( - `f5atpkey` int(11) NOT NULL DEFAULT '0', + `f5atpkey` int(11) NOT NULL DEFAULT 0, `f5atzo05` int(11) DEFAULT NULL, `pos` bigint(21) DEFAULT NULL, `f5BnvB` int(9) DEFAULT NULL, diff --git a/mysql-test/suite/innodb/r/innodb-autoinc.result b/mysql-test/suite/innodb/r/innodb-autoinc.result index ddca4685e05..52c5bb6157b 100644 --- a/mysql-test/suite/innodb/r/innodb-autoinc.result +++ b/mysql-test/suite/innodb/r/innodb-autoinc.result @@ -1304,7 +1304,7 @@ Warning 1264 Out of range value for column 'c1' at row 1 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` int(11) NOT NULL DEFAULT '0', + `c1` int(11) NOT NULL DEFAULT 0, `c2` varchar(10) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 @@ -1316,7 +1316,7 @@ c1 c2 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` int(11) NOT NULL DEFAULT '0', + `c1` int(11) NOT NULL DEFAULT 0, `c2` varchar(10) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 diff --git a/mysql-test/suite/innodb/r/innodb-corrupted-table.result b/mysql-test/suite/innodb/r/innodb-corrupted-table.result new file mode 100644 index 00000000000..94203a794f8 --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb-corrupted-table.result @@ -0,0 +1,49 @@ +call mtr.add_suppression("Table .* has a primary key in InnoDB data dictionary, but not in MySQL.*"); +call mtr.add_suppression("InnoDB: Table .* contains .* indexes inside InnoDB, which is different from the number of indexes .* defined in the MySQL.*"); +create table t1 (pk int, i int, key(i)) engine=InnoDB; +insert into t1 values (1,1),(2,2); +flush tables; +# Save the .frm file without the PK +alter table t1 add primary key (pk); +# Stop the server, replace the frm with the old one and restart the server +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `pk` int(11) DEFAULT NULL, + `i` int(11) DEFAULT NULL, + KEY `i` (`i`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +Warnings: +Warning 1082 InnoDB: Table test/t1 has a primary key in InnoDB data dictionary, but not in MySQL! +Warning 1082 InnoDB: Table test/t1 contains 2 indexes inside InnoDB, which is different from the number of indexes 1 defined in the MySQL +select * from t1; +pk i +1 1 +2 2 +alter table t1 add j int; +Warnings: +Warning 1082 InnoDB: Table test/t1 contains 2 indexes inside InnoDB, which is different from the number of indexes 1 defined in the MySQL +show warnings; +Level Code Message +Warning 1082 InnoDB: Table test/t1 contains 2 indexes inside InnoDB, which is different from the number of indexes 1 defined in the MySQL +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `pk` int(11) DEFAULT NULL, + `i` int(11) DEFAULT NULL, + `j` int(11) DEFAULT NULL, + KEY `i` (`i`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +alter table t1 add primary key (pk); +show warnings; +Level Code Message +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `pk` int(11) NOT NULL, + `i` int(11) DEFAULT NULL, + `j` int(11) DEFAULT NULL, + PRIMARY KEY (`pk`), + KEY `i` (`i`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t1; diff --git a/mysql-test/suite/innodb/r/innodb-fk.result b/mysql-test/suite/innodb/r/innodb-fk.result index c916d665bf0..2eb19764769 100644 --- a/mysql-test/suite/innodb/r/innodb-fk.result +++ b/mysql-test/suite/innodb/r/innodb-fk.result @@ -70,6 +70,50 @@ Error 1005 Can't create table `test`.`#sql-temporary` (errno: 150 "Foreign key c Warning 1215 Cannot add foreign key constraint drop table t2; drop table t1; +CREATE DATABASE kg_test1; +CREATE DATABASE kg_test2; +CREATE TABLE `kg_test1`.`group` ( +Id INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE `kg_test1`.`person` ( +`Id` INT(11) NOT NULL AUTO_INCREMENT, +`Name` VARCHAR(50) NOT NULL, +PRIMARY KEY (`Id`), +CONSTRAINT `fk_person_group` FOREIGN KEY (`Id`) REFERENCES `group` (`Id`) +) ENGINE=INNODB DEFAULT CHARSET=utf8; +show create table `kg_test1`.`person`; +Table Create Table +person CREATE TABLE `person` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `Name` varchar(50) NOT NULL, + PRIMARY KEY (`Id`), + CONSTRAINT `fk_person_group` FOREIGN KEY (`Id`) REFERENCES `group` (`Id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 +CREATE TABLE `kg_test2`.`person2` ( +`Id` INT(11) NOT NULL AUTO_INCREMENT, +`Name` VARCHAR(50) NOT NULL, +PRIMARY KEY (`Id`), +CONSTRAINT `fk_person_group` FOREIGN KEY (`Id`) REFERENCES `group` (`Id`) +) ENGINE=INNODB DEFAULT CHARSET=utf8; +ERROR HY000: Can't create table `kg_test2`.`person2` (errno: 150 "Foreign key constraint is incorrectly formed") +CREATE TABLE `kg_test2`.`person2` ( +`Id` INT(11) NOT NULL AUTO_INCREMENT, +`Name` VARCHAR(50) NOT NULL, +PRIMARY KEY (`Id`), +CONSTRAINT `fk_person_group` FOREIGN KEY (`Id`) REFERENCES `kg_test1`.`group` (`Id`) +) ENGINE=INNODB DEFAULT CHARSET=utf8; +show create table `kg_test2`.`person2`; +Table Create Table +person2 CREATE TABLE `person2` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `Name` varchar(50) NOT NULL, + PRIMARY KEY (`Id`), + CONSTRAINT `fk_person_group` FOREIGN KEY (`Id`) REFERENCES `kg_test1`.`group` (`Id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 +SHOW WARNINGS; +Level Code Message +DROP DATABASE kg_test2; +DROP DATABASE kg_test1; CREATE TABLE `#departaments` ( `id_depart` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, PRIMARY KEY (`id_depart`) diff --git a/mysql-test/suite/innodb/r/innodb-fkcheck.result b/mysql-test/suite/innodb/r/innodb-fkcheck.result new file mode 100644 index 00000000000..c6beabb0f50 --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb-fkcheck.result @@ -0,0 +1,89 @@ +set global innodb_file_per_table = 1; +drop table if exists b; +drop database if exists bug_fk; +create database bug_fk; +use bug_fk; +CREATE TABLE b ( +b int unsigned NOT NULL, +d1 datetime NOT NULL, +PRIMARY KEY (b,d1) +) ENGINE=InnoDB; +CREATE TABLE c ( +b int unsigned NOT NULL, +d1 datetime NOT NULL, +d2 datetime NOT NULL, +PRIMARY KEY (b,d1), +CONSTRAINT b_fk FOREIGN KEY (b) REFERENCES b (b) +) ENGINE=InnoDB; +show warnings; +Level Code Message +set foreign_key_checks = 0; +DROP TABLE IF EXISTS b; +show create table c; +Table Create Table +c CREATE TABLE `c` ( + `b` int(10) unsigned NOT NULL, + `d1` datetime NOT NULL, + `d2` datetime NOT NULL, + PRIMARY KEY (`b`,`d1`), + CONSTRAINT `b_fk` FOREIGN KEY (`b`) REFERENCES `b` (`b`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +CREATE TABLE b ( +b bigint unsigned NOT NULL, +d1 date NOT NULL, +PRIMARY KEY (b,d1) +) ENGINE=InnoDB; +ERROR HY000: Can't create table `bug_fk`.`b` (errno: 150 "Foreign key constraint is incorrectly formed") +show warnings; +Level Code Message +Error 1005 Can't create table `bug_fk`.`b` (errno: 150 "Foreign key constraint is incorrectly formed") +Warning 1215 Cannot add foreign key constraint +DROP TABLE IF EXISTS d; +Warnings: +Note 1051 Unknown table 'bug_fk.d' +CREATE TABLE d ( +b bigint unsigned NOT NULL, +d1 date NOT NULL, +PRIMARY KEY (b,d1), +CONSTRAINT bd_fk FOREIGN KEY (b) REFERENCES b (b) +) ENGINE=InnoDB; +show warnings; +Level Code Message +set foreign_key_checks = 1; +show create table c; +Table Create Table +c CREATE TABLE `c` ( + `b` int(10) unsigned NOT NULL, + `d1` datetime NOT NULL, + `d2` datetime NOT NULL, + PRIMARY KEY (`b`,`d1`), + CONSTRAINT `b_fk` FOREIGN KEY (`b`) REFERENCES `b` (`b`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +show create table d; +Table Create Table +d CREATE TABLE `d` ( + `b` bigint(20) unsigned NOT NULL, + `d1` date NOT NULL, + PRIMARY KEY (`b`,`d1`), + CONSTRAINT `bd_fk` FOREIGN KEY (`b`) REFERENCES `b` (`b`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +CREATE TABLE b ( +b bigint unsigned NOT NULL, +d1 date NOT NULL, +PRIMARY KEY (b,d1) +) ENGINE=InnoDB; +ERROR HY000: Can't create table `bug_fk`.`b` (errno: 150 "Foreign key constraint is incorrectly formed") +show warnings; +Level Code Message +Error 1005 Can't create table `bug_fk`.`b` (errno: 150 "Foreign key constraint is incorrectly formed") +Warning 1215 Cannot add foreign key constraint +set foreign_key_checks=0; +drop table c; +drop table d; +create table b(id int) engine=innodb; +show warnings; +Level Code Message +b.frm +b.ibd +drop table if exists b; +drop database if exists bug_fk; diff --git a/mysql-test/suite/innodb/r/innodb-index.result b/mysql-test/suite/innodb/r/innodb-index.result index d7aa6c46747..e6ee836ae13 100644 --- a/mysql-test/suite/innodb/r/innodb-index.result +++ b/mysql-test/suite/innodb/r/innodb-index.result @@ -544,9 +544,9 @@ t2 CREATE TABLE `t2` ( delete from t1; ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t4`, CONSTRAINT `dc` FOREIGN KEY (`a`) REFERENCES `t1` (`a`)) drop index dc on t4; -ERROR 42000: Can't DROP 'dc'; check that column/key exists +ERROR 42000: Can't DROP INDEX `dc`; check that it exists alter table t3 drop foreign key dc; -ERROR 42000: Can't DROP 'dc'; check that column/key exists +ERROR 42000: Can't DROP FOREIGN KEY `dc`; check that it exists alter table t4 drop foreign key dc; affected rows: 0 info: Records: 0 Duplicates: 0 Warnings: 0 diff --git a/mysql-test/suite/innodb/r/innodb-update-insert.result b/mysql-test/suite/innodb/r/innodb-update-insert.result index 034a63bca6c..333618ff7be 100644 --- a/mysql-test/suite/innodb/r/innodb-update-insert.result +++ b/mysql-test/suite/innodb/r/innodb-update-insert.result @@ -8,7 +8,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `f1` char(1) NOT NULL, `f2` int(11) NOT NULL, - `f3` blob, + `f3` blob DEFAULT NULL, PRIMARY KEY (`f1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 insert into t1 values ('a', 0, repeat('b',8102)); diff --git a/mysql-test/suite/innodb/r/innodb-virtual-columns.result b/mysql-test/suite/innodb/r/innodb-virtual-columns.result index 558bb23de0a..e613f76d5bf 100644 --- a/mysql-test/suite/innodb/r/innodb-virtual-columns.result +++ b/mysql-test/suite/innodb/r/innodb-virtual-columns.result @@ -162,50 +162,42 @@ grad_degree CREATE TABLE `grad_degree` ( `plan` varchar(10) NOT NULL, `admit_term` char(4) NOT NULL, `wdraw_rsn` varchar(4) NOT NULL DEFAULT '', - `ofis_deg_status` varchar(15) AS ( -CASE + `ofis_deg_status` varchar(15) AS (CASE WHEN wdraw_rsn = '' THEN 'In progress' WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed' ELSE 'Not Completed' END) VIRTUAL, - `ofis_deg_status2` varchar(15) AS ( -CASE + `ofis_deg_status2` varchar(15) AS (CASE WHEN wdraw_rsn = '' THEN 'In progress2' WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed2' ELSE 'Not Completed2' END) VIRTUAL, - `ofis_deg_status3` varchar(15) AS ( -CASE + `ofis_deg_status3` varchar(15) AS (CASE WHEN wdraw_rsn = '' THEN 'In progress3' WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed3' ELSE 'Not Completed3' END) VIRTUAL, - `ofis_deg_status4` varchar(15) AS ( -CASE + `ofis_deg_status4` varchar(15) AS (CASE WHEN wdraw_rsn = '' THEN 'In progress4' WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed4' ELSE 'Not Completed4' END) VIRTUAL, - `ofis_deg_status5` varchar(15) AS ( -CASE + `ofis_deg_status5` varchar(15) AS (CASE WHEN wdraw_rsn = '' THEN 'In progress5' WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed5' ELSE 'Not Completed5' END) VIRTUAL, - `ofis_deg_status6` varchar(15) AS ( -CASE + `ofis_deg_status6` varchar(15) AS (CASE WHEN wdraw_rsn = '' THEN 'In progress6' WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed6' ELSE 'Not Completed6' END) VIRTUAL, - `ofis_deg_status7` varchar(15) AS ( -CASE + `ofis_deg_status7` varchar(15) AS (CASE WHEN wdraw_rsn = '' THEN 'In progress7' WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed7' ELSE 'Not Completed7' END) VIRTUAL, - `ofis_deg_status8` varchar(15) AS ( -CASE + `ofis_deg_status8` varchar(15) AS (CASE WHEN wdraw_rsn = '' THEN 'In progress8' WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed8' ELSE 'Not Completed8' diff --git a/mysql-test/suite/innodb/r/innodb.result b/mysql-test/suite/innodb/r/innodb.result index 73920134185..4c890ddf0c0 100644 --- a/mysql-test/suite/innodb/r/innodb.result +++ b/mysql-test/suite/innodb/r/innodb.result @@ -1730,7 +1730,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `v` varchar(10) DEFAULT NULL, `c` char(10) DEFAULT NULL, - `t` text + `t` text DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 create table t2 like t1; show create table t2; @@ -1738,7 +1738,7 @@ Table Create Table t2 CREATE TABLE `t2` ( `v` varchar(10) DEFAULT NULL, `c` char(10) DEFAULT NULL, - `t` text + `t` text DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 create table t3 select * from t1; show create table t3; @@ -1746,7 +1746,7 @@ Table Create Table t3 CREATE TABLE `t3` ( `v` varchar(10) DEFAULT NULL, `c` char(10) DEFAULT NULL, - `t` text + `t` text DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 alter table t1 modify c varchar(10); show create table t1; @@ -1754,7 +1754,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `v` varchar(10) DEFAULT NULL, `c` varchar(10) DEFAULT NULL, - `t` text + `t` text DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 alter table t1 modify v char(10); show create table t1; @@ -1762,7 +1762,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `v` char(10) DEFAULT NULL, `c` varchar(10) DEFAULT NULL, - `t` text + `t` text DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 alter table t1 modify t varchar(10); Warnings: @@ -1785,7 +1785,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `v` varchar(10) DEFAULT NULL, `c` char(10) DEFAULT NULL, - `t` text, + `t` text DEFAULT NULL, KEY `v` (`v`), KEY `c` (`c`), KEY `t` (`t`(10)) @@ -2006,7 +2006,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `v` varchar(300) DEFAULT NULL, `c` char(10) DEFAULT NULL, - `t` text, + `t` text DEFAULT NULL, KEY `c` (`c`), KEY `t` (`t`(10)), KEY `v` (`v`) @@ -2086,7 +2086,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `v` varchar(300) DEFAULT NULL, `c` char(10) DEFAULT NULL, - `t` text, + `t` text DEFAULT NULL, KEY `c` (`c`), KEY `t` (`t`(10)), KEY `v` (`v`(30)) @@ -2166,7 +2166,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `v` varchar(600) DEFAULT NULL, `c` char(10) DEFAULT NULL, - `t` text, + `t` text DEFAULT NULL, KEY `c` (`c`), KEY `t` (`t`(10)), KEY `v` (`v`) @@ -2244,7 +2244,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `v` varchar(10) DEFAULT NULL, `c` char(10) DEFAULT NULL, - `t` text, + `t` text DEFAULT NULL, KEY `v` (`v`(5)), KEY `c` (`c`(5)), KEY `t` (`t`(5)) @@ -2297,7 +2297,7 @@ Note 1246 Converting column 'v' from VARCHAR to TEXT show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `v` mediumtext + `v` mediumtext DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 drop table t1; create table t1 (v varchar(65530) character set utf8); @@ -2306,7 +2306,7 @@ Note 1246 Converting column 'v' from VARCHAR to TEXT show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `v` mediumtext CHARACTER SET utf8 + `v` mediumtext CHARACTER SET utf8 DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 drop table t1; set storage_engine=MyISAM; diff --git a/mysql-test/suite/innodb/r/innodb_corrupt_bit.result b/mysql-test/suite/innodb/r/innodb_corrupt_bit.result index 353303825e5..0ef6f65d0ff 100644 --- a/mysql-test/suite/innodb/r/innodb_corrupt_bit.result +++ b/mysql-test/suite/innodb/r/innodb_corrupt_bit.result @@ -1,82 +1,48 @@ -set names utf8; -CREATE TABLE corrupt_bit_test_Ä( -a INT AUTO_INCREMENT PRIMARY KEY, -b CHAR(100), -c INT, -z INT, -INDEX(b)) -ENGINE=InnoDB; -INSERT INTO corrupt_bit_test_Ä VALUES(0,'x',1, 1); -CREATE UNIQUE INDEX idxÄ ON corrupt_bit_test_Ä(c, b); -CREATE UNIQUE INDEX idxÄ“ ON corrupt_bit_test_Ä(z, b); -SELECT * FROM corrupt_bit_test_Ä; a b c z 1 x 1 1 -select @@unique_checks; -@@unique_checks -0 -select @@innodb_change_buffering_debug; -@@innodb_change_buffering_debug -1 -INSERT INTO corrupt_bit_test_Ä SELECT 0,b,c+1,z+1 FROM corrupt_bit_test_Ä; -INSERT INTO corrupt_bit_test_Ä SELECT 0,b,c+10,z+10 FROM corrupt_bit_test_Ä; -INSERT INTO corrupt_bit_test_Ä SELECT 0,b,c+20,z+20 FROM corrupt_bit_test_Ä; -INSERT INTO corrupt_bit_test_Ä SELECT 0,b,c+50,z+50 FROM corrupt_bit_test_Ä; -INSERT INTO corrupt_bit_test_Ä SELECT 0,b,c+100,z+100 FROM corrupt_bit_test_Ä; -INSERT INTO corrupt_bit_test_Ä SELECT 0,b,c+200,z+200 FROM corrupt_bit_test_Ä; -INSERT INTO corrupt_bit_test_Ä SELECT 0,b,c+400,z+400 FROM corrupt_bit_test_Ä; -INSERT INTO corrupt_bit_test_Ä SELECT 0,b,c+800,z+800 FROM corrupt_bit_test_Ä; -INSERT INTO corrupt_bit_test_Ä SELECT 0,b,c+1600,z+1600 FROM corrupt_bit_test_Ä; -INSERT INTO corrupt_bit_test_Ä SELECT 0,b,c+4000,z+4000 FROM corrupt_bit_test_Ä; -select count(*) from corrupt_bit_test_Ä; count(*) -1024 -CREATE INDEX idx3 ON corrupt_bit_test_Ä(b, c); -INSERT INTO corrupt_bit_test_Ä VALUES(13000,'x',1,1); -CREATE INDEX idx4 ON corrupt_bit_test_Ä(b, z); -check table corrupt_bit_test_Ä; +2 Table Op Msg_type Msg_text -test.corrupt_bit_test_Ä check Warning InnoDB: The B-tree of index "idxÄ" is corrupted. -test.corrupt_bit_test_Ä check Warning InnoDB: The B-tree of index "idxÄ“" is corrupted. +test.corrupt_bit_test_Ä check Warning InnoDB: Index "idx" is marked as corrupted +test.corrupt_bit_test_Ä check Warning InnoDB: Index "idxÄ" is marked as corrupted +test.corrupt_bit_test_Ä check Warning InnoDB: Index "idxÄ“" is marked as corrupted test.corrupt_bit_test_Ä check error Corrupt -select c from corrupt_bit_test_Ä; +ERROR HY000: Index "idx" is corrupted +ERROR HY000: Index "idx" is corrupted ERROR HY000: Index corrupt_bit_test_Ä is corrupted -select z from corrupt_bit_test_Ä; ERROR HY000: Index corrupt_bit_test_Ä is corrupted -show warnings; Level Code Message Warning 180 InnoDB: Index "idxÄ“" for table "test"."corrupt_bit_test_Ä" is marked as corrupted Error 1712 Index corrupt_bit_test_Ä is corrupted -insert into corrupt_bit_test_Ä values (10001, "a", 20001, 20001); -select * from corrupt_bit_test_Ä use index(primary) where a = 10001; a b c z 10001 a 20001 20001 -begin; -insert into corrupt_bit_test_Ä values (10002, "a", 20002, 20002); -delete from corrupt_bit_test_Ä where a = 10001; -insert into corrupt_bit_test_Ä values (10001, "a", 20001, 20001); -rollback; -drop index idxÄ on corrupt_bit_test_Ä; -check table corrupt_bit_test_Ä; Table Op Msg_type Msg_text +test.corrupt_bit_test_Ä check Warning InnoDB: Index "idx" is marked as corrupted test.corrupt_bit_test_Ä check Warning InnoDB: Index "idxÄ“" is marked as corrupted test.corrupt_bit_test_Ä check error Corrupt -set names utf8; -select z from corrupt_bit_test_Ä; ERROR HY000: Index corrupt_bit_test_Ä is corrupted -drop index idxÄ“ on corrupt_bit_test_Ä; -select z from corrupt_bit_test_Ä limit 10; +Table Create Table +corrupt_bit_test_Ä CREATE TABLE `corrupt_bit_test_Ä` ( + `a` int(11) NOT NULL AUTO_INCREMENT, + `b` char(100) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + `z` int(11) DEFAULT NULL, + PRIMARY KEY (`a`), + UNIQUE KEY `idxÄ“` (`z`,`b`), + KEY `idx` (`b`) +) ENGINE=InnoDB AUTO_INCREMENT=10003 DEFAULT CHARSET=latin1 +ERROR HY000: Index "idx" is corrupted +ERROR HY000: Index "idx" is corrupted +Table Create Table +corrupt_bit_test_Ä CREATE TABLE `corrupt_bit_test_Ä` ( + `a` int(11) NOT NULL AUTO_INCREMENT, + `b` char(100) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + `z` int(11) DEFAULT NULL, + PRIMARY KEY (`a`), + KEY `idx` (`b`) +) ENGINE=InnoDB AUTO_INCREMENT=10003 DEFAULT CHARSET=latin1 z 20001 1 -1 2 -11 -12 -21 -22 -31 -32 -drop table corrupt_bit_test_Ä; -DROP DATABASE pad; -SET GLOBAL innodb_change_buffering_debug = 0; diff --git a/mysql-test/suite/innodb/r/innodb_ctype_ldml.result b/mysql-test/suite/innodb/r/innodb_ctype_ldml.result index 0008de141dc..fefadb2ecb0 100644 --- a/mysql-test/suite/innodb/r/innodb_ctype_ldml.result +++ b/mysql-test/suite/innodb/r/innodb_ctype_ldml.result @@ -396,6 +396,7 @@ utf8mb4_test_400_ci utf8mb4 328 8 latin1_test2 latin1 332 1 utf8_bengali_standard_ci utf8 336 8 utf8_bengali_traditional_ci utf8 337 8 +utf8_implicit_weights_ci utf8 338 8 utf8_phone_ci utf8 352 8 utf8_test_ci utf8 353 8 utf8_5624_1 utf8 354 8 diff --git a/mysql-test/suite/innodb/r/innodb_mysql.result b/mysql-test/suite/innodb/r/innodb_mysql.result index 1f40887b9fc..900e3814e49 100644 --- a/mysql-test/suite/innodb/r/innodb_mysql.result +++ b/mysql-test/suite/innodb/r/innodb_mysql.result @@ -1182,7 +1182,7 @@ Warning 1071 Specified key was too long; max key length is 767 bytes show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` text, + `a` text DEFAULT NULL, KEY `a` (`a`(255)) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 drop table t1; diff --git a/mysql-test/suite/innodb/r/innodb_uninstall.result b/mysql-test/suite/innodb/r/innodb_uninstall.result index f3b166c5736..40c76b4131c 100644 --- a/mysql-test/suite/innodb/r/innodb_uninstall.result +++ b/mysql-test/suite/innodb/r/innodb_uninstall.result @@ -1,6 +1,4 @@ install plugin innodb soname 'ha_innodb'; -Warnings: -Warning 1105 Cannot enable tc-log at run-time. XA features of InnoDB are disabled create table t1(a int not null primary key) engine=innodb; connect con1, localhost, root; connection con1; @@ -20,8 +18,6 @@ Warning 1620 Plugin is busy and will be uninstalled on shutdown connect con1, localhost, root; connection con1; install plugin innodb soname 'ha_innodb'; -Warnings: -Warning 1105 Cannot enable tc-log at run-time. XA features of InnoDB are disabled drop table t1; create table t2(a int not null primary key) engine=innodb; insert into t2 values(1); diff --git a/mysql-test/suite/innodb/t/create_isl_with_direct.opt b/mysql-test/suite/innodb/t/create_isl_with_direct.opt new file mode 100644 index 00000000000..8f80f02e359 --- /dev/null +++ b/mysql-test/suite/innodb/t/create_isl_with_direct.opt @@ -0,0 +1 @@ +--innodb_flush_method=O_DIRECT diff --git a/mysql-test/suite/innodb/t/create_isl_with_direct.test b/mysql-test/suite/innodb/t/create_isl_with_direct.test new file mode 100644 index 00000000000..34ea9c77703 --- /dev/null +++ b/mysql-test/suite/innodb/t/create_isl_with_direct.test @@ -0,0 +1,28 @@ +--source include/not_embedded.inc +--source include/have_innodb.inc +--source include/not_windows.inc + +--disable_query_log +CALL mtr.add_suppression("\\[Warning\\] InnoDB: Failed to set O_DIRECT on file ./ibdata1: OPEN: Invalid argument, continuing anyway. O_DIRECT is known to result in 'Invalid argument' on Linux on tmpfs, see MySQL Bug#26662."); + +# The below mtr suppression to avoid failure in solaris platform. +CALL mtr.add_suppression("\\[ERROR\\] InnoDB: Failed to set DIRECTIO_ON on file.*"); +--enable_query_log + +SHOW VARIABLES LIKE 'innodb_flush_method'; + +let MYSQLD_DATADIR=`SELECT @@datadir`; + +--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR + +# Create a table with explicit data directory option. +EVAL CREATE TABLE t1 (x INT) ENGINE=INNODB, DATA DIRECTORY='$MYSQL_TMP_DIR'; + +--echo # Contents of tmp/test directory containing .ibd file +--list_files $MYSQL_TMP_DIR/test + +--echo # Contents of the 'test' database directory containing .isl and .frm files +--list_files $MYSQLD_DATADIR/test + +DROP TABLE t1; + \ No newline at end of file diff --git a/mysql-test/suite/innodb/t/defrag_mdl-9155.test b/mysql-test/suite/innodb/t/defrag_mdl-9155.test new file mode 100644 index 00000000000..1e1efb9c4c6 --- /dev/null +++ b/mysql-test/suite/innodb/t/defrag_mdl-9155.test @@ -0,0 +1,22 @@ +# +# MDEV-9155 Enabling Defragmenting in 10.1.8 still causes OPTIMIZE TABLE to take metadatalocks +# +source include/have_innodb.inc; +source include/have_sequence.inc; + +set global innodb_defragment=1; +create table t1 (a int not null primary key auto_increment, b varchar(256), key second(a, b)) engine=innodb; +insert t1 select null, repeat('a', 256) from seq_1_to_100; +select count(*) from t1; + +connect (con1,localhost,root); +start transaction; +select count(*) from t1; + +connection default; +optimize table t1; + +connection con1; +drop table t1; + +set global innodb_defragment=default; diff --git a/mysql-test/suite/innodb/t/innodb-corrupted-table.test b/mysql-test/suite/innodb/t/innodb-corrupted-table.test new file mode 100644 index 00000000000..94c5454429f --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb-corrupted-table.test @@ -0,0 +1,46 @@ +--source include/have_innodb.inc +--source include/not_embedded.inc + +# +# MDEV-9918: [ERROR] mysqld got signal 11 during ALTER TABLE `name` COLUMN ADD +# + +call mtr.add_suppression("Table .* has a primary key in InnoDB data dictionary, but not in MySQL.*"); +call mtr.add_suppression("InnoDB: Table .* contains .* indexes inside InnoDB, which is different from the number of indexes .* defined in the MySQL.*"); + +create table t1 (pk int, i int, key(i)) engine=InnoDB; +insert into t1 values (1,1),(2,2); + +--let $datadir= `select @@datadir` + +flush tables; + +--echo # Save the .frm file without the PK + +--copy_file $datadir/test/t1.frm $MYSQLTEST_VARDIR/tmp/t1.frm + +alter table t1 add primary key (pk); + +--echo # Stop the server, replace the frm with the old one and restart the server + +--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--shutdown_server 10 +--source include/wait_until_disconnected.inc + +--remove_file $datadir/test/t1.frm +--copy_file $MYSQLTEST_VARDIR/tmp/t1.frm $datadir/test/t1.frm + +--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--enable_reconnect +--source include/wait_until_connected_again.inc + +show create table t1; +select * from t1; +alter table t1 add j int; +show warnings; +show create table t1; +alter table t1 add primary key (pk); +show warnings; +show create table t1; +# Cleanup +drop table t1; diff --git a/mysql-test/suite/innodb/t/innodb-fk.test b/mysql-test/suite/innodb/t/innodb-fk.test index f7bcbe238dd..17e926e8647 100644 --- a/mysql-test/suite/innodb/t/innodb-fk.test +++ b/mysql-test/suite/innodb/t/innodb-fk.test @@ -125,6 +125,47 @@ show warnings; drop table t2; drop table t1; +# +# MDEV-9142 :Adding Constraint with no database reference +# results in ERROR 1046 (3D000) at line 13: No database selected +# +CREATE DATABASE kg_test1; +CREATE DATABASE kg_test2; + +CREATE TABLE `kg_test1`.`group` ( + Id INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `kg_test1`.`person` ( +`Id` INT(11) NOT NULL AUTO_INCREMENT, +`Name` VARCHAR(50) NOT NULL, +PRIMARY KEY (`Id`), +CONSTRAINT `fk_person_group` FOREIGN KEY (`Id`) REFERENCES `group` (`Id`) +) ENGINE=INNODB DEFAULT CHARSET=utf8; + +show create table `kg_test1`.`person`; + +--error 1005 +CREATE TABLE `kg_test2`.`person2` ( +`Id` INT(11) NOT NULL AUTO_INCREMENT, +`Name` VARCHAR(50) NOT NULL, +PRIMARY KEY (`Id`), +CONSTRAINT `fk_person_group` FOREIGN KEY (`Id`) REFERENCES `group` (`Id`) +) ENGINE=INNODB DEFAULT CHARSET=utf8; + +CREATE TABLE `kg_test2`.`person2` ( +`Id` INT(11) NOT NULL AUTO_INCREMENT, +`Name` VARCHAR(50) NOT NULL, +PRIMARY KEY (`Id`), +CONSTRAINT `fk_person_group` FOREIGN KEY (`Id`) REFERENCES `kg_test1`.`group` (`Id`) +) ENGINE=INNODB DEFAULT CHARSET=utf8; + +show create table `kg_test2`.`person2`; + +SHOW WARNINGS; +DROP DATABASE kg_test2; +DROP DATABASE kg_test1; + # # MDEV-7627: Some symbols in table name can cause to Error Code: 1050 when created FK # diff --git a/mysql-test/suite/innodb/t/innodb-fkcheck.test b/mysql-test/suite/innodb/t/innodb-fkcheck.test new file mode 100644 index 00000000000..51e36ae6984 --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb-fkcheck.test @@ -0,0 +1,115 @@ +--source include/have_innodb.inc + +# +# MDEV-10083: Orphan ibd file when playing with foreign keys +# +--disable_query_log +SET @start_global_fpt = @@global.innodb_file_per_table; +SET @start_global_fkc = @@global.foreign_key_checks; +--enable_query_log + +set global innodb_file_per_table = 1; + +--disable_warnings +drop table if exists b; +drop database if exists bug_fk; +--enable_warnings + +let $MYSQLD_DATADIR = `select @@datadir`; + +create database bug_fk; +use bug_fk; + +CREATE TABLE b ( + b int unsigned NOT NULL, + d1 datetime NOT NULL, + PRIMARY KEY (b,d1) +) ENGINE=InnoDB; + +CREATE TABLE c ( + b int unsigned NOT NULL, + d1 datetime NOT NULL, + d2 datetime NOT NULL, + PRIMARY KEY (b,d1), + CONSTRAINT b_fk FOREIGN KEY (b) REFERENCES b (b) +) ENGINE=InnoDB; + +show warnings; + +set foreign_key_checks = 0; + +DROP TABLE IF EXISTS b; + +show create table c; + +# +# Note that column b has different type in parent table +# +--error 1005 +CREATE TABLE b ( + b bigint unsigned NOT NULL, + d1 date NOT NULL, + PRIMARY KEY (b,d1) +) ENGINE=InnoDB; + +show warnings; + +DROP TABLE IF EXISTS d; + +CREATE TABLE d ( + b bigint unsigned NOT NULL, + d1 date NOT NULL, + PRIMARY KEY (b,d1), + CONSTRAINT bd_fk FOREIGN KEY (b) REFERENCES b (b) +) ENGINE=InnoDB; + +show warnings; + +set foreign_key_checks = 1; + +show create table c; +show create table d; + +# +# Table c column b used on foreign key has different type +# compared referenced column b in table b, but this +# create still produced b.ibd file. This is because +# we row_drop_table_for_mysql was called and referenced +# table is not allowed to be dropped even in case +# when actual create is not successfull. +# +--error 1005 +CREATE TABLE b ( + b bigint unsigned NOT NULL, + d1 date NOT NULL, + PRIMARY KEY (b,d1) +) ENGINE=InnoDB; + +show warnings; + +--list_files $MYSQLD_DATADIR/bug_fk b* + +set foreign_key_checks=0; + +drop table c; +drop table d; + +--list_files $MYSQLD_DATADIR/bug_fk b* + +create table b(id int) engine=innodb; +show warnings; + +--list_files $MYSQLD_DATADIR/bug_fk b* + +# +# Cleanup +# +--disable_query_log +SET @@global.innodb_file_per_table = @start_global_fpt; +SET @@global.foreign_key_checks = @start_global_fkc; +--enable_query_log + +--disable_warnings +drop table if exists b; +drop database if exists bug_fk; +--enable_warnings diff --git a/mysql-test/suite/innodb/t/innodb_corrupt_bit.test b/mysql-test/suite/innodb/t/innodb_corrupt_bit.test index d6d77076b83..ee04e8d66fc 100644 --- a/mysql-test/suite/innodb/t/innodb_corrupt_bit.test +++ b/mysql-test/suite/innodb/t/innodb_corrupt_bit.test @@ -2,46 +2,24 @@ # Test for persistent corrupt bit for corrupted index and table # -- source include/have_innodb.inc --- source include/have_innodb_16k.inc - -# Issues with innodb_change_buffering_debug on Windows, so the test scenario -# cannot be created on windows ---source include/not_windows.inc - +#-- source include/have_innodb_16k.inc +-- source include/not_embedded.inc # This test needs debug server ---source include/have_debug.inc +-- source include/have_debug.inc -- disable_query_log -call mtr.add_suppression("Flagged corruption of idx.*in CHECK TABLE"); -# This test setup is extracted from bug56680.test: -# The flag innodb_change_buffering_debug is only available in debug builds. -# It instructs InnoDB to try to evict pages from the buffer pool when -# change buffering is possible, so that the change buffer will be used -# whenever possible. -SET @innodb_change_buffering_debug_orig = @@innodb_change_buffering_debug; -SET GLOBAL innodb_change_buffering_debug = 1; - -# Turn off Unique Check to create corrupted index with dup key -SET UNIQUE_CHECKS=0; - -CREATE DATABASE pad; -let $i=338; -while ($i) -{ ---eval CREATE TABLE pad.t$i(a INT PRIMARY KEY)ENGINE=InnoDB; - dec $i; -} - --- enable_query_log +call mtr.add_suppression("Flagged corruption of idx.*in"); set names utf8; +SET UNIQUE_CHECKS=0; + CREATE TABLE corrupt_bit_test_Ä( a INT AUTO_INCREMENT PRIMARY KEY, b CHAR(100), c INT, z INT, - INDEX(b)) + INDEX idx(b)) ENGINE=InnoDB; INSERT INTO corrupt_bit_test_Ä VALUES(0,'x',1, 1); @@ -54,37 +32,20 @@ CREATE UNIQUE INDEX idxÄ“ ON corrupt_bit_test_Ä(z, b); SELECT * FROM corrupt_bit_test_Ä; -select @@unique_checks; -select @@innodb_change_buffering_debug; - -# Create enough rows for the table, so that the insert buffer will be -# used for modifying the secondary index page. There must be multiple -# index pages, because changes to the root page are never buffered. - INSERT INTO corrupt_bit_test_Ä SELECT 0,b,c+1,z+1 FROM corrupt_bit_test_Ä; -INSERT INTO corrupt_bit_test_Ä SELECT 0,b,c+10,z+10 FROM corrupt_bit_test_Ä; -INSERT INTO corrupt_bit_test_Ä SELECT 0,b,c+20,z+20 FROM corrupt_bit_test_Ä; -INSERT INTO corrupt_bit_test_Ä SELECT 0,b,c+50,z+50 FROM corrupt_bit_test_Ä; -INSERT INTO corrupt_bit_test_Ä SELECT 0,b,c+100,z+100 FROM corrupt_bit_test_Ä; -INSERT INTO corrupt_bit_test_Ä SELECT 0,b,c+200,z+200 FROM corrupt_bit_test_Ä; -INSERT INTO corrupt_bit_test_Ä SELECT 0,b,c+400,z+400 FROM corrupt_bit_test_Ä; -INSERT INTO corrupt_bit_test_Ä SELECT 0,b,c+800,z+800 FROM corrupt_bit_test_Ä; -INSERT INTO corrupt_bit_test_Ä SELECT 0,b,c+1600,z+1600 FROM corrupt_bit_test_Ä; -INSERT INTO corrupt_bit_test_Ä SELECT 0,b,c+4000,z+4000 FROM corrupt_bit_test_Ä; select count(*) from corrupt_bit_test_Ä; -CREATE INDEX idx3 ON corrupt_bit_test_Ä(b, c); - -# Create a dup key error on index "idxÄ“" and "idxÄ" by inserting a dup value -INSERT INTO corrupt_bit_test_Ä VALUES(13000,'x',1,1); - -# creating an index should succeed even if other secondary indexes are corrupted -CREATE INDEX idx4 ON corrupt_bit_test_Ä(b, z); - -# Check table will find the unique indexes corrupted -# with dup key +# This will flag all secondary indexes corrupted +SET SESSION debug_dbug="+d,dict_set_index_corrupted"; check table corrupt_bit_test_Ä; +SET SESSION debug_dbug=""; + +# Cannot create new indexes while corrupted indexes exist +--error ER_INDEX_CORRUPT +CREATE INDEX idx3 ON corrupt_bit_test_Ä(b, c); +--error ER_INDEX_CORRUPT +CREATE INDEX idx4 ON corrupt_bit_test_Ä(b, z); # This selection intend to use the corrupted index. Expect to fail -- error ER_INDEX_CORRUPT @@ -109,7 +70,6 @@ delete from corrupt_bit_test_Ä where a = 10001; insert into corrupt_bit_test_Ä values (10001, "a", 20001, 20001); rollback; -# Drop one corrupted index before reboot drop index idxÄ on corrupt_bit_test_Ä; check table corrupt_bit_test_Ä; @@ -119,14 +79,26 @@ set names utf8; -- error ER_INDEX_CORRUPT select z from corrupt_bit_test_Ä; +show create table corrupt_bit_test_Ä; + # Drop the corrupted index drop index idxÄ“ on corrupt_bit_test_Ä; +# Cannot create new indexes while a corrupt index exists. +--error ER_INDEX_CORRUPT +CREATE INDEX idx3 ON corrupt_bit_test_Ä(b, c); +--error ER_INDEX_CORRUPT +CREATE INDEX idx4 ON corrupt_bit_test_Ä(b, z); + +show create table corrupt_bit_test_Ä; +drop index idx on corrupt_bit_test_Ä; + +# Now that there exist no corrupted indexes, we can create new indexes. +CREATE INDEX idx3 ON corrupt_bit_test_Ä(b, c); +CREATE INDEX idx4 ON corrupt_bit_test_Ä(b, z); + # Now select back to normal select z from corrupt_bit_test_Ä limit 10; # Drop table drop table corrupt_bit_test_Ä; -DROP DATABASE pad; - -SET GLOBAL innodb_change_buffering_debug = 0; diff --git a/mysql-test/suite/innodb/t/innodb_uninstall.test b/mysql-test/suite/innodb/t/innodb_uninstall.test index 3cd02b23d8c..1b65db8a28d 100644 --- a/mysql-test/suite/innodb/t/innodb_uninstall.test +++ b/mysql-test/suite/innodb/t/innodb_uninstall.test @@ -9,7 +9,13 @@ if (!$HA_INNODB_SO) { # MDEV-8474: InnoDB sets per-connection data unsafely # Below test caused hang # +# When mysqld is built with wsrep patch (WITH_WSREP=ON), +# the following install command emits a warning about +# server unable to enable tc-log at runtime. +disable_warnings; install plugin innodb soname 'ha_innodb'; +enable_warnings; + create table t1(a int not null primary key) engine=innodb; connect (con1, localhost, root); @@ -36,7 +42,9 @@ reap; connect (con1, localhost, root); connection con1; +disable_warnings; install plugin innodb soname 'ha_innodb'; +enable_warnings; drop table t1; create table t2(a int not null primary key) engine=innodb; diff --git a/mysql-test/suite/innodb_fts/r/fulltext.result b/mysql-test/suite/innodb_fts/r/fulltext.result index 1cdce29cdf9..2f23a484508 100644 --- a/mysql-test/suite/innodb_fts/r/fulltext.result +++ b/mysql-test/suite/innodb_fts/r/fulltext.result @@ -240,7 +240,7 @@ show create table t2; Table Create Table t2 CREATE TABLE `t2` ( `ticket` int(11) DEFAULT NULL, - `inhalt` text, + `inhalt` text DEFAULT NULL, KEY `tig` (`ticket`), FULLTEXT KEY `tix` (`inhalt`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 diff --git a/mysql-test/suite/innodb_fts/r/fulltext_distinct.result b/mysql-test/suite/innodb_fts/r/fulltext_distinct.result index 95a9a617fa6..e660b55c448 100644 --- a/mysql-test/suite/innodb_fts/r/fulltext_distinct.result +++ b/mysql-test/suite/innodb_fts/r/fulltext_distinct.result @@ -8,8 +8,6 @@ KEY kt(tag), KEY kv(value(15)), FULLTEXT KEY kvf(value) ) ENGINE = InnoDB; -Warnings: -Warning 1101 BLOB/TEXT column 'value' can't have a default value CREATE TABLE t2 ( id_t2 mediumint unsigned NOT NULL default '0', id_t1 mediumint unsigned NOT NULL default '0', diff --git a/mysql-test/suite/innodb_fts/r/fulltext_update.result b/mysql-test/suite/innodb_fts/r/fulltext_update.result index df323996dd9..00d0777362f 100644 --- a/mysql-test/suite/innodb_fts/r/fulltext_update.result +++ b/mysql-test/suite/innodb_fts/r/fulltext_update.result @@ -9,8 +9,6 @@ name VARCHAR(80) DEFAULT '' NOT NULL, FULLTEXT(url,description,shortdesc,longdesc), PRIMARY KEY(gnr) ) ENGINE = InnoDB; -Warnings: -Warning 1101 BLOB/TEXT column 'longdesc' can't have a default value insert into test (url,shortdesc,longdesc,description,name) VALUES ("http:/test.at", "kurz", "lang","desc", "name"); insert into test (url,shortdesc,longdesc,description,name) VALUES diff --git a/mysql-test/suite/innodb_fts/r/innodb-fts-stopword.result b/mysql-test/suite/innodb_fts/r/innodb-fts-stopword.result index b76b97d0ed5..dea2f2360da 100644 --- a/mysql-test/suite/innodb_fts/r/innodb-fts-stopword.result +++ b/mysql-test/suite/innodb_fts/r/innodb-fts-stopword.result @@ -147,7 +147,7 @@ Table Create Table articles CREATE TABLE `articles` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `title` varchar(200) DEFAULT NULL, - `body` text, + `body` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `idx` (`title`,`body`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 @@ -243,7 +243,7 @@ Table Create Table articles CREATE TABLE `articles` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `title` varchar(200) DEFAULT NULL, - `body` text, + `body` text DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=latin1 ALTER TABLE articles ADD FULLTEXT INDEX idx (title,body); @@ -437,7 +437,7 @@ Table Create Table articles CREATE TABLE `articles` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `title` varchar(200) DEFAULT NULL, - `body` text, + `body` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `idx` (`title`,`body`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 @@ -548,7 +548,7 @@ Table Create Table articles CREATE TABLE `articles` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `title` varchar(200) DEFAULT NULL, - `body` text, + `body` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `idx` (`title`,`body`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 diff --git a/mysql-test/suite/innodb_fts/r/innodb_fts_misc.result b/mysql-test/suite/innodb_fts/r/innodb_fts_misc.result index f6be36a24ef..1449fd7d85a 100644 --- a/mysql-test/suite/innodb_fts/r/innodb_fts_misc.result +++ b/mysql-test/suite/innodb_fts/r/innodb_fts_misc.result @@ -16,7 +16,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `a` varchar(200) DEFAULT NULL, - `b` text, + `b` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `idx` (`a`,`b`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1 @@ -302,7 +302,7 @@ MATCH a,b AGAINST ('support') ; SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( - `id` int(10) unsigned NOT NULL DEFAULT '0' + `id` int(10) unsigned NOT NULL DEFAULT 0 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 SELECT id FROM t2; id @@ -314,7 +314,7 @@ MATCH a,b AGAINST("+support +collections" IN BOOLEAN MODE); SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( - `id` int(10) unsigned NOT NULL DEFAULT '0' + `id` int(10) unsigned NOT NULL DEFAULT 0 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 SELECT id FROM t2; id @@ -325,7 +325,7 @@ MATCH a,b AGAINST ('"proximity search"@10' IN BOOLEAN MODE); SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( - `id` int(10) unsigned NOT NULL DEFAULT '0' + `id` int(10) unsigned NOT NULL DEFAULT 0 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 SELECT id FROM t2; id @@ -563,7 +563,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `a` varchar(200) DEFAULT NULL, - `b` text, + `b` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `idx` (`a`,`b`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1 @@ -969,7 +969,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `a` varchar(200) DEFAULT NULL, - `b` text, + `b` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `idx` (`a`,`b`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1 diff --git a/mysql-test/suite/innodb_fts/r/innodb_fts_misc_1.result b/mysql-test/suite/innodb_fts/r/innodb_fts_misc_1.result index 9f5c1f271fc..a74d6094a7f 100644 --- a/mysql-test/suite/innodb_fts/r/innodb_fts_misc_1.result +++ b/mysql-test/suite/innodb_fts/r/innodb_fts_misc_1.result @@ -477,7 +477,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `a` varchar(200) DEFAULT NULL, - `b` text, + `b` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `idx` (`a`,`b`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPRESSED diff --git a/mysql-test/suite/innodb_fts/r/innodb_fts_multiple_index.result b/mysql-test/suite/innodb_fts/r/innodb_fts_multiple_index.result index 6a255ddffc5..0b011639e2e 100644 --- a/mysql-test/suite/innodb_fts/r/innodb_fts_multiple_index.result +++ b/mysql-test/suite/innodb_fts/r/innodb_fts_multiple_index.result @@ -17,7 +17,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `a` varchar(200) DEFAULT NULL, - `b` text, + `b` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `idx_1` (`a`), FULLTEXT KEY `idx_2` (`b`) diff --git a/mysql-test/suite/maria/maria-gis-rtree-dynamic.result b/mysql-test/suite/maria/maria-gis-rtree-dynamic.result index f8487258546..024b929646a 100644 --- a/mysql-test/suite/maria/maria-gis-rtree-dynamic.result +++ b/mysql-test/suite/maria/maria-gis-rtree-dynamic.result @@ -805,8 +805,6 @@ INSERT INTO t2 SELECT GeomFromText(st) FROM t1; ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field drop table t1, t2; CREATE TABLE t1 (`geometry` geometry NOT NULL default '',SPATIAL KEY `gndx` (`geometry`)) row_format=dynamic DEFAULT CHARSET=latin1; -Warnings: -Warning 1101 BLOB/TEXT column 'geometry' can't have a default value INSERT INTO t1 (geometry) VALUES (PolygonFromText('POLYGON((-18.6086111000 -66.9327777000, -18.6055555000 -66.8158332999, -18.7186111000 -66.8102777000, -18.7211111000 -66.9269443999, @@ -823,8 +821,6 @@ CREATE TABLE t1 ( c1 geometry NOT NULL default '', SPATIAL KEY i1 (c1) ) row_format=dynamic DEFAULT CHARSET=latin1; -Warnings: -Warning 1101 BLOB/TEXT column 'c1' can't have a default value INSERT INTO t1 (c1) VALUES ( PolygonFromText('POLYGON((-18.6086111000 -66.9327777000, -18.6055555000 -66.8158332999, @@ -839,8 +835,6 @@ CREATE TABLE t1 ( c1 geometry NOT NULL default '', SPATIAL KEY i1 (c1) ) row_format=dynamic DEFAULT CHARSET=latin1; -Warnings: -Warning 1101 BLOB/TEXT column 'c1' can't have a default value INSERT INTO t1 (c1) VALUES ( PolygonFromText('POLYGON((-18.6086111000 -66.9327777000, -18.6055555000 -66.8158332999, diff --git a/mysql-test/suite/maria/maria-gis-rtree-trans.result b/mysql-test/suite/maria/maria-gis-rtree-trans.result index a8ea6f1d112..2b94bc0ffad 100644 --- a/mysql-test/suite/maria/maria-gis-rtree-trans.result +++ b/mysql-test/suite/maria/maria-gis-rtree-trans.result @@ -805,8 +805,6 @@ INSERT INTO t2 SELECT GeomFromText(st) FROM t1; ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field drop table t1, t2; CREATE TABLE t1 (`geometry` geometry NOT NULL default '',SPATIAL KEY `gndx` (`geometry`)) transactional=1 row_format=page DEFAULT CHARSET=latin1; -Warnings: -Warning 1101 BLOB/TEXT column 'geometry' can't have a default value INSERT INTO t1 (geometry) VALUES (PolygonFromText('POLYGON((-18.6086111000 -66.9327777000, -18.6055555000 -66.8158332999, -18.7186111000 -66.8102777000, -18.7211111000 -66.9269443999, @@ -823,8 +821,6 @@ CREATE TABLE t1 ( c1 geometry NOT NULL default '', SPATIAL KEY i1 (c1) ) transactional=1 row_format=page DEFAULT CHARSET=latin1; -Warnings: -Warning 1101 BLOB/TEXT column 'c1' can't have a default value INSERT INTO t1 (c1) VALUES ( PolygonFromText('POLYGON((-18.6086111000 -66.9327777000, -18.6055555000 -66.8158332999, @@ -839,8 +835,6 @@ CREATE TABLE t1 ( c1 geometry NOT NULL default '', SPATIAL KEY i1 (c1) ) transactional=1 row_format=page DEFAULT CHARSET=latin1; -Warnings: -Warning 1101 BLOB/TEXT column 'c1' can't have a default value INSERT INTO t1 (c1) VALUES ( PolygonFromText('POLYGON((-18.6086111000 -66.9327777000, -18.6055555000 -66.8158332999, diff --git a/mysql-test/suite/maria/maria-gis-rtree.result b/mysql-test/suite/maria/maria-gis-rtree.result index c7c65fac003..826aee5fbc2 100644 --- a/mysql-test/suite/maria/maria-gis-rtree.result +++ b/mysql-test/suite/maria/maria-gis-rtree.result @@ -805,8 +805,6 @@ INSERT INTO t2 SELECT GeomFromText(st) FROM t1; ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field drop table t1, t2; CREATE TABLE t1 (`geometry` geometry NOT NULL default '',SPATIAL KEY `gndx` (`geometry`)) transactional=0 row_format=page DEFAULT CHARSET=latin1; -Warnings: -Warning 1101 BLOB/TEXT column 'geometry' can't have a default value INSERT INTO t1 (geometry) VALUES (PolygonFromText('POLYGON((-18.6086111000 -66.9327777000, -18.6055555000 -66.8158332999, -18.7186111000 -66.8102777000, -18.7211111000 -66.9269443999, @@ -823,8 +821,6 @@ CREATE TABLE t1 ( c1 geometry NOT NULL default '', SPATIAL KEY i1 (c1) ) transactional=0 row_format=page DEFAULT CHARSET=latin1; -Warnings: -Warning 1101 BLOB/TEXT column 'c1' can't have a default value INSERT INTO t1 (c1) VALUES ( PolygonFromText('POLYGON((-18.6086111000 -66.9327777000, -18.6055555000 -66.8158332999, @@ -839,8 +835,6 @@ CREATE TABLE t1 ( c1 geometry NOT NULL default '', SPATIAL KEY i1 (c1) ) transactional=0 row_format=page DEFAULT CHARSET=latin1; -Warnings: -Warning 1101 BLOB/TEXT column 'c1' can't have a default value INSERT INTO t1 (c1) VALUES ( PolygonFromText('POLYGON((-18.6086111000 -66.9327777000, -18.6055555000 -66.8158332999, diff --git a/mysql-test/suite/maria/maria.result b/mysql-test/suite/maria/maria.result index ea4e7896066..d056207df64 100644 --- a/mysql-test/suite/maria/maria.result +++ b/mysql-test/suite/maria/maria.result @@ -1024,7 +1024,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `v` varchar(10) DEFAULT NULL, `c` char(10) DEFAULT NULL, - `t` text + `t` text DEFAULT NULL ) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=0 create table t2 like t1; show create table t2; @@ -1032,7 +1032,7 @@ Table Create Table t2 CREATE TABLE `t2` ( `v` varchar(10) DEFAULT NULL, `c` char(10) DEFAULT NULL, - `t` text + `t` text DEFAULT NULL ) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=0 create table t3 select * from t1; show create table t3; @@ -1040,7 +1040,7 @@ Table Create Table t3 CREATE TABLE `t3` ( `v` varchar(10) DEFAULT NULL, `c` char(10) DEFAULT NULL, - `t` text + `t` text DEFAULT NULL ) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=0 alter table t1 modify c varchar(10); show create table t1; @@ -1048,7 +1048,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `v` varchar(10) DEFAULT NULL, `c` varchar(10) DEFAULT NULL, - `t` text + `t` text DEFAULT NULL ) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=0 alter table t1 modify v char(10); show create table t1; @@ -1056,7 +1056,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `v` char(10) DEFAULT NULL, `c` varchar(10) DEFAULT NULL, - `t` text + `t` text DEFAULT NULL ) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=0 alter table t1 modify t varchar(10); Warnings: @@ -1079,7 +1079,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `v` varchar(10) DEFAULT NULL, `c` char(10) DEFAULT NULL, - `t` text, + `t` text DEFAULT NULL, KEY `v` (`v`), KEY `c` (`c`), KEY `t` (`t`(10)) @@ -1300,7 +1300,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `v` varchar(300) DEFAULT NULL, `c` char(10) DEFAULT NULL, - `t` text, + `t` text DEFAULT NULL, KEY `c` (`c`), KEY `t` (`t`(10)), KEY `v` (`v`) @@ -1380,7 +1380,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `v` varchar(300) DEFAULT NULL, `c` char(10) DEFAULT NULL, - `t` text, + `t` text DEFAULT NULL, KEY `c` (`c`), KEY `t` (`t`(10)), KEY `v` (`v`(30)) @@ -1460,7 +1460,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `v` varchar(600) DEFAULT NULL, `c` char(10) DEFAULT NULL, - `t` text, + `t` text DEFAULT NULL, KEY `c` (`c`), KEY `t` (`t`(10)), KEY `v` (`v`) @@ -1538,7 +1538,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `v` varchar(10) DEFAULT NULL, `c` char(10) DEFAULT NULL, - `t` text, + `t` text DEFAULT NULL, KEY `v` (`v`(5)), KEY `c` (`c`(5)), KEY `t` (`t`(5)) @@ -1589,7 +1589,7 @@ Note 1246 Converting column 'v' from VARCHAR to TEXT show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `v` mediumtext + `v` mediumtext DEFAULT NULL ) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=0 drop table t1; create table t1 (v varchar(65530) character set utf8); @@ -1598,7 +1598,7 @@ Note 1246 Converting column 'v' from VARCHAR to TEXT show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `v` mediumtext CHARACTER SET utf8 + `v` mediumtext CHARACTER SET utf8 DEFAULT NULL ) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=0 drop table t1; create table t1 (v varchar(65535)); diff --git a/mysql-test/suite/maria/ps_maria.result b/mysql-test/suite/maria/ps_maria.result index c5defa8ae54..6ce10fc2bce 100644 --- a/mysql-test/suite/maria/ps_maria.result +++ b/mysql-test/suite/maria/ps_maria.result @@ -1154,15 +1154,15 @@ prepare stmt1 from ' explain select * from t9 ' ; execute stmt1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def id 8 3 1 Y 32928 0 63 -def select_type 253 19 6 N 1 31 8 -def table 253 64 2 Y 0 31 8 -def type 253 10 3 Y 0 31 8 -def possible_keys 253 4_OR_8_K 0 Y 0 31 8 -def key 253 64 0 Y 0 31 8 -def key_len 253 4_OR_8_K 0 Y 0 31 8 -def ref 253 2048 0 Y 0 31 8 +def select_type 253 19 6 N 1 39 8 +def table 253 64 2 Y 0 39 8 +def type 253 10 3 Y 0 39 8 +def possible_keys 253 4_OR_8_K 0 Y 0 39 8 +def key 253 64 0 Y 0 39 8 +def key_len 253 4_OR_8_K 0 Y 0 39 8 +def ref 253 2048 0 Y 0 39 8 def rows 8 10 1 Y 32928 0 63 -def Extra 253 255 0 N 1 31 8 +def Extra 253 255 0 N 1 39 8 id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t9 ALL NULL NULL NULL NULL 2 drop table if exists t2 ; @@ -1779,37 +1779,37 @@ t5 CREATE TABLE `t5` ( `const01` int(1) NOT NULL, `param01` bigint(20) DEFAULT NULL, `const02` decimal(2,1) NOT NULL, - `param02` decimal(65,30) DEFAULT NULL, + `param02` decimal(65,38) DEFAULT NULL, `const03` double NOT NULL, `param03` double DEFAULT NULL, `const04` varchar(3) NOT NULL, - `param04` longtext, + `param04` longtext DEFAULT NULL, `const05` varbinary(3) NOT NULL, - `param05` longblob, + `param05` longblob DEFAULT NULL, `const06` varchar(10) NOT NULL, - `param06` longtext, + `param06` longtext DEFAULT NULL, `const07` date DEFAULT NULL, - `param07` longtext, + `param07` longtext DEFAULT NULL, `const08` varchar(19) NOT NULL, - `param08` longtext, + `param08` longtext DEFAULT NULL, `const09` datetime DEFAULT NULL, - `param09` longtext, + `param09` longtext DEFAULT NULL, `const10` bigint(17) DEFAULT NULL, `param10` bigint(20) DEFAULT NULL, `const11` int(4) DEFAULT NULL, `param11` bigint(20) DEFAULT NULL, `const12` binary(0) DEFAULT NULL, `param12` bigint(20) DEFAULT NULL, - `param13` decimal(65,30) DEFAULT NULL, - `param14` longtext, - `param15` longblob + `param13` decimal(65,38) DEFAULT NULL, + `param14` longtext DEFAULT NULL, + `param15` longblob DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 select * from t5 ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def test t5 t5 const01 const01 3 1 1 N 36865 0 63 def test t5 t5 param01 param01 8 20 1 Y 32768 0 63 def test t5 t5 const02 const02 246 4 3 N 36865 1 63 -def test t5 t5 param02 param02 246 67 32 Y 32768 30 63 +def test t5 t5 param02 param02 246 67 40 Y 32768 38 63 def test t5 t5 const03 const03 5 17 1 N 36865 31 63 def test t5 t5 param03 param03 5 23 1 Y 32768 31 63 def test t5 t5 const04 const04 253 3 3 N 4097 0 8 @@ -1830,13 +1830,13 @@ def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 def test t5 t5 const12 const12 254 0 0 Y 128 0 63 def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 -def test t5 t5 param13 param13 246 67 0 Y 32768 30 63 +def test t5 t5 param13 param13 246 67 0 Y 32768 38 63 def test t5 t5 param14 param14 252 4294967295 0 Y 16 0 8 def test t5 t5 param15 param15 252 4294967295 0 Y 144 0 63 const01 8 param01 8 const02 8.0 -param02 8.000000000000000000000000000000 +param02 8.00000000000000000000000000000000000000 const03 8 param03 8 const04 abc @@ -1928,28 +1928,28 @@ def @arg07 5 23 1 Y 32896 31 63 def @arg08 5 23 1 Y 32896 31 63 def @arg09 5 23 1 Y 32896 31 63 def @arg10 5 23 1 Y 32896 31 63 -def @arg11 246 83 6 Y 32896 30 63 -def @arg12 246 83 6 Y 32896 30 63 -def @arg13 250 16777215 10 Y 0 31 8 -def @arg14 250 16777215 19 Y 0 31 8 -def @arg15 250 16777215 19 Y 0 31 8 -def @arg16 250 16777215 8 Y 0 31 8 +def @arg11 246 83 6 Y 32896 38 63 +def @arg12 246 83 6 Y 32896 38 63 +def @arg13 250 16777215 10 Y 0 39 8 +def @arg14 250 16777215 19 Y 0 39 8 +def @arg15 250 16777215 19 Y 0 39 8 +def @arg16 250 16777215 8 Y 0 39 8 def @arg17 8 20 4 Y 32928 0 63 def @arg18 8 20 1 Y 32896 0 63 def @arg19 8 20 1 Y 32896 0 63 -def @arg20 250 16777215 1 Y 0 31 8 -def @arg21 250 16777215 10 Y 0 31 8 -def @arg22 250 16777215 30 Y 0 31 8 -def @arg23 250 16777215 8 Y 128 31 63 -def @arg24 250 16777215 8 Y 0 31 8 -def @arg25 250 16777215 4 Y 128 31 63 -def @arg26 250 16777215 4 Y 0 31 8 -def @arg27 250 16777215 10 Y 128 31 63 -def @arg28 250 16777215 10 Y 0 31 8 -def @arg29 250 16777215 8 Y 128 31 63 -def @arg30 250 16777215 8 Y 0 31 8 -def @arg31 250 16777215 3 Y 0 31 8 -def @arg32 250 16777215 6 Y 0 31 8 +def @arg20 250 16777215 1 Y 0 39 8 +def @arg21 250 16777215 10 Y 0 39 8 +def @arg22 250 16777215 30 Y 0 39 8 +def @arg23 250 16777215 8 Y 128 39 63 +def @arg24 250 16777215 8 Y 0 39 8 +def @arg25 250 16777215 4 Y 128 39 63 +def @arg26 250 16777215 4 Y 0 39 8 +def @arg27 250 16777215 10 Y 128 39 63 +def @arg28 250 16777215 10 Y 0 39 8 +def @arg29 250 16777215 8 Y 128 39 63 +def @arg30 250 16777215 8 Y 0 39 8 +def @arg31 250 16777215 3 Y 0 39 8 +def @arg32 250 16777215 6 Y 0 39 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, @@ -1975,28 +1975,28 @@ def @arg07 5 23 0 Y 32896 31 63 def @arg08 5 23 0 Y 32896 31 63 def @arg09 5 23 0 Y 32896 31 63 def @arg10 5 23 0 Y 32896 31 63 -def @arg11 246 83 0 Y 32896 30 63 -def @arg12 246 83 0 Y 32896 30 63 -def @arg13 250 16777215 0 Y 0 31 8 -def @arg14 250 16777215 0 Y 0 31 8 -def @arg15 250 16777215 19 Y 0 31 8 -def @arg16 250 16777215 0 Y 0 31 8 +def @arg11 246 83 0 Y 32896 38 63 +def @arg12 246 83 0 Y 32896 38 63 +def @arg13 250 16777215 0 Y 0 39 8 +def @arg14 250 16777215 0 Y 0 39 8 +def @arg15 250 16777215 19 Y 0 39 8 +def @arg16 250 16777215 0 Y 0 39 8 def @arg17 8 20 0 Y 32928 0 63 def @arg18 8 20 0 Y 32896 0 63 def @arg19 8 20 0 Y 32896 0 63 -def @arg20 250 16777215 0 Y 0 31 8 -def @arg21 250 16777215 0 Y 0 31 8 -def @arg22 250 16777215 0 Y 0 31 8 -def @arg23 250 16777215 0 Y 128 31 63 -def @arg24 250 16777215 0 Y 0 31 8 -def @arg25 250 16777215 0 Y 128 31 63 -def @arg26 250 16777215 0 Y 0 31 8 -def @arg27 250 16777215 0 Y 128 31 63 -def @arg28 250 16777215 0 Y 0 31 8 -def @arg29 250 16777215 0 Y 128 31 63 -def @arg30 250 16777215 0 Y 0 31 8 -def @arg31 250 16777215 0 Y 0 31 8 -def @arg32 250 16777215 0 Y 0 31 8 +def @arg20 250 16777215 0 Y 0 39 8 +def @arg21 250 16777215 0 Y 0 39 8 +def @arg22 250 16777215 0 Y 0 39 8 +def @arg23 250 16777215 0 Y 128 39 63 +def @arg24 250 16777215 0 Y 0 39 8 +def @arg25 250 16777215 0 Y 128 39 63 +def @arg26 250 16777215 0 Y 0 39 8 +def @arg27 250 16777215 0 Y 128 39 63 +def @arg28 250 16777215 0 Y 0 39 8 +def @arg29 250 16777215 0 Y 128 39 63 +def @arg30 250 16777215 0 Y 0 39 8 +def @arg31 250 16777215 0 Y 0 39 8 +def @arg32 250 16777215 0 Y 0 39 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select @@ -2025,28 +2025,28 @@ def @arg07 5 23 1 Y 32896 31 63 def @arg08 5 23 1 Y 32896 31 63 def @arg09 5 23 1 Y 32896 31 63 def @arg10 5 23 1 Y 32896 31 63 -def @arg11 246 83 6 Y 32896 30 63 -def @arg12 246 83 6 Y 32896 30 63 -def @arg13 250 16777215 10 Y 0 31 8 -def @arg14 250 16777215 19 Y 0 31 8 -def @arg15 250 16777215 19 Y 0 31 8 -def @arg16 250 16777215 8 Y 0 31 8 +def @arg11 246 83 6 Y 32896 38 63 +def @arg12 246 83 6 Y 32896 38 63 +def @arg13 250 16777215 10 Y 0 39 8 +def @arg14 250 16777215 19 Y 0 39 8 +def @arg15 250 16777215 19 Y 0 39 8 +def @arg16 250 16777215 8 Y 0 39 8 def @arg17 8 20 4 Y 32928 0 63 def @arg18 8 20 1 Y 32896 0 63 def @arg19 8 20 1 Y 32896 0 63 -def @arg20 250 16777215 1 Y 0 31 8 -def @arg21 250 16777215 10 Y 0 31 8 -def @arg22 250 16777215 30 Y 0 31 8 -def @arg23 250 16777215 8 Y 128 31 63 -def @arg24 250 16777215 8 Y 0 31 8 -def @arg25 250 16777215 4 Y 128 31 63 -def @arg26 250 16777215 4 Y 0 31 8 -def @arg27 250 16777215 10 Y 128 31 63 -def @arg28 250 16777215 10 Y 0 31 8 -def @arg29 250 16777215 8 Y 128 31 63 -def @arg30 250 16777215 8 Y 0 31 8 -def @arg31 250 16777215 3 Y 0 31 8 -def @arg32 250 16777215 6 Y 0 31 8 +def @arg20 250 16777215 1 Y 0 39 8 +def @arg21 250 16777215 10 Y 0 39 8 +def @arg22 250 16777215 30 Y 0 39 8 +def @arg23 250 16777215 8 Y 128 39 63 +def @arg24 250 16777215 8 Y 0 39 8 +def @arg25 250 16777215 4 Y 128 39 63 +def @arg26 250 16777215 4 Y 0 39 8 +def @arg27 250 16777215 10 Y 128 39 63 +def @arg28 250 16777215 10 Y 0 39 8 +def @arg29 250 16777215 8 Y 128 39 63 +def @arg30 250 16777215 8 Y 0 39 8 +def @arg31 250 16777215 3 Y 0 39 8 +def @arg32 250 16777215 6 Y 0 39 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; @@ -2065,28 +2065,28 @@ def @arg07 5 23 0 Y 32896 31 63 def @arg08 5 23 0 Y 32896 31 63 def @arg09 5 23 0 Y 32896 31 63 def @arg10 5 23 0 Y 32896 31 63 -def @arg11 246 83 0 Y 32896 30 63 -def @arg12 246 83 0 Y 32896 30 63 -def @arg13 250 16777215 0 Y 0 31 8 -def @arg14 250 16777215 0 Y 0 31 8 -def @arg15 250 16777215 19 Y 0 31 8 -def @arg16 250 16777215 0 Y 0 31 8 +def @arg11 246 83 0 Y 32896 38 63 +def @arg12 246 83 0 Y 32896 38 63 +def @arg13 250 16777215 0 Y 0 39 8 +def @arg14 250 16777215 0 Y 0 39 8 +def @arg15 250 16777215 19 Y 0 39 8 +def @arg16 250 16777215 0 Y 0 39 8 def @arg17 8 20 0 Y 32928 0 63 def @arg18 8 20 0 Y 32896 0 63 def @arg19 8 20 0 Y 32896 0 63 -def @arg20 250 16777215 0 Y 0 31 8 -def @arg21 250 16777215 0 Y 0 31 8 -def @arg22 250 16777215 0 Y 0 31 8 -def @arg23 250 16777215 0 Y 128 31 63 -def @arg24 250 16777215 0 Y 0 31 8 -def @arg25 250 16777215 0 Y 128 31 63 -def @arg26 250 16777215 0 Y 0 31 8 -def @arg27 250 16777215 0 Y 128 31 63 -def @arg28 250 16777215 0 Y 0 31 8 -def @arg29 250 16777215 0 Y 128 31 63 -def @arg30 250 16777215 0 Y 0 31 8 -def @arg31 250 16777215 0 Y 0 31 8 -def @arg32 250 16777215 0 Y 0 31 8 +def @arg20 250 16777215 0 Y 0 39 8 +def @arg21 250 16777215 0 Y 0 39 8 +def @arg22 250 16777215 0 Y 0 39 8 +def @arg23 250 16777215 0 Y 128 39 63 +def @arg24 250 16777215 0 Y 0 39 8 +def @arg25 250 16777215 0 Y 128 39 63 +def @arg26 250 16777215 0 Y 0 39 8 +def @arg27 250 16777215 0 Y 128 39 63 +def @arg28 250 16777215 0 Y 0 39 8 +def @arg29 250 16777215 0 Y 128 39 63 +def @arg30 250 16777215 0 Y 0 39 8 +def @arg31 250 16777215 0 Y 0 39 8 +def @arg32 250 16777215 0 Y 0 39 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select ? := c1 from t9 where c1= 1" ; @@ -2113,28 +2113,28 @@ def @arg07 5 23 1 Y 32896 31 63 def @arg08 5 23 1 Y 32896 31 63 def @arg09 5 23 1 Y 32896 31 63 def @arg10 5 23 1 Y 32896 31 63 -def @arg11 246 83 6 Y 32896 30 63 -def @arg12 246 83 6 Y 32896 30 63 -def @arg13 250 16777215 10 Y 0 31 8 -def @arg14 250 16777215 19 Y 0 31 8 -def @arg15 250 16777215 19 Y 0 31 8 -def @arg16 250 16777215 8 Y 0 31 8 +def @arg11 246 83 6 Y 32896 38 63 +def @arg12 246 83 6 Y 32896 38 63 +def @arg13 250 16777215 10 Y 0 39 8 +def @arg14 250 16777215 19 Y 0 39 8 +def @arg15 250 16777215 19 Y 0 39 8 +def @arg16 250 16777215 8 Y 0 39 8 def @arg17 8 20 4 Y 32928 0 63 def @arg18 8 20 1 Y 32896 0 63 def @arg19 8 20 1 Y 32896 0 63 -def @arg20 250 16777215 1 Y 0 31 8 -def @arg21 250 16777215 10 Y 0 31 8 -def @arg22 250 16777215 30 Y 0 31 8 -def @arg23 250 16777215 8 Y 128 31 63 -def @arg24 250 16777215 8 Y 0 31 8 -def @arg25 250 16777215 4 Y 128 31 63 -def @arg26 250 16777215 4 Y 0 31 8 -def @arg27 250 16777215 10 Y 128 31 63 -def @arg28 250 16777215 10 Y 0 31 8 -def @arg29 250 16777215 8 Y 128 31 63 -def @arg30 250 16777215 8 Y 0 31 8 -def @arg31 250 16777215 3 Y 0 31 8 -def @arg32 250 16777215 6 Y 0 31 8 +def @arg20 250 16777215 1 Y 0 39 8 +def @arg21 250 16777215 10 Y 0 39 8 +def @arg22 250 16777215 30 Y 0 39 8 +def @arg23 250 16777215 8 Y 128 39 63 +def @arg24 250 16777215 8 Y 0 39 8 +def @arg25 250 16777215 4 Y 128 39 63 +def @arg26 250 16777215 4 Y 0 39 8 +def @arg27 250 16777215 10 Y 128 39 63 +def @arg28 250 16777215 10 Y 0 39 8 +def @arg29 250 16777215 8 Y 128 39 63 +def @arg30 250 16777215 8 Y 0 39 8 +def @arg31 250 16777215 3 Y 0 39 8 +def @arg32 250 16777215 6 Y 0 39 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, @@ -2157,28 +2157,28 @@ def @arg07 5 23 0 Y 32896 31 63 def @arg08 5 23 0 Y 32896 31 63 def @arg09 5 23 0 Y 32896 31 63 def @arg10 5 23 0 Y 32896 31 63 -def @arg11 246 83 0 Y 32896 30 63 -def @arg12 246 83 0 Y 32896 30 63 -def @arg13 250 16777215 0 Y 0 31 8 -def @arg14 250 16777215 0 Y 0 31 8 -def @arg15 250 16777215 19 Y 0 31 8 -def @arg16 250 16777215 0 Y 0 31 8 +def @arg11 246 83 0 Y 32896 38 63 +def @arg12 246 83 0 Y 32896 38 63 +def @arg13 250 16777215 0 Y 0 39 8 +def @arg14 250 16777215 0 Y 0 39 8 +def @arg15 250 16777215 19 Y 0 39 8 +def @arg16 250 16777215 0 Y 0 39 8 def @arg17 8 20 0 Y 32928 0 63 def @arg18 8 20 0 Y 32896 0 63 def @arg19 8 20 0 Y 32896 0 63 -def @arg20 250 16777215 0 Y 0 31 8 -def @arg21 250 16777215 0 Y 0 31 8 -def @arg22 250 16777215 0 Y 0 31 8 -def @arg23 250 16777215 0 Y 128 31 63 -def @arg24 250 16777215 0 Y 0 31 8 -def @arg25 250 16777215 0 Y 128 31 63 -def @arg26 250 16777215 0 Y 0 31 8 -def @arg27 250 16777215 0 Y 128 31 63 -def @arg28 250 16777215 0 Y 0 31 8 -def @arg29 250 16777215 0 Y 128 31 63 -def @arg30 250 16777215 0 Y 0 31 8 -def @arg31 250 16777215 0 Y 0 31 8 -def @arg32 250 16777215 0 Y 0 31 8 +def @arg20 250 16777215 0 Y 0 39 8 +def @arg21 250 16777215 0 Y 0 39 8 +def @arg22 250 16777215 0 Y 0 39 8 +def @arg23 250 16777215 0 Y 128 39 63 +def @arg24 250 16777215 0 Y 0 39 8 +def @arg25 250 16777215 0 Y 128 39 63 +def @arg26 250 16777215 0 Y 0 39 8 +def @arg27 250 16777215 0 Y 128 39 63 +def @arg28 250 16777215 0 Y 0 39 8 +def @arg29 250 16777215 0 Y 128 39 63 +def @arg30 250 16777215 0 Y 0 39 8 +def @arg31 250 16777215 0 Y 0 39 8 +def @arg32 250 16777215 0 Y 0 39 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, @@ -2203,28 +2203,28 @@ def @arg07 5 23 1 Y 32896 31 63 def @arg08 5 23 1 Y 32896 31 63 def @arg09 5 23 1 Y 32896 31 63 def @arg10 5 23 1 Y 32896 31 63 -def @arg11 246 83 6 Y 32896 30 63 -def @arg12 246 83 6 Y 32896 30 63 -def @arg13 250 16777215 10 Y 0 31 8 -def @arg14 250 16777215 19 Y 0 31 8 -def @arg15 250 16777215 19 Y 0 31 8 -def @arg16 250 16777215 8 Y 0 31 8 +def @arg11 246 83 6 Y 32896 38 63 +def @arg12 246 83 6 Y 32896 38 63 +def @arg13 250 16777215 10 Y 0 39 8 +def @arg14 250 16777215 19 Y 0 39 8 +def @arg15 250 16777215 19 Y 0 39 8 +def @arg16 250 16777215 8 Y 0 39 8 def @arg17 8 20 4 Y 32928 0 63 def @arg18 8 20 1 Y 32896 0 63 def @arg19 8 20 1 Y 32896 0 63 -def @arg20 250 16777215 1 Y 0 31 8 -def @arg21 250 16777215 10 Y 0 31 8 -def @arg22 250 16777215 30 Y 0 31 8 -def @arg23 250 16777215 8 Y 128 31 63 -def @arg24 250 16777215 8 Y 0 31 8 -def @arg25 250 16777215 4 Y 128 31 63 -def @arg26 250 16777215 4 Y 0 31 8 -def @arg27 250 16777215 10 Y 128 31 63 -def @arg28 250 16777215 10 Y 0 31 8 -def @arg29 250 16777215 8 Y 128 31 63 -def @arg30 250 16777215 8 Y 0 31 8 -def @arg31 250 16777215 3 Y 0 31 8 -def @arg32 250 16777215 6 Y 0 31 8 +def @arg20 250 16777215 1 Y 0 39 8 +def @arg21 250 16777215 10 Y 0 39 8 +def @arg22 250 16777215 30 Y 0 39 8 +def @arg23 250 16777215 8 Y 128 39 63 +def @arg24 250 16777215 8 Y 0 39 8 +def @arg25 250 16777215 4 Y 128 39 63 +def @arg26 250 16777215 4 Y 0 39 8 +def @arg27 250 16777215 10 Y 128 39 63 +def @arg28 250 16777215 10 Y 0 39 8 +def @arg29 250 16777215 8 Y 128 39 63 +def @arg30 250 16777215 8 Y 0 39 8 +def @arg31 250 16777215 3 Y 0 39 8 +def @arg32 250 16777215 6 Y 0 39 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; @@ -2241,28 +2241,28 @@ def @arg07 5 23 0 Y 32896 31 63 def @arg08 5 23 0 Y 32896 31 63 def @arg09 5 23 0 Y 32896 31 63 def @arg10 5 23 0 Y 32896 31 63 -def @arg11 246 83 0 Y 32896 30 63 -def @arg12 246 83 0 Y 32896 30 63 -def @arg13 250 16777215 0 Y 0 31 8 -def @arg14 250 16777215 0 Y 0 31 8 -def @arg15 250 16777215 19 Y 0 31 8 -def @arg16 250 16777215 0 Y 0 31 8 +def @arg11 246 83 0 Y 32896 38 63 +def @arg12 246 83 0 Y 32896 38 63 +def @arg13 250 16777215 0 Y 0 39 8 +def @arg14 250 16777215 0 Y 0 39 8 +def @arg15 250 16777215 19 Y 0 39 8 +def @arg16 250 16777215 0 Y 0 39 8 def @arg17 8 20 0 Y 32928 0 63 def @arg18 8 20 0 Y 32896 0 63 def @arg19 8 20 0 Y 32896 0 63 -def @arg20 250 16777215 0 Y 0 31 8 -def @arg21 250 16777215 0 Y 0 31 8 -def @arg22 250 16777215 0 Y 0 31 8 -def @arg23 250 16777215 0 Y 128 31 63 -def @arg24 250 16777215 0 Y 0 31 8 -def @arg25 250 16777215 0 Y 128 31 63 -def @arg26 250 16777215 0 Y 0 31 8 -def @arg27 250 16777215 0 Y 128 31 63 -def @arg28 250 16777215 0 Y 0 31 8 -def @arg29 250 16777215 0 Y 128 31 63 -def @arg30 250 16777215 0 Y 0 31 8 -def @arg31 250 16777215 0 Y 0 31 8 -def @arg32 250 16777215 0 Y 0 31 8 +def @arg20 250 16777215 0 Y 0 39 8 +def @arg21 250 16777215 0 Y 0 39 8 +def @arg22 250 16777215 0 Y 0 39 8 +def @arg23 250 16777215 0 Y 128 39 63 +def @arg24 250 16777215 0 Y 0 39 8 +def @arg25 250 16777215 0 Y 128 39 63 +def @arg26 250 16777215 0 Y 0 39 8 +def @arg27 250 16777215 0 Y 128 39 63 +def @arg28 250 16777215 0 Y 0 39 8 +def @arg29 250 16777215 0 Y 128 39 63 +def @arg30 250 16777215 0 Y 0 39 8 +def @arg31 250 16777215 0 Y 0 39 8 +def @arg32 250 16777215 0 Y 0 39 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select c1 into ? from t9 where c1= 1" ; diff --git a/mysql-test/suite/parts/inc/partition_fail_t2.inc b/mysql-test/suite/parts/inc/partition_fail_t2.inc index 3904ec8662c..12cac51db4d 100644 --- a/mysql-test/suite/parts/inc/partition_fail_t2.inc +++ b/mysql-test/suite/parts/inc/partition_fail_t2.inc @@ -1,4 +1,4 @@ -# Include file to to test failure with error injection. +# Include file to test failure with error injection. # To be used with WL#4445: EXCHANGE PARTITION WITH TABLE. --eval $create_statement2 --eval $insert_statement2 diff --git a/mysql-test/suite/parts/r/partition_alter1_1_2_innodb.result b/mysql-test/suite/parts/r/partition_alter1_1_2_innodb.result index 34fcba6ae87..c55fab0f5cc 100644 --- a/mysql-test/suite/parts/r/partition_alter1_1_2_innodb.result +++ b/mysql-test/suite/parts/r/partition_alter1_1_2_innodb.result @@ -68,8 +68,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -560,8 +560,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -1060,8 +1060,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -1565,8 +1565,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -2064,8 +2064,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -2567,8 +2567,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -3077,8 +3077,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -3585,8 +3585,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -4082,8 +4082,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -4574,8 +4574,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -5074,8 +5074,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -5579,8 +5579,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -6078,8 +6078,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -6581,8 +6581,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -7091,8 +7091,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -7599,8 +7599,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -8097,8 +8097,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -8605,8 +8605,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -9121,8 +9121,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -9642,8 +9642,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -10157,8 +10157,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -10676,8 +10676,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -11202,8 +11202,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -11726,8 +11726,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -12239,8 +12239,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -12747,8 +12747,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -13263,8 +13263,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -13784,8 +13784,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -14299,8 +14299,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -14818,8 +14818,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -15344,8 +15344,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -15868,8 +15868,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -16382,8 +16382,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -16875,8 +16875,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -17376,8 +17376,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -17882,8 +17882,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -18382,8 +18382,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -18886,8 +18886,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -19397,8 +19397,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -19906,8 +19906,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -20404,8 +20404,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -20897,8 +20897,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -21398,8 +21398,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -21904,8 +21904,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -22404,8 +22404,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -22908,8 +22908,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -23419,8 +23419,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -23928,8 +23928,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -24426,8 +24426,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -24919,8 +24919,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -25420,8 +25420,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -25926,8 +25926,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -26426,8 +26426,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -26930,8 +26930,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -27441,8 +27441,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -27950,8 +27950,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, diff --git a/mysql-test/suite/parts/r/partition_alter1_1_2_myisam.result b/mysql-test/suite/parts/r/partition_alter1_1_2_myisam.result index 018bc4e9287..3d5548c340b 100644 --- a/mysql-test/suite/parts/r/partition_alter1_1_2_myisam.result +++ b/mysql-test/suite/parts/r/partition_alter1_1_2_myisam.result @@ -68,8 +68,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -585,8 +585,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -1116,8 +1116,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -1658,8 +1658,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -2190,8 +2190,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -2730,8 +2730,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -3277,8 +3277,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -3822,8 +3822,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -4358,8 +4358,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -4875,8 +4875,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -5406,8 +5406,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -5948,8 +5948,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -6480,8 +6480,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -7020,8 +7020,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -7567,8 +7567,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -8112,8 +8112,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, diff --git a/mysql-test/suite/parts/r/partition_alter1_1_innodb.result b/mysql-test/suite/parts/r/partition_alter1_1_innodb.result index c05abfbcaed..29aaa2713c1 100644 --- a/mysql-test/suite/parts/r/partition_alter1_1_innodb.result +++ b/mysql-test/suite/parts/r/partition_alter1_1_innodb.result @@ -386,8 +386,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -878,8 +878,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -1378,8 +1378,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -1883,8 +1883,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -2382,8 +2382,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -2887,8 +2887,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -3397,8 +3397,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -3905,8 +3905,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -4402,8 +4402,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -4894,8 +4894,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -5394,8 +5394,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -5899,8 +5899,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -6398,8 +6398,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -6903,8 +6903,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -7413,8 +7413,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -7921,8 +7921,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -8419,8 +8419,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -8927,8 +8927,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -9443,8 +9443,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -9964,8 +9964,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -10479,8 +10479,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -11000,8 +11000,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -11526,8 +11526,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -12050,8 +12050,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -12563,8 +12563,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -13071,8 +13071,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -13587,8 +13587,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -14108,8 +14108,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -14623,8 +14623,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -15144,8 +15144,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -15670,8 +15670,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -16194,8 +16194,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, diff --git a/mysql-test/suite/parts/r/partition_alter1_1_myisam.result b/mysql-test/suite/parts/r/partition_alter1_1_myisam.result index 514afd88a20..4f724d3c8b2 100644 --- a/mysql-test/suite/parts/r/partition_alter1_1_myisam.result +++ b/mysql-test/suite/parts/r/partition_alter1_1_myisam.result @@ -227,8 +227,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -744,8 +744,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -1275,8 +1275,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -1817,8 +1817,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -2349,8 +2349,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -2891,8 +2891,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -3438,8 +3438,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -3983,8 +3983,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -4519,8 +4519,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -5036,8 +5036,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -5567,8 +5567,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -6109,8 +6109,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -6641,8 +6641,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -7183,8 +7183,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -7730,8 +7730,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -8275,8 +8275,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, diff --git a/mysql-test/suite/parts/r/partition_alter1_2_innodb.result b/mysql-test/suite/parts/r/partition_alter1_2_innodb.result index 8ab37aafcbe..d52a3180124 100644 --- a/mysql-test/suite/parts/r/partition_alter1_2_innodb.result +++ b/mysql-test/suite/parts/r/partition_alter1_2_innodb.result @@ -67,8 +67,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -507,8 +507,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -955,8 +955,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -1408,8 +1408,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -1855,8 +1855,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -2308,8 +2308,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -2766,8 +2766,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -3222,8 +3222,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -3667,8 +3667,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -4107,8 +4107,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -4555,8 +4555,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -5008,8 +5008,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -5455,8 +5455,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -5908,8 +5908,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -6366,8 +6366,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -6822,8 +6822,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -7267,8 +7267,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -7723,8 +7723,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -8187,8 +8187,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -8656,8 +8656,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -9119,8 +9119,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -9588,8 +9588,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -10062,8 +10062,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -10534,8 +10534,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -10999,8 +10999,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -11439,8 +11439,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -11887,8 +11887,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -12340,8 +12340,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -12787,8 +12787,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -13238,8 +13238,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -13696,8 +13696,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -14152,8 +14152,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -14597,8 +14597,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -15037,8 +15037,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -15485,8 +15485,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -15938,8 +15938,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -16385,8 +16385,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -16836,8 +16836,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -17294,8 +17294,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -17750,8 +17750,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -18196,8 +18196,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -18652,8 +18652,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -19116,8 +19116,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -19585,8 +19585,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -20048,8 +20048,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -20515,8 +20515,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -20989,8 +20989,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -21461,8 +21461,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -21922,8 +21922,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -22378,8 +22378,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -22842,8 +22842,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -23311,8 +23311,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -23774,8 +23774,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -24241,8 +24241,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -24715,8 +24715,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -25187,8 +25187,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -25649,8 +25649,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -26089,8 +26089,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -26537,8 +26537,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -26990,8 +26990,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -27437,8 +27437,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -27888,8 +27888,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -28346,8 +28346,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -28802,8 +28802,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -29247,8 +29247,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -29687,8 +29687,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -30135,8 +30135,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -30588,8 +30588,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -31035,8 +31035,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -31486,8 +31486,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -31944,8 +31944,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -32400,8 +32400,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -32845,8 +32845,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -33301,8 +33301,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -33765,8 +33765,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -34234,8 +34234,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -34697,8 +34697,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -35164,8 +35164,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -35638,8 +35638,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -36110,8 +36110,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL diff --git a/mysql-test/suite/parts/r/partition_alter1_2_myisam.result b/mysql-test/suite/parts/r/partition_alter1_2_myisam.result index d998e264522..6f9a2486fbe 100644 --- a/mysql-test/suite/parts/r/partition_alter1_2_myisam.result +++ b/mysql-test/suite/parts/r/partition_alter1_2_myisam.result @@ -66,8 +66,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -531,8 +531,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -1010,8 +1010,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -1500,8 +1500,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -1980,8 +1980,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -2470,8 +2470,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -2965,8 +2965,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -3458,8 +3458,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -3946,8 +3946,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -4411,8 +4411,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -4890,8 +4890,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -5380,8 +5380,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -5860,8 +5860,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -6348,8 +6348,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -6843,8 +6843,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -7336,8 +7336,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -7820,8 +7820,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -8285,8 +8285,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -8764,8 +8764,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -9254,8 +9254,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -9734,8 +9734,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -10222,8 +10222,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -10717,8 +10717,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -11210,8 +11210,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -11694,8 +11694,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -12159,8 +12159,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -12638,8 +12638,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -13128,8 +13128,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -13608,8 +13608,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -14096,8 +14096,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -14591,8 +14591,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -15084,8 +15084,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL diff --git a/mysql-test/suite/parts/r/partition_alter2_1_1_innodb.result b/mysql-test/suite/parts/r/partition_alter2_1_1_innodb.result index efc81603b5a..06dd78b69dc 100644 --- a/mysql-test/suite/parts/r/partition_alter2_1_1_innodb.result +++ b/mysql-test/suite/parts/r/partition_alter2_1_1_innodb.result @@ -68,7 +68,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -524,7 +524,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -988,7 +988,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -1457,7 +1457,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -1920,7 +1920,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -2389,7 +2389,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -2863,7 +2863,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -3335,7 +3335,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -3797,7 +3797,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, `f_int2` bigint(20) NOT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -4291,7 +4291,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, `f_int2` bigint(20) NOT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -4793,7 +4793,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, `f_int2` bigint(20) NOT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -5300,7 +5300,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, `f_int2` bigint(20) NOT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -5801,7 +5801,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, `f_int2` bigint(20) NOT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -6308,7 +6308,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, `f_int2` bigint(20) NOT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -6820,7 +6820,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, `f_int2` bigint(20) NOT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -7330,7 +7330,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, `f_int2` bigint(20) NOT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -7829,7 +7829,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, `f_int2` bigint(20) NOT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -8323,7 +8323,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, `f_int2` bigint(20) NOT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -8825,7 +8825,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, `f_int2` bigint(20) NOT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -9332,7 +9332,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, `f_int2` bigint(20) NOT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -9833,7 +9833,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, `f_int2` bigint(20) NOT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -10340,7 +10340,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, `f_int2` bigint(20) NOT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -10852,7 +10852,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, `f_int2` bigint(20) NOT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -11362,7 +11362,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, `f_int2` bigint(20) NOT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -11862,7 +11862,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -12370,7 +12370,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -12886,7 +12886,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -13407,7 +13407,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -13922,7 +13922,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -14443,7 +14443,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -14969,7 +14969,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -15493,7 +15493,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -16006,7 +16006,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -16514,7 +16514,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -17030,7 +17030,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -17551,7 +17551,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -18066,7 +18066,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -18587,7 +18587,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -19113,7 +19113,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -19637,7 +19637,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, diff --git a/mysql-test/suite/parts/r/partition_alter2_1_maria.result b/mysql-test/suite/parts/r/partition_alter2_1_maria.result index 1182794ff05..1905c5c25ae 100644 --- a/mysql-test/suite/parts/r/partition_alter2_1_maria.result +++ b/mysql-test/suite/parts/r/partition_alter2_1_maria.result @@ -68,7 +68,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -533,7 +533,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -1012,7 +1012,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -1502,7 +1502,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -1982,7 +1982,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -2472,7 +2472,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -2967,7 +2967,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -3460,7 +3460,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -3945,7 +3945,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -4462,7 +4462,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -4993,7 +4993,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -5535,7 +5535,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -6067,7 +6067,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -6609,7 +6609,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -7156,7 +7156,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -7701,7 +7701,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -8237,7 +8237,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -8754,7 +8754,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -9285,7 +9285,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -9827,7 +9827,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -10359,7 +10359,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -10901,7 +10901,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -11448,7 +11448,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -11993,7 +11993,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, diff --git a/mysql-test/suite/parts/r/partition_alter2_1_myisam.result b/mysql-test/suite/parts/r/partition_alter2_1_myisam.result index c6f68a5882e..3a31fa905e1 100644 --- a/mysql-test/suite/parts/r/partition_alter2_1_myisam.result +++ b/mysql-test/suite/parts/r/partition_alter2_1_myisam.result @@ -68,7 +68,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -533,7 +533,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -1012,7 +1012,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -1502,7 +1502,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -1982,7 +1982,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -2472,7 +2472,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -2967,7 +2967,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -3460,7 +3460,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -3945,7 +3945,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -4462,7 +4462,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -4993,7 +4993,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -5535,7 +5535,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -6067,7 +6067,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -6609,7 +6609,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -7156,7 +7156,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -7701,7 +7701,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -8237,7 +8237,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -8754,7 +8754,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -9285,7 +9285,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -9827,7 +9827,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -10359,7 +10359,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -10901,7 +10901,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -11448,7 +11448,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -11993,7 +11993,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` bigint(20) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, diff --git a/mysql-test/suite/parts/r/partition_alter2_2_1_innodb.result b/mysql-test/suite/parts/r/partition_alter2_2_1_innodb.result index 2c8ec37d844..1b5fbc437cc 100644 --- a/mysql-test/suite/parts/r/partition_alter2_2_1_innodb.result +++ b/mysql-test/suite/parts/r/partition_alter2_2_1_innodb.result @@ -68,7 +68,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -526,7 +526,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -992,7 +992,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -1463,7 +1463,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -1926,7 +1926,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -2397,7 +2397,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -2871,7 +2871,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -3345,7 +3345,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -3808,7 +3808,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, `f_int2` mediumint(9) NOT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -4304,7 +4304,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, `f_int2` mediumint(9) NOT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -4808,7 +4808,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, `f_int2` mediumint(9) NOT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -5317,7 +5317,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, `f_int2` mediumint(9) NOT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -5818,7 +5818,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, `f_int2` mediumint(9) NOT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -6327,7 +6327,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, `f_int2` mediumint(9) NOT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -6839,7 +6839,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, `f_int2` mediumint(9) NOT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -7351,7 +7351,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, `f_int2` mediumint(9) NOT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -7852,7 +7852,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, `f_int2` mediumint(9) NOT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -8348,7 +8348,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, `f_int2` mediumint(9) NOT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -8852,7 +8852,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, `f_int2` mediumint(9) NOT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -9361,7 +9361,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, `f_int2` mediumint(9) NOT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -9862,7 +9862,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, `f_int2` mediumint(9) NOT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -10371,7 +10371,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, `f_int2` mediumint(9) NOT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -10883,7 +10883,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, `f_int2` mediumint(9) NOT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -11395,7 +11395,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, `f_int2` mediumint(9) NOT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -11897,7 +11897,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -12407,7 +12407,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -12925,7 +12925,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -13448,7 +13448,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -13963,7 +13963,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -14486,7 +14486,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -15012,7 +15012,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -15538,7 +15538,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -16053,7 +16053,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -16563,7 +16563,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -17081,7 +17081,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -17604,7 +17604,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -18119,7 +18119,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -18642,7 +18642,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -19168,7 +19168,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -19694,7 +19694,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, diff --git a/mysql-test/suite/parts/r/partition_alter2_2_maria.result b/mysql-test/suite/parts/r/partition_alter2_2_maria.result index 7eaffd200ce..9407be53e04 100644 --- a/mysql-test/suite/parts/r/partition_alter2_2_maria.result +++ b/mysql-test/suite/parts/r/partition_alter2_2_maria.result @@ -68,7 +68,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -535,7 +535,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -1016,7 +1016,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -1508,7 +1508,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -1988,7 +1988,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -2480,7 +2480,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -2975,7 +2975,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -3470,7 +3470,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -3957,7 +3957,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -4476,7 +4476,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -5009,7 +5009,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -5553,7 +5553,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -6085,7 +6085,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -6629,7 +6629,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -7176,7 +7176,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -7723,7 +7723,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -8261,7 +8261,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -8780,7 +8780,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -9313,7 +9313,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -9857,7 +9857,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -10389,7 +10389,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -10933,7 +10933,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -11480,7 +11480,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -12027,7 +12027,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, diff --git a/mysql-test/suite/parts/r/partition_alter2_2_myisam.result b/mysql-test/suite/parts/r/partition_alter2_2_myisam.result index 85ace90e88c..f2a450686f5 100644 --- a/mysql-test/suite/parts/r/partition_alter2_2_myisam.result +++ b/mysql-test/suite/parts/r/partition_alter2_2_myisam.result @@ -68,7 +68,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -535,7 +535,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -1016,7 +1016,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -1508,7 +1508,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -1988,7 +1988,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -2480,7 +2480,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -2975,7 +2975,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -3470,7 +3470,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -3957,7 +3957,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -4476,7 +4476,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -5009,7 +5009,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -5553,7 +5553,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -6085,7 +6085,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -6629,7 +6629,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -7176,7 +7176,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -7723,7 +7723,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -8261,7 +8261,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -8780,7 +8780,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -9313,7 +9313,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -9857,7 +9857,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -10389,7 +10389,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -10933,7 +10933,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -11480,7 +11480,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, @@ -12027,7 +12027,7 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, `f_int2` mediumint(9) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, diff --git a/mysql-test/suite/parts/r/partition_alter3_innodb.result b/mysql-test/suite/parts/r/partition_alter3_innodb.result index a1718453c11..2bb1bcc2433 100644 --- a/mysql-test/suite/parts/r/partition_alter3_innodb.result +++ b/mysql-test/suite/parts/r/partition_alter3_innodb.result @@ -440,8 +440,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -463,8 +463,8 @@ ALTER TABLE t1 PARTITION BY KEY(f_int1); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -489,8 +489,8 @@ ALTER TABLE t1 ADD PARTITION (PARTITION part1, PARTITION part7); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -515,8 +515,8 @@ ALTER TABLE t1 ADD PARTITION (PARTITION part2); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -543,8 +543,8 @@ ALTER TABLE t1 ADD PARTITION PARTITIONS 4; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -586,8 +586,8 @@ ALTER TABLE t1 COALESCE PARTITION 1; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -619,8 +619,8 @@ ALTER TABLE t1 COALESCE PARTITION 1; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -650,8 +650,8 @@ ALTER TABLE t1 COALESCE PARTITION 1; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -679,8 +679,8 @@ ALTER TABLE t1 COALESCE PARTITION 1; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -706,8 +706,8 @@ ALTER TABLE t1 COALESCE PARTITION 1; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -731,8 +731,8 @@ ALTER TABLE t1 COALESCE PARTITION 1; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -754,8 +754,8 @@ ALTER TABLE t1 COALESCE PARTITION 1; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -779,8 +779,8 @@ ALTER TABLE t1 REMOVE PARTITIONING; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL diff --git a/mysql-test/suite/parts/r/partition_alter3_myisam.result b/mysql-test/suite/parts/r/partition_alter3_myisam.result index 8bee02a3096..2a2ae74d8bd 100644 --- a/mysql-test/suite/parts/r/partition_alter3_myisam.result +++ b/mysql-test/suite/parts/r/partition_alter3_myisam.result @@ -482,8 +482,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -506,8 +506,8 @@ ALTER TABLE t1 PARTITION BY KEY(f_int1); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -533,8 +533,8 @@ ALTER TABLE t1 ADD PARTITION (PARTITION part1, PARTITION part7); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -562,8 +562,8 @@ ALTER TABLE t1 ADD PARTITION (PARTITION part2); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -594,8 +594,8 @@ ALTER TABLE t1 ADD PARTITION PARTITIONS 4; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -645,8 +645,8 @@ ALTER TABLE t1 COALESCE PARTITION 1; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -685,8 +685,8 @@ ALTER TABLE t1 COALESCE PARTITION 1; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -722,8 +722,8 @@ ALTER TABLE t1 COALESCE PARTITION 1; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -756,8 +756,8 @@ ALTER TABLE t1 COALESCE PARTITION 1; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -787,8 +787,8 @@ ALTER TABLE t1 COALESCE PARTITION 1; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -815,8 +815,8 @@ ALTER TABLE t1 COALESCE PARTITION 1; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -840,8 +840,8 @@ ALTER TABLE t1 COALESCE PARTITION 1; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -866,8 +866,8 @@ ALTER TABLE t1 REMOVE PARTITIONING; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL diff --git a/mysql-test/suite/parts/r/partition_alter4_innodb.result b/mysql-test/suite/parts/r/partition_alter4_innodb.result index f51d6e5cb02..5bdf4ac0ab1 100644 --- a/mysql-test/suite/parts/r/partition_alter4_innodb.result +++ b/mysql-test/suite/parts/r/partition_alter4_innodb.result @@ -69,8 +69,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -528,8 +528,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -998,8 +998,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -1469,8 +1469,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -1934,8 +1934,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -2405,8 +2405,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -2881,8 +2881,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -3355,8 +3355,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -3819,8 +3819,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -4278,8 +4278,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -4748,8 +4748,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -5219,8 +5219,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -5684,8 +5684,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -6155,8 +6155,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -6631,8 +6631,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -7105,8 +7105,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -7569,8 +7569,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -8028,8 +8028,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -8498,8 +8498,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -8969,8 +8969,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -9434,8 +9434,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -9905,8 +9905,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -10381,8 +10381,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -10855,8 +10855,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -11319,8 +11319,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -11778,8 +11778,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -12248,8 +12248,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -12719,8 +12719,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -13184,8 +13184,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -13655,8 +13655,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -14131,8 +14131,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -14605,8 +14605,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -15069,8 +15069,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -15528,8 +15528,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -15998,8 +15998,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -16469,8 +16469,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -16934,8 +16934,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -17405,8 +17405,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -17881,8 +17881,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -18355,8 +18355,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -18822,8 +18822,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -19281,8 +19281,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -19751,8 +19751,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -20222,8 +20222,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -20687,8 +20687,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -21158,8 +21158,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -21634,8 +21634,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -22108,8 +22108,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -22572,8 +22572,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -23031,8 +23031,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -23501,8 +23501,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -23972,8 +23972,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -24437,8 +24437,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -24908,8 +24908,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -25384,8 +25384,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -25858,8 +25858,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -26322,8 +26322,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -26781,8 +26781,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -27251,8 +27251,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -27722,8 +27722,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -28187,8 +28187,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -28658,8 +28658,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -29134,8 +29134,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -29608,8 +29608,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -30072,8 +30072,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -30531,8 +30531,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -31001,8 +31001,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -31472,8 +31472,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -31937,8 +31937,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -32408,8 +32408,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -32884,8 +32884,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -33358,8 +33358,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -33822,8 +33822,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -34281,8 +34281,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -34751,8 +34751,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -35222,8 +35222,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -35687,8 +35687,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -36158,8 +36158,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -36634,8 +36634,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -37108,8 +37108,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -37576,8 +37576,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -38036,8 +38036,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -38507,8 +38507,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -38979,8 +38979,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -39445,8 +39445,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -39917,8 +39917,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -40394,8 +40394,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -40869,8 +40869,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -41334,8 +41334,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -41794,8 +41794,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -42265,8 +42265,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -42737,8 +42737,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -43203,8 +43203,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -43675,8 +43675,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -44152,8 +44152,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -44627,8 +44627,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -45091,8 +45091,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -45550,8 +45550,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -46020,8 +46020,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -46491,8 +46491,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -46956,8 +46956,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -47427,8 +47427,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -47903,8 +47903,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -48377,8 +48377,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -48841,8 +48841,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -49300,8 +49300,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -49770,8 +49770,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -50241,8 +50241,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -50706,8 +50706,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -51177,8 +51177,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -51653,8 +51653,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -52127,8 +52127,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -52592,8 +52592,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -53052,8 +53052,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -53523,8 +53523,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -53995,8 +53995,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -54461,8 +54461,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -54933,8 +54933,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -55410,8 +55410,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -55885,8 +55885,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -56350,8 +56350,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -56807,8 +56807,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -57275,8 +57275,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -57744,8 +57744,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -58207,8 +58207,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -58676,8 +58676,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -59150,8 +59150,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -59622,8 +59622,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -60084,8 +60084,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -60541,8 +60541,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -61009,8 +61009,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -61478,8 +61478,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -61941,8 +61941,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -62410,8 +62410,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -62884,8 +62884,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -63356,8 +63356,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -64138,8 +64138,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -64595,8 +64595,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -65063,8 +65063,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -65532,8 +65532,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -65995,8 +65995,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -66464,8 +66464,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -66938,8 +66938,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -67410,8 +67410,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -67877,8 +67877,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -68336,8 +68336,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -68806,8 +68806,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -69277,8 +69277,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -69742,8 +69742,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -70213,8 +70213,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -70689,8 +70689,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -71163,8 +71163,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -71627,8 +71627,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -72086,8 +72086,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -72556,8 +72556,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -73027,8 +73027,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -73492,8 +73492,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -73963,8 +73963,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -74439,8 +74439,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -74913,8 +74913,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -75377,8 +75377,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -75836,8 +75836,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -76306,8 +76306,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -76777,8 +76777,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -77242,8 +77242,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -77713,8 +77713,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -78189,8 +78189,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -78663,8 +78663,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -79127,8 +79127,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -79586,8 +79586,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -80056,8 +80056,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -80527,8 +80527,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -80992,8 +80992,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -81463,8 +81463,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -81939,8 +81939,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -82413,8 +82413,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -82877,8 +82877,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -83336,8 +83336,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -83806,8 +83806,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -84277,8 +84277,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -84742,8 +84742,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -85213,8 +85213,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -85689,8 +85689,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -86163,8 +86163,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -86628,8 +86628,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -87082,8 +87082,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -87544,8 +87544,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -88004,8 +88004,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -88462,8 +88462,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -88924,8 +88924,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -89386,8 +89386,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -89844,8 +89844,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL diff --git a/mysql-test/suite/parts/r/partition_alter4_myisam.result b/mysql-test/suite/parts/r/partition_alter4_myisam.result index c49b4229519..da99d6867ab 100644 --- a/mysql-test/suite/parts/r/partition_alter4_myisam.result +++ b/mysql-test/suite/parts/r/partition_alter4_myisam.result @@ -69,8 +69,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -537,8 +537,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -1022,8 +1022,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -1514,8 +1514,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -1996,8 +1996,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -2488,8 +2488,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -2985,8 +2985,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -3480,8 +3480,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -3967,8 +3967,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -4435,8 +4435,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -4920,8 +4920,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -5412,8 +5412,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -5894,8 +5894,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -6386,8 +6386,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -6883,8 +6883,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -7378,8 +7378,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -7865,8 +7865,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -8333,8 +8333,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -8818,8 +8818,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -9310,8 +9310,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -9792,8 +9792,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -10284,8 +10284,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -10781,8 +10781,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -11276,8 +11276,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -11763,8 +11763,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -12231,8 +12231,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -12716,8 +12716,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -13208,8 +13208,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -13690,8 +13690,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -14182,8 +14182,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -14679,8 +14679,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -15174,8 +15174,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -15661,8 +15661,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -16129,8 +16129,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -16614,8 +16614,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -17106,8 +17106,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -17588,8 +17588,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -18080,8 +18080,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -18577,8 +18577,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -19072,8 +19072,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -19562,8 +19562,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -20030,8 +20030,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -20515,8 +20515,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -21007,8 +21007,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -21489,8 +21489,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -21981,8 +21981,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -22478,8 +22478,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -22973,8 +22973,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -23460,8 +23460,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -23928,8 +23928,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -24413,8 +24413,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -24905,8 +24905,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -25387,8 +25387,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -25879,8 +25879,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -26376,8 +26376,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -26871,8 +26871,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -27358,8 +27358,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -27826,8 +27826,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -28311,8 +28311,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -28803,8 +28803,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -29285,8 +29285,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -29777,8 +29777,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -30274,8 +30274,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -30769,8 +30769,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -31256,8 +31256,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -31724,8 +31724,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -32209,8 +32209,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -32701,8 +32701,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -33183,8 +33183,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -33675,8 +33675,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -34172,8 +34172,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -34667,8 +34667,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -35154,8 +35154,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -35622,8 +35622,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -36107,8 +36107,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -36599,8 +36599,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -37081,8 +37081,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -37573,8 +37573,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -38070,8 +38070,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -38565,8 +38565,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -39055,8 +39055,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -39523,8 +39523,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -40008,8 +40008,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -40500,8 +40500,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -40982,8 +40982,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -41474,8 +41474,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -41971,8 +41971,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -42466,8 +42466,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -42953,8 +42953,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -43421,8 +43421,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -43906,8 +43906,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -44398,8 +44398,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -44880,8 +44880,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -45372,8 +45372,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -45869,8 +45869,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -46364,8 +46364,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -46851,8 +46851,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -47319,8 +47319,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -47804,8 +47804,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -48296,8 +48296,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -48778,8 +48778,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -49270,8 +49270,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -49767,8 +49767,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -50262,8 +50262,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -50749,8 +50749,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -51217,8 +51217,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -51702,8 +51702,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -52194,8 +52194,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -52676,8 +52676,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -53168,8 +53168,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -53665,8 +53665,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -54160,8 +54160,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -54647,8 +54647,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -55115,8 +55115,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -55600,8 +55600,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -56092,8 +56092,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -56574,8 +56574,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -57066,8 +57066,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -57563,8 +57563,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -58058,8 +58058,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -58546,8 +58546,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -59012,8 +59012,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -59495,8 +59495,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -59985,8 +59985,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -60465,8 +60465,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -60955,8 +60955,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -61450,8 +61450,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -61943,8 +61943,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -62428,8 +62428,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -62894,8 +62894,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -63377,8 +63377,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -63867,8 +63867,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -64347,8 +64347,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -64837,8 +64837,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -65332,8 +65332,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -65825,8 +65825,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -66630,8 +66630,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -67096,8 +67096,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -67579,8 +67579,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -68069,8 +68069,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -68549,8 +68549,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -69039,8 +69039,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -69534,8 +69534,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -70027,8 +70027,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -70517,8 +70517,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -70985,8 +70985,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -71470,8 +71470,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -71962,8 +71962,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -72444,8 +72444,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -72936,8 +72936,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -73433,8 +73433,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -73928,8 +73928,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -74415,8 +74415,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -74883,8 +74883,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -75368,8 +75368,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -75860,8 +75860,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -76342,8 +76342,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -76834,8 +76834,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -77331,8 +77331,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -77826,8 +77826,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -78313,8 +78313,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -78781,8 +78781,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -79266,8 +79266,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -79758,8 +79758,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -80240,8 +80240,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -80732,8 +80732,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -81229,8 +81229,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -81724,8 +81724,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -82211,8 +82211,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -82679,8 +82679,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -83164,8 +83164,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -83656,8 +83656,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -84138,8 +84138,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -84630,8 +84630,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -85127,8 +85127,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -85622,8 +85622,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -86109,8 +86109,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -86577,8 +86577,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -87062,8 +87062,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -87554,8 +87554,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -88036,8 +88036,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -88528,8 +88528,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -89025,8 +89025,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -89520,8 +89520,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -90008,8 +90008,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -90468,8 +90468,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -90936,8 +90936,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -91402,8 +91402,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -91866,8 +91866,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -92334,8 +92334,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -92802,8 +92802,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -93266,8 +93266,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL diff --git a/mysql-test/suite/parts/r/partition_basic_innodb.result b/mysql-test/suite/parts/r/partition_basic_innodb.result index 1a726229403..5bfda948ca4 100644 --- a/mysql-test/suite/parts/r/partition_basic_innodb.result +++ b/mysql-test/suite/parts/r/partition_basic_innodb.result @@ -67,8 +67,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -524,8 +524,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -992,8 +992,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -1468,8 +1468,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -1936,8 +1936,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -2412,8 +2412,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -2897,8 +2897,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -3376,8 +3376,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -3846,8 +3846,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -4303,8 +4303,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -4771,8 +4771,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -5247,8 +5247,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -5715,8 +5715,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -6189,8 +6189,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -6670,8 +6670,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -7149,8 +7149,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -7623,8 +7623,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -8117,8 +8117,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -8622,8 +8622,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -9135,8 +9135,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -9640,8 +9640,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -10153,8 +10153,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -10675,8 +10675,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -11191,8 +11191,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -11697,8 +11697,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -12191,8 +12191,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -12696,8 +12696,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -13209,8 +13209,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -13714,8 +13714,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -14227,8 +14227,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -14749,8 +14749,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -15265,8 +15265,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -15771,8 +15771,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -16281,8 +16281,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -16802,8 +16802,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -17331,8 +17331,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -17852,8 +17852,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -18381,8 +18381,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -18919,8 +18919,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -19451,8 +19451,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -19978,8 +19978,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -20472,8 +20472,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -20977,8 +20977,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -21490,8 +21490,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -21995,8 +21995,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -22506,8 +22506,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -23024,8 +23024,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -23540,8 +23540,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -24046,8 +24046,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -24540,8 +24540,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -25045,8 +25045,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -25558,8 +25558,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -26063,8 +26063,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -26574,8 +26574,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -27092,8 +27092,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -27608,8 +27608,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) NOT NULL DEFAULT '0', - `f_int2` int(11) NOT NULL DEFAULT '0', + `f_int1` int(11) NOT NULL DEFAULT 0, + `f_int2` int(11) NOT NULL DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -28114,8 +28114,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -28624,8 +28624,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -29145,8 +29145,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -29674,8 +29674,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -30195,8 +30195,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -30722,8 +30722,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -31256,8 +31256,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -31788,8 +31788,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, diff --git a/mysql-test/suite/parts/r/partition_basic_myisam.result b/mysql-test/suite/parts/r/partition_basic_myisam.result index bade6841047..3351201ea06 100644 --- a/mysql-test/suite/parts/r/partition_basic_myisam.result +++ b/mysql-test/suite/parts/r/partition_basic_myisam.result @@ -67,8 +67,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -527,8 +527,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -1001,8 +1001,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -1486,8 +1486,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -1961,8 +1961,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -2446,8 +2446,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -2940,8 +2940,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -3428,8 +3428,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -3908,8 +3908,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -4368,8 +4368,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -4842,8 +4842,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -5327,8 +5327,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -5802,8 +5802,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -6285,8 +6285,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -6775,8 +6775,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -7263,8 +7263,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -7747,8 +7747,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -8260,8 +8260,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -8787,8 +8787,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -9325,8 +9325,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -9853,8 +9853,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -10391,8 +10391,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -10938,8 +10938,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -11479,8 +11479,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -12016,8 +12016,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -12529,8 +12529,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -13056,8 +13056,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -13594,8 +13594,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -14122,8 +14122,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -14658,8 +14658,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -15201,8 +15201,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -15742,8 +15742,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, diff --git a/mysql-test/suite/parts/r/partition_basic_symlink_myisam.result b/mysql-test/suite/parts/r/partition_basic_symlink_myisam.result index 006820d3f18..1c1a758f985 100644 --- a/mysql-test/suite/parts/r/partition_basic_symlink_myisam.result +++ b/mysql-test/suite/parts/r/partition_basic_symlink_myisam.result @@ -77,8 +77,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -557,8 +557,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -1053,8 +1053,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -1566,8 +1566,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -2061,8 +2061,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -2566,8 +2566,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -3096,8 +3096,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -3606,8 +3606,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -4110,8 +4110,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -4590,8 +4590,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -5086,8 +5086,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -5599,8 +5599,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -6094,8 +6094,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -6597,8 +6597,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -7127,8 +7127,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -7637,8 +7637,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -8145,8 +8145,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -8678,8 +8678,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -9227,8 +9227,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -9793,8 +9793,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -10341,8 +10341,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -10899,8 +10899,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -11482,8 +11482,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -12045,8 +12045,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -12606,8 +12606,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -13139,8 +13139,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -13688,8 +13688,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -14254,8 +14254,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -14802,8 +14802,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -15358,8 +15358,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -15941,8 +15941,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -16504,8 +16504,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -17061,8 +17061,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -17587,8 +17587,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -18131,8 +18131,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -18684,8 +18684,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -19222,8 +19222,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -19773,8 +19773,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, @@ -20316,8 +20316,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL, diff --git a/mysql-test/suite/parts/r/partition_engine_innodb.result b/mysql-test/suite/parts/r/partition_engine_innodb.result index c3cb7cff083..cfa27c8e112 100644 --- a/mysql-test/suite/parts/r/partition_engine_innodb.result +++ b/mysql-test/suite/parts/r/partition_engine_innodb.result @@ -62,8 +62,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -519,8 +519,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -978,8 +978,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -1503,8 +1503,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -2004,8 +2004,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -2466,8 +2466,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -2928,8 +2928,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -3387,8 +3387,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -3852,8 +3852,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -4310,8 +4310,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -4764,8 +4764,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL diff --git a/mysql-test/suite/parts/r/partition_engine_myisam.result b/mysql-test/suite/parts/r/partition_engine_myisam.result index 02f8649692d..3d20dbb726a 100644 --- a/mysql-test/suite/parts/r/partition_engine_myisam.result +++ b/mysql-test/suite/parts/r/partition_engine_myisam.result @@ -62,8 +62,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -528,8 +528,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -996,8 +996,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -1534,8 +1534,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -2048,8 +2048,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -2523,8 +2523,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -2998,8 +2998,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -3466,8 +3466,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -3944,8 +3944,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -4415,8 +4415,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -4876,8 +4876,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL diff --git a/mysql-test/suite/parts/r/partition_syntax_innodb.result b/mysql-test/suite/parts/r/partition_syntax_innodb.result index 3dba2873235..767f023d04e 100644 --- a/mysql-test/suite/parts/r/partition_syntax_innodb.result +++ b/mysql-test/suite/parts/r/partition_syntax_innodb.result @@ -652,8 +652,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -679,8 +679,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -713,8 +713,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -735,8 +735,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -820,8 +820,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -856,8 +856,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -881,8 +881,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -906,8 +906,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -931,8 +931,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -1675,8 +1675,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -1704,8 +1704,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL diff --git a/mysql-test/suite/parts/r/partition_syntax_myisam.result b/mysql-test/suite/parts/r/partition_syntax_myisam.result index 7da964a1f8c..97eabe7d2ce 100644 --- a/mysql-test/suite/parts/r/partition_syntax_myisam.result +++ b/mysql-test/suite/parts/r/partition_syntax_myisam.result @@ -652,8 +652,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -687,8 +687,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -731,8 +731,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -759,8 +759,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -852,8 +852,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -904,8 +904,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -937,8 +937,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -974,8 +974,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -1005,8 +1005,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -1757,8 +1757,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -1794,8 +1794,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL diff --git a/mysql-test/suite/parts/r/rpl_partition.result b/mysql-test/suite/parts/r/rpl_partition.result index 9969d53a3d7..874b482cfb8 100644 --- a/mysql-test/suite/parts/r/rpl_partition.result +++ b/mysql-test/suite/parts/r/rpl_partition.result @@ -130,7 +130,7 @@ Create Table CREATE TABLE `t3` ( `id` mediumint(9) NOT NULL AUTO_INCREMENT, `dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `user` char(255) DEFAULT NULL, - `uuidf` longblob, + `uuidf` longblob DEFAULT NULL, `fkid` mediumint(9) DEFAULT NULL, `filler` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) diff --git a/mysql-test/suite/perfschema/r/schema.result b/mysql-test/suite/perfschema/r/schema.result index 050c4461105..1f331394df6 100644 --- a/mysql-test/suite/perfschema/r/schema.result +++ b/mysql-test/suite/perfschema/r/schema.result @@ -182,9 +182,9 @@ events_statements_current CREATE TABLE `events_statements_current` ( `TIMER_END` bigint(20) unsigned DEFAULT NULL, `TIMER_WAIT` bigint(20) unsigned DEFAULT NULL, `LOCK_TIME` bigint(20) unsigned NOT NULL, - `SQL_TEXT` longtext, + `SQL_TEXT` longtext DEFAULT NULL, `DIGEST` varchar(32) DEFAULT NULL, - `DIGEST_TEXT` longtext, + `DIGEST_TEXT` longtext DEFAULT NULL, `CURRENT_SCHEMA` varchar(64) DEFAULT NULL, `OBJECT_TYPE` varchar(64) DEFAULT NULL, `OBJECT_SCHEMA` varchar(64) DEFAULT NULL, @@ -226,9 +226,9 @@ events_statements_history CREATE TABLE `events_statements_history` ( `TIMER_END` bigint(20) unsigned DEFAULT NULL, `TIMER_WAIT` bigint(20) unsigned DEFAULT NULL, `LOCK_TIME` bigint(20) unsigned NOT NULL, - `SQL_TEXT` longtext, + `SQL_TEXT` longtext DEFAULT NULL, `DIGEST` varchar(32) DEFAULT NULL, - `DIGEST_TEXT` longtext, + `DIGEST_TEXT` longtext DEFAULT NULL, `CURRENT_SCHEMA` varchar(64) DEFAULT NULL, `OBJECT_TYPE` varchar(64) DEFAULT NULL, `OBJECT_SCHEMA` varchar(64) DEFAULT NULL, @@ -270,9 +270,9 @@ events_statements_history_long CREATE TABLE `events_statements_history_long` ( `TIMER_END` bigint(20) unsigned DEFAULT NULL, `TIMER_WAIT` bigint(20) unsigned DEFAULT NULL, `LOCK_TIME` bigint(20) unsigned NOT NULL, - `SQL_TEXT` longtext, + `SQL_TEXT` longtext DEFAULT NULL, `DIGEST` varchar(32) DEFAULT NULL, - `DIGEST_TEXT` longtext, + `DIGEST_TEXT` longtext DEFAULT NULL, `CURRENT_SCHEMA` varchar(64) DEFAULT NULL, `OBJECT_TYPE` varchar(64) DEFAULT NULL, `OBJECT_SCHEMA` varchar(64) DEFAULT NULL, @@ -307,7 +307,7 @@ Table Create Table events_statements_summary_by_digest CREATE TABLE `events_statements_summary_by_digest` ( `SCHEMA_NAME` varchar(64) DEFAULT NULL, `DIGEST` varchar(32) DEFAULT NULL, - `DIGEST_TEXT` longtext, + `DIGEST_TEXT` longtext DEFAULT NULL, `COUNT_STAR` bigint(20) unsigned NOT NULL, `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL, `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL, @@ -1034,7 +1034,7 @@ threads CREATE TABLE `threads` ( `PROCESSLIST_COMMAND` varchar(16) DEFAULT NULL, `PROCESSLIST_TIME` bigint(20) DEFAULT NULL, `PROCESSLIST_STATE` varchar(64) DEFAULT NULL, - `PROCESSLIST_INFO` longtext, + `PROCESSLIST_INFO` longtext DEFAULT NULL, `PARENT_THREAD_ID` bigint(20) unsigned DEFAULT NULL, `ROLE` varchar(64) DEFAULT NULL, `INSTRUMENTED` enum('YES','NO') NOT NULL diff --git a/mysql-test/suite/perfschema/r/sizing_low.result b/mysql-test/suite/perfschema/r/sizing_low.result index dce5a994099..a698f55aa07 100644 --- a/mysql-test/suite/perfschema/r/sizing_low.result +++ b/mysql-test/suite/perfschema/r/sizing_low.result @@ -67,3 +67,4 @@ Performance_schema_table_instances_lost 0 Performance_schema_thread_classes_lost 0 Performance_schema_thread_instances_lost 0 Performance_schema_users_lost 0 +CALL mtr.add_suppression("innodb_open_files should not be greater than the open_files_limit."); diff --git a/mysql-test/suite/perfschema/r/table_name.result b/mysql-test/suite/perfschema/r/table_name.result new file mode 100644 index 00000000000..d6369ffc79e --- /dev/null +++ b/mysql-test/suite/perfschema/r/table_name.result @@ -0,0 +1,156 @@ + +# +# TEST 1: Normal tables prefixed with "#sql" and "sql". +# +USE test; +CREATE TABLE `#sql_1` (a int, b text); +INSERT INTO `#sql_1` VALUES(1,'one'); + +CREATE TABLE `sql_1` (a int, b text); +INSERT INTO `sql_1` VALUES(1,'one'); + +# Verify that the tables are treated as normal tables . + +SELECT object_type, object_schema, object_name +FROM performance_schema.objects_summary_global_by_type +WHERE object_schema="test"; +object_type object_schema object_name +TABLE test #sql_1 +TABLE test sql_1 + +# Drop the tables, verify that the table objects are removed. + +DROP TABLE `#sql_1`; +DROP TABLE `sql_1`; + +SELECT object_type, object_schema, object_name +FROM performance_schema.objects_summary_global_by_type +WHERE object_schema="test"; +object_type object_schema object_name + +# +# TEST 2: Temporary tables, no special prefix. +# +CREATE TEMPORARY TABLE sql_temp2_myisam (a int, b text) ENGINE=MYISAM; +INSERT INTO sql_temp2_myisam VALUES(1,'one'); + +CREATE TEMPORARY TABLE sql_temp2_innodb (a int, b text) ENGINE=INNODB; +INSERT INTO sql_temp2_innodb VALUES(1,'one'); + +# Confirm that the temporary tables are ignored. + +SELECT object_type, object_schema, object_name +FROM performance_schema.objects_summary_global_by_type +WHERE object_schema="test"; +object_type object_schema object_name + +# Drop the tables, verify that the table objects are not created. + +DROP TABLE sql_temp2_myisam; +DROP TABLE sql_temp2_innodb; + +SELECT object_type, object_schema, object_name +FROM performance_schema.objects_summary_global_by_type +WHERE object_schema="test"; +object_type object_schema object_name + +# +# TEST 3: Temporary tables with the "#sql" prefix. +# +CREATE TEMPORARY TABLE `#sql_temp3_myisam` (a int, b text) ENGINE=MYISAM; +CHECK TABLE `#sql_temp3_myisam`; +Table Op Msg_type Msg_text +test.#sql_temp3_myisam check status OK +INSERT INTO `#sql_temp3_myisam` VALUES(1,'one'); + +CREATE TEMPORARY TABLE `#sql_temp3_innodb` (a int, b text) ENGINE=INNODB; +CHECK TABLE `#sql_temp3_innodb`; +Table Op Msg_type Msg_text +test.#sql_temp3_innodb check status OK +INSERT INTO `#sql_temp3_innodb` VALUES(1,'one'); + +# Confirm that the temporary tables are ignored. + +SELECT object_type, object_schema, object_name +FROM performance_schema.objects_summary_global_by_type +WHERE object_schema="test"; +object_type object_schema object_name + +# Drop the temporary tables. + +DROP TABLE `#sql_temp3_myisam`; +DROP TABLE `#sql_temp3_innodb`; + +# Confirm that the temporary tables are still ignored. + +SELECT object_type, object_schema, object_name +FROM performance_schema.objects_summary_global_by_type +WHERE object_schema="test"; +object_type object_schema object_name + +# +# TEST 4: Special case: MyISAM temporary tables are recreated as non-temporary +# when they are truncated. +# +CREATE TEMPORARY TABLE `sql_temp4_myisam` (a int, b text) ENGINE=MYISAM; +INSERT INTO `sql_temp4_myisam` VALUES(1,'one'); + +CREATE TEMPORARY TABLE `#sql_temp4_myisam` (a int, b text) ENGINE=MYISAM; +INSERT INTO `#sql_temp4_myisam` VALUES(1,'one'); + +# Confirm that the MyISAM temporary tables are ignored. + +SELECT object_type, object_schema, object_name +FROM performance_schema.objects_summary_global_by_type +WHERE object_schema="test"; +object_type object_schema object_name + +# Truncate the MyISAM temporary tables, forcing them to be recreated as non-temporary. + +TRUNCATE TABLE `sql_temp4_myisam`; +TRUNCATE TABLE `#sql_temp4_myisam`; + +# Confirm that the recreated MyISAM tables are still regarded as temporary and ignored. + +SELECT object_type, object_schema, object_name +FROM performance_schema.objects_summary_global_by_type +WHERE object_schema="test"; +object_type object_schema object_name + +# Drop the recreated MyISAM tables; + +DROP TABLE `sql_temp4_myisam`; +DROP TABLE `#sql_temp4_myisam`; + +# Confirm that the recreated temporary tables are still ignored. + +SELECT object_type, object_schema, object_name +FROM performance_schema.objects_summary_global_by_type +WHERE object_schema="test"; +object_type object_schema object_name + +# +# TEST 5: Generate temporary tables with ALTER MyISAM table. +# +USE test; +CREATE TABLE t1 (a int) ENGINE=MYISAM; +INSERT INTO t1 VALUES (1), (2), (3); +ALTER TABLE t1 ADD COLUMN (b int); + +# Confirm that the recreated temporary tables are still ignored. + +SELECT object_type, object_schema, object_name +FROM performance_schema.objects_summary_global_by_type +WHERE object_schema="test"; +object_type object_schema object_name + +# Drop the MyISAM table + +DROP TABLE t1; + +# Confirm that no tables remain; + +SELECT object_type, object_schema, object_name +FROM performance_schema.objects_summary_global_by_type +WHERE object_schema="test"; +object_type object_schema object_name diff --git a/mysql-test/suite/perfschema/t/privilege_table_io.test b/mysql-test/suite/perfschema/t/privilege_table_io.test index 833fe85e8bb..35c49bf33fb 100644 --- a/mysql-test/suite/perfschema/t/privilege_table_io.test +++ b/mysql-test/suite/perfschema/t/privilege_table_io.test @@ -1,7 +1,10 @@ # Tests for PERFORMANCE_SCHEMA table io +# This test makes a restart because without it, events_waits_history_long +# sometimes contains duplicated entries of roles_mapping. --source include/not_embedded.inc --source include/have_perfschema.inc +--source include/restart_mysqld.inc --source ../include/table_io_setup_helper.inc # Remove "deleted" records from mysql.db that may come from previous tests, diff --git a/mysql-test/suite/perfschema/t/sizing_low.test b/mysql-test/suite/perfschema/t/sizing_low.test index 4d02d41aecd..56446fd6973 100644 --- a/mysql-test/suite/perfschema/t/sizing_low.test +++ b/mysql-test/suite/perfschema/t/sizing_low.test @@ -7,3 +7,4 @@ --source ../include/sizing_auto.inc +CALL mtr.add_suppression("innodb_open_files should not be greater than the open_files_limit."); diff --git a/mysql-test/suite/perfschema/t/table_name.test b/mysql-test/suite/perfschema/t/table_name.test new file mode 100644 index 00000000000..a8179f2d1f8 --- /dev/null +++ b/mysql-test/suite/perfschema/t/table_name.test @@ -0,0 +1,165 @@ +# +# Performance Schema +# +# Verify that the Performance Schema correctly identifies normal and temporary +# tables with non-standard names. + +# The server uses the table name prefix "#sql" for temporary and intermediate +# tables, however user-defined tables having the "#sql" prefix are also permitted. +# Independent of the table name, temporary or intermediate tables always have the +# "#sql" prefix in the filename. (For non-temporary tables starting with "#", +# the "#" is encoded to @0023 in the filename.) +# +# Given the ambiguity with temporary table names, the Performance Schema identifies +# temporary tables tables either by the table category or by the filename. +# +--source include/have_perfschema.inc +--source include/have_innodb.inc +--source include/not_embedded.inc + +--echo +--echo # +--echo # TEST 1: Normal tables prefixed with "#sql" and "sql". +--echo # +USE test; +CREATE TABLE `#sql_1` (a int, b text); +# INSERT forces path through get_table_share() +INSERT INTO `#sql_1` VALUES(1,'one'); +--echo +CREATE TABLE `sql_1` (a int, b text); +INSERT INTO `sql_1` VALUES(1,'one'); +--echo +--echo # Verify that the tables are treated as normal tables . +--echo +SELECT object_type, object_schema, object_name +FROM performance_schema.objects_summary_global_by_type +WHERE object_schema="test"; +--echo +--echo # Drop the tables, verify that the table objects are removed. +--echo +DROP TABLE `#sql_1`; +DROP TABLE `sql_1`; +--echo +SELECT object_type, object_schema, object_name +FROM performance_schema.objects_summary_global_by_type +WHERE object_schema="test"; + +--echo +--echo # +--echo # TEST 2: Temporary tables, no special prefix. +--echo # +CREATE TEMPORARY TABLE sql_temp2_myisam (a int, b text) ENGINE=MYISAM; +INSERT INTO sql_temp2_myisam VALUES(1,'one'); +--echo +CREATE TEMPORARY TABLE sql_temp2_innodb (a int, b text) ENGINE=INNODB; +INSERT INTO sql_temp2_innodb VALUES(1,'one'); +--echo +--echo # Confirm that the temporary tables are ignored. +--echo +SELECT object_type, object_schema, object_name +FROM performance_schema.objects_summary_global_by_type +WHERE object_schema="test"; +--echo +--echo # Drop the tables, verify that the table objects are not created. +--echo +DROP TABLE sql_temp2_myisam; +DROP TABLE sql_temp2_innodb; +--echo +SELECT object_type, object_schema, object_name +FROM performance_schema.objects_summary_global_by_type +WHERE object_schema="test"; + +--echo +--echo # +--echo # TEST 3: Temporary tables with the "#sql" prefix. +--echo # +CREATE TEMPORARY TABLE `#sql_temp3_myisam` (a int, b text) ENGINE=MYISAM; +CHECK TABLE `#sql_temp3_myisam`; +INSERT INTO `#sql_temp3_myisam` VALUES(1,'one'); +--echo +CREATE TEMPORARY TABLE `#sql_temp3_innodb` (a int, b text) ENGINE=INNODB; +CHECK TABLE `#sql_temp3_innodb`; +INSERT INTO `#sql_temp3_innodb` VALUES(1,'one'); +--echo +--echo # Confirm that the temporary tables are ignored. +--echo +SELECT object_type, object_schema, object_name +FROM performance_schema.objects_summary_global_by_type +WHERE object_schema="test"; +--echo +--echo # Drop the temporary tables. +--echo +DROP TABLE `#sql_temp3_myisam`; +DROP TABLE `#sql_temp3_innodb`; +--echo +--echo # Confirm that the temporary tables are still ignored. +--echo +SELECT object_type, object_schema, object_name +FROM performance_schema.objects_summary_global_by_type +WHERE object_schema="test"; + +--echo +--echo # +--echo # TEST 4: Special case: MyISAM temporary tables are recreated as non-temporary +--echo # when they are truncated. +--echo # +CREATE TEMPORARY TABLE `sql_temp4_myisam` (a int, b text) ENGINE=MYISAM; +INSERT INTO `sql_temp4_myisam` VALUES(1,'one'); +--echo +CREATE TEMPORARY TABLE `#sql_temp4_myisam` (a int, b text) ENGINE=MYISAM; +INSERT INTO `#sql_temp4_myisam` VALUES(1,'one'); +--echo +--echo # Confirm that the MyISAM temporary tables are ignored. +--echo +SELECT object_type, object_schema, object_name +FROM performance_schema.objects_summary_global_by_type +WHERE object_schema="test"; +--echo +--echo # Truncate the MyISAM temporary tables, forcing them to be recreated as non-temporary. +--echo +TRUNCATE TABLE `sql_temp4_myisam`; +TRUNCATE TABLE `#sql_temp4_myisam`; +--echo +--echo # Confirm that the recreated MyISAM tables are still regarded as temporary and ignored. +--echo +SELECT object_type, object_schema, object_name +FROM performance_schema.objects_summary_global_by_type +WHERE object_schema="test"; +--echo +--echo # Drop the recreated MyISAM tables; +--echo +DROP TABLE `sql_temp4_myisam`; +DROP TABLE `#sql_temp4_myisam`; +--echo +--echo # Confirm that the recreated temporary tables are still ignored. +--echo +SELECT object_type, object_schema, object_name +FROM performance_schema.objects_summary_global_by_type +WHERE object_schema="test"; + +--echo +--echo # +--echo # TEST 5: Generate temporary tables with ALTER MyISAM table. +--echo # +USE test; +CREATE TABLE t1 (a int) ENGINE=MYISAM; +INSERT INTO t1 VALUES (1), (2), (3); +# Force a path throug mysql_alter_table() and ha_create_table(). +ALTER TABLE t1 ADD COLUMN (b int); +--echo +--echo # Confirm that the recreated temporary tables are still ignored. +--echo +SELECT object_type, object_schema, object_name +FROM performance_schema.objects_summary_global_by_type +WHERE object_schema="test"; +--echo +--echo # Drop the MyISAM table +--echo +DROP TABLE t1; + +--echo +--echo # Confirm that no tables remain; +--echo +SELECT object_type, object_schema, object_name +FROM performance_schema.objects_summary_global_by_type +WHERE object_schema="test"; diff --git a/mysql-test/suite/plugins/r/cracklib_password_check.result b/mysql-test/suite/plugins/r/cracklib_password_check.result index 638f138b986..dc31cb6d044 100644 --- a/mysql-test/suite/plugins/r/cracklib_password_check.result +++ b/mysql-test/suite/plugins/r/cracklib_password_check.result @@ -39,6 +39,12 @@ Warning 1819 cracklib: it is based on a dictionary word Error 1819 Your password does not satisfy the current policy requirements grant select on *.* to foobar identified by 'q$%^&*rty'; drop user foobar; +# +# MDEV-9851: CREATE USER w/o IDENTIFIED BY clause causes crash +# when using cracklib plugin +# +create user 'newuser'@'localhost'; +ERROR HY000: Your password does not satisfy the current policy requirements uninstall plugin cracklib_password_check; create user foo1 identified by 'pwd'; drop user foo1; diff --git a/mysql-test/suite/plugins/r/server_audit.result b/mysql-test/suite/plugins/r/server_audit.result index 26a7d1b872c..9c7dc1490b1 100644 --- a/mysql-test/suite/plugins/r/server_audit.result +++ b/mysql-test/suite/plugins/r/server_audit.result @@ -174,7 +174,7 @@ CREATE USER u1 IDENTIFIED BY 'pwd-123'; GRANT ALL ON sa_db TO u2 IDENTIFIED BY "pwd-321"; SET PASSWORD FOR u1 = PASSWORD('pwd 098'); SET PASSWORD FOR u1=; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '=' at line 1 +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1 CREATE USER u3 IDENTIFIED BY ''; drop user u1, u2, u3; select 2; diff --git a/mysql-test/suite/plugins/r/simple_password_check.result b/mysql-test/suite/plugins/r/simple_password_check.result index a0b43a94137..bbb96bb8c38 100644 --- a/mysql-test/suite/plugins/r/simple_password_check.result +++ b/mysql-test/suite/plugins/r/simple_password_check.result @@ -72,6 +72,8 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED create user foo1 identified by 'pwd'; ERROR HY000: Your password does not satisfy the current policy requirements +create user foo1; +ERROR HY000: Your password does not satisfy the current policy requirements grant select on *.* to foo1 identified by 'pwd'; ERROR HY000: Your password does not satisfy the current policy requirements grant select on *.* to `FooBar1!` identified by 'FooBar1!'; @@ -147,6 +149,8 @@ grant select on *.* to foo2 identified with mysql_old_password using '2222222222 drop user foo2; set global strict_password_validation=1; drop user foo1; +create role r1; +drop role r1; uninstall plugin simple_password_check; create user foo1 identified by 'pwd'; drop user foo1; diff --git a/mysql-test/suite/plugins/r/thread_pool_server_audit.result b/mysql-test/suite/plugins/r/thread_pool_server_audit.result index 26a7d1b872c..9c7dc1490b1 100644 --- a/mysql-test/suite/plugins/r/thread_pool_server_audit.result +++ b/mysql-test/suite/plugins/r/thread_pool_server_audit.result @@ -174,7 +174,7 @@ CREATE USER u1 IDENTIFIED BY 'pwd-123'; GRANT ALL ON sa_db TO u2 IDENTIFIED BY "pwd-321"; SET PASSWORD FOR u1 = PASSWORD('pwd 098'); SET PASSWORD FOR u1=; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '=' at line 1 +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1 CREATE USER u3 IDENTIFIED BY ''; drop user u1, u2, u3; select 2; diff --git a/mysql-test/suite/plugins/r/unix_socket.result b/mysql-test/suite/plugins/r/unix_socket.result index 45bf608cc93..0e08794fbe6 100644 --- a/mysql-test/suite/plugins/r/unix_socket.result +++ b/mysql-test/suite/plugins/r/unix_socket.result @@ -27,4 +27,5 @@ USER@localhost @% test # name does not match = failure # delete from mysql.user where user=''; +FLUSH PRIVILEGES; uninstall plugin unix_socket; diff --git a/mysql-test/suite/plugins/t/cracklib_password_check.test b/mysql-test/suite/plugins/t/cracklib_password_check.test index d0e05fed926..89b53b656d6 100644 --- a/mysql-test/suite/plugins/t/cracklib_password_check.test +++ b/mysql-test/suite/plugins/t/cracklib_password_check.test @@ -30,6 +30,14 @@ show warnings; grant select on *.* to foobar identified by 'q$%^&*rty'; drop user foobar; +--echo # +--echo # MDEV-9851: CREATE USER w/o IDENTIFIED BY clause causes crash +--echo # when using cracklib plugin +--echo # + +--error ER_NOT_VALID_PASSWORD +create user 'newuser'@'localhost'; + uninstall plugin cracklib_password_check; create user foo1 identified by 'pwd'; diff --git a/mysql-test/suite/plugins/t/simple_password_check.test b/mysql-test/suite/plugins/t/simple_password_check.test index 9854f93efe8..4965ee492d2 100644 --- a/mysql-test/suite/plugins/t/simple_password_check.test +++ b/mysql-test/suite/plugins/t/simple_password_check.test @@ -16,6 +16,10 @@ select * from information_schema.system_variables where variable_name like 'simp --error ER_NOT_VALID_PASSWORD create user foo1 identified by 'pwd'; +# Create user with no password. +--error ER_NOT_VALID_PASSWORD +create user foo1; + --error ER_NOT_VALID_PASSWORD grant select on *.* to foo1 identified by 'pwd'; @@ -103,6 +107,12 @@ drop user foo2; set global strict_password_validation=1; drop user foo1; +# +# MDEV-9940 CREATE ROLE blocked by password validation plugin +# +create role r1; +drop role r1; + uninstall plugin simple_password_check; create user foo1 identified by 'pwd'; diff --git a/mysql-test/suite/plugins/t/unix_socket.test b/mysql-test/suite/plugins/t/unix_socket.test index 1522c9b7cbe..bd0323c0274 100644 --- a/mysql-test/suite/plugins/t/unix_socket.test +++ b/mysql-test/suite/plugins/t/unix_socket.test @@ -55,6 +55,6 @@ grant SELECT ON test.* TO '' identified via unix_socket; # restoring mysql.user to the original state. delete from mysql.user where user=''; +FLUSH PRIVILEGES; uninstall plugin unix_socket; --remove_file $MYSQLTEST_VARDIR/tmp/peercred_test.txt - diff --git a/mysql-test/suite/roles/definer.result b/mysql-test/suite/roles/definer.result index 293e5e539bc..4810e597763 100644 --- a/mysql-test/suite/roles/definer.result +++ b/mysql-test/suite/roles/definer.result @@ -22,10 +22,10 @@ show create view test.v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`role1` SQL SECURITY DEFINER VIEW `test`.`v1` AS select (`mysqltest1`.`t1`.`a` + `mysqltest1`.`t1`.`b`) AS `a+b`,`mysqltest1`.`t1`.`c` AS `c` from `mysqltest1`.`t1` latin1 latin1_swedish_ci set role none; -create definer=role2 view test.v2 as select a+b,c from t1; +create definer=role2 view test.v2 as select a+b,c,current_role() from t1; show create view test.v2; View Create View character_set_client collation_connection -v2 CREATE ALGORITHM=UNDEFINED DEFINER=`role2` SQL SECURITY DEFINER VIEW `test`.`v2` AS select (`mysqltest1`.`t1`.`a` + `mysqltest1`.`t1`.`b`) AS `a+b`,`mysqltest1`.`t1`.`c` AS `c` from `mysqltest1`.`t1` latin1 latin1_swedish_ci +v2 CREATE ALGORITHM=UNDEFINED DEFINER=`role2` SQL SECURITY DEFINER VIEW `test`.`v2` AS select (`mysqltest1`.`t1`.`a` + `mysqltest1`.`t1`.`b`) AS `a+b`,`mysqltest1`.`t1`.`c` AS `c`,current_role() AS `current_role()` from `mysqltest1`.`t1` latin1 latin1_swedish_ci create definer=role3 view test.v3 as select a+b,c from t1; Warnings: Note 1449 The user specified as a definer ('role3'@'%') does not exist @@ -44,9 +44,9 @@ GRANT CREATE VIEW ON `mysqltest1`.* TO 'foo'@'localhost' select * from test.v1; ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them select * from test.v2; -a+b c -11 100 -22 200 +a+b c current_role() +11 100 role2 +22 200 role2 select * from test.v3; ERROR 28000: Access denied for user 'foo'@'localhost' (using password: NO) create definer=role4 view test.v4 as select a+b,c from t1; @@ -113,7 +113,7 @@ tr1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`role1` trigger tr insert t1 values (111, 222, 333) latin1 latin1_swedish_ci latin1_swedish_ci set role none; insert t2 values (11,22,33); -ERROR 42000: INSERT command denied to user 'role1'@'' for table 't1' +ERROR 42000: INSERT command denied to user ''@'' for table 't1' select * from t1; a b c 1 10 100 @@ -179,7 +179,7 @@ pr1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`role1` PROCEDURE insert t1 values (111, 222, 333) latin1 latin1_swedish_ci latin1_swedish_ci set role none; call pr1(); -ERROR 42000: INSERT command denied to user 'role1'@'' for table 't1' +ERROR 42000: INSERT command denied to user ''@'' for table 't1' select * from t1; a b c 1 10 100 @@ -222,7 +222,7 @@ fn1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`role1` FUNCTION ` return (select sum(a+b) from t1) latin1 latin1_swedish_ci latin1_swedish_ci set role none; select fn1(); -ERROR 42000: SELECT command denied to user 'role1'@'' for column 'b' in table 't1' +ERROR 42000: SELECT command denied to user ''@'' for column 'b' in table 't1' select * from t1; a b c 1 10 100 @@ -289,7 +289,8 @@ SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; /*!50001 CREATE TABLE `v2` ( `a+b` tinyint NOT NULL, - `c` tinyint NOT NULL + `c` tinyint NOT NULL, + `current_role()` tinyint NOT NULL ) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; SET @saved_cs_client = @@character_set_client; @@ -553,7 +554,7 @@ USE `test`; /*!50001 SET character_set_client = latin1 */; /*!50001 SET character_set_results = latin1 */; /*!50001 SET collation_connection = latin1_swedish_ci */; -/*!50001 CREATE ALGORITHM=UNDEFINED DEFINER=`role2` SQL SECURITY DEFINER VIEW `v2` AS select (`mysqltest1`.`t1`.`a` + `mysqltest1`.`t1`.`b`) AS `a+b`,`mysqltest1`.`t1`.`c` AS `c` from `mysqltest1`.`t1` */; +/*!50001 CREATE ALGORITHM=UNDEFINED DEFINER=`role2` SQL SECURITY DEFINER VIEW `v2` AS select (`mysqltest1`.`t1`.`a` + `mysqltest1`.`t1`.`b`) AS `a+b`,`mysqltest1`.`t1`.`c` AS `c`,current_role() AS `current_role()` from `mysqltest1`.`t1` */; /*!50001 SET character_set_client = @saved_cs_client */; /*!50001 SET character_set_results = @saved_cs_results */; /*!50001 SET collation_connection = @saved_col_connection */; diff --git a/mysql-test/suite/roles/definer.test b/mysql-test/suite/roles/definer.test index 3de4a6922c2..090c60917c9 100644 --- a/mysql-test/suite/roles/definer.test +++ b/mysql-test/suite/roles/definer.test @@ -47,7 +47,7 @@ show create view test.v1; set role none; # definer=role_name, privileges ok -create definer=role2 view test.v2 as select a+b,c from t1; +create definer=role2 view test.v2 as select a+b,c,current_role() from t1; show create view test.v2; # definer=non_existent_role diff --git a/mysql-test/suite/roles/rpl_grant_revoke_current_role-8638.result b/mysql-test/suite/roles/rpl_grant_revoke_current_role-8638.result new file mode 100644 index 00000000000..ef2b9648778 --- /dev/null +++ b/mysql-test/suite/roles/rpl_grant_revoke_current_role-8638.result @@ -0,0 +1,8 @@ +include/master-slave.inc +[connection master] +create role r1; +set role r1; +grant select on db.* to current_role; +revoke all privileges, grant option from current_role; +drop role r1; +include/rpl_end.inc diff --git a/mysql-test/suite/roles/rpl_grant_revoke_current_role-8638.test b/mysql-test/suite/roles/rpl_grant_revoke_current_role-8638.test new file mode 100644 index 00000000000..6a6c4f2a756 --- /dev/null +++ b/mysql-test/suite/roles/rpl_grant_revoke_current_role-8638.test @@ -0,0 +1,12 @@ +--source include/master-slave.inc +--source include/have_binlog_format_mixed.inc + +--enable_connect_log + +create role r1; +set role r1; +grant select on db.* to current_role; +revoke all privileges, grant option from current_role; +drop role r1; + +--source include/rpl_end.inc diff --git a/mysql-test/suite/roles/set_role-9614.result b/mysql-test/suite/roles/set_role-9614.result new file mode 100644 index 00000000000..37f6db070c0 --- /dev/null +++ b/mysql-test/suite/roles/set_role-9614.result @@ -0,0 +1,99 @@ +# +# MDEV-9614 Roles and Users Longer than 6 characters +# +# This test case checks the edge case presented in the MDEV. The +# real issue is actually apparent when the username is longer than the +# rolename. +# +# We need a separate database not including test or test_% names. Due to +# default privileges given on these databases. +# +DROP DATABASE IF EXISTS `bug_db`; +Warnings: +Note 1008 Can't drop database 'bug_db'; database doesn't exist +# +# The first user did not show the bug as john's length is smaller +# than client. The bug is apparent most of the time for usertestjohn. +# +CREATE USER `john`@`%`; +CREATE USER `usertestjohn`@`%`; +CREATE ROLE `client`; +# +# Setup the required tables. +# +CREATE DATABASE `bug_db`; +CREATE TABLE `bug_db`.`t0`(`c0` INT); +# +# Setup select privileges only on the role. Setting the role should give +# select access to bug_db.t0. +# +GRANT SELECT ON `bug_db`.`t0` TO `client`; +GRANT `client` TO `john`@`%`; +GRANT `client` TO `usertestjohn`@`%`; +# +# Check to see grants are set. +# +SHOW GRANTS FOR `john`@`%`; +Grants for john@% +GRANT client TO 'john'@'%' +GRANT USAGE ON *.* TO 'john'@'%' +SHOW GRANTS FOR `usertestjohn`@`%`; +Grants for usertestjohn@% +GRANT client TO 'usertestjohn'@'%' +GRANT USAGE ON *.* TO 'usertestjohn'@'%' +SHOW GRANTS FOR `client`; +Grants for client +GRANT USAGE ON *.* TO 'client' +GRANT SELECT ON `bug_db`.`t0` TO 'client' +show databases; +Database +bug_db +information_schema +mtr +mysql +performance_schema +test +# +# Try using the database as john. +# +connect john, localhost, john,,information_schema; +show databases; +Database +information_schema +test +set role client; +show databases; +Database +bug_db +information_schema +test +use bug_db; +# +# Try using the database as usertestjohn. +# +connect usertestjohn, localhost, usertestjohn,,information_schema; +show databases; +Database +information_schema +test +set role client; +show databases; +Database +bug_db +information_schema +test +show grants; +Grants for usertestjohn@% +GRANT client TO 'usertestjohn'@'%' +GRANT USAGE ON *.* TO 'usertestjohn'@'%' +GRANT USAGE ON *.* TO 'client' +GRANT SELECT ON `bug_db`.`t0` TO 'client' +use bug_db; +# +# Cleanup +# +connection default; +drop user john; +drop user usertestjohn; +drop role client; +drop database bug_db; diff --git a/mysql-test/suite/roles/set_role-9614.test b/mysql-test/suite/roles/set_role-9614.test new file mode 100644 index 00000000000..5e9f7dacf19 --- /dev/null +++ b/mysql-test/suite/roles/set_role-9614.test @@ -0,0 +1,79 @@ +--source include/not_embedded.inc + +--echo # +--echo # MDEV-9614 Roles and Users Longer than 6 characters +--echo # +--echo # This test case checks the edge case presented in the MDEV. The +--echo # real issue is actually apparent when the username is longer than the +--echo # rolename. + +--enable_connect_log +--echo # +--echo # We need a separate database not including test or test_% names. Due to +--echo # default privileges given on these databases. +--echo # +DROP DATABASE IF EXISTS `bug_db`; + +--echo # +--echo # The first user did not show the bug as john's length is smaller +--echo # than client. The bug is apparent most of the time for usertestjohn. +--echo # +CREATE USER `john`@`%`; +CREATE USER `usertestjohn`@`%`; +CREATE ROLE `client`; + +--echo # +--echo # Setup the required tables. +--echo # +CREATE DATABASE `bug_db`; +CREATE TABLE `bug_db`.`t0`(`c0` INT); + +--echo # +--echo # Setup select privileges only on the role. Setting the role should give +--echo # select access to bug_db.t0. +--echo # +GRANT SELECT ON `bug_db`.`t0` TO `client`; +GRANT `client` TO `john`@`%`; +GRANT `client` TO `usertestjohn`@`%`; + +--echo # +--echo # Check to see grants are set. +--echo # +SHOW GRANTS FOR `john`@`%`; +SHOW GRANTS FOR `usertestjohn`@`%`; +SHOW GRANTS FOR `client`; + +show databases; + +--echo # +--echo # Try using the database as john. +--echo # +connect (john, localhost, john,,information_schema); + +show databases; +set role client; +show databases; +use bug_db; + +--echo # +--echo # Try using the database as usertestjohn. +--echo # +connect (usertestjohn, localhost, usertestjohn,,information_schema); + +show databases; +set role client; +show databases; + +show grants; +use bug_db; + + +--echo # +--echo # Cleanup +--echo # +connection default; +drop user john; +drop user usertestjohn; +drop role client; +drop database bug_db; +--disable_connect_log diff --git a/mysql-test/suite/roles/set_role-simple.result b/mysql-test/suite/roles/set_role-simple.result index 3ce6d5c054b..29b176776e7 100644 --- a/mysql-test/suite/roles/set_role-simple.result +++ b/mysql-test/suite/roles/set_role-simple.result @@ -45,3 +45,14 @@ delete from mysql.user where user='test_role1'; delete from mysql.roles_mapping where Role='test_role1'; flush privileges; drop user 'test_user'@'localhost'; +create user user1; +connect con1,localhost,user1,,; +select current_user; +current_user +user1@% +show grants; +Grants for user1@% +GRANT USAGE ON *.* TO 'user1'@'%' +set role none; +connection default; +drop user user1; diff --git a/mysql-test/suite/roles/set_role-simple.test b/mysql-test/suite/roles/set_role-simple.test index 152a1d0eb25..ed884fa2407 100644 --- a/mysql-test/suite/roles/set_role-simple.test +++ b/mysql-test/suite/roles/set_role-simple.test @@ -37,3 +37,18 @@ delete from mysql.user where user='test_role1'; delete from mysql.roles_mapping where Role='test_role1'; flush privileges; drop user 'test_user'@'localhost'; + +# +# MDEV-9898 SET ROLE NONE can crash mysqld. +# + +create user user1; + +--connect (con1,localhost,user1,,) +select current_user; +show grants; +set role none; + +connection default; +drop user user1; + diff --git a/mysql-test/suite/rpl/r/create_or_replace_mix.result b/mysql-test/suite/rpl/r/create_or_replace_mix.result index e90021f78fc..9029156c625 100644 --- a/mysql-test/suite/rpl/r/create_or_replace_mix.result +++ b/mysql-test/suite/rpl/r/create_or_replace_mix.result @@ -163,7 +163,7 @@ slave-bin.000001 # Query # # COMMIT slave-bin.000001 # Gtid # # GTID #-#-# slave-bin.000001 # Query # # use `test`; CREATE TABLE `t4` ( `a` int(11) DEFAULT NULL -) +) ENGINE=MyISAM slave-bin.000001 # Gtid # # BEGIN GTID #-#-# slave-bin.000001 # Query # # use `test`; CREATE TABLE `t5` ( `a` int(11) DEFAULT NULL diff --git a/mysql-test/suite/rpl/r/create_or_replace_row.result b/mysql-test/suite/rpl/r/create_or_replace_row.result index 2f29b1c125b..78477ca4c73 100644 --- a/mysql-test/suite/rpl/r/create_or_replace_row.result +++ b/mysql-test/suite/rpl/r/create_or_replace_row.result @@ -41,7 +41,7 @@ master-bin.000001 # Query # # use `test`; CREATE OR REPLACE table t1 like t2 master-bin.000001 # Gtid # # GTID #-#-# master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE `t1` ( `a_in_temporary` int(11) DEFAULT NULL -) +) ENGINE=MyISAM master-bin.000001 # Gtid # # GTID #-#-# master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ connection server_2; @@ -75,7 +75,7 @@ slave-bin.000001 # Query # # use `test`; CREATE OR REPLACE table t1 like t2 slave-bin.000001 # Gtid # # GTID #-#-# slave-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE `t1` ( `a_in_temporary` int(11) DEFAULT NULL -) +) ENGINE=MyISAM slave-bin.000001 # Gtid # # GTID #-#-# slave-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by server */ connection server_1; @@ -185,7 +185,7 @@ slave-bin.000001 # Query # # COMMIT slave-bin.000001 # Gtid # # GTID #-#-# slave-bin.000001 # Query # # use `test`; CREATE TABLE `t4` ( `a` int(11) DEFAULT NULL -) +) ENGINE=MyISAM slave-bin.000001 # Gtid # # BEGIN GTID #-#-# slave-bin.000001 # Query # # use `test`; CREATE TABLE `t5` ( `a` int(11) DEFAULT NULL diff --git a/mysql-test/suite/rpl/r/create_or_replace_statement.result b/mysql-test/suite/rpl/r/create_or_replace_statement.result index 3b4525f82b6..69206cc861f 100644 --- a/mysql-test/suite/rpl/r/create_or_replace_statement.result +++ b/mysql-test/suite/rpl/r/create_or_replace_statement.result @@ -166,7 +166,7 @@ slave-bin.000001 # Query # # COMMIT slave-bin.000001 # Gtid # # GTID #-#-# slave-bin.000001 # Query # # use `test`; CREATE TABLE `t4` ( `a` int(11) DEFAULT NULL -) +) ENGINE=MyISAM slave-bin.000001 # Gtid # # BEGIN GTID #-#-# slave-bin.000001 # Query # # use `test`; CREATE TABLE `t5` ( `a` int(11) DEFAULT NULL diff --git a/mysql-test/suite/rpl/r/rpl_default.result b/mysql-test/suite/rpl/r/rpl_default.result new file mode 100644 index 00000000000..a1629b99bb3 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_default.result @@ -0,0 +1,19 @@ +include/master-slave.inc +[connection master] +connection master; +create table t1 (a int DEFAULT (1+1), b bigint default uuid_short(), u blob default user()); +insert into t1 (a) values(1); +connection slave; +connection slave; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT (1+1), + `b` bigint(20) DEFAULT uuid_short(), + `u` blob DEFAULT user() +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +a uuid user +1 1 1 +connection master; +drop table t1; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_extra_col_master_innodb.result b/mysql-test/suite/rpl/r/rpl_extra_col_master_innodb.result index 8371018f96a..81302266d82 100644 --- a/mysql-test/suite/rpl/r/rpl_extra_col_master_innodb.result +++ b/mysql-test/suite/rpl/r/rpl_extra_col_master_innodb.result @@ -101,13 +101,11 @@ f5 DOUBLE DEFAULT '2.00', f6 ENUM('a', 'b', 'c') default 'a', f7 DECIMAL(17,9) default '1000.00', f8 MEDIUMBLOB, -f9 NUMERIC(6,4) default '2000.00', +f9 NUMERIC(6,2) default '2000.00', f10 VARCHAR(1024), f11 BINARY(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0', f12 SET('a', 'b', 'c') default 'b') ENGINE='InnoDB'; -Warnings: -Warning 1264 Out of range value for column 'f9' at row 1 CREATE TABLE t3 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), /* extra */ @@ -124,13 +122,11 @@ CREATE TABLE t4 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), f5 DOUBLE DEFAULT '2.00', f6 DECIMAL(17,9) default '1000.00', f7 MEDIUMBLOB, -f8 NUMERIC(6,4) default '2000.00', +f8 NUMERIC(6,2) default '2000.00', f9 VARCHAR(1024), f10 BINARY(20) not null default '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0', f11 CHAR(255)) ENGINE='InnoDB'; -Warnings: -Warning 1264 Out of range value for column 'f8' at row 1 CREATE TABLE t31 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), /* extra */ @@ -191,9 +187,6 @@ INSERT into t2 values (2, 2, 2, 'second', (3, 3, 3, 'third', 3.0, 'b', 3000.0003, 'f8: medium size blob', 3000, 'f10: some var char', '01234567', 'c'); -Warnings: -Warning 1264 Out of range value for column 'f9' at row 1 -Warning 1264 Out of range value for column 'f9' at row 2 INSERT into t3 set f1=1, f2=1, f3=1, f4='first', f10='f10: some var char'; INSERT into t4 set f1=1, f2=1, f3=1, f4='first', f7='f7: medium size blob', f10='f10: binary data'; @@ -643,7 +636,7 @@ c1 c3 hex(c4) c5 c6 ************ connection slave; include/wait_for_slave_sql_error.inc [errno=1091] -Last_SQL_Error = 'Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7'' +Last_SQL_Error = 'Error 'Can't DROP COLUMN `c7`; check that it exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7'' STOP SLAVE; RESET SLAVE; diff --git a/mysql-test/suite/rpl/r/rpl_extra_col_master_myisam.result b/mysql-test/suite/rpl/r/rpl_extra_col_master_myisam.result index 6b41925aad7..12567f89af9 100644 --- a/mysql-test/suite/rpl/r/rpl_extra_col_master_myisam.result +++ b/mysql-test/suite/rpl/r/rpl_extra_col_master_myisam.result @@ -101,13 +101,11 @@ f5 DOUBLE DEFAULT '2.00', f6 ENUM('a', 'b', 'c') default 'a', f7 DECIMAL(17,9) default '1000.00', f8 MEDIUMBLOB, -f9 NUMERIC(6,4) default '2000.00', +f9 NUMERIC(6,2) default '2000.00', f10 VARCHAR(1024), f11 BINARY(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0', f12 SET('a', 'b', 'c') default 'b') ENGINE='MyISAM'; -Warnings: -Warning 1264 Out of range value for column 'f9' at row 1 CREATE TABLE t3 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), /* extra */ @@ -124,13 +122,11 @@ CREATE TABLE t4 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), f5 DOUBLE DEFAULT '2.00', f6 DECIMAL(17,9) default '1000.00', f7 MEDIUMBLOB, -f8 NUMERIC(6,4) default '2000.00', +f8 NUMERIC(6,2) default '2000.00', f9 VARCHAR(1024), f10 BINARY(20) not null default '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0', f11 CHAR(255)) ENGINE='MyISAM'; -Warnings: -Warning 1264 Out of range value for column 'f8' at row 1 CREATE TABLE t31 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), /* extra */ @@ -191,9 +187,6 @@ INSERT into t2 values (2, 2, 2, 'second', (3, 3, 3, 'third', 3.0, 'b', 3000.0003, 'f8: medium size blob', 3000, 'f10: some var char', '01234567', 'c'); -Warnings: -Warning 1264 Out of range value for column 'f9' at row 1 -Warning 1264 Out of range value for column 'f9' at row 2 INSERT into t3 set f1=1, f2=1, f3=1, f4='first', f10='f10: some var char'; INSERT into t4 set f1=1, f2=1, f3=1, f4='first', f7='f7: medium size blob', f10='f10: binary data'; @@ -643,7 +636,7 @@ c1 c3 hex(c4) c5 c6 ************ connection slave; include/wait_for_slave_sql_error.inc [errno=1091] -Last_SQL_Error = 'Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7'' +Last_SQL_Error = 'Error 'Can't DROP COLUMN `c7`; check that it exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7'' STOP SLAVE; RESET SLAVE; diff --git a/mysql-test/suite/rpl/r/rpl_extra_col_slave_innodb.result b/mysql-test/suite/rpl/r/rpl_extra_col_slave_innodb.result index e5e474fecca..f4648160bbd 100644 --- a/mysql-test/suite/rpl/r/rpl_extra_col_slave_innodb.result +++ b/mysql-test/suite/rpl/r/rpl_extra_col_slave_innodb.result @@ -657,8 +657,8 @@ Table Create Table t16 CREATE TABLE `t16` ( `c1` int(11) NOT NULL, `c2` decimal(8,2) DEFAULT NULL, - `c3` text, - `c4` blob, + `c3` text DEFAULT NULL, + `c4` blob DEFAULT NULL, `c5` char(5) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 @@ -671,10 +671,10 @@ Table Create Table t16 CREATE TABLE `t16` ( `c1` int(11) NOT NULL, `c2` decimal(8,2) DEFAULT NULL, - `c3` text, - `c4` blob, + `c3` text DEFAULT NULL, + `c4` blob DEFAULT NULL, `c5` char(5) DEFAULT NULL, - `c6` int(11) DEFAULT '1', + `c6` int(11) DEFAULT 1, `c7` timestamp NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`c1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 diff --git a/mysql-test/suite/rpl/r/rpl_extra_col_slave_myisam.result b/mysql-test/suite/rpl/r/rpl_extra_col_slave_myisam.result index 548736b9146..f3863b27325 100644 --- a/mysql-test/suite/rpl/r/rpl_extra_col_slave_myisam.result +++ b/mysql-test/suite/rpl/r/rpl_extra_col_slave_myisam.result @@ -657,8 +657,8 @@ Table Create Table t16 CREATE TABLE `t16` ( `c1` int(11) NOT NULL, `c2` decimal(8,2) DEFAULT NULL, - `c3` text, - `c4` blob, + `c3` text DEFAULT NULL, + `c4` blob DEFAULT NULL, `c5` char(5) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 @@ -671,10 +671,10 @@ Table Create Table t16 CREATE TABLE `t16` ( `c1` int(11) NOT NULL, `c2` decimal(8,2) DEFAULT NULL, - `c3` text, - `c4` blob, + `c3` text DEFAULT NULL, + `c4` blob DEFAULT NULL, `c5` char(5) DEFAULT NULL, - `c6` int(11) DEFAULT '1', + `c6` int(11) DEFAULT 1, `c7` timestamp NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`c1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 diff --git a/mysql-test/suite/rpl/r/rpl_gtid_basic.result b/mysql-test/suite/rpl/r/rpl_gtid_basic.result index 2a665e87008..9fb4d043599 100644 --- a/mysql-test/suite/rpl/r/rpl_gtid_basic.result +++ b/mysql-test/suite/rpl/r/rpl_gtid_basic.result @@ -555,3 +555,14 @@ a connection server_1; DROP TABLE t1; include/rpl_end.inc +# +# Start of 10.2 tests +# +# +# MDEV-10134 Add full support for DEFAULT +# +CREATE TABLE t1 (a VARCHAR(100) DEFAULT BINLOG_GTID_POS("master-bin.000001", 600)); +ERROR HY000: Function or expression 'binlog_gtid_pos()' cannot be used in the DEFAULT clause of `a` +# +# End of 10.2 tests +# diff --git a/mysql-test/suite/rpl/r/rpl_hrtime.result b/mysql-test/suite/rpl/r/rpl_hrtime.result index 99d412d4843..eb470fa2274 100644 --- a/mysql-test/suite/rpl/r/rpl_hrtime.result +++ b/mysql-test/suite/rpl/r/rpl_hrtime.result @@ -37,7 +37,7 @@ ROLLBACK/*!*/; use `test`/*!*/; SET TIMESTAMP=1293832861/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=1342177280/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; diff --git a/mysql-test/suite/rpl/r/rpl_ignore_table.result b/mysql-test/suite/rpl/r/rpl_ignore_table.result index 732d1746dbd..4eeb333d10c 100644 --- a/mysql-test/suite/rpl/r/rpl_ignore_table.result +++ b/mysql-test/suite/rpl/r/rpl_ignore_table.result @@ -157,5 +157,6 @@ SELECT * FROM tmptbl504451f4258$1; ERROR 42S02: Table 'test.tmptbl504451f4258$1' doesn't exist connection master; DROP TABLE t5; +flush privileges; connection slave; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_innodb_bug28430.result b/mysql-test/suite/rpl/r/rpl_innodb_bug28430.result index ee8c585444e..86607217019 100644 --- a/mysql-test/suite/rpl/r/rpl_innodb_bug28430.result +++ b/mysql-test/suite/rpl/r/rpl_innodb_bug28430.result @@ -116,7 +116,7 @@ Create Table CREATE TABLE `byrange_tbl` ( `id` mediumint(9) NOT NULL AUTO_INCREMENT, `dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `user` char(255) DEFAULT NULL, - `uuidf` longblob, + `uuidf` longblob DEFAULT NULL, `fkid` mediumint(9) DEFAULT NULL, `filler` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) diff --git a/mysql-test/suite/rpl/r/rpl_killed_ddl.result b/mysql-test/suite/rpl/r/rpl_killed_ddl.result index b5b302bc3eb..bb264a12af3 100644 --- a/mysql-test/suite/rpl/r/rpl_killed_ddl.result +++ b/mysql-test/suite/rpl/r/rpl_killed_ddl.result @@ -61,6 +61,13 @@ connection master; include/rpl_diff.inc connection master; connection master1; +ALTER DATABASE d1 +DEFAULT CHARACTER SET = 'utf8'; +source include/kill_query.inc; +connection master; +include/rpl_diff.inc +connection master; +connection master1; DROP DATABASE d1; source include/kill_query.inc; connection master; @@ -112,6 +119,12 @@ connection master; include/rpl_diff.inc connection master; connection master1; +DROP FUNCTION IF EXISTS f2; +source include/kill_query.inc; +connection master; +include/rpl_diff.inc +connection master; +connection master1; CREATE PROCEDURE p2 (OUT rows INT) BEGIN SELECT COUNT(*) INTO rows FROM t2; @@ -134,6 +147,12 @@ connection master; include/rpl_diff.inc connection master; connection master1; +DROP PROCEDURE IF EXISTS p2; +source include/kill_query.inc; +connection master; +include/rpl_diff.inc +connection master; +connection master1; CREATE TABLE t2 (b int); source include/kill_query.inc; connection master; diff --git a/mysql-test/suite/rpl/r/rpl_mdev382.result b/mysql-test/suite/rpl/r/rpl_mdev382.result index a21d6fe6a5f..0d75d1c2000 100644 --- a/mysql-test/suite/rpl/r/rpl_mdev382.result +++ b/mysql-test/suite/rpl/r/rpl_mdev382.result @@ -179,7 +179,7 @@ ROLLBACK/*!*/; use `db1``; select 'oops!'`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -279,7 +279,7 @@ ROLLBACK/*!*/; use `db1``; select 'oops!'`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -388,7 +388,7 @@ BEGIN use `ts``et`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=1342177280/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; diff --git a/mysql-test/suite/rpl/r/rpl_mixed_ddl_dml.result b/mysql-test/suite/rpl/r/rpl_mixed_ddl_dml.result index ceb4fdf39d5..e7b0d6f29c8 100644 --- a/mysql-test/suite/rpl/r/rpl_mixed_ddl_dml.result +++ b/mysql-test/suite/rpl/r/rpl_mixed_ddl_dml.result @@ -44,7 +44,7 @@ t3 CREATE TABLE `t3` ( show create table t5; Table Create Table t5 CREATE TABLE `t5` ( - `id` int(11) NOT NULL DEFAULT '0', + `id` int(11) NOT NULL DEFAULT 0, `created` datetime DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 connection master; diff --git a/mysql-test/suite/rpl/r/rpl_multi_engine.result b/mysql-test/suite/rpl/r/rpl_multi_engine.result index c39d9f5f374..075cbc14fe7 100644 --- a/mysql-test/suite/rpl/r/rpl_multi_engine.result +++ b/mysql-test/suite/rpl/r/rpl_multi_engine.result @@ -17,8 +17,8 @@ t1 CREATE TABLE `t1` ( `b1` bit(8) DEFAULT NULL, `vc` varchar(255) DEFAULT NULL, `bc` char(255) DEFAULT NULL, - `d` decimal(10,4) DEFAULT '0.0000', - `f` float DEFAULT '0', + `d` decimal(10,4) DEFAULT 0.0000, + `f` float DEFAULT 0, `total` bigint(20) unsigned DEFAULT NULL, `y` year(4) DEFAULT NULL, `t` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, @@ -34,8 +34,8 @@ t1 CREATE TABLE `t1` ( `b1` bit(8) DEFAULT NULL, `vc` varchar(255) DEFAULT NULL, `bc` char(255) DEFAULT NULL, - `d` decimal(10,4) DEFAULT '0.0000', - `f` float DEFAULT '0', + `d` decimal(10,4) DEFAULT 0.0000, + `f` float DEFAULT 0, `total` bigint(20) unsigned DEFAULT NULL, `y` year(4) DEFAULT NULL, `t` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, @@ -76,8 +76,8 @@ t1 CREATE TABLE `t1` ( `b1` bit(8) DEFAULT NULL, `vc` varchar(255) DEFAULT NULL, `bc` char(255) DEFAULT NULL, - `d` decimal(10,4) DEFAULT '0.0000', - `f` float DEFAULT '0', + `d` decimal(10,4) DEFAULT 0.0000, + `f` float DEFAULT 0, `total` bigint(20) unsigned DEFAULT NULL, `y` year(4) DEFAULT NULL, `t` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, @@ -118,8 +118,8 @@ t1 CREATE TABLE `t1` ( `b1` bit(8) DEFAULT NULL, `vc` varchar(255) DEFAULT NULL, `bc` char(255) DEFAULT NULL, - `d` decimal(10,4) DEFAULT '0.0000', - `f` float DEFAULT '0', + `d` decimal(10,4) DEFAULT 0.0000, + `f` float DEFAULT 0, `total` bigint(20) unsigned DEFAULT NULL, `y` year(4) DEFAULT NULL, `t` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, @@ -160,8 +160,8 @@ t1 CREATE TABLE `t1` ( `b1` bit(8) DEFAULT NULL, `vc` varchar(255) DEFAULT NULL, `bc` char(255) DEFAULT NULL, - `d` decimal(10,4) DEFAULT '0.0000', - `f` float DEFAULT '0', + `d` decimal(10,4) DEFAULT 0.0000, + `f` float DEFAULT 0, `total` bigint(20) unsigned DEFAULT NULL, `y` year(4) DEFAULT NULL, `t` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, @@ -177,8 +177,8 @@ t1 CREATE TABLE `t1` ( `b1` bit(8) DEFAULT NULL, `vc` varchar(255) DEFAULT NULL, `bc` char(255) DEFAULT NULL, - `d` decimal(10,4) DEFAULT '0.0000', - `f` float DEFAULT '0', + `d` decimal(10,4) DEFAULT 0.0000, + `f` float DEFAULT 0, `total` bigint(20) unsigned DEFAULT NULL, `y` year(4) DEFAULT NULL, `t` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, @@ -219,8 +219,8 @@ t1 CREATE TABLE `t1` ( `b1` bit(8) DEFAULT NULL, `vc` varchar(255) DEFAULT NULL, `bc` char(255) DEFAULT NULL, - `d` decimal(10,4) DEFAULT '0.0000', - `f` float DEFAULT '0', + `d` decimal(10,4) DEFAULT 0.0000, + `f` float DEFAULT 0, `total` bigint(20) unsigned DEFAULT NULL, `y` year(4) DEFAULT NULL, `t` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, @@ -261,8 +261,8 @@ t1 CREATE TABLE `t1` ( `b1` bit(8) DEFAULT NULL, `vc` varchar(255) DEFAULT NULL, `bc` char(255) DEFAULT NULL, - `d` decimal(10,4) DEFAULT '0.0000', - `f` float DEFAULT '0', + `d` decimal(10,4) DEFAULT 0.0000, + `f` float DEFAULT 0, `total` bigint(20) unsigned DEFAULT NULL, `y` year(4) DEFAULT NULL, `t` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, @@ -303,8 +303,8 @@ t1 CREATE TABLE `t1` ( `b1` bit(8) DEFAULT NULL, `vc` varchar(255) DEFAULT NULL, `bc` char(255) DEFAULT NULL, - `d` decimal(10,4) DEFAULT '0.0000', - `f` float DEFAULT '0', + `d` decimal(10,4) DEFAULT 0.0000, + `f` float DEFAULT 0, `total` bigint(20) unsigned DEFAULT NULL, `y` year(4) DEFAULT NULL, `t` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, @@ -320,8 +320,8 @@ t1 CREATE TABLE `t1` ( `b1` bit(8) DEFAULT NULL, `vc` varchar(255) DEFAULT NULL, `bc` char(255) DEFAULT NULL, - `d` decimal(10,4) DEFAULT '0.0000', - `f` float DEFAULT '0', + `d` decimal(10,4) DEFAULT 0.0000, + `f` float DEFAULT 0, `total` bigint(20) unsigned DEFAULT NULL, `y` year(4) DEFAULT NULL, `t` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, @@ -362,8 +362,8 @@ t1 CREATE TABLE `t1` ( `b1` bit(8) DEFAULT NULL, `vc` varchar(255) DEFAULT NULL, `bc` char(255) DEFAULT NULL, - `d` decimal(10,4) DEFAULT '0.0000', - `f` float DEFAULT '0', + `d` decimal(10,4) DEFAULT 0.0000, + `f` float DEFAULT 0, `total` bigint(20) unsigned DEFAULT NULL, `y` year(4) DEFAULT NULL, `t` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, @@ -404,8 +404,8 @@ t1 CREATE TABLE `t1` ( `b1` bit(8) DEFAULT NULL, `vc` varchar(255) DEFAULT NULL, `bc` char(255) DEFAULT NULL, - `d` decimal(10,4) DEFAULT '0.0000', - `f` float DEFAULT '0', + `d` decimal(10,4) DEFAULT 0.0000, + `f` float DEFAULT 0, `total` bigint(20) unsigned DEFAULT NULL, `y` year(4) DEFAULT NULL, `t` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, diff --git a/mysql-test/suite/rpl/r/rpl_reopen_temp_table.result b/mysql-test/suite/rpl/r/rpl_reopen_temp_table.result new file mode 100644 index 00000000000..2c4ffba622b --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_reopen_temp_table.result @@ -0,0 +1,30 @@ +include/master-slave.inc +[connection master] +connection slave; +reset master; +# +# MDEV-5535: Cannot reopen temporary table +# +connection master; +DROP TABLE IF EXISTS t1, t2, t3; +CREATE TEMPORARY TABLE t1(c1 INT) ENGINE=INNODB; +INSERT INTO t1 VALUES (1), (2), (3), (4), (5); +CREATE TEMPORARY TABLE t2 SELECT A.c1 a, B.c1 b FROM t1 AS A, t1 AS B; +CREATE TABLE t3 SELECT * FROM t2; +SELECT COUNT(*) = 5 FROM t1; +COUNT(*) = 5 +1 +SELECT COUNT(*) = 25 FROM t2; +COUNT(*) = 25 +1 +SELECT COUNT(*) = 25 FROM t3; +COUNT(*) = 25 +1 +connection slave; +SELECT COUNT(*) = 25 FROM t3; +COUNT(*) = 25 +1 +connection master; +DROP TABLE t1, t2, t3; +connection slave; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_row_UUID.result b/mysql-test/suite/rpl/r/rpl_row_UUID.result index 45fc1c0f4a0..f54ea7f6aef 100644 --- a/mysql-test/suite/rpl/r/rpl_row_UUID.result +++ b/mysql-test/suite/rpl/r/rpl_row_UUID.result @@ -28,7 +28,7 @@ SHOW CREATE TABLE test.t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) NOT NULL, - `blob_column` longblob, + `blob_column` longblob DEFAULT NULL, `vchar_column` varchar(100) DEFAULT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 diff --git a/mysql-test/suite/rpl/r/rpl_row_basic_8partition.result b/mysql-test/suite/rpl/r/rpl_row_basic_8partition.result index 2946a149412..37548cad4db 100644 --- a/mysql-test/suite/rpl/r/rpl_row_basic_8partition.result +++ b/mysql-test/suite/rpl/r/rpl_row_basic_8partition.result @@ -22,8 +22,8 @@ t1 CREATE TABLE `t1` ( `b1` bit(8) DEFAULT NULL, `vc` varchar(255) DEFAULT NULL, `bc` char(255) DEFAULT NULL, - `d` decimal(10,4) DEFAULT '0.0000', - `f` float DEFAULT '0', + `d` decimal(10,4) DEFAULT 0.0000, + `f` float DEFAULT 0, `total` bigint(20) unsigned DEFAULT NULL, `y` year(4) DEFAULT NULL, `t` date DEFAULT NULL @@ -43,8 +43,8 @@ t1 CREATE TABLE `t1` ( `b1` bit(8) DEFAULT NULL, `vc` varchar(255) DEFAULT NULL, `bc` char(255) DEFAULT NULL, - `d` decimal(10,4) DEFAULT '0.0000', - `f` float DEFAULT '0', + `d` decimal(10,4) DEFAULT 0.0000, + `f` float DEFAULT 0, `total` bigint(20) unsigned DEFAULT NULL, `y` year(4) DEFAULT NULL, `t` date DEFAULT NULL @@ -108,10 +108,10 @@ Table Create Table t1 CREATE TABLE `t1` ( `id` mediumint(9) NOT NULL, `b1` bit(8) DEFAULT NULL, - `vc` text, + `vc` text DEFAULT NULL, `bc` char(255) DEFAULT NULL, - `d` decimal(10,4) DEFAULT '0.0000', - `f` float DEFAULT '0', + `d` decimal(10,4) DEFAULT 0.0000, + `f` float DEFAULT 0, `total` bigint(20) unsigned DEFAULT NULL, `y` year(4) DEFAULT NULL, `t` date DEFAULT NULL @@ -129,10 +129,10 @@ Table Create Table t1 CREATE TABLE `t1` ( `id` mediumint(9) NOT NULL, `b1` bit(8) DEFAULT NULL, - `vc` text, + `vc` text DEFAULT NULL, `bc` char(255) DEFAULT NULL, - `d` decimal(10,4) DEFAULT '0.0000', - `f` float DEFAULT '0', + `d` decimal(10,4) DEFAULT 0.0000, + `f` float DEFAULT 0, `total` bigint(20) unsigned DEFAULT NULL, `y` year(4) DEFAULT NULL, `t` date DEFAULT NULL @@ -207,8 +207,8 @@ t1 CREATE TABLE `t1` ( `b1` bit(8) DEFAULT NULL, `vc` varchar(255) DEFAULT NULL, `bc` char(255) DEFAULT NULL, - `d` decimal(10,4) DEFAULT '0.0000', - `f` float DEFAULT '0', + `d` decimal(10,4) DEFAULT 0.0000, + `f` float DEFAULT 0, `total` bigint(20) unsigned DEFAULT NULL, `y` year(4) DEFAULT NULL, `t` date DEFAULT NULL @@ -225,8 +225,8 @@ t1 CREATE TABLE `t1` ( `b1` bit(8) DEFAULT NULL, `vc` varchar(255) DEFAULT NULL, `bc` char(255) DEFAULT NULL, - `d` decimal(10,4) DEFAULT '0.0000', - `f` float DEFAULT '0', + `d` decimal(10,4) DEFAULT 0.0000, + `f` float DEFAULT 0, `total` bigint(20) unsigned DEFAULT NULL, `y` year(4) DEFAULT NULL, `t` date DEFAULT NULL @@ -287,10 +287,10 @@ Table Create Table t1 CREATE TABLE `t1` ( `id` mediumint(9) NOT NULL, `b1` bit(8) DEFAULT NULL, - `vc` text, + `vc` text DEFAULT NULL, `bc` char(255) DEFAULT NULL, - `d` decimal(10,4) DEFAULT '0.0000', - `f` float DEFAULT '0', + `d` decimal(10,4) DEFAULT 0.0000, + `f` float DEFAULT 0, `total` bigint(20) unsigned DEFAULT NULL, `y` year(4) DEFAULT NULL, `t` date DEFAULT NULL @@ -305,10 +305,10 @@ Table Create Table t1 CREATE TABLE `t1` ( `id` mediumint(9) NOT NULL, `b1` bit(8) DEFAULT NULL, - `vc` text, + `vc` text DEFAULT NULL, `bc` char(255) DEFAULT NULL, - `d` decimal(10,4) DEFAULT '0.0000', - `f` float DEFAULT '0', + `d` decimal(10,4) DEFAULT 0.0000, + `f` float DEFAULT 0, `total` bigint(20) unsigned DEFAULT NULL, `y` year(4) DEFAULT NULL, `t` date DEFAULT NULL @@ -378,8 +378,8 @@ t1 CREATE TABLE `t1` ( `b1` bit(8) DEFAULT NULL, `vc` varchar(255) DEFAULT NULL, `bc` char(255) DEFAULT NULL, - `d` decimal(10,4) DEFAULT '0.0000', - `f` float DEFAULT '0', + `d` decimal(10,4) DEFAULT 0.0000, + `f` float DEFAULT 0, `total` bigint(20) unsigned DEFAULT NULL, `y` year(4) DEFAULT NULL, `t` date DEFAULT NULL @@ -394,8 +394,8 @@ t1 CREATE TABLE `t1` ( `b1` bit(8) DEFAULT NULL, `vc` varchar(255) DEFAULT NULL, `bc` char(255) DEFAULT NULL, - `d` decimal(10,4) DEFAULT '0.0000', - `f` float DEFAULT '0', + `d` decimal(10,4) DEFAULT 0.0000, + `f` float DEFAULT 0, `total` bigint(20) unsigned DEFAULT NULL, `y` year(4) DEFAULT NULL, `t` date DEFAULT NULL @@ -453,10 +453,10 @@ Table Create Table t1 CREATE TABLE `t1` ( `id` mediumint(9) NOT NULL, `b1` bit(8) DEFAULT NULL, - `vc` text, + `vc` text DEFAULT NULL, `bc` char(255) DEFAULT NULL, - `d` decimal(10,4) DEFAULT '0.0000', - `f` float DEFAULT '0', + `d` decimal(10,4) DEFAULT 0.0000, + `f` float DEFAULT 0, `total` bigint(20) unsigned DEFAULT NULL, `y` year(4) DEFAULT NULL, `t` date DEFAULT NULL @@ -469,10 +469,10 @@ Table Create Table t1 CREATE TABLE `t1` ( `id` mediumint(9) NOT NULL, `b1` bit(8) DEFAULT NULL, - `vc` text, + `vc` text DEFAULT NULL, `bc` char(255) DEFAULT NULL, - `d` decimal(10,4) DEFAULT '0.0000', - `f` float DEFAULT '0', + `d` decimal(10,4) DEFAULT 0.0000, + `f` float DEFAULT 0, `total` bigint(20) unsigned DEFAULT NULL, `y` year(4) DEFAULT NULL, `t` date DEFAULT NULL @@ -540,8 +540,8 @@ t1 CREATE TABLE `t1` ( `b1` bit(8) DEFAULT NULL, `vc` varchar(255) DEFAULT NULL, `bc` char(255) DEFAULT NULL, - `d` decimal(10,4) DEFAULT '0.0000', - `f` float DEFAULT '0', + `d` decimal(10,4) DEFAULT 0.0000, + `f` float DEFAULT 0, `total` bigint(20) unsigned DEFAULT NULL, `y` year(4) DEFAULT NULL, `t` date DEFAULT NULL, @@ -557,8 +557,8 @@ t1 CREATE TABLE `t1` ( `b1` bit(8) DEFAULT NULL, `vc` varchar(255) DEFAULT NULL, `bc` char(255) DEFAULT NULL, - `d` decimal(10,4) DEFAULT '0.0000', - `f` float DEFAULT '0', + `d` decimal(10,4) DEFAULT 0.0000, + `f` float DEFAULT 0, `total` bigint(20) unsigned DEFAULT NULL, `y` year(4) DEFAULT NULL, `t` date DEFAULT NULL, @@ -620,8 +620,8 @@ t1 CREATE TABLE `t1` ( `b1` bit(8) DEFAULT NULL, `vc` varchar(255) DEFAULT NULL, `bc` char(255) DEFAULT NULL, - `d` decimal(10,4) DEFAULT '0.0000', - `f` float DEFAULT '0', + `d` decimal(10,4) DEFAULT 0.0000, + `f` float DEFAULT 0, `total` bigint(20) unsigned NOT NULL, `y` year(4) DEFAULT NULL, `t` date DEFAULT NULL, @@ -637,8 +637,8 @@ t1 CREATE TABLE `t1` ( `b1` bit(8) DEFAULT NULL, `vc` varchar(255) DEFAULT NULL, `bc` char(255) DEFAULT NULL, - `d` decimal(10,4) DEFAULT '0.0000', - `f` float DEFAULT '0', + `d` decimal(10,4) DEFAULT 0.0000, + `f` float DEFAULT 0, `total` bigint(20) unsigned NOT NULL, `y` year(4) DEFAULT NULL, `t` date DEFAULT NULL, @@ -698,10 +698,10 @@ Table Create Table t1 CREATE TABLE `t1` ( `id` mediumint(9) NOT NULL, `b1` bit(8) DEFAULT NULL, - `vc` text, + `vc` text DEFAULT NULL, `bc` char(255) DEFAULT NULL, - `d` decimal(10,4) DEFAULT '0.0000', - `f` float DEFAULT '0', + `d` decimal(10,4) DEFAULT 0.0000, + `f` float DEFAULT 0, `total` bigint(20) unsigned NOT NULL, `y` year(4) DEFAULT NULL, `t` date DEFAULT NULL, @@ -715,10 +715,10 @@ Table Create Table t1 CREATE TABLE `t1` ( `id` mediumint(9) NOT NULL, `b1` bit(8) DEFAULT NULL, - `vc` text, + `vc` text DEFAULT NULL, `bc` char(255) DEFAULT NULL, - `d` decimal(10,4) DEFAULT '0.0000', - `f` float DEFAULT '0', + `d` decimal(10,4) DEFAULT 0.0000, + `f` float DEFAULT 0, `total` bigint(20) unsigned NOT NULL, `y` year(4) DEFAULT NULL, `t` date DEFAULT NULL, diff --git a/mysql-test/suite/rpl/r/rpl_row_create_table.result b/mysql-test/suite/rpl/r/rpl_row_create_table.result index 22ddf2e58f8..9ba89b2fc15 100644 --- a/mysql-test/suite/rpl/r/rpl_row_create_table.result +++ b/mysql-test/suite/rpl/r/rpl_row_create_table.result @@ -201,7 +201,7 @@ master-bin.000001 # Gtid # # GTID #-#-# master-bin.000001 # Query # # use `test`; CREATE TABLE `t9` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL -) +) ENGINE=MyISAM connection slave; SHOW CREATE TABLE t8; Table t8 @@ -214,7 +214,7 @@ Table t9 Create Table CREATE TABLE `t9` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL -) ENGINE=MEMORY DEFAULT CHARSET=latin1 +) ENGINE=MyISAM DEFAULT CHARSET=latin1 connection master; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8,t9; connection slave; diff --git a/mysql-test/suite/rpl/r/rpl_row_merge_engine.result b/mysql-test/suite/rpl/r/rpl_row_merge_engine.result index 8039527b099..ecc0e6d6d18 100644 --- a/mysql-test/suite/rpl/r/rpl_row_merge_engine.result +++ b/mysql-test/suite/rpl/r/rpl_row_merge_engine.result @@ -5,8 +5,9 @@ CREATE TABLE t1 (a int) ENGINE=MyISAM; CREATE TABLE t2 (a int) ENGINE=MyISAM; INSERT INTO t1 VALUES (1), (2), (3); INSERT INTO t2 VALUES (4), (5), (6); -CREATE TABLE IF NOT EXISTS t1_merge LIKE t1; -ALTER TABLE t1_merge ENGINE=MERGE UNION (t2, t1); +CREATE TEMPORARY TABLE IF NOT EXISTS tt1_merge LIKE t1; +ALTER TABLE tt1_merge ENGINE=MERGE UNION (t2, t1); +CREATE TABLE t1_merge LIKE tt1_merge; connection slave; include/diff_tables.inc [master:test.t1, slave:test.t1] include/diff_tables.inc [master:test.t2, slave:test.t2] diff --git a/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result b/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result index ad99ec5f630..5c3bcf9070c 100644 --- a/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result +++ b/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result @@ -167,7 +167,7 @@ ROLLBACK/*!*/; use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -191,7 +191,7 @@ ROLLBACK/*!*/; use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -312,7 +312,7 @@ ROLLBACK/*!*/; use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -345,7 +345,7 @@ ROLLBACK/*!*/; use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; diff --git a/mysql-test/suite/rpl/r/rpl_sp.result b/mysql-test/suite/rpl/r/rpl_sp.result index 944f7ea06ec..65203cdaba7 100644 --- a/mysql-test/suite/rpl/r/rpl_sp.result +++ b/mysql-test/suite/rpl/r/rpl_sp.result @@ -783,7 +783,7 @@ DELIMITER /*!*/; ROLLBACK/*!*/; SET TIMESTAMP=t/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; diff --git a/mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result b/mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result index e330576be54..585ebfd9bdb 100644 --- a/mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result +++ b/mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result @@ -31,7 +31,8 @@ CREATE TABLE t3 ( i1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (i1) ); CREATE TRIGGER tr1 AFTER DELETE ON t2 FOR EACH ROW INSERT INTO t3 () VALUES (); CREATE TEMPORARY TABLE t1_tmp (i1 int); ALTER TABLE t1_tmp ADD COLUMN b INT; -DELETE FROM t2; +INSERT INTO t1 values(1); +INSERT INTO t2 (i1) select * from t1; CREATE TEMPORARY TABLE t2_tmp (a int); ALTER TABLE t1_tmp ADD COLUMN c INT; ### assertion: assert that there is one open temp table on slave @@ -66,6 +67,13 @@ slave-bin.000001 # Gtid # # GTID #-#-# slave-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE t1_tmp (i1 int) slave-bin.000001 # Gtid # # GTID #-#-# slave-bin.000001 # Query # # use `test`; ALTER TABLE t1_tmp ADD COLUMN b INT +slave-bin.000001 # Gtid # # BEGIN GTID #-#-# +slave-bin.000001 # Query # # use `test`; INSERT INTO t1 values(1) +slave-bin.000001 # Xid # # COMMIT /* XID */ +slave-bin.000001 # Gtid # # BEGIN GTID #-#-# +slave-bin.000001 # Table_map # # table_id: # (test.t2) +slave-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F +slave-bin.000001 # Query # # COMMIT slave-bin.000001 # Gtid # # GTID #-#-# slave-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`t1_tmp` /* generated by server */ slave-bin.000001 # Gtid # # GTID #-#-# diff --git a/mysql-test/suite/rpl/r/rpl_temporary.result b/mysql-test/suite/rpl/r/rpl_temporary.result index e1b34026cb7..37f13c8afb0 100644 --- a/mysql-test/suite/rpl/r/rpl_temporary.result +++ b/mysql-test/suite/rpl/r/rpl_temporary.result @@ -183,5 +183,63 @@ disconnect cont43748; -- throw out test-user on slave. connection slave; DROP USER user43748@127.0.0.1; +# +# MDEV-10216: Assertion `strcmp(share->unique_file_name,filename) || +# share->last_version' failed in myisam/mi_open.c:67: test_if_reopen +# +connection master; +CREATE TEMPORARY TABLE t1(i INT PRIMARY KEY) ENGINE=MYISAM; +INSERT INTO t1 VALUES(1); +SELECT COUNT(*)=1 FROM t1; +COUNT(*)=1 +1 +ALTER TABLE t1 RENAME t2; +SELECT COUNT(*)=1 FROM t2; +COUNT(*)=1 +1 +ALTER TABLE t2 RENAME t1; +ALTER TABLE t1 DISABLE KEYS; +ALTER TABLE t1 ENABLE KEYS; +LOCK TABLES t1 WRITE; +ALTER TABLE t1 RENAME t2; +SELECT COUNT(*)=1 FROM t2; +COUNT(*)=1 +1 +ALTER TABLE t2 RENAME t1; +ALTER TABLE t1 DISABLE KEYS; +ALTER TABLE t1 ENABLE KEYS; +UNLOCK TABLES; +LOCK TABLES t1 READ; +ALTER TABLE t1 RENAME t2; +SELECT COUNT(*)=1 FROM t2; +COUNT(*)=1 +1 +ALTER TABLE t2 RENAME t1; +ALTER TABLE t1 DISABLE KEYS; +ALTER TABLE t1 ENABLE KEYS; +UNLOCK TABLES; +FLUSH TABLES WITH READ LOCK; +ALTER TABLE t1 RENAME t2; +SELECT COUNT(*)=1 FROM t2; +COUNT(*)=1 +1 +ALTER TABLE t2 RENAME t1; +ALTER TABLE t1 DISABLE KEYS; +ALTER TABLE t1 ENABLE KEYS; +UNLOCK TABLES; +ALTER TABLE t1 RENAME t2, LOCK SHARED; +ALTER TABLE t2 RENAME t1, LOCK EXCLUSIVE; +DROP TABLE t1; +# +# MDEV-10320: NO-OP ALTER TABLE on temporary tables getting logged +# under row binlog format +# +connection master; +CREATE TEMPORARY TABLE t1(i INT PRIMARY KEY) ENGINE=MYISAM; +ALTER TABLE t1; +ALTER TABLE t1 ADD COLUMN IF NOT EXISTS I INT; +Warnings: +Note 1060 Duplicate column name 'I' +DROP TABLE t1; End of 5.1 tests include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL_innodb.result b/mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL_innodb.result new file mode 100644 index 00000000000..1a728a9932c --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL_innodb.result @@ -0,0 +1,18 @@ +include/master-slave.inc +[connection master] +connection master; +CREATE TEMPORARY TABLE temp_t1 (c1 INT) ENGINE=InnoDB; +CREATE TEMPORARY TABLE temp_t2 (c1 INT) ENGINE=MyISAM; +CREATE TABLE t1 LIKE temp_t1; +CREATE TABLE t2 LIKE temp_t2; +connection slave; +connection master; +include/assert.inc ["t1 on master and temp_t1 have the same storage engine"] +include/assert.inc ["t2 on master and temp_t2 have the same storage engine"] +connection slave; +include/assert.inc ["t1 on slave and temp_t1 have the same storage engine"] +include/assert.inc ["t2 on slave and temp_t2 have the same storage engine"] +connection master; +DROP TEMPORARY TABLE temp_t1, temp_t2; +DROP TABLE t1, t2; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/show_status_stop_slave_race-7126.result b/mysql-test/suite/rpl/r/show_status_stop_slave_race-7126.result index 277b3e74696..64219e3908d 100644 --- a/mysql-test/suite/rpl/r/show_status_stop_slave_race-7126.result +++ b/mysql-test/suite/rpl/r/show_status_stop_slave_race-7126.result @@ -1,5 +1,6 @@ include/master-slave.inc [connection master] +call mtr.add_suppression("Master is configured to log replication events"); connection slave; connection slave; start slave; diff --git a/mysql-test/suite/rpl/t/rpl_default.test b/mysql-test/suite/rpl/t/rpl_default.test new file mode 100644 index 00000000000..9adf15c93ac --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_default.test @@ -0,0 +1,29 @@ +# +# Test of replicating default values +# As the table is using non deterministic functions, replication must +# switch to binlog format. +# + +-- source include/have_binlog_format_mixed_or_row.inc +-- source include/master-slave.inc + +connection master; + +create table t1 (a int DEFAULT (1+1), b bigint default uuid_short(), u blob default user()); +insert into t1 (a) values(1); + +let $b=query_get_value(select * from t1, b, 1); +let $u=query_get_value(select * from t1, u, 1); + +sync_slave_with_master; +connection slave; + +show create table t1; +--disable_query_log +eval select a,"$b"=b as uuid,"$u"=u as user from t1; +--enable_query_log +connection master; + +drop table t1; + +--source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_gtid_basic.test b/mysql-test/suite/rpl/t/rpl_gtid_basic.test index 772194e55f4..7a4659fb824 100644 --- a/mysql-test/suite/rpl/t/rpl_gtid_basic.test +++ b/mysql-test/suite/rpl/t/rpl_gtid_basic.test @@ -560,3 +560,18 @@ DROP TABLE t1; --source include/rpl_end.inc + +--echo # +--echo # Start of 10.2 tests +--echo # + +--echo # +--echo # MDEV-10134 Add full support for DEFAULT +--echo # + +--error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +CREATE TABLE t1 (a VARCHAR(100) DEFAULT BINLOG_GTID_POS("master-bin.000001", 600)); + +--echo # +--echo # End of 10.2 tests +--echo # diff --git a/mysql-test/suite/rpl/t/rpl_ignore_table.test b/mysql-test/suite/rpl/t/rpl_ignore_table.test index a5f7b608174..3360b789475 100644 --- a/mysql-test/suite/rpl/t/rpl_ignore_table.test +++ b/mysql-test/suite/rpl/t/rpl_ignore_table.test @@ -1,6 +1,6 @@ -source include/master-slave.inc; let collation=utf8_unicode_ci; ---source include/have_collation.inc +source include/have_collation.inc; +source include/master-slave.inc; call mtr.add_suppression("Can't find record in 't.'"); call mtr.add_suppression("Can't find record in 'user'"); @@ -179,6 +179,7 @@ SELECT HEX(word) FROM t5; SELECT * FROM tmptbl504451f4258$1; connection master; DROP TABLE t5; +flush privileges; sync_slave_with_master; --source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_killed_ddl.test b/mysql-test/suite/rpl/t/rpl_killed_ddl.test index dcd3ec3625b..593051700a7 100644 --- a/mysql-test/suite/rpl/t/rpl_killed_ddl.test +++ b/mysql-test/suite/rpl/t/rpl_killed_ddl.test @@ -26,10 +26,8 @@ # # There are some part of the test are temporarily disabled because of # the following bugs, please enable then once they get fixed: -# - BUG#44041 -# - BUG#43353 -# - BUG#25705 -# - BUG#44171 +# - BUG#22473427 +# - Bug#22587377 # Temporarily disabled on Windows due to bug #47638 --source include/not_windows.inc @@ -146,11 +144,9 @@ let $rpl_diff_statement= SELECT schema_name FROM information_schema.schemata send CREATE DATABASE d2; source include/kill_query_and_diff_master_slave.inc; -# Temporarily disabled, see BUG#44041, the ALTER DATABASE can affect the -# collation of other database on slave -#send ALTER DATABASE d1 -# DEFAULT CHARACTER SET = 'utf8'; -#source include/kill_query_and_diff_master_slave.inc; +send ALTER DATABASE d1 + DEFAULT CHARACTER SET = 'utf8'; +source include/kill_query_and_diff_master_slave.inc; send DROP DATABASE d1; source include/kill_query_and_diff_master_slave.inc; @@ -169,8 +165,8 @@ send CREATE EVENT e2 DO INSERT INTO test.t1 VALUES (2); source include/kill_query_and_diff_master_slave.inc; -# Temporarily disabled because of BUG#44171, killing ALTER EVENT can -# crash the server +# Temporarily disabled,see Bug#22587377-RPL.RPL_KILLED_DDL +# FAILS SPORADICALLY ON PB2 IN 5.5 AND 5.6 #send ALTER EVENT e1 # ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 2 DAY; #source include/kill_query_and_diff_master_slave.inc; @@ -199,16 +195,8 @@ source include/kill_query_and_diff_master_slave.inc; # function f2 probably does not exist because the CREATE query was # killed -# -# Temporarily disabled. Because of BUG#43353, KILL the query may -# result in function not found, and for 5.1, DROP statements will be -# logged if the function is not found on master, so the following DROP -# FUNCTION statement may be interrupted and not drop the function on -# master, but still get logged and executed on slave and cause -# inconsistence. Also disable the following DROP PROCEDURE IF EXITS -# below. -#send DROP FUNCTION IF EXISTS f2; -#source include/kill_query_and_diff_master_slave.inc; +send DROP FUNCTION IF EXISTS f2; +source include/kill_query_and_diff_master_slave.inc; ######## PROCEDURE ######## @@ -229,9 +217,8 @@ source include/kill_query_and_diff_master_slave.inc; send DROP PROCEDURE p1; source include/kill_query_and_diff_master_slave.inc; -# Temporarily disabled because of bug#43353, see comment above for DROP FUNCTION IF EXISTS -#send DROP PROCEDURE IF EXISTS p2; -#source include/kill_query_and_diff_master_slave.inc; +send DROP PROCEDURE IF EXISTS p2; +source include/kill_query_and_diff_master_slave.inc; ######## TABLE ######## @@ -259,9 +246,10 @@ source include/kill_query_and_diff_master_slave.inc; ######## SERVER ######## -# Tempoarily disabled, see bug#25705 +# Temporarily disabled, see Bug #22473427 - DROP SERVER FAILS +# AFTER ALTER SERVER+KILL QUERY -# --let $rpl_diff_statement= SELECT * FROM mysql.server WHERE name like \'s%\' +# --let $rpl_diff_statement= SELECT * FROM mysql.servers WHERE Server_name like \'s%\' # send CREATE SERVER s2 # FOREIGN DATA WRAPPER mysql diff --git a/mysql-test/suite/rpl/t/rpl_reopen_temp_table.test b/mysql-test/suite/rpl/t/rpl_reopen_temp_table.test new file mode 100644 index 00000000000..2396dc348fe --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_reopen_temp_table.test @@ -0,0 +1,43 @@ +--source include/have_innodb.inc +--source include/master-slave.inc + +# Clean up old slave's binlogs (see rpl_temporary.test for explanation). +save_master_pos; +connection slave; +sync_with_master; +reset master; + +--echo # +--echo # MDEV-5535: Cannot reopen temporary table +--echo # + +connection master; +--disable_query_log +CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); +--enable_query_log + +disable_warnings; +DROP TABLE IF EXISTS t1, t2, t3; +enable_warnings; + +CREATE TEMPORARY TABLE t1(c1 INT) ENGINE=INNODB; +INSERT INTO t1 VALUES (1), (2), (3), (4), (5); + +CREATE TEMPORARY TABLE t2 SELECT A.c1 a, B.c1 b FROM t1 AS A, t1 AS B; + +CREATE TABLE t3 SELECT * FROM t2; + +SELECT COUNT(*) = 5 FROM t1; +SELECT COUNT(*) = 25 FROM t2; +SELECT COUNT(*) = 25 FROM t3; + +sync_slave_with_master; + +SELECT COUNT(*) = 25 FROM t3; + +connection master; +DROP TABLE t1, t2, t3; + +sync_slave_with_master; + +--source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_row_merge_engine.test b/mysql-test/suite/rpl/t/rpl_row_merge_engine.test index 5add8dc1cda..dcbb8b891d8 100644 --- a/mysql-test/suite/rpl/t/rpl_row_merge_engine.test +++ b/mysql-test/suite/rpl/t/rpl_row_merge_engine.test @@ -20,8 +20,10 @@ CREATE TABLE t1 (a int) ENGINE=MyISAM; CREATE TABLE t2 (a int) ENGINE=MyISAM; INSERT INTO t1 VALUES (1), (2), (3); INSERT INTO t2 VALUES (4), (5), (6); -CREATE TABLE IF NOT EXISTS t1_merge LIKE t1; -ALTER TABLE t1_merge ENGINE=MERGE UNION (t2, t1); +# Changed a little to check also an issue reported on BUG#20574550 +CREATE TEMPORARY TABLE IF NOT EXISTS tt1_merge LIKE t1; +ALTER TABLE tt1_merge ENGINE=MERGE UNION (t2, t1); +CREATE TABLE t1_merge LIKE tt1_merge; --sync_slave_with_master diff --git a/mysql-test/suite/rpl/t/rpl_temp_table_mix_row.test b/mysql-test/suite/rpl/t/rpl_temp_table_mix_row.test index b221abf8a4a..fa611538aed 100644 --- a/mysql-test/suite/rpl/t/rpl_temp_table_mix_row.test +++ b/mysql-test/suite/rpl/t/rpl_temp_table_mix_row.test @@ -102,7 +102,8 @@ CREATE TEMPORARY TABLE t1_tmp (i1 int); ALTER TABLE t1_tmp ADD COLUMN b INT; # action: force switch to RBR -DELETE FROM t2; +INSERT INTO t1 values(1); +INSERT INTO t2 (i1) select * from t1; # assertion: assert that t2_tmp will not make into the binlog (RBR logging atm) CREATE TEMPORARY TABLE t2_tmp (a int); diff --git a/mysql-test/suite/rpl/t/rpl_temporary.test b/mysql-test/suite/rpl/t/rpl_temporary.test index 96ee31667b6..e3f5a0be573 100644 --- a/mysql-test/suite/rpl/t/rpl_temporary.test +++ b/mysql-test/suite/rpl/t/rpl_temporary.test @@ -354,6 +354,62 @@ connection slave; DROP USER user43748@127.0.0.1; +--echo # +--echo # MDEV-10216: Assertion `strcmp(share->unique_file_name,filename) || +--echo # share->last_version' failed in myisam/mi_open.c:67: test_if_reopen +--echo # + +connection master; +CREATE TEMPORARY TABLE t1(i INT PRIMARY KEY) ENGINE=MYISAM; +INSERT INTO t1 VALUES(1); +SELECT COUNT(*)=1 FROM t1; + +ALTER TABLE t1 RENAME t2; +SELECT COUNT(*)=1 FROM t2; +ALTER TABLE t2 RENAME t1; + +ALTER TABLE t1 DISABLE KEYS; +ALTER TABLE t1 ENABLE KEYS; + +# LOCK TABLES is ignored for temporary tables. +LOCK TABLES t1 WRITE; +ALTER TABLE t1 RENAME t2; +SELECT COUNT(*)=1 FROM t2; +ALTER TABLE t2 RENAME t1; +ALTER TABLE t1 DISABLE KEYS; +ALTER TABLE t1 ENABLE KEYS; +UNLOCK TABLES; + +LOCK TABLES t1 READ; +ALTER TABLE t1 RENAME t2; +SELECT COUNT(*)=1 FROM t2; +ALTER TABLE t2 RENAME t1; +ALTER TABLE t1 DISABLE KEYS; +ALTER TABLE t1 ENABLE KEYS; +UNLOCK TABLES; + +FLUSH TABLES WITH READ LOCK; +ALTER TABLE t1 RENAME t2; +SELECT COUNT(*)=1 FROM t2; +ALTER TABLE t2 RENAME t1; +ALTER TABLE t1 DISABLE KEYS; +ALTER TABLE t1 ENABLE KEYS; +UNLOCK TABLES; + +ALTER TABLE t1 RENAME t2, LOCK SHARED; +ALTER TABLE t2 RENAME t1, LOCK EXCLUSIVE; + +DROP TABLE t1; + +--echo # +--echo # MDEV-10320: NO-OP ALTER TABLE on temporary tables getting logged +--echo # under row binlog format +--echo # +connection master; +CREATE TEMPORARY TABLE t1(i INT PRIMARY KEY) ENGINE=MYISAM; +ALTER TABLE t1; +ALTER TABLE t1 ADD COLUMN IF NOT EXISTS I INT; +DROP TABLE t1; --echo End of 5.1 tests --let $rpl_only_running_threads= 1 diff --git a/mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL_innodb.test b/mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL_innodb.test new file mode 100644 index 00000000000..1a09b685249 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL_innodb.test @@ -0,0 +1,55 @@ +source include/have_innodb.inc; +source include/have_binlog_format_row.inc; +source include/master-slave.inc; +# +# BUG#20574550 +# CREATE TABLE LIKE does not preserve original table storage +# engine when using row based replication +# +--connection master + +# Define temp_t1 and temp_t2 storage engines +--let $engine_temp_t1= InnoDB +--let $engine_temp_t2= MyISAM + +# Create the two temporary tables +--eval CREATE TEMPORARY TABLE temp_t1 (c1 INT) ENGINE=$engine_temp_t1 +--eval CREATE TEMPORARY TABLE temp_t2 (c1 INT) ENGINE=$engine_temp_t2 + +# Create t1 and t2 based on temporary tables +CREATE TABLE t1 LIKE temp_t1; +CREATE TABLE t2 LIKE temp_t2; +--sync_slave_with_master + +# On master +--connection master +# Assert that t1 and t2 have the same storage engines as temp_t1 and temp_t2 +--let $engine_t1= query_get_value(SHOW TABLE STATUS WHERE Name='t1', Engine, 1) +--let $assert_cond= "$engine_t1" = "$engine_temp_t1" +--let $assert_text= "t1 on master and temp_t1 have the same storage engine" +--source include/assert.inc + +--let $engine_t2= query_get_value(SHOW TABLE STATUS WHERE Name='t2', Engine, 1) +--let $assert_cond= "$engine_t2" = "$engine_temp_t2" +--let $assert_text= "t2 on master and temp_t2 have the same storage engine" +--source include/assert.inc + +# On slave +--connection slave +# Assert that t1 and t2 have the same storage engines as temp_t1 and temp_t2 +--let $engine_t1= query_get_value(SHOW TABLE STATUS WHERE Name='t1', Engine, 1) +--let $assert_cond= "$engine_t1" = "$engine_temp_t1" +--let $assert_text= "t1 on slave and temp_t1 have the same storage engine" +--source include/assert.inc + +--let $engine_t2= query_get_value(SHOW TABLE STATUS WHERE Name='t2', Engine, 1) +--let $assert_cond= "$engine_t2" = "$engine_temp_t2" +--let $assert_text= "t2 on slave and temp_t2 have the same storage engine" +--source include/assert.inc + +# Cleanup +--connection master +DROP TEMPORARY TABLE temp_t1, temp_t2; +DROP TABLE t1, t2; +--source include/rpl_end.inc + diff --git a/mysql-test/suite/rpl/t/rpl_user_variables.test b/mysql-test/suite/rpl/t/rpl_user_variables.test index 3edd9b0a5bf..08d9b4aee16 100644 --- a/mysql-test/suite/rpl/t/rpl_user_variables.test +++ b/mysql-test/suite/rpl/t/rpl_user_variables.test @@ -38,7 +38,7 @@ insert into t1 values (@i1), (@i2), (@i3), (@i4); insert into t1 values (@r1), (@r2); insert into t1 values (@s1), (@s2), (@s3), (@s4), (@s5); insert into t1 values (@n1); -insert into t1 values (@n2); # not explicitely set before +insert into t1 values (@n2); # not explicitly set before insert into t1 values (@a:=0), (@a:=@a+1), (@a:=@a+1); insert into t1 values (@a+(@b:=@a+1)); set @q:='abc'; diff --git a/mysql-test/suite/rpl/t/show_status_stop_slave_race-7126.test b/mysql-test/suite/rpl/t/show_status_stop_slave_race-7126.test index 38759c9b16a..88d7076b1e4 100644 --- a/mysql-test/suite/rpl/t/show_status_stop_slave_race-7126.test +++ b/mysql-test/suite/rpl/t/show_status_stop_slave_race-7126.test @@ -3,8 +3,11 @@ # --source include/master-slave.inc +call mtr.add_suppression("Master is configured to log replication events"); + --connection slave + # If everything is okay, the test will end in several seconds; maybe a minute. # If the problem shows up, it will hang until testcase timeout is exceeded. --exec $MYSQL_SLAP --silent --socket=$SLAVE_MYSOCK -q "START SLAVE; STOP SLAVE; SHOW GLOBAL STATUS" -c 2 --number-of-queries=100 --create-schema=test @@ -16,4 +19,3 @@ start slave; --connection master --source include/rpl_end.inc - diff --git a/mysql-test/suite/sys_vars/inc/collation_basic.inc b/mysql-test/suite/sys_vars/inc/collation_basic.inc index be8ae36eeb8..14b9ae4af2a 100644 --- a/mysql-test/suite/sys_vars/inc/collation_basic.inc +++ b/mysql-test/suite/sys_vars/inc/collation_basic.inc @@ -152,6 +152,8 @@ eval SET $collation_variable = utf8_esperanto_ci; eval SELECT $collation_variable; eval SET $collation_variable = utf8_hungarian_ci; eval SELECT $collation_variable; +eval SET $collation_variable = utf8_thai_520_w2; +eval SELECT $collation_variable; eval SET $collation_variable = ucs2_general_ci; eval SELECT $collation_variable; eval SET $collation_variable = ucs2_bin; diff --git a/mysql-test/suite/sys_vars/r/collation_connection_basic.result b/mysql-test/suite/sys_vars/r/collation_connection_basic.result index c8ce41cfe88..5f8d64e8fa3 100644 --- a/mysql-test/suite/sys_vars/r/collation_connection_basic.result +++ b/mysql-test/suite/sys_vars/r/collation_connection_basic.result @@ -374,6 +374,10 @@ SET @@session.collation_connection = utf8_hungarian_ci; SELECT @@session.collation_connection; @@session.collation_connection utf8_hungarian_ci +SET @@session.collation_connection = utf8_thai_520_w2; +SELECT @@session.collation_connection; +@@session.collation_connection +utf8_thai_520_w2 SET @@session.collation_connection = ucs2_general_ci; SELECT @@session.collation_connection; @@session.collation_connection @@ -883,6 +887,10 @@ SET @@global.collation_connection = utf8_hungarian_ci; SELECT @@global.collation_connection; @@global.collation_connection utf8_hungarian_ci +SET @@global.collation_connection = utf8_thai_520_w2; +SELECT @@global.collation_connection; +@@global.collation_connection +utf8_thai_520_w2 SET @@global.collation_connection = ucs2_general_ci; SELECT @@global.collation_connection; @@global.collation_connection diff --git a/mysql-test/suite/sys_vars/r/collation_database_basic.result b/mysql-test/suite/sys_vars/r/collation_database_basic.result index efe9638c5f6..5a218167bdb 100644 --- a/mysql-test/suite/sys_vars/r/collation_database_basic.result +++ b/mysql-test/suite/sys_vars/r/collation_database_basic.result @@ -376,6 +376,10 @@ SET @@session.collation_database = utf8_hungarian_ci; SELECT @@session.collation_database; @@session.collation_database utf8_hungarian_ci +SET @@session.collation_database = utf8_thai_520_w2; +SELECT @@session.collation_database; +@@session.collation_database +utf8_thai_520_w2 SET @@session.collation_database = ucs2_general_ci; SELECT @@session.collation_database; @@session.collation_database @@ -885,6 +889,10 @@ SET @@global.collation_database = utf8_hungarian_ci; SELECT @@global.collation_database; @@global.collation_database utf8_hungarian_ci +SET @@global.collation_database = utf8_thai_520_w2; +SELECT @@global.collation_database; +@@global.collation_database +utf8_thai_520_w2 SET @@global.collation_database = ucs2_general_ci; SELECT @@global.collation_database; @@global.collation_database diff --git a/mysql-test/suite/sys_vars/r/collation_server_basic.result b/mysql-test/suite/sys_vars/r/collation_server_basic.result index e60f3a3041a..352aeb9ce15 100644 --- a/mysql-test/suite/sys_vars/r/collation_server_basic.result +++ b/mysql-test/suite/sys_vars/r/collation_server_basic.result @@ -373,6 +373,10 @@ SET @@session.collation_server = utf8_hungarian_ci; SELECT @@session.collation_server; @@session.collation_server utf8_hungarian_ci +SET @@session.collation_server = utf8_thai_520_w2; +SELECT @@session.collation_server; +@@session.collation_server +utf8_thai_520_w2 SET @@session.collation_server = ucs2_general_ci; SELECT @@session.collation_server; @@session.collation_server @@ -882,6 +886,10 @@ SET @@global.collation_server = utf8_hungarian_ci; SELECT @@global.collation_server; @@global.collation_server utf8_hungarian_ci +SET @@global.collation_server = utf8_thai_520_w2; +SELECT @@global.collation_server; +@@global.collation_server +utf8_thai_520_w2 SET @@global.collation_server = ucs2_general_ci; SELECT @@global.collation_server; @@global.collation_server diff --git a/mysql-test/suite/sys_vars/r/div_precision_increment_basic.result b/mysql-test/suite/sys_vars/r/div_precision_increment_basic.result index 21c00c65eab..570824f8df6 100644 --- a/mysql-test/suite/sys_vars/r/div_precision_increment_basic.result +++ b/mysql-test/suite/sys_vars/r/div_precision_increment_basic.result @@ -65,18 +65,18 @@ SELECT @@session.div_precision_increment; @@session.div_precision_increment 30 '#------------------FN_DYNVARS_027_05-----------------------#' -SET @@global.div_precision_increment = 31; +SET @@global.div_precision_increment = 39; Warnings: -Warning 1292 Truncated incorrect div_precision_increment value: '31' +Warning 1292 Truncated incorrect div_precision_increment value: '39' SELECT @@global.div_precision_increment; @@global.div_precision_increment -30 -SET @@global.div_precision_increment = 40; +38 +SET @@global.div_precision_increment = 50; Warnings: -Warning 1292 Truncated incorrect div_precision_increment value: '40' +Warning 1292 Truncated incorrect div_precision_increment value: '50' SELECT @@global.div_precision_increment; @@global.div_precision_increment -30 +38 SET @@global.div_precision_increment = -1024; Warnings: Warning 1292 Truncated incorrect div_precision_increment value: '-1024' @@ -88,19 +88,17 @@ Warnings: Warning 1292 Truncated incorrect div_precision_increment value: '65536' SELECT @@global.div_precision_increment; @@global.div_precision_increment -30 -SET @@session.div_precision_increment = 40; +38 +SET @@session.div_precision_increment = 50; Warnings: -Warning 1292 Truncated incorrect div_precision_increment value: '40' +Warning 1292 Truncated incorrect div_precision_increment value: '50' SELECT @@session.div_precision_increment; @@session.div_precision_increment -30 -SET @@session.div_precision_increment = 31; -Warnings: -Warning 1292 Truncated incorrect div_precision_increment value: '31' +38 +SET @@session.div_precision_increment = 37; SELECT @@session.div_precision_increment; @@session.div_precision_increment -30 +37 SET @@session.div_precision_increment = -2; Warnings: Warning 1292 Truncated incorrect div_precision_increment value: '-2' @@ -112,27 +110,27 @@ Warnings: Warning 1292 Truncated incorrect div_precision_increment value: '65550' SELECT @@session.div_precision_increment; @@session.div_precision_increment -30 +38 SET @@global.div_precision_increment = 65530.30; ERROR 42000: Incorrect argument type to variable 'div_precision_increment' SELECT @@global.div_precision_increment; @@global.div_precision_increment -30 +38 SET @@global.div_precision_increment = OFF; ERROR 42000: Incorrect argument type to variable 'div_precision_increment' SELECT @@global.div_precision_increment; @@global.div_precision_increment -30 +38 SET @@session.div_precision_increment = ON; ERROR 42000: Incorrect argument type to variable 'div_precision_increment' SELECT @@session.div_precision_increment; @@session.div_precision_increment -30 +38 SET @@session.div_precision_increment = 65530.30; ERROR 42000: Incorrect argument type to variable 'div_precision_increment' SELECT @@session.div_precision_increment; @@session.div_precision_increment -30 +38 '#------------------FN_DYNVARS_027_06-----------------------#' SELECT @@global.div_precision_increment = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES diff --git a/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result b/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result index 3160fd7c4fb..97fe3957264 100644 --- a/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result +++ b/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result @@ -1,63 +1,63 @@ SET @start_global_value = @@global.optimizer_switch; SELECT @start_global_value; @start_global_value -index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on +index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=off select @@global.optimizer_switch; @@global.optimizer_switch -index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on +index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=off select @@session.optimizer_switch; @@session.optimizer_switch -index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on +index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=off show global variables like 'optimizer_switch'; Variable_name Value -optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on +optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=off show session variables like 'optimizer_switch'; Variable_name Value -optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on +optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=off select * from information_schema.global_variables where variable_name='optimizer_switch'; VARIABLE_NAME VARIABLE_VALUE -OPTIMIZER_SWITCH index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on +OPTIMIZER_SWITCH index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=off select * from information_schema.session_variables where variable_name='optimizer_switch'; VARIABLE_NAME VARIABLE_VALUE -OPTIMIZER_SWITCH index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on +OPTIMIZER_SWITCH index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=off set global optimizer_switch=10; set session optimizer_switch=5; select @@global.optimizer_switch; @@global.optimizer_switch -index_merge=off,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off +index_merge=off,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off select @@session.optimizer_switch; @@session.optimizer_switch -index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off +index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off set global optimizer_switch="index_merge_sort_union=on"; set session optimizer_switch="index_merge=off"; select @@global.optimizer_switch; @@global.optimizer_switch -index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off +index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off select @@session.optimizer_switch; @@session.optimizer_switch -index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off +index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off show global variables like 'optimizer_switch'; Variable_name Value -optimizer_switch index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off +optimizer_switch index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off show session variables like 'optimizer_switch'; Variable_name Value -optimizer_switch index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off +optimizer_switch index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off select * from information_schema.global_variables where variable_name='optimizer_switch'; VARIABLE_NAME VARIABLE_VALUE -OPTIMIZER_SWITCH index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off +OPTIMIZER_SWITCH index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off select * from information_schema.session_variables where variable_name='optimizer_switch'; VARIABLE_NAME VARIABLE_VALUE -OPTIMIZER_SWITCH index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off +OPTIMIZER_SWITCH index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off set session optimizer_switch="default"; select @@session.optimizer_switch; @@session.optimizer_switch -index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off +index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off set optimizer_switch = replace(@@optimizer_switch, '=off', '=on'); Warnings: Warning 1681 'engine_condition_pushdown=on' is deprecated and will be removed in a future release. select @@optimizer_switch; @@optimizer_switch -index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=on,mrr_cost_based=on,mrr_sort_keys=on,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on +index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=on,mrr_cost_based=on,mrr_sort_keys=on,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on set global optimizer_switch=1.1; ERROR 42000: Incorrect argument type to variable 'optimizer_switch' set global optimizer_switch=1e1; @@ -69,4 +69,4 @@ ERROR 42000: Variable 'optimizer_switch' can't be set to the value of 'foobar' SET @@global.optimizer_switch = @start_global_value; SELECT @@global.optimizer_switch; @@global.optimizer_switch -index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on +index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=off diff --git a/mysql-test/suite/sys_vars/r/server_id_basic.result b/mysql-test/suite/sys_vars/r/server_id_basic.result index 4d82d8f102a..a2b117c1332 100644 --- a/mysql-test/suite/sys_vars/r/server_id_basic.result +++ b/mysql-test/suite/sys_vars/r/server_id_basic.result @@ -8,17 +8,19 @@ SET @@global.server_id = 500000; SET @@global.server_id = DEFAULT; SELECT @@global.server_id; @@global.server_id -0 +1 '#--------------------FN_DYNVARS_144_02-------------------------#' SET @@global.server_id = DEFAULT; -SELECT @@global.server_id = 0; -@@global.server_id = 0 +SELECT @@global.server_id = 1; +@@global.server_id = 1 1 '#--------------------FN_DYNVARS_144_03-------------------------#' SET @@global.server_id = 0; +Warnings: +Warning 1292 Truncated incorrect server_id value: '0' SELECT @@global.server_id; @@global.server_id -0 +1 SET @@global.server_id = 1; SELECT @@global.server_id; @@global.server_id @@ -62,13 +64,13 @@ Warnings: Warning 1292 Truncated incorrect server_id value: '-1' SELECT @@global.server_id; @@global.server_id -0 +1 SET @@global.server_id = -2147483648; Warnings: Warning 1292 Truncated incorrect server_id value: '-2147483648' SELECT @@global.server_id; @@global.server_id -0 +1 SET @@global.server_id = 2147483649*2; Warnings: Warning 1292 Truncated incorrect server_id value: '4294967298' @@ -102,9 +104,11 @@ SELECT @@global.server_id; @@global.server_id 1 SET @@global.server_id = FALSE; +Warnings: +Warning 1292 Truncated incorrect server_id value: '0' SELECT @@global.server_id; @@global.server_id -0 +1 '#---------------------FN_DYNVARS_001_09----------------------#' SET @@global.server_id = 512; SELECT @@server_id = @@global.server_id; diff --git a/mysql-test/suite/sys_vars/r/sysvars_debug,32bit.rdiff b/mysql-test/suite/sys_vars/r/sysvars_debug,32bit.rdiff index 799ad90a474..3164d094528 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_debug,32bit.rdiff +++ b/mysql-test/suite/sys_vars/r/sysvars_debug,32bit.rdiff @@ -9,16 +9,3 @@ VARIABLE_COMMENT Extra sleep (in microseconds) to add to binlog fsync(), for debugging NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -35,10 +35,10 @@ - GLOBAL_VALUE_ORIGIN COMPILE-TIME - DEFAULT_VALUE 0 - VARIABLE_SCOPE GLOBAL --VARIABLE_TYPE BIGINT UNSIGNED -+VARIABLE_TYPE INT UNSIGNED - VARIABLE_COMMENT Call my_debug_put_break_here() if crc matches this number (for debug) - NUMERIC_MIN_VALUE 0 --NUMERIC_MAX_VALUE 18446744073709551615 -+NUMERIC_MAX_VALUE 4294967295 - NUMERIC_BLOCK_SIZE 1 - ENUM_VALUE_LIST NULL - READ_ONLY NO diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit,xtradb.rdiff b/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit,xtradb.rdiff index cad46e36f42..4d507126872 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit,xtradb.rdiff +++ b/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit,xtradb.rdiff @@ -1,5 +1,5 @@ ---- suite/sys_vars/r/sysvars_innodb.result -+++ suite/sys_vars/r/sysvars_innodb,32bit,xtradb.reject +--- suite/sys_vars/r/sysvars_innodb.result 2016-05-06 14:03:16.000000000 +0300 ++++ suite/sys_vars/r/sysvars_innodb,32bit.reject 2016-05-08 13:28:44.312418574 +0300 @@ -47,13 +47,27 @@ ENUM_VALUE_LIST NULL READ_ONLY NO @@ -313,7 +313,7 @@ COMMAND_LINE_ARGUMENT OPTIONAL +VARIABLE_NAME INNODB_EMPTY_FREE_LIST_ALGORITHM +SESSION_VALUE NULL -+GLOBAL_VALUE BACKOFF ++GLOBAL_VALUE LEGACY +GLOBAL_VALUE_ORIGIN COMPILE-TIME +DEFAULT_VALUE BACKOFF +VARIABLE_SCOPE GLOBAL @@ -1119,21 +1119,14 @@ VARIABLE_COMMENT Time of innodb thread sleeping before joining InnoDB queue (usec). Value 0 disable a sleep NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 1000000 -@@ -2203,14 +2637,28 @@ +@@ -2217,6 +2651,34 @@ ENUM_VALUE_LIST NULL READ_ONLY NO - COMMAND_LINE_ARGUMENT REQUIRED --VARIABLE_NAME INNODB_TMPDIR --SESSION_VALUE --GLOBAL_VALUE + COMMAND_LINE_ARGUMENT OPTIONAL +VARIABLE_NAME INNODB_TRACK_CHANGED_PAGES +SESSION_VALUE NULL +GLOBAL_VALUE OFF - GLOBAL_VALUE_ORIGIN COMPILE-TIME --DEFAULT_VALUE --VARIABLE_SCOPE SESSION --VARIABLE_TYPE VARCHAR --VARIABLE_COMMENT Directory for temporary non-tablespace files. ++GLOBAL_VALUE_ORIGIN COMPILE-TIME +DEFAULT_VALUE OFF +VARIABLE_SCOPE GLOBAL +VARIABLE_TYPE BOOLEAN @@ -1152,10 +1145,16 @@ +VARIABLE_SCOPE GLOBAL +VARIABLE_TYPE BOOLEAN +VARIABLE_COMMENT Force log tracker to catch up with checkpoint now - NUMERIC_MIN_VALUE NULL - NUMERIC_MAX_VALUE NULL - NUMERIC_BLOCK_SIZE NULL -@@ -2265,7 +2713,7 @@ ++NUMERIC_MIN_VALUE NULL ++NUMERIC_MAX_VALUE NULL ++NUMERIC_BLOCK_SIZE NULL ++ENUM_VALUE_LIST NULL ++READ_ONLY NO ++COMMAND_LINE_ARGUMENT OPTIONAL + VARIABLE_NAME INNODB_TRX_PURGE_VIEW_UPDATE_ONLY_DEBUG + SESSION_VALUE NULL + GLOBAL_VALUE OFF +@@ -2265,7 +2727,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 128 VARIABLE_SCOPE GLOBAL @@ -1164,7 +1163,7 @@ VARIABLE_COMMENT Number of undo logs to use. NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 128 -@@ -2279,7 +2727,7 @@ +@@ -2279,7 +2741,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 0 VARIABLE_SCOPE GLOBAL @@ -1173,7 +1172,7 @@ VARIABLE_COMMENT Number of undo tablespaces to use. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 126 -@@ -2294,7 +2742,7 @@ +@@ -2294,7 +2756,7 @@ DEFAULT_VALUE OFF VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BOOLEAN @@ -1182,7 +1181,7 @@ NUMERIC_MIN_VALUE NULL NUMERIC_MAX_VALUE NULL NUMERIC_BLOCK_SIZE NULL -@@ -2315,6 +2763,20 @@ +@@ -2315,6 +2777,20 @@ ENUM_VALUE_LIST NULL READ_ONLY YES COMMAND_LINE_ARGUMENT NONE @@ -1203,7 +1202,7 @@ VARIABLE_NAME INNODB_USE_MTFLUSH SESSION_VALUE NULL GLOBAL_VALUE OFF -@@ -2329,6 +2791,20 @@ +@@ -2329,6 +2805,20 @@ ENUM_VALUE_LIST NULL READ_ONLY YES COMMAND_LINE_ARGUMENT NONE @@ -1224,12 +1223,12 @@ VARIABLE_NAME INNODB_USE_SYS_MALLOC SESSION_VALUE NULL GLOBAL_VALUE ON -@@ -2359,12 +2835,12 @@ +@@ -2359,12 +2849,12 @@ COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME INNODB_VERSION SESSION_VALUE NULL --GLOBAL_VALUE 5.6.29 -+GLOBAL_VALUE 5.6.28-76.1 +-GLOBAL_VALUE 5.6.31 ++GLOBAL_VALUE 5.6.30-76.3 GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE NULL VARIABLE_SCOPE GLOBAL @@ -1239,7 +1238,7 @@ NUMERIC_MIN_VALUE NULL NUMERIC_MAX_VALUE NULL NUMERIC_BLOCK_SIZE NULL -@@ -2377,7 +2853,7 @@ +@@ -2377,7 +2867,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE 4 VARIABLE_SCOPE GLOBAL diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit.rdiff b/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit.rdiff index e1db778832f..ccdaa3ec644 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit.rdiff +++ b/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit.rdiff @@ -1,5 +1,5 @@ --- suite/sys_vars/r/sysvars_innodb.result -+++ suite/sys_vars/r/sysvars_innodb,32bit.reject ++++ suite/sys_vars/r/sysvars_innodb.result @@ -53,7 +53,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 150000 @@ -551,7 +551,7 @@ VARIABLE_COMMENT Time of innodb thread sleeping before joining InnoDB queue (usec). Value 0 disable a sleep NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 1000000 -@@ -2251,7 +2251,7 @@ +@@ -2265,7 +2265,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 128 VARIABLE_SCOPE GLOBAL @@ -560,7 +560,7 @@ VARIABLE_COMMENT Number of undo logs to use. NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 128 -@@ -2265,7 +2265,7 @@ +@@ -2279,7 +2279,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 0 VARIABLE_SCOPE GLOBAL @@ -569,7 +569,7 @@ VARIABLE_COMMENT Number of undo tablespaces to use. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 126 -@@ -2363,7 +2363,7 @@ +@@ -2377,7 +2377,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE 4 VARIABLE_SCOPE GLOBAL diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb,xtradb.rdiff b/mysql-test/suite/sys_vars/r/sysvars_innodb,xtradb.rdiff index a9e975313db..6d95a517b33 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_innodb,xtradb.rdiff +++ b/mysql-test/suite/sys_vars/r/sysvars_innodb,xtradb.rdiff @@ -183,7 +183,7 @@ COMMAND_LINE_ARGUMENT OPTIONAL +VARIABLE_NAME INNODB_EMPTY_FREE_LIST_ALGORITHM +SESSION_VALUE NULL -+GLOBAL_VALUE BACKOFF ++GLOBAL_VALUE LEGACY +GLOBAL_VALUE_ORIGIN COMPILE-TIME +DEFAULT_VALUE BACKOFF +VARIABLE_SCOPE GLOBAL @@ -571,21 +571,14 @@ NUMERIC_MIN_VALUE NULL NUMERIC_MAX_VALUE NULL NUMERIC_BLOCK_SIZE NULL -@@ -2203,14 +2637,28 @@ +@@ -2217,6 +2651,34 @@ ENUM_VALUE_LIST NULL READ_ONLY NO - COMMAND_LINE_ARGUMENT REQUIRED --VARIABLE_NAME INNODB_TMPDIR --SESSION_VALUE --GLOBAL_VALUE + COMMAND_LINE_ARGUMENT OPTIONAL +VARIABLE_NAME INNODB_TRACK_CHANGED_PAGES +SESSION_VALUE NULL +GLOBAL_VALUE OFF - GLOBAL_VALUE_ORIGIN COMPILE-TIME --DEFAULT_VALUE --VARIABLE_SCOPE SESSION --VARIABLE_TYPE VARCHAR --VARIABLE_COMMENT Directory for temporary non-tablespace files. ++GLOBAL_VALUE_ORIGIN COMPILE-TIME +DEFAULT_VALUE OFF +VARIABLE_SCOPE GLOBAL +VARIABLE_TYPE BOOLEAN @@ -604,10 +597,16 @@ +VARIABLE_SCOPE GLOBAL +VARIABLE_TYPE BOOLEAN +VARIABLE_COMMENT Force log tracker to catch up with checkpoint now - NUMERIC_MIN_VALUE NULL - NUMERIC_MAX_VALUE NULL - NUMERIC_BLOCK_SIZE NULL -@@ -2294,7 +2742,7 @@ ++NUMERIC_MIN_VALUE NULL ++NUMERIC_MAX_VALUE NULL ++NUMERIC_BLOCK_SIZE NULL ++ENUM_VALUE_LIST NULL ++READ_ONLY NO ++COMMAND_LINE_ARGUMENT OPTIONAL + VARIABLE_NAME INNODB_TRX_PURGE_VIEW_UPDATE_ONLY_DEBUG + SESSION_VALUE NULL + GLOBAL_VALUE OFF +@@ -2294,7 +2756,7 @@ DEFAULT_VALUE OFF VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BOOLEAN @@ -616,7 +615,7 @@ NUMERIC_MIN_VALUE NULL NUMERIC_MAX_VALUE NULL NUMERIC_BLOCK_SIZE NULL -@@ -2315,6 +2763,20 @@ +@@ -2315,6 +2777,20 @@ ENUM_VALUE_LIST NULL READ_ONLY YES COMMAND_LINE_ARGUMENT NONE @@ -637,7 +636,7 @@ VARIABLE_NAME INNODB_USE_MTFLUSH SESSION_VALUE NULL GLOBAL_VALUE OFF -@@ -2329,6 +2791,20 @@ +@@ -2329,6 +2805,20 @@ ENUM_VALUE_LIST NULL READ_ONLY YES COMMAND_LINE_ARGUMENT NONE @@ -658,12 +657,12 @@ VARIABLE_NAME INNODB_USE_SYS_MALLOC SESSION_VALUE NULL GLOBAL_VALUE ON -@@ -2359,12 +2835,12 @@ +@@ -2359,12 +2849,12 @@ COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME INNODB_VERSION SESSION_VALUE NULL --GLOBAL_VALUE 5.6.29 -+GLOBAL_VALUE 5.6.28-76.1 +-GLOBAL_VALUE 5.6.31 ++GLOBAL_VALUE 5.6.30-76.3 GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE NULL VARIABLE_SCOPE GLOBAL diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb.result b/mysql-test/suite/sys_vars/r/sysvars_innodb.result index 0ddc401e618..9f92ea99437 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_innodb.result +++ b/mysql-test/suite/sys_vars/r/sysvars_innodb.result @@ -2359,7 +2359,7 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME INNODB_VERSION SESSION_VALUE NULL -GLOBAL_VALUE 5.6.29 +GLOBAL_VALUE 5.6.31 GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE NULL VARIABLE_SCOPE GLOBAL diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_embedded,32bit.rdiff b/mysql-test/suite/sys_vars/r/sysvars_server_embedded,32bit.rdiff index fe022426a91..37f38ceb7be 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_server_embedded,32bit.rdiff +++ b/mysql-test/suite/sys_vars/r/sysvars_server_embedded,32bit.rdiff @@ -80,7 +80,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -463,7 +463,7 @@ +@@ -477,7 +477,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE 10 VARIABLE_SCOPE GLOBAL @@ -89,7 +89,7 @@ VARIABLE_COMMENT The number of seconds the mysqld server is waiting for a connect packet before responding with 'Bad handshake' NUMERIC_MIN_VALUE 2 NUMERIC_MAX_VALUE 31536000 -@@ -519,7 +519,7 @@ +@@ -533,7 +533,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 15 VARIABLE_SCOPE SESSION @@ -98,7 +98,7 @@ VARIABLE_COMMENT Long search depth for the two-step deadlock detection NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 33 -@@ -533,7 +533,7 @@ +@@ -547,7 +547,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 4 VARIABLE_SCOPE SESSION @@ -107,7 +107,7 @@ VARIABLE_COMMENT Short search depth for the two-step deadlock detection NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 32 -@@ -547,7 +547,7 @@ +@@ -561,7 +561,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 50000000 VARIABLE_SCOPE SESSION @@ -116,7 +116,7 @@ VARIABLE_COMMENT Long timeout for the two-step deadlock detection (in microseconds) NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -561,7 +561,7 @@ +@@ -575,7 +575,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 10000 VARIABLE_SCOPE SESSION @@ -125,7 +125,7 @@ VARIABLE_COMMENT Short timeout for the two-step deadlock detection (in microseconds) NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -617,7 +617,7 @@ +@@ -631,7 +631,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 0 VARIABLE_SCOPE SESSION @@ -134,7 +134,7 @@ VARIABLE_COMMENT The default week format used by WEEK() functions NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 7 -@@ -631,7 +631,7 @@ +@@ -645,7 +645,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 100 VARIABLE_SCOPE GLOBAL @@ -143,7 +143,7 @@ VARIABLE_COMMENT After inserting delayed_insert_limit rows, the INSERT DELAYED handler will check if there are any SELECT statements pending. If so, it allows these to execute before continuing NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 4294967295 -@@ -645,7 +645,7 @@ +@@ -659,7 +659,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 300 VARIABLE_SCOPE GLOBAL @@ -152,7 +152,7 @@ VARIABLE_COMMENT How long a INSERT DELAYED thread should wait for INSERT statements before terminating NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 31536000 -@@ -659,7 +659,7 @@ +@@ -673,7 +673,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1000 VARIABLE_SCOPE GLOBAL @@ -161,7 +161,7 @@ VARIABLE_COMMENT What size queue (in rows) should be allocated for handling INSERT DELAYED. If the queue becomes full, any client that does INSERT DELAYED will wait until there is room in the queue again NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 4294967295 -@@ -687,7 +687,7 @@ +@@ -701,7 +701,7 @@ GLOBAL_VALUE_ORIGIN SQL DEFAULT_VALUE 4 VARIABLE_SCOPE SESSION @@ -169,8 +169,8 @@ +VARIABLE_TYPE INT UNSIGNED VARIABLE_COMMENT Precision of the result of '/' operator will be increased on that value NUMERIC_MIN_VALUE 0 - NUMERIC_MAX_VALUE 30 -@@ -785,7 +785,7 @@ + NUMERIC_MAX_VALUE 38 +@@ -799,7 +799,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 0 VARIABLE_SCOPE GLOBAL @@ -179,7 +179,7 @@ VARIABLE_COMMENT If non-zero, binary logs will be purged after expire_logs_days days; possible purges happen at startup and at binary log rotation NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 99 -@@ -827,7 +827,7 @@ +@@ -841,7 +841,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1 VARIABLE_SCOPE GLOBAL @@ -188,7 +188,7 @@ VARIABLE_COMMENT The number of connections on extra-port NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 100000 -@@ -869,7 +869,7 @@ +@@ -883,7 +883,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 0 VARIABLE_SCOPE GLOBAL @@ -197,7 +197,7 @@ VARIABLE_COMMENT A dedicated thread is created to flush all tables at the given interval NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 31536000 -@@ -911,7 +911,7 @@ +@@ -925,7 +925,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 84 VARIABLE_SCOPE GLOBAL @@ -206,7 +206,7 @@ VARIABLE_COMMENT The maximum length of the word to be included in a FULLTEXT index. Note: FULLTEXT indexes must be rebuilt after changing this variable NUMERIC_MIN_VALUE 10 NUMERIC_MAX_VALUE 84 -@@ -925,7 +925,7 @@ +@@ -939,7 +939,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 4 VARIABLE_SCOPE GLOBAL @@ -215,7 +215,7 @@ VARIABLE_COMMENT The minimum length of the word to be included in a FULLTEXT index. Note: FULLTEXT indexes must be rebuilt after changing this variable NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 84 -@@ -939,7 +939,7 @@ +@@ -953,7 +953,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 20 VARIABLE_SCOPE GLOBAL @@ -224,7 +224,7 @@ VARIABLE_COMMENT Number of best matches to use for query expansion NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 1000 -@@ -998,7 +998,7 @@ +@@ -1012,7 +1012,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The maximum length of the result of function GROUP_CONCAT() NUMERIC_MIN_VALUE 4 @@ -233,7 +233,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -1149,7 +1149,7 @@ +@@ -1163,7 +1163,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 0 VARIABLE_SCOPE SESSION @@ -242,7 +242,7 @@ VARIABLE_COMMENT Number of bytes used for a histogram. If set to 0, no histograms are created by ANALYZE. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 255 -@@ -1177,7 +1177,7 @@ +@@ -1191,7 +1191,7 @@ GLOBAL_VALUE_ORIGIN AUTO DEFAULT_VALUE 128 VARIABLE_SCOPE GLOBAL @@ -251,7 +251,7 @@ VARIABLE_COMMENT How many host names should be cached to avoid resolving. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 65536 -@@ -1289,7 +1289,7 @@ +@@ -1303,7 +1303,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 28800 VARIABLE_SCOPE SESSION @@ -260,7 +260,7 @@ VARIABLE_COMMENT The number of seconds the server waits for activity on an interactive connection before closing it NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 31536000 -@@ -1320,7 +1320,7 @@ +@@ -1334,7 +1334,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The size of the buffer that is used for joins NUMERIC_MIN_VALUE 128 @@ -269,7 +269,7 @@ NUMERIC_BLOCK_SIZE 128 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -1345,7 +1345,7 @@ +@@ -1359,7 +1359,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 2 VARIABLE_SCOPE SESSION @@ -278,7 +278,7 @@ VARIABLE_COMMENT Controls what join operations can be executed with join buffers. Odd numbers are used for plain join buffers while even numbers are used for linked buffers NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 8 -@@ -1376,7 +1376,7 @@ +@@ -1390,7 +1390,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The size of the buffer used for index blocks for MyISAM tables. Increase this to get better index handling (for all reads and multiple writes) to as much as you can afford NUMERIC_MIN_VALUE 0 @@ -287,7 +287,7 @@ NUMERIC_BLOCK_SIZE 4096 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -1583,7 +1583,7 @@ +@@ -1597,7 +1597,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 31536000 VARIABLE_SCOPE SESSION @@ -296,7 +296,7 @@ VARIABLE_COMMENT Timeout in seconds to wait for a lock before returning an error. NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 31536000 -@@ -1695,7 +1695,7 @@ +@@ -1709,7 +1709,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1 VARIABLE_SCOPE SESSION @@ -305,7 +305,7 @@ VARIABLE_COMMENT Write to slow log every #th slow query. Set to 1 to log everything. Increase it to reduce the size of the slow or the performance impact of slow logging NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 4294967295 -@@ -1737,7 +1737,7 @@ +@@ -1751,7 +1751,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1 VARIABLE_SCOPE SESSION @@ -314,7 +314,7 @@ VARIABLE_COMMENT Log some not critical warnings to the general log file.Value can be between 0 and 11. Higher values mean more verbosity NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -1779,7 +1779,7 @@ +@@ -1793,7 +1793,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 4194304 VARIABLE_SCOPE SESSION @@ -323,7 +323,7 @@ VARIABLE_COMMENT Max packet length to send to or receive from the server NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 1073741824 -@@ -1789,14 +1789,14 @@ +@@ -1803,14 +1803,14 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME MAX_BINLOG_CACHE_SIZE SESSION_VALUE NULL @@ -341,7 +341,7 @@ NUMERIC_BLOCK_SIZE 4096 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -1807,7 +1807,7 @@ +@@ -1821,7 +1821,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1073741824 VARIABLE_SCOPE GLOBAL @@ -350,7 +350,7 @@ VARIABLE_COMMENT Binary log will be rotated automatically when the size exceeds this value. NUMERIC_MIN_VALUE 4096 NUMERIC_MAX_VALUE 1073741824 -@@ -1817,14 +1817,14 @@ +@@ -1831,14 +1831,14 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME MAX_BINLOG_STMT_CACHE_SIZE SESSION_VALUE NULL @@ -368,7 +368,7 @@ NUMERIC_BLOCK_SIZE 4096 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -1835,7 +1835,7 @@ +@@ -1849,7 +1849,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 151 VARIABLE_SCOPE GLOBAL @@ -377,7 +377,7 @@ VARIABLE_COMMENT The number of simultaneous clients allowed NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 100000 -@@ -1849,7 +1849,7 @@ +@@ -1863,7 +1863,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 100 VARIABLE_SCOPE GLOBAL @@ -386,7 +386,7 @@ VARIABLE_COMMENT If there is more than this number of interrupted connections from a host this host will be blocked from further connections NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 4294967295 -@@ -1863,7 +1863,7 @@ +@@ -1877,7 +1877,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 20 VARIABLE_SCOPE SESSION @@ -395,7 +395,7 @@ VARIABLE_COMMENT Don't start more than this number of threads to handle INSERT DELAYED statements. If set to zero INSERT DELAYED will be not used NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 16384 -@@ -1891,7 +1891,7 @@ +@@ -1905,7 +1905,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 64 VARIABLE_SCOPE SESSION @@ -404,7 +404,7 @@ VARIABLE_COMMENT Max number of errors/warnings to store for a statement NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 65535 -@@ -1908,7 +1908,7 @@ +@@ -1922,7 +1922,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Don't allow creation of heap tables bigger than this NUMERIC_MIN_VALUE 16384 @@ -413,7 +413,7 @@ NUMERIC_BLOCK_SIZE 1024 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -1919,7 +1919,7 @@ +@@ -1933,7 +1933,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 20 VARIABLE_SCOPE SESSION @@ -422,7 +422,7 @@ VARIABLE_COMMENT Don't start more than this number of threads to handle INSERT DELAYED statements. If set to zero INSERT DELAYED will be not used NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 16384 -@@ -1947,7 +1947,7 @@ +@@ -1961,7 +1961,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1024 VARIABLE_SCOPE SESSION @@ -431,7 +431,7 @@ VARIABLE_COMMENT Max number of bytes in sorted records NUMERIC_MIN_VALUE 4 NUMERIC_MAX_VALUE 8388608 -@@ -1961,7 +1961,7 @@ +@@ -1975,7 +1975,7 @@ GLOBAL_VALUE_ORIGIN AUTO DEFAULT_VALUE 1048576 VARIABLE_SCOPE GLOBAL @@ -440,7 +440,7 @@ VARIABLE_COMMENT The maximum BLOB length to send to server from mysql_send_long_data API. Deprecated option; use max_allowed_packet instead. NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 4294967295 -@@ -1975,7 +1975,7 @@ +@@ -1989,7 +1989,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 16382 VARIABLE_SCOPE GLOBAL @@ -449,7 +449,7 @@ VARIABLE_COMMENT Maximum number of prepared statements in the server NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 1048576 -@@ -1989,7 +1989,7 @@ +@@ -2003,7 +2003,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 4294967295 VARIABLE_SCOPE SESSION @@ -458,7 +458,7 @@ VARIABLE_COMMENT Limit assumed max number of seeks when looking up rows based on a key NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 4294967295 -@@ -2003,7 +2003,7 @@ +@@ -2017,7 +2017,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1024 VARIABLE_SCOPE SESSION @@ -467,7 +467,7 @@ VARIABLE_COMMENT The number of bytes to use when sorting BLOB or TEXT values (only the first max_sort_length bytes of each value are used; the rest are ignored) NUMERIC_MIN_VALUE 4 NUMERIC_MAX_VALUE 8388608 -@@ -2017,7 +2017,7 @@ +@@ -2031,7 +2031,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 0 VARIABLE_SCOPE SESSION @@ -476,7 +476,7 @@ VARIABLE_COMMENT Maximum stored procedure recursion depth NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 255 -@@ -2045,7 +2045,7 @@ +@@ -2059,7 +2059,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 32 VARIABLE_SCOPE SESSION @@ -485,7 +485,7 @@ VARIABLE_COMMENT Unused, will be removed. NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 4294967295 -@@ -2073,7 +2073,7 @@ +@@ -2087,7 +2087,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 4294967295 VARIABLE_SCOPE GLOBAL @@ -494,7 +494,7 @@ VARIABLE_COMMENT After this many write locks, allow some read locks to run in between NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 4294967295 -@@ -2087,7 +2087,7 @@ +@@ -2101,7 +2101,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1024 VARIABLE_SCOPE GLOBAL @@ -503,7 +503,7 @@ VARIABLE_COMMENT Unused NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 1048576 -@@ -2101,7 +2101,7 @@ +@@ -2115,7 +2115,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 8 VARIABLE_SCOPE GLOBAL @@ -512,7 +512,7 @@ VARIABLE_COMMENT Unused NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 1024 -@@ -2115,7 +2115,7 @@ +@@ -2129,7 +2129,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 0 VARIABLE_SCOPE SESSION @@ -521,7 +521,7 @@ VARIABLE_COMMENT Don't write queries to slow log that examine fewer rows than that NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -2129,7 +2129,7 @@ +@@ -2143,7 +2143,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 262144 VARIABLE_SCOPE SESSION @@ -530,7 +530,7 @@ VARIABLE_COMMENT Size of buffer to use when using MRR with range access NUMERIC_MIN_VALUE 8192 NUMERIC_MAX_VALUE 2147483647 -@@ -2143,10 +2143,10 @@ +@@ -2157,10 +2157,10 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 256 VARIABLE_SCOPE SESSION @@ -543,7 +543,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -2157,7 +2157,7 @@ +@@ -2171,7 +2171,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1024 VARIABLE_SCOPE GLOBAL @@ -552,7 +552,7 @@ VARIABLE_COMMENT Block size to be used for MyISAM index pages NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 16384 -@@ -2171,7 +2171,7 @@ +@@ -2185,7 +2185,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 6 VARIABLE_SCOPE GLOBAL @@ -561,7 +561,7 @@ VARIABLE_COMMENT Default pointer size to be used for MyISAM tables NUMERIC_MIN_VALUE 2 NUMERIC_MAX_VALUE 7 -@@ -2181,9 +2181,9 @@ +@@ -2195,9 +2195,9 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME MYISAM_MAX_SORT_FILE_SIZE SESSION_VALUE NULL @@ -573,7 +573,7 @@ VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Don't use the fast sort index method to created index if the temporary file would get bigger than this -@@ -2195,14 +2195,14 @@ +@@ -2209,14 +2209,14 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME MYISAM_MMAP_SIZE SESSION_VALUE NULL @@ -591,7 +591,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY YES -@@ -2227,10 +2227,10 @@ +@@ -2241,10 +2241,10 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1 VARIABLE_SCOPE SESSION @@ -604,7 +604,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -2244,7 +2244,7 @@ +@@ -2258,7 +2258,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The buffer that is allocated when sorting the index when doing a REPAIR or when creating indexes with CREATE INDEX or ALTER TABLE NUMERIC_MIN_VALUE 4096 @@ -613,7 +613,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -2297,7 +2297,7 @@ +@@ -2311,7 +2311,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 16384 VARIABLE_SCOPE SESSION @@ -622,7 +622,7 @@ VARIABLE_COMMENT Buffer length for TCP/IP and socket communication NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 1048576 -@@ -2311,7 +2311,7 @@ +@@ -2325,7 +2325,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 30 VARIABLE_SCOPE SESSION @@ -631,7 +631,7 @@ VARIABLE_COMMENT Number of seconds to wait for more data from a connection before aborting the read NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 31536000 -@@ -2325,7 +2325,7 @@ +@@ -2339,7 +2339,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 10 VARIABLE_SCOPE SESSION @@ -640,7 +640,7 @@ VARIABLE_COMMENT If a read on a communication port is interrupted, retry this many times before giving up NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 4294967295 -@@ -2339,7 +2339,7 @@ +@@ -2353,7 +2353,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 60 VARIABLE_SCOPE SESSION @@ -649,7 +649,7 @@ VARIABLE_COMMENT Number of seconds to wait for a block to be written to a connection before aborting the write NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 31536000 -@@ -2409,7 +2409,7 @@ +@@ -2423,7 +2423,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1 VARIABLE_SCOPE SESSION @@ -658,7 +658,7 @@ VARIABLE_COMMENT Controls the heuristic(s) applied during query optimization to prune less-promising partial plans from the optimizer search space. Meaning: 0 - do not apply any heuristic, thus perform exhaustive search; 1 - prune plans based on number of retrieved rows NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 1 -@@ -2423,7 +2423,7 @@ +@@ -2437,7 +2437,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 62 VARIABLE_SCOPE SESSION @@ -667,7 +667,7 @@ VARIABLE_COMMENT Maximum depth of search performed by the query optimizer. Values larger than the number of relations in a query result in better query plans, but take longer to compile a query. Values smaller than the number of tables in a relation result in faster optimization, but may produce very bad query plans. If set to 0, the system will automatically pick a reasonable value NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 62 -@@ -2437,7 +2437,7 @@ +@@ -2451,7 +2451,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 100 VARIABLE_SCOPE SESSION @@ -676,7 +676,7 @@ VARIABLE_COMMENT Controls number of record samples to check condition selectivity NUMERIC_MIN_VALUE 10 NUMERIC_MAX_VALUE 4294967295 -@@ -2465,7 +2465,7 @@ +@@ -2479,7 +2479,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1 VARIABLE_SCOPE SESSION @@ -685,7 +685,7 @@ VARIABLE_COMMENT Controls selectivity of which conditions the optimizer takes into account to calculate cardinality of a partial join when it searches for the best execution plan Meaning: 1 - use selectivity of index backed range conditions to calculate the cardinality of a partial join if the last joined table is accessed by full table scan or an index scan, 2 - use selectivity of index backed range conditions to calculate the cardinality of a partial join in any case, 3 - additionally always use selectivity of range conditions that are not backed by any index to calculate the cardinality of a partial join, 4 - use histograms to calculate selectivity of range conditions that are not backed by any index to calculate the cardinality of a partial join.5 - additionally use selectivity of certain non-range predicates calculated on record samples NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 5 -@@ -2493,7 +2493,7 @@ +@@ -2507,7 +2507,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -694,7 +694,7 @@ VARIABLE_COMMENT Maximum number of instrumented user@host accounts. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2507,7 +2507,7 @@ +@@ -2521,7 +2521,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -703,7 +703,7 @@ VARIABLE_COMMENT Size of the statement digest. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 200 -@@ -2521,7 +2521,7 @@ +@@ -2535,7 +2535,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -712,7 +712,7 @@ VARIABLE_COMMENT Number of rows in EVENTS_STAGES_HISTORY_LONG. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2535,7 +2535,7 @@ +@@ -2549,7 +2549,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -721,7 +721,7 @@ VARIABLE_COMMENT Number of rows per thread in EVENTS_STAGES_HISTORY. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1024 -@@ -2549,7 +2549,7 @@ +@@ -2563,7 +2563,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -730,7 +730,7 @@ VARIABLE_COMMENT Number of rows in EVENTS_STATEMENTS_HISTORY_LONG. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2563,7 +2563,7 @@ +@@ -2577,7 +2577,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -739,7 +739,7 @@ VARIABLE_COMMENT Number of rows per thread in EVENTS_STATEMENTS_HISTORY. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1024 -@@ -2577,7 +2577,7 @@ +@@ -2591,7 +2591,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -748,7 +748,7 @@ VARIABLE_COMMENT Number of rows in EVENTS_WAITS_HISTORY_LONG. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2591,7 +2591,7 @@ +@@ -2605,7 +2605,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -757,7 +757,7 @@ VARIABLE_COMMENT Number of rows per thread in EVENTS_WAITS_HISTORY. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1024 -@@ -2605,7 +2605,7 @@ +@@ -2619,7 +2619,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -766,7 +766,7 @@ VARIABLE_COMMENT Maximum number of instrumented hosts. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2619,7 +2619,7 @@ +@@ -2633,7 +2633,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 80 VARIABLE_SCOPE GLOBAL @@ -775,7 +775,7 @@ VARIABLE_COMMENT Maximum number of condition instruments. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 256 -@@ -2633,7 +2633,7 @@ +@@ -2647,7 +2647,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -784,7 +784,7 @@ VARIABLE_COMMENT Maximum number of instrumented condition objects. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2647,7 +2647,7 @@ +@@ -2661,7 +2661,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1024 VARIABLE_SCOPE GLOBAL @@ -793,7 +793,7 @@ VARIABLE_COMMENT Maximum length considered for digest text, when stored in performance_schema tables. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 1048576 -@@ -2661,7 +2661,7 @@ +@@ -2675,7 +2675,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 50 VARIABLE_SCOPE GLOBAL @@ -802,7 +802,7 @@ VARIABLE_COMMENT Maximum number of file instruments. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 256 -@@ -2675,7 +2675,7 @@ +@@ -2689,7 +2689,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 32768 VARIABLE_SCOPE GLOBAL @@ -811,7 +811,7 @@ VARIABLE_COMMENT Maximum number of opened instrumented files. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 1048576 -@@ -2689,7 +2689,7 @@ +@@ -2703,7 +2703,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -820,7 +820,7 @@ VARIABLE_COMMENT Maximum number of instrumented files. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2703,7 +2703,7 @@ +@@ -2717,7 +2717,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 200 VARIABLE_SCOPE GLOBAL @@ -829,7 +829,7 @@ VARIABLE_COMMENT Maximum number of mutex instruments. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 256 -@@ -2717,7 +2717,7 @@ +@@ -2731,7 +2731,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -838,7 +838,7 @@ VARIABLE_COMMENT Maximum number of instrumented MUTEX objects. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 104857600 -@@ -2731,7 +2731,7 @@ +@@ -2745,7 +2745,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 40 VARIABLE_SCOPE GLOBAL @@ -847,7 +847,7 @@ VARIABLE_COMMENT Maximum number of rwlock instruments. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 256 -@@ -2745,7 +2745,7 @@ +@@ -2759,7 +2759,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -856,7 +856,7 @@ VARIABLE_COMMENT Maximum number of instrumented RWLOCK objects. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 104857600 -@@ -2759,7 +2759,7 @@ +@@ -2773,7 +2773,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 10 VARIABLE_SCOPE GLOBAL @@ -865,7 +865,7 @@ VARIABLE_COMMENT Maximum number of socket instruments. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 256 -@@ -2773,7 +2773,7 @@ +@@ -2787,7 +2787,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -874,7 +874,7 @@ VARIABLE_COMMENT Maximum number of opened instrumented sockets. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2787,7 +2787,7 @@ +@@ -2801,7 +2801,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 150 VARIABLE_SCOPE GLOBAL @@ -883,7 +883,7 @@ VARIABLE_COMMENT Maximum number of stage instruments. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 256 -@@ -2801,7 +2801,7 @@ +@@ -2815,7 +2815,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 181 VARIABLE_SCOPE GLOBAL @@ -892,7 +892,7 @@ VARIABLE_COMMENT Maximum number of statement instruments. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 256 -@@ -2815,7 +2815,7 @@ +@@ -2829,7 +2829,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -901,7 +901,7 @@ VARIABLE_COMMENT Maximum number of opened instrumented tables. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2829,7 +2829,7 @@ +@@ -2843,7 +2843,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -910,7 +910,7 @@ VARIABLE_COMMENT Maximum number of instrumented tables. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2843,7 +2843,7 @@ +@@ -2857,7 +2857,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 50 VARIABLE_SCOPE GLOBAL @@ -919,7 +919,7 @@ VARIABLE_COMMENT Maximum number of thread instruments. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 256 -@@ -2857,7 +2857,7 @@ +@@ -2871,7 +2871,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -928,7 +928,7 @@ VARIABLE_COMMENT Maximum number of instrumented threads. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2871,7 +2871,7 @@ +@@ -2885,7 +2885,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -937,7 +937,7 @@ VARIABLE_COMMENT Size of session attribute string buffer per thread. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2885,7 +2885,7 @@ +@@ -2899,7 +2899,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 100 VARIABLE_SCOPE GLOBAL @@ -946,7 +946,7 @@ VARIABLE_COMMENT Maximum number of rows in SETUP_ACTORS. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 1024 -@@ -2899,7 +2899,7 @@ +@@ -2913,7 +2913,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 100 VARIABLE_SCOPE GLOBAL @@ -955,7 +955,7 @@ VARIABLE_COMMENT Maximum number of rows in SETUP_OBJECTS. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 1048576 -@@ -2913,7 +2913,7 @@ +@@ -2927,7 +2927,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -964,7 +964,7 @@ VARIABLE_COMMENT Maximum number of instrumented users. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2983,7 +2983,7 @@ +@@ -2997,7 +2997,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 32768 VARIABLE_SCOPE SESSION @@ -973,7 +973,7 @@ VARIABLE_COMMENT The size of the buffer that is allocated when preloading indexes NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 1073741824 -@@ -3011,7 +3011,7 @@ +@@ -3025,7 +3025,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 15 VARIABLE_SCOPE SESSION @@ -982,7 +982,7 @@ VARIABLE_COMMENT Limit of query profiling memory NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 100 -@@ -3025,7 +3025,7 @@ +@@ -3039,7 +3039,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 5 VARIABLE_SCOPE SESSION @@ -991,7 +991,7 @@ VARIABLE_COMMENT Seconds between sending progress reports to the client for time-consuming statements. Set to 0 to disable progress reporting. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -3095,7 +3095,7 @@ +@@ -3109,7 +3109,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 16384 VARIABLE_SCOPE SESSION @@ -1000,7 +1000,7 @@ VARIABLE_COMMENT Allocation block size for query parsing and execution NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 4294967295 -@@ -3109,7 +3109,7 @@ +@@ -3123,7 +3123,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1048576 VARIABLE_SCOPE GLOBAL @@ -1009,7 +1009,7 @@ VARIABLE_COMMENT Don't cache results that are bigger than this NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -3123,7 +3123,7 @@ +@@ -3137,7 +3137,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 4096 VARIABLE_SCOPE GLOBAL @@ -1018,7 +1018,7 @@ VARIABLE_COMMENT The minimum size for blocks allocated by the query cache NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -3140,7 +3140,7 @@ +@@ -3154,7 +3154,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The memory allocated to store results from old queries NUMERIC_MIN_VALUE 0 @@ -1027,7 +1027,7 @@ NUMERIC_BLOCK_SIZE 1024 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -3193,7 +3193,7 @@ +@@ -3207,7 +3207,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 24576 VARIABLE_SCOPE SESSION @@ -1036,7 +1036,7 @@ VARIABLE_COMMENT Persistent buffer for query parsing and execution NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 4294967295 -@@ -3207,7 +3207,7 @@ +@@ -3221,7 +3221,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 4096 VARIABLE_SCOPE SESSION @@ -1045,7 +1045,7 @@ VARIABLE_COMMENT Allocation block size for storing ranges during optimization NUMERIC_MIN_VALUE 4096 NUMERIC_MAX_VALUE 4294967295 -@@ -3221,7 +3221,7 @@ +@@ -3235,7 +3235,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 131072 VARIABLE_SCOPE SESSION @@ -1054,7 +1054,7 @@ VARIABLE_COMMENT Each thread that does a sequential scan allocates a buffer of this size for each table it scans. If you do many sequential scans, you may want to increase this value NUMERIC_MIN_VALUE 8192 NUMERIC_MAX_VALUE 2147483647 -@@ -3249,7 +3249,7 @@ +@@ -3263,7 +3263,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 262144 VARIABLE_SCOPE SESSION @@ -1063,7 +1063,7 @@ VARIABLE_COMMENT When reading rows in sorted order after a sort, the rows are read through this buffer to avoid a disk seeks NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 2147483647 -@@ -3263,10 +3263,10 @@ +@@ -3277,10 +3277,10 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 8388608 VARIABLE_SCOPE SESSION @@ -1076,7 +1076,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -3305,7 +3305,7 @@ +@@ -3319,7 +3319,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE 0 VARIABLE_SCOPE SESSION @@ -1085,7 +1085,7 @@ VARIABLE_COMMENT Uniquely identifies the server instance in the community of replication partners NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -3403,7 +3403,7 @@ +@@ -3417,7 +3417,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1073741824 VARIABLE_SCOPE GLOBAL @@ -1094,7 +1094,7 @@ VARIABLE_COMMENT The maximum packet length to sent successfully from the master to slave. NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 1073741824 -@@ -3417,7 +3417,7 @@ +@@ -3431,7 +3431,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 2 VARIABLE_SCOPE GLOBAL @@ -1103,7 +1103,7 @@ VARIABLE_COMMENT If creating the thread takes longer than this value (in seconds), the Slow_launch_threads counter will be incremented NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 31536000 -@@ -3476,7 +3476,7 @@ +@@ -3490,7 +3490,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Each thread that needs to do a sort allocates a buffer of this size NUMERIC_MIN_VALUE 1024 @@ -1112,7 +1112,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -3753,7 +3753,7 @@ +@@ -3767,7 +3767,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 256 VARIABLE_SCOPE GLOBAL @@ -1121,7 +1121,7 @@ VARIABLE_COMMENT The soft upper limit for number of cached stored routines for one connection. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 524288 -@@ -3823,7 +3823,7 @@ +@@ -3837,7 +3837,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 400 VARIABLE_SCOPE GLOBAL @@ -1130,7 +1130,7 @@ VARIABLE_COMMENT The number of cached table definitions NUMERIC_MIN_VALUE 400 NUMERIC_MAX_VALUE 524288 -@@ -3837,7 +3837,7 @@ +@@ -3851,7 +3851,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 2000 VARIABLE_SCOPE GLOBAL @@ -1139,7 +1139,7 @@ VARIABLE_COMMENT The number of cached open tables NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 524288 -@@ -3851,7 +3851,7 @@ +@@ -3865,7 +3865,7 @@ GLOBAL_VALUE_ORIGIN AUTO DEFAULT_VALUE 256 VARIABLE_SCOPE GLOBAL @@ -1148,7 +1148,7 @@ VARIABLE_COMMENT How many threads we should keep in a cache for reuse. These are freed after 5 minutes of idle time NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 16384 -@@ -3865,7 +3865,7 @@ +@@ -3879,7 +3879,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 10 VARIABLE_SCOPE GLOBAL @@ -1157,7 +1157,7 @@ VARIABLE_COMMENT Permits the application to give the threads system a hint for the desired number of threads that should be run at the same time.This variable has no effect, and is deprecated. It will be removed in a future release. NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 512 -@@ -3980,7 +3980,7 @@ +@@ -3994,7 +3994,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT If an internal in-memory temporary table exceeds this size, MySQL will automatically convert it to an on-disk MyISAM or Aria table NUMERIC_MIN_VALUE 1024 @@ -1166,7 +1166,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -3991,7 +3991,7 @@ +@@ -4005,7 +4005,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 8192 VARIABLE_SCOPE SESSION @@ -1175,7 +1175,7 @@ VARIABLE_COMMENT Allocation block size for transactions to be stored in binary log NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 134217728 -@@ -4005,7 +4005,7 @@ +@@ -4019,7 +4019,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 4096 VARIABLE_SCOPE SESSION @@ -1184,7 +1184,7 @@ VARIABLE_COMMENT Persistent buffer for transactions to be stored in binary log NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 134217728 -@@ -4103,7 +4103,7 @@ +@@ -4117,7 +4117,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 28800 VARIABLE_SCOPE SESSION @@ -1193,7 +1193,7 @@ VARIABLE_COMMENT The number of seconds the server waits for activity on a connection before closing it NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 31536000 -@@ -4207,7 +4207,7 @@ +@@ -4221,7 +4221,7 @@ COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME OPEN_FILES_LIMIT VARIABLE_SCOPE GLOBAL @@ -1202,7 +1202,7 @@ VARIABLE_COMMENT If this is not 0, then mysqld will use this value to reserve file descriptors to use with setrlimit(). If this value is 0 then mysqld will reserve max_connections*5 or max_connections + table_cache*2 (whichever is larger) number of file descriptors NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -4220,7 +4220,7 @@ +@@ -4234,7 +4234,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Sets the internal state of the RAND() generator for replication purposes NUMERIC_MIN_VALUE 0 @@ -1211,7 +1211,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -4230,7 +4230,7 @@ +@@ -4244,7 +4244,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Sets the internal state of the RAND() generator for replication purposes NUMERIC_MIN_VALUE 0 @@ -1220,7 +1220,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -4315,7 +4315,7 @@ +@@ -4329,7 +4329,7 @@ VARIABLE_NAME LOG_TC_SIZE GLOBAL_VALUE_ORIGIN AUTO VARIABLE_SCOPE GLOBAL diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result b/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result index 11f97cd309d..06e31cac5d3 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result +++ b/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result @@ -387,6 +387,20 @@ NUMERIC_BLOCK_SIZE NULL ENUM_VALUE_LIST NULL READ_ONLY YES COMMAND_LINE_ARGUMENT NULL +VARIABLE_NAME CHECK_CONSTRAINT_CHECKS +SESSION_VALUE ON +GLOBAL_VALUE ON +GLOBAL_VALUE_ORIGIN COMPILE-TIME +DEFAULT_VALUE ON +VARIABLE_SCOPE SESSION +VARIABLE_TYPE BOOLEAN +VARIABLE_COMMENT check_constraint_checks +NUMERIC_MIN_VALUE NULL +NUMERIC_MAX_VALUE NULL +NUMERIC_BLOCK_SIZE NULL +ENUM_VALUE_LIST OFF,ON +READ_ONLY NO +COMMAND_LINE_ARGUMENT NULL VARIABLE_NAME COLLATION_CONNECTION SESSION_VALUE latin1_swedish_ci GLOBAL_VALUE latin1_swedish_ci @@ -690,7 +704,7 @@ VARIABLE_SCOPE SESSION VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Precision of the result of '/' operator will be increased on that value NUMERIC_MIN_VALUE 0 -NUMERIC_MAX_VALUE 30 +NUMERIC_MAX_VALUE 38 NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO @@ -2460,17 +2474,17 @@ ENUM_VALUE_LIST NULL READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME OPTIMIZER_SWITCH -SESSION_VALUE index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on -GLOBAL_VALUE index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on +SESSION_VALUE index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=off +GLOBAL_VALUE index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=off GLOBAL_VALUE_ORIGIN COMPILE-TIME -DEFAULT_VALUE index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on +DEFAULT_VALUE index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=off VARIABLE_SCOPE SESSION VARIABLE_TYPE FLAGSET VARIABLE_COMMENT Fine-tune the optimizer behavior NUMERIC_MIN_VALUE NULL NUMERIC_MAX_VALUE NULL NUMERIC_BLOCK_SIZE NULL -ENUM_VALUE_LIST index_merge,index_merge_union,index_merge_sort_union,index_merge_intersection,index_merge_sort_intersection,engine_condition_pushdown,index_condition_pushdown,derived_merge,derived_with_keys,firstmatch,loosescan,materialization,in_to_exists,semijoin,partial_match_rowid_merge,partial_match_table_scan,subquery_cache,mrr,mrr_cost_based,mrr_sort_keys,outer_join_with_cache,semijoin_with_cache,join_cache_incremental,join_cache_hashed,join_cache_bka,optimize_join_buffer_size,table_elimination,extended_keys,exists_to_in,default +ENUM_VALUE_LIST index_merge,index_merge_union,index_merge_sort_union,index_merge_intersection,index_merge_sort_intersection,engine_condition_pushdown,index_condition_pushdown,derived_merge,derived_with_keys,firstmatch,loosescan,materialization,in_to_exists,semijoin,partial_match_rowid_merge,partial_match_table_scan,subquery_cache,mrr,mrr_cost_based,mrr_sort_keys,outer_join_with_cache,semijoin_with_cache,join_cache_incremental,join_cache_hashed,join_cache_bka,optimize_join_buffer_size,table_elimination,extended_keys,exists_to_in,orderby_uses_equalities,default READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME OPTIMIZER_USE_CONDITION_SELECTIVITY @@ -3917,9 +3931,9 @@ READ_ONLY YES COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME THREAD_STACK SESSION_VALUE NULL -GLOBAL_VALUE 296960 +GLOBAL_VALUE 297984 GLOBAL_VALUE_ORIGIN COMPILE-TIME -DEFAULT_VALUE 296960 +DEFAULT_VALUE 297984 VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The stack size for each thread diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded,32bit.rdiff b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded,32bit.rdiff index 07bb14eb75f..7dea7ec3d23 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded,32bit.rdiff +++ b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded,32bit.rdiff @@ -80,7 +80,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -463,7 +463,7 @@ +@@ -477,7 +477,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE 10 VARIABLE_SCOPE GLOBAL @@ -89,7 +89,7 @@ VARIABLE_COMMENT The number of seconds the mysqld server is waiting for a connect packet before responding with 'Bad handshake' NUMERIC_MIN_VALUE 2 NUMERIC_MAX_VALUE 31536000 -@@ -519,7 +519,7 @@ +@@ -533,7 +533,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 15 VARIABLE_SCOPE SESSION @@ -98,7 +98,7 @@ VARIABLE_COMMENT Long search depth for the two-step deadlock detection NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 33 -@@ -533,7 +533,7 @@ +@@ -547,7 +547,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 4 VARIABLE_SCOPE SESSION @@ -107,7 +107,7 @@ VARIABLE_COMMENT Short search depth for the two-step deadlock detection NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 32 -@@ -547,7 +547,7 @@ +@@ -561,7 +561,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 50000000 VARIABLE_SCOPE SESSION @@ -116,7 +116,7 @@ VARIABLE_COMMENT Long timeout for the two-step deadlock detection (in microseconds) NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -561,7 +561,7 @@ +@@ -575,7 +575,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 10000 VARIABLE_SCOPE SESSION @@ -125,7 +125,7 @@ VARIABLE_COMMENT Short timeout for the two-step deadlock detection (in microseconds) NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -631,7 +631,7 @@ +@@ -645,7 +645,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 0 VARIABLE_SCOPE SESSION @@ -134,7 +134,7 @@ VARIABLE_COMMENT The default week format used by WEEK() functions NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 7 -@@ -645,7 +645,7 @@ +@@ -659,7 +659,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 100 VARIABLE_SCOPE GLOBAL @@ -143,7 +143,7 @@ VARIABLE_COMMENT After inserting delayed_insert_limit rows, the INSERT DELAYED handler will check if there are any SELECT statements pending. If so, it allows these to execute before continuing NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 4294967295 -@@ -659,7 +659,7 @@ +@@ -673,7 +673,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 300 VARIABLE_SCOPE GLOBAL @@ -152,7 +152,7 @@ VARIABLE_COMMENT How long a INSERT DELAYED thread should wait for INSERT statements before terminating NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 31536000 -@@ -673,7 +673,7 @@ +@@ -687,7 +687,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1000 VARIABLE_SCOPE GLOBAL @@ -161,7 +161,7 @@ VARIABLE_COMMENT What size queue (in rows) should be allocated for handling INSERT DELAYED. If the queue becomes full, any client that does INSERT DELAYED will wait until there is room in the queue again NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 4294967295 -@@ -701,7 +701,7 @@ +@@ -715,7 +715,7 @@ GLOBAL_VALUE_ORIGIN SQL DEFAULT_VALUE 4 VARIABLE_SCOPE SESSION @@ -169,8 +169,8 @@ +VARIABLE_TYPE INT UNSIGNED VARIABLE_COMMENT Precision of the result of '/' operator will be increased on that value NUMERIC_MIN_VALUE 0 - NUMERIC_MAX_VALUE 30 -@@ -813,7 +813,7 @@ + NUMERIC_MAX_VALUE 38 +@@ -827,7 +827,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 0 VARIABLE_SCOPE GLOBAL @@ -179,7 +179,7 @@ VARIABLE_COMMENT If non-zero, binary logs will be purged after expire_logs_days days; possible purges happen at startup and at binary log rotation NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 99 -@@ -855,7 +855,7 @@ +@@ -869,7 +869,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1 VARIABLE_SCOPE GLOBAL @@ -188,7 +188,7 @@ VARIABLE_COMMENT The number of connections on extra-port NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 100000 -@@ -897,7 +897,7 @@ +@@ -911,7 +911,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 0 VARIABLE_SCOPE GLOBAL @@ -197,7 +197,7 @@ VARIABLE_COMMENT A dedicated thread is created to flush all tables at the given interval NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 31536000 -@@ -939,7 +939,7 @@ +@@ -953,7 +953,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 84 VARIABLE_SCOPE GLOBAL @@ -206,7 +206,7 @@ VARIABLE_COMMENT The maximum length of the word to be included in a FULLTEXT index. Note: FULLTEXT indexes must be rebuilt after changing this variable NUMERIC_MIN_VALUE 10 NUMERIC_MAX_VALUE 84 -@@ -953,7 +953,7 @@ +@@ -967,7 +967,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 4 VARIABLE_SCOPE GLOBAL @@ -215,7 +215,7 @@ VARIABLE_COMMENT The minimum length of the word to be included in a FULLTEXT index. Note: FULLTEXT indexes must be rebuilt after changing this variable NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 84 -@@ -967,7 +967,7 @@ +@@ -981,7 +981,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 20 VARIABLE_SCOPE GLOBAL @@ -224,7 +224,7 @@ VARIABLE_COMMENT Number of best matches to use for query expansion NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 1000 -@@ -1026,7 +1026,7 @@ +@@ -1040,7 +1040,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The maximum length of the result of function GROUP_CONCAT() NUMERIC_MIN_VALUE 4 @@ -233,7 +233,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -1261,7 +1261,7 @@ +@@ -1275,7 +1275,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 0 VARIABLE_SCOPE SESSION @@ -242,7 +242,7 @@ VARIABLE_COMMENT Number of bytes used for a histogram. If set to 0, no histograms are created by ANALYZE. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 255 -@@ -1289,7 +1289,7 @@ +@@ -1303,7 +1303,7 @@ GLOBAL_VALUE_ORIGIN AUTO DEFAULT_VALUE 128 VARIABLE_SCOPE GLOBAL @@ -251,7 +251,7 @@ VARIABLE_COMMENT How many host names should be cached to avoid resolving. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 65536 -@@ -1401,7 +1401,7 @@ +@@ -1415,7 +1415,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 28800 VARIABLE_SCOPE SESSION @@ -260,7 +260,7 @@ VARIABLE_COMMENT The number of seconds the server waits for activity on an interactive connection before closing it NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 31536000 -@@ -1432,7 +1432,7 @@ +@@ -1446,7 +1446,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The size of the buffer that is used for joins NUMERIC_MIN_VALUE 128 @@ -269,7 +269,7 @@ NUMERIC_BLOCK_SIZE 128 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -1457,7 +1457,7 @@ +@@ -1471,7 +1471,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 2 VARIABLE_SCOPE SESSION @@ -278,7 +278,7 @@ VARIABLE_COMMENT Controls what join operations can be executed with join buffers. Odd numbers are used for plain join buffers while even numbers are used for linked buffers NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 8 -@@ -1488,7 +1488,7 @@ +@@ -1502,7 +1502,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The size of the buffer used for index blocks for MyISAM tables. Increase this to get better index handling (for all reads and multiple writes) to as much as you can afford NUMERIC_MIN_VALUE 0 @@ -287,7 +287,7 @@ NUMERIC_BLOCK_SIZE 4096 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -1709,7 +1709,7 @@ +@@ -1723,7 +1723,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 31536000 VARIABLE_SCOPE SESSION @@ -296,7 +296,7 @@ VARIABLE_COMMENT Timeout in seconds to wait for a lock before returning an error. NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 31536000 -@@ -1863,7 +1863,7 @@ +@@ -1877,7 +1877,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1 VARIABLE_SCOPE SESSION @@ -305,7 +305,7 @@ VARIABLE_COMMENT Write to slow log every #th slow query. Set to 1 to log everything. Increase it to reduce the size of the slow or the performance impact of slow logging NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 4294967295 -@@ -1905,7 +1905,7 @@ +@@ -1919,7 +1919,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1 VARIABLE_SCOPE SESSION @@ -314,7 +314,7 @@ VARIABLE_COMMENT Log some not critical warnings to the general log file.Value can be between 0 and 11. Higher values mean more verbosity NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -1961,7 +1961,7 @@ +@@ -1975,7 +1975,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 4194304 VARIABLE_SCOPE SESSION @@ -323,7 +323,7 @@ VARIABLE_COMMENT Max packet length to send to or receive from the server NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 1073741824 -@@ -1971,14 +1971,14 @@ +@@ -1985,14 +1985,14 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME MAX_BINLOG_CACHE_SIZE SESSION_VALUE NULL @@ -341,7 +341,7 @@ NUMERIC_BLOCK_SIZE 4096 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -1989,7 +1989,7 @@ +@@ -2003,7 +2003,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1073741824 VARIABLE_SCOPE GLOBAL @@ -350,7 +350,7 @@ VARIABLE_COMMENT Binary log will be rotated automatically when the size exceeds this value. NUMERIC_MIN_VALUE 4096 NUMERIC_MAX_VALUE 1073741824 -@@ -1999,14 +1999,14 @@ +@@ -2013,14 +2013,14 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME MAX_BINLOG_STMT_CACHE_SIZE SESSION_VALUE NULL @@ -368,7 +368,7 @@ NUMERIC_BLOCK_SIZE 4096 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -2017,7 +2017,7 @@ +@@ -2031,7 +2031,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 151 VARIABLE_SCOPE GLOBAL @@ -377,7 +377,7 @@ VARIABLE_COMMENT The number of simultaneous clients allowed NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 100000 -@@ -2031,7 +2031,7 @@ +@@ -2045,7 +2045,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 100 VARIABLE_SCOPE GLOBAL @@ -386,7 +386,7 @@ VARIABLE_COMMENT If there is more than this number of interrupted connections from a host this host will be blocked from further connections NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 4294967295 -@@ -2045,7 +2045,7 @@ +@@ -2059,7 +2059,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 20 VARIABLE_SCOPE SESSION @@ -395,7 +395,7 @@ VARIABLE_COMMENT Don't start more than this number of threads to handle INSERT DELAYED statements. If set to zero INSERT DELAYED will be not used NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 16384 -@@ -2073,7 +2073,7 @@ +@@ -2087,7 +2087,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 64 VARIABLE_SCOPE SESSION @@ -404,7 +404,7 @@ VARIABLE_COMMENT Max number of errors/warnings to store for a statement NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 65535 -@@ -2090,7 +2090,7 @@ +@@ -2104,7 +2104,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Don't allow creation of heap tables bigger than this NUMERIC_MIN_VALUE 16384 @@ -413,7 +413,7 @@ NUMERIC_BLOCK_SIZE 1024 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -2101,7 +2101,7 @@ +@@ -2115,7 +2115,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 20 VARIABLE_SCOPE SESSION @@ -422,7 +422,7 @@ VARIABLE_COMMENT Don't start more than this number of threads to handle INSERT DELAYED statements. If set to zero INSERT DELAYED will be not used NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 16384 -@@ -2129,7 +2129,7 @@ +@@ -2143,7 +2143,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1024 VARIABLE_SCOPE SESSION @@ -431,7 +431,7 @@ VARIABLE_COMMENT Max number of bytes in sorted records NUMERIC_MIN_VALUE 4 NUMERIC_MAX_VALUE 8388608 -@@ -2143,7 +2143,7 @@ +@@ -2157,7 +2157,7 @@ GLOBAL_VALUE_ORIGIN AUTO DEFAULT_VALUE 1048576 VARIABLE_SCOPE GLOBAL @@ -440,7 +440,7 @@ VARIABLE_COMMENT The maximum BLOB length to send to server from mysql_send_long_data API. Deprecated option; use max_allowed_packet instead. NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 4294967295 -@@ -2157,7 +2157,7 @@ +@@ -2171,7 +2171,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 16382 VARIABLE_SCOPE GLOBAL @@ -458,7 +458,7 @@ VARIABLE_COMMENT Maximum number of iterations when executing recursive queries NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -2185,7 +2185,7 @@ +@@ -2199,7 +2199,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 4294967295 VARIABLE_SCOPE SESSION @@ -467,7 +467,7 @@ VARIABLE_COMMENT Limit assumed max number of seeks when looking up rows based on a key NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 4294967295 -@@ -2199,7 +2199,7 @@ +@@ -2213,7 +2213,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1024 VARIABLE_SCOPE SESSION @@ -476,7 +476,7 @@ VARIABLE_COMMENT The number of bytes to use when sorting BLOB or TEXT values (only the first max_sort_length bytes of each value are used; the rest are ignored) NUMERIC_MIN_VALUE 4 NUMERIC_MAX_VALUE 8388608 -@@ -2213,7 +2213,7 @@ +@@ -2227,7 +2227,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 0 VARIABLE_SCOPE SESSION @@ -485,7 +485,7 @@ VARIABLE_COMMENT Maximum stored procedure recursion depth NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 255 -@@ -2241,7 +2241,7 @@ +@@ -2255,7 +2255,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 32 VARIABLE_SCOPE SESSION @@ -494,7 +494,7 @@ VARIABLE_COMMENT Unused, will be removed. NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 4294967295 -@@ -2269,7 +2269,7 @@ +@@ -2283,7 +2283,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 4294967295 VARIABLE_SCOPE GLOBAL @@ -503,7 +503,7 @@ VARIABLE_COMMENT After this many write locks, allow some read locks to run in between NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 4294967295 -@@ -2283,7 +2283,7 @@ +@@ -2297,7 +2297,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1024 VARIABLE_SCOPE GLOBAL @@ -512,7 +512,7 @@ VARIABLE_COMMENT Unused NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 1048576 -@@ -2297,7 +2297,7 @@ +@@ -2311,7 +2311,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 8 VARIABLE_SCOPE GLOBAL @@ -521,7 +521,7 @@ VARIABLE_COMMENT Unused NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 1024 -@@ -2311,7 +2311,7 @@ +@@ -2325,7 +2325,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 0 VARIABLE_SCOPE SESSION @@ -530,7 +530,7 @@ VARIABLE_COMMENT Don't write queries to slow log that examine fewer rows than that NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -2325,7 +2325,7 @@ +@@ -2339,7 +2339,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 262144 VARIABLE_SCOPE SESSION @@ -539,7 +539,7 @@ VARIABLE_COMMENT Size of buffer to use when using MRR with range access NUMERIC_MIN_VALUE 8192 NUMERIC_MAX_VALUE 2147483647 -@@ -2339,10 +2339,10 @@ +@@ -2353,10 +2353,10 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 256 VARIABLE_SCOPE SESSION @@ -552,7 +552,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -2353,7 +2353,7 @@ +@@ -2367,7 +2367,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1024 VARIABLE_SCOPE GLOBAL @@ -561,7 +561,7 @@ VARIABLE_COMMENT Block size to be used for MyISAM index pages NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 16384 -@@ -2367,7 +2367,7 @@ +@@ -2381,7 +2381,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 6 VARIABLE_SCOPE GLOBAL @@ -570,7 +570,7 @@ VARIABLE_COMMENT Default pointer size to be used for MyISAM tables NUMERIC_MIN_VALUE 2 NUMERIC_MAX_VALUE 7 -@@ -2377,9 +2377,9 @@ +@@ -2391,9 +2391,9 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME MYISAM_MAX_SORT_FILE_SIZE SESSION_VALUE NULL @@ -582,7 +582,7 @@ VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Don't use the fast sort index method to created index if the temporary file would get bigger than this -@@ -2391,14 +2391,14 @@ +@@ -2405,14 +2405,14 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME MYISAM_MMAP_SIZE SESSION_VALUE NULL @@ -600,7 +600,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY YES -@@ -2423,10 +2423,10 @@ +@@ -2437,10 +2437,10 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1 VARIABLE_SCOPE SESSION @@ -613,7 +613,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -2440,7 +2440,7 @@ +@@ -2454,7 +2454,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The buffer that is allocated when sorting the index when doing a REPAIR or when creating indexes with CREATE INDEX or ALTER TABLE NUMERIC_MIN_VALUE 4096 @@ -622,7 +622,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -2493,7 +2493,7 @@ +@@ -2507,7 +2507,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 16384 VARIABLE_SCOPE SESSION @@ -631,7 +631,7 @@ VARIABLE_COMMENT Buffer length for TCP/IP and socket communication NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 1048576 -@@ -2507,7 +2507,7 @@ +@@ -2521,7 +2521,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 30 VARIABLE_SCOPE SESSION @@ -640,7 +640,7 @@ VARIABLE_COMMENT Number of seconds to wait for more data from a connection before aborting the read NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 31536000 -@@ -2521,7 +2521,7 @@ +@@ -2535,7 +2535,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 10 VARIABLE_SCOPE SESSION @@ -649,7 +649,7 @@ VARIABLE_COMMENT If a read on a communication port is interrupted, retry this many times before giving up NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 4294967295 -@@ -2535,7 +2535,7 @@ +@@ -2549,7 +2549,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 60 VARIABLE_SCOPE SESSION @@ -658,7 +658,7 @@ VARIABLE_COMMENT Number of seconds to wait for a block to be written to a connection before aborting the write NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 31536000 -@@ -2605,7 +2605,7 @@ +@@ -2619,7 +2619,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1 VARIABLE_SCOPE SESSION @@ -667,7 +667,7 @@ VARIABLE_COMMENT Controls the heuristic(s) applied during query optimization to prune less-promising partial plans from the optimizer search space. Meaning: 0 - do not apply any heuristic, thus perform exhaustive search; 1 - prune plans based on number of retrieved rows NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 1 -@@ -2619,7 +2619,7 @@ +@@ -2633,7 +2633,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 62 VARIABLE_SCOPE SESSION @@ -676,7 +676,7 @@ VARIABLE_COMMENT Maximum depth of search performed by the query optimizer. Values larger than the number of relations in a query result in better query plans, but take longer to compile a query. Values smaller than the number of tables in a relation result in faster optimization, but may produce very bad query plans. If set to 0, the system will automatically pick a reasonable value NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 62 -@@ -2633,7 +2633,7 @@ +@@ -2647,7 +2647,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 100 VARIABLE_SCOPE SESSION @@ -685,7 +685,7 @@ VARIABLE_COMMENT Controls number of record samples to check condition selectivity NUMERIC_MIN_VALUE 10 NUMERIC_MAX_VALUE 4294967295 -@@ -2661,7 +2661,7 @@ +@@ -2675,7 +2675,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1 VARIABLE_SCOPE SESSION @@ -694,7 +694,7 @@ VARIABLE_COMMENT Controls selectivity of which conditions the optimizer takes into account to calculate cardinality of a partial join when it searches for the best execution plan Meaning: 1 - use selectivity of index backed range conditions to calculate the cardinality of a partial join if the last joined table is accessed by full table scan or an index scan, 2 - use selectivity of index backed range conditions to calculate the cardinality of a partial join in any case, 3 - additionally always use selectivity of range conditions that are not backed by any index to calculate the cardinality of a partial join, 4 - use histograms to calculate selectivity of range conditions that are not backed by any index to calculate the cardinality of a partial join.5 - additionally use selectivity of certain non-range predicates calculated on record samples NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 5 -@@ -2689,7 +2689,7 @@ +@@ -2703,7 +2703,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -703,7 +703,7 @@ VARIABLE_COMMENT Maximum number of instrumented user@host accounts. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2703,7 +2703,7 @@ +@@ -2717,7 +2717,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -712,7 +712,7 @@ VARIABLE_COMMENT Size of the statement digest. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 200 -@@ -2717,7 +2717,7 @@ +@@ -2731,7 +2731,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -721,7 +721,7 @@ VARIABLE_COMMENT Number of rows in EVENTS_STAGES_HISTORY_LONG. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2731,7 +2731,7 @@ +@@ -2745,7 +2745,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -730,7 +730,7 @@ VARIABLE_COMMENT Number of rows per thread in EVENTS_STAGES_HISTORY. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1024 -@@ -2745,7 +2745,7 @@ +@@ -2759,7 +2759,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -739,7 +739,7 @@ VARIABLE_COMMENT Number of rows in EVENTS_STATEMENTS_HISTORY_LONG. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2759,7 +2759,7 @@ +@@ -2773,7 +2773,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -748,7 +748,7 @@ VARIABLE_COMMENT Number of rows per thread in EVENTS_STATEMENTS_HISTORY. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1024 -@@ -2773,7 +2773,7 @@ +@@ -2787,7 +2787,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -757,7 +757,7 @@ VARIABLE_COMMENT Number of rows in EVENTS_WAITS_HISTORY_LONG. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2787,7 +2787,7 @@ +@@ -2801,7 +2801,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -766,7 +766,7 @@ VARIABLE_COMMENT Number of rows per thread in EVENTS_WAITS_HISTORY. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1024 -@@ -2801,7 +2801,7 @@ +@@ -2815,7 +2815,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -775,7 +775,7 @@ VARIABLE_COMMENT Maximum number of instrumented hosts. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2815,7 +2815,7 @@ +@@ -2829,7 +2829,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 80 VARIABLE_SCOPE GLOBAL @@ -784,7 +784,7 @@ VARIABLE_COMMENT Maximum number of condition instruments. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 256 -@@ -2829,7 +2829,7 @@ +@@ -2843,7 +2843,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -793,7 +793,7 @@ VARIABLE_COMMENT Maximum number of instrumented condition objects. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2843,7 +2843,7 @@ +@@ -2857,7 +2857,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1024 VARIABLE_SCOPE GLOBAL @@ -802,7 +802,7 @@ VARIABLE_COMMENT Maximum length considered for digest text, when stored in performance_schema tables. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 1048576 -@@ -2857,7 +2857,7 @@ +@@ -2871,7 +2871,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 50 VARIABLE_SCOPE GLOBAL @@ -811,7 +811,7 @@ VARIABLE_COMMENT Maximum number of file instruments. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 256 -@@ -2871,7 +2871,7 @@ +@@ -2885,7 +2885,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 32768 VARIABLE_SCOPE GLOBAL @@ -820,7 +820,7 @@ VARIABLE_COMMENT Maximum number of opened instrumented files. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 1048576 -@@ -2885,7 +2885,7 @@ +@@ -2899,7 +2899,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -829,7 +829,7 @@ VARIABLE_COMMENT Maximum number of instrumented files. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2899,7 +2899,7 @@ +@@ -2913,7 +2913,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 200 VARIABLE_SCOPE GLOBAL @@ -838,7 +838,7 @@ VARIABLE_COMMENT Maximum number of mutex instruments. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 256 -@@ -2913,7 +2913,7 @@ +@@ -2927,7 +2927,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -847,7 +847,7 @@ VARIABLE_COMMENT Maximum number of instrumented MUTEX objects. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 104857600 -@@ -2927,7 +2927,7 @@ +@@ -2941,7 +2941,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 40 VARIABLE_SCOPE GLOBAL @@ -856,7 +856,7 @@ VARIABLE_COMMENT Maximum number of rwlock instruments. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 256 -@@ -2941,7 +2941,7 @@ +@@ -2955,7 +2955,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -865,7 +865,7 @@ VARIABLE_COMMENT Maximum number of instrumented RWLOCK objects. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 104857600 -@@ -2955,7 +2955,7 @@ +@@ -2969,7 +2969,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 10 VARIABLE_SCOPE GLOBAL @@ -874,7 +874,7 @@ VARIABLE_COMMENT Maximum number of socket instruments. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 256 -@@ -2969,7 +2969,7 @@ +@@ -2983,7 +2983,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -883,7 +883,7 @@ VARIABLE_COMMENT Maximum number of opened instrumented sockets. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2983,7 +2983,7 @@ +@@ -2997,7 +2997,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 150 VARIABLE_SCOPE GLOBAL @@ -892,7 +892,7 @@ VARIABLE_COMMENT Maximum number of stage instruments. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 256 -@@ -2997,7 +2997,7 @@ +@@ -3011,7 +3011,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 181 VARIABLE_SCOPE GLOBAL @@ -901,7 +901,7 @@ VARIABLE_COMMENT Maximum number of statement instruments. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 256 -@@ -3011,7 +3011,7 @@ +@@ -3025,7 +3025,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -910,7 +910,7 @@ VARIABLE_COMMENT Maximum number of opened instrumented tables. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -3025,7 +3025,7 @@ +@@ -3039,7 +3039,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -919,7 +919,7 @@ VARIABLE_COMMENT Maximum number of instrumented tables. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -3039,7 +3039,7 @@ +@@ -3053,7 +3053,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 50 VARIABLE_SCOPE GLOBAL @@ -928,7 +928,7 @@ VARIABLE_COMMENT Maximum number of thread instruments. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 256 -@@ -3053,7 +3053,7 @@ +@@ -3067,7 +3067,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -937,7 +937,7 @@ VARIABLE_COMMENT Maximum number of instrumented threads. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -3067,7 +3067,7 @@ +@@ -3081,7 +3081,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -946,7 +946,7 @@ VARIABLE_COMMENT Size of session attribute string buffer per thread. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -3081,7 +3081,7 @@ +@@ -3095,7 +3095,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 100 VARIABLE_SCOPE GLOBAL @@ -955,7 +955,7 @@ VARIABLE_COMMENT Maximum number of rows in SETUP_ACTORS. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 1024 -@@ -3095,7 +3095,7 @@ +@@ -3109,7 +3109,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 100 VARIABLE_SCOPE GLOBAL @@ -964,7 +964,7 @@ VARIABLE_COMMENT Maximum number of rows in SETUP_OBJECTS. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 1048576 -@@ -3109,7 +3109,7 @@ +@@ -3123,7 +3123,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -973,7 +973,7 @@ VARIABLE_COMMENT Maximum number of instrumented users. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -3179,7 +3179,7 @@ +@@ -3193,7 +3193,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 32768 VARIABLE_SCOPE SESSION @@ -982,7 +982,7 @@ VARIABLE_COMMENT The size of the buffer that is allocated when preloading indexes NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 1073741824 -@@ -3207,7 +3207,7 @@ +@@ -3221,7 +3221,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 15 VARIABLE_SCOPE SESSION @@ -991,7 +991,7 @@ VARIABLE_COMMENT Limit of query profiling memory NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 100 -@@ -3221,7 +3221,7 @@ +@@ -3235,7 +3235,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 5 VARIABLE_SCOPE SESSION @@ -1000,7 +1000,7 @@ VARIABLE_COMMENT Seconds between sending progress reports to the client for time-consuming statements. Set to 0 to disable progress reporting. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -3291,7 +3291,7 @@ +@@ -3305,7 +3305,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 16384 VARIABLE_SCOPE SESSION @@ -1009,7 +1009,7 @@ VARIABLE_COMMENT Allocation block size for query parsing and execution NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 4294967295 -@@ -3305,7 +3305,7 @@ +@@ -3319,7 +3319,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1048576 VARIABLE_SCOPE GLOBAL @@ -1018,7 +1018,7 @@ VARIABLE_COMMENT Don't cache results that are bigger than this NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -3319,7 +3319,7 @@ +@@ -3333,7 +3333,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 4096 VARIABLE_SCOPE GLOBAL @@ -1027,7 +1027,7 @@ VARIABLE_COMMENT The minimum size for blocks allocated by the query cache NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -3336,7 +3336,7 @@ +@@ -3350,7 +3350,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The memory allocated to store results from old queries NUMERIC_MIN_VALUE 0 @@ -1036,7 +1036,7 @@ NUMERIC_BLOCK_SIZE 1024 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -3389,7 +3389,7 @@ +@@ -3403,7 +3403,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 24576 VARIABLE_SCOPE SESSION @@ -1045,7 +1045,7 @@ VARIABLE_COMMENT Persistent buffer for query parsing and execution NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 4294967295 -@@ -3403,7 +3403,7 @@ +@@ -3417,7 +3417,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 4096 VARIABLE_SCOPE SESSION @@ -1054,7 +1054,7 @@ VARIABLE_COMMENT Allocation block size for storing ranges during optimization NUMERIC_MIN_VALUE 4096 NUMERIC_MAX_VALUE 4294967295 -@@ -3417,7 +3417,7 @@ +@@ -3431,7 +3431,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 131072 VARIABLE_SCOPE SESSION @@ -1063,7 +1063,7 @@ VARIABLE_COMMENT Each thread that does a sequential scan allocates a buffer of this size for each table it scans. If you do many sequential scans, you may want to increase this value NUMERIC_MIN_VALUE 8192 NUMERIC_MAX_VALUE 2147483647 -@@ -3445,7 +3445,7 @@ +@@ -3459,7 +3459,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 262144 VARIABLE_SCOPE SESSION @@ -1072,7 +1072,7 @@ VARIABLE_COMMENT When reading rows in sorted order after a sort, the rows are read through this buffer to avoid a disk seeks NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 2147483647 -@@ -3725,10 +3725,10 @@ +@@ -3739,10 +3739,10 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 8388608 VARIABLE_SCOPE SESSION @@ -1085,7 +1085,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -3767,7 +3767,7 @@ +@@ -3781,7 +3781,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE 0 VARIABLE_SCOPE SESSION @@ -1094,7 +1094,7 @@ VARIABLE_COMMENT Uniquely identifies the server instance in the community of replication partners NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -3893,7 +3893,7 @@ +@@ -3907,7 +3907,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 0 VARIABLE_SCOPE GLOBAL @@ -1103,7 +1103,7 @@ VARIABLE_COMMENT Maximum number of parallel threads to use on slave for events in a single replication domain. When using multiple domains, this can be used to limit a single domain from grabbing all threads and thus stalling other domains. The default of 0 means to allow a domain to grab as many threads as it wants, up to the value of slave_parallel_threads. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 16383 -@@ -3935,7 +3935,7 @@ +@@ -3949,7 +3949,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1073741824 VARIABLE_SCOPE GLOBAL @@ -1112,7 +1112,7 @@ VARIABLE_COMMENT The maximum packet length to sent successfully from the master to slave. NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 1073741824 -@@ -3963,7 +3963,7 @@ +@@ -3977,7 +3977,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 131072 VARIABLE_SCOPE GLOBAL @@ -1121,7 +1121,7 @@ VARIABLE_COMMENT Limit on how much memory SQL threads should use per parallel replication thread when reading ahead in the relay log looking for opportunities for parallel replication. Only used when --slave-parallel-threads > 0. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 2147483647 -@@ -3991,7 +3991,7 @@ +@@ -4005,7 +4005,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 0 VARIABLE_SCOPE GLOBAL @@ -1130,7 +1130,7 @@ VARIABLE_COMMENT If non-zero, number of threads to spawn to apply in parallel events on the slave that were group-committed on the master or were logged with GTID in different replication domains. Note that these threads are in addition to the IO and SQL threads, which are always created by a replication slave NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 16383 -@@ -4005,7 +4005,7 @@ +@@ -4019,7 +4019,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 0 VARIABLE_SCOPE GLOBAL @@ -1139,7 +1139,7 @@ VARIABLE_COMMENT Alias for slave_parallel_threads NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 16383 -@@ -4061,7 +4061,7 @@ +@@ -4075,7 +4075,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 10 VARIABLE_SCOPE GLOBAL @@ -1148,7 +1148,7 @@ VARIABLE_COMMENT Number of times the slave SQL thread will retry a transaction in case it failed with a deadlock or elapsed lock wait timeout, before giving up and stopping NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -4089,7 +4089,7 @@ +@@ -4103,7 +4103,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 2 VARIABLE_SCOPE GLOBAL @@ -1157,7 +1157,7 @@ VARIABLE_COMMENT If creating the thread takes longer than this value (in seconds), the Slow_launch_threads counter will be incremented NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 31536000 -@@ -4148,7 +4148,7 @@ +@@ -4162,7 +4162,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Each thread that needs to do a sort allocates a buffer of this size NUMERIC_MIN_VALUE 1024 @@ -1166,7 +1166,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -4439,7 +4439,7 @@ +@@ -4453,7 +4453,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 256 VARIABLE_SCOPE GLOBAL @@ -1175,7 +1175,7 @@ VARIABLE_COMMENT The soft upper limit for number of cached stored routines for one connection. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 524288 -@@ -4537,7 +4537,7 @@ +@@ -4551,7 +4551,7 @@ GLOBAL_VALUE_ORIGIN AUTO DEFAULT_VALUE 400 VARIABLE_SCOPE GLOBAL @@ -1184,7 +1184,7 @@ VARIABLE_COMMENT The number of cached table definitions NUMERIC_MIN_VALUE 400 NUMERIC_MAX_VALUE 524288 -@@ -4551,7 +4551,7 @@ +@@ -4565,7 +4565,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 2000 VARIABLE_SCOPE GLOBAL @@ -1193,7 +1193,7 @@ VARIABLE_COMMENT The number of cached open tables NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 524288 -@@ -4565,7 +4565,7 @@ +@@ -4579,7 +4579,7 @@ GLOBAL_VALUE_ORIGIN AUTO DEFAULT_VALUE 256 VARIABLE_SCOPE GLOBAL @@ -1202,7 +1202,7 @@ VARIABLE_COMMENT How many threads we should keep in a cache for reuse. These are freed after 5 minutes of idle time NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 16384 -@@ -4579,7 +4579,7 @@ +@@ -4593,7 +4593,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 10 VARIABLE_SCOPE GLOBAL @@ -1211,7 +1211,7 @@ VARIABLE_COMMENT Permits the application to give the threads system a hint for the desired number of threads that should be run at the same time.This variable has no effect, and is deprecated. It will be removed in a future release. NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 512 -@@ -4764,7 +4764,7 @@ +@@ -4778,7 +4778,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT If an internal in-memory temporary table exceeds this size, MySQL will automatically convert it to an on-disk MyISAM or Aria table NUMERIC_MIN_VALUE 1024 @@ -1220,7 +1220,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -4775,7 +4775,7 @@ +@@ -4789,7 +4789,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 8192 VARIABLE_SCOPE SESSION @@ -1229,7 +1229,7 @@ VARIABLE_COMMENT Allocation block size for transactions to be stored in binary log NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 134217728 -@@ -4789,7 +4789,7 @@ +@@ -4803,7 +4803,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 4096 VARIABLE_SCOPE SESSION @@ -1238,7 +1238,7 @@ VARIABLE_COMMENT Persistent buffer for transactions to be stored in binary log NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 134217728 -@@ -4887,7 +4887,7 @@ +@@ -4901,7 +4901,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 28800 VARIABLE_SCOPE SESSION @@ -1247,7 +1247,7 @@ VARIABLE_COMMENT The number of seconds the server waits for activity on a connection before closing it NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 31536000 -@@ -4991,7 +4991,7 @@ +@@ -5005,7 +5005,7 @@ COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME OPEN_FILES_LIMIT VARIABLE_SCOPE GLOBAL @@ -1256,7 +1256,7 @@ VARIABLE_COMMENT If this is not 0, then mysqld will use this value to reserve file descriptors to use with setrlimit(). If this value is 0 then mysqld will reserve max_connections*5 or max_connections + table_cache*2 (whichever is larger) number of file descriptors NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -5004,7 +5004,7 @@ +@@ -5018,7 +5018,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Sets the internal state of the RAND() generator for replication purposes NUMERIC_MIN_VALUE 0 @@ -1265,7 +1265,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -5014,7 +5014,7 @@ +@@ -5028,7 +5028,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Sets the internal state of the RAND() generator for replication purposes NUMERIC_MIN_VALUE 0 @@ -1274,7 +1274,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -5099,7 +5099,7 @@ +@@ -5113,7 +5113,7 @@ VARIABLE_NAME LOG_TC_SIZE GLOBAL_VALUE_ORIGIN AUTO VARIABLE_SCOPE GLOBAL diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result index 04709f014f7..2dbb1db5bda 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result +++ b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result @@ -387,6 +387,20 @@ NUMERIC_BLOCK_SIZE NULL ENUM_VALUE_LIST NULL READ_ONLY YES COMMAND_LINE_ARGUMENT NULL +VARIABLE_NAME CHECK_CONSTRAINT_CHECKS +SESSION_VALUE ON +GLOBAL_VALUE ON +GLOBAL_VALUE_ORIGIN COMPILE-TIME +DEFAULT_VALUE ON +VARIABLE_SCOPE SESSION +VARIABLE_TYPE BOOLEAN +VARIABLE_COMMENT check_constraint_checks +NUMERIC_MIN_VALUE NULL +NUMERIC_MAX_VALUE NULL +NUMERIC_BLOCK_SIZE NULL +ENUM_VALUE_LIST OFF,ON +READ_ONLY NO +COMMAND_LINE_ARGUMENT NULL VARIABLE_NAME COLLATION_CONNECTION SESSION_VALUE latin1_swedish_ci GLOBAL_VALUE latin1_swedish_ci @@ -704,7 +718,7 @@ VARIABLE_SCOPE SESSION VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Precision of the result of '/' operator will be increased on that value NUMERIC_MIN_VALUE 0 -NUMERIC_MAX_VALUE 30 +NUMERIC_MAX_VALUE 38 NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO @@ -2656,17 +2670,17 @@ ENUM_VALUE_LIST NULL READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME OPTIMIZER_SWITCH -SESSION_VALUE index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on -GLOBAL_VALUE index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on +SESSION_VALUE index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=off +GLOBAL_VALUE index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=off GLOBAL_VALUE_ORIGIN COMPILE-TIME -DEFAULT_VALUE index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on +DEFAULT_VALUE index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=off VARIABLE_SCOPE SESSION VARIABLE_TYPE FLAGSET VARIABLE_COMMENT Fine-tune the optimizer behavior NUMERIC_MIN_VALUE NULL NUMERIC_MAX_VALUE NULL NUMERIC_BLOCK_SIZE NULL -ENUM_VALUE_LIST index_merge,index_merge_union,index_merge_sort_union,index_merge_intersection,index_merge_sort_intersection,engine_condition_pushdown,index_condition_pushdown,derived_merge,derived_with_keys,firstmatch,loosescan,materialization,in_to_exists,semijoin,partial_match_rowid_merge,partial_match_table_scan,subquery_cache,mrr,mrr_cost_based,mrr_sort_keys,outer_join_with_cache,semijoin_with_cache,join_cache_incremental,join_cache_hashed,join_cache_bka,optimize_join_buffer_size,table_elimination,extended_keys,exists_to_in,default +ENUM_VALUE_LIST index_merge,index_merge_union,index_merge_sort_union,index_merge_intersection,index_merge_sort_intersection,engine_condition_pushdown,index_condition_pushdown,derived_merge,derived_with_keys,firstmatch,loosescan,materialization,in_to_exists,semijoin,partial_match_rowid_merge,partial_match_table_scan,subquery_cache,mrr,mrr_cost_based,mrr_sort_keys,outer_join_with_cache,semijoin_with_cache,join_cache_incremental,join_cache_hashed,join_cache_bka,optimize_join_buffer_size,table_elimination,extended_keys,exists_to_in,orderby_uses_equalities,default READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME OPTIMIZER_USE_CONDITION_SELECTIVITY @@ -3007,9 +3021,9 @@ READ_ONLY YES COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_STATEMENT_CLASSES SESSION_VALUE NULL -GLOBAL_VALUE 181 +GLOBAL_VALUE 184 GLOBAL_VALUE_ORIGIN COMPILE-TIME -DEFAULT_VALUE 181 +DEFAULT_VALUE 184 VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Maximum number of statement instruments. @@ -3779,11 +3793,11 @@ VARIABLE_NAME SERVER_ID SESSION_VALUE 1 GLOBAL_VALUE 1 GLOBAL_VALUE_ORIGIN CONFIG -DEFAULT_VALUE 0 +DEFAULT_VALUE 1 VARIABLE_SCOPE SESSION VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Uniquely identifies the server instance in the community of replication partners -NUMERIC_MIN_VALUE 0 +NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 4294967295 NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL @@ -4701,9 +4715,9 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME THREAD_STACK SESSION_VALUE NULL -GLOBAL_VALUE 296960 +GLOBAL_VALUE 297984 GLOBAL_VALUE_ORIGIN COMPILE-TIME -DEFAULT_VALUE 296960 +DEFAULT_VALUE 297984 VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The stack size for each thread diff --git a/mysql-test/suite/sys_vars/r/sysvars_wsrep,32bit.rdiff b/mysql-test/suite/sys_vars/r/sysvars_wsrep,32bit.rdiff index b93afb03c6f..016bd016f29 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_wsrep,32bit.rdiff +++ b/mysql-test/suite/sys_vars/r/sysvars_wsrep,32bit.rdiff @@ -1,6 +1,6 @@ --- suite/sys_vars/r/sysvars_wsrep.result 2014-10-10 13:33:55.000000000 +0300 +++ suite/sys_vars/r/sysvars_wsrep,32bit.reject 2014-10-10 19:38:09.000000000 +0300 -@@ -203,7 +203,7 @@ +@@ -245,7 +245,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 131072 VARIABLE_SCOPE GLOBAL @@ -9,7 +9,7 @@ VARIABLE_COMMENT Max number of rows in write set NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 1048576 -@@ -217,7 +217,7 @@ +@@ -259,7 +259,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1073741824 VARIABLE_SCOPE GLOBAL @@ -18,7 +18,7 @@ VARIABLE_COMMENT Max write set size (bytes) NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 4294901759 -@@ -231,7 +231,7 @@ +@@ -273,7 +273,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 0 VARIABLE_SCOPE GLOBAL @@ -27,7 +27,7 @@ VARIABLE_COMMENT mysql replication group commit NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 1000 -@@ -399,7 +399,7 @@ +@@ -455,7 +455,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1 VARIABLE_SCOPE SESSION @@ -36,7 +36,7 @@ VARIABLE_COMMENT Max number of times to retry a failed autocommit statement NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 10000 -@@ -427,7 +427,7 @@ +@@ -483,7 +483,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1 VARIABLE_SCOPE GLOBAL diff --git a/mysql-test/suite/sys_vars/r/sysvars_wsrep.result b/mysql-test/suite/sys_vars/r/sysvars_wsrep.result index 4d7b03690af..f1745a1ad34 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_wsrep.result +++ b/mysql-test/suite/sys_vars/r/sysvars_wsrep.result @@ -311,9 +311,9 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME WSREP_NODE_NAME SESSION_VALUE NULL -GLOBAL_VALUE +GLOBAL_VALUE HOSTNAME GLOBAL_VALUE_ORIGIN COMPILE-TIME -DEFAULT_VALUE +DEFAULT_VALUE HOSTNAME VARIABLE_SCOPE GLOBAL VARIABLE_TYPE VARCHAR VARIABLE_COMMENT Node name diff --git a/mysql-test/suite/sys_vars/r/thread_stack_basic.result b/mysql-test/suite/sys_vars/r/thread_stack_basic.result index 5984ffebdaf..4f916b89b55 100644 --- a/mysql-test/suite/sys_vars/r/thread_stack_basic.result +++ b/mysql-test/suite/sys_vars/r/thread_stack_basic.result @@ -1,20 +1,20 @@ select @@global.thread_stack; @@global.thread_stack -296960 +297984 select @@session.thread_stack; ERROR HY000: Variable 'thread_stack' is a GLOBAL variable show global variables like 'thread_stack'; Variable_name Value -thread_stack 296960 +thread_stack 297984 show session variables like 'thread_stack'; Variable_name Value -thread_stack 296960 +thread_stack 297984 select * from information_schema.global_variables where variable_name='thread_stack'; VARIABLE_NAME VARIABLE_VALUE -THREAD_STACK 296960 +THREAD_STACK 297984 select * from information_schema.session_variables where variable_name='thread_stack'; VARIABLE_NAME VARIABLE_VALUE -THREAD_STACK 296960 +THREAD_STACK 297984 set global thread_stack=1; ERROR HY000: Variable 'thread_stack' is a read only variable set session thread_stack=1; diff --git a/mysql-test/suite/sys_vars/r/wsrep_node_name_basic.result b/mysql-test/suite/sys_vars/r/wsrep_node_name_basic.result index 9657e6bf428..763d0612a1b 100644 --- a/mysql-test/suite/sys_vars/r/wsrep_node_name_basic.result +++ b/mysql-test/suite/sys_vars/r/wsrep_node_name_basic.result @@ -4,10 +4,10 @@ call mtr.add_suppression("WSREP: Failed to get provider options"); # save the initial value SET @wsrep_node_name_global_saved = @@global.wsrep_node_name; -# default -SELECT @@global.wsrep_node_name; -@@global.wsrep_node_name - +# default (expect 1) +SELECT COUNT(@@global.wsrep_node_name); +COUNT(@@global.wsrep_node_name) +1 # scope SELECT @@session.wsrep_node_name; @@ -27,21 +27,34 @@ SELECT @@global.wsrep_node_name; @@global.wsrep_node_name hyphenated-node-name SET @@global.wsrep_node_name=default; -SELECT @@global.wsrep_node_name; -@@global.wsrep_node_name - +# default (expect 1) +SELECT COUNT(@@global.wsrep_node_name); +COUNT(@@global.wsrep_node_name) +1 # invalid values SET @@global.wsrep_node_name=NULL; ERROR 42000: Variable 'wsrep_node_name' can't be set to the value of 'NULL' -SELECT @@global.wsrep_node_name; -@@global.wsrep_node_name - +SELECT COUNT(@@global.wsrep_node_name); +COUNT(@@global.wsrep_node_name) +1 SET @@global.wsrep_node_name=1; ERROR 42000: Incorrect argument type to variable 'wsrep_node_name' -SELECT @@global.wsrep_node_name; -@@global.wsrep_node_name - +SELECT COUNT(@@global.wsrep_node_name); +COUNT(@@global.wsrep_node_name) +1 +# +# MDEV-6699 : wsrep_node_name not automaticly set to hostname +# +SET @@global.wsrep_node_name=default; +SELECT @@GLOBAL.wsrep_node_name = VARIABLE_VALUE FROM +INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='hostname'; +@@GLOBAL.wsrep_node_name = VARIABLE_VALUE +1 +SELECT @@GLOBAL.wsrep_node_name = VARIABLE_VALUE FROM +INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='wsrep_node_name'; +@@GLOBAL.wsrep_node_name = VARIABLE_VALUE +1 # restore the initial value SET @@global.wsrep_node_name = @wsrep_node_name_global_saved; diff --git a/mysql-test/suite/sys_vars/r/wsrep_start_position_basic.result b/mysql-test/suite/sys_vars/r/wsrep_start_position_basic.result index a49e6135d47..fd6dc1b5a4d 100644 --- a/mysql-test/suite/sys_vars/r/wsrep_start_position_basic.result +++ b/mysql-test/suite/sys_vars/r/wsrep_start_position_basic.result @@ -17,10 +17,6 @@ SELECT @@global.wsrep_start_position; 00000000-0000-0000-0000-000000000000:-1 # valid values -SET @@global.wsrep_start_position='00000000-0000-0000-0000-000000000000:-2'; -SELECT @@global.wsrep_start_position; -@@global.wsrep_start_position -00000000-0000-0000-0000-000000000000:-2 SET @@global.wsrep_start_position='12345678-1234-1234-1234-123456789012:100'; SELECT @@global.wsrep_start_position; @@global.wsrep_start_position @@ -31,6 +27,12 @@ SELECT @@global.wsrep_start_position; 00000000-0000-0000-0000-000000000000:-1 # invalid values +call mtr.add_suppression("WSREP: SST position can't be set in past. Requested: -2, Current: -1."); +SET @@global.wsrep_start_position='00000000-0000-0000-0000-000000000000:-2'; +ERROR 42000: Variable 'wsrep_start_position' can't be set to the value of '00000000-0000-0000-0000-000000000000:-2' +SELECT @@global.wsrep_start_position; +@@global.wsrep_start_position +00000000-0000-0000-0000-000000000000:-1 SET @@global.wsrep_start_position='000000000000000-0000-0000-0000-000000000000:-1'; ERROR 42000: Variable 'wsrep_start_position' can't be set to the value of '000000000000000-0000-0000-0000-000000000000:-1' SET @@global.wsrep_start_position='12345678-1234-1234-12345-123456789012:100'; diff --git a/mysql-test/suite/sys_vars/t/div_precision_increment_basic.test b/mysql-test/suite/sys_vars/t/div_precision_increment_basic.test index 65edf6dd76f..97f0e0eab81 100644 --- a/mysql-test/suite/sys_vars/t/div_precision_increment_basic.test +++ b/mysql-test/suite/sys_vars/t/div_precision_increment_basic.test @@ -98,17 +98,17 @@ SELECT @@session.div_precision_increment; # Change the value of div_precision_increment to an invalid value # ################################################################### -SET @@global.div_precision_increment = 31; +SET @@global.div_precision_increment = 39; SELECT @@global.div_precision_increment; -SET @@global.div_precision_increment = 40; +SET @@global.div_precision_increment = 50; SELECT @@global.div_precision_increment; SET @@global.div_precision_increment = -1024; SELECT @@global.div_precision_increment; SET @@global.div_precision_increment = 65536; SELECT @@global.div_precision_increment; -SET @@session.div_precision_increment = 40; +SET @@session.div_precision_increment = 50; SELECT @@session.div_precision_increment; -SET @@session.div_precision_increment = 31; +SET @@session.div_precision_increment = 37; SELECT @@session.div_precision_increment; SET @@session.div_precision_increment = -2; SELECT @@session.div_precision_increment; diff --git a/mysql-test/suite/sys_vars/t/innodb_buffer_pool_load_now_basic.test b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_load_now_basic.test index 160b3ba52cc..a0409901865 100644 --- a/mysql-test/suite/sys_vars/t/innodb_buffer_pool_load_now_basic.test +++ b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_load_now_basic.test @@ -13,11 +13,19 @@ let $old_status= `SELECT variable_value FROM information_schema.global_status # A previous test could have run buffer pool dump already; # in this case we want to make sure that the current time is different -# from the timestamp in the status variable +# from the timestamp in the status variable. +# We should have had a smart wait condition here, like the commented one below, +# but we can't because of MDEV-9867, so there will be just sleep instead. +# And it might be not enough to sleep one second, so we'll have to sleep two. +# let $wait_condition = +# SELECT TRIM(SUBSTR('$old_status', -8)) != DATE_FORMAT(CURTIME(), '%k:%i:%s'); +# -- source include/wait_condition.inc -let $wait_condition = - SELECT TRIM(SUBSTR('$old_status', -8)) != DATE_FORMAT(CURTIME(), '%k:%i:%s'); --- source include/wait_condition.inc +if (`SELECT variable_value LIKE '%dump completed at%' FROM information_schema.global_status + WHERE LOWER(variable_name) = 'innodb_buffer_pool_dump_status'`) +{ + -- sleep 2 +} # Do the dump SET GLOBAL innodb_buffer_pool_dump_now = ON; diff --git a/mysql-test/suite/sys_vars/t/innodb_empty_free_list_algorithm_basic.opt b/mysql-test/suite/sys_vars/t/innodb_empty_free_list_algorithm_basic.opt new file mode 100644 index 00000000000..c788dc76ac7 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/innodb_empty_free_list_algorithm_basic.opt @@ -0,0 +1 @@ +--loose-innodb-buffer-pool-size=20M diff --git a/mysql-test/suite/sys_vars/t/server_id_basic.test b/mysql-test/suite/sys_vars/t/server_id_basic.test index 6940270c12e..c2dfa4c5f9d 100644 --- a/mysql-test/suite/sys_vars/t/server_id_basic.test +++ b/mysql-test/suite/sys_vars/t/server_id_basic.test @@ -54,7 +54,7 @@ SELECT @@global.server_id; ################################################################### SET @@global.server_id = DEFAULT; -SELECT @@global.server_id = 0; +SELECT @@global.server_id = 1; --echo '#--------------------FN_DYNVARS_144_03-------------------------#' ################################################################################## diff --git a/mysql-test/suite/sys_vars/t/sysvars_wsrep.test b/mysql-test/suite/sys_vars/t/sysvars_wsrep.test index 32af7d3a5ca..25454191e2e 100644 --- a/mysql-test/suite/sys_vars/t/sysvars_wsrep.test +++ b/mysql-test/suite/sys_vars/t/sysvars_wsrep.test @@ -1,8 +1,9 @@ --source include/have_wsrep.inc --source include/word_size.inc --let $datadir = `SELECT @@datadir` +--let $hostname = `SELECT @@hostname` ---replace_result $datadir DATADIR +--replace_result $datadir DATADIR $hostname HOSTNAME --vertical_results select * from information_schema.system_variables where variable_name like 'wsrep%' diff --git a/mysql-test/suite/sys_vars/t/wsrep_node_name_basic.test b/mysql-test/suite/sys_vars/t/wsrep_node_name_basic.test index 1f3ccc0de2c..7bc9bec8b95 100644 --- a/mysql-test/suite/sys_vars/t/wsrep_node_name_basic.test +++ b/mysql-test/suite/sys_vars/t/wsrep_node_name_basic.test @@ -9,8 +9,8 @@ call mtr.add_suppression("WSREP: Failed to get provider options"); --echo # save the initial value SET @wsrep_node_name_global_saved = @@global.wsrep_node_name; ---echo # default -SELECT @@global.wsrep_node_name; +--echo # default (expect 1) +SELECT COUNT(@@global.wsrep_node_name); --echo --echo # scope @@ -26,16 +26,26 @@ SELECT @@global.wsrep_node_name; SET @@global.wsrep_node_name='hyphenated-node-name'; SELECT @@global.wsrep_node_name; SET @@global.wsrep_node_name=default; -SELECT @@global.wsrep_node_name; +--echo # default (expect 1) +SELECT COUNT(@@global.wsrep_node_name); --echo --echo # invalid values --error ER_WRONG_VALUE_FOR_VAR SET @@global.wsrep_node_name=NULL; -SELECT @@global.wsrep_node_name; +SELECT COUNT(@@global.wsrep_node_name); --error ER_WRONG_TYPE_FOR_VAR SET @@global.wsrep_node_name=1; -SELECT @@global.wsrep_node_name; +SELECT COUNT(@@global.wsrep_node_name); + +--echo # +--echo # MDEV-6699 : wsrep_node_name not automaticly set to hostname +--echo # +SET @@global.wsrep_node_name=default; +SELECT @@GLOBAL.wsrep_node_name = VARIABLE_VALUE FROM +INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='hostname'; +SELECT @@GLOBAL.wsrep_node_name = VARIABLE_VALUE FROM +INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='wsrep_node_name'; --echo --echo # restore the initial value diff --git a/mysql-test/suite/sys_vars/t/wsrep_start_position_basic.test b/mysql-test/suite/sys_vars/t/wsrep_start_position_basic.test index 3e57cfa6da2..7f8eb138727 100644 --- a/mysql-test/suite/sys_vars/t/wsrep_start_position_basic.test +++ b/mysql-test/suite/sys_vars/t/wsrep_start_position_basic.test @@ -19,8 +19,6 @@ SELECT @@global.wsrep_start_position; --echo --echo # valid values -SET @@global.wsrep_start_position='00000000-0000-0000-0000-000000000000:-2'; -SELECT @@global.wsrep_start_position; SET @@global.wsrep_start_position='12345678-1234-1234-1234-123456789012:100'; SELECT @@global.wsrep_start_position; SET @@global.wsrep_start_position=default; @@ -28,6 +26,10 @@ SELECT @@global.wsrep_start_position; --echo --echo # invalid values +call mtr.add_suppression("WSREP: SST position can't be set in past. Requested: -2, Current: -1."); +--error ER_WRONG_VALUE_FOR_VAR +SET @@global.wsrep_start_position='00000000-0000-0000-0000-000000000000:-2'; +SELECT @@global.wsrep_start_position; --error ER_WRONG_VALUE_FOR_VAR SET @@global.wsrep_start_position='000000000000000-0000-0000-0000-000000000000:-1'; --error ER_WRONG_VALUE_FOR_VAR diff --git a/mysql-test/suite/vcol/inc/vcol_partition.inc b/mysql-test/suite/vcol/inc/vcol_partition.inc index c20dfaaa2a4..b2c0c90ff69 100644 --- a/mysql-test/suite/vcol/inc/vcol_partition.inc +++ b/mysql-test/suite/vcol/inc/vcol_partition.inc @@ -34,6 +34,7 @@ PARTITION BY RANGE( b ) ( insert into t1 values ('2006-01-01',default); insert into t1 values ('2007-01-01',default); insert into t1 values ('2005-01-01',default); +insert into t1 (a) values ('2007-01-02'); select * from t1; select partition_name,table_rows,data_length from information_schema.partitions where table_name = 't1'; diff --git a/mysql-test/suite/vcol/r/not_supported.result b/mysql-test/suite/vcol/r/not_supported.result index 251fdaad101..cecf5c27912 100644 --- a/mysql-test/suite/vcol/r/not_supported.result +++ b/mysql-test/suite/vcol/r/not_supported.result @@ -4,32 +4,22 @@ set time_zone='+10:00'; set div_precision_increment=20; create table t1 (a int, b int, v decimal(20,19) as (a/3)); create table t2 (a int, b int, v int as (a+@a)); -ERROR HY000: Function or expression is not allowed for column 'v' -create table t3 (a int, b int, v int as (a+@@error_count)); -ERROR HY000: Function or expression is not allowed for column 'v' +ERROR HY000: Function or expression '@a' cannot be used in the GENERATED ALWAYS AS clause of `v` +create table t2 (a int, b int, v int as (a+@a) PERSISTENT); +ERROR HY000: Function or expression '@a' cannot be used in the GENERATED ALWAYS AS clause of `v` +create table t3_ok (a int, b int, v int as (a+@@error_count)); +create table t3 (a int, b int, v int as (a+@@error_count) PERSISTENT); +ERROR HY000: Function or expression '@@error_count' cannot be used in the GENERATED ALWAYS AS clause of `v` create table t4 (a int, b int, v int as (@a:=a)); -ERROR HY000: Function or expression is not allowed for column 'v' -create table t5 (a int, b int, v varchar(100) as (monthname(a))); -create table t6 (a int, b int, v varchar(100) as (dayname(a))); -create table t7 (a int, b int, v varchar(100) as (date_format(a, '%W %a %M %b'))); +ERROR HY000: Function or expression '@a' cannot be used in the GENERATED ALWAYS AS clause of `v` +create table t4 (a int, b int, v int as (@a:=a) PERSISTENT); +ERROR HY000: Function or expression '@a' cannot be used in the GENERATED ALWAYS AS clause of `v` create table t8 (a int, b int, v varchar(100) as (from_unixtime(a))); insert t1 (a,b) values (1,2); -insert t5 (a,b) values (20141010,2); -insert t6 (a,b) values (20141010,2); -insert t7 (a,b) values (20141010,2); insert t8 (a,b) values (1234567890,2); select * from t1; a b v 1 2 0.3333333333333333333 -select * from t5; -a b v -20141010 2 octubre -select * from t6; -a b v -20141010 2 viernes -select * from t7; -a b v -20141010 2 viernes vie octubre oct select * from t8; a b v 1234567890 2 2009-02-14 09:31:30 @@ -39,15 +29,6 @@ set time_zone='+1:00'; select * from t1; a b v 1 2 0.3333333333333333333 -select * from t5; -a b v -20141010 2 octubre -select * from t6; -a b v -20141010 2 viernes -select * from t7; -a b v -20141010 2 viernes vie octubre oct select * from t8; a b v 1234567890 2 2009-02-14 09:31:30 @@ -55,16 +36,7 @@ flush tables; select * from t1; a b v 1 2 0.3333333330000000000 -select * from t5; -a b v -20141010 2 October -select * from t6; -a b v -20141010 2 Friday -select * from t7; -a b v -20141010 2 Friday Fri October Oct select * from t8; a b v 1234567890 2 2009-02-14 00:31:30 -drop table t1, t5, t6, t7, t8; +drop table t1, t3_ok, t8; diff --git a/mysql-test/suite/vcol/r/vcol_blocked_sql_funcs.result b/mysql-test/suite/vcol/r/vcol_blocked_sql_funcs.result new file mode 100644 index 00000000000..0e03d80014d --- /dev/null +++ b/mysql-test/suite/vcol/r/vcol_blocked_sql_funcs.result @@ -0,0 +1,249 @@ +SET @@session.storage_engine = 'MyISAM'; +# RAND() +create or replace table t1 (b double as (rand())); +create or replace table t1 (b double as (rand()) PERSISTENT); +ERROR HY000: Function or expression 'rand()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# LOAD_FILE() +create or replace table t1 (a varchar(64), b varchar(1024) as (load_file(a))); +ERROR HY000: Function or expression 'load_file()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# CURDATE() +create or replace table t1 (a datetime as (curdate()) PERSISTENT); +ERROR HY000: Function or expression 'curdate()' cannot be used in the GENERATED ALWAYS AS clause of `a` +# CURRENT_DATE(), CURRENT_DATE +create or replace table t1 (a datetime as (current_date) PERSISTENT); +ERROR HY000: Function or expression 'curdate()' cannot be used in the GENERATED ALWAYS AS clause of `a` +create or replace table t1 (a datetime as (current_date()) PERSISTENT); +ERROR HY000: Function or expression 'curdate()' cannot be used in the GENERATED ALWAYS AS clause of `a` +# CURRENT_TIME(), CURRENT_TIME +create or replace table t1 (a datetime as (current_time) PERSISTENT); +ERROR HY000: Function or expression 'curtime()' cannot be used in the GENERATED ALWAYS AS clause of `a` +create or replace table t1 (a datetime as (current_time()) PERSISTENT); +ERROR HY000: Function or expression 'curtime()' cannot be used in the GENERATED ALWAYS AS clause of `a` +# CURRENT_TIMESTAMP(), CURRENT_TIMESTAMP +create or replace table t1 (a datetime as (current_timestamp()) PERSISTENT); +ERROR HY000: Function or expression 'now()' cannot be used in the GENERATED ALWAYS AS clause of `a` +create or replace table t1 (a datetime as (current_timestamp) PERSISTENT); +ERROR HY000: Function or expression 'now()' cannot be used in the GENERATED ALWAYS AS clause of `a` +# CURTIME() +create or replace table t1 (a datetime as (curtime()) PERSISTENT); +ERROR HY000: Function or expression 'curtime()' cannot be used in the GENERATED ALWAYS AS clause of `a` +# LOCALTIME(), LOCALTIME +create or replace table t1 (a datetime, b varchar(10) as (localtime()) PERSISTENT); +ERROR HY000: Function or expression 'now()' cannot be used in the GENERATED ALWAYS AS clause of `b` +create or replace table t1 (a datetime, b varchar(10) as (localtime) PERSISTENT); +ERROR HY000: Function or expression 'now()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# LOCALTIMESTAMP, LOCALTIMESTAMP()(v4.0.6) +create or replace table t1 (a datetime, b varchar(10) as (localtimestamp()) PERSISTENT); +ERROR HY000: Function or expression 'now()' cannot be used in the GENERATED ALWAYS AS clause of `b` +create or replace table t1 (a datetime, b varchar(10) as (localtimestamp) PERSISTENT); +ERROR HY000: Function or expression 'now()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# NOW() +create or replace table t1 (a datetime, b varchar(10) as (now()) PERSISTENT); +ERROR HY000: Function or expression 'now()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# SYSDATE() +create or replace table t1 (a int, b varchar(10) as (sysdate()) PERSISTENT); +ERROR HY000: Function or expression 'sysdate()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# UNIX_TIMESTAMP() +create or replace table t1 (a datetime, b datetime as (unix_timestamp()) PERSISTENT); +ERROR HY000: Function or expression 'unix_timestamp()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# UTC_DATE() +create or replace table t1 (a datetime, b datetime as (utc_date()) PERSISTENT); +ERROR HY000: Function or expression 'utc_date()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# UTC_TIME() +create or replace table t1 (a datetime, b datetime as (utc_time()) PERSISTENT); +ERROR HY000: Function or expression 'utc_time()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# UTC_TIMESTAMP() +create or replace table t1 (a datetime, b datetime as (utc_timestamp()) PERSISTENT); +ERROR HY000: Function or expression 'utc_timestamp()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# WEEK() - one argument version +create or replace table t1 (a datetime, b datetime as (week(a)) PERSISTENT); +ERROR HY000: Function or expression '@@default_week_format' cannot be used in the GENERATED ALWAYS AS clause of `b` +# MATCH() +create or replace table t1 (a varchar(32), b bool as (match a against ('sample text')) PERSISTENT); +ERROR HY000: Function or expression 'match ... against()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# BENCHMARK() +create or replace table t1 (a varchar(1024), b varchar(1024) as (benchmark(a,3))); +ERROR HY000: Function or expression 'benchmark()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# CHARSET() +create or replace table t1 (a varchar(64), b varchar(64) as (charset(a)) PERSISTENT); +# COERCIBILITY() +create or replace table t1 (a varchar(64), b int as (coercibility(a)) PERSISTENT); +# COLLATION() +create or replace table t1 (a varchar(64), b varchar(64) as (collation(a)) PERSISTENT); +# CONNECTION_ID() +create or replace table t1 (a int as (connection_id())); +create or replace table t1 (a int as (connection_id()) PERSISTENT); +ERROR HY000: Function or expression 'connection_id()' cannot be used in the GENERATED ALWAYS AS clause of `a` +# DATABASE() +create or replace table t1 (a varchar(32) as (database())); +create or replace table t1 (a varchar(1024), b varchar(1024) as (database()) PERSISTENT); +ERROR HY000: Function or expression 'database()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# FOUND_ROWS() +create or replace table t1 (a varchar(1024), b varchar(1024) as (found_rows())); +ERROR HY000: Function or expression 'found_rows()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# GET_LOCK() +create or replace table t1 (a varchar(1024), b varchar(1024) as (get_lock(a,10))); +ERROR HY000: Function or expression 'get_lock()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# IS_FREE_LOCK() +create or replace table t1 (a varchar(1024), b varchar(1024) as (is_free_lock(a))); +ERROR HY000: Function or expression 'is_free_lock()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# IS_USED_LOCK() +create or replace table t1 (a varchar(1024), b varchar(1024) as (is_used_lock(a))); +ERROR HY000: Function or expression 'is_used_lock()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# LAST_INSERT_ID() +create or replace table t1 (a int as (last_insert_id())); +ERROR HY000: Function or expression 'last_insert_id()' cannot be used in the GENERATED ALWAYS AS clause of `a` +# MASTER_POS_WAIT() +create or replace table t1 (a varchar(32), b int as (master_pos_wait(a,0,2))); +ERROR HY000: Function or expression 'master_pos_wait()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# NAME_CONST() +create or replace table t1 (a varchar(32) as (name_const('test',1))); +ERROR HY000: Function or expression 'name_const()' cannot be used in the GENERATED ALWAYS AS clause of `a` +# RELEASE_LOCK() +create or replace table t1 (a varchar(32), b int as (release_lock(a))); +ERROR HY000: Function or expression 'release_lock()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# ROW_COUNT() +create or replace table t1 (a int as (row_count())); +ERROR HY000: Function or expression 'row_count()' cannot be used in the GENERATED ALWAYS AS clause of `a` +# SCHEMA() +create or replace table t1 (a varchar(32) as (schema()) PERSISTENT); +ERROR HY000: Function or expression 'database()' cannot be used in the GENERATED ALWAYS AS clause of `a` +# SESSION_USER() +create or replace table t1 (a varchar(32) as (session_user()) PERSISTENT); +ERROR HY000: Function or expression 'user()' cannot be used in the GENERATED ALWAYS AS clause of `a` +# SLEEP() +create or replace table t1 (a int, b int as (sleep(a))); +ERROR HY000: Function or expression 'sleep()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# SYSTEM_USER() +create or replace table t1 (a varchar(32) as (system_user()) PERSISTENT); +ERROR HY000: Function or expression 'user()' cannot be used in the GENERATED ALWAYS AS clause of `a` +# USER() +create or replace table t1 (a varchar(1024), b varchar(1024) as (user()) PERSISTENT); +ERROR HY000: Function or expression 'user()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# UUID_SHORT() +create or replace table t1 (a varchar(1024) as (uuid_short()) PERSISTENT); +ERROR HY000: Function or expression 'uuid_short()' cannot be used in the GENERATED ALWAYS AS clause of `a` +# UUID() +create or replace table t1 (a varchar(1024) as (uuid()) PERSISTENT); +ERROR HY000: Function or expression 'uuid()' cannot be used in the GENERATED ALWAYS AS clause of `a` +# VALUES() +create or replace table t1 (a varchar(1024), b varchar(1024) as (values(a))); +ERROR HY000: Function or expression 'values()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# VERSION() +create or replace table t1 (a varchar(1024), b varchar(1024) as (version()) PERSISTENT); +ERROR HY000: Function or expression 'version()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# ENCRYPT() +create or replace table t1 (a varchar(1024), b varchar(1024) as (encrypt(a)) PERSISTENT); +# Stored procedures +create procedure p1() +begin +select current_user(); +end // +create function f1() +returns int +begin +return 1; +end // +create or replace table t1 (a int as (p1()) PERSISTENT); +ERROR HY000: Function or expression '`p1`()' cannot be used in the GENERATED ALWAYS AS clause of `a` +create or replace table t1 (a int as (f1()) PERSISTENT); +ERROR HY000: Function or expression '`f1`()' cannot be used in the GENERATED ALWAYS AS clause of `a` +drop procedure p1; +drop function f1; +# Unknown functions +create or replace table t1 (a int as (f1()) PERSISTENT); +ERROR HY000: Function or expression '`f1`()' cannot be used in the GENERATED ALWAYS AS clause of `a` +# +# GROUP BY FUNCTIONS +# +# AVG() +create or replace table t1 (a int, b int as (avg(a))); +ERROR HY000: Function or expression 'avg()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# BIT_AND() +create or replace table t1 (a int, b int as (bit_and(a))); +ERROR HY000: Function or expression 'bit_and()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# BIT_OR() +create or replace table t1 (a int, b int as (bit_or(a))); +ERROR HY000: Function or expression 'bit_or()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# BIT_XOR() +create or replace table t1 (a int, b int as (bit_xor(a))); +ERROR HY000: Function or expression 'bit_xor()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# COUNT(DISTINCT) +create or replace table t1 (a int, b int as (count(distinct a))); +ERROR HY000: Function or expression 'count(distinct )' cannot be used in the GENERATED ALWAYS AS clause of `b` +# COUNT() +create or replace table t1 (a int, b int as (count(a))); +ERROR HY000: Function or expression 'count()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# GROUP_CONCAT() +create or replace table t1 (a varchar(32), b int as (group_concat(a,''))); +ERROR HY000: Function or expression 'group_concat()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# MAX() +create or replace table t1 (a int, b int as (max(a))); +ERROR HY000: Function or expression 'max()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# MIN() +create or replace table t1 (a int, b int as (min(a))); +ERROR HY000: Function or expression 'min()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# STD() +create or replace table t1 (a int, b int as (std(a))); +ERROR HY000: Function or expression 'std()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# STDDEV_POP() +create or replace table t1 (a int, b int as (stddev_pop(a))); +ERROR HY000: Function or expression 'std()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# STDDEV_SAMP() +create or replace table t1 (a int, b int as (stddev_samp(a))); +ERROR HY000: Function or expression 'std()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# STDDEV() +create or replace table t1 (a int, b int as (stddev(a))); +ERROR HY000: Function or expression 'std()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# SUM() +create or replace table t1 (a int, b int as (sum(a))); +ERROR HY000: Function or expression 'sum()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# VAR_POP() +create or replace table t1 (a int, b int as (var_pop(a))); +ERROR HY000: Function or expression 'variance()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# VAR_SAMP() +create or replace table t1 (a int, b int as (var_samp(a))); +ERROR HY000: Function or expression 'var_samp()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# VARIANCE() +create or replace table t1 (a int, b int as (variance(a))); +ERROR HY000: Function or expression 'variance()' cannot be used in the GENERATED ALWAYS AS clause of `b` +# +# XML FUNCTIONS +# +# ExtractValue() +create or replace table t1 (a varchar(1024), b varchar(1024) as (ExtractValue(a,'//b[$@j]')) PERSISTENT); +# UpdateXML() +create or replace table t1 (a varchar(1024), b varchar(1024) as (UpdateXML(a,'/a','fff')) PERSISTENT); +# +# Sub-selects +# +create or replace table t1 (a int); +create or replace table t2 (a int, b int as (select count(*) from t1)); +ERROR HY000: Function or expression 'select ...' cannot be used in the GENERATED ALWAYS AS clause of `b` +drop table t1; +create or replace table t1 (a int, b int as ((select 1))); +ERROR HY000: Function or expression 'select ...' cannot be used in the GENERATED ALWAYS AS clause of `b` +create or replace table t1 (a int, b int as (a+(select 1))); +ERROR HY000: Function or expression 'select ...' cannot be used in the GENERATED ALWAYS AS clause of `b` +# +# SP functions +# +drop function if exists sub1; +create function sub1(i int) returns int deterministic +return i+1; +select sub1(1); +sub1(1) +2 +create or replace table t1 (a int, b int as (a+sub3(1))); +ERROR HY000: Function or expression '`sub3`()' cannot be used in the GENERATED ALWAYS AS clause of `b` +drop function sub1; +# +# Long expression +create or replace table t1 (a int, b varchar(300) as (concat(a,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'))); +drop table t1; +create or replace table t1 (a int, b varchar(16384) as (concat(a,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'))); +ERROR HY000: Table definition is too large +# +# Constant expression +create or replace table t1 (a int as (PI()) PERSISTENT); +drop table if exists t1; diff --git a/mysql-test/suite/vcol/r/vcol_blocked_sql_funcs_innodb.result b/mysql-test/suite/vcol/r/vcol_blocked_sql_funcs_innodb.result deleted file mode 100644 index 7f805459264..00000000000 --- a/mysql-test/suite/vcol/r/vcol_blocked_sql_funcs_innodb.result +++ /dev/null @@ -1,255 +0,0 @@ -SET @@session.storage_engine = 'InnoDB'; -# RAND() -create table t1 (b double as (rand())); -ERROR HY000: Function or expression is not allowed for column 'b' -# LOAD_FILE() -create table t1 (a varchar(64), b varchar(1024) as (load_file(a))); -ERROR HY000: Function or expression is not allowed for column 'b' -# CURDATE() -create table t1 (a datetime as (curdate())); -ERROR HY000: Function or expression is not allowed for column 'a' -# CURRENT_DATE(), CURRENT_DATE -create table t1 (a datetime as (current_date)); -ERROR HY000: Function or expression is not allowed for column 'a' -create table t1 (a datetime as (current_date())); -ERROR HY000: Function or expression is not allowed for column 'a' -# CURRENT_TIME(), CURRENT_TIME -create table t1 (a datetime as (current_time)); -ERROR HY000: Function or expression is not allowed for column 'a' -create table t1 (a datetime as (current_time())); -ERROR HY000: Function or expression is not allowed for column 'a' -# CURRENT_TIMESTAMP(), CURRENT_TIMESTAMP -create table t1 (a datetime as (current_timestamp())); -ERROR HY000: Function or expression is not allowed for column 'a' -create table t1 (a datetime as (current_timestamp)); -ERROR HY000: Function or expression is not allowed for column 'a' -# CURTIME() -create table t1 (a datetime as (curtime())); -ERROR HY000: Function or expression is not allowed for column 'a' -# LOCALTIME(), LOCALTIME -create table t1 (a datetime, b varchar(10) as (localtime())); -ERROR HY000: Function or expression is not allowed for column 'b' -create table t1 (a datetime, b varchar(10) as (localtime)); -ERROR HY000: Function or expression is not allowed for column 'b' -# LOCALTIMESTAMP, LOCALTIMESTAMP()(v4.0.6) -create table t1 (a datetime, b varchar(10) as (localtimestamp())); -ERROR HY000: Function or expression is not allowed for column 'b' -create table t1 (a datetime, b varchar(10) as (localtimestamp)); -ERROR HY000: Function or expression is not allowed for column 'b' -# NOW() -create table t1 (a datetime, b varchar(10) as (now())); -ERROR HY000: Function or expression is not allowed for column 'b' -# SYSDATE() -create table t1 (a int, b varchar(10) as (sysdate())); -ERROR HY000: Function or expression is not allowed for column 'b' -# UNIX_TIMESTAMP() -create table t1 (a datetime, b datetime as (unix_timestamp())); -ERROR HY000: Function or expression is not allowed for column 'b' -# UTC_DATE() -create table t1 (a datetime, b datetime as (utc_date())); -ERROR HY000: Function or expression is not allowed for column 'b' -# UTC_TIME() -create table t1 (a datetime, b datetime as (utc_time())); -ERROR HY000: Function or expression is not allowed for column 'b' -# UTC_TIMESTAMP() -create table t1 (a datetime, b datetime as (utc_timestamp())); -ERROR HY000: Function or expression is not allowed for column 'b' -# WEEK() - one argument version -create table t1 (a datetime, b datetime as (week(a))); -ERROR HY000: Function or expression is not allowed for column 'b' -# MATCH() -# BENCHMARK() -create table t1 (a varchar(1024), b varchar(1024) as (benchmark(a,3))); -ERROR HY000: Function or expression is not allowed for column 'b' -# CHARSET() -create table t1 (a varchar(64), b varchar(64) as (charset(a))); -ERROR HY000: Constant expression in computed column function is not allowed -# COERCIBILITY() -create table t1 (a varchar(64), b int as (coercibility(a))); -ERROR HY000: Constant expression in computed column function is not allowed -# COLLATION() -create table t1 (a varchar(64), b varchar(64) as (collation(a))); -ERROR HY000: Constant expression in computed column function is not allowed -# CONNECTION_ID() -create table t1 (a int as (connection_id())); -ERROR HY000: Function or expression is not allowed for column 'a' -# CURRENT_USER(), CURRENT_USER -create table t1 (a varchar(32) as (current_user())); -ERROR HY000: Function or expression is not allowed for column 'a' -create table t1 (a varchar(32) as (current_user)); -ERROR HY000: Function or expression is not allowed for column 'a' -# DATABASE() -create table t1 (a varchar(1024), b varchar(1024) as (database())); -ERROR HY000: Function or expression is not allowed for column 'b' -# FOUND_ROWS() -create table t1 (a varchar(1024), b varchar(1024) as (found_rows())); -ERROR HY000: Function or expression is not allowed for column 'b' -# GET_LOCK() -create table t1 (a varchar(1024), b varchar(1024) as (get_lock(a,10))); -ERROR HY000: Function or expression is not allowed for column 'b' -# IS_FREE_LOCK() -create table t1 (a varchar(1024), b varchar(1024) as (is_free_lock(a))); -ERROR HY000: Function or expression is not allowed for column 'b' -# IS_USED_LOCK() -create table t1 (a varchar(1024), b varchar(1024) as (is_used_lock(a))); -ERROR HY000: Function or expression is not allowed for column 'b' -# LAST_INSERT_ID() -create table t1 (a int as (last_insert_id())); -ERROR HY000: Function or expression is not allowed for column 'a' -# MASTER_POS_WAIT() -create table t1 (a varchar(32), b int as (master_pos_wait(a,0,2))); -ERROR HY000: Function or expression is not allowed for column 'b' -# NAME_CONST() -create table t1 (a varchar(32) as (name_const('test',1))); -ERROR HY000: Function or expression is not allowed for column 'a' -# RELEASE_LOCK() -create table t1 (a varchar(32), b int as (release_lock(a))); -ERROR HY000: Function or expression is not allowed for column 'b' -# ROW_COUNT() -create table t1 (a int as (row_count())); -ERROR HY000: Function or expression is not allowed for column 'a' -# SCHEMA() -create table t1 (a varchar(32) as (schema())); -ERROR HY000: Function or expression is not allowed for column 'a' -# SESSION_USER() -create table t1 (a varchar(32) as (session_user())); -ERROR HY000: Function or expression is not allowed for column 'a' -# SLEEP() -create table t1 (a int, b int as (sleep(a))); -ERROR HY000: Function or expression is not allowed for column 'b' -# SYSTEM_USER() -create table t1 (a varchar(32) as (system_user())); -ERROR HY000: Function or expression is not allowed for column 'a' -# USER() -create table t1 (a varchar(1024), b varchar(1024) as (user())); -ERROR HY000: Function or expression is not allowed for column 'b' -# UUID_SHORT() -create table t1 (a varchar(1024) as (uuid_short())); -ERROR HY000: Function or expression is not allowed for column 'a' -# UUID() -create table t1 (a varchar(1024) as (uuid())); -ERROR HY000: Function or expression is not allowed for column 'a' -# VALUES() -create table t1 (a varchar(1024), b varchar(1024) as (values(a))); -ERROR HY000: Function or expression is not allowed for column 'b' -# VERSION() -create table t1 (a varchar(1024), b varchar(1024) as (version())); -ERROR HY000: Function or expression is not allowed for column 'b' -# ENCRYPT() -create table t1 (a varchar(1024), b varchar(1024) as (encrypt(a))); -ERROR HY000: Function or expression is not allowed for column 'b' -# Stored procedures -create procedure p1() -begin -select current_user(); -end // -create function f1() -returns int -begin -return 1; -end // -create table t1 (a int as (p1())); -ERROR HY000: Function or expression is not allowed for column 'a' -create table t1 (a int as (f1())); -ERROR HY000: Function or expression is not allowed for column 'a' -drop procedure p1; -drop function f1; -# Unknown functions -create table t1 (a int as (f1())); -ERROR HY000: Function or expression is not allowed for column 'a' -# -# GROUP BY FUNCTIONS -# -# AVG() -create table t1 (a int, b int as (avg(a))); -ERROR HY000: Function or expression is not allowed for column 'b' -# BIT_AND() -create table t1 (a int, b int as (bit_and(a))); -ERROR HY000: Function or expression is not allowed for column 'b' -# BIT_OR() -create table t1 (a int, b int as (bit_or(a))); -ERROR HY000: Function or expression is not allowed for column 'b' -# BIT_XOR() -create table t1 (a int, b int as (bit_xor(a))); -ERROR HY000: Function or expression is not allowed for column 'b' -# COUNT(DISTINCT) -create table t1 (a int, b int as (count(distinct a))); -ERROR HY000: Function or expression is not allowed for column 'b' -# COUNT() -create table t1 (a int, b int as (count(a))); -ERROR HY000: Function or expression is not allowed for column 'b' -# GROUP_CONCAT() -create table t1 (a varchar(32), b int as (group_concat(a,''))); -ERROR HY000: Function or expression is not allowed for column 'b' -# MAX() -create table t1 (a int, b int as (max(a))); -ERROR HY000: Function or expression is not allowed for column 'b' -# MIN() -create table t1 (a int, b int as (min(a))); -ERROR HY000: Function or expression is not allowed for column 'b' -# STD() -create table t1 (a int, b int as (std(a))); -ERROR HY000: Function or expression is not allowed for column 'b' -# STDDEV_POP() -create table t1 (a int, b int as (stddev_pop(a))); -ERROR HY000: Function or expression is not allowed for column 'b' -# STDDEV_SAMP() -create table t1 (a int, b int as (stddev_samp(a))); -ERROR HY000: Function or expression is not allowed for column 'b' -# STDDEV() -create table t1 (a int, b int as (stddev(a))); -ERROR HY000: Function or expression is not allowed for column 'b' -# SUM() -create table t1 (a int, b int as (sum(a))); -ERROR HY000: Function or expression is not allowed for column 'b' -# VAR_POP() -create table t1 (a int, b int as (var_pop(a))); -ERROR HY000: Function or expression is not allowed for column 'b' -# VAR_SAMP() -create table t1 (a int, b int as (var_samp(a))); -ERROR HY000: Function or expression is not allowed for column 'b' -# VARIANCE() -create table t1 (a int, b int as (variance(a))); -ERROR HY000: Function or expression is not allowed for column 'b' -# -# XML FUNCTIONS -# -# ExtractValue() -create table t1 (a varchar(1024), b varchar(1024) as (ExtractValue(a,'//b[$@j]'))); -ERROR HY000: Function or expression is not allowed for column 'b' -# UpdateXML() -create table t1 (a varchar(1024), b varchar(1024) as (UpdateXML(a,'/a','fff'))); -ERROR HY000: Function or expression is not allowed for column 'b' -# -# Sub-selects -# -create table t1 (a int); -create table t2 (a int, b int as (select count(*) from t1)); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'select count(*) from t1))' at line 1 -drop table t1; -create table t1 (a int, b int as ((select 1))); -ERROR HY000: Function or expression is not allowed for column 'b' -create table t1 (a int, b int as (a+(select 1))); -ERROR HY000: Function or expression is not allowed for column 'b' -# -# SP functions -# -drop function if exists sub1; -create function sub1(i int) returns int deterministic -return i+1; -select sub1(1); -sub1(1) -2 -create table t1 (a int, b int as (a+sub3(1))); -ERROR HY000: Function or expression is not allowed for column 'b' -drop function sub1; -# -# Long expression -create table t1 (a int, b varchar(300) as (concat(a,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'))); -drop table t1; -create table t1 (a int, b varchar(300) as (concat(a,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'))); -ERROR HY000: String 'concat(a,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' is too long for VIRTUAL COLUMN EXPRESSION (should be no longer than 252) -# -# Constant expression -create table t1 (a int as (PI())); -ERROR HY000: Constant expression in computed column function is not allowed diff --git a/mysql-test/suite/vcol/r/vcol_blocked_sql_funcs_myisam.result b/mysql-test/suite/vcol/r/vcol_blocked_sql_funcs_myisam.result deleted file mode 100644 index 1e1e6d6466e..00000000000 --- a/mysql-test/suite/vcol/r/vcol_blocked_sql_funcs_myisam.result +++ /dev/null @@ -1,257 +0,0 @@ -SET @@session.storage_engine = 'MyISAM'; -# RAND() -create table t1 (b double as (rand())); -ERROR HY000: Function or expression is not allowed for column 'b' -# LOAD_FILE() -create table t1 (a varchar(64), b varchar(1024) as (load_file(a))); -ERROR HY000: Function or expression is not allowed for column 'b' -# CURDATE() -create table t1 (a datetime as (curdate())); -ERROR HY000: Function or expression is not allowed for column 'a' -# CURRENT_DATE(), CURRENT_DATE -create table t1 (a datetime as (current_date)); -ERROR HY000: Function or expression is not allowed for column 'a' -create table t1 (a datetime as (current_date())); -ERROR HY000: Function or expression is not allowed for column 'a' -# CURRENT_TIME(), CURRENT_TIME -create table t1 (a datetime as (current_time)); -ERROR HY000: Function or expression is not allowed for column 'a' -create table t1 (a datetime as (current_time())); -ERROR HY000: Function or expression is not allowed for column 'a' -# CURRENT_TIMESTAMP(), CURRENT_TIMESTAMP -create table t1 (a datetime as (current_timestamp())); -ERROR HY000: Function or expression is not allowed for column 'a' -create table t1 (a datetime as (current_timestamp)); -ERROR HY000: Function or expression is not allowed for column 'a' -# CURTIME() -create table t1 (a datetime as (curtime())); -ERROR HY000: Function or expression is not allowed for column 'a' -# LOCALTIME(), LOCALTIME -create table t1 (a datetime, b varchar(10) as (localtime())); -ERROR HY000: Function or expression is not allowed for column 'b' -create table t1 (a datetime, b varchar(10) as (localtime)); -ERROR HY000: Function or expression is not allowed for column 'b' -# LOCALTIMESTAMP, LOCALTIMESTAMP()(v4.0.6) -create table t1 (a datetime, b varchar(10) as (localtimestamp())); -ERROR HY000: Function or expression is not allowed for column 'b' -create table t1 (a datetime, b varchar(10) as (localtimestamp)); -ERROR HY000: Function or expression is not allowed for column 'b' -# NOW() -create table t1 (a datetime, b varchar(10) as (now())); -ERROR HY000: Function or expression is not allowed for column 'b' -# SYSDATE() -create table t1 (a int, b varchar(10) as (sysdate())); -ERROR HY000: Function or expression is not allowed for column 'b' -# UNIX_TIMESTAMP() -create table t1 (a datetime, b datetime as (unix_timestamp())); -ERROR HY000: Function or expression is not allowed for column 'b' -# UTC_DATE() -create table t1 (a datetime, b datetime as (utc_date())); -ERROR HY000: Function or expression is not allowed for column 'b' -# UTC_TIME() -create table t1 (a datetime, b datetime as (utc_time())); -ERROR HY000: Function or expression is not allowed for column 'b' -# UTC_TIMESTAMP() -create table t1 (a datetime, b datetime as (utc_timestamp())); -ERROR HY000: Function or expression is not allowed for column 'b' -# WEEK() - one argument version -create table t1 (a datetime, b datetime as (week(a))); -ERROR HY000: Function or expression is not allowed for column 'b' -# MATCH() -create table t1 (a varchar(32), b bool as (match a against ('sample text'))); -ERROR HY000: Function or expression is not allowed for column 'b' -# BENCHMARK() -create table t1 (a varchar(1024), b varchar(1024) as (benchmark(a,3))); -ERROR HY000: Function or expression is not allowed for column 'b' -# CHARSET() -create table t1 (a varchar(64), b varchar(64) as (charset(a))); -ERROR HY000: Constant expression in computed column function is not allowed -# COERCIBILITY() -create table t1 (a varchar(64), b int as (coercibility(a))); -ERROR HY000: Constant expression in computed column function is not allowed -# COLLATION() -create table t1 (a varchar(64), b varchar(64) as (collation(a))); -ERROR HY000: Constant expression in computed column function is not allowed -# CONNECTION_ID() -create table t1 (a int as (connection_id())); -ERROR HY000: Function or expression is not allowed for column 'a' -# CURRENT_USER(), CURRENT_USER -create table t1 (a varchar(32) as (current_user())); -ERROR HY000: Function or expression is not allowed for column 'a' -create table t1 (a varchar(32) as (current_user)); -ERROR HY000: Function or expression is not allowed for column 'a' -# DATABASE() -create table t1 (a varchar(1024), b varchar(1024) as (database())); -ERROR HY000: Function or expression is not allowed for column 'b' -# FOUND_ROWS() -create table t1 (a varchar(1024), b varchar(1024) as (found_rows())); -ERROR HY000: Function or expression is not allowed for column 'b' -# GET_LOCK() -create table t1 (a varchar(1024), b varchar(1024) as (get_lock(a,10))); -ERROR HY000: Function or expression is not allowed for column 'b' -# IS_FREE_LOCK() -create table t1 (a varchar(1024), b varchar(1024) as (is_free_lock(a))); -ERROR HY000: Function or expression is not allowed for column 'b' -# IS_USED_LOCK() -create table t1 (a varchar(1024), b varchar(1024) as (is_used_lock(a))); -ERROR HY000: Function or expression is not allowed for column 'b' -# LAST_INSERT_ID() -create table t1 (a int as (last_insert_id())); -ERROR HY000: Function or expression is not allowed for column 'a' -# MASTER_POS_WAIT() -create table t1 (a varchar(32), b int as (master_pos_wait(a,0,2))); -ERROR HY000: Function or expression is not allowed for column 'b' -# NAME_CONST() -create table t1 (a varchar(32) as (name_const('test',1))); -ERROR HY000: Function or expression is not allowed for column 'a' -# RELEASE_LOCK() -create table t1 (a varchar(32), b int as (release_lock(a))); -ERROR HY000: Function or expression is not allowed for column 'b' -# ROW_COUNT() -create table t1 (a int as (row_count())); -ERROR HY000: Function or expression is not allowed for column 'a' -# SCHEMA() -create table t1 (a varchar(32) as (schema())); -ERROR HY000: Function or expression is not allowed for column 'a' -# SESSION_USER() -create table t1 (a varchar(32) as (session_user())); -ERROR HY000: Function or expression is not allowed for column 'a' -# SLEEP() -create table t1 (a int, b int as (sleep(a))); -ERROR HY000: Function or expression is not allowed for column 'b' -# SYSTEM_USER() -create table t1 (a varchar(32) as (system_user())); -ERROR HY000: Function or expression is not allowed for column 'a' -# USER() -create table t1 (a varchar(1024), b varchar(1024) as (user())); -ERROR HY000: Function or expression is not allowed for column 'b' -# UUID_SHORT() -create table t1 (a varchar(1024) as (uuid_short())); -ERROR HY000: Function or expression is not allowed for column 'a' -# UUID() -create table t1 (a varchar(1024) as (uuid())); -ERROR HY000: Function or expression is not allowed for column 'a' -# VALUES() -create table t1 (a varchar(1024), b varchar(1024) as (values(a))); -ERROR HY000: Function or expression is not allowed for column 'b' -# VERSION() -create table t1 (a varchar(1024), b varchar(1024) as (version())); -ERROR HY000: Function or expression is not allowed for column 'b' -# ENCRYPT() -create table t1 (a varchar(1024), b varchar(1024) as (encrypt(a))); -ERROR HY000: Function or expression is not allowed for column 'b' -# Stored procedures -create procedure p1() -begin -select current_user(); -end // -create function f1() -returns int -begin -return 1; -end // -create table t1 (a int as (p1())); -ERROR HY000: Function or expression is not allowed for column 'a' -create table t1 (a int as (f1())); -ERROR HY000: Function or expression is not allowed for column 'a' -drop procedure p1; -drop function f1; -# Unknown functions -create table t1 (a int as (f1())); -ERROR HY000: Function or expression is not allowed for column 'a' -# -# GROUP BY FUNCTIONS -# -# AVG() -create table t1 (a int, b int as (avg(a))); -ERROR HY000: Function or expression is not allowed for column 'b' -# BIT_AND() -create table t1 (a int, b int as (bit_and(a))); -ERROR HY000: Function or expression is not allowed for column 'b' -# BIT_OR() -create table t1 (a int, b int as (bit_or(a))); -ERROR HY000: Function or expression is not allowed for column 'b' -# BIT_XOR() -create table t1 (a int, b int as (bit_xor(a))); -ERROR HY000: Function or expression is not allowed for column 'b' -# COUNT(DISTINCT) -create table t1 (a int, b int as (count(distinct a))); -ERROR HY000: Function or expression is not allowed for column 'b' -# COUNT() -create table t1 (a int, b int as (count(a))); -ERROR HY000: Function or expression is not allowed for column 'b' -# GROUP_CONCAT() -create table t1 (a varchar(32), b int as (group_concat(a,''))); -ERROR HY000: Function or expression is not allowed for column 'b' -# MAX() -create table t1 (a int, b int as (max(a))); -ERROR HY000: Function or expression is not allowed for column 'b' -# MIN() -create table t1 (a int, b int as (min(a))); -ERROR HY000: Function or expression is not allowed for column 'b' -# STD() -create table t1 (a int, b int as (std(a))); -ERROR HY000: Function or expression is not allowed for column 'b' -# STDDEV_POP() -create table t1 (a int, b int as (stddev_pop(a))); -ERROR HY000: Function or expression is not allowed for column 'b' -# STDDEV_SAMP() -create table t1 (a int, b int as (stddev_samp(a))); -ERROR HY000: Function or expression is not allowed for column 'b' -# STDDEV() -create table t1 (a int, b int as (stddev(a))); -ERROR HY000: Function or expression is not allowed for column 'b' -# SUM() -create table t1 (a int, b int as (sum(a))); -ERROR HY000: Function or expression is not allowed for column 'b' -# VAR_POP() -create table t1 (a int, b int as (var_pop(a))); -ERROR HY000: Function or expression is not allowed for column 'b' -# VAR_SAMP() -create table t1 (a int, b int as (var_samp(a))); -ERROR HY000: Function or expression is not allowed for column 'b' -# VARIANCE() -create table t1 (a int, b int as (variance(a))); -ERROR HY000: Function or expression is not allowed for column 'b' -# -# XML FUNCTIONS -# -# ExtractValue() -create table t1 (a varchar(1024), b varchar(1024) as (ExtractValue(a,'//b[$@j]'))); -ERROR HY000: Function or expression is not allowed for column 'b' -# UpdateXML() -create table t1 (a varchar(1024), b varchar(1024) as (UpdateXML(a,'/a','fff'))); -ERROR HY000: Function or expression is not allowed for column 'b' -# -# Sub-selects -# -create table t1 (a int); -create table t2 (a int, b int as (select count(*) from t1)); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'select count(*) from t1))' at line 1 -drop table t1; -create table t1 (a int, b int as ((select 1))); -ERROR HY000: Function or expression is not allowed for column 'b' -create table t1 (a int, b int as (a+(select 1))); -ERROR HY000: Function or expression is not allowed for column 'b' -# -# SP functions -# -drop function if exists sub1; -create function sub1(i int) returns int deterministic -return i+1; -select sub1(1); -sub1(1) -2 -create table t1 (a int, b int as (a+sub3(1))); -ERROR HY000: Function or expression is not allowed for column 'b' -drop function sub1; -# -# Long expression -create table t1 (a int, b varchar(300) as (concat(a,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'))); -drop table t1; -create table t1 (a int, b varchar(300) as (concat(a,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'))); -ERROR HY000: String 'concat(a,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' is too long for VIRTUAL COLUMN EXPRESSION (should be no longer than 252) -# -# Constant expression -create table t1 (a int as (PI())); -ERROR HY000: Constant expression in computed column function is not allowed diff --git a/mysql-test/suite/vcol/r/vcol_misc.result b/mysql-test/suite/vcol/r/vcol_misc.result index 451898aa972..d4a583c34b2 100644 --- a/mysql-test/suite/vcol/r/vcol_misc.result +++ b/mysql-test/suite/vcol/r/vcol_misc.result @@ -34,7 +34,7 @@ CREATE TABLE t1 ( a int NOT NULL DEFAULT '0', v double AS ((1, a)) VIRTUAL ); -ERROR HY000: Expression for computed column cannot return a row +ERROR 21000: Operand should contain 1 column(s) CREATE TABLE t1 ( a CHAR(255) BINARY NOT NULL DEFAULT 0, b CHAR(255) BINARY NOT NULL DEFAULT 0, @@ -187,11 +187,7 @@ ts TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, tsv TIMESTAMP AS (ADDDATE(ts, INTERVAL 1 DAY)) VIRTUAL ) ENGINE=MyISAM; INSERT INTO t1 (tsv) VALUES (DEFAULT); -Warnings: -Warning 1292 Incorrect datetime value: '0000-00-00 00:00:00' INSERT DELAYED INTO t1 (tsv) VALUES (DEFAULT); -Warnings: -Warning 1292 Incorrect datetime value: '0000-00-00 00:00:00' FLUSH TABLES; SELECT COUNT(*) FROM t1; COUNT(*) @@ -320,7 +316,9 @@ drop table t1; # MDEV-5611: self-referencing virtual column # create table t1 (a int, b int as (b is null) virtual); -ERROR HY000: A computed column cannot be based on a computed column +ERROR 01000: Expression for field `b` is refering to uninitialized field `b` +create table t1 (a int as (1+1), b int as (a is null) virtual); +drop table t1; # end of 5.3 tests create table t1 (v1 varchar(255) as (c1) persistent, c1 varchar(50)) collate=latin1_general_ci; show create table t1; diff --git a/mysql-test/suite/vcol/r/vcol_partition_innodb.result b/mysql-test/suite/vcol/r/vcol_partition_innodb.result index 466c1851800..6a7978a8bf4 100644 --- a/mysql-test/suite/vcol/r/vcol_partition_innodb.result +++ b/mysql-test/suite/vcol/r/vcol_partition_innodb.result @@ -12,15 +12,17 @@ PARTITION p2 VALUES LESS THAN (2008) insert into t1 values ('2006-01-01',default); insert into t1 values ('2007-01-01',default); insert into t1 values ('2005-01-01',default); +insert into t1 (a) values ('2007-01-02'); select * from t1; a b 2005-01-01 2005 2006-01-01 2006 2007-01-01 2007 +2007-01-02 2007 select partition_name,table_rows,data_length from information_schema.partitions where table_name = 't1'; partition_name table_rows data_length p0 1 16384 -p2 2 16384 +p2 3 16384 # Modify the expression of virtual column b ALTER TABLE t1 modify b int as (year(a)-1); select * from t1; @@ -28,10 +30,11 @@ a b 2005-01-01 2004 2006-01-01 2005 2007-01-01 2006 +2007-01-02 2006 select partition_name,table_rows,data_length from information_schema.partitions where table_name = 't1'; partition_name table_rows data_length p0 2 16384 -p2 1 16384 +p2 2 16384 drop table t1; # Case 2. Partitioning by LIST based on a stored virtual column. CREATE TABLE t1 (a int, b int as (a % 3 ) persistent) diff --git a/mysql-test/suite/vcol/r/vcol_partition_myisam.result b/mysql-test/suite/vcol/r/vcol_partition_myisam.result index 9a92f308c45..cb6f7fe1eca 100644 --- a/mysql-test/suite/vcol/r/vcol_partition_myisam.result +++ b/mysql-test/suite/vcol/r/vcol_partition_myisam.result @@ -12,15 +12,17 @@ PARTITION p2 VALUES LESS THAN (2008) insert into t1 values ('2006-01-01',default); insert into t1 values ('2007-01-01',default); insert into t1 values ('2005-01-01',default); +insert into t1 (a) values ('2007-01-02'); select * from t1; a b 2005-01-01 2005 2006-01-01 2006 2007-01-01 2007 +2007-01-02 2007 select partition_name,table_rows,data_length from information_schema.partitions where table_name = 't1'; partition_name table_rows data_length p0 1 7 -p2 2 14 +p2 3 21 # Modify the expression of virtual column b ALTER TABLE t1 modify b int as (year(a)-1); select * from t1; @@ -28,10 +30,11 @@ a b 2005-01-01 2004 2006-01-01 2005 2007-01-01 2006 +2007-01-02 2006 select partition_name,table_rows,data_length from information_schema.partitions where table_name = 't1'; partition_name table_rows data_length p0 2 14 -p2 1 7 +p2 2 14 drop table t1; # Case 2. Partitioning by LIST based on a stored virtual column. CREATE TABLE t1 (a int, b int as (a % 3 ) persistent) diff --git a/mysql-test/suite/vcol/r/vcol_select_innodb.result b/mysql-test/suite/vcol/r/vcol_select_innodb.result index 97bfbbe4eaf..63c35bade07 100644 --- a/mysql-test/suite/vcol/r/vcol_select_innodb.result +++ b/mysql-test/suite/vcol/r/vcol_select_innodb.result @@ -22,7 +22,7 @@ a b c 1 -1 -1 explain select * from t2 where c=-1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ref c c 5 const 1 Using index condition +1 SIMPLE t2 ref c c 5 const 1 # select_type=SIMPLE, type=ALL select * from t1 where b=-1; a b c @@ -53,7 +53,7 @@ a b c a b c explain select * from t1,t3 where t1.c=t3.c and t3.c=-1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t3 const c c 5 const 1 -1 SIMPLE t1 ref c c 5 const 2 Using index condition +1 SIMPLE t1 ref c c 5 const 2 # select_type=PRIMARY, type=index,ALL select * from t1 where b in (select c from t3); a b c diff --git a/mysql-test/suite/vcol/r/vcol_select_myisam.result b/mysql-test/suite/vcol/r/vcol_select_myisam.result index 934d047f6bf..d6d01150e0b 100644 --- a/mysql-test/suite/vcol/r/vcol_select_myisam.result +++ b/mysql-test/suite/vcol/r/vcol_select_myisam.result @@ -53,7 +53,7 @@ a b c a b c explain select * from t1,t3 where t1.c=t3.c and t3.c=-1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t3 const c c 5 const 1 -1 SIMPLE t1 ref c c 5 const 2 Using index condition +1 SIMPLE t1 ref c c 5 const 2 # select_type=PRIMARY, type=index,ALL select * from t1 where b in (select c from t3); a b c diff --git a/mysql-test/suite/vcol/r/vcol_supported_sql_funcs_myisam.result b/mysql-test/suite/vcol/r/vcol_supported_sql_funcs.result similarity index 98% rename from mysql-test/suite/vcol/r/vcol_supported_sql_funcs_myisam.result rename to mysql-test/suite/vcol/r/vcol_supported_sql_funcs.result index 184b4a441b2..2e6dbc38b6f 100644 --- a/mysql-test/suite/vcol/r/vcol_supported_sql_funcs_myisam.result +++ b/mysql-test/suite/vcol/r/vcol_supported_sql_funcs.result @@ -2028,21 +2028,6 @@ a b 2008-08-31 00:00:00 2008-09-30 00:00:00 drop table t1; set sql_warnings = 0; -# DATE_FORMAT() -set sql_warnings = 1; -create table t1 (a datetime, b varchar(64) as (date_format(a,'%W %M %D'))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` datetime DEFAULT NULL, - `b` varchar(64) AS (date_format(a,'%W %M %D')) VIRTUAL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -insert into t1 values ('2008-08-31',default); -select * from t1; -a b -2008-08-31 00:00:00 Sunday August 31st -drop table t1; -set sql_warnings = 0; # DATE_SUB() set sql_warnings = 1; create table t1 (a datetime, b datetime as (date_sub(a,interval 1 month))); @@ -2103,21 +2088,6 @@ a b 2008-08-31 00:00:00 31 drop table t1; set sql_warnings = 0; -# DAYNAME() -set sql_warnings = 1; -create table t1 (a datetime, b varchar(10) as (dayname(a))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` datetime DEFAULT NULL, - `b` varchar(10) AS (dayname(a)) VIRTUAL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -insert into t1 values ('2008-08-31',default); -select * from t1; -a b -2008-08-31 00:00:00 Sunday -drop table t1; -set sql_warnings = 0; # DAYOFMONTH() set sql_warnings = 1; create table t1 (a datetime, b int as (dayofmonth(a))); @@ -2184,7 +2154,7 @@ create table t1 (a long, b datetime as (from_days(a))); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` mediumtext, + `a` mediumtext DEFAULT NULL, `b` datetime AS (from_days(a)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (730669,default); @@ -2200,7 +2170,7 @@ create table t1 (a long, b datetime as (from_unixtime(a))); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` mediumtext, + `a` mediumtext DEFAULT NULL, `b` datetime AS (from_unixtime(a)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1196440219,default); @@ -2209,21 +2179,6 @@ a b 1196440219 2007-11-30 16:30:19 drop table t1; set sql_warnings = 0; -# GET_FORMAT() -set sql_warnings = 1; -create table t1 (a datetime, b varchar(32) as (date_format(a,get_format(DATE,'EUR')))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` datetime DEFAULT NULL, - `b` varchar(32) AS (date_format(a,get_format(DATE,'EUR'))) VIRTUAL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -insert into t1 values ('2008-08-31',default); -select * from t1; -a b -2008-08-31 00:00:00 31.08.2008 -drop table t1; -set sql_warnings = 0; # HOUR() set sql_warnings = 1; create table t1 (a time, b long as (hour(a))); @@ -2335,21 +2290,6 @@ a b 2009-12-31 23:59:59 12 drop table t1; set sql_warnings = 0; -# MONTHNAME() -set sql_warnings = 1; -create table t1 (a datetime, b varchar(16) as (monthname(a))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` datetime DEFAULT NULL, - `b` varchar(16) AS (monthname(a)) VIRTUAL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -insert into t1 values ('2009-12-31 23:59:59.000010',default); -select * from t1; -a b -2009-12-31 23:59:59 December -drop table t1; -set sql_warnings = 0; # PERIOD_ADD() set sql_warnings = 1; create table t1 (a int, b int as (period_add(a,2))); @@ -2402,7 +2342,7 @@ create table t1 (a long, b time as (sec_to_time(a))); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` mediumtext, + `a` mediumtext DEFAULT NULL, `b` time AS (sec_to_time(a)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (2378,default); @@ -2471,21 +2411,6 @@ a b 2008-08-31 00:00:00 2008-08-30 22:00:00 drop table t1; set sql_warnings = 0; -# TIME_FORMAT() -set sql_warnings = 1; -create table t1 (a datetime, b varchar(32) as (time_format(a,'%r'))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` datetime DEFAULT NULL, - `b` varchar(32) AS (time_format(a,'%r')) VIRTUAL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -insert into t1 values ('2008-08-31 02:03:04',default); -select * from t1; -a b -2008-08-31 02:03:04 02:03:04 AM -drop table t1; -set sql_warnings = 0; # TIME_TO_SEC() set sql_warnings = 1; create table t1 (a time, b long as (time_to_sec(a))); @@ -2906,3 +2831,78 @@ a b a 30 drop table t1; set sql_warnings = 0; +# MONTHNAME() +set sql_warnings = 1; +create table t1 (a date, b varchar(100) as (monthname(a))); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` date DEFAULT NULL, + `b` varchar(100) AS (monthname(a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('2010-10-10',default); +select * from t1; +a b +2010-10-10 October +drop table t1; +set sql_warnings = 0; +# DAYNAME() +set sql_warnings = 1; +create table t1 (a date, b varchar(100) as (dayname(a))); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` date DEFAULT NULL, + `b` varchar(100) AS (dayname(a)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('2011-11-11',default); +select * from t1; +a b +2011-11-11 Friday +drop table t1; +set sql_warnings = 0; +# DATE_FORMAT() +set sql_warnings = 1; +create table t1 (a date, b varchar(100) as (date_format(a, '%W %a %M %b'))); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` date DEFAULT NULL, + `b` varchar(100) AS (date_format(a, '%W %a %M %b')) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('2012-12-12',default); +select * from t1; +a b +2012-12-12 Wednesday Wed December Dec +drop table t1; +set sql_warnings = 0; +# CURRENT_USER() +set sql_warnings = 1; +create table t1 (a char, b varchar(32) as (current_user())); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(1) DEFAULT NULL, + `b` varchar(32) AS (current_user()) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('a', default); +select * from t1; +a b +a root@localhost +drop table t1; +set sql_warnings = 0; +# TIME_FORMAT() +set sql_warnings = 1; +create table t1 (a datetime, b varchar(10) as (time_format(a,"%d.%m.%Y"))); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL, + `b` varchar(10) AS (time_format(a,"%d.%m.%Y")) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('2001-01-01 02:02:02',default); +select * from t1; +a b +2001-01-01 02:02:02 01.01.2001 +drop table t1; +set sql_warnings = 0; diff --git a/mysql-test/suite/vcol/r/vcol_supported_sql_funcs_innodb.result b/mysql-test/suite/vcol/r/vcol_supported_sql_funcs_innodb.result deleted file mode 100644 index f9a7e2cc65c..00000000000 --- a/mysql-test/suite/vcol/r/vcol_supported_sql_funcs_innodb.result +++ /dev/null @@ -1,2908 +0,0 @@ -SET @@session.storage_engine = 'InnoDB'; -# -# NUMERIC FUNCTIONS -# -# ABS() -set sql_warnings = 1; -create table t1 (a int, b int as (abs(a))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT NULL, - `b` int(11) AS (abs(a)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (-1, default); -select * from t1; -a b --1 1 -drop table t1; -set sql_warnings = 0; -# ACOS() -set sql_warnings = 1; -create table t1 (a double, b double as (format(acos(a),6))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` double DEFAULT NULL, - `b` double AS (format(acos(a),6)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (1, default); -insert into t1 values (1.0001,default); -insert into t1 values (0,default); -select * from t1; -a b -1 0 -1.0001 NULL -0 1.570796 -drop table t1; -set sql_warnings = 0; -# ASIN() -set sql_warnings = 1; -create table t1 (a double, b double as (format(asin(a),6))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` double DEFAULT NULL, - `b` double AS (format(asin(a),6)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (0.2, default); -insert into t1 values (1.0001,default); -select * from t1; -a b -0.2 0.201358 -1.0001 NULL -drop table t1; -set sql_warnings = 0; -#ATAN -set sql_warnings = 1; -create table t1 (a double, b double, c double as (format(atan(a,b),6))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` double DEFAULT NULL, - `b` double DEFAULT NULL, - `c` double AS (format(atan(a,b),6)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (-2,2,default); -insert into t1 values (format(PI(),6),0,default); -select * from t1; -a b c --2 2 -0.785398 -3.141593 0 1.570796 -drop table t1; -set sql_warnings = 0; -set sql_warnings = 1; -create table t1 (a double, c double as (format(atan(a),6))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` double DEFAULT NULL, - `c` double AS (format(atan(a),6)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (-2,default); -insert into t1 values (format(PI(),6),default); -select * from t1; -a c --2 -1.107149 -3.141593 1.262627 -drop table t1; -set sql_warnings = 0; -# ATAN2 -set sql_warnings = 1; -create table t1 (a double, b double, c double as (format(atan2(a,b),6))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` double DEFAULT NULL, - `b` double DEFAULT NULL, - `c` double AS (format(atan2(a,b),6)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (-2,2,default); -insert into t1 values (format(PI(),6),0,default); -select * from t1; -a b c --2 2 -0.785398 -3.141593 0 1.570796 -drop table t1; -set sql_warnings = 0; -# CEIL() -set sql_warnings = 1; -create table t1 (a double, b int as (ceil(a))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` double DEFAULT NULL, - `b` int(11) AS (ceil(a)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (1.23,default); -insert into t1 values (-1.23,default); -select * from t1; -a b -1.23 2 --1.23 -1 -drop table t1; -set sql_warnings = 0; -# CONV() -set sql_warnings = 1; -create table t1 (a varchar(10), b int, c int, d varchar(10) as (conv(a,b,c))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(10) DEFAULT NULL, - `b` int(11) DEFAULT NULL, - `c` int(11) DEFAULT NULL, - `d` varchar(10) AS (conv(a,b,c)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('a',16,2,default); -insert into t1 values ('6e',18,8,default); -insert into t1 values (-17,10,-18,default); -insert into t1 values (10+'10'+'10'+0xa,10,10,default); -select * from t1; -a b c d -a 16 2 1010 -6e 18 8 172 --17 10 -18 -H -40 10 10 40 -drop table t1; -set sql_warnings = 0; -# COS() -set sql_warnings = 1; -create table t1 (a double, b double as (format(cos(a),6))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` double DEFAULT NULL, - `b` double AS (format(cos(a),6)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (format(PI(),6),default); -select * from t1; -a b -3.141593 -1 -drop table t1; -set sql_warnings = 0; -# COT() -set sql_warnings = 1; -create table t1 (a double, b double as (format(cot(a),6))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` double DEFAULT NULL, - `b` double AS (format(cot(a),6)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (12,default); -insert into t1 values (1,default); -select * from t1; -a b -12 -1.572673 -1 0.642093 -drop table t1; -set sql_warnings = 0; -# CRC32() -set sql_warnings = 1; -create table t1 (a varchar(10), b long as (crc32(a))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(10) DEFAULT NULL, - `b` mediumtext AS (crc32(a)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('MySQL',default); -insert into t1 values ('mysql',default); -select * from t1; -a b -MySQL 3259397556 -mysql 2501908538 -drop table t1; -set sql_warnings = 0; -# DEGREES() -set sql_warnings = 1; -create table t1 (a double, b double as (format(degrees(a),6))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` double DEFAULT NULL, - `b` double AS (format(degrees(a),6)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (format(PI(),6),default); -insert into t1 values (format(PI()/2,6),default); -select * from t1; -a b -3.141593 180.00002 -1.570796 89.999981 -drop table t1; -set sql_warnings = 0; -# / -set sql_warnings = 1; -create table t1 (a double, b double as (a/2)); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` double DEFAULT NULL, - `b` double AS (a/2) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (2,default); -select * from t1; -a b -2 1 -drop table t1; -set sql_warnings = 0; -# EXP() -set sql_warnings = 1; -create table t1 (a double, b double as (format(exp(a),6))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` double DEFAULT NULL, - `b` double AS (format(exp(a),6)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (2,default); -insert into t1 values (-2,default); -insert into t1 values (0,default); -select * from t1; -a b -2 7.389056 --2 0.135335 -0 1 -drop table t1; -set sql_warnings = 0; -# FLOOR() -set sql_warnings = 1; -create table t1 (a double, b long as (floor(a))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` double DEFAULT NULL, - `b` mediumtext AS (floor(a)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (1.23,default); -insert into t1 values (-1.23,default); -select * from t1; -a b -1.23 1 --1.23 -2 -drop table t1; -set sql_warnings = 0; -# LN() -set sql_warnings = 1; -create table t1 (a double, b double as (format(ln(a),6))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` double DEFAULT NULL, - `b` double AS (format(ln(a),6)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (2,default); -insert into t1 values (-2,default); -select * from t1; -a b -2 0.693147 --2 NULL -drop table t1; -set sql_warnings = 0; -# LOG() -set sql_warnings = 1; -create table t1 (a double, b double, c double as (format(log(a,b),6))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` double DEFAULT NULL, - `b` double DEFAULT NULL, - `c` double AS (format(log(a,b),6)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (2,65536,default); -insert into t1 values (10,100,default); -insert into t1 values (1,100,default); -select * from t1; -a b c -2 65536 16 -10 100 2 -1 100 NULL -drop table t1; -set sql_warnings = 0; -set sql_warnings = 1; -create table t1 (a double, b double as (format(log(a),6))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` double DEFAULT NULL, - `b` double AS (format(log(a),6)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (2,default); -insert into t1 values (-2,default); -select * from t1; -a b -2 0.693147 --2 NULL -drop table t1; -set sql_warnings = 0; -# LOG2() -set sql_warnings = 1; -create table t1 (a double, b double as (format(log2(a),6))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` double DEFAULT NULL, - `b` double AS (format(log2(a),6)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (65536,default); -insert into t1 values (-100,default); -select * from t1; -a b -65536 16 --100 NULL -drop table t1; -set sql_warnings = 0; -# LOG10() -set sql_warnings = 1; -create table t1 (a double, b double as (format(log10(a),6))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` double DEFAULT NULL, - `b` double AS (format(log10(a),6)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (2,default); -insert into t1 values (100,default); -insert into t1 values (-100,default); -select * from t1; -a b -2 0.30103 -100 2 --100 NULL -drop table t1; -set sql_warnings = 0; -# - -set sql_warnings = 1; -create table t1 (a double, b double as (a-1)); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` double DEFAULT NULL, - `b` double AS (a-1) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (2,default); -select * from t1; -a b -2 1 -drop table t1; -set sql_warnings = 0; -# MOD() -set sql_warnings = 1; -create table t1 (a int, b int as (mod(a,10))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT NULL, - `b` int(11) AS (mod(a,10)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (1,default); -insert into t1 values (11,default); -select * from t1; -a b -1 1 -11 1 -drop table t1; -set sql_warnings = 0; -# % -set sql_warnings = 1; -create table t1 (a int, b int as (a % 10)); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT NULL, - `b` int(11) AS (a % 10) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (1,default); -insert into t1 values (11,default); -select * from t1; -a b -1 1 -11 1 -drop table t1; -set sql_warnings = 0; -# OCT() -set sql_warnings = 1; -create table t1 (a double, b varchar(10) as (oct(a))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` double DEFAULT NULL, - `b` varchar(10) AS (oct(a)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (12,default); -select * from t1; -a b -12 14 -drop table t1; -set sql_warnings = 0; -# PI() -set sql_warnings = 1; -create table t1 (a double, b double as (format(PI()*a*a,6))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` double DEFAULT NULL, - `b` double AS (format(PI()*a*a,6)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (1,default); -select * from t1; -a b -1 3.141593 -drop table t1; -set sql_warnings = 0; -# + -set sql_warnings = 1; -create table t1 (a int, b int as (a+1)); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT NULL, - `b` int(11) AS (a+1) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (1,default); -select * from t1; -a b -1 2 -drop table t1; -set sql_warnings = 0; -# POW, POWER -set sql_warnings = 1; -create table t1 (a int, b int as (pow(a,2)), c int as (power(a,2))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT NULL, - `b` int(11) AS (pow(a,2)) VIRTUAL, - `c` int(11) AS (power(a,2)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (1,default,default); -insert into t1 values (2,default,default); -select * from t1; -a b c -1 1 1 -2 4 4 -drop table t1; -set sql_warnings = 0; -# RADIANS() -set sql_warnings = 1; -create table t1 (a double, b double as (format(radians(a),6))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` double DEFAULT NULL, - `b` double AS (format(radians(a),6)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (90,default); -select * from t1; -a b -90 1.570796 -drop table t1; -set sql_warnings = 0; -# ROUND() -set sql_warnings = 1; -create table t1 (a double, b int as (round(a))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` double DEFAULT NULL, - `b` int(11) AS (round(a)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (-1.23,default); -insert into t1 values (-1.58,default); -insert into t1 values (1.58,default); -select * from t1; -a b --1.23 -1 --1.58 -2 -1.58 2 -drop table t1; -set sql_warnings = 0; -set sql_warnings = 1; -create table t1 (a double, b double, c int as (round(a,b))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` double DEFAULT NULL, - `b` double DEFAULT NULL, - `c` int(11) AS (round(a,b)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (1.298,1,default); -insert into t1 values (1.298,0,default); -insert into t1 values (23.298,-1,default); -select * from t1; -a b c -1.298 1 1 -1.298 0 1 -23.298 -1 20 -drop table t1; -set sql_warnings = 0; -# SIGN() -set sql_warnings = 1; -create table t1 (a double, b int as (sign(a))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` double DEFAULT NULL, - `b` int(11) AS (sign(a)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (-32,default); -insert into t1 values (0,default); -insert into t1 values (234,default); -select * from t1; -a b --32 -1 -0 0 -234 1 -drop table t1; -set sql_warnings = 0; -# SIN() -set sql_warnings = 1; -create table t1 (a double, b double as (format(sin(a),6))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` double DEFAULT NULL, - `b` double AS (format(sin(a),6)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (format(PI()/2,6),default); -select * from t1; -a b -1.570796 1 -drop table t1; -set sql_warnings = 0; -# SQRT() -set sql_warnings = 1; -create table t1 (a double, b double as (format(sqrt(a),6))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` double DEFAULT NULL, - `b` double AS (format(sqrt(a),6)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (4,default); -insert into t1 values (20,default); -insert into t1 values (-16,default); -select * from t1; -a b -4 2 -20 4.472136 --16 NULL -drop table t1; -set sql_warnings = 0; -# TAN() -set sql_warnings = 1; -create table t1 (a double, b double as (format(tan(a),6))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` double DEFAULT NULL, - `b` double AS (format(tan(a),6)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (format(PI(),6),default); -insert into t1 values (format(PI()+1,6),default); -select * from t1; -a b -3.141593 0 -4.141593 1.557409 -drop table t1; -set sql_warnings = 0; -# * -set sql_warnings = 1; -create table t1 (a double, b double as (a*3)); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` double DEFAULT NULL, - `b` double AS (a*3) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (0,default); -insert into t1 values (1,default); -insert into t1 values (2,default); -select * from t1; -a b -0 0 -1 3 -2 6 -drop table t1; -set sql_warnings = 0; -# TRUNCATE() -set sql_warnings = 1; -create table t1 (a double, b double as (truncate(a,4))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` double DEFAULT NULL, - `b` double AS (truncate(a,4)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (1.223,default); -insert into t1 values (1.999,default); -insert into t1 values (1.999,default); -insert into t1 values (122,default); -select * from t1; -a b -1.223 1.223 -1.999 1.999 -1.999 1.999 -122 122 -drop table t1; -set sql_warnings = 0; -# Unary - -set sql_warnings = 1; -create table t1 (a double, b double as (-a)); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` double DEFAULT NULL, - `b` double AS (-a) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (1,default); -insert into t1 values (-1,default); -select * from t1; -a b -1 -1 --1 1 -drop table t1; -set sql_warnings = 0; -# -# STRING FUNCTIONS -# -# ASCII() -set sql_warnings = 1; -create table t1 (a char(2), b int as (ascii(a))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` char(2) DEFAULT NULL, - `b` int(11) AS (ascii(a)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('2',default); -insert into t1 values (2,default); -insert into t1 values ('dx',default); -select * from t1; -a b -2 50 -2 50 -dx 100 -drop table t1; -set sql_warnings = 0; -# BIN() -set sql_warnings = 1; -create table t1 (a int, b varchar(10) as (bin(a))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT NULL, - `b` varchar(10) AS (bin(a)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (12,default); -select * from t1; -a b -12 1100 -drop table t1; -set sql_warnings = 0; -# BIT_LENGTH() -set sql_warnings = 1; -create table t1 (a varchar(10), b long as (bit_length(a))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(10) DEFAULT NULL, - `b` mediumtext AS (bit_length(a)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('text',default); -select * from t1; -a b -text 32 -drop table t1; -set sql_warnings = 0; -# CHAR_LENGTH() -set sql_warnings = 1; -create table t1 (a varchar(10), b long as (char_length(a))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(10) DEFAULT NULL, - `b` mediumtext AS (char_length(a)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('text',default); -select * from t1; -a b -text 4 -drop table t1; -set sql_warnings = 0; -# CHAR() -set sql_warnings = 1; -create table t1 (a int, b int, c varbinary(10) as (char(a,b))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL, - `c` varbinary(10) AS (char(a,b)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (77,121,default); -select * from t1; -a b c -77 121 My -drop table t1; -set sql_warnings = 0; -# CHARACTER_LENGTH() -set sql_warnings = 1; -create table t1 (a varchar(10), b long as (character_length(a))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(10) DEFAULT NULL, - `b` mediumtext AS (character_length(a)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('text',default); -select * from t1; -a b -text 4 -drop table t1; -set sql_warnings = 0; -# CONCAT_WS() -set sql_warnings = 1; -create table t1 (a varchar(10), b varchar(10), c varchar(20) as (concat_ws(',',a,b))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(10) DEFAULT NULL, - `b` varchar(10) DEFAULT NULL, - `c` varchar(20) AS (concat_ws(',',a,b)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('value1','value2',default); -select * from t1; -a b c -value1 value2 value1,value2 -drop table t1; -set sql_warnings = 0; -# CONCAT() -set sql_warnings = 1; -create table t1 (a varchar(10), b varchar(10), c varchar(20) as (concat(a,',',b))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(10) DEFAULT NULL, - `b` varchar(10) DEFAULT NULL, - `c` varchar(20) AS (concat(a,',',b)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('value1','value2',default); -select * from t1; -a b c -value1 value2 value1,value2 -drop table t1; -set sql_warnings = 0; -# ELT() -set sql_warnings = 1; -create table t1 (a varchar(10), b varchar(10), c int, d varchar(10) as (elt(c,a,b))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(10) DEFAULT NULL, - `b` varchar(10) DEFAULT NULL, - `c` int(11) DEFAULT NULL, - `d` varchar(10) AS (elt(c,a,b)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('value1','value2',1,default); -insert into t1 values ('value1','value2',2,default); -select * from t1; -a b c d -value1 value2 1 value1 -value1 value2 2 value2 -drop table t1; -set sql_warnings = 0; -# EXPORT_SET() -set sql_warnings = 1; -create table t1 (a int, b varchar(10) as (export_set(a,'1','0','',10))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT NULL, - `b` varchar(10) AS (export_set(a,'1','0','',10)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (6,default); -select * from t1; -a b -6 0110000000 -drop table t1; -set sql_warnings = 0; -# FIELD() -set sql_warnings = 1; -create table t1 (a varchar(10), b varchar(10), c int as (field('aa',a,b))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(10) DEFAULT NULL, - `b` varchar(10) DEFAULT NULL, - `c` int(11) AS (field('aa',a,b)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('aa','bb',default); -insert into t1 values ('bb','aa',default); -select * from t1; -a b c -aa bb 1 -bb aa 2 -drop table t1; -set sql_warnings = 0; -# FIND_IN_SET() -set sql_warnings = 1; -create table t1 (a varchar(10), b varchar(10), c int as (find_in_set(a,b))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(10) DEFAULT NULL, - `b` varchar(10) DEFAULT NULL, - `c` int(11) AS (find_in_set(a,b)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('aa','aa,bb,cc',default); -insert into t1 values ('aa','bb,aa,cc',default); -select * from t1; -a b c -aa aa,bb,cc 1 -aa bb,aa,cc 2 -drop table t1; -set sql_warnings = 0; -# FORMAT() -set sql_warnings = 1; -create table t1 (a double, b varchar(20) as (format(a,2))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` double DEFAULT NULL, - `b` varchar(20) AS (format(a,2)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (12332.123456,default); -select * from t1; -a b -12332.123456 12,332.12 -drop table t1; -set sql_warnings = 0; -# HEX() -set sql_warnings = 1; -create table t1 (a int, b varchar(10) as (hex(a))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT NULL, - `b` varchar(10) AS (hex(a)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (17,default); -select * from t1; -a b -17 11 -drop table t1; -set sql_warnings = 0; -set sql_warnings = 1; -create table t1 (a varchar(10), b varchar(10) as (hex(a))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (hex(a)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('abc',default); -select * from t1; -a b -abc 616263 -drop table t1; -set sql_warnings = 0; -# INSERT() -set sql_warnings = 1; -create table t1 (a varchar(10), b varchar(10), c varchar(20) as (insert(a,length(a),length(b),b))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(10) DEFAULT NULL, - `b` varchar(10) DEFAULT NULL, - `c` varchar(20) AS (insert(a,length(a),length(b),b)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('start,','end',default); -select * from t1; -a b c -start, end startend -drop table t1; -set sql_warnings = 0; -# INSTR() -set sql_warnings = 1; -create table t1 (a varchar(10), b varchar(10), c int as (instr(a,b))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(10) DEFAULT NULL, - `b` varchar(10) DEFAULT NULL, - `c` int(11) AS (instr(a,b)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('foobarbar,','bar',default); -insert into t1 values ('xbar,','foobar',default); -select * from t1; -a b c -foobarbar, bar 4 -xbar, foobar 0 -drop table t1; -set sql_warnings = 0; -# LCASE() -set sql_warnings = 1; -create table t1 (a varchar(10), b varchar(10) as (lcase(a))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (lcase(a)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('MySQL',default); -select * from t1; -a b -MySQL mysql -drop table t1; -set sql_warnings = 0; -# LEFT() -set sql_warnings = 1; -create table t1 (a varchar(10), b varchar(5) as (left(a,5))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(10) DEFAULT NULL, - `b` varchar(5) AS (left(a,5)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('foobarbar',default); -select * from t1; -a b -foobarbar fooba -drop table t1; -set sql_warnings = 0; -# LENGTH() -set sql_warnings = 1; -create table t1 (a varchar(10), b int as (length(a))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(10) DEFAULT NULL, - `b` int(11) AS (length(a)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('text',default); -select * from t1; -a b -text 4 -drop table t1; -set sql_warnings = 0; -# LIKE -set sql_warnings = 1; -create table t1 (a varchar(10), b bool as (a like 'H%!o' escape '!')); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(10) DEFAULT NULL, - `b` tinyint(1) AS (a like 'H%!o' escape '!') VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('Hello',default); -insert into t1 values ('MySQL',default); -select * from t1; -a b -Hello 1 -MySQL 0 -drop table t1; -set sql_warnings = 0; -# LOCATE() -set sql_warnings = 1; -create table t1 (a varchar(10), b varchar(10) as (locate('bar',a))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (locate('bar',a)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('foobarbar',default); -select * from t1; -a b -foobarbar 4 -drop table t1; -set sql_warnings = 0; -# LOWER() -set sql_warnings = 1; -create table t1 (a varchar(10), b varchar(10) as (lower(a))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (lower(a)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('MySQL',default); -select * from t1; -a b -MySQL mysql -drop table t1; -set sql_warnings = 0; -# LPAD() -set sql_warnings = 1; -create table t1 (a varchar(10), b varchar(10) as (lpad(a,4,' '))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (lpad(a,4,' ')) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('MySQL',default); -insert into t1 values ('M',default); -select * from t1; -a b -MySQL MySQ -M M -drop table t1; -set sql_warnings = 0; -# LTRIM() -set sql_warnings = 1; -create table t1 (a varchar(10), b varchar(10) as (ltrim(a))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (ltrim(a)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (' MySQL',default); -insert into t1 values ('MySQL',default); -select * from t1; -a b - MySQL MySQL -MySQL MySQL -drop table t1; -set sql_warnings = 0; -# MAKE_SET() -set sql_warnings = 1; -create table t1 (a varchar(10), b varchar(10), c int, d varchar(30) as (make_set(c,a,b))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(10) DEFAULT NULL, - `b` varchar(10) DEFAULT NULL, - `c` int(11) DEFAULT NULL, - `d` varchar(30) AS (make_set(c,a,b)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('a','b',1,default); -insert into t1 values ('a','b',3,default); -select * from t1; -a b c d -a b 1 a -a b 3 a,b -drop table t1; -set sql_warnings = 0; -# MID() -set sql_warnings = 1; -create table t1 (a varchar(10), b varchar(10) as (mid(a,1,2))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (mid(a,1,2)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('foobarbar',default); -select * from t1; -a b -foobarbar fo -drop table t1; -set sql_warnings = 0; -# NOT LIKE -set sql_warnings = 1; -create table t1 (a varchar(10), b bool as (a not like 'H%o')); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(10) DEFAULT NULL, - `b` tinyint(1) AS (a not like 'H%o') VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('Hello',default); -insert into t1 values ('MySQL',default); -select * from t1; -a b -Hello 0 -MySQL 1 -drop table t1; -set sql_warnings = 0; -# NOT REGEXP -set sql_warnings = 1; -create table t1 (a varchar(10), b bool as (a not regexp 'H.+o')); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(10) DEFAULT NULL, - `b` tinyint(1) AS (a not regexp 'H.+o') VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('Hello',default); -insert into t1 values ('hello',default); -select * from t1; -a b -Hello 0 -hello 0 -drop table t1; -set sql_warnings = 0; -# OCTET_LENGTH() -set sql_warnings = 1; -create table t1 (a varchar(10), b int as (octet_length(a))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(10) DEFAULT NULL, - `b` int(11) AS (octet_length(a)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('text',default); -select * from t1; -a b -text 4 -drop table t1; -set sql_warnings = 0; -# ORD() -set sql_warnings = 1; -create table t1 (a varchar(10), b long as (ord(a))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(10) DEFAULT NULL, - `b` mediumtext AS (ord(a)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('2',default); -select * from t1; -a b -2 50 -drop table t1; -set sql_warnings = 0; -# POSITION() -set sql_warnings = 1; -create table t1 (a varchar(10), b varchar(10) as (position('bar' in a))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (position('bar' in a)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('foobarbar',default); -select * from t1; -a b -foobarbar 4 -drop table t1; -set sql_warnings = 0; -# QUOTE() -set sql_warnings = 1; -create table t1 (a varchar(10), b varchar(10) as (quote(a))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (quote(a)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('Don\'t',default); -select * from t1; -a b -Don't 'Don\'t' -drop table t1; -set sql_warnings = 0; -# REGEXP() -set sql_warnings = 1; -create table t1 (a varchar(10), b bool as (a regexp 'H.+o')); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(10) DEFAULT NULL, - `b` tinyint(1) AS (a regexp 'H.+o') VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('Hello',default); -insert into t1 values ('hello',default); -select * from t1; -a b -Hello 1 -hello 1 -drop table t1; -set sql_warnings = 0; -# REPEAT() -set sql_warnings = 1; -create table t1 (a varchar(10), b varchar(30) as (repeat(a,3))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(10) DEFAULT NULL, - `b` varchar(30) AS (repeat(a,3)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('MySQL',default); -select * from t1; -a b -MySQL MySQLMySQLMySQL -drop table t1; -set sql_warnings = 0; -# REPLACE() -set sql_warnings = 1; -create table t1 (a varchar(10), b varchar(30) as (replace(a,'aa','bb'))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(10) DEFAULT NULL, - `b` varchar(30) AS (replace(a,'aa','bb')) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('maa',default); -select * from t1; -a b -maa mbb -drop table t1; -set sql_warnings = 0; -# REVERSE() -set sql_warnings = 1; -create table t1 (a varchar(10), b varchar(30) as (reverse(a))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(10) DEFAULT NULL, - `b` varchar(30) AS (reverse(a)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('maa',default); -select * from t1; -a b -maa aam -drop table t1; -set sql_warnings = 0; -# RIGHT() -set sql_warnings = 1; -create table t1 (a varchar(10), b varchar(10) as (right(a,4))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (right(a,4)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('foobarbar',default); -select * from t1; -a b -foobarbar rbar -drop table t1; -set sql_warnings = 0; -# RLIKE() -set sql_warnings = 1; -create table t1 (a varchar(10), b bool as (a rlike 'H.+o')); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(10) DEFAULT NULL, - `b` tinyint(1) AS (a rlike 'H.+o') VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('Hello',default); -insert into t1 values ('MySQL',default); -select * from t1; -a b -Hello 1 -MySQL 0 -drop table t1; -set sql_warnings = 0; -# RPAD() -set sql_warnings = 1; -create table t1 (a varchar(10), b varchar(10) as (rpad(a,4,'??'))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (rpad(a,4,'??')) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('He',default); -select * from t1; -a b -He He?? -drop table t1; -set sql_warnings = 0; -# RTRIM(); -set sql_warnings = 1; -create table t1 (a varchar(10), b varchar(10) as (rtrim(a))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (rtrim(a)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('Hello ',default); -select * from t1; -a b -Hello Hello -drop table t1; -set sql_warnings = 0; -# SOUNDEX() -set sql_warnings = 1; -create table t1 (a varchar(10), b varchar(20) as (soundex(a))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(10) DEFAULT NULL, - `b` varchar(20) AS (soundex(a)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('Hello',default); -select * from t1; -a b -Hello H400 -drop table t1; -set sql_warnings = 0; -# SOUNDS LIKE -set sql_warnings = 1; -create table t1 (a varchar(10), b varchar(10), c bool as (a sounds like b)); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(10) DEFAULT NULL, - `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) AS (a sounds like b) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('Hello','Hello',default); -insert into t1 values ('Hello','MySQL',default); -insert into t1 values ('Hello','hello',default); -select * from t1; -a b c -Hello Hello 1 -Hello MySQL 0 -Hello hello 1 -drop table t1; -set sql_warnings = 0; -# SPACE() -set sql_warnings = 1; -create table t1 (a varchar(5), b varchar(10) as (concat(a,space(5)))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(5) DEFAULT NULL, - `b` varchar(10) AS (concat(a,space(5))) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('Hello', default); -select * from t1; -a b -Hello Hello -drop table t1; -set sql_warnings = 0; -# STRCMP() -set sql_warnings = 1; -create table t1 (a varchar(9), b varchar(9), c tinyint(1) as (strcmp(a,b))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(9) DEFAULT NULL, - `b` varchar(9) DEFAULT NULL, - `c` tinyint(1) AS (strcmp(a,b)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('Hello','Hello', default); -insert into t1 values ('Hello','Hello1', default); -select * from t1; -a b c -Hello Hello 0 -Hello Hello1 -1 -drop table t1; -set sql_warnings = 0; -# SUBSTR() -set sql_warnings = 1; -create table t1 (a varchar(5), b varchar(10) as (substr(a,2))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(5) DEFAULT NULL, - `b` varchar(10) AS (substr(a,2)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('Hello',default); -select * from t1; -a b -Hello ello -drop table t1; -set sql_warnings = 0; -# SUBSTRING_INDEX() -set sql_warnings = 1; -create table t1 (a varchar(15), b varchar(10) as (substring_index(a,'.',2))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(15) DEFAULT NULL, - `b` varchar(10) AS (substring_index(a,'.',2)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('www.mysql.com',default); -select * from t1; -a b -www.mysql.com www.mysql -drop table t1; -set sql_warnings = 0; -# SUBSTRING() -set sql_warnings = 1; -create table t1 (a varchar(5), b varchar(10) as (substring(a from 2 for 2))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(5) DEFAULT NULL, - `b` varchar(10) AS (substring(a from 2 for 2)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('Hello',default); -select * from t1; -a b -Hello el -drop table t1; -set sql_warnings = 0; -# TRIM() -set sql_warnings = 1; -create table t1 (a varchar(15), b varchar(10) as (trim(a))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(15) DEFAULT NULL, - `b` varchar(10) AS (trim(a)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (' aa ',default); -select * from t1; -a b - aa aa -drop table t1; -set sql_warnings = 0; -# UCASE() -set sql_warnings = 1; -create table t1 (a varchar(5), b varchar(10) as (ucase(a))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(5) DEFAULT NULL, - `b` varchar(10) AS (ucase(a)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('MySQL',default); -select * from t1; -a b -MySQL MYSQL -drop table t1; -set sql_warnings = 0; -# UNHEX() -set sql_warnings = 1; -create table t1 (a varchar(15), b varchar(10) as (unhex(a))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(15) DEFAULT NULL, - `b` varchar(10) AS (unhex(a)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('4D7953514C',default); -select * from t1; -a b -4D7953514C MySQL -drop table t1; -set sql_warnings = 0; -# UPPER() -set sql_warnings = 1; -create table t1 (a varchar(5), b varchar(10) as (upper(a))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(5) DEFAULT NULL, - `b` varchar(10) AS (upper(a)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('MySQL',default); -select * from t1; -a b -MySQL MYSQL -drop table t1; -set sql_warnings = 0; -# -# CONTROL FLOW FUNCTIONS -# -# CASE -set sql_warnings = 1; -create table t1 (a varchar(10), b varchar(16) as (case a when NULL then 'asd' when 'b' then 'B' else a end)); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(10) DEFAULT NULL, - `b` varchar(16) AS (case a when NULL then 'asd' when 'b' then 'B' else a end) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (NULL,default); -insert into t1 values ('b',default); -insert into t1 values ('c',default); -select * from t1; -a b -NULL NULL -b B -c c -drop table t1; -set sql_warnings = 0; -# IF -set sql_warnings = 1; -create table t1 (a int, b int, c int as (if(a=1,a,b))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL, - `c` int(11) AS (if(a=1,a,b)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (1,2,default); -insert into t1 values (3,4,default); -select * from t1; -a b c -1 2 1 -3 4 4 -drop table t1; -set sql_warnings = 0; -# IFNULL -set sql_warnings = 1; -create table t1 (a varchar(10), b varchar(10), c varchar(10) as (ifnull(a,'DEFAULT'))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(10) DEFAULT NULL, - `b` varchar(10) DEFAULT NULL, - `c` varchar(10) AS (ifnull(a,'DEFAULT')) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (NULL,'adf',default); -insert into t1 values ('a','adf',default); -select * from t1; -a b c -NULL adf DEFAULT -a adf a -drop table t1; -set sql_warnings = 0; -# NULLIF -set sql_warnings = 1; -create table t1 (a varchar(10), b varchar(10) as (nullif(a,'DEFAULT'))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (nullif(a,'DEFAULT')) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('DEFAULT',default); -insert into t1 values ('a',default); -select * from t1; -a b -DEFAULT NULL -a a -drop table t1; -set sql_warnings = 0; -# -# OPERATORS -# -# AND, && -set sql_warnings = 1; -create table t1 (a int, b bool as (a>0 && a<2)); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT NULL, - `b` tinyint(1) AS (a>0 && a<2) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (-1,default); -insert into t1 values (1,default); -select * from t1; -a b --1 0 -1 1 -drop table t1; -set sql_warnings = 0; -# BETWEEN ... AND ... -set sql_warnings = 1; -create table t1 (a int, b bool as (a between 0 and 2)); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT NULL, - `b` tinyint(1) AS (a between 0 and 2) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (-1,default); -insert into t1 values (1,default); -select * from t1; -a b --1 0 -1 1 -drop table t1; -set sql_warnings = 0; -# BINARY -set sql_warnings = 1; -create table t1 (a varchar(10), b varbinary(10) as (binary a)); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(10) DEFAULT NULL, - `b` varbinary(10) AS (binary a) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('11',default); -insert into t1 values (1,default); -select * from t1; -a b -11 11 -1 1 -drop table t1; -set sql_warnings = 0; -# & -set sql_warnings = 1; -create table t1 (a int, b int as (a & 5)); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT NULL, - `b` int(11) AS (a & 5) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (1,default); -insert into t1 values (0,default); -select * from t1; -a b -1 1 -0 0 -drop table t1; -set sql_warnings = 0; -# ~ -set sql_warnings = 1; -create table t1 (a int, b int as (~a)); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT NULL, - `b` int(11) AS (~a) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (1,default); -Warnings: -Warning 1264 Out of range value for column 'b' at row 1 -select * from t1; -a b -1 2147483647 -drop table t1; -set sql_warnings = 0; -# | -set sql_warnings = 1; -create table t1 (a int, b int as (a | 5)); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT NULL, - `b` int(11) AS (a | 5) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (1,default); -insert into t1 values (0,default); -insert into t1 values (2,default); -select * from t1; -a b -1 5 -0 5 -2 7 -drop table t1; -set sql_warnings = 0; -# ^ -set sql_warnings = 1; -create table t1 (a int, b int as (a ^ 5)); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT NULL, - `b` int(11) AS (a ^ 5) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (1,default); -insert into t1 values (0,default); -insert into t1 values (2,default); -select * from t1; -a b -1 4 -0 5 -2 7 -drop table t1; -set sql_warnings = 0; -# DIV -set sql_warnings = 1; -create table t1 (a int, b int as (a div 5)); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT NULL, - `b` int(11) AS (a div 5) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (1,default); -insert into t1 values (7,default); -select * from t1; -a b -1 0 -7 1 -drop table t1; -set sql_warnings = 0; -# <=> -set sql_warnings = 1; -create table t1 (a int, b int, c bool as (a <=> b)); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL, - `c` tinyint(1) AS (a <=> b) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (1,1,default); -insert into t1 values (NULL,NULL,default); -insert into t1 values (1,NULL,default); -select * from t1; -a b c -1 1 1 -NULL NULL 1 -1 NULL 0 -drop table t1; -set sql_warnings = 0; -# = -set sql_warnings = 1; -create table t1 (a varchar(10), b varchar(10), c bool as (a=b)); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(10) DEFAULT NULL, - `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) AS (a=b) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('a','b',default); -insert into t1 values ('a','a',default); -select * from t1; -a b c -a b 0 -a a 1 -drop table t1; -set sql_warnings = 0; -# >= -set sql_warnings = 1; -create table t1 (a varchar(10), b varchar(10), c bool as (a >= b)); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(10) DEFAULT NULL, - `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) AS (a >= b) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('a','b',default); -insert into t1 values ('a','a',default); -select * from t1; -a b c -a b 0 -a a 1 -drop table t1; -set sql_warnings = 0; -# > -set sql_warnings = 1; -create table t1 (a varchar(10), b varchar(10), c bool as (a > b)); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(10) DEFAULT NULL, - `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) AS (a > b) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('a','b',default); -insert into t1 values ('a','a',default); -select * from t1; -a b c -a b 0 -a a 0 -drop table t1; -set sql_warnings = 0; -# IS NOT NULL -set sql_warnings = 1; -create table t1 (a int, b bool as (a is not null)); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT NULL, - `b` tinyint(1) AS (a is not null) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (1,default); -insert into t1 values (NULL,default); -select * from t1; -a b -1 1 -NULL 0 -drop table t1; -set sql_warnings = 0; -# IS NULL -set sql_warnings = 1; -create table t1 (a int, b bool as (a is null)); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT NULL, - `b` tinyint(1) AS (a is null) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (1,default); -insert into t1 values (NULL,default); -select * from t1; -a b -1 0 -NULL 1 -drop table t1; -set sql_warnings = 0; -# << -set sql_warnings = 1; -create table t1 (a int, b int as (a << 2)); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT NULL, - `b` int(11) AS (a << 2) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (1,default); -insert into t1 values (3,default); -select * from t1; -a b -1 4 -3 12 -drop table t1; -set sql_warnings = 0; -# <= -set sql_warnings = 1; -create table t1 (a varchar(10), b varchar(10), c bool as (a <= b)); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(10) DEFAULT NULL, - `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) AS (a <= b) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('b','a',default); -insert into t1 values ('b','b',default); -insert into t1 values ('b','c',default); -select * from t1; -a b c -b a 0 -b b 1 -b c 1 -drop table t1; -set sql_warnings = 0; -# < -set sql_warnings = 1; -create table t1 (a varchar(10), b varchar(10), c bool as (a < b)); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(10) DEFAULT NULL, - `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) AS (a < b) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('b','a',default); -insert into t1 values ('b','b',default); -insert into t1 values ('b','c',default); -select * from t1; -a b c -b a 0 -b b 0 -b c 1 -drop table t1; -set sql_warnings = 0; -# NOT BETWEEN ... AND ... -set sql_warnings = 1; -create table t1 (a int, b bool as (a not between 0 and 2)); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT NULL, - `b` tinyint(1) AS (a not between 0 and 2) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (-1,default); -insert into t1 values (1,default); -select * from t1; -a b --1 1 -1 0 -drop table t1; -set sql_warnings = 0; -# <> -set sql_warnings = 1; -create table t1 (a varchar(10), b varchar(10), c bool as (a <> b)); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(10) DEFAULT NULL, - `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) AS (a <> b) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('b','a',default); -insert into t1 values ('b','b',default); -insert into t1 values ('b','c',default); -select * from t1; -a b c -b a 1 -b b 0 -b c 1 -drop table t1; -set sql_warnings = 0; -# != -set sql_warnings = 1; -create table t1 (a varchar(10), b varchar(10), c bool as (a != b)); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(10) DEFAULT NULL, - `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) AS (a != b) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('b','a',default); -insert into t1 values ('b','b',default); -insert into t1 values ('b','c',default); -select * from t1; -a b c -b a 1 -b b 0 -b c 1 -drop table t1; -set sql_warnings = 0; -# ||, OR -set sql_warnings = 1; -create table t1 (a int, b int as (a>5 || a<3)); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT NULL, - `b` int(11) AS (a>5 || a<3) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (1,default); -insert into t1 values (4,default); -select * from t1; -a b -1 1 -4 0 -drop table t1; -set sql_warnings = 0; -# >> -set sql_warnings = 1; -create table t1 (a int, b int as (a >> 2)); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT NULL, - `b` int(11) AS (a >> 2) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (8,default); -insert into t1 values (3,default); -select * from t1; -a b -8 2 -3 0 -drop table t1; -set sql_warnings = 0; -# XOR -set sql_warnings = 1; -create table t1 (a int, b int as (a xor 5)); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT NULL, - `b` int(11) AS (a xor 5) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (0,default); -insert into t1 values (1,default); -insert into t1 values (2,default); -select * from t1; -a b -0 1 -1 0 -2 0 -drop table t1; -set sql_warnings = 0; -# -# DATE AND TIME FUNCTIONS -# -# ADDDATE() -set sql_warnings = 1; -create table t1 (a datetime, b datetime as (adddate(a,interval 1 month))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` datetime DEFAULT NULL, - `b` datetime AS (adddate(a,interval 1 month)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('2008-08-31',default); -select * from t1; -a b -2008-08-31 00:00:00 2008-09-30 00:00:00 -drop table t1; -set sql_warnings = 0; -# ADDTIME() -set sql_warnings = 1; -create table t1 (a datetime, b datetime as (addtime(a,'02:00:00'))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` datetime DEFAULT NULL, - `b` datetime AS (addtime(a,'02:00:00')) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('2008-08-31',default); -select * from t1; -a b -2008-08-31 00:00:00 2008-08-31 02:00:00 -drop table t1; -set sql_warnings = 0; -# CONVERT_TZ() -set sql_warnings = 1; -create table t1 (a datetime, b datetime as (convert_tz(a,'MET','UTC'))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` datetime DEFAULT NULL, - `b` datetime AS (convert_tz(a,'MET','UTC')) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('2008-08-31',default); -select * from t1; -a b -2008-08-31 00:00:00 2008-08-30 22:00:00 -drop table t1; -set sql_warnings = 0; -# DATE_ADD() -set sql_warnings = 1; -create table t1 (a datetime, b datetime as (date_add(a,interval 1 month))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` datetime DEFAULT NULL, - `b` datetime AS (date_add(a,interval 1 month)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('2008-08-31',default); -select * from t1; -a b -2008-08-31 00:00:00 2008-09-30 00:00:00 -drop table t1; -set sql_warnings = 0; -# DATE_FORMAT() -set sql_warnings = 1; -create table t1 (a datetime, b varchar(64) as (date_format(a,'%W %M %D'))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` datetime DEFAULT NULL, - `b` varchar(64) AS (date_format(a,'%W %M %D')) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('2008-08-31',default); -select * from t1; -a b -2008-08-31 00:00:00 Sunday August 31st -drop table t1; -set sql_warnings = 0; -# DATE_SUB() -set sql_warnings = 1; -create table t1 (a datetime, b datetime as (date_sub(a,interval 1 month))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` datetime DEFAULT NULL, - `b` datetime AS (date_sub(a,interval 1 month)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('2008-08-31',default); -select * from t1; -a b -2008-08-31 00:00:00 2008-07-31 00:00:00 -drop table t1; -set sql_warnings = 0; -# DATE() -set sql_warnings = 1; -create table t1 (a datetime, b datetime as (date(a))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` datetime DEFAULT NULL, - `b` datetime AS (date(a)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('2008-08-31 02:00:00',default); -select * from t1; -a b -2008-08-31 02:00:00 2008-08-31 00:00:00 -drop table t1; -set sql_warnings = 0; -# DATEDIFF() -set sql_warnings = 1; -create table t1 (a datetime, b long as (datediff(a,'2000-01-01'))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` datetime DEFAULT NULL, - `b` mediumtext AS (datediff(a,'2000-01-01')) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('2008-08-31',default); -select * from t1; -a b -2008-08-31 00:00:00 3165 -drop table t1; -set sql_warnings = 0; -# DAY() -set sql_warnings = 1; -create table t1 (a datetime, b int as (day(a))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` datetime DEFAULT NULL, - `b` int(11) AS (day(a)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('2008-08-31',default); -select * from t1; -a b -2008-08-31 00:00:00 31 -drop table t1; -set sql_warnings = 0; -# DAYNAME() -set sql_warnings = 1; -create table t1 (a datetime, b varchar(10) as (dayname(a))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` datetime DEFAULT NULL, - `b` varchar(10) AS (dayname(a)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('2008-08-31',default); -select * from t1; -a b -2008-08-31 00:00:00 Sunday -drop table t1; -set sql_warnings = 0; -# DAYOFMONTH() -set sql_warnings = 1; -create table t1 (a datetime, b int as (dayofmonth(a))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` datetime DEFAULT NULL, - `b` int(11) AS (dayofmonth(a)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('2008-08-31',default); -select * from t1; -a b -2008-08-31 00:00:00 31 -drop table t1; -set sql_warnings = 0; -# DAYOFWEEK() -set sql_warnings = 1; -create table t1 (a datetime, b int as (dayofweek(a))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` datetime DEFAULT NULL, - `b` int(11) AS (dayofweek(a)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('2008-08-31',default); -select * from t1; -a b -2008-08-31 00:00:00 1 -drop table t1; -set sql_warnings = 0; -# DAYOFYEAR() -set sql_warnings = 1; -create table t1 (a datetime, b int as (dayofyear(a))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` datetime DEFAULT NULL, - `b` int(11) AS (dayofyear(a)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('2008-08-31',default); -select * from t1; -a b -2008-08-31 00:00:00 244 -drop table t1; -set sql_warnings = 0; -# EXTRACT -set sql_warnings = 1; -create table t1 (a datetime, b int as (extract(year from a))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` datetime DEFAULT NULL, - `b` int(11) AS (extract(year from a)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('2008-08-31',default); -select * from t1; -a b -2008-08-31 00:00:00 2008 -drop table t1; -set sql_warnings = 0; -# FROM_DAYS() -set sql_warnings = 1; -create table t1 (a long, b datetime as (from_days(a))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` mediumtext, - `b` datetime AS (from_days(a)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (730669,default); -select * from t1; -a b -730669 2000-07-03 00:00:00 -drop table t1; -set sql_warnings = 0; -# FROM_UNIXTIME() -set time_zone='UTC'; -set sql_warnings = 1; -create table t1 (a long, b datetime as (from_unixtime(a))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` mediumtext, - `b` datetime AS (from_unixtime(a)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (1196440219,default); -select * from t1; -a b -1196440219 2007-11-30 16:30:19 -drop table t1; -set sql_warnings = 0; -# GET_FORMAT() -set sql_warnings = 1; -create table t1 (a datetime, b varchar(32) as (date_format(a,get_format(DATE,'EUR')))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` datetime DEFAULT NULL, - `b` varchar(32) AS (date_format(a,get_format(DATE,'EUR'))) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('2008-08-31',default); -select * from t1; -a b -2008-08-31 00:00:00 31.08.2008 -drop table t1; -set sql_warnings = 0; -# HOUR() -set sql_warnings = 1; -create table t1 (a time, b long as (hour(a))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` time DEFAULT NULL, - `b` mediumtext AS (hour(a)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('10:05:03',default); -select * from t1; -a b -10:05:03 10 -drop table t1; -set sql_warnings = 0; -# LAST_DAY() -set sql_warnings = 1; -create table t1 (a datetime, b datetime as (last_day(a))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` datetime DEFAULT NULL, - `b` datetime AS (last_day(a)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('2003-02-05',default); -insert into t1 values ('2003-02-32',default); -Warnings: -Warning 1265 Data truncated for column 'a' at row 1 -select * from t1; -a b -2003-02-05 00:00:00 2003-02-28 00:00:00 -0000-00-00 00:00:00 NULL -drop table t1; -set sql_warnings = 0; -# MAKEDATE() -set sql_warnings = 1; -create table t1 (a int, b datetime as (makedate(a,1))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT NULL, - `b` datetime AS (makedate(a,1)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (2001,default); -select * from t1; -a b -2001 2001-01-01 00:00:00 -drop table t1; -set sql_warnings = 0; -# MAKETIME() -set sql_warnings = 1; -create table t1 (a int, b time as (maketime(a,1,3))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT NULL, - `b` time AS (maketime(a,1,3)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (12,default); -select * from t1; -a b -12 12:01:03 -drop table t1; -set sql_warnings = 0; -# MICROSECOND() -set sql_warnings = 1; -create table t1 (a datetime, b long as (microsecond(a))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` datetime DEFAULT NULL, - `b` mediumtext AS (microsecond(a)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('2009-12-31 12:00:00.123456',default); -insert into t1 values ('2009-12-31 23:59:59.000010',default); -select * from t1; -a b -2009-12-31 12:00:00 0 -2009-12-31 23:59:59 0 -drop table t1; -set sql_warnings = 0; -# MINUTE() -set sql_warnings = 1; -create table t1 (a datetime, b int as (minute(a))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` datetime DEFAULT NULL, - `b` int(11) AS (minute(a)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('2009-12-31 23:59:59.000010',default); -select * from t1; -a b -2009-12-31 23:59:59 59 -drop table t1; -set sql_warnings = 0; -# MONTH() -set sql_warnings = 1; -create table t1 (a datetime, b int as (month(a))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` datetime DEFAULT NULL, - `b` int(11) AS (month(a)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('2009-12-31 23:59:59.000010',default); -select * from t1; -a b -2009-12-31 23:59:59 12 -drop table t1; -set sql_warnings = 0; -# MONTHNAME() -set sql_warnings = 1; -create table t1 (a datetime, b varchar(16) as (monthname(a))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` datetime DEFAULT NULL, - `b` varchar(16) AS (monthname(a)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('2009-12-31 23:59:59.000010',default); -select * from t1; -a b -2009-12-31 23:59:59 December -drop table t1; -set sql_warnings = 0; -# PERIOD_ADD() -set sql_warnings = 1; -create table t1 (a int, b int as (period_add(a,2))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT NULL, - `b` int(11) AS (period_add(a,2)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (200801,default); -select * from t1; -a b -200801 200803 -drop table t1; -set sql_warnings = 0; -# PERIOD_DIFF() -set sql_warnings = 1; -create table t1 (a int, b int, c int as (period_diff(a,b))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL, - `c` int(11) AS (period_diff(a,b)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (200802,200703,default); -select * from t1; -a b c -200802 200703 11 -drop table t1; -set sql_warnings = 0; -# QUARTER() -set sql_warnings = 1; -create table t1 (a datetime, b int as (quarter(a))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` datetime DEFAULT NULL, - `b` int(11) AS (quarter(a)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('2008-08-31',default); -select * from t1; -a b -2008-08-31 00:00:00 3 -drop table t1; -set sql_warnings = 0; -# SEC_TO_TIME() -set sql_warnings = 1; -create table t1 (a long, b time as (sec_to_time(a))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` mediumtext, - `b` time AS (sec_to_time(a)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (2378,default); -select * from t1; -a b -2378 00:39:38 -drop table t1; -set sql_warnings = 0; -# SECOND() -set sql_warnings = 1; -create table t1 (a datetime, b int as (second(a))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` datetime DEFAULT NULL, - `b` int(11) AS (second(a)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('10:05:03',default); -select * from t1; -a b -2010-05-03 00:00:00 0 -drop table t1; -set sql_warnings = 0; -# STR_TO_DATE() -set sql_warnings = 1; -create table t1 (a varchar(64), b datetime as (str_to_date(a,'%m/%d/%Y'))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(64) DEFAULT NULL, - `b` datetime AS (str_to_date(a,'%m/%d/%Y')) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('04/30/2004',default); -select * from t1; -a b -04/30/2004 2004-04-30 00:00:00 -drop table t1; -set sql_warnings = 0; -# SUBDATE() -set sql_warnings = 1; -create table t1 (a datetime, b datetime as (subdate(a,interval 1 month))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` datetime DEFAULT NULL, - `b` datetime AS (subdate(a,interval 1 month)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('2008-08-31',default); -select * from t1; -a b -2008-08-31 00:00:00 2008-07-31 00:00:00 -drop table t1; -set sql_warnings = 0; -# SUBTIME() -set sql_warnings = 1; -create table t1 (a datetime, b datetime as (subtime(a,'02:00:00'))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` datetime DEFAULT NULL, - `b` datetime AS (subtime(a,'02:00:00')) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('2008-08-31',default); -select * from t1; -a b -2008-08-31 00:00:00 2008-08-30 22:00:00 -drop table t1; -set sql_warnings = 0; -# TIME_FORMAT() -set sql_warnings = 1; -create table t1 (a datetime, b varchar(32) as (time_format(a,'%r'))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` datetime DEFAULT NULL, - `b` varchar(32) AS (time_format(a,'%r')) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('2008-08-31 02:03:04',default); -select * from t1; -a b -2008-08-31 02:03:04 02:03:04 AM -drop table t1; -set sql_warnings = 0; -# TIME_TO_SEC() -set sql_warnings = 1; -create table t1 (a time, b long as (time_to_sec(a))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` time DEFAULT NULL, - `b` mediumtext AS (time_to_sec(a)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('22:23:00',default); -select * from t1; -a b -22:23:00 80580 -drop table t1; -set sql_warnings = 0; -# TIME() -set sql_warnings = 1; -create table t1 (a datetime, b time as (time(a))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` datetime DEFAULT NULL, - `b` time AS (time(a)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('2008-08-31 02:03:04',default); -select * from t1; -a b -2008-08-31 02:03:04 02:03:04 -drop table t1; -set sql_warnings = 0; -# TIMEDIFF() -set sql_warnings = 1; -create table t1 (a datetime, b datetime, c long as (timediff(a,b))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` datetime DEFAULT NULL, - `b` datetime DEFAULT NULL, - `c` mediumtext AS (timediff(a,b)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('2008-12-31 23:59:59.000001','2008-12-30 01:01:01.000002',default); -select * from t1; -a b c -2008-12-31 23:59:59 2008-12-30 01:01:01 46:58:58 -drop table t1; -set sql_warnings = 0; -# TIMESTAMP() -set sql_warnings = 1; -create table t1 (a datetime, b timestamp as (timestamp(a))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` datetime DEFAULT NULL, - `b` timestamp AS (timestamp(a)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('2008-12-31',default); -select * from t1; -a b -2008-12-31 00:00:00 2008-12-31 00:00:00 -drop table t1; -set sql_warnings = 0; -# TIMESTAMPADD() -set sql_warnings = 1; -create table t1 (a datetime, b timestamp as (timestampadd(minute,1,a))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` datetime DEFAULT NULL, - `b` timestamp AS (timestampadd(minute,1,a)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('2003-01-02',default); -select * from t1; -a b -2003-01-02 00:00:00 2003-01-02 00:01:00 -drop table t1; -set sql_warnings = 0; -# TIMESTAMPDIFF() -set sql_warnings = 1; -create table t1 (a timestamp, b timestamp, c long as (timestampdiff(MONTH, a,b))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `b` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c` mediumtext AS (timestampdiff(MONTH, a,b)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('2003-02-01','2003-05-01',default); -select * from t1; -a b c -2003-02-01 00:00:00 2003-05-01 00:00:00 3 -drop table t1; -set sql_warnings = 0; -# TO_DAYS() -set sql_warnings = 1; -create table t1 (a datetime, b long as (to_days(a))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` datetime DEFAULT NULL, - `b` mediumtext AS (to_days(a)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('2007-10-07',default); -select * from t1; -a b -2007-10-07 00:00:00 733321 -drop table t1; -set sql_warnings = 0; -# WEEK() -set sql_warnings = 1; -create table t1 (a datetime, b int as (week(a,0))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` datetime DEFAULT NULL, - `b` int(11) AS (week(a,0)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('2008-09-01',default); -select * from t1; -a b -2008-09-01 00:00:00 35 -drop table t1; -set sql_warnings = 0; -# WEEKDAY() -set sql_warnings = 1; -create table t1 (a datetime, b int as (weekday(a))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` datetime DEFAULT NULL, - `b` int(11) AS (weekday(a)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('2008-09-01',default); -select * from t1; -a b -2008-09-01 00:00:00 0 -drop table t1; -set sql_warnings = 0; -# WEEKOFYEAR() -set sql_warnings = 1; -create table t1 (a datetime, b int as (weekofyear(a))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` datetime DEFAULT NULL, - `b` int(11) AS (weekofyear(a)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('2008-09-01',default); -select * from t1; -a b -2008-09-01 00:00:00 36 -drop table t1; -set sql_warnings = 0; -# YEAR() -set sql_warnings = 1; -create table t1 (a datetime, b int as (year(a))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` datetime DEFAULT NULL, - `b` int(11) AS (year(a)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('2008-09-01',default); -select * from t1; -a b -2008-09-01 00:00:00 2008 -drop table t1; -set sql_warnings = 0; -# YEARWEEK() -set sql_warnings = 1; -create table t1 (a datetime, b int as (yearweek(a))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` datetime DEFAULT NULL, - `b` int(11) AS (yearweek(a)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('2008-09-01',default); -select * from t1; -a b -2008-09-01 00:00:00 200835 -drop table t1; -set sql_warnings = 0; -# -# FULL TEXT SEARCH FUNCTIONS -# -# None. -# -# CAST FUNCTIONS AND OPERATORS -# -# CAST() -set sql_warnings = 1; -create table t1 (a int, b long as (cast(a as unsigned))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT NULL, - `b` mediumtext AS (cast(a as unsigned)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (1,default); -insert into t1 values (-1,default); -Warnings: -Note 1105 Cast to unsigned converted negative integer to it's positive complement -select * from t1; -a b -1 1 --1 18446744073709551615 -Warnings: -Note 1105 Cast to unsigned converted negative integer to it's positive complement -Note 1105 Cast to unsigned converted negative integer to it's positive complement -drop table t1; -set sql_warnings = 0; -# Convert() -set sql_warnings = 1; -create table t1 (a int, b long as (convert(a,unsigned))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT NULL, - `b` mediumtext AS (convert(a,unsigned)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (1,default); -insert into t1 values (-1,default); -Warnings: -Note 1105 Cast to unsigned converted negative integer to it's positive complement -select * from t1; -a b -1 1 --1 18446744073709551615 -Warnings: -Note 1105 Cast to unsigned converted negative integer to it's positive complement -Note 1105 Cast to unsigned converted negative integer to it's positive complement -drop table t1; -set sql_warnings = 0; -# -# XML FUNCTIONS -# -# None. -# -# OTHER FUNCTIONS -# -# AES_DECRYPT(), AES_ENCRYPT() -set sql_warnings = 1; -create table t1 (a varchar(1024), b varchar(1024) as (aes_encrypt(aes_decrypt(a,'adf'),'adf'))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (aes_encrypt(aes_decrypt(a,'adf'),'adf')) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('MySQL',default); -select * from t1; -a b -MySQL NULL -drop table t1; -set sql_warnings = 0; -# BIT_COUNT() -set sql_warnings = 1; -create table t1 (a int, b int as (bit_count(a))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT NULL, - `b` int(11) AS (bit_count(a)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values (5,default); -select * from t1; -a b -5 2 -drop table t1; -set sql_warnings = 0; -# COMPRESS(), UNCOMPRESS() -set sql_warnings = 1; -create table t1 (a varchar(1024), b varchar(1024) as (uncompress(compress(a)))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (uncompress(compress(a))) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('MySQL',default); -select * from t1; -a b -MySQL MySQL -drop table t1; -set sql_warnings = 0; -# ENCODE(), DECODE() -set sql_warnings = 1; -create table t1 (a varchar(1024), b varchar(1024) as (decode(encode(a,'abc'),'abc'))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (decode(encode(a,'abc'),'abc')) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('MySQL',default); -select * from t1; -a b -MySQL MySQL -drop table t1; -set sql_warnings = 0; -# DEFAULT() -set sql_warnings = 1; -create table t1 (a varchar(1024) default 'aaa', b varchar(1024) as (ifnull(a,default(a)))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(1024) DEFAULT 'aaa', - `b` varchar(1024) AS (ifnull(a,default(a))) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('any value',default); -select * from t1; -a b -any value any value -drop table t1; -set sql_warnings = 0; -# INET_ATON(), INET_NTOA() -set sql_warnings = 1; -create table t1 (a varchar(1024), b varchar(1024) as (inet_ntoa(inet_aton(a)))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (inet_ntoa(inet_aton(a))) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('127.0.0.1',default); -select * from t1; -a b -127.0.0.1 127.0.0.1 -drop table t1; -set sql_warnings = 0; -# MD5() -set sql_warnings = 1; -create table t1 (a varchar(1024), b varbinary(32) as (md5(a))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(1024) DEFAULT NULL, - `b` varbinary(32) AS (md5(a)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('testing',default); -select * from t1; -a b -testing ae2b1fca515949e5d54fb22b8ed95575 -drop table t1; -set sql_warnings = 0; -# OLD_PASSWORD() -set sql_warnings = 1; -create table t1 (a varchar(1024), b varchar(1024) as (old_password(a))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (old_password(a)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('badpwd',default); -select * from t1; -a b -badpwd 7f84554057dd964b -drop table t1; -set sql_warnings = 0; -# PASSWORD() -set sql_warnings = 1; -create table t1 (a varchar(1024), b varchar(1024) as (password(a))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (password(a)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('badpwd',default); -select * from t1; -a b -badpwd *AAB3E285149C0135D51A520E1940DD3263DC008C -drop table t1; -set sql_warnings = 0; -# SHA1() -set sql_warnings = 1; -create table t1 (a varchar(1024), b varchar(1024) as (sha1(a))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (sha1(a)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('abc',default); -select * from t1; -a b -abc a9993e364706816aba3e25717850c26c9cd0d89d -drop table t1; -set sql_warnings = 0; -# SHA() -set sql_warnings = 1; -create table t1 (a varchar(1024), b varchar(1024) as (sha(a))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (sha(a)) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('abc',default); -select * from t1; -a b -abc a9993e364706816aba3e25717850c26c9cd0d89d -drop table t1; -set sql_warnings = 0; -# UNCOMPRESSED_LENGTH() -set sql_warnings = 1; -create table t1 (a char, b varchar(1024) as (uncompressed_length(compress(repeat(a,30))))); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` char(1) DEFAULT NULL, - `b` varchar(1024) AS (uncompressed_length(compress(repeat(a,30)))) VIRTUAL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -insert into t1 values ('a',default); -select * from t1; -a b -a 30 -drop table t1; -set sql_warnings = 0; diff --git a/mysql-test/suite/vcol/r/vcol_view_innodb.result b/mysql-test/suite/vcol/r/vcol_view_innodb.result index c9a4897e230..447e2fd89b6 100644 --- a/mysql-test/suite/vcol/r/vcol_view_innodb.result +++ b/mysql-test/suite/vcol/r/vcol_view_innodb.result @@ -270,11 +270,11 @@ c int as (-a) persistent); create view v1 as select * from t1 where b > -2 && c >-2 with check option; insert into v1 (a) values (1); insert into v1 (a) values (3); -ERROR HY000: CHECK OPTION failed 'test.v1' +ERROR 44000: CHECK OPTION failed `test`.`v1` insert ignore into v1 (a) values (2),(3),(0); Warnings: -Warning 1369 CHECK OPTION failed 'test.v1' -Warning 1369 CHECK OPTION failed 'test.v1' +Warning 1369 CHECK OPTION failed `test`.`v1` +Warning 1369 CHECK OPTION failed `test`.`v1` select * from t1; a b c 1 -1 -1 diff --git a/mysql-test/suite/vcol/r/vcol_view_myisam.result b/mysql-test/suite/vcol/r/vcol_view_myisam.result index e3fb2ec61ca..1b665e91a0f 100644 --- a/mysql-test/suite/vcol/r/vcol_view_myisam.result +++ b/mysql-test/suite/vcol/r/vcol_view_myisam.result @@ -270,11 +270,11 @@ c int as (-a) persistent); create view v1 as select * from t1 where b > -2 && c >-2 with check option; insert into v1 (a) values (1); insert into v1 (a) values (3); -ERROR HY000: CHECK OPTION failed 'test.v1' +ERROR 44000: CHECK OPTION failed `test`.`v1` insert ignore into v1 (a) values (2),(3),(0); Warnings: -Warning 1369 CHECK OPTION failed 'test.v1' -Warning 1369 CHECK OPTION failed 'test.v1' +Warning 1369 CHECK OPTION failed `test`.`v1` +Warning 1369 CHECK OPTION failed `test`.`v1` select * from t1; a b c 1 -1 -1 diff --git a/mysql-test/suite/vcol/t/not_supported.test b/mysql-test/suite/vcol/t/not_supported.test index 70b9dea69fd..ee6074870de 100644 --- a/mysql-test/suite/vcol/t/not_supported.test +++ b/mysql-test/suite/vcol/t/not_supported.test @@ -16,24 +16,20 @@ create table t1 (a int, b int, v decimal(20,19) as (a/3)); --error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED create table t2 (a int, b int, v int as (a+@a)); --error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t3 (a int, b int, v int as (a+@@error_count)); +create table t2 (a int, b int, v int as (a+@a) PERSISTENT); +create table t3_ok (a int, b int, v int as (a+@@error_count)); +--error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +create table t3 (a int, b int, v int as (a+@@error_count) PERSISTENT); --error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED create table t4 (a int, b int, v int as (@a:=a)); -create table t5 (a int, b int, v varchar(100) as (monthname(a))); -create table t6 (a int, b int, v varchar(100) as (dayname(a))); -create table t7 (a int, b int, v varchar(100) as (date_format(a, '%W %a %M %b'))); +--error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +create table t4 (a int, b int, v int as (@a:=a) PERSISTENT); create table t8 (a int, b int, v varchar(100) as (from_unixtime(a))); insert t1 (a,b) values (1,2); -insert t5 (a,b) values (20141010,2); -insert t6 (a,b) values (20141010,2); -insert t7 (a,b) values (20141010,2); insert t8 (a,b) values (1234567890,2); select * from t1; -select * from t5; -select * from t6; -select * from t7; select * from t8; disconnect con1; @@ -41,18 +37,11 @@ connection default; set time_zone='+1:00'; select * from t1; -select * from t5; -select * from t6; -select * from t7; select * from t8; flush tables; select * from t1; -select * from t5; -select * from t6; -select * from t7; select * from t8; -drop table t1, t5, t6, t7, t8; - +drop table t1, t3_ok, t8; diff --git a/mysql-test/suite/vcol/t/vcol_blocked_sql_funcs_myisam.test b/mysql-test/suite/vcol/t/vcol_blocked_sql_funcs.test similarity index 97% rename from mysql-test/suite/vcol/t/vcol_blocked_sql_funcs_myisam.test rename to mysql-test/suite/vcol/t/vcol_blocked_sql_funcs.test index d8eddb4ef15..3e9e5936476 100644 --- a/mysql-test/suite/vcol/t/vcol_blocked_sql_funcs_myisam.test +++ b/mysql-test/suite/vcol/t/vcol_blocked_sql_funcs.test @@ -39,7 +39,7 @@ eval SET @@session.storage_engine = 'MyISAM'; #------------------------------------------------------------------------------# # Execute the tests to be applied to all storage engines ---source suite/vcol/inc/vcol_blocked_sql_funcs_main.inc +--source vcol_blocked_sql_funcs_main.inc #------------------------------------------------------------------------------# # Execute storage engine specific tests diff --git a/mysql-test/suite/vcol/t/vcol_blocked_sql_funcs_innodb.test b/mysql-test/suite/vcol/t/vcol_blocked_sql_funcs_innodb.test deleted file mode 100644 index 516e121a2aa..00000000000 --- a/mysql-test/suite/vcol/t/vcol_blocked_sql_funcs_innodb.test +++ /dev/null @@ -1,52 +0,0 @@ -################################################################################ -# t/vcol_supported_sql_funcs.test # -# # -# Purpose: # -# Test SQL functions not allowed for virtual columns # -# InnoDB branch # -# # -#------------------------------------------------------------------------------# -# Original Author: Andrey Zhakov # -# Original Date: 2008-08-31 # -# Change Author: # -# Change Date: # -# Change: # -################################################################################ - -# -# NOTE: PLEASE DO NOT ADD NOT MYISAM SPECIFIC TESTCASES HERE ! -# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN -# THE SOURCED FILES ONLY. -# - -#------------------------------------------------------------------------------# -# General not engine specific settings and requirements ---source suite/vcol/inc/vcol_init_vars.pre - -#------------------------------------------------------------------------------# -# Cleanup ---source suite/vcol/inc/vcol_cleanup.inc - -#------------------------------------------------------------------------------# -# Engine specific settings and requirements - -##### Storage engine to be tested -# Set the session storage engine ---source include/have_innodb.inc -eval SET @@session.storage_engine = 'InnoDB'; - -let $skip_full_text_checks = 1; - -##### Workarounds for known open engine specific bugs -# none - -#------------------------------------------------------------------------------# -# Execute the tests to be applied to all storage engines ---source suite/vcol/inc/vcol_blocked_sql_funcs_main.inc - -#------------------------------------------------------------------------------# -# Execute storage engine specific tests - -#------------------------------------------------------------------------------# -# Cleanup ---source suite/vcol/inc/vcol_cleanup.inc diff --git a/mysql-test/suite/vcol/inc/vcol_blocked_sql_funcs_main.inc b/mysql-test/suite/vcol/t/vcol_blocked_sql_funcs_main.inc similarity index 51% rename from mysql-test/suite/vcol/inc/vcol_blocked_sql_funcs_main.inc rename to mysql-test/suite/vcol/t/vcol_blocked_sql_funcs_main.inc index 571fe75560b..492082af30c 100644 --- a/mysql-test/suite/vcol/inc/vcol_blocked_sql_funcs_main.inc +++ b/mysql-test/suite/vcol/t/vcol_blocked_sql_funcs_main.inc @@ -15,194 +15,186 @@ # # NOTE: All SQL functions should be rejected, otherwise BUG. +# As PERSISTANT has higher level checks than VIRTUAL, we use VIRTUAL +# to check for things that should not work for either VIRTUAL or PERSISTENT # --echo # RAND() +create or replace table t1 (b double as (rand())); -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (b double as (rand())); +create or replace table t1 (b double as (rand()) PERSISTENT); --echo # LOAD_FILE() -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a varchar(64), b varchar(1024) as (load_file(a))); +create or replace table t1 (a varchar(64), b varchar(1024) as (load_file(a))); --echo # CURDATE() -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a datetime as (curdate())); +create or replace table t1 (a datetime as (curdate()) PERSISTENT); --echo # CURRENT_DATE(), CURRENT_DATE -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a datetime as (current_date)); +create or replace table t1 (a datetime as (current_date) PERSISTENT); -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a datetime as (current_date())); +create or replace table t1 (a datetime as (current_date()) PERSISTENT); --echo # CURRENT_TIME(), CURRENT_TIME -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a datetime as (current_time)); +create or replace table t1 (a datetime as (current_time) PERSISTENT); -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a datetime as (current_time())); +create or replace table t1 (a datetime as (current_time()) PERSISTENT); --echo # CURRENT_TIMESTAMP(), CURRENT_TIMESTAMP -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a datetime as (current_timestamp())); +create or replace table t1 (a datetime as (current_timestamp()) PERSISTENT); -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a datetime as (current_timestamp)); +create or replace table t1 (a datetime as (current_timestamp) PERSISTENT); --echo # CURTIME() -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a datetime as (curtime())); +create or replace table t1 (a datetime as (curtime()) PERSISTENT); --echo # LOCALTIME(), LOCALTIME -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a datetime, b varchar(10) as (localtime())); +create or replace table t1 (a datetime, b varchar(10) as (localtime()) PERSISTENT); -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a datetime, b varchar(10) as (localtime)); +create or replace table t1 (a datetime, b varchar(10) as (localtime) PERSISTENT); --echo # LOCALTIMESTAMP, LOCALTIMESTAMP()(v4.0.6) -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a datetime, b varchar(10) as (localtimestamp())); +create or replace table t1 (a datetime, b varchar(10) as (localtimestamp()) PERSISTENT); -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a datetime, b varchar(10) as (localtimestamp)); +create or replace table t1 (a datetime, b varchar(10) as (localtimestamp) PERSISTENT); --echo # NOW() -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a datetime, b varchar(10) as (now())); +create or replace table t1 (a datetime, b varchar(10) as (now()) PERSISTENT); --echo # SYSDATE() -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a int, b varchar(10) as (sysdate())); +create or replace table t1 (a int, b varchar(10) as (sysdate()) PERSISTENT); --echo # UNIX_TIMESTAMP() -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a datetime, b datetime as (unix_timestamp())); +create or replace table t1 (a datetime, b datetime as (unix_timestamp()) PERSISTENT); --echo # UTC_DATE() -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a datetime, b datetime as (utc_date())); +create or replace table t1 (a datetime, b datetime as (utc_date()) PERSISTENT); --echo # UTC_TIME() -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a datetime, b datetime as (utc_time())); +create or replace table t1 (a datetime, b datetime as (utc_time()) PERSISTENT); --echo # UTC_TIMESTAMP() -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a datetime, b datetime as (utc_timestamp())); +create or replace table t1 (a datetime, b datetime as (utc_timestamp()) PERSISTENT); --echo # WEEK() - one argument version -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a datetime, b datetime as (week(a))); +create or replace table t1 (a datetime, b datetime as (week(a)) PERSISTENT); --echo # MATCH() -if (!$skip_full_text_checks) -{ - -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED - create table t1 (a varchar(32), b bool as (match a against ('sample text'))); -} +--error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED + create or replace table t1 (a varchar(32), b bool as (match a against ('sample text')) PERSISTENT); --echo # BENCHMARK() -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a varchar(1024), b varchar(1024) as (benchmark(a,3))); +create or replace table t1 (a varchar(1024), b varchar(1024) as (benchmark(a,3))); --echo # CHARSET() --- error ER_CONST_EXPR_IN_VCOL -create table t1 (a varchar(64), b varchar(64) as (charset(a))); +create or replace table t1 (a varchar(64), b varchar(64) as (charset(a)) PERSISTENT); --echo # COERCIBILITY() --- error ER_CONST_EXPR_IN_VCOL -create table t1 (a varchar(64), b int as (coercibility(a))); +create or replace table t1 (a varchar(64), b int as (coercibility(a)) PERSISTENT); --echo # COLLATION() --- error ER_CONST_EXPR_IN_VCOL -create table t1 (a varchar(64), b varchar(64) as (collation(a))); +create or replace table t1 (a varchar(64), b varchar(64) as (collation(a)) PERSISTENT); --echo # CONNECTION_ID() +create or replace table t1 (a int as (connection_id())); -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a int as (connection_id())); - ---echo # CURRENT_USER(), CURRENT_USER --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a varchar(32) as (current_user())); --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a varchar(32) as (current_user)); +create or replace table t1 (a int as (connection_id()) PERSISTENT); --echo # DATABASE() +create or replace table t1 (a varchar(32) as (database())); -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a varchar(1024), b varchar(1024) as (database())); +create or replace table t1 (a varchar(1024), b varchar(1024) as (database()) PERSISTENT); --echo # FOUND_ROWS() -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a varchar(1024), b varchar(1024) as (found_rows())); +create or replace table t1 (a varchar(1024), b varchar(1024) as (found_rows())); --echo # GET_LOCK() -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a varchar(1024), b varchar(1024) as (get_lock(a,10))); +create or replace table t1 (a varchar(1024), b varchar(1024) as (get_lock(a,10))); --echo # IS_FREE_LOCK() -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a varchar(1024), b varchar(1024) as (is_free_lock(a))); +create or replace table t1 (a varchar(1024), b varchar(1024) as (is_free_lock(a))); --echo # IS_USED_LOCK() -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a varchar(1024), b varchar(1024) as (is_used_lock(a))); +create or replace table t1 (a varchar(1024), b varchar(1024) as (is_used_lock(a))); --echo # LAST_INSERT_ID() -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a int as (last_insert_id())); +create or replace table t1 (a int as (last_insert_id())); --echo # MASTER_POS_WAIT() -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a varchar(32), b int as (master_pos_wait(a,0,2))); +create or replace table t1 (a varchar(32), b int as (master_pos_wait(a,0,2))); --echo # NAME_CONST() -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a varchar(32) as (name_const('test',1))); +create or replace table t1 (a varchar(32) as (name_const('test',1))); --echo # RELEASE_LOCK() -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a varchar(32), b int as (release_lock(a))); +create or replace table t1 (a varchar(32), b int as (release_lock(a))); --echo # ROW_COUNT() -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a int as (row_count())); +create or replace table t1 (a int as (row_count())); --echo # SCHEMA() -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a varchar(32) as (schema())); +create or replace table t1 (a varchar(32) as (schema()) PERSISTENT); --echo # SESSION_USER() -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a varchar(32) as (session_user())); +create or replace table t1 (a varchar(32) as (session_user()) PERSISTENT); --echo # SLEEP() -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a int, b int as (sleep(a))); +create or replace table t1 (a int, b int as (sleep(a))); --echo # SYSTEM_USER() -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a varchar(32) as (system_user())); +create or replace table t1 (a varchar(32) as (system_user()) PERSISTENT); --echo # USER() -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a varchar(1024), b varchar(1024) as (user())); +create or replace table t1 (a varchar(1024), b varchar(1024) as (user()) PERSISTENT); --echo # UUID_SHORT() -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a varchar(1024) as (uuid_short())); +create or replace table t1 (a varchar(1024) as (uuid_short()) PERSISTENT); --echo # UUID() -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a varchar(1024) as (uuid())); +create or replace table t1 (a varchar(1024) as (uuid()) PERSISTENT); --echo # VALUES() -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a varchar(1024), b varchar(1024) as (values(a))); +create or replace table t1 (a varchar(1024), b varchar(1024) as (values(a))); --echo # VERSION() -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a varchar(1024), b varchar(1024) as (version())); +create or replace table t1 (a varchar(1024), b varchar(1024) as (version()) PERSISTENT); --echo # ENCRYPT() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a varchar(1024), b varchar(1024) as (encrypt(a))); +create or replace table t1 (a varchar(1024), b varchar(1024) as (encrypt(a)) PERSISTENT); --echo # Stored procedures @@ -221,16 +213,16 @@ end // delimiter ;// -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a int as (p1())); +create or replace table t1 (a int as (p1()) PERSISTENT); -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a int as (f1())); +create or replace table t1 (a int as (f1()) PERSISTENT); drop procedure p1; drop function f1; --echo # Unknown functions -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a int as (f1())); +create or replace table t1 (a int as (f1()) PERSISTENT); --echo # --echo # GROUP BY FUNCTIONS @@ -238,97 +230,95 @@ create table t1 (a int as (f1())); --echo # AVG() -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a int, b int as (avg(a))); +create or replace table t1 (a int, b int as (avg(a))); --echo # BIT_AND() -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a int, b int as (bit_and(a))); +create or replace table t1 (a int, b int as (bit_and(a))); --echo # BIT_OR() -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a int, b int as (bit_or(a))); +create or replace table t1 (a int, b int as (bit_or(a))); --echo # BIT_XOR() -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a int, b int as (bit_xor(a))); +create or replace table t1 (a int, b int as (bit_xor(a))); --echo # COUNT(DISTINCT) -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a int, b int as (count(distinct a))); +create or replace table t1 (a int, b int as (count(distinct a))); --echo # COUNT() -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a int, b int as (count(a))); +create or replace table t1 (a int, b int as (count(a))); --echo # GROUP_CONCAT() -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a varchar(32), b int as (group_concat(a,''))); +create or replace table t1 (a varchar(32), b int as (group_concat(a,''))); --echo # MAX() -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a int, b int as (max(a))); +create or replace table t1 (a int, b int as (max(a))); --echo # MIN() -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a int, b int as (min(a))); +create or replace table t1 (a int, b int as (min(a))); --echo # STD() -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a int, b int as (std(a))); +create or replace table t1 (a int, b int as (std(a))); --echo # STDDEV_POP() -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a int, b int as (stddev_pop(a))); +create or replace table t1 (a int, b int as (stddev_pop(a))); --echo # STDDEV_SAMP() -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a int, b int as (stddev_samp(a))); +create or replace table t1 (a int, b int as (stddev_samp(a))); --echo # STDDEV() -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a int, b int as (stddev(a))); +create or replace table t1 (a int, b int as (stddev(a))); --echo # SUM() -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a int, b int as (sum(a))); +create or replace table t1 (a int, b int as (sum(a))); --echo # VAR_POP() -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a int, b int as (var_pop(a))); +create or replace table t1 (a int, b int as (var_pop(a))); --echo # VAR_SAMP() -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a int, b int as (var_samp(a))); +create or replace table t1 (a int, b int as (var_samp(a))); --echo # VARIANCE() -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a int, b int as (variance(a))); +create or replace table t1 (a int, b int as (variance(a))); --echo # --echo # XML FUNCTIONS --echo # --echo # ExtractValue() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a varchar(1024), b varchar(1024) as (ExtractValue(a,'//b[$@j]'))); +create or replace table t1 (a varchar(1024), b varchar(1024) as (ExtractValue(a,'//b[$@j]')) PERSISTENT); --echo # UpdateXML() --- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a varchar(1024), b varchar(1024) as (UpdateXML(a,'/a','fff'))); +create or replace table t1 (a varchar(1024), b varchar(1024) as (UpdateXML(a,'/a','fff')) PERSISTENT); --echo # --echo # Sub-selects --echo # -create table t1 (a int); --- error ER_PARSE_ERROR -create table t2 (a int, b int as (select count(*) from t1)); +create or replace table t1 (a int); +-- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +create or replace table t2 (a int, b int as (select count(*) from t1)); drop table t1; -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a int, b int as ((select 1))); +create or replace table t1 (a int, b int as ((select 1))); -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a int, b int as (a+(select 1))); +create or replace table t1 (a int, b int as (a+(select 1))); --echo # --echo # SP functions @@ -341,20 +331,26 @@ create function sub1(i int) returns int deterministic return i+1; select sub1(1); -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -create table t1 (a int, b int as (a+sub3(1))); +create or replace table t1 (a int, b int as (a+sub3(1))); drop function sub1; --echo # --echo # Long expression let $tmp_long_string = `SELECT repeat('a',240)`; -eval create table t1 (a int, b varchar(300) as (concat(a,'$tmp_long_string'))); +eval create or replace table t1 (a int, b varchar(300) as (concat(a,'$tmp_long_string'))); drop table t1; let $tmp_long_string = `SELECT repeat('a',243)`; ---error ER_WRONG_STRING_LENGTH -eval create table t1 (a int, b varchar(300) as (concat(a,'$tmp_long_string'))); +eval create or replace table t1 (a int, b varchar(16384) as (concat(a,'$tmp_long_string'))); + +--disable_query_log +let $tmp_long_string = `SELECT repeat('a',65535)`; +--error ER_TOO_MANY_FIELDS +eval create or replace table t1 (a int, b varchar(16384) as (concat(a,'$tmp_long_string'))); +--enable_query_log --echo # --echo # Constant expression ---error ER_CONST_EXPR_IN_VCOL -create table t1 (a int as (PI())); +create or replace table t1 (a int as (PI()) PERSISTENT); + +drop table if exists t1; diff --git a/mysql-test/suite/vcol/t/vcol_misc.test b/mysql-test/suite/vcol/t/vcol_misc.test index c78093bce0f..4ca9562221c 100644 --- a/mysql-test/suite/vcol/t/vcol_misc.test +++ b/mysql-test/suite/vcol/t/vcol_misc.test @@ -26,7 +26,7 @@ drop table t1; # Bug#604549: Expression for virtual column returns row # --- error ER_ROW_EXPR_FOR_VCOL +-- error ER_OPERAND_COLUMNS CREATE TABLE t1 ( a int NOT NULL DEFAULT '0', v double AS ((1, a)) VIRTUAL @@ -279,9 +279,12 @@ drop table t1; --echo # MDEV-5611: self-referencing virtual column --echo # ---error ER_VCOL_BASED_ON_VCOL +--error ER_EXPRESSION_REFERS_TO_UNINIT_FIELD create table t1 (a int, b int as (b is null) virtual); +create table t1 (a int as (1+1), b int as (a is null) virtual); +drop table t1; + --echo # end of 5.3 tests # diff --git a/mysql-test/suite/vcol/t/vcol_supported_sql_funcs_myisam.test b/mysql-test/suite/vcol/t/vcol_supported_sql_funcs.test similarity index 97% rename from mysql-test/suite/vcol/t/vcol_supported_sql_funcs_myisam.test rename to mysql-test/suite/vcol/t/vcol_supported_sql_funcs.test index aa5833451c6..d1e21af059b 100644 --- a/mysql-test/suite/vcol/t/vcol_supported_sql_funcs_myisam.test +++ b/mysql-test/suite/vcol/t/vcol_supported_sql_funcs.test @@ -39,7 +39,7 @@ eval SET @@session.storage_engine = 'MyISAM'; #------------------------------------------------------------------------------# # Execute the tests to be applied to all storage engines ---source suite/vcol/inc/vcol_supported_sql_funcs_main.inc +--source vcol_supported_sql_funcs_main.inc #------------------------------------------------------------------------------# # Execute storage engine specific tests diff --git a/mysql-test/suite/vcol/t/vcol_supported_sql_funcs_innodb.test b/mysql-test/suite/vcol/t/vcol_supported_sql_funcs_innodb.test deleted file mode 100644 index 53826a460a7..00000000000 --- a/mysql-test/suite/vcol/t/vcol_supported_sql_funcs_innodb.test +++ /dev/null @@ -1,50 +0,0 @@ -################################################################################ -# t/vcol_supported_sql_funcs.test # -# # -# Purpose: # -# Test SQL functions allowed for virtual columns # -# InnoDB branch # -# # -#------------------------------------------------------------------------------# -# Original Author: Andrey Zhakov # -# Original Date: 2008-08-31 # -# Change Author: # -# Change Date: # -# Change: # -################################################################################ - -# -# NOTE: PLEASE DO NOT ADD NOT MYISAM SPECIFIC TESTCASES HERE ! -# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN -# THE SOURCED FILES ONLY. -# - -#------------------------------------------------------------------------------# -# General not engine specific settings and requirements ---source suite/vcol/inc/vcol_init_vars.pre - -#------------------------------------------------------------------------------# -# Cleanup ---source suite/vcol/inc/vcol_cleanup.inc - -#------------------------------------------------------------------------------# -# Engine specific settings and requirements - -##### Storage engine to be tested -# Set the session storage engine ---source include/have_innodb.inc -SET @@session.storage_engine = 'InnoDB'; - -##### Workarounds for known open engine specific bugs -# none - -#------------------------------------------------------------------------------# -# Execute the tests to be applied to all storage engines ---source suite/vcol/inc/vcol_supported_sql_funcs_main.inc - -#------------------------------------------------------------------------------# -# Execute storage engine specific tests - -#------------------------------------------------------------------------------# -# Cleanup ---source suite/vcol/inc/vcol_cleanup.inc diff --git a/mysql-test/suite/vcol/inc/vcol_supported_sql_funcs_main.inc b/mysql-test/suite/vcol/t/vcol_supported_sql_funcs_main.inc similarity index 98% rename from mysql-test/suite/vcol/inc/vcol_supported_sql_funcs_main.inc rename to mysql-test/suite/vcol/t/vcol_supported_sql_funcs_main.inc index 38f2b00a1a0..4a95ea75534 100644 --- a/mysql-test/suite/vcol/inc/vcol_supported_sql_funcs_main.inc +++ b/mysql-test/suite/vcol/t/vcol_supported_sql_funcs_main.inc @@ -842,12 +842,6 @@ let $values1 = '2008-08-31',default; let $rows = 1; --source suite/vcol/inc/vcol_supported_sql_funcs.inc ---echo # DATE_FORMAT() -let $cols = a datetime, b varchar(64) as (date_format(a,'%W %M %D')); -let $values1 = '2008-08-31',default; -let $rows = 1; ---source suite/vcol/inc/vcol_supported_sql_funcs.inc - --echo # DATE_SUB() let $cols = a datetime, b datetime as (date_sub(a,interval 1 month)); let $values1 = '2008-08-31',default; @@ -872,12 +866,6 @@ let $values1 = '2008-08-31',default; let $rows = 1; --source suite/vcol/inc/vcol_supported_sql_funcs.inc ---echo # DAYNAME() -let $cols = a datetime, b varchar(10) as (dayname(a)); -let $values1 = '2008-08-31',default; -let $rows = 1; ---source suite/vcol/inc/vcol_supported_sql_funcs.inc - --echo # DAYOFMONTH() let $cols = a datetime, b int as (dayofmonth(a)); let $values1 = '2008-08-31',default; @@ -915,12 +903,6 @@ let $rows = 1; set time_zone='UTC'; --source suite/vcol/inc/vcol_supported_sql_funcs.inc ---echo # GET_FORMAT() -let $cols = a datetime, b varchar(32) as (date_format(a,get_format(DATE,'EUR'))); -let $values1 = '2008-08-31',default; -let $rows = 1; ---source suite/vcol/inc/vcol_supported_sql_funcs.inc - --echo # HOUR() let $cols = a time, b long as (hour(a)); let $values1 = '10:05:03',default; @@ -965,12 +947,6 @@ let $values1 = '2009-12-31 23:59:59.000010',default; let $rows = 1; --source suite/vcol/inc/vcol_supported_sql_funcs.inc ---echo # MONTHNAME() -let $cols = a datetime, b varchar(16) as (monthname(a)); -let $values1 = '2009-12-31 23:59:59.000010',default; -let $rows = 1; ---source suite/vcol/inc/vcol_supported_sql_funcs.inc - --echo # PERIOD_ADD() let $cols = a int, b int as (period_add(a,2)); let $values1 = 200801,default; @@ -1019,12 +995,6 @@ let $values1 = '2008-08-31',default; let $rows = 1; --source suite/vcol/inc/vcol_supported_sql_funcs.inc ---echo # TIME_FORMAT() -let $cols = a datetime, b varchar(32) as (time_format(a,'%r')); -let $values1 = '2008-08-31 02:03:04',default; -let $rows = 1; ---source suite/vcol/inc/vcol_supported_sql_funcs.inc - --echo # TIME_TO_SEC() let $cols = a time, b long as (time_to_sec(a)); let $values1 = '22:23:00',default; @@ -1209,3 +1179,33 @@ let $values1 = 'a',default; let $rows = 1; --source suite/vcol/inc/vcol_supported_sql_funcs.inc +--echo # MONTHNAME() +let $cols = a date, b varchar(100) as (monthname(a)); +let $values1 = '2010-10-10',default; +let $rows = 1; +--source suite/vcol/inc/vcol_supported_sql_funcs.inc + +--echo # DAYNAME() +let $cols = a date, b varchar(100) as (dayname(a)); +let $values1 = '2011-11-11',default; +let $rows = 1; +--source suite/vcol/inc/vcol_supported_sql_funcs.inc + +--echo # DATE_FORMAT() +let $cols = a date, b varchar(100) as (date_format(a, '%W %a %M %b')); +let $values1 = '2012-12-12',default; +let $rows = 1; +--source suite/vcol/inc/vcol_supported_sql_funcs.inc + +--echo # CURRENT_USER() +let $cols = a char, b varchar(32) as (current_user()); +let $values1 = 'a', default; +let $rows = 1; +--source suite/vcol/inc/vcol_supported_sql_funcs.inc + +--echo # TIME_FORMAT() +let $cols = a datetime, b varchar(10) as (time_format(a,"%d.%m.%Y")); +let $values1 = '2001-01-01 02:02:02',default; +let $rows = 1; +--source suite/vcol/inc/vcol_supported_sql_funcs.inc + diff --git a/mysql-test/suite/wsrep/r/binlog_format.result b/mysql-test/suite/wsrep/r/binlog_format.result index d996371c056..1ca90bd626d 100644 --- a/mysql-test/suite/wsrep/r/binlog_format.result +++ b/mysql-test/suite/wsrep/r/binlog_format.result @@ -1,5 +1,5 @@ call mtr.add_suppression("WSREP: MariaDB Galera does not support binlog format.*"); -call mtr.add_suppression("WSREP: cannot get fake InnoDB transaction ID"); +call mtr.add_suppression("WSREP: Cannot get fake transaction ID from storage engine."); # # MDEV-4227: Galera server should stop crashing on setting binlog_format STATEMENT # diff --git a/mysql-test/suite/wsrep/r/mdev_10186.result b/mysql-test/suite/wsrep/r/mdev_10186.result new file mode 100644 index 00000000000..f966c443569 --- /dev/null +++ b/mysql-test/suite/wsrep/r/mdev_10186.result @@ -0,0 +1,11 @@ +# +# MDEV-10186: mysqld crash when runtime setting +# wsrep_cluster_address without wsrep_on=ON +# +SELECT @@wsrep_on; +@@wsrep_on +0 +SELECT @@GLOBAL.wsrep_provider; +@@GLOBAL.wsrep_provider +/usr/lib/galera/libgalera_smm.so +SET @@GLOBAL.wsrep_cluster_address='gcomm://'; diff --git a/mysql-test/suite/wsrep/suite.pm b/mysql-test/suite/wsrep/suite.pm index a7939c2e333..b6c5bf15ca1 100644 --- a/mysql-test/suite/wsrep/suite.pm +++ b/mysql-test/suite/wsrep/suite.pm @@ -26,8 +26,6 @@ push @::global_suppressions, ( qr(WSREP: Could not open saved state file for reading: .*), qr(WSREP: Could not open state file for reading: .*), - qr(WSREP: option --wsrep-causal-reads is deprecated), - qr(WSREP: --wsrep-causal-reads=ON takes precedence over --wsrep-sync-wait=0), qr|WSREP: access file\(.*gvwstate.dat\) failed\(No such file or directory\)|, ); diff --git a/mysql-test/suite/wsrep/t/binlog_format.test b/mysql-test/suite/wsrep/t/binlog_format.test index a2dc8542322..85864256862 100644 --- a/mysql-test/suite/wsrep/t/binlog_format.test +++ b/mysql-test/suite/wsrep/t/binlog_format.test @@ -2,7 +2,7 @@ --source include/have_binlog_format_row.inc call mtr.add_suppression("WSREP: MariaDB Galera does not support binlog format.*"); -call mtr.add_suppression("WSREP: cannot get fake InnoDB transaction ID"); +call mtr.add_suppression("WSREP: Cannot get fake transaction ID from storage engine."); --echo # --echo # MDEV-4227: Galera server should stop crashing on setting binlog_format STATEMENT diff --git a/mysql-test/suite/wsrep/t/mdev_10186.opt b/mysql-test/suite/wsrep/t/mdev_10186.opt new file mode 100644 index 00000000000..e2655959c62 --- /dev/null +++ b/mysql-test/suite/wsrep/t/mdev_10186.opt @@ -0,0 +1 @@ +--wsrep-provider=$WSREP_PROVIDER --wsrep-cluster-address=gcomm:// --wsrep-on=0 diff --git a/mysql-test/suite/wsrep/t/mdev_10186.test b/mysql-test/suite/wsrep/t/mdev_10186.test new file mode 100644 index 00000000000..90665d3c97f --- /dev/null +++ b/mysql-test/suite/wsrep/t/mdev_10186.test @@ -0,0 +1,13 @@ +--source include/have_wsrep_provider.inc +--source include/have_binlog_format_row.inc + +--echo # +--echo # MDEV-10186: mysqld crash when runtime setting +--echo # wsrep_cluster_address without wsrep_on=ON +--echo # + +SELECT @@wsrep_on; +--replace_result /usr/lib64/ /usr/lib/ +SELECT @@GLOBAL.wsrep_provider; +SET @@GLOBAL.wsrep_cluster_address='gcomm://'; + diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test index 8f4b3ee2fb7..7811de0f9f7 100644 --- a/mysql-test/t/alter_table.test +++ b/mysql-test/t/alter_table.test @@ -1455,6 +1455,8 @@ ALTER TABLE m1 ENABLE KEYS, ALGORITHM= INPLACE, LOCK= SHARED; ALTER TABLE m1 ENABLE KEYS, ALGORITHM= INPLACE, LOCK= EXCLUSIVE; --error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON ALTER TABLE m1 ENABLE KEYS, ALGORITHM= COPY, LOCK= NONE; +--error ER_ALTER_OPERATION_NOT_SUPPORTED +ALTER ONLINE TABLE m1 ADD COLUMN c int; # This works because the lock will be SNW for the copy phase. # It will still require exclusive lock for actually enabling keys. ALTER TABLE m1 ENABLE KEYS, ALGORITHM= COPY, LOCK= SHARED; diff --git a/mysql-test/t/alter_table_online.test b/mysql-test/t/alter_table_online.test index 6386a1551e1..22ebadd64f9 100644 --- a/mysql-test/t/alter_table_online.test +++ b/mysql-test/t/alter_table_online.test @@ -3,9 +3,7 @@ # --source include/have_innodb.inc ---disable_warnings -drop table if exists t1,t2,t3; ---enable_warnings +--source include/have_partition.inc # # Test of things that can be done online # @@ -102,6 +100,28 @@ create table t3 (a int not null primary key, b int, c varchar(80)) engine=merge alter online table t3 union=(t1,t2); drop table t1,t2,t3; +# +# MDEV-9868 Altering a partitioned table comment does a full copy +# +create table t1 (i int) partition by hash(i) partitions 2; +alter online table t1 comment 'test'; +drop table t1; + +# +# MDEV-9168 altering a column comment does a full copy +# +create table t1 (a int); +alter online table t1 modify a int comment 'test'; +drop table t1; + +create table t1 (a int) engine=innodb; +alter online table t1 modify a int comment 'test'; +drop table t1; + +create table t1 (a int) partition by hash(a) partitions 2; +alter online table t1 modify a int comment 'test'; +drop table t1; + --echo # --echo # MDEV-8948 ALTER ... INPLACE does work for BINARY, BLOB --echo # diff --git a/mysql-test/t/bigint.test b/mysql-test/t/bigint.test index 41f33b8a7f2..fb18d60edd9 100644 --- a/mysql-test/t/bigint.test +++ b/mysql-test/t/bigint.test @@ -409,3 +409,8 @@ SELECT * FROM t1 WHERE a=0.9; SELECT * FROM t1 WHERE a IN (0.8,0.9); DROP TABLE t1; + +--echo # +--echo # MDEV-9372 select 100 between 1 and 9223372036854775808 returns false +--echo # +SELECT 100 BETWEEN 1 AND 9223372036854775808; diff --git a/mysql-test/t/bootstrap.test b/mysql-test/t/bootstrap.test index 840b9a12cee..a7e0ff17494 100644 --- a/mysql-test/t/bootstrap.test +++ b/mysql-test/t/bootstrap.test @@ -80,7 +80,7 @@ EOF --write_file $MYSQLTEST_VARDIR/tmp/bootstrap_plugins.sql SET SQL_MODE=""; use test; -create table t1(a int) engine=example; +create table t1(a int) engine=example charset=latin1; EOF --exec $MYSQLD_BOOTSTRAP_CMD --plugin-dir=$PLUGIN_DIR < $MYSQLTEST_VARDIR/tmp/bootstrap_plugins.sql >> $MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1 --remove_file $MYSQLTEST_VARDIR/tmp/bootstrap_plugins.sql @@ -90,3 +90,13 @@ drop table t1; --replace_result .dll .so select * from mysql.plugin; truncate table mysql.plugin; + + +# +# MDEV-9969 mysql_install_db error processing ignore_db_dirs. +# +--write_file $MYSQLTEST_VARDIR/tmp/bootstrap_9969.sql +use test; +EOF +--exec $MYSQLD_BOOTSTRAP_CMD --ignore-db-dirs='some_dir' --ignore-db-dirs='some_dir' < $MYSQLTEST_VARDIR/tmp/bootstrap_9969.sql >> $MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1 +--remove_file $MYSQLTEST_VARDIR/tmp/bootstrap_9969.sql diff --git a/mysql-test/t/cache_temporal_4265.test b/mysql-test/t/cache_temporal_4265.test index 6135438f023..c62f3c3c506 100644 --- a/mysql-test/t/cache_temporal_4265.test +++ b/mysql-test/t/cache_temporal_4265.test @@ -7,5 +7,16 @@ create table t1 (a date); insert t1 values ('2000-01-02'), ('2001-02-03'), ('2002-03-04'); set debug_dbug='d,str_to_datetime_warn'; select * from t1 where a > date_add('2000-01-01', interval 5 day); +set debug_dbug=''; +drop table t1; + +# +# MDEV-9707 MAX(timestamp(6) column) in correlated sub-query returns non-existent row data in original table +# +create table t1 (id int not null, ut timestamp(6) not null); +insert into t1 values(1, '2001-01-01 00:00:00.2'); +insert into t1 values(1, '2001-01-01 00:00:00.1'); +select * from t1; +select (select max(m2.ut) from t1 m2 where m1.id <> 0) from t1 m1; drop table t1; diff --git a/mysql-test/t/case.test b/mysql-test/t/case.test index 957c4ac5c9d..7cc74c52b28 100644 --- a/mysql-test/t/case.test +++ b/mysql-test/t/case.test @@ -193,6 +193,16 @@ insert t1 values ('00:00:00'),('00:01:00'); select case t1.f1 when '00:00:00' then 1 end from t1; drop table t1; +--echo # +--echo # MDEV-9745 Crash with CASE WHEN TRUE THEN COALESCE(CAST(NULL AS UNSIGNED)) ELSE 4 END +--echo # +CREATE TABLE t1 SELECT CASE WHEN TRUE THEN COALESCE(CAST(NULL AS UNSIGNED)) ELSE 4 END AS a; +DESCRIBE t1; +DROP TABLE t1; +CREATE TABLE t1 SELECT CASE WHEN TRUE THEN COALESCE(CAST(NULL AS UNSIGNED)) ELSE 40 END AS a; +DESCRIBE t1; +DROP TABLE t1; + --echo # --echo # Start of 10.1 test --echo # diff --git a/mysql-test/t/change_user.test b/mysql-test/t/change_user.test index c918224520d..d191b1c3ca0 100644 --- a/mysql-test/t/change_user.test +++ b/mysql-test/t/change_user.test @@ -142,3 +142,10 @@ if ($after != $before){ echo Value of com_select did not change; set global secure_auth=default; + +set timestamp=unix_timestamp('2010-10-10 10:10:10'); +select now(); +select year(now()) > 2011; +--echo change_user +--change_user +select year(now()) > 2011; diff --git a/mysql-test/t/check_constraint.test b/mysql-test/t/check_constraint.test new file mode 100644 index 00000000000..8dd6fcc4f27 --- /dev/null +++ b/mysql-test/t/check_constraint.test @@ -0,0 +1,71 @@ +# +# Check of check constraints + +set @save_check_constraint=@@check_constraint_checks; + +create table t1 (a int check(a>10), b int check (b > 20), constraint `min` check (a+b > 100), constraint `max` check (a+b <500)) engine=myisam; +show create table t1; +insert into t1 values (100,100); +--error ER_CONSTRAINT_FAILED +insert into t1 values (1,1); +--error ER_CONSTRAINT_FAILED +insert into t1 values (20,1); +--error ER_CONSTRAINT_FAILED +insert into t1 values (20,30); +--error ER_CONSTRAINT_FAILED +insert into t1 values (500,500); + +--error ER_CONSTRAINT_FAILED +insert into t1 values (101,101),(102,102),(600,600),(103,103); +select * from t1; +truncate table t1; +insert ignore into t1 values (101,101),(102,102),(600,600),(103,103); +select * from t1; +set check_constraint_checks=0; +truncate table t1; +insert into t1 values (101,101),(102,102),(600,600),(103,103); +select * from t1; +set check_constraint_checks=@save_check_constraint; + +--replace_regex /failed for.*/failed for table/ +--error ER_CONSTRAINT_FAILED +alter table t1 add c int default 0 check (c < 10); + +set check_constraint_checks=0; +alter table t1 add c int default 0 check (c < 10); +alter table t1 add check (a+b+c < 500); +set check_constraint_checks=@save_check_constraint; + +show create table t1; +--error ER_CONSTRAINT_FAILED +insert into t1 values(105,105,105); +--error ER_CONSTRAINT_FAILED +insert into t1 values(249,249,9); +insert into t1 values(105,105,9); +select * from t1; + +create table t2 like t1; +show create table t2; +--error ER_CANT_DROP_FIELD_OR_KEY +alter table t2 drop constraint c; +alter table t2 drop constraint if exists c; +alter table t2 drop constraint min; +show create table t2; + +drop table t1,t2; + +# +# check constraint name auto-generation: +# +create or replace table t1 (a int, b int, constraint check (a>b)); +show create table t1; +create or replace table t1 (a int, b int, + constraint CONSTRAINT_1 check (a>1), + constraint check (b>1)); +show create table t1; +create or replace table t1 (a int, b int, + constraint CONSTRAINT_1 check (a>1), + constraint check (b>1), + constraint CONSTRAINT_2 check (a>b)); +show create table t1; +drop table t1; diff --git a/mysql-test/t/constraints.test b/mysql-test/t/constraints.test index 70a95e5f16e..1997c23bfa9 100644 --- a/mysql-test/t/constraints.test +++ b/mysql-test/t/constraints.test @@ -1,24 +1,30 @@ # # Testing of constraints -# Currently MySQL only ignores the syntax. # --disable_warnings drop table if exists t1; --enable_warnings create table t1 (a int check (a>0)); +show create table t1; insert into t1 values (1); +--error ER_CONSTRAINT_FAILED insert into t1 values (0); drop table t1; create table t1 (a int, b int, check (a>b)); +show create table t1; insert into t1 values (1,0); +--error ER_CONSTRAINT_FAILED insert into t1 values (0,1); drop table t1; create table t1 (a int ,b int, constraint abc check (a>b)); +show create table t1; insert into t1 values (1,0); +--error ER_CONSTRAINT_FAILED insert into t1 values (0,1); drop table t1; create table t1 (a int null); +show create table t1; insert into t1 values (1),(NULL); drop table t1; create table t1 (a int null); diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test index 10ee41ca2aa..0fd3e31a5b4 100644 --- a/mysql-test/t/create.test +++ b/mysql-test/t/create.test @@ -1618,7 +1618,6 @@ drop view t1; create table t1 (a int) select 1 as a; create temporary table if not exists t1 (a int) select * from t1; ---error ER_CANT_REOPEN_TABLE create temporary table if not exists t1 (a int) select * from t1; select * from t1; drop temporary table t1; diff --git a/mysql-test/t/create_or_replace.test b/mysql-test/t/create_or_replace.test index 3e37910380c..6d744679d67 100644 --- a/mysql-test/t/create_or_replace.test +++ b/mysql-test/t/create_or_replace.test @@ -214,15 +214,18 @@ create table test.t1 (i int); create table mysqltest2.t2 like test.t1; lock table test.t1 write, mysqltest2.t2 write; --replace_column 1 # +--sorted_result select * from information_schema.metadata_lock_info; --error ER_TABLE_MUST_HAVE_COLUMNS create or replace table test.t1; show tables; --replace_column 1 # +--sorted_result select * from information_schema.metadata_lock_info; --error ER_TABLE_MUST_HAVE_COLUMNS create or replace table mysqltest2.t2; --replace_column 1 # +--sorted_result select * from information_schema.metadata_lock_info; create table t1 (i int); drop table t1; @@ -231,15 +234,18 @@ create table test.t1 (i int); create table mysqltest2.t2 like test.t1; lock table test.t1 write, mysqltest2.t2 write; --replace_column 1 # +--sorted_result select * from information_schema.metadata_lock_info; --error ER_DUP_FIELDNAME create or replace table test.t1 (a int) select 1 as 'a', 2 as 'a'; show tables; --replace_column 1 # +--sorted_result select * from information_schema.metadata_lock_info; --error ER_DUP_FIELDNAME create or replace table mysqltest2.t2 (a int) select 1 as 'a', 2 as 'a'; --replace_column 1 # +--sorted_result select * from information_schema.metadata_lock_info; create table t1 (i int); drop table t1; @@ -317,15 +323,19 @@ drop view t1; create table t1 (a int); lock table t1 write, t2 read; --replace_column 1 # +--sorted_result select * from information_schema.metadata_lock_info; create or replace table t1 (i int); --replace_column 1 # +--sorted_result select * from information_schema.metadata_lock_info; create or replace table t1 like t2; --replace_column 1 # +--sorted_result select * from information_schema.metadata_lock_info; create or replace table t1 select 1 as f1; --replace_column 1 # +--sorted_result select * from information_schema.metadata_lock_info; drop table t1; unlock tables; diff --git a/mysql-test/t/ctype_cp850.test b/mysql-test/t/ctype_cp850.test new file mode 100644 index 00000000000..358829eb351 --- /dev/null +++ b/mysql-test/t/ctype_cp850.test @@ -0,0 +1,16 @@ +--echo # +--echo # Start of 5.5 tests +--echo # + +--echo # +--echo # MDEV-9862 Illegal mix of collation, when comparing column with CASE expression +--echo # +SET NAMES cp850; +CREATE TABLE t1 (a CHAR(1) CHARACTER SET latin1); +SELECT a FROM t1 WHERE CASE a WHEN 'aaaa' THEN 'Y' WHEN 'aaaa' THEN 'Y' ELSE NULL END <> a; +DROP TABLE t1; + + +--echo # +--echo # End of 5.5 tests +--echo # diff --git a/mysql-test/t/ctype_ldml.test b/mysql-test/t/ctype_ldml.test index 1b9d7c9d4ad..1ea8002a2eb 100644 --- a/mysql-test/t/ctype_ldml.test +++ b/mysql-test/t/ctype_ldml.test @@ -397,3 +397,15 @@ perl; print "Occurances : $count_error\n"; close(FILE); EOF + + +--echo # +--echo # MDEV-8686 A user defined collation utf8_confusables doesn't work +--echo # +CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf8 COLLATE utf8_implicit_weights_ci); +INSERT INTO t1 VALUES ('a'),('b'),('c'); +INSERT INTO t1 VALUES (_ucs2 0x1500),(_ucs2 0x1501); +INSERT INTO t1 VALUES (_ucs2 0x3400),(_ucs2 0x3560),(_ucs2 0x3561),(_ucs2 0x3600); +INSERT INTO t1 VALUES (_ucs2 0x3700),(_ucs2 0x3701); +SELECT HEX(CONVERT(a USING ucs2)) AS ch, HEX(WEIGHT_STRING(a)) AS w, HEX(WEIGHT_STRING(a COLLATE utf8_unicode_ci)) AS ducet FROM t1 ORDER BY a,ch; +DROP TABLE t1; diff --git a/mysql-test/t/ctype_like_range.test b/mysql-test/t/ctype_like_range.test index 02f2f79d168..e8784990d36 100644 --- a/mysql-test/t/ctype_like_range.test +++ b/mysql-test/t/ctype_like_range.test @@ -4,6 +4,8 @@ --source include/have_utf32.inc --source include/have_utf8mb4.inc +SET NAMES utf8; + --disable_warnings DROP TABLE IF EXISTS t1; DROP VIEW IF EXISTS v1; @@ -38,6 +40,8 @@ ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET latin1; SELECT * FROM v1; ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8; +INSERT INTO t1 (a) VALUES (_ucs2 0x0425),(_ucs2 0x045F); +INSERT INTO t1 (a) VALUES (_ucs2 0x2525),(_ucs2 0x5F5F); SELECT * FROM v1; ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_unicode_ci; @@ -52,6 +56,9 @@ SELECT * FROM v1; ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_danish_ci; SELECT * FROM v1; +ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_thai_520_w2; +SELECT * FROM v1; + ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8mb4; SELECT * FROM v1; @@ -67,6 +74,9 @@ SELECT * FROM v1; ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_danish_ci; SELECT * FROM v1; +ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_thai_520_w2; +SELECT * FROM v1; + ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci; SELECT * FROM v1; @@ -82,6 +92,9 @@ SELECT * FROM v1; ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET ucs2 COLLATE ucs2_danish_ci; SELECT * FROM v1; +ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET ucs2 COLLATE ucs2_thai_520_w2; +SELECT * FROM v1; + ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf16; SELECT * FROM v1; @@ -97,6 +110,9 @@ SELECT * FROM v1; ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf16 COLLATE utf16_danish_ci; SELECT * FROM v1; +ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf16 COLLATE utf16_thai_520_w2; +SELECT * FROM v1; + ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf16 COLLATE utf16_unicode_520_ci; SELECT * FROM v1; @@ -112,8 +128,32 @@ SELECT * FROM v1; ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf32 COLLATE utf32_danish_ci; SELECT * FROM v1; +ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf32 COLLATE utf32_thai_520_w2; +SELECT * FROM v1; + ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf32 COLLATE utf32_unicode_520_ci; SELECT * FROM v1; DROP VIEW v1; DROP TABLE t1; + +--echo # +--echo # Start of 10.2 tests +--echo # + +--echo # +--echo # MDEV-10134 Add full support for DEFAULT +--echo # +CREATE TABLE t1 ( + a VARCHAR(10), + mn VARCHAR(10) DEFAULT LIKE_RANGE_MIN(a,10), + mx VARCHAR(10) DEFAULT LIKE_RANGE_MAX(a,10) +); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES ('a'),('a_'),('a%'); +SELECT a, HEX(mn), HEX(mx) FROM t1; +DROP TABLE t1; + +--echo # +--echo # End of 10.2 tests +--echo # diff --git a/mysql-test/t/ctype_recoding.test b/mysql-test/t/ctype_recoding.test index ee07ef24def..81c04fc9c30 100644 --- a/mysql-test/t/ctype_recoding.test +++ b/mysql-test/t/ctype_recoding.test @@ -220,7 +220,6 @@ SET character_set_connection = utf8; CREATE TABLE t1 ( a VARCHAR(1) ); INSERT INTO t1 VALUES ('m'),('n'); CREATE VIEW v1 AS SELECT 'w' ; ---error ER_CANT_AGGREGATE_2COLLATIONS SELECT * FROM t1 WHERE a < ALL ( SELECT * FROM v1 ); drop view v1; drop table t1; @@ -228,3 +227,30 @@ SET character_set_connection = default; SET optimizer_switch= default; --echo #End of 5.3 tests + +--echo # +--echo # Start of 5.5 tests +--echo # + +--echo # +--echo # MDEV-10181 Illegal mix of collation for a field and an ASCII string as a view field +--echo # +SET NAMES utf8; +CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET latin1); +INSERT INTO t1 VALUES ('A'),('a'),('B'),('b'); +CREATE VIEW v1 AS SELECT 'a'; +SELECT * FROM v1,t1 where t1.a=v1.a; +DROP VIEW v1; +DROP TABLE t1; + +SET NAMES utf8; +CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET latin1); +INSERT INTO t1 VALUES ('a'),('b'),('c'); +CREATE VIEW v1 AS SELECT 'a' AS a UNION SELECT 'b'; +SELECT * FROM v1,t1 WHERE t1.a=v1.a; +DROP VIEW v1; +DROP TABLE t1; + +--echo # +--echo # End of 5.5 tests +--echo # diff --git a/mysql-test/t/ctype_uca.test b/mysql-test/t/ctype_uca.test index 9ef4c8e2ae8..15a945fde6d 100644 --- a/mysql-test/t/ctype_uca.test +++ b/mysql-test/t/ctype_uca.test @@ -70,6 +70,7 @@ select group_concat(c1 order by c1) from t1 group by c1 collate utf8_croatian_ci select group_concat(c1 order by c1) from t1 group by c1 collate utf8_german2_ci; select group_concat(c1 order by c1) from t1 group by c1 collate utf8_unicode_520_ci; select group_concat(c1 order by c1) from t1 group by c1 collate utf8_vietnamese_ci; +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_thai_520_w2; ALTER TABLE t1 CONVERT TO CHARACTER SET ucs2 COLLATE ucs2_bin; SELECT GROUP_CONCAT(c1 ORDER BY c1) FROM t1 GROUP BY c1 COLLATE ucs2_unicode_ci; @@ -641,7 +642,16 @@ SELECT * FROM t1 WHERE a=_utf8'a'; # Make sure this does not return "Illegal mix of collations" SELECT * FROM t1 WHERE a='a' AND a=_utf8'a'; DROP TABLE t1; + + +SET NAMES utf8 COLLATE utf8_thai_520_w2; +--source include/ctype_uca_w2.inc +--source include/ctype_thai.inc + SET NAMES utf8; +SET collation_connection=ucs2_thai_520_w2; +--source include/ctype_uca_w2.inc +--source include/ctype_thai.inc --echo # --echo # End of MariaDB-10.1 tests diff --git a/mysql-test/t/ctype_uca_partitions.test b/mysql-test/t/ctype_uca_partitions.test new file mode 100644 index 00000000000..5734bb52008 --- /dev/null +++ b/mysql-test/t/ctype_uca_partitions.test @@ -0,0 +1,38 @@ +--source include/have_partition.inc + +SET NAMES utf8; + +CREATE TABLE t1 (c1 VARCHAR(10) CHARACTER SET utf8 COLLATE utf8_thai_520_w2) +PARTITION BY KEY(c1) PARTITIONS 3; +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES ('A'),('À'),('Ã'),('Â'),('Ã'),('Ä'),('Ã…'); +INSERT INTO t1 VALUES ('B'); +INSERT INTO t1 VALUES ('C'); +INSERT INTO t1 VALUES ('D'); +INSERT INTO t1 VALUES ('E'); +INSERT INTO t1 VALUES ('F'); +INSERT INTO t1 VALUES ('G'); +INSERT INTO t1 VALUES ('H'); +INSERT INTO t1 VALUES ('I'); +INSERT INTO t1 VALUES ('J'); +INSERT INTO t1 VALUES ('K'); +INSERT INTO t1 VALUES ('L'),('Ĺ'),('Ä»'),('Ľ'),('Ä¿'),('Å'); +INSERT INTO t1 VALUES ('M'); +INSERT INTO t1 VALUES ('N'); +INSERT INTO t1 VALUES ('O'),('Ã’'),('Ó'),('Ô'),('Õ'),('Ö'),('Ø'); +INSERT INTO t1 VALUES ('P'); +INSERT INTO t1 VALUES ('Q'); +INSERT INTO t1 VALUES ('R'); +INSERT INTO t1 VALUES ('S'); +INSERT INTO t1 VALUES ('T'); +INSERT INTO t1 VALUES ('U'); +INSERT INTO t1 VALUES ('V'); +INSERT INTO t1 VALUES ('W'); +INSERT INTO t1 VALUES ('X'); +INSERT INTO t1 VALUES ('Y'); +INSERT INTO t1 VALUES ('Z'); + +SELECT * FROM t1 PARTITION (p0) ORDER BY c1; +SELECT * FROM t1 PARTITION (p1) ORDER BY c1; +SELECT * FROM t1 PARTITION (p2) ORDER BY c1; +DROP TABLE t1; diff --git a/mysql-test/t/ctype_utf16_uca.test b/mysql-test/t/ctype_utf16_uca.test index 63799054ae8..160d5b19d12 100644 --- a/mysql-test/t/ctype_utf16_uca.test +++ b/mysql-test/t/ctype_utf16_uca.test @@ -208,3 +208,16 @@ SET collation_connection=utf16_myanmar_ci; --echo # --echo # End of MariaDB-10.0 tests --echo # + +--echo # +--echo # Start of 10.1 tests +--echo # + +SET NAMES utf8; +SET collation_connection=utf16_thai_520_w2; +--source include/ctype_uca_w2.inc +--source include/ctype_thai.inc + +--echo # +--echo # End of 10.1 tests +--echo # diff --git a/mysql-test/t/ctype_utf32_uca.test b/mysql-test/t/ctype_utf32_uca.test index 6052ea7b334..fb691221db8 100644 --- a/mysql-test/t/ctype_utf32_uca.test +++ b/mysql-test/t/ctype_utf32_uca.test @@ -229,3 +229,16 @@ SET collation_connection=utf32_myanmar_ci; --echo # --echo # End of MariaDB-10.0 tests --echo # + +--echo # +--echo # Start of 10.1 tests +--echo # + +SET NAMES utf8; +SET collation_connection=utf32_thai_520_w2; +--source include/ctype_uca_w2.inc +--source include/ctype_thai.inc + +--echo # +--echo # End of 10.1 tests +--echo # diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test index 61bc1c58ecb..c4d94166493 100644 --- a/mysql-test/t/ctype_utf8.test +++ b/mysql-test/t/ctype_utf8.test @@ -1678,6 +1678,29 @@ ALTER TABLE t1 MODIFY a TINYTEXT CHARACTER SET utf8; SELECT OCTET_LENGTH(a),a FROM t1; DROP TABLE t1; +--echo # +--echo # MDEV-8402 Bug#77473 Bug#21317406 TRUNCATED DATA WITH SUBQUERY & UTF8 +--echo # +--echo # + +SET NAMES utf8; +SELECT length(rpad(_utf8 0xD0B1, 65536, _utf8 0xD0B2)) AS data; +SELECT length(data) AS len FROM ( + SELECT rpad(_utf8 0xD0B1, 65536, _utf8 0xD0B2) AS data +) AS sub; + +SELECT length(rpad(_utf8 0xD0B1, 65535, _utf8 0xD0B2)) AS data; +SELECT length(data) AS len FROM ( + SELECT rpad(_utf8 0xD0B1, 65535, _utf8 0xD0B2) AS data +) AS sub; + +SELECT length(data) AS len FROM (SELECT REPEAT('ä', 36766) AS data) AS sub; +SELECT length(data) AS len FROM (SELECT REPEAT('ä', 36767) AS data) AS sub; +SELECT length(data) AS len FROM (SELECT REPEAT('ä', 36778) AS data) AS sub; +SELECT length(data) AS len FROM (SELECT REPEAT('ä', 65535) AS data) AS sub; +SELECT length(data) AS len FROM (SELECT REPEAT('ä', 65536) AS data) AS sub; +SELECT length(data) AS len FROM (SELECT REPEAT('ä', 65537) AS data) AS sub; + --echo # --echo # End of 5.5 tests --echo # @@ -1982,6 +2005,60 @@ LOAD XML INFILE '../../std_data/loaddata/mdev9874.xml' INTO TABLE t1 CHARACTER S SELECT HEX(a) FROM t1; DROP TABLE t1; +--echo # +--echo # MDEV-10134 Add full support for DEFAULT +--echo # + +# This test uses some magic codes: +# _latin1 0xC39F is "A WITH TILDE + Y WITH DIAERESIS" +# _utf8 0xC39F is "SHARP S" + +# "A WITH TILDE + Y WITH DIAERESIS" in DEFAULT. +SET NAMES latin1; +CREATE TABLE t1 (a VARCHAR(30) CHARACTER SET latin1 DEFAULT CONCAT('ß')); +SET NAMES utf8; +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (DEFAULT); +SELECT HEX(a),a FROM t1; +SET NAMES latin1; +ALTER TABLE t1 ADD b VARCHAR(30) CHARACTER SET latin1 DEFAULT CONCAT('ß'); +SET NAMES utf8; +ALTER TABLE t1 ADD c VARCHAR(30) CHARACTER SET latin1 DEFAULT CONCAT('ß'); +SHOW CREATE TABLE t1; +# Testing that DEFAULT is independent on the current "SET NAMES". +DELETE FROM t1; +INSERT INTO t1 VALUES(); +SELECT * FROM t1; +SET NAMES latin1; +DELETE FROM t1; +INSERT INTO t1 VALUES(); +SET NAMES utf8; +SELECT * FROM t1; +DROP TABLE t1; + +SET NAMES latin1; +CREATE TABLE t1 (a VARCHAR(30) CHARACTER SET utf8 DEFAULT CONCAT('ß')); +SET NAMES utf8; +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (DEFAULT); +SELECT HEX(a), a FROM t1; +DROP TABLE t1; + +# "SHARP S" in DEFAULT +SET NAMES utf8; +CREATE TABLE t1 (a VARCHAR(30) CHARACTER SET latin1 DEFAULT CONCAT('ß')); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (DEFAULT); +SELECT HEX(a) FROM t1; +DROP TABLE t1; + +SET NAMES utf8; +CREATE TABLE t1 (a VARCHAR(30) CHARACTER SET utf8 DEFAULT CONCAT('ß')); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (DEFAULT); +SELECT HEX(a) FROM t1; +DROP TABLE t1; + --echo # --echo # End of 10.2 tests --echo # diff --git a/mysql-test/t/ctype_utf8mb4.test b/mysql-test/t/ctype_utf8mb4.test index 74e39a80e5b..7c7c532b045 100644 --- a/mysql-test/t/ctype_utf8mb4.test +++ b/mysql-test/t/ctype_utf8mb4.test @@ -1821,6 +1821,26 @@ SELECT OCTET_LENGTH(a),a FROM t1; DROP TABLE t1; +--echo # +--echo # MDEV-8402 Bug#77473 Bug#21317406 TRUNCATED DATA WITH SUBQUERY & UTF8 +--echo # +--echo # + +SET NAMES utf8mb4; +SELECT length(repeat(_utf8mb4 0xE29883, 21844)) AS data; +SELECT length(data) AS len +FROM ( SELECT repeat(_utf8mb4 0xE29883, 21844) AS data ) AS sub; + +SELECT length(repeat(_utf8mb4 0xE29883, 21846)) AS data; +SELECT length(data) AS len +FROM ( SELECT repeat(_utf8mb4 0xE29883, 21846) AS data ) AS sub; + +SELECT LENGTH(data) AS len FROM (SELECT REPEAT('☃', 21844) AS data ) AS sub; +SELECT LENGTH(data) AS len FROM (SELECT REPEAT('☃', 21845) AS data ) AS sub; +SELECT LENGTH(data) AS len FROM (SELECT REPEAT('☃', 21846) AS data ) AS sub; +SELECT LENGTH(data) AS len FROM (SELECT REPEAT('☃', 65535) AS data ) AS sub; +SELECT LENGTH(data) AS len FROM (SELECT REPEAT('☃', 65536) AS data ) AS sub; + --echo # --echo # End of 5.5 tests --echo # diff --git a/mysql-test/t/ctype_utf8mb4_uca.test b/mysql-test/t/ctype_utf8mb4_uca.test index a5493e78c47..e56c6d7b884 100644 --- a/mysql-test/t/ctype_utf8mb4_uca.test +++ b/mysql-test/t/ctype_utf8mb4_uca.test @@ -70,3 +70,16 @@ SET NAMES utf8mb4 COLLATE utf8mb4_myanmar_ci; --echo # --echo # End of MariaDB-10.0 tests --echo # + +--echo # +--echo # Start of 10.1 tests +--echo # + +SET NAMES utf8; +SET collation_connection=utf8mb4_thai_520_w2; +--source include/ctype_uca_w2.inc +--source include/ctype_thai.inc + +--echo # +--echo # End of 10.1 tests +--echo # diff --git a/mysql-test/t/default.test b/mysql-test/t/default.test index 17f4383ae22..6c871527212 100644 --- a/mysql-test/t/default.test +++ b/mysql-test/t/default.test @@ -166,7 +166,7 @@ select * from t1; drop table t1, t2; ---echo End of 5.0 tests. +--echo # End of 5.0 tests --echo # --echo # Start of 10.1 tests @@ -183,3 +183,1656 @@ DROP TABLE IF EXISTS t1; --echo # --echo # End of 10.1 tests --echo # + +--echo # +--echo # Start of 10.2 tests +--echo # + +SET timestamp=UNIX_TIMESTAMP('2001-01-01 10:20:30.123456'); + +--echo # +--echo # Check that CURRENT_TIMESTAMP works as before +--echo # + +CREATE or replace TABLE t1 (event_time TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP); +SHOW CREATE TABLE t1; + +CREATE or replace TABLE t1 (event_time TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(2) ON UPDATE CURRENT_TIMESTAMP); +SHOW CREATE TABLE t1; + +CREATE or replace TABLE t1 (event_time TIMESTAMP(6) NOT NULL DEFAULT SYSDATE(2) ON UPDATE CURRENT_TIMESTAMP); +SHOW CREATE TABLE t1; + +drop table t1; + +--echo # +--echo # Check default expressions +--echo # + +create or replace table t1 (a int default 1, b int default (a+1), c int default (a+b)) engine myisam; +show create table t1; +insert into t1 values (); +insert into t1 (a) values (2); +insert into t1 (a,b) values (10,20); +insert into t1 (a,b,c) values (100,200,400); +select * from t1; +truncate table t1; +insert delayed into t1 values (); +insert delayed into t1 (a) values (2); +insert delayed into t1 (a,b) values (10,20); +insert delayed into t1 (a,b,c) values (100,200,400); +flush tables t1; +select * from t1; + +create or replace table t1 (a int, b blob default (1), c blob default "hello", t text default concat(a,b,c)) engine=myisam; +show create table t1; +insert into t1 (a) values (2); +insert into t1 (a,b) values (10,"test1"); +insert into t1 (a,b,c) values (10,"test2","test3"); +insert delayed into t1 (a,b) values (10,"test4"); +flush tables t1; +select * from t1; +drop table t1; + +create or replace table t1 (a bigint default uuid_short()); +insert into t1 values(); +select a > 0 from t1; +drop table t1; + +create or replace table t1 (param_list int DEFAULT (1+1) NOT NULL); +--error ER_PARSE_ERROR +create or replace table t1 (param_list int DEFAULT 1+1 NOT NULL); +create or replace table t1 (param_list blob DEFAULT "" NOT NULL); + +drop table t1; + +create table t1 (a int); +insert into t1 values(-1); +alter table t1 add b int default 1, add c int default -1, add d int default (1+1), add e timestamp; +select a,b,c,d,e from t1; +insert into t1 values(10,10,10,10,0); +alter table t1 add f int default (1+1+1) null, add g int default (1+1+1+1) not null,add h int default (2+2+2+2); +select a,b,c,d,e,f,g,h from t1; +show create table t1; + +create table t2 like t1; +show create table t2; +insert into t2 (a) values (100); +select a,b,c,d,e,f,g,h from t2; +drop table t1,t2; + +create table t1 (a int default (1----1), b int default - 1, c int default +1, e int default (--1)); +show create table t1; +insert into t1 values(); +insert into t1 values(); +select * from t1; +drop table t1; + +--echo # +--echo # Create or replace can delete a table on error +--echo # +create table t1 (a int); +--error ER_EXPRESSION_REFERS_TO_UNINIT_FIELD +create or replace table t1 (a int default b, b int default a); +--error ER_NO_SUCH_TABLE +show create table t1; + +--echo # +--echo # Refering to other columns +--echo # + +create or replace table t1 (a int default 1, b int default a); +create or replace table t1 (a int default 1, b int as (a)); +create or replace table t1 (a int default b, b int default 1); +create or replace table t1 (a int as (b), b int default 1); +create or replace table t1 (a int as (b), b int default (1+1)); +create or replace table t1 (a int default 1, b int as (c), c int default (a+1)); +create or replace table t1 (a int default (1+1), b int as (c), c int default (a+1)); +create or replace table t1 (a varchar(128) default @@version); +create or replace table t1 (a int not null, b int as (a)); +create or replace table t1 (a int not null, b int default (a+1)); + + +--error ER_EXPRESSION_REFERS_TO_UNINIT_FIELD +create or replace table t1 (a int default a); +create or replace table t1 (a int default b, b int default (1+1)); +--error ER_EXPRESSION_REFERS_TO_UNINIT_FIELD +create or replace table t1 (a int default 1, b int as (c), c int as (a+1)); +--error ER_EXPRESSION_REFERS_TO_UNINIT_FIELD +CREATE TABLE t1 (a INT DEFAULT (DEFAULT(a))); +--error ER_EXPRESSION_REFERS_TO_UNINIT_FIELD +CREATE TABLE t1 (a INT DEFAULT(DEFAULT(b)), b INT DEFAULT(DEFAULT(a))); +--error ER_EXPRESSION_REFERS_TO_UNINIT_FIELD +CREATE TABLE t1 (a INT DEFAULT(DEFAULT(b)) NOT NULL, b INT DEFAULT(DEFAULT(a)) NOT NULL); + +--echo # +--echo # Allow defaults to refer to not default fields +--echo # + +create or replace table t1 (a int default b, b int not null); +insert into t1 values(); +insert into t1 (a) values(1); +insert into t1 (b) values(2); +insert into t1 (a,b) values(3,4); +select * from t1; +drop table t1; + +--echo # +--echo # Error handling +--echo # + +--error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +create or replace table t1 (a bigint default xxx()); +--error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +create or replace table t1 (a bigint default (select (1))); +--error ER_OPERAND_COLUMNS +create or replace table t1 (a bigint default (1,2,3)); +--error ER_OPERAND_COLUMNS +create or replace table t1 (a bigint default ((1,2,3))); +--error ER_PARSE_ERROR +CREATE TABLE t1 (a INT, b INT, c INT DEFAULT a DIV b); +--error ER_PARSE_ERROR +CREATE TABLE t1 (a INT, b INT DEFAULT -a); + +--echo # +--echo # Invalid DEFAULT expressions +--echo # + +--error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +CREATE TABLE t1 (a INT DEFAULT ((SELECT 1))); + +--error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +CREATE TABLE t1 (a INT DEFAULT (EXISTS (SELECT 1))); + +--error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +CREATE TABLE t1 (a INT DEFAULT (1=ANY (SELECT 1))); + +--error ER_OPERAND_COLUMNS +CREATE TABLE t1 (a INT DEFAULT ROW(1,1)); + +--error ER_OPERAND_COLUMNS +CREATE TABLE t1 (a INT DEFAULT (1,1)); + +--error ER_OPERAND_COLUMNS +CREATE TABLE t1 (a INT DEFAULT ((1,1))); + +--error ER_PARSE_ERROR,2031 +CREATE TABLE t1 (a INT DEFAULT ?); +--error ER_PARSE_ERROR,2031 +CREATE TABLE t1 (a INT DEFAULT(?)); + +--error ER_EXPRESSION_REFERS_TO_UNINIT_FIELD +CREATE TABLE t1 (a INT DEFAULT (b), b INT DEFAULT(a)); + +--error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +CREATE TABLE t1 (a INT DEFAULT @v); + +--error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +CREATE TABLE t1 (a INT DEFAULT @v:=1); + +--error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +CREATE TABLE t1 (a INT DEFAULT(NAME_CONST('xxx', 'yyy')); + +--error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +CREATE TABLE t1 (a INT DEFAULT COUNT(*)); + +--error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +CREATE TABLE t1 (a INT DEFAULT COUNT(1)); + +--error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +CREATE TABLE t1 (a INT DEFAULT AVG(1)); + +--error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +CREATE TABLE t1 (a INT DEFAULT MIN(1)); + +--error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +CREATE TABLE t1 (a INT DEFAULT GROUP_CONCAT(1)); + +--error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +CREATE TABLE t1 (a INT DEFAULT ROW_NUMBER() OVER ()); + +CREATE FUNCTION f1() RETURNS INT RETURN 1; +--error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +CREATE TABLE t1 (a INT DEFAULT f1()); +DROP FUNCTION f1; + +--error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +CREATE PROCEDURE p1(par INT) CREATE TABLE t1 (a INT DEFAULT par); + +--error ER_BAD_FIELD_ERROR +CREATE TABLE t1 (a INT DEFAULT par); + +CREATE PROCEDURE p1() CREATE TABLE t1 (a INT DEFAULT par); +--error ER_BAD_FIELD_ERROR +CALL p1; +DROP PROCEDURE p1; + +--error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +CREATE TABLE t1 (a INT DEFAULT VALUES(a)); + + +CREATE TABLE t1 (a INT); +# "Explicit or implicit commit is not allowed in stored function or trigger +# because the entire CREATE TABLE is actually not allowed in triggers! +--error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +CREATE TRIGGER tr1 AFTER INSERT ON t1 FOR EACH ROW CREATE TABLE t2 (a INT DEFAULT NEW.a); +# This is OK to return Function or expression is not allowed for 'DEFAULT' +# because CREATE TEMPORARY TABLE is allowed in triggers +--error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +CREATE TRIGGER tr1 AFTER INSERT ON t1 FOR EACH ROW CREATE TEMPORARY TABLE t2 (a INT DEFAULT NEW.a); +DROP TABLE t1; + +--echo # +--echo # Prepared statements +--echo # + +PREPARE stmt FROM 'CREATE TABLE t1 (a INT DEFAULT(?))'; +set @a=1; +execute stmt using @a; +show create table t1; +drop table t1; +set @a=-1; +execute stmt using @a; +show create table t1; +drop table t1; +DEALLOCATE PREPARE stmt; + +PREPARE stmt FROM 'CREATE TABLE t1 (a INT DEFAULT(?), b INT DEFAULT(?))'; +set @a=1, @b=2; +execute stmt using @a,@b; +show create table t1; +drop table t1; +DEALLOCATE PREPARE stmt; + +# +# We can't have an expression for prepared statements +# + +PREPARE stmt FROM 'CREATE TABLE t1 (a INT DEFAULT(?+?))'; +set @a=1; +--error ER_PARSE_ERROR +execute stmt using @a,@a; +DEALLOCATE PREPARE stmt; + +--echo # +--echo # Parenthesized Item_basic_constant +--echo # + + +# It would be better if SHOW would display PI() rather than '3.141592653589793' +# The problem is that PI() is declared as a basic constant item and it +# could cause some problems changing it. + +CREATE TABLE t1 ( + i01 INT DEFAULT (((1))), + i02 INT DEFAULT (((0x3939))), + i03 INT DEFAULT (((1.0))), + i04 INT DEFAULT (((1e0))), + i05 INT DEFAULT (((NULL))), + + f01 DOUBLE DEFAULT (((PI()))), + + s01 VARCHAR(10) DEFAULT (((_latin1'test'))), + s02 VARCHAR(10) DEFAULT ((('test'))), + s03 VARCHAR(10) DEFAULT (((0x40))), + s04 VARCHAR(10) DEFAULT (((X'40'))), + s05 VARCHAR(10) DEFAULT (((B'1000000'))), + + d01 TIME DEFAULT (((TIME'10:20:30'))), + d02 DATE DEFAULT (((DATE'2001-01-01'))), + d03 DATETIME DEFAULT (((TIMESTAMP'2001-01-01 10:20:30'))) +); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (); +--vertical_results +SELECT * FROM t1; +--horizontal_results +DROP TABLE t1; + + +--echo # +--echo # COALESCE(Item_basic_constant) +--echo # + +# i02 INT DEFAULT 0x3939 -- gives 14649 (see the previous query), +# because it treats as a number +# i02 INT DEFAULT COALESCE(0x3939) -- gives 99, because it converts to string +# +# should be at least documented + +CREATE TABLE t1 ( + i01 INT DEFAULT COALESCE(1), + i02 INT DEFAULT COALESCE(0x3939), + i03 INT DEFAULT COALESCE(1.0), + i04 INT DEFAULT COALESCE(1e0), + i05 INT DEFAULT COALESCE(NULL), + + f01 DOUBLE DEFAULT COALESCE(PI()), + + s01 VARCHAR(10) DEFAULT COALESCE(_latin1'test'), + s02 VARCHAR(10) DEFAULT COALESCE('test'), + s03 VARCHAR(10) DEFAULT COALESCE(0x40), + s04 VARCHAR(10) DEFAULT COALESCE(X'40'), + s05 VARCHAR(10) DEFAULT COALESCE(B'1000000'), + + d01 TIME DEFAULT COALESCE(TIME'10:20:30'), + d02 DATE DEFAULT COALESCE(DATE'2001-01-01'), + d03 DATETIME DEFAULT COALESCE(TIMESTAMP'2001-01-01 10:20:30') +); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (); +--vertical_results +SELECT * FROM t1; +--horizontal_results +DROP TABLE t1; + + +--echo # +--echo # TINYINT: out of range +--echo # +--error ER_INVALID_DEFAULT +CREATE TABLE t1 (a TINYINT DEFAULT 300 NOT NULL); +--error ER_INVALID_DEFAULT +CREATE TABLE t1 (a TINYINT DEFAULT 128 NOT NULL); +--error ER_INVALID_DEFAULT +CREATE TABLE t1 (a TINYINT DEFAULT -500 NOT NULL); + +--echo # +--echo # INT: simple numeric expressions +--echo # +CREATE TABLE t1 (a INT DEFAULT 1 NOT NULL); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (DEFAULT); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a INT DEFAULT COALESCE(1) NOT NULL); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (DEFAULT); +SELECT * FROM t1; +DROP TABLE t1; + +--echo # +--echo # INT: simple string expressions +--echo # + +CREATE TABLE t1 (a INT DEFAULT '1' NOT NULL); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (DEFAULT); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a INT DEFAULT CONCAT('1') NOT NULL); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (DEFAULT); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a INT DEFAULT COALESCE('1') NOT NULL); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (DEFAULT); +SELECT * FROM t1; +DROP TABLE t1; + +--echo # +--echo # INT: string expressions with garbage +--echo # +--error ER_INVALID_DEFAULT +CREATE TABLE t1 (a INT DEFAULT 'x'); +--error ER_INVALID_DEFAULT +CREATE TABLE t1 (a INT DEFAULT CONCAT('x')); +--error ER_INVALID_DEFAULT +CREATE TABLE t1 (a INT DEFAULT COALESCE('x')); +--error ER_INVALID_DEFAULT +CREATE TABLE t1 (a INT DEFAULT (((((COALESCE('x'))))))); + +--echo # +--echo # INT: string expressions with numbers + garbage +--echo # + +--error ER_INVALID_DEFAULT +CREATE TABLE t1 (a INT DEFAULT '1x'); +--error ER_INVALID_DEFAULT +CREATE TABLE t1 (a INT DEFAULT COALESCE('1x')); +--error ER_INVALID_DEFAULT +CREATE TABLE t1 (a INT DEFAULT CONCAT('1x')); + +--echo # +--echo # INT: string expressions with numbers + trailing space +--echo # + +CREATE TABLE t1 (a INT DEFAULT '1 '); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (DEFAULT); +SELECT * FROM t1; +DROP TABLE t1; + +# unlike constant, this preserve trailing spaces +# and sends a note on INSERT. Perhaps CREATE should be rejected +CREATE TABLE t1 (a INT DEFAULT CONCAT('1 ')); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (DEFAULT); +SELECT * FROM t1; +DROP TABLE t1; + +# unlike constant, this preserve trailing spaces +# and sends a note on INSERT +CREATE TABLE t1 (a INT DEFAULT COALESCE('1 ')); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (DEFAULT); +SELECT * FROM t1; +DROP TABLE t1; + +--echo # +--echo # INT: a HEX value +--echo # +CREATE TABLE t1 (a INT DEFAULT 0x61 NOT NULL); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (DEFAULT); +SELECT * FROM t1; +DROP TABLE t1; + + +--echo # +--echo # VARCHAR: good defaults +--echo # +CREATE TABLE t1 (a VARCHAR(30) DEFAULT 'xxx' NOT NULL); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (DEFAULT); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a VARCHAR(2) DEFAULT 0x41 NOT NULL); +SHOW CREATE TABLE t1; +DROP TABLE t1; + +CREATE TABLE t1 (a VARCHAR(2) DEFAULT CONCAT(0x41) NOT NULL); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (DEFAULT); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a VARCHAR(2) DEFAULT COALESCE(0x41) NOT NULL); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (DEFAULT); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a VARCHAR(2) DEFAULT CONCAT(_utf8 0x41) NOT NULL); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (DEFAULT); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a VARCHAR(2) DEFAULT CONCAT(_utf8 X'41') NOT NULL); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (DEFAULT); +SELECT * FROM t1; +DROP TABLE t1; + + +--echo # +--echo # VARCHAR: Too long default +--echo # +--error ER_INVALID_DEFAULT +CREATE TABLE t1 (a VARCHAR(2) DEFAULT 'xxx' NOT NULL); +--error ER_INVALID_DEFAULT +CREATE TABLE t1 (a VARCHAR(2) DEFAULT CONCAT('xxx') NOT NULL); + +--echo # +--echo # VARCHAR: Too long default with non-important data +--echo # +--error ER_INVALID_DEFAULT +CREATE TABLE t1 (a VARCHAR(2) DEFAULT 'xx ' NOT NULL); +--error ER_INVALID_DEFAULT +CREATE TABLE t1 (a VARCHAR(2) DEFAULT CONCAT('xx ') NOT NULL); + +--echo # +--echo # VARCHAR: conversion failures +--echo # + +# DEFAULT with a Cyrillic letter for a Latin1 column +--error ER_INVALID_DEFAULT +CREATE TABLE t1 (a VARCHAR(2) CHARACTER SET latin1 DEFAULT _utf8 X'D18F' NOT NULL); +--error ER_INVALID_DEFAULT +CREATE TABLE t1 (a VARCHAR(2) CHARACTER SET latin1 DEFAULT CONCAT(_utf8 X'D18F') NOT NULL); +--error ER_INVALID_DEFAULT +CREATE TABLE t1 (a VARCHAR(2) CHARACTER SET latin1 DEFAULT CONCAT(_utf8 0xD18F) NOT NULL); + +--echo # +--echo # Field as a default value +--echo # + +CREATE TABLE t1 (a INT, b INT DEFAULT (a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (1, 1); +INSERT INTO t1 VALUES (DEFAULT, DEFAULT); +INSERT INTO t1 VALUES (1, DEFAULT); +INSERT INTO t1 VALUES (DEFAULT, 1); +SELECT * FROM t1; +DROP TABLE t1; + +--echo # +--echo # Function DEFAULT(field) +--echo # + +CREATE TABLE t1 (a INT DEFAULT(DEFAULT(b)), b INT DEFAULT 1); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (DEFAULT, DEFAULT); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a INT DEFAULT 1, b INT DEFAULT(DEFAULT(a))); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (DEFAULT, DEFAULT); +SELECT * FROM t1; +DROP TABLE t1; + +--echo # +--echo # SQL Standard as a +--echo # + +CREATE TABLE t1 (a DATETIME DEFAULT CURRENT_TIMESTAMP); +SHOW CREATE TABLE t1; +DROP TABLE t1; + +CREATE TABLE t1 (a TIME DEFAULT CURRENT_TIME); +SHOW CREATE TABLE t1; +DROP TABLE t1; + +CREATE TABLE t1 (a DATE DEFAULT CURRENT_DATE); +SHOW CREATE TABLE t1; +DROP TABLE t1; + +--echo # +--echo # DECIMAL + CURRENT_TIMESTAMP, no truncation +--echo # +CREATE TABLE t1 (a DECIMAL(30,6) DEFAULT CURRENT_TIMESTAMP(6)); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a DECIMAL(30,6) DEFAULT COALESCE(CURRENT_TIMESTAMP(6))); +SHOW CREATE TABLE t1; +# Same as insert into t1 values ("2016-06-05 12:54:52.342095"); +INSERT INTO t1 VALUES(); +INSERT IGNORE INTO t1 VALUES(); +SET sql_mode = 'STRICT_ALL_TABLES'; +--error WARN_DATA_TRUNCATED +INSERT INTO t1 VALUES(); +SET sql_mode = DEFAULT; +DROP TABLE t1; + +--echo # +--echo # DECIMAL + CURRENT_TIME, no truncation +--echo # +CREATE TABLE t1 (a DECIMAL(30,6) DEFAULT COALESCE(CURRENT_TIME(6))); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES(); +DROP TABLE t1; + +--echo # +--echo # DECIMAL + CURRENT_DATE, no truncation +--echo # +CREATE TABLE t1 (a DECIMAL(30,6) DEFAULT COALESCE(CURRENT_DATE)); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES(); +DROP TABLE t1; + + +--echo # +--echo # COALESCE for SQL Standard +--echo # + +CREATE TABLE t1 (a TIMESTAMP DEFAULT COALESCE(CURRENT_TIMESTAMP)); +SHOW CREATE TABLE t1; +DROP TABLE t1; + +CREATE TABLE t1 (a DATE DEFAULT COALESCE(CURRENT_DATE)); +SHOW CREATE TABLE t1; +DROP TABLE t1; + +CREATE TABLE t1 (a TIME DEFAULT COALESCE(CURRENT_TIME)); +SHOW CREATE TABLE t1; +DROP TABLE t1; + +CREATE TABLE t1 ( + a TIMESTAMP DEFAULT CURRENT_TIMESTAMP(6), + b TIMESTAMP DEFAULT COALESCE(CURRENT_TIMESTAMP(6)) +); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (); +SELECT CURRENT_TIMESTAMP(6); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 ( + a DECIMAL(30,0) DEFAULT CURRENT_TIMESTAMP(6), + b DECIMAL(30,0) DEFAULT COALESCE(CURRENT_TIMESTAMP(6)) +); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (); +SELECT * FROM t1; +DROP TABLE t1; + +--echo # +--echo # Check DEFAULT() function +--echo # + +CREATE TABLE `t1` (`a` int(11) DEFAULT (3+3),`b` int(11) DEFAULT '1000'); +SHOW CREATE TABLE t1; +insert into t1 values (1,1),(2,2); +insert into t1 values (default,default); +select * from t1; +select default(a),b from t1; +select a,default(b) from t1; +drop table t1; + + +--echo # +--echo # Real functions +--echo # + +CREATE TABLE t1 (a DECIMAL(10,1), b DOUBLE DEFAULT CAST(a AS DOUBLE)); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (10.1, DEFAULT); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a DOUBLE, b DOUBLE DEFAULT EXP(a), c DOUBLE DEFAULT LOG(b), d DOUBLE DEFAULT LOG(4, b)); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (2, DEFAULT, DEFAULT, DEFAULT); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a INT, b DOUBLE DEFAULT LOG2(a), c DOUBLE DEFAULT LOG10(a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (4, DEFAULT, DEFAULT); +INSERT INTO t1 VALUES (100, DEFAULT, DEFAULT); +SELECT * FROM t1; +DROP TABLE t1; + + +CREATE TABLE t1 (a DOUBLE, b DOUBLE DEFAULT SQRT(a), c DOUBLE DEFAULT POW(a,3)); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (4, DEFAULT, DEFAULT); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a DOUBLE, b DOUBLE DEFAULT ACOS(a), c DOUBLE DEFAULT ASIN(a), d DOUBLE DEFAULT ATAN(a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (1, DEFAULT, DEFAULT, DEFAULT); +SELECT a, b/PI(), c/PI(), d/PI() FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a DOUBLE, b DOUBLE DEFAULT COS(a), c DOUBLE DEFAULT SIN(a), d DOUBLE DEFAULT TAN(a), e DOUBLE DEFAULT COT(a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES (PI()/3); +SELECT ROUND(a,3), ROUND(b,3), ROUND(c,3), ROUND(d,3), ROUND(e,3) FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a DOUBLE DEFAULT RAND()); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (DEFAULT); +DROP TABLE t1; + +CREATE TABLE t1 (a DOUBLE, b DOUBLE DEFAULT DEGREES(a), c DOUBLE DEFAULT RADIANS(b)); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (PI(), DEFAULT, DEFAULT); +SELECT * FROM t1; +DROP TABLE t1; + +--echo # +--echo # INT result functions +--echo # + +CREATE TABLE t1 (a INT, b INT DEFAULT INTERVAL(a, 10, 20, 30, 40)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES (34); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a INT, b INT, c INT DEFAULT (a DIV b)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a, b) VALUES (13, 3); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a INT, b INT DEFAULT SIGN(a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES (-10),(0), (10); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a VARCHAR(30), b INT DEFAULT FIELD(a, 'Hej', 'ej', 'Heja', 'hej', 'foo')); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES ('ej'); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a VARCHAR(30), b INT DEFAULT FIND_IN_SET(a, 'Hej,ej,Heja,hej,foo')); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES ('ej'); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a VARCHAR(30), b INT DEFAULT ASCII(a), c INT DEFAULT ORD(a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES ('a'); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a TEXT DEFAULT UUID_SHORT()); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (); +SELECT a>0 FROM t1; +DROP TABLE t1; + +--error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +CREATE TABLE t1 (a INT DEFAULT BENCHMARK(1,1)); + +--error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +CREATE TABLE t1 (a INT DEFAULT GET_LOCK('a',1)); + +--error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +CREATE TABLE t1 (a INT DEFAULT RELEASE_LOCK('a')); + +--error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +CREATE TABLE t1 (a INT DEFAULT IS_USED_LOCK('a')); + +--error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +CREATE TABLE t1 (a INT DEFAULT IS_FREE_LOCK('a')); + +--error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +CREATE TABLE t1 (a INT DEFAULT SLEEP(1)); + +--error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +CREATE TABLE t1 (a INT DEFAULT ROW_COUNT()); + +--error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +CREATE TABLE t1 (a INT DEFAULT FOUND_ROWS()); + +--error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +CREATE TABLE t1 (a INT DEFAULT MASTER_POS_WAIT('test',100)); + +--error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +CREATE TABLE t1 (a INT DEFAULT MASTER_GTID_WAIT('test')); + +--error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +CREATE TABLE t1 (a VARCHAR(30), b DOUBLE DEFAULT MATCH (a) AGAINST('bbbb' IN BOOLEAN MODE)); + +--echo # +--echo # Temporal functions +--echo # + +--echo # Item_temporal_hybrid_func + +CREATE TABLE t1 (a DATE, b INT, c DATE DEFAULT DATE_ADD(a, INTERVAL b DAY)); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES ('2001-01-01', 30, DEFAULT); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a DATE, b TIME, c DATETIME DEFAULT ADDTIME(a, b)); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES ('2001-01-01', '10:20:30', DEFAULT); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a VARCHAR(32), b VARCHAR(32), c DATE DEFAULT STR_TO_DATE(a,b)); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES ('01,5,2013','%d,%m,%Y', DEFAULT); +SELECT * FROM t1; +DROP TABLE t1; + +--echo # Item_datefunc + +SET time_zone='-10:00'; +SET timestamp=UNIX_TIMESTAMP('2001-01-01 23:59:59'); +CREATE TABLE t1 (a DATE DEFAULT CURDATE(), b DATE DEFAULT UTC_DATE()); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (); +SELECT * FROM t1; +DROP TABLE t1; +SET time_zone=DEFAULT, timestamp= DEFAULT; + +CREATE TABLE t1 (a INT, b DATE DEFAULT FROM_DAYS(a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (730669, DEFAULT); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a DATE, b DATE DEFAULT LAST_DAY(a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES ('2003-02-05', DEFAULT); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (yy INT, yd INT, d DATE DEFAULT MAKEDATE(yy, yd)); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (2011,32,DEFAULT); +SELECT * FROM t1; +DROP TABLE t1; + +--echo # Item_timefunc + +SET time_zone='-10:00'; +SET timestamp=UNIX_TIMESTAMP('2001-01-01 23:59:59'); +CREATE TABLE t1 (a TIME DEFAULT CURTIME(), b TIME DEFAULT UTC_TIME()); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (); +SELECT * FROM t1; +DROP TABLE t1; +SET time_zone=DEFAULT, timestamp= DEFAULT; + +CREATE TABLE t1 (a INT, b TIME DEFAULT SEC_TO_TIME(a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (2378, DEFAULT); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a DATETIME, b DATETIME, c TIME DEFAULT TIMEDIFF(a,b)); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES ('2000:01:01 00:00:00', '2000:01:02 10:20:30', DEFAULT); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (hh INT, mm INT, ss INT, t TIME DEFAULT MAKETIME(hh,mm,ss)); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (10,20,30,DEFAULT); +SELECT * FROM t1; +DROP TABLE t1; + + +--echo # Item_datetimefunc + +SET time_zone='-10:00'; +SET timestamp=UNIX_TIMESTAMP('2001-01-01 23:59:59'); +CREATE TABLE t1 (a TIMESTAMP DEFAULT NOW(), b TIMESTAMP DEFAULT UTC_TIMESTAMP()); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (); +SELECT * FROM t1; +DROP TABLE t1; +SET time_zone=DEFAULT, timestamp= DEFAULT; + +# SYSDATE is evaluated during get_date() rather than fix_fields. +CREATE TABLE t1 (a TIMESTAMP(6) DEFAULT SYSDATE(6), s INT, b TIMESTAMP(6) DEFAULT SYSDATE(6)); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (DEFAULT, SLEEP(0.1), DEFAULT); +SELECT b>a FROM t1; +DROP TABLE t1; + +SET time_zone='+00:00'; +CREATE TABLE t1 (a INT, b TIMESTAMP DEFAULT FROM_UNIXTIME(a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (1447430881, DEFAULT); +SELECT * FROM t1; +DROP TABLE t1; +SET time_zone=DEFAULT; + +CREATE TABLE t1 (a TIMESTAMP, b TIMESTAMP DEFAULT CONVERT_TZ(a, '-10:00', '+10:00')); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES ('2001-01-01 10:20:30', DEFAULT); +SELECT * FROM t1; +DROP TABLE t1; + +--echo # Item_temporal_typecast +CREATE TABLE t1 (a INT, b DATE DEFAULT CAST(a AS DATE)); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (20010203, DEFAULT); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a INT, b TIME DEFAULT CAST(a AS TIME)); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (102030, DEFAULT); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a BIGINT, b DATETIME DEFAULT CAST(a AS DATETIME)); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (20010203102030, DEFAULT); +SELECT * FROM t1; +DROP TABLE t1; + + +--echo # +--echo # Functions with temporal input +--echo # + +CREATE TABLE t1 (a INT, b INT, c INT DEFAULT PERIOD_ADD(a,b)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a,b) VALUES (200801, 2); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a INT, b INT, c INT DEFAULT PERIOD_DIFF(a,b)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a,b) VALUES (200802, 200703); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a INT, b INT DEFAULT TO_DAYS(a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES (950501); +SELECT * FROM t1; +DROP TABLE t1; +CREATE TABLE t1 (a DATE, b INT DEFAULT TO_DAYS(a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES ('2007-10-07'); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a INT, b BIGINT DEFAULT TO_SECONDS(a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES (950501); +SELECT * FROM t1; +DROP TABLE t1; +CREATE TABLE t1 (a DATE, b BIGINT DEFAULT TO_SECONDS(a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES ('2009-11-29'); +SELECT * FROM t1; +DROP TABLE t1; +CREATE TABLE t1 (a DATETIME, b BIGINT DEFAULT TO_SECONDS(a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES ('2009-11-29 13:43:32'); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a DATE, b BIGINT DEFAULT DAYOFMONTH(a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES ('2007-02-03'); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a DATE, b BIGINT DEFAULT DAYOFWEEK(a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES ('2007-02-03'); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a DATE, b BIGINT DEFAULT DAYOFYEAR(a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES ('2007-02-03'); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a TIME, b INT DEFAULT HOUR(a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES ('10:05:03'); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a TIME, b INT DEFAULT MINUTE(a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES ('10:05:03'); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a TIME, b INT DEFAULT SECOND(a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES ('10:05:03'); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a DATETIME(6), b INT DEFAULT MICROSECOND(a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES ('2009-12-31 23:59:59.000010'); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a DATE, b INT DEFAULT YEAR(a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES ('1987-01-01'); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a DATE, b INT DEFAULT MONTH(a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES ('1987-01-01'); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a DATE, b INT DEFAULT WEEK(a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES ('1987-02-01'); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a DATE, b INT DEFAULT YEARWEEK(a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES ('2000-01-01'); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a DATE, b INT DEFAULT QUARTER(a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES ('2008-04-01'); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a DATE, b INT DEFAULT EXTRACT(YEAR FROM a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES ('2009-07-02'); +SELECT * FROM t1; +DROP TABLE t1; +CREATE TABLE t1 (a DATETIME, b INT DEFAULT EXTRACT(YEAR_MONTH FROM a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES ('2009-07-02 01:02:03'); +SELECT * FROM t1; +DROP TABLE t1; +CREATE TABLE t1 (a DATETIME, b INT DEFAULT EXTRACT(DAY_MINUTE FROM a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES ('2009-07-02 01:02:03'); +SELECT * FROM t1; +DROP TABLE t1; +CREATE TABLE t1 (a DATETIME(6), b INT DEFAULT EXTRACT(MICROSECOND FROM a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES ('2009-07-02 01:02:03.000123'); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a DATE, b DATE, c INT DEFAULT TIMESTAMPDIFF(MONTH,a,b)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a,b) VALUES ('2003-02-01','2003-05-01'); +SELECT * FROM t1; +DROP TABLE t1; +CREATE TABLE t1 (a DATE, b DATE, c INT DEFAULT TIMESTAMPDIFF(YEAR,a,b)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a,b) VALUES ('2002-05-01','2001-01-01'); +SELECT * FROM t1; +DROP TABLE t1; +CREATE TABLE t1 (a DATE, b DATETIME, c INT DEFAULT TIMESTAMPDIFF(MINUTE,a,b)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a,b) VALUES ('2003-02-01','2003-05-01 12:05:55'); +SELECT * FROM t1; +DROP TABLE t1; + + +--echo # +--echo # Hybrid type functions +--echo # + +CREATE TABLE t1 (a INT, b INT, c INT DEFAULT COALESCE(a,b)); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (NULL, 1, DEFAULT); +SELECT * FROM t1; +DROP TABLE t1; + + +CREATE TABLE t1 (a INT, b INT, c INT DEFAULT IFNULL(a,b)); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (NULL, 2, DEFAULT); +INSERT INTO t1 VALUES (1, 2, DEFAULT); +SELECT * FROM t1; +DROP TABLE t1; + + +CREATE TABLE t1 (a INT, b INT, c INT DEFAULT NULLIF(a,b)); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (1, 1, DEFAULT); +INSERT INTO t1 VALUES (1, 2, DEFAULT); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a INT, b INT, c INT DEFAULT IF(a,b,2)); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (0, 1, DEFAULT); +INSERT INTO t1 VALUES (1, 1, DEFAULT); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a INT, b INT, c INT DEFAULT CASE WHEN a THEN b ELSE 2 END); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (0, 1, DEFAULT); +INSERT INTO t1 VALUES (1, 1, DEFAULT); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a INT, b INT DEFAULT (-a)); +SHOW CREATE TABLE t1; +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (10, DEFAULT); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a INT, b INT DEFAULT ABS(a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (-10, DEFAULT); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a DOUBLE, b INT DEFAULT CEILING(a), c INT DEFAULT FLOOR(a), d INT DEFAULT ROUND(a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (1.5, DEFAULT, DEFAULT, DEFAULT); +INSERT INTO t1 VALUES (-1.5, DEFAULT, DEFAULT, DEFAULT); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a INT, b INT, c INT DEFAULT (a+b), d INT DEFAULT (a-b)); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (2, 1, DEFAULT, DEFAULT); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a INT, b INT, c INT DEFAULT (a*b), d INT DEFAULT (a/b), e INT DEFAULT (a MOD b)); +SHOW CREATE TABLE t1; +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (7, 3, DEFAULT, DEFAULT, DEFAULT); +SELECT * FROM t1; +DROP TABLE t1; + +SET time_zone='+00:00'; +CREATE TABLE t1 (a DATETIME, b INT DEFAULT UNIX_TIMESTAMP(a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES ('2001-01-01 10:20:30', DEFAULT); +SELECT * FROM t1; +DROP TABLE t1; +SET time_zone=DEFAULT; + +CREATE TABLE t1 (a TIME, b INT DEFAULT TIME_TO_SEC(a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES ('22:23:00', DEFAULT); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a INT, b INT, c INT DEFAULT LEAST(a,b), d INT DEFAULT GREATEST(a,b)); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (0, 1, DEFAULT, DEFAULT); +INSERT INTO t1 VALUES (1, 1, DEFAULT, DEFAULT); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a INT, b INT, c INT DEFAULT LAST_VALUE(a,b)); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (1, 2, DEFAULT); +SELECT * FROM t1; +DROP TABLE t1; + +--echo # +--echo # CAST +--echo # +CREATE TABLE t1 (a VARCHAR(30), b DECIMAL(10,6) DEFAULT CAST(a AS DECIMAL(10,1))); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES ('123.456'); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a DECIMAL(10,3), + b VARCHAR(10) DEFAULT CAST(a AS CHAR(10)), + c VARCHAR(10) DEFAULT CAST(a AS CHAR(4))); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES (123.456); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a INT, b INT UNSIGNED DEFAULT CAST(a AS UNSIGNED)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES (-1); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a BIGINT UNSIGNED, b BIGINT SIGNED DEFAULT CAST(a AS SIGNED)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES (0xFFFFFFFFFFFFFFFF); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 ( + a VARCHAR(10) CHARACTER SET latin1, + b VARCHAR(10) CHARACTER SET latin1 DEFAULT a COLLATE latin1_bin, + c VARCHAR(10) CHARACTER SET utf8 DEFAULT CONVERT(a USING utf8), + d VARBINARY(10) DEFAULT (BINARY(a)) +); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES ('a'); +SELECT * FROM t1; +DROP TABLE t1; + + +--echo # +--echo # Bit functions +--echo # + +CREATE TABLE t1 (a INT, b INT DEFAULT BIT_COUNT(a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES (7); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a INT, b INT, c INT DEFAULT (a|b)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a,b) VALUES (1,2); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a INT, b INT, c INT DEFAULT (a&b)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a,b) VALUES (5,4); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a INT, b INT, c INT DEFAULT (a^b)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a,b) VALUES (11,3); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a INT, b INT, c INT DEFAULT (a&~b)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a,b) VALUES (5,1); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a INT, b INT, c INT DEFAULT (a<>b)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a,b) VALUES (5,1); +SELECT * FROM t1; +DROP TABLE t1; + + +--echo # +--echo # String functions +--echo # + +CREATE TABLE t1 (a VARCHAR(10), b VARCHAR(20) DEFAULT REVERSE(a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES ('abcd'); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a VARCHAR(10), b VARCHAR(10) DEFAULT UPPER(a), c VARCHAR(10) DEFAULT LOWER(a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES ('ABcd'); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a VARCHAR(10), b VARCHAR(10) DEFAULT LEFT(a,1), c VARCHAR(10) DEFAULT RIGHT(a,1), d VARCHAR(10) DEFAULT SUBSTR(a,2,2)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES ('abcd'); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a VARCHAR(20), b VARCHAR(20) DEFAULT SUBSTRING_INDEX(a,'.',2)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES ('www.mariadb.org'); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a VARCHAR(10), b VARCHAR(10), c VARCHAR(20) DEFAULT CONCAT(a,b)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a,b) VALUES ('a','b'); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a VARCHAR(10), b VARCHAR(10), c VARCHAR(20) DEFAULT CONCAT_WS(',',a,b)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a,b) VALUES ('a','b'); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a VARCHAR(10), b VARCHAR(10) DEFAULT REPLACE(a,'a','A')); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES ('abc'); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a VARCHAR(10), b VARCHAR(10) DEFAULT REGEXP_REPLACE(a,'[0-9]','.')); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES ('a1b2c'); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a VARCHAR(10), b VARCHAR(10) DEFAULT REGEXP_SUBSTR(a,'[0-9]+')); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES ('ab12cd'); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a VARCHAR(20), b VARCHAR(20) DEFAULT SOUNDEX(a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES ('tester'); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a VARCHAR(20), b VARCHAR(20) DEFAULT QUOTE(a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES ('a\'b'); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a VARCHAR(10), b VARCHAR(10) DEFAULT LPAD(a,10,'.'), c VARCHAR(10) DEFAULT RPAD(a,10,'.')); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES ('ab'); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a VARCHAR(10), b VARCHAR(10) DEFAULT LTRIM(a), c VARCHAR(10) DEFAULT RTRIM(a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES (' ab '); +SELECT a, HEX(b), HEX(c) FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a VARCHAR(10), b VARCHAR(10) DEFAULT TRIM(BOTH 'a' FROM a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES ('abba'); +SELECT a, b FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a INT, b VARCHAR(10) DEFAULT SPACE(a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES (3); +SELECT a, HEX(b) FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a INT, b VARCHAR(10), c VARCHAR(10) DEFAULT REPEAT(b,a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a,b) VALUES (3,'x'); +SELECT a, b, c FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (str VARCHAR(10), pos INT, len INT, newstr VARCHAR(10), result VARCHAR(10) DEFAULT INSERT(str,pos,len,newstr)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (str,pos,len,newstr) VALUES ('Quadratic', 3, 4, 'What'); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (n INT, res VARCHAR(10) DEFAULT ELT(n,'ej', 'Heja', 'hej', 'foo')); +SHOW CREATE TABLE t1; +INSERT INTO t1 (n) VALUES (1); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (bits INT, res VARCHAR(10) DEFAULT MAKE_SET(bits,'a','b','c','d')); +SHOW CREATE TABLE t1; +INSERT INTO t1 (bits) VALUES (1|4); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a INT, b VARCHAR(10) DEFAULT CHAR(a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES (77); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a INT, b VARCHAR(10) DEFAULT CONV(a,10,16)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES (64); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a INT, b INT, c VARCHAR(30) DEFAULT FORMAT(a,b)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a,b) VALUES (10000,3); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a INT, b INT, l VARCHAR(10), c VARCHAR(30) DEFAULT FORMAT(a,b,l)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a,b,l) VALUES (10000,2,'no_NO'),(10000,2,'ru_RU'),(10000,2,'ar_BH'); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a VARCHAR(10), b VARCHAR(20) DEFAULT GET_FORMAT(DATE,a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES ('EUR'),('USA'),('JIS'),('ISO'),('INTERNAL'); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 ( + bits INT, + v_on VARCHAR(10), + v_off VARCHAR(10), + v_separator VARCHAR(10), + number_of_bits INT, + x VARCHAR(30) DEFAULT EXPORT_SET(bits, v_on, v_off, v_separator, number_of_bits) +); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (0x50006,'Y','N','',64,DEFAULT); +SELECT * FROM t1; +DROP TABLE t1; + +--error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +CREATE TABLE t1 (a VARCHAR(30), b BLOB DEFAULT LOAD_FILE(a)); + +--echo # +--echo # Predicates +--echo # + +CREATE TABLE t1 (a INT, b INT DEFAULT (NOT a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES (NULL),(0),(1); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a INT, b INT, x INT DEFAULT (a XOR b)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a,b) VALUES (0,0),(0,1),(1,0),(1,1); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a INT, b INT DEFAULT (a IS TRUE), c INT DEFAULT (a IS NOT TRUE)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES (NULL),(0),(1); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a INT, b INT DEFAULT (a IS FALSE), c INT DEFAULT (a IS NOT FALSE)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES (NULL),(0),(1); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a INT, b INT DEFAULT (a IS NULL), c INT DEFAULT (a IS NOT NULL)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES (NULL),(0),(1); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a INT, b INT DEFAULT (a IS UNKNOWN), c INT DEFAULT (a IS NOT UNKNOWN)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES (NULL),(0),(1); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a INT, + eq INT DEFAULT (a=0), equal INT DEFAULT (a<=>0), + ne INT DEFAULT (a<>0), + lt INT DEFAULT (a<0), le INT DEFAULT (a<=0), + gt INT DEFAULT (a>0), ge INT DEFAULT (a>=0)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES (NULL),(-1),(0),(1); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a VARCHAR(10), b INT DEFAULT (a LIKE 'a%')); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES ('AAA'),('aaa'),('bbb'); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a VARCHAR(10), b INT DEFAULT (a RLIKE 'a$')); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES ('AAA'),('aaa'),('bbb'); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a VARCHAR(10), b INT DEFAULT (a IN ('aaa','bbb'))); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES ('AAA'),('aaa'),('bbb'),('ccc'); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a VARCHAR(10), b INT DEFAULT (a NOT IN ('aaa','bbb'))); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES ('AAA'),('aaa'),('bbb'),('ccc'); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a VARCHAR(10), b INT DEFAULT (a BETWEEN 'aaa' AND 'bbb')); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES ('AAA'),('aaa'),('bbb'),('ccc'); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a VARCHAR(10), b INT DEFAULT (a NOT BETWEEN 'aaa' AND 'bbb')); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES ('AAA'),('aaa'),('bbb'),('ccc'); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a TEXT DEFAULT UUID()); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (); +SELECT LENGTH(a)>0 FROM t1; +DROP TABLE t1; + +--echo # +--echo # Numeric result functions with string input +--echo # + +CREATE TABLE t1 (a VARCHAR(10), b INT DEFAULT STRCMP(a,'b')); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES ('A'),('a'),('B'),('b'),('C'),('c'); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a VARCHAR(10), b INT DEFAULT LENGTH(a), c INT DEFAULT CHAR_LENGTH(a), d INT DEFAULT BIT_LENGTH(a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES ('a'),('aa'),('aaa'); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a VARCHAR(10), b INT DEFAULT LOCATE('a',a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES ('xa'),('xxa'),('xxxa'); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a VARCHAR(10), b INT DEFAULT REGEXP_INSTR(a, 'a')); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES ('xa'),('xxa'),('xxxa'); +SELECT * FROM t1; +DROP TABLE t1; + +--echo # +--echo # INT result metadata functions +--echo # + +# QQ: LAST_INSERT_ID() should probably be allowed +--error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +CREATE TABLE t1 +( + id SERIAL PRIMARY KEY, + b INT DEFAULT LAST_INSERT_ID() +); + +CREATE TABLE t1 (a INT DEFAULT CONNECTION_ID()); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES(); +SELECT a>0 FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a VARCHAR(10), b INT DEFAULT COERCIBILITY(a), c INT DEFAULT COERCIBILITY(b)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES ('test'); +SELECT * FROM t1; +DROP TABLE t1; + +--echo # +--echo # String result metadata functions +--echo # +CREATE TABLE t1 ( + a VARCHAR(10) CHARACTER SET latin1, + b VARCHAR(20) DEFAULT CHARSET(a), + c VARCHAR(20) DEFAULT COLLATION(a) +); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES ('test'); +SELECT * FROM t1; +DROP TABLE t1; + +--echo # +--echo # Hash, compression, encode/decode +--echo # +CREATE TABLE t1 (a VARCHAR(10), b BIGINT DEFAULT CRC32(a), c TEXT DEFAULT MD5(a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES ('a'); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a VARCHAR(10), b TEXT DEFAULT TO_BASE64(a), c TEXT DEFAULT FROM_BASE64(b)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES ('aaaabbbb'); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a VARCHAR(10), b TEXT DEFAULT HEX(a), c TEXT DEFAULT UNHEX(b)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES ('aaaabbbb'); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a VARCHAR(10), b TEXT DEFAULT ENCODE(a,'test'), c TEXT DEFAULT DECODE(b,'test')); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES ('aaaabbbb'); +SELECT a, HEX(b), c FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a VARCHAR(30), b TEXT DEFAULT PASSWORD(a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES ('notagoodpwd'); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 ( + a VARCHAR(30), + b BLOB DEFAULT AES_ENCRYPT(a, 'passwd'), + c TEXT DEFAULT AES_DECRYPT(b, 'passwd') +); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES ('test'); +SELECT c FROM t1; +DROP TABLE t1; + +--echo # +--echo # Collations +--echo # + +--error ER_BAD_DATA +CREATE TABLE t1 (a VARCHAR(20) CHARACTER SET latin1 DEFAULT CONCAT('ö')) CHARACTER SET koi8r COLLATE koi8r_bin; +CREATE OR REPLACE TABLE t1 (a char(2) default concat('A') COLLATE utf8mb4_unicode_ci); +SHOW CREATE TABLE t1; +DROP TABLE t1; + +# +# Order of evaluation: +# +create table t1 (a int default 1, b int default (rand()*0+2), c int); +insert t1 (c) values (a); +insert t1 (c) values (b); +select * from t1; +drop table t1; + +# +# ALTER ... SET DEFAULT +# +create table t1 (a int default 1, b int default (1+1), c int); +show create table t1; +alter table t1 alter a set default (2+3), alter b set default 4, + alter c set default (-a); +--error ER_PARSE_ERROR +alter table t1 alter a set default 1+2; +show create table t1; +drop table t1; + +# +# CREATE ... SELECT +# +create table t1 (a int default 5 check (a>10), b int default (5+5), c int as (a+b)); +create table t2 as select a, b, c from t1; +create table t3 as select max(a), max(b), max(c) from t1; +show create table t2; +show create table t3; +drop table t1, t2, t3; diff --git a/mysql-test/t/default_session.test b/mysql-test/t/default_session.test new file mode 100644 index 00000000000..7796354ffd4 --- /dev/null +++ b/mysql-test/t/default_session.test @@ -0,0 +1,82 @@ +# +# DEFAULT clause with functions that depend on the current session state +# + +source include/not_embedded.inc; + +create database mysqltest1; + +create user ''@localhost; +create user foo@localhost; +create role bar; +grant select on *.* to ''@localhost; +grant select,insert on *.* to foo@localhost; +grant select,insert on *.* to bar; +grant bar to ''@localhost; + +create table t1 (n varchar(100), + u varchar(100) default user(), + cu varchar(100) default current_user(), + cr varchar(100) default current_role(), + d varchar(100) default database()); + +create definer=foo@localhost view mysqltest1.v1 as select * from t1; +create definer=bar view v2 as select * from t1; +create view v3 as select * from v2; + +create definer=foo@localhost view mysqltest1.v4 as select default(n),default(u),default(cu),default(cr), default(d) from t1; +create definer=bar view v5 as select default(n),default(u),default(cu),default(cr), default(d) from t1; +create view v6 as select * from v5; + +insert t1 (n) values ('t1'); +insert mysqltest1.v1 (n) values ('v1'); +insert v2 (n) values ('v2'); +insert v3 (n) values ('v3'); + +select default(n),default(u),default(cu),default(cr), default(d) from t1 limit 1; +select * from mysqltest1.v4 limit 1; +select * from v5 limit 1; +select * from v6 limit 1; + +connect (conn,localhost,conn,,mysqltest1); +set role bar; +insert test.t1 (n) values ('t1'); +insert v1 (n) values ('v1'); +insert test.v2 (n) values ('v2'); +insert test.v3 (n) values ('v3'); + +select default(n),default(u),default(cu),default(cr), default(d) from test.t1 limit 1; +select * from v4 limit 1; +select * from test.v5 limit 1; +select * from test.v6 limit 1; +connection default; +disconnect conn; + +select * from t1; +drop database mysqltest1; +drop view v2, v3, v5, v6; +drop table t1; +drop user ''@localhost; +drop user foo@localhost; +drop role bar; + +create table t1 (a date, + mn varchar(100) default monthname(a), + dn varchar(100) default dayname(a), + df varchar(100) default date_format(a, "%a, %b")); + +insert t1 (a) values ('2010-12-2'); +set lc_time_names=de_DE; +insert t1 (a) values ('2010-12-2'); +set lc_time_names=default; + +select * from t1; +drop table t1; + +create table t1 (a varchar(100) default @@sql_mode); +insert t1 () values (); +set sql_mode=ansi; +insert t1 () values (); +set sql_mode=default; +select * from t1; +drop table t1; diff --git a/mysql-test/t/dyncol.test b/mysql-test/t/dyncol.test index 03e2345ba1c..49b2c5542d3 100644 --- a/mysql-test/t/dyncol.test +++ b/mysql-test/t/dyncol.test @@ -661,7 +661,7 @@ select column_get(column_create(1, "18446744073709552001" as char), 1 as int); --echo # mysqld --echo # --error ER_TOO_BIG_SCALE -SELECT COLUMN_GET(`x`, 'y' AS DECIMAL(5,34)); +SELECT COLUMN_GET(`x`, 'y' AS DECIMAL(5,50)); --echo # --echo # test of symbolic names @@ -923,3 +923,37 @@ SELECT COLUMN_JSON(COLUMN_CREATE('a',1 AS DECIMAL,'b',1 AS DECIMAL)); --echo # --echo # end of 10.0 tests --echo # + +--echo # +--echo # Start of 10.2 tests +--echo # + +--echo # +--echo # MDEV-10134 Add full support for DEFAULT +--echo # +CREATE TABLE t1 ( + name VARCHAR(10), + value VARCHAR(10), + dyncol0 BLOB DEFAULT COLUMN_CREATE(name, value), + value_dyncol0_name0 VARCHAR(10) DEFAULT COLUMN_GET(dyncol0, 'name0' AS CHAR), + dyncol1 BLOB DEFAULT COLUMN_ADD(dyncol0, 'name1', 'value1'), + value_dyncol1_name1 VARCHAR(10) DEFAULT COLUMN_GET(dyncol1, 'name1' AS CHAR), + dyncol2 BLOB DEFAULT COLUMN_DELETE(dyncol1, 'name1'), + dyncol2_exists_name0 INT DEFAULT COLUMN_EXISTS(dyncol2, 'name0'), + dyncol2_exists_name1 INT DEFAULT COLUMN_EXISTS(dyncol2, 'name1'), + dyncol2_check INT DEFAULT COLUMN_CHECK(dyncol2), + dyncol1_list TEXT DEFAULT COLUMN_LIST(dyncol1), + dyncol1_json TEXT DEFAULT COLUMN_JSON(dyncol1) +); +SHOW CREATE TABLE t1; +INSERT INTO t1 (name,value) VALUES ('name0', 'value0'); +SELECT value_dyncol0_name0, value_dyncol1_name1 FROM t1; +SELECT dyncol2_check, dyncol2_exists_name0, dyncol2_exists_name1 FROM t1; +SELECT dyncol1_list FROM t1; +SELECT dyncol1_json FROM t1; +DROP TABLE t1; + + +--echo # +--echo # End of 10.2 tests +--echo # diff --git a/mysql-test/t/events_1.test b/mysql-test/t/events_1.test index 88120b0cd4f..9768127f458 100644 --- a/mysql-test/t/events_1.test +++ b/mysql-test/t/events_1.test @@ -461,6 +461,25 @@ DROP EVENT ev1; SHOW EVENTS; +--echo # +--echo # MDEV-9524 Cannot load from mysql.event when sql_mode is set to PAD_CHAR_TO_FULL_LENGTH +--echo # +CREATE TABLE t1 (a INT); +CREATE EVENT ev1 ON SCHEDULE EVERY 5 SECOND DO DELETE FROM t1; +--replace_column 8 # 9 # +SHOW EVENTS; +SET sql_mode=PAD_CHAR_TO_FULL_LENGTH; +--replace_column 8 # 9 # +SHOW EVENTS; +DROP EVENT ev1; +CREATE EVENT ev1 ON SCHEDULE EVERY 5 SECOND DO DELETE FROM t1; +--replace_column 8 # 9 # +SHOW EVENTS; +DROP EVENT ev1; +DROP TABLE t1; +SET sql_mode=DEFAULT; + + --echo --echo # --echo # End of tests diff --git a/mysql-test/t/events_2.test b/mysql-test/t/events_2.test index 7d9ac7c5858..20f17966b29 100644 --- a/mysql-test/t/events_2.test +++ b/mysql-test/t/events_2.test @@ -69,10 +69,10 @@ select /*2*/ user, host, db, command, state, info select release_lock("test_lock2"); drop event закачка; -# Wait for release_lock("test_lock2") to complete, +# Wait for get_lock("test_lock2") to complete, # to avoid polluting the next test information_schema.processlist let $wait_condition= select count(*) = 0 from information_schema.processlist - where (state like 'User lock%' AND info like 'select get_lock%'); + where info='select get_lock("test_lock2", 20)'; --source include/wait_condition.inc diff --git a/mysql-test/t/features.test b/mysql-test/t/features.test index 225ab40b361..63e923a772b 100644 --- a/mysql-test/t/features.test +++ b/mysql-test/t/features.test @@ -130,3 +130,11 @@ insert into t1 values(2); drop table t1; show status like "feature_delay_key_write"; + +# +# Feature CHECK CONSTRAINT +# +create table t1 (a int check (a > 5)); +create table t2 (b int, constraint foo check (b < 10)); +drop table t1, t2; +show status like "feature_check_constraint"; diff --git a/mysql-test/t/fulltext3.test b/mysql-test/t/fulltext3.test index 1b6a07c540f..66f940b495e 100644 --- a/mysql-test/t/fulltext3.test +++ b/mysql-test/t/fulltext3.test @@ -32,3 +32,18 @@ INSERT INTO t1 VALUES(0xA3C2); DROP TABLE t1; # End of 5.1 tests + +# +# MDEV-9986 Full-text search of the utf8mb4 column causes crash +# +create table t1 ( + id varchar(255), + business_name text null collate utf8mb4_unicode_ci, + street_address text, + fulltext index ft (business_name), + fulltext index ft2 (street_address) +); +--error ER_FT_MATCHING_KEY_NOT_FOUND +select * from t1 where match (business_name, street_address) against ('some business name and address here'); +select * from t1 where match (business_name, street_address) against ('some business name and address here' in boolean mode); +drop table t1; diff --git a/mysql-test/t/func_compress.test b/mysql-test/t/func_compress.test index 2a06769b2ef..50eb14777a7 100644 --- a/mysql-test/t/func_compress.test +++ b/mysql-test/t/func_compress.test @@ -152,3 +152,20 @@ set global max_allowed_packet=default; --echo # --echo # End of 5.5 tests --echo # + +--echo # +--echo # Start of 10.2 tests +--echo # + +--echo # +--echo # MDEV-10134 Add full support for DEFAULT +--echo # +CREATE TABLE t1 (a TEXT, b BLOB DEFAULT COMPRESS(a), bl INT DEFAULT UNCOMPRESSED_LENGTH(b), a1 TEXT DEFAULT UNCOMPRESS(b)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES (REPEAT('a',100)); +SELECT bl, a1 FROM t1; +DROP TABLE t1; + +--echo # +--echo # End of 10.2 tests +--echo # diff --git a/mysql-test/t/func_crypt.test b/mysql-test/t/func_crypt.test index ca6e712f45c..6232f019e6b 100644 --- a/mysql-test/t/func_crypt.test +++ b/mysql-test/t/func_crypt.test @@ -70,3 +70,10 @@ SELECT OLD_PASSWORD(c1), PASSWORD(c1) FROM t1; DROP TABLE t1; --echo End of 5.0 tests +--echo Start of 10.2 tests + +CREATE TABLE t1 (a VARCHAR(10), b VARCHAR(30) DEFAULT ENCRYPT(a,123)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES ('hello'); +SELECT * FROM t1; +DROP TABLE t1; diff --git a/mysql-test/t/func_default.test b/mysql-test/t/func_default.test index 7bebd4b4b72..fbd73990297 100644 --- a/mysql-test/t/func_default.test +++ b/mysql-test/t/func_default.test @@ -29,3 +29,15 @@ INSERT INTO t1 VALUES (1, 'one'), (2, 'two'), (3, 'three'); SELECT s, 32 AS mi FROM t1 GROUP BY s HAVING DEFAULT(mi) IS NULL; DROP TABLE t1; +# +# 10.2 tests +# + +set timestamp=unix_timestamp('2001-01-01 10:20:30.123456'); +create table t1 (a int default 1, b int default (a+1), + c varchar(100) default 'foo', d text default 'bar', + e timestamp default now(), f timestamp(6) default now(2)); +insert t1 () values (); +insert t1 (a) values (10); +select default(a),default(b),default(c),default(d),default(e),default(f) from t1; +drop table t1; diff --git a/mysql-test/t/func_des_encrypt.test b/mysql-test/t/func_des_encrypt.test index e121aedab06..c9661b81cc0 100644 --- a/mysql-test/t/func_des_encrypt.test +++ b/mysql-test/t/func_des_encrypt.test @@ -1,4 +1,4 @@ --- source include/have_ssl_crypto_functs.inc +-- source include/have_des.inc # This test can't be in func_encrypt.test, because it requires # --des-key-file to not be set. diff --git a/mysql-test/t/func_digest.test b/mysql-test/t/func_digest.test index 81f19c7e091..384b238523a 100644 --- a/mysql-test/t/func_digest.test +++ b/mysql-test/t/func_digest.test @@ -494,3 +494,24 @@ SET NAMES latin1; SELECT sha2('1',224); --disable_metadata +--echo # +--echo # Start of 10.2 tests +--echo # + +--echo # +--echo # MDEV-10134 Add full support for DEFAULT +--echo # + +CREATE TABLE t1 ( + a VARCHAR(30), + b TEXT DEFAULT SHA(a), + c TEXT DEFAULT SHA2(a,224) +); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES ('abc'); +SELECT * FROM t1; +DROP TABLE t1; + +--echo # +--echo # End of 10.2 tests +--echo # diff --git a/mysql-test/t/func_encrypt.test b/mysql-test/t/func_encrypt.test index 4eab0ac87e9..e27a2bd46d3 100644 --- a/mysql-test/t/func_encrypt.test +++ b/mysql-test/t/func_encrypt.test @@ -1,4 +1,4 @@ --- source include/have_ssl_crypto_functs.inc +-- source include/have_des.inc --disable_warnings drop table if exists t1; @@ -121,3 +121,25 @@ DROP TABLE t1; --echo # --echo # End of 10.1 tests --echo # + +--echo # +--echo # Start of 10.2 tests +--echo # + +--echo # +--echo # MDEV-10134 Add full support for DEFAULT +--echo # + +CREATE TABLE t1 ( + a VARCHAR(30), + b BLOB DEFAULT DES_ENCRYPT(a, 'passwd'), + c TEXT DEFAULT DES_DECRYPT(b, 'passwd') +); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES ('test'); +SELECT c FROM t1; +DROP TABLE t1; + +--echo # +--echo # End of 10.2 tests +--echo # diff --git a/mysql-test/t/func_encrypt_ucs2.test b/mysql-test/t/func_encrypt_ucs2.test index 8b4cd44d354..1242c3b9e6a 100644 --- a/mysql-test/t/func_encrypt_ucs2.test +++ b/mysql-test/t/func_encrypt_ucs2.test @@ -1,4 +1,4 @@ --- source include/have_ssl_crypto_functs.inc +-- source include/have_des.inc -- source include/have_ucs2.inc --echo # diff --git a/mysql-test/t/func_gconcat.test b/mysql-test/t/func_gconcat.test index 3cc244339d3..bdd295d0fa9 100644 --- a/mysql-test/t/func_gconcat.test +++ b/mysql-test/t/func_gconcat.test @@ -873,3 +873,45 @@ SELECT LENGTH(GROUP_CONCAT(f1 ORDER BY f2)) FROM t1 GROUP BY f2; DROP TABLE t1; SET group_concat_max_len= DEFAULT; + + +--echo # +--echo # Start of 10.2 tests +--echo # + +--echo # +--echo # MDEV-10124 Incorrect usage of CUBE/ROLLUP and ORDER BY with GROUP_CONCAT(a ORDER BY a) +--echo # + +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (10),(20),(30); + +SELECT a,GROUP_CONCAT(a ORDER BY a) FROM t1 GROUP BY a WITH ROLLUP; +CREATE VIEW v1 AS +SELECT a,GROUP_CONCAT(a ORDER BY a) FROM t1 GROUP BY a WITH ROLLUP; +SELECT * FROM v1; +DROP VIEW v1; + +SELECT a,GROUP_CONCAT(a ORDER BY a) FROM t1 GROUP BY a WITH ROLLUP HAVING GROUP_CONCAT(a ORDER BY a)='10,20,30'; +CREATE VIEW v1 AS +SELECT a,GROUP_CONCAT(a ORDER BY a) FROM t1 GROUP BY a WITH ROLLUP HAVING GROUP_CONCAT(a ORDER BY a)='10,20,30'; +SELECT * FROM v1; +DROP VIEW v1; + +SELECT * FROM (SELECT a,GROUP_CONCAT(a ORDER BY a) FROM t1 GROUP BY a WITH ROLLUP HAVING GROUP_CONCAT(a ORDER BY a)='10,20,30') t1; +CREATE VIEW v1 AS +SELECT * FROM (SELECT a,GROUP_CONCAT(a ORDER BY a) FROM t1 GROUP BY a WITH ROLLUP HAVING GROUP_CONCAT(a ORDER BY a)='10,20,30') t1; +SELECT * FROM v1; +DROP VIEW v1; + +SELECT (SELECT GROUP_CONCAT(a ORDER BY a) FROM t1 GROUP BY a WITH ROLLUP HAVING GROUP_CONCAT(a ORDER BY a)='10,20,30'); +CREATE VIEW v1 AS +SELECT (SELECT GROUP_CONCAT(a ORDER BY a) FROM t1 GROUP BY a WITH ROLLUP HAVING GROUP_CONCAT(a ORDER BY a)='10,20,30'); +SELECT * FROM v1; +DROP VIEW v1; + +DROP TABLE t1; + +--echo # +--echo # End of 10.2 tests +--echo # diff --git a/mysql-test/t/func_in.test b/mysql-test/t/func_in.test index fab39b04484..9e848aa1847 100644 --- a/mysql-test/t/func_in.test +++ b/mysql-test/t/func_in.test @@ -607,6 +607,28 @@ DROP TABLE t1; --echo # End of 5.3 tests + +--echo # +--echo # Start of 10.0 tests +--echo # + +--echo # +--echo # MDEV-10020 InnoDB NOT IN Query Crash When One Item Is NULL +--echo # +CREATE TABLE t1 +( + a INT(11), + b VARCHAR(10), + KEY (b) +); +INSERT INTO t1 VALUES (1,'x'),(2,'y'),(3,'z'); +SELECT * FROM t1 WHERE b NOT IN (NULL, '', 'A'); +DROP TABLE t1; + +--echo # +--echo # Start of 10.1 tests +--echo # + --echo # --echo # MDEV-8755 Equal field propagation is not performed any longer for the IN list when multiple comparison types --echo # diff --git a/mysql-test/t/func_math.test b/mysql-test/t/func_math.test index b48f4599074..ad821645aeb 100644 --- a/mysql-test/t/func_math.test +++ b/mysql-test/t/func_math.test @@ -486,6 +486,14 @@ SELECT -a FROM t1; --error ER_DATA_OUT_OF_RANGE SELECT -b FROM t1; +# try with two rows now +INSERT INTO t1 VALUES(0,0); + +--error ER_DATA_OUT_OF_RANGE +SELECT -a FROM t1; +--error ER_DATA_OUT_OF_RANGE +SELECT -b FROM t1; + DROP TABLE t1; # Decimal overflows @@ -586,5 +594,14 @@ SELECT STDDEV_POP(ROUND(0,@A:=2009)) FROM (SELECT 1 UNION SELECT 2) fake_table; --echo # ---echo # End of 10.0 tests +--echo # Start of 10.2 tests --echo # + +--echo # Test zero +select 0=0, 0=-0, 0.0= -0.0, 0.0 = -(0.0), 0.0E1=-0.0E1, 0.0E1=-(0.0E1); + +--echo # +--echo # CRC32 tests +--echo # + +select CRC32(NULL), CRC32(''), CRC32('MySQL'), CRC32('mysql'), CRC32('01234567'), CRC32('012345678'); diff --git a/mysql-test/t/func_misc.test b/mysql-test/t/func_misc.test index 222608c0579..f24576cc992 100644 --- a/mysql-test/t/func_misc.test +++ b/mysql-test/t/func_misc.test @@ -1081,3 +1081,39 @@ select release_lock('test'); --echo --echo # -- Done. --echo + +--echo # +--echo # Start of 10.2 tests +--echo # + +--echo # +--echo # MDEV-10134 Add full support for DEFAULT +--echo # + +CREATE TABLE t1 ( + a VARCHAR(30), + b BIGINT DEFAULT INET_ATON(a), + a1 VARCHAR(30) DEFAULT INET_NTOA(b), + c INT DEFAULT IS_IPV4(a), + d INT DEFAULT IS_IPV6(a) +); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES ('192.168.001.001'),('::1'),('xxx'); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 ( + str VARCHAR(128), + addr VARBINARY(16) DEFAULT INET6_ATON(str), + str1 VARCHAR(128) DEFAULT INET6_NTOA(addr), + b INT DEFAULT IS_IPV4_COMPAT(addr), + c INT DEFAULT IS_IPV4_MAPPED(addr) +); +SHOW CREATE TABLE t1; +INSERT INTO t1 (str) VALUES ('::FFFF:192.168.0.1'),('::10.0.5.9'); +SELECT str, str1, b,c FROM t1; +DROP TABLE t1; + +--echo # +--echo # End of 10.2 tests +--echo # diff --git a/mysql-test/t/func_test.test b/mysql-test/t/func_test.test index b7bca957e5b..d1c0702da80 100644 --- a/mysql-test/t/func_test.test +++ b/mysql-test/t/func_test.test @@ -179,6 +179,8 @@ explain extended select not (a+0) from t1; select * from t1 where not (a+0); explain extended select * from t1 where not (a+0); +select not 1, not null, not not null, 1 is not null; + drop table t1; --echo # diff --git a/mysql-test/t/func_weight_string.test b/mysql-test/t/func_weight_string.test index b8fdfd8b250..ddaf14dc75d 100644 --- a/mysql-test/t/func_weight_string.test +++ b/mysql-test/t/func_weight_string.test @@ -147,3 +147,20 @@ DROP TABLE t1; --echo # --echo # End of 10.1 tests --echo # + +--echo # +--echo # Start of 10.2 tests +--echo # + +--echo # +--echo # MDEV-10134 Add full support for DEFAULT +--echo # +CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET latin1, b VARBINARY(10) DEFAULT WEIGHT_STRING(a AS CHAR(10))); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES ('a'); +SELECT a, HEX(b) FROM t1; +DROP TABLE t1; + +--echo # +--echo # End of 10.2 tests +--echo # diff --git a/mysql-test/t/gis-debug.test b/mysql-test/t/gis-debug.test index a0647a2c9f4..30fcb3661c4 100644 --- a/mysql-test/t/gis-debug.test +++ b/mysql-test/t/gis-debug.test @@ -4,3 +4,19 @@ SET @tmp=ST_GIS_DEBUG(1); --source include/gis_debug.inc + + +--echo # +--echo # Start of 10.2 tests +--echo # + +--echo # +--echo # MDEV-10134 Add full support for DEFAULT +--echo # + +--error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED +CREATE TABLE t1 (a INT DEFAULT ST_GIS_DEBUG(1)); + +--echo # +--echo # End of 10.2 tests +--echo # diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test index 18cfe95b749..12b3e607e96 100644 --- a/mysql-test/t/gis.test +++ b/mysql-test/t/gis.test @@ -1525,3 +1525,189 @@ CREATE TABLE t1 (g1 GEOMETRY NOT NULL,g2 GEOMETRY NULL); CREATE TABLE t2 AS SELECT WITHIN(g1,g1) as w1,WITHIN(g2,g2) AS w2 FROM t1; SHOW CREATE TABLE t2; DROP TABLE t1,t2; + +--echo # +--echo # Start of 10.2 tests +--echo # + +--echo # +--echo # MDEV-10134 Add full support for DEFAULT +--echo # + +CREATE TABLE t1 (a POINT, x DOUBLE DEFAULT x(a), y DOUBLE DEFAULT y(a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES (Point(1,2)); +SELECT x,y FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (g GEOMETRY, area DOUBLE DEFAULT ST_AREA(g)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (g) VALUES (GeomFromText('POLYGON((0 0,20 0,20 20,0 20,0 0))')); +SELECT area FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (g GEOMETRY, length DOUBLE DEFAULT ST_LENGTH(g)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (g) VALUES (GeomFromText('LINESTRING(0 0,20 0,20 20,0 20,0 0)')); +SELECT length FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (g POINT, distance DOUBLE DEFAULT ST_DISTANCE(g, POINT(0,0))); +SHOW CREATE TABLE t1; +INSERT INTO t1 (g) VALUES (Point(1,0)); +SELECT distance FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a TEXT, g GEOMETRY DEFAULT GeomFromText(a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES ('point(1 1)'); +SELECT AsText(g) FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (x INT, y INT, g GEOMETRY DEFAULT POINT(x,y)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (x,y) VALUES (10,20); +SELECT AsText(g) FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a GEOMETRY, b GEOMETRY DEFAULT PointN(a,2)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES (GeomFromText('LineString(1 1,2 2,3 3)')); +SELECT AsText(b) FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a GEOMETRY, b GEOMETRY DEFAULT StartPoint(a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES (GeomFromText('LineString(1 1,2 2,3 3)')); +SELECT AsText(b) FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a GEOMETRY, b GEOMETRY, c GEOMETRY DEFAULT GeometryCollection(a,b)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a,b) VALUES (Point(1,1), Point(2,2)); +SELECT AsText(c) FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a GEOMETRY, b GEOMETRY DEFAULT GeomFromWKB(AsBinary(a),20)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES (GeomFromText('POINT(1 1)', 10)); +SELECT AsText(a), SRID(a), AsText(b), SRID(b) FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a GEOMETRY, b GEOMETRY DEFAULT BOUNDARY(a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES (GeomFromText('POLYGON((10 10, 10 20, 20 20, 20 10, 10 10))')); +SELECT AsText(b) FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a GEOMETRY, b GEOMETRY DEFAULT BUFFER(a,10)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES (GeomFromText('POLYGON((10 10, 10 20, 20 20, 20 10, 10 10))')); +SELECT GeometryType(b) FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a GEOMETRY, b GEOMETRY DEFAULT CENTROID(a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES (GeomFromText('POLYGON((10 10, 10 20, 20 20, 20 10, 10 10))')); +SELECT AsText(b) FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a GEOMETRY, b GEOMETRY DEFAULT ENVELOPE(a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES (GeomFromText('LineString(1 1,4 4)')); +SELECT AsText(b) FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a GEOMETRY, b GEOMETRY DEFAULT PointOnSurface(a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES (GeomFromText('POLYGON((10 10, 10 20, 20 20, 20 10, 10 10))')); +SELECT GeometryType(b) FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a GEOMETRY, b GEOMETRY DEFAULT Point(1,1), c GEOMETRY DEFAULT ST_UNION(a,b)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES (Point(0,0)); +SELECT AsText(c) FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a GEOMETRY, b VARCHAR(20) DEFAULT GeometryType(a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES (Point(0, 0)); +SELECT b FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a GEOMETRY, b INT DEFAULT IsSimple(a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES (Point(0, 0)); +SELECT b FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a GEOMETRY, b INT DEFAULT IsEmpty(a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES (Point(0, 0)); +SELECT b FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a GEOMETRY, b INT DEFAULT IsRing(a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES (GeomFromText('LineString(0 0,0 1,1 1,1 0,0 0)')); +SELECT b FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a GEOMETRY, b INT DEFAULT IsClosed(a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES (GeomFromText('LineString(0 0,0 1,1 1,1 0,0 0)')); +SELECT b FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a GEOMETRY, b INT DEFAULT Dimension(a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES (Buffer(Point(1,1),1)); +SELECT b FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a GEOMETRY, b INT DEFAULT NumGeometries(a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES (ST_UNION(Point(1,1),Point(0,0))); +SELECT b FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a GEOMETRY, b INT DEFAULT NumInteriorRings(a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES (GeomFromText('Polygon((0 0,0 3,3 3,3 0,0 0),(1 1,1 2,2 2,2 1,1 1))')); +SELECT b FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a GEOMETRY, b INT DEFAULT NumPoints(a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES (LineString(Point(1,1),Point(0,0))); +SELECT b FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a GEOMETRY, b INT DEFAULT SRID(a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES (GeomFromText('Point(1 1)', 100)); +SELECT b FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a GEOMETRY, b GEOMETRY, c INT DEFAULT MBRDisjoint(a,b)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a,b) VALUES (Point(1,1),Point(1,1)); +SELECT c FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a GEOMETRY, b GEOMETRY, c INT DEFAULT ST_Disjoint(a,b)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a,b) VALUES (Point(1,1),Point(1,1)); +SELECT c FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a GEOMETRY, b GEOMETRY, c INT DEFAULT ST_Relate(a,b,'T*F**FFF*')); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a,b) VALUES (Point(1,1),Point(1,1)); +SELECT c FROM t1; +DROP TABLE t1; + +--echo # +--echo # End of 10.2 tests +--echo # diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test index d3f84596106..b816afed851 100644 --- a/mysql-test/t/grant.test +++ b/mysql-test/t/grant.test @@ -2172,3 +2172,30 @@ drop user mysqltest_u1; set GLOBAL sql_mode=default; # Wait till we reached the initial number of concurrent sessions --source include/wait_until_count_sessions.inc + +--echo # +--echo # Start of 10.2 tests +--echo # + +--echo # +--echo # MDEV-10134 Add full support for DEFAULT +--echo # + + +CREATE TABLE t1 (a VARCHAR(30) DEFAULT USER()); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (); +GRANT ALL PRIVILEGES ON test.* TO dummy@localhost IDENTIFIED BY 'pwd'; +connect (conn1,localhost,dummy,pwd,test); +connection conn1; +INSERT INTO t1 VALUES (); +connection default; +disconnect conn1; +INSERT INTO t1 VALUES (); +SELECT * FROM t1; +DROP TABLE t1; +DROP USER dummy@localhost; + +--echo # +--echo # End of 10.2 tests +--echo # diff --git a/mysql-test/t/grant5.test b/mysql-test/t/grant5.test index db953d97fb3..14f2fd65020 100644 --- a/mysql-test/t/grant5.test +++ b/mysql-test/t/grant5.test @@ -5,3 +5,21 @@ # --error ER_NONEXISTING_GRANT SHOW GRANTS FOR root@invalid_host; + +# +# MDEV-9580 SHOW GRANTS FOR fails +# +create user test; +create user foo; +create role foo; +grant foo to test; +--connect (conn_1, localhost, test,,) +set role foo; +show grants for test; # user +show grants for foo; # role +--error ER_DBACCESS_DENIED_ERROR +show grants for foo@'%'; # user +--connection default +drop user test, foo; +drop role foo; + diff --git a/mysql-test/t/greedy_optimizer.test b/mysql-test/t/greedy_optimizer.test index 8f969f2562a..dcd0587d76e 100644 --- a/mysql-test/t/greedy_optimizer.test +++ b/mysql-test/t/greedy_optimizer.test @@ -138,7 +138,7 @@ insert into t7 values (21,2,3,4,5,6); # The actual test begins here # -# Check the default values for the optimizer paramters +# Check the default values for the optimizer parameters select @@optimizer_search_depth; select @@optimizer_prune_level; diff --git a/mysql-test/t/help.test b/mysql-test/t/help.test index 43e61136e05..dc5dc1cee5f 100644 --- a/mysql-test/t/help.test +++ b/mysql-test/t/help.test @@ -61,6 +61,12 @@ help '%function_7'; help '%category_2'; help 'impossible_function_1'; help 'impossible_category_1'; + +--echo # MDEV-9524 Cannot load from mysql.event when sql_mode is set to PAD_CHAR_TO_FULL_LENGTH +help 'impossible_function_1'; +SET sql_mode=PAD_CHAR_TO_FULL_LENGTH; +help 'impossible_function_1'; +SET sql_mode=DEFAULT; ############## set sql_mode=""; diff --git a/mysql-test/t/information_schema_stats.test b/mysql-test/t/information_schema_stats.test new file mode 100644 index 00000000000..38248063d68 --- /dev/null +++ b/mysql-test/t/information_schema_stats.test @@ -0,0 +1,44 @@ +# +# MDEV-8633: information_schema.index_statistics doesn't delete item when drop table indexes or drop table; +# +set global userstat=1; +create table just_a_test(id int,first_name varchar(10),last_name varchar(10),address varchar(100),phone bigint,email varchar(30), state varchar(30)); +insert into just_a_test values(1,'fa','la','china_a',11111111,'fa_la@163.com','California'), +(2,'fb','lb','china_b',22222222,'fb_lb@163.com','Arizona'), +(3,'fc','lc','china_c',33333333,'fc_lc@163.com','California'), +(4,'fd','ld','china_d',44444444,'fd_ld@163.com','Utah'), +(5,'fe','le','china_e',55555555,'fe_le@163.com','Arizona'); +alter table just_a_test add primary key (id); +alter table just_a_test add key IND_just_a_test_first_name_last_name(first_name,last_name); +alter table just_a_test add key IND_just_a_test_state(state); +select count(*) from just_a_test where first_name='fc' and last_name='lc'; +select count(*) from just_a_test where state = 'California'; +select * from information_schema.index_statistics where table_schema='test' and table_name='just_a_test'; +select * from information_schema.table_statistics where table_schema='test' and table_name='just_a_test'; +alter table just_a_test drop key IND_just_a_test_first_name_last_name; +select * from information_schema.index_statistics where table_schema='test' and table_name='just_a_test'; +select * from information_schema.table_statistics where table_schema='test' and table_name='just_a_test'; +alter table just_a_test drop column state; +select * from information_schema.index_statistics where table_schema='test' and table_name='just_a_test'; +select * from information_schema.table_statistics where table_schema='test' and table_name='just_a_test'; +drop table just_a_test; +select * from information_schema.index_statistics where table_schema='test' and table_name='just_a_test'; +select * from information_schema.table_statistics where table_schema='test' and table_name='just_a_test'; +# +# Test direct drop table +# +create table just_a_test(id int not null primary key,first_name varchar(10),last_name varchar(10),address varchar(100),phone bigint,email varchar(30), state varchar(30),key(first_name,last_name),key(state)); +insert into just_a_test values(1,'fa','la','china_a',11111111,'fa_la@163.com','California'), +(2,'fb','lb','china_b',22222222,'fb_lb@163.com','Arizona'), +(3,'fc','lc','china_c',33333333,'fc_lc@163.com','California'), +(4,'fd','ld','china_d',44444444,'fd_ld@163.com','Utah'), +(5,'fe','le','china_e',55555555,'fe_le@163.com','Arizona'); +select count(*) from just_a_test where first_name='fc' and last_name='lc'; +select count(*) from just_a_test where state = 'California'; +select count(*) from just_a_test where id between 2 and 4; +select * from information_schema.index_statistics where table_schema='test' and table_name='just_a_test'; +select * from information_schema.table_statistics where table_schema='test' and table_name='just_a_test'; +drop table just_a_test; +select * from information_schema.index_statistics where table_schema='test' and table_name='just_a_test'; +select * from information_schema.table_statistics where table_schema='test' and table_name='just_a_test'; +set global userstat=0; diff --git a/mysql-test/t/insert_innodb.test b/mysql-test/t/insert_innodb.test new file mode 100644 index 00000000000..68b6ca4e315 --- /dev/null +++ b/mysql-test/t/insert_innodb.test @@ -0,0 +1,64 @@ +--source include/have_innodb.inc + +# +# MDEV-8979 IGNORE does not ignore the error 1452 +# + +--echo # +--echo # BUG#22037930: INSERT IGNORE FAILS TO IGNORE +--echo # FOREIGN KEY CONSTRAINT + +--echo # Setup. +CREATE TABLE t1 (fld1 INT PRIMARY KEY) ENGINE=INNODB; +CREATE TABLE t2 (fld2 INT, FOREIGN KEY (fld2) REFERENCES t1 (fld1)) +ENGINE=INNODB; +INSERT INTO t1 VALUES(0); +INSERT INTO t2 VALUES(0); + +--echo # Without fix, an error is reported. +INSERT IGNORE INTO t2 VALUES(1); +UPDATE IGNORE t2 SET fld2=20 WHERE fld2=0; +UPDATE IGNORE t1 SET fld1=20 WHERE fld1=0; + +--echo # Test for multi update. +UPDATE IGNORE t1, t2 SET t2.fld2= t2.fld2 + 3; +UPDATE IGNORE t1, t2 SET t1.fld1= t1.fld1 + 3; + +--echo # Reports an error since IGNORE is not used. +--error ER_NO_REFERENCED_ROW_2 +INSERT INTO t2 VALUES(1); + +--error ER_NO_REFERENCED_ROW_2 +UPDATE t2 SET fld2=20 WHERE fld2=0; + +--error ER_ROW_IS_REFERENCED_2 +UPDATE t1 SET fld1=20 WHERE fld1=0; + +--error ER_NO_REFERENCED_ROW_2 +UPDATE t1, t2 SET t2.fld2= t2.fld2 + 3; + +--error ER_ROW_IS_REFERENCED_2 +UPDATE t1, t2 SET t1.fld1= t1.fld1 + 3; + +DROP TABLE t2, t1; + +--echo # +--echo # BUG#22037930: INSERT IGNORE FAILS TO IGNORE FOREIGN +--echo # KEY CONSTRAINT + +CREATE TABLE t1 (fld1 INT PRIMARY KEY) ENGINE= INNODB; + +CREATE TABLE t2 (fld1 VARCHAR(10), fld2 INT NOT NULL, +CONSTRAINT fk FOREIGN KEY (fld2) REFERENCES t1(fld1)) ENGINE= INNODB; + +--echo # Without patch, reports incorrect error. +--error ER_NO_REFERENCED_ROW_2 +INSERT INTO t2 VALUES('abc', 2) ON DUPLICATE KEY UPDATE fld1= 'def'; +--error ER_NO_REFERENCED_ROW_2 +REPLACE INTO t2 VALUES('abc', 2); + +--enable_warnings +INSERT IGNORE INTO t2 VALUES('abc', 2) ON DUPLICATE KEY UPDATE fld1= 'def'; +--disable_warnings + +DROP TABLE t2, t1; diff --git a/mysql-test/t/join_outer.test b/mysql-test/t/join_outer.test index 9ae65780086..a3a1278ef1e 100644 --- a/mysql-test/t/join_outer.test +++ b/mysql-test/t/join_outer.test @@ -1824,4 +1824,62 @@ explain select * from t1 left join t2 on t2.c is null; drop table t1,t2; +--echo # +--echo # MDEV-10006: optimizer doesn't convert outer join to inner on views with WHERE clause +--echo # + +CREATE TABLE t1(i1 int primary key, v1 int, key(v1)); +INSERT INTO t1 VALUES (1, 1); +INSERT INTO t1 VALUES (2, 2); +INSERT INTO t1 VALUES (3, 3); +INSERT INTO t1 VALUES (4, 4); +INSERT INTO t1 VALUES (5, 3); +INSERT INTO t1 VALUES (6, 6); +INSERT INTO t1 VALUES (7, 7); +INSERT INTO t1 VALUES (8, 8); +INSERT INTO t1 VALUES (9, 9); + +CREATE TABLE t2(i2 int primary key, v2 int, key(v2)); +INSERT INTO t2 VALUES (1, 1); +INSERT INTO t2 VALUES (2, 2); +INSERT INTO t2 VALUES (3, 3); +INSERT INTO t2 VALUES (4, 4); +INSERT INTO t2 VALUES (5, 3); +INSERT INTO t2 VALUES (6, 6); +INSERT INTO t2 VALUES (7, 7); +INSERT INTO t2 VALUES (8, 8); +INSERT INTO t2 VALUES (9, 9); + +CREATE TABLE t3(i3 int primary key, v3 int, key(v3)); +INSERT INTO t3 VALUES (2, 2); +INSERT INTO t3 VALUES (4, 4); +INSERT INTO t3 VALUES (6, 6); +INSERT INTO t3 VALUES (8, 8); + +--echo # This should have a join order of t3,t1,t2 (or t3,t2,t1, the idea is that t3 is the first one) +EXPLAIN EXTENDED +SELECT * FROM + (SELECT t1.i1 as i1, t1.v1 as v1, + t2.i2 as i2, t2.v2 as v2, + t3.i3 as i3, t3.v3 as v3 + FROM t1 JOIN t2 on t1.i1 = t2.i2 + LEFT JOIN t3 on t2.i2 = t3.i3 + ) as w1 +WHERE v3 = 4; + +--echo # This should have the same join order like the query above: +EXPLAIN EXTENDED +SELECT * FROM + (SELECT t1.i1 as i1, t1.v1 as v1, + t2.i2 as i2, t2.v2 as v2, + t3.i3 as i3, t3.v3 as v3 + FROM t1 JOIN t2 on t1.i1 = t2.i2 + LEFT JOIN t3 on t2.i2 = t3.i3 + WHERE t1.i1 = t2.i2 + AND 1 = 1 + ) as w2 +WHERE v3 = 4; + +drop table t1,t2,t3; + SET optimizer_switch=@save_optimizer_switch; diff --git a/mysql-test/t/kill_processlist-6619.test b/mysql-test/t/kill_processlist-6619.test index df5f410208b..d984924f9db 100644 --- a/mysql-test/t/kill_processlist-6619.test +++ b/mysql-test/t/kill_processlist-6619.test @@ -22,5 +22,12 @@ SET DEBUG_SYNC='now SIGNAL go'; --error ER_QUERY_INTERRUPTED reap; SET DEBUG_SYNC='reset'; + +# Wait until default connection has reset query string +let $wait_condition= + SELECT COUNT(*) = 1 from information_schema.processlist + WHERE info is NULL; +--source include/wait_condition.inc + --replace_column 1 # 3 # 6 # 7 # SHOW PROCESSLIST; diff --git a/mysql-test/t/locale.test b/mysql-test/t/locale.test index 93e347b722d..b1fbc40f0c8 100644 --- a/mysql-test/t/locale.test +++ b/mysql-test/t/locale.test @@ -55,6 +55,33 @@ SELECT DATE_FORMAT('2001-01-06', '%w %a %W'); SELECT DATE_FORMAT('2001-01-07', '%w %a %W'); --echo End of 5.4 tests +# +# MDEV-9928 LC_TIME_NAMES=de_AT; unusual name for february +# +SET NAMES utf8; +SET lc_time_names=de_AT; +SELECT monthname('2001-01-01'); +SELECT monthname('2001-02-01'); +SELECT monthname('2001-03-01'); + +--echo # +--echo # MDEV-10052 Illegal mix of collations with DAYNAME(date_field)<>varchar_field +--echo # +SET NAMES utf8; +CREATE TABLE t1 (c VARCHAR(8) CHARACTER SET latin1, d DATE); +INSERT INTO t1 VALUES ('test',now()); +SET lc_time_names=ru_RU; +--error ER_CANT_AGGREGATE_2COLLATIONS +SELECT c FROM t1 WHERE DAYNAME(d)<>c; +--error ER_CANT_AGGREGATE_2COLLATIONS +SELECT c FROM t1 WHERE MONTHNAME(d)<>c; +SET lc_time_names=en_US; +SELECT c FROM t1 WHERE DAYNAME(d)<>c; +SELECT c FROM t1 WHERE MONTHNAME(d)<>c; +SET NAMES latin1; +SELECT c FROM t1 WHERE DAYNAME(d)<>c; +SELECT c FROM t1 WHERE MONTHNAME(d)<>c; +DROP TABLE t1; --echo # --echo # Start of 5.6 tests diff --git a/mysql-test/t/lock.test b/mysql-test/t/lock.test index 23eb04d7826..2e164de9b93 100644 --- a/mysql-test/t/lock.test +++ b/mysql-test/t/lock.test @@ -442,11 +442,6 @@ alter table t1 add column j int; unlock tables; drop table t1; create temporary table t1 (i int); ---echo # ---echo # This is just for test coverage purposes, ---echo # when this is allowed, remove the --error. ---echo # ---error ER_CANT_REOPEN_TABLE lock tables t1 write, t1 as a read, t1 as b read; alter table t1 add column j int; unlock tables; diff --git a/mysql-test/t/mdev6830-master.opt b/mysql-test/t/mdev6830-master.opt deleted file mode 100644 index 2a8c27d4731..00000000000 --- a/mysql-test/t/mdev6830-master.opt +++ /dev/null @@ -1 +0,0 @@ ---debug diff --git a/mysql-test/t/mdev6830.test b/mysql-test/t/mdev6830.test index 24565d04fed..3898d5bbef6 100644 --- a/mysql-test/t/mdev6830.test +++ b/mysql-test/t/mdev6830.test @@ -1,10 +1,10 @@ - +# +# MDEV-6830 Server crashes in best_access_path after a sequence of SELECTs invollving a temptable view +# --source include/have_debug.inc ---disable_warnings -drop table if exists t1,t2,t3; -drop view if exists v2,v3; ---enable_warnings +set @@debug_dbug= 'd,opt'; + CREATE TABLE t1 (pk INT PRIMARY KEY) ENGINE=MyISAM; CREATE TABLE t2 ( diff --git a/mysql-test/t/multi_update.test b/mysql-test/t/multi_update.test index d54c2ab7c55..0297280340d 100644 --- a/mysql-test/t/multi_update.test +++ b/mysql-test/t/multi_update.test @@ -1083,4 +1083,28 @@ SELECT * FROM v1; DROP TABLE t1, t2; DROP VIEW v1; +--echo # +--echo # MDEV-5973: MySQL Bug#11757486:49539: NON-DESCRIPTIVE ERR (ERROR 0 +--echo # FROM STORAGE ENGINE) WITH MULTI-TABLE UPDATE +--echo # + +CREATE TABLE table_11757486 (field1 tinyint) ENGINE=INNODB; +INSERT INTO table_11757486 VALUES (0),(0); +SET SESSION SQL_MODE='STRICT_ALL_TABLES'; +UPDATE IGNORE (SELECT 128 as col1) x, table_11757486 SET field1=x.col1; +UPDATE IGNORE table_11757486 SET field1=128; + +--error ER_WARN_DATA_OUT_OF_RANGE +UPDATE (SELECT 128 as col1) x, table_11757486 SET field1=x.col1; +--error ER_WARN_DATA_OUT_OF_RANGE +UPDATE table_11757486 SET field1=128; + +SET SESSION SQL_MODE=''; +UPDATE IGNORE (SELECT 128 as col1) x, table_11757486 SET field1=x.col1; +UPDATE IGNORE table_11757486 SET field1=128; + +DROP TABLE table_11757486; + +SET SESSION SQL_MODE=default; + --echo end of 10.0 tests diff --git a/mysql-test/t/mysql57_virtual.test b/mysql-test/t/mysql57_virtual.test new file mode 100644 index 00000000000..3ebdd894b79 --- /dev/null +++ b/mysql-test/t/mysql57_virtual.test @@ -0,0 +1,29 @@ +let $MYSQLD_DATADIR= `select @@datadir`; + +--echo # +--echo # Test that we can use tables created in MySQL 5.7 +--echo # + +--copy_file std_data/mysql57_virtual.frm $MYSQLD_DATADIR/test/mysql57_virtual.frm +--copy_file std_data/mysql57_virtual.MYD $MYSQLD_DATADIR/test/mysql57_virtual.MYD +--copy_file std_data/mysql57_virtual.MYI $MYSQLD_DATADIR/test/mysql57_virtual.MYI + +SHOW CREATE TABLE mysql57_virtual; +insert into mysql57_virtual (a) values (1),(2); +select * from mysql57_virtual; + +# We can't do online changes, as the MariaDB storage is incompatible with MySQL +--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON +alter online table mysql57_virtual comment "I am now a MariaDB table"; + +alter table mysql57_virtual comment "I am now a MariaDB table"; +SHOW CREATE TABLE mysql57_virtual; +DROP TABLE mysql57_virtual; + +--echo # +--echo # Check MySQL 5.7 syntax +--echo # + +create table t1 (a int, b int generated always as (a+1) STORED, c int generated always as (a+2) VIRTUAL); +show create table t1; +drop table t1; diff --git a/mysql-test/t/mysqlcheck.test b/mysql-test/t/mysqlcheck.test index 88f0d034bf0..e479a2232f0 100644 --- a/mysql-test/t/mysqlcheck.test +++ b/mysql-test/t/mysqlcheck.test @@ -350,6 +350,11 @@ create table t1(a int); drop view v1; drop table t1; +create table `#mysql50#t1``1` (a int) engine=myisam; +--exec $MYSQL_CHECK --fix-table-names --databases test +show tables; +drop table `t1``1`; + --echo # --echo #MDEV-7384 [PATCH] add PERSISENT FOR ALL option to mysqlanalyze/mysqlcheck --echo # diff --git a/mysql-test/t/mysqld--help.test b/mysql-test/t/mysqld--help.test index 12fd968b212..e6499957cd2 100644 --- a/mysql-test/t/mysqld--help.test +++ b/mysql-test/t/mysqld--help.test @@ -22,7 +22,7 @@ perl; log-slow-queries pid-file slow-query-log-file log-basename datadir slave-load-tmpdir tmpdir socket thread-pool-size large-files-support lower-case-file-system system-time-zone - log-tc-size version.*/; + collation-server character-set-server log-tc-size version.*/; # Plugins which may or may not be there: @plugins=qw/innodb archive blackhole federated partition diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index 9cde1f93a4a..ccc68485bd6 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -174,7 +174,7 @@ drop database mysqldump_test_db; --echo # Check that we don't dump in UTF8 in compatible mode by default, --echo # but use the default compiled values, or the values given in --echo # --default-character-set=xxx. However, we should dump in UTF8 ---echo # if it is explicitely set. +--echo # if it is explicitly set. CREATE TABLE t1 (a CHAR(10)); INSERT INTO t1 VALUES (_latin1 'ÄÖÜß'); diff --git a/mysql-test/t/null.test b/mysql-test/t/null.test index a5db4442183..8f130cc9b8e 100644 --- a/mysql-test/t/null.test +++ b/mysql-test/t/null.test @@ -22,6 +22,7 @@ SELECT (NULL OR NULL) IS NULL; select NULL AND 0, 0 and NULL; select inet_ntoa(null),inet_aton(null),inet_aton("122.256"),inet_aton("122.226."),inet_aton(""); explain extended select inet_ntoa(null),inet_aton(null),inet_aton("122.256"),inet_aton("122.226."),inet_aton(""); +select not null is true, not null or true, not null and false, not null <=> null; create table t1 (x int); insert into t1 values (null); @@ -1007,6 +1008,17 @@ SELECT * FROM t1 WHERE NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(N DROP TABLE t1; +--echo # +--echo # MDEV-10236 Where expression with NOT function gives incorrect result +--echo # +CREATE TABLE t1 (c1 INT); +INSERT INTO t1 VALUES (1),(2),(3); +EXPLAIN EXTENDED +SELECT * FROM t1 WHERE ((c1 IS NOT NULL) >= (NOT TRUE)) IS NOT NULL; +SELECT * FROM t1 WHERE ((c1 IS NOT NULL) >= (NOT TRUE)) IS NOT NULL; +DROP TABLE t1; + + --echo # --echo # End of 10.1 tests --echo # diff --git a/mysql-test/t/openssl_1.test b/mysql-test/t/openssl_1.test index 8c81bdc9bbb..837206e2717 100644 --- a/mysql-test/t/openssl_1.test +++ b/mysql-test/t/openssl_1.test @@ -134,7 +134,7 @@ drop table t1; # verification of servers certificate by setting both ca certificate # and ca path to NULL # ---replace_result DHE-RSA-AES256-GCM-SHA384 DHE-RSA-AES256-SHA +--replace_result DHE-RSA-AES256-GCM-SHA384 DHE-RSA-AES256-SHA DHE-RSA-CHACHA20-POLY1305 DHE-RSA-AES256-SHA --exec $MYSQL --ssl --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem -e "SHOW STATUS LIKE 'ssl_Cipher'" 2>&1 --echo End of 5.0 tests @@ -259,7 +259,7 @@ select 'is still running; no cipher request crashed the server' as result from d GRANT SELECT ON test.* TO bug42158@localhost REQUIRE X509; FLUSH PRIVILEGES; connect(con1,localhost,bug42158,,,,,SSL); ---replace_result DHE-RSA-AES256-GCM-SHA384 DHE-RSA-AES256-SHA +--replace_result DHE-RSA-AES256-GCM-SHA384 DHE-RSA-AES256-SHA DHE-RSA-CHACHA20-POLY1305 DHE-RSA-AES256-SHA SHOW STATUS LIKE 'Ssl_cipher'; disconnect con1; connection default; @@ -268,5 +268,12 @@ DROP USER bug42158@localhost; set global sql_mode=default; --echo End of 5.1 tests +# +# MDEV-9605 mysqlbinlog does not accept ssl-ca option as expected. +# + +--error 1 +--exec $MYSQL_BINLOG --read-from-remote-server --ssl-ca --user=root --host=localhost nobinlog.111111 + # Wait till we reached the initial number of concurrent sessions --source include/wait_until_count_sessions.inc diff --git a/mysql-test/t/openssl_6975.test b/mysql-test/t/openssl_6975.test index 88fe17d0621..6e8e03a0a89 100644 --- a/mysql-test/t/openssl_6975.test +++ b/mysql-test/t/openssl_6975.test @@ -17,6 +17,7 @@ let $mysql=$MYSQL --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$ disable_abort_on_error; echo TLS1.2 ciphers: user is ok with any cipher; exec $mysql --ssl-cipher=AES128-SHA256; +--replace_result DHE-RSA-CHACHA20-POLY1305 DHE-RSA-AES256-GCM-SHA384 exec $mysql --ssl-cipher=TLSv1.2; echo TLS1.2 ciphers: user requires SSLv3 cipher RC4-SHA; exec $mysql --user ssl_sslv3 --ssl-cipher=AES128-SHA256; diff --git a/mysql-test/t/order_by.test b/mysql-test/t/order_by.test index bdd6f3b825f..13c8db5a481 100644 --- a/mysql-test/t/order_by.test +++ b/mysql-test/t/order_by.test @@ -1997,3 +1997,87 @@ EXPLAIN SELECT id1 FROM t2 WHERE id2=1 AND id3=1 ORDER BY date DESC LIMIT 0,4; drop table t1,t2; +--echo # +--echo # MDEV-8989: ORDER BY optimizer ignores equality propagation +--echo # +set @tmp_8989=@@optimizer_switch; +set optimizer_switch='orderby_uses_equalities=on'; +create table t0(a int); +insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); + +create table t1(a int); +insert into t1 select A.a + B.a* 10 + C.a * 100 from t0 A, t0 B, t0 C; + +create table t2 ( + pk int primary key, + a int, b int, + filler char(200), + key(a) +); +insert into t2 select a, 1000-a, 1000-a, repeat('abc-',50) from t1 where a<200 limit 200; + +create table t3 ( + pk int primary key, + a int, b int, + filler char(200), + key(a) +); +insert into t3 select a, 1000-a, 1000-a, repeat('abc-',50) from t1; +insert into t3 select a+1000, 1000+a, 1000+a, repeat('abc-',50) from t1; + +--echo # The optimizer produces an order of 't2,t3' for this join +--echo # +--echo # Case #1 (from the bug report): +--echo # Q1 can take advantage of t2.a to resolve ORDER BY limit w/o sorting +explain +select t2.pk,t2.a,t2.b,t3.pk,t3.a,t3.b +from t2, t3 where t2.a=t3.a order by t2.a limit 5; + +--echo # +--echo # This is Q2 which used to have "Using temporary; using filesort" but +--echo # has the same query plan as Q1: +--echo # +explain +select t2.pk,t2.a,t2.b,t3.pk,t3.a,t3.b +from t2, t3 where t2.a=t3.a order by t3.a limit 5; + +select t2.pk,t2.a,t2.b,t3.pk,t3.a,t3.b +from t2, t3 where t2.a=t3.a order by t2.a limit 5; + +select t2.pk,t2.a,t2.b,t3.pk,t3.a,t3.b +from t2, t3 where t2.a=t3.a order by t3.a limit 5; + + +--echo # +--echo # Case #2: here, only "Using temporary" is removed. "Using filesort" remains. +--echo # +explain +select t2.pk,t2.a,t2.b,t3.pk,t3.a,t3.b +from t2, t3 where t2.a=t3.a order by t2.a limit 25; + +explain +select t2.pk,t2.a,t2.b,t3.pk,t3.a,t3.b +from t2, t3 where t2.a=t3.a order by t3.a limit 25; + + +select t2.pk,t2.a,t2.b,t3.pk,t3.a,t3.b +from t2, t3 where t2.a=t3.a order by t2.a limit 25; + + +select t2.pk,t2.a,t2.b,t3.pk,t3.a,t3.b +from t2, t3 where t2.a=t3.a order by t3.a limit 25; + +--echo # +--echo # Case #3: single table access (the code that decides whether we need +--echo # "Using temporary" is not invoked) +--echo # +explain select * from t3 where b=a order by a limit 10; + +--echo # This must not use filesort. The query plan should be like the query above: +explain select * from t3 where b=a order by b limit 10; +drop table t0,t1,t2,t3; + +set @@optimizer_switch=@tmp_8989; + +set optimizer_switch='orderby_uses_equalities=on'; + diff --git a/mysql-test/t/parser.test b/mysql-test/t/parser.test index 0450e3c6fb0..90b0fb11648 100644 --- a/mysql-test/t/parser.test +++ b/mysql-test/t/parser.test @@ -759,6 +759,22 @@ CREATE TRIGGER trigger1 BEFORE INSERT ON t1 FOR EACH ROW SET default_storage_engine = NEW.INNODB; DROP TABLE t1; +# +# MDEV-8328 Evaluation of two "!" operators depends on space in beetween +# +--error ER_PARSE_ERROR +select 0==0; +select 1=!0, 1 = ! 0; +select !!0, ! ! 0; +select 2>!0, 2 > ! 0; +select 0<=!0, 0 <= !0; +select 1<'😎'; DROP TABLE t1; +--echo # +--echo # MDEV-10185: Assertion `tree1->keys[key_no] && tree2->keys[key_no]' failed in +--echo # sel_trees_can_be_ored(RANGE_OPT_PARAM*, SEL_TREE*, SEL_TREE*, key_map*) +--echo # +CREATE TABLE t1 (pk INT PRIMARY KEY); +INSERT INTO t1 VALUES (1),(2); +SELECT * FROM t1 WHERE pk != 1000 OR pk IN ( 1000, 0, 1, 100, 2 ) OR pk >= 5; +DROP TABLE t1; + --echo # --echo # End of 10.1 tests --echo # diff --git a/mysql-test/t/reopen_temp_table.test b/mysql-test/t/reopen_temp_table.test new file mode 100644 index 00000000000..2aa6caa1655 --- /dev/null +++ b/mysql-test/t/reopen_temp_table.test @@ -0,0 +1,184 @@ +--source include/have_innodb.inc + +--echo # +--echo # MDEV-5535: Cannot reopen temporary table +--echo # + +--disable_warnings +DROP DATABASE IF EXISTS temp_db; +--enable_warnings + +CREATE DATABASE temp_db; +USE temp_db; + +--echo # +--echo # Reopen temporary table +--echo # + +CREATE TEMPORARY TABLE t1(i int)ENGINE=INNODB; +INSERT INTO t1 VALUES(1), (2); +SELECT * FROM t1 a, t1 b; +DROP TABLE t1; + +--echo # +--echo # CREATE & Stored routines +--echo # + +DELIMITER |; +CREATE FUNCTION f1() RETURNS INT +BEGIN + DROP TEMPORARY TABLE t1; + RETURN 1; +END| +DELIMITER ;| +--error ER_BAD_TABLE_ERROR +CREATE TEMPORARY TABLE t1 AS SELECT f1(); +DROP FUNCTION f1; + +DELIMITER |; +CREATE FUNCTION f2() RETURNS INT +BEGIN + CREATE TEMPORARY TABLE t2(i INT); + INSERT INTO t2 VALUES(1), (2); + RETURN 1; +END| +DELIMITER ;| +--error ER_TABLE_EXISTS_ERROR +CREATE TEMPORARY TABLE t2 AS SELECT f2(); +SELECT * FROM t2; +DROP TABLE t2; +DROP FUNCTION f2; + +CREATE TEMPORARY TABLE t3 AS SELECT 1 AS a; +DELIMITER |; +CREATE PROCEDURE p1() +BEGIN + DROP TEMPORARY TABLE t3; +end| +CREATE FUNCTION f3() RETURNS INT +BEGIN + CALL p1(); + RETURN 1; +END| +DELIMITER ;| +PREPARE STMT FROM "SELECT f3() AS my_Column, a FROM t3"; +--error ER_CANT_REOPEN_TABLE +EXECUTE STMT; +DROP TABLE t3; +DROP FUNCTION f3; +DROP PROCEDURE p1; + +CREATE TEMPORARY TABLE t4 (i INT); +INSERT INTO t4 VALUES(1), (2); +DELIMITER |; +CREATE FUNCTION f4() RETURNS INT +BEGIN + DROP TEMPORARY TABLE t4; + RETURN 1; +END| +DELIMITER ;| +--error ER_CANT_REOPEN_TABLE +SELECT f4() FROM t4; +SELECT * FROM t4; +DROP TABLE t4; +DROP FUNCTION f4; + +CREATE TEMPORARY TABLE t5 AS SELECT 1 AS a; +DELIMITER |; +CREATE PROCEDURE p2() +BEGIN + DROP TEMPORARY TABLE t5; +END| +CREATE FUNCTION f5() RETURNS INT +BEGIN + CALL p2(); + RETURN 1; +END| +DELIMITER ;| +--error ER_CANT_REOPEN_TABLE +SELECT f5() AS my_column, a FROM t5; +DROP TABLE t5; +DROP FUNCTION f5; +DROP PROCEDURE p2; + +--echo # +--echo # CTAS +--echo # + +CREATE TABLE t1(i INT); +INSERT INTO t1 VALUES(1), (2); +CREATE TEMPORARY TABLE t1 + SELECT temp_1.i a, temp_2.i b FROM t1 AS temp_1, t1 AS temp_2; +SELECT * FROM t1; +DROP TABLE t1; +SELECT * FROM t1; +DROP TABLE t1; + +--echo # +--echo # HANDLER +--echo # + +CREATE TABLE t1 (a INT, KEY a(a)); +INSERT INTO t1 (a) VALUES (1), (2), (3), (4), (5); +CREATE TABLE t2 (a INT, KEY a (a)) SELECT * FROM t1; +CREATE TEMPORARY TABLE t3 (a INT, KEY a (a)) SELECT * FROM t2; +HANDLER t3 OPEN; +SELECT * FROM t1; +LOCK TABLE t1 READ; +--error ER_LOCK_OR_ACTIVE_TRANSACTION +HANDLER t3 OPEN; +UNLOCK TABLES; +--error ER_NONUNIQ_TABLE +HANDLER t3 OPEN; +HANDLER t3 READ NEXT; +HANDLER t3 OPEN AS t3_1; +HANDLER t3_1 READ NEXT; +HANDLER t3_1 READ NEXT; +HANDLER t3 CLOSE; +HANDLER t3_1 CLOSE; +DROP TEMPORARY TABLE t3; +DROP TABLE t1, t2; + +--echo # +--echo # INSERT-SELECT +--echo # + +CREATE TEMPORARY TABLE t4 (a INT) ENGINE=MYISAM; +INSERT INTO t4 VALUES(1), (2); +INSERT INTO t4 SELECT * FROM t4; +SELECT COUNT(*) FROM t4; +DROP TABLE t4; + +CREATE TABLE t5 (a INT) ENGINE=INNODB; +CREATE TEMPORARY TABLE t6 (a INT) ENGINE=INNODB; +INSERT INTO t5 VALUES(1), (2); +INSERT INTO t6 SELECT * FROM t5; +INSERT INTO t6 SELECT * FROM t6; +INSERT INTO t5 SELECT * FROM t6; +SELECT COUNT(*)=6 FROM t5; +SELECT COUNT(*)=4 FROM t6; +DROP TABLE t5, t6; + +--echo # +--echo # MDEV-10216: Assertion `strcmp(share->unique_file_name,filename) || +--echo # share->last_version' failed in myisam/mi_open.c:67: test_if_reopen +--echo # +CREATE TEMPORARY TABLE t7 (i INT) ENGINE=MYISAM; +INSERT INTO t7 VALUES(1); +ALTER TABLE t7 RENAME TO t; +SELECT * FROM t a, t b; +DROP TABLE t; + +CREATE TEMPORARY TABLE t7 (i INT) ENGINE=ARIA; +INSERT INTO t7 VALUES(1); +ALTER TABLE t7 RENAME TO t; +SELECT * FROM t a, t b; +DROP TABLE t; + +CREATE TEMPORARY TABLE t8 (i INT) ENGINE=ARIA; +ALTER TABLE t8 rename to t; +SELECT (SELECT 1 FROM t a1, t a2 ) AS f1, ( SELECT 2 FROM t a3 ) AS f2 FROM DUAL; +DROP TABLE t; + +--echo # Cleanup +DROP DATABASE temp_db; diff --git a/mysql-test/t/select_debug.test b/mysql-test/t/select_debug.test index 4b77f9fd047..49415400db3 100644 --- a/mysql-test/t/select_debug.test +++ b/mysql-test/t/select_debug.test @@ -10,7 +10,7 @@ create table t2 (a int); insert into t2 values (2), (3); set session join_cache_level=3; -set @@debug_dbug= 'd:t:O,/tmp/trace.out'; +set @@debug_dbug= 'd,opt'; explain select t1.b from t1,t2 where t1.b=t2.a; select t1.b from t1,t2 where t1.b=t2.a; diff --git a/mysql-test/t/set_password_plugin-9835.test b/mysql-test/t/set_password_plugin-9835.test new file mode 100644 index 00000000000..6afccd74f9d --- /dev/null +++ b/mysql-test/t/set_password_plugin-9835.test @@ -0,0 +1,131 @@ +# +# MDEV-9835 Valid password is not working after server restart. +# +# Various combinations of SET PASSWORD and not-empty mysql.user.plugin field +# +--source include/not_embedded.inc + +--enable_connect_log + +set global secure_auth=0; + +# The hash (old and new) is for 'test' +create user natauth@localhost identified via 'mysql_native_password' using '*94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29'; + +create user newpass@localhost identified by password '*94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29'; + +create user newpassnat@localhost identified via 'mysql_native_password'; +set password for newpassnat@localhost = '*94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29'; + +create user oldauth@localhost identified with 'mysql_old_password' using '378b243e220ca493'; + +create user oldpass@localhost identified by password '378b243e220ca493'; + +create user oldpassold@localhost identified with 'mysql_old_password'; +set password for oldpassold@localhost = '378b243e220ca493'; + +--sorted_result +select user, host, password, plugin, authentication_string from mysql.user where user != 'root'; + +--connect(con,localhost,natauth,test,) +select current_user(); +--disconnect con +--connect(con,localhost,newpass,test,) +select current_user(); +--disconnect con +--connect(con,localhost,newpassnat,test,) +select current_user(); +--disconnect con +--connect(con,localhost,oldauth,test,) +select current_user(); +--disconnect con +--connect(con,localhost,oldpass,test,) +select current_user(); +--disconnect con +--connect(con,localhost,oldpassold,test,) +select current_user(); +--disconnect con + +--connection default + +flush privileges; + +--connect(con,localhost,natauth,test,) +select current_user(); +--disconnect con +--connect(con,localhost,newpass,test,) +select current_user(); +--disconnect con +--connect(con,localhost,newpassnat,test,) +select current_user(); +--disconnect con +--connect(con,localhost,oldauth,test,) +select current_user(); +--disconnect con +--connect(con,localhost,oldpass,test,) +select current_user(); +--disconnect con +--connect(con,localhost,oldpassold,test,) +select current_user(); +--disconnect con + +--connection default + +# changing to the NEW password hash +set password for natauth@localhost = PASSWORD('test2'); +set password for newpass@localhost = PASSWORD('test2'); +set password for newpassnat@localhost = PASSWORD('test2'); +set password for oldauth@localhost = PASSWORD('test2'); +set password for oldpass@localhost = PASSWORD('test2'); +set password for oldpassold@localhost = PASSWORD('test2'); + +--sorted_result +select user, host, password, plugin, authentication_string from mysql.user where user != 'root'; + +--connect(con,localhost,natauth,test2,) +select current_user(); +--disconnect con +--connect(con,localhost,newpass,test2,) +select current_user(); +--disconnect con +--connect(con,localhost,newpassnat,test2,) +select current_user(); +--disconnect con +--connect(con,localhost,oldauth,test2,) +select current_user(); +--disconnect con +--connect(con,localhost,oldpass,test2,) +select current_user(); +--disconnect con +--connect(con,localhost,oldpassold,test2,) +select current_user(); +--disconnect con + +--connection default + +flush privileges; + +--connect(con,localhost,natauth,test2,) +select current_user(); +--disconnect con +--connect(con,localhost,newpass,test2,) +select current_user(); +--disconnect con +--connect(con,localhost,newpassnat,test2,) +select current_user(); +--disconnect con +--connect(con,localhost,oldauth,test2,) +select current_user(); +--disconnect con +--connect(con,localhost,oldpass,test2,) +select current_user(); +--disconnect con +--connect(con,localhost,oldpassold,test2,) +select current_user(); +--disconnect con + +--connection default +drop user natauth@localhost, newpass@localhost, newpassnat@localhost; +drop user oldauth@localhost, oldpass@localhost, oldpassold@localhost; +set global secure_auth=default; + diff --git a/mysql-test/t/set_statement.test b/mysql-test/t/set_statement.test index 5d6206335fb..a91c53c8dee 100644 --- a/mysql-test/t/set_statement.test +++ b/mysql-test/t/set_statement.test @@ -1003,34 +1003,34 @@ truncate table mysql.slow_log; set slow_query_log= 1; set global log_output='TABLE'; -select sql_text from mysql.slow_log; +select sql_text from mysql.slow_log where sql_text not like 'set @@long_query_time%'; set @@long_query_time=0.01; --echo #should be written select sleep(0.1); set @@long_query_time=@save_long_query_time; -select sql_text from mysql.slow_log; +select sql_text from mysql.slow_log where sql_text not like 'set @@long_query_time%'; --echo #--- --echo #should be written set statement long_query_time=0.01 for select sleep(0.1); -select sql_text from mysql.slow_log; +select sql_text from mysql.slow_log where sql_text not like 'set @@long_query_time%'; --echo #--- set @@long_query_time=0.01; --echo #should NOT be written set statement slow_query_log=0 for select sleep(0.1); set @@long_query_time=@save_long_query_time; -select sql_text from mysql.slow_log; +select sql_text from mysql.slow_log where sql_text not like 'set @@long_query_time%'; --echo #--- --echo #should NOT be written set statement long_query_time=0.01,log_slow_filter='full_scan' for select sleep(0.1); -select sql_text from mysql.slow_log; +select sql_text from mysql.slow_log where sql_text not like 'set @@long_query_time%'; --echo #--- --echo #should NOT be written set statement long_query_time=0.01,log_slow_rate_limit=9999 for select sleep(0.1); -select sql_text from mysql.slow_log; +select sql_text from mysql.slow_log where sql_text not like 'set @@long_query_time%'; --echo #--- --echo #should NOT be written set statement long_query_time=0.01,min_examined_row_limit=50 for select sleep(0.1); -select sql_text from mysql.slow_log; +select sql_text from mysql.slow_log where sql_text not like 'set @@long_query_time%'; --echo #--- # # log_slow_verbosity is impossible to check because results are not written diff --git a/mysql-test/t/sp-error.test b/mysql-test/t/sp-error.test index b1d4f67f357..e30fc6e30d4 100644 --- a/mysql-test/t/sp-error.test +++ b/mysql-test/t/sp-error.test @@ -1794,8 +1794,8 @@ CREATE PROCEDURE bug20953() CREATE VIEW v AS SELECT 1 INTO OUTFILE "file"; --error ER_PARSE_ERROR CREATE PROCEDURE bug20953() CREATE VIEW v AS SELECT i FROM t1 PROCEDURE ANALYSE(); ---error ER_VIEW_SELECT_DERIVED -CREATE PROCEDURE bug20953() CREATE VIEW v AS SELECT 1 FROM (SELECT 1) AS d1; +--error ER_PARSE_ERROR +CREATE PROCEDURE bug20953() CREATE VIEW v AS SELECT 1 FROM (SELECT 1) AS d1 into @w; --error ER_VIEW_SELECT_VARIABLE CREATE PROCEDURE bug20953(i INT) CREATE VIEW v AS SELECT i; delimiter |; @@ -2231,7 +2231,7 @@ begin return 1; end| delimiter ;| ---error ER_CANT_REOPEN_TABLE +--error ER_BAD_TABLE_ERROR create temporary table t1 as select f1(); delimiter |; @@ -2241,7 +2241,7 @@ begin return 1; end| delimiter ;| ---error ER_CANT_REOPEN_TABLE +--error ER_BAD_TABLE_ERROR create temporary table t1 as select f2(); drop function f1; @@ -2259,7 +2259,7 @@ begin return 1; end| delimiter ;| ---error ER_CANT_REOPEN_TABLE +--error ER_BAD_TABLE_ERROR create temporary table t1 as select f2(); drop function f1; diff --git a/mysql-test/t/sp-threads.test b/mysql-test/t/sp-threads.test index e1012e2b72d..7a6d1258331 100644 --- a/mysql-test/t/sp-threads.test +++ b/mysql-test/t/sp-threads.test @@ -77,12 +77,15 @@ call bug9486(); connection con2root; lock tables t2 write; connection con1root; +let $con1root_id=`SELECT CONNECTION_ID()`; send call bug9486(); connection con2root; ---sleep 2 # There should be call statement in locked state. ---replace_column 1 # 3 localhost 6 # -show processlist; +let $wait_condition=SELECT COUNT(*)=1 FROM information_schema.processlist WHERE + id=$con1root_id AND state='Waiting for table metadata lock'; +--source include/wait_condition.inc +--replace_result $con1root_id con1root_id +eval SELECT state,info FROM information_schema.processlist WHERE id=$con1root_id; unlock tables; connection con1root; reap; diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index 9e6b919ea19..c80e1eaaa3e 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -1368,11 +1368,6 @@ select f10()| create table t4 as select 1 as id| select f10()| -# Practical cases which we don't handle well (yet) -# -# Function which does not work because of well-known and documented -# limitation of MySQL. We can't use the several instances of the -# same temporary table in statement. create function f11() returns int begin drop temporary table if exists t3; @@ -1380,9 +1375,7 @@ begin insert into t3 values (1), (2), (3); return (select count(*) from t3 as a, t3 as b); end| ---error ER_CANT_REOPEN_TABLE select f11()| ---error ER_CANT_REOPEN_TABLE select f11() from t1| # Test that using a single table instance at a time works create function f12_1() returns int @@ -1397,6 +1390,7 @@ create function f12_2() returns int drop temporary table t3| select f12_1()| +drop temporary table t3| select f12_1() from t1 limit 1| # Cleanup @@ -8278,7 +8272,6 @@ delimiter |; CREATE PROCEDURE p1 () BEGIN SELECT f1 FROM t3 AS A WHERE A.f1 IN ( SELECT f1 FROM t3 ) ; END| delimiter ;| ---error ER_CANT_REOPEN_TABLE CALL p1; CREATE VIEW t3 AS SELECT f1 FROM t2 A WHERE A.f1 IN ( SELECT f1 FROM t2 ); DROP TABLE t3; diff --git a/mysql-test/t/ssl.test b/mysql-test/t/ssl.test index 0d14ad82692..88766e7cf39 100644 --- a/mysql-test/t/ssl.test +++ b/mysql-test/t/ssl.test @@ -11,7 +11,7 @@ connect (ssl_con,localhost,root,,,,,SSL); # Check ssl turned on ---replace_result DHE-RSA-AES256-GCM-SHA384 DHE-RSA-AES256-SHA +--replace_result DHE-RSA-AES256-GCM-SHA384 DHE-RSA-AES256-SHA DHE-RSA-CHACHA20-POLY1305 DHE-RSA-AES256-SHA SHOW STATUS LIKE 'Ssl_cipher'; # Check ssl expiration @@ -22,7 +22,7 @@ SHOW STATUS LIKE 'Ssl_server_not_after'; -- source include/common-tests.inc # Check ssl turned on ---replace_result DHE-RSA-AES256-GCM-SHA384 DHE-RSA-AES256-SHA +--replace_result DHE-RSA-AES256-GCM-SHA384 DHE-RSA-AES256-SHA DHE-RSA-CHACHA20-POLY1305 DHE-RSA-AES256-SHA SHOW STATUS LIKE 'Ssl_cipher'; # @@ -34,5 +34,10 @@ select 'still connected?'; connection default; disconnect ssl_con; +create user mysqltest_1@localhost; +grant usage on mysqltest.* to mysqltest_1@localhost require cipher "EDH-RSA-DES-CBC3-SHA"; +--exec $MYSQL -umysqltest_1 --ssl-cipher=EDH-RSA-DES-CBC3-SHA -e "show status like 'ssl_cipher'" 2>&1 +drop user mysqltest_1@localhost; + # Wait till all disconnects are completed --source include/wait_until_count_sessions.inc diff --git a/mysql-test/t/ssl_ca.test b/mysql-test/t/ssl_ca.test new file mode 100644 index 00000000000..8e81f44e61c --- /dev/null +++ b/mysql-test/t/ssl_ca.test @@ -0,0 +1,36 @@ +--source include/have_ssl_communication.inc +--source include/not_embedded.inc + +--echo # +--echo # Bug#21920657: SSL-CA FAILS SILENTLY IF THE PATH CANNOT BE FOUND +--echo # + +--echo # try to connect with wrong '--ssl-ca' path : should fail +--error 1 +--exec $MYSQL --ssl-ca=$MYSQL_TEST_DIR/std_data/wrong-cacert.pem --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem test -e "SHOW STATUS LIKE 'Ssl_cipher'" 2>&1 + +--echo # try to connect with correct '--ssl-ca' path : should connect +--replace_result DHE-RSA-AES256-GCM-SHA384 DHE-RSA-AES256-SHA +--exec $MYSQL --ssl-ca=$MYSQL_TEST_DIR/std_data/cacert.pem --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem test -e "SHOW STATUS LIKE 'Ssl_cipher'" + +--echo # +--echo # Bug#21920678: SSL-CA DOES NOT ACCEPT ~USER TILDE HOME DIRECTORY +--echo # PATH SUBSTITUTION +--echo # + +--let $mysql_test_dir_path= `SELECT IF(LENGTH('$HOME'), REPLACE('=$MYSQL_TEST_DIR', '=$HOME', '=~'), '=$MYSQL_TEST_DIR')` + +--echo # try to connect with '--ssl-ca' option using tilde home directoy +--echo # path substitution : should connect +--replace_result DHE-RSA-AES256-GCM-SHA384 DHE-RSA-AES256-SHA +--exec $MYSQL --ssl-ca$mysql_test_dir_path/std_data/cacert.pem --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem test -e "SHOW STATUS LIKE 'Ssl_cipher'" + +--echo # try to connect with '--ssl-key' option using tilde home directoy +--echo # path substitution : should connect +--replace_result DHE-RSA-AES256-GCM-SHA384 DHE-RSA-AES256-SHA +--exec $MYSQL --ssl-ca=$MYSQL_TEST_DIR/std_data/cacert.pem --ssl-key$mysql_test_dir_path/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem test -e "SHOW STATUS LIKE 'Ssl_cipher'" + +--echo # try to connect with '--ssl-cert' option using tilde home directoy +--echo # path substitution : should connect +--replace_result DHE-RSA-AES256-GCM-SHA384 DHE-RSA-AES256-SHA +--exec $MYSQL --ssl-ca=$MYSQL_TEST_DIR/std_data/cacert.pem --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert$mysql_test_dir_path/std_data/client-cert.pem test -e "SHOW STATUS LIKE 'Ssl_cipher'" diff --git a/mysql-test/t/ssl_compress.test b/mysql-test/t/ssl_compress.test index 5e45e3824a2..28f3453c23e 100644 --- a/mysql-test/t/ssl_compress.test +++ b/mysql-test/t/ssl_compress.test @@ -11,7 +11,7 @@ connect (ssl_compress_con,localhost,root,,,,,SSL COMPRESS); # Check ssl turned on ---replace_result DHE-RSA-AES256-GCM-SHA384 DHE-RSA-AES256-SHA +--replace_result DHE-RSA-AES256-GCM-SHA384 DHE-RSA-AES256-SHA DHE-RSA-CHACHA20-POLY1305 DHE-RSA-AES256-SHA SHOW STATUS LIKE 'Ssl_cipher'; # Check compression turned on @@ -21,7 +21,7 @@ SHOW STATUS LIKE 'Compression'; -- source include/common-tests.inc # Check ssl turned on ---replace_result DHE-RSA-AES256-GCM-SHA384 DHE-RSA-AES256-SHA +--replace_result DHE-RSA-AES256-GCM-SHA384 DHE-RSA-AES256-SHA DHE-RSA-CHACHA20-POLY1305 DHE-RSA-AES256-SHA SHOW STATUS LIKE 'Ssl_cipher'; # Check compression turned on diff --git a/mysql-test/t/ssl_timeout-9836.opt b/mysql-test/t/ssl_timeout-9836.opt new file mode 100644 index 00000000000..7a2696875b8 --- /dev/null +++ b/mysql-test/t/ssl_timeout-9836.opt @@ -0,0 +1 @@ +--loose-thread-handling=pool-of-threads diff --git a/mysql-test/t/ssl_timeout-9836.test b/mysql-test/t/ssl_timeout-9836.test new file mode 100644 index 00000000000..5b57917f3b8 --- /dev/null +++ b/mysql-test/t/ssl_timeout-9836.test @@ -0,0 +1,11 @@ +# +# MDEV-9836 Connection lost when using SSL +# +-- source include/have_ssl_communication.inc +connect(con1,localhost,root,,,,,SSL); +SET @@net_read_timeout=1; +SELECT 1; +# MDEV-9836 - YASSL bug - SSL connection lost if it has been idle, for longer than net_read_timeout +-- sleep 2 +SELECT 1; +disconnect con1; diff --git a/mysql-test/t/ssl_timeout.test b/mysql-test/t/ssl_timeout.test index 0d96b3f6601..806b928aca0 100644 --- a/mysql-test/t/ssl_timeout.test +++ b/mysql-test/t/ssl_timeout.test @@ -7,7 +7,7 @@ connect (ssl_con,localhost,root,,,,,SSL read_timeout=5); --echo # Check ssl turned on ---replace_result DHE-RSA-AES256-GCM-SHA384 DHE-RSA-AES256-SHA +--replace_result DHE-RSA-AES256-GCM-SHA384 DHE-RSA-AES256-SHA DHE-RSA-CHACHA20-POLY1305 DHE-RSA-AES256-SHA SHOW STATUS LIKE 'Ssl_cipher'; # --error CR_SERVER_LOST diff --git a/mysql-test/t/stat_tables_innodb_debug.test b/mysql-test/t/stat_tables_innodb_debug.test new file mode 100644 index 00000000000..f3652fc2312 --- /dev/null +++ b/mysql-test/t/stat_tables_innodb_debug.test @@ -0,0 +1,36 @@ +--source include/have_innodb.inc +--source include/have_sequence.inc +--source include/have_stat_tables.inc +--source include/have_debug_sync.inc +--source include/not_embedded.inc + +--echo # +--echo # MDEV-7901: re-implement analyze table for low impact +--echo # + +create table t1 (a int, b int, c int, key IDX1(a), key IDX2(a,b)) engine=innodb; +insert into t1 select seq/10, seq/2, seq from seq_0_to_9; + + +SET DEBUG_SYNC='statistics_collection_start1 SIGNAL analyzing WAIT_FOR written'; + +send analyze table t1 persistent for all; +connect (con1, localhost, root,,); +--connection con1 + +SET DEBUG_SYNC= 'now WAIT_FOR analyzing'; + +select count(*) from t1; +# insert will work even with MyISAM because it allow to append file +insert into t1 values (333,333,333); +# but update now hang for MyISAM bacause can't get lock (InnoDB/XtraDB works) +update t1 set a=1; + +SET DEBUG_SYNC= 'now SIGNAL written'; + +--connection default +--reap +select count(*) from t1; + +set debug_sync='RESET'; +drop table t1; diff --git a/mysql-test/t/stat_tables_myisam_debug.test b/mysql-test/t/stat_tables_myisam_debug.test new file mode 100644 index 00000000000..e8ef44325b9 --- /dev/null +++ b/mysql-test/t/stat_tables_myisam_debug.test @@ -0,0 +1,33 @@ +--source include/have_sequence.inc +--source include/have_stat_tables.inc +--source include/have_debug_sync.inc +--source include/not_embedded.inc + +--echo # +--echo # MDEV-7901: re-implement analyze table for low impact +--echo # + +create table t1 (a int, b int, c int, key IDX1(a), key IDX2(a,b)) engine=myisam; +insert into t1 select seq/10, seq/2, seq from seq_0_to_9; + + +SET DEBUG_SYNC='statistics_collection_start1 SIGNAL analyzing WAIT_FOR written'; + +send analyze table t1 persistent for all; +connect (con1, localhost, root,,); +--connection con1 + +SET DEBUG_SYNC= 'now WAIT_FOR analyzing'; + +select count(*) from t1; +# insert will work even with MyISAM because it allow to append file +insert into t1 values (333,333,333); + +SET DEBUG_SYNC= 'now SIGNAL written'; + +--connection default +--reap +select count(*) from t1; + +set debug_sync='RESET'; +drop table t1; diff --git a/mysql-test/t/statistics.test b/mysql-test/t/statistics.test index 805c169b2a4..d8b56b9c0a3 100644 --- a/mysql-test/t/statistics.test +++ b/mysql-test/t/statistics.test @@ -741,3 +741,21 @@ analyze table t1; drop table t1; set use_stat_tables=@save_use_stat_tables; + +--echo # +--echo # Start of 10.2 tests +--echo # + +--echo # +--echo # MDEV-10134 Add full support for DEFAULT +--echo # + +CREATE TABLE t1 (a BLOB, b TEXT DEFAULT DECODE_HISTOGRAM('SINGLE_PREC_HB',a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES (0x0000000000000000000000000101010101010101010202020303030304040404050505050606070707080809090A0A0B0C0D0D0E0E0F10111213131415161718191B1C1E202224292A2E33373B4850575F6A76818C9AA7B9C4CFDADFE5EBF0F4F8FAFCFF); +SELECT b FROM t1; +DROP TABLE t1; + +--echo # +--echo # End of 10.2 tests +--echo # diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index c19613da493..67af426f5fe 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -6000,3 +6000,14 @@ SELECT ( SELECT MIN(v2.f2) FROM t1 ) AS sq FROM v2 GROUP BY sq; drop view v2; drop table t1,t2; + +--echo # +--echo # MDEV-9487: Server crashes in Time_and_counter_tracker::incr_loops +--echo # with UNION in ALL subquery +--echo # +SET NAMES utf8; +CREATE TABLE t1 (f VARCHAR(8)) ENGINE=MyISAM; +INSERT INTO t1 VALUES ('foo'); +SELECT f FROM t1 WHERE f > ALL ( SELECT 'bar' UNION SELECT 'baz' ); +drop table t1; +SET NAMES default; diff --git a/mysql-test/t/temp_table.test b/mysql-test/t/temp_table.test index 987fbf7e848..fc1b8fad514 100644 --- a/mysql-test/t/temp_table.test +++ b/mysql-test/t/temp_table.test @@ -1,5 +1,6 @@ # mysqltest should be fixed --- source include/not_embedded.inc +--source include/not_embedded.inc +--source include/have_innodb.inc # # Test of temporary tables @@ -338,3 +339,246 @@ drop table t2; drop temporary table t3; show status like 'com_create%table'; show status like 'com_drop%table'; + +--echo # +--echo # Some more generic temporary table tests +--echo # added during MDEV-5535. +--echo # + +--disable_warnings +DROP DATABASE IF EXISTS temp_db; +--enable_warnings + +CREATE DATABASE temp_db; +USE temp_db; + +--echo # +--echo # SHOW TABLES do not list temporary tables. +--echo # + +CREATE TEMPORARY TABLE temp_t1(i INT) ENGINE=INNODB; +INSERT INTO temp_t1 VALUES(1); +SELECT * FROM temp_t1; +SHOW TABLES; +DROP TABLE temp_t1; + +--echo # +--echo # Create and drop a temporary table. +--echo # + +CREATE TEMPORARY TABLE temp_t1(i INT) ENGINE=INNODB; +INSERT INTO temp_t1 VALUES(1); +SELECT * FROM temp_t1; +DROP TABLE temp_t1; +--error ER_NO_SUCH_TABLE +SELECT * FROM temp_t1; + +--echo # +--echo # Create a temporary table and base table with same name and DROP TABLE. +--echo # + +CREATE TABLE t1(c1 VARCHAR(20)) ENGINE=INNODB; +INSERT INTO t1 VALUES("BASE TABLE"); +# Temporary table shadows the base table with the same name. +CREATE TEMPORARY TABLE t1(c1 VARCHAR(20)) ENGINE=INNODB; +INSERT INTO t1 VALUES("TEMPORARY TABLE"); +SELECT * FROM t1; +# Only temporary table should get dropped. +DROP TABLE t1; +SELECT * FROM t1; +DROP TABLE t1; +--error ER_NO_SUCH_TABLE +SELECT * FROM t1; + +--echo # +--echo # Create a temporary table and base table with same name and DROP TEMPORARY +--echo # TABLE. +--echo # + +CREATE TABLE t1(c1 VARCHAR(20)) ENGINE=INNODB; +INSERT INTO t1 VALUES("BASE TABLE"); +# Temporary table shadows the base table with the same name. +CREATE TEMPORARY TABLE t1(c1 VARCHAR(20)) ENGINE=INNODB; +INSERT INTO t1 VALUES("TEMPORARY TABLE"); +SELECT * FROM t1; +# Only temporary table should get dropped. +DROP TEMPORARY TABLE t1; +SELECT * FROM t1; +--error ER_BAD_TABLE_ERROR +DROP TEMPORARY TABLE t1; +SELECT * FROM t1; +DROP TABLE t1; + +--echo # +--echo # Create a temporary table and drop its parent database. +--echo # + +USE temp_db; +CREATE TEMPORARY TABLE temp_t1(i INT) ENGINE=INNODB; +INSERT INTO temp_t1 VALUES (1); +# Drop database +DROP DATABASE temp_db; +CREATE DATABASE temp_db; +USE temp_db; +# Temporary tables are not physically tied to schemas +DROP TEMPORARY TABLE temp_t1; + +--echo # +--echo # Similar to above, but this time with a base table with same name. +--echo # + +USE temp_db; +CREATE TABLE t1(i INT)ENGINE=INNODB; +CREATE TEMPORARY TABLE t1(i INT) ENGINE=INNODB; +INSERT INTO t1 VALUES (1); +# Drop database +DROP DATABASE temp_db; +CREATE DATABASE temp_db; +USE temp_db; +# Temporary tables are not physically tied to schemas +DROP TEMPORARY TABLE t1; +--error ER_BAD_TABLE_ERROR +DROP TABLE t1; + +--echo # +--echo # Create a temporary table within a function. +--echo # + +USE temp_db; +delimiter |; +CREATE FUNCTION f1() RETURNS INT +BEGIN + DROP TEMPORARY TABLE IF EXISTS temp_t1; + CREATE TEMPORARY TABLE temp_t1(i INT) ENGINE=INNODB; + INSERT INTO `temp_t1` VALUES(1); + RETURN (SELECT COUNT(*) FROM temp_t1); +END| +delimiter ;| + +SELECT f1(); +SELECT * FROM temp_t1; + +DROP TABLE temp_t1; +CREATE TEMPORARY TABLE `temp_t1`(i INT) ENGINE=INNODB; +SELECT f1(); +SELECT * FROM temp_t1; +DROP FUNCTION f1; + +--echo # +--echo # Create and drop a temporary table within a function. +--echo # + +delimiter |; +--error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG +CREATE FUNCTION f2() RETURNS INT +BEGIN + DROP TEMPORARY TABLE IF EXISTS temp_t1; + CREATE TEMPORARY TABLE temp_t1(i INT) ENGINE=INNODB; + INSERT INTO temp_t1 VALUES(1); + DROP TABLE temp_t1; + RETURN 0; +END| + +CREATE FUNCTION f2() RETURNS INT +BEGIN + DROP TEMPORARY TABLE IF EXISTS temp_t1; + CREATE TEMPORARY TABLE temp_t1(i INT) ENGINE=INNODB; + INSERT INTO temp_t1 VALUES(1); + DROP TEMPORARY TABLE temp_t1; + RETURN 0; +END| +delimiter ;| +SELECT f2(); +DROP FUNCTION f2; + +--echo # +--echo # Create a temporary table within a function and select it from another +--echo # function. +--echo # + +delimiter |; +CREATE FUNCTION f2() RETURNS INT +BEGIN + DROP TEMPORARY TABLE IF EXISTS temp_t1; + CREATE TEMPORARY TABLE temp_t1 (i INT) ENGINE=INNODB; + INSERT INTO temp_t1 VALUES (1); + RETURN f2_1(); +END| + +CREATE FUNCTION f2_1() RETURNS INT + RETURN (SELECT COUNT(*) FROM temp_t1)| +delimiter ;| + +SELECT f2(); +DROP TEMPORARY TABLE temp_t1; +DROP FUNCTION f2; + +--echo # +--echo # Create temporary table like base table. +--echo # + +CREATE TABLE t1(i INT) ENGINE=INNODB; +INSERT INTO t1 VALUES(1); +CREATE TEMPORARY TABLE temp_t1 LIKE t1; +SELECT * FROM temp_t1; +--error ER_NONUNIQ_TABLE +CREATE TEMPORARY TABLE t1 LIKE t1; +DROP TABLE temp_t1, t1; + +--echo # +--echo # Create temporary table as base table. +--echo # + +CREATE TABLE t1(i INT) ENGINE=INNODB; +INSERT INTO t1 VALUES(1); +CREATE TEMPORARY TABLE temp_t1 AS SELECT * FROM t1; +SELECT * FROM temp_t1; +DROP TABLE temp_t1, t1; + +--echo # +--echo # ALTER TABLE RENAME & ENABLE/DISABLE KEYS (shortcuts) +--echo # +CREATE TEMPORARY TABLE t1(i INT PRIMARY KEY) ENGINE=MYISAM; +INSERT INTO t1 VALUES(1); +SELECT COUNT(*)=1 FROM t1; + +ALTER TABLE t1 RENAME t2; +SELECT COUNT(*)=1 FROM t2; +ALTER TABLE t2 RENAME t1; + +ALTER TABLE t1 DISABLE KEYS; +ALTER TABLE t1 ENABLE KEYS; + +# LOCK TABLES is ignored for temporary tables. +LOCK TABLES t1 WRITE; +ALTER TABLE t1 RENAME t2; +SELECT COUNT(*)=1 FROM t2; +ALTER TABLE t2 RENAME t1; +ALTER TABLE t1 DISABLE KEYS; +ALTER TABLE t1 ENABLE KEYS; +UNLOCK TABLES; + +LOCK TABLES t1 READ; +ALTER TABLE t1 RENAME t2; +SELECT COUNT(*)=1 FROM t2; +ALTER TABLE t2 RENAME t1; +ALTER TABLE t1 DISABLE KEYS; +ALTER TABLE t1 ENABLE KEYS; +UNLOCK TABLES; + +FLUSH TABLES WITH READ LOCK; +ALTER TABLE t1 RENAME t2; +SELECT COUNT(*)=1 FROM t2; +ALTER TABLE t2 RENAME t1; +ALTER TABLE t1 DISABLE KEYS; +ALTER TABLE t1 ENABLE KEYS; +UNLOCK TABLES; + +ALTER TABLE t1 RENAME t2, LOCK SHARED; +ALTER TABLE t2 RENAME t1, LOCK EXCLUSIVE; + +DROP TABLE t1; + +--echo # Cleanup +DROP DATABASE temp_db; + diff --git a/mysql-test/t/trigger_null-8605.test b/mysql-test/t/trigger_null-8605.test index 4b51ccd5606..748768a1849 100644 --- a/mysql-test/t/trigger_null-8605.test +++ b/mysql-test/t/trigger_null-8605.test @@ -336,7 +336,8 @@ select * from t1; delete from t1; create trigger t1_bi before insert on t1 for each row begin end; insert t1 values (0); -select * from t1; +--error ER_DUP_ENTRY +insert t1 (id) values (0); drop table t1; # diff --git a/mysql-test/t/type_blob.test b/mysql-test/t/type_blob.test index a20173e231a..b818e1b451d 100644 --- a/mysql-test/t/type_blob.test +++ b/mysql-test/t/type_blob.test @@ -33,15 +33,12 @@ drop table t1,t2,t3,t4; CREATE TABLE t1 (a char(257) default "hello"); --error 1074 CREATE TABLE t2 (a char(256)); ---error 1074 CREATE TABLE t1 (a varchar(70000) default "hello"); ---error 1101 +SHOW CREATE TABLE t1; CREATE TABLE t2 (a blob default "hello"); +SHOW CREATE TABLE t2; -# Safety to be able to continue with other tests if above fails ---disable_warnings -drop table if exists t1,t2; ---enable_warnings +drop table t1,t2; # # test of full join with blob @@ -432,8 +429,9 @@ insert into t1 values (default); select * from t1; drop table t1; set @@sql_mode='TRADITIONAL'; ---error ER_BLOB_CANT_HAVE_DEFAULT create table t1 (a text default ''); +show create table t1; +drop table t1; set @@sql_mode=''; # @@ -515,7 +513,7 @@ CREATE TABLE b15776 (a char(2147483648)); --error ER_TOO_BIG_FIELDLENGTH CREATE TABLE b15776 (a char(4294967295)); # Even BLOB won't hold ---error ER_TOO_BIG_DISPLAYWIDTH +--error ER_TOO_BIG_FIELDLENGTH CREATE TABLE b15776 (a char(4294967296)); @@ -523,12 +521,14 @@ CREATE TABLE b15776 (a char(4294967296)); ## For year, widths not "2" or "4" are silently rewritten to "4". But ## When we complain about it, we say that the max is 255. We may be ## talking about different things. It's confusing. +--replace_result 4294967295 ? 0 ? CREATE TABLE b15776 (a year(4294967295)); INSERT INTO b15776 VALUES (42); SELECT * FROM b15776; DROP TABLE b15776; ---error ER_TOO_BIG_DISPLAYWIDTH CREATE TABLE b15776 (a year(4294967296)); +SHOW CREATE TABLE b15776; +DROP TABLE b15776; CREATE TABLE b15776 (a year(0)); # 0 is special case, means default size DROP TABLE b15776; --error ER_PARSE_ERROR @@ -539,7 +539,7 @@ CREATE TABLE b15776 (a year(-2)); CREATE TABLE b15776 (a timestamp(4294967294)); --error ER_TOO_BIG_PRECISION CREATE TABLE b15776 (a timestamp(4294967295)); ---error ER_TOO_BIG_DISPLAYWIDTH +--error ER_TOO_BIG_PRECISION CREATE TABLE b15776 (a timestamp(4294967296)); --error ER_PARSE_ERROR CREATE TABLE b15776 (a timestamp(-1)); @@ -550,10 +550,11 @@ CREATE TABLE b15776 (a timestamp(-2)); # widths that are too large to be interpreted cause DISPLAYWIDTH errors. --error ER_TOO_BIG_DISPLAYWIDTH CREATE TABLE b15776 (a int(999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999)); ---error ER_TOO_BIG_DISPLAYWIDTH +--error ER_TOO_BIG_FIELDLENGTH CREATE TABLE b15776 (a char(999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999)); ---error ER_TOO_BIG_DISPLAYWIDTH CREATE TABLE b15776 (a year(999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999)); +SHOW CREATE TABLE b15776; +DROP TABLE b15776; ## Do not select, too much memory needed. CREATE TABLE b15776 select cast(null as char(4294967295)); diff --git a/mysql-test/t/type_date.test b/mysql-test/t/type_date.test index 52ca2c85b15..71b1e76ac47 100644 --- a/mysql-test/t/type_date.test +++ b/mysql-test/t/type_date.test @@ -385,6 +385,37 @@ select 1 from t1 as t1_0 inner join t1 as t2 on (t1_0.a <=> now()) join t1 on 1; select 1 from t1 as t1_0 inner join t1 as t2 on (t1_0.a <=> now()) join t1 on 1; drop table t1; +--echo # +--echo # MDEV-9521 Least function returns 0000-00-00 for null date columns instead of null +--echo # MDEV-9972 Least function retuns date in date time format +--echo # +CREATE TABLE t1 ( + id BIGINT NOT NULL, + date_debut DATE NOT NULL, + date_fin DATE DEFAULT NULL); +CREATE TABLE t2( + id BIGINT NOT NULL, + date_debut DATE NOT NULL, + date_fin DATE DEFAULT NULL); +INSERT INTO t1 VALUES (1,'2016-01-01','2016-01-31'); +INSERT INTO t1 VALUES (2,'2016-02-01',null); +INSERT INTO t1 VALUES (3,'2016-03-01','2016-03-31'); +INSERT INTO t1 VALUES (4,'2016-04-01',null); + +INSERT INTO t2 VALUES (1,'2016-01-01','2016-01-31'); +INSERT INTO t2 VALUES (2,'2016-02-01','2016-01-28'); +INSERT INTO t2 VALUES (3,'2016-03-01',null); +INSERT INTO t2 VALUES (4,'2016-04-01',null); +SELECT t1.id, + GREATEST(t2.date_debut, t1.date_debut) AS date_debut, + LEAST(IFNULL(t2.date_fin, IFNULL(t1.date_fin, NULL)), + IFNULL(t1.date_fin, IFNULL(t2.date_fin, NULL))) AS date_fin +FROM t1 LEFT JOIN t2 ON (t1.id=t2.id); +DROP TABLE t1,t2; +SELECT + LEAST(COALESCE(DATE(NULL), DATE(NULL)), COALESCE(DATE(NULL), DATE(NULL))) AS d0, + LEAST(IFNULL(DATE(NULL), DATE(NULL)), IFNULL(DATE(NULL), DATE(NULL))) AS d1; + --echo # --echo # MDEV-9511 Valgrind warnings 'Invalid read' in Field_newdate::cmp and Field_newdate::val_str --echo # diff --git a/mysql-test/t/type_datetime.test b/mysql-test/t/type_datetime.test index 7c9d56a0780..b16d426ab70 100644 --- a/mysql-test/t/type_datetime.test +++ b/mysql-test/t/type_datetime.test @@ -610,6 +610,14 @@ EXECUTE stmt1; DEALLOCATE PREPARE stmt1; DROP TABLE t1,t2; +--echo # +--echo # MDEV-9374 having '2015-01-01 01:00:00.000001' > coalesce(NULL) returns true +--echo # +CREATE TABLE t1 (c1 DATETIME(0)); +INSERT INTO t1 VALUES (NULL); +SELECT * FROM t1 HAVING '2015-01-01 01:00:00.000001' > COALESCE(c1); +DROP TABLE t1; + --echo # --echo # End of 5.5 tests --echo # diff --git a/mysql-test/t/type_float.test b/mysql-test/t/type_float.test index ec0256beeef..f54eacf0595 100644 --- a/mysql-test/t/type_float.test +++ b/mysql-test/t/type_float.test @@ -509,6 +509,30 @@ INSERT INTO t1 (d2_2) SELECT d4_2 FROM t2; SELECT * FROM t1; DROP TABLE t1,t2; +--echo # +--echo # Test of using wrong scale +--echo # + +create or replace table t1 (a double(40,30)); +--error ER_TOO_BIG_SCALE 1425 +create or replace table t1 (a double(40,31)); +create or replace table t1 as select 1.01e1; +show create table t1; +create or replace table t1 as select truncate(10.000000000001e1, 30) as t; +show create table t1; +create or replace table t1 as select truncate(10.000000000001e1, 31) as t; +show create table t1; +create or replace table t1 as select truncate(10.000000000001e1, 39) as t; +show create table t1; +create or replace table t1 as select truncate(10.000000000001e1, 51) as t; +show create table t1; +create or replace table t1 as select truncate(10.000000000001e1, 20)/2 as t; +show create table t1; +create or replace table t1 as select truncate(10.000000000001e1, 28)/2 as t; +show create table t1; + +drop table if exists t1; + --echo # --echo # End of 10.2 tests --echo # diff --git a/mysql-test/t/type_newdecimal.test b/mysql-test/t/type_newdecimal.test index 86066309acc..152c3ade487 100644 --- a/mysql-test/t/type_newdecimal.test +++ b/mysql-test/t/type_newdecimal.test @@ -606,14 +606,14 @@ select round(99999999999999999.999,3); select round(-99999999999999999.999,3); #-- should return -100000000000000000.000 # -select truncate(99999999999999999999999999999999999999,31); +select truncate(99999999999999999999999999999999999999,49); #-- should return 99999999999999999999999999999999999999.000 # -select truncate(99.999999999999999999999999999999999999,31); +select truncate(99.999999999999999999999999999999999999,49); #-- should return 99.9999999999999999999999999999999 # select truncate(99999999999999999999999999999999999999,-31); -# should return 90000000000000000000000000000000 +# should return 99999990000000000000000000000000000000 # #-- 6. Set functions (AVG, SUM, COUNT) should work. # @@ -959,16 +959,18 @@ select cast(ln(14000) as decimal(2,3)) c1; --error 1426 create table t1 (sl decimal(70,30)); --error 1425 -create table t1 (sl decimal(32,31)); +create table t1 (sl decimal(32,39)); +--error 1426 +create table t1 (sl decimal(67,38)); --error 1425 -create table t1 (sl decimal(0,38)); +create table t1 (sl decimal(0,50)); --error 1427 create table t1 (sl decimal(0,30)); create table t1 (sl decimal(5, 5)); show create table t1; drop table t1; # Test limits -create table t1 (sl decimal(65, 30)); +create table t1 (sl decimal(65, 38)); show create table t1; drop table t1; @@ -1180,15 +1182,15 @@ SELECT CAST(1 AS decimal(65,10)); --error ER_TOO_BIG_PRECISION SELECT CAST(1 AS decimal(66,10)); -SELECT CAST(1 AS decimal(65,30)); +SELECT CAST(1 AS decimal(65,38)); --error ER_TOO_BIG_SCALE -SELECT CAST(1 AS decimal(65,31)); +SELECT CAST(1 AS decimal(65,39)); CREATE TABLE t1 (a int DEFAULT NULL, b int DEFAULT NULL); INSERT INTO t1 VALUES (3,30), (1,10), (2,10); SELECT a+CAST(1 AS decimal(65,30)) AS aa, SUM(b) FROM t1 GROUP BY aa; --error ER_TOO_BIG_SCALE -SELECT a+CAST(1 AS decimal(65,31)) AS aa, SUM(b) FROM t1 GROUP BY aa; +SELECT a+CAST(1 AS decimal(65,49)) AS aa, SUM(b) FROM t1 GROUP BY aa; DROP TABLE t1; @@ -1213,7 +1215,7 @@ DROP TABLE t1; # maxmimum precision of 30 places after the decimal point. Show that # temp field creation beyond that works and throws a truncation warning. # DECIMAL(37,36) should be adjusted to DECIMAL(31,30). -CREATE TABLE t1 SELECT 0.123456789012345678901234567890123456 AS f1; +CREATE TABLE t1 SELECT 0.1234567890123456789012345678901234567890123456789 AS f1; DESC t1; SELECT f1 FROM t1; DROP TABLE t1; @@ -1421,7 +1423,7 @@ DROP TABLE t1,t2; CREATE TABLE t1 (a DECIMAL(30,30)); INSERT INTO t1 VALUES (0.1),(0.2),(0.3); -CREATE TABLE t2 SELECT IFNULL(a + 0.0000000000000000000000000000001, NULL) AS c1 FROM t1; +CREATE TABLE t2 SELECT IFNULL(a + 0.00000000000000000000000000000000000000000000000001, NULL) AS c1 FROM t1; DESC t2; DROP TABLE t1,t2; @@ -1684,6 +1686,74 @@ INSERT INTO t1 VALUES (1),(2),(3),(4),(5); EXPLAIN SELECT * FROM t1 WHERE a='ax' ORDER BY a; DROP TABLE t1; + +--echo # +--echo # MDEV-8502 DECIMAL accepts out of range DEFAULT values +--echo # + +--error ER_INVALID_DEFAULT +CREATE TABLE t1 (a DECIMAL(2,1) DEFAULT 10000); +--error ER_INVALID_DEFAULT +CREATE TABLE t1 (a DECIMAL(2,1) DEFAULT 10000.0); +--error ER_INVALID_DEFAULT +CREATE TABLE t1 (a DECIMAL(2,1) DEFAULT 10000e0); +--error ER_INVALID_DEFAULT +CREATE TABLE t1 (a DECIMAL(2,1) DEFAULT '10000.0'); +--error ER_INVALID_DEFAULT +CREATE TABLE t1 (a DECIMAL(2,1) DEFAULT '10000.1'); + +--echo # +--echo # MDEV-10277 Redundant NOTE when inserting '0.00001 ' into a DECIMAL(2,1) column +--echo # +CREATE TABLE t1 (a DECIMAL(2,1)); +INSERT INTO t1 VALUES ('0.00001 '); +INSERT INTO t1 VALUES ('1e-10000 '); +INSERT INTO t1 VALUES ('0.1 '); +INSERT INTO t1 VALUES ('0.111 '); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a DECIMAL(2,1) DEFAULT '1e-10000'); +SHOW CREATE TABLE t1; +DROP TABLE t1; + +CREATE TABLE t1 (a DECIMAL(2,1) DEFAULT '0.1 '); +SHOW CREATE TABLE t1; +DROP TABLE t1; + +CREATE TABLE t1 (a DECIMAL(2,1) DEFAULT '0.10001 '); +SHOW CREATE TABLE t1; +DROP TABLE t1; + +CREATE TABLE t1 (a DECIMAL(2,1) DEFAULT '0.10001'); +SHOW CREATE TABLE t1; +DROP TABLE t1; + +CREATE TABLE t1 (a DECIMAL(2,1) DEFAULT 0.10001); +SHOW CREATE TABLE t1; +DROP TABLE t1; + +CREATE TABLE t1 (a DECIMAL(2,1) DEFAULT 0.10001e0); +SHOW CREATE TABLE t1; +DROP TABLE t1; + --echo # --echo # End of 10.1 tests --echo # + +--echo # +--echo # Test CREATE .. SELECT +--echo + +create or replace table t1 as select 1.000000000000000000000000000000000 as a; +show create table t1; +create or replace table t1 as select 1.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 as a; +show create table t1; +create or replace table t1 as select 1.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 as a; +show create table t1; + +drop table t1; + +--echo # +--echo # End of 10.2 tests +--echo # diff --git a/mysql-test/t/type_timestamp.test b/mysql-test/t/type_timestamp.test index 6188ed6b4d6..460769f8961 100644 --- a/mysql-test/t/type_timestamp.test +++ b/mysql-test/t/type_timestamp.test @@ -445,6 +445,14 @@ SELECT MAX(ts) = '2011-01-06 12:34:30' FROM t1; SELECT MAX(dt) = '2011-01-06 12:34:30' FROM t1; DROP TABLE t1; +--echo # +--echo # MDEV-9413 "datetime >= coalesce(c1(NULL))" doesn't return expected NULL +--echo # +CREATE TABLE t1(c1 TIMESTAMP(6) NULL DEFAULT NULL); +INSERT INTO t1 VALUES(NULL); +SELECT c1, '2016-06-13 20:00:00.000003' >= COALESCE( c1 ) FROM t1; +DROP TABLE t1; + --echo End of 5.5 tests --echo # diff --git a/mysql-test/t/type_timestamp_hires.test b/mysql-test/t/type_timestamp_hires.test index 0a49056294f..0b05f81ef42 100644 --- a/mysql-test/t/type_timestamp_hires.test +++ b/mysql-test/t/type_timestamp_hires.test @@ -17,15 +17,26 @@ drop table t1; # # MDEV-438 Microseconds: Precision is ignored in CURRENT_TIMESTAMP(N) when it is given as a default column value # -create table t1 (a timestamp(5) default current_timestamp); drop table t1; -create table t1 (a timestamp(5) default current_timestamp()); drop table t1; ---error ER_INVALID_DEFAULT -create table t1 (a timestamp(5) default current_timestamp(2)); -create table t1 (a timestamp(5) default current_timestamp(5)); drop table t1; -create table t1 (a timestamp(5) default current_timestamp(6)); drop table t1; -create table t1 (a timestamp(5) on update current_timestamp); drop table t1; -create table t1 (a timestamp(5) on update current_timestamp()); drop table t1; +create or replace table t1 (a timestamp(5) default current_timestamp); +show create table t1; +create or replace table t1 (a timestamp(5) default current_timestamp()); +show create table t1; +create or replace table t1 (a timestamp(5) default current_timestamp(2)); +show create table t1; +insert t1 () values (); +select * from t1; +create or replace table t1 (a timestamp(5) default current_timestamp(5)); +show create table t1; +create or replace table t1 (a timestamp(5) default current_timestamp(6)); +show create table t1; +create or replace table t1 (a timestamp(5) on update current_timestamp); +show create table t1; +create or replace table t1 (a timestamp(5) on update current_timestamp()); +show create table t1; --error ER_INVALID_ON_UPDATE -create table t1 (a timestamp(5) on update current_timestamp(3)); -create table t1 (a timestamp(5) on update current_timestamp(5)); drop table t1; -create table t1 (a timestamp(5) on update current_timestamp(6)); drop table t1; +create or replace table t1 (a timestamp(5) on update current_timestamp(3)); +create or replace table t1 (a timestamp(5) on update current_timestamp(5)); +show create table t1; +create or replace table t1 (a timestamp(5) on update current_timestamp(6)); +show create table t1; +drop table t1; diff --git a/mysql-test/t/udf.test b/mysql-test/t/udf.test index 4ee412f80d8..42a813b0782 100644 --- a/mysql-test/t/udf.test +++ b/mysql-test/t/udf.test @@ -512,3 +512,19 @@ DROP TABLE t1; --echo # --echo End of 5.1 tests. +--echo # +--echo # MDEV-10134 Add full support for DEFAULT +--echo # + +--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB +eval CREATE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_SO"; +SELECT METAPHON('Hello'); +CREATE TABLE t1 (a VARCHAR(10), b VARCHAR(10) DEFAULT METAPHON(a)); +SHOW CREATE TABLE t1; +INSERT INTO t1 (a) VALUES ('Hello'); +SELECT * FROM t1; +DROP FUNCTION METAPHON; +# QQ: this should return an error +#INSERT INTO t1 (a) VALUES ('Hello'); +#SELECT * FROM t1; +DROP TABLE t1; diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index 9fdabca82de..e2bc2168385 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -847,8 +847,9 @@ create view v1 as select 5 into outfile 'ttt'; create table t1 (a int); -- error ER_PARSE_ERROR create view v1 as select a from t1 procedure analyse(); --- error ER_VIEW_SELECT_DERIVED +# now derived tables are allowed create view v1 as select 1 from (select 1) as d1; +drop view v1; drop table t1; # @@ -3173,10 +3174,10 @@ DROP TABLE t1; DROP VIEW IF EXISTS v1; --enable_warnings -let $query = SELECT * FROM (SELECT 1) AS t; +let $query = SELECT * FROM (SELECT 1) AS t into @w; eval $query; ---error ER_VIEW_SELECT_DERIVED +--error ER_PARSE_ERROR eval CREATE VIEW v1 AS $query; --echo # Previously the following would fail. eval $query; @@ -5765,6 +5766,39 @@ drop table t1; --echo # Start of 10.2 tests --echo # +--echo # Checking that SHOW CREATE VIEW preserve parentheses + +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (10),(20),(30); + +CREATE VIEW v1 AS SELECT 1 AS a UNION SELECT a FROM t1; +SHOW CREATE VIEW v1; +SELECT * FROM v1; +DROP VIEW v1; + +CREATE VIEW v1 AS SELECT 1 AS a UNION SELECT a FROM t1 LIMIT 1; +SHOW CREATE VIEW v1; +SELECT * FROM v1; +DROP VIEW v1; + +CREATE VIEW v1 AS SELECT 1 AS a UNION (SELECT a FROM t1); +SHOW CREATE VIEW v1; +SELECT * FROM v1; +DROP VIEW v1; + +CREATE VIEW v1 AS SELECT 1 AS a UNION (SELECT a FROM t1 LIMIT 1); +SHOW CREATE VIEW v1; +SELECT * FROM v1; +DROP VIEW v1; + +CREATE VIEW v1 AS SELECT 1 AS a UNION (SELECT a FROM t1) LIMIT 1; +SHOW CREATE VIEW v1; +SELECT * FROM v1; +DROP VIEW v1; + +DROP TABLE t1; + + --echo # --echo # MDEV-9408 CREATE TABLE SELECT MAX(int_column) creates different columns for table vs view --echo # @@ -5784,7 +5818,172 @@ SHOW CREATE TABLE t3; DROP VIEW v1; DROP TABLE t1,t2,t3; +--echo # +--echo # MDEV-3944: Allow derived tables in VIEWS +--echo # +create table t1 (s1 int); +insert into t1 values (1),(2),(3); +CREATE VIEW v1 AS SELECT * FROM (SELECT s1 FROM t1 WHERE s1>1) AS x; +CREATE VIEW v2 AS SELECT * FROM (SELECT s1 FROM t1 WHERE s1<3) AS x; + +--sorted_result +select * from v1; +--sorted_result +select * from v2; +--sorted_result +select * from v1 natural join v2; +--sorted_result +select * from v1 natural join t1; +--sorted_result +select * from v1 natural join (SELECT s1 FROM t1 WHERE s1<3) as x; +--sorted_result +select * from v1 left join v2 on (v1.s1=v2.s1); +--sorted_result +select * from v1 left join t1 on (v1.s1=t1.s1); +--sorted_result +select * from t1 left join v2 on (t1.s1=v2.s1); +--sorted_result +select * from v1 left join (SELECT s1 FROM t1 WHERE s1<3) as x on (v1.s1=x.s1); +--sorted_result +select * from (SELECT s1 FROM t1 WHERE s1>1) AS x left join v2 on (x.s1=v2.s1); + +drop view v1,v2; + +CREATE VIEW v1 AS SELECT * FROM (SELECT s1 FROM (SELECT s1 FROM t1 WHERE s1 +< 100) as xx WHERE s1>1) AS x; +CREATE VIEW v2 AS SELECT * FROM (SELECT s1 FROM (SELECT s1 FROM t1 WHERE s1 +> -100) as xx WHERE s1<3) AS x; +insert into t1 values (200),(-200); +--sorted_result +select * from t1; +--sorted_result +select * from v1; +--sorted_result +select * from v2; +--sorted_result +select * from v1 natural join v2; +--sorted_result +select * from v1 natural join t1; +--sorted_result +select * from v1 natural join (SELECT s1 FROM t1 WHERE s1<3) as x; +--sorted_result +select * from v1 left join v2 on (v1.s1=v2.s1); +--sorted_result +select * from v1 left join t1 on (v1.s1=t1.s1); +--sorted_result +select * from t1 left join v2 on (t1.s1=v2.s1); +--sorted_result +select * from v1 left join (SELECT s1 FROM t1 WHERE s1<3) as x on (v1.s1=x.s1); +--sorted_result +select * from (SELECT s1 FROM t1 WHERE s1>1) AS x left join v2 on (x.s1=v2.s1); + +drop view v1,v2; + +CREATE algorithm=temptable VIEW v1 AS SELECT * FROM (SELECT s1 FROM (SELECT s1 FROM t1 WHERE s1 +< 100) as xx WHERE s1>1) AS x; +CREATE algorithm=temptable VIEW v2 AS SELECT * FROM (SELECT s1 FROM (SELECT s1 FROM t1 WHERE s1 +> -100) as xx WHERE s1<3) AS x; +--sorted_result +select * from t1; +--sorted_result +select * from v1; +--sorted_result +select * from v2; +--sorted_result +select * from v1 natural join v2; +--sorted_result +select * from v1 natural join t1; +--sorted_result +select * from v1 natural join (SELECT s1 FROM t1 WHERE s1<3) as x; +--sorted_result +select * from v1 left join v2 on (v1.s1=v2.s1); +--sorted_result +select * from v1 left join t1 on (v1.s1=t1.s1); +--sorted_result +select * from t1 left join v2 on (t1.s1=v2.s1); +--sorted_result +select * from v1 left join (SELECT s1 FROM t1 WHERE s1<3) as x on (v1.s1=x.s1); +--sorted_result +select * from (SELECT s1 FROM t1 WHERE s1>1) AS x left join v2 on (x.s1=v2.s1); + +drop view v1,v2; + +CREATE VIEW v1 AS SELECT * FROM (SELECT s1 FROM (SELECT s1 FROM t1 WHERE s1 +< 100) as xx WHERE s1>1) AS x; + +--error ER_NON_INSERTABLE_TABLE +insert into v1 values (-300); +--error ER_NON_UPDATABLE_TABLE +update v1 set s1=s1+1; + +drop view v1; + +CREATE VIEW v1 AS SELECT s1,s2 FROM (SELECT s1 as s2 FROM t1 WHERE s1 < +100) x, t1 WHERE t1.s1=x.s2; +select * from v1; + +insert into v1 (s1) values (-300); +update v1 set s1=s1+1; +select * from v1; +select * from t1; +--error ER_NON_INSERTABLE_TABLE +insert into v1(s2) values (-300); +--error ER_NON_UPDATABLE_TABLE +update v1 set s2=s2+1; + +drop view v1; + +CREATE VIEW v1 AS SELECT * FROM (SELECT s1 FROM t1 WHERE s1 +< 100) AS x; + +--error ER_NON_INSERTABLE_TABLE +insert into v1 values (-300); +--error ER_NON_UPDATABLE_TABLE +update v1 set s1=s1+1; + +drop view v1; + +CREATE VIEW v1 AS SELECT * FROM (SELECT s1 FROM (SELECT s1 FROM t1 WHERE s1 +< 100) as xx WHERE s1>1) AS x; + +--error ER_NON_INSERTABLE_TABLE +insert into v1 values (-300); +--error ER_NON_UPDATABLE_TABLE +update v1 set s1=s1+1; + +create view v2 as select * from v1; + +--error ER_NON_INSERTABLE_TABLE +insert into v2 values (-300); +--error ER_NON_UPDATABLE_TABLE +update v2 set s1=s1+1; + +drop view v1, v2; +drop table t1; + +--echo # +--echo # MDEV-9671:Wrong result upon select from a view with a FROM subquery +--echo # +CREATE TABLE t1 (i INT); +INSERT INTO t1 VALUES (3),(2); + +CREATE TABLE t2 (j INT); +INSERT INTO t2 VALUES (8),(3),(3); + +CREATE TABLE t3 (k INT); +INSERT INTO t3 VALUES (1),(8); + +CREATE VIEW v1 AS SELECT * FROM t1 LEFT JOIN ( SELECT t2.* FROM t2 INNER JOIN t3 ON ( k = j ) ) AS alias1 ON ( i = j ); + +show create view v1; + +SELECT * FROM t1 LEFT JOIN ( SELECT t2.* FROM t2 INNER JOIN t3 ON ( k = j ) ) AS alias1 ON ( i = j ); + +SELECT * FROM v1; + +DROP VIEW v1; +DROP TABLE t1, t2, t3; --echo # --echo # End of 10.2 tests --echo # diff --git a/mysql-test/t/wait_timeout_not_windows.test b/mysql-test/t/wait_timeout_not_windows.test new file mode 100644 index 00000000000..de4904fada2 --- /dev/null +++ b/mysql-test/t/wait_timeout_not_windows.test @@ -0,0 +1,16 @@ +source include/not_embedded.inc; +source include/not_windows.inc; + +# +# MDEV-7775 Wrong error message (Unknown error) when idle sessions are killed after wait_timeout +# +set global log_warnings=2; +connect (foo,localhost,root); +set @@wait_timeout=1; +sleep 2; +connection default; +let SEARCH_FILE=$MYSQLTEST_VARDIR/log/mysqld.1.err; +let SEARCH_RANGE= -50; +let SEARCH_PATTERN= Aborted.*Got timeout reading communication packets; +source include/search_pattern_in_file.inc; +set global log_warnings=@@log_warnings; diff --git a/mysql-test/t/xml.test b/mysql-test/t/xml.test index 3e7c9b78673..417c206f6dc 100644 --- a/mysql-test/t/xml.test +++ b/mysql-test/t/xml.test @@ -754,3 +754,24 @@ DROP TABLE t1; --echo # --echo # End of 10.0 tests --echo # + +--echo # +--echo # Start of 10.2 tests +--echo # + +--echo # +--echo # MDEV-10134 Add full support for DEFAULT +--echo # +CREATE TABLE t1 (a TEXT, b TEXT DEFAULT ExtractValue(a, '/a/b')); +INSERT INTO t1 (a) VALUES ('bbb'); +SELECT b FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a TEXT, b TEXT DEFAULT UpdateXML(a, '/a/b','xxx')); +INSERT INTO t1 (a) VALUES ('bbb'); +SELECT b FROM t1; +DROP TABLE t1; + +--echo # +--echo # End of 10.2 tests +--echo # diff --git a/mysql-test/valgrind.supp b/mysql-test/valgrind.supp index b5c9b62049b..c3e7d1c65ec 100644 --- a/mysql-test/valgrind.supp +++ b/mysql-test/valgrind.supp @@ -19,36 +19,6 @@ # Suppress some common (not fatal) errors in system libraries found by valgrind # -# -# Pthread doesn't free all thread specific memory before program exists -# -{ - pthread allocate_tls memory loss - Memcheck:Leak - fun:calloc - fun:_dl_allocate_tls - fun:allocate_stack - fun:pthread_create* -} - -{ - pthread allocate_tls memory loss - Memcheck:Leak - fun:calloc - fun:_dl_allocate_tls - fun:pthread_create* - -} - -{ - pthread allocate_tls memory loss - Memcheck:Leak - fun:calloc - obj:/lib*/ld*.so - fun:_dl_allocate_tls - fun:pthread_create* -} - { pthead_exit memory loss 1 Memcheck:Leak @@ -89,52 +59,6 @@ fun:_dl_map_object_from_fd } -{ - pthread allocate_dtv memory loss - Memcheck:Leak - fun:calloc - fun:allocate_dtv - fun:_dl_allocate_tls_storage - fun:__GI__dl_allocate_tls - fun:pthread_create -} - -{ - pthread allocate_dtv memory loss second - Memcheck:Leak - fun:calloc - fun:allocate_dtv - fun:_dl_allocate_tls - fun:pthread_create* -} - -{ - pthread memalign memory loss - Memcheck:Leak - fun:memalign - fun:_dl_allocate_tls_storage - fun:__GI__dl_allocate_tls - fun:pthread_create -} - -{ - pthread memalign memory loss2 - Memcheck:Leak - fun:memalign - fun:tls_get_addr_tail - ... - fun:*ha_initialize_handlerton* -} - -{ - pthread memalign memory loss3 - Memcheck:Leak - fun:memalign - fun:tls_get_addr_tail - ... - fun:*ha_finalize_handlerton* -} - { pthread pthread_key_create Memcheck:Leak @@ -1006,18 +930,6 @@ fun:nptl_pthread_exit_hack_handler } -# -# Pthread doesn't free all thread specific memory before program exists -# -{ - pthread allocate_tls memory loss in 2.6.1. - Memcheck:Leak - fun:calloc - obj:*/ld-*.so - fun:_dl_allocate_tls - fun:pthread_create* -} - { memory "leak" in backtrace() of glibc 2.9 (not present in 2.13) Memcheck:Leak @@ -1152,6 +1064,13 @@ fun:SSL_library_init } +{ + libcrypto 2.2.1 leak + Memcheck:Leak + fun:malloc + ... + fun:ERR_get_state +} { Problem with udf and libresolve @@ -1163,6 +1082,23 @@ fun:gethostbyaddr_r } +# +# Detached threads may not complete deiniitialization by the time shutdown +# thread calls exit. This is unfortunate property of detached threads, which +# we currently can only ignore. Unfortunately there is no way to distinguish +# between false positives generated by detached threads and real memory leaks +# generated by not joined joinable threads. So we hide both cases. +# +# To avoid enumeration of the whole variety of possible traces we ignore all +# "possibly lost" blocks allocated by pthread_create (and it's callees). +# +{ + Detached threads memory loss + Memcheck:Leak + match-leak-kinds:possible + ... + fun:pthread_create* +} { ConnectSE: unixODBC SQLAllocEnv leaves some "still reachable" pointers @@ -1625,4 +1561,3 @@ g codership/mysql-wsrep/issues#176 fun:start_thread fun:clone } - diff --git a/mysys/CMakeLists.txt b/mysys/CMakeLists.txt index 0d404586569..5f4e9156fd2 100644 --- a/mysys/CMakeLists.txt +++ b/mysys/CMakeLists.txt @@ -71,7 +71,7 @@ ENDIF() ADD_CONVENIENCE_LIBRARY(mysys ${MYSYS_SOURCES}) TARGET_LINK_LIBRARIES(mysys dbug strings mysys_ssl ${ZLIB_LIBRARY} - ${LIBNSL} ${LIBM} ${LIBRT} ${LIBDL} ${LIBSOCKET} ${LIBEXECINFO}) + ${LIBNSL} ${LIBM} ${LIBRT} ${LIBDL} ${LIBSOCKET} ${LIBEXECINFO} ${CRC32_VPMSUM_LIBRARY}) DTRACE_INSTRUMENT(mysys) IF(HAVE_BFD_H) diff --git a/mysys/charset-def.c b/mysys/charset-def.c index af1e9bae2ac..defb5c0062d 100644 --- a/mysys/charset-def.c +++ b/mysys/charset-def.c @@ -49,6 +49,7 @@ extern struct charset_info_st my_charset_ucs2_unicode_520_ci; extern struct charset_info_st my_charset_ucs2_vietnamese_ci; extern struct charset_info_st my_charset_ucs2_croatian_uca_ci; extern struct charset_info_st my_charset_ucs2_myanmar_uca_ci; +extern struct charset_info_st my_charset_ucs2_thai_520_w2; #endif @@ -78,6 +79,7 @@ extern struct charset_info_st my_charset_utf32_unicode_520_ci; extern struct charset_info_st my_charset_utf32_vietnamese_ci; extern struct charset_info_st my_charset_utf32_croatian_uca_ci; extern struct charset_info_st my_charset_utf32_myanmar_uca_ci; +extern struct charset_info_st my_charset_utf32_thai_520_w2; #endif /* HAVE_CHARSET_utf32 */ @@ -107,6 +109,7 @@ extern struct charset_info_st my_charset_utf16_unicode_520_ci; extern struct charset_info_st my_charset_utf16_vietnamese_ci; extern struct charset_info_st my_charset_utf16_croatian_uca_ci; extern struct charset_info_st my_charset_utf16_myanmar_uca_ci; +extern struct charset_info_st my_charset_utf16_thai_520_w2; #endif /* HAVE_CHARSET_utf16 */ @@ -136,6 +139,7 @@ extern struct charset_info_st my_charset_utf8_unicode_520_ci; extern struct charset_info_st my_charset_utf8_vietnamese_ci; extern struct charset_info_st my_charset_utf8_croatian_uca_ci; extern struct charset_info_st my_charset_utf8_myanmar_uca_ci; +extern struct charset_info_st my_charset_utf8_thai_520_w2; #ifdef HAVE_UTF8_GENERAL_CS extern struct charset_info_st my_charset_utf8_general_cs; #endif @@ -167,6 +171,7 @@ extern struct charset_info_st my_charset_utf8mb4_unicode_520_ci; extern struct charset_info_st my_charset_utf8mb4_vietnamese_ci; extern struct charset_info_st my_charset_utf8mb4_croatian_uca_ci; extern struct charset_info_st my_charset_utf8mb4_myanmar_uca_ci; +extern struct charset_info_st my_charset_utf8mb4_thai_520_w2; #endif /* HAVE_CHARSET_utf8mb4 */ #endif /* HAVE_UCA_COLLATIONS */ @@ -261,6 +266,7 @@ my_bool init_compiled_charsets(myf flags __attribute__((unused))) add_compiled_collation(&my_charset_ucs2_vietnamese_ci); add_compiled_collation(&my_charset_ucs2_croatian_uca_ci); add_compiled_collation(&my_charset_ucs2_myanmar_uca_ci); + add_compiled_collation(&my_charset_ucs2_thai_520_w2); #endif #endif @@ -303,6 +309,7 @@ my_bool init_compiled_charsets(myf flags __attribute__((unused))) add_compiled_collation(&my_charset_utf8_vietnamese_ci); add_compiled_collation(&my_charset_utf8_croatian_uca_ci); add_compiled_collation(&my_charset_utf8_myanmar_uca_ci); + add_compiled_collation(&my_charset_utf8_thai_520_w2); #endif #endif /* HAVE_CHARSET_utf8 */ @@ -337,6 +344,7 @@ my_bool init_compiled_charsets(myf flags __attribute__((unused))) add_compiled_collation(&my_charset_utf8mb4_vietnamese_ci); add_compiled_collation(&my_charset_utf8mb4_croatian_uca_ci); add_compiled_collation(&my_charset_utf8mb4_myanmar_uca_ci); + add_compiled_collation(&my_charset_utf8mb4_thai_520_w2); #endif /* HAVE_UCA_COLLATIONS */ #endif /* HAVE_CHARSET_utf8mb4 */ @@ -373,6 +381,7 @@ my_bool init_compiled_charsets(myf flags __attribute__((unused))) add_compiled_collation(&my_charset_utf16_vietnamese_ci); add_compiled_collation(&my_charset_utf16_croatian_uca_ci); add_compiled_collation(&my_charset_utf16_myanmar_uca_ci); + add_compiled_collation(&my_charset_utf16_thai_520_w2); #endif /* HAVE_UCA_COLLATIONS */ #endif /* HAVE_CHARSET_utf16 */ @@ -407,6 +416,7 @@ my_bool init_compiled_charsets(myf flags __attribute__((unused))) add_compiled_collation(&my_charset_utf32_vietnamese_ci); add_compiled_collation(&my_charset_utf32_croatian_uca_ci); add_compiled_collation(&my_charset_utf32_myanmar_uca_ci); + add_compiled_collation(&my_charset_utf32_thai_520_w2); #endif /* HAVE_UCA_COLLATIONS */ #endif /* HAVE_CHARSET_utf32 */ diff --git a/mysys/checksum.c b/mysys/checksum.c index a948785d935..40f2ace680d 100644 --- a/mysys/checksum.c +++ b/mysys/checksum.c @@ -30,7 +30,13 @@ ha_checksum my_checksum(ha_checksum crc, const uchar *pos, size_t length) { +#ifdef HAVE_CRC32_VPMSUM + extern unsigned int crc32ieee_vpmsum(unsigned int crc, const unsigned char *p, + unsigned long len); + crc= (ha_checksum) crc32ieee_vpmsum((uint) crc, pos, (uint) length); +#else crc= (ha_checksum) crc32((uint)crc, pos, (uint) length); +#endif DBUG_PRINT("info", ("crc: %lu", (ulong) crc)); return crc; } diff --git a/mysys/errors.c b/mysys/errors.c index e3fbfd4d8e6..0c6942c5b82 100644 --- a/mysys/errors.c +++ b/mysys/errors.c @@ -1,6 +1,5 @@ -/* - Copyright (c) 2000, 2013, Oracle and/or its affiliates - Copyright (c) 1995, 2013, Monty Program Ab +/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. + Copyright (c) 2009, 2016, MariaDB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/mysys/lf_alloc-pin.c b/mysys/lf_alloc-pin.c index b349ef88ed1..932dfe0f254 100644 --- a/mysys/lf_alloc-pin.c +++ b/mysys/lf_alloc-pin.c @@ -121,7 +121,6 @@ void lf_pinbox_init(LF_PINBOX *pinbox, uint free_ptr_offset, lf_pinbox_free_func *free_func, void *free_func_arg) { DBUG_ASSERT(free_ptr_offset % sizeof(void *) == 0); - compile_time_assert(sizeof(LF_PINS) == 128); lf_dynarray_init(&pinbox->pinarray, sizeof(LF_PINS)); pinbox->pinstack_top_ver= 0; pinbox->pins_in_array= 0; diff --git a/mysys/lf_hash.c b/mysys/lf_hash.c index 6be11edbfcf..98a34647844 100644 --- a/mysys/lf_hash.c +++ b/mysys/lf_hash.c @@ -308,7 +308,7 @@ static inline const uchar* hash_key(const LF_HASH *hash, @note, that the hash value is limited to 2^31, because we need one bit to distinguish between normal and dummy nodes. */ -static inline my_hash_value_type calc_hash(const CHARSET_INFO *cs, +static inline my_hash_value_type calc_hash(CHARSET_INFO *cs, const uchar *key, size_t keylen) { diff --git a/mysys/ma_dyncol.c b/mysys/ma_dyncol.c index 92418e38c2e..4d281b98d1c 100644 --- a/mysys/ma_dyncol.c +++ b/mysys/ma_dyncol.c @@ -566,7 +566,7 @@ static my_bool type_and_offset_read_named(DYNAMIC_COLUMN_TYPE *type, return 1; } *type= (val & 0xf) + 1; - *offset= val >> 4; + *offset= (size_t) (val >> 4); return (*offset >= lim); } @@ -2066,7 +2066,7 @@ static uchar *find_entry_named(DYN_HEADER *hdr, LEX_STRING *key) /** Write number in the buffer (backward direction - starts from the buffer end) - @return pointer on the number begining + @return pointer on the number beginning */ static char *backwritenum(char *chr, uint numkey) @@ -2803,7 +2803,7 @@ dynamic_column_update_copy(DYNAMIC_COLUMN *str, PLAN *plan, else if (offs < first_offset) goto err; - offs+= plan[i].ddelta; + offs+= (size_t) plan[i].ddelta; { DYNAMIC_COLUMN_VALUE val; val.type= tp; // only the type used in the header @@ -2969,7 +2969,7 @@ dynamic_column_update_move_left(DYNAMIC_COLUMN *str, PLAN *plan, return ER_DYNCOL_FORMAT; } - offs+= plan[i].ddelta; + offs+= (size_t) plan[i].ddelta; int2store(write, nm); /* write rest of data at write + COLUMN_NUMBER_SIZE */ type_and_offset_store_num(write, new_offset_size, tp, offs); @@ -3023,9 +3023,9 @@ dynamic_column_update_move_left(DYNAMIC_COLUMN *str, PLAN *plan, memmove((header_base + new_header_size + plan[i].mv_offset + plan[i].ddelta), header_base + header_size + plan[i].mv_offset, - plan[i].mv_length); + (size_t) plan[i].mv_length); } - str->length+= plan[i].mv_length; + str->length+= (size_t) plan[i].mv_length; /* new data adding */ if (i < add_column_count) @@ -3514,8 +3514,8 @@ dynamic_column_update_many_fmt(DYNAMIC_COLUMN *str, Check if it is only "increasing" or only "decreasing" plan for (header and data separately). */ - new_header.data_size= header.data_size + data_delta; - new_header.nmpool_size= new_header.nmpool_size + name_delta; + new_header.data_size= (size_t) (header.data_size + data_delta); + new_header.nmpool_size= (size_t) (new_header.nmpool_size + name_delta); DBUG_ASSERT(new_header.format != dyncol_fmt_num || new_header.nmpool_size == 0); if ((new_header.offset_size= diff --git a/mysys/mf_iocache.c b/mysys/mf_iocache.c index db8d0b51ada..635e544d367 100644 --- a/mysys/mf_iocache.c +++ b/mysys/mf_iocache.c @@ -517,7 +517,7 @@ int _my_b_write(IO_CACHE *info, const uchar *Buffer, size_t Count) { my_off_t old_pos_in_file= info->pos_in_file; res= info->write_function(info, Buffer, Count); - Count-= info->pos_in_file - old_pos_in_file; + Count-= (size_t) (info->pos_in_file - old_pos_in_file); Buffer+= info->pos_in_file - old_pos_in_file; } else @@ -614,6 +614,7 @@ int _my_b_cache_read(IO_CACHE *info, uchar *Buffer, size_t Count) { /* End of file. Return, what we did copy from the buffer. */ info->error= (int) left_length; + info->seek_not_done=1; DBUG_RETURN(1); } /* @@ -631,6 +632,7 @@ int _my_b_cache_read(IO_CACHE *info, uchar *Buffer, size_t Count) */ info->error= (read_length == (size_t) -1 ? -1 : (int) (read_length+left_length)); + info->seek_not_done=1; DBUG_RETURN(1); } Count-=length; @@ -683,6 +685,7 @@ int _my_b_cache_read(IO_CACHE *info, uchar *Buffer, size_t Count) /* For a read error, return -1, otherwise, what we got in total. */ info->error= length == (size_t) -1 ? -1 : (int) (length+left_length); info->read_pos=info->read_end=info->buffer; + info->seek_not_done=1; DBUG_RETURN(1); } /* @@ -1226,7 +1229,7 @@ static int _my_b_cache_read_r(IO_CACHE *cache, uchar *Buffer, size_t Count) static void copy_to_read_buffer(IO_CACHE *write_cache, const uchar *write_buffer, my_off_t pos_in_file) { - size_t write_length= write_cache->pos_in_file - pos_in_file; + size_t write_length= (size_t) (write_cache->pos_in_file - pos_in_file); IO_CACHE_SHARE *cshare= write_cache->share; DBUG_ASSERT(cshare->source_cache == write_cache); @@ -1925,6 +1928,7 @@ void die(const char* fmt, ...) fprintf(stderr,"Error:"); vfprintf(stderr, fmt,va_args); fprintf(stderr,", errno=%d\n", errno); + va_end(va_args); exit(1); } diff --git a/mysys/mulalloc.c b/mysys/mulalloc.c index fceecdc1dc7..e230cdf9b71 100644 --- a/mysys/mulalloc.c +++ b/mysys/mulalloc.c @@ -80,7 +80,7 @@ void *my_multi_malloc_large(myf myFlags, ...) { va_list args; char **ptr,*start,*res; - size_t tot_length,length; + ulonglong tot_length,length; DBUG_ENTER("my_multi_malloc"); va_start(args,myFlags); @@ -92,7 +92,7 @@ void *my_multi_malloc_large(myf myFlags, ...) } va_end(args); - if (!(start=(char *) my_malloc(tot_length, myFlags))) + if (!(start=(char *) my_malloc((size_t) tot_length, myFlags))) DBUG_RETURN(0); /* purecov: inspected */ va_start(args,myFlags); diff --git a/mysys/my_context.c b/mysys/my_context.c index 5faa041361a..fd9415afc94 100644 --- a/mysys/my_context.c +++ b/mysys/my_context.c @@ -206,7 +206,7 @@ my_context_spawn(struct my_context *c, void (*f)(void *), void *d) ( "movq %%rsp, (%[save])\n\t" "movq %[stack], %%rsp\n\t" -#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 4 && !defined(__INTEL_COMPILER) +#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) && !defined(__INTEL_COMPILER) /* This emits a DWARF DW_CFA_undefined directive to make the return address undefined. This indicates that this is the top of the stack frame, and @@ -454,7 +454,7 @@ my_context_spawn(struct my_context *c, void (*f)(void *), void *d) ( "movl %%esp, (%[save])\n\t" "movl %[stack], %%esp\n\t" -#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 4 && !defined(__INTEL_COMPILER) +#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) && !defined(__INTEL_COMPILER) /* This emits a DWARF DW_CFA_undefined directive to make the return address undefined. This indicates that this is the top of the stack frame, and diff --git a/mysys/my_copy.c b/mysys/my_copy.c index 8af572b5518..bd23dfc48cd 100644 --- a/mysys/my_copy.c +++ b/mysys/my_copy.c @@ -18,7 +18,6 @@ #include "mysys_err.h" #include /* for stat */ #include -#include "mysys_err.h" #if defined(HAVE_UTIME_H) #include #elif defined(HAVE_SYS_UTIME_H) diff --git a/mysys/my_crc32.c b/mysys/my_crc32.c deleted file mode 100644 index 0981c75755d..00000000000 --- a/mysys/my_crc32.c +++ /dev/null @@ -1,23 +0,0 @@ -/* Copyright (c) 2003, 2004 MySQL AB - Use is subject to license terms - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ - -#include "mysys_priv.h" - -#ifndef HAVE_COMPRESS -#undef DYNAMIC_CRC_TABLE -#include "../zlib/crc32.c" -#endif - diff --git a/mysys/my_default.c b/mysys/my_default.c index 0c4fce0d2c7..a8c3c53adf6 100644 --- a/mysys/my_default.c +++ b/mysys/my_default.c @@ -1124,43 +1124,7 @@ static int add_directory(MEM_ROOT *alloc, const char *dir, const char **dirs) return 0; } - #ifdef __WIN__ -/* - This wrapper for GetSystemWindowsDirectory() will dynamically bind to the - function if it is available, emulate it on NT4 Terminal Server by stripping - the \SYSTEM32 from the end of the results of GetSystemDirectory(), or just - return GetSystemDirectory(). - */ - -typedef UINT (WINAPI *GET_SYSTEM_WINDOWS_DIRECTORY)(LPSTR, UINT); - -static size_t my_get_system_windows_directory(char *buffer, size_t size) -{ - size_t count; - GET_SYSTEM_WINDOWS_DIRECTORY - func_ptr= (GET_SYSTEM_WINDOWS_DIRECTORY) - GetProcAddress(GetModuleHandle("kernel32.dll"), - "GetSystemWindowsDirectoryA"); - - if (func_ptr) - return func_ptr(buffer, (uint) size); - - /* - Windows NT 4.0 Terminal Server Edition: - To retrieve the shared Windows directory, call GetSystemDirectory and - trim the "System32" element from the end of the returned path. - */ - count= GetSystemDirectory(buffer, (uint) size); - if (count > 8 && stricmp(buffer+(count-8), "\\System32") == 0) - { - count-= 8; - buffer[count] = '\0'; - } - return count; -} - - static const char *my_get_module_parent(char *buf, size_t size) { char *last= NULL; @@ -1209,7 +1173,7 @@ static const char **init_default_directories(MEM_ROOT *alloc) { char fname_buffer[FN_REFLEN]; - if (my_get_system_windows_directory(fname_buffer, sizeof(fname_buffer))) + if (GetSystemWindowsDirectory(fname_buffer, sizeof(fname_buffer))) errors += add_directory(alloc, fname_buffer, dirs); if (GetWindowsDirectory(fname_buffer, sizeof(fname_buffer))) diff --git a/mysys/my_thr_init.c b/mysys/my_thr_init.c index 1e4b85583b1..60a46997901 100644 --- a/mysys/my_thr_init.c +++ b/mysys/my_thr_init.c @@ -294,7 +294,7 @@ my_bool my_thread_init(void) STACK_DIRECTION * (long)my_thread_stack_size; mysql_mutex_lock(&THR_LOCK_threads); - tmp->id= ++thread_id; + tmp->id= tmp->dbug_id= ++thread_id; ++THR_thread_count; mysql_mutex_unlock(&THR_LOCK_threads); tmp->init= 1; @@ -400,7 +400,7 @@ my_thread_id my_thread_dbug_id() my_thread_init(). */ struct st_my_thread_var *tmp= my_thread_var; - return tmp ? tmp->id : 0; + return tmp ? tmp->dbug_id : 0; } #ifdef DBUG_OFF diff --git a/mysys/my_wincond.c b/mysys/my_wincond.c index 07ba4f5c587..54b272d7025 100644 --- a/mysys/my_wincond.c +++ b/mysys/my_wincond.c @@ -26,63 +26,6 @@ #include -/* - Windows native condition variables. We use runtime loading / function - pointers, because they are not available on XP -*/ - -/* Prototypes and function pointers for condition variable functions */ -typedef void (WINAPI * InitializeConditionVariableProc) - (PCONDITION_VARIABLE ConditionVariable); - -typedef BOOL (WINAPI * SleepConditionVariableCSProc) - (PCONDITION_VARIABLE ConditionVariable, - PCRITICAL_SECTION CriticalSection, - DWORD dwMilliseconds); - -typedef void (WINAPI * WakeAllConditionVariableProc) - (PCONDITION_VARIABLE ConditionVariable); - -typedef void (WINAPI * WakeConditionVariableProc) - (PCONDITION_VARIABLE ConditionVariable); - -static InitializeConditionVariableProc my_InitializeConditionVariable; -static SleepConditionVariableCSProc my_SleepConditionVariableCS; -static WakeAllConditionVariableProc my_WakeAllConditionVariable; -static WakeConditionVariableProc my_WakeConditionVariable; - - -/** - Indicates if we have native condition variables, - initialized first time pthread_cond_init is called. -*/ - -static BOOL have_native_conditions= FALSE; - - -/** - Check if native conditions can be used, load function pointers -*/ - -static void check_native_cond_availability(void) -{ - HMODULE module= GetModuleHandle("kernel32"); - - my_InitializeConditionVariable= (InitializeConditionVariableProc) - GetProcAddress(module, "InitializeConditionVariable"); - my_SleepConditionVariableCS= (SleepConditionVariableCSProc) - GetProcAddress(module, "SleepConditionVariableCS"); - my_WakeAllConditionVariable= (WakeAllConditionVariableProc) - GetProcAddress(module, "WakeAllConditionVariable"); - my_WakeConditionVariable= (WakeConditionVariableProc) - GetProcAddress(module, "WakeConditionVariable"); - - if (my_InitializeConditionVariable) - have_native_conditions= TRUE; -} - - - /** Convert abstime to milliseconds */ @@ -105,202 +48,40 @@ static DWORD get_milliseconds(const struct timespec *abstime) return (DWORD)ms; } - -/* - Old (pre-vista) implementation using events -*/ - -static int legacy_cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr) -{ - cond->waiting= 0; - InitializeCriticalSection(&cond->lock_waiting); - - cond->events[SIGNAL]= CreateEvent(NULL, /* no security */ - FALSE, /* auto-reset event */ - FALSE, /* non-signaled initially */ - NULL); /* unnamed */ - - /* Create a manual-reset event. */ - cond->events[BROADCAST]= CreateEvent(NULL, /* no security */ - TRUE, /* manual-reset */ - FALSE, /* non-signaled initially */ - NULL); /* unnamed */ - - - cond->broadcast_block_event= CreateEvent(NULL, /* no security */ - TRUE, /* manual-reset */ - TRUE, /* signaled initially */ - NULL); /* unnamed */ - - if( cond->events[SIGNAL] == NULL || - cond->events[BROADCAST] == NULL || - cond->broadcast_block_event == NULL ) - return ENOMEM; - return 0; -} - - -static int legacy_cond_destroy(pthread_cond_t *cond) -{ - DeleteCriticalSection(&cond->lock_waiting); - - if (CloseHandle(cond->events[SIGNAL]) == 0 || - CloseHandle(cond->events[BROADCAST]) == 0 || - CloseHandle(cond->broadcast_block_event) == 0) - return EINVAL; - return 0; -} - - -static int legacy_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex, - struct timespec *abstime) -{ - int result; - DWORD timeout; - - timeout= get_milliseconds(abstime); - /* - Block access if previous broadcast hasn't finished. - This is just for safety and should normally not - affect the total time spent in this function. - */ - WaitForSingleObject(cond->broadcast_block_event, INFINITE); - - EnterCriticalSection(&cond->lock_waiting); - cond->waiting++; - LeaveCriticalSection(&cond->lock_waiting); - - LeaveCriticalSection(mutex); - result= WaitForMultipleObjects(2, cond->events, FALSE, timeout); - - EnterCriticalSection(&cond->lock_waiting); - cond->waiting--; - - if (cond->waiting == 0) - { - /* - We're the last waiter to be notified or to stop waiting, so - reset the manual event. - */ - /* Close broadcast gate */ - ResetEvent(cond->events[BROADCAST]); - /* Open block gate */ - SetEvent(cond->broadcast_block_event); - } - LeaveCriticalSection(&cond->lock_waiting); - - EnterCriticalSection(mutex); - - return result == WAIT_TIMEOUT ? ETIMEDOUT : 0; -} - -static int legacy_cond_signal(pthread_cond_t *cond) -{ - EnterCriticalSection(&cond->lock_waiting); - - if(cond->waiting > 0) - SetEvent(cond->events[SIGNAL]); - - LeaveCriticalSection(&cond->lock_waiting); - - return 0; -} - - -static int legacy_cond_broadcast(pthread_cond_t *cond) -{ - EnterCriticalSection(&cond->lock_waiting); - /* - The mutex protect us from broadcasting if - there isn't any thread waiting to open the - block gate after this call has closed it. - */ - if(cond->waiting > 0) - { - /* Close block gate */ - ResetEvent(cond->broadcast_block_event); - /* Open broadcast gate */ - SetEvent(cond->events[BROADCAST]); - } - - LeaveCriticalSection(&cond->lock_waiting); - - return 0; -} - - -/* - Posix API functions. Just choose between native and legacy implementation. -*/ - int pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr) { - /* - Once initialization is used here rather than in my_init(), to - 1) avoid my_init() pitfalls- undefined order in which initialization should - run - 2) be potentially useful C++ (in static constructors that run before main()) - 3) just to simplify the API. - Also, the overhead of my_pthread_once is very small. - */ - static my_pthread_once_t once_control= MY_PTHREAD_ONCE_INIT; - my_pthread_once(&once_control, check_native_cond_availability); - - if (have_native_conditions) - { - my_InitializeConditionVariable(&cond->native_cond); - return 0; - } - else - return legacy_cond_init(cond, attr); + InitializeConditionVariable(cond); + return 0; } int pthread_cond_destroy(pthread_cond_t *cond) { - if (have_native_conditions) - return 0; /* no destroy function */ - else - return legacy_cond_destroy(cond); + return 0; } int pthread_cond_broadcast(pthread_cond_t *cond) { - if (have_native_conditions) - { - my_WakeAllConditionVariable(&cond->native_cond); - return 0; - } - else - return legacy_cond_broadcast(cond); + WakeAllConditionVariable(cond); + return 0; } int pthread_cond_signal(pthread_cond_t *cond) { - if (have_native_conditions) - { - my_WakeConditionVariable(&cond->native_cond); - return 0; - } - else - return legacy_cond_signal(cond); + WakeConditionVariable(cond); + return 0; } int pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex, const struct timespec *abstime) { - if (have_native_conditions) - { - DWORD timeout= get_milliseconds(abstime); - if (!my_SleepConditionVariableCS(&cond->native_cond, mutex, timeout)) - return ETIMEDOUT; - return 0; - } - else - return legacy_cond_timedwait(cond, mutex, abstime); + DWORD timeout= get_milliseconds(abstime); + if (!SleepConditionVariableCS(cond, mutex, timeout)) + return ETIMEDOUT; + return 0; } diff --git a/mysys/my_winthread.c b/mysys/my_winthread.c index 81fd0e7277c..31385fad360 100644 --- a/mysys/my_winthread.c +++ b/mysys/my_winthread.c @@ -149,45 +149,22 @@ int pthread_cancel(pthread_t thread) return -1; } + + /* - One time initialization. For simplicity, we assume initializer thread - does not exit within init_routine(). + One time initialization. */ -int my_pthread_once(my_pthread_once_t *once_control, - void (*init_routine)(void)) + +static BOOL CALLBACK init_once_callback(my_pthread_once_t *once_control, PVOID param, PVOID *context) { - LONG state; + typedef void(*void_f)(void); + ((void_f)param)(); + return TRUE; +} - /* - Do "dirty" read to find out if initialization is already done, to - save an interlocked operation in common case. Memory barriers are ensured by - Visual C++ volatile implementation. - */ - if (*once_control == MY_PTHREAD_ONCE_DONE) - return 0; - - state= InterlockedCompareExchange(once_control, MY_PTHREAD_ONCE_INPROGRESS, - MY_PTHREAD_ONCE_INIT); - - switch(state) - { - case MY_PTHREAD_ONCE_INIT: - /* This is initializer thread */ - (*init_routine)(); - *once_control= MY_PTHREAD_ONCE_DONE; - break; - - case MY_PTHREAD_ONCE_INPROGRESS: - /* init_routine in progress. Wait for its completion */ - while(*once_control == MY_PTHREAD_ONCE_INPROGRESS) - { - Sleep(1); - } - break; - case MY_PTHREAD_ONCE_DONE: - /* Nothing to do */ - break; - } +int my_pthread_once(my_pthread_once_t *once_control, void (*func)(void)) +{ + InitOnceExecuteOnce(once_control, init_once_callback, func, NULL); return 0; } #endif diff --git a/mysys/my_write.c b/mysys/my_write.c index a7985997036..43735c18f0a 100644 --- a/mysys/my_write.c +++ b/mysys/my_write.c @@ -1,4 +1,5 @@ -/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. + Copyright (c) 2011, 2016, MariaDB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/mysys/testhash.c b/mysys/testhash.c index 3359b5dce29..96b106bec14 100644 --- a/mysys/testhash.c +++ b/mysys/testhash.c @@ -169,7 +169,9 @@ static int do_test() for (j=0 ; j < 1000 ; j++) if (key1[j] > 1) break; - if (key1[j] > 1) + // j will be 1000 only if we have no keys in the hash. This only happens + // when the parameter recant is set to 0 via command line argument. + if (j < 1000 && key1[j] > 1) { HASH_SEARCH_STATE state; printf("- Testing identical read\n"); diff --git a/mysys/thr_lock.c b/mysys/thr_lock.c index da653b12314..e8c4ed9c614 100644 --- a/mysys/thr_lock.c +++ b/mysys/thr_lock.c @@ -465,9 +465,10 @@ void thr_lock_delete(THR_LOCK *lock) } -void thr_lock_info_init(THR_LOCK_INFO *info) +void thr_lock_info_init(THR_LOCK_INFO *info, struct st_my_thread_var *tmp) { - struct st_my_thread_var *tmp= my_thread_var; + if (tmp) + tmp= my_thread_var; info->thread= tmp->pthread_self; info->thread_id= tmp->id; } @@ -1816,7 +1817,7 @@ static void *test_thread(void *arg) printf("Thread %s (%d) started\n",my_thread_name(),param); fflush(stdout); - thr_lock_info_init(&lock_info); + thr_lock_info_init(&lock_info, 0); for (i=0; i < lock_counts[param] ; i++) thr_lock_data_init(locks+tests[param][i].lock_nr,data+i,NULL); for (j=1 ; j < 10 ; j++) /* try locking 10 times */ diff --git a/mysys/tree.c b/mysys/tree.c index a9fc542faf6..ab810c64c67 100644 --- a/mysys/tree.c +++ b/mysys/tree.c @@ -1,4 +1,5 @@ -/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. + Copyright (c) 2010, 2016, MariaDB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/pcre/AUTHORS b/pcre/AUTHORS index d33723f198a..342417a8a19 100644 --- a/pcre/AUTHORS +++ b/pcre/AUTHORS @@ -8,7 +8,7 @@ Email domain: cam.ac.uk University of Cambridge Computing Service, Cambridge, England. -Copyright (c) 1997-2015 University of Cambridge +Copyright (c) 1997-2016 University of Cambridge All rights reserved @@ -19,7 +19,7 @@ Written by: Zoltan Herczeg Email local part: hzmester Emain domain: freemail.hu -Copyright(c) 2010-2015 Zoltan Herczeg +Copyright(c) 2010-2016 Zoltan Herczeg All rights reserved. @@ -30,7 +30,7 @@ Written by: Zoltan Herczeg Email local part: hzmester Emain domain: freemail.hu -Copyright(c) 2009-2015 Zoltan Herczeg +Copyright(c) 2009-2016 Zoltan Herczeg All rights reserved. diff --git a/pcre/CMakeLists.txt b/pcre/CMakeLists.txt index a4faef6f47a..91e2e781fc2 100644 --- a/pcre/CMakeLists.txt +++ b/pcre/CMakeLists.txt @@ -65,6 +65,7 @@ # so it has been removed. # 2013-10-08 PH got rid of the "source" command, which is a bash-ism (use ".") # 2013-11-05 PH added support for PARENS_NEST_LIMIT +# 2016-03-01 PH applied Chris Wilson's patch for MSVC static build PROJECT(PCRE C CXX) diff --git a/pcre/ChangeLog b/pcre/ChangeLog index 5e5bf188cea..a34f845f8a1 100644 --- a/pcre/ChangeLog +++ b/pcre/ChangeLog @@ -4,12 +4,104 @@ ChangeLog for PCRE Note that the PCRE 8.xx series (PCRE1) is now in a bugfix-only state. All development is happening in the PCRE2 10.xx series. +Version 8.39 14-June-2016 +------------------------- + +1. If PCRE_AUTO_CALLOUT was set on a pattern that had a (?# comment between + an item and its qualifier (for example, A(?#comment)?B) pcre_compile() + misbehaved. This bug was found by the LLVM fuzzer. + +2. Similar to the above, if an isolated \E was present between an item and its + qualifier when PCRE_AUTO_CALLOUT was set, pcre_compile() misbehaved. This + bug was found by the LLVM fuzzer. + +3. Further to 8.38/46, negated classes such as [^[:^ascii:]\d] were also not + working correctly in UCP mode. + +4. The POSIX wrapper function regexec() crashed if the option REG_STARTEND + was set when the pmatch argument was NULL. It now returns REG_INVARG. + +5. Allow for up to 32-bit numbers in the ordin() function in pcregrep. + +6. An empty \Q\E sequence between an item and its qualifier caused + pcre_compile() to misbehave when auto callouts were enabled. This bug was + found by the LLVM fuzzer. + +7. If a pattern that was compiled with PCRE_EXTENDED started with white + space or a #-type comment that was followed by (?-x), which turns off + PCRE_EXTENDED, and there was no subsequent (?x) to turn it on again, + pcre_compile() assumed that (?-x) applied to the whole pattern and + consequently mis-compiled it. This bug was found by the LLVM fuzzer. + +8. A call of pcre_copy_named_substring() for a named substring whose number + was greater than the space in the ovector could cause a crash. + +9. Yet another buffer overflow bug involved duplicate named groups with a + group that reset capture numbers (compare 8.38/7 below). Once again, I have + just allowed for more memory, even if not needed. (A proper fix is + implemented in PCRE2, but it involves a lot of refactoring.) + +10. pcre_get_substring_list() crashed if the use of \K in a match caused the + start of the match to be earlier than the end. + +11. Migrating appropriate PCRE2 JIT improvements to PCRE. + +12. A pattern such as /(?<=((?C)0))/, which has a callout inside a lookbehind + assertion, caused pcretest to generate incorrect output, and also to read + uninitialized memory (detected by ASAN or valgrind). + +13. A pattern that included (*ACCEPT) in the middle of a sufficiently deeply + nested set of parentheses of sufficient size caused an overflow of the + compiling workspace (which was diagnosed, but of course is not desirable). + +14. And yet another buffer overflow bug involving duplicate named groups, this + time nested, with a nested back reference. Yet again, I have just allowed + for more memory, because anything more needs all the refactoring that has + been done for PCRE2. An example pattern that provoked this bug is: + /((?J)(?'R'(?'R'(?'R'(?'R'(?'R'(?|(\k'R'))))))))/ and the bug was + registered as CVE-2016-1283. + +15. pcretest went into a loop if global matching was requested with an ovector + size less than 2. It now gives an error message. This bug was found by + afl-fuzz. + +16. An invalid pattern fragment such as (?(?C)0 was not diagnosing an error + ("assertion expected") when (?(?C) was not followed by an opening + parenthesis. + +17. Fixed typo ("&&" for "&") in pcre_study(). Fortunately, this could not + actually affect anything, by sheer luck. + +18. Applied Chris Wilson's patch (Bugzilla #1681) to CMakeLists.txt for MSVC + static compilation. + +19. Modified the RunTest script to incorporate a valgrind suppressions file so + that certain errors, provoked by the SSE2 instruction set when JIT is used, + are ignored. + +20. A racing condition is fixed in JIT reported by Mozilla. + +21. Minor code refactor to avoid "array subscript is below array bounds" + compiler warning. + +22. Minor code refactor to avoid "left shift of negative number" warning. + +23. Fix typo causing compile error when 16- or 32-bit JIT is compiled without + UCP support. + +24. Refactor to avoid compiler warnings in pcrecpp.cc. + +25. Refactor to fix a typo in pcre_jit_test.c + +26. Patch to support compiling pcrecpp.cc with Intel compiler. + + Version 8.38 23-November-2015 ----------------------------- 1. If a group that contained a recursive back reference also contained a forward reference subroutine call followed by a non-forward-reference - subroutine call, for example /.((?2)(?R)\1)()/, pcre2_compile() failed to + subroutine call, for example /.((?2)(?R)\1)()/, pcre_compile() failed to compile correct code, leading to undefined behaviour or an internally detected error. This bug was discovered by the LLVM fuzzer. diff --git a/pcre/LICENCE b/pcre/LICENCE index 9f6f98e477f..dd977af971b 100644 --- a/pcre/LICENCE +++ b/pcre/LICENCE @@ -25,7 +25,7 @@ Email domain: cam.ac.uk University of Cambridge Computing Service, Cambridge, England. -Copyright (c) 1997-2015 University of Cambridge +Copyright (c) 1997-2016 University of Cambridge All rights reserved. @@ -36,7 +36,7 @@ Written by: Zoltan Herczeg Email local part: hzmester Emain domain: freemail.hu -Copyright(c) 2010-2015 Zoltan Herczeg +Copyright(c) 2010-2016 Zoltan Herczeg All rights reserved. @@ -47,7 +47,7 @@ Written by: Zoltan Herczeg Email local part: hzmester Emain domain: freemail.hu -Copyright(c) 2009-2015 Zoltan Herczeg +Copyright(c) 2009-2016 Zoltan Herczeg All rights reserved. diff --git a/pcre/NEWS b/pcre/NEWS index 7e42dcb3603..0ca1bab2a4c 100644 --- a/pcre/NEWS +++ b/pcre/NEWS @@ -1,6 +1,15 @@ News about PCRE releases ------------------------ +Release 8.39 14-June-2016 +------------------------- + +Some appropriate PCRE2 JIT improvements have been retro-fitted to PCRE1. Apart +from that, this is another bug-fix release. Note that this library (now called +PCRE1) is now being maintained for bug fixes only. New projects are advised to +use the new PCRE2 libraries. + + Release 8.38 23-November-2015 ----------------------------- diff --git a/pcre/RunGrepTest b/pcre/RunGrepTest index a6e93d34892..721ec5184ab 100755 --- a/pcre/RunGrepTest +++ b/pcre/RunGrepTest @@ -67,6 +67,15 @@ fi ./pcretest -C utf >/dev/null utf8=$? +# We need valgrind suppressions when JIT is in use. (This isn't perfect because +# some tests are run with -no-jit, but as PCRE1 is in maintenance only, I have +# not bothered about that.) + +./pcretest -C jit >/dev/null +if [ $? -eq 1 -a "$valgrind" != "" ] ; then + valgrind="$valgrind --suppressions=./testdata/valgrind-jit.supp" +fi + echo "Testing pcregrep main features" echo "---------------------------- Test 1 ------------------------------" >testtrygrep diff --git a/pcre/RunTest b/pcre/RunTest index 67cfbf07cf9..357a739b75f 100755 --- a/pcre/RunTest +++ b/pcre/RunTest @@ -178,6 +178,7 @@ nojit= sim= skip= valgrind= +vjs= # This is in case the caller has set aliases (as I do - PH) unset cp ls mv rm @@ -357,6 +358,9 @@ $sim ./pcretest -C jit >/dev/null jit=$? if [ $jit -ne 0 -a "$nojit" != "yes" ] ; then jitopt=-s+ + if [ "$valgrind" != "" ] ; then + vjs="--suppressions=$testdata/valgrind-jit.supp" + fi fi # If no specific tests were requested, select all. Those that are not @@ -423,7 +427,7 @@ for bmode in "$test8" "$test16" "$test32"; do if [ $do1 = yes ] ; then echo $title1 for opt in "" "-s" $jitopt; do - $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput1 testtry + $sim $valgrind ${opt:+$vjs} ./pcretest -q $bmode $opt $testdata/testinput1 testtry if [ $? = 0 ] ; then $cf $testdata/testoutput1 testtry if [ $? != 0 ] ; then exit 1; fi @@ -441,7 +445,7 @@ fi if [ $do2 = yes ] ; then echo $title2 "(not UTF-$bits)" for opt in "" "-s" $jitopt; do - $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput2 testtry + $sim $valgrind ${opt:+$vjs} ./pcretest -q $bmode $opt $testdata/testinput2 testtry if [ $? = 0 ] ; then $cf $testdata/testoutput2 testtry if [ $? != 0 ] ; then exit 1; fi @@ -504,7 +508,7 @@ if [ $do3 = yes ] ; then if [ "$locale" != "" ] ; then echo $title3 "(using '$locale' locale)" for opt in "" "-s" $jitopt; do - $sim $valgrind ./pcretest -q $bmode $opt $infile testtry + $sim $valgrind ${opt:+$vjs} ./pcretest -q $bmode $opt $infile testtry if [ $? = 0 ] ; then if $cf $outfile testtry >teststdout || \ $cf $outfile2 testtry >teststdout || \ @@ -540,7 +544,7 @@ if [ $do4 = yes ] ; then echo " Skipped because UTF-$bits support is not available" else for opt in "" "-s" $jitopt; do - $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput4 testtry + $sim $valgrind ${opt:+$vjs} ./pcretest -q $bmode $opt $testdata/testinput4 testtry if [ $? = 0 ] ; then $cf $testdata/testoutput4 testtry if [ $? != 0 ] ; then exit 1; fi @@ -560,7 +564,7 @@ if [ $do5 = yes ] ; then echo " Skipped because UTF-$bits support is not available" else for opt in "" "-s" $jitopt; do - $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput5 testtry + $sim $valgrind ${opt:+$vjs} ./pcretest -q $bmode $opt $testdata/testinput5 testtry if [ $? = 0 ] ; then $cf $testdata/testoutput5 testtry if [ $? != 0 ] ; then exit 1; fi @@ -580,7 +584,7 @@ if [ $do6 = yes ] ; then echo " Skipped because Unicode property support is not available" else for opt in "" "-s" $jitopt; do - $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput6 testtry + $sim $valgrind ${opt:+$vjs} ./pcretest -q $bmode $opt $testdata/testinput6 testtry if [ $? = 0 ] ; then $cf $testdata/testoutput6 testtry if [ $? != 0 ] ; then exit 1; fi @@ -602,7 +606,7 @@ if [ $do7 = yes ] ; then echo " Skipped because Unicode property support is not available" else for opt in "" "-s" $jitopt; do - $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput7 testtry + $sim $valgrind ${opt:+$vjs} ./pcretest -q $bmode $opt $testdata/testinput7 testtry if [ $? = 0 ] ; then $cf $testdata/testoutput7 testtry if [ $? != 0 ] ; then exit 1; fi @@ -698,7 +702,7 @@ if [ $do12 = yes ] ; then if [ $jit -eq 0 -o "$nojit" = "yes" ] ; then echo " Skipped because JIT is not available or not usable" else - $sim $valgrind ./pcretest -q $bmode $testdata/testinput12 testtry + $sim $valgrind $vjs ./pcretest -q $bmode $testdata/testinput12 testtry if [ $? = 0 ] ; then $cf $testdata/testoutput12 testtry if [ $? != 0 ] ; then exit 1; fi @@ -735,7 +739,7 @@ if [ "$do14" = yes ] ; then cp -f $testdata/saved16 testsaved16 cp -f $testdata/saved32 testsaved32 for opt in "" "-s" $jitopt; do - $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput14 testtry + $sim $valgrind ${opt:+$vjs} ./pcretest -q $bmode $opt $testdata/testinput14 testtry if [ $? = 0 ] ; then $cf $testdata/testoutput14 testtry if [ $? != 0 ] ; then exit 1; fi @@ -759,7 +763,7 @@ if [ "$do15" = yes ] ; then echo " Skipped because UTF-$bits support is not available" else for opt in "" "-s" $jitopt; do - $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput15 testtry + $sim $valgrind ${opt:+$vjs} ./pcretest -q $bmode $opt $testdata/testinput15 testtry if [ $? = 0 ] ; then $cf $testdata/testoutput15 testtry if [ $? != 0 ] ; then exit 1; fi @@ -783,7 +787,7 @@ if [ $do16 = yes ] ; then echo " Skipped because Unicode property support is not available" else for opt in "" "-s" $jitopt; do - $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput16 testtry + $sim $valgrind ${opt:+$vjs} ./pcretest -q $bmode $opt $testdata/testinput16 testtry if [ $? = 0 ] ; then $cf $testdata/testoutput16 testtry if [ $? != 0 ] ; then exit 1; fi @@ -805,7 +809,7 @@ if [ $do17 = yes ] ; then echo " Skipped when running 8-bit tests" else for opt in "" "-s" $jitopt; do - $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput17 testtry + $sim $valgrind ${opt:+$vjs} ./pcretest -q $bmode $opt $testdata/testinput17 testtry if [ $? = 0 ] ; then $cf $testdata/testoutput17 testtry if [ $? != 0 ] ; then exit 1; fi @@ -829,7 +833,7 @@ if [ $do18 = yes ] ; then echo " Skipped because UTF-$bits support is not available" else for opt in "" "-s" $jitopt; do - $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput18 testtry + $sim $valgrind ${opt:+$vjs} ./pcretest -q $bmode $opt $testdata/testinput18 testtry if [ $? = 0 ] ; then $cf $testdata/testoutput18-$bits testtry if [ $? != 0 ] ; then exit 1; fi @@ -853,7 +857,7 @@ if [ $do19 = yes ] ; then echo " Skipped because Unicode property support is not available" else for opt in "" "-s" $jitopt; do - $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput19 testtry + $sim $valgrind ${opt:+$vjs} ./pcretest -q $bmode $opt $testdata/testinput19 testtry if [ $? = 0 ] ; then $cf $testdata/testoutput19 testtry if [ $? != 0 ] ; then exit 1; fi diff --git a/pcre/configure.ac b/pcre/configure.ac index 9ebe598746c..3cefaf100f9 100644 --- a/pcre/configure.ac +++ b/pcre/configure.ac @@ -9,18 +9,18 @@ dnl The PCRE_PRERELEASE feature is for identifying release candidates. It might dnl be defined as -RC2, for example. For real releases, it should be empty. m4_define(pcre_major, [8]) -m4_define(pcre_minor, [38]) +m4_define(pcre_minor, [39]) m4_define(pcre_prerelease, []) -m4_define(pcre_date, [2015-11-23]) +m4_define(pcre_date, [2016-06-14]) # NOTE: The CMakeLists.txt file searches for the above variables in the first # 50 lines of this file. Please update that if the variables above are moved. # Libtool shared library interface versions (current:revision:age) -m4_define(libpcre_version, [3:6:2]) -m4_define(libpcre16_version, [2:6:2]) -m4_define(libpcre32_version, [0:6:0]) -m4_define(libpcreposix_version, [0:3:0]) +m4_define(libpcre_version, [3:7:2]) +m4_define(libpcre16_version, [2:7:2]) +m4_define(libpcre32_version, [0:7:0]) +m4_define(libpcreposix_version, [0:4:0]) m4_define(libpcrecpp_version, [0:1:0]) AC_PREREQ(2.57) diff --git a/pcre/doc/html/pcreapi.html b/pcre/doc/html/pcreapi.html index b401ecc76df..2d7adf185a6 100644 --- a/pcre/doc/html/pcreapi.html +++ b/pcre/doc/html/pcreapi.html @@ -315,9 +315,8 @@ documentation for details of how to do this. It is a non-standard way of building PCRE, for use in environments that have limited stacks. Because of the greater use of memory management, it runs more slowly. Separate functions are provided so that special-purpose external code can be used for this case. When -used, these functions are always called in a stack-like manner (last obtained, -first freed), and always for memory blocks of the same size. There is a -discussion about PCRE's stack usage in the +used, these functions always allocate memory blocks of the same size. There is +a discussion about PCRE's stack usage in the pcrestack documentation.

@@ -2913,9 +2912,9 @@ Cambridge CB2 3QH, England.


REVISION

-Last updated: 09 February 2014 +Last updated: 18 December 2015
-Copyright © 1997-2014 University of Cambridge. +Copyright © 1997-2015 University of Cambridge.

Return to the PCRE index page. diff --git a/pcre/doc/pcre.txt b/pcre/doc/pcre.txt index 76a47c79eff..f5eb347e18a 100644 --- a/pcre/doc/pcre.txt +++ b/pcre/doc/pcre.txt @@ -1814,84 +1814,83 @@ PCRE API OVERVIEW ments that have limited stacks. Because of the greater use of memory management, it runs more slowly. Separate functions are provided so that special-purpose external code can be used for this case. When - used, these functions are always called in a stack-like manner (last - obtained, first freed), and always for memory blocks of the same size. - There is a discussion about PCRE's stack usage in the pcrestack docu- + used, these functions always allocate memory blocks of the same size. + There is a discussion about PCRE's stack usage in the pcrestack docu- mentation. The global variable pcre_callout initially contains NULL. It can be set - by the caller to a "callout" function, which PCRE will then call at - specified points during a matching operation. Details are given in the + by the caller to a "callout" function, which PCRE will then call at + specified points during a matching operation. Details are given in the pcrecallout documentation. The global variable pcre_stack_guard initially contains NULL. It can be - set by the caller to a function that is called by PCRE whenever it - starts to compile a parenthesized part of a pattern. When parentheses + set by the caller to a function that is called by PCRE whenever it + starts to compile a parenthesized part of a pattern. When parentheses are nested, PCRE uses recursive function calls, which use up the system - stack. This function is provided so that applications with restricted - stacks can force a compilation error if the stack runs out. The func- + stack. This function is provided so that applications with restricted + stacks can force a compilation error if the stack runs out. The func- tion should return zero if all is well, or non-zero to force an error. NEWLINES - PCRE supports five different conventions for indicating line breaks in - strings: a single CR (carriage return) character, a single LF (line- + PCRE supports five different conventions for indicating line breaks in + strings: a single CR (carriage return) character, a single LF (line- feed) character, the two-character sequence CRLF, any of the three pre- - ceding, or any Unicode newline sequence. The Unicode newline sequences - are the three just mentioned, plus the single characters VT (vertical + ceding, or any Unicode newline sequence. The Unicode newline sequences + are the three just mentioned, plus the single characters VT (vertical tab, U+000B), FF (form feed, U+000C), NEL (next line, U+0085), LS (line separator, U+2028), and PS (paragraph separator, U+2029). - Each of the first three conventions is used by at least one operating - system as its standard newline sequence. When PCRE is built, a default - can be specified. The default default is LF, which is the Unix stan- - dard. When PCRE is run, the default can be overridden, either when a + Each of the first three conventions is used by at least one operating + system as its standard newline sequence. When PCRE is built, a default + can be specified. The default default is LF, which is the Unix stan- + dard. When PCRE is run, the default can be overridden, either when a pattern is compiled, or when it is matched. At compile time, the newline convention can be specified by the options - argument of pcre_compile(), or it can be specified by special text at + argument of pcre_compile(), or it can be specified by special text at the start of the pattern itself; this overrides any other settings. See the pcrepattern page for details of the special character sequences. In the PCRE documentation the word "newline" is used to mean "the char- - acter or pair of characters that indicate a line break". The choice of - newline convention affects the handling of the dot, circumflex, and + acter or pair of characters that indicate a line break". The choice of + newline convention affects the handling of the dot, circumflex, and dollar metacharacters, the handling of #-comments in /x mode, and, when - CRLF is a recognized line ending sequence, the match position advance- + CRLF is a recognized line ending sequence, the match position advance- ment for a non-anchored pattern. There is more detail about this in the section on pcre_exec() options below. - The choice of newline convention does not affect the interpretation of - the \n or \r escape sequences, nor does it affect what \R matches, + The choice of newline convention does not affect the interpretation of + the \n or \r escape sequences, nor does it affect what \R matches, which is controlled in a similar way, but by separate options. MULTITHREADING - The PCRE functions can be used in multi-threading applications, with + The PCRE functions can be used in multi-threading applications, with the proviso that the memory management functions pointed to by pcre_malloc, pcre_free, pcre_stack_malloc, and pcre_stack_free, and the - callout and stack-checking functions pointed to by pcre_callout and + callout and stack-checking functions pointed to by pcre_callout and pcre_stack_guard, are shared by all threads. - The compiled form of a regular expression is not altered during match- + The compiled form of a regular expression is not altered during match- ing, so the same compiled pattern can safely be used by several threads at once. - If the just-in-time optimization feature is being used, it needs sepa- - rate memory stack areas for each thread. See the pcrejit documentation + If the just-in-time optimization feature is being used, it needs sepa- + rate memory stack areas for each thread. See the pcrejit documentation for more details. SAVING PRECOMPILED PATTERNS FOR LATER USE The compiled form of a regular expression can be saved and re-used at a - later time, possibly by a different program, and even on a host other - than the one on which it was compiled. Details are given in the - pcreprecompile documentation, which includes a description of the - pcre_pattern_to_host_byte_order() function. However, compiling a regu- - lar expression with one version of PCRE for use with a different ver- + later time, possibly by a different program, and even on a host other + than the one on which it was compiled. Details are given in the + pcreprecompile documentation, which includes a description of the + pcre_pattern_to_host_byte_order() function. However, compiling a regu- + lar expression with one version of PCRE for use with a different ver- sion is not guaranteed to work and may cause crashes. @@ -1899,45 +1898,45 @@ CHECKING BUILD-TIME OPTIONS int pcre_config(int what, void *where); - The function pcre_config() makes it possible for a PCRE client to dis- + The function pcre_config() makes it possible for a PCRE client to dis- cover which optional features have been compiled into the PCRE library. - The pcrebuild documentation has more details about these optional fea- + The pcrebuild documentation has more details about these optional fea- tures. - The first argument for pcre_config() is an integer, specifying which + The first argument for pcre_config() is an integer, specifying which information is required; the second argument is a pointer to a variable - into which the information is placed. The returned value is zero on - success, or the negative error code PCRE_ERROR_BADOPTION if the value - in the first argument is not recognized. The following information is + into which the information is placed. The returned value is zero on + success, or the negative error code PCRE_ERROR_BADOPTION if the value + in the first argument is not recognized. The following information is available: PCRE_CONFIG_UTF8 - The output is an integer that is set to one if UTF-8 support is avail- - able; otherwise it is set to zero. This value should normally be given + The output is an integer that is set to one if UTF-8 support is avail- + able; otherwise it is set to zero. This value should normally be given to the 8-bit version of this function, pcre_config(). If it is given to - the 16-bit or 32-bit version of this function, the result is + the 16-bit or 32-bit version of this function, the result is PCRE_ERROR_BADOPTION. PCRE_CONFIG_UTF16 The output is an integer that is set to one if UTF-16 support is avail- - able; otherwise it is set to zero. This value should normally be given + able; otherwise it is set to zero. This value should normally be given to the 16-bit version of this function, pcre16_config(). If it is given - to the 8-bit or 32-bit version of this function, the result is + to the 8-bit or 32-bit version of this function, the result is PCRE_ERROR_BADOPTION. PCRE_CONFIG_UTF32 The output is an integer that is set to one if UTF-32 support is avail- - able; otherwise it is set to zero. This value should normally be given + able; otherwise it is set to zero. This value should normally be given to the 32-bit version of this function, pcre32_config(). If it is given - to the 8-bit or 16-bit version of this function, the result is + to the 8-bit or 16-bit version of this function, the result is PCRE_ERROR_BADOPTION. PCRE_CONFIG_UNICODE_PROPERTIES - The output is an integer that is set to one if support for Unicode + The output is an integer that is set to one if support for Unicode character properties is available; otherwise it is set to zero. PCRE_CONFIG_JIT @@ -1947,80 +1946,80 @@ CHECKING BUILD-TIME OPTIONS PCRE_CONFIG_JITTARGET - The output is a pointer to a zero-terminated "const char *" string. If + The output is a pointer to a zero-terminated "const char *" string. If JIT support is available, the string contains the name of the architec- - ture for which the JIT compiler is configured, for example "x86 32bit - (little endian + unaligned)". If JIT support is not available, the + ture for which the JIT compiler is configured, for example "x86 32bit + (little endian + unaligned)". If JIT support is not available, the result is NULL. PCRE_CONFIG_NEWLINE - The output is an integer whose value specifies the default character - sequence that is recognized as meaning "newline". The values that are + The output is an integer whose value specifies the default character + sequence that is recognized as meaning "newline". The values that are supported in ASCII/Unicode environments are: 10 for LF, 13 for CR, 3338 - for CRLF, -2 for ANYCRLF, and -1 for ANY. In EBCDIC environments, CR, - ANYCRLF, and ANY yield the same values. However, the value for LF is - normally 21, though some EBCDIC environments use 37. The corresponding - values for CRLF are 3349 and 3365. The default should normally corre- + for CRLF, -2 for ANYCRLF, and -1 for ANY. In EBCDIC environments, CR, + ANYCRLF, and ANY yield the same values. However, the value for LF is + normally 21, though some EBCDIC environments use 37. The corresponding + values for CRLF are 3349 and 3365. The default should normally corre- spond to the standard sequence for your operating system. PCRE_CONFIG_BSR The output is an integer whose value indicates what character sequences - the \R escape sequence matches by default. A value of 0 means that \R - matches any Unicode line ending sequence; a value of 1 means that \R + the \R escape sequence matches by default. A value of 0 means that \R + matches any Unicode line ending sequence; a value of 1 means that \R matches only CR, LF, or CRLF. The default can be overridden when a pat- tern is compiled or matched. PCRE_CONFIG_LINK_SIZE - The output is an integer that contains the number of bytes used for + The output is an integer that contains the number of bytes used for internal linkage in compiled regular expressions. For the 8-bit library, the value can be 2, 3, or 4. For the 16-bit library, the value - is either 2 or 4 and is still a number of bytes. For the 32-bit + is either 2 or 4 and is still a number of bytes. For the 32-bit library, the value is either 2 or 4 and is still a number of bytes. The default value of 2 is sufficient for all but the most massive patterns, - since it allows the compiled pattern to be up to 64K in size. Larger - values allow larger regular expressions to be compiled, at the expense + since it allows the compiled pattern to be up to 64K in size. Larger + values allow larger regular expressions to be compiled, at the expense of slower matching. PCRE_CONFIG_POSIX_MALLOC_THRESHOLD - The output is an integer that contains the threshold above which the - POSIX interface uses malloc() for output vectors. Further details are + The output is an integer that contains the threshold above which the + POSIX interface uses malloc() for output vectors. Further details are given in the pcreposix documentation. PCRE_CONFIG_PARENS_LIMIT The output is a long integer that gives the maximum depth of nesting of - parentheses (of any kind) in a pattern. This limit is imposed to cap + parentheses (of any kind) in a pattern. This limit is imposed to cap the amount of system stack used when a pattern is compiled. It is spec- - ified when PCRE is built; the default is 250. This limit does not take + ified when PCRE is built; the default is 250. This limit does not take into account the stack that may already be used by the calling applica- - tion. For finer control over compilation stack usage, you can set a + tion. For finer control over compilation stack usage, you can set a pointer to an external checking function in pcre_stack_guard. PCRE_CONFIG_MATCH_LIMIT - The output is a long integer that gives the default limit for the num- - ber of internal matching function calls in a pcre_exec() execution. + The output is a long integer that gives the default limit for the num- + ber of internal matching function calls in a pcre_exec() execution. Further details are given with pcre_exec() below. PCRE_CONFIG_MATCH_LIMIT_RECURSION The output is a long integer that gives the default limit for the depth - of recursion when calling the internal matching function in a - pcre_exec() execution. Further details are given with pcre_exec() + of recursion when calling the internal matching function in a + pcre_exec() execution. Further details are given with pcre_exec() below. PCRE_CONFIG_STACKRECURSE - The output is an integer that is set to one if internal recursion when + The output is an integer that is set to one if internal recursion when running pcre_exec() is implemented by recursive function calls that use - the stack to remember their state. This is the usual way that PCRE is + the stack to remember their state. This is the usual way that PCRE is compiled. The output is zero if PCRE was compiled to use blocks of data - on the heap instead of recursive function calls. In this case, - pcre_stack_malloc and pcre_stack_free are called to manage memory + on the heap instead of recursive function calls. In this case, + pcre_stack_malloc and pcre_stack_free are called to manage memory blocks on the heap, thus avoiding the use of the stack. @@ -2037,67 +2036,67 @@ COMPILING A PATTERN Either of the functions pcre_compile() or pcre_compile2() can be called to compile a pattern into an internal form. The only difference between - the two interfaces is that pcre_compile2() has an additional argument, - errorcodeptr, via which a numerical error code can be returned. To - avoid too much repetition, we refer just to pcre_compile() below, but + the two interfaces is that pcre_compile2() has an additional argument, + errorcodeptr, via which a numerical error code can be returned. To + avoid too much repetition, we refer just to pcre_compile() below, but the information applies equally to pcre_compile2(). The pattern is a C string terminated by a binary zero, and is passed in - the pattern argument. A pointer to a single block of memory that is - obtained via pcre_malloc is returned. This contains the compiled code + the pattern argument. A pointer to a single block of memory that is + obtained via pcre_malloc is returned. This contains the compiled code and related data. The pcre type is defined for the returned block; this is a typedef for a structure whose contents are not externally defined. It is up to the caller to free the memory (via pcre_free) when it is no longer required. - Although the compiled code of a PCRE regex is relocatable, that is, it + Although the compiled code of a PCRE regex is relocatable, that is, it does not depend on memory location, the complete pcre data block is not - fully relocatable, because it may contain a copy of the tableptr argu- + fully relocatable, because it may contain a copy of the tableptr argu- ment, which is an address (see below). The options argument contains various bit settings that affect the com- - pilation. It should be zero if no options are required. The available - options are described below. Some of them (in particular, those that - are compatible with Perl, but some others as well) can also be set and - unset from within the pattern (see the detailed description in the - pcrepattern documentation). For those options that can be different in - different parts of the pattern, the contents of the options argument + pilation. It should be zero if no options are required. The available + options are described below. Some of them (in particular, those that + are compatible with Perl, but some others as well) can also be set and + unset from within the pattern (see the detailed description in the + pcrepattern documentation). For those options that can be different in + different parts of the pattern, the contents of the options argument specifies their settings at the start of compilation and execution. The - PCRE_ANCHORED, PCRE_BSR_xxx, PCRE_NEWLINE_xxx, PCRE_NO_UTF8_CHECK, and - PCRE_NO_START_OPTIMIZE options can be set at the time of matching as + PCRE_ANCHORED, PCRE_BSR_xxx, PCRE_NEWLINE_xxx, PCRE_NO_UTF8_CHECK, and + PCRE_NO_START_OPTIMIZE options can be set at the time of matching as well as at compile time. If errptr is NULL, pcre_compile() returns NULL immediately. Otherwise, - if compilation of a pattern fails, pcre_compile() returns NULL, and + if compilation of a pattern fails, pcre_compile() returns NULL, and sets the variable pointed to by errptr to point to a textual error mes- sage. This is a static string that is part of the library. You must not - try to free it. Normally, the offset from the start of the pattern to + try to free it. Normally, the offset from the start of the pattern to the data unit that was being processed when the error was discovered is - placed in the variable pointed to by erroffset, which must not be NULL - (if it is, an immediate error is given). However, for an invalid UTF-8 - or UTF-16 string, the offset is that of the first data unit of the + placed in the variable pointed to by erroffset, which must not be NULL + (if it is, an immediate error is given). However, for an invalid UTF-8 + or UTF-16 string, the offset is that of the first data unit of the failing character. - Some errors are not detected until the whole pattern has been scanned; - in these cases, the offset passed back is the length of the pattern. - Note that the offset is in data units, not characters, even in a UTF + Some errors are not detected until the whole pattern has been scanned; + in these cases, the offset passed back is the length of the pattern. + Note that the offset is in data units, not characters, even in a UTF mode. It may sometimes point into the middle of a UTF-8 or UTF-16 char- acter. - If pcre_compile2() is used instead of pcre_compile(), and the error- - codeptr argument is not NULL, a non-zero error code number is returned - via this argument in the event of an error. This is in addition to the + If pcre_compile2() is used instead of pcre_compile(), and the error- + codeptr argument is not NULL, a non-zero error code number is returned + via this argument in the event of an error. This is in addition to the textual error message. Error codes and messages are listed below. - If the final argument, tableptr, is NULL, PCRE uses a default set of - character tables that are built when PCRE is compiled, using the - default C locale. Otherwise, tableptr must be an address that is the - result of a call to pcre_maketables(). This value is stored with the - compiled pattern, and used again by pcre_exec() and pcre_dfa_exec() - when the pattern is matched. For more discussion, see the section on + If the final argument, tableptr, is NULL, PCRE uses a default set of + character tables that are built when PCRE is compiled, using the + default C locale. Otherwise, tableptr must be an address that is the + result of a call to pcre_maketables(). This value is stored with the + compiled pattern, and used again by pcre_exec() and pcre_dfa_exec() + when the pattern is matched. For more discussion, see the section on locale support below. - This code fragment shows a typical straightforward call to pcre_com- + This code fragment shows a typical straightforward call to pcre_com- pile(): pcre *re; @@ -2110,181 +2109,181 @@ COMPILING A PATTERN &erroffset, /* for error offset */ NULL); /* use default character tables */ - The following names for option bits are defined in the pcre.h header + The following names for option bits are defined in the pcre.h header file: PCRE_ANCHORED If this bit is set, the pattern is forced to be "anchored", that is, it - is constrained to match only at the first matching point in the string - that is being searched (the "subject string"). This effect can also be - achieved by appropriate constructs in the pattern itself, which is the + is constrained to match only at the first matching point in the string + that is being searched (the "subject string"). This effect can also be + achieved by appropriate constructs in the pattern itself, which is the only way to do it in Perl. PCRE_AUTO_CALLOUT If this bit is set, pcre_compile() automatically inserts callout items, - all with number 255, before each pattern item. For discussion of the + all with number 255, before each pattern item. For discussion of the callout facility, see the pcrecallout documentation. PCRE_BSR_ANYCRLF PCRE_BSR_UNICODE These options (which are mutually exclusive) control what the \R escape - sequence matches. The choice is either to match only CR, LF, or CRLF, + sequence matches. The choice is either to match only CR, LF, or CRLF, or to match any Unicode newline sequence. The default is specified when PCRE is built. It can be overridden from within the pattern, or by set- ting an option when a compiled pattern is matched. PCRE_CASELESS - If this bit is set, letters in the pattern match both upper and lower - case letters. It is equivalent to Perl's /i option, and it can be - changed within a pattern by a (?i) option setting. In UTF-8 mode, PCRE - always understands the concept of case for characters whose values are - less than 128, so caseless matching is always possible. For characters - with higher values, the concept of case is supported if PCRE is com- - piled with Unicode property support, but not otherwise. If you want to - use caseless matching for characters 128 and above, you must ensure - that PCRE is compiled with Unicode property support as well as with + If this bit is set, letters in the pattern match both upper and lower + case letters. It is equivalent to Perl's /i option, and it can be + changed within a pattern by a (?i) option setting. In UTF-8 mode, PCRE + always understands the concept of case for characters whose values are + less than 128, so caseless matching is always possible. For characters + with higher values, the concept of case is supported if PCRE is com- + piled with Unicode property support, but not otherwise. If you want to + use caseless matching for characters 128 and above, you must ensure + that PCRE is compiled with Unicode property support as well as with UTF-8 support. PCRE_DOLLAR_ENDONLY - If this bit is set, a dollar metacharacter in the pattern matches only - at the end of the subject string. Without this option, a dollar also - matches immediately before a newline at the end of the string (but not - before any other newlines). The PCRE_DOLLAR_ENDONLY option is ignored - if PCRE_MULTILINE is set. There is no equivalent to this option in + If this bit is set, a dollar metacharacter in the pattern matches only + at the end of the subject string. Without this option, a dollar also + matches immediately before a newline at the end of the string (but not + before any other newlines). The PCRE_DOLLAR_ENDONLY option is ignored + if PCRE_MULTILINE is set. There is no equivalent to this option in Perl, and no way to set it within a pattern. PCRE_DOTALL - If this bit is set, a dot metacharacter in the pattern matches a char- + If this bit is set, a dot metacharacter in the pattern matches a char- acter of any value, including one that indicates a newline. However, it - only ever matches one character, even if newlines are coded as CRLF. - Without this option, a dot does not match when the current position is + only ever matches one character, even if newlines are coded as CRLF. + Without this option, a dot does not match when the current position is at a newline. This option is equivalent to Perl's /s option, and it can - be changed within a pattern by a (?s) option setting. A negative class + be changed within a pattern by a (?s) option setting. A negative class such as [^a] always matches newline characters, independent of the set- ting of this option. PCRE_DUPNAMES - If this bit is set, names used to identify capturing subpatterns need + If this bit is set, names used to identify capturing subpatterns need not be unique. This can be helpful for certain types of pattern when it - is known that only one instance of the named subpattern can ever be - matched. There are more details of named subpatterns below; see also + is known that only one instance of the named subpattern can ever be + matched. There are more details of named subpatterns below; see also the pcrepattern documentation. PCRE_EXTENDED - If this bit is set, most white space characters in the pattern are - totally ignored except when escaped or inside a character class. How- - ever, white space is not allowed within sequences such as (?> that - introduce various parenthesized subpatterns, nor within a numerical - quantifier such as {1,3}. However, ignorable white space is permitted + If this bit is set, most white space characters in the pattern are + totally ignored except when escaped or inside a character class. How- + ever, white space is not allowed within sequences such as (?> that + introduce various parenthesized subpatterns, nor within a numerical + quantifier such as {1,3}. However, ignorable white space is permitted between an item and a following quantifier and between a quantifier and a following + that indicates possessiveness. White space did not used to include the VT character (code 11), because Perl did not treat this character as white space. However, Perl changed - at release 5.18, so PCRE followed at release 8.34, and VT is now + at release 5.18, so PCRE followed at release 8.34, and VT is now treated as white space. - PCRE_EXTENDED also causes characters between an unescaped # outside a - character class and the next newline, inclusive, to be ignored. - PCRE_EXTENDED is equivalent to Perl's /x option, and it can be changed + PCRE_EXTENDED also causes characters between an unescaped # outside a + character class and the next newline, inclusive, to be ignored. + PCRE_EXTENDED is equivalent to Perl's /x option, and it can be changed within a pattern by a (?x) option setting. - Which characters are interpreted as newlines is controlled by the - options passed to pcre_compile() or by a special sequence at the start - of the pattern, as described in the section entitled "Newline conven- + Which characters are interpreted as newlines is controlled by the + options passed to pcre_compile() or by a special sequence at the start + of the pattern, as described in the section entitled "Newline conven- tions" in the pcrepattern documentation. Note that the end of this type - of comment is a literal newline sequence in the pattern; escape + of comment is a literal newline sequence in the pattern; escape sequences that happen to represent a newline do not count. - This option makes it possible to include comments inside complicated - patterns. Note, however, that this applies only to data characters. - White space characters may never appear within special character + This option makes it possible to include comments inside complicated + patterns. Note, however, that this applies only to data characters. + White space characters may never appear within special character sequences in a pattern, for example within the sequence (?( that intro- duces a conditional subpattern. PCRE_EXTRA - This option was invented in order to turn on additional functionality - of PCRE that is incompatible with Perl, but it is currently of very - little use. When set, any backslash in a pattern that is followed by a - letter that has no special meaning causes an error, thus reserving - these combinations for future expansion. By default, as in Perl, a - backslash followed by a letter with no special meaning is treated as a + This option was invented in order to turn on additional functionality + of PCRE that is incompatible with Perl, but it is currently of very + little use. When set, any backslash in a pattern that is followed by a + letter that has no special meaning causes an error, thus reserving + these combinations for future expansion. By default, as in Perl, a + backslash followed by a letter with no special meaning is treated as a literal. (Perl can, however, be persuaded to give an error for this, by - running it with the -w option.) There are at present no other features - controlled by this option. It can also be set by a (?X) option setting + running it with the -w option.) There are at present no other features + controlled by this option. It can also be set by a (?X) option setting within a pattern. PCRE_FIRSTLINE - If this option is set, an unanchored pattern is required to match - before or at the first newline in the subject string, though the + If this option is set, an unanchored pattern is required to match + before or at the first newline in the subject string, though the matched text may continue over the newline. PCRE_JAVASCRIPT_COMPAT If this option is set, PCRE's behaviour is changed in some ways so that - it is compatible with JavaScript rather than Perl. The changes are as + it is compatible with JavaScript rather than Perl. The changes are as follows: - (1) A lone closing square bracket in a pattern causes a compile-time - error, because this is illegal in JavaScript (by default it is treated + (1) A lone closing square bracket in a pattern causes a compile-time + error, because this is illegal in JavaScript (by default it is treated as a data character). Thus, the pattern AB]CD becomes illegal when this option is set. - (2) At run time, a back reference to an unset subpattern group matches - an empty string (by default this causes the current matching alterna- - tive to fail). A pattern such as (\1)(a) succeeds when this option is - set (assuming it can find an "a" in the subject), whereas it fails by + (2) At run time, a back reference to an unset subpattern group matches + an empty string (by default this causes the current matching alterna- + tive to fail). A pattern such as (\1)(a) succeeds when this option is + set (assuming it can find an "a" in the subject), whereas it fails by default, for Perl compatibility. (3) \U matches an upper case "U" character; by default \U causes a com- pile time error (Perl uses \U to upper case subsequent characters). (4) \u matches a lower case "u" character unless it is followed by four - hexadecimal digits, in which case the hexadecimal number defines the - code point to match. By default, \u causes a compile time error (Perl + hexadecimal digits, in which case the hexadecimal number defines the + code point to match. By default, \u causes a compile time error (Perl uses it to upper case the following character). - (5) \x matches a lower case "x" character unless it is followed by two - hexadecimal digits, in which case the hexadecimal number defines the - code point to match. By default, as in Perl, a hexadecimal number is + (5) \x matches a lower case "x" character unless it is followed by two + hexadecimal digits, in which case the hexadecimal number defines the + code point to match. By default, as in Perl, a hexadecimal number is always expected after \x, but it may have zero, one, or two digits (so, for example, \xz matches a binary zero character followed by z). PCRE_MULTILINE - By default, for the purposes of matching "start of line" and "end of + By default, for the purposes of matching "start of line" and "end of line", PCRE treats the subject string as consisting of a single line of - characters, even if it actually contains newlines. The "start of line" + characters, even if it actually contains newlines. The "start of line" metacharacter (^) matches only at the start of the string, and the "end - of line" metacharacter ($) matches only at the end of the string, or - before a terminating newline (except when PCRE_DOLLAR_ENDONLY is set). - Note, however, that unless PCRE_DOTALL is set, the "any character" - metacharacter (.) does not match at a newline. This behaviour (for ^, + of line" metacharacter ($) matches only at the end of the string, or + before a terminating newline (except when PCRE_DOLLAR_ENDONLY is set). + Note, however, that unless PCRE_DOTALL is set, the "any character" + metacharacter (.) does not match at a newline. This behaviour (for ^, $, and dot) is the same as Perl. - When PCRE_MULTILINE it is set, the "start of line" and "end of line" - constructs match immediately following or immediately before internal - newlines in the subject string, respectively, as well as at the very - start and end. This is equivalent to Perl's /m option, and it can be + When PCRE_MULTILINE it is set, the "start of line" and "end of line" + constructs match immediately following or immediately before internal + newlines in the subject string, respectively, as well as at the very + start and end. This is equivalent to Perl's /m option, and it can be changed within a pattern by a (?m) option setting. If there are no new- - lines in a subject string, or no occurrences of ^ or $ in a pattern, + lines in a subject string, or no occurrences of ^ or $ in a pattern, setting PCRE_MULTILINE has no effect. PCRE_NEVER_UTF This option locks out interpretation of the pattern as UTF-8 (or UTF-16 - or UTF-32 in the 16-bit and 32-bit libraries). In particular, it pre- - vents the creator of the pattern from switching to UTF interpretation + or UTF-32 in the 16-bit and 32-bit libraries). In particular, it pre- + vents the creator of the pattern from switching to UTF interpretation by starting the pattern with (*UTF). This may be useful in applications that process patterns from external sources. The combination of PCRE_UTF8 and PCRE_NEVER_UTF also causes an error. @@ -2295,41 +2294,41 @@ COMPILING A PATTERN PCRE_NEWLINE_ANYCRLF PCRE_NEWLINE_ANY - These options override the default newline definition that was chosen - when PCRE was built. Setting the first or the second specifies that a - newline is indicated by a single character (CR or LF, respectively). - Setting PCRE_NEWLINE_CRLF specifies that a newline is indicated by the - two-character CRLF sequence. Setting PCRE_NEWLINE_ANYCRLF specifies + These options override the default newline definition that was chosen + when PCRE was built. Setting the first or the second specifies that a + newline is indicated by a single character (CR or LF, respectively). + Setting PCRE_NEWLINE_CRLF specifies that a newline is indicated by the + two-character CRLF sequence. Setting PCRE_NEWLINE_ANYCRLF specifies that any of the three preceding sequences should be recognized. Setting - PCRE_NEWLINE_ANY specifies that any Unicode newline sequence should be + PCRE_NEWLINE_ANY specifies that any Unicode newline sequence should be recognized. - In an ASCII/Unicode environment, the Unicode newline sequences are the - three just mentioned, plus the single characters VT (vertical tab, + In an ASCII/Unicode environment, the Unicode newline sequences are the + three just mentioned, plus the single characters VT (vertical tab, U+000B), FF (form feed, U+000C), NEL (next line, U+0085), LS (line sep- - arator, U+2028), and PS (paragraph separator, U+2029). For the 8-bit + arator, U+2028), and PS (paragraph separator, U+2029). For the 8-bit library, the last two are recognized only in UTF-8 mode. - When PCRE is compiled to run in an EBCDIC (mainframe) environment, the + When PCRE is compiled to run in an EBCDIC (mainframe) environment, the code for CR is 0x0d, the same as ASCII. However, the character code for - LF is normally 0x15, though in some EBCDIC environments 0x25 is used. - Whichever of these is not LF is made to correspond to Unicode's NEL - character. EBCDIC codes are all less than 256. For more details, see + LF is normally 0x15, though in some EBCDIC environments 0x25 is used. + Whichever of these is not LF is made to correspond to Unicode's NEL + character. EBCDIC codes are all less than 256. For more details, see the pcrebuild documentation. - The newline setting in the options word uses three bits that are + The newline setting in the options word uses three bits that are treated as a number, giving eight possibilities. Currently only six are - used (default plus the five values above). This means that if you set - more than one newline option, the combination may or may not be sensi- + used (default plus the five values above). This means that if you set + more than one newline option, the combination may or may not be sensi- ble. For example, PCRE_NEWLINE_CR with PCRE_NEWLINE_LF is equivalent to - PCRE_NEWLINE_CRLF, but other combinations may yield unused numbers and + PCRE_NEWLINE_CRLF, but other combinations may yield unused numbers and cause an error. - The only time that a line break in a pattern is specially recognized - when compiling is when PCRE_EXTENDED is set. CR and LF are white space - characters, and so are ignored in this mode. Also, an unescaped # out- - side a character class indicates a comment that lasts until after the - next line break sequence. In other circumstances, line break sequences + The only time that a line break in a pattern is specially recognized + when compiling is when PCRE_EXTENDED is set. CR and LF are white space + characters, and so are ignored in this mode. Also, an unescaped # out- + side a character class indicates a comment that lasts until after the + next line break sequence. In other circumstances, line break sequences in patterns are treated as literal data. The newline option that is set at compile time becomes the default that @@ -2338,79 +2337,79 @@ COMPILING A PATTERN PCRE_NO_AUTO_CAPTURE If this option is set, it disables the use of numbered capturing paren- - theses in the pattern. Any opening parenthesis that is not followed by - ? behaves as if it were followed by ?: but named parentheses can still - be used for capturing (and they acquire numbers in the usual way). + theses in the pattern. Any opening parenthesis that is not followed by + ? behaves as if it were followed by ?: but named parentheses can still + be used for capturing (and they acquire numbers in the usual way). There is no equivalent of this option in Perl. PCRE_NO_AUTO_POSSESS - If this option is set, it disables "auto-possessification". This is an - optimization that, for example, turns a+b into a++b in order to avoid - backtracks into a+ that can never be successful. However, if callouts - are in use, auto-possessification means that some of them are never + If this option is set, it disables "auto-possessification". This is an + optimization that, for example, turns a+b into a++b in order to avoid + backtracks into a+ that can never be successful. However, if callouts + are in use, auto-possessification means that some of them are never taken. You can set this option if you want the matching functions to do - a full unoptimized search and run all the callouts, but it is mainly + a full unoptimized search and run all the callouts, but it is mainly provided for testing purposes. PCRE_NO_START_OPTIMIZE - This is an option that acts at matching time; that is, it is really an - option for pcre_exec() or pcre_dfa_exec(). If it is set at compile - time, it is remembered with the compiled pattern and assumed at match- - ing time. This is necessary if you want to use JIT execution, because - the JIT compiler needs to know whether or not this option is set. For + This is an option that acts at matching time; that is, it is really an + option for pcre_exec() or pcre_dfa_exec(). If it is set at compile + time, it is remembered with the compiled pattern and assumed at match- + ing time. This is necessary if you want to use JIT execution, because + the JIT compiler needs to know whether or not this option is set. For details see the discussion of PCRE_NO_START_OPTIMIZE below. PCRE_UCP - This option changes the way PCRE processes \B, \b, \D, \d, \S, \s, \W, - \w, and some of the POSIX character classes. By default, only ASCII - characters are recognized, but if PCRE_UCP is set, Unicode properties - are used instead to classify characters. More details are given in the - section on generic character types in the pcrepattern page. If you set - PCRE_UCP, matching one of the items it affects takes much longer. The - option is available only if PCRE has been compiled with Unicode prop- + This option changes the way PCRE processes \B, \b, \D, \d, \S, \s, \W, + \w, and some of the POSIX character classes. By default, only ASCII + characters are recognized, but if PCRE_UCP is set, Unicode properties + are used instead to classify characters. More details are given in the + section on generic character types in the pcrepattern page. If you set + PCRE_UCP, matching one of the items it affects takes much longer. The + option is available only if PCRE has been compiled with Unicode prop- erty support. PCRE_UNGREEDY - This option inverts the "greediness" of the quantifiers so that they - are not greedy by default, but become greedy if followed by "?". It is - not compatible with Perl. It can also be set by a (?U) option setting + This option inverts the "greediness" of the quantifiers so that they + are not greedy by default, but become greedy if followed by "?". It is + not compatible with Perl. It can also be set by a (?U) option setting within the pattern. PCRE_UTF8 - This option causes PCRE to regard both the pattern and the subject as + This option causes PCRE to regard both the pattern and the subject as strings of UTF-8 characters instead of single-byte strings. However, it - is available only when PCRE is built to include UTF support. If not, - the use of this option provokes an error. Details of how this option + is available only when PCRE is built to include UTF support. If not, + the use of this option provokes an error. Details of how this option changes the behaviour of PCRE are given in the pcreunicode page. PCRE_NO_UTF8_CHECK When PCRE_UTF8 is set, the validity of the pattern as a UTF-8 string is - automatically checked. There is a discussion about the validity of - UTF-8 strings in the pcreunicode page. If an invalid UTF-8 sequence is - found, pcre_compile() returns an error. If you already know that your - pattern is valid, and you want to skip this check for performance rea- - sons, you can set the PCRE_NO_UTF8_CHECK option. When it is set, the + automatically checked. There is a discussion about the validity of + UTF-8 strings in the pcreunicode page. If an invalid UTF-8 sequence is + found, pcre_compile() returns an error. If you already know that your + pattern is valid, and you want to skip this check for performance rea- + sons, you can set the PCRE_NO_UTF8_CHECK option. When it is set, the effect of passing an invalid UTF-8 string as a pattern is undefined. It may cause your program to crash or loop. Note that this option can also - be passed to pcre_exec() and pcre_dfa_exec(), to suppress the validity - checking of subject strings only. If the same string is being matched - many times, the option can be safely set for the second and subsequent + be passed to pcre_exec() and pcre_dfa_exec(), to suppress the validity + checking of subject strings only. If the same string is being matched + many times, the option can be safely set for the second and subsequent matchings to improve performance. COMPILATION ERROR CODES - The following table lists the error codes than may be returned by - pcre_compile2(), along with the error messages that may be returned by - both compiling functions. Note that error messages are always 8-bit - ASCII strings, even in 16-bit or 32-bit mode. As PCRE has developed, - some error codes have fallen out of use. To avoid confusion, they have + The following table lists the error codes than may be returned by + pcre_compile2(), along with the error messages that may be returned by + both compiling functions. Note that error messages are always 8-bit + ASCII strings, even in 16-bit or 32-bit mode. As PCRE has developed, + some error codes have fallen out of use. To avoid confusion, they have not been re-used. 0 no error @@ -2504,7 +2503,7 @@ COMPILATION ERROR CODES 84 group name must start with a non-digit 85 parentheses are too deeply nested (stack check) - The numbers 32 and 10000 in errors 48 and 49 are defaults; different + The numbers 32 and 10000 in errors 48 and 49 are defaults; different values may be used if the limits were changed when PCRE was built. @@ -2513,64 +2512,64 @@ STUDYING A PATTERN pcre_extra *pcre_study(const pcre *code, int options, const char **errptr); - If a compiled pattern is going to be used several times, it is worth + If a compiled pattern is going to be used several times, it is worth spending more time analyzing it in order to speed up the time taken for - matching. The function pcre_study() takes a pointer to a compiled pat- + matching. The function pcre_study() takes a pointer to a compiled pat- tern as its first argument. If studying the pattern produces additional - information that will help speed up matching, pcre_study() returns a - pointer to a pcre_extra block, in which the study_data field points to + information that will help speed up matching, pcre_study() returns a + pointer to a pcre_extra block, in which the study_data field points to the results of the study. The returned value from pcre_study() can be passed directly to - pcre_exec() or pcre_dfa_exec(). However, a pcre_extra block also con- - tains other fields that can be set by the caller before the block is + pcre_exec() or pcre_dfa_exec(). However, a pcre_extra block also con- + tains other fields that can be set by the caller before the block is passed; these are described below in the section on matching a pattern. - If studying the pattern does not produce any useful information, - pcre_study() returns NULL by default. In that circumstance, if the + If studying the pattern does not produce any useful information, + pcre_study() returns NULL by default. In that circumstance, if the calling program wants to pass any of the other fields to pcre_exec() or - pcre_dfa_exec(), it must set up its own pcre_extra block. However, if - pcre_study() is called with the PCRE_STUDY_EXTRA_NEEDED option, it + pcre_dfa_exec(), it must set up its own pcre_extra block. However, if + pcre_study() is called with the PCRE_STUDY_EXTRA_NEEDED option, it returns a pcre_extra block even if studying did not find any additional - information. It may still return NULL, however, if an error occurs in + information. It may still return NULL, however, if an error occurs in pcre_study(). - The second argument of pcre_study() contains option bits. There are + The second argument of pcre_study() contains option bits. There are three further options in addition to PCRE_STUDY_EXTRA_NEEDED: PCRE_STUDY_JIT_COMPILE PCRE_STUDY_JIT_PARTIAL_HARD_COMPILE PCRE_STUDY_JIT_PARTIAL_SOFT_COMPILE - If any of these are set, and the just-in-time compiler is available, - the pattern is further compiled into machine code that executes much - faster than the pcre_exec() interpretive matching function. If the - just-in-time compiler is not available, these options are ignored. All + If any of these are set, and the just-in-time compiler is available, + the pattern is further compiled into machine code that executes much + faster than the pcre_exec() interpretive matching function. If the + just-in-time compiler is not available, these options are ignored. All undefined bits in the options argument must be zero. - JIT compilation is a heavyweight optimization. It can take some time - for patterns to be analyzed, and for one-off matches and simple pat- - terns the benefit of faster execution might be offset by a much slower + JIT compilation is a heavyweight optimization. It can take some time + for patterns to be analyzed, and for one-off matches and simple pat- + terns the benefit of faster execution might be offset by a much slower study time. Not all patterns can be optimized by the JIT compiler. For - those that cannot be handled, matching automatically falls back to the - pcre_exec() interpreter. For more details, see the pcrejit documenta- + those that cannot be handled, matching automatically falls back to the + pcre_exec() interpreter. For more details, see the pcrejit documenta- tion. - The third argument for pcre_study() is a pointer for an error message. - If studying succeeds (even if no data is returned), the variable it - points to is set to NULL. Otherwise it is set to point to a textual + The third argument for pcre_study() is a pointer for an error message. + If studying succeeds (even if no data is returned), the variable it + points to is set to NULL. Otherwise it is set to point to a textual error message. This is a static string that is part of the library. You - must not try to free it. You should test the error pointer for NULL + must not try to free it. You should test the error pointer for NULL after calling pcre_study(), to be sure that it has run successfully. - When you are finished with a pattern, you can free the memory used for + When you are finished with a pattern, you can free the memory used for the study data by calling pcre_free_study(). This function was added to - the API for release 8.20. For earlier versions, the memory could be - freed with pcre_free(), just like the pattern itself. This will still - work in cases where JIT optimization is not used, but it is advisable + the API for release 8.20. For earlier versions, the memory could be + freed with pcre_free(), just like the pattern itself. This will still + work in cases where JIT optimization is not used, but it is advisable to change to the new function when convenient. - This is a typical way in which pcre_study() is used (except that in a + This is a typical way in which pcre_study() is used (except that in a real application there should be tests for errors): int rc; @@ -2590,29 +2589,29 @@ STUDYING A PATTERN Studying a pattern does two things: first, a lower bound for the length of subject string that is needed to match the pattern is computed. This does not mean that there are any strings of that length that match, but - it does guarantee that no shorter strings match. The value is used to + it does guarantee that no shorter strings match. The value is used to avoid wasting time by trying to match strings that are shorter than the - lower bound. You can find out the value in a calling program via the + lower bound. You can find out the value in a calling program via the pcre_fullinfo() function. Studying a pattern is also useful for non-anchored patterns that do not - have a single fixed starting character. A bitmap of possible starting - bytes is created. This speeds up finding a position in the subject at + have a single fixed starting character. A bitmap of possible starting + bytes is created. This speeds up finding a position in the subject at which to start matching. (In 16-bit mode, the bitmap is used for 16-bit - values less than 256. In 32-bit mode, the bitmap is used for 32-bit + values less than 256. In 32-bit mode, the bitmap is used for 32-bit values less than 256.) - These two optimizations apply to both pcre_exec() and pcre_dfa_exec(), - and the information is also used by the JIT compiler. The optimiza- - tions can be disabled by setting the PCRE_NO_START_OPTIMIZE option. - You might want to do this if your pattern contains callouts or (*MARK) - and you want to make use of these facilities in cases where matching + These two optimizations apply to both pcre_exec() and pcre_dfa_exec(), + and the information is also used by the JIT compiler. The optimiza- + tions can be disabled by setting the PCRE_NO_START_OPTIMIZE option. + You might want to do this if your pattern contains callouts or (*MARK) + and you want to make use of these facilities in cases where matching fails. - PCRE_NO_START_OPTIMIZE can be specified at either compile time or exe- - cution time. However, if PCRE_NO_START_OPTIMIZE is passed to + PCRE_NO_START_OPTIMIZE can be specified at either compile time or exe- + cution time. However, if PCRE_NO_START_OPTIMIZE is passed to pcre_exec(), (that is, after any JIT compilation has happened) JIT exe- - cution is disabled. For JIT execution to work with PCRE_NO_START_OPTI- + cution is disabled. For JIT execution to work with PCRE_NO_START_OPTI- MIZE, the option must be set at compile time. There is a longer discussion of PCRE_NO_START_OPTIMIZE below. @@ -2620,65 +2619,65 @@ STUDYING A PATTERN LOCALE SUPPORT - PCRE handles caseless matching, and determines whether characters are - letters, digits, or whatever, by reference to a set of tables, indexed - by character code point. When running in UTF-8 mode, or in the 16- or + PCRE handles caseless matching, and determines whether characters are + letters, digits, or whatever, by reference to a set of tables, indexed + by character code point. When running in UTF-8 mode, or in the 16- or 32-bit libraries, this applies only to characters with code points less - than 256. By default, higher-valued code points never match escapes - such as \w or \d. However, if PCRE is built with Unicode property sup- - port, all characters can be tested with \p and \P, or, alternatively, - the PCRE_UCP option can be set when a pattern is compiled; this causes - \w and friends to use Unicode property support instead of the built-in + than 256. By default, higher-valued code points never match escapes + such as \w or \d. However, if PCRE is built with Unicode property sup- + port, all characters can be tested with \p and \P, or, alternatively, + the PCRE_UCP option can be set when a pattern is compiled; this causes + \w and friends to use Unicode property support instead of the built-in tables. - The use of locales with Unicode is discouraged. If you are handling - characters with code points greater than 128, you should either use + The use of locales with Unicode is discouraged. If you are handling + characters with code points greater than 128, you should either use Unicode support, or use locales, but not try to mix the two. - PCRE contains an internal set of tables that are used when the final - argument of pcre_compile() is NULL. These are sufficient for many + PCRE contains an internal set of tables that are used when the final + argument of pcre_compile() is NULL. These are sufficient for many applications. Normally, the internal tables recognize only ASCII char- acters. However, when PCRE is built, it is possible to cause the inter- nal tables to be rebuilt in the default "C" locale of the local system, which may cause them to be different. - The internal tables can always be overridden by tables supplied by the + The internal tables can always be overridden by tables supplied by the application that calls PCRE. These may be created in a different locale - from the default. As more and more applications change to using Uni- + from the default. As more and more applications change to using Uni- code, the need for this locale support is expected to die away. - External tables are built by calling the pcre_maketables() function, - which has no arguments, in the relevant locale. The result can then be - passed to pcre_compile() as often as necessary. For example, to build - and use tables that are appropriate for the French locale (where - accented characters with values greater than 128 are treated as let- + External tables are built by calling the pcre_maketables() function, + which has no arguments, in the relevant locale. The result can then be + passed to pcre_compile() as often as necessary. For example, to build + and use tables that are appropriate for the French locale (where + accented characters with values greater than 128 are treated as let- ters), the following code could be used: setlocale(LC_CTYPE, "fr_FR"); tables = pcre_maketables(); re = pcre_compile(..., tables); - The locale name "fr_FR" is used on Linux and other Unix-like systems; + The locale name "fr_FR" is used on Linux and other Unix-like systems; if you are using Windows, the name for the French locale is "french". - When pcre_maketables() runs, the tables are built in memory that is - obtained via pcre_malloc. It is the caller's responsibility to ensure - that the memory containing the tables remains available for as long as + When pcre_maketables() runs, the tables are built in memory that is + obtained via pcre_malloc. It is the caller's responsibility to ensure + that the memory containing the tables remains available for as long as it is needed. The pointer that is passed to pcre_compile() is saved with the compiled - pattern, and the same tables are used via this pointer by pcre_study() - and also by pcre_exec() and pcre_dfa_exec(). Thus, for any single pat- + pattern, and the same tables are used via this pointer by pcre_study() + and also by pcre_exec() and pcre_dfa_exec(). Thus, for any single pat- tern, compilation, studying and matching all happen in the same locale, but different patterns can be processed in different locales. - It is possible to pass a table pointer or NULL (indicating the use of + It is possible to pass a table pointer or NULL (indicating the use of the internal tables) to pcre_exec() or pcre_dfa_exec() (see the discus- sion below in the section on matching a pattern). This facility is pro- - vided for use with pre-compiled patterns that have been saved and - reloaded. Character tables are not saved with patterns, so if a non- + vided for use with pre-compiled patterns that have been saved and + reloaded. Character tables are not saved with patterns, so if a non- standard table was used at compile time, it must be provided again when - the reloaded pattern is matched. Attempting to use this facility to + the reloaded pattern is matched. Attempting to use this facility to match a pattern in a different locale from the one in which it was com- piled is likely to lead to anomalous (usually incorrect) results. @@ -2688,15 +2687,15 @@ INFORMATION ABOUT A PATTERN int pcre_fullinfo(const pcre *code, const pcre_extra *extra, int what, void *where); - The pcre_fullinfo() function returns information about a compiled pat- - tern. It replaces the pcre_info() function, which was removed from the + The pcre_fullinfo() function returns information about a compiled pat- + tern. It replaces the pcre_info() function, which was removed from the library at version 8.30, after more than 10 years of obsolescence. - The first argument for pcre_fullinfo() is a pointer to the compiled - pattern. The second argument is the result of pcre_study(), or NULL if - the pattern was not studied. The third argument specifies which piece - of information is required, and the fourth argument is a pointer to a - variable to receive the data. The yield of the function is zero for + The first argument for pcre_fullinfo() is a pointer to the compiled + pattern. The second argument is the result of pcre_study(), or NULL if + the pattern was not studied. The third argument specifies which piece + of information is required, and the fourth argument is a pointer to a + variable to receive the data. The yield of the function is zero for success, or one of the following negative numbers: PCRE_ERROR_NULL the argument code was NULL @@ -2707,10 +2706,10 @@ INFORMATION ABOUT A PATTERN PCRE_ERROR_BADOPTION the value of what was invalid PCRE_ERROR_UNSET the requested field is not set - The "magic number" is placed at the start of each compiled pattern as - an simple check against passing an arbitrary memory pointer. The endi- + The "magic number" is placed at the start of each compiled pattern as + an simple check against passing an arbitrary memory pointer. The endi- anness error can occur if a compiled pattern is saved and reloaded on a - different host. Here is a typical call of pcre_fullinfo(), to obtain + different host. Here is a typical call of pcre_fullinfo(), to obtain the length of the compiled pattern: int rc; @@ -2721,81 +2720,81 @@ INFORMATION ABOUT A PATTERN PCRE_INFO_SIZE, /* what is required */ &length); /* where to put the data */ - The possible values for the third argument are defined in pcre.h, and + The possible values for the third argument are defined in pcre.h, and are as follows: PCRE_INFO_BACKREFMAX - Return the number of the highest back reference in the pattern. The - fourth argument should point to an int variable. Zero is returned if + Return the number of the highest back reference in the pattern. The + fourth argument should point to an int variable. Zero is returned if there are no back references. PCRE_INFO_CAPTURECOUNT - Return the number of capturing subpatterns in the pattern. The fourth + Return the number of capturing subpatterns in the pattern. The fourth argument should point to an int variable. PCRE_INFO_DEFAULT_TABLES - Return a pointer to the internal default character tables within PCRE. - The fourth argument should point to an unsigned char * variable. This + Return a pointer to the internal default character tables within PCRE. + The fourth argument should point to an unsigned char * variable. This information call is provided for internal use by the pcre_study() func- - tion. External callers can cause PCRE to use its internal tables by + tion. External callers can cause PCRE to use its internal tables by passing a NULL table pointer. PCRE_INFO_FIRSTBYTE (deprecated) Return information about the first data unit of any matched string, for - a non-anchored pattern. The name of this option refers to the 8-bit - library, where data units are bytes. The fourth argument should point - to an int variable. Negative values are used for special cases. How- - ever, this means that when the 32-bit library is in non-UTF-32 mode, - the full 32-bit range of characters cannot be returned. For this rea- - son, this value is deprecated; use PCRE_INFO_FIRSTCHARACTERFLAGS and + a non-anchored pattern. The name of this option refers to the 8-bit + library, where data units are bytes. The fourth argument should point + to an int variable. Negative values are used for special cases. How- + ever, this means that when the 32-bit library is in non-UTF-32 mode, + the full 32-bit range of characters cannot be returned. For this rea- + son, this value is deprecated; use PCRE_INFO_FIRSTCHARACTERFLAGS and PCRE_INFO_FIRSTCHARACTER instead. - If there is a fixed first value, for example, the letter "c" from a - pattern such as (cat|cow|coyote), its value is returned. In the 8-bit - library, the value is always less than 256. In the 16-bit library the + If there is a fixed first value, for example, the letter "c" from a + pattern such as (cat|cow|coyote), its value is returned. In the 8-bit + library, the value is always less than 256. In the 16-bit library the value can be up to 0xffff. In the 32-bit library the value can be up to 0x10ffff. If there is no fixed first value, and if either - (a) the pattern was compiled with the PCRE_MULTILINE option, and every + (a) the pattern was compiled with the PCRE_MULTILINE option, and every branch starts with "^", or (b) every branch of the pattern starts with ".*" and PCRE_DOTALL is not set (if it were set, the pattern would be anchored), - -1 is returned, indicating that the pattern matches only at the start - of a subject string or after any newline within the string. Otherwise + -1 is returned, indicating that the pattern matches only at the start + of a subject string or after any newline within the string. Otherwise -2 is returned. For anchored patterns, -2 is returned. PCRE_INFO_FIRSTCHARACTER - Return the value of the first data unit (non-UTF character) of any - matched string in the situation where PCRE_INFO_FIRSTCHARACTERFLAGS - returns 1; otherwise return 0. The fourth argument should point to an + Return the value of the first data unit (non-UTF character) of any + matched string in the situation where PCRE_INFO_FIRSTCHARACTERFLAGS + returns 1; otherwise return 0. The fourth argument should point to an uint_t variable. - In the 8-bit library, the value is always less than 256. In the 16-bit - library the value can be up to 0xffff. In the 32-bit library in UTF-32 - mode the value can be up to 0x10ffff, and up to 0xffffffff when not + In the 8-bit library, the value is always less than 256. In the 16-bit + library the value can be up to 0xffff. In the 32-bit library in UTF-32 + mode the value can be up to 0x10ffff, and up to 0xffffffff when not using UTF-32 mode. PCRE_INFO_FIRSTCHARACTERFLAGS Return information about the first data unit of any matched string, for - a non-anchored pattern. The fourth argument should point to an int + a non-anchored pattern. The fourth argument should point to an int variable. - If there is a fixed first value, for example, the letter "c" from a - pattern such as (cat|cow|coyote), 1 is returned, and the character - value can be retrieved using PCRE_INFO_FIRSTCHARACTER. If there is no + If there is a fixed first value, for example, the letter "c" from a + pattern such as (cat|cow|coyote), 1 is returned, and the character + value can be retrieved using PCRE_INFO_FIRSTCHARACTER. If there is no fixed first value, and if either - (a) the pattern was compiled with the PCRE_MULTILINE option, and every + (a) the pattern was compiled with the PCRE_MULTILINE option, and every branch starts with "^", or (b) every branch of the pattern starts with ".*" and PCRE_DOTALL is not @@ -2807,139 +2806,139 @@ INFORMATION ABOUT A PATTERN PCRE_INFO_FIRSTTABLE - If the pattern was studied, and this resulted in the construction of a - 256-bit table indicating a fixed set of values for the first data unit - in any matching string, a pointer to the table is returned. Otherwise - NULL is returned. The fourth argument should point to an unsigned char + If the pattern was studied, and this resulted in the construction of a + 256-bit table indicating a fixed set of values for the first data unit + in any matching string, a pointer to the table is returned. Otherwise + NULL is returned. The fourth argument should point to an unsigned char * variable. PCRE_INFO_HASCRORLF - Return 1 if the pattern contains any explicit matches for CR or LF - characters, otherwise 0. The fourth argument should point to an int - variable. An explicit match is either a literal CR or LF character, or + Return 1 if the pattern contains any explicit matches for CR or LF + characters, otherwise 0. The fourth argument should point to an int + variable. An explicit match is either a literal CR or LF character, or \r or \n. PCRE_INFO_JCHANGED - Return 1 if the (?J) or (?-J) option setting is used in the pattern, - otherwise 0. The fourth argument should point to an int variable. (?J) + Return 1 if the (?J) or (?-J) option setting is used in the pattern, + otherwise 0. The fourth argument should point to an int variable. (?J) and (?-J) set and unset the local PCRE_DUPNAMES option, respectively. PCRE_INFO_JIT - Return 1 if the pattern was studied with one of the JIT options, and + Return 1 if the pattern was studied with one of the JIT options, and just-in-time compiling was successful. The fourth argument should point - to an int variable. A return value of 0 means that JIT support is not - available in this version of PCRE, or that the pattern was not studied - with a JIT option, or that the JIT compiler could not handle this par- - ticular pattern. See the pcrejit documentation for details of what can + to an int variable. A return value of 0 means that JIT support is not + available in this version of PCRE, or that the pattern was not studied + with a JIT option, or that the JIT compiler could not handle this par- + ticular pattern. See the pcrejit documentation for details of what can and cannot be handled. PCRE_INFO_JITSIZE - If the pattern was successfully studied with a JIT option, return the - size of the JIT compiled code, otherwise return zero. The fourth argu- + If the pattern was successfully studied with a JIT option, return the + size of the JIT compiled code, otherwise return zero. The fourth argu- ment should point to a size_t variable. PCRE_INFO_LASTLITERAL - Return the value of the rightmost literal data unit that must exist in - any matched string, other than at its start, if such a value has been + Return the value of the rightmost literal data unit that must exist in + any matched string, other than at its start, if such a value has been recorded. The fourth argument should point to an int variable. If there is no such value, -1 is returned. For anchored patterns, a last literal - value is recorded only if it follows something of variable length. For + value is recorded only if it follows something of variable length. For example, for the pattern /^a\d+z\d+/ the returned value is "z", but for /^a\dz\d/ the returned value is -1. - Since for the 32-bit library using the non-UTF-32 mode, this function - is unable to return the full 32-bit range of characters, this value is + Since for the 32-bit library using the non-UTF-32 mode, this function + is unable to return the full 32-bit range of characters, this value is deprecated; instead the PCRE_INFO_REQUIREDCHARFLAGS and PCRE_INFO_REQUIREDCHAR values should be used. PCRE_INFO_MATCH_EMPTY - Return 1 if the pattern can match an empty string, otherwise 0. The + Return 1 if the pattern can match an empty string, otherwise 0. The fourth argument should point to an int variable. PCRE_INFO_MATCHLIMIT - If the pattern set a match limit by including an item of the form - (*LIMIT_MATCH=nnnn) at the start, the value is returned. The fourth - argument should point to an unsigned 32-bit integer. If no such value - has been set, the call to pcre_fullinfo() returns the error + If the pattern set a match limit by including an item of the form + (*LIMIT_MATCH=nnnn) at the start, the value is returned. The fourth + argument should point to an unsigned 32-bit integer. If no such value + has been set, the call to pcre_fullinfo() returns the error PCRE_ERROR_UNSET. PCRE_INFO_MAXLOOKBEHIND - Return the number of characters (NB not data units) in the longest - lookbehind assertion in the pattern. This information is useful when - doing multi-segment matching using the partial matching facilities. + Return the number of characters (NB not data units) in the longest + lookbehind assertion in the pattern. This information is useful when + doing multi-segment matching using the partial matching facilities. Note that the simple assertions \b and \B require a one-character look- - behind. \A also registers a one-character lookbehind, though it does - not actually inspect the previous character. This is to ensure that at + behind. \A also registers a one-character lookbehind, though it does + not actually inspect the previous character. This is to ensure that at least one character from the old segment is retained when a new segment is processed. Otherwise, if there are no lookbehinds in the pattern, \A might match incorrectly at the start of a new segment. PCRE_INFO_MINLENGTH - If the pattern was studied and a minimum length for matching subject - strings was computed, its value is returned. Otherwise the returned + If the pattern was studied and a minimum length for matching subject + strings was computed, its value is returned. Otherwise the returned value is -1. The value is a number of characters, which in UTF mode may - be different from the number of data units. The fourth argument should - point to an int variable. A non-negative value is a lower bound to the - length of any matching string. There may not be any strings of that - length that do actually match, but every string that does match is at + be different from the number of data units. The fourth argument should + point to an int variable. A non-negative value is a lower bound to the + length of any matching string. There may not be any strings of that + length that do actually match, but every string that does match is at least that long. PCRE_INFO_NAMECOUNT PCRE_INFO_NAMEENTRYSIZE PCRE_INFO_NAMETABLE - PCRE supports the use of named as well as numbered capturing parenthe- - ses. The names are just an additional way of identifying the parenthe- + PCRE supports the use of named as well as numbered capturing parenthe- + ses. The names are just an additional way of identifying the parenthe- ses, which still acquire numbers. Several convenience functions such as - pcre_get_named_substring() are provided for extracting captured sub- - strings by name. It is also possible to extract the data directly, by - first converting the name to a number in order to access the correct + pcre_get_named_substring() are provided for extracting captured sub- + strings by name. It is also possible to extract the data directly, by + first converting the name to a number in order to access the correct pointers in the output vector (described with pcre_exec() below). To do - the conversion, you need to use the name-to-number map, which is + the conversion, you need to use the name-to-number map, which is described by these three values. The map consists of a number of fixed-size entries. PCRE_INFO_NAMECOUNT gives the number of entries, and PCRE_INFO_NAMEENTRYSIZE gives the size - of each entry; both of these return an int value. The entry size - depends on the length of the longest name. PCRE_INFO_NAMETABLE returns + of each entry; both of these return an int value. The entry size + depends on the length of the longest name. PCRE_INFO_NAMETABLE returns a pointer to the first entry of the table. This is a pointer to char in the 8-bit library, where the first two bytes of each entry are the num- - ber of the capturing parenthesis, most significant byte first. In the - 16-bit library, the pointer points to 16-bit data units, the first of - which contains the parenthesis number. In the 32-bit library, the - pointer points to 32-bit data units, the first of which contains the - parenthesis number. The rest of the entry is the corresponding name, + ber of the capturing parenthesis, most significant byte first. In the + 16-bit library, the pointer points to 16-bit data units, the first of + which contains the parenthesis number. In the 32-bit library, the + pointer points to 32-bit data units, the first of which contains the + parenthesis number. The rest of the entry is the corresponding name, zero terminated. - The names are in alphabetical order. If (?| is used to create multiple - groups with the same number, as described in the section on duplicate + The names are in alphabetical order. If (?| is used to create multiple + groups with the same number, as described in the section on duplicate subpattern numbers in the pcrepattern page, the groups may be given the - same name, but there is only one entry in the table. Different names - for groups of the same number are not permitted. Duplicate names for + same name, but there is only one entry in the table. Different names + for groups of the same number are not permitted. Duplicate names for subpatterns with different numbers are permitted, but only if PCRE_DUP- - NAMES is set. They appear in the table in the order in which they were - found in the pattern. In the absence of (?| this is the order of - increasing number; when (?| is used this is not necessarily the case + NAMES is set. They appear in the table in the order in which they were + found in the pattern. In the absence of (?| this is the order of + increasing number; when (?| is used this is not necessarily the case because later subpatterns may have lower numbers. - As a simple example of the name/number table, consider the following + As a simple example of the name/number table, consider the following pattern after compilation by the 8-bit library (assume PCRE_EXTENDED is set, so white space - including newlines - is ignored): (? (?(\d\d)?\d\d) - (?\d\d) - (?\d\d) ) - There are four named subpatterns, so the table has four entries, and - each entry in the table is eight bytes long. The table is as follows, + There are four named subpatterns, so the table has four entries, and + each entry in the table is eight bytes long. The table is as follows, with non-printing bytes shows in hexadecimal, and undefined bytes shown as ??: @@ -2948,31 +2947,31 @@ INFORMATION ABOUT A PATTERN 00 04 m o n t h 00 00 02 y e a r 00 ?? - When writing code to extract data from named subpatterns using the - name-to-number map, remember that the length of the entries is likely + When writing code to extract data from named subpatterns using the + name-to-number map, remember that the length of the entries is likely to be different for each compiled pattern. PCRE_INFO_OKPARTIAL - Return 1 if the pattern can be used for partial matching with - pcre_exec(), otherwise 0. The fourth argument should point to an int - variable. From release 8.00, this always returns 1, because the - restrictions that previously applied to partial matching have been - lifted. The pcrepartial documentation gives details of partial match- + Return 1 if the pattern can be used for partial matching with + pcre_exec(), otherwise 0. The fourth argument should point to an int + variable. From release 8.00, this always returns 1, because the + restrictions that previously applied to partial matching have been + lifted. The pcrepartial documentation gives details of partial match- ing. PCRE_INFO_OPTIONS - Return a copy of the options with which the pattern was compiled. The - fourth argument should point to an unsigned long int variable. These + Return a copy of the options with which the pattern was compiled. The + fourth argument should point to an unsigned long int variable. These option bits are those specified in the call to pcre_compile(), modified by any top-level option settings at the start of the pattern itself. In - other words, they are the options that will be in force when matching - starts. For example, if the pattern /(?im)abc(?-i)d/ is compiled with - the PCRE_EXTENDED option, the result is PCRE_CASELESS, PCRE_MULTILINE, + other words, they are the options that will be in force when matching + starts. For example, if the pattern /(?im)abc(?-i)d/ is compiled with + the PCRE_EXTENDED option, the result is PCRE_CASELESS, PCRE_MULTILINE, and PCRE_EXTENDED. - A pattern is automatically anchored by PCRE if all of its top-level + A pattern is automatically anchored by PCRE if all of its top-level alternatives begin with one of the following: ^ unless PCRE_MULTILINE is set @@ -2986,53 +2985,53 @@ INFORMATION ABOUT A PATTERN PCRE_INFO_RECURSIONLIMIT - If the pattern set a recursion limit by including an item of the form + If the pattern set a recursion limit by including an item of the form (*LIMIT_RECURSION=nnnn) at the start, the value is returned. The fourth - argument should point to an unsigned 32-bit integer. If no such value - has been set, the call to pcre_fullinfo() returns the error + argument should point to an unsigned 32-bit integer. If no such value + has been set, the call to pcre_fullinfo() returns the error PCRE_ERROR_UNSET. PCRE_INFO_SIZE - Return the size of the compiled pattern in bytes (for all three + Return the size of the compiled pattern in bytes (for all three libraries). The fourth argument should point to a size_t variable. This - value does not include the size of the pcre structure that is returned - by pcre_compile(). The value that is passed as the argument to - pcre_malloc() when pcre_compile() is getting memory in which to place + value does not include the size of the pcre structure that is returned + by pcre_compile(). The value that is passed as the argument to + pcre_malloc() when pcre_compile() is getting memory in which to place the compiled data is the value returned by this option plus the size of - the pcre structure. Studying a compiled pattern, with or without JIT, + the pcre structure. Studying a compiled pattern, with or without JIT, does not alter the value returned by this option. PCRE_INFO_STUDYSIZE - Return the size in bytes (for all three libraries) of the data block + Return the size in bytes (for all three libraries) of the data block pointed to by the study_data field in a pcre_extra block. If pcre_extra - is NULL, or there is no study data, zero is returned. The fourth argu- - ment should point to a size_t variable. The study_data field is set by + is NULL, or there is no study data, zero is returned. The fourth argu- + ment should point to a size_t variable. The study_data field is set by pcre_study() to record information that will speed up matching (see the - section entitled "Studying a pattern" above). The format of the - study_data block is private, but its length is made available via this - option so that it can be saved and restored (see the pcreprecompile + section entitled "Studying a pattern" above). The format of the + study_data block is private, but its length is made available via this + option so that it can be saved and restored (see the pcreprecompile documentation for details). PCRE_INFO_REQUIREDCHARFLAGS - Returns 1 if there is a rightmost literal data unit that must exist in + Returns 1 if there is a rightmost literal data unit that must exist in any matched string, other than at its start. The fourth argument should - point to an int variable. If there is no such value, 0 is returned. If + point to an int variable. If there is no such value, 0 is returned. If returning 1, the character value itself can be retrieved using PCRE_INFO_REQUIREDCHAR. For anchored patterns, a last literal value is recorded only if it fol- - lows something of variable length. For example, for the pattern - /^a\d+z\d+/ the returned value 1 (with "z" returned from + lows something of variable length. For example, for the pattern + /^a\d+z\d+/ the returned value 1 (with "z" returned from PCRE_INFO_REQUIREDCHAR), but for /^a\dz\d/ the returned value is 0. PCRE_INFO_REQUIREDCHAR - Return the value of the rightmost literal data unit that must exist in - any matched string, other than at its start, if such a value has been - recorded. The fourth argument should point to an uint32_t variable. If + Return the value of the rightmost literal data unit that must exist in + any matched string, other than at its start, if such a value has been + recorded. The fourth argument should point to an uint32_t variable. If there is no such value, 0 is returned. @@ -3040,21 +3039,21 @@ REFERENCE COUNTS int pcre_refcount(pcre *code, int adjust); - The pcre_refcount() function is used to maintain a reference count in + The pcre_refcount() function is used to maintain a reference count in the data block that contains a compiled pattern. It is provided for the - benefit of applications that operate in an object-oriented manner, + benefit of applications that operate in an object-oriented manner, where different parts of the application may be using the same compiled pattern, but you want to free the block when they are all done. When a pattern is compiled, the reference count field is initialized to - zero. It is changed only by calling this function, whose action is to - add the adjust value (which may be positive or negative) to it. The + zero. It is changed only by calling this function, whose action is to + add the adjust value (which may be positive or negative) to it. The yield of the function is the new value. However, the value of the count - is constrained to lie between 0 and 65535, inclusive. If the new value + is constrained to lie between 0 and 65535, inclusive. If the new value is outside these limits, it is forced to the appropriate limit value. - Except when it is zero, the reference count is not correctly preserved - if a pattern is compiled on one host and then transferred to a host + Except when it is zero, the reference count is not correctly preserved + if a pattern is compiled on one host and then transferred to a host whose byte-order is different. (This seems a highly unlikely scenario.) @@ -3064,22 +3063,22 @@ MATCHING A PATTERN: THE TRADITIONAL FUNCTION const char *subject, int length, int startoffset, int options, int *ovector, int ovecsize); - The function pcre_exec() is called to match a subject string against a - compiled pattern, which is passed in the code argument. If the pattern - was studied, the result of the study should be passed in the extra - argument. You can call pcre_exec() with the same code and extra argu- - ments as many times as you like, in order to match different subject + The function pcre_exec() is called to match a subject string against a + compiled pattern, which is passed in the code argument. If the pattern + was studied, the result of the study should be passed in the extra + argument. You can call pcre_exec() with the same code and extra argu- + ments as many times as you like, in order to match different subject strings with the same pattern. - This function is the main matching facility of the library, and it - operates in a Perl-like manner. For specialist use there is also an - alternative matching function, which is described below in the section + This function is the main matching facility of the library, and it + operates in a Perl-like manner. For specialist use there is also an + alternative matching function, which is described below in the section about the pcre_dfa_exec() function. - In most applications, the pattern will have been compiled (and option- - ally studied) in the same process that calls pcre_exec(). However, it + In most applications, the pattern will have been compiled (and option- + ally studied) in the same process that calls pcre_exec(). However, it is possible to save compiled patterns and study data, and then use them - later in different processes, possibly even on different hosts. For a + later in different processes, possibly even on different hosts. For a discussion about this, see the pcreprecompile documentation. Here is an example of a simple call to pcre_exec(): @@ -3098,10 +3097,10 @@ MATCHING A PATTERN: THE TRADITIONAL FUNCTION Extra data for pcre_exec() - If the extra argument is not NULL, it must point to a pcre_extra data - block. The pcre_study() function returns such a block (when it doesn't - return NULL), but you can also create one for yourself, and pass addi- - tional information in it. The pcre_extra block contains the following + If the extra argument is not NULL, it must point to a pcre_extra data + block. The pcre_study() function returns such a block (when it doesn't + return NULL), but you can also create one for yourself, and pass addi- + tional information in it. The pcre_extra block contains the following fields (not necessarily in this order): unsigned long int flags; @@ -3113,13 +3112,13 @@ MATCHING A PATTERN: THE TRADITIONAL FUNCTION const unsigned char *tables; unsigned char **mark; - In the 16-bit version of this structure, the mark field has type + In the 16-bit version of this structure, the mark field has type "PCRE_UCHAR16 **". - In the 32-bit version of this structure, the mark field has type + In the 32-bit version of this structure, the mark field has type "PCRE_UCHAR32 **". - The flags field is used to specify which of the other fields are set. + The flags field is used to specify which of the other fields are set. The flag bits are: PCRE_EXTRA_CALLOUT_DATA @@ -3130,134 +3129,134 @@ MATCHING A PATTERN: THE TRADITIONAL FUNCTION PCRE_EXTRA_STUDY_DATA PCRE_EXTRA_TABLES - Other flag bits should be set to zero. The study_data field and some- - times the executable_jit field are set in the pcre_extra block that is - returned by pcre_study(), together with the appropriate flag bits. You - should not set these yourself, but you may add to the block by setting + Other flag bits should be set to zero. The study_data field and some- + times the executable_jit field are set in the pcre_extra block that is + returned by pcre_study(), together with the appropriate flag bits. You + should not set these yourself, but you may add to the block by setting other fields and their corresponding flag bits. The match_limit field provides a means of preventing PCRE from using up - a vast amount of resources when running patterns that are not going to - match, but which have a very large number of possibilities in their - search trees. The classic example is a pattern that uses nested unlim- + a vast amount of resources when running patterns that are not going to + match, but which have a very large number of possibilities in their + search trees. The classic example is a pattern that uses nested unlim- ited repeats. - Internally, pcre_exec() uses a function called match(), which it calls - repeatedly (sometimes recursively). The limit set by match_limit is - imposed on the number of times this function is called during a match, - which has the effect of limiting the amount of backtracking that can + Internally, pcre_exec() uses a function called match(), which it calls + repeatedly (sometimes recursively). The limit set by match_limit is + imposed on the number of times this function is called during a match, + which has the effect of limiting the amount of backtracking that can take place. For patterns that are not anchored, the count restarts from zero for each position in the subject string. When pcre_exec() is called with a pattern that was successfully studied - with a JIT option, the way that the matching is executed is entirely + with a JIT option, the way that the matching is executed is entirely different. However, there is still the possibility of runaway matching that goes on for a very long time, and so the match_limit value is also used in this case (but in a different way) to limit how long the match- ing can continue. - The default value for the limit can be set when PCRE is built; the - default default is 10 million, which handles all but the most extreme - cases. You can override the default by suppling pcre_exec() with a - pcre_extra block in which match_limit is set, and - PCRE_EXTRA_MATCH_LIMIT is set in the flags field. If the limit is + The default value for the limit can be set when PCRE is built; the + default default is 10 million, which handles all but the most extreme + cases. You can override the default by suppling pcre_exec() with a + pcre_extra block in which match_limit is set, and + PCRE_EXTRA_MATCH_LIMIT is set in the flags field. If the limit is exceeded, pcre_exec() returns PCRE_ERROR_MATCHLIMIT. - A value for the match limit may also be supplied by an item at the + A value for the match limit may also be supplied by an item at the start of a pattern of the form (*LIMIT_MATCH=d) - where d is a decimal number. However, such a setting is ignored unless - d is less than the limit set by the caller of pcre_exec() or, if no + where d is a decimal number. However, such a setting is ignored unless + d is less than the limit set by the caller of pcre_exec() or, if no such limit is set, less than the default. - The match_limit_recursion field is similar to match_limit, but instead + The match_limit_recursion field is similar to match_limit, but instead of limiting the total number of times that match() is called, it limits - the depth of recursion. The recursion depth is a smaller number than - the total number of calls, because not all calls to match() are recur- + the depth of recursion. The recursion depth is a smaller number than + the total number of calls, because not all calls to match() are recur- sive. This limit is of use only if it is set smaller than match_limit. - Limiting the recursion depth limits the amount of machine stack that - can be used, or, when PCRE has been compiled to use memory on the heap - instead of the stack, the amount of heap memory that can be used. This - limit is not relevant, and is ignored, when matching is done using JIT + Limiting the recursion depth limits the amount of machine stack that + can be used, or, when PCRE has been compiled to use memory on the heap + instead of the stack, the amount of heap memory that can be used. This + limit is not relevant, and is ignored, when matching is done using JIT compiled code. - The default value for match_limit_recursion can be set when PCRE is - built; the default default is the same value as the default for - match_limit. You can override the default by suppling pcre_exec() with - a pcre_extra block in which match_limit_recursion is set, and - PCRE_EXTRA_MATCH_LIMIT_RECURSION is set in the flags field. If the + The default value for match_limit_recursion can be set when PCRE is + built; the default default is the same value as the default for + match_limit. You can override the default by suppling pcre_exec() with + a pcre_extra block in which match_limit_recursion is set, and + PCRE_EXTRA_MATCH_LIMIT_RECURSION is set in the flags field. If the limit is exceeded, pcre_exec() returns PCRE_ERROR_RECURSIONLIMIT. - A value for the recursion limit may also be supplied by an item at the + A value for the recursion limit may also be supplied by an item at the start of a pattern of the form (*LIMIT_RECURSION=d) - where d is a decimal number. However, such a setting is ignored unless - d is less than the limit set by the caller of pcre_exec() or, if no + where d is a decimal number. However, such a setting is ignored unless + d is less than the limit set by the caller of pcre_exec() or, if no such limit is set, less than the default. - The callout_data field is used in conjunction with the "callout" fea- + The callout_data field is used in conjunction with the "callout" fea- ture, and is described in the pcrecallout documentation. - The tables field is provided for use with patterns that have been pre- + The tables field is provided for use with patterns that have been pre- compiled using custom character tables, saved to disc or elsewhere, and - then reloaded, because the tables that were used to compile a pattern - are not saved with it. See the pcreprecompile documentation for a dis- - cussion of saving compiled patterns for later use. If NULL is passed + then reloaded, because the tables that were used to compile a pattern + are not saved with it. See the pcreprecompile documentation for a dis- + cussion of saving compiled patterns for later use. If NULL is passed using this mechanism, it forces PCRE's internal tables to be used. - Warning: The tables that pcre_exec() uses must be the same as those - that were used when the pattern was compiled. If this is not the case, + Warning: The tables that pcre_exec() uses must be the same as those + that were used when the pattern was compiled. If this is not the case, the behaviour of pcre_exec() is undefined. Therefore, when a pattern is - compiled and matched in the same process, this field should never be + compiled and matched in the same process, this field should never be set. In this (the most common) case, the correct table pointer is auto- - matically passed with the compiled pattern from pcre_compile() to + matically passed with the compiled pattern from pcre_compile() to pcre_exec(). - If PCRE_EXTRA_MARK is set in the flags field, the mark field must be - set to point to a suitable variable. If the pattern contains any back- - tracking control verbs such as (*MARK:NAME), and the execution ends up - with a name to pass back, a pointer to the name string (zero termi- - nated) is placed in the variable pointed to by the mark field. The - names are within the compiled pattern; if you wish to retain such a - name you must copy it before freeing the memory of a compiled pattern. - If there is no name to pass back, the variable pointed to by the mark - field is set to NULL. For details of the backtracking control verbs, + If PCRE_EXTRA_MARK is set in the flags field, the mark field must be + set to point to a suitable variable. If the pattern contains any back- + tracking control verbs such as (*MARK:NAME), and the execution ends up + with a name to pass back, a pointer to the name string (zero termi- + nated) is placed in the variable pointed to by the mark field. The + names are within the compiled pattern; if you wish to retain such a + name you must copy it before freeing the memory of a compiled pattern. + If there is no name to pass back, the variable pointed to by the mark + field is set to NULL. For details of the backtracking control verbs, see the section entitled "Backtracking control" in the pcrepattern doc- umentation. Option bits for pcre_exec() - The unused bits of the options argument for pcre_exec() must be zero. - The only bits that may be set are PCRE_ANCHORED, PCRE_NEWLINE_xxx, - PCRE_NOTBOL, PCRE_NOTEOL, PCRE_NOTEMPTY, PCRE_NOTEMPTY_ATSTART, - PCRE_NO_START_OPTIMIZE, PCRE_NO_UTF8_CHECK, PCRE_PARTIAL_HARD, and + The unused bits of the options argument for pcre_exec() must be zero. + The only bits that may be set are PCRE_ANCHORED, PCRE_NEWLINE_xxx, + PCRE_NOTBOL, PCRE_NOTEOL, PCRE_NOTEMPTY, PCRE_NOTEMPTY_ATSTART, + PCRE_NO_START_OPTIMIZE, PCRE_NO_UTF8_CHECK, PCRE_PARTIAL_HARD, and PCRE_PARTIAL_SOFT. - If the pattern was successfully studied with one of the just-in-time + If the pattern was successfully studied with one of the just-in-time (JIT) compile options, the only supported options for JIT execution are - PCRE_NO_UTF8_CHECK, PCRE_NOTBOL, PCRE_NOTEOL, PCRE_NOTEMPTY, - PCRE_NOTEMPTY_ATSTART, PCRE_PARTIAL_HARD, and PCRE_PARTIAL_SOFT. If an - unsupported option is used, JIT execution is disabled and the normal + PCRE_NO_UTF8_CHECK, PCRE_NOTBOL, PCRE_NOTEOL, PCRE_NOTEMPTY, + PCRE_NOTEMPTY_ATSTART, PCRE_PARTIAL_HARD, and PCRE_PARTIAL_SOFT. If an + unsupported option is used, JIT execution is disabled and the normal interpretive code in pcre_exec() is run. PCRE_ANCHORED - The PCRE_ANCHORED option limits pcre_exec() to matching at the first - matching position. If a pattern was compiled with PCRE_ANCHORED, or - turned out to be anchored by virtue of its contents, it cannot be made + The PCRE_ANCHORED option limits pcre_exec() to matching at the first + matching position. If a pattern was compiled with PCRE_ANCHORED, or + turned out to be anchored by virtue of its contents, it cannot be made unachored at matching time. PCRE_BSR_ANYCRLF PCRE_BSR_UNICODE These options (which are mutually exclusive) control what the \R escape - sequence matches. The choice is either to match only CR, LF, or CRLF, - or to match any Unicode newline sequence. These options override the + sequence matches. The choice is either to match only CR, LF, or CRLF, + or to match any Unicode newline sequence. These options override the choice that was made or defaulted when the pattern was compiled. PCRE_NEWLINE_CR @@ -3266,345 +3265,345 @@ MATCHING A PATTERN: THE TRADITIONAL FUNCTION PCRE_NEWLINE_ANYCRLF PCRE_NEWLINE_ANY - These options override the newline definition that was chosen or - defaulted when the pattern was compiled. For details, see the descrip- - tion of pcre_compile() above. During matching, the newline choice - affects the behaviour of the dot, circumflex, and dollar metacharac- - ters. It may also alter the way the match position is advanced after a + These options override the newline definition that was chosen or + defaulted when the pattern was compiled. For details, see the descrip- + tion of pcre_compile() above. During matching, the newline choice + affects the behaviour of the dot, circumflex, and dollar metacharac- + ters. It may also alter the way the match position is advanced after a match failure for an unanchored pattern. - When PCRE_NEWLINE_CRLF, PCRE_NEWLINE_ANYCRLF, or PCRE_NEWLINE_ANY is - set, and a match attempt for an unanchored pattern fails when the cur- - rent position is at a CRLF sequence, and the pattern contains no - explicit matches for CR or LF characters, the match position is + When PCRE_NEWLINE_CRLF, PCRE_NEWLINE_ANYCRLF, or PCRE_NEWLINE_ANY is + set, and a match attempt for an unanchored pattern fails when the cur- + rent position is at a CRLF sequence, and the pattern contains no + explicit matches for CR or LF characters, the match position is advanced by two characters instead of one, in other words, to after the CRLF. The above rule is a compromise that makes the most common cases work as - expected. For example, if the pattern is .+A (and the PCRE_DOTALL + expected. For example, if the pattern is .+A (and the PCRE_DOTALL option is not set), it does not match the string "\r\nA" because, after - failing at the start, it skips both the CR and the LF before retrying. - However, the pattern [\r\n]A does match that string, because it con- + failing at the start, it skips both the CR and the LF before retrying. + However, the pattern [\r\n]A does match that string, because it con- tains an explicit CR or LF reference, and so advances only by one char- acter after the first failure. An explicit match for CR of LF is either a literal appearance of one of - those characters, or one of the \r or \n escape sequences. Implicit - matches such as [^X] do not count, nor does \s (which includes CR and + those characters, or one of the \r or \n escape sequences. Implicit + matches such as [^X] do not count, nor does \s (which includes CR and LF in the characters that it matches). - Notwithstanding the above, anomalous effects may still occur when CRLF + Notwithstanding the above, anomalous effects may still occur when CRLF is a valid newline sequence and explicit \r or \n escapes appear in the pattern. PCRE_NOTBOL This option specifies that first character of the subject string is not - the beginning of a line, so the circumflex metacharacter should not - match before it. Setting this without PCRE_MULTILINE (at compile time) - causes circumflex never to match. This option affects only the behav- + the beginning of a line, so the circumflex metacharacter should not + match before it. Setting this without PCRE_MULTILINE (at compile time) + causes circumflex never to match. This option affects only the behav- iour of the circumflex metacharacter. It does not affect \A. PCRE_NOTEOL This option specifies that the end of the subject string is not the end - of a line, so the dollar metacharacter should not match it nor (except - in multiline mode) a newline immediately before it. Setting this with- + of a line, so the dollar metacharacter should not match it nor (except + in multiline mode) a newline immediately before it. Setting this with- out PCRE_MULTILINE (at compile time) causes dollar never to match. This - option affects only the behaviour of the dollar metacharacter. It does + option affects only the behaviour of the dollar metacharacter. It does not affect \Z or \z. PCRE_NOTEMPTY An empty string is not considered to be a valid match if this option is - set. If there are alternatives in the pattern, they are tried. If all - the alternatives match the empty string, the entire match fails. For + set. If there are alternatives in the pattern, they are tried. If all + the alternatives match the empty string, the entire match fails. For example, if the pattern a?b? - is applied to a string not beginning with "a" or "b", it matches an - empty string at the start of the subject. With PCRE_NOTEMPTY set, this + is applied to a string not beginning with "a" or "b", it matches an + empty string at the start of the subject. With PCRE_NOTEMPTY set, this match is not valid, so PCRE searches further into the string for occur- rences of "a" or "b". PCRE_NOTEMPTY_ATSTART - This is like PCRE_NOTEMPTY, except that an empty string match that is - not at the start of the subject is permitted. If the pattern is + This is like PCRE_NOTEMPTY, except that an empty string match that is + not at the start of the subject is permitted. If the pattern is anchored, such a match can occur only if the pattern contains \K. - Perl has no direct equivalent of PCRE_NOTEMPTY or - PCRE_NOTEMPTY_ATSTART, but it does make a special case of a pattern - match of the empty string within its split() function, and when using - the /g modifier. It is possible to emulate Perl's behaviour after + Perl has no direct equivalent of PCRE_NOTEMPTY or + PCRE_NOTEMPTY_ATSTART, but it does make a special case of a pattern + match of the empty string within its split() function, and when using + the /g modifier. It is possible to emulate Perl's behaviour after matching a null string by first trying the match again at the same off- - set with PCRE_NOTEMPTY_ATSTART and PCRE_ANCHORED, and then if that + set with PCRE_NOTEMPTY_ATSTART and PCRE_ANCHORED, and then if that fails, by advancing the starting offset (see below) and trying an ordi- - nary match again. There is some code that demonstrates how to do this - in the pcredemo sample program. In the most general case, you have to - check to see if the newline convention recognizes CRLF as a newline, - and if so, and the current character is CR followed by LF, advance the + nary match again. There is some code that demonstrates how to do this + in the pcredemo sample program. In the most general case, you have to + check to see if the newline convention recognizes CRLF as a newline, + and if so, and the current character is CR followed by LF, advance the starting offset by two characters instead of one. PCRE_NO_START_OPTIMIZE - There are a number of optimizations that pcre_exec() uses at the start - of a match, in order to speed up the process. For example, if it is + There are a number of optimizations that pcre_exec() uses at the start + of a match, in order to speed up the process. For example, if it is known that an unanchored match must start with a specific character, it - searches the subject for that character, and fails immediately if it - cannot find it, without actually running the main matching function. + searches the subject for that character, and fails immediately if it + cannot find it, without actually running the main matching function. This means that a special item such as (*COMMIT) at the start of a pat- - tern is not considered until after a suitable starting point for the - match has been found. Also, when callouts or (*MARK) items are in use, + tern is not considered until after a suitable starting point for the + match has been found. Also, when callouts or (*MARK) items are in use, these "start-up" optimizations can cause them to be skipped if the pat- tern is never actually used. The start-up optimizations are in effect a pre-scan of the subject that takes place before the pattern is run. - The PCRE_NO_START_OPTIMIZE option disables the start-up optimizations, - possibly causing performance to suffer, but ensuring that in cases - where the result is "no match", the callouts do occur, and that items + The PCRE_NO_START_OPTIMIZE option disables the start-up optimizations, + possibly causing performance to suffer, but ensuring that in cases + where the result is "no match", the callouts do occur, and that items such as (*COMMIT) and (*MARK) are considered at every possible starting - position in the subject string. If PCRE_NO_START_OPTIMIZE is set at - compile time, it cannot be unset at matching time. The use of + position in the subject string. If PCRE_NO_START_OPTIMIZE is set at + compile time, it cannot be unset at matching time. The use of PCRE_NO_START_OPTIMIZE at matching time (that is, passing it to - pcre_exec()) disables JIT execution; in this situation, matching is + pcre_exec()) disables JIT execution; in this situation, matching is always done using interpretively. - Setting PCRE_NO_START_OPTIMIZE can change the outcome of a matching + Setting PCRE_NO_START_OPTIMIZE can change the outcome of a matching operation. Consider the pattern (*COMMIT)ABC - When this is compiled, PCRE records the fact that a match must start - with the character "A". Suppose the subject string is "DEFABC". The - start-up optimization scans along the subject, finds "A" and runs the - first match attempt from there. The (*COMMIT) item means that the pat- - tern must match the current starting position, which in this case, it - does. However, if the same match is run with PCRE_NO_START_OPTIMIZE - set, the initial scan along the subject string does not happen. The - first match attempt is run starting from "D" and when this fails, - (*COMMIT) prevents any further matches being tried, so the overall - result is "no match". If the pattern is studied, more start-up opti- - mizations may be used. For example, a minimum length for the subject + When this is compiled, PCRE records the fact that a match must start + with the character "A". Suppose the subject string is "DEFABC". The + start-up optimization scans along the subject, finds "A" and runs the + first match attempt from there. The (*COMMIT) item means that the pat- + tern must match the current starting position, which in this case, it + does. However, if the same match is run with PCRE_NO_START_OPTIMIZE + set, the initial scan along the subject string does not happen. The + first match attempt is run starting from "D" and when this fails, + (*COMMIT) prevents any further matches being tried, so the overall + result is "no match". If the pattern is studied, more start-up opti- + mizations may be used. For example, a minimum length for the subject may be recorded. Consider the pattern (*MARK:A)(X|Y) - The minimum length for a match is one character. If the subject is - "ABC", there will be attempts to match "ABC", "BC", "C", and then - finally an empty string. If the pattern is studied, the final attempt - does not take place, because PCRE knows that the subject is too short, - and so the (*MARK) is never encountered. In this case, studying the - pattern does not affect the overall match result, which is still "no + The minimum length for a match is one character. If the subject is + "ABC", there will be attempts to match "ABC", "BC", "C", and then + finally an empty string. If the pattern is studied, the final attempt + does not take place, because PCRE knows that the subject is too short, + and so the (*MARK) is never encountered. In this case, studying the + pattern does not affect the overall match result, which is still "no match", but it does affect the auxiliary information that is returned. PCRE_NO_UTF8_CHECK When PCRE_UTF8 is set at compile time, the validity of the subject as a - UTF-8 string is automatically checked when pcre_exec() is subsequently + UTF-8 string is automatically checked when pcre_exec() is subsequently called. The entire string is checked before any other processing takes - place. The value of startoffset is also checked to ensure that it - points to the start of a UTF-8 character. There is a discussion about - the validity of UTF-8 strings in the pcreunicode page. If an invalid - sequence of bytes is found, pcre_exec() returns the error + place. The value of startoffset is also checked to ensure that it + points to the start of a UTF-8 character. There is a discussion about + the validity of UTF-8 strings in the pcreunicode page. If an invalid + sequence of bytes is found, pcre_exec() returns the error PCRE_ERROR_BADUTF8 or, if PCRE_PARTIAL_HARD is set and the problem is a truncated character at the end of the subject, PCRE_ERROR_SHORTUTF8. In - both cases, information about the precise nature of the error may also - be returned (see the descriptions of these errors in the section enti- - tled Error return values from pcre_exec() below). If startoffset con- + both cases, information about the precise nature of the error may also + be returned (see the descriptions of these errors in the section enti- + tled Error return values from pcre_exec() below). If startoffset con- tains a value that does not point to the start of a UTF-8 character (or to the end of the subject), PCRE_ERROR_BADUTF8_OFFSET is returned. - If you already know that your subject is valid, and you want to skip - these checks for performance reasons, you can set the - PCRE_NO_UTF8_CHECK option when calling pcre_exec(). You might want to - do this for the second and subsequent calls to pcre_exec() if you are - making repeated calls to find all the matches in a single subject - string. However, you should be sure that the value of startoffset - points to the start of a character (or the end of the subject). When + If you already know that your subject is valid, and you want to skip + these checks for performance reasons, you can set the + PCRE_NO_UTF8_CHECK option when calling pcre_exec(). You might want to + do this for the second and subsequent calls to pcre_exec() if you are + making repeated calls to find all the matches in a single subject + string. However, you should be sure that the value of startoffset + points to the start of a character (or the end of the subject). When PCRE_NO_UTF8_CHECK is set, the effect of passing an invalid string as a - subject or an invalid value of startoffset is undefined. Your program + subject or an invalid value of startoffset is undefined. Your program may crash or loop. PCRE_PARTIAL_HARD PCRE_PARTIAL_SOFT - These options turn on the partial matching feature. For backwards com- - patibility, PCRE_PARTIAL is a synonym for PCRE_PARTIAL_SOFT. A partial - match occurs if the end of the subject string is reached successfully, - but there are not enough subject characters to complete the match. If + These options turn on the partial matching feature. For backwards com- + patibility, PCRE_PARTIAL is a synonym for PCRE_PARTIAL_SOFT. A partial + match occurs if the end of the subject string is reached successfully, + but there are not enough subject characters to complete the match. If this happens when PCRE_PARTIAL_SOFT (but not PCRE_PARTIAL_HARD) is set, - matching continues by testing any remaining alternatives. Only if no - complete match can be found is PCRE_ERROR_PARTIAL returned instead of - PCRE_ERROR_NOMATCH. In other words, PCRE_PARTIAL_SOFT says that the - caller is prepared to handle a partial match, but only if no complete + matching continues by testing any remaining alternatives. Only if no + complete match can be found is PCRE_ERROR_PARTIAL returned instead of + PCRE_ERROR_NOMATCH. In other words, PCRE_PARTIAL_SOFT says that the + caller is prepared to handle a partial match, but only if no complete match can be found. - If PCRE_PARTIAL_HARD is set, it overrides PCRE_PARTIAL_SOFT. In this - case, if a partial match is found, pcre_exec() immediately returns - PCRE_ERROR_PARTIAL, without considering any other alternatives. In - other words, when PCRE_PARTIAL_HARD is set, a partial match is consid- + If PCRE_PARTIAL_HARD is set, it overrides PCRE_PARTIAL_SOFT. In this + case, if a partial match is found, pcre_exec() immediately returns + PCRE_ERROR_PARTIAL, without considering any other alternatives. In + other words, when PCRE_PARTIAL_HARD is set, a partial match is consid- ered to be more important that an alternative complete match. - In both cases, the portion of the string that was inspected when the + In both cases, the portion of the string that was inspected when the partial match was found is set as the first matching string. There is a - more detailed discussion of partial and multi-segment matching, with + more detailed discussion of partial and multi-segment matching, with examples, in the pcrepartial documentation. The string to be matched by pcre_exec() - The subject string is passed to pcre_exec() as a pointer in subject, a - length in length, and a starting offset in startoffset. The units for - length and startoffset are bytes for the 8-bit library, 16-bit data - items for the 16-bit library, and 32-bit data items for the 32-bit + The subject string is passed to pcre_exec() as a pointer in subject, a + length in length, and a starting offset in startoffset. The units for + length and startoffset are bytes for the 8-bit library, 16-bit data + items for the 16-bit library, and 32-bit data items for the 32-bit library. - If startoffset is negative or greater than the length of the subject, - pcre_exec() returns PCRE_ERROR_BADOFFSET. When the starting offset is - zero, the search for a match starts at the beginning of the subject, - and this is by far the most common case. In UTF-8 or UTF-16 mode, the - offset must point to the start of a character, or the end of the sub- - ject (in UTF-32 mode, one data unit equals one character, so all off- - sets are valid). Unlike the pattern string, the subject may contain + If startoffset is negative or greater than the length of the subject, + pcre_exec() returns PCRE_ERROR_BADOFFSET. When the starting offset is + zero, the search for a match starts at the beginning of the subject, + and this is by far the most common case. In UTF-8 or UTF-16 mode, the + offset must point to the start of a character, or the end of the sub- + ject (in UTF-32 mode, one data unit equals one character, so all off- + sets are valid). Unlike the pattern string, the subject may contain binary zeroes. - A non-zero starting offset is useful when searching for another match - in the same subject by calling pcre_exec() again after a previous suc- - cess. Setting startoffset differs from just passing over a shortened - string and setting PCRE_NOTBOL in the case of a pattern that begins + A non-zero starting offset is useful when searching for another match + in the same subject by calling pcre_exec() again after a previous suc- + cess. Setting startoffset differs from just passing over a shortened + string and setting PCRE_NOTBOL in the case of a pattern that begins with any kind of lookbehind. For example, consider the pattern \Biss\B - which finds occurrences of "iss" in the middle of words. (\B matches - only if the current position in the subject is not a word boundary.) - When applied to the string "Mississipi" the first call to pcre_exec() - finds the first occurrence. If pcre_exec() is called again with just - the remainder of the subject, namely "issipi", it does not match, + which finds occurrences of "iss" in the middle of words. (\B matches + only if the current position in the subject is not a word boundary.) + When applied to the string "Mississipi" the first call to pcre_exec() + finds the first occurrence. If pcre_exec() is called again with just + the remainder of the subject, namely "issipi", it does not match, because \B is always false at the start of the subject, which is deemed - to be a word boundary. However, if pcre_exec() is passed the entire + to be a word boundary. However, if pcre_exec() is passed the entire string again, but with startoffset set to 4, it finds the second occur- - rence of "iss" because it is able to look behind the starting point to + rence of "iss" because it is able to look behind the starting point to discover that it is preceded by a letter. - Finding all the matches in a subject is tricky when the pattern can + Finding all the matches in a subject is tricky when the pattern can match an empty string. It is possible to emulate Perl's /g behaviour by - first trying the match again at the same offset, with the - PCRE_NOTEMPTY_ATSTART and PCRE_ANCHORED options, and then if that - fails, advancing the starting offset and trying an ordinary match + first trying the match again at the same offset, with the + PCRE_NOTEMPTY_ATSTART and PCRE_ANCHORED options, and then if that + fails, advancing the starting offset and trying an ordinary match again. There is some code that demonstrates how to do this in the pcre- demo sample program. In the most general case, you have to check to see - if the newline convention recognizes CRLF as a newline, and if so, and + if the newline convention recognizes CRLF as a newline, and if so, and the current character is CR followed by LF, advance the starting offset by two characters instead of one. - If a non-zero starting offset is passed when the pattern is anchored, + If a non-zero starting offset is passed when the pattern is anchored, one attempt to match at the given offset is made. This can only succeed - if the pattern does not require the match to be at the start of the + if the pattern does not require the match to be at the start of the subject. How pcre_exec() returns captured substrings - In general, a pattern matches a certain portion of the subject, and in - addition, further substrings from the subject may be picked out by - parts of the pattern. Following the usage in Jeffrey Friedl's book, - this is called "capturing" in what follows, and the phrase "capturing - subpattern" is used for a fragment of a pattern that picks out a sub- - string. PCRE supports several other kinds of parenthesized subpattern + In general, a pattern matches a certain portion of the subject, and in + addition, further substrings from the subject may be picked out by + parts of the pattern. Following the usage in Jeffrey Friedl's book, + this is called "capturing" in what follows, and the phrase "capturing + subpattern" is used for a fragment of a pattern that picks out a sub- + string. PCRE supports several other kinds of parenthesized subpattern that do not cause substrings to be captured. Captured substrings are returned to the caller via a vector of integers - whose address is passed in ovector. The number of elements in the vec- - tor is passed in ovecsize, which must be a non-negative number. Note: + whose address is passed in ovector. The number of elements in the vec- + tor is passed in ovecsize, which must be a non-negative number. Note: this argument is NOT the size of ovector in bytes. - The first two-thirds of the vector is used to pass back captured sub- - strings, each substring using a pair of integers. The remaining third - of the vector is used as workspace by pcre_exec() while matching cap- - turing subpatterns, and is not available for passing back information. - The number passed in ovecsize should always be a multiple of three. If + The first two-thirds of the vector is used to pass back captured sub- + strings, each substring using a pair of integers. The remaining third + of the vector is used as workspace by pcre_exec() while matching cap- + turing subpatterns, and is not available for passing back information. + The number passed in ovecsize should always be a multiple of three. If it is not, it is rounded down. - When a match is successful, information about captured substrings is - returned in pairs of integers, starting at the beginning of ovector, - and continuing up to two-thirds of its length at the most. The first - element of each pair is set to the offset of the first character in a - substring, and the second is set to the offset of the first character - after the end of a substring. These values are always data unit off- - sets, even in UTF mode. They are byte offsets in the 8-bit library, - 16-bit data item offsets in the 16-bit library, and 32-bit data item + When a match is successful, information about captured substrings is + returned in pairs of integers, starting at the beginning of ovector, + and continuing up to two-thirds of its length at the most. The first + element of each pair is set to the offset of the first character in a + substring, and the second is set to the offset of the first character + after the end of a substring. These values are always data unit off- + sets, even in UTF mode. They are byte offsets in the 8-bit library, + 16-bit data item offsets in the 16-bit library, and 32-bit data item offsets in the 32-bit library. Note: they are not character counts. - The first pair of integers, ovector[0] and ovector[1], identify the - portion of the subject string matched by the entire pattern. The next - pair is used for the first capturing subpattern, and so on. The value + The first pair of integers, ovector[0] and ovector[1], identify the + portion of the subject string matched by the entire pattern. The next + pair is used for the first capturing subpattern, and so on. The value returned by pcre_exec() is one more than the highest numbered pair that - has been set. For example, if two substrings have been captured, the - returned value is 3. If there are no capturing subpatterns, the return + has been set. For example, if two substrings have been captured, the + returned value is 3. If there are no capturing subpatterns, the return value from a successful match is 1, indicating that just the first pair of offsets has been set. If a capturing subpattern is matched repeatedly, it is the last portion of the string that it matched that is returned. - If the vector is too small to hold all the captured substring offsets, + If the vector is too small to hold all the captured substring offsets, it is used as far as possible (up to two-thirds of its length), and the - function returns a value of zero. If neither the actual string matched - nor any captured substrings are of interest, pcre_exec() may be called - with ovector passed as NULL and ovecsize as zero. However, if the pat- - tern contains back references and the ovector is not big enough to - remember the related substrings, PCRE has to get additional memory for - use during matching. Thus it is usually advisable to supply an ovector + function returns a value of zero. If neither the actual string matched + nor any captured substrings are of interest, pcre_exec() may be called + with ovector passed as NULL and ovecsize as zero. However, if the pat- + tern contains back references and the ovector is not big enough to + remember the related substrings, PCRE has to get additional memory for + use during matching. Thus it is usually advisable to supply an ovector of reasonable size. - There are some cases where zero is returned (indicating vector over- - flow) when in fact the vector is exactly the right size for the final + There are some cases where zero is returned (indicating vector over- + flow) when in fact the vector is exactly the right size for the final match. For example, consider the pattern (a)(?:(b)c|bd) - If a vector of 6 elements (allowing for only 1 captured substring) is + If a vector of 6 elements (allowing for only 1 captured substring) is given with subject string "abd", pcre_exec() will try to set the second captured string, thereby recording a vector overflow, before failing to - match "c" and backing up to try the second alternative. The zero - return, however, does correctly indicate that the maximum number of + match "c" and backing up to try the second alternative. The zero + return, however, does correctly indicate that the maximum number of slots (namely 2) have been filled. In similar cases where there is tem- - porary overflow, but the final number of used slots is actually less + porary overflow, but the final number of used slots is actually less than the maximum, a non-zero value is returned. The pcre_fullinfo() function can be used to find out how many capturing - subpatterns there are in a compiled pattern. The smallest size for - ovector that will allow for n captured substrings, in addition to the + subpatterns there are in a compiled pattern. The smallest size for + ovector that will allow for n captured substrings, in addition to the offsets of the substring matched by the whole pattern, is (n+1)*3. - It is possible for capturing subpattern number n+1 to match some part + It is possible for capturing subpattern number n+1 to match some part of the subject when subpattern n has not been used at all. For example, - if the string "abc" is matched against the pattern (a|(z))(bc) the + if the string "abc" is matched against the pattern (a|(z))(bc) the return from the function is 4, and subpatterns 1 and 3 are matched, but - 2 is not. When this happens, both values in the offset pairs corre- + 2 is not. When this happens, both values in the offset pairs corre- sponding to unused subpatterns are set to -1. - Offset values that correspond to unused subpatterns at the end of the - expression are also set to -1. For example, if the string "abc" is - matched against the pattern (abc)(x(yz)?)? subpatterns 2 and 3 are not - matched. The return from the function is 2, because the highest used - capturing subpattern number is 1, and the offsets for for the second - and third capturing subpatterns (assuming the vector is large enough, + Offset values that correspond to unused subpatterns at the end of the + expression are also set to -1. For example, if the string "abc" is + matched against the pattern (abc)(x(yz)?)? subpatterns 2 and 3 are not + matched. The return from the function is 2, because the highest used + capturing subpattern number is 1, and the offsets for for the second + and third capturing subpatterns (assuming the vector is large enough, of course) are set to -1. - Note: Elements in the first two-thirds of ovector that do not corre- - spond to capturing parentheses in the pattern are never changed. That - is, if a pattern contains n capturing parentheses, no more than ovec- - tor[0] to ovector[2n+1] are set by pcre_exec(). The other elements (in + Note: Elements in the first two-thirds of ovector that do not corre- + spond to capturing parentheses in the pattern are never changed. That + is, if a pattern contains n capturing parentheses, no more than ovec- + tor[0] to ovector[2n+1] are set by pcre_exec(). The other elements (in the first two-thirds) retain whatever values they previously had. - Some convenience functions are provided for extracting the captured + Some convenience functions are provided for extracting the captured substrings as separate strings. These are described below. Error return values from pcre_exec() - If pcre_exec() fails, it returns a negative number. The following are + If pcre_exec() fails, it returns a negative number. The following are defined in the header file: PCRE_ERROR_NOMATCH (-1) @@ -3613,7 +3612,7 @@ MATCHING A PATTERN: THE TRADITIONAL FUNCTION PCRE_ERROR_NULL (-2) - Either code or subject was passed as NULL, or ovector was NULL and + Either code or subject was passed as NULL, or ovector was NULL and ovecsize was not zero. PCRE_ERROR_BADOPTION (-3) @@ -3622,82 +3621,82 @@ MATCHING A PATTERN: THE TRADITIONAL FUNCTION PCRE_ERROR_BADMAGIC (-4) - PCRE stores a 4-byte "magic number" at the start of the compiled code, + PCRE stores a 4-byte "magic number" at the start of the compiled code, to catch the case when it is passed a junk pointer and to detect when a pattern that was compiled in an environment of one endianness is run in - an environment with the other endianness. This is the error that PCRE + an environment with the other endianness. This is the error that PCRE gives when the magic number is not present. PCRE_ERROR_UNKNOWN_OPCODE (-5) While running the pattern match, an unknown item was encountered in the - compiled pattern. This error could be caused by a bug in PCRE or by + compiled pattern. This error could be caused by a bug in PCRE or by overwriting of the compiled pattern. PCRE_ERROR_NOMEMORY (-6) - If a pattern contains back references, but the ovector that is passed + If a pattern contains back references, but the ovector that is passed to pcre_exec() is not big enough to remember the referenced substrings, - PCRE gets a block of memory at the start of matching to use for this - purpose. If the call via pcre_malloc() fails, this error is given. The + PCRE gets a block of memory at the start of matching to use for this + purpose. If the call via pcre_malloc() fails, this error is given. The memory is automatically freed at the end of matching. - This error is also given if pcre_stack_malloc() fails in pcre_exec(). - This can happen only when PCRE has been compiled with --disable-stack- + This error is also given if pcre_stack_malloc() fails in pcre_exec(). + This can happen only when PCRE has been compiled with --disable-stack- for-recursion. PCRE_ERROR_NOSUBSTRING (-7) - This error is used by the pcre_copy_substring(), pcre_get_substring(), + This error is used by the pcre_copy_substring(), pcre_get_substring(), and pcre_get_substring_list() functions (see below). It is never returned by pcre_exec(). PCRE_ERROR_MATCHLIMIT (-8) - The backtracking limit, as specified by the match_limit field in a - pcre_extra structure (or defaulted) was reached. See the description + The backtracking limit, as specified by the match_limit field in a + pcre_extra structure (or defaulted) was reached. See the description above. PCRE_ERROR_CALLOUT (-9) This error is never generated by pcre_exec() itself. It is provided for - use by callout functions that want to yield a distinctive error code. + use by callout functions that want to yield a distinctive error code. See the pcrecallout documentation for details. PCRE_ERROR_BADUTF8 (-10) - A string that contains an invalid UTF-8 byte sequence was passed as a - subject, and the PCRE_NO_UTF8_CHECK option was not set. If the size of - the output vector (ovecsize) is at least 2, the byte offset to the - start of the the invalid UTF-8 character is placed in the first ele- - ment, and a reason code is placed in the second element. The reason + A string that contains an invalid UTF-8 byte sequence was passed as a + subject, and the PCRE_NO_UTF8_CHECK option was not set. If the size of + the output vector (ovecsize) is at least 2, the byte offset to the + start of the the invalid UTF-8 character is placed in the first ele- + ment, and a reason code is placed in the second element. The reason codes are listed in the following section. For backward compatibility, - if PCRE_PARTIAL_HARD is set and the problem is a truncated UTF-8 char- - acter at the end of the subject (reason codes 1 to 5), + if PCRE_PARTIAL_HARD is set and the problem is a truncated UTF-8 char- + acter at the end of the subject (reason codes 1 to 5), PCRE_ERROR_SHORTUTF8 is returned instead of PCRE_ERROR_BADUTF8. PCRE_ERROR_BADUTF8_OFFSET (-11) - The UTF-8 byte sequence that was passed as a subject was checked and - found to be valid (the PCRE_NO_UTF8_CHECK option was not set), but the - value of startoffset did not point to the beginning of a UTF-8 charac- + The UTF-8 byte sequence that was passed as a subject was checked and + found to be valid (the PCRE_NO_UTF8_CHECK option was not set), but the + value of startoffset did not point to the beginning of a UTF-8 charac- ter or the end of the subject. PCRE_ERROR_PARTIAL (-12) - The subject string did not match, but it did match partially. See the + The subject string did not match, but it did match partially. See the pcrepartial documentation for details of partial matching. PCRE_ERROR_BADPARTIAL (-13) - This code is no longer in use. It was formerly returned when the - PCRE_PARTIAL option was used with a compiled pattern containing items - that were not supported for partial matching. From release 8.00 + This code is no longer in use. It was formerly returned when the + PCRE_PARTIAL option was used with a compiled pattern containing items + that were not supported for partial matching. From release 8.00 onwards, there are no restrictions on partial matching. PCRE_ERROR_INTERNAL (-14) - An unexpected internal error has occurred. This error could be caused + An unexpected internal error has occurred. This error could be caused by a bug in PCRE or by overwriting of the compiled pattern. PCRE_ERROR_BADCOUNT (-15) @@ -3707,7 +3706,7 @@ MATCHING A PATTERN: THE TRADITIONAL FUNCTION PCRE_ERROR_RECURSIONLIMIT (-21) The internal recursion limit, as specified by the match_limit_recursion - field in a pcre_extra structure (or defaulted) was reached. See the + field in a pcre_extra structure (or defaulted) was reached. See the description above. PCRE_ERROR_BADNEWLINE (-23) @@ -3721,29 +3720,29 @@ MATCHING A PATTERN: THE TRADITIONAL FUNCTION PCRE_ERROR_SHORTUTF8 (-25) - This error is returned instead of PCRE_ERROR_BADUTF8 when the subject - string ends with a truncated UTF-8 character and the PCRE_PARTIAL_HARD - option is set. Information about the failure is returned as for - PCRE_ERROR_BADUTF8. It is in fact sufficient to detect this case, but - this special error code for PCRE_PARTIAL_HARD precedes the implementa- - tion of returned information; it is retained for backwards compatibil- + This error is returned instead of PCRE_ERROR_BADUTF8 when the subject + string ends with a truncated UTF-8 character and the PCRE_PARTIAL_HARD + option is set. Information about the failure is returned as for + PCRE_ERROR_BADUTF8. It is in fact sufficient to detect this case, but + this special error code for PCRE_PARTIAL_HARD precedes the implementa- + tion of returned information; it is retained for backwards compatibil- ity. PCRE_ERROR_RECURSELOOP (-26) This error is returned when pcre_exec() detects a recursion loop within - the pattern. Specifically, it means that either the whole pattern or a - subpattern has been called recursively for the second time at the same + the pattern. Specifically, it means that either the whole pattern or a + subpattern has been called recursively for the second time at the same position in the subject string. Some simple patterns that might do this - are detected and faulted at compile time, but more complicated cases, + are detected and faulted at compile time, but more complicated cases, in particular mutual recursions between two different subpatterns, can- not be detected until run time. PCRE_ERROR_JIT_STACKLIMIT (-27) - This error is returned when a pattern that was successfully studied - using a JIT compile option is being matched, but the memory available - for the just-in-time processing stack is not large enough. See the + This error is returned when a pattern that was successfully studied + using a JIT compile option is being matched, but the memory available + for the just-in-time processing stack is not large enough. See the pcrejit documentation for more details. PCRE_ERROR_BADMODE (-28) @@ -3753,38 +3752,38 @@ MATCHING A PATTERN: THE TRADITIONAL FUNCTION PCRE_ERROR_BADENDIANNESS (-29) - This error is given if a pattern that was compiled and saved is - reloaded on a host with different endianness. The utility function + This error is given if a pattern that was compiled and saved is + reloaded on a host with different endianness. The utility function pcre_pattern_to_host_byte_order() can be used to convert such a pattern so that it runs on the new host. PCRE_ERROR_JIT_BADOPTION - This error is returned when a pattern that was successfully studied - using a JIT compile option is being matched, but the matching mode - (partial or complete match) does not correspond to any JIT compilation - mode. When the JIT fast path function is used, this error may be also - given for invalid options. See the pcrejit documentation for more + This error is returned when a pattern that was successfully studied + using a JIT compile option is being matched, but the matching mode + (partial or complete match) does not correspond to any JIT compilation + mode. When the JIT fast path function is used, this error may be also + given for invalid options. See the pcrejit documentation for more details. PCRE_ERROR_BADLENGTH (-32) - This error is given if pcre_exec() is called with a negative value for + This error is given if pcre_exec() is called with a negative value for the length argument. Error numbers -16 to -20, -22, and 30 are not used by pcre_exec(). Reason codes for invalid UTF-8 strings - This section applies only to the 8-bit library. The corresponding - information for the 16-bit and 32-bit libraries is given in the pcre16 + This section applies only to the 8-bit library. The corresponding + information for the 16-bit and 32-bit libraries is given in the pcre16 and pcre32 pages. When pcre_exec() returns either PCRE_ERROR_BADUTF8 or PCRE_ERROR_SHORT- - UTF8, and the size of the output vector (ovecsize) is at least 2, the - offset of the start of the invalid UTF-8 character is placed in the + UTF8, and the size of the output vector (ovecsize) is at least 2, the + offset of the start of the invalid UTF-8 character is placed in the first output vector element (ovector[0]) and a reason code is placed in - the second element (ovector[1]). The reason codes are given names in + the second element (ovector[1]). The reason codes are given names in the pcre.h header file: PCRE_UTF8_ERR1 @@ -3793,10 +3792,10 @@ MATCHING A PATTERN: THE TRADITIONAL FUNCTION PCRE_UTF8_ERR4 PCRE_UTF8_ERR5 - The string ends with a truncated UTF-8 character; the code specifies - how many bytes are missing (1 to 5). Although RFC 3629 restricts UTF-8 - characters to be no longer than 4 bytes, the encoding scheme (origi- - nally defined by RFC 2279) allows for up to 6 bytes, and this is + The string ends with a truncated UTF-8 character; the code specifies + how many bytes are missing (1 to 5). Although RFC 3629 restricts UTF-8 + characters to be no longer than 4 bytes, the encoding scheme (origi- + nally defined by RFC 2279) allows for up to 6 bytes, and this is checked first; hence the possibility of 4 or 5 missing bytes. PCRE_UTF8_ERR6 @@ -3806,24 +3805,24 @@ MATCHING A PATTERN: THE TRADITIONAL FUNCTION PCRE_UTF8_ERR10 The two most significant bits of the 2nd, 3rd, 4th, 5th, or 6th byte of - the character do not have the binary value 0b10 (that is, either the + the character do not have the binary value 0b10 (that is, either the most significant bit is 0, or the next bit is 1). PCRE_UTF8_ERR11 PCRE_UTF8_ERR12 - A character that is valid by the RFC 2279 rules is either 5 or 6 bytes + A character that is valid by the RFC 2279 rules is either 5 or 6 bytes long; these code points are excluded by RFC 3629. PCRE_UTF8_ERR13 - A 4-byte character has a value greater than 0x10fff; these code points + A 4-byte character has a value greater than 0x10fff; these code points are excluded by RFC 3629. PCRE_UTF8_ERR14 - A 3-byte character has a value in the range 0xd800 to 0xdfff; this - range of code points are reserved by RFC 3629 for use with UTF-16, and + A 3-byte character has a value in the range 0xd800 to 0xdfff; this + range of code points are reserved by RFC 3629 for use with UTF-16, and so are excluded from UTF-8. PCRE_UTF8_ERR15 @@ -3832,28 +3831,28 @@ MATCHING A PATTERN: THE TRADITIONAL FUNCTION PCRE_UTF8_ERR18 PCRE_UTF8_ERR19 - A 2-, 3-, 4-, 5-, or 6-byte character is "overlong", that is, it codes - for a value that can be represented by fewer bytes, which is invalid. - For example, the two bytes 0xc0, 0xae give the value 0x2e, whose cor- + A 2-, 3-, 4-, 5-, or 6-byte character is "overlong", that is, it codes + for a value that can be represented by fewer bytes, which is invalid. + For example, the two bytes 0xc0, 0xae give the value 0x2e, whose cor- rect coding uses just one byte. PCRE_UTF8_ERR20 The two most significant bits of the first byte of a character have the - binary value 0b10 (that is, the most significant bit is 1 and the sec- - ond is 0). Such a byte can only validly occur as the second or subse- + binary value 0b10 (that is, the most significant bit is 1 and the sec- + ond is 0). Such a byte can only validly occur as the second or subse- quent byte of a multi-byte character. PCRE_UTF8_ERR21 - The first byte of a character has the value 0xfe or 0xff. These values + The first byte of a character has the value 0xfe or 0xff. These values can never occur in a valid UTF-8 string. PCRE_UTF8_ERR22 - This error code was formerly used when the presence of a so-called - "non-character" caused an error. Unicode corrigendum #9 makes it clear - that such characters should not cause a string to be rejected, and so + This error code was formerly used when the presence of a so-called + "non-character" caused an error. Unicode corrigendum #9 makes it clear + that such characters should not cause a string to be rejected, and so this code is no longer in use and is never returned. @@ -3870,78 +3869,78 @@ EXTRACTING CAPTURED SUBSTRINGS BY NUMBER int pcre_get_substring_list(const char *subject, int *ovector, int stringcount, const char ***listptr); - Captured substrings can be accessed directly by using the offsets - returned by pcre_exec() in ovector. For convenience, the functions + Captured substrings can be accessed directly by using the offsets + returned by pcre_exec() in ovector. For convenience, the functions pcre_copy_substring(), pcre_get_substring(), and pcre_get_sub- - string_list() are provided for extracting captured substrings as new, - separate, zero-terminated strings. These functions identify substrings - by number. The next section describes functions for extracting named + string_list() are provided for extracting captured substrings as new, + separate, zero-terminated strings. These functions identify substrings + by number. The next section describes functions for extracting named substrings. - A substring that contains a binary zero is correctly extracted and has - a further zero added on the end, but the result is not, of course, a C - string. However, you can process such a string by referring to the - length that is returned by pcre_copy_substring() and pcre_get_sub- + A substring that contains a binary zero is correctly extracted and has + a further zero added on the end, but the result is not, of course, a C + string. However, you can process such a string by referring to the + length that is returned by pcre_copy_substring() and pcre_get_sub- string(). Unfortunately, the interface to pcre_get_substring_list() is - not adequate for handling strings containing binary zeros, because the + not adequate for handling strings containing binary zeros, because the end of the final string is not independently indicated. - The first three arguments are the same for all three of these func- - tions: subject is the subject string that has just been successfully + The first three arguments are the same for all three of these func- + tions: subject is the subject string that has just been successfully matched, ovector is a pointer to the vector of integer offsets that was passed to pcre_exec(), and stringcount is the number of substrings that - were captured by the match, including the substring that matched the + were captured by the match, including the substring that matched the entire regular expression. This is the value returned by pcre_exec() if - it is greater than zero. If pcre_exec() returned zero, indicating that - it ran out of space in ovector, the value passed as stringcount should + it is greater than zero. If pcre_exec() returned zero, indicating that + it ran out of space in ovector, the value passed as stringcount should be the number of elements in the vector divided by three. - The functions pcre_copy_substring() and pcre_get_substring() extract a - single substring, whose number is given as stringnumber. A value of - zero extracts the substring that matched the entire pattern, whereas - higher values extract the captured substrings. For pcre_copy_sub- - string(), the string is placed in buffer, whose length is given by - buffersize, while for pcre_get_substring() a new block of memory is - obtained via pcre_malloc, and its address is returned via stringptr. - The yield of the function is the length of the string, not including + The functions pcre_copy_substring() and pcre_get_substring() extract a + single substring, whose number is given as stringnumber. A value of + zero extracts the substring that matched the entire pattern, whereas + higher values extract the captured substrings. For pcre_copy_sub- + string(), the string is placed in buffer, whose length is given by + buffersize, while for pcre_get_substring() a new block of memory is + obtained via pcre_malloc, and its address is returned via stringptr. + The yield of the function is the length of the string, not including the terminating zero, or one of these error codes: PCRE_ERROR_NOMEMORY (-6) - The buffer was too small for pcre_copy_substring(), or the attempt to + The buffer was too small for pcre_copy_substring(), or the attempt to get memory failed for pcre_get_substring(). PCRE_ERROR_NOSUBSTRING (-7) There is no substring whose number is stringnumber. - The pcre_get_substring_list() function extracts all available sub- - strings and builds a list of pointers to them. All this is done in a + The pcre_get_substring_list() function extracts all available sub- + strings and builds a list of pointers to them. All this is done in a single block of memory that is obtained via pcre_malloc. The address of - the memory block is returned via listptr, which is also the start of - the list of string pointers. The end of the list is marked by a NULL - pointer. The yield of the function is zero if all went well, or the + the memory block is returned via listptr, which is also the start of + the list of string pointers. The end of the list is marked by a NULL + pointer. The yield of the function is zero if all went well, or the error code PCRE_ERROR_NOMEMORY (-6) if the attempt to get the memory block failed. - When any of these functions encounter a substring that is unset, which - can happen when capturing subpattern number n+1 matches some part of - the subject, but subpattern n has not been used at all, they return an + When any of these functions encounter a substring that is unset, which + can happen when capturing subpattern number n+1 matches some part of + the subject, but subpattern n has not been used at all, they return an empty string. This can be distinguished from a genuine zero-length sub- - string by inspecting the appropriate offset in ovector, which is nega- + string by inspecting the appropriate offset in ovector, which is nega- tive for unset substrings. - The two convenience functions pcre_free_substring() and pcre_free_sub- - string_list() can be used to free the memory returned by a previous + The two convenience functions pcre_free_substring() and pcre_free_sub- + string_list() can be used to free the memory returned by a previous call of pcre_get_substring() or pcre_get_substring_list(), respec- - tively. They do nothing more than call the function pointed to by - pcre_free, which of course could be called directly from a C program. - However, PCRE is used in some situations where it is linked via a spe- - cial interface to another programming language that cannot use - pcre_free directly; it is for these cases that the functions are pro- + tively. They do nothing more than call the function pointed to by + pcre_free, which of course could be called directly from a C program. + However, PCRE is used in some situations where it is linked via a spe- + cial interface to another programming language that cannot use + pcre_free directly; it is for these cases that the functions are pro- vided. @@ -3960,7 +3959,7 @@ EXTRACTING CAPTURED SUBSTRINGS BY NAME int stringcount, const char *stringname, const char **stringptr); - To extract a substring by name, you first have to find associated num- + To extract a substring by name, you first have to find associated num- ber. For example, for this pattern (a+)b(?\d+)... @@ -3969,35 +3968,35 @@ EXTRACTING CAPTURED SUBSTRINGS BY NAME be unique (PCRE_DUPNAMES was not set), you can find the number from the name by calling pcre_get_stringnumber(). The first argument is the com- piled pattern, and the second is the name. The yield of the function is - the subpattern number, or PCRE_ERROR_NOSUBSTRING (-7) if there is no + the subpattern number, or PCRE_ERROR_NOSUBSTRING (-7) if there is no subpattern of that name. Given the number, you can extract the substring directly, or use one of the functions described in the previous section. For convenience, there are also two functions that do the whole job. - Most of the arguments of pcre_copy_named_substring() and - pcre_get_named_substring() are the same as those for the similarly - named functions that extract by number. As these are described in the - previous section, they are not re-described here. There are just two + Most of the arguments of pcre_copy_named_substring() and + pcre_get_named_substring() are the same as those for the similarly + named functions that extract by number. As these are described in the + previous section, they are not re-described here. There are just two differences: - First, instead of a substring number, a substring name is given. Sec- + First, instead of a substring number, a substring name is given. Sec- ond, there is an extra argument, given at the start, which is a pointer - to the compiled pattern. This is needed in order to gain access to the + to the compiled pattern. This is needed in order to gain access to the name-to-number translation table. - These functions call pcre_get_stringnumber(), and if it succeeds, they - then call pcre_copy_substring() or pcre_get_substring(), as appropri- - ate. NOTE: If PCRE_DUPNAMES is set and there are duplicate names, the + These functions call pcre_get_stringnumber(), and if it succeeds, they + then call pcre_copy_substring() or pcre_get_substring(), as appropri- + ate. NOTE: If PCRE_DUPNAMES is set and there are duplicate names, the behaviour may not be what you want (see the next section). Warning: If the pattern uses the (?| feature to set up multiple subpat- - terns with the same number, as described in the section on duplicate - subpattern numbers in the pcrepattern page, you cannot use names to - distinguish the different subpatterns, because names are not included - in the compiled code. The matching process uses only numbers. For this - reason, the use of different names for subpatterns of the same number + terns with the same number, as described in the section on duplicate + subpattern numbers in the pcrepattern page, you cannot use names to + distinguish the different subpatterns, because names are not included + in the compiled code. The matching process uses only numbers. For this + reason, the use of different names for subpatterns of the same number causes an error at compile time. @@ -4006,76 +4005,76 @@ DUPLICATE SUBPATTERN NAMES int pcre_get_stringtable_entries(const pcre *code, const char *name, char **first, char **last); - When a pattern is compiled with the PCRE_DUPNAMES option, names for - subpatterns are not required to be unique. (Duplicate names are always - allowed for subpatterns with the same number, created by using the (?| - feature. Indeed, if such subpatterns are named, they are required to + When a pattern is compiled with the PCRE_DUPNAMES option, names for + subpatterns are not required to be unique. (Duplicate names are always + allowed for subpatterns with the same number, created by using the (?| + feature. Indeed, if such subpatterns are named, they are required to use the same names.) Normally, patterns with duplicate names are such that in any one match, - only one of the named subpatterns participates. An example is shown in + only one of the named subpatterns participates. An example is shown in the pcrepattern documentation. - When duplicates are present, pcre_copy_named_substring() and - pcre_get_named_substring() return the first substring corresponding to - the given name that is set. If none are set, PCRE_ERROR_NOSUBSTRING - (-7) is returned; no data is returned. The pcre_get_stringnumber() - function returns one of the numbers that are associated with the name, + When duplicates are present, pcre_copy_named_substring() and + pcre_get_named_substring() return the first substring corresponding to + the given name that is set. If none are set, PCRE_ERROR_NOSUBSTRING + (-7) is returned; no data is returned. The pcre_get_stringnumber() + function returns one of the numbers that are associated with the name, but it is not defined which it is. - If you want to get full details of all captured substrings for a given - name, you must use the pcre_get_stringtable_entries() function. The + If you want to get full details of all captured substrings for a given + name, you must use the pcre_get_stringtable_entries() function. The first argument is the compiled pattern, and the second is the name. The - third and fourth are pointers to variables which are updated by the + third and fourth are pointers to variables which are updated by the function. After it has run, they point to the first and last entries in - the name-to-number table for the given name. The function itself - returns the length of each entry, or PCRE_ERROR_NOSUBSTRING (-7) if - there are none. The format of the table is described above in the sec- - tion entitled Information about a pattern above. Given all the rele- - vant entries for the name, you can extract each of their numbers, and + the name-to-number table for the given name. The function itself + returns the length of each entry, or PCRE_ERROR_NOSUBSTRING (-7) if + there are none. The format of the table is described above in the sec- + tion entitled Information about a pattern above. Given all the rele- + vant entries for the name, you can extract each of their numbers, and hence the captured data, if any. FINDING ALL POSSIBLE MATCHES - The traditional matching function uses a similar algorithm to Perl, + The traditional matching function uses a similar algorithm to Perl, which stops when it finds the first match, starting at a given point in - the subject. If you want to find all possible matches, or the longest - possible match, consider using the alternative matching function (see - below) instead. If you cannot use the alternative function, but still - need to find all possible matches, you can kludge it up by making use + the subject. If you want to find all possible matches, or the longest + possible match, consider using the alternative matching function (see + below) instead. If you cannot use the alternative function, but still + need to find all possible matches, you can kludge it up by making use of the callout facility, which is described in the pcrecallout documen- tation. What you have to do is to insert a callout right at the end of the pat- - tern. When your callout function is called, extract and save the cur- - rent matched substring. Then return 1, which forces pcre_exec() to - backtrack and try other alternatives. Ultimately, when it runs out of + tern. When your callout function is called, extract and save the cur- + rent matched substring. Then return 1, which forces pcre_exec() to + backtrack and try other alternatives. Ultimately, when it runs out of matches, pcre_exec() will yield PCRE_ERROR_NOMATCH. OBTAINING AN ESTIMATE OF STACK USAGE - Matching certain patterns using pcre_exec() can use a lot of process - stack, which in certain environments can be rather limited in size. - Some users find it helpful to have an estimate of the amount of stack - that is used by pcre_exec(), to help them set recursion limits, as - described in the pcrestack documentation. The estimate that is output + Matching certain patterns using pcre_exec() can use a lot of process + stack, which in certain environments can be rather limited in size. + Some users find it helpful to have an estimate of the amount of stack + that is used by pcre_exec(), to help them set recursion limits, as + described in the pcrestack documentation. The estimate that is output by pcretest when called with the -m and -C options is obtained by call- - ing pcre_exec with the values NULL, NULL, NULL, -999, and -999 for its + ing pcre_exec with the values NULL, NULL, NULL, -999, and -999 for its first five arguments. - Normally, if its first argument is NULL, pcre_exec() immediately - returns the negative error code PCRE_ERROR_NULL, but with this special - combination of arguments, it returns instead a negative number whose - absolute value is the approximate stack frame size in bytes. (A nega- - tive number is used so that it is clear that no match has happened.) - The value is approximate because in some cases, recursive calls to + Normally, if its first argument is NULL, pcre_exec() immediately + returns the negative error code PCRE_ERROR_NULL, but with this special + combination of arguments, it returns instead a negative number whose + absolute value is the approximate stack frame size in bytes. (A nega- + tive number is used so that it is clear that no match has happened.) + The value is approximate because in some cases, recursive calls to pcre_exec() occur when there are one or two additional variables on the stack. - If PCRE has been compiled to use the heap instead of the stack for - recursion, the value returned is the size of each block that is + If PCRE has been compiled to use the heap instead of the stack for + recursion, the value returned is the size of each block that is obtained from the heap. @@ -4086,26 +4085,26 @@ MATCHING A PATTERN: THE ALTERNATIVE FUNCTION int options, int *ovector, int ovecsize, int *workspace, int wscount); - The function pcre_dfa_exec() is called to match a subject string - against a compiled pattern, using a matching algorithm that scans the - subject string just once, and does not backtrack. This has different - characteristics to the normal algorithm, and is not compatible with - Perl. Some of the features of PCRE patterns are not supported. Never- - theless, there are times when this kind of matching can be useful. For - a discussion of the two matching algorithms, and a list of features - that pcre_dfa_exec() does not support, see the pcrematching documenta- + The function pcre_dfa_exec() is called to match a subject string + against a compiled pattern, using a matching algorithm that scans the + subject string just once, and does not backtrack. This has different + characteristics to the normal algorithm, and is not compatible with + Perl. Some of the features of PCRE patterns are not supported. Never- + theless, there are times when this kind of matching can be useful. For + a discussion of the two matching algorithms, and a list of features + that pcre_dfa_exec() does not support, see the pcrematching documenta- tion. - The arguments for the pcre_dfa_exec() function are the same as for + The arguments for the pcre_dfa_exec() function are the same as for pcre_exec(), plus two extras. The ovector argument is used in a differ- - ent way, and this is described below. The other common arguments are - used in the same way as for pcre_exec(), so their description is not + ent way, and this is described below. The other common arguments are + used in the same way as for pcre_exec(), so their description is not repeated here. - The two additional arguments provide workspace for the function. The - workspace vector should contain at least 20 elements. It is used for + The two additional arguments provide workspace for the function. The + workspace vector should contain at least 20 elements. It is used for keeping track of multiple paths through the pattern tree. More - workspace will be needed for patterns and subjects where there are a + workspace will be needed for patterns and subjects where there are a lot of potential matches. Here is an example of a simple call to pcre_dfa_exec(): @@ -4127,55 +4126,55 @@ MATCHING A PATTERN: THE ALTERNATIVE FUNCTION Option bits for pcre_dfa_exec() - The unused bits of the options argument for pcre_dfa_exec() must be - zero. The only bits that may be set are PCRE_ANCHORED, PCRE_NEW- + The unused bits of the options argument for pcre_dfa_exec() must be + zero. The only bits that may be set are PCRE_ANCHORED, PCRE_NEW- LINE_xxx, PCRE_NOTBOL, PCRE_NOTEOL, PCRE_NOTEMPTY, - PCRE_NOTEMPTY_ATSTART, PCRE_NO_UTF8_CHECK, PCRE_BSR_ANYCRLF, - PCRE_BSR_UNICODE, PCRE_NO_START_OPTIMIZE, PCRE_PARTIAL_HARD, PCRE_PAR- - TIAL_SOFT, PCRE_DFA_SHORTEST, and PCRE_DFA_RESTART. All but the last - four of these are exactly the same as for pcre_exec(), so their + PCRE_NOTEMPTY_ATSTART, PCRE_NO_UTF8_CHECK, PCRE_BSR_ANYCRLF, + PCRE_BSR_UNICODE, PCRE_NO_START_OPTIMIZE, PCRE_PARTIAL_HARD, PCRE_PAR- + TIAL_SOFT, PCRE_DFA_SHORTEST, and PCRE_DFA_RESTART. All but the last + four of these are exactly the same as for pcre_exec(), so their description is not repeated here. PCRE_PARTIAL_HARD PCRE_PARTIAL_SOFT - These have the same general effect as they do for pcre_exec(), but the - details are slightly different. When PCRE_PARTIAL_HARD is set for - pcre_dfa_exec(), it returns PCRE_ERROR_PARTIAL if the end of the sub- - ject is reached and there is still at least one matching possibility + These have the same general effect as they do for pcre_exec(), but the + details are slightly different. When PCRE_PARTIAL_HARD is set for + pcre_dfa_exec(), it returns PCRE_ERROR_PARTIAL if the end of the sub- + ject is reached and there is still at least one matching possibility that requires additional characters. This happens even if some complete matches have also been found. When PCRE_PARTIAL_SOFT is set, the return code PCRE_ERROR_NOMATCH is converted into PCRE_ERROR_PARTIAL if the end - of the subject is reached, there have been no complete matches, but - there is still at least one matching possibility. The portion of the - string that was inspected when the longest partial match was found is - set as the first matching string in both cases. There is a more - detailed discussion of partial and multi-segment matching, with exam- + of the subject is reached, there have been no complete matches, but + there is still at least one matching possibility. The portion of the + string that was inspected when the longest partial match was found is + set as the first matching string in both cases. There is a more + detailed discussion of partial and multi-segment matching, with exam- ples, in the pcrepartial documentation. PCRE_DFA_SHORTEST - Setting the PCRE_DFA_SHORTEST option causes the matching algorithm to + Setting the PCRE_DFA_SHORTEST option causes the matching algorithm to stop as soon as it has found one match. Because of the way the alterna- - tive algorithm works, this is necessarily the shortest possible match + tive algorithm works, this is necessarily the shortest possible match at the first possible matching point in the subject string. PCRE_DFA_RESTART When pcre_dfa_exec() returns a partial match, it is possible to call it - again, with additional subject characters, and have it continue with - the same match. The PCRE_DFA_RESTART option requests this action; when - it is set, the workspace and wscount options must reference the same - vector as before because data about the match so far is left in them + again, with additional subject characters, and have it continue with + the same match. The PCRE_DFA_RESTART option requests this action; when + it is set, the workspace and wscount options must reference the same + vector as before because data about the match so far is left in them after a partial match. There is more discussion of this facility in the pcrepartial documentation. Successful returns from pcre_dfa_exec() - When pcre_dfa_exec() succeeds, it may have matched more than one sub- + When pcre_dfa_exec() succeeds, it may have matched more than one sub- string in the subject. Note, however, that all the matches from one run - of the function start at the same point in the subject. The shorter - matches are all initial substrings of the longer matches. For example, + of the function start at the same point in the subject. The shorter + matches are all initial substrings of the longer matches. For example, if the pattern <.*> @@ -4190,79 +4189,79 @@ MATCHING A PATTERN: THE ALTERNATIVE FUNCTION - On success, the yield of the function is a number greater than zero, - which is the number of matched substrings. The substrings themselves - are returned in ovector. Each string uses two elements; the first is - the offset to the start, and the second is the offset to the end. In - fact, all the strings have the same start offset. (Space could have - been saved by giving this only once, but it was decided to retain some - compatibility with the way pcre_exec() returns data, even though the + On success, the yield of the function is a number greater than zero, + which is the number of matched substrings. The substrings themselves + are returned in ovector. Each string uses two elements; the first is + the offset to the start, and the second is the offset to the end. In + fact, all the strings have the same start offset. (Space could have + been saved by giving this only once, but it was decided to retain some + compatibility with the way pcre_exec() returns data, even though the meaning of the strings is different.) The strings are returned in reverse order of length; that is, the long- - est matching string is given first. If there were too many matches to - fit into ovector, the yield of the function is zero, and the vector is - filled with the longest matches. Unlike pcre_exec(), pcre_dfa_exec() + est matching string is given first. If there were too many matches to + fit into ovector, the yield of the function is zero, and the vector is + filled with the longest matches. Unlike pcre_exec(), pcre_dfa_exec() can use the entire ovector for returning matched strings. - NOTE: PCRE's "auto-possessification" optimization usually applies to - character repeats at the end of a pattern (as well as internally). For - example, the pattern "a\d+" is compiled as if it were "a\d++" because + NOTE: PCRE's "auto-possessification" optimization usually applies to + character repeats at the end of a pattern (as well as internally). For + example, the pattern "a\d+" is compiled as if it were "a\d++" because there is no point even considering the possibility of backtracking into - the repeated digits. For DFA matching, this means that only one possi- - ble match is found. If you really do want multiple matches in such - cases, either use an ungreedy repeat ("a\d+?") or set the + the repeated digits. For DFA matching, this means that only one possi- + ble match is found. If you really do want multiple matches in such + cases, either use an ungreedy repeat ("a\d+?") or set the PCRE_NO_AUTO_POSSESS option when compiling. Error returns from pcre_dfa_exec() - The pcre_dfa_exec() function returns a negative number when it fails. - Many of the errors are the same as for pcre_exec(), and these are - described above. There are in addition the following errors that are + The pcre_dfa_exec() function returns a negative number when it fails. + Many of the errors are the same as for pcre_exec(), and these are + described above. There are in addition the following errors that are specific to pcre_dfa_exec(): PCRE_ERROR_DFA_UITEM (-16) - This return is given if pcre_dfa_exec() encounters an item in the pat- - tern that it does not support, for instance, the use of \C or a back + This return is given if pcre_dfa_exec() encounters an item in the pat- + tern that it does not support, for instance, the use of \C or a back reference. PCRE_ERROR_DFA_UCOND (-17) - This return is given if pcre_dfa_exec() encounters a condition item - that uses a back reference for the condition, or a test for recursion + This return is given if pcre_dfa_exec() encounters a condition item + that uses a back reference for the condition, or a test for recursion in a specific group. These are not supported. PCRE_ERROR_DFA_UMLIMIT (-18) - This return is given if pcre_dfa_exec() is called with an extra block - that contains a setting of the match_limit or match_limit_recursion - fields. This is not supported (these fields are meaningless for DFA + This return is given if pcre_dfa_exec() is called with an extra block + that contains a setting of the match_limit or match_limit_recursion + fields. This is not supported (these fields are meaningless for DFA matching). PCRE_ERROR_DFA_WSSIZE (-19) - This return is given if pcre_dfa_exec() runs out of space in the + This return is given if pcre_dfa_exec() runs out of space in the workspace vector. PCRE_ERROR_DFA_RECURSE (-20) - When a recursive subpattern is processed, the matching function calls - itself recursively, using private vectors for ovector and workspace. - This error is given if the output vector is not large enough. This + When a recursive subpattern is processed, the matching function calls + itself recursively, using private vectors for ovector and workspace. + This error is given if the output vector is not large enough. This should be extremely rare, as a vector of size 1000 is used. PCRE_ERROR_DFA_BADRESTART (-30) - When pcre_dfa_exec() is called with the PCRE_DFA_RESTART option, some - plausibility checks are made on the contents of the workspace, which - should contain data about the previous partial match. If any of these + When pcre_dfa_exec() is called with the PCRE_DFA_RESTART option, some + plausibility checks are made on the contents of the workspace, which + should contain data about the previous partial match. If any of these checks fail, this error is given. SEE ALSO - pcre16(3), pcre32(3), pcrebuild(3), pcrecallout(3), pcrecpp(3)(3), + pcre16(3), pcre32(3), pcrebuild(3), pcrecallout(3), pcrecpp(3)(3), pcrematching(3), pcrepartial(3), pcreposix(3), pcreprecompile(3), pcre- sample(3), pcrestack(3). @@ -4276,8 +4275,8 @@ AUTHOR REVISION - Last updated: 09 February 2014 - Copyright (c) 1997-2014 University of Cambridge. + Last updated: 18 December 2015 + Copyright (c) 1997-2015 University of Cambridge. ------------------------------------------------------------------------------ diff --git a/pcre/doc/pcreapi.3 b/pcre/doc/pcreapi.3 index ab3eaa0b521..6e7c7c6e3ce 100644 --- a/pcre/doc/pcreapi.3 +++ b/pcre/doc/pcreapi.3 @@ -1,4 +1,4 @@ -.TH PCREAPI 3 "09 February 2014" "PCRE 8.35" +.TH PCREAPI 3 "18 December 2015" "PCRE 8.39" .SH NAME PCRE - Perl-compatible regular expressions .sp @@ -273,9 +273,8 @@ documentation for details of how to do this. It is a non-standard way of building PCRE, for use in environments that have limited stacks. Because of the greater use of memory management, it runs more slowly. Separate functions are provided so that special-purpose external code can be used for this case. When -used, these functions are always called in a stack-like manner (last obtained, -first freed), and always for memory blocks of the same size. There is a -discussion about PCRE's stack usage in the +used, these functions always allocate memory blocks of the same size. There is +a discussion about PCRE's stack usage in the .\" HREF \fBpcrestack\fP .\" @@ -2914,6 +2913,6 @@ Cambridge CB2 3QH, England. .rs .sp .nf -Last updated: 09 February 2014 -Copyright (c) 1997-2014 University of Cambridge. +Last updated: 18 December 2015 +Copyright (c) 1997-2015 University of Cambridge. .fi diff --git a/pcre/pcre_compile.c b/pcre/pcre_compile.c index 4d3b3139dea..7cd39501230 100644 --- a/pcre/pcre_compile.c +++ b/pcre/pcre_compile.c @@ -6,7 +6,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel - Copyright (c) 1997-2014 University of Cambridge + Copyright (c) 1997-2016 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -485,7 +485,7 @@ static const char error_texts[] = "lookbehind assertion is not fixed length\0" "malformed number or name after (?(\0" "conditional group contains more than two branches\0" - "assertion expected after (?(\0" + "assertion expected after (?( or (?(?C)\0" "(?R or (?[+-]digits must be followed by )\0" /* 30 */ "unknown POSIX class name\0" @@ -560,6 +560,7 @@ static const char error_texts[] = /* 85 */ "parentheses are too deeply nested (stack check)\0" "digits missing in \\x{} or \\o{}\0" + "regular expression is too complicated\0" ; /* Table to identify digits and hex digits. This is used when compiling @@ -4566,6 +4567,10 @@ for (;; ptr++) pcre_uint32 ec; pcre_uchar mcbuffer[8]; + /* Come here to restart the loop without advancing the pointer. */ + + REDO_LOOP: + /* Get next character in the pattern */ c = *ptr; @@ -4591,7 +4596,8 @@ for (;; ptr++) if (code > cd->start_workspace + cd->workspace_size - WORK_SIZE_SAFETY_MARGIN) /* Check for overrun */ { - *errorcodeptr = ERR52; + *errorcodeptr = (code >= cd->start_workspace + cd->workspace_size)? + ERR52 : ERR87; goto FAILED; } @@ -4645,9 +4651,10 @@ for (;; ptr++) goto FAILED; } - /* If in \Q...\E, check for the end; if not, we have a literal */ + /* If in \Q...\E, check for the end; if not, we have a literal. Otherwise an + isolated \E is ignored. */ - if (inescq && c != CHAR_NULL) + if (c != CHAR_NULL) { if (c == CHAR_BACKSLASH && ptr[1] == CHAR_E) { @@ -4655,7 +4662,7 @@ for (;; ptr++) ptr++; continue; } - else + else if (inescq) { if (previous_callout != NULL) { @@ -4670,18 +4677,27 @@ for (;; ptr++) } goto NORMAL_CHAR; } - /* Control does not reach here. */ + + /* Check for the start of a \Q...\E sequence. We must do this here rather + than later in case it is immediately followed by \E, which turns it into a + "do nothing" sequence. */ + + if (c == CHAR_BACKSLASH && ptr[1] == CHAR_Q) + { + inescq = TRUE; + ptr++; + continue; + } } - /* In extended mode, skip white space and comments. We need a loop in order - to check for more white space and more comments after a comment. */ + /* In extended mode, skip white space and comments. */ if ((options & PCRE_EXTENDED) != 0) { - for (;;) + const pcre_uchar *wscptr = ptr; + while (MAX_255(c) && (cd->ctypes[c] & ctype_space) != 0) c = *(++ptr); + if (c == CHAR_NUMBER_SIGN) { - while (MAX_255(c) && (cd->ctypes[c] & ctype_space) != 0) c = *(++ptr); - if (c != CHAR_NUMBER_SIGN) break; ptr++; while (*ptr != CHAR_NULL) { @@ -4695,8 +4711,29 @@ for (;; ptr++) if (utf) FORWARDCHAR(ptr); #endif } - c = *ptr; /* Either NULL or the char after a newline */ } + + /* If we skipped any characters, restart the loop. Otherwise, we didn't see + a comment. */ + + if (ptr > wscptr) goto REDO_LOOP; + } + + /* Skip over (?# comments. We need to do this here because we want to know if + the next thing is a quantifier, and these comments may come between an item + and its quantifier. */ + + if (c == CHAR_LEFT_PARENTHESIS && ptr[1] == CHAR_QUESTION_MARK && + ptr[2] == CHAR_NUMBER_SIGN) + { + ptr += 3; + while (*ptr != CHAR_NULL && *ptr != CHAR_RIGHT_PARENTHESIS) ptr++; + if (*ptr == CHAR_NULL) + { + *errorcodeptr = ERR18; + goto FAILED; + } + continue; } /* See if the next thing is a quantifier. */ @@ -4820,15 +4857,15 @@ for (;; ptr++) if (STRNCMP_UC_C8(ptr+1, STRING_WEIRD_STARTWORD, 6) == 0) { nestptr = ptr + 7; - ptr = sub_start_of_word - 1; - continue; + ptr = sub_start_of_word; + goto REDO_LOOP; } if (STRNCMP_UC_C8(ptr+1, STRING_WEIRD_ENDWORD, 6) == 0) { nestptr = ptr + 7; - ptr = sub_end_of_word - 1; - continue; + ptr = sub_end_of_word; + goto REDO_LOOP; } /* Handle a real character class. */ @@ -5046,20 +5083,22 @@ for (;; ptr++) ptr = tempptr + 1; continue; - /* For the other POSIX classes (ascii, xdigit) we are going to fall - through to the non-UCP case and build a bit map for characters with - code points less than 256. If we are in a negated POSIX class - within a non-negated overall class, characters with code points - greater than 255 must all match. In the special case where we have - not yet generated any xclass data, and this is the final item in - the overall class, we need do nothing: later on, the opcode + /* For the other POSIX classes (ascii, cntrl, xdigit) we are going + to fall through to the non-UCP case and build a bit map for + characters with code points less than 256. If we are in a negated + POSIX class, characters with code points greater than 255 must + either all match or all not match. In the special case where we + have not yet generated any xclass data, and this is the final item + in the overall class, we need do nothing: later on, the opcode OP_NCLASS will be used to indicate that characters greater than 255 are acceptable. If we have already seen an xclass item or one may follow (we have to assume that it might if this is not the end of - the class), explicitly match all wide codepoints. */ + the class), explicitly list all wide codepoints, which will then + either not match or match, depending on whether the class is or is + not negated. */ default: - if (!negate_class && local_negate && + if (local_negate && (xclass || tempptr[2] != CHAR_RIGHT_SQUARE_BRACKET)) { *class_uchardata++ = XCL_RANGE; @@ -6529,21 +6568,6 @@ for (;; ptr++) case CHAR_LEFT_PARENTHESIS: ptr++; - /* First deal with comments. Putting this code right at the start ensures - that comments have no bad side effects. */ - - if (ptr[0] == CHAR_QUESTION_MARK && ptr[1] == CHAR_NUMBER_SIGN) - { - ptr += 2; - while (*ptr != CHAR_NULL && *ptr != CHAR_RIGHT_PARENTHESIS) ptr++; - if (*ptr == CHAR_NULL) - { - *errorcodeptr = ERR18; - goto FAILED; - } - continue; - } - /* Now deal with various "verbs" that can be introduced by '*'. */ if (ptr[0] == CHAR_ASTERISK && (ptr[1] == ':' @@ -6604,8 +6628,21 @@ for (;; ptr++) cd->had_accept = TRUE; for (oc = cd->open_caps; oc != NULL; oc = oc->next) { - *code++ = OP_CLOSE; - PUT2INC(code, 0, oc->number); + if (lengthptr != NULL) + { +#ifdef COMPILE_PCRE8 + *lengthptr += 1 + IMM2_SIZE; +#elif defined COMPILE_PCRE16 + *lengthptr += 2 + IMM2_SIZE; +#elif defined COMPILE_PCRE32 + *lengthptr += 4 + IMM2_SIZE; +#endif + } + else + { + *code++ = OP_CLOSE; + PUT2INC(code, 0, oc->number); + } } setverb = *code++ = (cd->assert_depth > 0)? OP_ASSERT_ACCEPT : OP_ACCEPT; @@ -6734,6 +6771,15 @@ for (;; ptr++) for (i = 3;; i++) if (!IS_DIGIT(ptr[i])) break; if (ptr[i] == CHAR_RIGHT_PARENTHESIS) tempptr += i + 1; + + /* tempptr should now be pointing to the opening parenthesis of the + assertion condition. */ + + if (*tempptr != CHAR_LEFT_PARENTHESIS) + { + *errorcodeptr = ERR28; + goto FAILED; + } } /* For conditions that are assertions, check the syntax, and then exit @@ -7258,7 +7304,7 @@ for (;; ptr++) issue is fixed "properly" in PCRE2. As PCRE1 is now in maintenance only mode, we finesse the bug by allowing more memory always. */ - *lengthptr += 2 + 2*LINK_SIZE; + *lengthptr += 4 + 4*LINK_SIZE; /* It is even worse than that. The current reference may be to an existing named group with a different number (so apparently not @@ -7274,7 +7320,12 @@ for (;; ptr++) so far in order to get the number. If the name is not found, leave the value of recno as 0 for a forward reference. */ - else + /* This patch (removing "else") fixes a problem when a reference is + to multiple identically named nested groups from within the nest. + Once again, it is not the "proper" fix, and it results in an + over-allocation of memory. */ + + /* else */ { ng = cd->named_groups; for (i = 0; i < cd->names_found; i++, ng++) @@ -7585,39 +7636,15 @@ for (;; ptr++) newoptions = (options | set) & (~unset); /* If the options ended with ')' this is not the start of a nested - group with option changes, so the options change at this level. If this - item is right at the start of the pattern, the options can be - abstracted and made external in the pre-compile phase, and ignored in - the compile phase. This can be helpful when matching -- for instance in - caseless checking of required bytes. - - If the code pointer is not (cd->start_code + 1 + LINK_SIZE), we are - definitely *not* at the start of the pattern because something has been - compiled. In the pre-compile phase, however, the code pointer can have - that value after the start, because it gets reset as code is discarded - during the pre-compile. However, this can happen only at top level - if - we are within parentheses, the starting BRA will still be present. At - any parenthesis level, the length value can be used to test if anything - has been compiled at that level. Thus, a test for both these conditions - is necessary to ensure we correctly detect the start of the pattern in - both phases. - + group with option changes, so the options change at this level. If we are not at the pattern start, reset the greedy defaults and the case value for firstchar and reqchar. */ if (*ptr == CHAR_RIGHT_PARENTHESIS) { - if (code == cd->start_code + 1 + LINK_SIZE && - (lengthptr == NULL || *lengthptr == 2 + 2*LINK_SIZE)) - { - cd->external_options = newoptions; - } - else - { - greedy_default = ((newoptions & PCRE_UNGREEDY) != 0); - greedy_non_default = greedy_default ^ 1; - req_caseopt = ((newoptions & PCRE_CASELESS) != 0)? REQ_CASELESS:0; - } + greedy_default = ((newoptions & PCRE_UNGREEDY) != 0); + greedy_non_default = greedy_default ^ 1; + req_caseopt = ((newoptions & PCRE_CASELESS) != 0)? REQ_CASELESS:0; /* Change options at this level, and pass them back for use in subsequent branches. */ @@ -7896,16 +7923,6 @@ for (;; ptr++) c = ec; else { - if (escape == ESC_Q) /* Handle start of quoted string */ - { - if (ptr[1] == CHAR_BACKSLASH && ptr[2] == CHAR_E) - ptr += 2; /* avoid empty string */ - else inescq = TRUE; - continue; - } - - if (escape == ESC_E) continue; /* Perl ignores an orphan \E */ - /* For metasequences that actually match a character, we disable the setting of a first character if it hasn't already been set. */ diff --git a/pcre/pcre_get.c b/pcre/pcre_get.c index 8094b34bbfb..9475d5e88cd 100644 --- a/pcre/pcre_get.c +++ b/pcre/pcre_get.c @@ -250,6 +250,7 @@ Arguments: code the compiled regex stringname the name of the capturing substring ovector the vector of matched substrings + stringcount number of captured substrings Returns: the number of the first that is set, or the number of the last one if none are set, @@ -258,13 +259,16 @@ Returns: the number of the first that is set, #if defined COMPILE_PCRE8 static int -get_first_set(const pcre *code, const char *stringname, int *ovector) +get_first_set(const pcre *code, const char *stringname, int *ovector, + int stringcount) #elif defined COMPILE_PCRE16 static int -get_first_set(const pcre16 *code, PCRE_SPTR16 stringname, int *ovector) +get_first_set(const pcre16 *code, PCRE_SPTR16 stringname, int *ovector, + int stringcount) #elif defined COMPILE_PCRE32 static int -get_first_set(const pcre32 *code, PCRE_SPTR32 stringname, int *ovector) +get_first_set(const pcre32 *code, PCRE_SPTR32 stringname, int *ovector, + int stringcount) #endif { const REAL_PCRE *re = (const REAL_PCRE *)code; @@ -295,7 +299,7 @@ if (entrysize <= 0) return entrysize; for (entry = (pcre_uchar *)first; entry <= (pcre_uchar *)last; entry += entrysize) { int n = GET2(entry, 0); - if (ovector[n*2] >= 0) return n; + if (n < stringcount && ovector[n*2] >= 0) return n; } return GET2(entry, 0); } @@ -402,7 +406,7 @@ pcre32_copy_named_substring(const pcre32 *code, PCRE_SPTR32 subject, PCRE_UCHAR32 *buffer, int size) #endif { -int n = get_first_set(code, stringname, ovector); +int n = get_first_set(code, stringname, ovector, stringcount); if (n <= 0) return n; #if defined COMPILE_PCRE8 return pcre_copy_substring(subject, ovector, stringcount, n, buffer, size); @@ -457,7 +461,10 @@ pcre_uchar **stringlist; pcre_uchar *p; for (i = 0; i < double_count; i += 2) - size += sizeof(pcre_uchar *) + IN_UCHARS(ovector[i+1] - ovector[i] + 1); + { + size += sizeof(pcre_uchar *) + IN_UCHARS(1); + if (ovector[i+1] > ovector[i]) size += IN_UCHARS(ovector[i+1] - ovector[i]); + } stringlist = (pcre_uchar **)(PUBL(malloc))(size); if (stringlist == NULL) return PCRE_ERROR_NOMEMORY; @@ -473,7 +480,7 @@ p = (pcre_uchar *)(stringlist + stringcount + 1); for (i = 0; i < double_count; i += 2) { - int len = ovector[i+1] - ovector[i]; + int len = (ovector[i+1] > ovector[i])? (ovector[i+1] - ovector[i]) : 0; memcpy(p, subject + ovector[i], IN_UCHARS(len)); *stringlist++ = p; p += len; @@ -619,7 +626,7 @@ pcre32_get_named_substring(const pcre32 *code, PCRE_SPTR32 subject, PCRE_SPTR32 *stringptr) #endif { -int n = get_first_set(code, stringname, ovector); +int n = get_first_set(code, stringname, ovector, stringcount); if (n <= 0) return n; #if defined COMPILE_PCRE8 return pcre_get_substring(subject, ovector, stringcount, n, stringptr); diff --git a/pcre/pcre_internal.h b/pcre/pcre_internal.h index f7a5ee7aa6f..2923b29f82d 100644 --- a/pcre/pcre_internal.h +++ b/pcre/pcre_internal.h @@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel - Copyright (c) 1997-2014 University of Cambridge + Copyright (c) 1997-2016 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -275,7 +275,7 @@ pcre.h(.in) and disable (comment out) this message. */ typedef pcre_uint16 pcre_uchar; #define UCHAR_SHIFT (1) -#define IN_UCHARS(x) ((x) << UCHAR_SHIFT) +#define IN_UCHARS(x) ((x) * 2) #define MAX_255(c) ((c) <= 255u) #define TABLE_GET(c, table, default) (MAX_255(c)? ((table)[c]):(default)) @@ -283,7 +283,7 @@ typedef pcre_uint16 pcre_uchar; typedef pcre_uint32 pcre_uchar; #define UCHAR_SHIFT (2) -#define IN_UCHARS(x) ((x) << UCHAR_SHIFT) +#define IN_UCHARS(x) ((x) * 4) #define MAX_255(c) ((c) <= 255u) #define TABLE_GET(c, table, default) (MAX_255(c)? ((table)[c]):(default)) @@ -2289,7 +2289,7 @@ enum { ERR0, ERR1, ERR2, ERR3, ERR4, ERR5, ERR6, ERR7, ERR8, ERR9, ERR50, ERR51, ERR52, ERR53, ERR54, ERR55, ERR56, ERR57, ERR58, ERR59, ERR60, ERR61, ERR62, ERR63, ERR64, ERR65, ERR66, ERR67, ERR68, ERR69, ERR70, ERR71, ERR72, ERR73, ERR74, ERR75, ERR76, ERR77, ERR78, ERR79, - ERR80, ERR81, ERR82, ERR83, ERR84, ERR85, ERR86, ERRCOUNT }; + ERR80, ERR81, ERR82, ERR83, ERR84, ERR85, ERR86, ERR87, ERRCOUNT }; /* JIT compiling modes. The function list is indexed by them. */ diff --git a/pcre/pcre_jit_compile.c b/pcre/pcre_jit_compile.c index 445de0cbefe..4f15a27ac28 100644 --- a/pcre/pcre_jit_compile.c +++ b/pcre/pcre_jit_compile.c @@ -168,13 +168,13 @@ typedef struct jit_arguments { pcre_uchar *mark_ptr; void *callout_data; /* Everything else after. */ - pcre_uint32 limit_match; + sljit_u32 limit_match; int real_offset_count; int offset_count; - pcre_uint8 notbol; - pcre_uint8 noteol; - pcre_uint8 notempty; - pcre_uint8 notempty_atstart; + sljit_u8 notbol; + sljit_u8 noteol; + sljit_u8 notempty; + sljit_u8 notempty_atstart; } jit_arguments; typedef struct executable_functions { @@ -183,8 +183,8 @@ typedef struct executable_functions { sljit_uw executable_sizes[JIT_NUMBER_OF_COMPILE_MODES]; PUBL(jit_callback) callback; void *userdata; - pcre_uint32 top_bracket; - pcre_uint32 limit_match; + sljit_u32 top_bracket; + sljit_u32 limit_match; } executable_functions; typedef struct jump_list { @@ -277,11 +277,25 @@ typedef struct braminzero_backtrack { struct sljit_label *matchingpath; } braminzero_backtrack; -typedef struct iterator_backtrack { +typedef struct char_iterator_backtrack { backtrack_common common; /* Next iteration. */ struct sljit_label *matchingpath; -} iterator_backtrack; + union { + jump_list *backtracks; + struct { + unsigned int othercasebit; + pcre_uchar chr; + BOOL enabled; + } charpos; + } u; +} char_iterator_backtrack; + +typedef struct ref_iterator_backtrack { + backtrack_common common; + /* Next iteration. */ + struct sljit_label *matchingpath; +} ref_iterator_backtrack; typedef struct recurse_entry { struct recurse_entry *next; @@ -321,40 +335,46 @@ typedef struct compiler_common { /* First byte code. */ pcre_uchar *start; /* Maps private data offset to each opcode. */ - sljit_si *private_data_ptrs; + sljit_s32 *private_data_ptrs; /* Chain list of read-only data ptrs. */ void *read_only_data_head; /* Tells whether the capturing bracket is optimized. */ - pcre_uint8 *optimized_cbracket; + sljit_u8 *optimized_cbracket; /* Tells whether the starting offset is a target of then. */ - pcre_uint8 *then_offsets; + sljit_u8 *then_offsets; /* Current position where a THEN must jump. */ then_trap_backtrack *then_trap; /* Starting offset of private data for capturing brackets. */ - int cbra_ptr; + sljit_s32 cbra_ptr; /* Output vector starting point. Must be divisible by 2. */ - int ovector_start; + sljit_s32 ovector_start; + /* Points to the starting character of the current match. */ + sljit_s32 start_ptr; /* Last known position of the requested byte. */ - int req_char_ptr; + sljit_s32 req_char_ptr; /* Head of the last recursion. */ - int recursive_head_ptr; - /* First inspected character for partial matching. */ - int start_used_ptr; + sljit_s32 recursive_head_ptr; + /* First inspected character for partial matching. + (Needed for avoiding zero length partial matches.) */ + sljit_s32 start_used_ptr; /* Starting pointer for partial soft matches. */ - int hit_start; - /* End pointer of the first line. */ - int first_line_end; + sljit_s32 hit_start; + /* Pointer of the match end position. */ + sljit_s32 match_end_ptr; /* Points to the marked string. */ - int mark_ptr; + sljit_s32 mark_ptr; /* Recursive control verb management chain. */ - int control_head_ptr; + sljit_s32 control_head_ptr; /* Points to the last matched capture block index. */ - int capture_last_ptr; - /* Points to the starting position of the current match. */ - int start_ptr; + sljit_s32 capture_last_ptr; + /* Fast forward skipping byte code pointer. */ + pcre_uchar *fast_forward_bc_ptr; + /* Locals used by fast fail optimization. */ + sljit_s32 fast_fail_start_ptr; + sljit_s32 fast_fail_end_ptr; /* Flipped and lower case tables. */ - const pcre_uint8 *fcc; + const sljit_u8 *fcc; sljit_sw lcc; /* Mode can be PCRE_STUDY_JIT_COMPILE and others. */ int mode; @@ -366,20 +386,20 @@ typedef struct compiler_common { BOOL has_skip_arg; /* (*THEN) is found in the pattern. */ BOOL has_then; - /* Needs to know the start position anytime. */ - BOOL needs_start_ptr; + /* (*SKIP) or (*SKIP:arg) is found in lookbehind assertion. */ + BOOL has_skip_in_assert_back; /* Currently in recurse or negative assert. */ BOOL local_exit; /* Currently in a positive assert. */ BOOL positive_assert; /* Newline control. */ int nltype; - pcre_uint32 nlmax; - pcre_uint32 nlmin; + sljit_u32 nlmax; + sljit_u32 nlmin; int newline; int bsr_nltype; - pcre_uint32 bsr_nlmax; - pcre_uint32 bsr_nlmin; + sljit_u32 bsr_nlmax; + sljit_u32 bsr_nlmin; /* Dollar endonly. */ int endonly; /* Tables. */ @@ -419,6 +439,7 @@ typedef struct compiler_common { BOOL utf; #ifdef SUPPORT_UCP BOOL use_ucp; + jump_list *getucd; #endif #ifdef COMPILE_PCRE8 jump_list *utfreadchar; @@ -426,9 +447,6 @@ typedef struct compiler_common { jump_list *utfreadtype8; #endif #endif /* SUPPORT_UTF */ -#ifdef SUPPORT_UCP - jump_list *getucd; -#endif } compiler_common; /* For byte_sequence_compare. */ @@ -439,27 +457,27 @@ typedef struct compare_context { #if defined SLJIT_UNALIGNED && SLJIT_UNALIGNED int ucharptr; union { - sljit_si asint; - sljit_uh asushort; + sljit_s32 asint; + sljit_u16 asushort; #if defined COMPILE_PCRE8 - sljit_ub asbyte; - sljit_ub asuchars[4]; + sljit_u8 asbyte; + sljit_u8 asuchars[4]; #elif defined COMPILE_PCRE16 - sljit_uh asuchars[2]; + sljit_u16 asuchars[2]; #elif defined COMPILE_PCRE32 - sljit_ui asuchars[1]; + sljit_u32 asuchars[1]; #endif } c; union { - sljit_si asint; - sljit_uh asushort; + sljit_s32 asint; + sljit_u16 asushort; #if defined COMPILE_PCRE8 - sljit_ub asbyte; - sljit_ub asuchars[4]; + sljit_u8 asbyte; + sljit_u8 asuchars[4]; #elif defined COMPILE_PCRE16 - sljit_uh asuchars[2]; + sljit_u16 asuchars[2]; #elif defined COMPILE_PCRE32 - sljit_ui asuchars[1]; + sljit_u32 asuchars[1]; #endif } oc; #endif @@ -501,14 +519,14 @@ the start pointers when the end of the capturing group has not yet reached. */ #define PRIVATE_DATA(cc) (common->private_data_ptrs[(cc) - common->start]) #if defined COMPILE_PCRE8 -#define MOV_UCHAR SLJIT_MOV_UB -#define MOVU_UCHAR SLJIT_MOVU_UB +#define MOV_UCHAR SLJIT_MOV_U8 +#define MOVU_UCHAR SLJIT_MOVU_U8 #elif defined COMPILE_PCRE16 -#define MOV_UCHAR SLJIT_MOV_UH -#define MOVU_UCHAR SLJIT_MOVU_UH +#define MOV_UCHAR SLJIT_MOV_U16 +#define MOVU_UCHAR SLJIT_MOVU_U16 #elif defined COMPILE_PCRE32 -#define MOV_UCHAR SLJIT_MOV_UI -#define MOVU_UCHAR SLJIT_MOVU_UI +#define MOV_UCHAR SLJIT_MOV_U32 +#define MOVU_UCHAR SLJIT_MOVU_U32 #else #error Unsupported compiling mode #endif @@ -564,11 +582,6 @@ SLJIT_ASSERT(*cc >= OP_KET && *cc <= OP_KETRPOS); return count; } -static int ones_in_half_byte[16] = { - /* 0 */ 0, 1, 1, 2, /* 4 */ 1, 2, 2, 3, - /* 8 */ 1, 2, 2, 3, /* 12 */ 2, 3, 3, 4 -}; - /* Functions whose might need modification for all new supported opcodes: next_opcode check_opcode_types @@ -780,6 +793,7 @@ static BOOL check_opcode_types(compiler_common *common, pcre_uchar *cc, pcre_uch { int count; pcre_uchar *slot; +pcre_uchar *assert_back_end = cc - 1; /* Calculate important variables (like stack size) and checks whether all opcodes are supported. */ while (cc < ccend) @@ -850,15 +864,19 @@ while (cc < ccend) cc += 2 + 2 * LINK_SIZE; break; + case OP_ASSERTBACK: + slot = bracketend(cc); + if (slot > assert_back_end) + assert_back_end = slot; + cc += 1 + LINK_SIZE; + break; + case OP_THEN_ARG: common->has_then = TRUE; common->control_head_ptr = 1; /* Fall through. */ case OP_PRUNE_ARG: - common->needs_start_ptr = TRUE; - /* Fall through. */ - case OP_MARK: if (common->mark_ptr == 0) { @@ -871,17 +889,20 @@ while (cc < ccend) case OP_THEN: common->has_then = TRUE; common->control_head_ptr = 1; - /* Fall through. */ + cc += 1; + break; - case OP_PRUNE: case OP_SKIP: - common->needs_start_ptr = TRUE; + if (cc < assert_back_end) + common->has_skip_in_assert_back = TRUE; cc += 1; break; case OP_SKIP_ARG: common->control_head_ptr = 1; common->has_skip_arg = TRUE; + if (cc < assert_back_end) + common->has_skip_in_assert_back = TRUE; cc += 1 + 2 + cc[1]; break; @@ -895,8 +916,189 @@ while (cc < ccend) return TRUE; } +static BOOL is_accelerated_repeat(pcre_uchar *cc) +{ +switch(*cc) + { + case OP_TYPESTAR: + case OP_TYPEMINSTAR: + case OP_TYPEPLUS: + case OP_TYPEMINPLUS: + case OP_TYPEPOSSTAR: + case OP_TYPEPOSPLUS: + return (cc[1] != OP_ANYNL && cc[1] != OP_EXTUNI); + + case OP_STAR: + case OP_MINSTAR: + case OP_PLUS: + case OP_MINPLUS: + case OP_POSSTAR: + case OP_POSPLUS: + + case OP_STARI: + case OP_MINSTARI: + case OP_PLUSI: + case OP_MINPLUSI: + case OP_POSSTARI: + case OP_POSPLUSI: + + case OP_NOTSTAR: + case OP_NOTMINSTAR: + case OP_NOTPLUS: + case OP_NOTMINPLUS: + case OP_NOTPOSSTAR: + case OP_NOTPOSPLUS: + + case OP_NOTSTARI: + case OP_NOTMINSTARI: + case OP_NOTPLUSI: + case OP_NOTMINPLUSI: + case OP_NOTPOSSTARI: + case OP_NOTPOSPLUSI: + return TRUE; + + case OP_CLASS: + case OP_NCLASS: +#if defined SUPPORT_UTF || !defined COMPILE_PCRE8 + case OP_XCLASS: + cc += (*cc == OP_XCLASS) ? GET(cc, 1) : (int)(1 + (32 / sizeof(pcre_uchar))); +#else + cc += (1 + (32 / sizeof(pcre_uchar))); +#endif + + switch(*cc) + { + case OP_CRSTAR: + case OP_CRMINSTAR: + case OP_CRPLUS: + case OP_CRMINPLUS: + case OP_CRPOSSTAR: + case OP_CRPOSPLUS: + return TRUE; + } + break; + } +return FALSE; +} + +static SLJIT_INLINE BOOL detect_fast_forward_skip(compiler_common *common, int *private_data_start) +{ +pcre_uchar *cc = common->start; +pcre_uchar *end; + +/* Skip not repeated brackets. */ +while (TRUE) + { + switch(*cc) + { + case OP_SOD: + case OP_SOM: + case OP_SET_SOM: + case OP_NOT_WORD_BOUNDARY: + case OP_WORD_BOUNDARY: + case OP_EODN: + case OP_EOD: + case OP_CIRC: + case OP_CIRCM: + case OP_DOLL: + case OP_DOLLM: + /* Zero width assertions. */ + cc++; + continue; + } + + if (*cc != OP_BRA && *cc != OP_CBRA) + break; + + end = cc + GET(cc, 1); + if (*end != OP_KET || PRIVATE_DATA(end) != 0) + return FALSE; + if (*cc == OP_CBRA) + { + if (common->optimized_cbracket[GET2(cc, 1 + LINK_SIZE)] == 0) + return FALSE; + cc += IMM2_SIZE; + } + cc += 1 + LINK_SIZE; + } + +if (is_accelerated_repeat(cc)) + { + common->fast_forward_bc_ptr = cc; + common->private_data_ptrs[(cc + 1) - common->start] = *private_data_start; + *private_data_start += sizeof(sljit_sw); + return TRUE; + } +return FALSE; +} + +static SLJIT_INLINE void detect_fast_fail(compiler_common *common, pcre_uchar *cc, int *private_data_start, sljit_s32 depth) +{ + pcre_uchar *next_alt; + + SLJIT_ASSERT(*cc == OP_BRA || *cc == OP_CBRA); + + if (*cc == OP_CBRA && common->optimized_cbracket[GET2(cc, 1 + LINK_SIZE)] == 0) + return; + + next_alt = bracketend(cc) - (1 + LINK_SIZE); + if (*next_alt != OP_KET || PRIVATE_DATA(next_alt) != 0) + return; + + do + { + next_alt = cc + GET(cc, 1); + + cc += 1 + LINK_SIZE + ((*cc == OP_CBRA) ? IMM2_SIZE : 0); + + while (TRUE) + { + switch(*cc) + { + case OP_SOD: + case OP_SOM: + case OP_SET_SOM: + case OP_NOT_WORD_BOUNDARY: + case OP_WORD_BOUNDARY: + case OP_EODN: + case OP_EOD: + case OP_CIRC: + case OP_CIRCM: + case OP_DOLL: + case OP_DOLLM: + /* Zero width assertions. */ + cc++; + continue; + } + break; + } + + if (depth > 0 && (*cc == OP_BRA || *cc == OP_CBRA)) + detect_fast_fail(common, cc, private_data_start, depth - 1); + + if (is_accelerated_repeat(cc)) + { + common->private_data_ptrs[(cc + 1) - common->start] = *private_data_start; + + if (common->fast_fail_start_ptr == 0) + common->fast_fail_start_ptr = *private_data_start; + + *private_data_start += sizeof(sljit_sw); + common->fast_fail_end_ptr = *private_data_start; + + if (*private_data_start > SLJIT_MAX_LOCAL_SIZE) + return; + } + + cc = next_alt; + } + while (*cc == OP_ALT); +} + static int get_class_iterator_size(pcre_uchar *cc) { +sljit_u32 min; +sljit_u32 max; switch(*cc) { case OP_CRSTAR: @@ -911,9 +1113,14 @@ switch(*cc) case OP_CRRANGE: case OP_CRMINRANGE: - if (GET2(cc, 1) == GET2(cc, 1 + IMM2_SIZE)) - return 0; - return 2; + min = GET2(cc, 1); + max = GET2(cc, 1 + IMM2_SIZE); + if (max == 0) + return (*cc == OP_CRRANGE) ? 2 : 1; + max -= min; + if (max > 2) + max = 2; + return max; default: return 0; @@ -1186,14 +1393,14 @@ while (cc < ccend) case OP_CLASS: case OP_NCLASS: - size += 1 + 32 / sizeof(pcre_uchar); space = get_class_iterator_size(cc + size); + size = 1 + 32 / sizeof(pcre_uchar); break; #if defined SUPPORT_UTF || !defined COMPILE_PCRE8 case OP_XCLASS: - size = GET(cc, 1); space = get_class_iterator_size(cc + size); + size = GET(cc, 1); break; #endif @@ -1406,6 +1613,7 @@ while (cc < ccend) case OP_CLASS: case OP_NCLASS: case OP_XCLASS: + case OP_CALLOUT: cc = next_opcode(common, cc); SLJIT_ASSERT(cc != NULL); @@ -1990,7 +2198,7 @@ if (save) SLJIT_ASSERT(cc == ccend && stackptr == stacktop && (save || (tmp1empty && tmp2empty))); } -static SLJIT_INLINE pcre_uchar *set_then_offsets(compiler_common *common, pcre_uchar *cc, pcre_uint8 *current_offset) +static SLJIT_INLINE pcre_uchar *set_then_offsets(compiler_common *common, pcre_uchar *cc, sljit_u8 *current_offset) { pcre_uchar *end = bracketend(cc); BOOL has_alternatives = cc[GET(cc, 1)] == OP_ALT; @@ -2113,6 +2321,7 @@ static SLJIT_INLINE void allocate_stack(compiler_common *common, int size) /* May destroy all locals and registers except TMP2. */ DEFINE_COMPILER; +SLJIT_ASSERT(size > 0); OP2(SLJIT_ADD, STACK_TOP, 0, STACK_TOP, 0, SLJIT_IMM, size * sizeof(sljit_sw)); #ifdef DESTROY_REGISTERS OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, 12345); @@ -2127,6 +2336,8 @@ add_stub(common, CMP(SLJIT_GREATER, STACK_TOP, 0, STACK_LIMIT, 0)); static SLJIT_INLINE void free_stack(compiler_common *common, int size) { DEFINE_COMPILER; + +SLJIT_ASSERT(size > 0); OP2(SLJIT_SUB, STACK_TOP, 0, STACK_TOP, 0, SLJIT_IMM, size * sizeof(sljit_sw)); } @@ -2190,6 +2401,18 @@ else } } +static SLJIT_INLINE void reset_fast_fail(compiler_common *common) +{ +DEFINE_COMPILER; +sljit_s32 i; + +SLJIT_ASSERT(common->fast_fail_start_ptr < common->fast_fail_end_ptr); + +OP2(SLJIT_SUB, TMP1, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); +for (i = common->fast_fail_start_ptr; i < common->fast_fail_end_ptr; i += sizeof(sljit_sw)) + OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), i, TMP1, 0); +} + static SLJIT_INLINE void do_reset_match(compiler_common *common, int length) { DEFINE_COMPILER; @@ -2262,7 +2485,7 @@ OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), OVECTOR(1), STR_PTR, 0); OP1(SLJIT_MOV, SLJIT_R0, 0, ARGUMENTS, 0); if (common->mark_ptr != 0) OP1(SLJIT_MOV, SLJIT_R2, 0, SLJIT_MEM1(SLJIT_SP), common->mark_ptr); -OP1(SLJIT_MOV_SI, SLJIT_R1, 0, SLJIT_MEM1(SLJIT_R0), SLJIT_OFFSETOF(jit_arguments, offset_count)); +OP1(SLJIT_MOV_S32, SLJIT_R1, 0, SLJIT_MEM1(SLJIT_R0), SLJIT_OFFSETOF(jit_arguments, offset_count)); if (common->mark_ptr != 0) OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_R0), SLJIT_OFFSETOF(jit_arguments, mark_ptr), SLJIT_R2, 0); OP2(SLJIT_SUB, SLJIT_R2, 0, SLJIT_MEM1(SLJIT_R0), SLJIT_OFFSETOF(jit_arguments, offsets), SLJIT_IMM, sizeof(int)); @@ -2277,7 +2500,7 @@ OP2(SLJIT_ADD, SLJIT_S0, 0, SLJIT_S0, 0, SLJIT_IMM, sizeof(sljit_sw)); #if defined COMPILE_PCRE16 || defined COMPILE_PCRE32 OP2(SLJIT_ASHR, SLJIT_S1, 0, SLJIT_S1, 0, SLJIT_IMM, UCHAR_SHIFT); #endif -OP1(SLJIT_MOVU_SI, SLJIT_MEM1(SLJIT_R2), sizeof(int), SLJIT_S1, 0); +OP1(SLJIT_MOVU_S32, SLJIT_MEM1(SLJIT_R2), sizeof(int), SLJIT_S1, 0); OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_R1, 0, SLJIT_R1, 0, SLJIT_IMM, 1); JUMPTO(SLJIT_NOT_ZERO, loop); JUMPHERE(early_quit); @@ -2310,7 +2533,7 @@ SLJIT_ASSERT(common->start_used_ptr != 0 && common->start_ptr != 0 OP1(SLJIT_MOV, SLJIT_R1, 0, ARGUMENTS, 0); OP1(SLJIT_MOV, SLJIT_RETURN_REG, 0, SLJIT_IMM, PCRE_ERROR_PARTIAL); -OP1(SLJIT_MOV_SI, SLJIT_R2, 0, SLJIT_MEM1(SLJIT_R1), SLJIT_OFFSETOF(jit_arguments, real_offset_count)); +OP1(SLJIT_MOV_S32, SLJIT_R2, 0, SLJIT_MEM1(SLJIT_R1), SLJIT_OFFSETOF(jit_arguments, real_offset_count)); CMPTO(SLJIT_SIG_LESS, SLJIT_R2, 0, SLJIT_IMM, 2, quit); /* Store match begin and end. */ @@ -2322,7 +2545,7 @@ OP2(SLJIT_SUB, SLJIT_R2, 0, SLJIT_MEM1(SLJIT_SP), common->mode == JIT_PARTIAL_HA #if defined COMPILE_PCRE16 || defined COMPILE_PCRE32 OP2(SLJIT_ASHR, SLJIT_R2, 0, SLJIT_R2, 0, SLJIT_IMM, UCHAR_SHIFT); #endif -OP1(SLJIT_MOV_SI, SLJIT_MEM1(SLJIT_R1), 2 * sizeof(int), SLJIT_R2, 0); +OP1(SLJIT_MOV_S32, SLJIT_MEM1(SLJIT_R1), 2 * sizeof(int), SLJIT_R2, 0); JUMPHERE(jump); OP1(SLJIT_MOV, SLJIT_R2, 0, SLJIT_MEM1(SLJIT_SP), common->mode == JIT_PARTIAL_HARD_COMPILE ? common->start_used_ptr : common->hit_start); @@ -2330,13 +2553,13 @@ OP2(SLJIT_SUB, SLJIT_S1, 0, STR_END, 0, SLJIT_S0, 0); #if defined COMPILE_PCRE16 || defined COMPILE_PCRE32 OP2(SLJIT_ASHR, SLJIT_S1, 0, SLJIT_S1, 0, SLJIT_IMM, UCHAR_SHIFT); #endif -OP1(SLJIT_MOV_SI, SLJIT_MEM1(SLJIT_R1), sizeof(int), SLJIT_S1, 0); +OP1(SLJIT_MOV_S32, SLJIT_MEM1(SLJIT_R1), sizeof(int), SLJIT_S1, 0); OP2(SLJIT_SUB, SLJIT_R2, 0, SLJIT_R2, 0, SLJIT_S0, 0); #if defined COMPILE_PCRE16 || defined COMPILE_PCRE32 OP2(SLJIT_ASHR, SLJIT_R2, 0, SLJIT_R2, 0, SLJIT_IMM, UCHAR_SHIFT); #endif -OP1(SLJIT_MOV_SI, SLJIT_MEM1(SLJIT_R1), 0, SLJIT_R2, 0); +OP1(SLJIT_MOV_S32, SLJIT_MEM1(SLJIT_R1), 0, SLJIT_R2, 0); JUMPTO(SLJIT_JUMP, quit); } @@ -2573,7 +2796,7 @@ else JUMPHERE(jump); } -static void peek_char(compiler_common *common, pcre_uint32 max) +static void peek_char(compiler_common *common, sljit_u32 max) { /* Reads the character into TMP1, keeps STR_PTR. Does not check STR_END. TMP2 Destroyed. */ @@ -2618,12 +2841,12 @@ if (common->utf) #if defined SUPPORT_UTF && defined COMPILE_PCRE8 -static BOOL is_char7_bitset(const pcre_uint8 *bitset, BOOL nclass) +static BOOL is_char7_bitset(const sljit_u8 *bitset, BOOL nclass) { /* Tells whether the character codes below 128 are enough to determine a match. */ -const pcre_uint8 value = nclass ? 0xff : 0; -const pcre_uint8 *end = bitset + 32; +const sljit_u8 value = nclass ? 0xff : 0; +const sljit_u8 *end = bitset + 32; bitset += 16; do @@ -2648,12 +2871,12 @@ SLJIT_ASSERT(common->utf); OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), 0); OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); -OP1(SLJIT_MOV_UB, TMP1, 0, SLJIT_MEM1(TMP2), common->ctypes); +OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP2), common->ctypes); if (full_read) { jump = CMP(SLJIT_LESS, TMP2, 0, SLJIT_IMM, 0xc0); - OP1(SLJIT_MOV_UB, TMP2, 0, SLJIT_MEM1(TMP2), (sljit_sw)PRIV(utf8_table4) - 0xc0); + OP1(SLJIT_MOV_U8, TMP2, 0, SLJIT_MEM1(TMP2), (sljit_sw)PRIV(utf8_table4) - 0xc0); OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP2, 0); JUMPHERE(jump); } @@ -2661,7 +2884,7 @@ if (full_read) #endif /* SUPPORT_UTF && COMPILE_PCRE8 */ -static void read_char_range(compiler_common *common, pcre_uint32 min, pcre_uint32 max, BOOL update_str_ptr) +static void read_char_range(compiler_common *common, sljit_u32 min, sljit_u32 max, BOOL update_str_ptr) { /* Reads the precise value of a character into TMP1, if the character is between min and max (c >= min && c <= max). Otherwise it returns with a value @@ -2692,7 +2915,7 @@ if (common->utf) { OP2(SLJIT_SUB, TMP2, 0, TMP1, 0, SLJIT_IMM, 0xf0); if (update_str_ptr) - OP1(SLJIT_MOV_UB, RETURN_ADDR, 0, SLJIT_MEM1(TMP1), (sljit_sw)PRIV(utf8_table4) - 0xc0); + OP1(SLJIT_MOV_U8, RETURN_ADDR, 0, SLJIT_MEM1(TMP1), (sljit_sw)PRIV(utf8_table4) - 0xc0); OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(0)); jump2 = CMP(SLJIT_GREATER, TMP2, 0, SLJIT_IMM, 0x7); OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, 6); @@ -2716,7 +2939,7 @@ if (common->utf) { OP2(SLJIT_SUB, TMP2, 0, TMP1, 0, SLJIT_IMM, 0xe0); if (update_str_ptr) - OP1(SLJIT_MOV_UB, RETURN_ADDR, 0, SLJIT_MEM1(TMP1), (sljit_sw)PRIV(utf8_table4) - 0xc0); + OP1(SLJIT_MOV_U8, RETURN_ADDR, 0, SLJIT_MEM1(TMP1), (sljit_sw)PRIV(utf8_table4) - 0xc0); OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(0)); jump2 = CMP(SLJIT_GREATER, TMP2, 0, SLJIT_IMM, 0xf); OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, 6); @@ -2736,7 +2959,7 @@ if (common->utf) add_jump(compiler, (max < 0x10000) ? &common->utfreadchar16 : &common->utfreadchar, JUMP(SLJIT_FAST_CALL)); else if (max < 128) { - OP1(SLJIT_MOV_UB, TMP2, 0, SLJIT_MEM1(TMP1), (sljit_sw)PRIV(utf8_table4) - 0xc0); + OP1(SLJIT_MOV_U8, TMP2, 0, SLJIT_MEM1(TMP1), (sljit_sw)PRIV(utf8_table4) - 0xc0); OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP2, 0); } else @@ -2745,7 +2968,7 @@ if (common->utf) if (!update_str_ptr) OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); else - OP1(SLJIT_MOV_UB, RETURN_ADDR, 0, SLJIT_MEM1(TMP1), (sljit_sw)PRIV(utf8_table4) - 0xc0); + OP1(SLJIT_MOV_U8, RETURN_ADDR, 0, SLJIT_MEM1(TMP1), (sljit_sw)PRIV(utf8_table4) - 0xc0); OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, 0x3f); OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, 6); OP2(SLJIT_AND, TMP2, 0, TMP2, 0, SLJIT_IMM, 0x3f); @@ -2815,7 +3038,7 @@ if (common->utf) { /* This can be an extra read in some situations, but hopefully it is needed in most cases. */ - OP1(SLJIT_MOV_UB, TMP1, 0, SLJIT_MEM1(TMP2), common->ctypes); + OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP2), common->ctypes); jump = CMP(SLJIT_LESS, TMP2, 0, SLJIT_IMM, 0xc0); if (!update_str_ptr) { @@ -2827,7 +3050,7 @@ if (common->utf) OP2(SLJIT_OR, TMP2, 0, TMP2, 0, TMP1, 0); OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, 0); jump2 = CMP(SLJIT_GREATER, TMP2, 0, SLJIT_IMM, 255); - OP1(SLJIT_MOV_UB, TMP1, 0, SLJIT_MEM1(TMP2), common->ctypes); + OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP2), common->ctypes); JUMPHERE(jump2); } else @@ -2842,7 +3065,7 @@ if (common->utf) OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, 0); jump = CMP(SLJIT_GREATER, TMP2, 0, SLJIT_IMM, 255); #endif -OP1(SLJIT_MOV_UB, TMP1, 0, SLJIT_MEM1(TMP2), common->ctypes); +OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP2), common->ctypes); #if !defined COMPILE_PCRE8 JUMPHERE(jump); #endif @@ -3034,7 +3257,7 @@ compare = CMP(SLJIT_GREATER, TMP2, 0, SLJIT_IMM, 0x3); OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, 6); OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, 0x3f); OP2(SLJIT_OR, TMP2, 0, TMP2, 0, TMP1, 0); -OP1(SLJIT_MOV_UB, TMP1, 0, SLJIT_MEM1(TMP2), common->ctypes); +OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP2), common->ctypes); sljit_emit_fast_return(compiler, RETURN_ADDR, 0); JUMPHERE(compare); @@ -3043,7 +3266,7 @@ sljit_emit_fast_return(compiler, RETURN_ADDR, 0); /* We only have types for characters less than 256. */ JUMPHERE(jump); -OP1(SLJIT_MOV_UB, TMP2, 0, SLJIT_MEM1(TMP2), (sljit_sw)PRIV(utf8_table4) - 0xc0); +OP1(SLJIT_MOV_U8, TMP2, 0, SLJIT_MEM1(TMP2), (sljit_sw)PRIV(utf8_table4) - 0xc0); OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, 0); OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP2, 0); sljit_emit_fast_return(compiler, RETURN_ADDR, 0); @@ -3069,26 +3292,26 @@ SLJIT_ASSERT(UCD_BLOCK_SIZE == 128 && sizeof(ucd_record) == 8); sljit_emit_fast_enter(compiler, RETURN_ADDR, 0); OP2(SLJIT_LSHR, TMP2, 0, TMP1, 0, SLJIT_IMM, UCD_BLOCK_SHIFT); -OP1(SLJIT_MOV_UB, TMP2, 0, SLJIT_MEM1(TMP2), (sljit_sw)PRIV(ucd_stage1)); +OP1(SLJIT_MOV_U8, TMP2, 0, SLJIT_MEM1(TMP2), (sljit_sw)PRIV(ucd_stage1)); OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, UCD_BLOCK_MASK); OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, UCD_BLOCK_SHIFT); OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, TMP2, 0); OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, (sljit_sw)PRIV(ucd_stage2)); -OP1(SLJIT_MOV_UH, TMP2, 0, SLJIT_MEM2(TMP2, TMP1), 1); +OP1(SLJIT_MOV_U16, TMP2, 0, SLJIT_MEM2(TMP2, TMP1), 1); OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, (sljit_sw)PRIV(ucd_records) + SLJIT_OFFSETOF(ucd_record, chartype)); -OP1(SLJIT_MOV_UB, TMP1, 0, SLJIT_MEM2(TMP1, TMP2), 3); +OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM2(TMP1, TMP2), 3); sljit_emit_fast_return(compiler, RETURN_ADDR, 0); } #endif -static SLJIT_INLINE struct sljit_label *mainloop_entry(compiler_common *common, BOOL hascrorlf, BOOL firstline) +static SLJIT_INLINE struct sljit_label *mainloop_entry(compiler_common *common, BOOL hascrorlf) { DEFINE_COMPILER; struct sljit_label *mainloop; struct sljit_label *newlinelabel = NULL; struct sljit_jump *start; struct sljit_jump *end = NULL; -struct sljit_jump *nl = NULL; +struct sljit_jump *end2 = NULL; #if defined SUPPORT_UTF && !defined COMPILE_PCRE32 struct sljit_jump *singlechar; #endif @@ -3096,14 +3319,13 @@ jump_list *newline = NULL; BOOL newlinecheck = FALSE; BOOL readuchar = FALSE; -if (!(hascrorlf || firstline) && (common->nltype == NLTYPE_ANY || - common->nltype == NLTYPE_ANYCRLF || common->newline > 255)) +if (!(hascrorlf || (common->match_end_ptr != 0)) && + (common->nltype == NLTYPE_ANY || common->nltype == NLTYPE_ANYCRLF || common->newline > 255)) newlinecheck = TRUE; -if (firstline) +if (common->match_end_ptr != 0) { /* Search for the end of the first line. */ - SLJIT_ASSERT(common->first_line_end != 0); OP1(SLJIT_MOV, TMP3, 0, STR_PTR, 0); if (common->nltype == NLTYPE_FIXED && common->newline > 255) @@ -3116,19 +3338,19 @@ if (firstline) CMPTO(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, (common->newline >> 8) & 0xff, mainloop); CMPTO(SLJIT_NOT_EQUAL, TMP2, 0, SLJIT_IMM, common->newline & 0xff, mainloop); JUMPHERE(end); - OP2(SLJIT_SUB, SLJIT_MEM1(SLJIT_SP), common->first_line_end, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); + OP2(SLJIT_SUB, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); } else { end = CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0); mainloop = LABEL(); /* Continual stores does not cause data dependency. */ - OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->first_line_end, STR_PTR, 0); + OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr, STR_PTR, 0); read_char_range(common, common->nlmin, common->nlmax, TRUE); check_newlinechar(common, common->nltype, &newline, TRUE); CMPTO(SLJIT_LESS, STR_PTR, 0, STR_END, 0, mainloop); JUMPHERE(end); - OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->first_line_end, STR_PTR, 0); + OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr, STR_PTR, 0); set_jumps(newline, LABEL()); } @@ -3149,7 +3371,7 @@ if (newlinecheck) OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, UCHAR_SHIFT); #endif OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP1, 0); - nl = JUMP(SLJIT_JUMP); + end2 = JUMP(SLJIT_JUMP); } mainloop = LABEL(); @@ -3172,7 +3394,7 @@ OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); if (common->utf) { singlechar = CMP(SLJIT_LESS, TMP1, 0, SLJIT_IMM, 0xc0); - OP1(SLJIT_MOV_UB, TMP1, 0, SLJIT_MEM1(TMP1), (sljit_sw)PRIV(utf8_table4) - 0xc0); + OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP1), (sljit_sw)PRIV(utf8_table4) - 0xc0); OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP1, 0); JUMPHERE(singlechar); } @@ -3194,51 +3416,52 @@ JUMPHERE(start); if (newlinecheck) { JUMPHERE(end); - JUMPHERE(nl); + JUMPHERE(end2); } return mainloop; } #define MAX_N_CHARS 16 -#define MAX_N_BYTES 8 +#define MAX_DIFF_CHARS 6 -static SLJIT_INLINE void add_prefix_byte(pcre_uint8 byte, pcre_uint8 *bytes) +static SLJIT_INLINE void add_prefix_char(pcre_uchar chr, pcre_uchar *chars) { -pcre_uint8 len = bytes[0]; -int i; +pcre_uchar i, len; +len = chars[0]; if (len == 255) return; if (len == 0) { - bytes[0] = 1; - bytes[1] = byte; + chars[0] = 1; + chars[1] = chr; return; } for (i = len; i > 0; i--) - if (bytes[i] == byte) + if (chars[i] == chr) return; -if (len >= MAX_N_BYTES - 1) +if (len >= MAX_DIFF_CHARS - 1) { - bytes[0] = 255; + chars[0] = 255; return; } len++; -bytes[len] = byte; -bytes[0] = len; +chars[len] = chr; +chars[0] = len; } -static int scan_prefix(compiler_common *common, pcre_uchar *cc, pcre_uint32 *chars, pcre_uint8 *bytes, int max_chars, pcre_uint32 *rec_count) +static int scan_prefix(compiler_common *common, pcre_uchar *cc, pcre_uchar *chars, int max_chars, sljit_u32 *rec_count) { /* Recursive function, which scans prefix literals. */ -BOOL last, any, caseless; +BOOL last, any, class, caseless; int len, repeat, len_save, consumed = 0; -pcre_uint32 chr, mask; +sljit_u32 chr; /* Any unicode character. */ +sljit_u8 *bytes, *bytes_end, byte; pcre_uchar *alternative, *cc_save, *oc; #if defined SUPPORT_UTF && defined COMPILE_PCRE8 pcre_uchar othercase[8]; @@ -3257,6 +3480,7 @@ while (TRUE) last = TRUE; any = FALSE; + class = FALSE; caseless = FALSE; switch (*cc) @@ -3320,7 +3544,7 @@ while (TRUE) #ifdef SUPPORT_UTF if (common->utf && HAS_EXTRALEN(*cc)) len += GET_EXTRALEN(*cc); #endif - max_chars = scan_prefix(common, cc + len, chars, bytes, max_chars, rec_count); + max_chars = scan_prefix(common, cc + len, chars, max_chars, rec_count); if (max_chars == 0) return consumed; last = FALSE; @@ -3343,7 +3567,7 @@ while (TRUE) alternative = cc + GET(cc, 1); while (*alternative == OP_ALT) { - max_chars = scan_prefix(common, alternative + 1 + LINK_SIZE, chars, bytes, max_chars, rec_count); + max_chars = scan_prefix(common, alternative + 1 + LINK_SIZE, chars, max_chars, rec_count); if (max_chars == 0) return consumed; alternative += GET(alternative, 1); @@ -3356,18 +3580,17 @@ while (TRUE) case OP_CLASS: #if defined SUPPORT_UTF && defined COMPILE_PCRE8 - if (common->utf && !is_char7_bitset((const pcre_uint8 *)(cc + 1), FALSE)) return consumed; + if (common->utf && !is_char7_bitset((const sljit_u8 *)(cc + 1), FALSE)) + return consumed; #endif - any = TRUE; - cc += 1 + 32 / sizeof(pcre_uchar); + class = TRUE; break; case OP_NCLASS: #if defined SUPPORT_UTF && !defined COMPILE_PCRE32 if (common->utf) return consumed; #endif - any = TRUE; - cc += 1 + 32 / sizeof(pcre_uchar); + class = TRUE; break; #if defined SUPPORT_UTF || !defined COMPILE_PCRE8 @@ -3382,7 +3605,7 @@ while (TRUE) case OP_DIGIT: #if defined SUPPORT_UTF && defined COMPILE_PCRE8 - if (common->utf && !is_char7_bitset((const pcre_uint8 *)common->ctypes - cbit_length + cbit_digit, FALSE)) + if (common->utf && !is_char7_bitset((const sljit_u8 *)common->ctypes - cbit_length + cbit_digit, FALSE)) return consumed; #endif any = TRUE; @@ -3391,7 +3614,7 @@ while (TRUE) case OP_WHITESPACE: #if defined SUPPORT_UTF && defined COMPILE_PCRE8 - if (common->utf && !is_char7_bitset((const pcre_uint8 *)common->ctypes - cbit_length + cbit_space, FALSE)) + if (common->utf && !is_char7_bitset((const sljit_u8 *)common->ctypes - cbit_length + cbit_space, FALSE)) return consumed; #endif any = TRUE; @@ -3400,7 +3623,7 @@ while (TRUE) case OP_WORDCHAR: #if defined SUPPORT_UTF && defined COMPILE_PCRE8 - if (common->utf && !is_char7_bitset((const pcre_uint8 *)common->ctypes - cbit_length + cbit_word, FALSE)) + if (common->utf && !is_char7_bitset((const sljit_u8 *)common->ctypes - cbit_length + cbit_word, FALSE)) return consumed; #endif any = TRUE; @@ -3423,10 +3646,10 @@ while (TRUE) cc++; break; -#ifdef SUPPORT_UCP +#ifdef SUPPORT_UTF case OP_NOTPROP: case OP_PROP: -#if defined SUPPORT_UTF && !defined COMPILE_PCRE32 +#ifndef COMPILE_PCRE32 if (common->utf) return consumed; #endif any = TRUE; @@ -3455,27 +3678,14 @@ while (TRUE) if (any) { -#if defined COMPILE_PCRE8 - mask = 0xff; -#elif defined COMPILE_PCRE16 - mask = 0xffff; -#elif defined COMPILE_PCRE32 - mask = 0xffffffff; -#else - SLJIT_ASSERT_STOP(); -#endif - do { - chars[0] = mask; - chars[1] = mask; - bytes[0] = 255; + chars[0] = 255; consumed++; if (--max_chars == 0) return consumed; - chars += 2; - bytes += MAX_N_BYTES; + chars += MAX_DIFF_CHARS; } while (--repeat > 0); @@ -3483,6 +3693,103 @@ while (TRUE) continue; } + if (class) + { + bytes = (sljit_u8*) (cc + 1); + cc += 1 + 32 / sizeof(pcre_uchar); + + switch (*cc) + { + case OP_CRSTAR: + case OP_CRMINSTAR: + case OP_CRPOSSTAR: + case OP_CRQUERY: + case OP_CRMINQUERY: + case OP_CRPOSQUERY: + max_chars = scan_prefix(common, cc + 1, chars, max_chars, rec_count); + if (max_chars == 0) + return consumed; + break; + + default: + case OP_CRPLUS: + case OP_CRMINPLUS: + case OP_CRPOSPLUS: + break; + + case OP_CRRANGE: + case OP_CRMINRANGE: + case OP_CRPOSRANGE: + repeat = GET2(cc, 1); + if (repeat <= 0) + return consumed; + break; + } + + do + { + if (bytes[31] & 0x80) + chars[0] = 255; + else if (chars[0] != 255) + { + bytes_end = bytes + 32; + chr = 0; + do + { + byte = *bytes++; + SLJIT_ASSERT((chr & 0x7) == 0); + if (byte == 0) + chr += 8; + else + { + do + { + if ((byte & 0x1) != 0) + add_prefix_char(chr, chars); + byte >>= 1; + chr++; + } + while (byte != 0); + chr = (chr + 7) & ~7; + } + } + while (chars[0] != 255 && bytes < bytes_end); + bytes = bytes_end - 32; + } + + consumed++; + if (--max_chars == 0) + return consumed; + chars += MAX_DIFF_CHARS; + } + while (--repeat > 0); + + switch (*cc) + { + case OP_CRSTAR: + case OP_CRMINSTAR: + case OP_CRPOSSTAR: + return consumed; + + case OP_CRQUERY: + case OP_CRMINQUERY: + case OP_CRPOSQUERY: + cc++; + break; + + case OP_CRRANGE: + case OP_CRMINRANGE: + case OP_CRPOSRANGE: + if (GET2(cc, 1) != GET2(cc, 1 + IMM2_SIZE)) + return consumed; + cc += 1 + 2 * IMM2_SIZE; + break; + } + + repeat = 1; + continue; + } + len = 1; #ifdef SUPPORT_UTF if (common->utf && HAS_EXTRALEN(*cc)) len += GET_EXTRALEN(*cc); @@ -3505,7 +3812,10 @@ while (TRUE) } } else + { caseless = FALSE; + othercase[0] = 0; /* Stops compiler warning - PH */ + } len_save = len; cc_save = cc; @@ -3515,43 +3825,16 @@ while (TRUE) do { chr = *cc; -#ifdef COMPILE_PCRE32 - if (SLJIT_UNLIKELY(chr == NOTACHAR)) - return consumed; -#endif - add_prefix_byte((pcre_uint8)chr, bytes); + add_prefix_char(*cc, chars); - mask = 0; if (caseless) - { - add_prefix_byte((pcre_uint8)*oc, bytes); - mask = *cc ^ *oc; - chr |= mask; - } - -#ifdef COMPILE_PCRE32 - if (chars[0] == NOTACHAR && chars[1] == 0) -#else - if (chars[0] == NOTACHAR) -#endif - { - chars[0] = chr; - chars[1] = mask; - } - else - { - mask |= chars[0] ^ chr; - chr |= mask; - chars[0] = chr; - chars[1] |= mask; - } + add_prefix_char(*oc, chars); len--; consumed++; if (--max_chars == 0) return consumed; - chars += 2; - bytes += MAX_N_BYTES; + chars += MAX_DIFF_CHARS; cc++; oc++; } @@ -3570,163 +3853,576 @@ while (TRUE) } } -static SLJIT_INLINE BOOL fast_forward_first_n_chars(compiler_common *common, BOOL firstline) +#if (defined SLJIT_CONFIG_X86 && SLJIT_CONFIG_X86) + +static sljit_s32 character_to_int32(pcre_uchar chr) +{ +sljit_s32 value = (sljit_s32)chr; +#if defined COMPILE_PCRE8 +#define SSE2_COMPARE_TYPE_INDEX 0 +return (value << 24) | (value << 16) | (value << 8) | value; +#elif defined COMPILE_PCRE16 +#define SSE2_COMPARE_TYPE_INDEX 1 +return (value << 16) | value; +#elif defined COMPILE_PCRE32 +#define SSE2_COMPARE_TYPE_INDEX 2 +return value; +#else +#error "Unsupported unit width" +#endif +} + +static SLJIT_INLINE void fast_forward_first_char2_sse2(compiler_common *common, pcre_uchar char1, pcre_uchar char2) +{ +DEFINE_COMPILER; +struct sljit_label *start; +struct sljit_jump *quit[3]; +struct sljit_jump *nomatch; +sljit_u8 instruction[8]; +sljit_s32 tmp1_ind = sljit_get_register_index(TMP1); +sljit_s32 tmp2_ind = sljit_get_register_index(TMP2); +sljit_s32 str_ptr_ind = sljit_get_register_index(STR_PTR); +BOOL load_twice = FALSE; +pcre_uchar bit; + +bit = char1 ^ char2; +if (!is_powerof2(bit)) + bit = 0; + +if ((char1 != char2) && bit == 0) + load_twice = TRUE; + +quit[0] = CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0); + +/* First part (unaligned start) */ + +OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, character_to_int32(char1 | bit)); + +SLJIT_ASSERT(tmp1_ind < 8 && tmp2_ind == 1); + +/* MOVD xmm, r/m32 */ +instruction[0] = 0x66; +instruction[1] = 0x0f; +instruction[2] = 0x6e; +instruction[3] = 0xc0 | (2 << 3) | tmp1_ind; +sljit_emit_op_custom(compiler, instruction, 4); + +if (char1 != char2) + { + OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, character_to_int32(bit != 0 ? bit : char2)); + + /* MOVD xmm, r/m32 */ + instruction[3] = 0xc0 | (3 << 3) | tmp1_ind; + sljit_emit_op_custom(compiler, instruction, 4); + } + +/* PSHUFD xmm1, xmm2/m128, imm8 */ +instruction[2] = 0x70; +instruction[3] = 0xc0 | (2 << 3) | 2; +instruction[4] = 0; +sljit_emit_op_custom(compiler, instruction, 5); + +if (char1 != char2) + { + /* PSHUFD xmm1, xmm2/m128, imm8 */ + instruction[3] = 0xc0 | (3 << 3) | 3; + instruction[4] = 0; + sljit_emit_op_custom(compiler, instruction, 5); + } + +OP2(SLJIT_AND, TMP2, 0, STR_PTR, 0, SLJIT_IMM, 0xf); +OP2(SLJIT_AND, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, ~0xf); + +/* MOVDQA xmm1, xmm2/m128 */ +#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64) + +if (str_ptr_ind < 8) + { + instruction[2] = 0x6f; + instruction[3] = (0 << 3) | str_ptr_ind; + sljit_emit_op_custom(compiler, instruction, 4); + + if (load_twice) + { + instruction[3] = (1 << 3) | str_ptr_ind; + sljit_emit_op_custom(compiler, instruction, 4); + } + } +else + { + instruction[1] = 0x41; + instruction[2] = 0x0f; + instruction[3] = 0x6f; + instruction[4] = (0 << 3) | (str_ptr_ind & 0x7); + sljit_emit_op_custom(compiler, instruction, 5); + + if (load_twice) + { + instruction[4] = (1 << 3) | str_ptr_ind; + sljit_emit_op_custom(compiler, instruction, 5); + } + instruction[1] = 0x0f; + } + +#else + +instruction[2] = 0x6f; +instruction[3] = (0 << 3) | str_ptr_ind; +sljit_emit_op_custom(compiler, instruction, 4); + +if (load_twice) + { + instruction[3] = (1 << 3) | str_ptr_ind; + sljit_emit_op_custom(compiler, instruction, 4); + } + +#endif + +if (bit != 0) + { + /* POR xmm1, xmm2/m128 */ + instruction[2] = 0xeb; + instruction[3] = 0xc0 | (0 << 3) | 3; + sljit_emit_op_custom(compiler, instruction, 4); + } + +/* PCMPEQB/W/D xmm1, xmm2/m128 */ +instruction[2] = 0x74 + SSE2_COMPARE_TYPE_INDEX; +instruction[3] = 0xc0 | (0 << 3) | 2; +sljit_emit_op_custom(compiler, instruction, 4); + +if (load_twice) + { + instruction[3] = 0xc0 | (1 << 3) | 3; + sljit_emit_op_custom(compiler, instruction, 4); + } + +/* PMOVMSKB reg, xmm */ +instruction[2] = 0xd7; +instruction[3] = 0xc0 | (tmp1_ind << 3) | 0; +sljit_emit_op_custom(compiler, instruction, 4); + +if (load_twice) + { + OP1(SLJIT_MOV, TMP3, 0, TMP2, 0); + instruction[3] = 0xc0 | (tmp2_ind << 3) | 1; + sljit_emit_op_custom(compiler, instruction, 4); + + OP2(SLJIT_OR, TMP1, 0, TMP1, 0, TMP2, 0); + OP1(SLJIT_MOV, TMP2, 0, TMP3, 0); + } + +OP2(SLJIT_ASHR, TMP1, 0, TMP1, 0, TMP2, 0); + +/* BSF r32, r/m32 */ +instruction[0] = 0x0f; +instruction[1] = 0xbc; +instruction[2] = 0xc0 | (tmp1_ind << 3) | tmp1_ind; +sljit_emit_op_custom(compiler, instruction, 3); + +nomatch = JUMP(SLJIT_ZERO); + +OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP2, 0); +OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP1, 0); +quit[1] = JUMP(SLJIT_JUMP); + +JUMPHERE(nomatch); + +start = LABEL(); +OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, 16); +quit[2] = CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0); + +/* Second part (aligned) */ + +instruction[0] = 0x66; +instruction[1] = 0x0f; + +/* MOVDQA xmm1, xmm2/m128 */ +#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64) + +if (str_ptr_ind < 8) + { + instruction[2] = 0x6f; + instruction[3] = (0 << 3) | str_ptr_ind; + sljit_emit_op_custom(compiler, instruction, 4); + + if (load_twice) + { + instruction[3] = (1 << 3) | str_ptr_ind; + sljit_emit_op_custom(compiler, instruction, 4); + } + } +else + { + instruction[1] = 0x41; + instruction[2] = 0x0f; + instruction[3] = 0x6f; + instruction[4] = (0 << 3) | (str_ptr_ind & 0x7); + sljit_emit_op_custom(compiler, instruction, 5); + + if (load_twice) + { + instruction[4] = (1 << 3) | str_ptr_ind; + sljit_emit_op_custom(compiler, instruction, 5); + } + instruction[1] = 0x0f; + } + +#else + +instruction[2] = 0x6f; +instruction[3] = (0 << 3) | str_ptr_ind; +sljit_emit_op_custom(compiler, instruction, 4); + +if (load_twice) + { + instruction[3] = (1 << 3) | str_ptr_ind; + sljit_emit_op_custom(compiler, instruction, 4); + } + +#endif + +if (bit != 0) + { + /* POR xmm1, xmm2/m128 */ + instruction[2] = 0xeb; + instruction[3] = 0xc0 | (0 << 3) | 3; + sljit_emit_op_custom(compiler, instruction, 4); + } + +/* PCMPEQB/W/D xmm1, xmm2/m128 */ +instruction[2] = 0x74 + SSE2_COMPARE_TYPE_INDEX; +instruction[3] = 0xc0 | (0 << 3) | 2; +sljit_emit_op_custom(compiler, instruction, 4); + +if (load_twice) + { + instruction[3] = 0xc0 | (1 << 3) | 3; + sljit_emit_op_custom(compiler, instruction, 4); + } + +/* PMOVMSKB reg, xmm */ +instruction[2] = 0xd7; +instruction[3] = 0xc0 | (tmp1_ind << 3) | 0; +sljit_emit_op_custom(compiler, instruction, 4); + +if (load_twice) + { + instruction[3] = 0xc0 | (tmp2_ind << 3) | 1; + sljit_emit_op_custom(compiler, instruction, 4); + + OP2(SLJIT_OR, TMP1, 0, TMP1, 0, TMP2, 0); + } + +/* BSF r32, r/m32 */ +instruction[0] = 0x0f; +instruction[1] = 0xbc; +instruction[2] = 0xc0 | (tmp1_ind << 3) | tmp1_ind; +sljit_emit_op_custom(compiler, instruction, 3); + +JUMPTO(SLJIT_ZERO, start); + +OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP1, 0); + +start = LABEL(); +SET_LABEL(quit[0], start); +SET_LABEL(quit[1], start); +SET_LABEL(quit[2], start); +} + +#undef SSE2_COMPARE_TYPE_INDEX + +#endif + +static void fast_forward_first_char2(compiler_common *common, pcre_uchar char1, pcre_uchar char2, sljit_s32 offset) { DEFINE_COMPILER; struct sljit_label *start; struct sljit_jump *quit; -pcre_uint32 chars[MAX_N_CHARS * 2]; -pcre_uint8 bytes[MAX_N_CHARS * MAX_N_BYTES]; -pcre_uint8 ones[MAX_N_CHARS]; -int offsets[3]; -pcre_uint32 mask; -pcre_uint8 *byte_set, *byte_set_end; -int i, max, from; -int range_right = -1, range_len = 3 - 1; -sljit_ub *update_table = NULL; -BOOL in_range; -pcre_uint32 rec_count; +struct sljit_jump *found; +pcre_uchar mask; +#if defined SUPPORT_UTF && !defined COMPILE_PCRE32 +struct sljit_label *utf_start = NULL; +struct sljit_jump *utf_quit = NULL; +#endif +BOOL has_match_end = (common->match_end_ptr != 0); -for (i = 0; i < MAX_N_CHARS; i++) +if (offset > 0) + OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(offset)); + +if (has_match_end) { - chars[i << 1] = NOTACHAR; - chars[(i << 1) + 1] = 0; - bytes[i * MAX_N_BYTES] = 0; - } + OP1(SLJIT_MOV, TMP3, 0, STR_END, 0); -rec_count = 10000; -max = scan_prefix(common, common->start, chars, bytes, MAX_N_CHARS, &rec_count); - -if (max <= 1) - return FALSE; - -for (i = 0; i < max; i++) - { - mask = chars[(i << 1) + 1]; - ones[i] = ones_in_half_byte[mask & 0xf]; - mask >>= 4; - while (mask != 0) + OP2(SLJIT_ADD, STR_END, 0, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr, SLJIT_IMM, IN_UCHARS(offset + 1)); +#if (defined SLJIT_CONFIG_X86 && SLJIT_CONFIG_X86) + if (sljit_x86_is_cmov_available()) { - ones[i] += ones_in_half_byte[mask & 0xf]; - mask >>= 4; + OP2(SLJIT_SUB | SLJIT_SET_U, SLJIT_UNUSED, 0, STR_END, 0, TMP3, 0); + sljit_x86_emit_cmov(compiler, SLJIT_GREATER, STR_END, TMP3, 0); + } +#endif + { + quit = CMP(SLJIT_LESS_EQUAL, STR_END, 0, TMP3, 0); + OP1(SLJIT_MOV, STR_END, 0, TMP3, 0); + JUMPHERE(quit); } } +#if defined SUPPORT_UTF && !defined COMPILE_PCRE32 +if (common->utf && offset > 0) + utf_start = LABEL(); +#endif + +#if (defined SLJIT_CONFIG_X86 && SLJIT_CONFIG_X86) + +/* SSE2 accelerated first character search. */ + +if (sljit_x86_is_sse2_available()) + { + fast_forward_first_char2_sse2(common, char1, char2); + + SLJIT_ASSERT(common->mode == JIT_COMPILE || offset == 0); + if (common->mode == JIT_COMPILE) + { + /* In complete mode, we don't need to run a match when STR_PTR == STR_END. */ + SLJIT_ASSERT(common->forced_quit_label == NULL); + OP1(SLJIT_MOV, SLJIT_RETURN_REG, 0, SLJIT_IMM, PCRE_ERROR_NOMATCH); + add_jump(compiler, &common->forced_quit, CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0)); + +#if defined SUPPORT_UTF && !defined COMPILE_PCRE32 + if (common->utf && offset > 0) + { + SLJIT_ASSERT(common->mode == JIT_COMPILE); + + OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-offset)); + OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); +#if defined COMPILE_PCRE8 + OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xc0); + CMPTO(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, 0x80, utf_start); +#elif defined COMPILE_PCRE16 + OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xfc00); + CMPTO(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, 0xdc00, utf_start); +#else +#error "Unknown code width" +#endif + OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); + } +#endif + + if (offset > 0) + OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(offset)); + } + else if (sljit_x86_is_cmov_available()) + { + OP2(SLJIT_SUB | SLJIT_SET_U, SLJIT_UNUSED, 0, STR_PTR, 0, STR_END, 0); + sljit_x86_emit_cmov(compiler, SLJIT_GREATER_EQUAL, STR_PTR, has_match_end ? SLJIT_MEM1(SLJIT_SP) : STR_END, has_match_end ? common->match_end_ptr : 0); + } + else + { + quit = CMP(SLJIT_LESS, STR_PTR, 0, STR_END, 0); + OP1(SLJIT_MOV, STR_PTR, 0, has_match_end ? SLJIT_MEM1(SLJIT_SP) : STR_END, has_match_end ? common->match_end_ptr : 0); + JUMPHERE(quit); + } + + if (has_match_end) + OP1(SLJIT_MOV, STR_END, 0, TMP3, 0); + return; + } + +#endif + +quit = CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0); + +start = LABEL(); +OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), 0); + +if (char1 == char2) + found = CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, char1); +else + { + mask = char1 ^ char2; + if (is_powerof2(mask)) + { + OP2(SLJIT_OR, TMP1, 0, TMP1, 0, SLJIT_IMM, mask); + found = CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, char1 | mask); + } + else + { + OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, char1); + OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_UNUSED, 0, SLJIT_EQUAL); + OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, char2); + OP_FLAGS(SLJIT_OR | SLJIT_SET_E, TMP2, 0, TMP2, 0, SLJIT_EQUAL); + found = JUMP(SLJIT_NOT_ZERO); + } + } + +OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); +CMPTO(SLJIT_LESS, STR_PTR, 0, STR_END, 0, start); + +#if defined SUPPORT_UTF && !defined COMPILE_PCRE32 +if (common->utf && offset > 0) + utf_quit = JUMP(SLJIT_JUMP); +#endif + +JUMPHERE(found); + +#if defined SUPPORT_UTF && !defined COMPILE_PCRE32 +if (common->utf && offset > 0) + { + OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-offset)); + OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); +#if defined COMPILE_PCRE8 + OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xc0); + CMPTO(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, 0x80, utf_start); +#elif defined COMPILE_PCRE16 + OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xfc00); + CMPTO(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, 0xdc00, utf_start); +#else +#error "Unknown code width" +#endif + OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); + JUMPHERE(utf_quit); + } +#endif + +JUMPHERE(quit); + +if (has_match_end) + { + quit = CMP(SLJIT_LESS, STR_PTR, 0, STR_END, 0); + OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr); + if (offset > 0) + OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(offset)); + JUMPHERE(quit); + OP1(SLJIT_MOV, STR_END, 0, TMP3, 0); + } + +if (offset > 0) + OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(offset)); +} + +static SLJIT_INLINE BOOL fast_forward_first_n_chars(compiler_common *common) +{ +DEFINE_COMPILER; +struct sljit_label *start; +struct sljit_jump *quit; +struct sljit_jump *match; +/* bytes[0] represent the number of characters between 0 +and MAX_N_BYTES - 1, 255 represents any character. */ +pcre_uchar chars[MAX_N_CHARS * MAX_DIFF_CHARS]; +sljit_s32 offset; +pcre_uchar mask; +pcre_uchar *char_set, *char_set_end; +int i, max, from; +int range_right = -1, range_len; +sljit_u8 *update_table = NULL; +BOOL in_range; +sljit_u32 rec_count; + +for (i = 0; i < MAX_N_CHARS; i++) + chars[i * MAX_DIFF_CHARS] = 0; + +rec_count = 10000; +max = scan_prefix(common, common->start, chars, MAX_N_CHARS, &rec_count); + +if (max < 1) + return FALSE; + in_range = FALSE; -from = 0; /* Prevent compiler "uninitialized" warning */ +/* Prevent compiler "uninitialized" warning */ +from = 0; +range_len = 4 /* minimum length */ - 1; for (i = 0; i <= max; i++) { - if (in_range && (i - from) > range_len && (bytes[(i - 1) * MAX_N_BYTES] <= 4)) + if (in_range && (i - from) > range_len && (chars[(i - 1) * MAX_DIFF_CHARS] < 255)) { range_len = i - from; range_right = i - 1; } - if (i < max && bytes[i * MAX_N_BYTES] < 255) + if (i < max && chars[i * MAX_DIFF_CHARS] < 255) { + SLJIT_ASSERT(chars[i * MAX_DIFF_CHARS] > 0); if (!in_range) { in_range = TRUE; from = i; } } - else if (in_range) + else in_range = FALSE; } if (range_right >= 0) { - update_table = (sljit_ub *)allocate_read_only_data(common, 256); + update_table = (sljit_u8 *)allocate_read_only_data(common, 256); if (update_table == NULL) return TRUE; memset(update_table, IN_UCHARS(range_len), 256); for (i = 0; i < range_len; i++) { - byte_set = bytes + ((range_right - i) * MAX_N_BYTES); - SLJIT_ASSERT(byte_set[0] > 0 && byte_set[0] < 255); - byte_set_end = byte_set + byte_set[0]; - byte_set++; - while (byte_set <= byte_set_end) + char_set = chars + ((range_right - i) * MAX_DIFF_CHARS); + SLJIT_ASSERT(char_set[0] > 0 && char_set[0] < 255); + char_set_end = char_set + char_set[0]; + char_set++; + while (char_set <= char_set_end) { - if (update_table[*byte_set] > IN_UCHARS(i)) - update_table[*byte_set] = IN_UCHARS(i); - byte_set++; + if (update_table[(*char_set) & 0xff] > IN_UCHARS(i)) + update_table[(*char_set) & 0xff] = IN_UCHARS(i); + char_set++; } } } -offsets[0] = -1; +offset = -1; /* Scan forward. */ for (i = 0; i < max; i++) - if (ones[i] <= 2) { - offsets[0] = i; - break; - } - -if (offsets[0] < 0 && range_right < 0) - return FALSE; - -if (offsets[0] >= 0) { - /* Scan backward. */ - offsets[1] = -1; - for (i = max - 1; i > offsets[0]; i--) - if (ones[i] <= 2 && i != range_right) - { - offsets[1] = i; - break; - } - - /* This case is handled better by fast_forward_first_char. */ - if (offsets[1] == -1 && offsets[0] == 0 && range_right < 0) - return FALSE; - - offsets[2] = -1; - /* We only search for a middle character if there is no range check. */ - if (offsets[1] >= 0 && range_right == -1) + if (offset == -1) { - /* Scan from middle. */ - for (i = (offsets[0] + offsets[1]) / 2 + 1; i < offsets[1]; i++) - if (ones[i] <= 2) + if (chars[i * MAX_DIFF_CHARS] <= 2) + offset = i; + } + else if (chars[offset * MAX_DIFF_CHARS] == 2 && chars[i * MAX_DIFF_CHARS] <= 2) + { + if (chars[i * MAX_DIFF_CHARS] == 1) + offset = i; + else + { + mask = chars[offset * MAX_DIFF_CHARS + 1] ^ chars[offset * MAX_DIFF_CHARS + 2]; + if (!is_powerof2(mask)) { - offsets[2] = i; - break; + mask = chars[i * MAX_DIFF_CHARS + 1] ^ chars[i * MAX_DIFF_CHARS + 2]; + if (is_powerof2(mask)) + offset = i; } - - if (offsets[2] == -1) - { - for (i = (offsets[0] + offsets[1]) / 2; i > offsets[0]; i--) - if (ones[i] <= 2) - { - offsets[2] = i; - break; - } } } - - SLJIT_ASSERT(offsets[1] == -1 || (offsets[0] < offsets[1])); - SLJIT_ASSERT(offsets[2] == -1 || (offsets[0] < offsets[2] && offsets[1] > offsets[2])); - - chars[0] = chars[offsets[0] << 1]; - chars[1] = chars[(offsets[0] << 1) + 1]; - if (offsets[2] >= 0) - { - chars[2] = chars[offsets[2] << 1]; - chars[3] = chars[(offsets[2] << 1) + 1]; - } - if (offsets[1] >= 0) - { - chars[4] = chars[offsets[1] << 1]; - chars[5] = chars[(offsets[1] << 1) + 1]; - } } +if (range_right < 0) + { + if (offset < 0) + return FALSE; + SLJIT_ASSERT(chars[offset * MAX_DIFF_CHARS] >= 1 && chars[offset * MAX_DIFF_CHARS] <= 2); + /* Works regardless the value is 1 or 2. */ + mask = chars[offset * MAX_DIFF_CHARS + chars[offset * MAX_DIFF_CHARS]]; + fast_forward_first_char2(common, chars[offset * MAX_DIFF_CHARS + 1], mask, offset); + return TRUE; + } + +if (range_right == offset) + offset = -1; + +SLJIT_ASSERT(offset == -1 || (chars[offset * MAX_DIFF_CHARS] >= 1 && chars[offset * MAX_DIFF_CHARS] <= 2)); + max -= 1; -if (firstline) +SLJIT_ASSERT(max > 0); +if (common->match_end_ptr != 0) { - SLJIT_ASSERT(common->first_line_end != 0); - OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->first_line_end); + OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr); OP1(SLJIT_MOV, TMP3, 0, STR_END, 0); OP2(SLJIT_SUB, STR_END, 0, STR_END, 0, SLJIT_IMM, IN_UCHARS(max)); quit = CMP(SLJIT_LESS_EQUAL, STR_END, 0, TMP1, 0); @@ -3736,68 +4432,86 @@ if (firstline) else OP2(SLJIT_SUB, STR_END, 0, STR_END, 0, SLJIT_IMM, IN_UCHARS(max)); +SLJIT_ASSERT(range_right >= 0); + #if !(defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32) -if (range_right >= 0) - OP1(SLJIT_MOV, RETURN_ADDR, 0, SLJIT_IMM, (sljit_sw)update_table); +OP1(SLJIT_MOV, RETURN_ADDR, 0, SLJIT_IMM, (sljit_sw)update_table); #endif start = LABEL(); quit = CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0); -SLJIT_ASSERT(range_right >= 0 || offsets[0] >= 0); - -if (range_right >= 0) - { #if defined COMPILE_PCRE8 || (defined SLJIT_LITTLE_ENDIAN && SLJIT_LITTLE_ENDIAN) - OP1(SLJIT_MOV_UB, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(range_right)); +OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(range_right)); #else - OP1(SLJIT_MOV_UB, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(range_right + 1) - 1); +OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(range_right + 1) - 1); #endif #if !(defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32) - OP1(SLJIT_MOV_UB, TMP1, 0, SLJIT_MEM2(RETURN_ADDR, TMP1), 0); +OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM2(RETURN_ADDR, TMP1), 0); #else - OP1(SLJIT_MOV_UB, TMP1, 0, SLJIT_MEM1(TMP1), (sljit_sw)update_table); +OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP1), (sljit_sw)update_table); #endif - OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP1, 0); - CMPTO(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, 0, start); - } +OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP1, 0); +CMPTO(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, 0, start); -if (offsets[0] >= 0) +if (offset >= 0) { - OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(offsets[0])); - if (offsets[1] >= 0) - OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(offsets[1])); + OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(offset)); OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); - if (chars[1] != 0) - OP2(SLJIT_OR, TMP1, 0, TMP1, 0, SLJIT_IMM, chars[1]); - CMPTO(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, chars[0], start); - if (offsets[2] >= 0) - OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(offsets[2] - 1)); - - if (offsets[1] >= 0) + if (chars[offset * MAX_DIFF_CHARS] == 1) + CMPTO(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, chars[offset * MAX_DIFF_CHARS + 1], start); + else { - if (chars[5] != 0) - OP2(SLJIT_OR, TMP2, 0, TMP2, 0, SLJIT_IMM, chars[5]); - CMPTO(SLJIT_NOT_EQUAL, TMP2, 0, SLJIT_IMM, chars[4], start); + mask = chars[offset * MAX_DIFF_CHARS + 1] ^ chars[offset * MAX_DIFF_CHARS + 2]; + if (is_powerof2(mask)) + { + OP2(SLJIT_OR, TMP1, 0, TMP1, 0, SLJIT_IMM, mask); + CMPTO(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, chars[offset * MAX_DIFF_CHARS + 1] | mask, start); + } + else + { + match = CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, chars[offset * MAX_DIFF_CHARS + 1]); + CMPTO(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, chars[offset * MAX_DIFF_CHARS + 2], start); + JUMPHERE(match); + } } - - if (offsets[2] >= 0) - { - if (chars[3] != 0) - OP2(SLJIT_OR, TMP1, 0, TMP1, 0, SLJIT_IMM, chars[3]); - CMPTO(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, chars[2], start); - } - OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); } +#if defined SUPPORT_UTF && !defined COMPILE_PCRE32 +if (common->utf && offset != 0) + { + if (offset < 0) + { + OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), 0); + OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); + } + else + OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-1)); +#if defined COMPILE_PCRE8 + OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xc0); + CMPTO(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, 0x80, start); +#elif defined COMPILE_PCRE16 + OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xfc00); + CMPTO(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, 0xdc00, start); +#else +#error "Unknown code width" +#endif + if (offset < 0) + OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); + } +#endif + +if (offset >= 0) + OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); + JUMPHERE(quit); -if (firstline) +if (common->match_end_ptr != 0) { if (range_right >= 0) - OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->first_line_end); + OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr); OP1(SLJIT_MOV, STR_END, 0, TMP3, 0); if (range_right >= 0) { @@ -3812,66 +4526,26 @@ return TRUE; } #undef MAX_N_CHARS -#undef MAX_N_BYTES +#undef MAX_DIFF_CHARS -static SLJIT_INLINE void fast_forward_first_char(compiler_common *common, pcre_uchar first_char, BOOL caseless, BOOL firstline) +static SLJIT_INLINE void fast_forward_first_char(compiler_common *common, pcre_uchar first_char, BOOL caseless) { -DEFINE_COMPILER; -struct sljit_label *start; -struct sljit_jump *quit; -struct sljit_jump *found; -pcre_uchar oc, bit; - -if (firstline) - { - SLJIT_ASSERT(common->first_line_end != 0); - OP1(SLJIT_MOV, TMP3, 0, STR_END, 0); - OP1(SLJIT_MOV, STR_END, 0, SLJIT_MEM1(SLJIT_SP), common->first_line_end); - } - -start = LABEL(); -quit = CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0); -OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), 0); +pcre_uchar oc; oc = first_char; if (caseless) { oc = TABLE_GET(first_char, common->fcc, first_char); -#if defined SUPPORT_UCP && !(defined COMPILE_PCRE8) +#if defined SUPPORT_UCP && !defined COMPILE_PCRE8 if (first_char > 127 && common->utf) oc = UCD_OTHERCASE(first_char); #endif } -if (first_char == oc) - found = CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, first_char); -else - { - bit = first_char ^ oc; - if (is_powerof2(bit)) - { - OP2(SLJIT_OR, TMP2, 0, TMP1, 0, SLJIT_IMM, bit); - found = CMP(SLJIT_EQUAL, TMP2, 0, SLJIT_IMM, first_char | bit); - } - else - { - OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, first_char); - OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_UNUSED, 0, SLJIT_EQUAL); - OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, oc); - OP_FLAGS(SLJIT_OR | SLJIT_SET_E, TMP2, 0, TMP2, 0, SLJIT_EQUAL); - found = JUMP(SLJIT_NOT_ZERO); - } - } -OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); -JUMPTO(SLJIT_JUMP, start); -JUMPHERE(found); -JUMPHERE(quit); - -if (firstline) - OP1(SLJIT_MOV, STR_END, 0, TMP3, 0); +fast_forward_first_char2(common, first_char, oc, 0); } -static SLJIT_INLINE void fast_forward_newline(compiler_common *common, BOOL firstline) +static SLJIT_INLINE void fast_forward_newline(compiler_common *common) { DEFINE_COMPILER; struct sljit_label *loop; @@ -3882,11 +4556,10 @@ struct sljit_jump *foundcr = NULL; struct sljit_jump *notfoundnl; jump_list *newline = NULL; -if (firstline) +if (common->match_end_ptr != 0) { - SLJIT_ASSERT(common->first_line_end != 0); OP1(SLJIT_MOV, TMP3, 0, STR_END, 0); - OP1(SLJIT_MOV, STR_END, 0, SLJIT_MEM1(SLJIT_SP), common->first_line_end); + OP1(SLJIT_MOV, STR_END, 0, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr); } if (common->nltype == NLTYPE_FIXED && common->newline > 255) @@ -3917,7 +4590,7 @@ if (common->nltype == NLTYPE_FIXED && common->newline > 255) JUMPHERE(firstchar); JUMPHERE(lastchar); - if (firstline) + if (common->match_end_ptr != 0) OP1(SLJIT_MOV, STR_END, 0, TMP3, 0); return; } @@ -3955,13 +4628,13 @@ if (common->nltype == NLTYPE_ANY || common->nltype == NLTYPE_ANYCRLF) JUMPHERE(lastchar); JUMPHERE(firstchar); -if (firstline) +if (common->match_end_ptr != 0) OP1(SLJIT_MOV, STR_END, 0, TMP3, 0); } -static BOOL check_class_ranges(compiler_common *common, const pcre_uint8 *bits, BOOL nclass, BOOL invert, jump_list **backtracks); +static BOOL check_class_ranges(compiler_common *common, const sljit_u8 *bits, BOOL nclass, BOOL invert, jump_list **backtracks); -static SLJIT_INLINE void fast_forward_start_bits(compiler_common *common, pcre_uint8 *start_bits, BOOL firstline) +static SLJIT_INLINE void fast_forward_start_bits(compiler_common *common, const sljit_u8 *start_bits) { DEFINE_COMPILER; struct sljit_label *start; @@ -3972,11 +4645,10 @@ jump_list *matches = NULL; struct sljit_jump *jump; #endif -if (firstline) +if (common->match_end_ptr != 0) { - SLJIT_ASSERT(common->first_line_end != 0); OP1(SLJIT_MOV, RETURN_ADDR, 0, STR_END, 0); - OP1(SLJIT_MOV, STR_END, 0, SLJIT_MEM1(SLJIT_SP), common->first_line_end); + OP1(SLJIT_MOV, STR_END, 0, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr); } start = LABEL(); @@ -3996,7 +4668,7 @@ if (!check_class_ranges(common, start_bits, (start_bits[31] & 0x80) != 0, TRUE, #endif OP2(SLJIT_AND, TMP2, 0, TMP1, 0, SLJIT_IMM, 0x7); OP2(SLJIT_LSHR, TMP1, 0, TMP1, 0, SLJIT_IMM, 3); - OP1(SLJIT_MOV_UB, TMP1, 0, SLJIT_MEM1(TMP1), (sljit_sw)start_bits); + OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP1), (sljit_sw)start_bits); OP2(SLJIT_SHL, TMP2, 0, SLJIT_IMM, 1, TMP2, 0); OP2(SLJIT_AND | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, TMP2, 0); found = JUMP(SLJIT_NOT_ZERO); @@ -4012,7 +4684,7 @@ OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); if (common->utf) { CMPTO(SLJIT_LESS, TMP1, 0, SLJIT_IMM, 0xc0, start); - OP1(SLJIT_MOV_UB, TMP1, 0, SLJIT_MEM1(TMP1), (sljit_sw)PRIV(utf8_table4) - 0xc0); + OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP1), (sljit_sw)PRIV(utf8_table4) - 0xc0); OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP1, 0); } #elif defined COMPILE_PCRE16 @@ -4034,7 +4706,7 @@ if (matches != NULL) set_jumps(matches, LABEL()); JUMPHERE(quit); -if (firstline) +if (common->match_end_ptr != 0) OP1(SLJIT_MOV, STR_END, 0, RETURN_ADDR, 0); } @@ -4047,7 +4719,7 @@ struct sljit_jump *alreadyfound; struct sljit_jump *found; struct sljit_jump *foundoc = NULL; struct sljit_jump *notfound; -pcre_uint32 oc, bit; +sljit_u32 oc, bit; SLJIT_ASSERT(common->req_char_ptr != 0); OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), common->req_char_ptr); @@ -4184,7 +4856,7 @@ else if (common->utf) jump = CMP(SLJIT_GREATER, TMP1, 0, SLJIT_IMM, 255); #endif /* COMPILE_PCRE8 */ - OP1(SLJIT_MOV_UB, TMP1, 0, SLJIT_MEM1(TMP1), common->ctypes); + OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP1), common->ctypes); OP2(SLJIT_LSHR, TMP1, 0, TMP1, 0, SLJIT_IMM, 4 /* ctype_word */); OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, 1); OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), LOCALS1, TMP1, 0); @@ -4229,7 +4901,7 @@ else if (common->utf) jump = CMP(SLJIT_GREATER, TMP1, 0, SLJIT_IMM, 255); #endif - OP1(SLJIT_MOV_UB, TMP2, 0, SLJIT_MEM1(TMP1), common->ctypes); + OP1(SLJIT_MOV_U8, TMP2, 0, SLJIT_MEM1(TMP1), common->ctypes); OP2(SLJIT_LSHR, TMP2, 0, TMP2, 0, SLJIT_IMM, 4 /* ctype_word */); OP2(SLJIT_AND, TMP2, 0, TMP2, 0, SLJIT_IMM, 1); #ifndef COMPILE_PCRE8 @@ -4245,11 +4917,12 @@ OP2(SLJIT_XOR | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP2, 0, SLJIT_MEM1(SLJIT_SP), LOC sljit_emit_fast_return(compiler, SLJIT_MEM1(SLJIT_SP), LOCALS0); } -static BOOL check_class_ranges(compiler_common *common, const pcre_uint8 *bits, BOOL nclass, BOOL invert, jump_list **backtracks) +static BOOL check_class_ranges(compiler_common *common, const sljit_u8 *bits, BOOL nclass, BOOL invert, jump_list **backtracks) { +/* May destroy TMP1. */ DEFINE_COMPILER; int ranges[MAX_RANGE_SIZE]; -pcre_uint8 bit, cbit, all; +sljit_u8 bit, cbit, all; int i, byte, length = 0; bit = bits[0] & 0x1; @@ -4544,12 +5217,12 @@ OP1(MOVU_UCHAR, CHAR2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(1)); #ifndef COMPILE_PCRE8 jump = CMP(SLJIT_GREATER, CHAR1, 0, SLJIT_IMM, 255); #endif -OP1(SLJIT_MOV_UB, CHAR1, 0, SLJIT_MEM2(LCC_TABLE, CHAR1), 0); +OP1(SLJIT_MOV_U8, CHAR1, 0, SLJIT_MEM2(LCC_TABLE, CHAR1), 0); #ifndef COMPILE_PCRE8 JUMPHERE(jump); jump = CMP(SLJIT_GREATER, CHAR2, 0, SLJIT_IMM, 255); #endif -OP1(SLJIT_MOV_UB, CHAR2, 0, SLJIT_MEM2(LCC_TABLE, CHAR2), 0); +OP1(SLJIT_MOV_U8, CHAR2, 0, SLJIT_MEM2(LCC_TABLE, CHAR2), 0); #ifndef COMPILE_PCRE8 JUMPHERE(jump); #endif @@ -4574,11 +5247,11 @@ sljit_emit_fast_return(compiler, RETURN_ADDR, 0); static const pcre_uchar * SLJIT_CALL do_utf_caselesscmp(pcre_uchar *src1, jit_arguments *args, pcre_uchar *end1) { /* This function would be ineffective to do in JIT level. */ -pcre_uint32 c1, c2; +sljit_u32 c1, c2; const pcre_uchar *src2 = args->uchar_ptr; const pcre_uchar *end2 = args->end; const ucd_record *ur; -const pcre_uint32 *pp; +const sljit_u32 *pp; while (src1 < end1) { @@ -4638,16 +5311,16 @@ if (context->sourcereg == -1) #if defined COMPILE_PCRE8 #if defined SLJIT_UNALIGNED && SLJIT_UNALIGNED if (context->length >= 4) - OP1(SLJIT_MOV_SI, TMP1, 0, SLJIT_MEM1(STR_PTR), -context->length); + OP1(SLJIT_MOV_S32, TMP1, 0, SLJIT_MEM1(STR_PTR), -context->length); else if (context->length >= 2) - OP1(SLJIT_MOV_UH, TMP1, 0, SLJIT_MEM1(STR_PTR), -context->length); + OP1(SLJIT_MOV_U16, TMP1, 0, SLJIT_MEM1(STR_PTR), -context->length); else #endif - OP1(SLJIT_MOV_UB, TMP1, 0, SLJIT_MEM1(STR_PTR), -context->length); + OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(STR_PTR), -context->length); #elif defined COMPILE_PCRE16 #if defined SLJIT_UNALIGNED && SLJIT_UNALIGNED if (context->length >= 4) - OP1(SLJIT_MOV_SI, TMP1, 0, SLJIT_MEM1(STR_PTR), -context->length); + OP1(SLJIT_MOV_S32, TMP1, 0, SLJIT_MEM1(STR_PTR), -context->length); else #endif OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), -context->length); @@ -4689,12 +5362,12 @@ do #endif { if (context->length >= 4) - OP1(SLJIT_MOV_SI, context->sourcereg, 0, SLJIT_MEM1(STR_PTR), -context->length); + OP1(SLJIT_MOV_S32, context->sourcereg, 0, SLJIT_MEM1(STR_PTR), -context->length); else if (context->length >= 2) - OP1(SLJIT_MOV_UH, context->sourcereg, 0, SLJIT_MEM1(STR_PTR), -context->length); + OP1(SLJIT_MOV_U16, context->sourcereg, 0, SLJIT_MEM1(STR_PTR), -context->length); #if defined COMPILE_PCRE8 else if (context->length >= 1) - OP1(SLJIT_MOV_UB, context->sourcereg, 0, SLJIT_MEM1(STR_PTR), -context->length); + OP1(SLJIT_MOV_U8, context->sourcereg, 0, SLJIT_MEM1(STR_PTR), -context->length); #endif /* COMPILE_PCRE8 */ context->sourcereg = context->sourcereg == TMP1 ? TMP2 : TMP1; @@ -4777,6 +5450,8 @@ return cc; } \ charoffset = (value); +static pcre_uchar *compile_char1_matchingpath(compiler_common *common, pcre_uchar type, pcre_uchar *cc, jump_list **backtracks, BOOL check_str_ptr); + static void compile_xclass_matchingpath(compiler_common *common, pcre_uchar *cc, jump_list **backtracks) { DEFINE_COMPILER; @@ -4793,8 +5468,8 @@ BOOL utf = common->utf; #ifdef SUPPORT_UCP BOOL needstype = FALSE, needsscript = FALSE, needschar = FALSE; BOOL charsaved = FALSE; -int typereg = TMP1, scriptreg = TMP1; -const pcre_uint32 *other_cases; +int typereg = TMP1; +const sljit_u32 *other_cases; sljit_uw typeoffset; #endif @@ -4856,6 +5531,14 @@ while (*cc != XCL_END) switch(*cc) { case PT_ANY: + /* Any either accepts everything or ignored. */ + if (cc[-1] == XCL_PROP) + { + compile_char1_matchingpath(common, OP_ALLANY, cc, backtracks, FALSE); + if (list == backtracks) + add_jump(compiler, backtracks, JUMP(SLJIT_JUMP)); + return; + } break; case PT_LAMP: @@ -4892,10 +5575,10 @@ while (*cc != XCL_END) } #endif } +SLJIT_ASSERT(compares > 0); /* We are not necessary in utf mode even in 8 bit mode. */ cc = ccbegin; -detect_partial_match(common, backtracks); read_char_range(common, min, max, (cc[-1] & XCL_NOT) != 0); if ((cc[-1] & XCL_HASPROP) == 0) @@ -4903,11 +5586,11 @@ if ((cc[-1] & XCL_HASPROP) == 0) if ((cc[-1] & XCL_MAP) != 0) { jump = CMP(SLJIT_GREATER, TMP1, 0, SLJIT_IMM, 255); - if (!check_class_ranges(common, (const pcre_uint8 *)cc, (((const pcre_uint8 *)cc)[31] & 0x80) != 0, TRUE, &found)) + if (!check_class_ranges(common, (const sljit_u8 *)cc, (((const sljit_u8 *)cc)[31] & 0x80) != 0, TRUE, &found)) { OP2(SLJIT_AND, TMP2, 0, TMP1, 0, SLJIT_IMM, 0x7); OP2(SLJIT_LSHR, TMP1, 0, TMP1, 0, SLJIT_IMM, 3); - OP1(SLJIT_MOV_UB, TMP1, 0, SLJIT_MEM1(TMP1), (sljit_sw)cc); + OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP1), (sljit_sw)cc); OP2(SLJIT_SHL, TMP2, 0, SLJIT_IMM, 1, TMP2, 0); OP2(SLJIT_AND | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, TMP2, 0); add_jump(compiler, &found, JUMP(SLJIT_NOT_ZERO)); @@ -4926,11 +5609,11 @@ if ((cc[-1] & XCL_HASPROP) == 0) } else if ((cc[-1] & XCL_MAP) != 0) { - OP1(SLJIT_MOV, TMP3, 0, TMP1, 0); + OP1(SLJIT_MOV, RETURN_ADDR, 0, TMP1, 0); #ifdef SUPPORT_UCP charsaved = TRUE; #endif - if (!check_class_ranges(common, (const pcre_uint8 *)cc, FALSE, TRUE, list)) + if (!check_class_ranges(common, (const sljit_u8 *)cc, FALSE, TRUE, list)) { #ifdef COMPILE_PCRE8 jump = NULL; @@ -4940,7 +5623,7 @@ else if ((cc[-1] & XCL_MAP) != 0) OP2(SLJIT_AND, TMP2, 0, TMP1, 0, SLJIT_IMM, 0x7); OP2(SLJIT_LSHR, TMP1, 0, TMP1, 0, SLJIT_IMM, 3); - OP1(SLJIT_MOV_UB, TMP1, 0, SLJIT_MEM1(TMP1), (sljit_sw)cc); + OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP1), (sljit_sw)cc); OP2(SLJIT_SHL, TMP2, 0, SLJIT_IMM, 1, TMP2, 0); OP2(SLJIT_AND | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, TMP2, 0); add_jump(compiler, list, JUMP(SLJIT_NOT_ZERO)); @@ -4951,45 +5634,82 @@ else if ((cc[-1] & XCL_MAP) != 0) JUMPHERE(jump); } - OP1(SLJIT_MOV, TMP1, 0, TMP3, 0); + OP1(SLJIT_MOV, TMP1, 0, RETURN_ADDR, 0); cc += 32 / sizeof(pcre_uchar); } #ifdef SUPPORT_UCP -/* Simple register allocation. TMP1 is preferred if possible. */ if (needstype || needsscript) { if (needschar && !charsaved) - OP1(SLJIT_MOV, TMP3, 0, TMP1, 0); - add_jump(compiler, &common->getucd, JUMP(SLJIT_FAST_CALL)); - if (needschar) - { - if (needstype) - { - OP1(SLJIT_MOV, RETURN_ADDR, 0, TMP1, 0); - typereg = RETURN_ADDR; - } + OP1(SLJIT_MOV, RETURN_ADDR, 0, TMP1, 0); - if (needsscript) - scriptreg = TMP3; - OP1(SLJIT_MOV, TMP1, 0, TMP3, 0); - } - else if (needstype && needsscript) - scriptreg = TMP3; - /* In all other cases only one of them was specified, and that can goes to TMP1. */ + OP2(SLJIT_LSHR, TMP2, 0, TMP1, 0, SLJIT_IMM, UCD_BLOCK_SHIFT); + OP1(SLJIT_MOV_U8, TMP2, 0, SLJIT_MEM1(TMP2), (sljit_sw)PRIV(ucd_stage1)); + OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, UCD_BLOCK_MASK); + OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, UCD_BLOCK_SHIFT); + OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, TMP2, 0); + OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, (sljit_sw)PRIV(ucd_stage2)); + OP1(SLJIT_MOV_U16, TMP2, 0, SLJIT_MEM2(TMP2, TMP1), 1); + /* Before anything else, we deal with scripts. */ if (needsscript) { - if (scriptreg == TMP1) + OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, (sljit_sw)PRIV(ucd_records) + SLJIT_OFFSETOF(ucd_record, script)); + OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM2(TMP1, TMP2), 3); + + ccbegin = cc; + + while (*cc != XCL_END) { - OP1(SLJIT_MOV, scriptreg, 0, SLJIT_IMM, (sljit_sw)PRIV(ucd_records) + SLJIT_OFFSETOF(ucd_record, script)); - OP1(SLJIT_MOV_UB, scriptreg, 0, SLJIT_MEM2(scriptreg, TMP2), 3); + if (*cc == XCL_SINGLE) + { + cc ++; + GETCHARINCTEST(c, cc); + } + else if (*cc == XCL_RANGE) + { + cc ++; + GETCHARINCTEST(c, cc); + GETCHARINCTEST(c, cc); + } + else + { + SLJIT_ASSERT(*cc == XCL_PROP || *cc == XCL_NOTPROP); + cc++; + if (*cc == PT_SC) + { + compares--; + invertcmp = (compares == 0 && list != backtracks); + if (cc[-1] == XCL_NOTPROP) + invertcmp ^= 0x1; + jump = CMP(SLJIT_EQUAL ^ invertcmp, TMP1, 0, SLJIT_IMM, (int)cc[1]); + add_jump(compiler, compares > 0 ? list : backtracks, jump); + } + cc += 2; + } + } + + cc = ccbegin; + } + + if (needschar) + { + OP1(SLJIT_MOV, TMP1, 0, RETURN_ADDR, 0); + } + + if (needstype) + { + if (!needschar) + { + OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, (sljit_sw)PRIV(ucd_records) + SLJIT_OFFSETOF(ucd_record, chartype)); + OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM2(TMP1, TMP2), 3); } else { OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, 3); - OP2(SLJIT_ADD, TMP2, 0, TMP2, 0, SLJIT_IMM, (sljit_sw)PRIV(ucd_records) + SLJIT_OFFSETOF(ucd_record, script)); - OP1(SLJIT_MOV_UB, scriptreg, 0, SLJIT_MEM1(TMP2), 0); + OP1(SLJIT_MOV_U8, RETURN_ADDR, 0, SLJIT_MEM1(TMP2), (sljit_sw)PRIV(ucd_records) + SLJIT_OFFSETOF(ucd_record, chartype)); + typereg = RETURN_ADDR; } } } @@ -5061,20 +5781,15 @@ while (*cc != XCL_END) #ifdef SUPPORT_UCP else { + SLJIT_ASSERT(*cc == XCL_PROP || *cc == XCL_NOTPROP); if (*cc == XCL_NOTPROP) invertcmp ^= 0x1; cc++; switch(*cc) { case PT_ANY: - if (list != backtracks) - { - if ((cc[-1] == XCL_NOTPROP && compares > 0) || (cc[-1] == XCL_PROP && compares == 0)) - continue; - } - else if (cc[-1] == XCL_NOTPROP) - continue; - jump = JUMP(SLJIT_JUMP); + if (!invertcmp) + jump = JUMP(SLJIT_JUMP); break; case PT_LAMP: @@ -5098,7 +5813,8 @@ while (*cc != XCL_END) break; case PT_SC: - jump = CMP(SLJIT_EQUAL ^ invertcmp, scriptreg, 0, SLJIT_IMM, (int)cc[1]); + compares++; + /* Do nothing. */ break; case PT_SPACE: @@ -5264,6 +5980,10 @@ while (*cc != XCL_END) OP_FLAGS(SLJIT_OR | SLJIT_SET_E, TMP2, 0, TMP2, 0, SLJIT_LESS_EQUAL); jump = JUMP(SLJIT_NOT_ZERO ^ invertcmp); break; + + default: + SLJIT_ASSERT_STOP(); + break; } cc += 2; } @@ -5282,19 +6002,13 @@ if (found != NULL) #endif -static pcre_uchar *compile_char1_matchingpath(compiler_common *common, pcre_uchar type, pcre_uchar *cc, jump_list **backtracks) +static pcre_uchar *compile_simple_assertion_matchingpath(compiler_common *common, pcre_uchar type, pcre_uchar *cc, jump_list **backtracks) { DEFINE_COMPILER; int length; -unsigned int c, oc, bit; -compare_context context; struct sljit_jump *jump[4]; -jump_list *end_list; #ifdef SUPPORT_UTF struct sljit_label *label; -#ifdef SUPPORT_UCP -pcre_uchar propdata[5]; -#endif #endif /* SUPPORT_UTF */ switch(type) @@ -5317,191 +6031,6 @@ switch(type) add_jump(compiler, backtracks, JUMP(type == OP_NOT_WORD_BOUNDARY ? SLJIT_NOT_ZERO : SLJIT_ZERO)); return cc; - case OP_NOT_DIGIT: - case OP_DIGIT: - /* Digits are usually 0-9, so it is worth to optimize them. */ - detect_partial_match(common, backtracks); -#if defined SUPPORT_UTF && defined COMPILE_PCRE8 - if (common->utf && is_char7_bitset((const pcre_uint8*)common->ctypes - cbit_length + cbit_digit, FALSE)) - read_char7_type(common, type == OP_NOT_DIGIT); - else -#endif - read_char8_type(common, type == OP_NOT_DIGIT); - /* Flip the starting bit in the negative case. */ - OP2(SLJIT_AND | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, ctype_digit); - add_jump(compiler, backtracks, JUMP(type == OP_DIGIT ? SLJIT_ZERO : SLJIT_NOT_ZERO)); - return cc; - - case OP_NOT_WHITESPACE: - case OP_WHITESPACE: - detect_partial_match(common, backtracks); -#if defined SUPPORT_UTF && defined COMPILE_PCRE8 - if (common->utf && is_char7_bitset((const pcre_uint8*)common->ctypes - cbit_length + cbit_space, FALSE)) - read_char7_type(common, type == OP_NOT_WHITESPACE); - else -#endif - read_char8_type(common, type == OP_NOT_WHITESPACE); - OP2(SLJIT_AND | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, ctype_space); - add_jump(compiler, backtracks, JUMP(type == OP_WHITESPACE ? SLJIT_ZERO : SLJIT_NOT_ZERO)); - return cc; - - case OP_NOT_WORDCHAR: - case OP_WORDCHAR: - detect_partial_match(common, backtracks); -#if defined SUPPORT_UTF && defined COMPILE_PCRE8 - if (common->utf && is_char7_bitset((const pcre_uint8*)common->ctypes - cbit_length + cbit_word, FALSE)) - read_char7_type(common, type == OP_NOT_WORDCHAR); - else -#endif - read_char8_type(common, type == OP_NOT_WORDCHAR); - OP2(SLJIT_AND | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, ctype_word); - add_jump(compiler, backtracks, JUMP(type == OP_WORDCHAR ? SLJIT_ZERO : SLJIT_NOT_ZERO)); - return cc; - - case OP_ANY: - detect_partial_match(common, backtracks); - read_char_range(common, common->nlmin, common->nlmax, TRUE); - if (common->nltype == NLTYPE_FIXED && common->newline > 255) - { - jump[0] = CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, (common->newline >> 8) & 0xff); - end_list = NULL; - if (common->mode != JIT_PARTIAL_HARD_COMPILE) - add_jump(compiler, &end_list, CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0)); - else - check_str_end(common, &end_list); - - OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), 0); - add_jump(compiler, backtracks, CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, common->newline & 0xff)); - set_jumps(end_list, LABEL()); - JUMPHERE(jump[0]); - } - else - check_newlinechar(common, common->nltype, backtracks, TRUE); - return cc; - - case OP_ALLANY: - detect_partial_match(common, backtracks); -#ifdef SUPPORT_UTF - if (common->utf) - { - OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), 0); - OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); -#if defined COMPILE_PCRE8 || defined COMPILE_PCRE16 -#if defined COMPILE_PCRE8 - jump[0] = CMP(SLJIT_LESS, TMP1, 0, SLJIT_IMM, 0xc0); - OP1(SLJIT_MOV_UB, TMP1, 0, SLJIT_MEM1(TMP1), (sljit_sw)PRIV(utf8_table4) - 0xc0); - OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP1, 0); -#elif defined COMPILE_PCRE16 - jump[0] = CMP(SLJIT_LESS, TMP1, 0, SLJIT_IMM, 0xd800); - OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xfc00); - OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0xd800); - OP_FLAGS(SLJIT_MOV, TMP1, 0, SLJIT_UNUSED, 0, SLJIT_EQUAL); - OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, 1); - OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP1, 0); -#endif - JUMPHERE(jump[0]); -#endif /* COMPILE_PCRE[8|16] */ - return cc; - } -#endif - OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); - return cc; - - case OP_ANYBYTE: - detect_partial_match(common, backtracks); - OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); - return cc; - -#ifdef SUPPORT_UTF -#ifdef SUPPORT_UCP - case OP_NOTPROP: - case OP_PROP: - propdata[0] = XCL_HASPROP; - propdata[1] = type == OP_NOTPROP ? XCL_NOTPROP : XCL_PROP; - propdata[2] = cc[0]; - propdata[3] = cc[1]; - propdata[4] = XCL_END; - compile_xclass_matchingpath(common, propdata, backtracks); - return cc + 2; -#endif -#endif - - case OP_ANYNL: - detect_partial_match(common, backtracks); - read_char_range(common, common->bsr_nlmin, common->bsr_nlmax, FALSE); - jump[0] = CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, CHAR_CR); - /* We don't need to handle soft partial matching case. */ - end_list = NULL; - if (common->mode != JIT_PARTIAL_HARD_COMPILE) - add_jump(compiler, &end_list, CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0)); - else - check_str_end(common, &end_list); - OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), 0); - jump[1] = CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, CHAR_NL); - OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); - jump[2] = JUMP(SLJIT_JUMP); - JUMPHERE(jump[0]); - check_newlinechar(common, common->bsr_nltype, backtracks, FALSE); - set_jumps(end_list, LABEL()); - JUMPHERE(jump[1]); - JUMPHERE(jump[2]); - return cc; - - case OP_NOT_HSPACE: - case OP_HSPACE: - detect_partial_match(common, backtracks); - read_char_range(common, 0x9, 0x3000, type == OP_NOT_HSPACE); - add_jump(compiler, &common->hspace, JUMP(SLJIT_FAST_CALL)); - add_jump(compiler, backtracks, JUMP(type == OP_NOT_HSPACE ? SLJIT_NOT_ZERO : SLJIT_ZERO)); - return cc; - - case OP_NOT_VSPACE: - case OP_VSPACE: - detect_partial_match(common, backtracks); - read_char_range(common, 0xa, 0x2029, type == OP_NOT_VSPACE); - add_jump(compiler, &common->vspace, JUMP(SLJIT_FAST_CALL)); - add_jump(compiler, backtracks, JUMP(type == OP_NOT_VSPACE ? SLJIT_NOT_ZERO : SLJIT_ZERO)); - return cc; - -#ifdef SUPPORT_UCP - case OP_EXTUNI: - detect_partial_match(common, backtracks); - read_char(common); - add_jump(compiler, &common->getucd, JUMP(SLJIT_FAST_CALL)); - OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, (sljit_sw)PRIV(ucd_records) + SLJIT_OFFSETOF(ucd_record, gbprop)); - /* Optimize register allocation: use a real register. */ - OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), LOCALS0, STACK_TOP, 0); - OP1(SLJIT_MOV_UB, STACK_TOP, 0, SLJIT_MEM2(TMP1, TMP2), 3); - - label = LABEL(); - jump[0] = CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0); - OP1(SLJIT_MOV, TMP3, 0, STR_PTR, 0); - read_char(common); - add_jump(compiler, &common->getucd, JUMP(SLJIT_FAST_CALL)); - OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, (sljit_sw)PRIV(ucd_records) + SLJIT_OFFSETOF(ucd_record, gbprop)); - OP1(SLJIT_MOV_UB, TMP2, 0, SLJIT_MEM2(TMP1, TMP2), 3); - - OP2(SLJIT_SHL, STACK_TOP, 0, STACK_TOP, 0, SLJIT_IMM, 2); - OP1(SLJIT_MOV_UI, TMP1, 0, SLJIT_MEM1(STACK_TOP), (sljit_sw)PRIV(ucp_gbtable)); - OP1(SLJIT_MOV, STACK_TOP, 0, TMP2, 0); - OP2(SLJIT_SHL, TMP2, 0, SLJIT_IMM, 1, TMP2, 0); - OP2(SLJIT_AND | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, TMP2, 0); - JUMPTO(SLJIT_NOT_ZERO, label); - - OP1(SLJIT_MOV, STR_PTR, 0, TMP3, 0); - JUMPHERE(jump[0]); - OP1(SLJIT_MOV, STACK_TOP, 0, SLJIT_MEM1(SLJIT_SP), LOCALS0); - - if (common->mode == JIT_PARTIAL_HARD_COMPILE) - { - jump[0] = CMP(SLJIT_LESS, STR_PTR, 0, STR_END, 0); - /* Since we successfully read a char above, partial matching must occure. */ - check_partial(common, TRUE); - JUMPHERE(jump[0]); - } - return cc; -#endif - case OP_EODN: /* Requires rather complex checks. */ jump[0] = CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0); @@ -5575,49 +6104,13 @@ switch(type) check_partial(common, FALSE); return cc; - case OP_CIRC: - OP1(SLJIT_MOV, TMP2, 0, ARGUMENTS, 0); - OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(TMP2), SLJIT_OFFSETOF(jit_arguments, begin)); - add_jump(compiler, backtracks, CMP(SLJIT_GREATER, STR_PTR, 0, TMP1, 0)); - OP1(SLJIT_MOV_UB, TMP2, 0, SLJIT_MEM1(TMP2), SLJIT_OFFSETOF(jit_arguments, notbol)); - add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP2, 0, SLJIT_IMM, 0)); - return cc; - - case OP_CIRCM: - OP1(SLJIT_MOV, TMP2, 0, ARGUMENTS, 0); - OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(TMP2), SLJIT_OFFSETOF(jit_arguments, begin)); - jump[1] = CMP(SLJIT_GREATER, STR_PTR, 0, TMP1, 0); - OP1(SLJIT_MOV_UB, TMP2, 0, SLJIT_MEM1(TMP2), SLJIT_OFFSETOF(jit_arguments, notbol)); - add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP2, 0, SLJIT_IMM, 0)); - jump[0] = JUMP(SLJIT_JUMP); - JUMPHERE(jump[1]); - - add_jump(compiler, backtracks, CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0)); - if (common->nltype == NLTYPE_FIXED && common->newline > 255) - { - OP2(SLJIT_SUB, TMP2, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(2)); - add_jump(compiler, backtracks, CMP(SLJIT_LESS, TMP2, 0, TMP1, 0)); - OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-2)); - OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-1)); - add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, (common->newline >> 8) & 0xff)); - add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP2, 0, SLJIT_IMM, common->newline & 0xff)); - } - else - { - skip_char_back(common); - read_char_range(common, common->nlmin, common->nlmax, TRUE); - check_newlinechar(common, common->nltype, backtracks, FALSE); - } - JUMPHERE(jump[0]); - return cc; - case OP_DOLL: OP1(SLJIT_MOV, TMP2, 0, ARGUMENTS, 0); - OP1(SLJIT_MOV_UB, TMP2, 0, SLJIT_MEM1(TMP2), SLJIT_OFFSETOF(jit_arguments, noteol)); + OP1(SLJIT_MOV_U8, TMP2, 0, SLJIT_MEM1(TMP2), SLJIT_OFFSETOF(jit_arguments, noteol)); add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP2, 0, SLJIT_IMM, 0)); if (!common->endonly) - compile_char1_matchingpath(common, OP_EODN, cc, backtracks); + compile_simple_assertion_matchingpath(common, OP_EODN, cc, backtracks); else { add_jump(compiler, backtracks, CMP(SLJIT_LESS, STR_PTR, 0, STR_END, 0)); @@ -5628,7 +6121,7 @@ switch(type) case OP_DOLLM: jump[1] = CMP(SLJIT_LESS, STR_PTR, 0, STR_END, 0); OP1(SLJIT_MOV, TMP2, 0, ARGUMENTS, 0); - OP1(SLJIT_MOV_UB, TMP2, 0, SLJIT_MEM1(TMP2), SLJIT_OFFSETOF(jit_arguments, noteol)); + OP1(SLJIT_MOV_U8, TMP2, 0, SLJIT_MEM1(TMP2), SLJIT_OFFSETOF(jit_arguments, noteol)); add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP2, 0, SLJIT_IMM, 0)); check_partial(common, FALSE); jump[0] = JUMP(SLJIT_JUMP); @@ -5662,13 +6155,294 @@ switch(type) JUMPHERE(jump[0]); return cc; + case OP_CIRC: + OP1(SLJIT_MOV, TMP2, 0, ARGUMENTS, 0); + OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(TMP2), SLJIT_OFFSETOF(jit_arguments, begin)); + add_jump(compiler, backtracks, CMP(SLJIT_GREATER, STR_PTR, 0, TMP1, 0)); + OP1(SLJIT_MOV_U8, TMP2, 0, SLJIT_MEM1(TMP2), SLJIT_OFFSETOF(jit_arguments, notbol)); + add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP2, 0, SLJIT_IMM, 0)); + return cc; + + case OP_CIRCM: + OP1(SLJIT_MOV, TMP2, 0, ARGUMENTS, 0); + OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(TMP2), SLJIT_OFFSETOF(jit_arguments, begin)); + jump[1] = CMP(SLJIT_GREATER, STR_PTR, 0, TMP1, 0); + OP1(SLJIT_MOV_U8, TMP2, 0, SLJIT_MEM1(TMP2), SLJIT_OFFSETOF(jit_arguments, notbol)); + add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP2, 0, SLJIT_IMM, 0)); + jump[0] = JUMP(SLJIT_JUMP); + JUMPHERE(jump[1]); + + add_jump(compiler, backtracks, CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0)); + if (common->nltype == NLTYPE_FIXED && common->newline > 255) + { + OP2(SLJIT_SUB, TMP2, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(2)); + add_jump(compiler, backtracks, CMP(SLJIT_LESS, TMP2, 0, TMP1, 0)); + OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-2)); + OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-1)); + add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, (common->newline >> 8) & 0xff)); + add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP2, 0, SLJIT_IMM, common->newline & 0xff)); + } + else + { + skip_char_back(common); + read_char_range(common, common->nlmin, common->nlmax, TRUE); + check_newlinechar(common, common->nltype, backtracks, FALSE); + } + JUMPHERE(jump[0]); + return cc; + + case OP_REVERSE: + length = GET(cc, 0); + if (length == 0) + return cc + LINK_SIZE; + OP1(SLJIT_MOV, TMP1, 0, ARGUMENTS, 0); +#ifdef SUPPORT_UTF + if (common->utf) + { + OP1(SLJIT_MOV, TMP3, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, begin)); + OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, length); + label = LABEL(); + add_jump(compiler, backtracks, CMP(SLJIT_LESS_EQUAL, STR_PTR, 0, TMP3, 0)); + skip_char_back(common); + OP2(SLJIT_SUB | SLJIT_SET_E, TMP2, 0, TMP2, 0, SLJIT_IMM, 1); + JUMPTO(SLJIT_NOT_ZERO, label); + } + else +#endif + { + OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, begin)); + OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(length)); + add_jump(compiler, backtracks, CMP(SLJIT_LESS, STR_PTR, 0, TMP1, 0)); + } + check_start_used_ptr(common); + return cc + LINK_SIZE; + } +SLJIT_ASSERT_STOP(); +return cc; +} + +static pcre_uchar *compile_char1_matchingpath(compiler_common *common, pcre_uchar type, pcre_uchar *cc, jump_list **backtracks, BOOL check_str_ptr) +{ +DEFINE_COMPILER; +int length; +unsigned int c, oc, bit; +compare_context context; +struct sljit_jump *jump[3]; +jump_list *end_list; +#ifdef SUPPORT_UTF +struct sljit_label *label; +#ifdef SUPPORT_UCP +pcre_uchar propdata[5]; +#endif +#endif /* SUPPORT_UTF */ + +switch(type) + { + case OP_NOT_DIGIT: + case OP_DIGIT: + /* Digits are usually 0-9, so it is worth to optimize them. */ + if (check_str_ptr) + detect_partial_match(common, backtracks); +#if defined SUPPORT_UTF && defined COMPILE_PCRE8 + if (common->utf && is_char7_bitset((const sljit_u8 *)common->ctypes - cbit_length + cbit_digit, FALSE)) + read_char7_type(common, type == OP_NOT_DIGIT); + else +#endif + read_char8_type(common, type == OP_NOT_DIGIT); + /* Flip the starting bit in the negative case. */ + OP2(SLJIT_AND | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, ctype_digit); + add_jump(compiler, backtracks, JUMP(type == OP_DIGIT ? SLJIT_ZERO : SLJIT_NOT_ZERO)); + return cc; + + case OP_NOT_WHITESPACE: + case OP_WHITESPACE: + if (check_str_ptr) + detect_partial_match(common, backtracks); +#if defined SUPPORT_UTF && defined COMPILE_PCRE8 + if (common->utf && is_char7_bitset((const sljit_u8 *)common->ctypes - cbit_length + cbit_space, FALSE)) + read_char7_type(common, type == OP_NOT_WHITESPACE); + else +#endif + read_char8_type(common, type == OP_NOT_WHITESPACE); + OP2(SLJIT_AND | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, ctype_space); + add_jump(compiler, backtracks, JUMP(type == OP_WHITESPACE ? SLJIT_ZERO : SLJIT_NOT_ZERO)); + return cc; + + case OP_NOT_WORDCHAR: + case OP_WORDCHAR: + if (check_str_ptr) + detect_partial_match(common, backtracks); +#if defined SUPPORT_UTF && defined COMPILE_PCRE8 + if (common->utf && is_char7_bitset((const sljit_u8 *)common->ctypes - cbit_length + cbit_word, FALSE)) + read_char7_type(common, type == OP_NOT_WORDCHAR); + else +#endif + read_char8_type(common, type == OP_NOT_WORDCHAR); + OP2(SLJIT_AND | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, ctype_word); + add_jump(compiler, backtracks, JUMP(type == OP_WORDCHAR ? SLJIT_ZERO : SLJIT_NOT_ZERO)); + return cc; + + case OP_ANY: + if (check_str_ptr) + detect_partial_match(common, backtracks); + read_char_range(common, common->nlmin, common->nlmax, TRUE); + if (common->nltype == NLTYPE_FIXED && common->newline > 255) + { + jump[0] = CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, (common->newline >> 8) & 0xff); + end_list = NULL; + if (common->mode != JIT_PARTIAL_HARD_COMPILE) + add_jump(compiler, &end_list, CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0)); + else + check_str_end(common, &end_list); + + OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), 0); + add_jump(compiler, backtracks, CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, common->newline & 0xff)); + set_jumps(end_list, LABEL()); + JUMPHERE(jump[0]); + } + else + check_newlinechar(common, common->nltype, backtracks, TRUE); + return cc; + + case OP_ALLANY: + if (check_str_ptr) + detect_partial_match(common, backtracks); +#ifdef SUPPORT_UTF + if (common->utf) + { + OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), 0); + OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); +#if defined COMPILE_PCRE8 || defined COMPILE_PCRE16 +#if defined COMPILE_PCRE8 + jump[0] = CMP(SLJIT_LESS, TMP1, 0, SLJIT_IMM, 0xc0); + OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP1), (sljit_sw)PRIV(utf8_table4) - 0xc0); + OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP1, 0); +#elif defined COMPILE_PCRE16 + jump[0] = CMP(SLJIT_LESS, TMP1, 0, SLJIT_IMM, 0xd800); + OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xfc00); + OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0xd800); + OP_FLAGS(SLJIT_MOV, TMP1, 0, SLJIT_UNUSED, 0, SLJIT_EQUAL); + OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, 1); + OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP1, 0); +#endif + JUMPHERE(jump[0]); +#endif /* COMPILE_PCRE[8|16] */ + return cc; + } +#endif + OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); + return cc; + + case OP_ANYBYTE: + if (check_str_ptr) + detect_partial_match(common, backtracks); + OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); + return cc; + +#ifdef SUPPORT_UTF +#ifdef SUPPORT_UCP + case OP_NOTPROP: + case OP_PROP: + propdata[0] = XCL_HASPROP; + propdata[1] = type == OP_NOTPROP ? XCL_NOTPROP : XCL_PROP; + propdata[2] = cc[0]; + propdata[3] = cc[1]; + propdata[4] = XCL_END; + if (check_str_ptr) + detect_partial_match(common, backtracks); + compile_xclass_matchingpath(common, propdata, backtracks); + return cc + 2; +#endif +#endif + + case OP_ANYNL: + if (check_str_ptr) + detect_partial_match(common, backtracks); + read_char_range(common, common->bsr_nlmin, common->bsr_nlmax, FALSE); + jump[0] = CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, CHAR_CR); + /* We don't need to handle soft partial matching case. */ + end_list = NULL; + if (common->mode != JIT_PARTIAL_HARD_COMPILE) + add_jump(compiler, &end_list, CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0)); + else + check_str_end(common, &end_list); + OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), 0); + jump[1] = CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, CHAR_NL); + OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); + jump[2] = JUMP(SLJIT_JUMP); + JUMPHERE(jump[0]); + check_newlinechar(common, common->bsr_nltype, backtracks, FALSE); + set_jumps(end_list, LABEL()); + JUMPHERE(jump[1]); + JUMPHERE(jump[2]); + return cc; + + case OP_NOT_HSPACE: + case OP_HSPACE: + if (check_str_ptr) + detect_partial_match(common, backtracks); + read_char_range(common, 0x9, 0x3000, type == OP_NOT_HSPACE); + add_jump(compiler, &common->hspace, JUMP(SLJIT_FAST_CALL)); + add_jump(compiler, backtracks, JUMP(type == OP_NOT_HSPACE ? SLJIT_NOT_ZERO : SLJIT_ZERO)); + return cc; + + case OP_NOT_VSPACE: + case OP_VSPACE: + if (check_str_ptr) + detect_partial_match(common, backtracks); + read_char_range(common, 0xa, 0x2029, type == OP_NOT_VSPACE); + add_jump(compiler, &common->vspace, JUMP(SLJIT_FAST_CALL)); + add_jump(compiler, backtracks, JUMP(type == OP_NOT_VSPACE ? SLJIT_NOT_ZERO : SLJIT_ZERO)); + return cc; + +#ifdef SUPPORT_UCP + case OP_EXTUNI: + if (check_str_ptr) + detect_partial_match(common, backtracks); + read_char(common); + add_jump(compiler, &common->getucd, JUMP(SLJIT_FAST_CALL)); + OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, (sljit_sw)PRIV(ucd_records) + SLJIT_OFFSETOF(ucd_record, gbprop)); + /* Optimize register allocation: use a real register. */ + OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), LOCALS0, STACK_TOP, 0); + OP1(SLJIT_MOV_U8, STACK_TOP, 0, SLJIT_MEM2(TMP1, TMP2), 3); + + label = LABEL(); + jump[0] = CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0); + OP1(SLJIT_MOV, TMP3, 0, STR_PTR, 0); + read_char(common); + add_jump(compiler, &common->getucd, JUMP(SLJIT_FAST_CALL)); + OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, (sljit_sw)PRIV(ucd_records) + SLJIT_OFFSETOF(ucd_record, gbprop)); + OP1(SLJIT_MOV_U8, TMP2, 0, SLJIT_MEM2(TMP1, TMP2), 3); + + OP2(SLJIT_SHL, STACK_TOP, 0, STACK_TOP, 0, SLJIT_IMM, 2); + OP1(SLJIT_MOV_U32, TMP1, 0, SLJIT_MEM1(STACK_TOP), (sljit_sw)PRIV(ucp_gbtable)); + OP1(SLJIT_MOV, STACK_TOP, 0, TMP2, 0); + OP2(SLJIT_SHL, TMP2, 0, SLJIT_IMM, 1, TMP2, 0); + OP2(SLJIT_AND | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, TMP2, 0); + JUMPTO(SLJIT_NOT_ZERO, label); + + OP1(SLJIT_MOV, STR_PTR, 0, TMP3, 0); + JUMPHERE(jump[0]); + OP1(SLJIT_MOV, STACK_TOP, 0, SLJIT_MEM1(SLJIT_SP), LOCALS0); + + if (common->mode == JIT_PARTIAL_HARD_COMPILE) + { + jump[0] = CMP(SLJIT_LESS, STR_PTR, 0, STR_END, 0); + /* Since we successfully read a char above, partial matching must occure. */ + check_partial(common, TRUE); + JUMPHERE(jump[0]); + } + return cc; +#endif + case OP_CHAR: case OP_CHARI: length = 1; #ifdef SUPPORT_UTF if (common->utf && HAS_EXTRALEN(*cc)) length += GET_EXTRALEN(*cc); #endif - if (common->mode == JIT_COMPILE && (type == OP_CHAR || !char_has_othercase(common, cc) || char_get_othercase_bit(common, cc) != 0)) + if (common->mode == JIT_COMPILE && check_str_ptr + && (type == OP_CHAR || !char_has_othercase(common, cc) || char_get_othercase_bit(common, cc) != 0)) { OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(length)); add_jump(compiler, backtracks, CMP(SLJIT_GREATER, STR_PTR, 0, STR_END, 0)); @@ -5681,7 +6455,8 @@ switch(type) return byte_sequence_compare(common, type == OP_CHARI, cc, &context, backtracks); } - detect_partial_match(common, backtracks); + if (check_str_ptr) + detect_partial_match(common, backtracks); #ifdef SUPPORT_UTF if (common->utf) { @@ -5713,7 +6488,8 @@ switch(type) case OP_NOT: case OP_NOTI: - detect_partial_match(common, backtracks); + if (check_str_ptr) + detect_partial_match(common, backtracks); length = 1; #ifdef SUPPORT_UTF if (common->utf) @@ -5722,7 +6498,7 @@ switch(type) c = *cc; if (c < 128) { - OP1(SLJIT_MOV_UB, TMP1, 0, SLJIT_MEM1(STR_PTR), 0); + OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(STR_PTR), 0); if (type == OP_NOT || !char_has_othercase(common, cc)) add_jump(compiler, backtracks, CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, c)); else @@ -5774,16 +6550,17 @@ switch(type) case OP_CLASS: case OP_NCLASS: - detect_partial_match(common, backtracks); + if (check_str_ptr) + detect_partial_match(common, backtracks); #if defined SUPPORT_UTF && defined COMPILE_PCRE8 - bit = (common->utf && is_char7_bitset((const pcre_uint8 *)cc, type == OP_NCLASS)) ? 127 : 255; + bit = (common->utf && is_char7_bitset((const sljit_u8 *)cc, type == OP_NCLASS)) ? 127 : 255; read_char_range(common, 0, bit, type == OP_NCLASS); #else read_char_range(common, 0, 255, type == OP_NCLASS); #endif - if (check_class_ranges(common, (const pcre_uint8 *)cc, type == OP_NCLASS, FALSE, backtracks)) + if (check_class_ranges(common, (const sljit_u8 *)cc, type == OP_NCLASS, FALSE, backtracks)) return cc + 32 / sizeof(pcre_uchar); #if defined SUPPORT_UTF && defined COMPILE_PCRE8 @@ -5808,7 +6585,7 @@ switch(type) OP2(SLJIT_AND, TMP2, 0, TMP1, 0, SLJIT_IMM, 0x7); OP2(SLJIT_LSHR, TMP1, 0, TMP1, 0, SLJIT_IMM, 3); - OP1(SLJIT_MOV_UB, TMP1, 0, SLJIT_MEM1(TMP1), (sljit_sw)cc); + OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP1), (sljit_sw)cc); OP2(SLJIT_SHL, TMP2, 0, SLJIT_IMM, 1, TMP2, 0); OP2(SLJIT_AND | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, TMP2, 0); add_jump(compiler, backtracks, JUMP(SLJIT_ZERO)); @@ -5817,40 +6594,15 @@ switch(type) if (jump[0] != NULL) JUMPHERE(jump[0]); #endif - return cc + 32 / sizeof(pcre_uchar); #if defined SUPPORT_UTF || defined COMPILE_PCRE16 || defined COMPILE_PCRE32 case OP_XCLASS: + if (check_str_ptr) + detect_partial_match(common, backtracks); compile_xclass_matchingpath(common, cc + LINK_SIZE, backtracks); return cc + GET(cc, 0) - 1; #endif - - case OP_REVERSE: - length = GET(cc, 0); - if (length == 0) - return cc + LINK_SIZE; - OP1(SLJIT_MOV, TMP1, 0, ARGUMENTS, 0); -#ifdef SUPPORT_UTF - if (common->utf) - { - OP1(SLJIT_MOV, TMP3, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, begin)); - OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, length); - label = LABEL(); - add_jump(compiler, backtracks, CMP(SLJIT_LESS_EQUAL, STR_PTR, 0, TMP3, 0)); - skip_char_back(common); - OP2(SLJIT_SUB | SLJIT_SET_E, TMP2, 0, TMP2, 0, SLJIT_IMM, 1); - JUMPTO(SLJIT_NOT_ZERO, label); - } - else -#endif - { - OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, begin)); - OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(length)); - add_jump(compiler, backtracks, CMP(SLJIT_LESS, STR_PTR, 0, TMP1, 0)); - } - check_start_used_ptr(common); - return cc + LINK_SIZE; } SLJIT_ASSERT_STOP(); return cc; @@ -5919,7 +6671,7 @@ if (context.length > 0) } /* A non-fixed length character will be checked if length == 0. */ -return compile_char1_matchingpath(common, *cc, cc + 1, backtracks); +return compile_char1_matchingpath(common, *cc, cc + 1, backtracks, TRUE); } /* Forward definitions. */ @@ -6094,7 +6846,7 @@ pcre_uchar *ccbegin = cc; int min = 0, max = 0; BOOL minimize; -PUSH_BACKTRACK(sizeof(iterator_backtrack), cc, NULL); +PUSH_BACKTRACK(sizeof(ref_iterator_backtrack), cc, NULL); if (ref) offset = GET2(cc, 1) << 1; @@ -6214,7 +6966,7 @@ if (!minimize) } JUMPHERE(zerolength); - BACKTRACK_AS(iterator_backtrack)->matchingpath = LABEL(); + BACKTRACK_AS(ref_iterator_backtrack)->matchingpath = LABEL(); count_match(common); return cc; @@ -6260,7 +7012,7 @@ else } } -BACKTRACK_AS(iterator_backtrack)->matchingpath = LABEL(); +BACKTRACK_AS(ref_iterator_backtrack)->matchingpath = LABEL(); if (max > 0) add_jump(compiler, &backtrack->topbacktracks, CMP(SLJIT_GREATER_EQUAL, SLJIT_MEM1(STACK_TOP), STACK(1), SLJIT_IMM, max)); @@ -6274,7 +7026,7 @@ if (min > 1) OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(STACK_TOP), STACK(1)); OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, SLJIT_IMM, 1); OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(1), TMP1, 0); - CMPTO(SLJIT_LESS, TMP1, 0, SLJIT_IMM, min, BACKTRACK_AS(iterator_backtrack)->matchingpath); + CMPTO(SLJIT_LESS, TMP1, 0, SLJIT_IMM, min, BACKTRACK_AS(ref_iterator_backtrack)->matchingpath); } else if (max > 0) OP2(SLJIT_ADD, SLJIT_MEM1(STACK_TOP), STACK(1), SLJIT_MEM1(STACK_TOP), STACK(1), SLJIT_IMM, 1); @@ -6419,8 +7171,8 @@ allocate_stack(common, CALLOUT_ARG_SIZE / sizeof(sljit_sw)); SLJIT_ASSERT(common->capture_last_ptr != 0); OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), common->capture_last_ptr); OP1(SLJIT_MOV, TMP1, 0, ARGUMENTS, 0); -OP1(SLJIT_MOV_SI, SLJIT_MEM1(STACK_TOP), CALLOUT_ARG_OFFSET(callout_number), SLJIT_IMM, cc[1]); -OP1(SLJIT_MOV_SI, SLJIT_MEM1(STACK_TOP), CALLOUT_ARG_OFFSET(capture_last), TMP2, 0); +OP1(SLJIT_MOV_S32, SLJIT_MEM1(STACK_TOP), CALLOUT_ARG_OFFSET(callout_number), SLJIT_IMM, cc[1]); +OP1(SLJIT_MOV_S32, SLJIT_MEM1(STACK_TOP), CALLOUT_ARG_OFFSET(capture_last), TMP2, 0); /* These pointer sized fields temporarly stores internal variables. */ OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), OVECTOR(0)); @@ -6429,8 +7181,8 @@ OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), CALLOUT_ARG_OFFSET(subject), TMP2, 0); if (common->mark_ptr != 0) OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, mark_ptr)); -OP1(SLJIT_MOV_SI, SLJIT_MEM1(STACK_TOP), CALLOUT_ARG_OFFSET(pattern_position), SLJIT_IMM, GET(cc, 2)); -OP1(SLJIT_MOV_SI, SLJIT_MEM1(STACK_TOP), CALLOUT_ARG_OFFSET(next_item_length), SLJIT_IMM, GET(cc, 2 + LINK_SIZE)); +OP1(SLJIT_MOV_S32, SLJIT_MEM1(STACK_TOP), CALLOUT_ARG_OFFSET(pattern_position), SLJIT_IMM, GET(cc, 2)); +OP1(SLJIT_MOV_S32, SLJIT_MEM1(STACK_TOP), CALLOUT_ARG_OFFSET(next_item_length), SLJIT_IMM, GET(cc, 2 + LINK_SIZE)); OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), CALLOUT_ARG_OFFSET(mark), (common->mark_ptr != 0) ? TMP2 : SLJIT_IMM, 0); /* Needed to save important temporary registers. */ @@ -6438,7 +7190,7 @@ OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), LOCALS0, STACK_TOP, 0); OP2(SLJIT_SUB, SLJIT_R1, 0, STACK_TOP, 0, SLJIT_IMM, CALLOUT_ARG_SIZE); GET_LOCAL_BASE(SLJIT_R2, 0, OVECTOR_START); sljit_emit_ijump(compiler, SLJIT_CALL3, SLJIT_IMM, SLJIT_FUNC_OFFSET(do_callout)); -OP1(SLJIT_MOV_SI, SLJIT_RETURN_REG, 0, SLJIT_RETURN_REG, 0); +OP1(SLJIT_MOV_S32, SLJIT_RETURN_REG, 0, SLJIT_RETURN_REG, 0); OP1(SLJIT_MOV, STACK_TOP, 0, SLJIT_MEM1(SLJIT_SP), LOCALS0); free_stack(common, CALLOUT_ARG_SIZE / sizeof(sljit_sw)); @@ -6455,6 +7207,32 @@ return cc + 2 + 2 * LINK_SIZE; #undef CALLOUT_ARG_SIZE #undef CALLOUT_ARG_OFFSET +static SLJIT_INLINE BOOL assert_needs_str_ptr_saving(pcre_uchar *cc) +{ +while (TRUE) + { + switch (*cc) + { + case OP_NOT_WORD_BOUNDARY: + case OP_WORD_BOUNDARY: + case OP_CIRC: + case OP_CIRCM: + case OP_DOLL: + case OP_DOLLM: + case OP_CALLOUT: + case OP_ALT: + cc += PRIV(OP_lengths)[*cc]; + break; + + case OP_KET: + return FALSE; + + default: + return TRUE; + } + } +} + static pcre_uchar *compile_assert_matchingpath(compiler_common *common, pcre_uchar *cc, assert_backtrack *backtrack, BOOL conditional) { DEFINE_COMPILER; @@ -6511,15 +7289,28 @@ if (bra == OP_BRAMINZERO) if (framesize < 0) { - extrasize = needs_control_head ? 2 : 1; + extrasize = 1; + if (bra == OP_BRA && !assert_needs_str_ptr_saving(ccbegin + 1 + LINK_SIZE)) + extrasize = 0; + + if (needs_control_head) + extrasize++; + if (framesize == no_frame) OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), private_data_ptr, STACK_TOP, 0); - allocate_stack(common, extrasize); + + if (extrasize > 0) + allocate_stack(common, extrasize); + if (needs_control_head) OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr); - OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(0), STR_PTR, 0); + + if (extrasize > 0) + OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(0), STR_PTR, 0); + if (needs_control_head) { + SLJIT_ASSERT(extrasize == 2); OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, SLJIT_IMM, 0); OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(1), TMP1, 0); } @@ -6528,12 +7319,14 @@ else { extrasize = needs_control_head ? 3 : 2; allocate_stack(common, framesize + extrasize); + OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), private_data_ptr); OP2(SLJIT_SUB, TMP2, 0, STACK_TOP, 0, SLJIT_IMM, (framesize + extrasize) * sizeof(sljit_sw)); OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), private_data_ptr, TMP2, 0); if (needs_control_head) OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr); OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(0), STR_PTR, 0); + if (needs_control_head) { OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(2), TMP1, 0); @@ -6542,6 +7335,7 @@ else } else OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(1), TMP1, 0); + init_frame(common, ccbegin, NULL, framesize + extrasize - 1, extrasize, FALSE); } @@ -6565,7 +7359,7 @@ while (1) altbacktrack.top = NULL; altbacktrack.topbacktracks = NULL; - if (*ccbegin == OP_ALT) + if (*ccbegin == OP_ALT && extrasize > 0) OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(STACK_TOP), STACK(0)); altbacktrack.cc = ccbegin; @@ -6594,8 +7388,9 @@ while (1) { if (framesize == no_frame) OP1(SLJIT_MOV, STACK_TOP, 0, SLJIT_MEM1(SLJIT_SP), private_data_ptr); - else + else if (extrasize > 0) free_stack(common, extrasize); + if (needs_control_head) OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, SLJIT_MEM1(STACK_TOP), 0); } @@ -6621,7 +7416,10 @@ while (1) { /* We know that STR_PTR was stored on the top of the stack. */ if (conditional) - OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(STACK_TOP), needs_control_head ? sizeof(sljit_sw) : 0); + { + if (extrasize > 0) + OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(STACK_TOP), needs_control_head ? sizeof(sljit_sw) : 0); + } else if (bra == OP_BRAZERO) { if (framesize < 0) @@ -6698,7 +7496,7 @@ if (needs_control_head) if (opcode == OP_ASSERT || opcode == OP_ASSERTBACK) { /* Assert is failed. */ - if (conditional || bra == OP_BRAZERO) + if ((conditional && extrasize > 0) || bra == OP_BRAZERO) OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(STACK_TOP), STACK(0)); if (framesize < 0) @@ -6710,7 +7508,7 @@ if (opcode == OP_ASSERT || opcode == OP_ASSERTBACK) free_stack(common, 1); OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(0), SLJIT_IMM, 0); } - else + else if (extrasize > 0) free_stack(common, extrasize); } else @@ -6735,7 +7533,9 @@ if (opcode == OP_ASSERT || opcode == OP_ASSERTBACK) if (framesize < 0) { /* We know that STR_PTR was stored on the top of the stack. */ - OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(STACK_TOP), (extrasize - 1) * sizeof(sljit_sw)); + if (extrasize > 0) + OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(STACK_TOP), (extrasize - 1) * sizeof(sljit_sw)); + /* Keep the STR_PTR on the top of the stack. */ if (bra == OP_BRAZERO) { @@ -6798,14 +7598,16 @@ else /* AssertNot is successful. */ if (framesize < 0) { - OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(STACK_TOP), STACK(0)); + if (extrasize > 0) + OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(STACK_TOP), STACK(0)); + if (bra != OP_BRA) { if (extrasize == 2) free_stack(common, 1); OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(0), SLJIT_IMM, 0); } - else + else if (extrasize > 0) free_stack(common, extrasize); } else @@ -6867,7 +7669,9 @@ if (framesize < 0) stacksize = needs_control_head ? 1 : 0; if (ket != OP_KET || has_alternatives) stacksize++; - free_stack(common, stacksize); + + if (stacksize > 0) + free_stack(common, stacksize); } if (needs_control_head) @@ -7513,9 +8317,13 @@ while (*cc == OP_ALT) cc += GET(cc, 1); cc += 1 + LINK_SIZE; -/* Temporarily encoding the needs_control_head in framesize. */ if (opcode == OP_ONCE) + { + /* We temporarily encode the needs_control_head in the lowest bit. + Note: on the target architectures of SLJIT the ((x << 1) >> 1) returns + the same value for small signed numbers (including negative numbers). */ BACKTRACK_AS(bracket_backtrack)->u.framesize = (BACKTRACK_AS(bracket_backtrack)->u.framesize << 1) | (needs_control_head ? 1 : 0); + } return cc + repeat_length; } @@ -7802,11 +8610,13 @@ count_match(common); return cc + 1 + LINK_SIZE; } -static SLJIT_INLINE pcre_uchar *get_iterator_parameters(compiler_common *common, pcre_uchar *cc, pcre_uchar *opcode, pcre_uchar *type, int *max, int *min, pcre_uchar **end) +static SLJIT_INLINE pcre_uchar *get_iterator_parameters(compiler_common *common, pcre_uchar *cc, pcre_uchar *opcode, pcre_uchar *type, sljit_u32 *max, sljit_u32 *exact, pcre_uchar **end) { int class_len; *opcode = *cc; +*exact = 0; + if (*opcode >= OP_STAR && *opcode <= OP_POSUPTO) { cc++; @@ -7834,7 +8644,7 @@ else if (*opcode >= OP_TYPESTAR && *opcode <= OP_TYPEPOSUPTO) { cc++; *opcode -= OP_TYPESTAR - OP_STAR; - *type = 0; + *type = OP_END; } else { @@ -7843,60 +8653,105 @@ else cc++; class_len = (*type < OP_XCLASS) ? (int)(1 + (32 / sizeof(pcre_uchar))) : GET(cc, 0); *opcode = cc[class_len - 1]; + if (*opcode >= OP_CRSTAR && *opcode <= OP_CRMINQUERY) { *opcode -= OP_CRSTAR - OP_STAR; - if (end != NULL) - *end = cc + class_len; + *end = cc + class_len; + + if (*opcode == OP_PLUS || *opcode == OP_MINPLUS) + { + *exact = 1; + *opcode -= OP_PLUS - OP_STAR; + } } else if (*opcode >= OP_CRPOSSTAR && *opcode <= OP_CRPOSQUERY) { *opcode -= OP_CRPOSSTAR - OP_POSSTAR; - if (end != NULL) - *end = cc + class_len; + *end = cc + class_len; + + if (*opcode == OP_POSPLUS) + { + *exact = 1; + *opcode = OP_POSSTAR; + } } else { SLJIT_ASSERT(*opcode == OP_CRRANGE || *opcode == OP_CRMINRANGE || *opcode == OP_CRPOSRANGE); *max = GET2(cc, (class_len + IMM2_SIZE)); - *min = GET2(cc, class_len); + *exact = GET2(cc, class_len); - if (*min == 0) + if (*max == 0) { - SLJIT_ASSERT(*max != 0); - *opcode = (*opcode == OP_CRRANGE) ? OP_UPTO : (*opcode == OP_CRMINRANGE ? OP_MINUPTO : OP_POSUPTO); + if (*opcode == OP_CRPOSRANGE) + *opcode = OP_POSSTAR; + else + *opcode -= OP_CRRANGE - OP_STAR; } - if (*max == *min) - *opcode = OP_EXACT; - - if (end != NULL) - *end = cc + class_len + 2 * IMM2_SIZE; + else + { + *max -= *exact; + if (*max == 0) + *opcode = OP_EXACT; + else if (*max == 1) + { + if (*opcode == OP_CRPOSRANGE) + *opcode = OP_POSQUERY; + else + *opcode -= OP_CRRANGE - OP_QUERY; + } + else + { + if (*opcode == OP_CRPOSRANGE) + *opcode = OP_POSUPTO; + else + *opcode -= OP_CRRANGE - OP_UPTO; + } + } + *end = cc + class_len + 2 * IMM2_SIZE; } return cc; } -if (*opcode == OP_UPTO || *opcode == OP_MINUPTO || *opcode == OP_EXACT || *opcode == OP_POSUPTO) +switch(*opcode) { + case OP_EXACT: + *exact = GET2(cc, 0); + cc += IMM2_SIZE; + break; + + case OP_PLUS: + case OP_MINPLUS: + *exact = 1; + *opcode -= OP_PLUS - OP_STAR; + break; + + case OP_POSPLUS: + *exact = 1; + *opcode = OP_POSSTAR; + break; + + case OP_UPTO: + case OP_MINUPTO: + case OP_POSUPTO: *max = GET2(cc, 0); cc += IMM2_SIZE; + break; } -if (*type == 0) +if (*type == OP_END) { *type = *cc; - if (end != NULL) - *end = next_opcode(common, cc); + *end = next_opcode(common, cc); cc++; return cc; } -if (end != NULL) - { - *end = cc + 1; +*end = cc + 1; #ifdef SUPPORT_UTF - if (common->utf && HAS_EXTRALEN(*cc)) *end += GET_EXTRALEN(*cc); +if (common->utf && HAS_EXTRALEN(*cc)) *end += GET_EXTRALEN(*cc); #endif - } return cc; } @@ -7906,9 +8761,15 @@ DEFINE_COMPILER; backtrack_common *backtrack; pcre_uchar opcode; pcre_uchar type; -int max = -1, min = -1; +sljit_u32 max = 0, exact; +BOOL fast_fail; +sljit_s32 fast_str_ptr; +BOOL charpos_enabled; +pcre_uchar charpos_char; +unsigned int charpos_othercasebit; pcre_uchar *end; -jump_list *nomatch = NULL; +jump_list *no_match = NULL; +jump_list *no_char1_match = NULL; struct sljit_jump *jump = NULL; struct sljit_label *label; int private_data_ptr = PRIVATE_DATA(cc); @@ -7917,83 +8778,92 @@ int offset0 = (private_data_ptr == 0) ? STACK(0) : private_data_ptr; int offset1 = (private_data_ptr == 0) ? STACK(1) : private_data_ptr + (int)sizeof(sljit_sw); int tmp_base, tmp_offset; -PUSH_BACKTRACK(sizeof(iterator_backtrack), cc, NULL); +PUSH_BACKTRACK(sizeof(char_iterator_backtrack), cc, NULL); -cc = get_iterator_parameters(common, cc, &opcode, &type, &max, &min, &end); +fast_str_ptr = PRIVATE_DATA(cc + 1); +fast_fail = TRUE; -switch(type) +SLJIT_ASSERT(common->fast_forward_bc_ptr == NULL || fast_str_ptr == 0 || cc == common->fast_forward_bc_ptr); + +if (cc == common->fast_forward_bc_ptr) + fast_fail = FALSE; +else if (common->fast_fail_start_ptr == 0) + fast_str_ptr = 0; + +SLJIT_ASSERT(common->fast_forward_bc_ptr != NULL || fast_str_ptr == 0 + || (fast_str_ptr >= common->fast_fail_start_ptr && fast_str_ptr <= common->fast_fail_end_ptr)); + +cc = get_iterator_parameters(common, cc, &opcode, &type, &max, &exact, &end); + +if (type != OP_EXTUNI) { - case OP_NOT_DIGIT: - case OP_DIGIT: - case OP_NOT_WHITESPACE: - case OP_WHITESPACE: - case OP_NOT_WORDCHAR: - case OP_WORDCHAR: - case OP_ANY: - case OP_ALLANY: - case OP_ANYBYTE: - case OP_ANYNL: - case OP_NOT_HSPACE: - case OP_HSPACE: - case OP_NOT_VSPACE: - case OP_VSPACE: - case OP_CHAR: - case OP_CHARI: - case OP_NOT: - case OP_NOTI: - case OP_CLASS: - case OP_NCLASS: tmp_base = TMP3; tmp_offset = 0; - break; - - default: - SLJIT_ASSERT_STOP(); - /* Fall through. */ - - case OP_EXTUNI: - case OP_XCLASS: - case OP_NOTPROP: - case OP_PROP: + } +else + { tmp_base = SLJIT_MEM1(SLJIT_SP); tmp_offset = POSSESSIVE0; - break; } +if (fast_fail && fast_str_ptr != 0) + add_jump(compiler, &backtrack->topbacktracks, CMP(SLJIT_LESS_EQUAL, STR_PTR, 0, SLJIT_MEM1(SLJIT_SP), fast_str_ptr)); + +/* Handle fixed part first. */ +if (exact > 1) + { + SLJIT_ASSERT(fast_str_ptr == 0); + if (common->mode == JIT_COMPILE +#ifdef SUPPORT_UTF + && !common->utf +#endif + ) + { + OP2(SLJIT_ADD, TMP1, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(exact)); + add_jump(compiler, &backtrack->topbacktracks, CMP(SLJIT_GREATER, TMP1, 0, STR_END, 0)); + OP1(SLJIT_MOV, tmp_base, tmp_offset, SLJIT_IMM, exact); + label = LABEL(); + compile_char1_matchingpath(common, type, cc, &backtrack->topbacktracks, FALSE); + OP2(SLJIT_SUB | SLJIT_SET_E, tmp_base, tmp_offset, tmp_base, tmp_offset, SLJIT_IMM, 1); + JUMPTO(SLJIT_NOT_ZERO, label); + } + else + { + OP1(SLJIT_MOV, tmp_base, tmp_offset, SLJIT_IMM, exact); + label = LABEL(); + compile_char1_matchingpath(common, type, cc, &backtrack->topbacktracks, TRUE); + OP2(SLJIT_SUB | SLJIT_SET_E, tmp_base, tmp_offset, tmp_base, tmp_offset, SLJIT_IMM, 1); + JUMPTO(SLJIT_NOT_ZERO, label); + } + } +else if (exact == 1) + compile_char1_matchingpath(common, type, cc, &backtrack->topbacktracks, TRUE); + switch(opcode) { case OP_STAR: - case OP_PLUS: case OP_UPTO: - case OP_CRRANGE: + SLJIT_ASSERT(fast_str_ptr == 0 || opcode == OP_STAR); + if (type == OP_ANYNL || type == OP_EXTUNI) { SLJIT_ASSERT(private_data_ptr == 0); - if (opcode == OP_STAR || opcode == OP_UPTO) - { - allocate_stack(common, 2); - OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(0), STR_PTR, 0); - OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(1), SLJIT_IMM, 0); - } - else - { - allocate_stack(common, 1); - OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(0), SLJIT_IMM, 0); - } + SLJIT_ASSERT(fast_str_ptr == 0); - if (opcode == OP_UPTO || opcode == OP_CRRANGE) - OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), POSSESSIVE0, SLJIT_IMM, 0); + allocate_stack(common, 2); + OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(0), STR_PTR, 0); + OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(1), SLJIT_IMM, 0); + + if (opcode == OP_UPTO) + OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), POSSESSIVE0, SLJIT_IMM, max); label = LABEL(); - compile_char1_matchingpath(common, type, cc, &backtrack->topbacktracks); - if (opcode == OP_UPTO || opcode == OP_CRRANGE) + compile_char1_matchingpath(common, type, cc, &BACKTRACK_AS(char_iterator_backtrack)->u.backtracks, TRUE); + if (opcode == OP_UPTO) { OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), POSSESSIVE0); - OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, SLJIT_IMM, 1); - if (opcode == OP_CRRANGE && min > 0) - CMPTO(SLJIT_LESS, TMP1, 0, SLJIT_IMM, min, label); - if (opcode == OP_UPTO || (opcode == OP_CRRANGE && max > 0)) - jump = CMP(SLJIT_GREATER_EQUAL, TMP1, 0, SLJIT_IMM, max); + OP2(SLJIT_SUB | SLJIT_SET_E, TMP1, 0, TMP1, 0, SLJIT_IMM, 1); + jump = JUMP(SLJIT_ZERO); OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), POSSESSIVE0, TMP1, 0); } @@ -8006,134 +8876,268 @@ switch(opcode) } else { - if (opcode == OP_PLUS) - compile_char1_matchingpath(common, type, cc, &backtrack->topbacktracks); - if (private_data_ptr == 0) - allocate_stack(common, 2); - OP1(SLJIT_MOV, base, offset0, STR_PTR, 0); - if (opcode <= OP_PLUS) + charpos_enabled = FALSE; + charpos_char = 0; + charpos_othercasebit = 0; + + if ((type != OP_CHAR && type != OP_CHARI) && (*end == OP_CHAR || *end == OP_CHARI)) + { + charpos_enabled = TRUE; +#ifdef SUPPORT_UTF + charpos_enabled = !common->utf || !HAS_EXTRALEN(end[1]); +#endif + if (charpos_enabled && *end == OP_CHARI && char_has_othercase(common, end + 1)) + { + charpos_othercasebit = char_get_othercase_bit(common, end + 1); + if (charpos_othercasebit == 0) + charpos_enabled = FALSE; + } + + if (charpos_enabled) + { + charpos_char = end[1]; + /* Consumpe the OP_CHAR opcode. */ + end += 2; +#if defined COMPILE_PCRE8 + SLJIT_ASSERT((charpos_othercasebit >> 8) == 0); +#elif defined COMPILE_PCRE16 || defined COMPILE_PCRE32 + SLJIT_ASSERT((charpos_othercasebit >> 9) == 0); + if ((charpos_othercasebit & 0x100) != 0) + charpos_othercasebit = (charpos_othercasebit & 0xff) << 8; +#endif + if (charpos_othercasebit != 0) + charpos_char |= charpos_othercasebit; + + BACKTRACK_AS(char_iterator_backtrack)->u.charpos.enabled = TRUE; + BACKTRACK_AS(char_iterator_backtrack)->u.charpos.chr = charpos_char; + BACKTRACK_AS(char_iterator_backtrack)->u.charpos.othercasebit = charpos_othercasebit; + } + } + + if (charpos_enabled) + { + if (opcode == OP_UPTO) + OP1(SLJIT_MOV, tmp_base, tmp_offset, SLJIT_IMM, max + 1); + + /* Search the first instance of charpos_char. */ + jump = JUMP(SLJIT_JUMP); + label = LABEL(); + if (opcode == OP_UPTO) + { + OP2(SLJIT_SUB | SLJIT_SET_E, tmp_base, tmp_offset, tmp_base, tmp_offset, SLJIT_IMM, 1); + add_jump(compiler, &backtrack->topbacktracks, JUMP(SLJIT_ZERO)); + } + compile_char1_matchingpath(common, type, cc, &backtrack->topbacktracks, FALSE); + if (fast_str_ptr != 0) + OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), fast_str_ptr, STR_PTR, 0); + JUMPHERE(jump); + + detect_partial_match(common, &backtrack->topbacktracks); + OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(0)); + if (charpos_othercasebit != 0) + OP2(SLJIT_OR, TMP1, 0, TMP1, 0, SLJIT_IMM, charpos_othercasebit); + CMPTO(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, charpos_char, label); + + if (private_data_ptr == 0) + allocate_stack(common, 2); + OP1(SLJIT_MOV, base, offset0, STR_PTR, 0); OP1(SLJIT_MOV, base, offset1, STR_PTR, 0); - else - OP1(SLJIT_MOV, base, offset1, SLJIT_IMM, 1); - label = LABEL(); - compile_char1_matchingpath(common, type, cc, &nomatch); - OP1(SLJIT_MOV, base, offset0, STR_PTR, 0); - if (opcode <= OP_PLUS) - JUMPTO(SLJIT_JUMP, label); - else if (opcode == OP_CRRANGE && max == 0) - { - OP2(SLJIT_ADD, base, offset1, base, offset1, SLJIT_IMM, 1); - JUMPTO(SLJIT_JUMP, label); + if (opcode == OP_UPTO) + { + OP2(SLJIT_SUB | SLJIT_SET_E, tmp_base, tmp_offset, tmp_base, tmp_offset, SLJIT_IMM, 1); + add_jump(compiler, &no_match, JUMP(SLJIT_ZERO)); + } + + /* Search the last instance of charpos_char. */ + label = LABEL(); + compile_char1_matchingpath(common, type, cc, &no_match, FALSE); + if (fast_str_ptr != 0) + OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), fast_str_ptr, STR_PTR, 0); + detect_partial_match(common, &no_match); + OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(0)); + if (charpos_othercasebit != 0) + OP2(SLJIT_OR, TMP1, 0, TMP1, 0, SLJIT_IMM, charpos_othercasebit); + if (opcode == OP_STAR) + { + CMPTO(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, charpos_char, label); + OP1(SLJIT_MOV, base, offset0, STR_PTR, 0); + } + else + { + jump = CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, charpos_char); + OP1(SLJIT_MOV, base, offset0, STR_PTR, 0); + JUMPHERE(jump); + } + + if (opcode == OP_UPTO) + { + OP2(SLJIT_SUB | SLJIT_SET_E, tmp_base, tmp_offset, tmp_base, tmp_offset, SLJIT_IMM, 1); + JUMPTO(SLJIT_NOT_ZERO, label); + } + else + JUMPTO(SLJIT_JUMP, label); + + set_jumps(no_match, LABEL()); + OP1(SLJIT_MOV, STR_PTR, 0, base, offset0); + OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); + OP1(SLJIT_MOV, base, offset0, STR_PTR, 0); } +#if defined SUPPORT_UTF && !defined COMPILE_PCRE32 + else if (common->utf) + { + if (private_data_ptr == 0) + allocate_stack(common, 2); + + OP1(SLJIT_MOV, base, offset0, STR_PTR, 0); + OP1(SLJIT_MOV, base, offset1, STR_PTR, 0); + + if (opcode == OP_UPTO) + OP1(SLJIT_MOV, tmp_base, tmp_offset, SLJIT_IMM, max); + + label = LABEL(); + compile_char1_matchingpath(common, type, cc, &no_match, TRUE); + OP1(SLJIT_MOV, base, offset0, STR_PTR, 0); + + if (opcode == OP_UPTO) + { + OP2(SLJIT_SUB | SLJIT_SET_E, tmp_base, tmp_offset, tmp_base, tmp_offset, SLJIT_IMM, 1); + JUMPTO(SLJIT_NOT_ZERO, label); + } + else + JUMPTO(SLJIT_JUMP, label); + + set_jumps(no_match, LABEL()); + OP1(SLJIT_MOV, STR_PTR, 0, base, offset0); + if (fast_str_ptr != 0) + OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), fast_str_ptr, STR_PTR, 0); + } +#endif else { - OP1(SLJIT_MOV, TMP1, 0, base, offset1); - OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, SLJIT_IMM, 1); - OP1(SLJIT_MOV, base, offset1, TMP1, 0); - CMPTO(SLJIT_LESS, TMP1, 0, SLJIT_IMM, max + 1, label); + if (private_data_ptr == 0) + allocate_stack(common, 2); + + OP1(SLJIT_MOV, base, offset1, STR_PTR, 0); + if (opcode == OP_UPTO) + OP1(SLJIT_MOV, tmp_base, tmp_offset, SLJIT_IMM, max); + + label = LABEL(); + detect_partial_match(common, &no_match); + compile_char1_matchingpath(common, type, cc, &no_char1_match, FALSE); + if (opcode == OP_UPTO) + { + OP2(SLJIT_SUB | SLJIT_SET_E, tmp_base, tmp_offset, tmp_base, tmp_offset, SLJIT_IMM, 1); + JUMPTO(SLJIT_NOT_ZERO, label); + OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); + } + else + JUMPTO(SLJIT_JUMP, label); + + set_jumps(no_char1_match, LABEL()); + OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); + set_jumps(no_match, LABEL()); + OP1(SLJIT_MOV, base, offset0, STR_PTR, 0); + if (fast_str_ptr != 0) + OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), fast_str_ptr, STR_PTR, 0); } - set_jumps(nomatch, LABEL()); - if (opcode == OP_CRRANGE) - add_jump(compiler, &backtrack->topbacktracks, CMP(SLJIT_LESS, base, offset1, SLJIT_IMM, min + 1)); - OP1(SLJIT_MOV, STR_PTR, 0, base, offset0); } - BACKTRACK_AS(iterator_backtrack)->matchingpath = LABEL(); + BACKTRACK_AS(char_iterator_backtrack)->matchingpath = LABEL(); break; case OP_MINSTAR: - case OP_MINPLUS: - if (opcode == OP_MINPLUS) - compile_char1_matchingpath(common, type, cc, &backtrack->topbacktracks); if (private_data_ptr == 0) allocate_stack(common, 1); OP1(SLJIT_MOV, base, offset0, STR_PTR, 0); - BACKTRACK_AS(iterator_backtrack)->matchingpath = LABEL(); + BACKTRACK_AS(char_iterator_backtrack)->matchingpath = LABEL(); + if (fast_str_ptr != 0) + OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), fast_str_ptr, STR_PTR, 0); break; case OP_MINUPTO: - case OP_CRMINRANGE: + SLJIT_ASSERT(fast_str_ptr == 0); if (private_data_ptr == 0) allocate_stack(common, 2); OP1(SLJIT_MOV, base, offset0, STR_PTR, 0); - OP1(SLJIT_MOV, base, offset1, SLJIT_IMM, 1); - if (opcode == OP_CRMINRANGE) - add_jump(compiler, &backtrack->topbacktracks, JUMP(SLJIT_JUMP)); - BACKTRACK_AS(iterator_backtrack)->matchingpath = LABEL(); + OP1(SLJIT_MOV, base, offset1, SLJIT_IMM, max + 1); + BACKTRACK_AS(char_iterator_backtrack)->matchingpath = LABEL(); break; case OP_QUERY: case OP_MINQUERY: + SLJIT_ASSERT(fast_str_ptr == 0); if (private_data_ptr == 0) allocate_stack(common, 1); OP1(SLJIT_MOV, base, offset0, STR_PTR, 0); if (opcode == OP_QUERY) - compile_char1_matchingpath(common, type, cc, &backtrack->topbacktracks); - BACKTRACK_AS(iterator_backtrack)->matchingpath = LABEL(); + compile_char1_matchingpath(common, type, cc, &BACKTRACK_AS(char_iterator_backtrack)->u.backtracks, TRUE); + BACKTRACK_AS(char_iterator_backtrack)->matchingpath = LABEL(); break; case OP_EXACT: - OP1(SLJIT_MOV, tmp_base, tmp_offset, SLJIT_IMM, max); - label = LABEL(); - compile_char1_matchingpath(common, type, cc, &backtrack->topbacktracks); - OP2(SLJIT_SUB | SLJIT_SET_E, tmp_base, tmp_offset, tmp_base, tmp_offset, SLJIT_IMM, 1); - JUMPTO(SLJIT_NOT_ZERO, label); break; case OP_POSSTAR: - case OP_POSPLUS: - case OP_POSUPTO: - if (opcode == OP_POSPLUS) - compile_char1_matchingpath(common, type, cc, &backtrack->topbacktracks); - if (opcode == OP_POSUPTO) - OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), POSSESSIVE1, SLJIT_IMM, max); - OP1(SLJIT_MOV, tmp_base, tmp_offset, STR_PTR, 0); - label = LABEL(); - compile_char1_matchingpath(common, type, cc, &nomatch); - OP1(SLJIT_MOV, tmp_base, tmp_offset, STR_PTR, 0); - if (opcode != OP_POSUPTO) - JUMPTO(SLJIT_JUMP, label); - else +#if defined SUPPORT_UTF && !defined COMPILE_PCRE32 + if (common->utf) { - OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_MEM1(SLJIT_SP), POSSESSIVE1, SLJIT_MEM1(SLJIT_SP), POSSESSIVE1, SLJIT_IMM, 1); - JUMPTO(SLJIT_NOT_ZERO, label); + OP1(SLJIT_MOV, tmp_base, tmp_offset, STR_PTR, 0); + label = LABEL(); + compile_char1_matchingpath(common, type, cc, &no_match, TRUE); + OP1(SLJIT_MOV, tmp_base, tmp_offset, STR_PTR, 0); + JUMPTO(SLJIT_JUMP, label); + set_jumps(no_match, LABEL()); + OP1(SLJIT_MOV, STR_PTR, 0, tmp_base, tmp_offset); + if (fast_str_ptr != 0) + OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), fast_str_ptr, STR_PTR, 0); + break; } - set_jumps(nomatch, LABEL()); - OP1(SLJIT_MOV, STR_PTR, 0, tmp_base, tmp_offset); +#endif + label = LABEL(); + detect_partial_match(common, &no_match); + compile_char1_matchingpath(common, type, cc, &no_char1_match, FALSE); + JUMPTO(SLJIT_JUMP, label); + set_jumps(no_char1_match, LABEL()); + OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); + set_jumps(no_match, LABEL()); + if (fast_str_ptr != 0) + OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), fast_str_ptr, STR_PTR, 0); + break; + + case OP_POSUPTO: + SLJIT_ASSERT(fast_str_ptr == 0); +#if defined SUPPORT_UTF && !defined COMPILE_PCRE32 + if (common->utf) + { + OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), POSSESSIVE1, STR_PTR, 0); + OP1(SLJIT_MOV, tmp_base, tmp_offset, SLJIT_IMM, max); + label = LABEL(); + compile_char1_matchingpath(common, type, cc, &no_match, TRUE); + OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), POSSESSIVE1, STR_PTR, 0); + OP2(SLJIT_SUB | SLJIT_SET_E, tmp_base, tmp_offset, tmp_base, tmp_offset, SLJIT_IMM, 1); + JUMPTO(SLJIT_NOT_ZERO, label); + set_jumps(no_match, LABEL()); + OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(SLJIT_SP), POSSESSIVE1); + break; + } +#endif + OP1(SLJIT_MOV, tmp_base, tmp_offset, SLJIT_IMM, max); + label = LABEL(); + detect_partial_match(common, &no_match); + compile_char1_matchingpath(common, type, cc, &no_char1_match, FALSE); + OP2(SLJIT_SUB | SLJIT_SET_E, tmp_base, tmp_offset, tmp_base, tmp_offset, SLJIT_IMM, 1); + JUMPTO(SLJIT_NOT_ZERO, label); + OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); + set_jumps(no_char1_match, LABEL()); + OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); + set_jumps(no_match, LABEL()); break; case OP_POSQUERY: + SLJIT_ASSERT(fast_str_ptr == 0); OP1(SLJIT_MOV, tmp_base, tmp_offset, STR_PTR, 0); - compile_char1_matchingpath(common, type, cc, &nomatch); + compile_char1_matchingpath(common, type, cc, &no_match, TRUE); OP1(SLJIT_MOV, tmp_base, tmp_offset, STR_PTR, 0); - set_jumps(nomatch, LABEL()); - OP1(SLJIT_MOV, STR_PTR, 0, tmp_base, tmp_offset); - break; - - case OP_CRPOSRANGE: - /* Combination of OP_EXACT and OP_POSSTAR or OP_POSUPTO */ - OP1(SLJIT_MOV, tmp_base, tmp_offset, SLJIT_IMM, min); - label = LABEL(); - compile_char1_matchingpath(common, type, cc, &backtrack->topbacktracks); - OP2(SLJIT_SUB | SLJIT_SET_E, tmp_base, tmp_offset, tmp_base, tmp_offset, SLJIT_IMM, 1); - JUMPTO(SLJIT_NOT_ZERO, label); - - if (max != 0) - { - SLJIT_ASSERT(max - min > 0); - OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), POSSESSIVE1, SLJIT_IMM, max - min); - } - OP1(SLJIT_MOV, tmp_base, tmp_offset, STR_PTR, 0); - label = LABEL(); - compile_char1_matchingpath(common, type, cc, &nomatch); - OP1(SLJIT_MOV, tmp_base, tmp_offset, STR_PTR, 0); - if (max == 0) - JUMPTO(SLJIT_JUMP, label); - else - { - OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_MEM1(SLJIT_SP), POSSESSIVE1, SLJIT_MEM1(SLJIT_SP), POSSESSIVE1, SLJIT_IMM, 1); - JUMPTO(SLJIT_NOT_ZERO, label); - } - set_jumps(nomatch, LABEL()); + set_jumps(no_match, LABEL()); OP1(SLJIT_MOV, STR_PTR, 0, tmp_base, tmp_offset); break; @@ -8174,9 +9178,9 @@ if (common->accept_label == NULL) else CMPTO(SLJIT_NOT_EQUAL, STR_PTR, 0, SLJIT_MEM1(SLJIT_SP), OVECTOR(0), common->accept_label); OP1(SLJIT_MOV, TMP1, 0, ARGUMENTS, 0); -OP1(SLJIT_MOV_UB, TMP2, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, notempty)); +OP1(SLJIT_MOV_U8, TMP2, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, notempty)); add_jump(compiler, &backtrack->topbacktracks, CMP(SLJIT_NOT_EQUAL, TMP2, 0, SLJIT_IMM, 0)); -OP1(SLJIT_MOV_UB, TMP2, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, notempty_atstart)); +OP1(SLJIT_MOV_U8, TMP2, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, notempty_atstart)); if (common->accept_label == NULL) add_jump(compiler, &common->accept, CMP(SLJIT_EQUAL, TMP2, 0, SLJIT_IMM, 0)); else @@ -8298,6 +9302,16 @@ while (cc < ccend) case OP_SOM: case OP_NOT_WORD_BOUNDARY: case OP_WORD_BOUNDARY: + case OP_EODN: + case OP_EOD: + case OP_DOLL: + case OP_DOLLM: + case OP_CIRC: + case OP_CIRCM: + case OP_REVERSE: + cc = compile_simple_assertion_matchingpath(common, *cc, cc + 1, parent->top != NULL ? &parent->top->nextbacktracks : &parent->topbacktracks); + break; + case OP_NOT_DIGIT: case OP_DIGIT: case OP_NOT_WHITESPACE: @@ -8315,16 +9329,9 @@ while (cc < ccend) case OP_NOT_VSPACE: case OP_VSPACE: case OP_EXTUNI: - case OP_EODN: - case OP_EOD: - case OP_CIRC: - case OP_CIRCM: - case OP_DOLL: - case OP_DOLLM: case OP_NOT: case OP_NOTI: - case OP_REVERSE: - cc = compile_char1_matchingpath(common, *cc, cc + 1, parent->top != NULL ? &parent->top->nextbacktracks : &parent->topbacktracks); + cc = compile_char1_matchingpath(common, *cc, cc + 1, parent->top != NULL ? &parent->top->nextbacktracks : &parent->topbacktracks, TRUE); break; case OP_SET_SOM: @@ -8341,7 +9348,7 @@ while (cc < ccend) if (common->mode == JIT_COMPILE) cc = compile_charn_matchingpath(common, cc, ccend, parent->top != NULL ? &parent->top->nextbacktracks : &parent->topbacktracks); else - cc = compile_char1_matchingpath(common, *cc, cc + 1, parent->top != NULL ? &parent->top->nextbacktracks : &parent->topbacktracks); + cc = compile_char1_matchingpath(common, *cc, cc + 1, parent->top != NULL ? &parent->top->nextbacktracks : &parent->topbacktracks, TRUE); break; case OP_STAR: @@ -8417,7 +9424,7 @@ while (cc < ccend) if (cc[1 + (32 / sizeof(pcre_uchar))] >= OP_CRSTAR && cc[1 + (32 / sizeof(pcre_uchar))] <= OP_CRPOSRANGE) cc = compile_iterator_matchingpath(common, cc, parent); else - cc = compile_char1_matchingpath(common, *cc, cc + 1, parent->top != NULL ? &parent->top->nextbacktracks : &parent->topbacktracks); + cc = compile_char1_matchingpath(common, *cc, cc + 1, parent->top != NULL ? &parent->top->nextbacktracks : &parent->topbacktracks, TRUE); break; #if defined SUPPORT_UTF || defined COMPILE_PCRE16 || defined COMPILE_PCRE32 @@ -8425,7 +9432,7 @@ while (cc < ccend) if (*(cc + GET(cc, 1)) >= OP_CRSTAR && *(cc + GET(cc, 1)) <= OP_CRPOSRANGE) cc = compile_iterator_matchingpath(common, cc, parent); else - cc = compile_char1_matchingpath(common, *cc, cc + 1, parent->top != NULL ? &parent->top->nextbacktracks : &parent->topbacktracks); + cc = compile_char1_matchingpath(common, *cc, cc + 1, parent->top != NULL ? &parent->top->nextbacktracks : &parent->topbacktracks, TRUE); break; #endif @@ -8601,95 +9608,82 @@ DEFINE_COMPILER; pcre_uchar *cc = current->cc; pcre_uchar opcode; pcre_uchar type; -int max = -1, min = -1; +sljit_u32 max = 0, exact; struct sljit_label *label = NULL; struct sljit_jump *jump = NULL; jump_list *jumplist = NULL; +pcre_uchar *end; int private_data_ptr = PRIVATE_DATA(cc); int base = (private_data_ptr == 0) ? SLJIT_MEM1(STACK_TOP) : SLJIT_MEM1(SLJIT_SP); int offset0 = (private_data_ptr == 0) ? STACK(0) : private_data_ptr; int offset1 = (private_data_ptr == 0) ? STACK(1) : private_data_ptr + (int)sizeof(sljit_sw); -cc = get_iterator_parameters(common, cc, &opcode, &type, &max, &min, NULL); +cc = get_iterator_parameters(common, cc, &opcode, &type, &max, &exact, &end); switch(opcode) { case OP_STAR: - case OP_PLUS: case OP_UPTO: - case OP_CRRANGE: if (type == OP_ANYNL || type == OP_EXTUNI) { SLJIT_ASSERT(private_data_ptr == 0); - set_jumps(current->topbacktracks, LABEL()); + set_jumps(CURRENT_AS(char_iterator_backtrack)->u.backtracks, LABEL()); OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(STACK_TOP), STACK(0)); free_stack(common, 1); - CMPTO(SLJIT_NOT_EQUAL, STR_PTR, 0, SLJIT_IMM, 0, CURRENT_AS(iterator_backtrack)->matchingpath); + CMPTO(SLJIT_NOT_EQUAL, STR_PTR, 0, SLJIT_IMM, 0, CURRENT_AS(char_iterator_backtrack)->matchingpath); } else { - if (opcode == OP_UPTO) - min = 0; - if (opcode <= OP_PLUS) + if (CURRENT_AS(char_iterator_backtrack)->u.charpos.enabled) { OP1(SLJIT_MOV, STR_PTR, 0, base, offset0); - jump = CMP(SLJIT_LESS_EQUAL, STR_PTR, 0, base, offset1); + OP1(SLJIT_MOV, TMP2, 0, base, offset1); + OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); + + jump = CMP(SLJIT_LESS_EQUAL, STR_PTR, 0, TMP2, 0); + label = LABEL(); + OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-1)); + OP1(SLJIT_MOV, base, offset0, STR_PTR, 0); + if (CURRENT_AS(char_iterator_backtrack)->u.charpos.othercasebit != 0) + OP2(SLJIT_OR, TMP1, 0, TMP1, 0, SLJIT_IMM, CURRENT_AS(char_iterator_backtrack)->u.charpos.othercasebit); + CMPTO(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, CURRENT_AS(char_iterator_backtrack)->u.charpos.chr, CURRENT_AS(char_iterator_backtrack)->matchingpath); + skip_char_back(common); + CMPTO(SLJIT_GREATER, STR_PTR, 0, TMP2, 0, label); } else { - OP1(SLJIT_MOV, TMP1, 0, base, offset1); OP1(SLJIT_MOV, STR_PTR, 0, base, offset0); - jump = CMP(SLJIT_LESS_EQUAL, TMP1, 0, SLJIT_IMM, min + 1); - OP2(SLJIT_SUB, base, offset1, TMP1, 0, SLJIT_IMM, 1); + jump = CMP(SLJIT_LESS_EQUAL, STR_PTR, 0, base, offset1); + skip_char_back(common); + OP1(SLJIT_MOV, base, offset0, STR_PTR, 0); + JUMPTO(SLJIT_JUMP, CURRENT_AS(char_iterator_backtrack)->matchingpath); } - skip_char_back(common); - OP1(SLJIT_MOV, base, offset0, STR_PTR, 0); - JUMPTO(SLJIT_JUMP, CURRENT_AS(iterator_backtrack)->matchingpath); - if (opcode == OP_CRRANGE) - set_jumps(current->topbacktracks, LABEL()); JUMPHERE(jump); if (private_data_ptr == 0) free_stack(common, 2); - if (opcode == OP_PLUS) - set_jumps(current->topbacktracks, LABEL()); } break; case OP_MINSTAR: - case OP_MINPLUS: OP1(SLJIT_MOV, STR_PTR, 0, base, offset0); - compile_char1_matchingpath(common, type, cc, &jumplist); + compile_char1_matchingpath(common, type, cc, &jumplist, TRUE); OP1(SLJIT_MOV, base, offset0, STR_PTR, 0); - JUMPTO(SLJIT_JUMP, CURRENT_AS(iterator_backtrack)->matchingpath); + JUMPTO(SLJIT_JUMP, CURRENT_AS(char_iterator_backtrack)->matchingpath); set_jumps(jumplist, LABEL()); if (private_data_ptr == 0) free_stack(common, 1); - if (opcode == OP_MINPLUS) - set_jumps(current->topbacktracks, LABEL()); break; case OP_MINUPTO: - case OP_CRMINRANGE: - if (opcode == OP_CRMINRANGE) - { - label = LABEL(); - set_jumps(current->topbacktracks, label); - } - OP1(SLJIT_MOV, STR_PTR, 0, base, offset0); - compile_char1_matchingpath(common, type, cc, &jumplist); - OP1(SLJIT_MOV, TMP1, 0, base, offset1); - OP1(SLJIT_MOV, base, offset0, STR_PTR, 0); - OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, SLJIT_IMM, 1); + OP1(SLJIT_MOV, STR_PTR, 0, base, offset0); + OP2(SLJIT_SUB | SLJIT_SET_E, TMP1, 0, TMP1, 0, SLJIT_IMM, 1); + add_jump(compiler, &jumplist, JUMP(SLJIT_ZERO)); + OP1(SLJIT_MOV, base, offset1, TMP1, 0); - - if (opcode == OP_CRMINRANGE) - CMPTO(SLJIT_LESS, TMP1, 0, SLJIT_IMM, min + 1, label); - - if (opcode == OP_CRMINRANGE && max == 0) - JUMPTO(SLJIT_JUMP, CURRENT_AS(iterator_backtrack)->matchingpath); - else - CMPTO(SLJIT_LESS, TMP1, 0, SLJIT_IMM, max + 2, CURRENT_AS(iterator_backtrack)->matchingpath); + compile_char1_matchingpath(common, type, cc, &jumplist, TRUE); + OP1(SLJIT_MOV, base, offset0, STR_PTR, 0); + JUMPTO(SLJIT_JUMP, CURRENT_AS(char_iterator_backtrack)->matchingpath); set_jumps(jumplist, LABEL()); if (private_data_ptr == 0) @@ -8699,12 +9693,12 @@ switch(opcode) case OP_QUERY: OP1(SLJIT_MOV, STR_PTR, 0, base, offset0); OP1(SLJIT_MOV, base, offset0, SLJIT_IMM, 0); - CMPTO(SLJIT_NOT_EQUAL, STR_PTR, 0, SLJIT_IMM, 0, CURRENT_AS(iterator_backtrack)->matchingpath); + CMPTO(SLJIT_NOT_EQUAL, STR_PTR, 0, SLJIT_IMM, 0, CURRENT_AS(char_iterator_backtrack)->matchingpath); jump = JUMP(SLJIT_JUMP); - set_jumps(current->topbacktracks, LABEL()); + set_jumps(CURRENT_AS(char_iterator_backtrack)->u.backtracks, LABEL()); OP1(SLJIT_MOV, STR_PTR, 0, base, offset0); OP1(SLJIT_MOV, base, offset0, SLJIT_IMM, 0); - JUMPTO(SLJIT_JUMP, CURRENT_AS(iterator_backtrack)->matchingpath); + JUMPTO(SLJIT_JUMP, CURRENT_AS(char_iterator_backtrack)->matchingpath); JUMPHERE(jump); if (private_data_ptr == 0) free_stack(common, 1); @@ -8714,8 +9708,8 @@ switch(opcode) OP1(SLJIT_MOV, STR_PTR, 0, base, offset0); OP1(SLJIT_MOV, base, offset0, SLJIT_IMM, 0); jump = CMP(SLJIT_EQUAL, STR_PTR, 0, SLJIT_IMM, 0); - compile_char1_matchingpath(common, type, cc, &jumplist); - JUMPTO(SLJIT_JUMP, CURRENT_AS(iterator_backtrack)->matchingpath); + compile_char1_matchingpath(common, type, cc, &jumplist, TRUE); + JUMPTO(SLJIT_JUMP, CURRENT_AS(char_iterator_backtrack)->matchingpath); set_jumps(jumplist, LABEL()); JUMPHERE(jump); if (private_data_ptr == 0) @@ -8723,11 +9717,6 @@ switch(opcode) break; case OP_EXACT: - case OP_POSPLUS: - case OP_CRPOSRANGE: - set_jumps(current->topbacktracks, LABEL()); - break; - case OP_POSSTAR: case OP_POSQUERY: case OP_POSUPTO: @@ -8737,6 +9726,8 @@ switch(opcode) SLJIT_ASSERT_STOP(); break; } + +set_jumps(current->topbacktracks, LABEL()); } static SLJIT_INLINE void compile_ref_iterator_backtrackingpath(compiler_common *common, struct backtrack_common *current) @@ -8754,12 +9745,12 @@ if ((type & 0x1) == 0) set_jumps(current->topbacktracks, LABEL()); OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(STACK_TOP), STACK(0)); free_stack(common, 1); - CMPTO(SLJIT_NOT_EQUAL, STR_PTR, 0, SLJIT_IMM, 0, CURRENT_AS(iterator_backtrack)->matchingpath); + CMPTO(SLJIT_NOT_EQUAL, STR_PTR, 0, SLJIT_IMM, 0, CURRENT_AS(ref_iterator_backtrack)->matchingpath); return; } OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(STACK_TOP), STACK(0)); -CMPTO(SLJIT_NOT_EQUAL, STR_PTR, 0, SLJIT_IMM, 0, CURRENT_AS(iterator_backtrack)->matchingpath); +CMPTO(SLJIT_NOT_EQUAL, STR_PTR, 0, SLJIT_IMM, 0, CURRENT_AS(ref_iterator_backtrack)->matchingpath); set_jumps(current->topbacktracks, LABEL()); free_stack(common, ref ? 2 : 3); } @@ -9258,7 +10249,9 @@ else if (opcode == OP_ONCE) /* The STR_PTR must be released. */ stacksize++; } - free_stack(common, stacksize); + + if (stacksize > 0) + free_stack(common, stacksize); JUMPHERE(once); /* Restore previous private_data_ptr */ @@ -9688,8 +10681,8 @@ common->currententry->entry = LABEL(); set_jumps(common->currententry->calls, common->currententry->entry); sljit_emit_fast_enter(compiler, TMP2, 0); -allocate_stack(common, private_data_size + framesize + alternativesize); count_match(common); +allocate_stack(common, private_data_size + framesize + alternativesize); OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(private_data_size + framesize + alternativesize - 1), TMP2, 0); copy_private_data(common, ccbegin, ccend, TRUE, private_data_size + framesize + alternativesize, framesize + alternativesize, needs_control_head); if (needs_control_head) @@ -9795,7 +10788,7 @@ struct sljit_compiler *compiler; backtrack_common rootbacktrack; compiler_common common_data; compiler_common *common = &common_data; -const pcre_uint8 *tables = re->tables; +const sljit_u8 *tables = re->tables; pcre_study_data *study; int private_data_size; pcre_uchar *ccend; @@ -9907,7 +10900,7 @@ ccend = bracketend(common->start); /* Calculate the local space size on the stack. */ common->ovector_start = LIMIT_MATCH + sizeof(sljit_sw); -common->optimized_cbracket = (pcre_uint8 *)SLJIT_MALLOC(re->top_bracket + 1, compiler->allocator_data); +common->optimized_cbracket = (sljit_u8 *)SLJIT_MALLOC(re->top_bracket + 1, compiler->allocator_data); if (!common->optimized_cbracket) return; #if defined DEBUG_FORCE_UNOPTIMIZED_CBRAS && DEBUG_FORCE_UNOPTIMIZED_CBRAS == 1 @@ -9942,15 +10935,10 @@ if (mode != JIT_COMPILE) common->hit_start = common->ovector_start; common->ovector_start += 2 * sizeof(sljit_sw); } - else - { - SLJIT_ASSERT(mode == JIT_PARTIAL_HARD_COMPILE); - common->needs_start_ptr = TRUE; - } } if ((re->options & PCRE_FIRSTLINE) != 0) { - common->first_line_end = common->ovector_start; + common->match_end_ptr = common->ovector_start; common->ovector_start += sizeof(sljit_sw); } #if defined DEBUG_FORCE_CONTROL_HEAD && DEBUG_FORCE_CONTROL_HEAD @@ -9961,14 +10949,12 @@ if (common->control_head_ptr != 0) common->control_head_ptr = common->ovector_start; common->ovector_start += sizeof(sljit_sw); } -if (common->needs_start_ptr && common->has_set_som) +if (common->has_set_som) { /* Saving the real start pointer is necessary. */ common->start_ptr = common->ovector_start; common->ovector_start += sizeof(sljit_sw); } -else - common->needs_start_ptr = FALSE; /* Aligning ovector to even number of sljit words. */ if ((common->ovector_start & sizeof(sljit_sw)) != 0) @@ -9985,16 +10971,24 @@ SLJIT_ASSERT(!(common->req_char_ptr != 0 && common->start_used_ptr != 0)); common->cbra_ptr = OVECTOR_START + (re->top_bracket + 1) * 2 * sizeof(sljit_sw); total_length = ccend - common->start; -common->private_data_ptrs = (sljit_si *)SLJIT_MALLOC(total_length * (sizeof(sljit_si) + (common->has_then ? 1 : 0)), compiler->allocator_data); +common->private_data_ptrs = (sljit_s32 *)SLJIT_MALLOC(total_length * (sizeof(sljit_s32) + (common->has_then ? 1 : 0)), compiler->allocator_data); if (!common->private_data_ptrs) { SLJIT_FREE(common->optimized_cbracket, compiler->allocator_data); return; } -memset(common->private_data_ptrs, 0, total_length * sizeof(sljit_si)); +memset(common->private_data_ptrs, 0, total_length * sizeof(sljit_s32)); private_data_size = common->cbra_ptr + (re->top_bracket + 1) * sizeof(sljit_sw); set_private_data_ptrs(common, &private_data_size, ccend); +if ((re->options & PCRE_ANCHORED) == 0 && (re->options & PCRE_NO_START_OPTIMIZE) == 0) + { + if (!detect_fast_forward_skip(common, &private_data_size) && !common->has_skip_in_assert_back) + detect_fast_fail(common, common->start, &private_data_size, 4); + } + +SLJIT_ASSERT(common->fast_fail_start_ptr <= common->fast_fail_end_ptr); + if (private_data_size > SLJIT_MAX_LOCAL_SIZE) { SLJIT_FREE(common->private_data_ptrs, compiler->allocator_data); @@ -10004,7 +10998,7 @@ if (private_data_size > SLJIT_MAX_LOCAL_SIZE) if (common->has_then) { - common->then_offsets = (pcre_uint8 *)(common->private_data_ptrs + total_length); + common->then_offsets = (sljit_u8 *)(common->private_data_ptrs + total_length); memset(common->then_offsets, 0, total_length); set_then_offsets(common, common->start, NULL); } @@ -10031,12 +11025,15 @@ OP1(SLJIT_MOV, TMP1, 0, SLJIT_S0, 0); OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, str)); OP1(SLJIT_MOV, STR_END, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, end)); OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, stack)); -OP1(SLJIT_MOV_UI, TMP1, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, limit_match)); +OP1(SLJIT_MOV_U32, TMP1, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, limit_match)); OP1(SLJIT_MOV, STACK_TOP, 0, SLJIT_MEM1(TMP2), SLJIT_OFFSETOF(struct sljit_stack, base)); OP1(SLJIT_MOV, STACK_LIMIT, 0, SLJIT_MEM1(TMP2), SLJIT_OFFSETOF(struct sljit_stack, limit)); OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, SLJIT_IMM, 1); OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), LIMIT_MATCH, TMP1, 0); +if (common->fast_fail_start_ptr < common->fast_fail_end_ptr) + reset_fast_fail(common); + if (mode == JIT_PARTIAL_SOFT_COMPILE) OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->hit_start, SLJIT_IMM, -1); if (common->mark_ptr != 0) @@ -10047,19 +11044,19 @@ if (common->control_head_ptr != 0) /* Main part of the matching */ if ((re->options & PCRE_ANCHORED) == 0) { - mainloop_label = mainloop_entry(common, (re->flags & PCRE_HASCRORLF) != 0, (re->options & PCRE_FIRSTLINE) != 0); + mainloop_label = mainloop_entry(common, (re->flags & PCRE_HASCRORLF) != 0); continue_match_label = LABEL(); /* Forward search if possible. */ if ((re->options & PCRE_NO_START_OPTIMIZE) == 0) { - if (mode == JIT_COMPILE && fast_forward_first_n_chars(common, (re->options & PCRE_FIRSTLINE) != 0)) + if (mode == JIT_COMPILE && fast_forward_first_n_chars(common)) ; else if ((re->flags & PCRE_FIRSTSET) != 0) - fast_forward_first_char(common, (pcre_uchar)re->first_char, (re->flags & PCRE_FCH_CASELESS) != 0, (re->options & PCRE_FIRSTLINE) != 0); + fast_forward_first_char(common, (pcre_uchar)re->first_char, (re->flags & PCRE_FCH_CASELESS) != 0); else if ((re->flags & PCRE_STARTLINE) != 0) - fast_forward_newline(common, (re->options & PCRE_FIRSTLINE) != 0); + fast_forward_newline(common); else if (study != NULL && (study->flags & PCRE_STUDY_MAPPED) != 0) - fast_forward_start_bits(common, study->start_bits, (re->options & PCRE_FIRSTLINE) != 0); + fast_forward_start_bits(common, study->start_bits); } } else @@ -10080,14 +11077,11 @@ OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), OVECTOR(0), STR_PTR, 0); OP1(SLJIT_MOV, COUNT_MATCH, 0, SLJIT_MEM1(SLJIT_SP), LIMIT_MATCH); if (common->capture_last_ptr != 0) OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->capture_last_ptr, SLJIT_IMM, -1); +if (common->fast_forward_bc_ptr != NULL) + OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), PRIVATE_DATA(common->fast_forward_bc_ptr + 1), STR_PTR, 0); -if (common->needs_start_ptr) - { - SLJIT_ASSERT(common->start_ptr != OVECTOR(0)); +if (common->start_ptr != OVECTOR(0)) OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->start_ptr, STR_PTR, 0); - } -else - SLJIT_ASSERT(common->start_ptr == OVECTOR(0)); /* Copy the beginning of the string. */ if (mode == JIT_PARTIAL_SOFT_COMPILE) @@ -10166,11 +11160,12 @@ if (mode == JIT_PARTIAL_SOFT_COMPILE) /* Check we have remaining characters. */ if ((re->options & PCRE_ANCHORED) == 0 && (re->options & PCRE_FIRSTLINE) != 0) { - SLJIT_ASSERT(common->first_line_end != 0); - OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->first_line_end); + SLJIT_ASSERT(common->match_end_ptr != 0); + OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr); } -OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(SLJIT_SP), common->start_ptr); +OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(SLJIT_SP), + (common->fast_forward_bc_ptr != NULL) ? (PRIVATE_DATA(common->fast_forward_bc_ptr + 1)) : common->start_ptr); if ((re->options & PCRE_ANCHORED) == 0) { @@ -10181,12 +11176,7 @@ if ((re->options & PCRE_ANCHORED) == 0) /* There cannot be more newlines here. */ } else - { - if ((re->options & PCRE_FIRSTLINE) == 0) - CMPTO(SLJIT_LESS, STR_PTR, 0, STR_END, 0, mainloop_label); - else - CMPTO(SLJIT_LESS, STR_PTR, 0, TMP1, 0, mainloop_label); - } + CMPTO(SLJIT_LESS, STR_PTR, 0, ((re->options & PCRE_FIRSTLINE) == 0) ? STR_END : TMP1, 0, mainloop_label); } /* No more remaining characters. */ @@ -10205,15 +11195,18 @@ if (common->might_be_empty) { JUMPHERE(empty_match); OP1(SLJIT_MOV, TMP1, 0, ARGUMENTS, 0); - OP1(SLJIT_MOV_UB, TMP2, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, notempty)); + OP1(SLJIT_MOV_U8, TMP2, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, notempty)); CMPTO(SLJIT_NOT_EQUAL, TMP2, 0, SLJIT_IMM, 0, empty_match_backtrack_label); - OP1(SLJIT_MOV_UB, TMP2, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, notempty_atstart)); + OP1(SLJIT_MOV_U8, TMP2, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, notempty_atstart)); CMPTO(SLJIT_EQUAL, TMP2, 0, SLJIT_IMM, 0, empty_match_found_label); OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, str)); CMPTO(SLJIT_NOT_EQUAL, TMP2, 0, STR_PTR, 0, empty_match_found_label); JUMPTO(SLJIT_JUMP, empty_match_backtrack_label); } +common->fast_forward_bc_ptr = NULL; +common->fast_fail_start_ptr = 0; +common->fast_fail_end_ptr = 0; common->currententry = common->entries; common->local_exit = TRUE; quit_label = common->quit_label; @@ -10395,7 +11388,7 @@ union { void *executable_func; jit_function call_executable_func; } convert_executable_func; -pcre_uint8 local_space[MACHINE_STACK_SIZE]; +sljit_u8 local_space[MACHINE_STACK_SIZE]; struct sljit_stack local_stack; local_stack.top = (sljit_sw)&local_space; @@ -10435,7 +11428,7 @@ arguments.begin = subject; arguments.end = subject + length; arguments.mark_ptr = NULL; /* JIT decreases this value less frequently than the interpreter. */ -arguments.limit_match = ((extra_data->flags & PCRE_EXTRA_MATCH_LIMIT) == 0) ? MATCH_LIMIT : (pcre_uint32)(extra_data->match_limit); +arguments.limit_match = ((extra_data->flags & PCRE_EXTRA_MATCH_LIMIT) == 0) ? MATCH_LIMIT : (sljit_u32)(extra_data->match_limit); if (functions->limit_match != 0 && functions->limit_match < arguments.limit_match) arguments.limit_match = functions->limit_match; arguments.notbol = (options & PCRE_NOTBOL) != 0; @@ -10528,7 +11521,7 @@ arguments.begin = subject_ptr; arguments.end = subject_ptr + length; arguments.mark_ptr = NULL; /* JIT decreases this value less frequently than the interpreter. */ -arguments.limit_match = ((extra_data->flags & PCRE_EXTRA_MATCH_LIMIT) == 0) ? MATCH_LIMIT : (pcre_uint32)(extra_data->match_limit); +arguments.limit_match = ((extra_data->flags & PCRE_EXTRA_MATCH_LIMIT) == 0) ? MATCH_LIMIT : (sljit_u32)(extra_data->match_limit); if (functions->limit_match != 0 && functions->limit_match < arguments.limit_match) arguments.limit_match = functions->limit_match; arguments.notbol = (options & PCRE_NOTBOL) != 0; diff --git a/pcre/pcre_jit_test.c b/pcre/pcre_jit_test.c index 17378957d62..9b61ec000fa 100644 --- a/pcre/pcre_jit_test.c +++ b/pcre/pcre_jit_test.c @@ -242,13 +242,17 @@ static struct regression_test_case regression_test_cases[] = { { MA, 0, "a\\z", "aaa" }, { MA, 0 | F_NOMATCH, "a\\z", "aab" }, - /* Brackets. */ + /* Brackets and alternatives. */ { MUA, 0, "(ab|bb|cd)", "bacde" }, { MUA, 0, "(?:ab|a)(bc|c)", "ababc" }, { MUA, 0, "((ab|(cc))|(bb)|(?:cd|efg))", "abac" }, { CMUA, 0, "((aB|(Cc))|(bB)|(?:cd|EFg))", "AcCe" }, { MUA, 0, "((ab|(cc))|(bb)|(?:cd|ebg))", "acebebg" }, { MUA, 0, "(?:(a)|(?:b))(cc|(?:d|e))(a|b)k", "accabdbbccbk" }, + { MUA, 0, "\xc7\x82|\xc6\x82", "\xf1\x83\x82\x82\xc7\x82\xc7\x83" }, + { MUA, 0, "=\xc7\x82|#\xc6\x82", "\xf1\x83\x82\x82=\xc7\x82\xc7\x83" }, + { MUA, 0, "\xc7\x82\xc7\x83|\xc6\x82\xc6\x82", "\xf1\x83\x82\x82\xc7\x82\xc7\x83" }, + { MUA, 0, "\xc6\x82\xc6\x82|\xc7\x83\xc7\x83|\xc8\x84\xc8\x84", "\xf1\x83\x82\x82\xc8\x84\xc8\x84" }, /* Greedy and non-greedy ? operators. */ { MUA, 0, "(?:a)?a", "laab" }, @@ -318,6 +322,14 @@ static struct regression_test_case regression_test_cases[] = { { CMUA, 0, "[^\xe1\xbd\xb8][^\xc3\xa9]", "\xe1\xbd\xb8\xe1\xbf\xb8\xc3\xa9\xc3\x89#" }, { MUA, 0, "[^\xe1\xbd\xb8][^\xc3\xa9]", "\xe1\xbd\xb8\xe1\xbf\xb8\xc3\xa9\xc3\x89#" }, { MUA, 0, "[^\xe1\xbd\xb8]{3,}?", "##\xe1\xbd\xb8#\xe1\xbd\xb8#\xc3\x89#\xe1\xbd\xb8" }, + { MUA, 0, "\\d+123", "987654321,01234" }, + { MUA, 0, "abcd*|\\w+xy", "aaaaa,abxyz" }, + { MUA, 0, "(?:abc|((?:amc|\\b\\w*xy)))", "aaaaa,abxyz" }, + { MUA, 0, "a(?R)|([a-z]++)#", ".abcd.abcd#."}, + { MUA, 0, "a(?R)|([a-z]++)#", ".abcd.mbcd#."}, + { MUA, 0, ".[ab]*.", "xx" }, + { MUA, 0, ".[ab]*a", "xxa" }, + { MUA, 0, ".[ab]?.", "xx" }, /* Bracket repeats with limit. */ { MUA, 0, "(?:(ab){2}){5}M", "abababababababababababM" }, @@ -574,6 +586,16 @@ static struct regression_test_case regression_test_cases[] = { { MUA, 0, "(?:(?=.)??[a-c])+m", "abacdcbacacdcaccam" }, { MUA, 0, "((?!a)?(?!([^a]))?)+$", "acbab" }, { MUA, 0, "((?!a)?\?(?!([^a]))?\?)+$", "acbab" }, + { MUA, 0, "a(?=(?C)\\B)b", "ab" }, + { MUA, 0, "a(?!(?C)\\B)bb|ab", "abb" }, + { MUA, 0, "a(?=\\b|(?C)\\B)b", "ab" }, + { MUA, 0, "a(?!\\b|(?C)\\B)bb|ab", "abb" }, + { MUA, 0, "c(?(?=(?C)\\B)ab|a)", "cab" }, + { MUA, 0, "c(?(?!(?C)\\B)ab|a)", "cab" }, + { MUA, 0, "c(?(?=\\b|(?C)\\B)ab|a)", "cab" }, + { MUA, 0, "c(?(?!\\b|(?C)\\B)ab|a)", "cab" }, + { MUA, 0, "a(?=)b", "ab" }, + { MUA, 0 | F_NOMATCH, "a(?!)b", "ab" }, /* Not empty, ACCEPT, FAIL */ { MUA | PCRE_NOTEMPTY, 0 | F_NOMATCH, "a*", "bcx" }, @@ -664,6 +686,7 @@ static struct regression_test_case regression_test_cases[] = { { PCRE_MULTILINE | PCRE_UTF8 | PCRE_NEWLINE_CRLF | PCRE_FIRSTLINE, 1, ".", "\r\n" }, { PCRE_FIRSTLINE | PCRE_NEWLINE_LF | PCRE_DOTALL, 0 | F_NOMATCH, "ab.", "ab" }, { MUA | PCRE_FIRSTLINE, 1 | F_NOMATCH, "^[a-d0-9]", "\nxx\nd" }, + { PCRE_NEWLINE_ANY | PCRE_FIRSTLINE | PCRE_DOTALL, 0, "....a", "012\n0a" }, /* Recurse. */ { MUA, 0, "(a)(?1)", "aa" }, @@ -798,6 +821,9 @@ static struct regression_test_case regression_test_cases[] = { /* (*SKIP) verb. */ { MUA, 0 | F_NOMATCH, "(?=a(*SKIP)b)ab|ad", "ad" }, + { MUA, 0, "(\\w+(*SKIP)#)", "abcd,xyz#," }, + { MUA, 0, "\\w+(*SKIP)#|mm", "abcd,xyz#," }, + { MUA, 0 | F_NOMATCH, "b+(?<=(*SKIP)#c)|b+", "#bbb" }, /* (*THEN) verb. */ { MUA, 0, "((?:a(*THEN)|aab)(*THEN)c|a+)+m", "aabcaabcaabcaabcnacm" }, @@ -1534,10 +1560,10 @@ static int regression_tests(void) is_successful = 0; } #endif -#if defined SUPPORT_PCRE16 && defined SUPPORT_PCRE16 - if (ovector16_1[i] != ovector16_2[i] || ovector16_1[i] != ovector16_1[i] || ovector16_1[i] != ovector16_2[i]) { - printf("\n16 and 16 bit: Ovector[%d] value differs(J16:%d,I16:%d,J32:%d,I32:%d): [%d] '%s' @ '%s' \n", - i, ovector16_1[i], ovector16_2[i], ovector16_1[i], ovector16_2[i], +#if defined SUPPORT_PCRE16 && defined SUPPORT_PCRE32 + if (ovector16_1[i] != ovector16_2[i] || ovector16_1[i] != ovector32_1[i] || ovector16_1[i] != ovector32_2[i]) { + printf("\n16 and 32 bit: Ovector[%d] value differs(J16:%d,I16:%d,J32:%d,I32:%d): [%d] '%s' @ '%s' \n", + i, ovector16_1[i], ovector16_2[i], ovector32_1[i], ovector32_2[i], total, current->pattern, current->input); is_successful = 0; } diff --git a/pcre/pcre_study.c b/pcre/pcre_study.c index 7fd0ba0b3d8..d9d4960d84e 100644 --- a/pcre/pcre_study.c +++ b/pcre/pcre_study.c @@ -1371,7 +1371,7 @@ do for (c = 0; c < 16; c++) start_bits[c] |= map[c]; for (c = 128; c < 256; c++) { - if ((map[c/8] && (1 << (c&7))) != 0) + if ((map[c/8] & (1 << (c&7))) != 0) { int d = (c >> 6) | 0xc0; /* Set bit for this starter */ start_bits[d/8] |= (1 << (d&7)); /* and then skip on to the */ diff --git a/pcre/pcrecpp.cc b/pcre/pcrecpp.cc index c595cbcab5c..d09c9abc516 100644 --- a/pcre/pcrecpp.cc +++ b/pcre/pcrecpp.cc @@ -66,7 +66,7 @@ Arg RE::no_arg((void*)NULL); // inclusive test if we ever needed it. (Note that not only the // __attribute__ syntax, but also __USER_LABEL_PREFIX__, are // gnu-specific.) -#if defined(__GNUC__) && __GNUC__ >= 3 && defined(__ELF__) +#if defined(__GNUC__) && __GNUC__ >= 3 && defined(__ELF__) && !defined(__INTEL_COMPILER) # define ULP_AS_STRING(x) ULP_AS_STRING_INTERNAL(x) # define ULP_AS_STRING_INTERNAL(x) #x # define USER_LABEL_PREFIX_STR ULP_AS_STRING(__USER_LABEL_PREFIX__) @@ -168,22 +168,22 @@ bool RE::FullMatch(const StringPiece& text, const Arg& ptr16) const { const Arg* args[kMaxArgs]; int n = 0; - if (&ptr1 == &no_arg) goto done; args[n++] = &ptr1; - if (&ptr2 == &no_arg) goto done; args[n++] = &ptr2; - if (&ptr3 == &no_arg) goto done; args[n++] = &ptr3; - if (&ptr4 == &no_arg) goto done; args[n++] = &ptr4; - if (&ptr5 == &no_arg) goto done; args[n++] = &ptr5; - if (&ptr6 == &no_arg) goto done; args[n++] = &ptr6; - if (&ptr7 == &no_arg) goto done; args[n++] = &ptr7; - if (&ptr8 == &no_arg) goto done; args[n++] = &ptr8; - if (&ptr9 == &no_arg) goto done; args[n++] = &ptr9; - if (&ptr10 == &no_arg) goto done; args[n++] = &ptr10; - if (&ptr11 == &no_arg) goto done; args[n++] = &ptr11; - if (&ptr12 == &no_arg) goto done; args[n++] = &ptr12; - if (&ptr13 == &no_arg) goto done; args[n++] = &ptr13; - if (&ptr14 == &no_arg) goto done; args[n++] = &ptr14; - if (&ptr15 == &no_arg) goto done; args[n++] = &ptr15; - if (&ptr16 == &no_arg) goto done; args[n++] = &ptr16; + if (&ptr1 == &no_arg) { goto done; } args[n++] = &ptr1; + if (&ptr2 == &no_arg) { goto done; } args[n++] = &ptr2; + if (&ptr3 == &no_arg) { goto done; } args[n++] = &ptr3; + if (&ptr4 == &no_arg) { goto done; } args[n++] = &ptr4; + if (&ptr5 == &no_arg) { goto done; } args[n++] = &ptr5; + if (&ptr6 == &no_arg) { goto done; } args[n++] = &ptr6; + if (&ptr7 == &no_arg) { goto done; } args[n++] = &ptr7; + if (&ptr8 == &no_arg) { goto done; } args[n++] = &ptr8; + if (&ptr9 == &no_arg) { goto done; } args[n++] = &ptr9; + if (&ptr10 == &no_arg) { goto done; } args[n++] = &ptr10; + if (&ptr11 == &no_arg) { goto done; } args[n++] = &ptr11; + if (&ptr12 == &no_arg) { goto done; } args[n++] = &ptr12; + if (&ptr13 == &no_arg) { goto done; } args[n++] = &ptr13; + if (&ptr14 == &no_arg) { goto done; } args[n++] = &ptr14; + if (&ptr15 == &no_arg) { goto done; } args[n++] = &ptr15; + if (&ptr16 == &no_arg) { goto done; } args[n++] = &ptr16; done: int consumed; @@ -210,22 +210,22 @@ bool RE::PartialMatch(const StringPiece& text, const Arg& ptr16) const { const Arg* args[kMaxArgs]; int n = 0; - if (&ptr1 == &no_arg) goto done; args[n++] = &ptr1; - if (&ptr2 == &no_arg) goto done; args[n++] = &ptr2; - if (&ptr3 == &no_arg) goto done; args[n++] = &ptr3; - if (&ptr4 == &no_arg) goto done; args[n++] = &ptr4; - if (&ptr5 == &no_arg) goto done; args[n++] = &ptr5; - if (&ptr6 == &no_arg) goto done; args[n++] = &ptr6; - if (&ptr7 == &no_arg) goto done; args[n++] = &ptr7; - if (&ptr8 == &no_arg) goto done; args[n++] = &ptr8; - if (&ptr9 == &no_arg) goto done; args[n++] = &ptr9; - if (&ptr10 == &no_arg) goto done; args[n++] = &ptr10; - if (&ptr11 == &no_arg) goto done; args[n++] = &ptr11; - if (&ptr12 == &no_arg) goto done; args[n++] = &ptr12; - if (&ptr13 == &no_arg) goto done; args[n++] = &ptr13; - if (&ptr14 == &no_arg) goto done; args[n++] = &ptr14; - if (&ptr15 == &no_arg) goto done; args[n++] = &ptr15; - if (&ptr16 == &no_arg) goto done; args[n++] = &ptr16; + if (&ptr1 == &no_arg) { goto done; } args[n++] = &ptr1; + if (&ptr2 == &no_arg) { goto done; } args[n++] = &ptr2; + if (&ptr3 == &no_arg) { goto done; } args[n++] = &ptr3; + if (&ptr4 == &no_arg) { goto done; } args[n++] = &ptr4; + if (&ptr5 == &no_arg) { goto done; } args[n++] = &ptr5; + if (&ptr6 == &no_arg) { goto done; } args[n++] = &ptr6; + if (&ptr7 == &no_arg) { goto done; } args[n++] = &ptr7; + if (&ptr8 == &no_arg) { goto done; } args[n++] = &ptr8; + if (&ptr9 == &no_arg) { goto done; } args[n++] = &ptr9; + if (&ptr10 == &no_arg) { goto done; } args[n++] = &ptr10; + if (&ptr11 == &no_arg) { goto done; } args[n++] = &ptr11; + if (&ptr12 == &no_arg) { goto done; } args[n++] = &ptr12; + if (&ptr13 == &no_arg) { goto done; } args[n++] = &ptr13; + if (&ptr14 == &no_arg) { goto done; } args[n++] = &ptr14; + if (&ptr15 == &no_arg) { goto done; } args[n++] = &ptr15; + if (&ptr16 == &no_arg) { goto done; } args[n++] = &ptr16; done: int consumed; @@ -252,22 +252,22 @@ bool RE::Consume(StringPiece* input, const Arg& ptr16) const { const Arg* args[kMaxArgs]; int n = 0; - if (&ptr1 == &no_arg) goto done; args[n++] = &ptr1; - if (&ptr2 == &no_arg) goto done; args[n++] = &ptr2; - if (&ptr3 == &no_arg) goto done; args[n++] = &ptr3; - if (&ptr4 == &no_arg) goto done; args[n++] = &ptr4; - if (&ptr5 == &no_arg) goto done; args[n++] = &ptr5; - if (&ptr6 == &no_arg) goto done; args[n++] = &ptr6; - if (&ptr7 == &no_arg) goto done; args[n++] = &ptr7; - if (&ptr8 == &no_arg) goto done; args[n++] = &ptr8; - if (&ptr9 == &no_arg) goto done; args[n++] = &ptr9; - if (&ptr10 == &no_arg) goto done; args[n++] = &ptr10; - if (&ptr11 == &no_arg) goto done; args[n++] = &ptr11; - if (&ptr12 == &no_arg) goto done; args[n++] = &ptr12; - if (&ptr13 == &no_arg) goto done; args[n++] = &ptr13; - if (&ptr14 == &no_arg) goto done; args[n++] = &ptr14; - if (&ptr15 == &no_arg) goto done; args[n++] = &ptr15; - if (&ptr16 == &no_arg) goto done; args[n++] = &ptr16; + if (&ptr1 == &no_arg) { goto done; } args[n++] = &ptr1; + if (&ptr2 == &no_arg) { goto done; } args[n++] = &ptr2; + if (&ptr3 == &no_arg) { goto done; } args[n++] = &ptr3; + if (&ptr4 == &no_arg) { goto done; } args[n++] = &ptr4; + if (&ptr5 == &no_arg) { goto done; } args[n++] = &ptr5; + if (&ptr6 == &no_arg) { goto done; } args[n++] = &ptr6; + if (&ptr7 == &no_arg) { goto done; } args[n++] = &ptr7; + if (&ptr8 == &no_arg) { goto done; } args[n++] = &ptr8; + if (&ptr9 == &no_arg) { goto done; } args[n++] = &ptr9; + if (&ptr10 == &no_arg) { goto done; } args[n++] = &ptr10; + if (&ptr11 == &no_arg) { goto done; } args[n++] = &ptr11; + if (&ptr12 == &no_arg) { goto done; } args[n++] = &ptr12; + if (&ptr13 == &no_arg) { goto done; } args[n++] = &ptr13; + if (&ptr14 == &no_arg) { goto done; } args[n++] = &ptr14; + if (&ptr15 == &no_arg) { goto done; } args[n++] = &ptr15; + if (&ptr16 == &no_arg) { goto done; } args[n++] = &ptr16; done: int consumed; @@ -300,22 +300,22 @@ bool RE::FindAndConsume(StringPiece* input, const Arg& ptr16) const { const Arg* args[kMaxArgs]; int n = 0; - if (&ptr1 == &no_arg) goto done; args[n++] = &ptr1; - if (&ptr2 == &no_arg) goto done; args[n++] = &ptr2; - if (&ptr3 == &no_arg) goto done; args[n++] = &ptr3; - if (&ptr4 == &no_arg) goto done; args[n++] = &ptr4; - if (&ptr5 == &no_arg) goto done; args[n++] = &ptr5; - if (&ptr6 == &no_arg) goto done; args[n++] = &ptr6; - if (&ptr7 == &no_arg) goto done; args[n++] = &ptr7; - if (&ptr8 == &no_arg) goto done; args[n++] = &ptr8; - if (&ptr9 == &no_arg) goto done; args[n++] = &ptr9; - if (&ptr10 == &no_arg) goto done; args[n++] = &ptr10; - if (&ptr11 == &no_arg) goto done; args[n++] = &ptr11; - if (&ptr12 == &no_arg) goto done; args[n++] = &ptr12; - if (&ptr13 == &no_arg) goto done; args[n++] = &ptr13; - if (&ptr14 == &no_arg) goto done; args[n++] = &ptr14; - if (&ptr15 == &no_arg) goto done; args[n++] = &ptr15; - if (&ptr16 == &no_arg) goto done; args[n++] = &ptr16; + if (&ptr1 == &no_arg) { goto done; } args[n++] = &ptr1; + if (&ptr2 == &no_arg) { goto done; } args[n++] = &ptr2; + if (&ptr3 == &no_arg) { goto done; } args[n++] = &ptr3; + if (&ptr4 == &no_arg) { goto done; } args[n++] = &ptr4; + if (&ptr5 == &no_arg) { goto done; } args[n++] = &ptr5; + if (&ptr6 == &no_arg) { goto done; } args[n++] = &ptr6; + if (&ptr7 == &no_arg) { goto done; } args[n++] = &ptr7; + if (&ptr8 == &no_arg) { goto done; } args[n++] = &ptr8; + if (&ptr9 == &no_arg) { goto done; } args[n++] = &ptr9; + if (&ptr10 == &no_arg) { goto done; } args[n++] = &ptr10; + if (&ptr11 == &no_arg) { goto done; } args[n++] = &ptr11; + if (&ptr12 == &no_arg) { goto done; } args[n++] = &ptr12; + if (&ptr13 == &no_arg) { goto done; } args[n++] = &ptr13; + if (&ptr14 == &no_arg) { goto done; } args[n++] = &ptr14; + if (&ptr15 == &no_arg) { goto done; } args[n++] = &ptr15; + if (&ptr16 == &no_arg) { goto done; } args[n++] = &ptr16; done: int consumed; diff --git a/pcre/pcregrep.c b/pcre/pcregrep.c index 64986b016e6..cd53c648da2 100644 --- a/pcre/pcregrep.c +++ b/pcre/pcregrep.c @@ -2437,7 +2437,7 @@ return options; static char * ordin(int n) { -static char buffer[8]; +static char buffer[14]; char *p = buffer; sprintf(p, "%d", n); while (*p != 0) p++; diff --git a/pcre/pcreposix.c b/pcre/pcreposix.c index f024423b634..cf75588c40d 100644 --- a/pcre/pcreposix.c +++ b/pcre/pcreposix.c @@ -6,7 +6,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel - Copyright (c) 1997-2014 University of Cambridge + Copyright (c) 1997-2016 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -173,7 +173,8 @@ static const int eint[] = { REG_BADPAT, /* group name must start with a non-digit */ /* 85 */ REG_BADPAT, /* parentheses too deeply nested (stack check) */ - REG_BADPAT /* missing digits in \x{} or \o{} */ + REG_BADPAT, /* missing digits in \x{} or \o{} */ + REG_BADPAT /* pattern too complicated */ }; /* Table of texts corresponding to POSIX error codes */ @@ -364,6 +365,7 @@ start location rather than being passed as a PCRE "starting offset". */ if ((eflags & REG_STARTEND) != 0) { + if (pmatch == NULL) return REG_INVARG; so = pmatch[0].rm_so; eo = pmatch[0].rm_eo; } diff --git a/pcre/pcretest.c b/pcre/pcretest.c index 488e419462e..78ef5177df7 100644 --- a/pcre/pcretest.c +++ b/pcre/pcretest.c @@ -2250,7 +2250,7 @@ data is not zero. */ static int callout(pcre_callout_block *cb) { FILE *f = (first_callout | callout_extra)? outfile : NULL; -int i, pre_start, post_start, subject_length; +int i, current_position, pre_start, post_start, subject_length; if (callout_extra) { @@ -2280,14 +2280,19 @@ printed lengths of the substrings. */ if (f != NULL) fprintf(f, "--->"); +/* If a lookbehind is involved, the current position may be earlier than the +match start. If so, use the match start instead. */ + +current_position = (cb->current_position >= cb->start_match)? + cb->current_position : cb->start_match; + PCHARS(pre_start, cb->subject, 0, cb->start_match, f); PCHARS(post_start, cb->subject, cb->start_match, - cb->current_position - cb->start_match, f); + current_position - cb->start_match, f); PCHARS(subject_length, cb->subject, 0, cb->subject_length, NULL); -PCHARSV(cb->subject, cb->current_position, - cb->subject_length - cb->current_position, f); +PCHARSV(cb->subject, current_position, cb->subject_length - current_position, f); if (f != NULL) fprintf(f, "\n"); @@ -5612,6 +5617,12 @@ while (!done) break; } + if (use_size_offsets < 2) + { + fprintf(outfile, "Cannot do global matching with an ovector size < 2\n"); + break; + } + /* If we have matched an empty string, first check to see if we are at the end of the subject. If so, the /g loop is over. Otherwise, mimic what Perl's /g options does. This turns out to be rather cunning. First we set @@ -5740,3 +5751,4 @@ return yield; } /* End of pcretest.c */ + diff --git a/pcre/testdata/testinput11 b/pcre/testdata/testinput11 index ac9d2289854..6f0989a14c2 100644 --- a/pcre/testdata/testinput11 +++ b/pcre/testdata/testinput11 @@ -138,4 +138,6 @@ is required for these tests. --/ /.((?2)(?R)\1)()/B +/([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00](*ACCEPT)/ + /-- End of testinput11 --/ diff --git a/pcre/testdata/testinput2 b/pcre/testdata/testinput2 index e2e520f7404..75e402ee9b3 100644 --- a/pcre/testdata/testinput2 +++ b/pcre/testdata/testinput2 @@ -4217,4 +4217,30 @@ backtracking verbs. --/ /a[[:punct:]b]/BZ +/L(?#(|++)(?J:(?)(?))(?)/ + \O\CC + +/(?=a\K)/ + ring bpattingbobnd $ 1,oern cou \rb\L + +/(?<=((?C)0))/ + 9010 + abcd + +/((?J)(?'R'(?'R'(?'R'(?'R'(?'R'(?|(\k'R'))))))))/ + +/\N(?(?C)0?!.)*/ + /-- End of testinput2 --/ diff --git a/pcre/testdata/testinput6 b/pcre/testdata/testinput6 index aeb62a073fa..a178d3d67b4 100644 --- a/pcre/testdata/testinput6 +++ b/pcre/testdata/testinput6 @@ -1553,4 +1553,13 @@ \x{200} \x{37e} +/[^[:^ascii:]\d]/8W + a + ~ + 0 + \a + \x{7f} + \x{389} + \x{20ac} + /-- End of testinput6 --/ diff --git a/pcre/testdata/testinput7 b/pcre/testdata/testinput7 index e411a4b842e..00b9738a371 100644 --- a/pcre/testdata/testinput7 +++ b/pcre/testdata/testinput7 @@ -853,4 +853,8 @@ of case for anything other than the ASCII letters. --/ /a[b[:punct:]]/8WBZ +/L(?#(|++a)...(?P=a)bbb(?P>a)d/BM -Memory allocation (code space): 77 +Memory allocation (code space): 93 ------------------------------------------------------------------ 0 24 Bra 2 5 CBra 1 @@ -765,4 +765,7 @@ Memory allocation (code space): 14 25 End ------------------------------------------------------------------ +/([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00](*ACCEPT)/ +Failed: regular expression is too complicated at offset 490 + /-- End of testinput11 --/ diff --git a/pcre/testdata/testoutput11-32 b/pcre/testdata/testoutput11-32 index 57e5da02795..e19518db594 100644 --- a/pcre/testdata/testoutput11-32 +++ b/pcre/testdata/testoutput11-32 @@ -231,7 +231,7 @@ Memory allocation (code space): 155 ------------------------------------------------------------------ /(?Pa)...(?P=a)bbb(?P>a)d/BM -Memory allocation (code space): 157 +Memory allocation (code space): 189 ------------------------------------------------------------------ 0 24 Bra 2 5 CBra 1 @@ -765,4 +765,7 @@ Memory allocation (code space): 28 25 End ------------------------------------------------------------------ +/([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00](*ACCEPT)/ +Failed: missing ) at offset 509 + /-- End of testinput11 --/ diff --git a/pcre/testdata/testoutput11-8 b/pcre/testdata/testoutput11-8 index 748548a5abb..5a4fbb23663 100644 --- a/pcre/testdata/testoutput11-8 +++ b/pcre/testdata/testoutput11-8 @@ -231,7 +231,7 @@ Memory allocation (code space): 45 ------------------------------------------------------------------ /(?Pa)...(?P=a)bbb(?P>a)d/BM -Memory allocation (code space): 50 +Memory allocation (code space): 62 ------------------------------------------------------------------ 0 30 Bra 3 7 CBra 1 @@ -765,4 +765,7 @@ Memory allocation (code space): 10 38 End ------------------------------------------------------------------ +/([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00](*ACCEPT)/ +Failed: missing ) at offset 509 + /-- End of testinput11 --/ diff --git a/pcre/testdata/testoutput2 b/pcre/testdata/testoutput2 index 85c565d1326..5e88d1a7091 100644 --- a/pcre/testdata/testoutput2 +++ b/pcre/testdata/testoutput2 @@ -419,7 +419,7 @@ Need char = '>' /(?U)<.*>/I Capturing subpattern count = 0 -Options: ungreedy +No options First char = '<' Need char = '>' abcghinop @@ -443,7 +443,7 @@ Need char = '=' /(?U)={3,}?/I Capturing subpattern count = 0 -Options: ungreedy +No options First char = '=' Need char = '=' abc========def @@ -477,7 +477,7 @@ Failed: lookbehind assertion is not fixed length at offset 12 /(?i)abc/I Capturing subpattern count = 0 -Options: caseless +No options First char = 'a' (caseless) Need char = 'c' (caseless) @@ -489,7 +489,7 @@ No need char /(?i)^1234/I Capturing subpattern count = 0 -Options: anchored caseless +Options: anchored No first char No need char @@ -502,7 +502,7 @@ No need char /(?s).*/I Capturing subpattern count = 0 May match empty string -Options: anchored dotall +Options: anchored No first char No need char @@ -516,7 +516,7 @@ Starting chars: a b c d /(?i)[abcd]/IS Capturing subpattern count = 0 -Options: caseless +No options No first char No need char Subject length lower bound = 1 @@ -524,7 +524,7 @@ Starting chars: A B C D a b c d /(?m)[xy]|(b|c)/IS Capturing subpattern count = 1 -Options: multiline +No options No first char No need char Subject length lower bound = 1 @@ -538,7 +538,7 @@ No need char /(?i)(^a|^b)/Im Capturing subpattern count = 1 -Options: caseless multiline +Options: multiline First char at start or follows newline No need char @@ -555,13 +555,13 @@ Failed: malformed number or name after (?( at offset 4 Failed: malformed number or name after (?( at offset 4 /(?(?i))/ -Failed: assertion expected after (?( at offset 3 +Failed: assertion expected after (?( or (?(?C) at offset 3 /(?(abc))/ Failed: reference to non-existent subpattern at offset 7 /(?(?.*!.*)?)" -Failed: assertion expected after (?( at offset 3 +Failed: assertion expected after (?( or (?(?C) at offset 3 "X((?2)()*+){2}+"BZ ------------------------------------------------------------------ @@ -14574,4 +14574,100 @@ No match End ------------------------------------------------------------------ +/L(?#(|++)(?J:(?)(?))(?)/ + \O\CC +Matched, but too many substrings +copy substring C failed -7 + +/(?=a\K)/ + ring bpattingbobnd $ 1,oern cou \rb\L +Start of matched string is beyond its end - displaying from end to start. + 0: a + 0L + +/(?<=((?C)0))/ + 9010 +--->9010 + 0 ^ 0 + 0 ^ 0 + 0: + 1: 0 + abcd +--->abcd + 0 ^ 0 + 0 ^ 0 + 0 ^ 0 + 0 ^ 0 +No match + +/((?J)(?'R'(?'R'(?'R'(?'R'(?'R'(?|(\k'R'))))))))/ + +/\N(?(?C)0?!.)*/ +Failed: assertion expected after (?( or (?(?C) at offset 4 + /-- End of testinput2 --/ diff --git a/pcre/testdata/testoutput6 b/pcre/testdata/testoutput6 index beb85aaa0b6..b64dc0dc366 100644 --- a/pcre/testdata/testoutput6 +++ b/pcre/testdata/testoutput6 @@ -2557,4 +2557,20 @@ No match \x{37e} 0: \x{37e} +/[^[:^ascii:]\d]/8W + a + 0: a + ~ + 0: ~ + 0 +No match + \a + 0: \x{07} + \x{7f} + 0: \x{7f} + \x{389} +No match + \x{20ac} +No match + /-- End of testinput6 --/ diff --git a/pcre/testdata/testoutput7 b/pcre/testdata/testoutput7 index cc9ebdd5588..fdfff646d3e 100644 --- a/pcre/testdata/testoutput7 +++ b/pcre/testdata/testoutput7 @@ -2348,4 +2348,24 @@ No match End ------------------------------------------------------------------ +/L(?#(|++gr_gid; } - for (; user_groups < user_groups + ng; user_groups++) + for (; user_groups < groups_end; user_groups++) { if (*user_groups == group_id) return 1; @@ -146,7 +147,7 @@ int pam_sm_authenticate(pam_handle_t *pamh, int flags, goto ret; } } - pam_err= PAM_SUCCESS; + pam_err= PAM_AUTH_ERR; goto ret; syntax_error: diff --git a/plugin/aws_key_management/CMakeLists.txt b/plugin/aws_key_management/CMakeLists.txt index 97bcfbb04db..e414b9e6ad8 100644 --- a/plugin/aws_key_management/CMakeLists.txt +++ b/plugin/aws_key_management/CMakeLists.txt @@ -10,7 +10,7 @@ # Give message why the building this plugin is skipped (only if -DVERBOSE is defined) -# or if plugin is explicitely requested to build. Then bail out. +# or if plugin is explicitly requested to build. Then bail out. MACRO(SKIP_AWS_PLUGIN msg) IF(VERBOSE OR "${PLUGIN_AWS_KEY_MANAGEMENT}" MATCHES "^(STATIC|DYNAMIC)$") MESSAGE(STATUS "Skip aws_key_management - ${msg}") diff --git a/plugin/feedback/sender_thread.cc b/plugin/feedback/sender_thread.cc index f7b9f440fcd..16cdfe5574a 100644 --- a/plugin/feedback/sender_thread.cc +++ b/plugin/feedback/sender_thread.cc @@ -89,9 +89,8 @@ static int prepare_for_fill(TABLE_LIST *tables) (every increment of global thread_id counts as a new connection in SHOW STATUS and we want to avoid skewing the statistics) */ - thd->thread_id= thd->variables.pseudo_thread_id= thd_thread_id; + thd->variables.pseudo_thread_id= thd->thread_id; mysql_mutex_lock(&LOCK_thread_count); - thread_count++; threads.append(thd); mysql_mutex_unlock(&LOCK_thread_count); thd->thread_stack= (char*) &tables; @@ -205,10 +204,10 @@ static void send_report(const char *when) /* otherwise, prepare the THD and TABLE_LIST, create and fill the temporary table with data just like - SELECT * FROM IFROEMATION_SCHEMA.feedback is doing, + SELECT * FROM INFORMATION_SCHEMA.feedback is doing, read and concatenate table data into a String. */ - if (!(thd= new THD())) + if (!(thd= new THD(thd_thread_id))) return; if (prepare_for_fill(&tables)) @@ -263,7 +262,6 @@ ret: */ mysql_mutex_lock(&LOCK_thread_count); thd->set_status_var_init(); - thread_count--; thd->killed= KILL_CONNECTION; thd->unlink(); mysql_cond_broadcast(&COND_thread_count); diff --git a/plugin/feedback/url_http.cc b/plugin/feedback/url_http.cc index d04ff6fa9d5..cec3f60505c 100644 --- a/plugin/feedback/url_http.cc +++ b/plugin/feedback/url_http.cc @@ -190,6 +190,7 @@ int Url_http::send(const char* data, size_t data_length) break; closesocket(fd); + fd= INVALID_SOCKET; } freeaddrinfo(addrs); diff --git a/plugin/handler_socket/client/hslongrun.cpp b/plugin/handler_socket/client/hslongrun.cpp index e82c12b166b..b7c02951340 100644 --- a/plugin/handler_socket/client/hslongrun.cpp +++ b/plugin/handler_socket/client/hslongrun.cpp @@ -39,7 +39,7 @@ struct auto_mysql : private noncopyable { mysql_close(db); } if ((db = mysql_init(0)) == 0) { - fatal_exit("failed to initialize mysql client"); + fatal_abort("failed to initialize mysql client"); } } operator MYSQL *() const { return db; } @@ -870,7 +870,7 @@ mysql_do(MYSQL *db, const char *query) { if (mysql_real_query(db, query, strlen(query)) != 0) { fprintf(stderr, "mysql: e=[%s] q=[%s]\n", mysql_error(db), query); - fatal_exit("mysql_do"); + fatal_abort("mysql_do"); } } @@ -886,7 +886,7 @@ hs_longrun_init_table(const config& conf, int num_prepare, if (!mysql_real_connect(db, mysql_host.c_str(), mysql_user.c_str(), mysql_passwd.c_str(), mysql_dbname.c_str(), mysql_port, 0, 0)) { fprintf(stderr, "mysql: error=[%s]\n", mysql_error(db)); - fatal_exit("hs_longrun_init_table"); + fatal_abort("hs_longrun_init_table"); } mysql_do(db, "drop database if exists hstestdb"); mysql_do(db, "create database hstestdb"); diff --git a/plugin/handler_socket/handlersocket/database.cpp b/plugin/handler_socket/handlersocket/database.cpp index 94eedbf6d04..4292b826753 100644 --- a/plugin/handler_socket/handlersocket/database.cpp +++ b/plugin/handler_socket/handlersocket/database.cpp @@ -278,7 +278,7 @@ dbcontext::init_thread(const void *stack_bottom, volatile int& shutdown_flag) DBG_THR(fprintf(stderr, "HNDSOCK init thread\n")); { my_thread_init(); - thd = new THD; + thd = new THD(0); thd->thread_stack = (char *)stack_bottom; DBG_THR(fprintf(stderr, "thread_stack = %p sizeof(THD)=%zu sizeof(mtx)=%zu " @@ -310,7 +310,6 @@ dbcontext::init_thread(const void *stack_bottom, volatile int& shutdown_flag) } { thd->thread_id = next_thread_id(); - thread_safe_increment32(&thread_count); add_to_active_threads(thd); } @@ -348,7 +347,6 @@ dbcontext::term_thread() pthread_mutex_lock(&LOCK_thread_count); delete thd; thd = 0; - --thread_count; pthread_mutex_unlock(&LOCK_thread_count); my_thread_end(); } diff --git a/plugin/handler_socket/libhsclient/fatal.cpp b/plugin/handler_socket/libhsclient/fatal.cpp index 5cdd8879ab1..8e109cf13ba 100644 --- a/plugin/handler_socket/libhsclient/fatal.cpp +++ b/plugin/handler_socket/libhsclient/fatal.cpp @@ -17,14 +17,6 @@ namespace dena { const int opt_syslog = LOG_ERR | LOG_PID | LOG_CONS; -void -fatal_exit(const std::string& message) -{ - fprintf(stderr, "FATAL_EXIT: %s\n", message.c_str()); - syslog(opt_syslog, "FATAL_EXIT: %s", message.c_str()); - _exit(1); -} - void fatal_abort(const std::string& message) { diff --git a/plugin/handler_socket/libhsclient/fatal.hpp b/plugin/handler_socket/libhsclient/fatal.hpp index 8a630fab1cb..5eaa3db8687 100644 --- a/plugin/handler_socket/libhsclient/fatal.hpp +++ b/plugin/handler_socket/libhsclient/fatal.hpp @@ -13,7 +13,6 @@ namespace dena { -void fatal_exit(const std::string& message); void fatal_abort(const std::string& message); }; diff --git a/plugin/handler_socket/libhsclient/socket.cpp b/plugin/handler_socket/libhsclient/socket.cpp index cf19d4bbe14..2c93a3b4846 100644 --- a/plugin/handler_socket/libhsclient/socket.cpp +++ b/plugin/handler_socket/libhsclient/socket.cpp @@ -43,7 +43,7 @@ socket_args::set(const config& conf) } else { const char *nd = node.empty() ? 0 : node.c_str(); if (resolve(nd, port.c_str()) != 0) { - fatal_exit("getaddrinfo failed: " + node + ":" + port); + fatal_abort("getaddrinfo failed: " + node + ":" + port); } } } diff --git a/plugin/metadata_lock_info/metadata_lock_info.cc b/plugin/metadata_lock_info/metadata_lock_info.cc index 83db2c7ca5c..6a9f6ef3f6c 100644 --- a/plugin/metadata_lock_info/metadata_lock_info.cc +++ b/plugin/metadata_lock_info/metadata_lock_info.cc @@ -81,25 +81,17 @@ int i_s_metadata_lock_info_fill_row( THD *thd = param->thd; TABLE *table = param->table; DBUG_ENTER("i_s_metadata_lock_info_fill_row"); - MDL_request mdl_request; - enum_mdl_duration mdl_duration; MDL_context *mdl_ctx = mdl_ticket->get_ctx(); enum_mdl_type mdl_ticket_type = mdl_ticket->get_type(); MDL_key *mdl_key = mdl_ticket->get_key(); MDL_key::enum_mdl_namespace mdl_namespace = mdl_key->mdl_namespace(); - mdl_request.init(mdl_key, mdl_ticket_type, MDL_STATEMENT); - mdl_ctx->find_ticket(&mdl_request, &mdl_duration); table->field[0]->store((longlong) mdl_ctx->get_thread_id(), TRUE); table->field[1]->set_notnull(); table->field[1]->store( metadata_lock_info_lock_mode[(int) mdl_ticket_type].str, metadata_lock_info_lock_mode[(int) mdl_ticket_type].length, system_charset_info); - table->field[2]->set_notnull(); - table->field[2]->store( - metadata_lock_info_duration[(int) mdl_duration].str, - metadata_lock_info_duration[(int) mdl_duration].length, - system_charset_info); + table->field[2]->set_null(); table->field[3]->set_notnull(); table->field[3]->store( metadata_lock_info_lock_name[(int) mdl_namespace].str, @@ -131,6 +123,14 @@ int i_s_metadata_lock_info_fill_table( static int i_s_metadata_lock_info_init( void *p ) { + + compile_time_assert(sizeof(metadata_lock_info_lock_name)/sizeof(LEX_STRING) + == MDL_key::NAMESPACE_END); + compile_time_assert(sizeof(metadata_lock_info_lock_mode)/sizeof(LEX_STRING) + == MDL_TYPE_END); + compile_time_assert(sizeof(metadata_lock_info_duration)/sizeof(LEX_STRING) + == MDL_DURATION_END); + ST_SCHEMA_TABLE *schema = (ST_SCHEMA_TABLE *) p; DBUG_ENTER("i_s_metadata_lock_info_init"); schema->fields_info = i_s_metadata_lock_info_fields_info; diff --git a/plugin/metadata_lock_info/mysql-test/metadata_lock_info/r/global_read_lock.result b/plugin/metadata_lock_info/mysql-test/metadata_lock_info/r/global_read_lock.result index 9840aeecf97..5803d7d1290 100644 --- a/plugin/metadata_lock_info/mysql-test/metadata_lock_info/r/global_read_lock.result +++ b/plugin/metadata_lock_info/mysql-test/metadata_lock_info/r/global_read_lock.result @@ -3,8 +3,8 @@ lock_mode lock_duration lock_type table_schema table_name FLUSH TABLES WITH READ LOCK; SELECT lock_mode, lock_duration, lock_type, table_schema, table_name FROM information_schema.metadata_lock_info; lock_mode lock_duration lock_type table_schema table_name -MDL_SHARED MDL_EXPLICIT Global read lock -MDL_SHARED MDL_EXPLICIT Commit lock +MDL_SHARED NULL Commit lock +MDL_SHARED NULL Global read lock UNLOCK TABLES; SELECT lock_mode, lock_duration, lock_type, table_schema, table_name FROM information_schema.metadata_lock_info; lock_mode lock_duration lock_type table_schema table_name diff --git a/plugin/metadata_lock_info/mysql-test/metadata_lock_info/r/table_metadata_lock.result b/plugin/metadata_lock_info/mysql-test/metadata_lock_info/r/table_metadata_lock.result index 280c8284c54..1b76b9e8222 100644 --- a/plugin/metadata_lock_info/mysql-test/metadata_lock_info/r/table_metadata_lock.result +++ b/plugin/metadata_lock_info/mysql-test/metadata_lock_info/r/table_metadata_lock.result @@ -6,7 +6,7 @@ SELECT * FROM t1; a SELECT lock_mode, lock_duration, lock_type, table_schema, table_name FROM information_schema.metadata_lock_info; lock_mode lock_duration lock_type table_schema table_name -MDL_SHARED_READ MDL_TRANSACTION Table metadata lock test t1 +MDL_SHARED_READ NULL Table metadata lock test t1 ROLLBACK; SELECT lock_mode, lock_duration, lock_type, table_schema, table_name FROM information_schema.metadata_lock_info; lock_mode lock_duration lock_type table_schema table_name diff --git a/plugin/metadata_lock_info/mysql-test/metadata_lock_info/r/user_lock.result b/plugin/metadata_lock_info/mysql-test/metadata_lock_info/r/user_lock.result index e1d690b566c..34d238cb43b 100644 --- a/plugin/metadata_lock_info/mysql-test/metadata_lock_info/r/user_lock.result +++ b/plugin/metadata_lock_info/mysql-test/metadata_lock_info/r/user_lock.result @@ -5,7 +5,7 @@ GET_LOCK('LOCK1',0) 1 SELECT lock_mode, lock_duration, lock_type, table_schema, table_name FROM information_schema.metadata_lock_info; lock_mode lock_duration lock_type table_schema table_name -MDL_SHARED_NO_WRITE MDL_EXPLICIT User lock LOCK1 +MDL_SHARED_NO_WRITE NULL User lock LOCK1 SELECT RELEASE_LOCK('LOCK1'); RELEASE_LOCK('LOCK1') 1 diff --git a/plugin/metadata_lock_info/mysql-test/metadata_lock_info/t/global_read_lock.test b/plugin/metadata_lock_info/mysql-test/metadata_lock_info/t/global_read_lock.test index f221191255e..103050e3fb8 100644 --- a/plugin/metadata_lock_info/mysql-test/metadata_lock_info/t/global_read_lock.test +++ b/plugin/metadata_lock_info/mysql-test/metadata_lock_info/t/global_read_lock.test @@ -1,5 +1,6 @@ SELECT lock_mode, lock_duration, lock_type, table_schema, table_name FROM information_schema.metadata_lock_info; FLUSH TABLES WITH READ LOCK; +--sorted_result SELECT lock_mode, lock_duration, lock_type, table_schema, table_name FROM information_schema.metadata_lock_info; UNLOCK TABLES; SELECT lock_mode, lock_duration, lock_type, table_schema, table_name FROM information_schema.metadata_lock_info; diff --git a/plugin/query_response_time/mysql-test/query_response_time/basic.result b/plugin/query_response_time/mysql-test/query_response_time/basic.result index 86fba87e056..673201266ec 100644 --- a/plugin/query_response_time/mysql-test/query_response_time/basic.result +++ b/plugin/query_response_time/mysql-test/query_response_time/basic.result @@ -7,7 +7,7 @@ SHOW CREATE TABLE INFORMATION_SCHEMA.QUERY_RESPONSE_TIME; Table Create Table QUERY_RESPONSE_TIME CREATE TEMPORARY TABLE `QUERY_RESPONSE_TIME` ( `TIME` varchar(14) NOT NULL DEFAULT '', - `COUNT` int(11) unsigned NOT NULL DEFAULT '0', + `COUNT` int(11) unsigned NOT NULL DEFAULT 0, `TOTAL` varchar(14) NOT NULL DEFAULT '' ) ENGINE=MEMORY DEFAULT CHARSET=utf8 SELECT PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_TYPE, PLUGIN_AUTHOR, PLUGIN_DESCRIPTION, PLUGIN_LICENSE, PLUGIN_MATURITY FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME LIKE 'query_response_time%';; diff --git a/plugin/user_variables/user_variables.cc b/plugin/user_variables/user_variables.cc index c6c48d09303..981c39cdb86 100644 --- a/plugin/user_variables/user_variables.cc +++ b/plugin/user_variables/user_variables.cc @@ -21,23 +21,23 @@ static const LEX_CSTRING result_types[]= { - STRING_WITH_LEN("VARCHAR"), - STRING_WITH_LEN("DOUBLE"), - STRING_WITH_LEN("INT"), - STRING_WITH_LEN(""), // ROW_RESULT - STRING_WITH_LEN("DECIMAL"), - STRING_WITH_LEN("") // TIME_RESULT + { STRING_WITH_LEN("VARCHAR") }, + { STRING_WITH_LEN("DOUBLE") }, + { STRING_WITH_LEN("INT") }, + { STRING_WITH_LEN("") }, // ROW_RESULT + { STRING_WITH_LEN("DECIMAL") }, + { STRING_WITH_LEN("")} // TIME_RESULT }; static const LEX_CSTRING unsigned_result_types[]= { - STRING_WITH_LEN(""), // UNSIGNED STRING_RESULT - STRING_WITH_LEN("DOUBLE UNSIGNED"), - STRING_WITH_LEN("INT UNSIGNED"), - STRING_WITH_LEN(""), // UNSIGNED ROW_RESULT - STRING_WITH_LEN("DECIMAL UNSIGNED"), - STRING_WITH_LEN("") // UNSIGNED TIME_RESULT + { STRING_WITH_LEN("") }, // UNSIGNED STRING_RESULT + { STRING_WITH_LEN("DOUBLE UNSIGNED") }, + { STRING_WITH_LEN("INT UNSIGNED") }, + { STRING_WITH_LEN("") }, // UNSIGNED ROW_RESULT + { STRING_WITH_LEN("DECIMAL UNSIGNED") }, + { STRING_WITH_LEN("") } // UNSIGNED TIME_RESULT }; diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index eeb44b75322..dd642487ede 100644 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -79,6 +79,7 @@ INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/mysql_performance_tables.sql ${CMAKE_CURRENT_SOURCE_DIR}/fill_help_tables.sql ${CMAKE_CURRENT_SOURCE_DIR}/mysql_test_data_timezone.sql + ${CMAKE_CURRENT_SOURCE_DIR}/mysql_to_mariadb.sql ${FIX_PRIVILEGES_SQL} DESTINATION ${INSTALL_MYSQLSHAREDIR} COMPONENT Server ) diff --git a/scripts/galera_recovery.sh b/scripts/galera_recovery.sh new file mode 100644 index 00000000000..0e5a42b1676 --- /dev/null +++ b/scripts/galera_recovery.sh @@ -0,0 +1,118 @@ +#!/bin/sh + +# Copyright (c) 2016 MariaDB Corporation +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ + + +# This script is intended to be executed by systemd. It starts mysqld with +# --wsrep-recover to recover from a non-graceful shutdown, determines the +# last stored global transaction ID and echoes it in --wsrep-start-position=XX +# format. The output is then captured and used by systemd to start mysqld. +# If the server was configured to start without wsrep, nothing is echoed. + +cmdline_args=$@ +user="@MYSQLD_USER@" +print_defaults="@bindir@/my_print_defaults" +log_file=$(mktemp /tmp/wsrep_recovery.XXXXXX) +euid=$(id -u) +recovered_pos="" +skipped="" +start_pos="" +start_pos_opt="" +ret=0 +wsrep_on=0 + +log () +{ + local msg="$1" + # Print all messages to stderr as we reserve stdout for printing + # --wsrep-start-position=XXXX. + echo "$msg" >&2 +} + +finish() +{ + rm -f "$log_file" +} + +trap finish EXIT + +parse_arguments() { + for arg do + val=`echo "$arg" | sed -e "s;--[^=]*=;;"` + case "$arg" in + --wsrep[-_]on) wsrep_on=1 ;; + --skip[-_]wsrep[-_]on) wsrep_on=0 ;; + --wsrep[-_]on=*) + if echo $val | grep -iq '\(ON\|1\)'; then + wsrep_on=1 + else + wsrep_on=0 + fi + ;; + esac + done +} + +wsrep_recover_position() { + # Redirect server's error log to the log file. + eval /usr/sbin/mysqld $cmdline_args --user=$user --wsrep_recover 2> "$log_file" + ret=$? + if [ $ret -ne 0 ]; then + # Something went wrong, let us also print the error log so that it + # shows up in systemctl status output as a hint to the user. + log "WSREP: Failed to start mysqld for wsrep recovery: '`cat $log_file`'" + exit 1 + fi + + # Parse server's error log for recovered position. The server prints + # "..skipping position recovery.." if started without wsrep. + + recovered_pos="$(grep 'WSREP: Recovered position:' $log_file)" + + if [ -z "$recovered_pos" ]; then + skipped="$(grep WSREP $log_file | grep 'skipping position recovery')" + if [ -z "$skipped" ]; then + log "WSREP: Failed to recover position: '`cat $log_file`'" + exit 1 + else + log "WSREP: Position recovery skipped." + fi + else + start_pos="$(echo $recovered_pos | sed 's/.*WSREP\:\ Recovered\ position://' \ + | sed 's/^[ \t]*//')" + log "WSREP: Recovered position $start_pos" + start_pos_opt="--wsrep_start_position=$start_pos" + fi +} + +# Safety checks +if [ -n "$log_file" -a -f "$log_file" ]; then + [ "$euid" = "0" ] && chown $user $log_file + chmod 600 $log_file +else + log "WSREP: mktemp failed" +fi + +parse_arguments `$print_defaults $cmdline_args --loose-verbose \ + mariadb mariadb_safe mysqld mysqld_safe safe_mysqld galera` + +# Perform wsrep position recovery if wsrep_on=1, skip otherwise. +if [ "$wsrep_on" -eq 1 ]; then + wsrep_recover_position +fi + +echo "$start_pos_opt" + diff --git a/scripts/maria_add_gis_sp.sql.in b/scripts/maria_add_gis_sp.sql.in index 1e2e513cd0a..3a5dd49b95b 100644 --- a/scripts/maria_add_gis_sp.sql.in +++ b/scripts/maria_add_gis_sp.sql.in @@ -23,12 +23,12 @@ SET sql_mode=''; DROP PROCEDURE IF EXISTS AddGeometryColumn; DROP PROCEDURE IF EXISTS DropGeometryColumn; -CREATE PROCEDURE AddGeometryColumn(catalog varchar(64), t_schema varchar(64), +CREATE DEFINER=`root`@`localhost` PROCEDURE AddGeometryColumn(catalog varchar(64), t_schema varchar(64), t_name varchar(64), geometry_column varchar(64), t_srid int) begin set @qwe= concat('ALTER TABLE ', t_schema, '.', t_name, ' ADD ', geometry_column,' GEOMETRY REF_SYSTEM_ID=', t_srid); PREPARE ls from @qwe; execute ls; deallocate prepare ls; end @ADD_GIS_SP_EOL@ -CREATE PROCEDURE DropGeometryColumn(catalog varchar(64), t_schema varchar(64), +CREATE DEFINER=`root`@`localhost` PROCEDURE DropGeometryColumn(catalog varchar(64), t_schema varchar(64), t_name varchar(64), geometry_column varchar(64)) begin set @qwe= concat('ALTER TABLE ', t_schema, '.', t_name, ' DROP ', geometry_column); PREPARE ls from @qwe; execute ls; deallocate prepare ls; end @ADD_GIS_SP_EOL@ diff --git a/scripts/mysql_install_db.pl.in b/scripts/mysql_install_db.pl.in index d1c4aaa1906..d1b299d9ef5 100644 --- a/scripts/mysql_install_db.pl.in +++ b/scripts/mysql_install_db.pl.in @@ -238,7 +238,7 @@ sub quote_options { ############################################################################## my $opt = {}; -parse_arguments($opt, 'PICK-ARGS-FROM-ARGV', @ARGV); +parse_arguments($opt, @ARGV); # ---------------------------------------------------------------------- # We can now find my_print_defaults. This script supports: diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 773b5ee99a9..e5502301d9c 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -217,7 +217,7 @@ cannot_find_file() # Ok, let's go. We first need to parse arguments which are required by # my_print_defaults so that we can execute it first, then later re-parse # the command line to add any extra bits that we need. -parse_arguments PICK-ARGS-FROM-ARGV "$@" +parse_arguments "$@" # # We can now find my_print_defaults. This script supports: diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql index d9d01707b30..7b614163f46 100644 --- a/scripts/mysql_system_tables.sql +++ b/scripts/mysql_system_tables.sql @@ -229,7 +229,7 @@ SET @cmd= "CREATE TABLE IF NOT EXISTS gtid_slave_pos ( sub_id BIGINT UNSIGNED NOT NULL, server_id INT UNSIGNED NOT NULL, seq_no BIGINT UNSIGNED NOT NULL, - PRIMARY KEY (domain_id, sub_id)) + PRIMARY KEY (domain_id, sub_id)) CHARSET=latin1 COMMENT='Replication slave GTID position'"; SET @str=CONCAT(@cmd, ' ENGINE=', @innodb_or_myisam); PREPARE stmt FROM @str; diff --git a/scripts/mysql_to_mariadb.sql b/scripts/mysql_to_mariadb.sql new file mode 100644 index 00000000000..4ee3f3a4214 --- /dev/null +++ b/scripts/mysql_to_mariadb.sql @@ -0,0 +1,22 @@ +-- Script that changes MySQL 5.7 privilege tables to MariaDB 10.x +-- This should be run first with +-- mysql --force mysql < mysql_to_mariadb.sql +-- It's ok to ignore any errors, as these usually means that the tables are +-- already fixed. + +-- After this script s run, one should run at least: +-- mysql_upgrade --upgrade-system-tables +-- to get the other tables in the mysql database fixed. + +-- Drop not existing columnms +alter table mysql.user drop column `password_last_changed`, drop column `password_lifetime`, drop column `account_locked`; + +-- Change existing columns +alter table mysql.user change column `authentication_string` `auth_string` text COLLATE utf8_bin NOT NULL; + +-- Add new columns +alter table mysql.user add column `Password` char(41) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '' after `user`, add column `is_role` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N' after `auth_string`; +alter table mysql.user add column `default_role` char(80) COLLATE utf8_bin NOT NULL DEFAULT '', add column `max_statement_time` decimal(12,6) NOT NULL DEFAULT '0.000000'; + +-- Fix passwords +update mysql.user set `password`=`auth_string`, plugin='' where plugin="mysql_native_password"; diff --git a/scripts/mysqlaccess.sh b/scripts/mysqlaccess.sh index a7cc2eccf38..59d1bded245 100644 --- a/scripts/mysqlaccess.sh +++ b/scripts/mysqlaccess.sh @@ -262,7 +262,7 @@ Release Notes: * default values are read from a configuration file $script.conf first this file is looked for in the current directory; if not found it is looked for in @sysconfdir@ - Note that when default-values are given, these can't get overriden + Note that when default-values are given, these can't get overridden by empty (blanc) values! * CGI-BIN version with HTML and forms interface. Simply place the script in an ScriptAliased directory, make the configuration file diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh index ca259e5396d..a0bc06e5e58 100644 --- a/scripts/mysqld_multi.sh +++ b/scripts/mysqld_multi.sh @@ -17,7 +17,7 @@ # Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, # MA 02110-1301, USA -# Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public @@ -54,6 +54,7 @@ $opt_user = "root"; $opt_version = 0; $opt_silent = 0; $opt_verbose = 0; +$opt_wsrep_new_cluster = 0; my $my_print_defaults_exists= 1; my $logdir= undef(); @@ -126,7 +127,7 @@ sub main # We've already handled --no-defaults, --defaults-file, etc. if (!GetOptions("help", "example", "version", "mysqld=s", "mysqladmin=s", "user=s", "password=s", "log=s", "no-log", - "tcp-ip", "silent", "verbose")) + "tcp-ip", "silent", "verbose", "wsrep-new-cluster")) { $flag_exit= 1; } @@ -378,6 +379,11 @@ sub start_mysqlds() $info_sent= 1; } $com.= $tmp; + + if ($opt_wsrep_new_cluster) { + $com.= " --wsrep-new-cluster"; + } + $com.= " >> $opt_log 2>&1" if (!$opt_no_log); $com.= " &"; if (!$mysqld_found) @@ -625,7 +631,11 @@ sub my_which my ($command) = @_; my (@paths, $path); - return $command if (-f $command && -x $command); + # If the argument is not 'my_print_defaults' then it would be of the format + # / + return $command if ($command ne 'my_print_defaults' && -f $command && + -x $command); + @paths = split(':', $ENV{'PATH'}); foreach $path (@paths) { @@ -848,6 +858,7 @@ Using: @{[join ' ', @defaults_options]} --user=... mysqladmin user. Using: $opt_user --verbose Be more verbose. --version Print the version number and exit. +--wsrep-new-cluster Bootstrap a cluster. EOF exit(0); } diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 13206ce0e56..07bca1c0318 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -332,14 +332,21 @@ parse_arguments() { --timezone=*) TZ="$val"; export TZ; ;; --flush[-_]caches) flush_caches=1 ;; --numa[-_]interleave) numa_interleave=1 ;; - --wsrep[-_]on) wsrep_on=1 ;; - --skip[-_]wsrep[-_]on) wsrep_on=0 ;; + --wsrep[-_]on) + wsrep_on=1 + append_arg_to_args "$arg" + ;; + --skip[-_]wsrep[-_]on) + wsrep_on=0 + append_arg_to_args "$arg" + ;; --wsrep[-_]on=*) if echo $val | grep -iq '\(ON\|1\)'; then wsrep_on=1 else wsrep_on=0 fi + append_arg_to_args "$arg" ;; --wsrep[-_]urls=*) wsrep_urls="$val"; ;; --wsrep[-_]provider=*) diff --git a/scripts/wsrep_sst_xtrabackup-v2.sh b/scripts/wsrep_sst_xtrabackup-v2.sh index 4cd21d3c216..a836d5e0edd 100644 --- a/scripts/wsrep_sst_xtrabackup-v2.sh +++ b/scripts/wsrep_sst_xtrabackup-v2.sh @@ -34,6 +34,7 @@ ssystag="" XTRABACKUP_PID="" SST_PORT="" REMOTEIP="" +REMOTEHOST="" tcert="" tpem="" tkey="" @@ -208,7 +209,7 @@ get_transfer() tcmd="socat -u openssl-listen:${TSST_PORT},reuseaddr,cert=${tpem},cafile=${tcert}${sockopt} stdio" else wsrep_log_info "Encrypting with cert=${tpem}, cafile=${tcert}" - tcmd="socat -u stdio openssl-connect:${REMOTEIP}:${TSST_PORT},cert=${tpem},cafile=${tcert}${sockopt}" + tcmd="socat -u stdio openssl-connect:${REMOTEHOST}:${TSST_PORT},cert=${tpem},cafile=${tcert}${sockopt}" fi elif [[ $encrypt -eq 3 ]];then wsrep_log_info "Using openssl based encryption with socat: with key and crt" @@ -231,7 +232,7 @@ get_transfer() tcmd="socat -u stdio openssl-connect:${REMOTEIP}:${TSST_PORT},cert=${tpem},key=${tkey},verify=0${sockopt}" else wsrep_log_info "Encrypting with cert=${tpem}, key=${tkey}, cafile=${tcert}" - tcmd="socat -u stdio openssl-connect:${REMOTEIP}:${TSST_PORT},cert=${tpem},key=${tkey},cafile=${tcert}${sockopt}" + tcmd="socat -u stdio openssl-connect:${REMOTEHOST}:${TSST_PORT},cert=${tpem},key=${tkey},cafile=${tcert}${sockopt}" fi fi @@ -495,6 +496,10 @@ setup_ports() if [[ "$WSREP_SST_OPT_ROLE" == "donor" ]];then SST_PORT=$(echo $WSREP_SST_OPT_ADDR | awk -F '[:/]' '{ print $2 }') REMOTEIP=$(echo $WSREP_SST_OPT_ADDR | awk -F ':' '{ print $1 }') + REMOTEHOST=$(getent hosts $REMOTEIP | awk '{ print $2 }') + if [[ -z $REMOTEHOST ]];then + REMOTEHOST=$REMOTEIP + fi lsn=$(echo $WSREP_SST_OPT_ADDR | awk -F '[:/]' '{ print $4 }') sst_ver=$(echo $WSREP_SST_OPT_ADDR | awk -F '[:/]' '{ print $5 }') else @@ -871,7 +876,8 @@ then then if [[ -d ${DATA}/.sst ]];then - wsrep_log_info "WARNING: Stale temporary SST directory: ${DATA}/.sst from previous state transfer" + wsrep_log_info "WARNING: Stale temporary SST directory: ${DATA}/.sst from previous state transfer. Removing" + rm -rf ${DATA}/.sst fi mkdir -p ${DATA}/.sst (recv_joiner $DATA/.sst "${stagemsg}-SST" 0 0) & diff --git a/sql-common/client.c b/sql-common/client.c index b96231fcc13..fdb17a63ba5 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -1045,28 +1045,44 @@ static int add_init_command(struct st_mysql_options *options, const char *cmd) } while (0) -#define EXTENSION_SET_STRING(OPTS, X, STR) \ +#define EXTENSION_SET_STRING_X(OPTS, X, STR, dup) \ do { \ if ((OPTS)->extension) \ my_free((OPTS)->extension->X); \ else \ ALLOCATE_EXTENSIONS(OPTS); \ (OPTS)->extension->X= ((STR) != NULL) ? \ - my_strdup((STR), MYF(MY_WME)) : NULL; \ + dup((STR), MYF(MY_WME)) : NULL; \ } while (0) +#define EXTENSION_SET_STRING(OPTS, X, STR) \ + EXTENSION_SET_STRING_X(OPTS, X, STR, my_strdup) + #if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY) -#define SET_SSL_OPTION(OPTS, opt_var, arg) \ - my_free((OPTS)->opt_var); \ - (OPTS)->opt_var= arg ? my_strdup(arg, MYF(MY_WME)) : NULL; -#define EXTENSION_SET_SSL_STRING(OPTS, X, STR) \ - EXTENSION_SET_STRING((OPTS), X, (STR)); +#define SET_SSL_OPTION_X(OPTS, opt_var, arg, dup) \ + my_free((OPTS)->opt_var); \ + (OPTS)->opt_var= arg ? dup(arg, MYF(MY_WME)) : NULL; +#define EXTENSION_SET_SSL_STRING_X(OPTS, X, STR, dup) \ + EXTENSION_SET_STRING_X((OPTS), X, (STR), dup); + +static char *set_ssl_option_unpack_path(const char *arg, myf flags) +{ + char buff[FN_REFLEN + 1]; + unpack_filename(buff, (char *)arg); + return my_strdup(buff, flags); +} + #else -#define SET_SSL_OPTION(OPTS, opt_var,arg) do { } while(0) -#define EXTENSION_SET_SSL_STRING(OPTS, X, STR) do { } while(0) +#define SET_SSL_OPTION_X(OPTS, opt_var,arg, dup) do { } while(0) +#define EXTENSION_SET_SSL_STRING_X(OPTS, X, STR, dup) do { } while(0) #endif /* defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY) */ +#define SET_SSL_OPTION(OPTS, opt_var,arg) SET_SSL_OPTION_X(OPTS, opt_var, arg, my_strdup) +#define EXTENSION_SET_SSL_STRING(OPTS, X, STR) EXTENSION_SET_SSL_STRING_X(OPTS, X, STR, my_strdup) +#define SET_SSL_PATH_OPTION(OPTS, opt_var,arg) SET_SSL_OPTION_X(OPTS, opt_var, arg, set_ssl_option_unpack_path) +#define EXTENSION_SET_SSL_PATH_STRING(OPTS, X, STR) EXTENSION_SET_SSL_STRING_X(OPTS, X, STR, set_ssl_option_unpack_path) + void mysql_read_default_options(struct st_mysql_options *options, const char *filename,const char *group) { @@ -1626,10 +1642,10 @@ mysql_init(MYSQL *mysql) How this change impacts existing apps: - existing apps which relyed on the default will see a behaviour change; they will have to set reconnect=1 after mysql_real_connect(). - - existing apps which explicitely asked for reconnection (the only way they + - existing apps which explicitly asked for reconnection (the only way they could do it was by setting mysql.reconnect to 1 after mysql_real_connect()) will not see a behaviour change. - - existing apps which explicitely asked for no reconnection + - existing apps which explicitly asked for no reconnection (mysql.reconnect=0) will not see a behaviour change. */ mysql->reconnect= 0; @@ -4372,25 +4388,25 @@ mysql_options(MYSQL *mysql,enum mysql_option option, const void *arg) mysql->net.vio->async_context= ctxt; break; case MYSQL_OPT_SSL_KEY: - SET_SSL_OPTION(&mysql->options,ssl_key, arg); + SET_SSL_PATH_OPTION(&mysql->options,ssl_key, arg); break; case MYSQL_OPT_SSL_CERT: - SET_SSL_OPTION(&mysql->options, ssl_cert, arg); + SET_SSL_PATH_OPTION(&mysql->options, ssl_cert, arg); break; case MYSQL_OPT_SSL_CA: - SET_SSL_OPTION(&mysql->options,ssl_ca, arg); + SET_SSL_PATH_OPTION(&mysql->options,ssl_ca, arg); break; case MYSQL_OPT_SSL_CAPATH: - SET_SSL_OPTION(&mysql->options,ssl_capath, arg); + SET_SSL_PATH_OPTION(&mysql->options,ssl_capath, arg); break; case MYSQL_OPT_SSL_CIPHER: SET_SSL_OPTION(&mysql->options,ssl_cipher, arg); break; case MYSQL_OPT_SSL_CRL: - EXTENSION_SET_SSL_STRING(&mysql->options, ssl_crl, arg); + EXTENSION_SET_SSL_PATH_STRING(&mysql->options, ssl_crl, arg); break; case MYSQL_OPT_SSL_CRLPATH: - EXTENSION_SET_SSL_STRING(&mysql->options, ssl_crlpath, arg); + EXTENSION_SET_SSL_PATH_STRING(&mysql->options, ssl_crlpath, arg); break; case MYSQL_OPT_CONNECT_ATTR_RESET: ENSURE_EXTENSIONS_PRESENT(&mysql->options); diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt index 062e59bee5b..089d793b2b0 100644 --- a/sql/CMakeLists.txt +++ b/sql/CMakeLists.txt @@ -1,5 +1,5 @@ # Copyright (c) 2006, 2014, Oracle and/or its affiliates. -# Copyright (c) 2010, 2015, MariaDB +# Copyright (c) 2010, 2016, MariaDB Corporation # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -141,7 +141,7 @@ SET (SQL_SOURCE item_windowfunc.cc sql_window.cc sql_cte.cc sql_cte.h ${WSREP_SOURCES} - table_cache.cc encryption.cc + table_cache.cc encryption.cc temporary_tables.cc ${CMAKE_CURRENT_BINARY_DIR}/sql_builtin.cc ${GEN_SOURCES} ${GEN_DIGEST_SOURCES} diff --git a/sql/contributors.h b/sql/contributors.h index 04f8b74aa65..76674d654e5 100644 --- a/sql/contributors.h +++ b/sql/contributors.h @@ -46,7 +46,7 @@ struct show_table_contributors_st show_table_contributors[]= { /* Smaller sponsors, newer per year */ {"Verkkokauppa.com", "Finland", "Sponsor of the MariaDB Foundation"}, - {"Webyog", "Bangalore", "Sponsor of the MariaDB Foundation"}, + {"Virtuozzo", "https://virtuozzo.com/", "Sponsor of the MariaDB Foundation"}, /* Sponsors of important features */ {"Google", "USA", "Sponsoring encryption, parallel replication and GTID"}, diff --git a/sql/create_options.cc b/sql/create_options.cc index 3011c4b2d7e..40382c7887e 100644 --- a/sql/create_options.cc +++ b/sql/create_options.cc @@ -685,20 +685,25 @@ uchar *engine_table_options_frm_image(uchar *buff, @returns pointer to byte after last recorded in the buffer */ -uchar *engine_option_value::frm_read(const uchar *buff, engine_option_value **start, +uchar *engine_option_value::frm_read(const uchar *buff, const uchar *buff_end, + engine_option_value **start, engine_option_value **end, MEM_ROOT *root) { LEX_STRING name, value; uint len; +#define need_buff(N) if (buff + (N) >= buff_end) return NULL + need_buff(3); name.length= buff[0]; buff++; + need_buff(name.length + 2); if (!(name.str= strmake_root(root, (const char*)buff, name.length))) return NULL; buff+= name.length; len= uint2korr(buff); value.length= len & ~FRM_QUOTED_VALUE; buff+= 2; + need_buff(value.length); if (!(value.str= strmake_root(root, (const char*)buff, value.length))) return NULL; buff+= value.length; @@ -735,8 +740,8 @@ bool engine_table_options_frm_read(const uchar *buff, uint length, while (buff < buff_end && *buff) { - if (!(buff= engine_option_value::frm_read(buff, &share->option_list, &end, - root))) + if (!(buff= engine_option_value::frm_read(buff, buff_end, + &share->option_list, &end, root))) DBUG_RETURN(TRUE); } buff++; @@ -745,7 +750,7 @@ bool engine_table_options_frm_read(const uchar *buff, uint length, { while (buff < buff_end && *buff) { - if (!(buff= engine_option_value::frm_read(buff, + if (!(buff= engine_option_value::frm_read(buff, buff_end, &share->field[count]->option_list, &end, root))) DBUG_RETURN(TRUE); @@ -757,7 +762,7 @@ bool engine_table_options_frm_read(const uchar *buff, uint length, { while (buff < buff_end && *buff) { - if (!(buff= engine_option_value::frm_read(buff, + if (!(buff= engine_option_value::frm_read(buff, buff_end, &share->key_info[count].option_list, &end, root))) DBUG_RETURN(TRUE); diff --git a/sql/create_options.h b/sql/create_options.h index eb21f291ff4..3e7f9ecfabf 100644 --- a/sql/create_options.h +++ b/sql/create_options.h @@ -23,7 +23,8 @@ #define SQL_CREATE_OPTIONS_INCLUDED #include "sql_class.h" -//#include "handler.h" + +enum { ENGINE_OPTION_MAX_LENGTH=32767 }; class engine_option_value: public Sql_alloc { @@ -66,7 +67,8 @@ class engine_option_value: public Sql_alloc link(start, end); } } - static uchar *frm_read(const uchar *buff, engine_option_value **start, + static uchar *frm_read(const uchar *buff, const uchar *buff_end, + engine_option_value **start, engine_option_value **end, MEM_ROOT *root); void link(engine_option_value **start, engine_option_value **end); uint frm_length(); diff --git a/sql/debug_sync.h b/sql/debug_sync.h index 339a21139b1..999667b9efc 100644 --- a/sql/debug_sync.h +++ b/sql/debug_sync.h @@ -44,7 +44,6 @@ extern void debug_sync_end(void); extern void debug_sync_init_thread(THD *thd); extern void debug_sync_end_thread(THD *thd); extern bool debug_sync_set_action(THD *thd, const char *action_str, size_t len); - extern bool debug_sync_update(THD *thd, char *val_str, size_t len); extern uchar *debug_sync_value_ptr(THD *thd); diff --git a/sql/encryption.cc b/sql/encryption.cc index 209b092b0a4..52aaef896dd 100644 --- a/sql/encryption.cc +++ b/sql/encryption.cc @@ -23,6 +23,8 @@ static plugin_ref encryption_manager= 0; struct encryption_service_st encryption_handler; +extern "C" { + uint no_key(uint) { return ENCRYPTION_KEY_VERSION_INVALID; @@ -41,6 +43,8 @@ static unsigned int get_length(unsigned int slen, unsigned int key_id, return my_aes_get_size(MY_AES_CBC, slen); } +} /* extern "C" */ + int initialize_encryption_plugin(st_plugin_int *plugin) { if (encryption_manager) @@ -57,9 +61,15 @@ int initialize_encryption_plugin(st_plugin_int *plugin) st_mariadb_encryption *handle= (struct st_mariadb_encryption*) plugin->plugin->info; - encryption_handler.encryption_ctx_size_func= - handle->crypt_ctx_size ? handle->crypt_ctx_size : - (uint (*)(unsigned int, unsigned int))my_aes_ctx_size; + /* + Copmiler on Spark doesn't like the '?' operator here as it + belives the (uint (*)...) implies the C++ call model. + */ + if (handle->crypt_ctx_size) + encryption_handler.encryption_ctx_size_func= handle->crypt_ctx_size; + else + encryption_handler.encryption_ctx_size_func= + (uint (*)(unsigned int, unsigned int))my_aes_ctx_size; encryption_handler.encryption_ctx_init_func= handle->crypt_ctx_init ? handle->crypt_ctx_init : ctx_init; diff --git a/sql/event_scheduler.cc b/sql/event_scheduler.cc index 6a8bdabb948..3450e60f85c 100644 --- a/sql/event_scheduler.cc +++ b/sql/event_scheduler.cc @@ -134,7 +134,6 @@ post_init_event_thread(THD *thd) return TRUE; } - thread_safe_increment32(&thread_count); add_to_active_threads(thd); inc_thread_running(); return FALSE; @@ -189,7 +188,6 @@ pre_init_event_thread(THD* thd) thd->net.read_timeout= slave_net_timeout; thd->variables.option_bits|= OPTION_AUTO_IS_NULL; thd->client_capabilities|= CLIENT_MULTI_RESULTS; - thd->thread_id= thd->variables.pseudo_thread_id= next_thread_id(); /* Guarantees that we will see the thread in SHOW PROCESSLIST though its @@ -396,7 +394,7 @@ Event_scheduler::start(int *err_no) if (state > INITIALIZED) goto end; - if (!(new_thd= new THD)) + if (!(new_thd= new THD(next_thread_id()))) { sql_print_error("Event Scheduler: Cannot initialize the scheduler thread"); ret= true; @@ -542,7 +540,7 @@ Event_scheduler::execute_top(Event_queue_element_for_exec *event_name) int res= 0; DBUG_ENTER("Event_scheduler::execute_top"); - if (!(new_thd= new THD())) + if (!(new_thd= new THD(next_thread_id()))) goto error; pre_init_event_thread(new_thd); diff --git a/sql/events.cc b/sql/events.cc index 5ef4d6f55a5..2daf99abffc 100644 --- a/sql/events.cc +++ b/sql/events.cc @@ -854,7 +854,7 @@ Events::init(THD *thd, bool opt_noacl_or_bootstrap) if (!thd) { - if (!(thd= new THD())) + if (!(thd= new THD(0))) { res= TRUE; goto end; diff --git a/sql/field.cc b/sql/field.cc index a5d2d759edc..ba0ebb253f4 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -1503,10 +1503,12 @@ Value_source::Converter_string_to_number::check_edom_and_truncation(THD *thd, */ -int Field_num::check_edom_and_truncation(const char *type, bool edom, - CHARSET_INFO *cs, - const char *str, uint length, - const char *end) +int Field_num::check_edom_and_important_data_truncation(const char *type, + bool edom, + CHARSET_INFO *cs, + const char *str, + uint length, + const char *end) { /* Test if we get an empty string or garbage */ if (edom) @@ -1521,12 +1523,23 @@ int Field_num::check_edom_and_truncation(const char *type, bool edom, set_warning(WARN_DATA_TRUNCATED, 1); return 2; } - if (end < str + length) - set_note(WARN_DATA_TRUNCATED, 1); return 0; } +int Field_num::check_edom_and_truncation(const char *type, bool edom, + CHARSET_INFO *cs, + const char *str, uint length, + const char *end) +{ + int rc= check_edom_and_important_data_truncation(type, edom, + cs, str, length, end); + if (!rc && end < str + length) + set_note(WARN_DATA_TRUNCATED, 1); + return rc; +} + + /* Conver a string to an integer then check bounds. @@ -1674,7 +1687,8 @@ Field::Field(uchar *ptr_arg,uint32 length_arg,uchar *null_ptr_arg, part_of_key_not_clustered(0), part_of_sortkey(0), unireg_check(unireg_check_arg), field_length(length_arg), null_bit(null_bit_arg), is_created_from_null_item(FALSE), - read_stats(NULL), collected_stats(0), vcol_info(0) + read_stats(NULL), collected_stats(0), vcol_info(0), check_constraint(0), + default_value(0) { flags=null_ptr ? 0: NOT_NULL_FLAG; comment.str= (char*) ""; @@ -2049,6 +2063,7 @@ Field_str::Field_str(uchar *ptr_arg,uint32 len_arg, uchar *null_ptr_arg, if (charset_arg->state & MY_CS_BINSORT) flags|=BINARY_FLAG; field_derivation= DERIVATION_IMPLICIT; + field_repertoire= my_charset_repertoire(charset_arg); } @@ -2290,6 +2305,24 @@ Field *Field::clone(MEM_ROOT *root, my_ptrdiff_t diff) return tmp; } +void Field::set_default() +{ + if (default_value) + { + table->in_use->reset_arena_for_cached_items(table->expr_arena); + (void) default_value->expr_item->save_in_field(this, 0); + table->in_use->reset_arena_for_cached_items(0); + return; + } + /* Copy constant value stored in s->default_values */ + my_ptrdiff_t l_offset= (my_ptrdiff_t) (table->s->default_values - + table->record[0]); + memcpy(ptr, ptr + l_offset, pack_length()); + if (maybe_null_in_table()) + *null_ptr= ((*null_ptr & (uchar) ~null_bit) | + (null_ptr[l_offset] & null_bit)); +} + /**************************************************************************** Field_null, a field that always return NULL @@ -3029,7 +3062,8 @@ void Field_new_decimal::set_value_on_overflow(my_decimal *decimal_value, If it does, stores the decimal in the buffer using binary format. Otherwise sets maximal number that can be stored in the field. - @param decimal_value my_decimal + @param decimal_value my_decimal + @param [OUT] native_error the error returned by my_decimal2binary(). @retval 0 ok @@ -3037,7 +3071,8 @@ void Field_new_decimal::set_value_on_overflow(my_decimal *decimal_value, 1 error */ -bool Field_new_decimal::store_value(const my_decimal *decimal_value) +bool Field_new_decimal::store_value(const my_decimal *decimal_value, + int *native_error) { ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED; int error= 0; @@ -3066,11 +3101,14 @@ bool Field_new_decimal::store_value(const my_decimal *decimal_value) } #endif - if (warn_if_overflow(my_decimal2binary(E_DEC_FATAL_ERROR & ~E_DEC_OVERFLOW, - decimal_value, ptr, precision, dec))) + *native_error= my_decimal2binary(E_DEC_FATAL_ERROR & ~E_DEC_OVERFLOW, + decimal_value, ptr, precision, dec); + + if (*native_error == E_DEC_OVERFLOW) { my_decimal buff; DBUG_PRINT("info", ("overflow")); + set_warning(ER_WARN_DATA_OUT_OF_RANGE, 1); set_value_on_overflow(&buff, decimal_value->sign()); my_decimal2binary(E_DEC_FATAL_ERROR, &buff, ptr, precision, dec); error= 1; @@ -3081,6 +3119,16 @@ bool Field_new_decimal::store_value(const my_decimal *decimal_value) } +bool Field_new_decimal::store_value(const my_decimal *decimal_value) +{ + int native_error; + bool rc= store_value(decimal_value, &native_error); + if (!rc && native_error == E_DEC_TRUNCATED) + set_note(WARN_DATA_TRUNCATED, 1); + return rc; +} + + int Field_new_decimal::store(const char *from, uint length, CHARSET_INFO *charset_arg) { @@ -3108,9 +3156,10 @@ int Field_new_decimal::store(const char *from, uint length, if (thd->count_cuted_fields) { - if (check_edom_and_truncation("decimal", - err && err != E_DEC_TRUNCATED, - charset_arg, from, length, end)) + if (check_edom_and_important_data_truncation("decimal", + err && err != E_DEC_TRUNCATED, + charset_arg, + from, length, end)) { if (!thd->abort_on_warning) { @@ -3133,12 +3182,6 @@ int Field_new_decimal::store(const char *from, uint length, } DBUG_RETURN(1); } - /* - E_DEC_TRUNCATED means minor truncation '1e-1000000000000' -> 0.0 - A note should be enough. - */ - if (err == E_DEC_TRUNCATED) - set_note(WARN_DATA_TRUNCATED, 1); } #ifndef DBUG_OFF @@ -3146,7 +3189,21 @@ int Field_new_decimal::store(const char *from, uint length, DBUG_PRINT("enter", ("value: %s", dbug_decimal_as_string(dbug_buff, &decimal_value))); #endif - store_value(&decimal_value); + int err2; + if (store_value(&decimal_value, &err2)) + DBUG_RETURN(1); + + /* + E_DEC_TRUNCATED means minor truncation, a note should be enough: + - in err: str2my_decimal() truncated '1e-1000000000000' to 0.0 + - in err2: store_value() truncated 1.123 to 1.12, e.g. for DECIMAL(10,2) + Also, we send a note if a string had some trailing spaces: '1.12 ' + */ + if (thd->count_cuted_fields && + (err == E_DEC_TRUNCATED || + err2 == E_DEC_TRUNCATED || + end < from + length)) + set_note(WARN_DATA_TRUNCATED, 1); DBUG_RETURN(0); } @@ -4231,16 +4288,13 @@ int Field_longlong::store(const char *from,uint len,CHARSET_INFO *cs) int Field_longlong::store(double nr) { ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED; - bool error; - longlong res; + Converter_double_to_longlong conv(nr, unsigned_flag); - res= double_to_longlong(nr, unsigned_flag, &error); - - if (error) + if (conv.error()) set_warning(ER_WARN_DATA_OUT_OF_RANGE, 1); - int8store(ptr,res); - return error; + int8store(ptr, conv.result()); + return conv.error(); } @@ -4435,13 +4489,13 @@ String *Field_float::val_str(String *val_buffer, char *to=(char*) val_buffer->ptr(); size_t len; - if (dec >= NOT_FIXED_DEC) + if (dec >= FLOATING_POINT_DECIMALS) len= my_gcvt(nr, MY_GCVT_ARG_FLOAT, to_length - 1, to, NULL); else { /* We are safe here because the buffer length is 70, and - fabs(float) < 10^39, dec < NOT_FIXED_DEC. So the resulting string + fabs(float) < 10^39, dec < FLOATING_POINT_DECIMALS. So the resulting string will be not longer than 69 chars + terminating '\0'. */ len= my_fcvt(nr, dec, to, NULL); @@ -4525,7 +4579,7 @@ int Field_float::do_save_field_metadata(uchar *metadata_ptr) void Field_float::sql_type(String &res) const { - if (dec == NOT_FIXED_DEC) + if (dec >= FLOATING_POINT_DECIMALS) { res.set_ascii(STRING_WITH_LEN("float")); } @@ -4606,7 +4660,7 @@ int truncate_double(double *nr, uint field_length, uint dec, return 1; } - if (dec < NOT_FIXED_DEC) + if (dec < FLOATING_POINT_DECIMALS) { uint order= field_length - dec; uint step= array_elements(log_10) - 1; @@ -4641,53 +4695,61 @@ int truncate_double(double *nr, uint field_length, uint dec, /* Convert double to longlong / ulonglong. - If double is outside of range, adjust return value and set error. + If double is outside of the supported range, + adjust m_result and set m_error. - SYNOPSIS - double_to_longlong() - nr Number to convert - unsigned_flag 1 if result is unsigned - error Will be set to 1 in case of overflow. + @param nr Number to convert + @param unsigned_flag true if result is unsigned */ -longlong double_to_longlong(double nr, bool unsigned_flag, bool *error) +Value_source:: +Converter_double_to_longlong::Converter_double_to_longlong(double nr, + bool unsigned_flag) + :m_error(false) { - longlong res; - - *error= 0; - nr= rint(nr); if (unsigned_flag) { if (nr < 0) { - res= 0; - *error= 1; + m_result= 0; + m_error= true; } else if (nr >= (double) ULONGLONG_MAX) { - res= ~(longlong) 0; - *error= 1; + m_result= ~(longlong) 0; + m_error= true; } else - res= (longlong) double2ulonglong(nr); + m_result= (longlong) double2ulonglong(nr); } else { if (nr <= (double) LONGLONG_MIN) { - res= LONGLONG_MIN; - *error= (nr < (double) LONGLONG_MIN); + m_result= LONGLONG_MIN; + m_error= (nr < (double) LONGLONG_MIN); } else if (nr >= (double) (ulonglong) LONGLONG_MAX) { - res= LONGLONG_MAX; - *error= (nr > (double) LONGLONG_MAX); + m_result= LONGLONG_MAX; + m_error= (nr > (double) LONGLONG_MAX); } else - res= (longlong) nr; + m_result= (longlong) nr; } - return res; +} + + +void Value_source:: +Converter_double_to_longlong::push_warning(THD *thd, + double nr, + bool unsigned_flag) +{ + push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, + ER_DATA_OVERFLOW, ER_THD(thd, ER_DATA_OVERFLOW), + ErrConvDouble(nr).ptr(), + unsigned_flag ? "UNSIGNED INT" : "INT"); } @@ -4712,27 +4774,6 @@ double Field_double::val_real(void) return j; } -longlong Field_double::val_int(void) -{ - ASSERT_COLUMN_MARKED_FOR_READ; - double j; - longlong res; - bool error; - float8get(j,ptr); - - res= double_to_longlong(j, 0, &error); - if (error) - { - THD *thd= get_thd(); - ErrConvDouble err(j); - push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, - ER_TRUNCATED_WRONG_VALUE, - ER_THD(thd, ER_TRUNCATED_WRONG_VALUE), "INTEGER", - err.ptr()); - } - return res; -} - my_decimal *Field_real::val_decimal(my_decimal *decimal_value) { @@ -4788,7 +4829,7 @@ String *Field_double::val_str(String *val_buffer, char *to=(char*) val_buffer->ptr(); size_t len; - if (dec >= NOT_FIXED_DEC) + if (dec >= FLOATING_POINT_DECIMALS) len= my_gcvt(nr, MY_GCVT_ARG_DOUBLE, to_length - 1, to, NULL); else len= my_fcvt(nr, dec, to, NULL); @@ -4847,7 +4888,7 @@ int Field_double::do_save_field_metadata(uchar *metadata_ptr) void Field_double::sql_type(String &res) const { CHARSET_INFO *cs=res.charset(); - if (dec == NOT_FIXED_DEC) + if (dec >= FLOATING_POINT_DECIMALS) { res.set_ascii(STRING_WITH_LEN("double")); } @@ -4879,12 +4920,12 @@ void Field_double::sql_type(String &res) const field has NOW() as default and is updated when row changes, else it is field which has 0 as default value and is not automatically updated. TIMESTAMP_DN_FIELD - field with NOW() as default but not set on update - automatically (TIMESTAMP DEFAULT NOW()) + automatically (TIMESTAMP DEFAULT NOW()), not used in Field since 10.2.2 TIMESTAMP_UN_FIELD - field which is set on update automatically but has not NOW() as default (but it may has 0 or some other const timestamp as default) (TIMESTAMP ON UPDATE NOW()). TIMESTAMP_DNUN_FIELD - field which has now() as default and is auto-set on - update. (TIMESTAMP DEFAULT NOW() ON UPDATE NOW()) + update. (TIMESTAMP DEFAULT NOW() ON UPDATE NOW()), not used in Field since 10.2.2 NONE - field which is not auto-set on update with some other than NOW() default value (TIMESTAMP DEFAULT 0). @@ -4915,8 +4956,8 @@ Field_timestamp::Field_timestamp(uchar *ptr_arg, uint32 len_arg, this field will be automaticly updated on insert. */ flags|= TIMESTAMP_FLAG; - if (unireg_check != TIMESTAMP_DN_FIELD) - flags|= ON_UPDATE_NOW_FLAG; + flags|= ON_UPDATE_NOW_FLAG; + DBUG_ASSERT(unireg_check == TIMESTAMP_UN_FIELD); } } @@ -9739,9 +9780,44 @@ void Column_definition::create_length_to_internal_length(void) } -static inline bool is_item_func(Item* x) +bool check_expression(Virtual_column_info *vcol, const char *type, + const char *name, bool must_be_determinstic) { - return x != NULL && x->type() == Item::FUNC_ITEM; + bool ret; + Item::vcol_func_processor_result res; + /* We use 2 bytes to store the expression length */ + if (vcol->expr_str.length > UINT_MAX32) + { + my_error(ER_EXPRESSION_IS_TOO_BIG, MYF(0), type, name); + return TRUE; + } + + /* + Walk through the Item tree checking if all items are valid + to be part of the virtual column + */ + + res.errors= 0; + ret= vcol->expr_item->walk(&Item::check_vcol_func_processor, 0, &res); + vcol->flags= res.errors; + + uint filter= VCOL_IMPOSSIBLE; + if (must_be_determinstic) + filter|= VCOL_NOT_STRICTLY_DETERMINISTIC; + + if (ret || (res.errors & filter)) + { + my_error(ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED, MYF(0), res.name, + type, name); + return TRUE; + } + /* + Safe to call before fix_fields as long as vcol's don't include sub + queries (which is now checked in check_vcol_func_processor) + */ + if (vcol->expr_item->check_cols(1)) + return TRUE; + return FALSE; } @@ -9750,97 +9826,80 @@ bool Column_definition::check(THD *thd) const uint conditional_type_modifiers= AUTO_INCREMENT_FLAG; uint sign_len, allowed_type_modifier= 0; ulong max_field_charlength= MAX_FIELD_CHARLENGTH; - DBUG_ENTER("Create_field::check"); + DBUG_ENTER("Column_definition::check"); /* Initialize data for a computed field */ if (vcol_info) { DBUG_ASSERT(vcol_info->expr_item); - vcol_info->set_field_type(sql_type); - /* - Walk through the Item tree checking if all items are valid - to be part of the virtual column - */ - if (vcol_info->expr_item->walk(&Item::check_vcol_func_processor, 0, NULL)) - { - my_error(ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED, MYF(0), field_name); + if (check_expression(vcol_info, "GENERATED ALWAYS AS", field_name, + vcol_info->stored_in_db)) DBUG_RETURN(TRUE); - } } - if (length > MAX_FIELD_BLOBLENGTH) - { - my_error(ER_TOO_BIG_DISPLAYWIDTH, MYF(0), field_name, MAX_FIELD_BLOBLENGTH); + if (check_constraint && + check_expression(check_constraint, "CHECK", field_name, 0)) DBUG_RETURN(1); - } - if (decimals >= NOT_FIXED_DEC) + if (default_value) { - my_error(ER_TOO_BIG_SCALE, MYF(0), static_cast(decimals), - field_name, static_cast(NOT_FIXED_DEC - 1)); - DBUG_RETURN(TRUE); - } + Item *def_expr= default_value->expr_item; - if (def) - { - /* - Default value should be literal => basic constants => - no need fix_fields() + if (check_expression(default_value, "DEFAULT", field_name, 0)) + DBUG_RETURN(TRUE); - We allow only one function as part of default value - - NOW() as default for TIMESTAMP and DATETIME type. - */ - if (def->type() == Item::FUNC_ITEM && - (static_cast(def)->functype() != Item_func::NOW_FUNC || - (mysql_type_to_time_type(sql_type) != MYSQL_TIMESTAMP_DATETIME) || - def->decimals < length)) + /* Constant's are stored in the 'empty_record', except for blobs */ + if (def_expr->basic_const_item()) { - my_error(ER_INVALID_DEFAULT, MYF(0), field_name); - DBUG_RETURN(1); - } - else if (def->type() == Item::NULL_ITEM) - { - def= 0; - if ((flags & (NOT_NULL_FLAG | AUTO_INCREMENT_FLAG)) == NOT_NULL_FLAG) + if (def_expr->type() == Item::NULL_ITEM) { - my_error(ER_INVALID_DEFAULT, MYF(0), field_name); - DBUG_RETURN(1); + default_value= 0; + if ((flags & (NOT_NULL_FLAG | AUTO_INCREMENT_FLAG)) == NOT_NULL_FLAG) + { + my_error(ER_INVALID_DEFAULT, MYF(0), field_name); + DBUG_RETURN(1); + } } } - else if (flags & AUTO_INCREMENT_FLAG) + } + + if (default_value && (flags & AUTO_INCREMENT_FLAG)) + { + my_error(ER_INVALID_DEFAULT, MYF(0), field_name); + DBUG_RETURN(1); + } + + if (default_value && !default_value->expr_item->basic_const_item() && + mysql_type_to_time_type(sql_type) == MYSQL_TIMESTAMP_DATETIME && + default_value->expr_item->type() == Item::FUNC_ITEM) + { + /* + Special case: NOW() for TIMESTAMP and DATETIME fields are handled + as in MariaDB 10.1 by marking them in unireg_check. + */ + Item_func *fn= static_cast(default_value->expr_item); + if (fn->functype() == Item_func::NOW_FUNC && + (fn->decimals == 0 || fn->decimals >= length)) { - my_error(ER_INVALID_DEFAULT, MYF(0), field_name); - DBUG_RETURN(1); + default_value= 0; + unireg_check= Field::TIMESTAMP_DN_FIELD; } } - if (is_item_func(def)) + if (on_update) { - /* There is a function default for insertions. */ - def= NULL; - unireg_check= (is_item_func(on_update) ? - Field::TIMESTAMP_DNUN_FIELD : // for insertions and for updates. - Field::TIMESTAMP_DN_FIELD); // only for insertions. - } - else - { - /* No function default for insertions. Either NULL or a constant. */ - if (is_item_func(on_update)) - unireg_check= Field::TIMESTAMP_UN_FIELD; // function default for updates - else - unireg_check= ((flags & AUTO_INCREMENT_FLAG) ? - Field::NEXT_NUMBER : // Automatic increment. - Field::NONE); - } - - if (on_update && - (mysql_type_to_time_type(sql_type) != MYSQL_TIMESTAMP_DATETIME || - on_update->decimals < length)) - { - my_error(ER_INVALID_ON_UPDATE, MYF(0), field_name); - DBUG_RETURN(1); + if (mysql_type_to_time_type(sql_type) != MYSQL_TIMESTAMP_DATETIME || + on_update->decimals < length) + { + my_error(ER_INVALID_ON_UPDATE, MYF(0), field_name); + DBUG_RETURN(TRUE); + } + unireg_check= unireg_check == Field::NONE ? Field::TIMESTAMP_UN_FIELD + : Field::TIMESTAMP_DNUN_FIELD; } + else if (flags & AUTO_INCREMENT_FLAG) + unireg_check= Field::NEXT_NUMBER; sign_len= flags & UNSIGNED_FLAG ? 0 : 1; @@ -9873,6 +9932,12 @@ bool Column_definition::check(THD *thd) case MYSQL_TYPE_NULL: break; case MYSQL_TYPE_NEWDECIMAL: + if (decimals >= NOT_FIXED_DEC) + { + my_error(ER_TOO_BIG_SCALE, MYF(0), static_cast(decimals), + field_name, static_cast(NOT_FIXED_DEC - 1)); + DBUG_RETURN(TRUE); + } my_decimal_trim(&length, &decimals); if (length > DECIMAL_MAX_PRECISION) { @@ -9904,33 +9969,6 @@ bool Column_definition::check(THD *thd) case MYSQL_TYPE_LONG_BLOB: case MYSQL_TYPE_MEDIUM_BLOB: case MYSQL_TYPE_GEOMETRY: - if (def) - { - /* Allow empty as default value. */ - String str,*res; - res= def->val_str(&str); - /* - A default other than '' is always an error, and any non-NULL - specified default is an error in strict mode. - */ - if (res->length() || thd->is_strict_mode()) - { - my_error(ER_BLOB_CANT_HAVE_DEFAULT, MYF(0), - field_name); /* purecov: inspected */ - DBUG_RETURN(TRUE); - } - else - { - /* - Otherwise a default of '' is just a warning. - */ - push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, - ER_BLOB_CANT_HAVE_DEFAULT, - ER_THD(thd, ER_BLOB_CANT_HAVE_DEFAULT), - field_name); - } - def= 0; - } flags|= BLOB_FLAG; break; case MYSQL_TYPE_YEAR: @@ -9952,6 +9990,12 @@ bool Column_definition::check(THD *thd) my_error(ER_M_BIGGER_THAN_D, MYF(0), field_name); DBUG_RETURN(TRUE); } + if (decimals != NOT_FIXED_DEC && decimals >= FLOATING_POINT_DECIMALS) + { + my_error(ER_TOO_BIG_SCALE, MYF(0), static_cast(decimals), + field_name, static_cast(FLOATING_POINT_DECIMALS-1)); + DBUG_RETURN(TRUE); + } break; case MYSQL_TYPE_DOUBLE: allowed_type_modifier= AUTO_INCREMENT_FLAG; @@ -9966,6 +10010,12 @@ bool Column_definition::check(THD *thd) my_error(ER_M_BIGGER_THAN_D, MYF(0), field_name); DBUG_RETURN(TRUE); } + if (decimals != NOT_FIXED_DEC && decimals >= FLOATING_POINT_DECIMALS) + { + my_error(ER_TOO_BIG_SCALE, MYF(0), static_cast(decimals), + field_name, static_cast(FLOATING_POINT_DECIMALS-1)); + DBUG_RETURN(TRUE); + } break; case MYSQL_TYPE_TIMESTAMP: case MYSQL_TYPE_TIMESTAMP2: @@ -10040,7 +10090,7 @@ bool Column_definition::check(THD *thd) We need to do this check here and in mysql_create_prepare_table() as sp_head::fill_field_definition() calls this function. */ - if (!def && unireg_check == Field::NONE && (flags & NOT_NULL_FLAG)) + if (!default_value && unireg_check == Field::NONE && (flags & NOT_NULL_FLAG)) { /* TIMESTAMP columns get implicit DEFAULT value when @@ -10055,7 +10105,7 @@ bool Column_definition::check(THD *thd) if (!(flags & BLOB_FLAG) && ((length > max_field_charlength && - (sql_type != MYSQL_TYPE_VARCHAR || def)) || + sql_type != MYSQL_TYPE_VARCHAR) || (length == 0 && sql_type != MYSQL_TYPE_ENUM && sql_type != MYSQL_TYPE_SET && sql_type != MYSQL_TYPE_STRING && sql_type != MYSQL_TYPE_VARCHAR && @@ -10069,6 +10119,12 @@ bool Column_definition::check(THD *thd) field_name, max_field_charlength); /* purecov: inspected */ DBUG_RETURN(TRUE); } + else if (length > MAX_FIELD_BLOBLENGTH) + { + my_error(ER_TOO_BIG_DISPLAYWIDTH, MYF(0), field_name, MAX_FIELD_BLOBLENGTH); + DBUG_RETURN(1); + } + if ((~allowed_type_modifier) & flags & conditional_type_modifiers) { my_error(ER_WRONG_FIELD_SPEC, MYF(0), field_name); @@ -10280,19 +10336,29 @@ Field *make_field(TABLE_SHARE *share, f_is_zerofill(pack_flag) != 0, f_is_dec(pack_flag) == 0); case MYSQL_TYPE_FLOAT: + { + int decimals= f_decimals(pack_flag); + if (decimals == FLOATING_POINT_DECIMALS) + decimals= NOT_FIXED_DEC; return new (mem_root) Field_float(ptr,field_length,null_pos,null_bit, unireg_check, field_name, - f_decimals(pack_flag), + decimals, f_is_zerofill(pack_flag) != 0, f_is_dec(pack_flag)== 0); + } case MYSQL_TYPE_DOUBLE: + { + int decimals= f_decimals(pack_flag); + if (decimals == FLOATING_POINT_DECIMALS) + decimals= NOT_FIXED_DEC; return new (mem_root) Field_double(ptr,field_length,null_pos,null_bit, unireg_check, field_name, - f_decimals(pack_flag), + decimals, f_is_zerofill(pack_flag) != 0, f_is_dec(pack_flag)== 0); + } case MYSQL_TYPE_TINY: return new (mem_root) Field_tiny(ptr,field_length,null_pos,null_bit, @@ -10416,6 +10482,8 @@ Column_definition::Column_definition(THD *thd, Field *old_field, comment= old_field->comment; decimals= old_field->decimals(); vcol_info= old_field->vcol_info; + default_value= orig_field ? orig_field->default_value : 0; + check_constraint= orig_field ? orig_field->check_constraint : 0; option_list= old_field->option_list; switch (sql_type) { @@ -10459,6 +10527,15 @@ Column_definition::Column_definition(THD *thd, Field *old_field, buff, "YEAR(4)"); } break; + case MYSQL_TYPE_FLOAT: + case MYSQL_TYPE_DOUBLE: + /* + Floating points are stored with FLOATING_POINT_DECIMALS but internally + in MariaDB used with NOT_FIXED_DEC, which is >= FLOATING_POINT_DECIMALS. + */ + if (decimals >= FLOATING_POINT_DECIMALS) + decimals= NOT_FIXED_DEC; + break; default: break; } @@ -10467,7 +10544,6 @@ Column_definition::Column_definition(THD *thd, Field *old_field, interval= ((Field_enum*) old_field)->typelib; else interval=0; - def=0; char_length= length; /* @@ -10476,40 +10552,33 @@ Column_definition::Column_definition(THD *thd, Field *old_field, - The column allows a default. - - The column type is not a BLOB type. + - The column type is not a BLOB type (as BLOB's doesn't have constant + defaults) - The original column (old_field) was properly initialized with a record buffer pointer. + + - The column didn't have a default expression */ if (!(flags & (NO_DEFAULT_VALUE_FLAG | BLOB_FLAG)) && - old_field->ptr != NULL && - orig_field != NULL) + old_field->ptr != NULL && orig_field != NULL) { - bool default_now= false; - if (real_type_with_now_as_default(sql_type)) - { - // The SQL type of the new field allows a function default: - default_now= orig_field->has_insert_default_function(); - bool update_now= orig_field->has_update_default_function(); + if (orig_field->has_update_default_function()) + unireg_check= Field::TIMESTAMP_UN_FIELD; - if (default_now && update_now) - unireg_check= Field::TIMESTAMP_DNUN_FIELD; - else if (default_now) - unireg_check= Field::TIMESTAMP_DN_FIELD; - else if (update_now) - unireg_check= Field::TIMESTAMP_UN_FIELD; - } - if (!default_now) // Give a constant default + /* Get the value from default_values */ + const uchar *dv= orig_field->table->s->default_values; + if (!default_value && !orig_field->is_null_in_record(dv)) { - /* Get the value from default_values */ - const uchar *dv= orig_field->table->s->default_values; - if (!orig_field->is_null_in_record(dv)) - { - StringBuffer tmp(charset); - String *res= orig_field->val_str(&tmp, orig_field->ptr_in_record(dv)); - char *pos= (char*) thd->strmake(res->ptr(), res->length()); - def= new (thd->mem_root) Item_string(thd, pos, res->length(), charset); - } + StringBuffer tmp(charset); + String *res= orig_field->val_str(&tmp, orig_field->ptr_in_record(dv)); + char *pos= (char*) thd->strmake(res->ptr(), res->length()); + default_value= new (thd->mem_root) Virtual_column_info(); + default_value->expr_str.str= pos; + default_value->expr_str.length= res->length(); + default_value->expr_item= + new (thd->mem_root) Item_string(thd, pos, res->length(), charset); + default_value->utf8= 0; } } } @@ -10560,6 +10629,20 @@ Create_field *Create_field::clone(MEM_ROOT *mem_root) const return res; } +/** + Return true if default is an expression that must be saved explicitely + + This is: + - Not basic constants + - If field is a BLOB (Which doesn't support normal DEFAULT) +*/ + +bool Column_definition::has_default_expression() +{ + return (default_value && + (!default_value->expr_item->basic_const_item() || + (flags & BLOB_FLAG))); +} /** maximum possible display length for blob. diff --git a/sql/field.h b/sql/field.h index 736c51c2ac3..f550dad1c6c 100644 --- a/sql/field.h +++ b/sql/field.h @@ -51,7 +51,6 @@ enum enum_check_fields CHECK_FIELD_ERROR_FOR_NULL }; - /* Common declarations for Field and Item */ @@ -81,6 +80,35 @@ protected: Warn_filter_all() :Warn_filter(true, true) { } }; + class Converter_double_to_longlong + { + protected: + bool m_error; + longlong m_result; + public: + Converter_double_to_longlong(double nr, bool unsigned_flag); + longlong result() const { return m_result; } + bool error() const { return m_error; } + void push_warning(THD *thd, double nr, bool unsigned_flag); + }; + class Converter_double_to_longlong_with_warn: + public Converter_double_to_longlong + { + public: + Converter_double_to_longlong_with_warn(THD *thd, double nr, + bool unsigned_flag) + :Converter_double_to_longlong(nr, unsigned_flag) + { + if (m_error) + push_warning(thd, nr, unsigned_flag); + } + Converter_double_to_longlong_with_warn(double nr, bool unsigned_flag) + :Converter_double_to_longlong(nr, unsigned_flag) + { + if (m_error) + push_warning(current_thd, nr, unsigned_flag); + } + }; // String-to-number converters class Converter_string_to_number @@ -395,7 +423,9 @@ enum Derivation #define MY_REPERTOIRE_NUMERIC MY_REPERTOIRE_ASCII /* The length of the header part for each virtual column in the .frm file */ -#define FRM_VCOL_HEADER_SIZE(b) (3 + MY_TEST(b)) +#define FRM_VCOL_OLD_HEADER_SIZE(b) (3 + MY_TEST(b)) +#define FRM_VCOL_NEW_BASE_SIZE 16 +#define FRM_VCOL_NEW_HEADER_SIZE 6 class Count_distinct_field; @@ -405,7 +435,6 @@ struct st_cache_field; int field_conv(Field *to,Field *from); int truncate_double(double *nr, uint field_length, uint dec, bool unsigned_flag, double max_value); -longlong double_to_longlong(double nr, bool unsigned_flag, bool *error); inline uint get_enum_pack_length(int elements) { @@ -444,20 +473,6 @@ inline bool is_temporal_type_with_date(enum_field_types type) } -/** - Tests if a field real type can have "DEFAULT CURRENT_TIMESTAMP" - - @param type Field type, as returned by field->real_type(). - @retval true If field real type can have "DEFAULT CURRENT_TIMESTAMP". - @retval false If field real type can not have "DEFAULT CURRENT_TIMESTAMP". -*/ -inline bool real_type_with_now_as_default(enum_field_types type) -{ - return type == MYSQL_TYPE_TIMESTAMP || type == MYSQL_TYPE_TIMESTAMP2 || - type == MYSQL_TYPE_DATETIME || type == MYSQL_TYPE_DATETIME2; -} - - /** Recognizer for concrete data type (called real_type for some reason), returning true if it is one of the TIMESTAMP types. @@ -545,6 +560,19 @@ inline bool is_temporal_type_with_time(enum_field_types type) } } +/* + Flags for Virtual_column_info. If none is set, the expression must be + a constant with no side-effects, so it's calculated at CREATE TABLE time, + stored in table->record[2], and not recalculated for every statement. +*/ +#define VCOL_FIELD_REF 1 +#define VCOL_NON_DETERMINISTIC 2 +#define VCOL_SESSION_FUNC 4 /* uses session data, e.g. USER or DAYNAME */ +#define VCOL_TIME_FUNC 8 +#define VCOL_IMPOSSIBLE 16 + +#define VCOL_NOT_STRICTLY_DETERMINISTIC \ + (VCOL_NON_DETERMINISTIC | VCOL_TIME_FUNC | VCOL_SESSION_FUNC) /* Virtual_column_info is the class to contain additional @@ -570,18 +598,21 @@ private: public: /* Flag indicating that the field is physically stored in the database */ bool stored_in_db; + bool utf8; /* Already in utf8 */ /* The expression to compute the value of the virtual column */ Item *expr_item; /* Text representation of the defining expression */ LEX_STRING expr_str; + LEX_STRING name; /* Name of constraint */ + uint flags; Virtual_column_info() : field_type((enum enum_field_types)MYSQL_TYPE_VIRTUAL), in_partitioning_expr(FALSE), stored_in_db(FALSE), - expr_item(NULL) + utf8(TRUE), expr_item(NULL), flags(0) { - expr_str.str= NULL; - expr_str.length= 0; + expr_str.str= name.str= NULL; + name.length= 0; }; ~Virtual_column_info() {} enum_field_types get_real_type() @@ -736,11 +767,12 @@ public: Column_statistics_collected *collected_stats; /* - This is additional data provided for any computed(virtual) field. - In particular it includes a pointer to the item by which this field + This is additional data provided for any computed(virtual) field, + default function or check constraint. + In particular it includes a pointer to the item by which this field can be computed from other fields. */ - Virtual_column_info *vcol_info; + Virtual_column_info *vcol_info, *check_constraint, *default_value; Field(uchar *ptr_arg,uint32 length_arg,uchar *null_ptr_arg, uchar null_bit_arg, utype unireg_check_arg, @@ -880,26 +912,11 @@ public: my_ptrdiff_t l_offset= (my_ptrdiff_t) (record - table->record[0]); return ptr + l_offset; } - virtual void set_default() - { - my_ptrdiff_t l_offset= (my_ptrdiff_t) (table->s->default_values - - table->record[0]); - memcpy(ptr, ptr + l_offset, pack_length()); - if (maybe_null_in_table()) - *null_ptr= ((*null_ptr & (uchar) ~null_bit) | - (null_ptr[l_offset] & null_bit)); - } - - bool has_insert_default_function() const - { - return unireg_check == TIMESTAMP_DN_FIELD || - unireg_check == TIMESTAMP_DNUN_FIELD; - } + virtual void set_default(); bool has_update_default_function() const { - return unireg_check == TIMESTAMP_UN_FIELD || - unireg_check == TIMESTAMP_DNUN_FIELD; + return unireg_check == TIMESTAMP_UN_FIELD; } /* @@ -908,9 +925,15 @@ public: */ void set_has_explicit_value() { - flags|= HAS_EXPLICIT_VALUE; + if (table->has_value_set) /* If we have default functions */ + bitmap_set_bit(table->has_value_set, field_index); + } + bool has_explicit_value() + { + /* This function is only called when we have default functions */ + DBUG_ASSERT(table->has_value_set); + return bitmap_is_set(table->has_value_set, field_index); } - virtual void set_explicit_default(Item *value); /** @@ -1251,11 +1274,12 @@ public: { return binary() ? &my_charset_bin : charset(); } virtual CHARSET_INFO *sort_charset(void) const { return charset(); } virtual bool has_charset(void) const { return FALSE; } - virtual void set_charset(CHARSET_INFO *charset_arg) { } virtual enum Derivation derivation(void) const { return DERIVATION_IMPLICIT; } virtual uint repertoire(void) const { return MY_REPERTOIRE_UNICODE30; } - virtual void set_derivation(enum Derivation derivation_arg) { } + virtual void set_derivation(enum Derivation derivation_arg, + uint repertoire_arg) + { } virtual int set_time() { return 1; } bool set_warning(Sql_condition::enum_warning_level, unsigned int code, int cuted_increment) const; @@ -1508,6 +1532,10 @@ protected: class Field_num :public Field { protected: + int check_edom_and_important_data_truncation(const char *type, bool edom, + CHARSET_INFO *cs, + const char *str, uint length, + const char *end_of_num); int check_edom_and_truncation(const char *type, bool edom, CHARSET_INFO *cs, const char *str, uint length, @@ -1585,8 +1613,10 @@ public: class Field_str :public Field { protected: + // TODO-10.2: Reuse DTCollation instead of these three members CHARSET_INFO *field_charset; enum Derivation field_derivation; + uint field_repertoire; public: bool can_be_substituted_to_equal_item(const Context &ctx, const Item_equal *item_equal); @@ -1610,15 +1640,15 @@ public: { return store(str, length, &my_charset_bin); } - uint repertoire(void) const - { - return my_charset_repertoire(field_charset); - } + uint repertoire(void) const { return field_repertoire; } CHARSET_INFO *charset(void) const { return field_charset; } - void set_charset(CHARSET_INFO *charset_arg) { field_charset= charset_arg; } enum Derivation derivation(void) const { return field_derivation; } - virtual void set_derivation(enum Derivation derivation_arg) - { field_derivation= derivation_arg; } + void set_derivation(enum Derivation derivation_arg, + uint repertoire_arg) + { + field_derivation= derivation_arg; + field_repertoire= repertoire_arg; + } bool binary() const { return field_charset == &my_charset_bin; } uint32 max_display_length() { return field_length; } friend class Create_field; @@ -1699,7 +1729,7 @@ public: uint8 dec_arg, bool zero_arg, bool unsigned_arg) :Field_num(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, unireg_check_arg, field_name_arg, dec_arg, zero_arg, unsigned_arg), - not_fixed(dec_arg >= NOT_FIXED_DEC) + not_fixed(dec_arg >= FLOATING_POINT_DECIMALS) {} Item_result result_type () const { return REAL_RESULT; } Copy_func *get_copy_func(const Field *from) const @@ -1806,6 +1836,7 @@ public: } int reset(void); bool store_value(const my_decimal *decimal_value); + bool store_value(const my_decimal *decimal_value, int *native_error); void set_value_on_overflow(my_decimal *decimal_value, bool sign); int store(const char *to, uint length, CHARSET_INFO *charset); int store(double nr); @@ -2062,12 +2093,18 @@ public: :Field_real(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, unireg_check_arg, field_name_arg, dec_arg, zero_arg, unsigned_arg) - {} + { + if (dec_arg >= FLOATING_POINT_DECIMALS) + dec_arg= NOT_FIXED_DEC; + } Field_float(uint32 len_arg, bool maybe_null_arg, const char *field_name_arg, uint8 dec_arg) :Field_real((uchar*) 0, len_arg, maybe_null_arg ? (uchar*) "": 0, (uint) 0, NONE, field_name_arg, dec_arg, 0, 0) - {} + { + if (dec_arg >= FLOATING_POINT_DECIMALS) + dec_arg= NOT_FIXED_DEC; + } enum_field_types type() const { return MYSQL_TYPE_FLOAT;} enum ha_base_keytype key_type() const { return HA_KEYTYPE_FLOAT; } int store(const char *to,uint length,CHARSET_INFO *charset); @@ -2097,17 +2134,27 @@ public: :Field_real(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, unireg_check_arg, field_name_arg, dec_arg, zero_arg, unsigned_arg) - {} + { + if (dec_arg >= FLOATING_POINT_DECIMALS) + dec_arg= NOT_FIXED_DEC; + } Field_double(uint32 len_arg, bool maybe_null_arg, const char *field_name_arg, uint8 dec_arg) :Field_real((uchar*) 0, len_arg, maybe_null_arg ? (uchar*) "" : 0, (uint) 0, NONE, field_name_arg, dec_arg, 0, 0) - {} + { + if (dec_arg >= FLOATING_POINT_DECIMALS) + dec_arg= NOT_FIXED_DEC; + } Field_double(uint32 len_arg, bool maybe_null_arg, const char *field_name_arg, uint8 dec_arg, bool not_fixed_arg) :Field_real((uchar*) 0, len_arg, maybe_null_arg ? (uchar*) "" : 0, (uint) 0, NONE, field_name_arg, dec_arg, 0, 0) - {not_fixed= not_fixed_arg; } + { + not_fixed= not_fixed_arg; + if (dec_arg >= FLOATING_POINT_DECIMALS) + dec_arg= NOT_FIXED_DEC; + } enum_field_types type() const { return MYSQL_TYPE_DOUBLE;} enum ha_base_keytype key_type() const { return HA_KEYTYPE_DOUBLE; } int store(const char *to,uint length,CHARSET_INFO *charset); @@ -2115,7 +2162,13 @@ public: int store(longlong nr, bool unsigned_val); int reset(void) { bzero(ptr,sizeof(double)); return 0; } double val_real(void); - longlong val_int(void); + longlong val_int(void) + { + Converter_double_to_longlong conv(Field_double::val_real(), false); + if (conv.error()) + conv.push_warning(get_thd(), Field_double::val_real(), false); + return conv.result(); + } String *val_str(String*,String *); bool send_binary(Protocol *protocol); int cmp(const uchar *,const uchar *); @@ -2303,21 +2356,7 @@ public: void sql_type(String &str) const; bool zero_pack() const { return 0; } virtual int set_time(); - virtual void set_default() - { - if (has_insert_default_function()) - set_time(); - else - Field::set_default(); - } virtual void set_explicit_default(Item *value); - virtual int evaluate_insert_default_function() - { - int res= 0; - if (has_insert_default_function()) - res= set_time(); - return res; - } virtual int evaluate_update_default_function() { int res= 0; @@ -2747,20 +2786,6 @@ public: bool get_date(MYSQL_TIME *ltime, ulonglong fuzzydate) { return Field_datetime::get_TIME(ltime, ptr, fuzzydate); } virtual int set_time(); - virtual void set_default() - { - if (has_insert_default_function()) - set_time(); - else - Field::set_default(); - } - virtual int evaluate_insert_default_function() - { - int res= 0; - if (has_insert_default_function()) - res= set_time(); - return res; - } virtual int evaluate_update_default_function() { int res= 0; @@ -2898,7 +2923,7 @@ new_Field_timestamp(MEM_ROOT *root,uchar *ptr, uchar *null_ptr, uchar null_bit, return new (root) Field_timestamp(ptr, MAX_DATETIME_WIDTH, null_ptr, null_bit, unireg_check, field_name, share); - if (dec == NOT_FIXED_DEC) + if (dec >= FLOATING_POINT_DECIMALS) dec= MAX_DATETIME_PRECISION; return new (root) Field_timestamp_hires(ptr, null_ptr, null_bit, unireg_check, @@ -2914,7 +2939,7 @@ new_Field_time(MEM_ROOT *root, uchar *ptr, uchar *null_ptr, uchar null_bit, return new (root) Field_time(ptr, MIN_TIME_WIDTH, null_ptr, null_bit, unireg_check, field_name); - if (dec == NOT_FIXED_DEC) + if (dec >= FLOATING_POINT_DECIMALS) dec= MAX_DATETIME_PRECISION; return new (root) Field_time_hires(ptr, null_ptr, null_bit, unireg_check, field_name, dec); @@ -2929,7 +2954,7 @@ new_Field_datetime(MEM_ROOT *root, uchar *ptr, uchar *null_ptr, uchar null_bit, return new (root) Field_datetime(ptr, MAX_DATETIME_WIDTH, null_ptr, null_bit, unireg_check, field_name); - if (dec == NOT_FIXED_DEC) + if (dec >= FLOATING_POINT_DECIMALS) dec= MAX_DATETIME_PRECISION; return new (root) Field_datetime_hires(ptr, null_ptr, null_bit, @@ -3147,10 +3172,9 @@ public: packlength= 4; if (set_packlength) { - uint32 l_char_length= len_arg/cs->mbmaxlen; - packlength= l_char_length <= 255 ? 1 : - l_char_length <= 65535 ? 2 : - l_char_length <= 16777215 ? 3 : 4; + packlength= len_arg <= 255 ? 1 : + len_arg <= 65535 ? 2 : + len_arg <= 16777215 ? 3 : 4; } } Field_blob(uint32 packlength_arg) @@ -3675,7 +3699,7 @@ class Column_definition: public Sql_alloc public: const char *field_name; LEX_STRING comment; // Comment for field - Item *def, *on_update; // Default value + Item *on_update; // ON UPDATE NOW() enum enum_field_types sql_type; /* At various stages in execution this can be length of field in bytes or @@ -3698,20 +3722,23 @@ public: uint pack_flag; - /* + /* This is additinal data provided for any computed(virtual) field. In particular it includes a pointer to the item by which this field can be computed from other fields. */ - Virtual_column_info *vcol_info; + Virtual_column_info + *vcol_info, // Virtual field + *default_value, // Default value + *check_constraint; // Check constraint Column_definition(): comment(null_lex_str), - def(0), on_update(0), sql_type(MYSQL_TYPE_NULL), - flags(0), pack_length(0), key_length(0), interval(0), - srid(0), geom_type(Field::GEOM_GEOMETRY), + on_update(0), sql_type(MYSQL_TYPE_NULL), + flags(0), pack_length(0), key_length(0), unireg_check(Field::NONE), + interval(0), srid(0), geom_type(Field::GEOM_GEOMETRY), option_list(NULL), - vcol_info(0) + vcol_info(0), default_value(0), check_constraint(0) { interval_list.empty(); } @@ -3735,16 +3762,9 @@ public: ((flags >> FIELD_FLAGS_COLUMN_FORMAT) & 3); } - uint virtual_col_expr_maxlen() - { - return 255 - FRM_VCOL_HEADER_SIZE(interval != NULL); - } - bool has_default_function() const { - return (unireg_check == Field::TIMESTAMP_DN_FIELD || - unireg_check == Field::TIMESTAMP_DNUN_FIELD || - unireg_check == Field::TIMESTAMP_UN_FIELD || + return (unireg_check == Field::TIMESTAMP_UN_FIELD || unireg_check == Field::NEXT_NUMBER); } @@ -3764,6 +3784,8 @@ public: return make_field(share, mem_root, (uchar *) 0, (uchar *) "", 0, field_name_arg); } + /* Return true if default is an expression that must be saved explicitely */ + bool has_default_expression(); }; @@ -3860,6 +3882,8 @@ uint32 calc_pack_length(enum_field_types type,uint32 length); int set_field_to_null(Field *field); int set_field_to_null_with_conversions(Field *field, bool no_conversions); int convert_null_to_field_value_or_error(Field *field); +bool check_expression(Virtual_column_info *vcol, const char *type, + const char *name, bool must_be_deterministic); /* The following are for the interface with the .frm file @@ -3886,7 +3910,7 @@ int convert_null_to_field_value_or_error(Field *field); #define FIELDFLAG_HEX_ESCAPE ((uint) 0x10000) #define FIELDFLAG_PACK_SHIFT 3 #define FIELDFLAG_DEC_SHIFT 8 -#define FIELDFLAG_MAX_DEC 31 +#define FIELDFLAG_MAX_DEC 63 #define FIELDFLAG_NUM_SCREEN_TYPE 0x7F01 #define FIELDFLAG_ALFA_SCREEN_TYPE 0x7800 diff --git a/sql/filesort.cc b/sql/filesort.cc index 82a5c90d0bb..ae51fb94e64 100644 --- a/sql/filesort.cc +++ b/sql/filesort.cc @@ -137,7 +137,8 @@ void Sort_param::init_for_filesort(uint sortlen, TABLE *table, */ SORT_INFO *filesort(THD *thd, TABLE *table, Filesort *filesort, - Filesort_tracker* tracker) + Filesort_tracker* tracker, JOIN *join, + table_map first_table_bit) { int error; size_t memory_available= thd->variables.sortbuff_size; @@ -154,7 +155,7 @@ SORT_INFO *filesort(THD *thd, TABLE *table, Filesort *filesort, DBUG_ENTER("filesort"); - if (!(s_length= filesort->make_sortorder(thd))) + if (!(s_length= filesort->make_sortorder(thd, join, first_table_bit))) DBUG_RETURN(NULL); /* purecov: inspected */ DBUG_EXECUTE("info",TEST_filesort(filesort->sortorder,s_length);); @@ -438,7 +439,7 @@ void Filesort::cleanup() } -uint Filesort::make_sortorder(THD *thd) +uint Filesort::make_sortorder(THD *thd, JOIN *join, table_map first_table_bit) { uint count; SORT_FIELD *sort,*pos; @@ -458,7 +459,30 @@ uint Filesort::make_sortorder(THD *thd) for (ord= order; ord; ord= ord->next, pos++) { - Item *item= ord->item[0]->real_item(); + Item *first= ord->item[0]; + /* + It is possible that the query plan is to read table t1, while the + sort criteria actually has "ORDER BY t2.col" and the WHERE clause has + a multi-equality(t1.col, t2.col, ...). + The optimizer detects such cases (grep for + UseMultipleEqualitiesToRemoveTempTable to see where), but doesn't + perform equality substitution in the order->item. We need to do the + substitution here ourselves. + */ + table_map item_map= first->used_tables(); + if (join && (item_map & ~join->const_table_map) && + !(item_map & first_table_bit) && join->cond_equal && + first->get_item_equal()) + { + /* + Ok, this is the case descibed just above. Get the first element of the + multi-equality. + */ + Item_equal *item_eq= first->get_item_equal(); + first= item_eq->get_first(NO_PARTICULAR_TAB, NULL); + } + + Item *item= first->real_item(); pos->field= 0; pos->item= 0; if (item->type() == Item::FIELD_ITEM) pos->field= ((Item_field*) item)->field; @@ -474,7 +498,7 @@ uint Filesort::make_sortorder(THD *thd) DBUG_ASSERT(pos->field != NULL || pos->item != NULL); } DBUG_RETURN(count); - } +} /** Read 'count' number of buffer pointers into memory. */ @@ -743,11 +767,10 @@ static ha_rows find_all_keys(THD *thd, Sort_param *param, SQL_SELECT *select, 0 : !select->pre_idx_push_select_cond ? select->cond : select->pre_idx_push_select_cond; if (sort_cond) - sort_cond->walk(&Item::register_field_in_read_map, 1, (uchar*) sort_form); + sort_cond->walk(&Item::register_field_in_read_map, 1, sort_form); sort_form->column_bitmaps_set(&sort_form->tmp_set, &sort_form->tmp_set, &sort_form->tmp_set); - if (quick_select) { if (select->quick->reset()) @@ -1254,15 +1277,14 @@ static void register_used_fields(Sort_param *param) if (field->vcol_info) { Item *vcol_item= field->vcol_info->expr_item; - vcol_item->walk(&Item::register_field_in_read_map, 1, (uchar *) 0); + vcol_item->walk(&Item::register_field_in_read_map, 1, 0); } bitmap_set_bit(bitmap, field->field_index); } } else { // Item - sort_field->item->walk(&Item::register_field_in_read_map, 1, - (uchar *) table); + sort_field->item->walk(&Item::register_field_in_read_map, 1, table); } } diff --git a/sql/filesort.h b/sql/filesort.h index 18029a10c14..2b4f7ac2654 100644 --- a/sql/filesort.h +++ b/sql/filesort.h @@ -26,6 +26,7 @@ struct TABLE; class Filesort_tracker; struct SORT_FIELD; typedef struct st_order ORDER; +class JOIN; /** @@ -72,7 +73,7 @@ public: ~Filesort() { cleanup(); } /* Prepare ORDER BY list for sorting. */ - uint make_sortorder(THD *thd); + uint make_sortorder(THD *thd, JOIN *join, table_map first_table_bit); private: void cleanup(); @@ -152,11 +153,13 @@ public: { return filesort_buffer.sort_buffer_size(); } friend SORT_INFO *filesort(THD *thd, TABLE *table, Filesort *filesort, - Filesort_tracker* tracker); + Filesort_tracker* tracker, JOIN *join, + table_map first_table_bit); }; SORT_INFO *filesort(THD *thd, TABLE *table, Filesort *filesort, - Filesort_tracker* tracker); + Filesort_tracker* tracker, JOIN *join=NULL, + table_map first_table_bit=0); void change_double_for_sort(double nr,uchar *to); diff --git a/sql/gen_lex_hash.cc b/sql/gen_lex_hash.cc index c37f4f145cf..3a3273d279b 100644 --- a/sql/gen_lex_hash.cc +++ b/sql/gen_lex_hash.cc @@ -310,6 +310,7 @@ void print_find_structs() add_structs_to_map(root_by_len,max_len); set_links(root_by_len,max_len); print_hash_map("sql_functions_map"); + free(hash_map); hash_map= 0; size_hash_map= 0; @@ -319,6 +320,7 @@ void print_find_structs() add_structs_to_map(root_by_len2,max_len2); set_links(root_by_len2,max_len2); print_hash_map("symbols_map"); + free(hash_map); } diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index 173a5f709c1..400ca6129d6 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -3793,6 +3793,8 @@ int ha_partition::external_lock(THD *thd, int lock_type) (void) (*file)->ha_external_lock(thd, lock_type); } while (*(++file)); } + if (lock_type == F_WRLCK && m_part_info->part_expr) + m_part_info->part_expr->walk(&Item::register_field_in_read_map, 1, 0); DBUG_RETURN(0); err_handler: @@ -3927,6 +3929,8 @@ int ha_partition::start_stmt(THD *thd, thr_lock_type lock_type) /* Add partition to be called in reset(). */ bitmap_set_bit(&m_partitions_to_reset, i); } + if (lock_type == F_WRLCK && m_part_info->part_expr) + m_part_info->part_expr->walk(&Item::register_field_in_read_map, 1, 0); DBUG_RETURN(error); } @@ -8459,7 +8463,6 @@ uint ha_partition::min_record_length(uint options) const return max; } - /**************************************************************************** MODULE compare records ****************************************************************************/ diff --git a/sql/handler.cc b/sql/handler.cc index 2186d389056..3fbd1b3a71a 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -1,5 +1,5 @@ -/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. - Copyright (c) 2009, 2013, Monty Program Ab. +/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. + Copyright (c) 2009, 2016, MariaDB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -2826,7 +2826,7 @@ void handler::adjust_next_insert_id_after_explicit_value(ulonglong nr) { /* If we have set THD::next_insert_id previously and plan to insert an - explicitely-specified value larger than this, we need to increase + explicitly-specified value larger than this, we need to increase THD::next_insert_id to be greater than the explicit value. */ if ((next_insert_id > 0) && (nr >= next_insert_id)) @@ -3710,7 +3710,7 @@ int handler::ha_check_for_upgrade(HA_CHECK_OPT *check_opt) } } } - if (table->s->frm_version != FRM_VER_TRUE_VARCHAR) + if (table->s->frm_version < FRM_VER_TRUE_VARCHAR) return HA_ADMIN_NEEDS_ALTER; if ((error= check_collation_compatibility())) @@ -4196,6 +4196,7 @@ handler::check_if_supported_inplace_alter(TABLE *altered_table, Alter_inplace_info::ALTER_COLUMN_DEFAULT | Alter_inplace_info::ALTER_COLUMN_OPTION | Alter_inplace_info::CHANGE_CREATE_OPTION | + Alter_inplace_info::ALTER_PARTITIONED | Alter_inplace_info::ALTER_RENAME; /* Is there at least one operation that requires copy algorithm? */ @@ -4694,7 +4695,7 @@ int ha_create_table(THD *thd, const char *path, share.table_name.str, share.table_name.length); } - (void) closefrm(&table, 0); + (void) closefrm(&table); err: free_table_share(&share); @@ -6113,26 +6114,42 @@ int ha_abort_transaction(THD *bf_thd, THD *victim_thd, my_bool signal) void ha_fake_trx_id(THD *thd) { DBUG_ENTER("ha_fake_trx_id"); + + bool no_fake_trx_id= true; + if (!WSREP(thd)) { DBUG_VOID_RETURN; } - THD_TRANS *trans= &thd->transaction.all; + /* Try statement transaction if standard one is not set. */ + THD_TRANS *trans= (thd->transaction.all.ha_list) ? &thd->transaction.all : + &thd->transaction.stmt; + Ha_trx_info *ha_info= trans->ha_list, *ha_info_next; for (; ha_info; ha_info= ha_info_next) { handlerton *hton= ha_info->ht(); - if (!hton->fake_trx_id) + if (hton->fake_trx_id) { - WSREP_WARN("cannot get fake InnoDB transaction ID"); - } - else hton->fake_trx_id(hton, thd); + + /* Got a fake trx id. */ + no_fake_trx_id= false; + + /* + We need transaction ID from just one storage engine providing + fake_trx_id (which will most likely be the case). + */ + break; + } ha_info_next= ha_info->next(); - ha_info->reset(); /* keep it conveniently zero-filled */ } + + if (unlikely(no_fake_trx_id)) + WSREP_WARN("Cannot get fake transaction ID from storage engine."); + DBUG_VOID_RETURN; } #endif /* WITH_WSREP */ @@ -6326,3 +6343,98 @@ bool HA_CREATE_INFO::check_conflicting_charset_declarations(CHARSET_INFO *cs) } return false; } + +/* Remove all indexes for a given table from global index statistics */ + +static +int del_global_index_stats_for_table(THD *thd, uchar* cache_key, uint cache_key_length) +{ + int res = 0; + DBUG_ENTER("del_global_index_stats_for_table"); + + mysql_mutex_lock(&LOCK_global_index_stats); + + for (uint i= 0; i < global_index_stats.records;) + { + INDEX_STATS *index_stats = + (INDEX_STATS*) my_hash_element(&global_index_stats, i); + + /* We search correct db\0table_name\0 string */ + if (index_stats && + index_stats->index_name_length >= cache_key_length && + !memcmp(index_stats->index, cache_key, cache_key_length)) + { + res= my_hash_delete(&global_index_stats, (uchar*)index_stats); + /* + In our HASH implementation on deletion one elements + is moved into a place where a deleted element was, + and the last element is moved into the empty space. + Thus we need to re-examine the current element, but + we don't have to restart the search from the beginning. + */ + } + else + i++; + } + + mysql_mutex_unlock(&LOCK_global_index_stats); + DBUG_RETURN(res); +} + +/* Remove a table from global table statistics */ + +int del_global_table_stat(THD *thd, LEX_STRING *db, LEX_STRING *table) +{ + TABLE_STATS *table_stats; + int res = 0; + uchar *cache_key; + uint cache_key_length; + DBUG_ENTER("del_global_table_stat"); + + cache_key_length= db->length + 1 + table->length + 1; + + if(!(cache_key= (uchar *)my_malloc(cache_key_length, + MYF(MY_WME | MY_ZEROFILL)))) + { + /* Out of memory error already given */ + res = 1; + goto end; + } + + memcpy(cache_key, db->str, db->length); + memcpy(cache_key + db->length + 1, table->str, table->length); + + res= del_global_index_stats_for_table(thd, cache_key, cache_key_length); + + mysql_mutex_lock(&LOCK_global_table_stats); + + if((table_stats= (TABLE_STATS*) my_hash_search(&global_table_stats, + cache_key, + cache_key_length))) + res= my_hash_delete(&global_table_stats, (uchar*)table_stats); + + my_free(cache_key); + mysql_mutex_unlock(&LOCK_global_table_stats); + +end: + DBUG_RETURN(res); +} + +/* Remove a index from global index statistics */ + +int del_global_index_stat(THD *thd, TABLE* table, KEY* key_info) +{ + INDEX_STATS *index_stats; + uint key_length= table->s->table_cache_key.length + key_info->name_length + 1; + int res = 0; + DBUG_ENTER("del_global_index_stat"); + mysql_mutex_lock(&LOCK_global_index_stats); + + if((index_stats= (INDEX_STATS*) my_hash_search(&global_index_stats, + key_info->cache_name, + key_length))) + res= my_hash_delete(&global_index_stats, (uchar*)index_stats); + + mysql_mutex_unlock(&LOCK_global_index_stats); + DBUG_RETURN(res); +} diff --git a/sql/handler.h b/sql/handler.h index 6054ec2db35..cae95ea4ae6 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -1,8 +1,8 @@ #ifndef HANDLER_INCLUDED #define HANDLER_INCLUDED /* - Copyright (c) 2000, 2014, Oracle and/or its affiliates. - Copyright (c) 2009, 2014, Monty Program Ab. + Copyright (c) 2000, 2016, Oracle and/or its affiliates. + Copyright (c) 2009, 2016, MariaDB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -42,6 +42,7 @@ #include class Alter_info; +class Virtual_column_info; // the following is for checking tables @@ -129,7 +130,7 @@ enum enum_alter_inplace_result { */ #define HA_PRIMARY_KEY_REQUIRED_FOR_POSITION (1ULL << 16) #define HA_CAN_RTREEKEYS (1ULL << 17) -#define HA_NOT_DELETE_WITH_CACHE (1ULL << 18) +#define HA_NOT_DELETE_WITH_CACHE (1ULL << 18) /* unused */ /* The following is we need to a primary key to delete (and update) a row. If there is no primary key, all columns needs to be read on update and delete @@ -143,7 +144,7 @@ enum enum_alter_inplace_result { #define HA_HAS_OLD_CHECKSUM (1ULL << 24) /* Table data are stored in separate files (for lower_case_table_names) */ #define HA_FILE_BASED (1ULL << 26) -#define HA_NO_VARCHAR (1ULL << 27) +#define HA_NO_VARCHAR (1ULL << 27) /* unused */ #define HA_CAN_BIT_FIELD (1ULL << 28) /* supports bit fields */ #define HA_NEED_READ_RANGE_BUFFER (1ULL << 29) /* for read_multi_range */ #define HA_ANY_INDEX_MAY_BE_UNIQUE (1ULL << 30) @@ -248,6 +249,15 @@ enum enum_alter_inplace_result { */ #define HA_CAN_EXPORT (1LL << 45) +/* + Storage engine does not require an exclusive metadata lock + on the table during optimize. (TODO and repair?). + It can allow other connections to open the table. + (it does not necessarily mean that other connections can + read or modify the table - this is defined by THR locks and the + ::store_lock() method). +*/ +#define HA_CONCURRENT_OPTIMIZE (1LL << 46) /* Set of all binlog flags. Currently only contain the capabilities @@ -406,7 +416,9 @@ static const uint MYSQL_START_TRANS_OPT_READ_WRITE = 4; /* Flags for method is_fatal_error */ #define HA_CHECK_DUP_KEY 1 #define HA_CHECK_DUP_UNIQUE 2 +#define HA_CHECK_FK_ERROR 4 #define HA_CHECK_DUP (HA_CHECK_DUP_KEY + HA_CHECK_DUP_UNIQUE) +#define HA_CHECK_ALL (~0U) enum legacy_db_type { @@ -563,9 +575,9 @@ struct xid_t { xid_t() {} /* Remove gcc warning */ bool eq(struct xid_t *xid) - { return eq(xid->gtrid_length, xid->bqual_length, xid->data); } + { return !xid->is_null() && eq(xid->gtrid_length, xid->bqual_length, xid->data); } bool eq(long g, long b, const char *d) - { return g == gtrid_length && b == bqual_length && !memcmp(d, data, g+b); } + { return !is_null() && g == gtrid_length && b == bqual_length && !memcmp(d, data, g+b); } void set(struct xid_t *xid) { memcpy(this, xid, xid->length()); } void set(long f, const char *g, long gl, const char *b, long bl) @@ -1632,6 +1644,7 @@ struct Schema_specification_st - LIKE another_table_name ... // Copy structure from another table - [AS] SELECT ... // Copy structure from a subquery */ + struct Table_scope_and_contents_source_st { CHARSET_INFO *table_charset; @@ -1647,6 +1660,8 @@ struct Table_scope_and_contents_source_st ulong avg_row_length; ulong used_fields; ulong key_block_size; + ulong expression_length; + ulong field_check_constraints; /* number of pages to sample during stats estimation, if used, otherwise 0. @@ -1675,6 +1690,8 @@ struct Table_scope_and_contents_source_st enum_stats_auto_recalc stats_auto_recalc; bool varchar; ///< 1 if table has a VARCHAR + List *check_constraint_list; + /* the following three are only for ALTER TABLE, check_if_incompatible_data() */ ha_table_option_struct *option_struct; ///< structure with parsed table options ha_field_option_struct **fields_option_struct; ///< array of field option structures @@ -1823,7 +1840,7 @@ public: attribute has really changed we might choose to set flag pessimistically, for example, relying on parser output only. */ - typedef ulong HA_ALTER_FLAGS; + typedef ulonglong HA_ALTER_FLAGS; // Add non-unique, non-primary index static const HA_ALTER_FLAGS ADD_INDEX = 1L << 0; @@ -1929,9 +1946,16 @@ public: // Virtual columns changed static const HA_ALTER_FLAGS ALTER_COLUMN_VCOL = 1L << 30; - // ALTER TABLE for a partitioned table + /** + ALTER TABLE for a partitioned table. The engine needs to commit + online alter of all partitions atomically (using group_commit_ctx) + */ static const HA_ALTER_FLAGS ALTER_PARTITIONED = 1L << 31; + static const HA_ALTER_FLAGS ALTER_ADD_CHECK_CONSTRAINT = 1LL << 32; + + static const HA_ALTER_FLAGS ALTER_DROP_CHECK_CONSTRAINT= 1LL << 33; + /** Create options (like MAX_ROWS) for the new version of table. @@ -2943,7 +2967,10 @@ public: ((flags & HA_CHECK_DUP_KEY) && (error == HA_ERR_FOUND_DUPP_KEY || error == HA_ERR_FOUND_DUPP_UNIQUE)) || - error == HA_ERR_AUTOINC_ERANGE) + error == HA_ERR_AUTOINC_ERANGE || + ((flags & HA_CHECK_FK_ERROR) && + (error == HA_ERR_ROW_IS_REFERENCED || + error == HA_ERR_NO_REFERENCED_ROW))) return FALSE; return TRUE; } @@ -4290,4 +4317,7 @@ inline const char *table_case_name(HA_CREATE_INFO *info, const char *name) void print_keydup_error(TABLE *table, KEY *key, const char *msg, myf errflag); void print_keydup_error(TABLE *table, KEY *key, myf errflag); -#endif + +int del_global_index_stat(THD *thd, TABLE* table, KEY* key_info); +int del_global_table_stat(THD *thd, LEX_STRING *db, LEX_STRING *table); +#endif /* HANDLER_INCLUDED */ diff --git a/sql/item.cc b/sql/item.cc index 65fb00d4757..5da95b05b2f 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2014, Oracle and/or its affiliates. + Copyright (c) 2000, 2016, Oracle and/or its affiliates. Copyright (c) 2010, 2016, MariaDB This program is free software; you can redistribute it and/or modify @@ -72,6 +72,22 @@ void item_init(void) } +void Item::push_note_converted_to_negative_complement(THD *thd) +{ + push_warning(thd, Sql_condition::WARN_LEVEL_NOTE, ER_UNKNOWN_ERROR, + "Cast to signed converted positive out-of-range integer to " + "it's negative complement"); +} + + +void Item::push_note_converted_to_positive_complement(THD *thd) +{ + push_warning(thd, Sql_condition::WARN_LEVEL_NOTE, ER_UNKNOWN_ERROR, + "Cast to unsigned converted negative integer to it's " + "positive complement"); +} + + /** @todo Make this functions class dependent @@ -186,9 +202,6 @@ bool Item::get_time_with_conversion(THD *thd, MYSQL_TIME *ltime, */ String *Item::val_str_ascii(String *str) { - if (!(collation.collation->state & MY_CS_NONASCII)) - return val_str(str); - DBUG_ASSERT(str != &str_value); uint errors; @@ -196,11 +209,15 @@ String *Item::val_str_ascii(String *str) if (!res) return 0; - if ((null_value= str->copy(res->ptr(), res->length(), - collation.collation, &my_charset_latin1, - &errors))) - return 0; - + if (!(res->charset()->state & MY_CS_NONASCII)) + str= res; + else + { + if ((null_value= str->copy(res->ptr(), res->length(), collation.collation, + &my_charset_latin1, &errors))) + return 0; + } + return str; } @@ -357,14 +374,6 @@ longlong Item::val_int_from_date() } -longlong Item::val_int_from_real() -{ - DBUG_ASSERT(fixed == 1); - bool error; - return double_to_longlong(val_real(), false /*unsigned_flag*/, &error); -} - - double Item::val_real_from_date() { DBUG_ASSERT(fixed == 1); @@ -411,7 +420,7 @@ int Item::save_time_in_field(Field *field) int Item::save_date_in_field(Field *field) { MYSQL_TIME ltime; - if (get_date(<ime, sql_mode_for_dates(current_thd))) + if (get_date(<ime, sql_mode_for_dates(field->table->in_use))) return set_field_to_null_with_conversions(field, 0); field->set_notnull(); return field->store_time_dec(<ime, decimals); @@ -605,7 +614,7 @@ void Item::cleanup() @param arg a dummy parameter, is not used here */ -bool Item::cleanup_processor(uchar *arg) +bool Item::cleanup_processor(void *arg) { if (fixed) cleanup(); @@ -766,7 +775,7 @@ void Item_ident::cleanup() DBUG_VOID_RETURN; } -bool Item_ident::remove_dependence_processor(uchar * arg) +bool Item_ident::remove_dependence_processor(void * arg) { DBUG_ENTER("Item_ident::remove_dependence_processor"); if (get_depended_from() == (st_select_lex *) arg) @@ -776,7 +785,7 @@ bool Item_ident::remove_dependence_processor(uchar * arg) } -bool Item_ident::collect_outer_ref_processor(uchar *param) +bool Item_ident::collect_outer_ref_processor(void *param) { Collect_deps_prm *prm= (Collect_deps_prm *)param; if (depended_from && @@ -810,7 +819,7 @@ bool Item_ident::collect_outer_ref_processor(uchar *param) for the subsequent items. */ -bool Item_field::collect_item_field_processor(uchar *arg) +bool Item_field::collect_item_field_processor(void *arg) { DBUG_ENTER("Item_field::collect_item_field_processor"); DBUG_PRINT("info", ("%s", field->field_name ? field->field_name : "noname")); @@ -827,7 +836,7 @@ bool Item_field::collect_item_field_processor(uchar *arg) } -bool Item_field::add_field_to_set_processor(uchar *arg) +bool Item_field::add_field_to_set_processor(void *arg) { DBUG_ENTER("Item_field::add_field_to_set_processor"); DBUG_PRINT("info", ("%s", field->field_name ? field->field_name : "noname")); @@ -853,7 +862,7 @@ bool Item_field::add_field_to_set_processor(uchar *arg) FALSE otherwise */ -bool Item_field::find_item_in_field_list_processor(uchar *arg) +bool Item_field::find_item_in_field_list_processor(void *arg) { KEY_PART_INFO *first_non_group_part= *((KEY_PART_INFO **) arg); KEY_PART_INFO *last_part= *(((KEY_PART_INFO **) arg) + 1); @@ -873,17 +882,22 @@ bool Item_field::find_item_in_field_list_processor(uchar *arg) NOTES This is used by filesort to register used fields in a a temporary - column read set or to register used fields in a view + column read set or to register used fields in a view or check constraint */ -bool Item_field::register_field_in_read_map(uchar *arg) +bool Item_field::register_field_in_read_map(void *arg) { TABLE *table= (TABLE *) arg; if (field->table == table || !table) bitmap_set_bit(field->table->read_set, field->field_index); - if (field->vcol_info && field->vcol_info->expr_item) - return field->vcol_info->expr_item->walk(&Item::register_field_in_read_map, + if (field->vcol_info && + !bitmap_is_set(field->table->vcol_set, field->field_index)) + { + /* Ensure that the virtual fields is updated on read or write */ + bitmap_set_bit(field->table->vcol_set, field->field_index); + return field->vcol_info->expr_item->walk(&Item::register_field_in_read_map, 1, arg); + } return 0; } @@ -892,7 +906,7 @@ bool Item_field::register_field_in_read_map(uchar *arg) Mark field in bitmap supplied as *arg */ -bool Item_field::register_field_in_bitmap(uchar *arg) +bool Item_field::register_field_in_bitmap(void *arg) { MY_BITMAP *bitmap= (MY_BITMAP *) arg; DBUG_ASSERT(bitmap); @@ -908,7 +922,7 @@ bool Item_field::register_field_in_bitmap(uchar *arg) This is used by UPDATE to register underlying fields of used view fields. */ -bool Item_field::register_field_in_write_map(uchar *arg) +bool Item_field::register_field_in_write_map(void *arg) { TABLE *table= (TABLE *) arg; if (field->table == table || !table) @@ -916,6 +930,50 @@ bool Item_field::register_field_in_write_map(uchar *arg) return 0; } +/** + Check that we are not refering to any not yet initialized fields + + Fields are initialized in this order: + - All fields that have default value as a constant are initialized first. + - Then user-specified values from the INSERT list + - Then all fields that has a default expression, in field_index order. + - Last all virtual fields, in field_index order. + + This means: + - For default fields we can't access the same field or a field after + itself that doesn't have a non-constant default value. + - A virtual fields can't access itself or a virtual field after itself. + - user-specified values will not see virtual fields or default expressions, + as in INSERT t1 (a) VALUES (b); + + This is used by fix_vcol_expr() when a table is opened + + We don't have to check fields that are marked as NO_DEFAULT_VALUE + as the upper level will ensure that all these will be given a value. +*/ + +bool Item_field::check_field_expression_processor(void *arg) +{ + if (field->flags & NO_DEFAULT_VALUE_FLAG) + return 0; + if ((field->default_value && field->default_value->flags) || field->vcol_info) + { + Field *org_field= (Field*) arg; + if (field == org_field || + (!org_field->vcol_info && field->vcol_info) || + (((field->vcol_info && org_field->vcol_info) || + (!field->vcol_info && !org_field->vcol_info)) && + field->field_index >= org_field->field_index)) + { + my_error(ER_EXPRESSION_REFERS_TO_UNINIT_FIELD, + MYF(0), + org_field->field_name, field->field_name); + return 1; + } + } + return 0; +} + bool Item::check_cols(uint c) { @@ -1065,6 +1123,7 @@ Item *Item::safe_charset_converter(THD *thd, CHARSET_INFO *tocs) TODO: we should eventually check all other use cases of change_item_tree(). Perhaps some more potentially dangerous substitution examples exist. */ + Item *Item_cache::safe_charset_converter(THD *thd, CHARSET_INFO *tocs) { if (!example) @@ -1092,6 +1151,7 @@ Item *Item_cache::safe_charset_converter(THD *thd, CHARSET_INFO *tocs) the latter returns a non-fixed Item, so val_str() crashes afterwards. Override Item_num method, to return a fixed item. */ + Item *Item_num::safe_charset_converter(THD *thd, CHARSET_INFO *tocs) { /* @@ -1178,8 +1238,8 @@ Item *Item_param::safe_charset_converter(THD *thd, CHARSET_INFO *tocs) to it's possible that the converter will not be needed at all: PREPARE stmt FROM 'SELECT * FROM t1 WHERE field = ?'; - SET @@arg= 1; - EXECUTE stms USING @arg; + SET @arg= 1; + EXECUTE stmt USING @arg; In the above example result_type is STRING_RESULT at prepare time, and INT_RESULT at execution time. @@ -1329,6 +1389,43 @@ int Item::save_in_field_no_warnings(Field *field, bool no_conversions) return res; } +#ifndef DBUG_OFF +static inline +void mark_unsupported_func(const char *where, const char *processor_name) +{ + char buff[64]; + sprintf(buff, "%s::%s", where ? where: "", processor_name); + DBUG_ENTER(buff); + sprintf(buff, "%s returns TRUE: unsupported function", processor_name); + DBUG_PRINT("info", ("%s", buff)); + DBUG_VOID_RETURN; +} +#else +#define mark_unsupported_func(X,Y) {} +#endif + +bool mark_unsupported_function(const char *where, void *store, uint result) +{ + Item::vcol_func_processor_result *res= + (Item::vcol_func_processor_result*) store; + uint old_errors= res->errors; + mark_unsupported_func(where, "check_vcol_func_processor"); + res->errors|= result; /* Store type of expression */ + /* Store the name to the highest violation (normally VCOL_IMPOSSIBLE) */ + if (result > old_errors) + res->name= where ? where : ""; + return false; +} + +/* convenience helper for mark_unsupported_function() above */ +bool mark_unsupported_function(const char *w1, const char *w2, + void *store, uint result) +{ + char *ptr= (char*)current_thd->alloc(strlen(w1) + strlen(w2) + 1); + if (ptr) + strxmov(ptr, w1, w2, NullS); + return mark_unsupported_function(ptr, store, result); +} /***************************************************************************** Item_sp_variable methods @@ -2360,14 +2457,14 @@ void Item_field::reset_field(Field *f) } -bool Item_field::enumerate_field_refs_processor(uchar *arg) +bool Item_field::enumerate_field_refs_processor(void *arg) { Field_enumerator *fe= (Field_enumerator*)arg; fe->visit_field(this); return FALSE; } -bool Item_field::update_table_bitmaps_processor(uchar *arg) +bool Item_field::update_table_bitmaps_processor(void *arg) { update_table_bitmaps(); return FALSE; @@ -2383,7 +2480,7 @@ static inline void set_field_to_new_field(Field **field, Field **new_field) } } -bool Item_field::switch_to_nullable_fields_processor(uchar *arg) +bool Item_field::switch_to_nullable_fields_processor(void *arg) { Field **new_fields= (Field **)arg; set_field_to_new_field(&field, new_fields); @@ -3678,7 +3775,7 @@ Item_param::eq(const Item *item, bool binary_cmp) const void Item_param::print(String *str, enum_query_type query_type) { - if (state == NO_VALUE) + if (state == NO_VALUE || query_type & QT_NO_DATA_EXPANSION) { str->append('?'); } @@ -5122,6 +5219,8 @@ bool Item_field::fix_fields(THD *thd, Item **reference) } #endif fixed= 1; + if (field->vcol_info) + fix_session_vcol_expr_for_read(thd, field, field->vcol_info); if (thd->variables.sql_mode & MODE_ONLY_FULL_GROUP_BY && !outer_fixed && !thd->lex->in_sum_func && thd->lex->current_select->cur_pos_in_select_list != UNDEF_POS && @@ -5181,7 +5280,7 @@ error: Mark virtual columns as used in a partitioning expression */ -bool Item_field::vcol_in_partition_func_processor(uchar *int_arg) +bool Item_field::vcol_in_partition_func_processor(void *int_arg) { DBUG_ASSERT(fixed); if (field->vcol_info) @@ -5982,9 +6081,64 @@ Item *Item_int_with_ref::clone_item(THD *thd) } -Item_num *Item_uint::neg(THD *thd) +Item *Item::neg(THD *thd) { - Item_decimal *item= new (thd->mem_root) Item_decimal(thd, value, 1); + return new (thd->mem_root) Item_func_neg(thd, this); +} + +Item *Item_int::neg(THD *thd) +{ + /* + The following if should never be true with code generated by + our parser as LONGLONG_MIN values will be stored as decimal. + The code is here in case someone generates an int from inside + MariaDB + */ + if (unlikely(value == LONGLONG_MIN)) + { + /* Precision for int not big enough; Convert constant to decimal */ + Item_decimal *item= new (thd->mem_root) Item_decimal(thd, value, 0); + return item ? item->neg(thd) : item; + } + if (value > 0) + max_length++; + else if (value < 0 && max_length) + max_length--; + value= -value; + name= 0; + return this; +} + +Item *Item_decimal::neg(THD *thd) +{ + my_decimal_neg(&decimal_value); + unsigned_flag= 0; + name= 0; + max_length= my_decimal_precision_to_length_no_truncation( + decimal_value.intg + decimals, decimals, unsigned_flag); + return this; +} + +Item *Item_float::neg(THD *thd) +{ + if (value > 0) + max_length++; + else if (value < 0 && max_length) + max_length--; + value= -value; + name= presentation= 0 ; + return this; +} + +Item *Item_uint::neg(THD *thd) +{ + Item_decimal *item; + if (((ulonglong)value) <= LONGLONG_MAX) + return new (thd->mem_root) Item_int(thd, -value, max_length+1); + if (value == LONGLONG_MIN) + return new (thd->mem_root) Item_int(thd, value, max_length+1); + if (!(item= new (thd->mem_root) Item_decimal(thd, value, 1))) + return 0; return item->neg(thd); } @@ -6469,7 +6623,7 @@ Item* Item::cache_const_expr_transformer(THD *thd, uchar *arg) /** Find Item by reference in the expression */ -bool Item::find_item_processor(uchar *arg) +bool Item::find_item_processor(void *arg) { return (this == ((Item *) arg)); } @@ -6556,7 +6710,8 @@ Item *Item_field::update_value_transformer(THD *thd, uchar *select_arg) void Item_field::print(String *str, enum_query_type query_type) { - if (field && field->table->const_table) + if (field && field->table->const_table && + !(query_type & QT_NO_DATA_EXPANSION)) { print_value(str); return; @@ -6904,8 +7059,7 @@ bool Item_ref::fix_fields(THD *thd, Item **reference) Dependency_marker dep_marker; dep_marker.current_select= current_sel; dep_marker.thd= thd; - (*ref)->walk(&Item::enumerate_field_refs_processor, FALSE, - (uchar*)&dep_marker); + (*ref)->walk(&Item::enumerate_field_refs_processor, FALSE, &dep_marker); } DBUG_ASSERT(*ref); @@ -7887,7 +8041,7 @@ void Item_ref::fix_after_pullout(st_select_lex *new_parent, Item **refptr) FALSE always */ -bool Item_outer_ref::check_inner_refs_processor(uchar *arg) +bool Item_outer_ref::check_inner_refs_processor(void *arg) { List_iterator_fast *it= ((List_iterator_fast *) arg); @@ -8064,7 +8218,7 @@ bool Item_default_value::fix_fields(THD *thd, Item **items) } field_arg= (Item_field *)real_arg; - if (field_arg->field->flags & NO_DEFAULT_VALUE_FLAG) + if ((field_arg->field->flags & NO_DEFAULT_VALUE_FLAG)) { my_error(ER_NO_DEFAULT_FOR_FIELD, MYF(0), field_arg->field->field_name); goto error; @@ -8077,6 +8231,13 @@ bool Item_default_value::fix_fields(THD *thd, Item **items) (def_field->table->s->default_values - def_field->table->record[0])); set_field(def_field); + if (field->default_value) + { + fix_session_vcol_expr_for_read(thd, field, field->default_value); + if (thd->mark_used_columns != MARK_COLUMNS_NONE) + field->default_value->expr_item->walk(&Item::register_field_in_read_map, 1, 0); + IF_DBUG(def_field->is_stat_field=1,); // a hack to fool ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED + } return FALSE; error: @@ -8097,10 +8258,53 @@ void Item_default_value::print(String *str, enum_query_type query_type) str->append(')'); } +void Item_default_value::calculate() +{ + if (field->default_value) + field->set_default(); +} + +String *Item_default_value::val_str(String *str) +{ + calculate(); + return Item_field::val_str(str); +} + +double Item_default_value::val_real() +{ + calculate(); + return Item_field::val_real(); +} + +longlong Item_default_value::val_int() +{ + calculate(); + return Item_field::val_int(); +} + +my_decimal *Item_default_value::val_decimal(my_decimal *decimal_value) +{ + calculate(); + return Item_field::val_decimal(decimal_value); +} + +bool Item_default_value::get_date(MYSQL_TIME *ltime,ulonglong fuzzydate) +{ + calculate(); + return Item_field::get_date(ltime, fuzzydate); +} + +bool Item_default_value::send(Protocol *protocol, String *buffer) +{ + calculate(); + return Item_field::send(protocol, buffer); +} int Item_default_value::save_in_field(Field *field_arg, bool no_conversions) { - if (!arg) + if (arg) + calculate(); + else { TABLE *table= field_arg->table; THD *thd= table->in_use; @@ -8388,6 +8592,13 @@ void Item_trigger_field::print(String *str, enum_query_type query_type) } +bool Item_trigger_field::check_vcol_func_processor(void *arg) +{ + const char *ver= row_version == NEW_ROW ? "NEW." : "OLD."; + return mark_unsupported_function(ver, field_name, arg, VCOL_IMPOSSIBLE); +} + + void Item_trigger_field::cleanup() { want_privilege= original_privilege; diff --git a/sql/item.h b/sql/item.h index 674ff6e99dc..8fcbf82853d 100644 --- a/sql/item.h +++ b/sql/item.h @@ -32,27 +32,6 @@ C_MODE_START #include C_MODE_END -#ifndef DBUG_OFF -static inline -bool trace_unsupported_func(const char *where, const char *processor_name) -{ - char buff[64]; - sprintf(buff, "%s::%s", where, processor_name); - DBUG_ENTER(buff); - sprintf(buff, "%s returns TRUE: unsupported function", processor_name); - DBUG_PRINT("info", ("%s", buff)); - DBUG_RETURN(TRUE); -} -#else -#define trace_unsupported_func(X,Y) TRUE -#endif - -static inline -bool trace_unsupported_by_check_vcol_func_processor(const char *where) -{ - return trace_unsupported_func(where, "check_vcol_func_processor"); -} - class Protocol; struct TABLE_LIST; void item_init(void); /* Init item functions */ @@ -74,6 +53,11 @@ char_to_byte_length_safe(uint32 char_length_arg, uint32 mbmaxlen_arg) return (tmp > UINT_MAX32) ? (uint32) UINT_MAX32 : (uint32) tmp; } +bool mark_unsupported_function(const char *where, void *store, uint result); + +/* convenience helper for mark_unsupported_function() above */ +bool mark_unsupported_function(const char *w1, const char *w2, + void *store, uint result); /* Bits for the split_sum_func() function */ #define SPLIT_SUM_SKIP_REGISTERED 1 /* Skip registered funcs */ @@ -516,7 +500,7 @@ struct st_dyncall_create_def typedef struct st_dyncall_create_def DYNCALL_CREATE_DEF; -typedef bool (Item::*Item_processor) (uchar *arg); +typedef bool (Item::*Item_processor) (void *arg); /* Analyzer function SYNOPSIS @@ -665,6 +649,8 @@ protected: bool set_blob_packlength); Field *create_tmp_field(bool group, TABLE *table, uint convert_int_length); + void push_note_converted_to_negative_complement(THD *thd); + void push_note_converted_to_positive_complement(THD *thd); public: /* Cache val_str() into the own buffer, e.g. to evaluate constant @@ -875,6 +861,20 @@ public: If value is not null null_value flag will be reset to FALSE. */ virtual longlong val_int()=0; + /** + Get a value for CAST(x AS SIGNED). + Too large positive unsigned integer values are converted + to negative complements. + Values of non-integer data types are adjusted to the SIGNED range. + */ + virtual longlong val_int_signed_typecast(); + /** + Get a value for CAST(x AS UNSIGNED). + Negative signed integer values are converted + to positive complements. + Values of non-integer data types are adjusted to the UNSIGNED range. + */ + virtual longlong val_int_unsigned_typecast(); /* This is just a shortcut to avoid the cast. You should still use unsigned_flag to check the sign of the item. @@ -1041,7 +1041,12 @@ public: my_decimal *val_decimal_from_time(my_decimal *decimal_value); longlong val_int_from_decimal(); longlong val_int_from_date(); - longlong val_int_from_real(); + longlong val_int_from_real() + { + DBUG_ASSERT(fixed == 1); + return Converter_double_to_longlong_with_warn(val_real(), false).result(); + } + longlong val_int_from_str(int *error); double val_real_from_decimal(); double val_real_from_date(); @@ -1055,7 +1060,7 @@ public: int save_str_value_in_field(Field *field, String *result); virtual Field *get_tmp_table_field() { return 0; } - virtual Field *create_field_for_create_select(THD *thd, TABLE *table); + virtual Field *create_field_for_create_select(TABLE *table); virtual Field *create_field_for_schema(THD *thd, TABLE *table); virtual const char *full_name() const { return name ? name : "???"; } const char *field_name_or_null() @@ -1107,7 +1112,7 @@ public: virtual Item *clone_item(THD *thd) { return 0; } virtual cond_result eq_cmp_result() const { return COND_OK; } inline uint float_length(uint decimals_par) const - { return decimals != NOT_FIXED_DEC ? (DBL_DIG+2+decimals_par) : DBL_DIG+8;} + { return decimals < FLOATING_POINT_DECIMALS ? (DBL_DIG+2+decimals_par) : DBL_DIG+8;} /* Returns total number of decimal digits */ virtual uint decimal_precision() const; /* Returns the number of integer part digits only */ @@ -1372,6 +1377,8 @@ public: virtual void set_result_field(Field *field) {} virtual bool is_result_field() { return 0; } virtual bool is_bool_type() { return false; } + /* This is to handle printing of default values */ + virtual bool need_parentheses_in_default() { return false; } virtual void save_in_result_field(bool no_conversions) {} /* set value of aggregate function in case of no rows for grouping were found @@ -1395,12 +1402,7 @@ public: &my_charset_bin; }; - virtual bool walk(Item_processor processor, bool walk_subquery, uchar *arg) - { - return (this->*processor)(arg); - } - - virtual bool walk_top_and(Item_processor processor, uchar *arg) + virtual bool walk(Item_processor processor, bool walk_subquery, void *arg) { return (this->*processor)(arg); } @@ -1444,34 +1446,34 @@ public: this function and set the int_arg to maximum of the input data and their own version info. */ - virtual bool intro_version(uchar *int_arg) { return 0; } + virtual bool intro_version(void *int_arg) { return 0; } - virtual bool remove_dependence_processor(uchar * arg) { return 0; } - virtual bool cleanup_processor(uchar *arg); - virtual bool collect_item_field_processor(uchar * arg) { return 0; } - virtual bool add_field_to_set_processor(uchar * arg) { return 0; } - virtual bool find_item_in_field_list_processor(uchar *arg) { return 0; } - virtual bool find_item_processor(uchar *arg); - virtual bool change_context_processor(uchar *context) { return 0; } - virtual bool reset_query_id_processor(uchar *query_id_arg) { return 0; } - virtual bool is_expensive_processor(uchar *arg) { return 0; } - virtual bool register_field_in_read_map(uchar *arg) { return 0; } - virtual bool register_field_in_write_map(uchar *arg) { return 0; } - virtual bool enumerate_field_refs_processor(uchar *arg) { return 0; } - virtual bool mark_as_eliminated_processor(uchar *arg) { return 0; } - virtual bool eliminate_subselect_processor(uchar *arg) { return 0; } - virtual bool set_fake_select_as_master_processor(uchar *arg) { return 0; } - virtual bool update_table_bitmaps_processor(uchar *arg) { return 0; } - virtual bool view_used_tables_processor(uchar *arg) { return 0; } - virtual bool eval_not_null_tables(uchar *opt_arg) { return 0; } - virtual bool is_subquery_processor (uchar *opt_arg) { return 0; } - virtual bool count_sargable_conds(uchar *arg) { return 0; } - virtual bool limit_index_condition_pushdown_processor(uchar *opt_arg) + virtual bool remove_dependence_processor(void * arg) { return 0; } + virtual bool cleanup_processor(void *arg); + virtual bool collect_item_field_processor(void * arg) { return 0; } + virtual bool add_field_to_set_processor(void * arg) { return 0; } + virtual bool find_item_in_field_list_processor(void *arg) { return 0; } + virtual bool find_item_processor(void *arg); + virtual bool change_context_processor(void *context) { return 0; } + virtual bool reset_query_id_processor(void *query_id_arg) { return 0; } + virtual bool is_expensive_processor(void *arg) { return 0; } + virtual bool register_field_in_read_map(void *arg) { return 0; } + virtual bool register_field_in_write_map(void *arg) { return 0; } + virtual bool enumerate_field_refs_processor(void *arg) { return 0; } + virtual bool mark_as_eliminated_processor(void *arg) { return 0; } + virtual bool eliminate_subselect_processor(void *arg) { return 0; } + virtual bool set_fake_select_as_master_processor(void *arg) { return 0; } + virtual bool update_table_bitmaps_processor(void *arg) { return 0; } + virtual bool view_used_tables_processor(void *arg) { return 0; } + virtual bool eval_not_null_tables(void *opt_arg) { return 0; } + virtual bool is_subquery_processor (void *opt_arg) { return 0; } + virtual bool count_sargable_conds(void *arg) { return 0; } + virtual bool limit_index_condition_pushdown_processor(void *opt_arg) { return FALSE; } - virtual bool exists2in_processor(uchar *opt_arg) { return 0; } - virtual bool find_selective_predicates_list_processor(uchar *opt_arg) + virtual bool exists2in_processor(void *opt_arg) { return 0; } + virtual bool find_selective_predicates_list_processor(void *opt_arg) { return 0; } /* To call bool function for all arguments */ @@ -1480,21 +1482,12 @@ public: Item *original_func_item; void (Item::*bool_function)(); }; - bool call_bool_func_processor(uchar *org_item) - { - bool_func_call_args *info= (bool_func_call_args*) org_item; - /* Avoid recursion, as walk also calls for original item */ - if (info->original_func_item != this) - (this->*(info->bool_function))(); - return FALSE; - } - /* The next function differs from the previous one that a bitmap to be updated is passed as uchar *arg. */ - virtual bool register_field_in_bitmap(uchar *arg) { return 0; } + virtual bool register_field_in_bitmap(void *arg) { return 0; } bool cache_const_expr_analyzer(uchar **arg); Item* cache_const_expr_transformer(THD *thd, uchar *arg); @@ -1550,7 +1543,7 @@ public: assumes that there are no multi-byte collations amongst the partition fields. */ - virtual bool check_partition_func_processor(uchar *bool_arg) { return TRUE;} + virtual bool check_partition_func_processor(void *bool_arg) { return TRUE;} /* @brief Processor used to mark virtual columns used in partitioning expression @@ -1561,7 +1554,7 @@ public: @retval FALSE always */ - virtual bool vcol_in_partition_func_processor(uchar *arg) + virtual bool vcol_in_partition_func_processor(void *arg) { return FALSE; } @@ -1589,11 +1582,18 @@ public: @retval TRUE otherwise */ - virtual bool check_vcol_func_processor(uchar *arg) + struct vcol_func_processor_result { - return trace_unsupported_by_check_vcol_func_processor(full_name()); + uint errors; /* Bits of possible errors */ + const char *name; /* Not supported function */ + }; + virtual bool check_vcol_func_processor(void *arg) + { + return mark_unsupported_function(full_name(), arg, VCOL_IMPOSSIBLE); } + virtual bool check_field_expression_processor(void *arg) { return FALSE; } + /* arg points to REPLACE_EQUAL_FIELD_ARG object */ virtual Item *replace_equal_field(THD *thd, uchar *arg) { return this; } /* @@ -1601,7 +1601,7 @@ public: for date functions. Also used by partitioning code to reject timezone-dependent expressions in a (sub)partitioning function. */ - virtual bool check_valid_arguments_processor(uchar *bool_arg) + virtual bool check_valid_arguments_processor(void *bool_arg) { return FALSE; } @@ -1617,7 +1617,7 @@ public: /** Collect outer references */ - virtual bool collect_outer_ref_processor(uchar *arg) {return FALSE; } + virtual bool collect_outer_ref_processor(void *arg) {return FALSE; } /** Find a function of a given type @@ -1631,14 +1631,14 @@ public: This function can be used (together with Item::walk()) to find functions in an item tree fragment. */ - virtual bool find_function_processor (uchar *arg) + virtual bool find_function_processor (void *arg) { return FALSE; } - virtual bool check_inner_refs_processor(uchar *arg) { return FALSE; } + virtual bool check_inner_refs_processor(void *arg) { return FALSE; } - virtual bool switch_to_nullable_fields_processor(uchar *arg) { return FALSE; } + virtual bool switch_to_nullable_fields_processor(void *arg) { return FALSE; } /* For SP local variable returns pointer to Item representing its @@ -1760,7 +1760,7 @@ public: virtual bool is_expensive() { if (is_expensive_cache < 0) - is_expensive_cache= walk(&Item::is_expensive_processor, 0, (uchar*)0); + is_expensive_cache= walk(&Item::is_expensive_processor, 0, NULL); return MY_TEST(is_expensive_cache); } virtual Field::geometry_type get_geometry_type() const @@ -1811,7 +1811,7 @@ public: table_map view_used_tables(TABLE_LIST *view) { view->view_used_tables= 0; - walk(&Item::view_used_tables_processor, 0, (uchar *) view); + walk(&Item::view_used_tables_processor, 0, view); return view->view_used_tables; } @@ -1829,6 +1829,8 @@ public: /* how much position should be reserved for Exists2In transformation */ virtual uint exists2in_reserved_items() { return 0; }; + virtual Item *neg(THD *thd); + /** Inform the item that it is located under a NOT, which is a top-level item. */ @@ -1856,7 +1858,7 @@ bool cmp_items(Item *a, Item *b); } My_enumerator enumerator; - item->walk(Item::enumerate_field_refs_processor, ...,(uchar*)&enumerator); + item->walk(Item::enumerate_field_refs_processor, ...,&enumerator); This is similar to Visitor pattern. */ @@ -1968,6 +1970,7 @@ public: Item_basic_constant(THD *thd): Item_basic_value(thd), used_table_map(0) {}; void set_used_tables(table_map map) { used_table_map= map; } table_map used_tables() const { return used_table_map; } + bool check_vcol_func_processor(void *arg) { return FALSE;} /* to prevent drop fixed flag (no need parent cleanup call) */ void cleanup() { @@ -2029,6 +2032,10 @@ public: inline int save_in_field(Field *field, bool no_conversions); inline bool send(Protocol *protocol, String *str); + bool check_vcol_func_processor(void *arg) + { + return mark_unsupported_function(m_name.str, arg, VCOL_IMPOSSIBLE); + } }; /***************************************************************************** @@ -2234,9 +2241,9 @@ public: { return value_item->send(protocol, str); } - bool check_vcol_func_processor(uchar *arg) + bool check_vcol_func_processor(void *arg) { - return trace_unsupported_by_check_vcol_func_processor("name_const"); + return mark_unsupported_function("name_const()", arg, VCOL_IMPOSSIBLE); } }; @@ -2244,10 +2251,8 @@ class Item_num: public Item_basic_constant { public: Item_num(THD *thd): Item_basic_constant(thd) { collation.set_numeric(); } - virtual Item_num *neg(THD *thd)= 0; Item *safe_charset_converter(THD *thd, CHARSET_INFO *tocs); - bool check_partition_func_processor(uchar *int_arg) { return FALSE;} - bool check_vcol_func_processor(uchar *arg) { return FALSE;} + bool check_partition_func_processor(void *int_arg) { return FALSE;} }; #define NO_CACHED_FIELD_INDEX ((uint)(-1)) @@ -2279,7 +2284,7 @@ public: save_in_field(result_field, no_conversions); } void cleanup(); - bool check_vcol_func_processor(uchar *arg) { return FALSE;} + bool check_vcol_func_processor(void *arg) { return FALSE;} }; @@ -2336,14 +2341,14 @@ public: const char *full_name() const; void cleanup(); st_select_lex *get_depended_from() const; - bool remove_dependence_processor(uchar * arg); + bool remove_dependence_processor(void * arg); virtual void print(String *str, enum_query_type query_type); - virtual bool change_context_processor(uchar *cntx) + virtual bool change_context_processor(void *cntx) { context= (Name_resolution_context *)cntx; return FALSE; } /** Collect outer references */ - virtual bool collect_outer_ref_processor(uchar *arg); + virtual bool collect_outer_ref_processor(void *arg); friend bool insert_fields(THD *thd, Name_resolution_context *context, const char *db_name, const char *table_name, List_iterator *it, @@ -2498,17 +2503,22 @@ public: void set_result_field(Field *field_arg) {} void save_in_result_field(bool no_conversions) { } Item *get_tmp_table_item(THD *thd); - bool collect_item_field_processor(uchar * arg); - bool add_field_to_set_processor(uchar * arg); - bool find_item_in_field_list_processor(uchar *arg); - bool register_field_in_read_map(uchar *arg); - bool register_field_in_write_map(uchar *arg); - bool register_field_in_bitmap(uchar *arg); - bool check_partition_func_processor(uchar *int_arg) {return FALSE;} - bool vcol_in_partition_func_processor(uchar *bool_arg); - bool enumerate_field_refs_processor(uchar *arg); - bool update_table_bitmaps_processor(uchar *arg); - bool switch_to_nullable_fields_processor(uchar *arg); + bool collect_item_field_processor(void * arg); + bool add_field_to_set_processor(void * arg); + bool find_item_in_field_list_processor(void *arg); + bool register_field_in_read_map(void *arg); + bool register_field_in_write_map(void *arg); + bool register_field_in_bitmap(void *arg); + bool check_partition_func_processor(void *int_arg) {return FALSE;} + bool vcol_in_partition_func_processor(void *bool_arg); + bool check_field_expression_processor(void *arg); + bool enumerate_field_refs_processor(void *arg); + bool update_table_bitmaps_processor(void *arg); + bool switch_to_nullable_fields_processor(void *arg); + bool check_vcol_func_processor(void *arg) + { + return mark_unsupported_function(field_name, arg, VCOL_FIELD_REF); + } void cleanup(); Item_equal *get_item_equal() { return item_equal; } void set_item_equal(Item_equal *item_eq) { item_equal= item_eq; } @@ -2588,7 +2598,7 @@ public: max_length= 0; name= name_par ? name_par : (char*) "NULL"; fixed= 1; - collation.set(cs, DERIVATION_IGNORABLE); + collation.set(cs, DERIVATION_IGNORABLE, MY_REPERTOIRE_ASCII); } enum Type type() const { return NULL_ITEM; } bool eq(const Item *item, bool binary_cmp) const { return null_eq(item); } @@ -2611,8 +2621,7 @@ public: } Item *safe_charset_converter(THD *thd, CHARSET_INFO *tocs); - bool check_partition_func_processor(uchar *int_arg) {return FALSE;} - bool check_vcol_func_processor(uchar *arg) { return FALSE;} + bool check_partition_func_processor(void *int_arg) {return FALSE;} }; class Item_null_result :public Item_null @@ -2625,10 +2634,10 @@ public: { save_in_field(result_field, no_conversions); } - bool check_partition_func_processor(uchar *int_arg) {return TRUE;} - bool check_vcol_func_processor(uchar *arg) + bool check_partition_func_processor(void *int_arg) {return TRUE;} + bool check_vcol_func_processor(void *arg) { - return trace_unsupported_by_check_vcol_func_processor(full_name()); + return mark_unsupported_function(full_name(), arg, VCOL_IMPOSSIBLE); } }; @@ -2773,7 +2782,7 @@ public: { return this; } bool append_for_log(THD *thd, String *str); - + bool check_vcol_func_processor(void *int_arg) {return FALSE;} private: virtual bool set_value(THD *thd, sp_rcontext *ctx, Item **it); @@ -2817,13 +2826,11 @@ public: bool basic_const_item() const { return 1; } Item *clone_item(THD *thd); virtual void print(String *str, enum_query_type query_type); - Item_num *neg(THD *thd) { value= -value; return this; } + Item *neg(THD *thd); uint decimal_precision() const { return (uint) (max_length - MY_TEST(value < 0)); } bool eq(const Item *item, bool binary_cmp) const { return int_eq(value, item); } - bool check_partition_func_processor(uchar *bool_arg) { return FALSE;} - bool check_vcol_func_processor(uchar *arg) { return FALSE;} }; @@ -2838,7 +2845,7 @@ public: String *val_str(String*); Item *clone_item(THD *thd); virtual void print(String *str, enum_query_type query_type); - Item_num *neg(THD *thd); + Item *neg(THD *thd); uint decimal_precision() const { return max_length; } }; @@ -2882,17 +2889,10 @@ public: bool basic_const_item() const { return 1; } Item *clone_item(THD *thd); virtual void print(String *str, enum_query_type query_type); - Item_num *neg(THD *thd) - { - my_decimal_neg(&decimal_value); - unsigned_flag= !decimal_value.sign(); - return this; - } + Item *neg(THD *thd); uint decimal_precision() const { return decimal_value.precision(); } bool eq(const Item *, bool binary_cmp) const; void set_decimal_value(my_decimal *value_par); - bool check_partition_func_processor(uchar *bool_arg) { return FALSE;} - bool check_vcol_func_processor(uchar *arg) { return FALSE;} }; @@ -2937,7 +2937,7 @@ public: my_decimal *val_decimal(my_decimal *); bool basic_const_item() const { return 1; } Item *clone_item(THD *thd); - Item_num *neg(THD *thd) { value= -value; return this; } + Item *neg(THD *thd); virtual void print(String *str, enum_query_type query_type); bool eq(const Item *item, bool binary_cmp) const { return real_eq(value, item); } @@ -3073,8 +3073,7 @@ public: max_length= str_value.numchars() * collation.collation->mbmaxlen; } virtual void print(String *str, enum_query_type query_type); - bool check_partition_func_processor(uchar *int_arg) {return FALSE;} - bool check_vcol_func_processor(uchar *arg) { return FALSE;} + bool check_partition_func_processor(void *int_arg) {return FALSE;} /** Return TRUE if character-set-introducer was explicitly specified in the @@ -3205,10 +3204,10 @@ public: str->append(func_name); } - bool check_partition_func_processor(uchar *int_arg) {return TRUE;} - bool check_vcol_func_processor(uchar *arg) + bool check_partition_func_processor(void *int_arg) {return TRUE;} + bool check_vcol_func_processor(void *arg) { - return trace_unsupported_by_check_vcol_func_processor(func_name); + return mark_unsupported_function(func_name, arg, VCOL_IMPOSSIBLE); } }; @@ -3221,9 +3220,9 @@ public: CHARSET_INFO *cs= NULL): Item_string(thd, name_arg, length, cs) {} - bool check_vcol_func_processor(uchar *arg) + bool check_vcol_func_processor(void *arg) { - return trace_unsupported_by_check_vcol_func_processor("safe_string"); + return mark_unsupported_function("safe_string", arg, VCOL_IMPOSSIBLE); } }; @@ -3310,8 +3309,7 @@ public: { return const_charset_converter(thd, tocs, true); } - bool check_partition_func_processor(uchar *int_arg) {return FALSE;} - bool check_vcol_func_processor(uchar *arg) { return FALSE;} + bool check_partition_func_processor(void *int_arg) {return FALSE;} bool basic_const_item() const { return 1; } bool eq(const Item *item, bool binary_cmp) const { @@ -3439,8 +3437,7 @@ public: enum Item_result result_type () const { return STRING_RESULT; } Item_result cmp_type() const { return TIME_RESULT; } - bool check_partition_func_processor(uchar *int_arg) {return FALSE;} - bool check_vcol_func_processor(uchar *arg) { return FALSE;} + bool check_partition_func_processor(void *int_arg) {return FALSE;} bool is_null() { return is_null_from_temporal(); } @@ -3591,7 +3588,7 @@ protected: Item **args, *tmp_arg[2]; uint arg_count; void set_arguments(THD *thd, List &list); - bool walk_args(Item_processor processor, bool walk_subquery, uchar *arg) + bool walk_args(Item_processor processor, bool walk_subquery, void *arg) { for (uint i= 0; i < arg_count; i++) { @@ -3856,7 +3853,7 @@ public: Used_tables_and_const_cache(item) { } Item_func_or_sum(THD *thd, List &list): Item_result_field(thd), Item_args(thd, list) { } - bool walk(Item_processor processor, bool walk_subquery, uchar *arg) + bool walk(Item_processor processor, bool walk_subquery, void *arg) { if (walk_args(processor, walk_subquery, arg)) return true; @@ -3992,7 +3989,7 @@ public: { return ref ? (*ref)->real_item() : this; } - bool walk(Item_processor processor, bool walk_subquery, uchar *arg) + bool walk(Item_processor processor, bool walk_subquery, void *arg) { if (ref && *ref) return (*ref)->walk(processor, walk_subquery, arg) || @@ -4003,7 +4000,7 @@ public: Item* transform(THD *thd, Item_transformer, uchar *arg); Item* compile(THD *thd, Item_analyzer analyzer, uchar **arg_p, Item_transformer transformer, uchar *arg_t); - bool enumerate_field_refs_processor(uchar *arg) + bool enumerate_field_refs_processor(void *arg) { return (*ref)->enumerate_field_refs_processor(arg); } void no_rows_in_result() { @@ -4046,9 +4043,9 @@ public: if (ref && result_type() == ROW_RESULT) (*ref)->bring_value(); } - bool check_vcol_func_processor(uchar *arg) + bool check_vcol_func_processor(void *arg) { - return trace_unsupported_by_check_vcol_func_processor("ref"); + return mark_unsupported_function("ref", arg, VCOL_IMPOSSIBLE); } bool basic_const_item() const { return ref && (*ref)->basic_const_item(); } bool is_outer_field() const @@ -4231,12 +4228,12 @@ public: } bool const_item() const { return orig_item->const_item(); } table_map not_null_tables() const { return orig_item->not_null_tables(); } - bool walk(Item_processor processor, bool walk_subquery, uchar *arg) + bool walk(Item_processor processor, bool walk_subquery, void *arg) { return orig_item->walk(processor, walk_subquery, arg) || (this->*processor)(arg); } - bool enumerate_field_refs_processor(uchar *arg) + bool enumerate_field_refs_processor(void *arg) { return orig_item->enumerate_field_refs_processor(arg); } Item_field *field_for_view_update() { return orig_item->field_for_view_update(); } @@ -4262,11 +4259,11 @@ public: orig_item->bring_value(); } virtual bool is_expensive() { return orig_item->is_expensive(); } - bool is_expensive_processor(uchar *arg) + bool is_expensive_processor(void *arg) { return orig_item->is_expensive_processor(arg); } - bool check_vcol_func_processor(uchar *arg) + bool check_vcol_func_processor(void *arg) { - return trace_unsupported_by_check_vcol_func_processor("cache"); + return mark_unsupported_function("cache", arg, VCOL_IMPOSSIBLE); } }; @@ -4335,12 +4332,12 @@ public: void update_used_tables(); table_map not_null_tables() const; bool const_item() const { return used_tables() == 0; } - bool walk(Item_processor processor, bool walk_subquery, uchar *arg) + bool walk(Item_processor processor, bool walk_subquery, void *arg) { return (*ref)->walk(processor, walk_subquery, arg) || (this->*processor)(arg); } - bool view_used_tables_processor(uchar *arg) + bool view_used_tables_processor(void *arg) { TABLE_LIST *view_arg= (TABLE_LIST *) arg; if (view_arg == view) @@ -4484,7 +4481,7 @@ public: } table_map not_null_tables() const { return 0; } virtual Ref_Type ref_type() { return OUTER_REF; } - bool check_inner_refs_processor(uchar * arg); + bool check_inner_refs_processor(void * arg); }; @@ -4645,9 +4642,9 @@ public: table_map used_tables() const { return (table_map) 1L; } bool const_item() const { return 0; } bool is_null() { return null_value; } - bool check_vcol_func_processor(uchar *arg) + bool check_vcol_func_processor(void *arg) { - return trace_unsupported_by_check_vcol_func_processor("copy"); + return mark_unsupported_function("copy", arg, VCOL_IMPOSSIBLE); } /* @@ -4874,6 +4871,7 @@ public: class Item_default_value : public Item_field { + void calculate(); public: Item *arg; Item_default_value(THD *thd, Name_resolution_context *context_arg) @@ -4887,11 +4885,18 @@ public: enum Type type() const { return DEFAULT_VALUE_ITEM; } bool eq(const Item *item, bool binary_cmp) const; bool fix_fields(THD *, Item **); - virtual void print(String *str, enum_query_type query_type); + void print(String *str, enum_query_type query_type); + String *val_str(String *str); + double val_real(); + longlong val_int(); + my_decimal *val_decimal(my_decimal *decimal_value); + bool get_date(MYSQL_TIME *ltime,ulonglong fuzzydate); + bool send(Protocol *protocol, String *buffer); int save_in_field(Field *field_arg, bool no_conversions); table_map used_tables() const { return (table_map)0L; } + Item_field *field_for_view_update() { return 0; } - bool walk(Item_processor processor, bool walk_subquery, uchar *args) + bool walk(Item_processor processor, bool walk_subquery, void *args) { return (arg && arg->walk(processor, walk_subquery, args)) || (this->*processor)(args); @@ -4932,15 +4937,15 @@ public: */ table_map used_tables() const { return RAND_TABLE_BIT; } - bool walk(Item_processor processor, bool walk_subquery, uchar *args) + bool walk(Item_processor processor, bool walk_subquery, void *args) { return arg->walk(processor, walk_subquery, args) || (this->*processor)(args); } - bool check_partition_func_processor(uchar *int_arg) {return TRUE;} - bool check_vcol_func_processor(uchar *arg_arg) + bool check_partition_func_processor(void *int_arg) {return TRUE;} + bool check_vcol_func_processor(void *arg) { - return trace_unsupported_by_check_vcol_func_processor("values"); + return mark_unsupported_function("values()", arg, VCOL_IMPOSSIBLE); } }; @@ -5027,10 +5032,7 @@ private: */ bool read_only; public: - bool check_vcol_func_processor(uchar *arg) - { - return trace_unsupported_by_check_vcol_func_processor("trigger"); - } + bool check_vcol_func_processor(void *arg); }; @@ -5114,9 +5116,9 @@ public: { return this == item; } - bool check_vcol_func_processor(uchar *arg) + bool check_vcol_func_processor(void *arg) { - return trace_unsupported_by_check_vcol_func_processor("cache"); + return mark_unsupported_function("cache", arg, VCOL_IMPOSSIBLE); } /** Check if saved item has a non-NULL value. @@ -5133,14 +5135,14 @@ public: bool basic_const_item() const { return MY_TEST(example && example->basic_const_item()); } virtual void clear() { null_value= TRUE; value_cached= FALSE; } - bool is_null() { return null_value; } + bool is_null() { return !has_value(); } virtual bool is_expensive() { if (value_cached) return false; return example->is_expensive(); } - bool is_expensive_processor(uchar *arg) + bool is_expensive_processor(void *arg) { DBUG_ASSERT(example); if (value_cached) @@ -5148,7 +5150,7 @@ public: return example->is_expensive_processor(arg); } virtual void set_null(); - bool walk(Item_processor processor, bool walk_subquery, uchar *arg) + bool walk(Item_processor processor, bool walk_subquery, void *arg) { if (example && example->walk(processor, walk_subquery, arg)) return TRUE; diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 335228c37fa..eafb6b1c91b 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -120,10 +120,11 @@ static int cmp_row_type(Item* item1, Item* item2) static int agg_cmp_type(Item_result *type, Item **items, uint nitems) { - uint i; + uint unsigned_count= items[0]->unsigned_flag; type[0]= items[0]->cmp_type(); - for (i= 1 ; i < nitems ; i++) + for (uint i= 1 ; i < nitems ; i++) { + unsigned_count+= items[i]->unsigned_flag; type[0]= item_cmp_type(type[0], items[i]); /* When aggregating types of two row expressions we have to check @@ -135,6 +136,12 @@ static int agg_cmp_type(Item_result *type, Item **items, uint nitems) if (type[0] == ROW_RESULT && cmp_row_type(items[0], items[i])) return 1; // error found: invalid usage of rows } + /** + If all arguments are of INT type but have different unsigned_flag values, + switch to DECIMAL_RESULT. + */ + if (type[0] == INT_RESULT && unsigned_count != nitems && unsigned_count != 0) + type[0]= DECIMAL_RESULT; return 0; } @@ -1218,7 +1225,7 @@ void Item_in_optimizer::fix_after_pullout(st_select_lex *new_parent, Item **ref) } -bool Item_in_optimizer::eval_not_null_tables(uchar *opt_arg) +bool Item_in_optimizer::eval_not_null_tables(void *opt_arg) { not_null_tables_cache= 0; if (is_top_level_item()) @@ -1287,8 +1294,7 @@ bool Item_in_optimizer::fix_left(THD *thd) for (uint i= 0; i < n; i++) { /* Check that the expression (part of row) do not contain a subquery */ - if (args[0]->element_index(i)->walk(&Item::is_subquery_processor, - FALSE, NULL)) + if (args[0]->element_index(i)->walk(&Item::is_subquery_processor, 0, 0)) { my_error(ER_NOT_SUPPORTED_YET, MYF(0), "SUBQUERY in ROW in left expression of IN/ALL/ANY"); @@ -1717,7 +1723,7 @@ Item *Item_in_optimizer::transform(THD *thd, Item_transformer transformer, } -bool Item_in_optimizer::is_expensive_processor(uchar *arg) +bool Item_in_optimizer::is_expensive_processor(void *arg) { return args[0]->is_expensive_processor(arg) || args[1]->is_expensive_processor(arg); @@ -2013,7 +2019,7 @@ longlong Item_func_interval::val_int() */ -bool Item_func_between::eval_not_null_tables(uchar *opt_arg) +bool Item_func_between::eval_not_null_tables(void *opt_arg) { if (Item_func_opt_neg::eval_not_null_tables(NULL)) return 1; @@ -2030,7 +2036,7 @@ bool Item_func_between::eval_not_null_tables(uchar *opt_arg) } -bool Item_func_between::count_sargable_conds(uchar *arg) +bool Item_func_between::count_sargable_conds(void *arg) { SELECT_LEX *sel= (SELECT_LEX *) arg; sel->cond_count++; @@ -2329,10 +2335,7 @@ bool Item_func_ifnull::date_op(MYSQL_TIME *ltime, uint fuzzydate) DBUG_ASSERT(fixed == 1); if (!args[0]->get_date_with_conversion(ltime, fuzzydate & ~TIME_FUZZY_DATES)) return (null_value= false); - if (!args[1]->get_date_with_conversion(ltime, fuzzydate & ~TIME_FUZZY_DATES)) - return (null_value= false); - bzero((char*) ltime,sizeof(*ltime)); - return null_value= !(fuzzydate & TIME_FUZZY_DATES); + return (null_value= args[1]->get_date_with_conversion(ltime, fuzzydate & ~TIME_FUZZY_DATES)); } @@ -2376,7 +2379,7 @@ Item_func_if::fix_fields(THD *thd, Item **ref) bool -Item_func_if::eval_not_null_tables(uchar *opt_arg) +Item_func_if::eval_not_null_tables(void *opt_arg) { if (Item_func::eval_not_null_tables(NULL)) return 1; @@ -2498,6 +2501,23 @@ void Item_func_nullif::split_sum_func(THD *thd, Ref_ptr_array ref_pointer_array, } +bool Item_func_nullif::walk(Item_processor processor, + bool walk_subquery, void *arg) +{ + /* + No needs to iterate through args[2] when it's just a copy of args[0]. + See MDEV-9712 Performance degradation of nested NULLIF + */ + uint tmp_count= arg_count == 2 || args[0] == args[2] ? 2 : 3; + for (uint i= 0; i < tmp_count; i++) + { + if (args[i]->walk(processor, walk_subquery, arg)) + return true; + } + return (this->*processor)(arg); +} + + void Item_func_nullif::update_used_tables() { if (m_cache) @@ -2508,7 +2528,14 @@ void Item_func_nullif::update_used_tables() } else { - Item_func::update_used_tables(); + /* + MDEV-9712 Performance degradation of nested NULLIF + No needs to iterate through args[2] when it's just a copy of args[0]. + */ + DBUG_ASSERT(arg_count == 3); + used_tables_and_const_cache_init(); + used_tables_and_const_cache_update_and_join(args[0] == args[2] ? 2 : 3, + args); } } @@ -3362,16 +3389,12 @@ double Item_func_coalesce::real_op() bool Item_func_coalesce::date_op(MYSQL_TIME *ltime,uint fuzzydate) { DBUG_ASSERT(fixed == 1); - null_value= 0; for (uint i= 0; i < arg_count; i++) { - bool res= args[i]->get_date_with_conversion(ltime, - fuzzydate & ~TIME_FUZZY_DATES); - if (!args[i]->null_value) - return res; + if (!args[i]->get_date_with_conversion(ltime, fuzzydate & ~TIME_FUZZY_DATES)) + return (null_value= false); } - bzero((char*) ltime,sizeof(*ltime)); - return null_value|= !(fuzzydate & TIME_FUZZY_DATES); + return (null_value= true); } @@ -3983,7 +4006,7 @@ cmp_item *cmp_item_datetime::make_same() } -bool Item_func_in::count_sargable_conds(uchar *arg) +bool Item_func_in::count_sargable_conds(void *arg) { ((SELECT_LEX*) arg)->cond_count++; return 0; @@ -4042,7 +4065,7 @@ Item_func_in::fix_fields(THD *thd, Item **ref) bool -Item_func_in::eval_not_null_tables(uchar *opt_arg) +Item_func_in::eval_not_null_tables(void *opt_arg) { Item **arg, **arg_end; @@ -4546,7 +4569,7 @@ Item_cond::fix_fields(THD *thd, Item **ref) bool -Item_cond::eval_not_null_tables(uchar *opt_arg) +Item_cond::eval_not_null_tables(void *opt_arg) { Item *item; List_iterator li(list); @@ -4617,7 +4640,7 @@ void Item_cond::fix_after_pullout(st_select_lex *new_parent, Item **ref) } -bool Item_cond::walk(Item_processor processor, bool walk_subquery, uchar *arg) +bool Item_cond::walk(Item_processor processor, bool walk_subquery, void *arg) { List_iterator_fast li(list); Item *item; @@ -4627,17 +4650,6 @@ bool Item_cond::walk(Item_processor processor, bool walk_subquery, uchar *arg) return Item_func::walk(processor, walk_subquery, arg); } -bool Item_cond_and::walk_top_and(Item_processor processor, uchar *arg) -{ - List_iterator_fast li(list); - Item *item; - while ((item= li++)) - if (item->walk_top_and(processor, arg)) - return 1; - return Item_cond::walk_top_and(processor, arg); -} - - /** Transform an Item_cond object with a transformer callback function. @@ -4962,7 +4974,7 @@ Item *and_expressions(THD *thd, Item *a, Item *b, Item **org_item) } -bool Item_func_null_predicate::count_sargable_conds(uchar *arg) +bool Item_func_null_predicate::count_sargable_conds(void *arg) { ((SELECT_LEX*) arg)->cond_count++; return 0; @@ -5021,7 +5033,7 @@ void Item_func_isnotnull::print(String *str, enum_query_type query_type) } -bool Item_bool_func2::count_sargable_conds(uchar *arg) +bool Item_bool_func2::count_sargable_conds(void *arg) { ((SELECT_LEX*) arg)->cond_count++; return 0; @@ -5195,7 +5207,7 @@ void Item_func_like::cleanup() } -bool Item_func_like::find_selective_predicates_list_processor(uchar *arg) +bool Item_func_like::find_selective_predicates_list_processor(void *arg) { find_selective_predicates_list_processor_data *data= (find_selective_predicates_list_processor_data *) arg; @@ -6425,7 +6437,7 @@ void Item_equal::update_used_tables() } -bool Item_equal::count_sargable_conds(uchar *arg) +bool Item_equal::count_sargable_conds(void *arg) { SELECT_LEX *sel= (SELECT_LEX *) arg; uint m= equal_items.elements; @@ -6491,7 +6503,7 @@ void Item_equal::fix_length_and_dec() } -bool Item_equal::walk(Item_processor processor, bool walk_subquery, uchar *arg) +bool Item_equal::walk(Item_processor processor, bool walk_subquery, void *arg) { Item *item; Item_equal_fields_iterator it(*this); diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h index 5789186dbe8..f899775ce88 100644 --- a/sql/item_cmpfunc.h +++ b/sql/item_cmpfunc.h @@ -197,6 +197,7 @@ public: virtual CHARSET_INFO *compare_collation() const { return NULL; } void fix_length_and_dec() { decimals=0; max_length=1; } uint decimal_precision() const { return 1; } + bool need_parentheses_in_default() { return true; } }; @@ -335,13 +336,13 @@ public: void keep_top_level_cache(); Item *transform(THD *thd, Item_transformer transformer, uchar *arg); virtual Item *expr_cache_insert_transformer(THD *thd, uchar *unused); - bool is_expensive_processor(uchar *arg); + bool is_expensive_processor(void *arg); bool is_expensive(); void set_join_tab_idx(uint join_tab_idx_arg) { args[1]->set_join_tab_idx(join_tab_idx_arg); } virtual void get_cache_parameters(List ¶meters); bool is_top_level_item(); - bool eval_not_null_tables(uchar *opt_arg); + bool eval_not_null_tables(void *opt_arg); void fix_after_pullout(st_select_lex *new_parent, Item **ref); bool invisible_mode(); void reset_cache() { cache= NULL; } @@ -364,7 +365,7 @@ public: bool is_null() { return MY_TEST(args[0]->is_null() || args[1]->is_null()); } COND *remove_eq_conds(THD *thd, Item::cond_result *cond_value, bool top_level); - bool count_sargable_conds(uchar *arg); + bool count_sargable_conds(void *arg); /* Specifies which result type the function uses to compare its arguments. This method is used in equal field propagation. @@ -823,9 +824,9 @@ public: const char *func_name() const { return "between"; } void fix_length_and_dec(); virtual void print(String *str, enum_query_type query_type); - bool eval_not_null_tables(uchar *opt_arg); + bool eval_not_null_tables(void *opt_arg); void fix_after_pullout(st_select_lex *new_parent, Item **ref); - bool count_sargable_conds(uchar *arg); + bool count_sargable_conds(void *arg); void add_key_fields(JOIN *join, KEY_FIELD **key_fields, uint *and_level, table_map usable_tables, SARGABLE_PARAM **sargables); @@ -950,7 +951,7 @@ public: maybe_null= args[1]->maybe_null; } const char *func_name() const { return "ifnull"; } - Field *create_field_for_create_select(THD *thd, TABLE *table) + Field *create_field_for_create_select(TABLE *table) { return tmp_table_field_from_field_type(table, false, false); } table_map not_null_tables() const { return 0; } @@ -979,7 +980,7 @@ public: return Item_func_case_abbreviation2::decimal_precision2(args + 1); } const char *func_name() const { return "if"; } - bool eval_not_null_tables(uchar *opt_arg); + bool eval_not_null_tables(void *opt_arg); void fix_after_pullout(st_select_lex *new_parent, Item **ref); private: void cache_type_info(Item *source); @@ -1027,6 +1028,7 @@ public: String *str_op(String *str); my_decimal *decimal_op(my_decimal *); void fix_length_and_dec(); + bool walk(Item_processor processor, bool walk_subquery, void *arg); uint decimal_precision() const { return args[2]->decimal_precision(); } const char *func_name() const { return "nullif"; } void print(String *str, enum_query_type query_type); @@ -1038,13 +1040,21 @@ public: Item* propagate_equal_fields(THD *thd, const Context &ctx, COND_EQUAL *cond) { Context cmpctx(ANY_SUBST, cmp.compare_type(), cmp.compare_collation()); + const Item *old0= args[0]; args[0]->propagate_equal_fields_and_change_item_tree(thd, cmpctx, cond, &args[0]); args[1]->propagate_equal_fields_and_change_item_tree(thd, cmpctx, cond, &args[1]); - args[2]->propagate_equal_fields_and_change_item_tree(thd, - Context_identity(), - cond, &args[2]); + /* + MDEV-9712 Performance degradation of nested NULLIF + ANY_SUBST is more relaxed than IDENTITY_SUBST. + If ANY_SUBST did not change args[0], + then we can skip propagation for args[2]. + */ + if (old0 != args[0]) + args[2]->propagate_equal_fields_and_change_item_tree(thd, + Context_identity(), + cond, &args[2]); return this; } }; @@ -1488,6 +1498,7 @@ public: CHARSET_INFO *compare_collation() const { return cmp_collation.collation; } void cleanup(); Item* propagate_equal_fields(THD *thd, const Context &ctx, COND_EQUAL *cond); + bool need_parentheses_in_default() { return true; } }; /* @@ -1581,9 +1592,9 @@ public: virtual void print(String *str, enum_query_type query_type); enum Functype functype() const { return IN_FUNC; } const char *func_name() const { return " IN "; } - bool eval_not_null_tables(uchar *opt_arg); + bool eval_not_null_tables(void *opt_arg); void fix_after_pullout(st_select_lex *new_parent, Item **ref); - bool count_sargable_conds(uchar *arg); + bool count_sargable_conds(void *arg); }; class cmp_item_row :public cmp_item @@ -1643,7 +1654,7 @@ public: CHARSET_INFO *compare_collation() const { return args[0]->collation.collation; } void fix_length_and_dec() { decimals=0; max_length=1; maybe_null=0; } - bool count_sargable_conds(uchar *arg); + bool count_sargable_conds(void *arg); }; @@ -1861,7 +1872,7 @@ public: } void cleanup(); - bool find_selective_predicates_list_processor(uchar *arg); + bool find_selective_predicates_list_processor(void *arg); }; @@ -2062,7 +2073,7 @@ public: void top_level_item() { abort_on_null=1; } bool top_level() { return abort_on_null; } void copy_andor_arguments(THD *thd, Item_cond *item); - bool walk(Item_processor processor, bool walk_subquery, uchar *arg); + bool walk(Item_processor processor, bool walk_subquery, void *arg); Item *transform(THD *thd, Item_transformer transformer, uchar *arg); void traverse_cond(Cond_traverser, void *arg, traverse_order order); void neg_arguments(THD *thd); @@ -2070,7 +2081,7 @@ public: Item* propagate_equal_fields(THD *, const Context &, COND_EQUAL *); Item *compile(THD *thd, Item_analyzer analyzer, uchar **arg_p, Item_transformer transformer, uchar *arg_t); - bool eval_not_null_tables(uchar *opt_arg); + bool eval_not_null_tables(void *opt_arg); }; template class LI, class T> class Item_equal_iterator; @@ -2235,7 +2246,7 @@ public: uint *and_level, table_map usable_tables, SARGABLE_PARAM **sargables); SEL_TREE *get_mm_tree(RANGE_OPT_PARAM *param, Item **cond_ptr); - bool walk(Item_processor processor, bool walk_subquery, uchar *arg); + bool walk(Item_processor processor, bool walk_subquery, void *arg); Item *transform(THD *thd, Item_transformer transformer, uchar *arg); virtual void print(String *str, enum_query_type query_type); Item_result compare_type() const { return m_compare_type; } @@ -2244,7 +2255,7 @@ public: void set_context_field(Item_field *ctx_field) { context_field= ctx_field; } void set_link_equal_fields(bool flag) { link_equal_fields= flag; } friend class Item_equal_fields_iterator; - bool count_sargable_conds(uchar *arg); + bool count_sargable_conds(void *arg); friend class Item_equal_iterator; friend class Item_equal_iterator; friend Item *eliminate_item_equal(THD *thd, COND *cond, @@ -2381,7 +2392,6 @@ public: Item *neg_transformer(THD *thd); void mark_as_condition_AND_part(TABLE_LIST *embedding); virtual uint exists2in_reserved_items() { return list.elements; }; - bool walk_top_and(Item_processor processor, uchar *arg); COND *build_equal_items(THD *thd, COND_EQUAL *inherited, bool link_item_fields, COND_EQUAL **cond_equal_ref); @@ -2420,6 +2430,7 @@ public: Item_func_dyncol_check(THD *thd, Item *str): Item_bool_func(thd, str) {} longlong val_int(); const char *func_name() const { return "column_check"; } + bool need_parentheses_in_default() { return false; } }; class Item_func_dyncol_exists :public Item_bool_func @@ -2429,6 +2440,7 @@ public: Item_bool_func(thd, str, num) {} longlong val_int(); const char *func_name() const { return "column_exists"; } + bool need_parentheses_in_default() { return false; } }; inline bool is_cond_or(Item *item) diff --git a/sql/item_func.cc b/sql/item_func.cc index 57bd004cf88..cc1494cc034 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -257,7 +257,7 @@ Item_func::quick_fix_field() bool -Item_func::eval_not_null_tables(uchar *opt_arg) +Item_func::eval_not_null_tables(void *opt_arg) { Item **arg,**arg_end; not_null_tables_cache= 0; @@ -646,14 +646,15 @@ void Item_func::count_real_length(Item **items, uint nitems) unsigned_flag= false; for (uint i=0 ; i < nitems ; i++) { - if (decimals != NOT_FIXED_DEC) + if (decimals < FLOATING_POINT_DECIMALS) { set_if_bigger(decimals, items[i]->decimals); + /* Will be ignored if items[i]->decimals >= FLOATING_POINT_DECIMALS */ set_if_bigger(length, (items[i]->max_length - items[i]->decimals)); } set_if_bigger(max_length, items[i]->max_length); } - if (decimals != NOT_FIXED_DEC) + if (decimals < FLOATING_POINT_DECIMALS) { max_length= length; length+= decimals; @@ -1072,7 +1073,7 @@ void Item_func_signed::print(String *str, enum_query_type query_type) } -longlong Item_func_signed::val_int_from_str(int *error) +longlong Item::val_int_from_str(int *error) { char buff[MAX_FIELD_WIDTH]; String tmp(buff,sizeof(buff), &my_charset_bin), *res; @@ -1082,13 +1083,11 @@ longlong Item_func_signed::val_int_from_str(int *error) to a longlong */ - if (!(res= args[0]->val_str(&tmp))) + if (!(res= val_str(&tmp))) { - null_value= 1; *error= 0; return 0; } - null_value= 0; Converter_strtoll10_with_warn cnv(NULL, Warn_filter_all(), res->charset(), res->ptr(), res->length()); *error= cnv.error(); @@ -1096,37 +1095,15 @@ longlong Item_func_signed::val_int_from_str(int *error) } -longlong Item_func_signed::val_int() +longlong Item::val_int_signed_typecast() { - longlong value; + if (cast_to_int_type() != STRING_RESULT) + return val_int(); + int error; - - if (args[0]->cast_to_int_type() != STRING_RESULT) - { - value= args[0]->val_int(); - null_value= args[0]->null_value; - return value; - } - else if (args[0]->dynamic_result()) - { - /* We come here when argument has an unknown type */ - args[0]->unsigned_flag= 0; // Mark that we want to have a signed value - value= args[0]->val_int(); - null_value= args[0]->null_value; - if (!null_value && args[0]->unsigned_flag && value < 0) - goto err; // Warn about overflow - return value; - } - - value= val_int_from_str(&error); - if (value < 0 && error == 0) - goto err; - return value; - -err: - push_warning(current_thd, Sql_condition::WARN_LEVEL_NOTE, ER_UNKNOWN_ERROR, - "Cast to signed converted positive out-of-range integer to " - "it's negative complement"); + longlong value= val_int_from_str(&error); + if (!null_value && value < 0 && error == 0) + push_note_converted_to_negative_complement(current_thd); return value; } @@ -1140,49 +1117,30 @@ void Item_func_unsigned::print(String *str, enum_query_type query_type) } -longlong Item_func_unsigned::val_int() +longlong Item::val_int_unsigned_typecast() { - longlong value; - int error; - - if (args[0]->cast_to_int_type() == DECIMAL_RESULT) + if (cast_to_int_type() == DECIMAL_RESULT) { - my_decimal tmp, *dec= args[0]->val_decimal(&tmp); - if (!(null_value= args[0]->null_value)) + longlong value; + my_decimal tmp, *dec= val_decimal(&tmp); + if (!null_value) my_decimal2int(E_DEC_FATAL_ERROR, dec, 1, &value); else value= 0; return value; } - else if (args[0]->dynamic_result()) + else if (cast_to_int_type() != STRING_RESULT) { - /* We come here when argument has an unknown type */ - args[0]->unsigned_flag= 1; // Mark that we want to have an unsigned value - value= args[0]->val_int(); - null_value= args[0]->null_value; - if (!null_value && args[0]->unsigned_flag == 0 && value < 0) - goto err; // Warn about overflow - return value; - } - else if (args[0]->cast_to_int_type() != STRING_RESULT) - { - value= args[0]->val_int(); - null_value= args[0]->null_value; - if (!null_value && args[0]->unsigned_flag == 0 && value < 0) - goto err; // Warn about overflow + longlong value= val_int(); + if (!null_value && unsigned_flag == 0 && value < 0) + push_note_converted_to_positive_complement(current_thd); return value; } - value= val_int_from_str(&error); - if (error < 0) - goto err; - - return value; - -err: - push_warning(current_thd, Sql_condition::WARN_LEVEL_NOTE, ER_UNKNOWN_ERROR, - "Cast to unsigned converted negative integer to it's " - "positive complement"); + int error; + longlong value= val_int_from_str(&error); + if (!null_value && error < 0) + push_note_converted_to_positive_complement(current_thd); return value; } @@ -4629,6 +4587,11 @@ longlong Item_func_sleep::val_int() } +bool Item_func_user_var::check_vcol_func_processor(void *arg) +{ + return mark_unsupported_function("@", name.str, arg, VCOL_IMPOSSIBLE); +} + #define extra_size sizeof(double) user_var_entry *get_variable(HASH *hash, LEX_STRING &name, @@ -4783,7 +4746,7 @@ Item_func_set_user_var::fix_length_and_dec() column read set or to register used fields in a view */ -bool Item_func_set_user_var::register_field_in_read_map(uchar *arg) +bool Item_func_set_user_var::register_field_in_read_map(void *arg) { if (result_field) { @@ -4802,7 +4765,7 @@ bool Item_func_set_user_var::register_field_in_read_map(uchar *arg) */ -bool Item_func_set_user_var::register_field_in_bitmap(uchar *arg) +bool Item_func_set_user_var::register_field_in_bitmap(void *arg) { MY_BITMAP *bitmap = (MY_BITMAP *) arg; DBUG_ASSERT(bitmap); @@ -4903,7 +4866,7 @@ Item_func_set_user_var::update_hash(void *ptr, uint length, bool unsigned_arg) { /* - If we set a variable explicitely to NULL then keep the old + If we set a variable explicitly to NULL then keep the old result type of the variable */ if (args[0]->type() == Item::FIELD_ITEM) @@ -5889,6 +5852,10 @@ void Item_func_get_system_var::print(String *str, enum_query_type query_type) str->append(name, name_length); } +bool Item_func_get_system_var::check_vcol_func_processor(void *arg) +{ + return mark_unsupported_function("@@", var->name.str, arg, VCOL_SESSION_FUNC); +} enum Item_result Item_func_get_system_var::result_type() const { @@ -6279,6 +6246,8 @@ bool Item_func_match::fix_index() for (i=1; i < arg_count; i++) { + if (args[i]->type() != FIELD_ITEM) + goto err; item=(Item_field*)args[i]; for (keynr=0 ; keynr < fts ; keynr++) { @@ -6892,6 +6861,10 @@ void Item_func_sp::update_used_tables() } } +bool Item_func_sp::check_vcol_func_processor(void *arg) +{ + return mark_unsupported_function(func_name(), "()", arg, VCOL_IMPOSSIBLE); +} /* uuid_short handling. diff --git a/sql/item_func.h b/sql/item_func.h index 5c21535adbe..92bc798e044 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -1,7 +1,7 @@ #ifndef ITEM_FUNC_INCLUDED #define ITEM_FUNC_INCLUDED -/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. - Copyright (c) 2009, 2014, MariaDB +/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. + Copyright (c) 2009, 2016, MariaDB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -64,7 +64,7 @@ public: SP_STARTPOINT,SP_ENDPOINT,SP_EXTERIORRING, SP_POINTN,SP_GEOMETRYN,SP_INTERIORRINGN, SP_RELATE_FUNC, NOT_FUNC, NOT_ALL_FUNC, - NOW_FUNC, TRIG_COND_FUNC, + NOW_FUNC, NOW_UTC_FUNC, SYSDATE_FUNC, TRIG_COND_FUNC, SUSERVAR_FUNC, GUSERVAR_FUNC, COLLATE_FUNC, EXTRACT_FUNC, CHAR_TYPECAST_FUNC, FUNC_SP, UDF_FUNC, NEG_FUNC, GSYSVAR_FUNC, DYNCOL_FUNC }; @@ -173,9 +173,8 @@ public: } void signal_divide_by_null(); friend class udf_handler; - Field *create_field_for_create_select(THD *thd, TABLE *table) + Field *create_field_for_create_select(TABLE *table) { - DBUG_ASSERT(thd == table->in_use); return result_type() != STRING_RESULT ? create_tmp_field(false, table, MY_INT32_NUM_DECIMAL_DIGITS) : tmp_table_field_from_field_type(table, false, false); @@ -201,15 +200,15 @@ public: Item_transformer transformer, uchar *arg_t); void traverse_cond(Cond_traverser traverser, void * arg, traverse_order order); - bool eval_not_null_tables(uchar *opt_arg); - // bool is_expensive_processor(uchar *arg); + bool eval_not_null_tables(void *opt_arg); + // bool is_expensive_processor(void *arg); // virtual bool is_expensive() { return 0; } inline void raise_numeric_overflow(const char *type_name) { char buf[256]; String str(buf, sizeof(buf), system_charset_info); str.length(0); - print(&str, QT_ORDINARY); + print(&str, QT_NO_DATA_EXPANSION); my_error(ER_DATA_OUT_OF_RANGE, MYF(0), type_name, str.c_ptr_safe()); } inline double raise_float_overflow() @@ -325,12 +324,12 @@ public: representation of a TIMESTAMP argument verbatim, and thus does not depend on the timezone. */ - virtual bool check_valid_arguments_processor(uchar *bool_arg) + virtual bool check_valid_arguments_processor(void *bool_arg) { return has_timestamp_args(); } - virtual bool find_function_processor (uchar *arg) + virtual bool find_function_processor (void *arg) { return functype() == *(Functype *) arg; } @@ -571,8 +570,8 @@ class Item_num_op :public Item_func_numhybrid { print_op(str, query_type); } - void fix_length_and_dec(); + bool need_parentheses_in_default() { return true; } }; @@ -612,7 +611,10 @@ public: void fix_length_and_dec(); bool fix_fields(THD *thd, Item **ref); longlong val_int() { DBUG_ASSERT(fixed == 1); return value; } - bool check_vcol_func_processor(uchar *int_arg) { return TRUE;} + bool check_vcol_func_processor(void *arg) + { + return mark_unsupported_function(func_name(), "()", arg, VCOL_SESSION_FUNC); + } }; @@ -624,8 +626,12 @@ public: unsigned_flag= 0; } const char *func_name() const { return "cast_as_signed"; } - longlong val_int(); - longlong val_int_from_str(int *error); + longlong val_int() + { + longlong value= args[0]->val_int_signed_typecast(); + null_value= args[0]->null_value; + return value; + } void fix_length_and_dec() { fix_char_length(MY_MIN(args[0]->max_char_length(), @@ -633,6 +639,7 @@ public: } virtual void print(String *str, enum_query_type query_type); uint decimal_precision() const { return args[0]->decimal_precision(); } + bool need_parentheses_in_default() { return true; } }; @@ -644,7 +651,12 @@ public: unsigned_flag= 1; } const char *func_name() const { return "cast_as_unsigned"; } - longlong val_int(); + longlong val_int() + { + longlong value= args[0]->val_int_unsigned_typecast(); + null_value= args[0]->null_value; + return value; + } virtual void print(String *str, enum_query_type query_type); }; @@ -669,6 +681,7 @@ public: void fix_length_and_dec() {} const char *func_name() const { return "decimal_typecast"; } virtual void print(String *str, enum_query_type query_type); + bool need_parentheses_in_default() { return true; } }; @@ -686,6 +699,7 @@ public: void fix_length_and_dec() { maybe_null= 1; } const char *func_name() const { return "double_typecast"; } virtual void print(String *str, enum_query_type query_type); + bool need_parentheses_in_default() { return true; } }; @@ -695,8 +709,8 @@ class Item_func_additive_op :public Item_num_op public: Item_func_additive_op(THD *thd, Item *a, Item *b): Item_num_op(thd, a, b) {} void result_precision(); - bool check_partition_func_processor(uchar *int_arg) {return FALSE;} - bool check_vcol_func_processor(uchar *int_arg) { return FALSE;} + bool check_partition_func_processor(void *int_arg) {return FALSE;} + bool check_vcol_func_processor(void *arg) { return FALSE;} }; @@ -734,8 +748,8 @@ public: double real_op(); my_decimal *decimal_op(my_decimal *); void result_precision(); - bool check_partition_func_processor(uchar *int_arg) {return FALSE;} - bool check_vcol_func_processor(uchar *int_arg) { return FALSE;} + bool check_partition_func_processor(void *int_arg) {return FALSE;} + bool check_vcol_func_processor(void *arg) { return FALSE;} }; @@ -767,8 +781,9 @@ public: print_op(str, query_type); } - bool check_partition_func_processor(uchar *int_arg) {return FALSE;} - bool check_vcol_func_processor(uchar *int_arg) { return FALSE;} + bool check_partition_func_processor(void *int_arg) {return FALSE;} + bool check_vcol_func_processor(void *arg) { return FALSE;} + bool need_parentheses_in_default() { return true; } }; @@ -782,8 +797,8 @@ public: const char *func_name() const { return "%"; } void result_precision(); void fix_length_and_dec(); - bool check_partition_func_processor(uchar *int_arg) {return FALSE;} - bool check_vcol_func_processor(uchar *int_arg) { return FALSE;} + bool check_partition_func_processor(void *int_arg) {return FALSE;} + bool check_vcol_func_processor(void *arg) { return FALSE;} }; @@ -798,8 +813,9 @@ public: enum Functype functype() const { return NEG_FUNC; } void fix_length_and_dec(); uint decimal_precision() const { return args[0]->decimal_precision(); } - bool check_partition_func_processor(uchar *int_arg) {return FALSE;} - bool check_vcol_func_processor(uchar *int_arg) { return FALSE;} + bool check_partition_func_processor(void *int_arg) {return FALSE;} + bool check_vcol_func_processor(void *arg) { return FALSE;} + bool need_parentheses_in_default() { return true; } }; @@ -812,8 +828,8 @@ public: my_decimal *decimal_op(my_decimal *); const char *func_name() const { return "abs"; } void fix_length_and_dec(); - bool check_partition_func_processor(uchar *int_arg) {return FALSE;} - bool check_vcol_func_processor(uchar *int_arg) { return FALSE;} + bool check_partition_func_processor(void *int_arg) {return FALSE;} + bool check_vcol_func_processor(void *arg) { return FALSE;} }; // A class to handle logarithmic and trigonometric functions @@ -975,8 +991,8 @@ public: longlong int_op(); double real_op(); my_decimal *decimal_op(my_decimal *); - bool check_partition_func_processor(uchar *int_arg) {return FALSE;} - bool check_vcol_func_processor(uchar *int_arg) { return FALSE;} + bool check_partition_func_processor(void *int_arg) {return FALSE;} + bool check_vcol_func_processor(void *arg) { return FALSE;} }; @@ -988,8 +1004,8 @@ public: longlong int_op(); double real_op(); my_decimal *decimal_op(my_decimal *); - bool check_partition_func_processor(uchar *int_arg) {return FALSE;} - bool check_vcol_func_processor(uchar *int_arg) { return FALSE;} + bool check_partition_func_processor(void *int_arg) {return FALSE;} + bool check_vcol_func_processor(void *arg) { return FALSE;} }; /* This handles round and truncate */ @@ -1022,9 +1038,9 @@ public: void update_used_tables(); bool fix_fields(THD *thd, Item **ref); void cleanup() { first_eval= TRUE; Item_real_func::cleanup(); } - bool check_vcol_func_processor(uchar *int_arg) + bool check_vcol_func_processor(void *arg) { - return trace_unsupported_by_check_vcol_func_processor(func_name()); + return mark_unsupported_function(func_name(), "()", arg, VCOL_NON_DETERMINISTIC); } private: void seed_random (Item * val); @@ -1245,6 +1261,7 @@ public: { print_op(str, query_type); } + bool need_parentheses_in_default() { return true; } }; class Item_func_bit_or :public Item_func_bit @@ -1317,9 +1334,9 @@ public: unsigned_flag=1; } bool fix_fields(THD *thd, Item **ref); - bool check_vcol_func_processor(uchar *int_arg) + bool check_vcol_func_processor(void *arg) { - return trace_unsupported_by_check_vcol_func_processor(func_name()); + return mark_unsupported_function(func_name(), "()", arg, VCOL_IMPOSSIBLE); } }; @@ -1334,9 +1351,9 @@ public: const char *func_name() const { return "benchmark"; } void fix_length_and_dec() { max_length=1; maybe_null=0; } virtual void print(String *str, enum_query_type query_type); - bool check_vcol_func_processor(uchar *int_arg) + bool check_vcol_func_processor(void *arg) { - return trace_unsupported_by_check_vcol_func_processor(func_name()); + return mark_unsupported_function(func_name(), "()", arg, VCOL_IMPOSSIBLE); } }; @@ -1356,9 +1373,9 @@ public: } bool is_expensive() { return 1; } longlong val_int(); - bool check_vcol_func_processor(uchar *int_arg) + bool check_vcol_func_processor(void *arg) { - return trace_unsupported_by_check_vcol_func_processor(func_name()); + return mark_unsupported_function(func_name(), "()", arg, VCOL_IMPOSSIBLE); } }; @@ -1379,7 +1396,7 @@ class Item_udf_func :public Item_func } protected: udf_handler udf; - bool is_expensive_processor(uchar *arg) { return TRUE; } + bool is_expensive_processor(void *arg) { return TRUE; } public: Item_udf_func(THD *thd, udf_func *udf_arg): @@ -1397,7 +1414,7 @@ public: return res; } void fix_num_length_and_dec(); - void update_used_tables() + void update_used_tables() { /* TODO: Make a member in UDF_INIT and return if a UDF is deterministic or @@ -1451,6 +1468,10 @@ public: table_map not_null_tables() const { return 0; } bool is_expensive() { return 1; } virtual void print(String *str, enum_query_type query_type); + bool check_vcol_func_processor(void *arg) + { + return mark_unsupported_function(func_name(), "()", arg, VCOL_NON_DETERMINISTIC); + } }; @@ -1622,9 +1643,9 @@ class Item_func_get_lock :public Item_int_func } bool const_item() const { return 0; } bool is_expensive() { return 1; } - bool check_vcol_func_processor(uchar *int_arg) + bool check_vcol_func_processor(void *arg) { - return trace_unsupported_by_check_vcol_func_processor(func_name()); + return mark_unsupported_function(func_name(), "()", arg, VCOL_IMPOSSIBLE); } }; @@ -1642,9 +1663,9 @@ public: } bool const_item() const { return 0; } bool is_expensive() { return 1; } - bool check_vcol_func_processor(uchar *int_arg) + bool check_vcol_func_processor(void *arg) { - return trace_unsupported_by_check_vcol_func_processor(func_name()); + return mark_unsupported_function(func_name(), "()", arg, VCOL_IMPOSSIBLE); } }; @@ -1662,9 +1683,9 @@ public: longlong val_int(); const char *func_name() const { return "master_pos_wait"; } void fix_length_and_dec() { max_length=21; maybe_null=1;} - bool check_vcol_func_processor(uchar *int_arg) + bool check_vcol_func_processor(void *arg) { - return trace_unsupported_by_check_vcol_func_processor(func_name()); + return mark_unsupported_function(func_name(), "()", arg, VCOL_IMPOSSIBLE); } }; @@ -1678,9 +1699,9 @@ public: longlong val_int(); const char *func_name() const { return "master_gtid_wait"; } void fix_length_and_dec() { max_length=10+1+10+1+20+1; maybe_null=0;} - bool check_vcol_func_processor(uchar *int_arg) + bool check_vcol_func_processor(void *arg) { - return trace_unsupported_by_check_vcol_func_processor(func_name()); + return mark_unsupported_function(func_name(), "()", arg, VCOL_IMPOSSIBLE); } }; @@ -1706,7 +1727,7 @@ public: Item_func_user_var(THD *thd, Item_func_user_var *item) :Item_hybrid_func(thd, item), m_var_entry(item->m_var_entry), name(item->name) { } - bool check_vcol_func_processor(uchar *int_arg) { return true; } + bool check_vcol_func_processor(void *arg); }; @@ -1767,7 +1788,7 @@ public: bool update(); bool fix_fields(THD *thd, Item **ref); void fix_length_and_dec(); - Field *create_field_for_create_select(THD *thd, TABLE *table) + Field *create_field_for_create_select(TABLE *table) { return result_type() != STRING_RESULT ? create_tmp_field(false, table, MY_INT32_NUM_DECIMAL_DIGITS) : @@ -1791,8 +1812,8 @@ public: void save_org_in_field(Field *field, fast_field_copier data __attribute__ ((__unused__))) { (void)save_in_field(field, 1, 0); } - bool register_field_in_read_map(uchar *arg); - bool register_field_in_bitmap(uchar *arg); + bool register_field_in_read_map(void *arg); + bool register_field_in_bitmap(void *arg); bool set_entry(THD *thd, bool create_if_not_exists); void cleanup(); }; @@ -1913,7 +1934,7 @@ public: bool eq(const Item *item, bool binary_cmp) const; void cleanup(); - bool check_vcol_func_processor(uchar *int_arg) { return TRUE;} + bool check_vcol_func_processor(void *arg); }; @@ -1946,7 +1967,7 @@ public: table= 0; // required by Item_func_match::eq() DBUG_VOID_RETURN; } - bool is_expensive_processor(uchar *arg) { return TRUE; } + bool is_expensive_processor(void *arg) { return TRUE; } enum Functype functype() const { return FT_FUNC; } const char *func_name() const { return "match"; } table_map not_null_tables() const { return 0; } @@ -1959,10 +1980,9 @@ public: bool fix_index(); void init_search(THD *thd, bool no_order); - bool check_vcol_func_processor(uchar *int_arg) + bool check_vcol_func_processor(void *arg) { - /* TODO: consider adding in support for the MATCH-based virtual columns */ - return trace_unsupported_by_check_vcol_func_processor(func_name()); + return mark_unsupported_function("match ... against()", arg, VCOL_IMPOSSIBLE); } private: /** @@ -1998,7 +2018,6 @@ private: return false; } - }; @@ -2018,9 +2037,9 @@ public: longlong val_int(); const char *func_name() const { return "is_free_lock"; } void fix_length_and_dec() { decimals=0; max_length=1; maybe_null=1;} - bool check_vcol_func_processor(uchar *int_arg) + bool check_vcol_func_processor(void *arg) { - return trace_unsupported_by_check_vcol_func_processor(func_name()); + return mark_unsupported_function(func_name(), "()", arg, VCOL_IMPOSSIBLE); } }; @@ -2032,9 +2051,9 @@ public: longlong val_int(); const char *func_name() const { return "is_used_lock"; } void fix_length_and_dec() { decimals=0; max_length=10; maybe_null=1;} - bool check_vcol_func_processor(uchar *int_arg) + bool check_vcol_func_processor(void *arg) { - return trace_unsupported_by_check_vcol_func_processor(func_name()); + return mark_unsupported_function(func_name(), "()", arg, VCOL_IMPOSSIBLE); } }; @@ -2082,10 +2101,9 @@ public: longlong val_int(); const char *func_name() const { return "row_count"; } void fix_length_and_dec() { decimals= 0; maybe_null=0; } - bool check_vcol_func_processor(uchar *int_arg) + bool check_vcol_func_processor(void *arg) { - - return trace_unsupported_by_check_vcol_func_processor(func_name()); + return mark_unsupported_function(func_name(), "()", arg, VCOL_IMPOSSIBLE); } }; @@ -2118,7 +2136,7 @@ private: bool init_result_field(THD *thd); protected: - bool is_expensive_processor(uchar *arg) + bool is_expensive_processor(void *arg) { return is_expensive(); } public: @@ -2139,7 +2157,7 @@ public: enum enum_field_types field_type() const; - Field *create_field_for_create_select(THD *thd, TABLE *table) + Field *create_field_for_create_select(TABLE *table) { return result_type() != STRING_RESULT ? sp_result_field : @@ -2194,7 +2212,7 @@ public: execute(); } - virtual bool change_context_processor(uchar *cntx) + virtual bool change_context_processor(void *cntx) { context= (Name_resolution_context *)cntx; return FALSE; } bool sp_check_access(THD * thd); @@ -2209,11 +2227,8 @@ public: return sp_result_field; } - bool check_vcol_func_processor(uchar *int_arg) - { - return trace_unsupported_by_check_vcol_func_processor(func_name()); - } - bool limit_index_condition_pushdown_processor(uchar *opt_arg) + bool check_vcol_func_processor(void *arg); + bool limit_index_condition_pushdown_processor(void *opt_arg) { return TRUE; } @@ -2227,9 +2242,9 @@ public: longlong val_int(); const char *func_name() const { return "found_rows"; } void fix_length_and_dec() { decimals= 0; maybe_null=0; } - bool check_vcol_func_processor(uchar *int_arg) + bool check_vcol_func_processor(void *arg) { - return trace_unsupported_by_check_vcol_func_processor(func_name()); + return mark_unsupported_function(func_name(), "()", arg, VCOL_IMPOSSIBLE); } }; @@ -2244,9 +2259,10 @@ public: longlong val_int(); void fix_length_and_dec() { max_length= 21; unsigned_flag=1; } - bool check_vcol_func_processor(uchar *int_arg) + table_map used_tables() const { return RAND_TABLE_BIT; } + bool check_vcol_func_processor(void *arg) { - return trace_unsupported_by_check_vcol_func_processor(func_name()); + return mark_unsupported_function(func_name(), "()", arg, VCOL_NON_DETERMINISTIC); } }; diff --git a/sql/item_geofunc.cc b/sql/item_geofunc.cc index 39d06fd7a26..c856aa985b3 100644 --- a/sql/item_geofunc.cc +++ b/sql/item_geofunc.cc @@ -1,6 +1,5 @@ -/* - Copyright (c) 2003-2007 MySQL AB, 2009, 2010 Sun Microsystems, Inc. - Use is subject to license terms. +/* Copyright (c) 2003, 2016, Oracle and/or its affiliates. + Copyright (c) 2011, 2016, MariaDB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -41,7 +40,7 @@ #include "opt_range.h" -Field *Item_geometry_func::create_field_for_create_select(THD *thd, TABLE *t_arg) +Field *Item_geometry_func::create_field_for_create_select(TABLE *t_arg) { Field *result; if ((result= new Field_geom(max_length, maybe_null, name, t_arg->s, diff --git a/sql/item_geofunc.h b/sql/item_geofunc.h index 56e2a729924..58e1d0a78fb 100644 --- a/sql/item_geofunc.h +++ b/sql/item_geofunc.h @@ -1,8 +1,8 @@ #ifndef ITEM_GEOFUNC_INCLUDED #define ITEM_GEOFUNC_INCLUDED -/* Copyright (c) 2000, 2010 Oracle and/or its affiliates. - Copyright (C) 2011, 2015 MariaDB +/* Copyright (c) 2000, 2016 Oracle and/or its affiliates. + Copyright (C) 2011, 2016, MariaDB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -40,7 +40,7 @@ public: Item_geometry_func(THD *thd, List &list): Item_str_func(thd, list) {} void fix_length_and_dec(); enum_field_types field_type() const { return MYSQL_TYPE_GEOMETRY; } - Field *create_field_for_create_select(THD *thd, TABLE *table); + Field *create_field_for_create_select(TABLE *table); }; class Item_func_geometry_from_text: public Item_geometry_func @@ -259,7 +259,7 @@ public: if (args[i]->fixed && args[i]->field_type() != MYSQL_TYPE_GEOMETRY) { String str; - args[i]->print(&str, QT_ORDINARY); + args[i]->print(&str, QT_NO_DATA_EXPANSION); str.append('\0'); my_error(ER_ILLEGAL_VALUE_FOR_TYPE, MYF(0), "non geometric", str.ptr()); @@ -299,6 +299,7 @@ public: return add_key_fields_optimize_op(join, key_fields, and_level, usable_tables, sargables, false); } + bool need_parentheses_in_default() { return false; } }; @@ -339,6 +340,7 @@ public: { } longlong val_int(); const char *func_name() const { return "st_relate"; } + bool need_parentheses_in_default() { return false; } }; @@ -429,6 +431,7 @@ public: longlong val_int(); const char *func_name() const { return "st_isempty"; } void fix_length_and_dec() { maybe_null= 1; } + bool need_parentheses_in_default() { return false; } }; class Item_func_issimple: public Item_int_func @@ -613,6 +616,10 @@ class Item_func_gis_debug: public Item_int_func { null_value= false; } const char *func_name() const { return "st_gis_debug"; } longlong val_int(); + bool check_vcol_func_processor(void *arg) + { + return mark_unsupported_function(func_name(), "()", arg, VCOL_IMPOSSIBLE); + } }; #endif diff --git a/sql/item_inetfunc.h b/sql/item_inetfunc.h index 82a4405df1e..f5a0596d860 100644 --- a/sql/item_inetfunc.h +++ b/sql/item_inetfunc.h @@ -76,6 +76,7 @@ public: public: virtual longlong val_int(); + bool need_parentheses_in_default() { return false; } protected: virtual bool calc_value(const String *arg) = 0; diff --git a/sql/item_row.cc b/sql/item_row.cc index 56d73f7b759..a17d2507547 100644 --- a/sql/item_row.cc +++ b/sql/item_row.cc @@ -72,7 +72,7 @@ bool Item_row::fix_fields(THD *thd, Item **ref) bool -Item_row::eval_not_null_tables(uchar *opt_arg) +Item_row::eval_not_null_tables(void *opt_arg) { Item **arg,**arg_end; not_null_tables_cache= 0; diff --git a/sql/item_row.h b/sql/item_row.h index ddb6f0835f2..eb2686090e1 100644 --- a/sql/item_row.h +++ b/sql/item_row.h @@ -104,14 +104,14 @@ public: table_map not_null_tables() const { return not_null_tables_cache; } virtual void print(String *str, enum_query_type query_type); - bool walk(Item_processor processor, bool walk_subquery, uchar *arg) + bool walk(Item_processor processor, bool walk_subquery, void *arg) { if (walk_args(processor, walk_subquery, arg)) return true; return (this->*processor)(arg); } Item *transform(THD *thd, Item_transformer transformer, uchar *arg); - bool eval_not_null_tables(uchar *opt_arg); + bool eval_not_null_tables(void *opt_arg); uint cols() { return arg_count; } Item* element_index(uint i) { return args[i]; } @@ -119,7 +119,7 @@ public: bool check_cols(uint c); bool null_inside() { return with_null; }; void bring_value(); - bool check_vcol_func_processor(uchar *int_arg) {return FALSE; } + bool check_vcol_func_processor(void *arg) {return FALSE; } }; #endif /* ITEM_ROW_INCLUDED */ diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 7c1c5f7da7d..bff31ec7b26 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -54,7 +54,6 @@ #include #include #include "sha1.h" -#include C_MODE_START #include "../mysys/my_static.h" // For soundex_map C_MODE_END @@ -814,9 +813,10 @@ String *Item_func_des_encrypt::val_str(String *str) /* We make good 24-byte (168 bit) key from given plaintext key with MD5 */ bzero((char*) &ivec,sizeof(ivec)); - EVP_BytesToKey(EVP_des_ede3_cbc(),EVP_md5(),NULL, + if (!EVP_BytesToKey(EVP_des_ede3_cbc(),EVP_md5(),NULL, (uchar*) keystr->ptr(), (int) keystr->length(), - 1, (uchar*) &keyblock,ivec); + 1, (uchar*) &keyblock,ivec)) + goto error; DES_set_key_unchecked(&keyblock.key1,&keyschedule.ks1); DES_set_key_unchecked(&keyblock.key2,&keyschedule.ks2); DES_set_key_unchecked(&keyblock.key3,&keyschedule.ks3); @@ -909,9 +909,10 @@ String *Item_func_des_decrypt::val_str(String *str) goto error; bzero((char*) &ivec,sizeof(ivec)); - EVP_BytesToKey(EVP_des_ede3_cbc(),EVP_md5(),NULL, + if (!EVP_BytesToKey(EVP_des_ede3_cbc(),EVP_md5(),NULL, (uchar*) keystr->ptr(),(int) keystr->length(), - 1,(uchar*) &keyblock,ivec); + 1,(uchar*) &keyblock,ivec)) + goto error; // Here we set all 64-bit keys (56 effective) one by one DES_set_key_unchecked(&keyblock.key1,&keyschedule.ks1); DES_set_key_unchecked(&keyblock.key2,&keyschedule.ks2); @@ -2401,7 +2402,7 @@ bool Item_func_current_user::fix_fields(THD *thd, Item **ref) if (Item_func_sysconst::fix_fields(thd, ref)) return TRUE; - Security_context *ctx= context->security_ctx + Security_context *ctx= context && context->security_ctx ? context->security_ctx : thd->security_ctx; return init(ctx->priv_user, ctx->priv_host); } @@ -2411,7 +2412,7 @@ bool Item_func_current_role::fix_fields(THD *thd, Item **ref) if (Item_func_sysconst::fix_fields(thd, ref)) return 1; - Security_context *ctx= context->security_ctx + Security_context *ctx= context && context->security_ctx ? context->security_ctx : thd->security_ctx; if (ctx->priv_role[0]) @@ -2420,6 +2421,7 @@ bool Item_func_current_role::fix_fields(THD *thd, Item **ref) system_charset_info)) return 1; + null_value= maybe_null= 0; str_value.mark_as_const(); return 0; } @@ -2427,7 +2429,6 @@ bool Item_func_current_role::fix_fields(THD *thd, Item **ref) return 0; } - void Item_func_soundex::fix_length_and_dec() { uint32 char_length= args[0]->max_char_length(); @@ -3534,7 +3535,7 @@ void Item_func_weight_string::fix_length_and_dec() { uint char_length; char_length= ((cs->state & MY_CS_STRNXFRM_BAD_NWEIGHTS) || !nweights) ? - args[0]->max_char_length() : nweights; + args[0]->max_char_length() : nweights * cs->levels_for_order; max_length= cs->coll->strnxfrmlen(cs, char_length * cs->mbmaxlen); } maybe_null= 1; @@ -4118,7 +4119,7 @@ longlong Item_func_crc32::val_int() return 0; /* purecov: inspected */ } null_value=0; - return (longlong) crc32(0L, (uchar*)res->ptr(), res->length()); + return (longlong) my_checksum(0L, (uchar*)res->ptr(), res->length()); } #ifdef HAVE_COMPRESS @@ -4924,23 +4925,8 @@ longlong Item_dyncol_get::val_int() unsigned_flag= 0; // Make it possible for caller to detect sign return val.x.long_value; case DYN_COL_DOUBLE: - { - bool error; - longlong num; - - num= double_to_longlong(val.x.double_value, unsigned_flag, &error); - if (error) - { - char buff[30]; - sprintf(buff, "%lg", val.x.double_value); - push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, - ER_DATA_OVERFLOW, - ER_THD(thd, ER_DATA_OVERFLOW), - buff, - unsigned_flag ? "UNSIGNED INT" : "INT"); - } - return num; - } + return Converter_double_to_longlong_with_warn(thd, val.x.double_value, + unsigned_flag).result(); case DYN_COL_STRING: { int error; diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h index 0ff38157c25..fd63c571359 100644 --- a/sql/item_strfunc.h +++ b/sql/item_strfunc.h @@ -517,9 +517,9 @@ public: String *val_str(String *); void fix_length_and_dec() { maybe_null=1; max_length = 13; } const char *func_name() const { return "encrypt"; } - bool check_vcol_func_processor(uchar *int_arg) + bool check_vcol_func_processor(void *arg) { - return trace_unsupported_by_check_vcol_func_processor(func_name()); + return FALSE; } }; @@ -572,10 +572,10 @@ public: call */ virtual const char *fully_qualified_func_name() const = 0; - bool check_vcol_func_processor(uchar *int_arg) + bool check_vcol_func_processor(void *arg) { - return trace_unsupported_by_check_vcol_func_processor( - fully_qualified_func_name()); + return mark_unsupported_function(fully_qualified_func_name(), arg, + VCOL_SESSION_FUNC); } }; @@ -635,6 +635,12 @@ public: bool fix_fields(THD *thd, Item **ref); const char *func_name() const { return "current_user"; } const char *fully_qualified_func_name() const { return "current_user()"; } + bool check_vcol_func_processor(void *arg) + { + context= 0; + return mark_unsupported_function(fully_qualified_func_name(), arg, + VCOL_SESSION_FUNC); + } }; @@ -657,6 +663,12 @@ public: DBUG_ASSERT(fixed == 1); return (null_value ? 0 : &str_value); } + bool check_vcol_func_processor(void *arg) + { + context= 0; + return mark_unsupported_function(fully_qualified_func_name(), arg, + VCOL_SESSION_FUNC); + } }; @@ -722,7 +734,7 @@ public: Item_str_func(thd, list) { collation.set(cs); } String *val_str(String *); - void fix_length_and_dec() + void fix_length_and_dec() { max_length= arg_count * 4; } @@ -761,6 +773,10 @@ public: String *val_str(String *); void fix_length_and_dec(); const char *func_name() const { return "binlog_gtid_pos"; } + bool check_vcol_func_processor(void *arg) + { + return mark_unsupported_function(func_name(), "()", arg, VCOL_IMPOSSIBLE); + } }; @@ -900,6 +916,7 @@ public: } virtual void print(String *str, enum_query_type query_type); const char *func_name() const { return "cast_as_binary"; } + bool need_parentheses_in_default() { return true; } }; @@ -916,9 +933,9 @@ public: maybe_null=1; max_length=MAX_BLOB_WIDTH; } - bool check_vcol_func_processor(uchar *int_arg) + bool check_vcol_func_processor(void *arg) { - return trace_unsupported_by_check_vcol_func_processor(func_name()); + return mark_unsupported_function(func_name(), "()", arg, VCOL_IMPOSSIBLE); } }; @@ -1052,6 +1069,7 @@ public: /* this function is transparent for view updating */ return args[0]->field_for_view_update(); } + bool need_parentheses_in_default() { return true; } }; @@ -1183,9 +1201,9 @@ public: } const char *func_name() const{ return "uuid"; } String *val_str(String *); - bool check_vcol_func_processor(uchar *int_arg) + bool check_vcol_func_processor(void *arg) { - return trace_unsupported_by_check_vcol_func_processor(func_name()); + return mark_unsupported_function(func_name(), "()", arg, VCOL_NON_DETERMINISTIC); } }; @@ -1254,6 +1272,22 @@ public: const char *func_name() const { return "column_get"; } String *val_str(String *); longlong val_int(); + longlong val_int_signed_typecast() + { + unsigned_flag= false; // Mark that we want to have a signed value + longlong value= val_int(); // val_int() can change unsigned_flag + if (!null_value && unsigned_flag && value < 0) + push_note_converted_to_negative_complement(current_thd); + return value; + } + longlong val_int_unsigned_typecast() + { + unsigned_flag= true; // Mark that we want to have an unsigned value + longlong value= val_int(); // val_int() can change unsigned_flag + if (!null_value && unsigned_flag == 0 && value < 0) + push_note_converted_to_positive_complement(current_thd); + return value; + } double val_real(); my_decimal *val_decimal(my_decimal *); bool get_dyn_value(THD *thd, DYNAMIC_COLUMN_VALUE *val, String *tmp); diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index 7d458282825..fde85e4a120 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -86,7 +86,6 @@ void Item_subselect::init(st_select_lex *select_lex, DBUG_PRINT("enter", ("select_lex: 0x%lx this: 0x%lx", (ulong) select_lex, (ulong) this)); unit= select_lex->master_unit(); - thd= unit->thd; if (unit->item) { @@ -105,7 +104,7 @@ void Item_subselect::init(st_select_lex *select_lex, Item can be changed in JOIN::prepare while engine in JOIN::optimize => we do not copy old_engine here */ - thd->change_item_tree((Item**)&unit->item, this); + unit->thd->change_item_tree((Item**)&unit->item, this); engine->change_result(this, result, TRUE); } } @@ -120,9 +119,9 @@ void Item_subselect::init(st_select_lex *select_lex, NO_MATTER : outer_select->parsing_place); if (unit->is_union()) - engine= new subselect_union_engine(thd, unit, result, this); + engine= new subselect_union_engine(unit, result, this); else - engine= new subselect_single_select_engine(thd, select_lex, result, this); + engine= new subselect_single_select_engine(select_lex, result, this); } { SELECT_LEX *upper= unit->outer_select(); @@ -239,6 +238,10 @@ bool Item_subselect::fix_fields(THD *thd_param, Item **ref) uint8 uncacheable; bool res; + thd= thd_param; + + DBUG_ASSERT(unit->thd == thd); + status_var_increment(thd_param->status_var.feature_subquery); DBUG_ASSERT(fixed == 0); @@ -261,7 +264,7 @@ bool Item_subselect::fix_fields(THD *thd_param, Item **ref) return TRUE; - if (!(res= engine->prepare())) + if (!(res= engine->prepare(thd))) { // all transformation is done (used by prepared statements) changed= 1; @@ -324,7 +327,7 @@ end: } -bool Item_subselect::enumerate_field_refs_processor(uchar *arg) +bool Item_subselect::enumerate_field_refs_processor(void *arg) { List_iterator it(upper_refs); Ref_to_outside *upper; @@ -337,7 +340,7 @@ bool Item_subselect::enumerate_field_refs_processor(uchar *arg) return FALSE; } -bool Item_subselect::mark_as_eliminated_processor(uchar *arg) +bool Item_subselect::mark_as_eliminated_processor(void *arg) { eliminated= TRUE; return FALSE; @@ -354,7 +357,7 @@ bool Item_subselect::mark_as_eliminated_processor(uchar *arg) FALSE to force the evaluation of the processor for the subsequent items. */ -bool Item_subselect::eliminate_subselect_processor(uchar *arg) +bool Item_subselect::eliminate_subselect_processor(void *arg) { unit->item= NULL; unit->exclude_from_tree(); @@ -374,7 +377,7 @@ bool Item_subselect::eliminate_subselect_processor(uchar *arg) FALSE to force the evaluation of the processor for the subsequent items. */ -bool Item_subselect::set_fake_select_as_master_processor(uchar *arg) +bool Item_subselect::set_fake_select_as_master_processor(void *arg) { SELECT_LEX *fake_select= (SELECT_LEX*) arg; /* @@ -522,8 +525,7 @@ void Item_subselect::recalc_used_tables(st_select_lex *new_parent, Field_fixer fixer; fixer.used_tables= 0; fixer.new_parent= new_parent; - upper->item->walk(&Item::enumerate_field_refs_processor, FALSE, - (uchar*)&fixer); + upper->item->walk(&Item::enumerate_field_refs_processor, 0, &fixer); used_tables_cache |= fixer.used_tables; upper->item->walk(&Item::update_table_bitmaps_processor, FALSE, NULL); /* @@ -566,22 +568,34 @@ bool Item_subselect::is_expensive() for (SELECT_LEX *sl= unit->first_select(); sl; sl= sl->next_select()) { JOIN *cur_join= sl->join; + + /* not optimized subquery */ if (!cur_join) - continue; + return true; + + /* very simple subquery */ + if (!cur_join->tables_list && !sl->first_inner_unit()) + return false; + + /* + If the subquery is not optimised or in the process of optimization + it supposed to be expensive + */ + if (!cur_join->optimized) + return true; /* Subqueries whose result is known after optimization are not expensive. Such subqueries have all tables optimized away, thus have no join plan. */ - if (cur_join->optimized && - (cur_join->zero_result_cause || !cur_join->tables_list)) + if ((cur_join->zero_result_cause || !cur_join->tables_list)) return false; /* If a subquery is not optimized we cannot estimate its cost. A subquery is considered optimized if it has a join plan. */ - if (!(cur_join->optimized && cur_join->join_tab)) + if (!cur_join->join_tab) return true; if (sl->first_inner_unit()) @@ -601,7 +615,7 @@ bool Item_subselect::is_expensive() bool Item_subselect::walk(Item_processor processor, bool walk_subquery, - uchar *argument) + void *argument) { if (!(unit->uncacheable & ~UNCACHEABLE_DEPENDENT) && engine->is_executed() && !unit->describe) @@ -700,7 +714,7 @@ void Item_subselect::get_cache_parameters(List ¶meters) unit->first_select()->nest_level, // nest_level TRUE // collect }; - walk(&Item::collect_outer_ref_processor, TRUE, (uchar*)&prm); + walk(&Item::collect_outer_ref_processor, TRUE, &prm); } int Item_in_subselect::optimize(double *out_rows, double *cost) @@ -1781,7 +1795,7 @@ Item_in_subselect::single_value_transformer(JOIN *join) select and is not outer anymore. */ where_item->walk(&Item::remove_dependence_processor, 0, - (uchar *) select_lex->outer_select()); + select_lex->outer_select()); /* fix_field of substitution item will be done in time of substituting. @@ -2214,7 +2228,7 @@ Item_in_subselect::row_value_transformer(JOIN *join) /* The uncacheable property controls a number of actions, e.g. whether to save/restore (via init_save_join_tab/restore_tmp) the original JOIN for - plans with a temp table where the original JOIN was overriden by + plans with a temp table where the original JOIN was overridden by make_simple_join. The UNCACHEABLE_EXPLAIN is ignored by EXPLAIN, thus non-correlated subqueries will not appear as such to EXPLAIN. */ @@ -2510,7 +2524,7 @@ bool Item_in_subselect::create_in_to_exists_cond(JOIN *join_arg) /* The uncacheable property controls a number of actions, e.g. whether to save/restore (via init_save_join_tab/restore_tmp) the original JOIN for - plans with a temp table where the original JOIN was overriden by + plans with a temp table where the original JOIN was overridden by make_simple_join. The UNCACHEABLE_EXPLAIN is ignored by EXPLAIN, thus non-correlated subqueries will not appear as such to EXPLAIN. */ @@ -2747,7 +2761,7 @@ alloc_err: @return TRUE in case of error and FALSE otherwise. */ -bool Item_exists_subselect::exists2in_processor(uchar *opt_arg) +bool Item_exists_subselect::exists2in_processor(void *opt_arg) { THD *thd= (THD *)opt_arg; SELECT_LEX *first_select=unit->first_select(), *save_select; @@ -2797,7 +2811,7 @@ bool Item_exists_subselect::exists2in_processor(uchar *opt_arg) unit->first_select()->nest_level, // nest_level FALSE // collect }; - walk(&Item::collect_outer_ref_processor, TRUE, (uchar*)&prm); + walk(&Item::collect_outer_ref_processor, TRUE, &prm); DBUG_ASSERT(prm.count > 0); DBUG_ASSERT(prm.count >= (uint)eqs.elements()); will_be_correlated= prm.count > (uint)eqs.elements(); @@ -2935,7 +2949,7 @@ bool Item_exists_subselect::exists2in_processor(uchar *opt_arg) uint i; for (i= 0; i < (uint)eqs.elements(); i++) if (eqs.at(i).outer_exp-> - walk(&Item::find_item_processor, TRUE, (uchar*)upper->item)) + walk(&Item::find_item_processor, TRUE, upper->item)) break; if (i == (uint)eqs.elements() && (in_subs->upper_refs.push_back(upper, thd->stmt_arena->mem_root))) @@ -3166,9 +3180,12 @@ bool Item_in_subselect::fix_fields(THD *thd_arg, Item **ref) { uint outer_cols_num; List *inner_cols; - char const *save_where= thd->where; + char const *save_where= thd_arg->where; DBUG_ENTER("Item_in_subselect::fix_fields"); + thd= thd_arg; + DBUG_ASSERT(unit->thd == thd); + if (test_strategy(SUBS_SEMI_JOIN)) DBUG_RETURN( !( (*ref)= new (thd->mem_root) Item_int(thd, 1)) ); @@ -3285,7 +3302,8 @@ bool Item_in_subselect::setup_mat_engine() if (!(mat_engine= new subselect_hash_sj_engine(thd, this, select_engine))) DBUG_RETURN(TRUE); - if (mat_engine->init(&select_engine->join->fields_list, + if (mat_engine->prepare(thd) || + mat_engine->init(&select_engine->join->fields_list, engine->get_identifier())) DBUG_RETURN(TRUE); @@ -3402,10 +3420,10 @@ void subselect_engine::set_thd(THD *thd_arg) subselect_single_select_engine:: -subselect_single_select_engine(THD *thd_arg, st_select_lex *select, +subselect_single_select_engine(st_select_lex *select, select_result_interceptor *result_arg, Item_subselect *item_arg) - :subselect_engine(thd_arg, item_arg, result_arg), + :subselect_engine(item_arg, result_arg), prepared(0), executed(0), select_lex(select), join(0) { @@ -3486,10 +3504,10 @@ void subselect_uniquesubquery_engine::cleanup() } -subselect_union_engine::subselect_union_engine(THD *thd_arg, st_select_lex_unit *u, +subselect_union_engine::subselect_union_engine(st_select_lex_unit *u, select_result_interceptor *result_arg, Item_subselect *item_arg) - :subselect_engine(thd_arg, item_arg, result_arg) + :subselect_engine(item_arg, result_arg) { unit= u; unit->item= item_arg; @@ -3522,10 +3540,11 @@ subselect_union_engine::subselect_union_engine(THD *thd_arg, st_select_lex_unit @retval 1 if error */ -int subselect_single_select_engine::prepare() +int subselect_single_select_engine::prepare(THD *thd) { if (prepared) return 0; + set_thd(thd); if (select_lex->join) { select_lex->cleanup(); @@ -3553,12 +3572,13 @@ int subselect_single_select_engine::prepare() return 0; } -int subselect_union_engine::prepare() +int subselect_union_engine::prepare(THD *thd_arg) { + set_thd(thd_arg); return unit->prepare(thd, result, SELECT_NO_UNLOCK); } -int subselect_uniquesubquery_engine::prepare() +int subselect_uniquesubquery_engine::prepare(THD *) { /* Should never be called. */ DBUG_ASSERT(FALSE); @@ -4624,7 +4644,7 @@ subselect_hash_sj_engine::choose_partial_match_strategy( /* Choose according to global optimizer switch. If only one of the switches is 'ON', then the remaining strategy is the only possible one. The only cases - when this will be overriden is when the total size of all buffers for the + when this will be overridden is when the total size of all buffers for the merge strategy is bigger than the 'rowid_merge_buff_size' system variable, or if there isn't enough physical memory to allocate the buffers. */ @@ -5015,13 +5035,14 @@ subselect_hash_sj_engine::~subselect_hash_sj_engine() } -int subselect_hash_sj_engine::prepare() +int subselect_hash_sj_engine::prepare(THD *thd_arg) { /* Create and optimize the JOIN that will be used to materialize the subquery if not yet created. */ - return materialize_engine->prepare(); + set_thd(thd_arg); + return materialize_engine->prepare(thd); } @@ -5396,7 +5417,7 @@ int subselect_hash_sj_engine::exec() if (strategy == PARTIAL_MATCH_MERGE) { pm_engine= - new subselect_rowid_merge_engine(thd, (subselect_uniquesubquery_engine*) + new subselect_rowid_merge_engine((subselect_uniquesubquery_engine*) lookup_engine, tmp_table, count_pm_keys, has_covering_null_row, @@ -5405,6 +5426,7 @@ int subselect_hash_sj_engine::exec() item, result, semi_join_conds->argument_list()); if (!pm_engine || + pm_engine->prepare(thd) || ((subselect_rowid_merge_engine*) pm_engine)-> init(nn_key_parts, &partial_match_key_parts)) { @@ -5422,13 +5444,14 @@ int subselect_hash_sj_engine::exec() if (strategy == PARTIAL_MATCH_SCAN) { if (!(pm_engine= - new subselect_table_scan_engine(thd, (subselect_uniquesubquery_engine*) + new subselect_table_scan_engine((subselect_uniquesubquery_engine*) lookup_engine, tmp_table, item, result, semi_join_conds->argument_list(), has_covering_null_row, has_covering_null_columns, - count_columns_with_nulls))) + count_columns_with_nulls)) || + pm_engine->prepare(thd)) { /* This is an irrecoverable error. */ res= 1; @@ -5877,14 +5900,14 @@ void Ordered_key::print(String *str) subselect_partial_match_engine::subselect_partial_match_engine( - THD *thd_arg, subselect_uniquesubquery_engine *engine_arg, + subselect_uniquesubquery_engine *engine_arg, TABLE *tmp_table_arg, Item_subselect *item_arg, select_result_interceptor *result_arg, List *equi_join_conds_arg, bool has_covering_null_row_arg, bool has_covering_null_columns_arg, uint count_columns_with_nulls_arg) - :subselect_engine(thd_arg, item_arg, result_arg), + :subselect_engine(item_arg, result_arg), tmp_table(tmp_table_arg), lookup_engine(engine_arg), equi_join_conds(equi_join_conds_arg), has_covering_null_row(has_covering_null_row_arg), @@ -6497,7 +6520,7 @@ end: subselect_table_scan_engine::subselect_table_scan_engine( - THD *thd_arg, subselect_uniquesubquery_engine *engine_arg, + subselect_uniquesubquery_engine *engine_arg, TABLE *tmp_table_arg, Item_subselect *item_arg, select_result_interceptor *result_arg, @@ -6505,7 +6528,7 @@ subselect_table_scan_engine::subselect_table_scan_engine( bool has_covering_null_row_arg, bool has_covering_null_columns_arg, uint count_columns_with_nulls_arg) - :subselect_partial_match_engine(thd_arg, engine_arg, tmp_table_arg, item_arg, + :subselect_partial_match_engine(engine_arg, tmp_table_arg, item_arg, result_arg, equi_join_conds_arg, has_covering_null_row_arg, has_covering_null_columns_arg, diff --git a/sql/item_subselect.h b/sql/item_subselect.h index e72f75726ed..178c875d5e5 100644 --- a/sql/item_subselect.h +++ b/sql/item_subselect.h @@ -222,14 +222,14 @@ public: */ virtual void reset_value_registration() {} enum_parsing_place place() { return parsing_place; } - bool walk(Item_processor processor, bool walk_subquery, uchar *arg); - bool mark_as_eliminated_processor(uchar *arg); - bool eliminate_subselect_processor(uchar *arg); - bool set_fake_select_as_master_processor(uchar *arg); - bool enumerate_field_refs_processor(uchar *arg); - bool check_vcol_func_processor(uchar *int_arg) + bool walk(Item_processor processor, bool walk_subquery, void *arg); + bool mark_as_eliminated_processor(void *arg); + bool eliminate_subselect_processor(void *arg); + bool set_fake_select_as_master_processor(void *arg); + bool enumerate_field_refs_processor(void *arg); + bool check_vcol_func_processor(void *arg) { - return trace_unsupported_by_check_vcol_func_processor("subselect"); + return mark_unsupported_function("select ...", arg, VCOL_IMPOSSIBLE); } /** Callback to test if an IN predicate is expensive. @@ -240,7 +240,7 @@ public: @retval TRUE if the predicate is expensive @retval FALSE otherwise */ - bool is_expensive_processor(uchar *arg) { return is_expensive(); } + bool is_expensive_processor(void *arg) { return is_expensive(); } /** Get the SELECT_LEX structure associated with this Item. @@ -249,9 +249,9 @@ public: st_select_lex* get_select_lex(); virtual bool expr_cache_is_needed(THD *); virtual void get_cache_parameters(List ¶meters); - virtual bool is_subquery_processor (uchar *opt_arg) { return 1; } - bool exists2in_processor(uchar *opt_arg) { return 0; } - bool limit_index_condition_pushdown_processor(uchar *opt_arg) + virtual bool is_subquery_processor (void *opt_arg) { return 1; } + bool exists2in_processor(void *opt_arg) { return 0; } + bool limit_index_condition_pushdown_processor(void *opt_arg) { return TRUE; } @@ -400,7 +400,7 @@ public: bool select_transformer(JOIN *join); void top_level_item() { abort_on_null=1; } inline bool is_top_level_item() { return abort_on_null; } - bool exists2in_processor(uchar *opt_arg); + bool exists2in_processor(void *opt_arg); Item* expr_cache_insert_transformer(THD *thd, uchar *unused); @@ -706,7 +706,7 @@ public: in_strategy= (SUBS_STRATEGY_CHOSEN | strategy); DBUG_VOID_RETURN; } - bool exists2in_processor(uchar *opt_arg __attribute__((unused))) + bool exists2in_processor(void *opt_arg __attribute__((unused))) { return 0; }; @@ -761,7 +761,7 @@ public: INDEXSUBQUERY_ENGINE, HASH_SJ_ENGINE, ROWID_MERGE_ENGINE, TABLE_SCAN_ENGINE}; - subselect_engine(THD *thd_arg, Item_subselect *si, + subselect_engine(Item_subselect *si, select_result_interceptor *res) { result= res; @@ -769,7 +769,6 @@ public: cmp_type= res_type= STRING_RESULT; res_field_type= MYSQL_TYPE_VAR_STRING; maybe_null= 0; - set_thd(thd_arg); } virtual ~subselect_engine() {}; // to satisfy compiler virtual void cleanup()= 0; @@ -780,7 +779,7 @@ public: */ void set_thd(THD *thd_arg); THD * get_thd() { return thd; } - virtual int prepare()= 0; + virtual int prepare(THD *)= 0; virtual void fix_length_and_dec(Item_cache** row)= 0; /* Execute the engine @@ -835,11 +834,11 @@ class subselect_single_select_engine: public subselect_engine st_select_lex *select_lex; /* corresponding select_lex */ JOIN * join; /* corresponding JOIN structure */ public: - subselect_single_select_engine(THD *thd_arg, st_select_lex *select, + subselect_single_select_engine(st_select_lex *select, select_result_interceptor *result, Item_subselect *item); void cleanup(); - int prepare(); + int prepare(THD *thd); void fix_length_and_dec(Item_cache** row); int exec(); uint cols(); @@ -869,11 +868,11 @@ class subselect_union_engine: public subselect_engine { st_select_lex_unit *unit; /* corresponding unit structure */ public: - subselect_union_engine(THD *thd_arg, st_select_lex_unit *u, + subselect_union_engine(st_select_lex_unit *u, select_result_interceptor *result, Item_subselect *item); void cleanup(); - int prepare(); + int prepare(THD *); void fix_length_and_dec(Item_cache** row); int exec(); uint cols(); @@ -926,11 +925,11 @@ public: // constructor can assign THD because it will be called after JOIN::prepare subselect_uniquesubquery_engine(THD *thd_arg, st_join_table *tab_arg, Item_subselect *subs, Item *where) - :subselect_engine(thd_arg, subs, 0), tab(tab_arg), cond(where) + :subselect_engine(subs, 0), tab(tab_arg), cond(where) {} ~subselect_uniquesubquery_engine(); void cleanup(); - int prepare(); + int prepare(THD *); void fix_length_and_dec(Item_cache** row); int exec(); uint cols() { return 1; } @@ -1058,7 +1057,7 @@ public: subselect_hash_sj_engine(THD *thd_arg, Item_subselect *in_predicate, subselect_single_select_engine *old_engine) - : subselect_engine(thd_arg, in_predicate, NULL), + : subselect_engine(in_predicate, NULL), tmp_table(NULL), is_materialized(FALSE), materialize_engine(old_engine), materialize_join(NULL), semi_join_conds(NULL), lookup_engine(NULL), count_partial_match_columns(0), count_null_only_columns(0), @@ -1068,7 +1067,7 @@ public: bool init(List *tmp_columns, uint subquery_id); void cleanup(); - int prepare(); + int prepare(THD *); int exec(); virtual void print(String *str, enum_query_type query_type); uint cols() @@ -1347,15 +1346,14 @@ protected: protected: virtual bool partial_match()= 0; public: - subselect_partial_match_engine(THD *thd_arg, - subselect_uniquesubquery_engine *engine_arg, + subselect_partial_match_engine(subselect_uniquesubquery_engine *engine_arg, TABLE *tmp_table_arg, Item_subselect *item_arg, select_result_interceptor *result_arg, List *equi_join_conds_arg, bool has_covering_null_row_arg, bool has_covering_null_columns_arg, uint count_columns_with_nulls_arg); - int prepare() { return 0; } + int prepare(THD *thd_arg) { set_thd(thd_arg); return 0; } int exec(); void fix_length_and_dec(Item_cache**) {} uint cols() { /* TODO: what is the correct value? */ return 1; } @@ -1442,8 +1440,7 @@ protected: bool exists_complementing_null_row(MY_BITMAP *keys_to_complement); bool partial_match(); public: - subselect_rowid_merge_engine(THD *thd_arg, - subselect_uniquesubquery_engine *engine_arg, + subselect_rowid_merge_engine(subselect_uniquesubquery_engine *engine_arg, TABLE *tmp_table_arg, uint merge_keys_count_arg, bool has_covering_null_row_arg, bool has_covering_null_columns_arg, @@ -1451,7 +1448,7 @@ public: Item_subselect *item_arg, select_result_interceptor *result_arg, List *equi_join_conds_arg) - :subselect_partial_match_engine(thd_arg, engine_arg, tmp_table_arg, + :subselect_partial_match_engine(engine_arg, tmp_table_arg, item_arg, result_arg, equi_join_conds_arg, has_covering_null_row_arg, has_covering_null_columns_arg, @@ -1470,8 +1467,7 @@ class subselect_table_scan_engine: public subselect_partial_match_engine protected: bool partial_match(); public: - subselect_table_scan_engine(THD *thd_arg, - subselect_uniquesubquery_engine *engine_arg, + subselect_table_scan_engine(subselect_uniquesubquery_engine *engine_arg, TABLE *tmp_table_arg, Item_subselect *item_arg, select_result_interceptor *result_arg, List *equi_join_conds_arg, diff --git a/sql/item_sum.cc b/sql/item_sum.cc index f774ee5a561..cc7a76213f0 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -385,7 +385,7 @@ bool Item_sum::register_sum_func(THD *thd, Item **ref) } -bool Item_sum::collect_outer_ref_processor(uchar *param) +bool Item_sum::collect_outer_ref_processor(void *param) { Collect_deps_prm *prm= (Collect_deps_prm *)param; SELECT_LEX *ds; @@ -579,6 +579,12 @@ Item *Item_sum::result_item(THD *thd, Field *field) return new (thd->mem_root) Item_field(thd, field); } +bool Item_sum::check_vcol_func_processor(void *arg) +{ + return mark_unsupported_function(func_name(), ")", arg, VCOL_IMPOSSIBLE); +} + + /** Compare keys consisting of single field that cannot be compared as binary. @@ -1624,7 +1630,8 @@ void Item_sum_avg::fix_length_and_dec() } else { - decimals= MY_MIN(args[0]->decimals + prec_increment, NOT_FIXED_DEC); + decimals= MY_MIN(args[0]->decimals + prec_increment, + FLOATING_POINT_DECIMALS); max_length= MY_MIN(args[0]->max_length + prec_increment, float_length(decimals)); } } @@ -1839,13 +1846,14 @@ void Item_sum_variance::fix_length_and_dec() switch (args[0]->result_type()) { case REAL_RESULT: case STRING_RESULT: - decimals= MY_MIN(args[0]->decimals + 4, NOT_FIXED_DEC); + decimals= MY_MIN(args[0]->decimals + 4, FLOATING_POINT_DECIMALS); break; case INT_RESULT: case DECIMAL_RESULT: { int precision= args[0]->decimal_precision()*2 + prec_increment; - decimals= MY_MIN(args[0]->decimals + prec_increment, DECIMAL_MAX_SCALE); + decimals= MY_MIN(args[0]->decimals + prec_increment, + FLOATING_POINT_DECIMALS-1); max_length= my_decimal_precision_to_length_no_truncation(precision, decimals, unsigned_flag); diff --git a/sql/item_sum.h b/sql/item_sum.h index e766e69a1c5..4cb5529e1ce 100644 --- a/sql/item_sum.h +++ b/sql/item_sum.h @@ -61,7 +61,7 @@ public: Aggregator (Item_sum *arg): item_sum(arg) {} virtual ~Aggregator () {} /* Keep gcc happy */ - enum Aggregator_type { SIMPLE_AGGREGATOR, DISTINCT_AGGREGATOR }; + enum Aggregator_type { SIMPLE_AGGREGATOR, DISTINCT_AGGREGATOR }; virtual Aggregator_type Aggrtype() = 0; /** @@ -411,8 +411,8 @@ public: */ inline bool reset_and_add() { - aggregator_clear(); - return aggregator_add(); + aggregator_clear(); + return aggregator_add(); }; /* @@ -458,7 +458,7 @@ public: */ void make_const () { - used_tables_cache= 0; + used_tables_cache= 0; const_item_cache= true; } virtual bool const_during_execution() const { return false; } @@ -488,7 +488,7 @@ public: { return Item::create_tmp_field(group, table, MY_INT32_NUM_DECIMAL_DIGITS); } - virtual bool collect_outer_ref_processor(uchar *param); + virtual bool collect_outer_ref_processor(void *param); bool init_sum_func_check(THD *thd); bool check_sum_func(THD *thd, Item **ref); bool register_sum_func(THD *thd, Item **ref); @@ -547,11 +547,7 @@ public: virtual void remove() { DBUG_ASSERT(0); } virtual void cleanup(); - bool check_vcol_func_processor(uchar *int_arg) - { - return trace_unsupported_by_check_vcol_func_processor(func_name()); - } - + bool check_vcol_func_processor(void *arg); virtual void setup_window_func(THD *thd, Window_spec *window_spec) {} }; @@ -1159,6 +1155,10 @@ public: table_map used_tables() const { return (table_map) 1L; } void set_result_field(Field *) { DBUG_ASSERT(0); } void save_in_result_field(bool no_conversions) { DBUG_ASSERT(0); } + bool check_vcol_func_processor(void *arg) + { + return mark_unsupported_function(name, arg, VCOL_IMPOSSIBLE); + } }; @@ -1172,10 +1172,6 @@ public: { } enum Type type() const { return FIELD_AVG_ITEM; } bool is_null() { update_null_value(); return null_value; } - bool check_vcol_func_processor(uchar *int_arg) - { - return trace_unsupported_by_check_vcol_func_processor("avg_field"); - } }; @@ -1230,10 +1226,6 @@ public: bool is_null() { update_null_value(); return null_value; } enum_field_types field_type() const { return MYSQL_TYPE_DOUBLE; } enum Item_result result_type () const { return REAL_RESULT; } - bool check_vcol_func_processor(uchar *int_arg) - { - return trace_unsupported_by_check_vcol_func_processor("var_field"); - } }; @@ -1559,7 +1551,7 @@ public: void cleanup(); enum Sumfunctype sum_func () const {return GROUP_CONCAT_FUNC;} - const char *func_name() const { return "group_concat"; } + const char *func_name() const { return "group_concat("; } virtual Item_result result_type () const { return STRING_RESULT; } virtual Item_result cmp_type () const { return STRING_RESULT; } enum_field_types field_type() const @@ -1604,7 +1596,7 @@ public: Item *copy_or_same(THD* thd); void no_rows_in_result() {} virtual void print(String *str, enum_query_type query_type); - virtual bool change_context_processor(uchar *cntx) + virtual bool change_context_processor(void *cntx) { context= (Name_resolution_context *)cntx; return FALSE; } }; diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index 16edb35c392..a4a694fe5eb 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -939,9 +939,8 @@ void Item_func_monthname::fix_length_and_dec() { THD* thd= current_thd; CHARSET_INFO *cs= thd->variables.collation_connection; - uint32 repertoire= my_charset_repertoire(cs); locale= thd->variables.lc_time_names; - collation.set(cs, DERIVATION_COERCIBLE, repertoire); + collation.set(cs, DERIVATION_COERCIBLE, locale->repertoire()); decimals=0; max_length= locale->max_month_name_length * collation.collation->mbmaxlen; maybe_null=1; @@ -1086,9 +1085,8 @@ void Item_func_dayname::fix_length_and_dec() { THD* thd= current_thd; CHARSET_INFO *cs= thd->variables.collation_connection; - uint32 repertoire= my_charset_repertoire(cs); locale= thd->variables.lc_time_names; - collation.set(cs, DERIVATION_COERCIBLE, repertoire); + collation.set(cs, DERIVATION_COERCIBLE, locale->repertoire()); decimals=0; max_length= locale->max_day_name_length * collation.collation->mbmaxlen; maybe_null=1; @@ -1465,7 +1463,7 @@ void Item_temporal_func::fix_length_and_dec() We set maybe_null to 1 as default as any bad argument with date or time can get us to return NULL. */ - maybe_null= 1; + maybe_null= (arg_count > 0); if (decimals) { if (decimals == NOT_FIXED_DEC) @@ -1581,24 +1579,12 @@ bool Item_func_from_days::get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date) } -void Item_func_curdate::fix_length_and_dec() -{ - store_now_in_TIME(<ime); - - /* We don't need to set second_part and neg because they already 0 */ - ltime.hour= ltime.minute= ltime.second= 0; - ltime.time_type= MYSQL_TIMESTAMP_DATE; - Item_datefunc::fix_length_and_dec(); - maybe_null= false; -} - /** Converts current time in my_time_t to MYSQL_TIME represenatation for local time zone. Defines time zone (local) used for whole CURDATE function. */ -void Item_func_curdate_local::store_now_in_TIME(MYSQL_TIME *now_time) +void Item_func_curdate_local::store_now_in_TIME(THD *thd, MYSQL_TIME *now_time) { - THD *thd= current_thd; thd->variables.time_zone->gmt_sec_to_TIME(now_time, thd->query_start()); thd->time_zone_used= 1; } @@ -1608,9 +1594,8 @@ void Item_func_curdate_local::store_now_in_TIME(MYSQL_TIME *now_time) Converts current time in my_time_t to MYSQL_TIME represenatation for UTC time zone. Defines time zone (UTC) used for whole UTC_DATE function. */ -void Item_func_curdate_utc::store_now_in_TIME(MYSQL_TIME *now_time) +void Item_func_curdate_utc::store_now_in_TIME(THD *thd, MYSQL_TIME *now_time) { - THD *thd= current_thd; my_tz_UTC->gmt_sec_to_TIME(now_time, thd->query_start()); /* We are not flagging this query as using time zone, since it uses fixed @@ -1622,6 +1607,17 @@ void Item_func_curdate_utc::store_now_in_TIME(MYSQL_TIME *now_time) bool Item_func_curdate::get_date(MYSQL_TIME *res, ulonglong fuzzy_date __attribute__((unused))) { + THD *thd= current_thd; + query_id_t query_id= thd->query_id; + /* Cache value for this query */ + if (last_query_id != query_id) + { + last_query_id= query_id; + store_now_in_TIME(thd, <ime); + /* We don't need to set second_part and neg because they already 0 */ + ltime.hour= ltime.minute= ltime.second= 0; + ltime.time_type= MYSQL_TIMESTAMP_DATE; + } *res=ltime; return 0; } @@ -1641,6 +1637,14 @@ bool Item_func_curtime::fix_fields(THD *thd, Item **items) bool Item_func_curtime::get_date(MYSQL_TIME *res, ulonglong fuzzy_date __attribute__((unused))) { + THD *thd= current_thd; + query_id_t query_id= thd->query_id; + /* Cache value for this query */ + if (last_query_id != query_id) + { + last_query_id= query_id; + store_now_in_TIME(thd, <ime); + } *res= ltime; return 0; } @@ -1661,9 +1665,8 @@ static void set_sec_part(ulong sec_part, MYSQL_TIME *ltime, Item *item) Converts current time in my_time_t to MYSQL_TIME represenatation for local time zone. Defines time zone (local) used for whole CURTIME function. */ -void Item_func_curtime_local::store_now_in_TIME(MYSQL_TIME *now_time) +void Item_func_curtime_local::store_now_in_TIME(THD *thd, MYSQL_TIME *now_time) { - THD *thd= current_thd; thd->variables.time_zone->gmt_sec_to_TIME(now_time, thd->query_start()); now_time->year= now_time->month= now_time->day= 0; now_time->time_type= MYSQL_TIMESTAMP_TIME; @@ -1676,9 +1679,8 @@ void Item_func_curtime_local::store_now_in_TIME(MYSQL_TIME *now_time) Converts current time in my_time_t to MYSQL_TIME represenatation for UTC time zone. Defines time zone (UTC) used for whole UTC_TIME function. */ -void Item_func_curtime_utc::store_now_in_TIME(MYSQL_TIME *now_time) +void Item_func_curtime_utc::store_now_in_TIME(THD *thd, MYSQL_TIME *now_time) { - THD *thd= current_thd; my_tz_UTC->gmt_sec_to_TIME(now_time, thd->query_start()); now_time->year= now_time->month= now_time->day= 0; now_time->time_type= MYSQL_TIMESTAMP_TIME; @@ -1704,9 +1706,8 @@ bool Item_func_now::fix_fields(THD *thd, Item **items) Converts current time in my_time_t to MYSQL_TIME represenatation for local time zone. Defines time zone (local) used for whole NOW function. */ -void Item_func_now_local::store_now_in_TIME(MYSQL_TIME *now_time) +void Item_func_now_local::store_now_in_TIME(THD *thd, MYSQL_TIME *now_time) { - THD *thd= current_thd; thd->variables.time_zone->gmt_sec_to_TIME(now_time, thd->query_start()); set_sec_part(thd->query_start_sec_part(), now_time, this); thd->time_zone_used= 1; @@ -1717,9 +1718,8 @@ void Item_func_now_local::store_now_in_TIME(MYSQL_TIME *now_time) Converts current time in my_time_t to MYSQL_TIME represenatation for UTC time zone. Defines time zone (UTC) used for whole UTC_TIMESTAMP function. */ -void Item_func_now_utc::store_now_in_TIME(MYSQL_TIME *now_time) +void Item_func_now_utc::store_now_in_TIME(THD *thd, MYSQL_TIME *now_time) { - THD *thd= current_thd; my_tz_UTC->gmt_sec_to_TIME(now_time, thd->query_start()); set_sec_part(thd->query_start_sec_part(), now_time, this); /* @@ -1732,6 +1732,14 @@ void Item_func_now_utc::store_now_in_TIME(MYSQL_TIME *now_time) bool Item_func_now::get_date(MYSQL_TIME *res, ulonglong fuzzy_date __attribute__((unused))) { + THD *thd= current_thd; + query_id_t query_id= thd->query_id; + /* Cache value for this query */ + if (last_query_id != query_id) + { + last_query_id= query_id; + store_now_in_TIME(thd, <ime); + } *res= ltime; return 0; } @@ -1741,9 +1749,8 @@ bool Item_func_now::get_date(MYSQL_TIME *res, Converts current time in my_time_t to MYSQL_TIME represenatation for local time zone. Defines time zone (local) used for whole SYSDATE function. */ -void Item_func_sysdate_local::store_now_in_TIME(MYSQL_TIME *now_time) +void Item_func_sysdate_local::store_now_in_TIME(THD *thd, MYSQL_TIME *now_time) { - THD *thd= current_thd; my_hrtime_t now= my_hrtime(); thd->variables.time_zone->gmt_sec_to_TIME(now_time, hrtime_to_my_time(now)); set_sec_part(hrtime_sec_part(now), now_time, this); @@ -1754,7 +1761,7 @@ void Item_func_sysdate_local::store_now_in_TIME(MYSQL_TIME *now_time) bool Item_func_sysdate_local::get_date(MYSQL_TIME *res, ulonglong fuzzy_date __attribute__((unused))) { - store_now_in_TIME(res); + store_now_in_TIME(current_thd, res); return 0; } diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h index 175f3b06c1a..84f610b992d 100644 --- a/sql/item_timefunc.h +++ b/sql/item_timefunc.h @@ -49,7 +49,7 @@ public: Item_func_period_add(THD *thd, Item *a, Item *b): Item_int_func(thd, a, b) {} longlong val_int(); const char *func_name() const { return "period_add"; } - void fix_length_and_dec() + void fix_length_and_dec() { max_length=6*MY_CHARSET_BIN_MB_MAXLEN; } @@ -76,7 +76,7 @@ public: Item_func_to_days(THD *thd, Item *a): Item_int_func(thd, a) {} longlong val_int(); const char *func_name() const { return "to_days"; } - void fix_length_and_dec() + void fix_length_and_dec() { decimals=0; max_length=6*MY_CHARSET_BIN_MB_MAXLEN; @@ -84,9 +84,9 @@ public: } enum_monotonicity_info get_monotonicity_info() const; longlong val_int_endpoint(bool left_endp, bool *incl_endp); - bool check_partition_func_processor(uchar *int_arg) {return FALSE;} - bool check_vcol_func_processor(uchar *int_arg) { return FALSE;} - bool check_valid_arguments_processor(uchar *int_arg) + bool check_partition_func_processor(void *int_arg) {return FALSE;} + bool check_vcol_func_processor(void *arg) { return FALSE;} + bool check_valid_arguments_processor(void *int_arg) { return !has_date_args(); } @@ -99,7 +99,7 @@ public: Item_func_to_seconds(THD *thd, Item *a): Item_int_func(thd, a) {} longlong val_int(); const char *func_name() const { return "to_seconds"; } - void fix_length_and_dec() + void fix_length_and_dec() { decimals=0; max_length=6*MY_CHARSET_BIN_MB_MAXLEN; @@ -107,9 +107,9 @@ public: } enum_monotonicity_info get_monotonicity_info() const; longlong val_int_endpoint(bool left_endp, bool *incl_endp); - bool check_partition_func_processor(uchar *bool_arg) { return FALSE;} + bool check_partition_func_processor(void *bool_arg) { return FALSE;} - bool intro_version(uchar *int_arg) + bool intro_version(void *int_arg) { int *input_version= (int*)int_arg; /* This function was introduced in 5.5 */ @@ -119,7 +119,7 @@ public: } /* Only meaningful with date part and optional time part */ - bool check_valid_arguments_processor(uchar *int_arg) + bool check_valid_arguments_processor(void *int_arg) { return !has_date_args(); } @@ -132,15 +132,15 @@ public: Item_func_dayofmonth(THD *thd, Item *a): Item_int_func(thd, a) {} longlong val_int(); const char *func_name() const { return "dayofmonth"; } - void fix_length_and_dec() + void fix_length_and_dec() { decimals=0; max_length=2*MY_CHARSET_BIN_MB_MAXLEN; maybe_null=1; } - bool check_partition_func_processor(uchar *int_arg) {return FALSE;} - bool check_vcol_func_processor(uchar *int_arg) { return FALSE;} - bool check_valid_arguments_processor(uchar *int_arg) + bool check_partition_func_processor(void *int_arg) {return FALSE;} + bool check_vcol_func_processor(void *arg) { return FALSE;} + bool check_valid_arguments_processor(void *int_arg) { return !has_date_args(); } @@ -155,7 +155,7 @@ public: longlong val_int(); double val_real() { DBUG_ASSERT(fixed == 1); return (double) Item_func_month::val_int(); } - String *val_str(String *str) + String *val_str(String *str) { longlong nr= val_int(); if (null_value) @@ -166,15 +166,15 @@ public: const char *func_name() const { return "month"; } enum Item_result result_type () const { return INT_RESULT; } enum_field_types field_type() const { return MYSQL_TYPE_LONGLONG; } - void fix_length_and_dec() + void fix_length_and_dec() { decimals= 0; fix_char_length(2); maybe_null=1; } - bool check_partition_func_processor(uchar *int_arg) {return FALSE;} - bool check_vcol_func_processor(uchar *int_arg) { return FALSE;} - bool check_valid_arguments_processor(uchar *int_arg) + bool check_partition_func_processor(void *int_arg) {return FALSE;} + bool check_vcol_func_processor(void *arg) { return FALSE;} + bool check_valid_arguments_processor(void *int_arg) { return !has_date_args(); } @@ -189,12 +189,15 @@ public: const char *func_name() const { return "monthname"; } String *val_str(String *str); void fix_length_and_dec(); - bool check_partition_func_processor(uchar *int_arg) {return TRUE;} - bool check_vcol_func_processor(uchar *int_arg) {return FALSE;} - bool check_valid_arguments_processor(uchar *int_arg) + bool check_partition_func_processor(void *int_arg) {return TRUE;} + bool check_valid_arguments_processor(void *int_arg) { return !has_date_args(); } + bool check_vcol_func_processor(void *arg) + { + return mark_unsupported_function(func_name(), "()", arg, VCOL_SESSION_FUNC); + } }; @@ -204,15 +207,15 @@ public: Item_func_dayofyear(THD *thd, Item *a): Item_int_func(thd, a) {} longlong val_int(); const char *func_name() const { return "dayofyear"; } - void fix_length_and_dec() + void fix_length_and_dec() { decimals= 0; fix_char_length(3); maybe_null=1; } - bool check_partition_func_processor(uchar *int_arg) {return FALSE;} - bool check_vcol_func_processor(uchar *int_arg) { return FALSE;} - bool check_valid_arguments_processor(uchar *int_arg) + bool check_partition_func_processor(void *int_arg) {return FALSE;} + bool check_vcol_func_processor(void *arg) { return FALSE;} + bool check_valid_arguments_processor(void *int_arg) { return !has_date_args(); } @@ -231,9 +234,9 @@ public: max_length=2*MY_CHARSET_BIN_MB_MAXLEN; maybe_null=1; } - bool check_partition_func_processor(uchar *int_arg) {return FALSE;} - bool check_vcol_func_processor(uchar *int_arg) { return FALSE;} - bool check_valid_arguments_processor(uchar *int_arg) + bool check_partition_func_processor(void *int_arg) {return FALSE;} + bool check_vcol_func_processor(void *arg) { return FALSE;} + bool check_valid_arguments_processor(void *int_arg) { return !has_time_args(); } @@ -252,9 +255,9 @@ public: max_length=2*MY_CHARSET_BIN_MB_MAXLEN; maybe_null=1; } - bool check_partition_func_processor(uchar *int_arg) {return FALSE;} - bool check_vcol_func_processor(uchar *int_arg) { return FALSE;} - bool check_valid_arguments_processor(uchar *int_arg) + bool check_partition_func_processor(void *int_arg) {return FALSE;} + bool check_vcol_func_processor(void *arg) { return FALSE;} + bool check_valid_arguments_processor(void *int_arg) { return !has_time_args(); } @@ -273,9 +276,9 @@ public: max_length=1*MY_CHARSET_BIN_MB_MAXLEN; maybe_null=1; } - bool check_partition_func_processor(uchar *int_arg) {return FALSE;} - bool check_vcol_func_processor(uchar *int_arg) { return FALSE;} - bool check_valid_arguments_processor(uchar *int_arg) + bool check_partition_func_processor(void *int_arg) {return FALSE;} + bool check_vcol_func_processor(void *arg) { return FALSE;} + bool check_valid_arguments_processor(void *int_arg) { return !has_date_args(); } @@ -288,15 +291,15 @@ public: Item_func_second(THD *thd, Item *a): Item_int_func(thd, a) {} longlong val_int(); const char *func_name() const { return "second"; } - void fix_length_and_dec() + void fix_length_and_dec() { decimals=0; max_length=2*MY_CHARSET_BIN_MB_MAXLEN; maybe_null=1; } - bool check_partition_func_processor(uchar *int_arg) {return FALSE;} - bool check_vcol_func_processor(uchar *int_arg) { return FALSE;} - bool check_valid_arguments_processor(uchar *int_arg) + bool check_partition_func_processor(void *int_arg) {return FALSE;} + bool check_vcol_func_processor(void *arg) { return FALSE;} + bool check_valid_arguments_processor(void *int_arg) { return !has_time_args(); } @@ -329,9 +332,9 @@ public: max_length=6*MY_CHARSET_BIN_MB_MAXLEN; maybe_null=1; } - bool check_partition_func_processor(uchar *int_arg) {return FALSE;} - bool check_vcol_func_processor(uchar *int_arg) { return FALSE;} - bool check_valid_arguments_processor(uchar *int_arg) + bool check_partition_func_processor(void *int_arg) {return FALSE;} + bool check_vcol_func_processor(void *arg) { return FALSE;} + bool check_valid_arguments_processor(void *int_arg) { return !has_date_args(); } @@ -352,9 +355,9 @@ public: max_length=4*MY_CHARSET_BIN_MB_MAXLEN; maybe_null=1; } - bool check_partition_func_processor(uchar *int_arg) {return FALSE;} - bool check_vcol_func_processor(uchar *int_arg) { return FALSE;} - bool check_valid_arguments_processor(uchar *int_arg) + bool check_partition_func_processor(void *int_arg) {return FALSE;} + bool check_vcol_func_processor(void *arg) { return FALSE;} + bool check_valid_arguments_processor(void *int_arg) { return !has_date_args(); } @@ -387,9 +390,9 @@ public: fix_char_length(1); maybe_null=1; } - bool check_partition_func_processor(uchar *int_arg) {return FALSE;} - bool check_vcol_func_processor(uchar *int_arg) { return FALSE;} - bool check_valid_arguments_processor(uchar *int_arg) + bool check_partition_func_processor(void *int_arg) {return FALSE;} + bool check_vcol_func_processor(void *arg) { return FALSE;} + bool check_valid_arguments_processor(void *int_arg) { return !has_date_args(); } @@ -405,8 +408,11 @@ class Item_func_dayname :public Item_func_weekday enum Item_result result_type () const { return STRING_RESULT; } enum_field_types field_type() const { return MYSQL_TYPE_VARCHAR; } void fix_length_and_dec(); - bool check_partition_func_processor(uchar *int_arg) {return TRUE;} - bool check_vcol_func_processor(uchar *int_arg) { return FALSE;} + bool check_partition_func_processor(void *int_arg) {return TRUE;} + bool check_vcol_func_processor(void *arg) + { + return mark_unsupported_function(func_name(), "()", arg, VCOL_SESSION_FUNC); + } }; @@ -444,23 +450,21 @@ public: const char *func_name() const { return "unix_timestamp"; } enum_monotonicity_info get_monotonicity_info() const; longlong val_int_endpoint(bool left_endp, bool *incl_endp); - bool check_partition_func_processor(uchar *int_arg) {return FALSE;} + bool check_partition_func_processor(void *int_arg) {return FALSE;} /* UNIX_TIMESTAMP() depends on the current timezone (and thus may not be used as a partitioning function) when its argument is NOT of the TIMESTAMP type. */ - bool check_valid_arguments_processor(uchar *int_arg) + bool check_valid_arguments_processor(void *int_arg) { return !has_timestamp_args(); } - bool check_vcol_func_processor(uchar *int_arg) + bool check_vcol_func_processor(void *arg) { - /* - TODO: Allow UNIX_TIMESTAMP called with an argument to be a part - of the expression for a virtual column - */ - return trace_unsupported_by_check_vcol_func_processor(func_name()); + if (arg_count) + return FALSE; + return mark_unsupported_function(func_name(), "()", arg, VCOL_TIME_FUNC); } longlong int_op(); my_decimal *decimal_op(my_decimal* buf); @@ -475,9 +479,9 @@ public: Item_func_time_to_sec(THD *thd, Item *item): Item_func_seconds_hybrid(thd, item) {} const char *func_name() const { return "time_to_sec"; } - bool check_partition_func_processor(uchar *int_arg) {return FALSE;} - bool check_vcol_func_processor(uchar *int_arg) { return FALSE;} - bool check_valid_arguments_processor(uchar *int_arg) + bool check_partition_func_processor(void *int_arg) {return FALSE;} + bool check_vcol_func_processor(void *arg) { return FALSE;} + bool check_valid_arguments_processor(void *int_arg) { return !has_time_args(); } @@ -502,7 +506,7 @@ public: bool get_date(MYSQL_TIME *res, ulonglong fuzzy_date) { DBUG_ASSERT(0); return 1; } my_decimal *val_decimal(my_decimal *decimal_value) { return val_decimal_from_date(decimal_value); } - Field *create_field_for_create_select(THD *thd, TABLE *table) + Field *create_field_for_create_select(TABLE *table) { return tmp_table_field_from_field_type(table, false, false); } int save_in_field(Field *field, bool no_conversions) { return save_date_in_field(field); } @@ -596,25 +600,21 @@ public: class Item_func_curtime :public Item_timefunc { MYSQL_TIME ltime; + query_id_t last_query_id; public: - Item_func_curtime(THD *thd, uint dec): Item_timefunc(thd) { decimals= dec; } + Item_func_curtime(THD *thd, uint dec): Item_timefunc(thd), last_query_id(0) + { decimals= dec; } bool fix_fields(THD *, Item **); - void fix_length_and_dec() - { - store_now_in_TIME(<ime); - Item_timefunc::fix_length_and_dec(); - maybe_null= false; - } bool get_date(MYSQL_TIME *res, ulonglong fuzzy_date); /* Abstract method that defines which time zone is used for conversion. Converts time current time in my_time_t representation to broken-down MYSQL_TIME representation using UTC-SYSTEM or per-thread time zone. */ - virtual void store_now_in_TIME(MYSQL_TIME *now_time)=0; - bool check_vcol_func_processor(uchar *int_arg) + virtual void store_now_in_TIME(THD *thd, MYSQL_TIME *now_time)=0; + bool check_vcol_func_processor(void *arg) { - return trace_unsupported_by_check_vcol_func_processor(func_name()); + return mark_unsupported_function(func_name(), "()", arg, VCOL_TIME_FUNC); } }; @@ -624,7 +624,7 @@ class Item_func_curtime_local :public Item_func_curtime public: Item_func_curtime_local(THD *thd, uint dec): Item_func_curtime(thd, dec) {} const char *func_name() const { return "curtime"; } - virtual void store_now_in_TIME(MYSQL_TIME *now_time); + virtual void store_now_in_TIME(THD *thd, MYSQL_TIME *now_time); }; @@ -633,7 +633,7 @@ class Item_func_curtime_utc :public Item_func_curtime public: Item_func_curtime_utc(THD *thd, uint dec): Item_func_curtime(thd, dec) {} const char *func_name() const { return "utc_time"; } - virtual void store_now_in_TIME(MYSQL_TIME *now_time); + virtual void store_now_in_TIME(THD *thd, MYSQL_TIME *now_time); }; @@ -641,15 +641,16 @@ public: class Item_func_curdate :public Item_datefunc { + query_id_t last_query_id; MYSQL_TIME ltime; public: - Item_func_curdate(THD *thd): Item_datefunc(thd) {} - void fix_length_and_dec(); + Item_func_curdate(THD *thd): Item_datefunc(thd), last_query_id(0) {} bool get_date(MYSQL_TIME *res, ulonglong fuzzy_date); - virtual void store_now_in_TIME(MYSQL_TIME *now_time)=0; - bool check_vcol_func_processor(uchar *int_arg) + virtual void store_now_in_TIME(THD *thd, MYSQL_TIME *now_time)=0; + bool check_vcol_func_processor(void *arg) { - return trace_unsupported_by_check_vcol_func_processor(func_name()); + return mark_unsupported_function(func_name(), "()", arg, + VCOL_TIME_FUNC); } }; @@ -659,7 +660,7 @@ class Item_func_curdate_local :public Item_func_curdate public: Item_func_curdate_local(THD *thd): Item_func_curdate(thd) {} const char *func_name() const { return "curdate"; } - void store_now_in_TIME(MYSQL_TIME *now_time); + void store_now_in_TIME(THD *thd, MYSQL_TIME *now_time); }; @@ -668,30 +669,29 @@ class Item_func_curdate_utc :public Item_func_curdate public: Item_func_curdate_utc(THD *thd): Item_func_curdate(thd) {} const char *func_name() const { return "utc_date"; } - void store_now_in_TIME(MYSQL_TIME *now_time); + void store_now_in_TIME(THD* thd, MYSQL_TIME *now_time); }; /* Abstract CURRENT_TIMESTAMP function. See also Item_func_curtime */ - class Item_func_now :public Item_datetimefunc { MYSQL_TIME ltime; + query_id_t last_query_id; public: - Item_func_now(THD *thd, uint dec): Item_datetimefunc(thd) { decimals= dec; } + Item_func_now(THD *thd, uint dec): Item_datetimefunc(thd), last_query_id(0) + { decimals= dec; } bool fix_fields(THD *, Item **); - void fix_length_and_dec() - { - store_now_in_TIME(<ime); - Item_temporal_func::fix_length_and_dec(); - maybe_null= false; - } bool get_date(MYSQL_TIME *res, ulonglong fuzzy_date); - virtual void store_now_in_TIME(MYSQL_TIME *now_time)=0; - bool check_vcol_func_processor(uchar *int_arg) + virtual void store_now_in_TIME(THD *thd, MYSQL_TIME *now_time)=0; + bool check_vcol_func_processor(void *arg) { - return trace_unsupported_by_check_vcol_func_processor(func_name()); + /* + NOW is safe for replication as slaves will run with same time as + master + */ + return mark_unsupported_function(func_name(), "()", arg, VCOL_TIME_FUNC); } }; @@ -701,7 +701,7 @@ class Item_func_now_local :public Item_func_now public: Item_func_now_local(THD *thd, uint dec): Item_func_now(thd, dec) {} const char *func_name() const { return "now"; } - virtual void store_now_in_TIME(MYSQL_TIME *now_time); + virtual void store_now_in_TIME(THD *thd, MYSQL_TIME *now_time); virtual enum Functype functype() const { return NOW_FUNC; } }; @@ -711,7 +711,14 @@ class Item_func_now_utc :public Item_func_now public: Item_func_now_utc(THD *thd, uint dec): Item_func_now(thd, dec) {} const char *func_name() const { return "utc_timestamp"; } - virtual void store_now_in_TIME(MYSQL_TIME *now_time); + virtual void store_now_in_TIME(THD *thd, MYSQL_TIME *now_time); + virtual enum Functype functype() const { return NOW_UTC_FUNC; } + virtual bool check_vcol_func_processor(void *arg) + { + return mark_unsupported_function(func_name(), "()", arg, + VCOL_TIME_FUNC | VCOL_NON_DETERMINISTIC); + } + }; @@ -725,14 +732,15 @@ public: Item_func_sysdate_local(THD *thd, uint dec): Item_func_now(thd, dec) {} bool const_item() const { return 0; } const char *func_name() const { return "sysdate"; } - void store_now_in_TIME(MYSQL_TIME *now_time); + void store_now_in_TIME(THD *thd, MYSQL_TIME *now_time); bool get_date(MYSQL_TIME *res, ulonglong fuzzy_date); - void update_used_tables() + table_map used_tables() const { return RAND_TABLE_BIT; } + bool check_vcol_func_processor(void *arg) { - Item_func_now::update_used_tables(); - maybe_null= 0; - used_tables_cache|= RAND_TABLE_BIT; + return mark_unsupported_function(func_name(), "()", arg, + VCOL_TIME_FUNC | VCOL_NON_DETERMINISTIC); } + virtual enum Functype functype() const { return SYSDATE_FUNC; } }; @@ -742,9 +750,9 @@ public: Item_func_from_days(THD *thd, Item *a): Item_datefunc(thd, a) {} const char *func_name() const { return "from_days"; } bool get_date(MYSQL_TIME *res, ulonglong fuzzy_date); - bool check_partition_func_processor(uchar *int_arg) {return FALSE;} - bool check_vcol_func_processor(uchar *int_arg) { return FALSE;} - bool check_valid_arguments_processor(uchar *int_arg) + bool check_partition_func_processor(void *int_arg) {return FALSE;} + bool check_vcol_func_processor(void *arg) { return FALSE;} + bool check_valid_arguments_processor(void *int_arg) { return has_date_args() || has_time_args(); } @@ -766,6 +774,10 @@ public: void fix_length_and_dec(); uint format_length(const String *format); bool eq(const Item *item, bool binary_cmp) const; + bool check_vcol_func_processor(void *arg) + { + return mark_unsupported_function(func_name(), "()", arg, VCOL_SESSION_FUNC); + } }; @@ -842,6 +854,7 @@ public: bool get_date(MYSQL_TIME *res, ulonglong fuzzy_date); bool eq(const Item *item, bool binary_cmp) const; void print(String *str, enum_query_type query_type); + bool need_parentheses_in_default() { return true; } }; @@ -858,9 +871,9 @@ class Item_extract :public Item_int_func void fix_length_and_dec(); bool eq(const Item *item, bool binary_cmp) const; void print(String *str, enum_query_type query_type); - bool check_partition_func_processor(uchar *int_arg) {return FALSE;} - bool check_vcol_func_processor(uchar *int_arg) { return FALSE;} - bool check_valid_arguments_processor(uchar *int_arg) + bool check_partition_func_processor(void *int_arg) {return FALSE;} + bool check_vcol_func_processor(void *arg) { return FALSE;} + bool check_valid_arguments_processor(void *int_arg) { switch (int_type) { case INTERVAL_YEAR: @@ -919,6 +932,7 @@ public: String *val_str(String *a); void fix_length_and_dec(); void print(String *str, enum_query_type query_type); + bool need_parentheses_in_default() { return true; } }; @@ -1033,14 +1047,14 @@ public: Item_func_microsecond(THD *thd, Item *a): Item_int_func(thd, a) {} longlong val_int(); const char *func_name() const { return "microsecond"; } - void fix_length_and_dec() + void fix_length_and_dec() { decimals=0; maybe_null=1; } - bool check_partition_func_processor(uchar *int_arg) {return FALSE;} - bool check_vcol_func_processor(uchar *int_arg) { return FALSE;} - bool check_valid_arguments_processor(uchar *int_arg) + bool check_partition_func_processor(void *int_arg) {return FALSE;} + bool check_vcol_func_processor(void *arg) { return FALSE;} + bool check_valid_arguments_processor(void *int_arg) { return !has_time_args(); } diff --git a/sql/item_windowfunc.h b/sql/item_windowfunc.h index 40f48cc7dc5..9d2fa135e29 100644 --- a/sql/item_windowfunc.h +++ b/sql/item_windowfunc.h @@ -117,7 +117,7 @@ public: } const char*func_name() const { - return "row_number"; + return "row_number("; } }; @@ -433,7 +433,7 @@ class Item_sum_ntile : public Item_sum_window_with_row_count double val_real() { - return val_int(); + return (double) val_int(); } longlong val_int() @@ -534,7 +534,7 @@ public: have been computed. In that case, window function will need to read its temp.table field. In order to allow that, mark that field in the read_set. */ - bool register_field_in_read_map(uchar *arg) + bool register_field_in_read_map(void *arg) { TABLE *table= (TABLE*) arg; if (result_field && (result_field->table == table || !table)) diff --git a/sql/item_xmlfunc.cc b/sql/item_xmlfunc.cc index ba17d2c48c3..bf5abc882f2 100644 --- a/sql/item_xmlfunc.cc +++ b/sql/item_xmlfunc.cc @@ -234,9 +234,9 @@ public: const_item_cache= false; } const char *func_name() const { return "nodeset"; } - bool check_vcol_func_processor(uchar *int_arg) + bool check_vcol_func_processor(void *arg) { - return trace_unsupported_by_check_vcol_func_processor(func_name()); + return mark_unsupported_function(func_name(), arg, VCOL_IMPOSSIBLE); } }; @@ -572,9 +572,9 @@ public: Item_bool_func(thd, nodeset, cmpfunc), pxml(p) {} enum Type type() const { return XPATH_NODESET_CMP; }; const char *func_name() const { return "xpath_nodeset_to_const_comparator"; } - bool check_vcol_func_processor(uchar *int_arg) + bool check_vcol_func_processor(void *arg) { - return trace_unsupported_by_check_vcol_func_processor(func_name()); + return mark_unsupported_function(func_name(), arg, VCOL_IMPOSSIBLE); } longlong val_int() diff --git a/sql/item_xmlfunc.h b/sql/item_xmlfunc.h index 3758025fc90..ed12793742e 100644 --- a/sql/item_xmlfunc.h +++ b/sql/item_xmlfunc.h @@ -91,10 +91,6 @@ public: { return const_item_cache && (!nodeset_func || nodeset_func->const_item()); } - bool check_vcol_func_processor(uchar *int_arg) - { - return trace_unsupported_by_check_vcol_func_processor(func_name()); - } }; diff --git a/sql/lex.h b/sql/lex.h index f7a183e1862..d1762b2b20e 100644 --- a/sql/lex.h +++ b/sql/lex.h @@ -47,12 +47,9 @@ SYM_GROUP sym_group_rtree= {"RTree keys", "HAVE_RTREE_KEYS"}; static SYMBOL symbols[] = { { "&&", SYM(AND_AND_SYM)}, - { "<", SYM(LT)}, { "<=", SYM(LE)}, { "<>", SYM(NE)}, { "!=", SYM(NE)}, - { "=", SYM(EQ)}, - { ">", SYM(GT_SYM)}, { ">=", SYM(GE)}, { "<<", SYM(SHIFT_LEFT)}, { ">>", SYM(SHIFT_RIGHT)}, @@ -552,7 +549,8 @@ static SYMBOL symbols[] = { { "SOME", SYM(ANY_SYM)}, { "SONAME", SYM(SONAME_SYM)}, { "SOUNDS", SYM(SOUNDS_SYM)}, - { "SOURCE", SYM(SOURCE_SYM)}, + { "SOURCE", SYM(SOURCE_SYM)}, + { "STORED", SYM(STORED_SYM)}, { "SPATIAL", SYM(SPATIAL_SYM)}, { "SPECIFIC", SYM(SPECIFIC_SYM)}, { "REF_SYSTEM_ID", SYM(REF_SYSTEM_ID_SYM)}, diff --git a/sql/log.cc b/sql/log.cc index 07fd352d93b..fa8f10e5464 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. +/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. Copyright (c) 2009, 2016, MariaDB This program is free software; you can redistribute it and/or modify @@ -1681,13 +1681,13 @@ static int binlog_close_connection(handlerton *hton, THD *thd) size_t len=0; wsrep_write_cache_buf(cache, &buf, &len); WSREP_WARN("binlog trx cache not empty (%lu bytes) @ connection close %lld", - len, (longlong) thd->thread_id); + (ulong) len, (longlong) thd->thread_id); if (len > 0) wsrep_dump_rbr_buf(thd, buf, len); cache = cache_mngr->get_binlog_cache_log(false); wsrep_write_cache_buf(cache, &buf, &len); WSREP_WARN("binlog stmt cache not empty (%lu bytes) @ connection close %lld", - len, (longlong) thd->thread_id); + (ulong) len, (longlong) thd->thread_id); if (len > 0) wsrep_dump_rbr_buf(thd, buf, len); } #endif /* WITH_WSREP */ @@ -3171,6 +3171,21 @@ MYSQL_BIN_LOG::MYSQL_BIN_LOG(uint *sync_period) bzero((char*) &purge_index_file, sizeof(purge_index_file)); } +void MYSQL_BIN_LOG::stop_background_thread() +{ + if (binlog_background_thread_started) + { + mysql_mutex_lock(&LOCK_binlog_background_thread); + binlog_background_thread_stop= true; + mysql_cond_signal(&COND_binlog_background_thread); + while (binlog_background_thread_stop) + mysql_cond_wait(&COND_binlog_background_thread_end, + &LOCK_binlog_background_thread); + mysql_mutex_unlock(&LOCK_binlog_background_thread); + binlog_background_thread_started= false; + } +} + /* this is called only once */ void MYSQL_BIN_LOG::cleanup() @@ -3181,17 +3196,8 @@ void MYSQL_BIN_LOG::cleanup() xid_count_per_binlog *b; /* Wait for the binlog background thread to stop. */ - if (!is_relay_log && binlog_background_thread_started) - { - mysql_mutex_lock(&LOCK_binlog_background_thread); - binlog_background_thread_stop= true; - mysql_cond_signal(&COND_binlog_background_thread); - while (binlog_background_thread_stop) - mysql_cond_wait(&COND_binlog_background_thread_end, - &LOCK_binlog_background_thread); - mysql_mutex_unlock(&LOCK_binlog_background_thread); - binlog_background_thread_started= false; - } + if (!is_relay_log) + stop_background_thread(); inited= 0; close(LOG_CLOSE_INDEX|LOG_CLOSE_STOP_EVENT); @@ -4366,7 +4372,7 @@ int MYSQL_BIN_LOG::purge_first_log(Relay_log_info* rli, bool included) /* * Need to update the log pos because purge logs has been called - * after fetching initially the log pos at the begining of the method. + * after fetching initially the log pos at the beginning of the method. */ if((error=find_log_pos(&rli->linfo, rli->event_relay_log_name, 0))) { @@ -9510,10 +9516,9 @@ binlog_background_thread(void *arg __attribute__((unused))) my_thread_init(); DBUG_ENTER("binlog_background_thread"); - thd= new THD; + thd= new THD(next_thread_id()); thd->system_thread= SYSTEM_THREAD_BINLOG_BACKGROUND; thd->thread_stack= (char*) &thd; /* Set approximate stack start */ - thd->thread_id= next_thread_id(); thd->store_globals(); thd->security_ctx->skip_grants(); thd->set_command(COM_DAEMON); diff --git a/sql/log.h b/sql/log.h index e556ef91399..a74a01f9c67 100644 --- a/sql/log.h +++ b/sql/log.h @@ -1,5 +1,5 @@ -/* Copyright (c) 2005, 2012, Oracle and/or its affiliates. - Copyright (c) 2009, 2012, Monty Program Ab +/* Copyright (c) 2005, 2016, Oracle and/or its affiliates. + Copyright (c) 2009, 2016, Monty Program Ab This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -589,6 +589,8 @@ public: mysql_cond_t COND_binlog_background_thread; mysql_cond_t COND_binlog_background_thread_end; + void stop_background_thread(); + using MYSQL_LOG::generate_name; using MYSQL_LOG::is_open; diff --git a/sql/log_event.cc b/sql/log_event.cc index c966d36b732..b1cf6a9024a 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2015, Oracle and/or its affiliates. + Copyright (c) 2000, 2016, Oracle and/or its affiliates. Copyright (c) 2009, 2016, MariaDB This program is free software; you can redistribute it and/or modify @@ -3743,10 +3743,25 @@ Query_log_event::Query_log_event(const char* buf, uint event_len, if (time_zone_len) copy_str_and_move(&time_zone_str, &start, time_zone_len); - if (user.length > 0) + if (user.length) + { copy_str_and_move((const char **)&(user.str), &start, user.length); - if (host.length > 0) + } + else + { + user.str= (char *) start++; + user.str[0]= '\0'; + } + + if (host.length) + { copy_str_and_move((const char **)&(host.str), &start, host.length); + } + else + { + host.str= (char *) start++; + host.str[0]= '\0'; + } /** if time_zone_len or catalog_len are 0, then time_zone and catalog @@ -4034,6 +4049,8 @@ void Query_log_event::print_query_header(IO_CACHE* file, "@@session.unique_checks", &need_comma); print_set_option(file, tmp, OPTION_NOT_AUTOCOMMIT, ~flags2, "@@session.autocommit", &need_comma); + print_set_option(file, tmp, OPTION_NO_CHECK_CONSTRAINT_CHECKS, ~flags2, + "@@session.check_constraint_checks", &need_comma); my_b_printf(file,"%s\n", print_event_info->delimiter); print_event_info->flags2= flags2; } @@ -6159,7 +6176,7 @@ int Load_log_event::do_apply_event(NET* net, rpl_group_info *rgi, update it inside mysql_load(). */ List tmp_list; - if (open_temporary_tables(thd, &tables) || + if (thd->open_temporary_tables(&tables) || mysql_load(thd, &ex, &tables, field_list, tmp_list, tmp_list, handle_dup, ignore, net != 0)) thd->is_slave_error= 1; @@ -8017,7 +8034,7 @@ void User_var_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info) return; str_to_hex(hex_str, val, val_len); /* - For proper behaviour when mysqlbinlog|mysql, we need to explicitely + For proper behaviour when mysqlbinlog|mysql, we need to explicitly specify the variable's collation. It will however cause problems when people want to mysqlbinlog|mysql into another server not supporting the character set. But there's not much to do about this and it's unlikely. @@ -9336,9 +9353,11 @@ Rows_log_event::Rows_log_event(THD *thd_arg, TABLE *tbl_arg, ulong tid, (!tbl_arg && !cols && tid == ~0UL)); if (thd_arg->variables.option_bits & OPTION_NO_FOREIGN_KEY_CHECKS) - set_flags(NO_FOREIGN_KEY_CHECKS_F); + set_flags(NO_FOREIGN_KEY_CHECKS_F); if (thd_arg->variables.option_bits & OPTION_RELAXED_UNIQUE_CHECKS) - set_flags(RELAXED_UNIQUE_CHECKS_F); + set_flags(RELAXED_UNIQUE_CHECKS_F); + if (thd_arg->variables.option_bits & OPTION_NO_CHECK_CONSTRAINT_CHECKS) + set_flags(NO_CHECK_CONSTRAINT_CHECKS_F); /* if my_bitmap_init fails, caught in is_valid() */ if (likely(!my_bitmap_init(&m_cols, m_width <= sizeof(m_bitbuf)*8 ? m_bitbuf : NULL, @@ -9762,6 +9781,12 @@ int Rows_log_event::do_apply_event(rpl_group_info *rgi) thd->variables.option_bits|= OPTION_RELAXED_UNIQUE_CHECKS; else thd->variables.option_bits&= ~OPTION_RELAXED_UNIQUE_CHECKS; + + if (get_flags(NO_CHECK_CONSTRAINT_CHECKS_F)) + thd->variables.option_bits|= OPTION_NO_CHECK_CONSTRAINT_CHECKS; + else + thd->variables.option_bits&= ~OPTION_NO_CHECK_CONSTRAINT_CHECKS; + /* A small test to verify that objects have consistent types */ DBUG_ASSERT(sizeof(thd->variables.option_bits) == sizeof(OPTION_RELAXED_UNIQUE_CHECKS)); @@ -9825,9 +9850,6 @@ int Rows_log_event::do_apply_event(rpl_group_info *rgi) /* When the open and locking succeeded, we check all tables to ensure that they still have the correct type. - - We can use a down cast here since we know that every table added - to the tables_to_lock is a RPL_TABLE_LIST. */ { @@ -9846,10 +9868,37 @@ int Rows_log_event::do_apply_event(rpl_group_info *rgi) NOTE: The base tables are added here are removed when close_thread_tables is called. */ - RPL_TABLE_LIST *ptr= rgi->tables_to_lock; - for (uint i= 0 ; ptr && (i < rgi->tables_to_lock_count); - ptr= static_cast(ptr->next_global), i++) + TABLE_LIST *table_list_ptr= rgi->tables_to_lock; + for (uint i=0 ; table_list_ptr && (i < rgi->tables_to_lock_count); + table_list_ptr= table_list_ptr->next_global, i++) { + /* + Below if condition takes care of skipping base tables that + make up the MERGE table (which are added by open_tables() + call). They are added next to the merge table in the list. + For eg: If RPL_TABLE_LIST is t3->t1->t2 (where t1 and t2 + are base tables for merge table 't3'), open_tables will modify + the list by adding t1 and t2 again immediately after t3 in the + list (*not at the end of the list*). New table_to_lock list will + look like t3->t1'->t2'->t1->t2 (where t1' and t2' are TABLE_LIST + objects added by open_tables() call). There is no flag(or logic) in + open_tables() that can skip adding these base tables to the list. + So the logic here should take care of skipping them. + + tables_to_lock_count logic will take care of skipping base tables + that are added at the end of the list. + For eg: If RPL_TABLE_LIST is t1->t2->t3, open_tables will modify + the list into t1->t2->t3->t1'->t2'. t1' and t2' will be skipped + because tables_to_lock_count logic in this for loop. + */ + if (table_list_ptr->parent_l) + continue; + /* + We can use a down cast here since we know that every table added + to the tables_to_lock is a RPL_TABLE_LIST (or child table which is + skipped above). + */ + RPL_TABLE_LIST *ptr= static_cast(table_list_ptr); DBUG_ASSERT(ptr->m_tabledef_valid); TABLE *conv_table; if (!ptr->m_tabledef.compatible_with(thd, rgi, ptr->table, &conv_table)) @@ -9891,6 +9940,12 @@ int Rows_log_event::do_apply_event(rpl_group_info *rgi) TABLE_LIST *ptr= rgi->tables_to_lock; for (uint i=0 ; ptr && (i < rgi->tables_to_lock_count); ptr= ptr->next_global, i++) { + /* + Please see comment in above 'for' loop to know the reason + for this if condition + */ + if (ptr->parent_l) + continue; rgi->m_table_map.set_table(ptr->table_id, ptr->table); /* Following is passing flag about triggers on the server. The problem was diff --git a/sql/log_event.h b/sql/log_event.h index bc850c22a14..0ce0e563796 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -4238,7 +4238,10 @@ public: Indicates that rows in this event are complete, that is contain values for all columns of the table. */ - COMPLETE_ROWS_F = (1U << 3) + COMPLETE_ROWS_F = (1U << 3), + + /* Value of the OPTION_NO_CHECK_CONSTRAINT_CHECKS flag in thd->options */ + NO_CHECK_CONSTRAINT_CHECKS_F = (1U << 7) }; typedef uint16 flag_set; diff --git a/sql/log_event_old.cc b/sql/log_event_old.cc index ff2f7b156d5..0502f20d2b1 100644 --- a/sql/log_event_old.cc +++ b/sql/log_event_old.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2007, 2013, Oracle and/or its affiliates. +/* Copyright (c) 2007, 2016, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -120,16 +120,25 @@ Old_rows_log_event::do_apply_event(Old_rows_log_event *ev, rpl_group_info *rgi) /* When the open and locking succeeded, we check all tables to ensure that they still have the correct type. - - We can use a down cast here since we know that every table added - to the tables_to_lock is a RPL_TABLE_LIST. */ { - RPL_TABLE_LIST *ptr= rgi->tables_to_lock; - for (uint i= 0 ; ptr&& (i< rgi->tables_to_lock_count); - ptr= static_cast(ptr->next_global), i++) + TABLE_LIST *table_list_ptr= rgi->tables_to_lock; + for (uint i=0 ; table_list_ptr&& (i< rgi->tables_to_lock_count); + table_list_ptr= table_list_ptr->next_global, i++) { + /* + Please see comment in log_event.cc-Rows_log_event::do_apply_event() + function for the explanation of the below if condition + */ + if (table_list_ptr->parent_l) + continue; + /* + We can use a down cast here since we know that every table added + to the tables_to_lock is a RPL_TABLE_LIST(or child table which is + skipped above). + */ + RPL_TABLE_LIST *ptr=static_cast(table_list_ptr); DBUG_ASSERT(ptr->m_tabledef_valid); TABLE *conv_table; if (!ptr->m_tabledef.compatible_with(thd, rgi, ptr->table, &conv_table)) @@ -162,7 +171,15 @@ Old_rows_log_event::do_apply_event(Old_rows_log_event *ev, rpl_group_info *rgi) */ TABLE_LIST *ptr= rgi->tables_to_lock; for (uint i=0; ptr && (i < rgi->tables_to_lock_count); ptr= ptr->next_global, i++) + { + /* + Please see comment in log_event.cc-Rows_log_event::do_apply_event() + function for the explanation of the below if condition + */ + if (ptr->parent_l) + continue; rgi->m_table_map.set_table(ptr->table_id, ptr->table); + } #ifdef HAVE_QUERY_CACHE query_cache.invalidate_locked_for_write(thd, rgi->tables_to_lock); #endif @@ -1420,16 +1437,25 @@ int Old_rows_log_event::do_apply_event(rpl_group_info *rgi) /* When the open and locking succeeded, we check all tables to ensure that they still have the correct type. - - We can use a down cast here since we know that every table added - to the tables_to_lock is a RPL_TABLE_LIST. */ { - RPL_TABLE_LIST *ptr= rgi->tables_to_lock; - for (uint i= 0 ; ptr&& (i< rgi->tables_to_lock_count); - ptr= static_cast(ptr->next_global), i++) + TABLE_LIST *table_list_ptr= rgi->tables_to_lock; + for (uint i=0; table_list_ptr&& (i< rgi->tables_to_lock_count); + table_list_ptr= static_cast(table_list_ptr->next_global), i++) { + /* + Please see comment in log_event.cc-Rows_log_event::do_apply_event() + function for the explanation of the below if condition + */ + if (table_list_ptr->parent_l) + continue; + /* + We can use a down cast here since we know that every table added + to the tables_to_lock is a RPL_TABLE_LIST (or child table which is + skipped above). + */ + RPL_TABLE_LIST *ptr=static_cast(table_list_ptr); TABLE *conv_table; if (ptr->m_tabledef.compatible_with(thd, rgi, ptr->table, &conv_table)) { diff --git a/sql/mdl.cc b/sql/mdl.cc index 61591ec9f57..8fec368e3be 100644 --- a/sql/mdl.cc +++ b/sql/mdl.cc @@ -669,7 +669,7 @@ int mdl_iterate(int (*callback)(MDL_ticket *ticket, void *arg), void *arg) my_hash_value_type mdl_hash_function(CHARSET_INFO *cs, const uchar *key, size_t length) { - MDL_key *mdl_key= (MDL_key*) (key - offsetof(MDL_key, m_ptr)); + MDL_key *mdl_key= (MDL_key*) (key - my_offsetof(MDL_key, m_ptr)); return mdl_key->hash_value(); } @@ -2929,34 +2929,54 @@ bool MDL_context::has_explicit_locks() } #ifdef WITH_WSREP +static +const char *wsrep_get_mdl_type_name(enum_mdl_type type) +{ + switch (type) + { + case MDL_INTENTION_EXCLUSIVE : return "intention exclusive"; + case MDL_SHARED : return "shared"; + case MDL_SHARED_HIGH_PRIO : return "shared high prio"; + case MDL_SHARED_READ : return "shared read"; + case MDL_SHARED_WRITE : return "shared write"; + case MDL_SHARED_UPGRADABLE : return "shared upgradable"; + case MDL_SHARED_NO_WRITE : return "shared no write"; + case MDL_SHARED_NO_READ_WRITE : return "shared no read write"; + case MDL_EXCLUSIVE : return "exclusive"; + default: break; + } + return "UNKNOWN"; +} + +static +const char *wsrep_get_mdl_namespace_name(MDL_key::enum_mdl_namespace ns) +{ + switch (ns) + { + case MDL_key::GLOBAL : return "GLOBAL"; + case MDL_key::SCHEMA : return "SCHEMA"; + case MDL_key::TABLE : return "TABLE"; + case MDL_key::FUNCTION : return "FUNCTION"; + case MDL_key::PROCEDURE : return "PROCEDURE"; + case MDL_key::TRIGGER : return "TRIGGER"; + case MDL_key::EVENT : return "EVENT"; + case MDL_key::COMMIT : return "COMMIT"; + case MDL_key::USER_LOCK : return "USER_LOCK"; + default: break; + } + return "UNKNOWN"; +} + void MDL_ticket::wsrep_report(bool debug) { - if (debug) - { - const PSI_stage_info *psi_stage = m_lock->key.get_wait_state_name(); + if (!debug) return; - WSREP_DEBUG("MDL ticket: type: %s space: %s db: %s name: %s (%s)", - (get_type() == MDL_INTENTION_EXCLUSIVE) ? "intention exclusive" : - ((get_type() == MDL_SHARED) ? "shared" : - ((get_type() == MDL_SHARED_HIGH_PRIO ? "shared high prio" : - ((get_type() == MDL_SHARED_READ) ? "shared read" : - ((get_type() == MDL_SHARED_WRITE) ? "shared write" : - ((get_type() == MDL_SHARED_NO_WRITE) ? "shared no write" : - ((get_type() == MDL_SHARED_NO_READ_WRITE) ? "shared no read write" : - ((get_type() == MDL_EXCLUSIVE) ? "exclusive" : - "UNKNOWN")))))))), - (m_lock->key.mdl_namespace() == MDL_key::GLOBAL) ? "GLOBAL" : - ((m_lock->key.mdl_namespace() == MDL_key::SCHEMA) ? "SCHEMA" : - ((m_lock->key.mdl_namespace() == MDL_key::TABLE) ? "TABLE" : - ((m_lock->key.mdl_namespace() == MDL_key::TABLE) ? "FUNCTION" : - ((m_lock->key.mdl_namespace() == MDL_key::TABLE) ? "PROCEDURE" : - ((m_lock->key.mdl_namespace() == MDL_key::TABLE) ? "TRIGGER" : - ((m_lock->key.mdl_namespace() == MDL_key::TABLE) ? "EVENT" : - ((m_lock->key.mdl_namespace() == MDL_key::COMMIT) ? "COMMIT" : - (char *)"UNKNOWN"))))))), - m_lock->key.db_name(), - m_lock->key.name(), - psi_stage->m_name); - } + const PSI_stage_info *psi_stage= m_lock->key.get_wait_state_name(); + WSREP_DEBUG("MDL ticket: type: %s space: %s db: %s name: %s (%s)", + wsrep_get_mdl_type_name(get_type()), + wsrep_get_mdl_namespace_name(m_lock->key.mdl_namespace()), + m_lock->key.db_name(), + m_lock->key.name(), + psi_stage->m_name); } #endif /* WITH_WSREP */ diff --git a/sql/mem_root_array.h b/sql/mem_root_array.h index 2dcc475cd7b..5daeedadcba 100644 --- a/sql/mem_root_array.h +++ b/sql/mem_root_array.h @@ -47,12 +47,21 @@ template class Mem_root_array { public: + /// Convenience typedef, same typedef name as std::vector + typedef Element_type value_type; + Mem_root_array(MEM_ROOT *root) : m_root(root), m_array(NULL), m_size(0), m_capacity(0) { DBUG_ASSERT(m_root != NULL); } + Mem_root_array(MEM_ROOT *root, size_t n, const value_type &val= value_type()) + : m_root(root), m_array(NULL), m_size(0), m_capacity(0) + { + resize(n, val); + } + ~Mem_root_array() { clear(); @@ -70,6 +79,12 @@ public: return m_array[n]; } + Element_type &operator[](size_t n) { return at(n); } + const Element_type &operator[](size_t n) const { return at(n); } + + Element_type &back() { return at(size() - 1); } + const Element_type &back() const { return at(size() - 1); } + // Returns a pointer to the first element in the array. Element_type *begin() { return &m_array[0]; } @@ -155,6 +170,58 @@ public: return false; } + /** + Removes the last element in the array, effectively reducing the + container size by one. This destroys the removed element. + */ + void pop_back() + { + DBUG_ASSERT(!empty()); + if (!has_trivial_destructor) + back().~Element_type(); + m_size-= 1; + } + + /** + Resizes the container so that it contains n elements. + + If n is smaller than the current container size, the content is + reduced to its first n elements, removing those beyond (and + destroying them). + + If n is greater than the current container size, the content is + expanded by inserting at the end as many elements as needed to + reach a size of n. If val is specified, the new elements are + initialized as copies of val, otherwise, they are + value-initialized. + + If n is also greater than the current container capacity, an automatic + reallocation of the allocated storage space takes place. + + Notice that this function changes the actual content of the + container by inserting or erasing elements from it. + */ + void resize(size_t n, const value_type &val= value_type()) + { + if (n == m_size) + return; + if (n > m_size) + { + if (!reserve(n)) + { + while (n != m_size) + push_back(val); + } + return; + } + if (!has_trivial_destructor) + { + while (n != m_size) + pop_back(); + } + m_size= n; + } + size_t capacity() const { return m_capacity; } size_t element_size() const { return sizeof(Element_type); } bool empty() const { return size() == 0; } diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 845d114bc7a..8fa8f01b894 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -290,7 +290,7 @@ const char *show_comp_option_name[]= {"YES", "NO", "DISABLED"}; static const char *tc_heuristic_recover_names[]= { - "COMMIT", "ROLLBACK", NullS + "OFF", "COMMIT", "ROLLBACK", NullS }; static TYPELIB tc_heuristic_recover_typelib= { @@ -400,7 +400,6 @@ bool opt_error_log= IF_WIN(1,0); bool opt_disable_networking=0, opt_skip_show_db=0; bool opt_skip_name_resolve=0; my_bool opt_character_set_client_handshake= 1; -bool server_id_supplied = 0; bool opt_endinfo, using_udf_functions; my_bool locked_in_memory; bool opt_using_transactions; @@ -530,7 +529,7 @@ ulong extra_max_connections; uint max_digest_length= 0; ulong slave_retried_transactions; ulonglong slave_skipped_errors; -ulong feature_files_opened_with_delayed_keys; +ulong feature_files_opened_with_delayed_keys= 0, feature_check_constraint= 0; ulonglong denied_connections; my_decimal decimal_zero; @@ -1717,6 +1716,7 @@ static void close_connections(void) Events::deinit(); end_slave(); + mysql_bin_log.stop_background_thread(); /* Give threads time to die. @@ -2140,6 +2140,7 @@ static void mysqld_exit(int exit_code) shutdown_performance_schema(); // we do it as late as possible #endif set_malloc_size_cb(NULL); + DBUG_ASSERT(global_status_var.global_memory_used == 0); cleanup_tls(); DBUG_LEAVE; if (opt_endinfo && global_status_var.global_memory_used) @@ -2906,7 +2907,6 @@ void delete_running_thd(THD *thd) delete thd; dec_thread_running(); - dec_thread_count(); } /* @@ -2916,14 +2916,6 @@ void delete_running_thd(THD *thd) dec_thread_count() */ -void dec_thread_count(void) -{ - DBUG_ASSERT(thread_count > 0); - thread_safe_decrement32(&thread_count); - signal_thd_deleted(); -} - - /* Send a signal to unblock close_conneciton() / rpl_slave_init_thread() if there is no more threads running with a THD attached @@ -2949,7 +2941,7 @@ void signal_thd_deleted() /* - Unlink thd from global list of available connections and free thd + Unlink thd from global list of available connections SYNOPSIS unlink_thd() @@ -2971,8 +2963,7 @@ void unlink_thd(THD *thd) thd->add_status_to_global(); unlink_not_visible_thd(thd); - delete thd; - dec_thread_count(); + thd->free_connection(); DBUG_VOID_RETURN; } @@ -2983,6 +2974,7 @@ void unlink_thd(THD *thd) SYNOPSIS cache_thread() + thd Thread handler NOTES LOCK_thread_cache is used to protect the cache variables @@ -2994,10 +2986,11 @@ void unlink_thd(THD *thd) */ -static bool cache_thread() +static bool cache_thread(THD *thd) { struct timespec abstime; DBUG_ENTER("cache_thread"); + DBUG_ASSERT(thd); mysql_mutex_lock(&LOCK_thread_cache); if (cached_thread_count < thread_cache_size && @@ -3041,13 +3034,12 @@ static bool cache_thread() if (wake_thread) { CONNECT *connect; - THD *thd; wake_thread--; connect= thread_cache.get(); mysql_mutex_unlock(&LOCK_thread_cache); - if (!(thd= connect->create_thd())) + if (!(connect->create_thd(thd))) { /* Out of resources. Free thread to get more resources */ connect->close_and_delete(); @@ -3055,8 +3047,11 @@ static bool cache_thread() } delete connect; - thd->thread_stack= (char*) &thd; // For store_globals - (void) thd->store_globals(); + /* + We have to call store_globals to update mysys_var->id and lock_info + with the new thread_id + */ + thd->store_globals(); #ifdef HAVE_PSI_THREAD_INTERFACE /* @@ -3068,11 +3063,7 @@ static bool cache_thread() PSI_THREAD_CALL(set_thread)(psi); #endif - /* - THD::mysys_var::abort is associated with physical thread rather - than with THD object. So we need to reset this flag before using - this thread for handling of new THD object/connection. - */ + /* reset abort flag for the thread */ thd->mysys_var->abort= 0; thd->thr_create_utime= microsecond_interval_timer(); thd->start_utime= thd->thr_create_utime; @@ -3108,13 +3099,16 @@ static bool cache_thread() bool one_thread_per_connection_end(THD *thd, bool put_in_cache) { DBUG_ENTER("one_thread_per_connection_end"); - const bool wsrep_applier= IF_WSREP(thd->wsrep_applier, false); if (thd) - unlink_thd(thd); + { + const bool wsrep_applier= IF_WSREP(thd->wsrep_applier, false); - if (!wsrep_applier && put_in_cache && cache_thread()) - DBUG_RETURN(0); // Thread is reused + unlink_thd(thd); + if (!wsrep_applier && put_in_cache && cache_thread(thd)) + DBUG_RETURN(0); // Thread is reused + delete thd; + } DBUG_PRINT("info", ("killing thread")); DBUG_LEAVE; // Must match DBUG_ENTER() @@ -4076,9 +4070,9 @@ void init_com_statement_info() extern "C" my_thread_id mariadb_dbug_id() { THD *thd; - if ((thd= current_thd)) + if ((thd= current_thd) && thd->thread_dbug_id) { - return thd->thread_id; + return thd->thread_dbug_id; } return my_thread_dbug_id(); } @@ -4113,17 +4107,7 @@ static void my_malloc_size_cb_func(long long size, my_bool is_thread_specific) thd->status_var.global_memory_used+= size; } else - { update_global_memory_status(size); -#ifndef EMBEDDED_LIBRARY - /* - Check if we have missed some mallocs. THis can't be done for embedded - server as the main code may have done calls to malloc before starting - the embedded library. - */ - DBUG_ASSERT(global_status_var.global_memory_used >= 0); -#endif - } } } @@ -4286,14 +4270,6 @@ static int init_common_variables() else opt_log_basename= glob_hostname; -#ifdef WITH_WSREP - if (wsrep_node_name == 0 || wsrep_node_name[0] == 0) - { - my_free((void *)wsrep_node_name); - wsrep_node_name= my_strdup(glob_hostname, MYF(MY_WME)); - } -#endif /* WITH_WSREP */ - strmake(pidfile_name, opt_log_basename, sizeof(pidfile_name)-5); strmov(fn_ext(pidfile_name),".pid"); // Add proper extension SYSVAR_AUTOSIZE(pidfile_name_ptr, pidfile_name); @@ -4922,25 +4898,14 @@ static void end_ssl() /** Registers a file to be collected when Windows Error Reporting creates a crash report. - - @note only works on Vista and later, since WerRegisterFile() is not available - on earlier Windows. */ #include static void add_file_to_crash_report(char *file) { - /* Load WerRegisterFile function dynamically.*/ - HRESULT (WINAPI *pWerRegisterFile)(PCWSTR, WER_REGISTER_FILE_TYPE, DWORD) - =(HRESULT (WINAPI *) (PCWSTR, WER_REGISTER_FILE_TYPE, DWORD)) - GetProcAddress(GetModuleHandle("kernel32"),"WerRegisterFile"); - - if (pWerRegisterFile) + wchar_t wfile[MAX_PATH+1]= {0}; + if (mbstowcs(wfile, file, MAX_PATH) != (size_t)-1) { - wchar_t wfile[MAX_PATH+1]= {0}; - if (mbstowcs(wfile, file, MAX_PATH) != (size_t)-1) - { - pWerRegisterFile(wfile, WerRegFileTypeOther, WER_FILE_ANONYMOUS_DATA); - } + WerRegisterFile(wfile, WerRegFileTypeOther, WER_FILE_ANONYMOUS_DATA); } } #endif @@ -5865,17 +5830,6 @@ int mysqld_main(int argc, char **argv) if (WSREP_ON && wsrep_check_opts()) global_system_variables.wsrep_on= 0; - if (opt_bin_log && !global_system_variables.server_id) - { - SYSVAR_AUTOSIZE(global_system_variables.server_id, ::server_id= 1); -#ifdef EXTRA_DEBUG - sql_print_warning("You have enabled the binary log, but you haven't set " - "server-id to a non-zero value: we force server id to 1; " - "updates will be logged to the binary log, but " - "connections from slaves will not be accepted."); -#endif - } - /* The subsequent calls may take a long time : e.g. innodb log read. Thus set the long running service control manager timeout @@ -5979,7 +5933,10 @@ int mysqld_main(int argc, char **argv) wsrep_SE_init_grab(); wsrep_SE_init_done(); /*! in case of SST wsrep waits for wsrep->sst_received */ - wsrep_sst_continue(); + if (wsrep_sst_continue()) + { + WSREP_ERROR("Failed to signal the wsrep provider to continue."); + } } else { @@ -6326,7 +6283,7 @@ static void bootstrap(MYSQL_FILE *file) { DBUG_ENTER("bootstrap"); - THD *thd= new THD; + THD *thd= new THD(next_thread_id()); #ifdef WITH_WSREP thd->variables.wsrep_on= 0; #endif @@ -6334,8 +6291,6 @@ static void bootstrap(MYSQL_FILE *file) my_net_init(&thd->net,(st_vio*) 0, (void*) 0, MYF(0)); thd->max_client_packet_length= thd->net.max_packet; thd->security_ctx->master_access= ~(ulong)0; - thd->thread_id= thd->variables.pseudo_thread_id= next_thread_id(); - thread_count++; // Safe as only one thread running in_bootstrap= TRUE; bootstrap_file=file; @@ -6439,23 +6394,15 @@ void create_thread_to_handle_connection(CONNECT *connect) if ((error= mysql_thread_create(key_thread_one_connection, &connect->real_id, &connection_attrib, - handle_one_connection, - (void*) connect))) + handle_one_connection, (void*) connect))) { /* purecov: begin inspected */ - DBUG_PRINT("error", - ("Can't create thread to handle request (error %d)", + DBUG_PRINT("error", ("Can't create thread to handle request (error %d)", error)); - dec_connection_count(connect->scheduler); - statistic_increment(aborted_connects,&LOCK_status); - statistic_increment(connection_errors_internal, &LOCK_status); my_snprintf(error_message_buff, sizeof(error_message_buff), ER_DEFAULT(ER_CANT_CREATE_THREAD), error); - connect->close_with_error(ER_CANT_CREATE_THREAD, - error_message_buff, + connect->close_with_error(ER_CANT_CREATE_THREAD, error_message_buff, ER_OUT_OF_RESOURCES); - /* thread_count was incremented in create_new_thread() */ - dec_thread_count(); DBUG_VOID_RETURN; /* purecov: end */ } @@ -6507,7 +6454,6 @@ static void create_new_thread(CONNECT *connect) mysql_mutex_unlock(&LOCK_connection_count); - thread_safe_increment32(&thread_count); connect->thread_count_incremented= 1; /* @@ -7232,7 +7178,7 @@ struct my_option my_long_options[]= GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, /* Because Sys_var_bit does not support command-line options, we need to - explicitely add one for --autocommit + explicitly add one for --autocommit */ {"autocommit", 0, "Set default value for autocommit (0 or 1)", &opt_autocommit, &opt_autocommit, 0, @@ -8432,6 +8378,7 @@ SHOW_VAR status_vars[]= { {"Empty_queries", (char*) offsetof(STATUS_VAR, empty_queries), SHOW_LONG_STATUS}, {"Executed_events", (char*) &executed_events, SHOW_LONG_NOFLUSH }, {"Executed_triggers", (char*) offsetof(STATUS_VAR, executed_triggers), SHOW_LONG_STATUS}, + {"Feature_check_constraint", (char*) &feature_check_constraint, SHOW_LONG }, {"Feature_delay_key_write", (char*) &feature_files_opened_with_delayed_keys, SHOW_LONG }, {"Feature_dynamic_columns", (char*) offsetof(STATUS_VAR, feature_dynamic_columns), SHOW_LONG_STATUS}, {"Feature_fulltext", (char*) offsetof(STATUS_VAR, feature_fulltext), SHOW_LONG_STATUS}, @@ -8748,7 +8695,6 @@ static int mysql_init_variables(void) mqh_used= 0; kill_in_progress= 0; cleanup_done= 0; - server_id_supplied= 0; test_flags= select_errors= dropping_tables= ha_open_options=0; thread_count= thread_running= kill_cached_threads= wake_thread= 0; service_thread_count= 0; @@ -9217,7 +9163,6 @@ mysqld_get_one_option(int optid, const struct my_option *opt, char *argument) opt_noacl=opt_bootstrap=1; break; case OPT_SERVER_ID: - server_id_supplied = 1; ::server_id= global_system_variables.server_id; break; case OPT_LOWER_CASE_TABLE_NAMES: @@ -9248,6 +9193,7 @@ mysqld_get_one_option(int optid, const struct my_option *opt, char *argument) log_error_file_ptr= const_cast(""); break; case OPT_IGNORE_DB_DIRECTORY: + opt_ignore_db_dirs= NULL; // will be set in ignore_db_dirs_process_additions if (*argument == 0) ignore_db_dirs_reset(); else @@ -9341,6 +9287,16 @@ mysqld_get_one_option(int optid, const struct my_option *opt, char *argument) #endif break; } +#ifdef WITH_WSREP + case OPT_WSREP_CAUSAL_READS: + wsrep_causal_reads_update(&global_system_variables); + break; + case OPT_WSREP_SYNC_WAIT: + global_system_variables.wsrep_causal_reads= + MY_TEST(global_system_variables.wsrep_sync_wait & + WSREP_SYNC_WAIT_BEFORE_READ); + break; +#endif /* WITH_WSREP */ } return 0; } @@ -9637,13 +9593,6 @@ static int get_options(int *argc_ptr, char ***argv_ptr) one_thread_scheduler(extra_thread_scheduler); #else -#ifdef _WIN32 - /* workaround: disable thread pool on XP */ - if (GetProcAddress(GetModuleHandle("kernel32"),"CreateThreadpool") == 0 && - thread_handling > SCHEDULER_NO_THREADS) - SYSVAR_AUTOSIZE(thread_handling, SCHEDULER_ONE_THREAD_PER_CONNECTION); -#endif - if (thread_handling <= SCHEDULER_ONE_THREAD_PER_CONNECTION) one_thread_per_connection_scheduler(thread_scheduler, &max_connections, &connection_count); diff --git a/sql/mysqld.h b/sql/mysqld.h index e538cbd724e..846a01a9427 100644 --- a/sql/mysqld.h +++ b/sql/mysqld.h @@ -1,5 +1,5 @@ -/* Copyright (c) 2006, 2015, Oracle and/or its affiliates. - Copyright (c) 2010, 2015, MariaDB +/* Copyright (c) 2006, 2016, Oracle and/or its affiliates. + Copyright (c) 2010, 2016, MariaDB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -107,7 +107,7 @@ extern CHARSET_INFO *error_message_charset_info; extern CHARSET_INFO *character_set_filesystem; extern MY_BITMAP temp_pool; -extern bool opt_large_files, server_id_supplied; +extern bool opt_large_files; extern bool opt_update_log, opt_bin_log, opt_error_log; extern my_bool opt_log, opt_bootstrap; extern my_bool opt_backup_history_log; @@ -639,6 +639,10 @@ enum options_mysqld OPT_SSL_KEY, OPT_THREAD_CONCURRENCY, OPT_WANT_CORE, +#ifdef WITH_WSREP + OPT_WSREP_CAUSAL_READS, + OPT_WSREP_SYNC_WAIT, +#endif /* WITH_WSREP */ OPT_MYSQL_COMPATIBILITY, OPT_MYSQL_TO_BE_IMPLEMENTED, OPT_which_is_always_the_last @@ -686,7 +690,12 @@ enum enum_query_type /// Be more detailed than QT_EXPLAIN. /// Perhaps we should eventually include QT_ITEM_IDENT_SKIP_CURRENT_DATABASE /// here, as it would give better readable results - QT_EXPLAIN_EXTENDED= QT_TO_SYSTEM_CHARSET + QT_EXPLAIN_EXTENDED= QT_TO_SYSTEM_CHARSET, + + // If an expression is constant, print the expression, not the value + // it evaluates to. Should be used for error messages, so that they + // don't reveal values. + QT_NO_DATA_EXPANSION= (1 << 9), }; @@ -766,7 +775,6 @@ inline void dec_thread_running() } extern void set_server_version(void); -extern void dec_thread_count(void); #if defined(MYSQL_DYNAMIC_PLUGIN) && defined(_WIN32) extern "C" THD *_current_thd_noinline(); diff --git a/sql/opt_range.cc b/sql/opt_range.cc index a69709bbf03..bd191f715e0 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -255,12 +255,19 @@ public: (type == SEL_TREE::IMPOSSIBLE) */ enum Type { IMPOSSIBLE, ALWAYS, MAYBE, KEY, KEY_SMALLER } type; - SEL_TREE(enum Type type_arg) :type(type_arg) {} - SEL_TREE() :type(KEY) + + SEL_TREE(enum Type type_arg, MEM_ROOT *root, size_t num_keys) + : type(type_arg), keys(root, num_keys), n_ror_scans(0) { keys_map.clear_all(); - bzero((char*) keys,sizeof(keys)); } + + SEL_TREE(MEM_ROOT *root, size_t num_keys) : + type(KEY), keys(root, num_keys), n_ror_scans(0) + { + keys_map.clear_all(); + } + SEL_TREE(SEL_TREE *arg, bool without_merges, RANGE_OPT_PARAM *param); /* Note: there may exist SEL_TREE objects with sel_tree->type=KEY and @@ -268,7 +275,8 @@ public: merit in range analyzer functions (e.g. get_mm_parts) returning a pointer to such SEL_TREE instead of NULL) */ - SEL_ARG *keys[MAX_KEY]; + Mem_root_array keys; + key_map keys_map; /* bitmask of non-NULL elements in keys */ /* @@ -578,7 +586,7 @@ int SEL_IMERGE::and_sel_tree(RANGE_OPT_PARAM *param, SEL_TREE *tree, { SEL_TREE *res_or_tree= 0; SEL_TREE *and_tree= 0; - if (!(res_or_tree= new SEL_TREE()) || + if (!(res_or_tree= new SEL_TREE(param->mem_root, param->keys)) || !(and_tree= new SEL_TREE(tree, TRUE, param))) return (-1); if (!and_range_trees(param, *or_tree, and_tree, res_or_tree)) @@ -787,7 +795,10 @@ int SEL_IMERGE::or_sel_imerge_with_checks(RANGE_OPT_PARAM *param, */ SEL_TREE::SEL_TREE(SEL_TREE *arg, bool without_merges, - RANGE_OPT_PARAM *param): Sql_alloc() + RANGE_OPT_PARAM *param) + : Sql_alloc(), + keys(param->mem_root, param->keys), + n_ror_scans(0) { keys_map= arg->keys_map; type= arg->type; @@ -3022,9 +3033,7 @@ bool calculate_cond_selectivity_for_table(THD *thd, TABLE *table, Item **cond) PARAM param; MEM_ROOT alloc; SEL_TREE *tree; - SEL_ARG **key, **end; double rows; - uint idx= 0; init_sql_alloc(&alloc, thd->variables.range_alloc_block_size, 0, MYF(MY_THREAD_SPECIFIC)); @@ -3069,11 +3078,12 @@ bool calculate_cond_selectivity_for_table(THD *thd, TABLE *table, Item **cond) goto free_alloc; } - for (key= tree->keys, end= key + param.keys; key != end; key++, idx++) + for (uint idx= 0; idx < param.keys; idx++) { - if (*key) + SEL_ARG *key= tree->keys[idx]; + if (key) { - if ((*key)->type == SEL_ARG::IMPOSSIBLE) + if (key->type == SEL_ARG::IMPOSSIBLE) { rows= 0; table->reginfo.impossible_range= 1; @@ -3081,10 +3091,10 @@ bool calculate_cond_selectivity_for_table(THD *thd, TABLE *table, Item **cond) } else { - rows= records_in_column_ranges(¶m, idx, *key); + rows= records_in_column_ranges(¶m, idx, key); if (rows != HA_POS_ERROR) - (*key)->field->cond_selectivity= rows/table_records; - } + key->field->cond_selectivity= rows/table_records; + } } } @@ -3122,8 +3132,7 @@ bool calculate_cond_selectivity_for_table(THD *thd, TABLE *table, Item **cond) DBUG_RETURN(TRUE); dt->list.empty(); dt->table= table; - if ((*cond)->walk(&Item::find_selective_predicates_list_processor, 0, - (uchar*) dt)) + if ((*cond)->walk(&Item::find_selective_predicates_list_processor, 0, dt)) DBUG_RETURN(TRUE); if (dt->list.elements > 0) { @@ -4949,8 +4958,8 @@ TABLE_READ_PLAN *merge_same_index_scans(PARAM *param, SEL_IMERGE *imerge, { SEL_TREE **changed_tree= imerge->trees+(*tree_idx_ptr-1); SEL_ARG *key= (*changed_tree)->keys[key_idx]; - bzero((*changed_tree)->keys, - sizeof((*changed_tree)->keys[0])*param->keys); + for (uint i= 0; i < param->keys; i++) + (*changed_tree)->keys[i]= NULL; (*changed_tree)->keys_map.clear_all(); if (key) key->incr_refs(); @@ -6727,8 +6736,8 @@ static TRP_RANGE *get_key_scans_params(PARAM *param, SEL_TREE *tree, bool update_tbl_stats, double read_time) { - uint idx; - SEL_ARG **key,**end, **key_to_read= NULL; + uint idx, best_idx; + SEL_ARG *key_to_read= NULL; ha_rows UNINIT_VAR(best_records); /* protected by key_to_read */ uint UNINIT_VAR(best_mrr_flags), /* protected by key_to_read */ UNINIT_VAR(best_buf_size); /* protected by key_to_read */ @@ -6751,9 +6760,10 @@ static TRP_RANGE *get_key_scans_params(PARAM *param, SEL_TREE *tree, sizeof(INDEX_SCAN_INFO *) * param->keys); } tree->index_scans_end= tree->index_scans; - for (idx= 0,key=tree->keys, end=key+param->keys; key != end; key++,idx++) + for (idx= 0; idx < param->keys; idx++) { - if (*key) + SEL_ARG *key= tree->keys[idx]; + if (key) { ha_rows found_records; Cost_estimate cost; @@ -6761,14 +6771,14 @@ static TRP_RANGE *get_key_scans_params(PARAM *param, SEL_TREE *tree, uint mrr_flags, buf_size; INDEX_SCAN_INFO *index_scan; uint keynr= param->real_keynr[idx]; - if ((*key)->type == SEL_ARG::MAYBE_KEY || - (*key)->maybe_flag) + if (key->type == SEL_ARG::MAYBE_KEY || + key->maybe_flag) param->needed_reg->set_bit(keynr); bool read_index_only= index_read_must_be_used ? TRUE : (bool) param->table->covering_keys.is_set(keynr); - found_records= check_quick_select(param, idx, read_index_only, *key, + found_records= check_quick_select(param, idx, read_index_only, key, update_tbl_stats, &mrr_flags, &buf_size, &cost); @@ -6782,7 +6792,7 @@ static TRP_RANGE *get_key_scans_params(PARAM *param, SEL_TREE *tree, index_scan->used_key_parts= param->max_key_part+1; index_scan->range_count= param->range_count; index_scan->records= found_records; - index_scan->sel_arg= *key; + index_scan->sel_arg= key; *tree->index_scans_end++= index_scan; } if ((found_records != HA_POS_ERROR) && param->is_ror_scan) @@ -6796,6 +6806,7 @@ static TRP_RANGE *get_key_scans_params(PARAM *param, SEL_TREE *tree, read_time= found_read_time; best_records= found_records; key_to_read= key; + best_idx= idx; best_mrr_flags= mrr_flags; best_buf_size= buf_size; } @@ -6806,17 +6817,16 @@ static TRP_RANGE *get_key_scans_params(PARAM *param, SEL_TREE *tree, "ROR scans");); if (key_to_read) { - idx= key_to_read - tree->keys; - if ((read_plan= new (param->mem_root) TRP_RANGE(*key_to_read, idx, + if ((read_plan= new (param->mem_root) TRP_RANGE(key_to_read, best_idx, best_mrr_flags))) { read_plan->records= best_records; - read_plan->is_ror= tree->ror_scans_map.is_set(idx); + read_plan->is_ror= tree->ror_scans_map.is_set(best_idx); read_plan->read_cost= read_time; read_plan->mrr_buf_size= best_buf_size; DBUG_PRINT("info", ("Returning range plan for key %s, cost %g, records %lu", - param->table->key_info[param->real_keynr[idx]].name, + param->table->key_info[param->real_keynr[best_idx]].name, read_plan->read_cost, (ulong) read_plan->records)); } } @@ -7105,7 +7115,7 @@ SEL_TREE *Item_func_in::get_func_mm_tree(RANGE_OPT_PARAM *param, DBUG_RETURN(NULL); } SEL_TREE *tree2; - for (; i < array->count; i++) + for (; i < array->used_count; i++) { if (array->compare_elems(i, i-1)) { @@ -7444,9 +7454,11 @@ SEL_TREE *Item::get_mm_tree_for_const(RANGE_OPT_PARAM *param) MEM_ROOT *tmp_root= param->mem_root; param->thd->mem_root= param->old_root; SEL_TREE *tree; - tree= val_int() ? new(tmp_root) SEL_TREE(SEL_TREE::ALWAYS) : - new(tmp_root) SEL_TREE(SEL_TREE::IMPOSSIBLE); + + const SEL_TREE::Type type= val_int()? SEL_TREE::ALWAYS: SEL_TREE::IMPOSSIBLE; param->thd->mem_root= tmp_root; + + tree= new (tmp_root) SEL_TREE(type, tmp_root, param->keys); DBUG_RETURN(tree); } @@ -7472,7 +7484,8 @@ SEL_TREE *Item::get_mm_tree(RANGE_OPT_PARAM *param, Item **cond_ptr) if ((ref_tables & param->current_table) || (ref_tables & ~(param->prev_tables | param->read_tables))) DBUG_RETURN(0); - DBUG_RETURN(new SEL_TREE(SEL_TREE::MAYBE)); + DBUG_RETURN(new (param->mem_root) SEL_TREE(SEL_TREE::MAYBE, param->mem_root, + param->keys)); } @@ -7590,7 +7603,8 @@ Item_bool_func::get_mm_parts(RANGE_OPT_PARAM *param, Field *field, if (field->eq(key_part->field)) { SEL_ARG *sel_arg=0; - if (!tree && !(tree=new (param->thd->mem_root) SEL_TREE())) + if (!tree && !(tree=new (param->thd->mem_root) SEL_TREE(param->mem_root, + param->keys))) DBUG_RETURN(0); // OOM if (!value || !(value_used_tables & ~param->read_tables)) { @@ -8553,14 +8567,31 @@ tree_or(RANGE_OPT_PARAM *param,SEL_TREE *tree1,SEL_TREE *tree2) imerge[0]= new SEL_IMERGE(tree1->merges.head(), 0, param); } bool no_imerge_from_ranges= FALSE; - if (!(result= new SEL_TREE())) - DBUG_RETURN(result); /* Build the range part of the tree for the formula (1) */ if (sel_trees_can_be_ored(param, tree1, tree2, &ored_keys)) { bool must_be_ored= sel_trees_must_be_ored(param, tree1, tree2, ored_keys); no_imerge_from_ranges= must_be_ored; + + if (no_imerge_from_ranges && no_merges1 && no_merges2) + { + /* + Reuse tree1 as the result in simple cases. This reduces memory usage + for e.g. "key IN (c1, ..., cN)" which produces a lot of ranges. + */ + result= tree1; + result->keys_map.clear_all(); + } + else + { + if (!(result= new (param->mem_root) SEL_TREE(param->mem_root, + param->keys))) + { + DBUG_RETURN(result); + } + } + key_map::Iterator it(ored_keys); int key_no; while ((key_no= it++) != key_map::Iterator::BITMAP_END) @@ -8577,7 +8608,13 @@ tree_or(RANGE_OPT_PARAM *param,SEL_TREE *tree1,SEL_TREE *tree2) } result->type= tree1->type; } - + else + { + if (!result && !(result= new (param->mem_root) SEL_TREE(param->mem_root, + param->keys))) + DBUG_RETURN(result); + } + if (no_imerge_from_ranges && no_merges1 && no_merges2) { if (result->keys_map.is_clear_all()) @@ -12400,7 +12437,7 @@ get_best_group_min_max(PARAM *param, SEL_TREE *tree, double read_time) /* Check if cur_part is referenced in the WHERE clause. */ if (join->conds->walk(&Item::find_item_in_field_list_processor, 0, - (uchar*) key_part_range)) + key_part_range)) goto next_index; } } @@ -13914,7 +13951,7 @@ int QUICK_GROUP_MIN_MAX_SELECT::next_max() SELECT [SUM|COUNT|AVG](DISTINCT a,...) FROM t This method comes to replace the index scan + Unique class (distinct selection) for loose index scan that visits all the rows of a - covering index instead of jumping in the begining of each group. + covering index instead of jumping in the beginning of each group. TODO: Placeholder function. To be replaced by a handler API call @param is_index_scan hint to use index scan instead of random index read @@ -14382,16 +14419,12 @@ void QUICK_GROUP_MIN_MAX_SELECT::add_keys_and_lengths(String *key_names, static void print_sel_tree(PARAM *param, SEL_TREE *tree, key_map *tree_map, const char *msg) { - SEL_ARG **key,**end; - int idx; char buff[1024]; DBUG_ENTER("print_sel_tree"); String tmp(buff,sizeof(buff),&my_charset_bin); tmp.length(0); - for (idx= 0,key=tree->keys, end=key+param->keys ; - key != end ; - key++,idx++) + for (uint idx= 0; idx < param->keys; idx++) { if (tree_map->is_set(idx)) { diff --git a/sql/opt_range_mrr.cc b/sql/opt_range_mrr.cc index bff96c7d4cb..729c491a6f1 100644 --- a/sql/opt_range_mrr.cc +++ b/sql/opt_range_mrr.cc @@ -266,12 +266,28 @@ walk_up_n_right: range->end_key.flag= (cur->max_key_flag & NEAR_MAX ? HA_READ_BEFORE_KEY : HA_READ_AFTER_KEY); range->end_key.keypart_map= make_prev_keypart_map(cur->max_key_parts); - + + KEY *key_info; + if (seq->real_keyno== MAX_KEY) + key_info= NULL; + else + key_info= &seq->param->table->key_info[seq->real_keyno]; + + /* + Conditions below: + (1) - range analysis is used for estimating condition selectivity + (2) - This is a unique key, and we have conditions for all its + user-defined key parts. + (3) - The table uses extended keys, and we have conditions for + all key parts. + */ if (!(cur->min_key_flag & ~NULL_RANGE) && !cur->max_key_flag && - (seq->real_keyno == MAX_KEY || - ((uint)key_tree->part+1 == - seq->param->table->key_info[seq->real_keyno].user_defined_key_parts && - (seq->param->table->key_info[seq->real_keyno].flags & HA_NOSAME))) && + (!key_info || // (1) + ((uint)key_tree->part+1 == key_info->user_defined_key_parts && // (2) + key_info->flags & HA_NOSAME) || // (2) + (seq->param->table->s->use_ext_keys && // (3) + (uint)key_tree->part+1 == key_info->ext_key_parts) // (3) + ) && range->start_key.length == range->end_key.length && !memcmp(seq->param->min_key,seq->param->max_key,range->start_key.length)) range->range_flag= UNIQUE_RANGE | (cur->min_key_flag & NULL_RANGE); diff --git a/sql/opt_subselect.cc b/sql/opt_subselect.cc index afb439040de..ef05b768b69 100644 --- a/sql/opt_subselect.cc +++ b/sql/opt_subselect.cc @@ -2249,7 +2249,8 @@ bool optimize_semijoin_nests(JOIN *join, table_map all_table_map) rows *= join->map2table[tableno]->table->quick_condition_rows; sjm->rows= MY_MIN(sjm->rows, rows); } - memcpy(sjm->positions, join->best_positions + join->const_tables, + memcpy((uchar*) sjm->positions, + (uchar*) (join->best_positions + join->const_tables), sizeof(POSITION) * n_tables); /* @@ -3351,7 +3352,7 @@ void fix_semijoin_strategies_for_picked_join_order(JOIN *join) SJ_MATERIALIZATION_INFO *sjm= s->emb_sj_nest->sj_mat_info; sjm->is_used= TRUE; sjm->is_sj_scan= FALSE; - memcpy(pos - sjm->tables + 1, sjm->positions, + memcpy((uchar*) (pos - sjm->tables + 1), (uchar*) sjm->positions, sizeof(POSITION) * sjm->tables); recalculate_prefix_record_count(join, tablenr - sjm->tables + 1, tablenr); @@ -3367,8 +3368,8 @@ void fix_semijoin_strategies_for_picked_join_order(JOIN *join) sjm->is_used= TRUE; sjm->is_sj_scan= TRUE; first= pos->sjmat_picker.sjm_scan_last_inner - sjm->tables + 1; - memcpy(join->best_positions + first, - sjm->positions, sizeof(POSITION) * sjm->tables); + memcpy((uchar*) (join->best_positions + first), + (uchar*) sjm->positions, sizeof(POSITION) * sjm->tables); recalculate_prefix_record_count(join, first, first + sjm->tables); join->best_positions[first].sj_strategy= SJ_OPT_MATERIALIZE_SCAN; join->best_positions[first].n_sj_tables= sjm->tables; diff --git a/sql/opt_table_elimination.cc b/sql/opt_table_elimination.cc index 6835594ca07..b4131093f0f 100644 --- a/sql/opt_table_elimination.cc +++ b/sql/opt_table_elimination.cc @@ -1069,7 +1069,7 @@ bool Dep_analysis_context::setup_equality_modules_deps(List { /* Regular tbl.col=expr(tblX1.col1, tblY1.col2, ...) */ eq_mod->expr->walk(&Item::enumerate_field_refs_processor, FALSE, - (uchar*)&deps_recorder); + &deps_recorder); } else { diff --git a/sql/parse_file.cc b/sql/parse_file.cc index f3dab4f7b2f..1cd294c1c7a 100644 --- a/sql/parse_file.cc +++ b/sql/parse_file.cc @@ -660,7 +660,7 @@ parse_quoted_escaped_string(const char *ptr, const char *end, @param[in,out] ptr pointer to parameter @param[in] end end of the configuration - @param[in] line pointer to the line begining + @param[in] line pointer to the line beginning @param[in] base base address for parameter writing (structure like TABLE) @param[in] parameter description diff --git a/sql/partition_info.cc b/sql/partition_info.cc index 43a00607fe6..4f297c630ad 100644 --- a/sql/partition_info.cc +++ b/sql/partition_info.cc @@ -483,11 +483,12 @@ bool partition_info::set_used_partition(List &fields, if (fields.elements || !values.elements) { - if (fill_record(thd, table, fields, values, false)) + if (fill_record(thd, table, fields, values, false, !copy_default_values)) goto err; } else { + /* All fields has a value */ if (fill_record(thd, table, table->field, values, false, false)) goto err; } @@ -590,9 +591,9 @@ void partition_info::set_show_version_string(String *packet) else { if (part_expr) - part_expr->walk(&Item::intro_version, 0, (uchar*)&version); + part_expr->walk(&Item::intro_version, 0, &version); if (subpart_expr) - subpart_expr->walk(&Item::intro_version, 0, (uchar*)&version); + subpart_expr->walk(&Item::intro_version, 0, &version); if (version == 0) { /* No new functions in partition function */ @@ -1668,8 +1669,7 @@ bool partition_info::check_partition_info(THD *thd, handlerton **eng_type, if (!list_of_part_fields) { DBUG_ASSERT(part_expr); - err= part_expr->walk(&Item::check_partition_func_processor, 0, - NULL); + err= part_expr->walk(&Item::check_partition_func_processor, 0, NULL); } /* Check for sub partition expression. */ @@ -2424,8 +2424,7 @@ bool partition_info::add_column_list_value(THD *thd, Item *item) else thd->where= "partition function"; - if (item->walk(&Item::check_partition_func_processor, 0, - NULL)) + if (item->walk(&Item::check_partition_func_processor, 0, NULL)) { my_error(ER_PARTITION_FUNCTION_IS_NOT_ALLOWED, MYF(0)); DBUG_RETURN(TRUE); diff --git a/sql/procedure.h b/sql/procedure.h index 1452f33652a..be631675d5c 100644 --- a/sql/procedure.h +++ b/sql/procedure.h @@ -53,9 +53,10 @@ public: init_make_field(tmp_field,field_type()); } unsigned int size_of() { return sizeof(*this);} - bool check_vcol_func_processor(uchar *int_arg) + bool check_vcol_func_processor(void *arg) { - return trace_unsupported_by_check_vcol_func_processor("proc"); + DBUG_ASSERT(0); // impossible + return mark_unsupported_function("proc", arg, VCOL_IMPOSSIBLE); } }; diff --git a/sql/protocol.cc b/sql/protocol.cc index 6469581b482..608ec553da0 100644 --- a/sql/protocol.cc +++ b/sql/protocol.cc @@ -759,6 +759,10 @@ bool Protocol::send_result_set_metadata(List *list, uint flags) Send_field field; item->make_field(thd, &field); + /* limit number of decimals for float and double */ + if (field.type == MYSQL_TYPE_FLOAT || field.type == MYSQL_TYPE_DOUBLE) + set_if_smaller(field.decimals, FLOATING_POINT_DECIMALS); + /* Keep things compatible for old clients */ if (field.type == MYSQL_TYPE_VARCHAR) field.type= MYSQL_TYPE_VAR_STRING; diff --git a/sql/rpl_gtid.cc b/sql/rpl_gtid.cc index 5a94e1c5b54..4adea76b3cb 100644 --- a/sql/rpl_gtid.cc +++ b/sql/rpl_gtid.cc @@ -1015,8 +1015,8 @@ gtid_parser_helper(char **ptr, char *end, rpl_gtid *out_gtid) if (err != 0) return 1; - out_gtid->domain_id= v1; - out_gtid->server_id= v2; + out_gtid->domain_id= (uint32) v1; + out_gtid->server_id= (uint32) v2; out_gtid->seq_no= v3; *ptr= q; return 0; diff --git a/sql/rpl_parallel.cc b/sql/rpl_parallel.cc index df036d0e23f..a389dac1bba 100644 --- a/sql/rpl_parallel.cc +++ b/sql/rpl_parallel.cc @@ -307,6 +307,7 @@ do_gco_wait(rpl_group_info *rgi, group_commit_orderer *gco, &stage_waiting_for_prior_transaction_to_start_commit, old_stage); *did_enter_cond= true; + thd->set_time_for_next_stage(); do { if (thd->check_killed() && !rgi->worker_error) @@ -369,6 +370,7 @@ do_ftwrl_wait(rpl_group_info *rgi, thd->ENTER_COND(&entry->COND_parallel_entry, &entry->LOCK_parallel_entry, &stage_waiting_for_ftwrl, old_stage); *did_enter_cond= true; + thd->set_time_for_next_stage(); do { if (entry->force_abort || rgi->worker_error) @@ -417,8 +419,11 @@ pool_mark_busy(rpl_parallel_thread_pool *pool, THD *thd) */ mysql_mutex_lock(&pool->LOCK_rpl_thread_pool); if (thd) + { thd->ENTER_COND(&pool->COND_rpl_thread_pool, &pool->LOCK_rpl_thread_pool, &stage_waiting_for_rpl_thread_pool, &old_stage); + thd->set_time_for_next_stage(); + } while (pool->busy) { if (thd && thd->check_killed()) @@ -534,6 +539,7 @@ rpl_pause_for_ftwrl(THD *thd) e->pause_sub_id= e->largest_started_sub_id; thd->ENTER_COND(&e->COND_parallel_entry, &e->LOCK_parallel_entry, &stage_waiting_for_ftwrl_threads_to_pause, &old_stage); + thd->set_time_for_next_stage(); while (e->pause_sub_id < (uint64)ULONGLONG_MAX && e->last_committed_sub_id < e->pause_sub_id && !err) @@ -967,9 +973,8 @@ handle_rpl_parallel_thread(void *arg) struct rpl_parallel_thread *rpt= (struct rpl_parallel_thread *)arg; my_thread_init(); - thd = new THD; + thd = new THD(next_thread_id()); thd->thread_stack = (char*)&thd; - thd->thread_id= thd->variables.pseudo_thread_id= next_thread_id(); add_to_active_threads(thd); set_current_thd(thd); pthread_detach_this_thread(); @@ -996,7 +1001,6 @@ handle_rpl_parallel_thread(void *arg) */ thd->variables.tx_isolation= ISO_REPEATABLE_READ; - mysql_mutex_lock(&rpt->LOCK_rpl_thread); rpt->thd= thd; @@ -1006,8 +1010,10 @@ handle_rpl_parallel_thread(void *arg) rpt->running= true; mysql_cond_signal(&rpt->COND_rpl_thread); + thd->set_command(COM_SLAVE_WORKER); while (!rpt->stop) { + uint wait_count= 0; rpl_parallel_thread::queued_event *qev, *next_qev; thd->ENTER_COND(&rpt->COND_rpl_thread, &rpt->LOCK_rpl_thread, @@ -1026,7 +1032,11 @@ handle_rpl_parallel_thread(void *arg) (rpt->current_owner && !in_event_group) || (rpt->current_owner && group_rgi->parallel_entry->force_abort) || rpt->stop)) + { + if (!wait_count++) + thd->set_time_for_next_stage(); mysql_cond_wait(&rpt->COND_rpl_thread, &rpt->LOCK_rpl_thread); + } rpt->dequeue1(events); thd->EXIT_COND(&old_stage); diff --git a/sql/rpl_rli.cc b/sql/rpl_rli.cc index f9d0910a2a7..c1a1c440922 100644 --- a/sql/rpl_rli.cc +++ b/sql/rpl_rli.cc @@ -1,5 +1,6 @@ /* Copyright (c) 2006, 2013, Oracle and/or its affiliates. Copyright (c) 2010, 2013, Monty Program Ab + Copyright (c) 2016, MariaDB Corporation This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -52,8 +53,8 @@ Relay_log_info::Relay_log_info(bool is_slave_recovery) no_storage(FALSE), replicate_same_server_id(::replicate_same_server_id), info_fd(-1), cur_log_fd(-1), relay_log(&sync_relaylog_period), sync_counter(0), is_relay_log_recovery(is_slave_recovery), - save_temporary_tables(0), mi(0), - inuse_relaylog_list(0), last_inuse_relaylog(0), + save_temporary_tables(0), + mi(0), inuse_relaylog_list(0), last_inuse_relaylog(0), cur_log_old_open_count(0), group_relay_log_pos(0), event_relay_log_pos(0), #if HAVE_valgrind @@ -1062,24 +1063,53 @@ void Relay_log_info::inc_group_relay_log_pos(ulonglong log_pos, void Relay_log_info::close_temporary_tables() { - TABLE *table,*next; DBUG_ENTER("Relay_log_info::close_temporary_tables"); - for (table=save_temporary_tables ; table ; table=next) - { - next=table->next; + TMP_TABLE_SHARE *share; + TABLE *table; + + if (!save_temporary_tables) + { + /* There are no temporary tables. */ + DBUG_VOID_RETURN; + } + + while ((share= save_temporary_tables->pop_front())) + { + /* + Iterate over the list of tables for this TABLE_SHARE and close them. + */ + while ((table= share->all_tmp_tables.pop_front())) + { + DBUG_PRINT("tmptable", ("closing table: '%s'.'%s'", + table->s->db.str, table->s->table_name.str)); + + /* Reset in_use as the table may have been created by another thd */ + table->in_use= 0; + /* + Lets not free TABLE_SHARE here as there could be multiple TABLEs opened + for the same table (TABLE_SHARE). + */ + closefrm(table); + my_free(table); + } - /* Reset in_use as the table may have been created by another thd */ - table->in_use=0; /* Don't ask for disk deletion. For now, anyway they will be deleted when slave restarts, but it is a better intention to not delete them. */ - DBUG_PRINT("info", ("table: 0x%lx", (long) table)); - close_temporary(table, 1, 0); + + free_table_share(share); + my_free(share); } - save_temporary_tables= 0; + + /* By now, there mustn't be any elements left in the list. */ + DBUG_ASSERT(save_temporary_tables->is_empty()); + + my_free(save_temporary_tables); + save_temporary_tables= NULL; slave_open_temp_tables= 0; + DBUG_VOID_RETURN; } @@ -1756,6 +1786,7 @@ void rpl_group_info::cleanup_context(THD *thd, bool error) } m_table_map.clear_tables(); slave_close_thread_tables(thd); + if (error) { thd->mdl_context.release_transactional_locks(); @@ -1781,8 +1812,9 @@ void rpl_group_info::cleanup_context(THD *thd, bool error) /* Cleanup for the flags that have been set at do_apply_event. */ - thd->variables.option_bits&= ~OPTION_NO_FOREIGN_KEY_CHECKS; - thd->variables.option_bits&= ~OPTION_RELAXED_UNIQUE_CHECKS; + thd->variables.option_bits&= ~(OPTION_NO_FOREIGN_KEY_CHECKS | + OPTION_RELAXED_UNIQUE_CHECKS | + OPTION_NO_CHECK_CONSTRAINT_CHECKS); /* Reset state related to long_find_row notes in the error log: diff --git a/sql/rpl_rli.h b/sql/rpl_rli.h index 3eaee90d0f6..c5b495cbc30 100644 --- a/sql/rpl_rli.h +++ b/sql/rpl_rli.h @@ -148,7 +148,7 @@ public: Protected by data_lock. */ - TABLE *save_temporary_tables; + All_tmp_tables_list *save_temporary_tables; /* standard lock acquisition order to avoid deadlocks: diff --git a/sql/scheduler.cc b/sql/scheduler.cc index 2a0138d06a8..de472ae2504 100644 --- a/sql/scheduler.cc +++ b/sql/scheduler.cc @@ -36,7 +36,10 @@ static bool no_threads_end(THD *thd, bool put_in_cache) { if (thd) + { unlink_thd(thd); + delete thd; + } return 1; // Abort handle_one_connection } diff --git a/sql/set_var.cc b/sql/set_var.cc index 5392a0065ac..b178681e952 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -966,10 +966,8 @@ int set_var_collation_client::check(THD *thd) int set_var_collation_client::update(THD *thd) { - thd->variables.character_set_client= character_set_client; - thd->variables.character_set_results= character_set_results; - thd->variables.collation_connection= collation_connection; - thd->update_charset(); + thd->update_charset(character_set_client, collation_connection, + character_set_results); thd->protocol_text.init(thd); thd->protocol_binary.init(thd); return 0; diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt index 1dce05af943..e60c85d17c6 100644 --- a/sql/share/errmsg-utf8.txt +++ b/sql/share/errmsg-utf8.txt @@ -2071,29 +2071,27 @@ ER_CANT_REMOVE_ALL_FIELDS 42000 swe "Man kan inte radera alla fält med ALTER TABLE. Använd DROP TABLE istället" ukr "Ðе можливо видалити вÑÑ– Ñтовбці за допомогою ALTER TABLE. Ð”Ð»Ñ Ñ†ÑŒÐ¾Ð³Ð¾ ÑкориÑтайтеÑÑ DROP TABLE" ER_CANT_DROP_FIELD_OR_KEY 42000 - cze "Nemohu zruÅ¡it '%-.192s' (provést DROP). Zkontrolujte, zda neexistují záznamy/klíÄe" - dan "Kan ikke udføre DROP '%-.192s'. Undersøg om feltet/nøglen eksisterer." - nla "Kan '%-.192s' niet weggooien. Controleer of het veld of de zoeksleutel daadwerkelijk bestaat." - eng "Can't DROP '%-.192s'; check that column/key exists" - est "Ei suuda kustutada '%-.192s'. Kontrolli kas tulp/võti eksisteerib" - fre "Ne peut effacer (DROP) '%-.192s'. Vérifiez s'il existe" - ger "Kann '%-.192s' nicht löschen. Existiert die Spalte oder der Schlüssel?" - greek "ΑδÏνατη η διαγÏαφή (DROP) '%-.192s'. ΠαÏακαλώ ελέγξτε αν το πεδίο/κλειδί υπάÏχει" - hun "A DROP '%-.192s' nem lehetseges. Ellenorizze, hogy a mezo/kulcs letezik-e" - ita "Impossibile cancellare '%-.192s'. Controllare che il campo chiave esista" - jpn "'%-.192s' を削除ã§ãã¾ã›ã‚“。列ï¼ç´¢å¼•ã®å­˜åœ¨ã‚’確èªã—ã¦ä¸‹ã•ã„。" - kor "'%-.192s'를 DROPí•  수 없습니다. 칼럼ì´ë‚˜ 키가 존재하는지 채í¬í•˜ì„¸ìš”." - nor "Kan ikke DROP '%-.192s'. Undersøk om felt/nøkkel eksisterer." - norwegian-ny "Kan ikkje DROP '%-.192s'. Undersøk om felt/nøkkel eksisterar." - pol "Nie można wykonać operacji DROP '%-.192s'. SprawdĽ, czy to pole/klucz istnieje" - por "Não se pode fazer DROP '%-.192s'. Confira se esta coluna/chave existe" - rum "Nu pot sa DROP '%-.192s'. Verifica daca coloana/cheia exista" - rus "Ðевозможно удалить (DROP) '%-.192s'. УбедитеÑÑŒ что Ñтолбец/ключ дейÑтвительно ÑущеÑтвует" - serbian "Ne mogu da izvrÅ¡im komandu drop 'DROP' na '%-.192s'. Proverite da li ta kolona (odnosno kljuÄ) postoji" - slo "Nemôžem zruÅ¡iÅ¥ (DROP) '%-.192s'. Skontrolujte, Äi neexistujú záznamy/kľúÄe" - spa "No puedo ELIMINAR '%-.192s'. compuebe que el campo/clave existe" - swe "Kan inte ta bort '%-.192s'. Kontrollera att fältet/nyckel finns" - ukr "Ðе можу DROP '%-.192s'. Перевірте, чи цей Ñтовбець/ключ Ñ–Ñнує" + cze "Nemohu zruÅ¡it (DROP %s) %`-.192s. Zkontrolujte, zda neexistují záznamy/klíÄe" + dan "Kan ikke udføre DROP %s %`-.192s. Undersøg om feltet/nøglen eksisterer." + nla "DROP %s: Kan %`-.192s niet weggooien. Controleer of het veld of de zoeksleutel daadwerkelijk bestaat." + eng "Can't DROP %s %`-.192s; check that it exists" + est "Ei suuda kustutada (DROP %s) %`-.192s. Kontrolli kas tulp/võti eksisteerib" + fre "Ne peut effacer (DROP %s) %`-.192s. Vérifiez s'il existe" + ger "DROP %s: Kann %`-.192s nicht löschen. Existiert es?" + greek "ΑδÏνατη η διαγÏαφή (DROP %s) %`-.192s. ΠαÏακαλώ ελέγξτε αν το πεδίο/κλειδί υπάÏχει" + hun "A DROP %s %`-.192s nem lehetseges. Ellenorizze, hogy a mezo/kulcs letezik-e" + ita "Impossibile cancellare (DROP %s) %`-.192s. Controllare che il campo chiave esista" + nor "Kan ikke DROP %s %`-.192s. Undersøk om felt/nøkkel eksisterer." + norwegian-ny "Kan ikkje DROP %s %`-.192s. Undersøk om felt/nøkkel eksisterar." + pol "Nie można wykonać operacji DROP %s %`-.192s. SprawdĽ, czy to pole/klucz istnieje" + por "Não se pode fazer DROP %s %`-.192s. Confira se esta coluna/chave existe" + rum "Nu pot sa DROP %s %`-.192s. Verifica daca coloana/cheia exista" + rus "Ðевозможно удалить (DROP %s) %`-.192s. УбедитеÑÑŒ что он дейÑтвительно ÑущеÑтвует" + serbian "Ne mogu da izvrÅ¡im komandu drop 'DROP %s' na %`-.192s. Proverite da li ta kolona (odnosno kljuÄ) postoji" + slo "Nemôžem zruÅ¡iÅ¥ (DROP %s) %`-.192s. Skontrolujte, Äi neexistujú záznamy/kľúÄe" + spa "No puedo eliminar (DROP %s) %`-.192s. compuebe que el campo/clave existe" + swe "Kan inte ta bort (DROP %s) %`-.192s. Kontrollera att begränsningen/fältet/nyckel finns" + ukr "Ðе можу DROP %s %`-.192s. Перевірте, чи він Ñ–Ñнує" ER_INSERT_INFO cze "Záznamů: %ld Zdvojených: %ld Varování: %ld" dan "Poster: %ld Ens: %ld Advarsler: %ld" @@ -4846,7 +4844,7 @@ ER_WARN_USING_OTHER_HANDLER por "Usando engine de armazenamento %s para tabela '%s'" spa "Usando motor de almacenamiento %s para tabla '%s'" swe "Använder handler %s för tabell '%s'" -ER_CANT_AGGREGATE_2COLLATIONS +ER_CANT_AGGREGATE_2COLLATIONS eng "Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'" ger "Unerlaubte Mischung von Sortierreihenfolgen (%s, %s) und (%s, %s) für Operation '%s'" jpn "ç…§åˆé †åº (%s,%s) 㨠(%s,%s) ã®æ··åœ¨ã¯æ“作 '%s' ã§ã¯ä¸æ­£ã§ã™ã€‚" @@ -5286,15 +5284,15 @@ ER_ILLEGAL_VALUE_FOR_TYPE 22007 eng "Illegal %s '%-.192s' value found during parsing" ger "Nicht zulässiger %s-Wert '%-.192s' beim Parsen gefunden" ER_VIEW_NONUPD_CHECK - eng "CHECK OPTION on non-updatable view '%-.192s.%-.192s'" - ger "CHECK OPTION auf nicht-aktualisierbarem View '%-.192s.%-.192s'" - rus "CHECK OPTION Ð´Ð»Ñ Ð½ÐµÐ¾Ð±Ð½Ð¾Ð²Ð»Ñемого VIEW '%-.192s.%-.192s'" - ukr "CHECK OPTION Ð´Ð»Ñ VIEW '%-.192s.%-.192s' що не може бути оновленним" -ER_VIEW_CHECK_FAILED - eng "CHECK OPTION failed '%-.192s.%-.192s'" - ger "CHECK OPTION fehlgeschlagen: '%-.192s.%-.192s'" - rus "проверка CHECK OPTION Ð´Ð»Ñ VIEW '%-.192s.%-.192s' провалилаÑÑŒ" - ukr "Перевірка CHECK OPTION Ð´Ð»Ñ VIEW '%-.192s.%-.192s' не пройшла" + eng "CHECK OPTION on non-updatable view %`-.192s.%`-.192s" + ger "CHECK OPTION auf nicht-aktualisierbarem View %`-.192s.%`-.192s" + rus "CHECK OPTION Ð´Ð»Ñ Ð½ÐµÐ¾Ð±Ð½Ð¾Ð²Ð»Ñемого VIEW %`-.192s.%`-.192s" + ukr "CHECK OPTION Ð´Ð»Ñ VIEW %`-.192s.%`-.192s що не може бути оновленним" +ER_VIEW_CHECK_FAILED 44000 + eng "CHECK OPTION failed %`-.192s.%`-.192s" + ger "CHECK OPTION fehlgeschlagen: %`-.192s.%`-.192s" + rus "Проверка CHECK OPTION Ð´Ð»Ñ VIEW %`-.192s.%`-.192s провалилаÑÑŒ" + ukr "Перевірка CHECK OPTION Ð´Ð»Ñ VIEW %`-.192s.%`-.192s не пройшла" ER_PROCACCESS_DENIED_ERROR 42000 eng "%-.32s command denied to user '%s'@'%s' for routine '%-.192s'" ger "Befehl %-.32s nicht zulässig für Benutzer '%s'@'%s' in Routine '%-.192s'" @@ -6138,7 +6136,7 @@ ER_SLAVE_HEARTBEAT_FAILURE eng "Unexpected master's heartbeat data: %s" ger "Unerwartete Daten vom Heartbeat des Masters: %s" ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE - eng "The requested value for the heartbeat period is either negative or exceeds the maximum allowed (%s seconds)." + eng "The requested value for the heartbeat period is either negative or exceeds the maximum allowed (%u seconds)." ER_UNUSED_14 eng "You should never see it" ER_CONFLICT_FN_PARSE_ERROR @@ -6508,8 +6506,8 @@ ER_PARTITION_EXCHANGE_FOREIGN_KEY swe "Tabellen att byta ut mot partition har foreign key referenser: '%-.64s'" ER_NO_SUCH_KEY_VALUE eng "Key value '%-.192s' was not found in table '%-.192s.%-.192s'" -ER_RPL_INFO_DATA_TOO_LONG - eng "Data for column '%s' too long" +ER_VALUE_TOO_LONG + eng "Too long value for '%s'" ER_NETWORK_READ_EVENT_CHECKSUM_FAILURE eng "Replication event checksum verification failed while reading from network." ER_BINLOG_READ_EVENT_CHECKSUM_FAILURE @@ -6970,7 +6968,7 @@ start-error-number 1900 ER_VCOL_BASED_ON_VCOL eng "A computed column cannot be based on a computed column" ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED - eng "Function or expression is not allowed for column '%s'" + eng "Function or expression '%s' cannot be used in the %s clause of %`s" ER_DATA_CONVERSION_ERROR_FOR_VIRTUAL_COLUMN eng "Generated value for computed column '%s' cannot be converted to type '%s'" ER_PRIMARY_KEY_BASED_ON_VIRTUAL_COLUMN @@ -7141,6 +7139,21 @@ ER_KILL_QUERY_DENIED_ERROR ER_NO_EIS_FOR_FIELD eng "Engine-independent statistics are not collected for column '%s'" ukr "Ðезалежна від типу таблиці ÑтатиÑтика не збираєтьÑÑ Ð´Ð»Ñ ÑÑ‚Ð¾Ð²Ð±Ñ†Ñ '%s'" + +# +# Internal errors, not used +# +skip-to-error-number 2000 + +# MySQL 5.7 error numbers starts here +skip-to-error-number 3000 + +ER_MYSQL_57_TEST + eng "5.7 test" + +# MariaDB extra error numbers starts from 4000 +skip-to-error-number 4000 + ER_COMMULTI_BADCONTEXT 0A000 eng "COM_MULTI can't return a result set in the given context" ger "COM_MULTI kann im gegebenen Kontext keine Ergebnismenge zurückgeben" @@ -7161,23 +7174,9 @@ ER_UNACCEPTABLE_MUTUAL_RECURSION ER_REF_TO_RECURSIVE_WITH_TABLE_IN_DERIVED eng "Reference to recursive WITH table '%s' in materialized derived" ER_NOT_STANDARDS_COMPLIANT_RECURSIVE - eng "Restrictions imposed on recursive definitions are violated for table '%s'" -# -# Internal errors, not used -# -skip-to-error-number 2000 - -# MySQL 5.7 error numbers starts here -skip-to-error-number 3000 - -ER_MYSQL_57_TEST - eng "5.7 test" - -# MariaDB extra error numbers starts from 4000 -skip-to-error-number 4000 - + eng "Restrictions imposed on recursive definitions are violated for table '%s'"R_WRONG_WINDOW_SPEC_NAME ER_WRONG_WINDOW_SPEC_NAME - eng "Window specification with name '%s' is not defined" + eng "Window specification with name '%s' is not defined" ER_DUP_WINDOW_NAME eng "Multiple window specifications with the same name '%s'" ER_PARTITION_LIST_IN_REFERENCING_WINDOW_SPEC @@ -7208,3 +7207,16 @@ ER_WINDOW_FUNCTION_DONT_HAVE_FRAME eng "This window function may not have a window frame" ER_INVALID_NTILE_ARGUMENT eng "Argument of NTILE must be greater than 0" +ER_CONSTRAINT_FAILED 23000 + eng "CONSTRAINT %`s failed for %`-.192s.%`-.192s" + ger "CONSTRAINT %`s fehlgeschlagen: %`-.192s.%`-.192s" + rus "проверка CONSTRAINT %`s Ð´Ð»Ñ %`-.192s.%`-.192s провалилаÑÑŒ" + ukr "Перевірка CONSTRAINT %`s Ð´Ð»Ñ %`-.192s.%`-.192s не пройшла" +ER_EXPRESSION_IS_TOO_BIG + eng "%s expression in the %s clause is too big" +ER_ERROR_EVALUATING_EXPRESSION + eng "Got an error evaluating stored expression %`s" +ER_CALCULATING_DEFAULT_VALUE + eng "Got an error when calculating default value for %`s" +ER_EXPRESSION_REFERS_TO_UNINIT_FIELD 01000 + eng "Expression for field %`-.64s is refering to uninitialized field %`s" diff --git a/sql/slave.cc b/sql/slave.cc index 30a0018f490..078307274b0 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -1,5 +1,5 @@ -/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. - Copyright (c) 2008, 2015, MariaDB +/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. + Copyright (c) 2009, 2016, MariaDB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -292,9 +292,8 @@ handle_slave_init(void *arg __attribute__((unused))) THD *thd; my_thread_init(); - thd= new THD; + thd= new THD(next_thread_id()); thd->thread_stack= (char*) &thd; /* Set approximate stack start */ - thd->thread_id= next_thread_id(); thd->system_thread = SYSTEM_THREAD_SLAVE_INIT; thread_safe_increment32(&service_thread_count); thd->store_globals(); @@ -1359,6 +1358,10 @@ bool is_network_error(uint errorno) errorno == ER_NET_READ_INTERRUPTED || errorno == ER_SERVER_SHUTDOWN) return TRUE; +#ifdef WITH_WSREP + if (errorno == ER_UNKNOWN_COM_ERROR) + return TRUE; +#endif return FALSE; } @@ -3025,13 +3028,10 @@ void set_slave_thread_default_charset(THD* thd, rpl_group_info *rgi) { DBUG_ENTER("set_slave_thread_default_charset"); - thd->variables.character_set_client= - global_system_variables.character_set_client; - thd->variables.collation_connection= - global_system_variables.collation_connection; thd->variables.collation_server= global_system_variables.collation_server; - thd->update_charset(); + thd->update_charset(global_system_variables.character_set_client, + global_system_variables.collation_connection); thd->system_thread_info.rpl_sql_info->cached_charset_invalidate(); DBUG_VOID_RETURN; @@ -3071,7 +3071,6 @@ static int init_slave_thread(THD* thd, Master_info *mi, thd->variables.log_slow_filter= global_system_variables.log_slow_filter; set_slave_thread_options(thd); thd->client_capabilities = CLIENT_LOCAL_FILES; - thd->thread_id= thd->variables.pseudo_thread_id= next_thread_id(); if (thd_type == SLAVE_THD_SQL) THD_STAGE_INFO(thd, stage_waiting_for_the_next_event_in_relay_log); @@ -3940,7 +3939,7 @@ pthread_handler_t handle_slave_io(void *arg) mysql= NULL ; retry_count= 0; - thd= new THD; // note that contructor of THD uses DBUG_ ! + thd= new THD(next_thread_id()); // note that contructor of THD uses DBUG_ ! mysql_mutex_lock(&mi->run_lock); /* Inform waiting threads that slave has started */ @@ -4112,6 +4111,7 @@ connected: } DBUG_PRINT("info",("Starting reading binary log from master")); + thd->set_command(COM_SLAVE_IO); while (!io_slave_killed(mi)) { THD_STAGE_INFO(thd, stage_requesting_binlog_dump); @@ -4350,7 +4350,8 @@ int check_temp_dir(char* tmp_file) mysql_mutex_lock(&LOCK_start_thread); if (check_temp_dir_run) { - result= check_temp_dir_result; + if ((result= check_temp_dir_result)) + my_message(result, tmp_file, MYF(0)); goto end; } check_temp_dir_run= 1; @@ -4385,7 +4386,6 @@ int check_temp_dir(char* tmp_file) mysql_file_delete(key_file_misc, tmp_file, MYF(0)); end: - check_temp_dir_result= result; mysql_mutex_unlock(&LOCK_start_thread); DBUG_RETURN(result); } @@ -4512,7 +4512,7 @@ pthread_handler_t handle_slave_sql(void *arg) #endif serial_rgi= new rpl_group_info(rli); - thd = new THD; // note that contructor of THD uses DBUG_ ! + thd = new THD(next_thread_id()); // note that contructor of THD uses DBUG_ ! thd->thread_stack = (char*)&thd; // remember where our stack is thd->system_thread_info.rpl_sql_info= &sql_info; @@ -4605,11 +4605,11 @@ pthread_handler_t handle_slave_sql(void *arg) { rli->report(ERROR_LEVEL, ER_SLAVE_FATAL_ERROR, NULL, "Error initializing relay log position: %s", errmsg); - goto err; + goto err_before_start; } rli->reset_inuse_relaylog(); if (rli->alloc_inuse_relaylog(rli->group_relay_log_name)) - goto err; + goto err_before_start; strcpy(rli->future_event_master_log_name, rli->group_master_log_name); THD_CHECK_SENTRY(thd); @@ -4665,11 +4665,14 @@ pthread_handler_t handle_slave_sql(void *arg) if (check_temp_dir(rli->slave_patternload_file)) { + check_temp_dir_result= thd->get_stmt_da()->sql_errno(); rli->report(ERROR_LEVEL, thd->get_stmt_da()->sql_errno(), NULL, "Unable to use slave's temporary directory %s - %s", slave_load_tmpdir, thd->get_stmt_da()->message()); goto err; } + else + check_temp_dir_result= 0; /* Load the set of seen GTIDs, if we did not already. */ if (rpl_load_gtid_slave_state(thd)) @@ -4731,6 +4734,7 @@ pthread_handler_t handle_slave_sql(void *arg) /* Read queries from the IO/THREAD until this thread is killed */ + thd->set_command(COM_SLAVE_SQL); while (!sql_slave_killed(serial_rgi)) { THD_STAGE_INFO(thd, stage_reading_event_from_the_relay_log); @@ -4783,6 +4787,7 @@ pthread_handler_t handle_slave_sql(void *arg) } } + err: if (mi->using_parallel()) rli->parallel.wait_for_done(thd, rli); @@ -4800,15 +4805,7 @@ pthread_handler_t handle_slave_sql(void *arg) rli->group_master_log_pos, tmp.c_ptr_safe()); } - err: - - /* - Once again, in case we aborted with an error and skipped the first one. - (We want the first one to be before the printout of stop position to - get the correct position printed.) - */ - if (mi->using_parallel()) - rli->parallel.wait_for_done(thd, rli); + err_before_start: /* Some events set some playgrounds, which won't be cleared because thread @@ -4897,8 +4894,11 @@ err_during_init: /* TODO: see if we can do this conditionally in next_event() instead to avoid unneeded position re-init + + We only reset THD::temporary_tables to 0 here and not free it, as this + could be used by slave through Relay_log_info::save_temporary_tables. */ - thd->temporary_tables = 0; // remove tempation from destructor to close them + thd->temporary_tables= 0; rli->sql_driver_thd= 0; thd->rgi_fake= thd->rgi_slave= NULL; diff --git a/sql/slave.h b/sql/slave.h index ca89064d773..7f412c1091c 100644 --- a/sql/slave.h +++ b/sql/slave.h @@ -1,5 +1,5 @@ -/* - Copyright (c) 2000, 2010, Oracle and/or its affiliates. +/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. + Copyright (c) 2009, 2016, MariaDB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/sql/sp_head.cc b/sql/sp_head.cc index d58b51afc5e..6b048cec68b 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -1,6 +1,6 @@ /* - Copyright (c) 2002, 2013, Oracle and/or its affiliates. - Copyright (c) 2011, 2013, Monty Program Ab + Copyright (c) 2002, 2016, Oracle and/or its affiliates. + Copyright (c) 2011, 2016, MariaDB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -514,8 +514,10 @@ sp_name::init_qname(THD *thd) bool check_routine_name(LEX_STRING *ident) { - if (!ident || !ident->str || !ident->str[0] || - ident->str[ident->length-1] == ' ') + DBUG_ASSERT(ident); + DBUG_ASSERT(ident->str); + + if (!ident->str[0] || ident->str[ident->length-1] == ' ') { my_error(ER_SP_WRONG_NAME, MYF(0), ident->str); return TRUE; @@ -3077,7 +3079,7 @@ int sp_instr::exec_open_and_lock_tables(THD *thd, TABLE_LIST *tables) Check whenever we have access to tables for this statement and open and lock them before executing instructions core function. */ - if (open_temporary_tables(thd, tables) || + if (thd->open_temporary_tables(tables) || check_table_access(thd, SELECT_ACL, tables, FALSE, UINT_MAX, FALSE) || open_and_lock_tables(thd, tables, TRUE, 0)) result= -1; diff --git a/sql/spatial.h b/sql/spatial.h index 6f50acac984..2e449844d47 100644 --- a/sql/spatial.h +++ b/sql/spatial.h @@ -352,7 +352,7 @@ protected: Need to perform the calculation in logical units, since multiplication can overflow the size data type. - @arg data pointer to the begining of the points array + @arg data pointer to the beginning of the points array @arg expected_points number of points expected @arg extra_point_space extra space for each point element in the array @return true if there are not enough points diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 241f19c75a3..fe8e8eea83f 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -1,5 +1,5 @@ -/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. - Copyright (c) 2009, 2014, SkySQL Ab. +/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. + Copyright (c) 2009, 2016, MariaDB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -742,9 +742,8 @@ static ACL_USER *find_user_wild(const char *host, const char *user, const char * static ACL_ROLE *find_acl_role(const char *user); static ROLE_GRANT_PAIR *find_role_grant_pair(const LEX_STRING *u, const LEX_STRING *h, const LEX_STRING *r); static ACL_USER_BASE *find_acl_user_base(const char *user, const char *host); -static bool update_user_table(THD *thd, TABLE *table, const char *host, - const char *user, const char *new_password, - uint new_password_len); +static bool update_user_table(THD *, TABLE *, const char *, const char *, const + char *, uint); static bool acl_load(THD *thd, TABLE_LIST *tables); static bool grant_load(THD *thd, TABLE_LIST *tables); static inline void get_grantor(THD *thd, char* grantor); @@ -897,7 +896,9 @@ static bool validate_password(LEX_USER *user) { if (user->pwtext.length || !user->pwhash.length) { - struct validation_data data= { &user->user, &user->pwtext }; + struct validation_data data= { &user->user, + user->pwtext.str ? &user->pwtext : + const_cast(&empty_lex_str) }; if (plugin_foreach(NULL, do_validate, MariaDB_PASSWORD_VALIDATION_PLUGIN, &data)) { @@ -1133,7 +1134,7 @@ bool acl_init(bool dont_read_acl_tables) /* To be able to run this from boot, we allocate a temporary THD */ - if (!(thd=new THD)) + if (!(thd=new THD(0))) DBUG_RETURN(1); /* purecov: inspected */ thd->thread_stack= (char*) &thd; thd->store_globals(); @@ -1203,7 +1204,6 @@ static bool acl_load(THD *thd, TABLE_LIST *tables) grant_version++; /* Privileges updated */ init_sql_alloc(&acl_memroot, ACL_ALLOC_BLOCK_SIZE, 0, MYF(0)); - (void) my_init_dynamic_array(&acl_hosts,sizeof(ACL_HOST), 20, 50, MYF(0)); if ((table= tables[HOST_TABLE].table)) // "host" table may not exist (e.g. in MySQL 5.6.7+) { if (init_read_record(&read_record_info, thd, table, NULL, NULL, @@ -1265,10 +1265,6 @@ static bool acl_load(THD *thd, TABLE_LIST *tables) NULL, NULL, 1, 1, FALSE)) goto end; table->use_all_columns(); - (void) my_init_dynamic_array(&acl_users,sizeof(ACL_USER), 50, 100, MYF(0)); - (void) my_hash_init2(&acl_roles,50, &my_charset_utf8_bin, - 0, 0, 0, (my_hash_get_key) acl_role_get_key, 0, - (void (*)(void *))free_acl_role, 0); username_char_length= MY_MIN(table->field[1]->char_length(), USERNAME_CHAR_LENGTH); @@ -1527,7 +1523,6 @@ static bool acl_load(THD *thd, TABLE_LIST *tables) NULL, NULL, 1, 1, FALSE)) goto end; table->use_all_columns(); - (void) my_init_dynamic_array(&acl_dbs,sizeof(ACL_DB), 50, 100, MYF(0)); while (!(read_record_info.read_record(&read_record_info))) { ACL_DB db; @@ -1589,8 +1584,6 @@ static bool acl_load(THD *thd, TABLE_LIST *tables) end_read_record(&read_record_info); freeze_size(&acl_dbs); - (void) my_init_dynamic_array(&acl_proxy_users, sizeof(ACL_PROXY_USER), - 50, 100, MYF(0)); if ((table= tables[PROXIES_PRIV_TABLE].table)) { if (init_read_record(&read_record_info, thd, table, @@ -1627,10 +1620,7 @@ static bool acl_load(THD *thd, TABLE_LIST *tables) FALSE)) goto end; table->use_all_columns(); - /* account for every role mapping */ - (void) my_hash_init2(&acl_roles_mappings, 50, system_charset_info, 0, 0, 0, - (my_hash_get_key) acl_role_map_get_key, 0, 0, 0); MEM_ROOT temp_root; init_alloc_root(&temp_root, ACL_ALLOC_BLOCK_SIZE, 0, MYF(0)); while (!(read_record_info.read_record(&read_record_info))) @@ -1669,6 +1659,7 @@ static bool acl_load(THD *thd, TABLE_LIST *tables) return_val= FALSE; end: + end_read_record(&read_record_info); thd->variables.sql_mode= old_sql_mode; DBUG_RETURN(return_val); } @@ -1685,12 +1676,12 @@ void acl_free(bool end) delete_dynamic(&acl_proxy_users); my_hash_free(&acl_check_hosts); my_hash_free(&acl_roles_mappings); - plugin_unlock(0, native_password_plugin); - plugin_unlock(0, old_password_plugin); if (!end) acl_cache->clear(1); /* purecov: inspected */ else { + plugin_unlock(0, native_password_plugin); + plugin_unlock(0, old_password_plugin); delete acl_cache; acl_cache=0; } @@ -1752,6 +1743,15 @@ bool acl_reload(THD *thd) old_acl_roles_mappings= acl_roles_mappings; old_acl_proxy_users= acl_proxy_users; old_acl_dbs= acl_dbs; + my_init_dynamic_array(&acl_hosts, sizeof(ACL_HOST), 20, 50, MYF(0)); + my_init_dynamic_array(&acl_users, sizeof(ACL_USER), 50, 100, MYF(0)); + my_init_dynamic_array(&acl_dbs, sizeof(ACL_DB), 50, 100, MYF(0)); + my_init_dynamic_array(&acl_proxy_users, sizeof(ACL_PROXY_USER), 50, 100, MYF(0)); + my_hash_init2(&acl_roles,50, &my_charset_utf8_bin, + 0, 0, 0, (my_hash_get_key) acl_role_get_key, 0, + (void (*)(void *))free_acl_role, 0); + my_hash_init2(&acl_roles_mappings, 50, system_charset_info, 0, 0, 0, + (my_hash_get_key) acl_role_map_get_key, 0, 0, 0); old_mem= acl_memroot; delete_dynamic(&acl_wild_hosts); my_hash_free(&acl_check_hosts); @@ -2009,8 +2009,7 @@ bool acl_getroot(Security_context *sctx, char *user, char *host, sctx->master_access= acl_role->access; if (acl_role->user.str) - strmake_buf(sctx->priv_user, user); - sctx->priv_host[0]= 0; + strmake_buf(sctx->priv_role, user); } } @@ -2034,7 +2033,7 @@ static int check_user_can_set_role(const char *user, const char *host, { /* have to clear the privileges */ /* get the current user */ - acl_user= find_user_exact(host, user); + acl_user= find_user_wild(host, user, ip); if (acl_user == NULL) { my_error(ER_INVALID_CURRENT_USER, MYF(0), rolename); @@ -2910,6 +2909,15 @@ int acl_set_default_role(THD *thd, const char *host, const char *user, safe_str(rolename), safe_str(user), safe_str(host)); } + /* + This statement will be replicated as a statement, even when using + row-based replication. The flag will be reset at the end of the + statement. + This has to be handled here as it's called by set_var.cc, which is + not automaticly handled by sql_parse.cc + */ + save_binlog_format= thd->set_current_stmt_binlog_format_stmt(); + if (WSREP(thd) && !IF_WSREP(thd->wsrep_applier, 0)) { thd->set_query_inner(buff, query_length, system_charset_info); @@ -2922,15 +2930,6 @@ int acl_set_default_role(THD *thd, const char *host, const char *user, table= tables[USER_TABLE].table; result= 1; - /* - This statement will be replicated as a statement, even when using - row-based replication. The flag will be reset at the end of the - statement. - This has to be handled here as it's called by set_var.cc, which is - not automaticly handled by sql_parse.cc - */ - save_binlog_format= thd->set_current_stmt_binlog_format_stmt(); - mysql_mutex_lock(&acl_cache->lock); ACL_USER *acl_user; if (!(acl_user= find_user_exact(host, user))) @@ -3459,7 +3458,7 @@ static int replace_user_table(THD *thd, TABLE *table, LEX_USER &combo, } if (!old_row_exists || combo.pwtext.length || combo.pwhash.length) - if (validate_password(&combo)) + if (!handle_as_role && validate_password(&combo)) goto end; /* Update table columns with new privileges */ @@ -6570,7 +6569,7 @@ bool grant_init() bool return_val; DBUG_ENTER("grant_init"); - if (!(thd= new THD)) + if (!(thd= new THD(0))) DBUG_RETURN(1); /* purecov: deadcode */ thd->thread_stack= (char*) &thd; thd->store_globals(); @@ -7162,7 +7161,7 @@ bool check_column_grant_in_table_ref(THD *thd, TABLE_LIST * table_ref, GRANT_INFO *grant; const char *db_name; const char *table_name; - Security_context *sctx= MY_TEST(table_ref->security_ctx) ? + Security_context *sctx= table_ref->security_ctx ? table_ref->security_ctx : thd->security_ctx; if (table_ref->view || table_ref->field_translation) @@ -7378,8 +7377,7 @@ bool check_grant_db(THD *thd, const char *db) len= (uint) (end - helping) + 1; /* - If a role is set, we need to check for privileges - here aswell + If a role is set, we need to check for privileges here as well. */ if (sctx->priv_role[0]) { @@ -7393,11 +7391,10 @@ bool check_grant_db(THD *thd, const char *db) for (uint idx=0 ; idx < column_priv_hash.records ; idx++) { - GRANT_TABLE *grant_table= (GRANT_TABLE*) - my_hash_element(&column_priv_hash, - idx); + GRANT_TABLE *grant_table= (GRANT_TABLE*) my_hash_element(&column_priv_hash, + idx); if (len < grant_table->key_length && - !memcmp(grant_table->hash_key,helping,len) && + !memcmp(grant_table->hash_key, helping, len) && compare_hostname(&grant_table->host, sctx->host, sctx->ip)) { error= FALSE; /* Found match. */ @@ -7405,7 +7402,7 @@ bool check_grant_db(THD *thd, const char *db) } if (sctx->priv_role[0] && len2 < grant_table->key_length && - !memcmp(grant_table->hash_key,helping2,len) && + !memcmp(grant_table->hash_key, helping2, len2) && (!grant_table->host.hostname || !grant_table->host.hostname[0])) { error= FALSE; /* Found role match */ @@ -7641,7 +7638,8 @@ ulong get_column_grant(THD *thd, GRANT_INFO *grant, if (!grant_column) priv|= (grant->privilege | grant_table_role->privs); else - priv|= (grant->privilege | grant_table->privs | grant_column->rights); + priv|= (grant->privilege | grant_table_role->privs | + grant_column->rights); } } mysql_rwlock_unlock(&LOCK_grant); @@ -7813,23 +7811,71 @@ static bool print_grants_for_role(THD *thd, ACL_ROLE * role) } +/** checks privileges for SHOW GRANTS and SHOW CREATE USER + + @note that in case of SHOW CREATE USER the parser guarantees + that a role can never happen here, so *rolename will never + be assigned to +*/ +static bool check_show_access(THD *thd, LEX_USER *lex_user, char **username, + char **hostname, char **rolename) +{ + DBUG_ENTER("check_show_access"); + + if (lex_user->user.str == current_user.str) + { + *username= thd->security_ctx->priv_user; + *hostname= thd->security_ctx->priv_host; + } + else if (lex_user->user.str == current_role.str) + { + *rolename= thd->security_ctx->priv_role; + } + else if (lex_user->user.str == current_user_and_current_role.str) + { + *username= thd->security_ctx->priv_user; + *hostname= thd->security_ctx->priv_host; + *rolename= thd->security_ctx->priv_role; + } + else + { + Security_context *sctx= thd->security_ctx; + bool do_check_access; + + lex_user= get_current_user(thd, lex_user); + if (!lex_user) + DBUG_RETURN(TRUE); + + if (lex_user->is_role()) + { + *rolename= lex_user->user.str; + do_check_access= strcmp(*rolename, sctx->priv_role); + } + else + { + *username= lex_user->user.str; + *hostname= lex_user->host.str; + do_check_access= strcmp(*username, sctx->priv_user) || + strcmp(*hostname, sctx->priv_host); + } + + if (do_check_access && check_access(thd, SELECT_ACL, "mysql", 0, 0, 1, 0)) + DBUG_RETURN(TRUE); + } + DBUG_RETURN(FALSE); +} bool mysql_show_create_user(THD *thd, LEX_USER *lex_user) { - const char *username = safe_str(lex_user->user.str); - const char *hostname = safe_str(lex_user->host.str); + char *username= NULL, *hostname= NULL; char buff[1024]; //Show create user should not take more than 1024 bytes. Protocol *protocol= thd->protocol; bool error= false; ACL_USER *acl_user; DBUG_ENTER("mysql_show_create_user"); - // Check if the command specifies a username or not. - if (lex_user->user.str == current_user.str) - { - username= thd->security_ctx->priv_user; - hostname= thd->security_ctx->priv_host; - } + if (check_show_access(thd, lex_user, &username, &hostname, NULL)) + DBUG_RETURN(TRUE); List field_list; strxmov(buff, "CREATE USER for ", username, "@", hostname, NullS); @@ -7918,9 +7964,7 @@ bool mysql_show_grants(THD *thd, LEX_USER *lex_user) ACL_ROLE *acl_role= NULL; char buff[1024]; Protocol *protocol= thd->protocol; - char *username= NULL; - char *hostname= NULL; - char *rolename= NULL; + char *username= NULL, *hostname= NULL, *rolename= NULL; DBUG_ENTER("mysql_show_grants"); if (!initialized) @@ -7929,44 +7973,8 @@ bool mysql_show_grants(THD *thd, LEX_USER *lex_user) DBUG_RETURN(TRUE); } - mysql_rwlock_rdlock(&LOCK_grant); - mysql_mutex_lock(&acl_cache->lock); - - if (lex_user->user.str == current_user.str) - { - username= thd->security_ctx->priv_user; - hostname= thd->security_ctx->priv_host; - } - else if (lex_user->user.str == current_role.str) - { - rolename= thd->security_ctx->priv_role; - } - else if (lex_user->user.str == current_user_and_current_role.str) - { - username= thd->security_ctx->priv_user; - hostname= thd->security_ctx->priv_host; - rolename= thd->security_ctx->priv_role; - } - else - { - lex_user= get_current_user(thd, lex_user, false); - if (!lex_user) - { - mysql_mutex_unlock(&acl_cache->lock); - mysql_rwlock_unlock(&LOCK_grant); - DBUG_RETURN(TRUE); - } - - if (lex_user->is_role()) - { - rolename= lex_user->user.str; - } - else - { - username= lex_user->user.str; - hostname= lex_user->host.str; - } - } + if (check_show_access(thd, lex_user, &username, &hostname, &rolename)) + DBUG_RETURN(TRUE); DBUG_ASSERT(rolename || username); List field_list; @@ -7978,14 +7986,11 @@ bool mysql_show_grants(THD *thd, LEX_USER *lex_user) mysql_show_grants_get_fields(thd, &field_list, buff); if (protocol->send_result_set_metadata(&field_list, - Protocol::SEND_NUM_ROWS | - Protocol::SEND_EOF)) - { - mysql_mutex_unlock(&acl_cache->lock); - mysql_rwlock_unlock(&LOCK_grant); - + Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF)) DBUG_RETURN(TRUE); - } + + mysql_rwlock_rdlock(&LOCK_grant); + mysql_mutex_lock(&acl_cache->lock); if (username) { @@ -11072,7 +11077,7 @@ void fill_effective_table_privileges(THD *thd, GRANT_INFO *grant, /* global privileges */ grant->privilege= sctx->master_access; - if (!sctx->priv_user[0]) + if (!sctx->priv_user[0] && !sctx->priv_role[0]) { DBUG_PRINT("info", ("privilege 0x%lx", grant->privilege)); DBUG_VOID_RETURN; // it is slave @@ -11774,7 +11779,6 @@ static bool parse_com_change_user_packet(MPVIO_EXT *mpvio, uint packet_length) { if (thd_init_client_charset(thd, uint2korr(next_field))) DBUG_RETURN(1); - thd->update_charset(); next_field+= 2; } @@ -11940,7 +11944,6 @@ static ulong parse_client_handshake_packet(MPVIO_EXT *mpvio, DBUG_PRINT("info", ("client_character_set: %d", (uint) net->read_pos[8])); if (thd_init_client_charset(thd, (uint) net->read_pos[8])) return packet_error; - thd->update_charset(); end= (char*) net->read_pos+32; } else @@ -12344,6 +12347,9 @@ static bool acl_check_ssl(THD *thd, const ACL_USER *acl_user) return 1; } } + if (!acl_user->x509_issuer && !acl_user->x509_subject) + return 0; // all done + /* Prepare certificate (if exists) */ if (!(cert= SSL_get_peer_certificate(ssl))) return 1; diff --git a/sql/sql_admin.cc b/sql/sql_admin.cc index 205621c6f9f..ed23d9cccd6 100644 --- a/sql/sql_admin.cc +++ b/sql/sql_admin.cc @@ -54,7 +54,7 @@ static bool admin_recreate_table(THD *thd, TABLE_LIST *table_list) DEBUG_SYNC(thd, "ha_admin_try_alter"); tmp_disable_binlog(thd); // binlogging is done by caller if wanted - result_code= (open_temporary_tables(thd, table_list) || + result_code= (thd->open_temporary_tables(table_list) || mysql_recreate_table(thd, table_list, false)); reenable_binlog(thd); /* @@ -163,7 +163,7 @@ static int prepare_for_repair(THD *thd, TABLE_LIST *table_list, - Run a normal repair using the new index file and the old data file */ - if (table->s->frm_version != FRM_VER_TRUE_VARCHAR && + if (table->s->frm_version < FRM_VER_TRUE_VARCHAR && table->s->varchar_fields) { error= send_check_errmsg(thd, table_list, "repair", @@ -261,7 +261,10 @@ static int prepare_for_repair(THD *thd, TABLE_LIST *table_list, end: thd->locked_tables_list.unlink_all_closed_tables(thd, NULL, 0); if (table == &tmp_table) - closefrm(table, 1); // Free allocated memory + { + closefrm(table); + tdc_release_share(table->s); + } /* In case of a temporary table there will be no metadata lock. */ if (error && has_mdl_lock) thd->mdl_context.release_transactional_locks(); @@ -293,6 +296,97 @@ static inline bool table_not_corrupt_error(uint sql_errno) } +static bool open_only_one_table(THD* thd, TABLE_LIST* table, + bool repair_table_use_frm, + bool is_view_operator_func) +{ + LEX *lex= thd->lex; + SELECT_LEX *select= &lex->select_lex; + TABLE_LIST *save_next_global, *save_next_local; + bool open_error; + save_next_global= table->next_global; + table->next_global= 0; + save_next_local= table->next_local; + table->next_local= 0; + select->table_list.first= table; + /* + Time zone tables and SP tables can be add to lex->query_tables list, + so it have to be prepared. + TODO: Investigate if we can put extra tables into argument instead of + using lex->query_tables + */ + lex->query_tables= table; + lex->query_tables_last= &table->next_global; + lex->query_tables_own_last= 0; + + /* + CHECK TABLE command is allowed for views as well. Check on alter flags + to differentiate from ALTER TABLE...CHECK PARTITION on which view is not + allowed. + */ + if (lex->alter_info.flags & Alter_info::ALTER_ADMIN_PARTITION || + !is_view_operator_func) + { + table->required_type=FRMTYPE_TABLE; + DBUG_ASSERT(!lex->only_view); + } + else if (lex->only_view) + { + table->required_type= FRMTYPE_VIEW; + } + else if (!lex->only_view && lex->sql_command == SQLCOM_REPAIR) + { + table->required_type= FRMTYPE_TABLE; + } + + if (lex->sql_command == SQLCOM_CHECK || + lex->sql_command == SQLCOM_REPAIR || + lex->sql_command == SQLCOM_ANALYZE || + lex->sql_command == SQLCOM_OPTIMIZE) + thd->prepare_derived_at_open= TRUE; + if (!thd->locked_tables_mode && repair_table_use_frm) + { + /* + If we're not under LOCK TABLES and we're executing REPAIR TABLE + USE_FRM, we need to ignore errors from open_and_lock_tables(). + REPAIR TABLE USE_FRM is a heavy weapon used when a table is + critically damaged, so open_and_lock_tables() will most likely + report errors. Those errors are not interesting for the user + because it's already known that the table is badly damaged. + */ + + Diagnostics_area *da= thd->get_stmt_da(); + Warning_info tmp_wi(thd->query_id, false, true); + + da->push_warning_info(&tmp_wi); + + open_error= (thd->open_temporary_tables(table) || + open_and_lock_tables(thd, table, TRUE, 0)); + + da->pop_warning_info(); + } + else + { + /* + It's assumed that even if it is REPAIR TABLE USE_FRM, the table + can be opened if we're under LOCK TABLES (otherwise LOCK TABLES + would fail). Thus, the only errors we could have from + open_and_lock_tables() are logical ones, like incorrect locking + mode. It does make sense for the user to see such errors. + */ + + open_error= (thd->open_temporary_tables(table) || + open_and_lock_tables(thd, table, TRUE, 0)); + } + thd->prepare_derived_at_open= FALSE; + + table->next_global= save_next_global; + table->next_local= save_next_local; + + return open_error; +} + + /* RETURN VALUES FALSE Message sent to net (admin operation went ok) @@ -314,7 +408,6 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables, HA_CHECK_OPT *)) { TABLE_LIST *table; - SELECT_LEX *select= &thd->lex->select_lex; List field_list; Item *item; Protocol *protocol= thd->protocol; @@ -381,89 +474,17 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables, To allow concurrent execution of read-only operations we acquire weak metadata lock for them. */ - table->mdl_request.set_type((lock_type >= TL_WRITE_ALLOW_WRITE) ? - MDL_SHARED_NO_READ_WRITE : MDL_SHARED_READ); + table->mdl_request.set_type(lex->sql_command == SQLCOM_REPAIR + ? MDL_SHARED_NO_READ_WRITE + : lock_type >= TL_WRITE_ALLOW_WRITE + ? MDL_SHARED_WRITE : MDL_SHARED_READ); + /* open only one table from local list of command */ + while (1) { - TABLE_LIST *save_next_global, *save_next_local; - save_next_global= table->next_global; - table->next_global= 0; - save_next_local= table->next_local; - table->next_local= 0; - select->table_list.first= table; - /* - Time zone tables and SP tables can be add to lex->query_tables list, - so it have to be prepared. - TODO: Investigate if we can put extra tables into argument instead of - using lex->query_tables - */ - lex->query_tables= table; - lex->query_tables_last= &table->next_global; - lex->query_tables_own_last= 0; - - /* - CHECK TABLE command is allowed for views as well. Check on alter flags - to differentiate from ALTER TABLE...CHECK PARTITION on which view is not - allowed. - */ - if (lex->alter_info.flags & Alter_info::ALTER_ADMIN_PARTITION || - view_operator_func == NULL) - { - table->required_type=FRMTYPE_TABLE; - DBUG_ASSERT(!lex->only_view); - } - else if (lex->only_view) - { - table->required_type= FRMTYPE_VIEW; - } - else if (!lex->only_view && lex->sql_command == SQLCOM_REPAIR) - { - table->required_type= FRMTYPE_TABLE; - } - - if (lex->sql_command == SQLCOM_CHECK || - lex->sql_command == SQLCOM_REPAIR || - lex->sql_command == SQLCOM_ANALYZE || - lex->sql_command == SQLCOM_OPTIMIZE) - thd->prepare_derived_at_open= TRUE; - if (!thd->locked_tables_mode && repair_table_use_frm) - { - /* - If we're not under LOCK TABLES and we're executing REPAIR TABLE - USE_FRM, we need to ignore errors from open_and_lock_tables(). - REPAIR TABLE USE_FRM is a heavy weapon used when a table is - critically damaged, so open_and_lock_tables() will most likely - report errors. Those errors are not interesting for the user - because it's already known that the table is badly damaged. - */ - - Diagnostics_area *da= thd->get_stmt_da(); - Warning_info tmp_wi(thd->query_id, false, true); - - da->push_warning_info(&tmp_wi); - - open_error= (open_temporary_tables(thd, table) || - open_and_lock_tables(thd, table, TRUE, 0)); - - da->pop_warning_info(); - } - else - { - /* - It's assumed that even if it is REPAIR TABLE USE_FRM, the table - can be opened if we're under LOCK TABLES (otherwise LOCK TABLES - would fail). Thus, the only errors we could have from - open_and_lock_tables() are logical ones, like incorrect locking - mode. It does make sense for the user to see such errors. - */ - - open_error= (open_temporary_tables(thd, table) || - open_and_lock_tables(thd, table, TRUE, 0)); - } - thd->prepare_derived_at_open= FALSE; - - table->next_global= save_next_global; - table->next_local= save_next_local; + open_error= open_only_one_table(thd, table, + repair_table_use_frm, + (view_operator_func != NULL)); thd->open_options&= ~extra_open_options; /* @@ -483,6 +504,20 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables, result_code= HA_ADMIN_FAILED; goto send_result; } + + if (!table->table || table->mdl_request.type != MDL_SHARED_WRITE || + table->table->file->ha_table_flags() & HA_CONCURRENT_OPTIMIZE) + break; + + trans_rollback_stmt(thd); + trans_rollback(thd); + close_thread_tables(thd); + table->table= NULL; + thd->mdl_context.release_transactional_locks(); + table->mdl_request.init(MDL_key::TABLE, table->db, table->table_name, + MDL_SHARED_NO_READ_WRITE, MDL_TRANSACTION); + } + #ifdef WITH_PARTITION_STORAGE_ENGINE if (table->table) { @@ -521,7 +556,6 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables, } } #endif - } DBUG_PRINT("admin", ("table: 0x%lx", (long) table->table)); if (prepare_func) @@ -622,18 +656,18 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables, /* Close all instances of the table to allow MyISAM "repair" - to rename files. + (which is internally also used from "optimize") to rename files. @todo: This code does not close all instances of the table. It only closes instances in other connections, but if this connection has LOCK TABLE t1 a READ, t1 b WRITE, both t1 instances will be kept open. - There is no need to execute this branch for InnoDB, which does - repair by recreate. There is no need to do it for OPTIMIZE, - which doesn't move files around. - Hence, this code should be moved to prepare_for_repair(), - and executed only for MyISAM engine. + + Note that this code is only executed for engines that request + MDL_SHARED_NO_READ_WRITE lock (MDL_SHARED_WRITE cannot be upgraded) + by *not* having HA_CONCURRENT_OPTIMIZE table_flag. */ - if (lock_type == TL_WRITE && !table->table->s->tmp_table) + if (lock_type == TL_WRITE && !table->table->s->tmp_table && + table->mdl_request.type > MDL_SHARED_WRITE) { if (wait_while_table_is_used(thd, table->table, HA_EXTRA_PREPARE_FOR_RENAME)) @@ -691,7 +725,6 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables, if (operator_func == &handler::ha_analyze) { TABLE *tab= table->table; - Field **field_ptr= tab->field; if (lex->with_persistent_for_clause && tab->s->table_category != TABLE_CATEGORY_USER) @@ -703,58 +736,6 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables, (get_use_stat_tables_mode(thd) > NEVER || lex->with_persistent_for_clause)); - if (collect_eis) - { - if (!lex->column_list) - { - bitmap_clear_all(tab->read_set); - for (uint fields= 0; *field_ptr; field_ptr++, fields++) - { - enum enum_field_types type= (*field_ptr)->type(); - if (type < MYSQL_TYPE_MEDIUM_BLOB || - type > MYSQL_TYPE_BLOB) - bitmap_set_bit(tab->read_set, fields); - else if (collect_eis) - push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, - ER_NO_EIS_FOR_FIELD, - ER_THD(thd, ER_NO_EIS_FOR_FIELD), - (*field_ptr)->field_name); - } - } - else - { - int pos; - LEX_STRING *column_name; - List_iterator_fast it(*lex->column_list); - - bitmap_clear_all(tab->read_set); - while ((column_name= it++)) - { - if (tab->s->fieldnames.type_names == 0 || - (pos= find_type(&tab->s->fieldnames, column_name->str, - column_name->length, 1)) <= 0) - { - compl_result_code= result_code= HA_ADMIN_INVALID; - break; - } - pos--; - enum enum_field_types type= tab->field[pos]->type(); - if (type < MYSQL_TYPE_MEDIUM_BLOB || - type > MYSQL_TYPE_BLOB) - bitmap_set_bit(tab->read_set, pos); - else if (collect_eis) - push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, - ER_NO_EIS_FOR_FIELD, - ER_THD(thd, ER_NO_EIS_FOR_FIELD), - column_name->str); - } - tab->file->column_bitmaps_signal(); - } - } - else - { - DBUG_ASSERT(!lex->column_list); - } if (!lex->index_list) { @@ -792,7 +773,77 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables, if (compl_result_code == HA_ADMIN_OK && collect_eis) { - if (!(compl_result_code= + /* + Here we close and reopen table in read mode because operation of + collecting statistics is long and it will be better do not block + the table completely. + InnoDB/XtraDB will allow read/write and MyISAM read/insert. + */ + trans_commit_stmt(thd); + trans_commit(thd); + thd->open_options|= extra_open_options; + close_thread_tables(thd); + table->table= NULL; + thd->mdl_context.release_transactional_locks(); + table->mdl_request.init(MDL_key::TABLE, table->db, table->table_name, + MDL_SHARED_NO_READ_WRITE, MDL_TRANSACTION); + table->mdl_request.set_type(MDL_SHARED_READ); + + table->lock_type= TL_READ; + DBUG_ASSERT(view_operator_func == NULL); + open_error= open_only_one_table(thd, table, + repair_table_use_frm, FALSE); + thd->open_options&= ~extra_open_options; + + TABLE *tab= table->table; + Field **field_ptr= tab->field; + if (!lex->column_list) + { + bitmap_clear_all(tab->read_set); + for (uint fields= 0; *field_ptr; field_ptr++, fields++) + { + enum enum_field_types type= (*field_ptr)->type(); + if (type < MYSQL_TYPE_MEDIUM_BLOB || + type > MYSQL_TYPE_BLOB) + bitmap_set_bit(tab->read_set, fields); + else + push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, + ER_NO_EIS_FOR_FIELD, + ER_THD(thd, ER_NO_EIS_FOR_FIELD), + (*field_ptr)->field_name); + } + } + else + { + int pos; + LEX_STRING *column_name; + List_iterator_fast it(*lex->column_list); + + bitmap_clear_all(tab->read_set); + while ((column_name= it++)) + { + if (tab->s->fieldnames.type_names == 0 || + (pos= find_type(&tab->s->fieldnames, column_name->str, + column_name->length, 1)) <= 0) + { + compl_result_code= result_code= HA_ADMIN_INVALID; + break; + } + pos--; + enum enum_field_types type= tab->field[pos]->type(); + if (type < MYSQL_TYPE_MEDIUM_BLOB || + type > MYSQL_TYPE_BLOB) + bitmap_set_bit(tab->read_set, pos); + else + push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, + ER_NO_EIS_FOR_FIELD, + ER_THD(thd, ER_NO_EIS_FOR_FIELD), + column_name->str); + } + tab->file->column_bitmaps_signal(); + } + if (!open_error && + !(compl_result_code= alloc_statistics_for_table(thd, table->table)) && !(compl_result_code= collect_statistics_for_table(thd, table->table))) @@ -949,7 +1000,7 @@ send_result_message: table->mdl_request.ticket= NULL; DEBUG_SYNC(thd, "ha_admin_open_ltable"); table->mdl_request.set_type(MDL_SHARED_WRITE); - if (!open_temporary_tables(thd, table) && + if (!thd->open_temporary_tables(table) && (table->table= open_ltable(thd, table, lock_type, 0))) { uint save_flags; diff --git a/sql/sql_alter.cc b/sql/sql_alter.cc index bff45e089a4..3592fa3cfbd 100644 --- a/sql/sql_alter.cc +++ b/sql/sql_alter.cc @@ -1,4 +1,5 @@ /* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2016, MariaDB Corporation This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -16,7 +17,6 @@ #include "sql_parse.h" // check_access #include "sql_table.h" // mysql_alter_table, // mysql_exchange_partition -#include "sql_base.h" // open_temporary_tables #include "sql_alter.h" #include "wsrep_mysqld.h" @@ -25,6 +25,7 @@ Alter_info::Alter_info(const Alter_info &rhs, MEM_ROOT *mem_root) alter_list(rhs.alter_list, mem_root), key_list(rhs.key_list, mem_root), create_list(rhs.create_list, mem_root), + check_constraint_list(rhs.check_constraint_list, mem_root), flags(rhs.flags), keys_onoff(rhs.keys_onoff), partition_names(rhs.partition_names, mem_root), @@ -305,10 +306,8 @@ bool Sql_cmd_alter_table::execute(THD *thd) thd->enable_slow_log= opt_log_slow_admin_statements; #ifdef WITH_WSREP - TABLE *find_temporary_table(THD *thd, const TABLE_LIST *tl); - if ((!thd->is_current_stmt_binlog_format_row() || - !find_temporary_table(thd, first_table))) + !thd->find_temporary_table(first_table))) { WSREP_TO_ISOLATION_BEGIN(((lex->name.str) ? select_lex->db : NULL), ((lex->name.str) ? lex->name.str : NULL), diff --git a/sql/sql_alter.h b/sql/sql_alter.h index 526442e83e2..9e5fbaa425f 100644 --- a/sql/sql_alter.h +++ b/sql/sql_alter.h @@ -124,6 +124,8 @@ public: // Set for ADD [COLUMN] FIRST | AFTER static const uint ALTER_COLUMN_ORDER = 1L << 26; + static const uint ALTER_ADD_CHECK_CONSTRAINT = 1L << 27; + static const uint ALTER_DROP_CHECK_CONSTRAINT = 1L << 28; enum enum_enable_or_disable { LEAVE_AS_IS, ENABLE, DISABLE }; @@ -172,6 +174,7 @@ public: List key_list; // List of columns, used by both CREATE and ALTER TABLE. List create_list; + List check_constraint_list; // Type of ALTER TABLE operation. uint flags; // Enable or disable keys. @@ -200,6 +203,7 @@ public: alter_list.empty(); key_list.empty(); create_list.empty(); + check_constraint_list.empty(); flags= 0; keys_onoff= LEAVE_AS_IS; num_parts= 0; diff --git a/sql/sql_analyse.cc b/sql/sql_analyse.cc index b2bc9fc2e87..91a80c552cb 100644 --- a/sql/sql_analyse.cc +++ b/sql/sql_analyse.cc @@ -409,7 +409,7 @@ void field_real::add() if (num == 0.0) empty++; - if ((decs = decimals()) == NOT_FIXED_DEC) + if ((decs = decimals()) >= FLOATING_POINT_DECIMALS) { length= sprintf(buff, "%g", num); if (rint(num) != num) @@ -892,7 +892,7 @@ void field_real::get_opt_type(String *answer, if (!max_notzero_dec_len) { - int len= (int) max_length - ((item->decimals == NOT_FIXED_DEC) ? + int len= (int) max_length - ((item->decimals >= FLOATING_POINT_DECIMALS) ? 0 : (item->decimals + 1)); if (min_arg >= -128 && max_arg <= (min_arg >= 0 ? 255 : 127)) @@ -912,7 +912,7 @@ void field_real::get_opt_type(String *answer, if (min_arg >= 0) answer->append(STRING_WITH_LEN(" UNSIGNED")); } - else if (item->decimals == NOT_FIXED_DEC) + else if (item->decimals >= FLOATING_POINT_DECIMALS) { if (min_arg >= -FLT_MAX && max_arg <= FLT_MAX) answer->append(STRING_WITH_LEN("FLOAT")); diff --git a/sql/sql_audit.cc b/sql/sql_audit.cc index e2132efc528..118b843e1a4 100644 --- a/sql/sql_audit.cc +++ b/sql/sql_audit.cc @@ -460,5 +460,12 @@ void mysql_audit_release(THD *thd) { } +void mysql_audit_init_thd(THD *thd) +{ +} + +void mysql_audit_free_thd(THD *thd) +{ +} #endif /* EMBEDDED_LIBRARY */ diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 08a9647cf56..d7812db53bd 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -171,40 +171,6 @@ static bool open_table_entry_fini(THD *thd, TABLE_SHARE *share, TABLE *entry); static bool auto_repair_table(THD *thd, TABLE_LIST *table_list); -/** - Create a table cache/table definition cache key - - @param thd Thread context - @param key Buffer for the key to be created (must be of - size MAX_DBKEY_LENGTH). - @param db_name Database name. - @param table_name Table name. - - @note - The table cache_key is created from: - db_name + \0 - table_name + \0 - - additionally we add the following to make each tmp table - unique on the slave: - - 4 bytes for master thread id - 4 bytes pseudo thread id - - @return Length of key. -*/ - -uint create_tmp_table_def_key(THD *thd, char *key, - const char *db, const char *table_name) -{ - uint key_length= tdc_create_key(key, db, table_name); - int4store(key + key_length, thd->variables.server_id); - int4store(key + key_length + 4, thd->variables.pseudo_thread_id); - key_length+= TMP_TABLE_KEY_EXTRA; - return key_length; -} - - /** Get table cache key for a table list element. @@ -212,7 +178,7 @@ uint create_tmp_table_def_key(THD *thd, char *key, @param key[out] On return points to table cache key for the table. @note Unlike create_table_def_key() call this function doesn't construct - key in a buffer provider by caller. Instead it relies on the fact + key in a buffer provided by caller. Instead it relies on the fact that table list element for which key is requested has properly initialized MDL_request object and the fact that table definition cache key is suffix of key used in MDL subsystem. So to get table @@ -304,7 +270,7 @@ static my_bool list_open_tables_callback(TDC_element *element, (*arg->start_list)->in_use= 0; mysql_mutex_lock(&element->LOCK_table_share); - TDC_element::All_share_tables_list::Iterator it(element->all_tables); + All_share_tables_list::Iterator it(element->all_tables); TABLE *table; while ((table= it++)) if (table->in_use) @@ -336,68 +302,6 @@ OPEN_TABLE_LIST *list_open_tables(THD *thd, const char *db, const char *wild) DBUG_RETURN(argument.open_list); } -/***************************************************************************** - * Functions to free open table cache - ****************************************************************************/ - - -void intern_close_table(TABLE *table) -{ // Free all structures - DBUG_ENTER("intern_close_table"); - DBUG_PRINT("tcache", ("table: '%s'.'%s' 0x%lx", - table->s ? table->s->db.str : "?", - table->s ? table->s->table_name.str : "?", - (long) table)); - - delete table->triggers; - if (table->file) // Not true if placeholder - (void) closefrm(table, 1); // close file - table->alias.free(); - my_free(table); - DBUG_VOID_RETURN; -} - - -/** - Auxiliary function which allows to kill delayed threads for - particular table identified by its share. - - @param share Table share. - - @pre Caller should have TABLE_SHARE::tdc.LOCK_table_share mutex. -*/ - -void kill_delayed_threads_for_table(TDC_element *element) -{ - TDC_element::All_share_tables_list::Iterator it(element->all_tables); - TABLE *tab; - - mysql_mutex_assert_owner(&element->LOCK_table_share); - - if (!delayed_insert_threads) - return; - - while ((tab= it++)) - { - THD *in_use= tab->in_use; - - DBUG_ASSERT(in_use && tab->s->tdc->flushed); - if ((in_use->system_thread & SYSTEM_THREAD_DELAYED_INSERT) && - ! in_use->killed) - { - in_use->killed= KILL_SYSTEM_THREAD; - mysql_mutex_lock(&in_use->mysys_var->mutex); - if (in_use->mysys_var->current_cond) - { - mysql_mutex_lock(in_use->mysys_var->current_mutex); - mysql_cond_broadcast(in_use->mysys_var->current_cond); - mysql_mutex_unlock(in_use->mysys_var->current_mutex); - } - mysql_mutex_unlock(&in_use->mysys_var->mutex); - } - } -} - /* Close all tables which aren't in use by any thread @@ -664,96 +568,6 @@ bool close_cached_connection_tables(THD *thd, LEX_STRING *connection) } -/** - Mark all temporary tables which were used by the current statement or - substatement as free for reuse, but only if the query_id can be cleared. - - @param thd thread context - - @remark For temp tables associated with a open SQL HANDLER the query_id - is not reset until the HANDLER is closed. -*/ - -static void mark_temp_tables_as_free_for_reuse(THD *thd) -{ - rpl_group_info *rgi_slave; - DBUG_ENTER("mark_temp_tables_as_free_for_reuse"); - - if (thd->query_id == 0) - { - /* Thread has not executed any statement and has not used any tmp tables */ - DBUG_VOID_RETURN; - } - - rgi_slave=thd->rgi_slave; - if ((!rgi_slave && thd->temporary_tables) || - (rgi_slave && unlikely(rgi_slave->rli->save_temporary_tables))) - { - thd->lock_temporary_tables(); - for (TABLE *table= thd->temporary_tables ; table ; table= table->next) - { - if ((table->query_id == thd->query_id) && ! table->open_by_handler) - mark_tmp_table_for_reuse(table); - } - thd->unlock_temporary_tables(); - if (rgi_slave) - { - /* - Temporary tables are shared with other by sql execution threads. - As a safety messure, clear the pointer to the common area. - */ - thd->temporary_tables= 0; - } - } - DBUG_VOID_RETURN; -} - - -/** - Reset a single temporary table. - Effectively this "closes" one temporary table, - in a session. - - @param table Temporary table. -*/ - -void mark_tmp_table_for_reuse(TABLE *table) -{ - DBUG_ENTER("mark_tmp_table_for_reuse"); - DBUG_ASSERT(table->s->tmp_table); - - table->query_id= 0; - table->file->ha_reset(); - - /* Detach temporary MERGE children from temporary parent. */ - DBUG_ASSERT(table->file); - table->file->extra(HA_EXTRA_DETACH_CHILDREN); - - /* - Reset temporary table lock type to it's default value (TL_WRITE). - - Statements such as INSERT INTO .. SELECT FROM tmp, CREATE TABLE - .. SELECT FROM tmp and UPDATE may under some circumstances modify - the lock type of the tables participating in the statement. This - isn't a problem for non-temporary tables since their lock type is - reset at every open, but the same does not occur for temporary - tables for historical reasons. - - Furthermore, the lock type of temporary tables is not really that - important because they can only be used by one query at a time and - not even twice in a query -- a temporary table is represented by - only one TABLE object. Nonetheless, it's safer from a maintenance - point of view to reset the lock type of this singleton TABLE object - as to not cause problems when the table is reused. - - Even under LOCK TABLES mode its okay to reset the lock type as - LOCK TABLES is allowed (but ignored) for a temporary table. - */ - table->reginfo.lock_type= TL_WRITE; - DBUG_VOID_RETURN; -} - - /* Mark all tables in the list which were used by current substatement as free for reuse. @@ -824,6 +638,8 @@ close_all_tables_for_name(THD *thd, TABLE_SHARE *share, ha_extra_function extra, TABLE *skip_table) { + DBUG_ASSERT(!share->tmp_table); + char key[MAX_DBKEY_LENGTH]; uint key_length= share->table_cache_key.length; const char *db= key; @@ -956,7 +772,7 @@ void close_thread_tables(THD *thd) /* Mark all temporary tables used by this statement as free for reuse. */ - mark_temp_tables_as_free_for_reuse(thd); + thd->mark_tmp_tables_as_free_for_reuse(); if (thd->locked_tables_mode) { @@ -1070,196 +886,6 @@ void close_thread_table(THD *thd, TABLE **table_ptr) } -/* close_temporary_tables' internal, 4 is due to uint4korr definition */ -static inline uint tmpkeyval(THD *thd, TABLE *table) -{ - return uint4korr(table->s->table_cache_key.str + table->s->table_cache_key.length - 4); -} - - -/* - Close all temporary tables created by 'CREATE TEMPORARY TABLE' for thread - creates one DROP TEMPORARY TABLE binlog event for each pseudo-thread - - Temporary tables created in a sql slave is closed by - Relay_log_info::close_temporary_tables() - -*/ - -bool close_temporary_tables(THD *thd) -{ - DBUG_ENTER("close_temporary_tables"); - TABLE *table; - TABLE *next= NULL; - TABLE *prev_table; - /* Assume thd->variables.option_bits has OPTION_QUOTE_SHOW_CREATE */ - bool was_quote_show= TRUE; - bool error= 0; - - if (!thd->temporary_tables) - DBUG_RETURN(FALSE); - DBUG_ASSERT(!thd->rgi_slave); - - /* - Ensure we don't have open HANDLERs for tables we are about to close. - This is necessary when close_temporary_tables() is called as part - of execution of BINLOG statement (e.g. for format description event). - */ - mysql_ha_rm_temporary_tables(thd); - if (!mysql_bin_log.is_open()) - { - TABLE *tmp_next; - for (TABLE *t= thd->temporary_tables; t; t= tmp_next) - { - tmp_next= t->next; - mysql_lock_remove(thd, thd->lock, t); - close_temporary(t, 1, 1); - } - thd->temporary_tables= 0; - DBUG_RETURN(FALSE); - } - - /* Better add "if exists", in case a RESET MASTER has been done */ - const char stub[]= "DROP /*!40005 TEMPORARY */ TABLE IF EXISTS "; - char buf[FN_REFLEN]; - String s_query(buf, sizeof(buf), system_charset_info); - bool found_user_tables= FALSE; - - s_query.copy(stub, sizeof(stub)-1, system_charset_info); - - /* - Insertion sort of temp tables by pseudo_thread_id to build ordered list - of sublists of equal pseudo_thread_id - */ - - for (prev_table= thd->temporary_tables, table= prev_table->next; - table; - prev_table= table, table= table->next) - { - TABLE *prev_sorted /* same as for prev_table */, *sorted; - if (is_user_table(table)) - { - if (!found_user_tables) - found_user_tables= true; - for (prev_sorted= NULL, sorted= thd->temporary_tables; sorted != table; - prev_sorted= sorted, sorted= sorted->next) - { - if (!is_user_table(sorted) || - tmpkeyval(thd, sorted) > tmpkeyval(thd, table)) - { - /* move into the sorted part of the list from the unsorted */ - prev_table->next= table->next; - table->next= sorted; - if (prev_sorted) - { - prev_sorted->next= table; - } - else - { - thd->temporary_tables= table; - } - table= prev_table; - break; - } - } - } - } - - /* We always quote db,table names though it is slight overkill */ - if (found_user_tables && - !(was_quote_show= MY_TEST(thd->variables.option_bits & - OPTION_QUOTE_SHOW_CREATE))) - { - thd->variables.option_bits |= OPTION_QUOTE_SHOW_CREATE; - } - - /* scan sorted tmps to generate sequence of DROP */ - for (table= thd->temporary_tables; table; table= next) - { - if (is_user_table(table)) - { - bool save_thread_specific_used= thd->thread_specific_used; - my_thread_id save_pseudo_thread_id= thd->variables.pseudo_thread_id; - char db_buf[FN_REFLEN]; - String db(db_buf, sizeof(db_buf), system_charset_info); - - /* Set pseudo_thread_id to be that of the processed table */ - thd->variables.pseudo_thread_id= tmpkeyval(thd, table); - - db.copy(table->s->db.str, table->s->db.length, system_charset_info); - /* Reset s_query() if changed by previous loop */ - s_query.length(sizeof(stub)-1); - - /* Loop forward through all tables that belong to a common database - within the sublist of common pseudo_thread_id to create single - DROP query - */ - for (; - table && is_user_table(table) && - (ulong) tmpkeyval(thd, table) == - (ulong) thd->variables.pseudo_thread_id && - table->s->db.length == db.length() && - memcmp(table->s->db.str, db.ptr(), db.length()) == 0; - table= next) - { - /* - We are going to add ` around the table names and possible more - due to special characters - */ - append_identifier(thd, &s_query, table->s->table_name.str, - strlen(table->s->table_name.str)); - s_query.append(','); - next= table->next; - mysql_lock_remove(thd, thd->lock, table); - close_temporary(table, 1, 1); - } - thd->clear_error(); - CHARSET_INFO *cs_save= thd->variables.character_set_client; - thd->variables.character_set_client= system_charset_info; - thd->thread_specific_used= TRUE; - Query_log_event qinfo(thd, s_query.ptr(), - s_query.length() - 1 /* to remove trailing ',' */, - FALSE, TRUE, FALSE, 0); - qinfo.db= db.ptr(); - qinfo.db_len= db.length(); - thd->variables.character_set_client= cs_save; - - thd->get_stmt_da()->set_overwrite_status(true); - if ((error= (mysql_bin_log.write(&qinfo) || error))) - { - /* - If we're here following THD::cleanup, thence the connection - has been closed already. So lets print a message to the - error log instead of pushing yet another error into the - stmt_da. - - Also, we keep the error flag so that we propagate the error - up in the stack. This way, if we're the SQL thread we notice - that close_temporary_tables failed. (Actually, the SQL - thread only calls close_temporary_tables while applying old - Start_log_event_v3 events.) - */ - sql_print_error("Failed to write the DROP statement for " - "temporary tables to binary log"); - } - thd->get_stmt_da()->set_overwrite_status(false); - - thd->variables.pseudo_thread_id= save_pseudo_thread_id; - thd->thread_specific_used= save_thread_specific_used; - } - else - { - next= table->next; - close_temporary(table, 1, 1); - } - } - if (!was_quote_show) - thd->variables.option_bits&= ~OPTION_QUOTE_SHOW_CREATE; /* restore option */ - thd->temporary_tables=0; - - DBUG_RETURN(error); -} - /* Find table in list. @@ -1286,8 +912,7 @@ TABLE_LIST *find_table_in_list(TABLE_LIST *table, { for (; table; table= table->*link ) { - if ((table->table == 0 || table->table->s->tmp_table == NO_TMP_TABLE) && - strcmp(table->db, db_name) == 0 && + if (strcmp(table->db, db_name) == 0 && strcmp(table->table_name, table_name) == 0) break; } @@ -1352,9 +977,6 @@ TABLE_LIST* find_dup_table(THD *thd, TABLE_LIST *table, TABLE_LIST *table_list, /* All MyISAMMRG children are plain MyISAM tables. */ DBUG_ASSERT(table->table->file->ht->db_type != DB_TYPE_MRG_MYISAM); - /* temporary table is always unique */ - if (table->table && table->table->s->tmp_table != NO_TMP_TABLE) - DBUG_RETURN(0); table= table->find_underlying_table(table->table); /* as far as we have table->table we have to find real TABLE_LIST of @@ -1531,291 +1153,6 @@ void update_non_unique_table_error(TABLE_LIST *update, } -/** - Find temporary table specified by database and table names in the - THD::temporary_tables list. - - @return TABLE instance if a temporary table has been found; NULL otherwise. -*/ - -TABLE *find_temporary_table(THD *thd, const char *db, const char *table_name) -{ - char key[MAX_DBKEY_LENGTH]; - uint key_length= create_tmp_table_def_key(thd, key, db, table_name); - return find_temporary_table(thd, key, key_length); -} - - -/** - Find a temporary table specified by TABLE_LIST instance in the - THD::temporary_tables list. - - @return TABLE instance if a temporary table has been found; NULL otherwise. -*/ - -TABLE *find_temporary_table(THD *thd, const TABLE_LIST *tl) -{ - const char *tmp_key; - char key[MAX_DBKEY_LENGTH]; - uint key_length; - - key_length= get_table_def_key(tl, &tmp_key); - memcpy(key, tmp_key, key_length); - int4store(key + key_length, thd->variables.server_id); - int4store(key + key_length + 4, thd->variables.pseudo_thread_id); - - return find_temporary_table(thd, key, key_length + TMP_TABLE_KEY_EXTRA); -} - - -static bool -use_temporary_table(THD *thd, TABLE *table, TABLE **out_table) -{ - *out_table= table; - if (!table) - return false; - /* - Temporary tables are not safe for parallel replication. They were - designed to be visible to one thread only, so have no table locking. - Thus there is no protection against two conflicting transactions - committing in parallel and things like that. - - So for now, anything that uses temporary tables will be serialised - with anything before it, when using parallel replication. - - ToDo: We might be able to introduce a reference count or something - on temp tables, and have slave worker threads wait for it to reach - zero before being allowed to use the temp table. Might not be worth - it though, as statement-based replication using temporary tables is - in any case rather fragile. - */ - if (thd->rgi_slave && thd->rgi_slave->is_parallel_exec && - thd->wait_for_prior_commit()) - return true; - /* - We need to set the THD as it may be different in case of - parallel replication - */ - if (table->in_use != thd) - { - table->in_use= thd; -#ifdef REMOVE_AFTER_MERGE_WITH_10 - if (thd->rgi_slave) - { - /* - We may be stealing an opened temporary tables from one slave - thread to another, we need to let the performance schema know that, - for aggregates per thread to work properly. - */ - MYSQL_UNBIND_TABLE(table->file); - MYSQL_REBIND_TABLE(table->file); - } -#endif - } - return false; -} - -bool -find_and_use_temporary_table(THD *thd, const char *db, const char *table_name, - TABLE **out_table) -{ - return use_temporary_table(thd, find_temporary_table(thd, db, table_name), - out_table); -} - - -bool -find_and_use_temporary_table(THD *thd, const TABLE_LIST *tl, TABLE **out_table) -{ - return use_temporary_table(thd, find_temporary_table(thd, tl), out_table); -} - - -/** - Find a temporary table specified by a key in the THD::temporary_tables list. - - @return TABLE instance if a temporary table has been found; NULL otherwise. -*/ - -TABLE *find_temporary_table(THD *thd, - const char *table_key, - uint table_key_length) -{ - TABLE *result= 0; - if (!thd->have_temporary_tables()) - return NULL; - - thd->lock_temporary_tables(); - for (TABLE *table= thd->temporary_tables; table; table= table->next) - { - if (table->s->table_cache_key.length == table_key_length && - !memcmp(table->s->table_cache_key.str, table_key, table_key_length)) - { - result= table; - break; - } - } - thd->unlock_temporary_tables(); - return result; -} - - -/** - Drop a temporary table. - - Try to locate the table in the list of thd->temporary_tables. - If the table is found: - - if the table is being used by some outer statement, fail. - - if the table is locked with LOCK TABLES or by prelocking, - unlock it and remove it from the list of locked tables - (THD::lock). Currently only transactional temporary tables - are locked. - - Close the temporary table, remove its .FRM - - remove the table from the list of temporary tables - - This function is used to drop user temporary tables, as well as - internal tables created in CREATE TEMPORARY TABLE ... SELECT - or ALTER TABLE. Even though part of the work done by this function - is redundant when the table is internal, as long as we - link both internal and user temporary tables into the same - thd->temporary_tables list, it's impossible to tell here whether - we're dealing with an internal or a user temporary table. - - @param thd Thread handler - @param table Temporary table to be deleted - @param is_trans Is set to the type of the table: - transactional (e.g. innodb) as TRUE or non-transactional - (e.g. myisam) as FALSE. - - @retval 0 the table was found and dropped successfully. - @retval -1 the table is in use by a outer query -*/ - -int drop_temporary_table(THD *thd, TABLE *table, bool *is_trans) -{ - DBUG_ENTER("drop_temporary_table"); - DBUG_PRINT("tmptable", ("closing table: '%s'.'%s'", - table->s->db.str, table->s->table_name.str)); - - /* Table might be in use by some outer statement. */ - if (table->query_id && table->query_id != thd->query_id) - { - DBUG_PRINT("info", ("table->query_id: %lu thd->query_id: %lu", - (ulong) table->query_id, (ulong) thd->query_id)); - - my_error(ER_CANT_REOPEN_TABLE, MYF(0), table->alias.c_ptr()); - DBUG_RETURN(-1); - } - - *is_trans= table->file->has_transactions(); - - /* - If LOCK TABLES list is not empty and contains this table, - unlock the table and remove the table from this list. - */ - mysql_lock_remove(thd, thd->lock, table); - close_temporary_table(thd, table, 1, 1); - DBUG_RETURN(0); -} - - -/* - unlink from thd->temporary tables and close temporary table -*/ - -void close_temporary_table(THD *thd, TABLE *table, - bool free_share, bool delete_table) -{ - DBUG_ENTER("close_temporary_table"); - DBUG_PRINT("tmptable", ("closing table: '%s'.'%s' 0x%lx alias: '%s'", - table->s->db.str, table->s->table_name.str, - (long) table, table->alias.c_ptr())); - - thd->lock_temporary_tables(); - if (table->prev) - { - table->prev->next= table->next; - if (table->prev->next) - table->next->prev= table->prev; - } - else - { - /* removing the item from the list */ - DBUG_ASSERT(table == thd->temporary_tables); - /* - slave must reset its temporary list pointer to zero to exclude - passing non-zero value to end_slave via rli->save_temporary_tables - when no temp tables opened, see an invariant below. - */ - thd->temporary_tables= table->next; - if (thd->temporary_tables) - table->next->prev= 0; - } - if (thd->rgi_slave) - { - /* natural invariant of temporary_tables */ - DBUG_ASSERT(slave_open_temp_tables || !thd->temporary_tables); - thread_safe_decrement32(&slave_open_temp_tables); - table->in_use= 0; // No statistics - } - thd->unlock_temporary_tables(); - close_temporary(table, free_share, delete_table); - DBUG_VOID_RETURN; -} - - -/* - Close and delete a temporary table - - NOTE - This dosn't unlink table from thd->temporary - If this is needed, use close_temporary_table() -*/ - -void close_temporary(TABLE *table, bool free_share, bool delete_table) -{ - handlerton *table_type= table->s->db_type(); - DBUG_ENTER("close_temporary"); - DBUG_PRINT("tmptable", ("closing table: '%s'.'%s'", - table->s->db.str, table->s->table_name.str)); - - closefrm(table, 0); - if (delete_table) - rm_temporary_table(table_type, table->s->path.str); - if (free_share) - { - free_table_share(table->s); - my_free(table); - } - DBUG_VOID_RETURN; -} - - -/* - Used by ALTER TABLE when the table is a temporary one. It changes something - only if the ALTER contained a RENAME clause (otherwise, table_name is the old - name). - Prepares a table cache key, which is the concatenation of db, table_name and - thd->slave_proxy_id, separated by '\0'. -*/ - -bool rename_temporary_table(THD* thd, TABLE *table, const char *db, - const char *table_name) -{ - char *key; - uint key_length; - TABLE_SHARE *share= table->s; - DBUG_ENTER("rename_temporary_table"); - - if (!(key=(char*) alloc_root(&share->mem_root, MAX_DBKEY_LENGTH))) - DBUG_RETURN(1); /* purecov: inspected */ - - key_length= create_tmp_table_def_key(thd, key, db, table_name); - share->set_table_cache_key(key, key_length); - DBUG_RETURN(0); -} - - /** Force all other threads to stop using the table by upgrading metadata lock on it and remove unused TABLE instances from cache. @@ -1838,6 +1175,7 @@ bool wait_while_table_is_used(THD *thd, TABLE *table, enum ha_extra_function function) { DBUG_ENTER("wait_while_table_is_used"); + DBUG_ASSERT(!table->s->tmp_table); DBUG_PRINT("enter", ("table: '%s' share: 0x%lx db_stat: %u version: %lu", table->s->table_name.str, (ulong) table->s, table->db_stat, table->s->tdc->version)); @@ -1881,7 +1219,7 @@ void drop_open_table(THD *thd, TABLE *table, const char *db_name, { DBUG_ENTER("drop_open_table"); if (table->s->tmp_table) - close_temporary_table(thd, table, 1, 1); + thd->drop_temporary_table(table, NULL, true); else { DBUG_ASSERT(table == thd->open_tables); @@ -2545,7 +1883,7 @@ retry_share: } if (open_table_entry_fini(thd, share, table)) { - closefrm(table, 0); + closefrm(table); my_free(table); goto err_lock; } @@ -3361,12 +2699,12 @@ static bool auto_repair_table(THD *thd, TABLE_LIST *table_list) sql_print_error("Couldn't repair table: %s.%s", share->db.str, share->table_name.str); if (entry->file) - closefrm(entry, 0); + closefrm(entry); } else { thd->clear_error(); // Clear error message - closefrm(entry, 0); + closefrm(entry); result= FALSE; } @@ -3997,7 +3335,7 @@ open_and_process_table(THD *thd, LEX *lex, TABLE_LIST *tables, of temporary tables we have to try to open temporary table for it. We can't simply skip this table list element and postpone opening of - temporary tabletill the execution of substatement for several reasons: + temporary table till the execution of substatement for several reasons: - Temporary table can be a MERGE table with base underlying tables, so its underlying tables has to be properly open and locked at prelocking stage. @@ -4013,7 +3351,7 @@ open_and_process_table(THD *thd, LEX *lex, TABLE_LIST *tables, The problem is that since those attributes are not set in merge children, another round of PREPARE will not help. */ - error= open_temporary_table(thd, tables); + error= thd->open_temporary_table(tables); if (!error && !tables->table) error= open_table(thd, tables, ot_ctx); @@ -4032,7 +3370,8 @@ open_and_process_table(THD *thd, LEX *lex, TABLE_LIST *tables, Repair_mrg_table_error_handler repair_mrg_table_handler; thd->push_internal_handler(&repair_mrg_table_handler); - error= open_temporary_table(thd, tables); + error= thd->open_temporary_table(tables); + if (!error && !tables->table) error= open_table(thd, tables, ot_ctx); @@ -4048,7 +3387,7 @@ open_and_process_table(THD *thd, LEX *lex, TABLE_LIST *tables, still might need to look for a temporary table if this table list element corresponds to underlying table of a merge table. */ - error= open_temporary_table(thd, tables); + error= thd->open_temporary_table(tables); } if (!error && !tables->table) @@ -4220,6 +3559,7 @@ end: new locks, so use open_tables_check_upgradable_mdl() instead. @param thd Thread context. + @param options DDL options. @param tables_start Start of list of tables on which upgradable locks should be acquired. @param tables_end End of list of tables. @@ -4422,6 +3762,7 @@ open_tables_check_upgradable_mdl(THD *thd, TABLE_LIST *tables_start, Open all tables in list @param[in] thd Thread context. + @param[in] options DDL options. @param[in,out] start List of tables to be open (it can be adjusted for statement that uses tables only implicitly, e.g. for "SELECT f1()"). @@ -4595,7 +3936,7 @@ restart: goto error; /* Re-open temporary tables after close_tables_for_reopen(). */ - if (open_temporary_tables(thd, *start)) + if (thd->open_temporary_tables(*start)) goto error; error= FALSE; @@ -4657,7 +3998,7 @@ restart: goto error; /* Re-open temporary tables after close_tables_for_reopen(). */ - if (open_temporary_tables(thd, *start)) + if (thd->open_temporary_tables(*start)) goto error; error= FALSE; @@ -5112,7 +4453,7 @@ TABLE *open_ltable(THD *thd, TABLE_LIST *table_list, thr_lock_type lock_type, bool error; DBUG_ENTER("open_ltable"); - /* Ignore temporary tables as they have already ben opened*/ + /* Ignore temporary tables as they have already been opened. */ if (table_list->table) DBUG_RETURN(table_list->table); @@ -5199,8 +4540,9 @@ end: Open all tables in list, locks them and optionally process derived tables. @param thd Thread context. + @param options DDL options. @param tables List of tables for open and locking. - @param derived If to handle derived tables. + @param derived Whether to handle derived tables. @param flags Bitmap of options to be used to open and lock tables (see open_tables() and mysql_lock_tables() for details). @@ -5345,6 +4687,45 @@ static void mark_real_tables_as_free_for_reuse(TABLE_LIST *table_list) } +static bool fix_all_session_vcol_exprs(THD *thd, TABLE_LIST *tables) +{ + Security_context *save_security_ctx= thd->security_ctx; + TABLE_LIST *first_not_own= thd->lex->first_not_own_table(); + DBUG_ENTER("fix_session_vcol_expr"); + + for (TABLE_LIST *table= tables; table && table != first_not_own; + table= table->next_global) + { + TABLE *t= table->table; + if (!table->placeholder() && t->s->vcols_need_refixing && + table->lock_type >= TL_WRITE_ALLOW_WRITE) + { + if (table->security_ctx) + thd->security_ctx= table->security_ctx; + + for (Field **vf= t->vfield; vf && *vf; vf++) + if (fix_session_vcol_expr(thd, (*vf)->vcol_info)) + goto err; + + for (Field **df= t->default_field; df && *df; df++) + if ((*df)->default_value && + fix_session_vcol_expr(thd, (*df)->default_value)) + goto err; + + for (Virtual_column_info **cc= t->check_constraints; cc && *cc; cc++) + if (fix_session_vcol_expr(thd, (*cc))) + goto err; + + thd->security_ctx= save_security_ctx; + } + } + DBUG_RETURN(0); +err: + thd->security_ctx= save_security_ctx; + DBUG_RETURN(1); +} + + /** Lock all tables in a list. @@ -5506,7 +4887,11 @@ bool lock_tables(THD *thd, TABLE_LIST *tables, uint count, } } - DBUG_RETURN(thd->decide_logging_format(tables)); + bool res= fix_all_session_vcol_exprs(thd, tables); + if (!res) + res= thd->decide_logging_format(tables); + + DBUG_RETURN(res); } @@ -5595,176 +4980,6 @@ void close_tables_for_reopen(THD *thd, TABLE_LIST **tables, } -/** - Open a single table without table caching and don't add it to - THD::open_tables. Depending on the 'add_to_temporary_tables_list' value, - the opened TABLE instance will be addded to THD::temporary_tables list. - - @param thd Thread context. - @param hton Storage engine of the table, if known, - or NULL otherwise. - @param frm frm image - @param path Path (without .frm) - @param db Database name. - @param table_name Table name. - @param add_to_temporary_tables_list Specifies if the opened TABLE - instance should be linked into - THD::temporary_tables list. - @param open_in_engine Indicates that we need to open table - in storage engine in addition to - constructing TABLE object for it. - - @note This function is used: - - by alter_table() to open a temporary table; - - when creating a temporary table with CREATE TEMPORARY TABLE. - - @return TABLE instance for opened table. - @retval NULL on error. -*/ - -TABLE *open_table_uncached(THD *thd, handlerton *hton, - LEX_CUSTRING *frm, - const char *path, const char *db, - const char *table_name, - bool add_to_temporary_tables_list, - bool open_in_engine) -{ - TABLE *tmp_table; - TABLE_SHARE *share; - char cache_key[MAX_DBKEY_LENGTH], *saved_cache_key, *tmp_path; - uint key_length; - DBUG_ENTER("open_table_uncached"); - DBUG_PRINT("enter", - ("table: '%s'.'%s' path: '%s' server_id: %u " - "pseudo_thread_id: %lu", - db, table_name, path, - (uint) thd->variables.server_id, - (ulong) thd->variables.pseudo_thread_id)); - - if (add_to_temporary_tables_list) - { - /* Temporary tables are not safe for parallel replication. */ - if (thd->rgi_slave && thd->rgi_slave->is_parallel_exec && - thd->wait_for_prior_commit()) - DBUG_RETURN(NULL); - } - - /* Create the cache_key for temporary tables */ - key_length= create_tmp_table_def_key(thd, cache_key, db, table_name); - - if (!(tmp_table= (TABLE*) my_malloc(sizeof(*tmp_table) + sizeof(*share) + - strlen(path)+1 + key_length, - MYF(MY_WME)))) - DBUG_RETURN(0); /* purecov: inspected */ - - share= (TABLE_SHARE*) (tmp_table+1); - tmp_path= (char*) (share+1); - saved_cache_key= strmov(tmp_path, path)+1; - memcpy(saved_cache_key, cache_key, key_length); - - init_tmp_table_share(thd, share, saved_cache_key, key_length, - strend(saved_cache_key)+1, tmp_path); - share->db_plugin= ha_lock_engine(thd, hton); - - /* - Use the frm image, if possible, open the file otherwise. - - The image might be unavailable in ALTER TABLE, when the discovering - engine took over the ownership (see TABLE::read_frm_image). - */ - int res= frm->str - ? share->init_from_binary_frm_image(thd, false, frm->str, frm->length) - : open_table_def(thd, share, GTS_TABLE | GTS_USE_DISCOVERY); - - if (res) - { - /* No need to lock share->mutex as this is not needed for tmp tables */ - free_table_share(share); - my_free(tmp_table); - DBUG_RETURN(0); - } - - share->m_psi= PSI_CALL_get_table_share(true, share); - - if (open_table_from_share(thd, share, table_name, - open_in_engine ? - (uint) (HA_OPEN_KEYFILE | HA_OPEN_RNDFILE | - HA_GET_INDEX) : 0, - READ_KEYINFO | COMPUTE_TYPES | EXTRA_RECORD, - ha_open_options, - tmp_table, - /* - Set "is_create_table" if the table does not - exist in SE - */ - open_in_engine ? false : true)) - { - /* No need to lock share->mutex as this is not needed for tmp tables */ - free_table_share(share); - my_free(tmp_table); - DBUG_RETURN(0); - } - - tmp_table->reginfo.lock_type= TL_WRITE; // Simulate locked - tmp_table->grant.privilege= TMP_TABLE_ACLS; - share->tmp_table= (tmp_table->file->has_transactions() ? - TRANSACTIONAL_TMP_TABLE : NON_TRANSACTIONAL_TMP_TABLE); - - if (add_to_temporary_tables_list) - { - thd->lock_temporary_tables(); - /* growing temp list at the head */ - tmp_table->next= thd->temporary_tables; - if (tmp_table->next) - tmp_table->next->prev= tmp_table; - thd->temporary_tables= tmp_table; - thd->temporary_tables->prev= 0; - if (thd->rgi_slave) - { - thread_safe_increment32(&slave_open_temp_tables); - } - thd->unlock_temporary_tables(); - } - tmp_table->pos_in_table_list= 0; - DBUG_PRINT("tmptable", ("opened table: '%s'.'%s' 0x%lx", tmp_table->s->db.str, - tmp_table->s->table_name.str, (long) tmp_table)); - DBUG_RETURN(tmp_table); -} - - -/** - Delete a temporary table. - - @param base Handlerton for table to be deleted. - @param path Path to the table to be deleted (i.e. path - to its .frm without an extension). - - @retval false - success. - @retval true - failure. -*/ - -bool rm_temporary_table(handlerton *base, const char *path) -{ - bool error=0; - handler *file; - char frm_path[FN_REFLEN + 1]; - DBUG_ENTER("rm_temporary_table"); - - strxnmov(frm_path, sizeof(frm_path) - 1, path, reg_ext, NullS); - if (mysql_file_delete(key_file_frm, frm_path, MYF(0))) - error=1; /* purecov: inspected */ - file= get_new_handler((TABLE_SHARE*) 0, current_thd->mem_root, base); - if (file && file->ha_delete_table(path)) - { - error=1; - sql_print_warning("Could not remove temporary table: '%s', error: %d", - path, my_errno); - } - delete file; - DBUG_RETURN(error); -} - - /***************************************************************************** * The following find_field_in_XXX procedures implement the core of the * name resolution functionality. The entry point to resolve a column name in a @@ -5833,164 +5048,6 @@ static void update_field_dependencies(THD *thd, Field *field, TABLE *table) } -/** - Find a temporary table specified by TABLE_LIST instance in the cache and - prepare its TABLE instance for use. - - This function tries to resolve this table in the list of temporary tables - of this thread. Temporary tables are thread-local and "shadow" base - tables with the same name. - - @note In most cases one should use open_temporary_tables() instead - of this call. - - @note One should finalize process of opening temporary table for table - list element by calling open_and_process_table(). This function - is responsible for table version checking and handling of merge - tables. - - @note We used to check global_read_lock before opening temporary tables. - However, that limitation was artificial and is removed now. - - @return Error status. - @retval FALSE On success. If a temporary table exists for the given - key, tl->table is set. - @retval TRUE On error. my_error() has been called. -*/ - -bool open_temporary_table(THD *thd, TABLE_LIST *tl) -{ - TABLE *table; - DBUG_ENTER("open_temporary_table"); - DBUG_PRINT("enter", ("table: '%s'.'%s'", tl->db, tl->table_name)); - - /* - Code in open_table() assumes that TABLE_LIST::table can - be non-zero only for pre-opened temporary tables. - */ - DBUG_ASSERT(tl->table == NULL); - - /* - This function should not be called for cases when derived or I_S - tables can be met since table list elements for such tables can - have invalid db or table name. - Instead open_temporary_tables() should be used. - */ - DBUG_ASSERT(!tl->derived && !tl->schema_table); - - if (tl->open_type == OT_BASE_ONLY || !thd->have_temporary_tables()) - { - DBUG_PRINT("info", ("skip_temporary is set or no temporary tables")); - DBUG_RETURN(FALSE); - } - - if (find_and_use_temporary_table(thd, tl, &table)) - DBUG_RETURN(TRUE); - if (!table) - { - if (tl->open_type == OT_TEMPORARY_ONLY && - tl->open_strategy == TABLE_LIST::OPEN_NORMAL) - { - my_error(ER_NO_SUCH_TABLE, MYF(0), tl->db, tl->table_name); - DBUG_RETURN(TRUE); - } - DBUG_RETURN(FALSE); - } - - /* - Temporary tables are not safe for parallel replication. They were - designed to be visible to one thread only, so have no table locking. - Thus there is no protection against two conflicting transactions - committing in parallel and things like that. - - So for now, anything that uses temporary tables will be serialised - with anything before it, when using parallel replication. - - ToDo: We might be able to introduce a reference count or something - on temp tables, and have slave worker threads wait for it to reach - zero before being allowed to use the temp table. Might not be worth - it though, as statement-based replication using temporary tables is - in any case rather fragile. - */ - if (thd->rgi_slave && thd->rgi_slave->is_parallel_exec && - thd->wait_for_prior_commit()) - DBUG_RETURN(true); - -#ifdef WITH_PARTITION_STORAGE_ENGINE - if (tl->partition_names) - { - /* Partitioned temporary tables is not supported. */ - DBUG_ASSERT(!table->part_info); - my_error(ER_PARTITION_CLAUSE_ON_NONPARTITIONED, MYF(0)); - DBUG_RETURN(true); - } -#endif - - if (table->query_id) - { - /* - We're trying to use the same temporary table twice in a query. - Right now we don't support this because a temporary table is always - represented by only one TABLE object in THD, and it can not be - cloned. Emit an error for an unsupported behaviour. - */ - - DBUG_PRINT("error", - ("query_id: %lu server_id: %u pseudo_thread_id: %lu", - (ulong) table->query_id, (uint) thd->variables.server_id, - (ulong) thd->variables.pseudo_thread_id)); - my_error(ER_CANT_REOPEN_TABLE, MYF(0), table->alias.c_ptr()); - DBUG_RETURN(TRUE); - } - - table->query_id= thd->query_id; - thd->thread_specific_used= TRUE; - - tl->updatable= 1; // It is not derived table nor non-updatable VIEW. - tl->table= table; - - table->init(thd, tl); - - DBUG_PRINT("info", ("Using temporary table")); - DBUG_RETURN(FALSE); -} - - -/** - Pre-open temporary tables corresponding to table list elements. - - @note One should finalize process of opening temporary tables - by calling open_tables(). This function is responsible - for table version checking and handling of merge tables. - - @return Error status. - @retval FALSE On success. If a temporary tables exists for the - given element, tl->table is set. - @retval TRUE On error. my_error() has been called. -*/ - -bool open_temporary_tables(THD *thd, TABLE_LIST *tl_list) -{ - TABLE_LIST *first_not_own= thd->lex->first_not_own_table(); - DBUG_ENTER("open_temporary_tables"); - - for (TABLE_LIST *tl= tl_list; tl && tl != first_not_own; tl= tl->next_global) - { - if (tl->derived || tl->schema_table) - { - /* - Derived and I_S tables will be handled by a later call to open_tables(). - */ - continue; - } - - if (open_temporary_table(thd, tl)) - DBUG_RETURN(TRUE); - } - - DBUG_RETURN(FALSE); -} - /* Find a field by name in a view that uses merge algorithm. @@ -6469,9 +5526,9 @@ find_field_in_table_ref(THD *thd, TABLE_LIST *table_list, else { if (thd->mark_used_columns == MARK_COLUMNS_READ) - it->walk(&Item::register_field_in_read_map, 0, (uchar *) 0); + it->walk(&Item::register_field_in_read_map, 0, 0); else - it->walk(&Item::register_field_in_write_map, 0, (uchar *) 0); + it->walk(&Item::register_field_in_write_map, 0, 0); } } else @@ -8670,11 +7727,14 @@ err_no_arena: @param fields Item_fields list to be filled @param values values to fill with @param ignore_errors TRUE if we should ignore errors + @param update TRUE if update query @details fill_record() may set table->auto_increment_field_not_null and a caller should make sure that it is reset after their last call to this function. + default functions are executed for inserts. + virtual fields are always updated @return Status @retval true An error occurred. @@ -8683,7 +7743,7 @@ err_no_arena: bool fill_record(THD *thd, TABLE *table_arg, List &fields, List &values, - bool ignore_errors) + bool ignore_errors, bool update) { List_iterator_fast f(fields),v(values); Item *value, *fld; @@ -8714,7 +7774,7 @@ fill_record(THD *thd, TABLE *table_arg, List &fields, List &values, table_arg->auto_increment_field_not_null= FALSE; f.rewind(); } - else if (thd->lex->unit.insert_table_with_stored_vcol) + else vcol_table= thd->lex->unit.insert_table_with_stored_vcol; while ((fld= f++)) @@ -8727,7 +7787,8 @@ fill_record(THD *thd, TABLE *table_arg, List &fields, List &values, value=v++; Field *rfield= field->field; TABLE* table= rfield->table; - if (rfield == table->next_number_field) + if (table->next_number_field && + rfield->field_index == table->next_number_field->field_index) table->auto_increment_field_not_null= TRUE; if (rfield->vcol_info && value->type() != Item::DEFAULT_VALUE_ITEM && @@ -8749,12 +7810,16 @@ fill_record(THD *thd, TABLE *table_arg, List &fields, List &values, DBUG_ASSERT(vcol_table == 0 || vcol_table == table); vcol_table= table; } - /* Update virtual fields*/ + + if (!update && table_arg->default_field && + table_arg->update_default_fields(0, ignore_errors)) + goto err; + /* Update virtual fields */ thd->abort_on_warning= FALSE; if (vcol_table && vcol_table->vfield && update_virtual_fields(thd, vcol_table, vcol_table->triggers ? VCOL_UPDATE_ALL : - VCOL_UPDATE_FOR_WRITE)) + VCOL_UPDATE_FOR_WRITE)) goto err; thd->abort_on_warning= save_abort_on_warning; thd->no_errors= save_no_errors; @@ -8778,18 +7843,47 @@ void switch_to_nullable_trigger_fields(List &items, TABLE *table) { Field** field= table->field_to_fill(); + /* True if we have NOT NULL fields and BEFORE triggers */ if (field != table->field) { List_iterator_fast it(items); Item *item; while ((item= it++)) - item->walk(&Item::switch_to_nullable_fields_processor, 1, (uchar*)field); + item->walk(&Item::switch_to_nullable_fields_processor, 1, field); table->triggers->reset_extra_null_bitmap(); } } +/** + Prepare Virtual fields and field with default expressions to use + trigger fields + + This means redirecting from table->field to + table->field_to_fill(), if needed. +*/ + +void switch_defaults_to_nullable_trigger_fields(TABLE *table) +{ + if (!table->default_field) + return; // no defaults + + Field **trigger_field= table->field_to_fill(); + + /* True if we have NOT NULL fields and BEFORE triggers */ + if (trigger_field != table->field) + { + for (Field **field_ptr= table->default_field; *field_ptr ; field_ptr++) + { + Field *field= (*field_ptr); + field->default_value->expr_item->walk(&Item::switch_to_nullable_fields_processor, 1, trigger_field); + *field_ptr= (trigger_field[field->field_index]); + } + } +} + + /** Test NOT NULL constraint after BEFORE triggers */ @@ -8844,25 +7938,28 @@ static bool not_null_fields_have_null_values(TABLE *table) */ bool -fill_record_n_invoke_before_triggers(THD *thd, TABLE *table, List &fields, +fill_record_n_invoke_before_triggers(THD *thd, TABLE *table, + List &fields, List &values, bool ignore_errors, enum trg_event_type event) { bool result; Table_triggers_list *triggers= table->triggers; - result= fill_record(thd, table, fields, values, ignore_errors); + result= fill_record(thd, table, fields, values, ignore_errors, + event == TRG_EVENT_UPDATE); - if (!result && triggers) - result= triggers->process_triggers(thd, event, TRG_ACTION_BEFORE, TRUE) || - not_null_fields_have_null_values(table); - - /* - Re-calculate virtual fields to cater for cases when base columns are - updated by the triggers. - */ if (!result && triggers) { + if (triggers->process_triggers(thd, event, TRG_ACTION_BEFORE, + TRUE) || + not_null_fields_have_null_values(table)) + return TRUE; + + /* + Re-calculate virtual fields to cater for cases when base columns are + updated by the triggers. + */ List_iterator_fast f(fields); Item *fld; Item_field *item_field; @@ -8870,12 +7967,12 @@ fill_record_n_invoke_before_triggers(THD *thd, TABLE *table, List &fields, { fld= (Item_field*)f++; item_field= fld->field_for_view_update(); - if (item_field && item_field->field && table && table->vfield) + if (item_field && table->vfield) { DBUG_ASSERT(table == item_field->field->table); result= update_virtual_fields(thd, table, table->triggers ? VCOL_UPDATE_ALL : - VCOL_UPDATE_FOR_WRITE); + VCOL_UPDATE_FOR_WRITE); } } } @@ -8885,6 +7982,7 @@ fill_record_n_invoke_before_triggers(THD *thd, TABLE *table, List &fields, /** Fill the field buffer of a table with the values of an Item list + All fields are given a value @param thd thread handler @param table_arg the table that is being modified @@ -8960,7 +8058,8 @@ fill_record(THD *thd, TABLE *table, Field **ptr, List &values, goto err; field->set_explicit_default(value); } - /* Update virtual fields*/ + /* There is no default fields to update, as all fields are updated */ + /* Update virtual fields */ thd->abort_on_warning= FALSE; if (table->vfield && update_virtual_fields(thd, table, @@ -9020,8 +8119,9 @@ fill_record_n_invoke_before_triggers(THD *thd, TABLE *table, Field **ptr, DBUG_ASSERT(table == (*ptr)->table); if (table->vfield) result= update_virtual_fields(thd, table, - table->triggers ? VCOL_UPDATE_ALL : - VCOL_UPDATE_FOR_WRITE); + table->triggers ? + VCOL_UPDATE_ALL : + VCOL_UPDATE_FOR_WRITE); } return result; @@ -9038,7 +8138,7 @@ my_bool mysql_rm_tmp_tables(void) THD *thd; DBUG_ENTER("mysql_rm_tmp_tables"); - if (!(thd= new THD)) + if (!(thd= new THD(0))) DBUG_RETURN(1); thd->thread_stack= (char*) &thd; thd->store_globals(); diff --git a/sql/sql_base.h b/sql/sql_base.h index d6bd0e2ace7..f487887ddc9 100644 --- a/sql/sql_base.h +++ b/sql/sql_base.h @@ -59,8 +59,6 @@ enum find_item_error_report_type {REPORT_ALL_ERRORS, REPORT_EXCEPT_NOT_FOUND, IGNORE_ERRORS, REPORT_EXCEPT_NON_UNIQUE, IGNORE_EXCEPT_NON_UNIQUE}; -uint create_tmp_table_def_key(THD *thd, char *key, const char *db, - const char *table_name); uint get_table_def_key(const TABLE_LIST *table_list, const char **key); TABLE *open_ltable(THD *thd, TABLE_LIST *table_list, thr_lock_type update, uint lock_flags); @@ -124,11 +122,6 @@ bool open_table(THD *thd, TABLE_LIST *table_list, Open_table_context *ot_ctx); bool get_key_map_from_key_list(key_map *map, TABLE *table, List *index_list); -TABLE *open_table_uncached(THD *thd, handlerton *hton, - LEX_CUSTRING *frm, const char *path, - const char *db, const char *table_name, - bool add_to_temporary_tables_list, - bool open_in_engine); TABLE *find_locked_table(TABLE *list, const char *db, const char *table_name); TABLE *find_write_locked_table(TABLE *list, const char *db, const char *table_name); @@ -138,23 +131,15 @@ thr_lock_type read_lock_type_for_table(THD *thd, bool routine_modifies_data); my_bool mysql_rm_tmp_tables(void); -bool rm_temporary_table(handlerton *base, const char *path); void close_tables_for_reopen(THD *thd, TABLE_LIST **tables, const MDL_savepoint &start_of_statement_svp); TABLE_LIST *find_table_in_list(TABLE_LIST *table, TABLE_LIST *TABLE_LIST::*link, const char *db_name, const char *table_name); -TABLE *find_temporary_table(THD *thd, const char *db, const char *table_name); -bool find_and_use_temporary_table(THD *thd, const char *db, - const char *table_name, TABLE **out_table); -TABLE *find_temporary_table(THD *thd, const TABLE_LIST *tl); -bool find_and_use_temporary_table(THD *thd, const TABLE_LIST *tl, - TABLE **out_table); -TABLE *find_temporary_table(THD *thd, const char *table_key, - uint table_key_length); void close_thread_tables(THD *thd); void switch_to_nullable_trigger_fields(List &items, TABLE *); +void switch_defaults_to_nullable_trigger_fields(TABLE *table); bool fill_record_n_invoke_before_triggers(THD *thd, TABLE *table, List &fields, List &values, @@ -177,7 +162,7 @@ bool setup_fields(THD *thd, Ref_ptr_array ref_pointer_array, List *sum_func_list, bool allow_sum_func); void unfix_fields(List &items); bool fill_record(THD * thd, TABLE *table_arg, List &fields, - List &values, bool ignore_errors); + List &values, bool ignore_errors, bool update); bool fill_record(THD *thd, TABLE *table, Field **field, List &values, bool ignore_errors, bool use_value); @@ -271,20 +256,9 @@ bool open_normal_and_derived_tables(THD *thd, TABLE_LIST *tables, uint flags, uint dt_phases); bool lock_tables(THD *thd, TABLE_LIST *tables, uint counter, uint flags); int decide_logging_format(THD *thd, TABLE_LIST *tables); -void intern_close_table(TABLE *entry); -void kill_delayed_threads_for_table(TDC_element *element); void close_thread_table(THD *thd, TABLE **table_ptr); -bool close_temporary_tables(THD *thd); TABLE_LIST *unique_table(THD *thd, TABLE_LIST *table, TABLE_LIST *table_list, bool check_alias); -int drop_temporary_table(THD *thd, TABLE *table, bool *is_trans); -void close_temporary_table(THD *thd, TABLE *table, bool free_share, - bool delete_table); -void close_temporary(TABLE *table, bool free_share, bool delete_table); -bool rename_temporary_table(THD* thd, TABLE *table, const char *new_db, - const char *table_name); -bool open_temporary_tables(THD *thd, TABLE_LIST *tl_list); -bool open_temporary_table(THD *thd, TABLE_LIST *tl); bool is_equal(const LEX_STRING *a, const LEX_STRING *b); class Open_tables_backup; @@ -313,7 +287,6 @@ bool tdc_open_view(THD *thd, TABLE_LIST *table_list, uint flags); TABLE *find_table_for_mdl_upgrade(THD *thd, const char *db, const char *table_name, bool no_error); -void mark_tmp_table_for_reuse(TABLE *table); int update_virtual_fields(THD *thd, TABLE *table, enum enum_vcol_update_mode vcol_update_mode= VCOL_UPDATE_FOR_READ); diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index 42b80d9b143..06c5f992939 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -1999,36 +1999,32 @@ lookup: for (; block_table != block_table_end; block_table++) { TABLE_LIST table_list; - TABLE *tmptable; + TMP_TABLE_SHARE *tmptable; Query_cache_table *table = block_table->parent; /* - Check that we have not temporary tables with same names of tables - of this query. If we have such tables, we will not send data from - query cache, because temporary tables hide real tables by which + Check that we do not have temporary tables with same names as that of + base tables from this query. If we have such tables, we will not send + data from query cache, because temporary tables hide real tables by which query in query cache was made. */ - for (tmptable= thd->temporary_tables; tmptable ; tmptable= tmptable->next) + if ((tmptable= + thd->find_tmp_table_share_w_base_key((char *) table->data(), + table->key_length()))) { - if (tmptable->s->table_cache_key.length - TMP_TABLE_KEY_EXTRA == - table->key_length() && - !memcmp(tmptable->s->table_cache_key.str, table->data(), - table->key_length())) - { - DBUG_PRINT("qcache", - ("Temporary table detected: '%s.%s'", - tmptable->s->db.str, tmptable->alias.c_ptr())); - unlock(); - /* - We should not store result of this query because it contain - temporary tables => assign following variable to make check - faster. - */ - thd->query_cache_is_applicable= 0; // Query can't be cached - thd->lex->safe_to_cache_query= 0; // For prepared statements - BLOCK_UNLOCK_RD(query_block); - DBUG_RETURN(-1); - } + DBUG_PRINT("qcache", + ("Temporary table detected: '%s.%s'", + tmptable->db.str, tmptable->table_name.str)); + unlock(); + /* + We should not store result of this query because it contain + temporary tables => assign following variable to make check + faster. + */ + thd->query_cache_is_applicable= 0; // Query can't be cached + thd->lex->safe_to_cache_query= 0; // For prepared statements + BLOCK_UNLOCK_RD(query_block); + DBUG_RETURN(-1); } bzero((char*) &table_list,sizeof(table_list)); @@ -2360,7 +2356,7 @@ void Query_cache::invalidate(THD *thd, char *db) } /* The used tables are linked in a circular list; - loop until we return to the begining. + loop until we return to the beginning. */ } while (table_block != tables_blocks); /* @@ -3301,7 +3297,7 @@ Query_cache::invalidate_query_block_list(THD *thd, } /* - Register given table list begining with given position in tables table of + Register given table list beginning with given position in tables table of block SYNOPSIS @@ -4344,7 +4340,7 @@ my_bool Query_cache::move_by_type(uchar **border, { Query_cache_block_table *block_table = new_block->table(j); - // use aligment from begining of table if 'next' is in same block + // use aligment from beginning of table if 'next' is in same block if ((beg_of_table_table <= block_table->next) && (block_table->next < end_of_table_table)) ((Query_cache_block_table *)(beg_of_new_table_table + @@ -4354,7 +4350,7 @@ my_bool Query_cache::move_by_type(uchar **border, else block_table->next->prev= block_table; - // use aligment from begining of table if 'prev' is in same block + // use aligment from beginning of table if 'prev' is in same block if ((beg_of_table_table <= block_table->prev) && (block_table->prev < end_of_table_table)) ((Query_cache_block_table *)(beg_of_new_table_table + @@ -4851,7 +4847,7 @@ my_bool Query_cache::check_integrity(bool locked) if (((uchar*)block) + block->length != ((uchar*)block->pnext)) { DBUG_PRINT("error", - ("block 0x%lx, type %u, ended at 0x%lx, but next block begining at 0x%lx", + ("block 0x%lx, type %u, ended at 0x%lx, but next block beginning at 0x%lx", (ulong) block, (uint) block->type, (ulong) (((uchar*)block) + block->length), (ulong) ((uchar*)block->pnext))); diff --git a/sql/sql_class.cc b/sql/sql_class.cc index be950627f08..d29dc0eff14 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -37,7 +37,7 @@ #include "tztime.h" // MYSQL_TIME <-> my_time_t #include "sql_acl.h" // NO_ACCESS, // acl_getroot_no_password -#include "sql_base.h" // close_temporary_tables +#include "sql_base.h" #include "sql_handler.h" // mysql_ha_cleanup #include "rpl_rli.h" #include "rpl_filter.h" @@ -336,17 +336,6 @@ void thd_set_killed(THD *thd) thd->killed= KILL_CONNECTION; } -/** - Clear errors from the previous THD - - @param thd THD object -*/ -void thd_clear_errors(THD *thd) -{ - my_errno= 0; - thd->mysys_var->abort= 0; -} - /** Set thread stack in THD object @@ -456,7 +445,7 @@ my_socket thd_get_fd(THD *thd) { return mysql_socket_getfd(thd->net.vio->mysql_socket); } -#endif +#endif /* ONLY_FOR_MYSQL_CLOSED_SOURCE_SCHEDULED */ /** Get current THD object from thread local data @@ -468,6 +457,18 @@ THD *thd_get_current_thd() return current_thd; } +/** + Clear errors from the previous THD + + @param thd THD object +*/ +void thd_clear_errors(THD *thd) +{ + my_errno= 0; + thd->mysys_var->abort= 0; +} + + /** Get thread attributes for connection threads @@ -845,7 +846,7 @@ extern "C" void thd_kill_timeout(THD* thd) } -THD::THD(bool is_wsrep_applier) +THD::THD(my_thread_id id, bool is_wsrep_applier) :Statement(&main_lex, &main_mem_root, STMT_CONVENTIONAL_EXECUTION, /* statement id */ 0), rli_fake(0), rgi_fake(0), rgi_slave(NULL), @@ -854,17 +855,13 @@ THD::THD(bool is_wsrep_applier) binlog_unsafe_warning_flags(0), binlog_table_maps(0), table_map_for_update(0), - arg_of_last_insert_id_function(FALSE), - first_successful_insert_id_in_prev_stmt(0), - first_successful_insert_id_in_prev_stmt_for_binlog(0), - first_successful_insert_id_in_cur_stmt(0), - stmt_depends_on_first_successful_insert_id_in_prev_stmt(FALSE), m_examined_row_count(0), accessed_rows_and_keys(0), m_digest(NULL), m_statement_psi(NULL), m_idle_psi(NULL), - thread_id(0), + thread_id(id), + thread_dbug_id(id), os_thread_id(0), global_disable_checkpoint(0), failed_com_change_user(0), @@ -886,7 +883,8 @@ THD::THD(bool is_wsrep_applier) main_da(0, false, false), m_stmt_da(&main_da), tdc_hash_pins(0), - xid_hash_pins(0) + xid_hash_pins(0), + m_tmp_tables_locked(false) #ifdef WITH_WSREP , wsrep_applier(is_wsrep_applier), @@ -910,6 +908,7 @@ THD::THD(bool is_wsrep_applier) set_current_thd(this); status_var.local_memory_used= sizeof(THD); status_var.global_memory_used= 0; + variables.pseudo_thread_id= thread_id; main_da.init(); /* @@ -947,7 +946,6 @@ THD::THD(bool is_wsrep_applier) statement_id_counter= 0UL; // Must be reset to handle error with THD's created for init of mysqld lex->current_select= 0; - user_time.val= start_time= start_time_sec_part= 0; start_utime= utime_after_query= 0; utime_after_lock= 0L; progress.arena= 0; @@ -973,14 +971,12 @@ THD::THD(bool is_wsrep_applier) #ifndef DBUG_OFF dbug_sentry=THD_SENTRY_MAGIC; #endif -#ifndef EMBEDDED_LIBRARY mysql_audit_init_thd(this); -#endif net.vio=0; net.buff= 0; client_capabilities= 0; // minimalistic client system_thread= NON_SYSTEM_THREAD; - cleanup_done= abort_on_warning= 0; + cleanup_done= free_connection_done= abort_on_warning= 0; peer_port= 0; // For SHOW PROCESSLIST transaction.m_pending_rows_event= 0; transaction.on= 1; @@ -1003,7 +999,6 @@ THD::THD(bool is_wsrep_applier) /* Variables with default values */ proc_info="login"; where= THD::DEFAULT_WHERE; - variables.server_id = global_system_variables.server_id; slave_net = 0; m_command=COM_CONNECT; *scramble= '\0'; @@ -1064,7 +1059,6 @@ THD::THD(bool is_wsrep_applier) tmp= (ulong) (my_rnd(&sql_rand) * 0xffffffff); my_rnd_init(&rand, tmp + (ulong) &rand, tmp + (ulong) ::global_query_id); substitute_null_with_insert_id = FALSE; - thr_lock_info_init(&lock_info); /* safety: will be reset after start */ lock_info.mysql_thd= (void *)this; m_token_array= NULL; @@ -1084,6 +1078,7 @@ THD::THD(bool is_wsrep_applier) save_prep_leaf_list= FALSE; /* Restore THR_THD */ set_current_thd(old_THR_THD); + inc_thread_count(); } @@ -1405,6 +1400,8 @@ void THD::init(void) mysql_mutex_unlock(&LOCK_global_system_variables); + user_time.val= start_time= start_time_sec_part= 0; + server_status= SERVER_STATUS_AUTOCOMMIT; if (variables.sql_mode & MODE_NO_BACKSLASH_ESCAPES) server_status|= SERVER_STATUS_NO_BACKSLASH_ESCAPES; @@ -1420,15 +1417,21 @@ void THD::init(void) TL_WRITE); tx_isolation= (enum_tx_isolation) variables.tx_isolation; tx_read_only= variables.tx_read_only; - update_charset(); + update_charset(); // plugin_thd_var() changed character sets reset_current_stmt_binlog_format_row(); reset_binlog_local_stmt_filter(); set_status_var_init(); bzero((char *) &org_status_var, sizeof(org_status_var)); + status_in_global= 0; start_bytes_received= 0; last_commit_gtid.seq_no= 0; last_stmt= NULL; - status_in_global= 0; + /* Reset status of last insert id */ + arg_of_last_insert_id_function= FALSE; + stmt_depends_on_first_successful_insert_id_in_prev_stmt= FALSE; + first_successful_insert_id_in_prev_stmt= 0; + first_successful_insert_id_in_prev_stmt_for_binlog= 0; + first_successful_insert_id_in_cur_stmt= 0; #ifdef WITH_WSREP wsrep_exec_mode= wsrep_applier ? REPL_RECV : LOCAL_STATE; wsrep_conflict_state= NO_CONFLICT; @@ -1547,12 +1550,14 @@ void THD::init_for_queries() void THD::change_user(void) { - add_status_to_global(); + if (!status_in_global) // Reset in init() + add_status_to_global(); - cleanup(); - reset_killed(); + if (!cleanup_done) + cleanup(); cleanup_done= 0; - status_in_global= 0; + reset_killed(); + thd_clear_errors(this); init(); stmt_map.reset(); my_hash_init(&user_vars, system_charset_info, USER_VARS_HASH_SIZE, 0, 0, @@ -1582,7 +1587,7 @@ void THD::cleanup(void) locked_tables_list.unlock_locked_tables(this); delete_dynamic(&user_var_events); - close_temporary_tables(this); + close_temporary_tables(); transaction.xid_state.xa_state= XA_NOTR; trans_rollback(this); @@ -1616,6 +1621,8 @@ void THD::cleanup(void) my_hash_free(&user_vars); sp_cache_clear(&sp_proc_cache); sp_cache_clear(&sp_func_cache); + auto_inc_intervals_forced.empty(); + auto_inc_intervals_in_cur_stmt_for_binlog.empty(); mysql_ull_cleanup(this); /* All metadata locks must have been released by now. */ @@ -1627,6 +1634,69 @@ void THD::cleanup(void) } +/* + Free all connection related resources associated with a THD. + This is used when we put a thread into the thread cache. + After this call should either call ~THD or reset_for_reuse() depending on + circumstances. +*/ + +void THD::free_connection() +{ + DBUG_ASSERT(free_connection_done == 0); + my_free(db); + db= NULL; +#ifndef EMBEDDED_LIBRARY + if (net.vio) + vio_delete(net.vio); + net.vio= 0; + net_end(&net); +#endif + if (!cleanup_done) + cleanup(); + ha_close_connection(this); + plugin_thdvar_cleanup(this); + mysql_audit_free_thd(this); + main_security_ctx.destroy(); + /* close all prepared statements, to save memory */ + stmt_map.reset(); + free_connection_done= 1; +#if defined(ENABLED_PROFILING) + profiling.restart(); // Reset profiling +#endif +} + +/* + Reset thd for reuse by another connection + This is only used for user connections, so the following variables doesn't + have to be reset: + - Replication (slave) variables. + - Variables not reset between each statements. See reset_for_next_command. +*/ + +void THD::reset_for_reuse() +{ + mysql_audit_init_thd(this); + change_user(); // Calls cleanup() & init() + get_stmt_da()->reset_diagnostics_area(); + main_security_ctx.init(); + failed_com_change_user= 0; + is_fatal_error= 0; + client_capabilities= 0; + peer_port= 0; + query_name_consts= 0; // Safety + abort_on_warning= 0; + free_connection_done= 0; + m_command= COM_CONNECT; +#if defined(ENABLED_PROFILING) + profiling.reset(); +#endif +#ifdef SIGNAL_WITH_VIO_CLOSE + active_vio = 0; +#endif +} + + THD::~THD() { THD *orig_thd= current_thd; @@ -1653,26 +1723,13 @@ THD::~THD() mysql_mutex_lock(&LOCK_wsrep_thd); mysql_mutex_unlock(&LOCK_wsrep_thd); mysql_mutex_destroy(&LOCK_wsrep_thd); - if (wsrep_rgi) delete wsrep_rgi; + delete wsrep_rgi; #endif - /* Close connection */ -#ifndef EMBEDDED_LIBRARY - if (net.vio) - vio_delete(net.vio); - net_end(&net); -#endif - stmt_map.reset(); /* close all prepared statements */ - if (!cleanup_done) - cleanup(); + if (!free_connection_done) + free_connection(); mdl_context.destroy(); - ha_close_connection(this); - mysql_audit_release(this); - plugin_thdvar_cleanup(this); - main_security_ctx.destroy(); - my_free(db); - db= NULL; free_root(&transaction.mem_root,MYF(0)); mysql_cond_destroy(&COND_wakeup_ready); mysql_mutex_destroy(&LOCK_wakeup_ready); @@ -1692,7 +1749,6 @@ THD::~THD() rli_fake= NULL; } - mysql_audit_free_thd(this); if (rgi_slave) rgi_slave->cleanup_after_session(); my_free(semisync_info); @@ -1716,6 +1772,7 @@ THD::~THD() } update_global_memory_status(status_var.global_memory_used); set_current_thd(orig_thd == this ? 0 : orig_thd); + dec_thread_count(); DBUG_VOID_RETURN; } @@ -1730,7 +1787,7 @@ THD::~THD() NOTES This function assumes that all variables at start are long/ulong and - other types are handled explicitely + other types are handled explicitly */ void add_to_status(STATUS_VAR *to_var, STATUS_VAR *from_var) @@ -1762,11 +1819,10 @@ void add_to_status(STATUS_VAR *to_var, STATUS_VAR *from_var) DBUG_PRINT("info", ("global memory_used: %lld size: %lld", (longlong) global_status_var.global_memory_used, (longlong) from_var->global_memory_used)); + update_global_memory_status(from_var->global_memory_used); } - // workaround for gcc 4.2.4-1ubuntu4 -fPIE (from DEB_BUILD_HARDENING=1) - int64 volatile * volatile ptr= &to_var->global_memory_used; - my_atomic_add64_explicit(ptr, from_var->global_memory_used, - MY_MEMORY_ORDER_RELAXED); + else + to_var->global_memory_used+= from_var->global_memory_used; } /* @@ -1780,7 +1836,7 @@ void add_to_status(STATUS_VAR *to_var, STATUS_VAR *from_var) NOTE This function assumes that all variables at start are long/ulong and - other types are handled explicitely + other types are handled explicitly */ void add_diff_to_status(STATUS_VAR *to_var, STATUS_VAR *from_var, @@ -1978,46 +2034,63 @@ bool THD::notify_shared_lock(MDL_context_owner *ctx_in_use, { THD *in_use= ctx_in_use->get_thd(); bool signalled= FALSE; + DBUG_ENTER("THD::notify_shared_lock"); + DBUG_PRINT("enter",("needs_thr_lock_abort: %d", needs_thr_lock_abort)); if ((in_use->system_thread & SYSTEM_THREAD_DELAYED_INSERT) && !in_use->killed) { - in_use->killed= KILL_CONNECTION; - mysql_mutex_lock(&in_use->mysys_var->mutex); - if (in_use->mysys_var->current_cond) - mysql_cond_broadcast(in_use->mysys_var->current_cond); - mysql_mutex_unlock(&in_use->mysys_var->mutex); + /* This code is similar to kill_delayed_threads() */ + DBUG_PRINT("info", ("kill delayed thread")); + mysql_mutex_lock(&in_use->LOCK_thd_data); + if (in_use->killed < KILL_CONNECTION) + in_use->killed= KILL_CONNECTION; + if (in_use->mysys_var) + { + mysql_mutex_lock(&in_use->mysys_var->mutex); + if (in_use->mysys_var->current_cond) + mysql_cond_broadcast(in_use->mysys_var->current_cond); + + /* Abort if about to wait in thr_upgrade_write_delay_lock */ + in_use->mysys_var->abort= 1; + mysql_mutex_unlock(&in_use->mysys_var->mutex); + } + mysql_mutex_unlock(&in_use->LOCK_thd_data); signalled= TRUE; } if (needs_thr_lock_abort) { mysql_mutex_lock(&in_use->LOCK_thd_data); - for (TABLE *thd_table= in_use->open_tables; - thd_table ; - thd_table= thd_table->next) + /* If not already dying */ + if (in_use->killed != KILL_CONNECTION_HARD) { - /* - Check for TABLE::needs_reopen() is needed since in some places we call - handler::close() for table instance (and set TABLE::db_stat to 0) - and do not remove such instances from the THD::open_tables - for some time, during which other thread can see those instances - (e.g. see partitioning code). - */ - if (!thd_table->needs_reopen()) + for (TABLE *thd_table= in_use->open_tables; + thd_table ; + thd_table= thd_table->next) { - signalled|= mysql_lock_abort_for_thread(this, thd_table); - if (this && WSREP(this) && wsrep_thd_is_BF(this, FALSE)) + /* + Check for TABLE::needs_reopen() is needed since in some + places we call handler::close() for table instance (and set + TABLE::db_stat to 0) and do not remove such instances from + the THD::open_tables for some time, during which other + thread can see those instances (e.g. see partitioning code). + */ + if (!thd_table->needs_reopen()) { - WSREP_DEBUG("remove_table_from_cache: %llu", - (unsigned long long) this->real_id); - wsrep_abort_thd((void *)this, (void *)in_use, FALSE); + signalled|= mysql_lock_abort_for_thread(this, thd_table); + if (this && WSREP(this) && wsrep_thd_is_BF(this, FALSE)) + { + WSREP_DEBUG("remove_table_from_cache: %llu", + (unsigned long long) this->real_id); + wsrep_abort_thd((void *)this, (void *)in_use, FALSE); + } } } } mysql_mutex_unlock(&in_use->LOCK_thd_data); } - return signalled; + DBUG_RETURN(signalled); } @@ -2089,7 +2162,16 @@ bool THD::store_globals() Let mysqld define the thread id (not mysys) This allows us to move THD to different threads if needed. */ - mysys_var->id= thread_id; + mysys_var->id= thread_id; + + /* thread_dbug_id should not change for a THD */ + if (!thread_dbug_id) + thread_dbug_id= mysys_var->dbug_id; + else + { + /* This only changes if we are using pool-of-threads */ + mysys_var->dbug_id= thread_dbug_id; + } #ifdef __NR_gettid os_thread_id= (uint32)syscall(__NR_gettid); #else @@ -2100,14 +2182,13 @@ bool THD::store_globals() STACK_DIRECTION * (long)my_thread_stack_size; if (net.vio) { - vio_set_thread_id(net.vio, real_id); net.thd= this; } /* We have to call thr_lock_info_init() again here as THD may have been created in another thread */ - thr_lock_info_init(&lock_info); + thr_lock_info_init(&lock_info, mysys_var); return 0; } @@ -2251,12 +2332,19 @@ bool THD::convert_string(LEX_STRING *to, CHARSET_INFO *to_cs, { DBUG_ENTER("THD::convert_string"); size_t new_length= to_cs->mbmaxlen * from_length; - uint dummy_errors; + uint errors; if (alloc_lex_string(to, new_length + 1)) DBUG_RETURN(true); // EOM to->length= copy_and_convert((char*) to->str, new_length, to_cs, - from, from_length, from_cs, &dummy_errors); + from, from_length, from_cs, &errors); to->str[to->length]= 0; // Safety + if (errors && lex->parse_vcol_expr) + { + my_error(ER_BAD_DATA, MYF(0), + ErrConvString(from, from_length, from_cs).ptr(), + to_cs->csname); + DBUG_RETURN(true); + } DBUG_RETURN(false); } @@ -4259,7 +4347,8 @@ void THD::restore_backup_open_tables_state(Open_tables_backup *backup) Before we will throw away current open tables state we want to be sure that it was properly cleaned up. */ - DBUG_ASSERT(open_tables == 0 && temporary_tables == 0 && + DBUG_ASSERT(open_tables == 0 && + temporary_tables == 0 && derived_tables == 0 && lock == 0 && locked_tables_mode == LTM_NONE && @@ -5467,94 +5556,6 @@ int xid_cache_iterate(THD *thd, my_hash_walk_action action, void *arg) &argument); } -/* - Tells if two (or more) tables have auto_increment columns and we want to - lock those tables with a write lock. - - SYNOPSIS - has_two_write_locked_tables_with_auto_increment - tables Table list - - NOTES: - Call this function only when you have established the list of all tables - which you'll want to update (including stored functions, triggers, views - inside your statement). -*/ - -static bool -has_write_table_with_auto_increment(TABLE_LIST *tables) -{ - for (TABLE_LIST *table= tables; table; table= table->next_global) - { - /* we must do preliminary checks as table->table may be NULL */ - if (!table->placeholder() && - table->table->found_next_number_field && - (table->lock_type >= TL_WRITE_ALLOW_WRITE)) - return 1; - } - - return 0; -} - -/* - checks if we have select tables in the table list and write tables - with auto-increment column. - - SYNOPSIS - has_two_write_locked_tables_with_auto_increment_and_select - tables Table list - - RETURN VALUES - - -true if the table list has atleast one table with auto-increment column - - - and atleast one table to select from. - -false otherwise -*/ - -static bool -has_write_table_with_auto_increment_and_select(TABLE_LIST *tables) -{ - bool has_select= false; - bool has_auto_increment_tables = has_write_table_with_auto_increment(tables); - for(TABLE_LIST *table= tables; table; table= table->next_global) - { - if (!table->placeholder() && - (table->lock_type <= TL_READ_NO_INSERT)) - { - has_select= true; - break; - } - } - return(has_select && has_auto_increment_tables); -} - -/* - Tells if there is a table whose auto_increment column is a part - of a compound primary key while is not the first column in - the table definition. - - @param tables Table list - - @return true if the table exists, fais if does not. -*/ - -static bool -has_write_table_auto_increment_not_first_in_pk(TABLE_LIST *tables) -{ - for (TABLE_LIST *table= tables; table; table= table->next_global) - { - /* we must do preliminary checks as table->table may be NULL */ - if (!table->placeholder() && - table->table->found_next_number_field && - (table->lock_type >= TL_WRITE_ALLOW_WRITE) - && table->table->s->next_number_keypart != 0) - return 1; - } - - return 0; -} /** Decide on logging format to use for the statement and issue errors @@ -5685,17 +5686,25 @@ int THD::decide_logging_format(TABLE_LIST *tables) If different types of engines are about to be updated. For example: Innodb and Falcon; Innodb and MyIsam. */ - my_bool multi_write_engine= FALSE; + bool multi_write_engine= FALSE; /* If different types of engines are about to be accessed and any of them is about to be updated. For example: Innodb and Falcon; Innodb and MyIsam. */ - my_bool multi_access_engine= FALSE; + bool multi_access_engine= FALSE; /* Identifies if a table is changed. */ - my_bool is_write= FALSE; + bool is_write= FALSE; // If any write tables + bool has_read_tables= FALSE; // If any read only tables + bool has_auto_increment_write_tables= FALSE; // Write with auto-increment + /* If a write table that doesn't have auto increment part first */ + bool has_write_table_auto_increment_not_first_in_pk= FALSE; + bool has_auto_increment_write_tables_not_first= FALSE; + bool found_first_not_own_table= FALSE; + bool has_write_tables_with_unsafe_statements= FALSE; + /* A pointer to a previous table that was changed. */ @@ -5739,31 +5748,6 @@ int THD::decide_logging_format(TABLE_LIST *tables) } #endif - if (wsrep_binlog_format() != BINLOG_FORMAT_ROW && tables) - { - /* - DML statements that modify a table with an auto_increment column based on - rows selected from a table are unsafe as the order in which the rows are - fetched fron the select tables cannot be determined and may differ on - master and slave. - */ - if (has_write_table_with_auto_increment_and_select(tables)) - lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_WRITE_AUTOINC_SELECT); - - if (has_write_table_auto_increment_not_first_in_pk(tables)) - lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_AUTOINC_NOT_FIRST); - - /* - A query that modifies autoinc column in sub-statement can make the - master and slave inconsistent. - We can solve these problems in mixed mode by switching to binlogging - if at least one updated table is used by sub-statement - */ - if (lex->requires_prelocking() && - has_write_table_with_auto_increment(lex->first_not_own_table())) - lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_AUTOINC_COLUMNS); - } - /* Get the capabilities vector for all involved storage engines and mask out the flags for the binary log. @@ -5802,16 +5786,32 @@ int THD::decide_logging_format(TABLE_LIST *tables) continue; } } + if (table == lex->first_not_own_table()) + found_first_not_own_table= true; replicated_tables_count++; + if (table->lock_type <= TL_READ_NO_INSERT) + has_read_tables= true; + else if (table->table->found_next_number_field && + (table->lock_type >= TL_WRITE_ALLOW_WRITE)) + { + has_auto_increment_write_tables= true; + has_auto_increment_write_tables_not_first= found_first_not_own_table; + if (table->table->s->next_number_keypart != 0) + has_write_table_auto_increment_not_first_in_pk= true; + } + if (table->lock_type >= TL_WRITE_ALLOW_WRITE) { + bool trans; if (prev_write_table && prev_write_table->file->ht != table->table->file->ht) multi_write_engine= TRUE; + if (table->table->s->non_determinstic_insert) + has_write_tables_with_unsafe_statements= true; - my_bool trans= table->table->file->has_transactions(); + trans= table->table->file->has_transactions(); if (table->table->s->tmp_table) lex->set_stmt_accessed_table(trans ? LEX::STMT_WRITES_TEMP_TRANS_TABLE : @@ -5849,6 +5849,34 @@ int THD::decide_logging_format(TABLE_LIST *tables) prev_access_table= table->table; } + if (wsrep_binlog_format() != BINLOG_FORMAT_ROW) + { + /* + DML statements that modify a table with an auto_increment + column based on rows selected from a table are unsafe as the + order in which the rows are fetched fron the select tables + cannot be determined and may differ on master and slave. + */ + if (has_auto_increment_write_tables && has_read_tables) + lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_WRITE_AUTOINC_SELECT); + + if (has_write_table_auto_increment_not_first_in_pk) + lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_AUTOINC_NOT_FIRST); + + if (has_write_tables_with_unsafe_statements) + lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_SYSTEM_FUNCTION); + + /* + A query that modifies autoinc column in sub-statement can make the + master and slave inconsistent. + We can solve these problems in mixed mode by switching to binlogging + if at least one updated table is used by sub-statement + */ + if (lex->requires_prelocking() && + has_auto_increment_write_tables_not_first) + lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_AUTOINC_COLUMNS); + } + DBUG_PRINT("info", ("flags_write_all_set: 0x%llx", flags_write_all_set)); DBUG_PRINT("info", ("flags_write_some_set: 0x%llx", flags_write_some_set)); DBUG_PRINT("info", ("flags_access_some_set: 0x%llx", flags_access_some_set)); @@ -6922,24 +6950,6 @@ THD::signal_wakeup_ready() } -void THD::rgi_lock_temporary_tables() -{ - mysql_mutex_lock(&rgi_slave->rli->data_lock); - temporary_tables= rgi_slave->rli->save_temporary_tables; -} - -void THD::rgi_unlock_temporary_tables() -{ - rgi_slave->rli->save_temporary_tables= temporary_tables; - mysql_mutex_unlock(&rgi_slave->rli->data_lock); -} - -bool THD::rgi_have_temporary_tables() -{ - return rgi_slave->rli->save_temporary_tables != 0; -} - - void wait_for_commit::reinit() { diff --git a/sql/sql_class.h b/sql/sql_class.h index 99a5403ff04..3c5cc46656b 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2015, Oracle and/or its affiliates. + Copyright (c) 2000, 2016, Oracle and/or its affiliates. Copyright (c) 2009, 2016, MariaDB This program is free software; you can redistribute it and/or modify @@ -226,6 +226,7 @@ typedef struct st_copy_info { List *update_values; /* for VIEW ... WITH CHECK OPTION */ TABLE_LIST *view; + TABLE_LIST *table_list; /* Normal table */ } COPY_INFO; @@ -256,7 +257,7 @@ public: class Alter_drop :public Sql_alloc { public: - enum drop_type {KEY, COLUMN, FOREIGN_KEY }; + enum drop_type {KEY, COLUMN, FOREIGN_KEY, CHECK_CONSTRAINT }; const char *name; enum drop_type type; bool drop_if_exists; @@ -271,15 +272,21 @@ public: */ Alter_drop *clone(MEM_ROOT *mem_root) const { return new (mem_root) Alter_drop(*this); } + const char *type_name() + { + return type == COLUMN ? "COLUMN" : + type == CHECK_CONSTRAINT ? "CONSTRAINT" : + type == KEY ? "INDEX" : "FOREIGN KEY"; + } }; class Alter_column :public Sql_alloc { public: const char *name; - Item *def; - Alter_column(const char *par_name,Item *literal) - :name(par_name), def(literal) {} + Virtual_column_info *default_value; + Alter_column(const char *par_name, Virtual_column_info *expr) + :name(par_name), default_value(expr) {} /** Used to make a clone of this object for ALTER/CREATE TABLE @sa comment for Key_part_spec::clone @@ -818,8 +825,7 @@ typedef struct system_status_var Global status variables */ -extern ulong feature_files_opened_with_delayed_keys; - +extern ulong feature_files_opened_with_delayed_keys, feature_check_constraint; void add_to_status(STATUS_VAR *to_var, STATUS_VAR *from_var); @@ -1266,6 +1272,61 @@ enum enum_locked_tables_mode LTM_PRELOCKED_UNDER_LOCK_TABLES }; +/** + The following structure is an extension to TABLE_SHARE and is + exclusively for temporary tables. + + @note: + Although, TDC_element has data members (like next, prev & + all_tables) to store the list of TABLE_SHARE & TABLE objects + related to a particular TABLE_SHARE, they cannot be moved to + TABLE_SHARE in order to be reused for temporary tables. This + is because, as concurrent threads iterating through hash of + TDC_element's may need access to all_tables, but if all_tables + is made part of TABLE_SHARE, then TDC_element->share->all_tables + is not always guaranteed to be valid, as TDC_element can live + longer than TABLE_SHARE. +*/ +struct TMP_TABLE_SHARE : public TABLE_SHARE +{ +private: + /* + Link to all temporary table shares. Declared as private to + avoid direct manipulation with those objects. One should + use methods of I_P_List template instead. + */ + TMP_TABLE_SHARE *tmp_next; + TMP_TABLE_SHARE **tmp_prev; + + friend struct All_tmp_table_shares; + +public: + /* + Doubly-linked (back-linked) lists of used and unused TABLE objects + for this share. + */ + All_share_tables_list all_tmp_tables; +}; + +/** + Helper class which specifies which members of TMP_TABLE_SHARE are + used for participation in the list of temporary tables. +*/ + +struct All_tmp_table_shares +{ + static inline TMP_TABLE_SHARE **next_ptr(TMP_TABLE_SHARE *l) + { + return &l->tmp_next; + } + static inline TMP_TABLE_SHARE ***prev_ptr(TMP_TABLE_SHARE *l) + { + return &l->tmp_prev; + } +}; + +/* Also used in rpl_rli.h. */ +typedef I_P_List All_tmp_tables_list; /** Class that holds information about tables which were opened and locked @@ -1295,15 +1356,20 @@ public: base tables that were opened with @see open_tables(). */ TABLE *open_tables; + /** - List of temporary tables used by this thread. Contains user-level - temporary tables, created with CREATE TEMPORARY TABLE, and - internal temporary tables, created, e.g., to resolve a SELECT, + A list of temporary tables used by this thread. This includes + user-level temporary tables, created with CREATE TEMPORARY TABLE, + and internal temporary tables, created, e.g., to resolve a SELECT, or for an intermediate table used in ALTER. - XXX Why are internal temporary tables added to this list? */ - TABLE *temporary_tables; + All_tmp_tables_list *temporary_tables; + + /* + Derived tables. + */ TABLE *derived_tables; + /* During a MySQL session, one can lock tables in two modes: automatic or manual. In automatic mode all necessary tables are locked just before @@ -1381,8 +1447,11 @@ public: void reset_open_tables_state(THD *thd) { - open_tables= temporary_tables= derived_tables= 0; - extra_lock= lock= 0; + open_tables= 0; + temporary_tables= 0; + derived_tables= 0; + extra_lock= 0; + lock= 0; locked_tables_mode= LTM_NONE; state_flags= 0U; m_reprepare_observer= NULL; @@ -1432,7 +1501,7 @@ public: ha_rows cuted_fields, sent_row_count, examined_row_count; ulonglong client_capabilities; ulong query_plan_flags; - uint in_sub_stmt; + uint in_sub_stmt; /* 0, SUB_STMT_TRIGGER or SUB_STMT_FUNCTION */ bool enable_slow_log; bool last_insert_id_used; SAVEPOINT *savepoints; @@ -1908,6 +1977,19 @@ private: inline bool is_conventional() const { DBUG_ASSERT(0); return Statement::is_conventional(); } + void dec_thread_count(void) + { + DBUG_ASSERT(thread_count > 0); + thread_safe_decrement32(const_cast(&thread_count)); + signal_thd_deleted(); + } + + + void inc_thread_count(void) + { + thread_safe_increment32(const_cast(&thread_count)); + } + public: MDL_context mdl_context; @@ -2205,6 +2287,18 @@ public: current_stmt_binlog_format == BINLOG_FORMAT_ROW); return current_stmt_binlog_format == BINLOG_FORMAT_ROW; } + /** + Determine if binlogging is disabled for this session + @retval 0 if the current statement binlogging is disabled + (could be because of binlog closed/binlog option + is set to false). + @retval 1 if the current statement will be binlogged + */ + inline bool is_current_stmt_binlog_disabled() const + { + return (!(variables.option_bits & OPTION_BIN_LOG) || + !mysql_bin_log.is_open()); + } enum binlog_filter_state { @@ -2654,7 +2748,7 @@ public: ulong query_plan_flags; ulong query_plan_fsort_passes; pthread_t real_id; /* For debugging */ - my_thread_id thread_id; + my_thread_id thread_id, thread_dbug_id; uint32 os_thread_id; uint tmp_table, global_disable_checkpoint; uint server_status,open_options; @@ -2766,7 +2860,7 @@ public: /* for IS NULL => = last_insert_id() fix in remove_eq_conds() */ bool substitute_null_with_insert_id; bool in_lock_tables; - bool bootstrap, cleanup_done; + bool bootstrap, cleanup_done, free_connection_done; /** is set if some thread specific value(s) used in a statement. */ bool thread_specific_used; @@ -2908,7 +3002,7 @@ public: /* Debug Sync facility. See debug_sync.cc. */ struct st_debug_sync_control *debug_sync_control; #endif /* defined(ENABLED_DEBUG_SYNC) */ - THD(bool is_wsrep_applier= false); + THD(my_thread_id id, bool is_wsrep_applier= false); ~THD(); @@ -2928,6 +3022,8 @@ public: void change_user(void); void cleanup(void); void cleanup_after_query(); + void free_connection(); + void reset_for_reuse(); bool store_globals(); void reset_globals(); #ifdef SIGNAL_WITH_VIO_CLOSE @@ -2935,7 +3031,6 @@ public: { mysql_mutex_lock(&LOCK_thd_data); active_vio = vio; - vio_set_thread_id(vio, pthread_self()); mysql_mutex_unlock(&LOCK_thd_data); } inline void clear_active_vio() @@ -3100,6 +3195,12 @@ public: } ulonglong current_utime() { return microsecond_interval_timer(); } + /* Tell SHOW PROCESSLIST to show time from this point */ + inline void set_time_for_next_stage() + { + utime_after_query= current_utime(); + } + /** Update server status after execution of a top level statement. Currently only checks if a query was slow, and assigns @@ -3109,7 +3210,7 @@ public: */ void update_server_status() { - utime_after_query= current_utime(); + set_time_for_next_stage(); if (utime_after_query > utime_after_lock + variables.long_query_time) server_status|= SERVER_QUERY_WAS_SLOW; } @@ -3341,6 +3442,22 @@ public: inline CHARSET_INFO *charset() { return variables.character_set_client; } void update_charset(); + void update_charset(CHARSET_INFO *character_set_client, + CHARSET_INFO *collation_connection) + { + variables.character_set_client= character_set_client; + variables.collation_connection= collation_connection; + update_charset(); + } + void update_charset(CHARSET_INFO *character_set_client, + CHARSET_INFO *collation_connection, + CHARSET_INFO *character_set_results) + { + variables.character_set_client= character_set_client; + variables.collation_connection= collation_connection; + variables.character_set_results= character_set_results; + update_charset(); + } inline Query_arena *activate_stmt_arena_if_needed(Query_arena *backup) { @@ -3532,13 +3649,13 @@ public: */ DBUG_PRINT("debug", ("temporary_tables: %s, in_sub_stmt: %s, system_thread: %s", - YESNO(temporary_tables), YESNO(in_sub_stmt), + YESNO(has_thd_temporary_tables()), YESNO(in_sub_stmt), show_system_thread(system_thread))); if (in_sub_stmt == 0) { if (wsrep_binlog_format() == BINLOG_FORMAT_ROW) set_current_stmt_binlog_format_row(); - else if (temporary_tables == NULL) + else if (!has_thd_temporary_tables()) set_current_stmt_binlog_format_stmt(); } DBUG_VOID_RETURN; @@ -3938,10 +4055,6 @@ private: LEX_STRING invoker_user; LEX_STRING invoker_host; - /* Protect against add/delete of temporary tables in parallel replication */ - void rgi_lock_temporary_tables(); - void rgi_unlock_temporary_tables(); - bool rgi_have_temporary_tables(); public: /* Flag, mutex and condition for a thread to wait for a signal from another @@ -3959,26 +4072,88 @@ public: */ rpl_gtid last_commit_gtid; - inline void lock_temporary_tables() - { - if (rgi_slave) - rgi_lock_temporary_tables(); - } - inline void unlock_temporary_tables() - { - if (rgi_slave) - rgi_unlock_temporary_tables(); - } - inline bool have_temporary_tables() - { - return (temporary_tables || - (rgi_slave && rgi_have_temporary_tables())); - } - LF_PINS *tdc_hash_pins; LF_PINS *xid_hash_pins; bool fix_xid_hash_pins(); +/* Members related to temporary tables. */ +public: + bool has_thd_temporary_tables(); + + TABLE *create_and_open_tmp_table(handlerton *hton, + LEX_CUSTRING *frm, + const char *path, + const char *db, + const char *table_name, + bool open_in_engine); + + TABLE *find_temporary_table(const char *db, const char *table_name); + TABLE *find_temporary_table(const TABLE_LIST *tl); + + TMP_TABLE_SHARE *find_tmp_table_share_w_base_key(const char *key, + uint key_length); + TMP_TABLE_SHARE *find_tmp_table_share(const char *db, + const char *table_name); + TMP_TABLE_SHARE *find_tmp_table_share(const TABLE_LIST *tl); + TMP_TABLE_SHARE *find_tmp_table_share(const char *key, uint key_length); + + bool open_temporary_table(TABLE_LIST *tl); + bool open_temporary_tables(TABLE_LIST *tl); + + bool close_temporary_tables(); + bool rename_temporary_table(TABLE *table, const char *db, + const char *table_name); + bool drop_temporary_table(TABLE *table, bool *is_trans, bool delete_table); + bool rm_temporary_table(handlerton *hton, const char *path); + void mark_tmp_tables_as_free_for_reuse(); + void mark_tmp_table_as_free_for_reuse(TABLE *table); + + TMP_TABLE_SHARE* save_tmp_table_share(TABLE *table); + void restore_tmp_table_share(TMP_TABLE_SHARE *share); + +private: + /* Whether a lock has been acquired? */ + bool m_tmp_tables_locked; + + /* Opened table states. */ + enum Temporary_table_state { + TMP_TABLE_IN_USE, + TMP_TABLE_NOT_IN_USE, + TMP_TABLE_ANY + }; + + bool has_temporary_tables(); + uint create_tmp_table_def_key(char *key, const char *db, + const char *table_name); + TMP_TABLE_SHARE *create_temporary_table(handlerton *hton, LEX_CUSTRING *frm, + const char *path, const char *db, + const char *table_name); + TABLE *find_temporary_table(const char *key, uint key_length, + Temporary_table_state state); + TABLE *open_temporary_table(TMP_TABLE_SHARE *share, const char *alias, + bool open_in_engine); + bool find_and_use_tmp_table(const TABLE_LIST *tl, TABLE **out_table); + bool use_temporary_table(TABLE *table, TABLE **out_table); + void close_temporary_table(TABLE *table); + bool log_events_and_free_tmp_shares(); + void free_tmp_table_share(TMP_TABLE_SHARE *share, bool delete_table); + void free_temporary_table(TABLE *table); + bool lock_temporary_tables(); + void unlock_temporary_tables(); + + inline uint tmpkeyval(TMP_TABLE_SHARE *share) + { + return uint4korr(share->table_cache_key.str + + share->table_cache_key.length - 4); + } + + inline TMP_TABLE_SHARE *tmp_table_share(TABLE *table) + { + DBUG_ASSERT(table->s->tmp_table); + return static_cast(table->s); + } + +public: inline ulong wsrep_binlog_format() const { return WSREP_FORMAT(variables.binlog_format); @@ -4085,12 +4260,12 @@ inline void add_to_active_threads(THD *thd) /* This should be called when you want to delete a thd that was not running any queries. - This function will assert if the THD was not linked. + This function will assert that the THD is linked. */ inline void unlink_not_visible_thd(THD *thd) { - thd->assert_if_linked(); + thd->assert_linked(); mysql_mutex_lock(&LOCK_thread_count); thd->unlink(); mysql_mutex_unlock(&LOCK_thread_count); @@ -4488,6 +4663,7 @@ class select_create: public select_insert { /* m_lock or thd->extra_lock */ MYSQL_LOCK **m_plock; bool exit_done; + TMP_TABLE_SHARE *saved_tmp_table_share; public: select_create(THD *thd_arg, TABLE_LIST *table_arg, @@ -4495,12 +4671,14 @@ public: Alter_info *alter_info_arg, List &select_fields,enum_duplicates duplic, bool ignore, TABLE_LIST *select_tables_arg): - select_insert(thd_arg, NULL, NULL, &select_fields, 0, 0, duplic, ignore), + select_insert(thd_arg, table_arg, NULL, &select_fields, 0, 0, duplic, + ignore), create_table(table_arg), create_info(create_info_par), select_tables(select_tables_arg), alter_info(alter_info_arg), - m_plock(NULL), exit_done(0) + m_plock(NULL), exit_done(0), + saved_tmp_table_share(0) {} int prepare(List &list, SELECT_LEX_UNIT *u); diff --git a/sql/sql_connect.cc b/sql/sql_connect.cc index 66564bd5e94..fe6a101f999 100644 --- a/sql/sql_connect.cc +++ b/sql/sql_connect.cc @@ -799,12 +799,9 @@ bool thd_init_client_charset(THD *thd, uint cs_number) if (!opt_character_set_client_handshake || !(cs= get_charset(cs_number, MYF(0)))) { - thd->variables.character_set_client= - global_system_variables.character_set_client; - thd->variables.collation_connection= - global_system_variables.collation_connection; - thd->variables.character_set_results= - global_system_variables.character_set_results; + thd->update_charset(global_system_variables.character_set_client, + global_system_variables.collation_connection, + global_system_variables.character_set_results); } else { @@ -814,10 +811,8 @@ bool thd_init_client_charset(THD *thd, uint cs_number) my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), "character_set_client", cs->csname); return true; - } - thd->variables.character_set_results= - thd->variables.collation_connection= - thd->variables.character_set_client= cs; + } + thd->update_charset(cs,cs,cs); } return false; } @@ -1170,7 +1165,8 @@ void end_connection(THD *thd) } if (!thd->killed && (net->error && net->vio != 0)) - thd->print_aborted_warning(1, ER_THD(thd, ER_UNKNOWN_ERROR)); + thd->print_aborted_warning(1, thd->get_stmt_da()->is_error() + ? thd->get_stmt_da()->message() : ER_THD(thd, ER_UNKNOWN_ERROR)); } @@ -1299,7 +1295,7 @@ void do_handle_one_connection(CONNECT *connect) ulonglong thr_create_utime= microsecond_interval_timer(); THD *thd; if (connect->scheduler->init_new_connection_thread() || - !(thd= connect->create_thd())) + !(thd= connect->create_thd(NULL))) { scheduler_functions *scheduler= connect->scheduler; connect->close_with_error(0, 0, ER_OUT_OF_RESOURCES); @@ -1403,14 +1399,7 @@ void CONNECT::close_and_delete() if (vio) vio_close(vio); if (thread_count_incremented) - { - /* - Normally this is handled by THD::unlink. As we haven't yet created - a THD and put it in the thread list, we have to manage counting here. - */ - dec_thread_count(); dec_connection_count(scheduler); - } statistic_increment(connection_errors_internal, &LOCK_status); statistic_increment(aborted_connects,&LOCK_status); @@ -1426,7 +1415,7 @@ void CONNECT::close_and_delete() void CONNECT::close_with_error(uint sql_errno, const char *message, uint close_error) { - THD *thd= create_thd(); + THD *thd= create_thd(NULL); if (thd) { if (sql_errno) @@ -1434,23 +1423,8 @@ void CONNECT::close_with_error(uint sql_errno, close_connection(thd, close_error); delete thd; set_current_thd(0); - if (thread_count_incremented) - { - dec_thread_count(); - dec_connection_count(scheduler); - } - delete this; - statistic_increment(connection_errors_internal, &LOCK_status); - statistic_increment(aborted_connects,&LOCK_status); - } - else - { - /* - Out of memory; We can't generate an error, just close the connection - close_and_delete() will increment statistics. - */ - close_and_delete(); } + close_and_delete(); } @@ -1460,17 +1434,28 @@ CONNECT::~CONNECT() vio_delete(vio); } -/* Create a THD based on a CONNECT object */ -THD *CONNECT::create_thd() +/* Reuse or create a THD based on a CONNECT object */ + +THD *CONNECT::create_thd(THD *thd) { - my_bool res; - THD *thd; + bool res, thd_reused= thd != 0; DBUG_ENTER("create_thd"); DBUG_EXECUTE_IF("simulate_failed_connection_2", DBUG_RETURN(0); ); - if (!(thd= new THD)) + if (thd) + { + /* reuse old thd */ + thd->reset_for_reuse(); + /* + reset tread_id's, but not thread_dbug_id's as the later isn't allowed + to change as there is already structures in thd marked with the old + value. + */ + thd->thread_id= thd->variables.pseudo_thread_id= thread_id; + } + else if (!(thd= new THD(thread_id))) DBUG_RETURN(0); set_current_thd(thd); @@ -1479,7 +1464,8 @@ THD *CONNECT::create_thd() if (res) { - delete thd; + if (!thd_reused) + delete thd; set_current_thd(0); DBUG_RETURN(0); } @@ -1489,7 +1475,6 @@ THD *CONNECT::create_thd() thd->security_ctx->host= host; thd->extra_port= extra_port; thd->scheduler= scheduler; - thd->thread_id= thd->variables.pseudo_thread_id= thread_id; thd->real_id= real_id; DBUG_RETURN(thd); } diff --git a/sql/sql_connect.h b/sql/sql_connect.h index 22a12e845c7..9cd31814ad7 100644 --- a/sql/sql_connect.h +++ b/sql/sql_connect.h @@ -52,7 +52,7 @@ public: void close_and_delete(); void close_with_error(uint sql_errno, const char *message, uint close_error); - THD *create_thd(); + THD *create_thd(THD *thd); }; diff --git a/sql/sql_const.h b/sql/sql_const.h index 31ee4603dc9..c8e60305eab 100644 --- a/sql/sql_const.h +++ b/sql/sql_const.h @@ -101,6 +101,8 @@ #define DISK_BUFFER_SIZE (uint) (IO_SIZE*16) /* Size of diskbuffer */ #define FRM_VER_TRUE_VARCHAR (FRM_VER+4) /* 10 */ +#define FRM_VER_EXPRESSSIONS (FRM_VER+5) /* 11 */ +#define FRM_VER_CURRENT FRM_VER_EXPRESSSIONS /*************************************************************************** Configuration parameters diff --git a/sql/sql_cte.h b/sql/sql_cte.h index 94fad561b0d..89223170261 100644 --- a/sql/sql_cte.h +++ b/sql/sql_cte.h @@ -66,7 +66,7 @@ private: LEX_STRING unparsed_spec; /* Return the map where 1 is set only in the position for this element */ - table_map get_elem_map() { return 1 << number; } + table_map get_elem_map() { return (table_map) 1 << number; } public: /* diff --git a/sql/sql_db.cc b/sql/sql_db.cc index 2ba67cb1b00..1a0ee03ec34 100644 --- a/sql/sql_db.cc +++ b/sql/sql_db.cc @@ -1,6 +1,6 @@ /* Copyright (c) 2000, 2014, Oracle and/or its affiliates. - Copyright (c) 2009, 2015, MariaDB + Copyright (c) 2009, 2016, MariaDB Corporation This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -886,7 +886,8 @@ mysql_rm_db_internal(THD *thd,char *db, bool if_exists, bool silent) { LEX_STRING db_name= { table->db, table->db_length }; LEX_STRING table_name= { table->table_name, table->table_name_length }; - if (table->open_type == OT_BASE_ONLY || !find_temporary_table(thd, table)) + if (table->open_type == OT_BASE_ONLY || + !thd->find_temporary_table(table)) (void) delete_statistics_for_table(thd, &db_name, &table_name); } } @@ -1777,7 +1778,7 @@ bool mysql_upgrade_db(THD *thd, LEX_STRING *old_db) create trigger trg1 before insert on t2 for each row set @a:=1 rename database d1 to d2; - TODO: Triggers, having the renamed database explicitely written + TODO: Triggers, having the renamed database explicitly written in the table qualifiers. 1. when the same database is renamed: create trigger d1.trg1 before insert on d1.t1 for each row set @a:=1; diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc index 6297cc6eb84..04a84accccf 100644 --- a/sql/sql_derived.cc +++ b/sql/sql_derived.cc @@ -568,7 +568,11 @@ bool mysql_derived_init(THD *thd, LEX *lex, TABLE_LIST *derived) if (!unit || unit->prepared) DBUG_RETURN(FALSE); - DBUG_RETURN(derived->init_derived(thd, TRUE)); + bool res= derived->init_derived(thd, TRUE); + + derived->updatable= derived->updatable && derived->is_view(); + + DBUG_RETURN(res); } diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc index e8ade81062b..95417c73c74 100644 --- a/sql/sql_handler.cc +++ b/sql/sql_handler.cc @@ -1,5 +1,5 @@ /* Copyright (c) 2001, 2015, Oracle and/or its affiliates. - Copyright (c) 2011, 2015, MariaDB + Copyright (c) 2011, 2016, MariaDB Corporation This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -178,9 +178,8 @@ static void mysql_ha_close_table(SQL_HANDLER *handler) { /* Must be a temporary table */ table->file->ha_index_or_rnd_end(); - table->query_id= thd->query_id; table->open_by_handler= 0; - mark_tmp_table_for_reuse(table); + thd->mark_tmp_table_as_free_for_reuse(table); } my_free(handler->lock); handler->init(); @@ -294,7 +293,7 @@ bool mysql_ha_open(THD *thd, TABLE_LIST *tables, SQL_HANDLER *reopen) open_ltable() or open_table() because we would like to be able to open a temporary table. */ - error= (open_temporary_tables(thd, tables) || + error= (thd->open_temporary_tables(tables) || open_tables(thd, &tables, &counter, 0)); if (error) @@ -389,8 +388,7 @@ bool mysql_ha_open(THD *thd, TABLE_LIST *tables, SQL_HANDLER *reopen) /* Assert that the above check prevents opening of views and merge tables. For temporary tables, TABLE::next can be set even if only one table - was opened for HANDLER as it is used to link them together - (see thd->temporary_tables). + was opened for HANDLER as it is used to link them together. */ DBUG_ASSERT(sql_handler->table->next == NULL || sql_handler->table->s->tmp_table); @@ -1195,10 +1193,10 @@ void mysql_ha_set_explicit_lock_duration(THD *thd) Remove temporary tables from the HANDLER's hash table. The reason for having a separate function, rather than calling mysql_ha_rm_tables() is that it is not always feasible (e.g. in - close_temporary_tables) to obtain a TABLE_LIST containing the + THD::close_temporary_tables) to obtain a TABLE_LIST containing the temporary tables. - @See close_temporary_tables + @See THD::close_temporary_tables() @param thd Thread identifier. */ void mysql_ha_rm_temporary_tables(THD *thd) diff --git a/sql/sql_help.cc b/sql/sql_help.cc index a50b90fc111..1ddddaf1b40 100644 --- a/sql/sql_help.cc +++ b/sql/sql_help.cc @@ -672,7 +672,7 @@ SQL_SELECT *prepare_select_for_name(THD *thd, const char *mask, uint mlen, TRUE Error and send_error already commited */ -bool mysqld_help(THD *thd, const char *mask) +static bool mysqld_help_internal(THD *thd, const char *mask) { Protocol *protocol= thd->protocol; SQL_SELECT *select; @@ -854,3 +854,12 @@ error2: DBUG_RETURN(TRUE); } + +bool mysqld_help(THD *thd, const char *mask) +{ + ulonglong sql_mode_backup= thd->variables.sql_mode; + thd->variables.sql_mode&= ~MODE_PAD_CHAR_TO_FULL_LENGTH; + bool rc= mysqld_help_internal(thd, mask); + thd->variables.sql_mode= sql_mode_backup; + return rc; +} diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 65af14b62f6..13943ce8d3c 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -1,6 +1,6 @@ /* - Copyright (c) 2000, 2015, Oracle and/or its affiliates. - Copyright (c) 2010, 2015, MariaDB + Copyright (c) 2000, 2016, Oracle and/or its affiliates. + Copyright (c) 2010, 2016, MariaDB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -282,12 +282,7 @@ static int check_insert_fields(THD *thd, TABLE_LIST *table_list, my_error(ER_FIELD_SPECIFIED_TWICE, MYF(0), thd->dup_field->field_name); DBUG_RETURN(-1); } - if (table->default_field) - table->mark_default_fields_for_write(); } - /* Mark virtual columns used in the insert statement */ - if (table->vfield) - table->mark_virtual_columns_for_write(TRUE); // For the values we need select_priv #ifndef NO_EMBEDDED_ACCESS_CHECKS table->grant.want_privilege= (SELECT_ACL & ~table->grant.privilege); @@ -359,7 +354,7 @@ static int check_update_fields(THD *thd, TABLE_LIST *insert_table_list, return -1; if (table->default_field) - table->mark_default_fields_for_write(); + table->mark_default_fields_for_write(FALSE); if (table->found_next_number_field) { @@ -801,6 +796,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list, info.update_fields= &update_fields; info.update_values= &update_values; info.view= (table_list->view ? table_list : 0); + info.table_list= table_list; /* Count warnings for all inserts. @@ -864,15 +860,14 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list, thd->abort_on_warning= !ignore && thd->is_strict_mode(); + table->reset_default_fields(); table->prepare_triggers_for_insert_stmt_or_event(); table->mark_columns_needed_for_insert(); - if (table_list->prepare_where(thd, 0, TRUE) || table_list->prepare_check_option(thd)) error= 1; - table->reset_default_fields(); switch_to_nullable_trigger_fields(fields, table); switch_to_nullable_trigger_fields(update_fields, table); switch_to_nullable_trigger_fields(update_values, table); @@ -901,6 +896,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list, INSERT INTO t1 VALUES () */ restore_record(table,s->default_values); // Get empty record + table->reset_default_fields(); if (fill_record_n_invoke_before_triggers(thd, table, fields, *values, 0, TRG_EVENT_INSERT)) { @@ -961,11 +957,6 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list, break; } } - if (table->default_field && table->update_default_fields()) - { - error= 1; - break; - } if ((res= table_list->view_check_option(thd, (values_list.elements == 1 ? @@ -1504,18 +1495,8 @@ bool mysql_prepare_insert(THD *thd, TABLE_LIST *table_list, if (!table) table= table_list->table; - - if (!fields.elements && table->vfield) - { - for (Field **vfield_ptr= table->vfield; *vfield_ptr; vfield_ptr++) - { - if ((*vfield_ptr)->vcol_info->stored_in_db) - { - thd->lex->unit.insert_table_with_stored_vcol= table; - break; - } - } - } + if (table->s->virtual_stored_fields) + thd->lex->unit.insert_table_with_stored_vcol= table; if (!select_insert) { @@ -1626,9 +1607,10 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info) else table->file->insert_id_for_cur_row= insert_id_for_cur_row; bool is_duplicate_key_error; - if (table->file->is_fatal_error(error, HA_CHECK_DUP)) + if (table->file->is_fatal_error(error, HA_CHECK_ALL)) goto err; - is_duplicate_key_error= table->file->is_fatal_error(error, 0); + is_duplicate_key_error= + table->file->is_fatal_error(error, HA_CHECK_ALL & ~HA_CHECK_DUP); if (!is_duplicate_key_error) { /* @@ -1702,16 +1684,17 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info) DBUG_ASSERT(table->insert_values != NULL); store_record(table,insert_values); restore_record(table,record[1]); + table->reset_default_fields(); /* in INSERT ... ON DUPLICATE KEY UPDATE the set of modified fields can change per row. Thus, we have to do reset_default_fields() per row. Twice (before insert and before update). */ - table->reset_default_fields(); DBUG_ASSERT(info->update_fields->elements == info->update_values->elements); - if (fill_record_n_invoke_before_triggers(thd, table, *info->update_fields, + if (fill_record_n_invoke_before_triggers(thd, table, + *info->update_fields, *info->update_values, info->ignore, TRG_EVENT_UPDATE)) @@ -1728,20 +1711,13 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info) */ if (different_records && table->default_field) { - bool res; - enum_sql_command cmd= thd->lex->sql_command; - thd->lex->sql_command= SQLCOM_UPDATE; - res= table->update_default_fields(); - thd->lex->sql_command= cmd; - if (res) + if (table->update_default_fields(1, info->ignore)) goto err; } - table->reset_default_fields(); /* CHECK OPTION for VIEW ... ON DUPLICATE KEY UPDATE ... */ - if (info->view && - (res= info->view->view_check_option(current_thd, info->ignore)) == - VIEW_CHECK_SKIP) + res= info->table_list->view_check_option(table->in_use, info->ignore); + if (res == VIEW_CHECK_SKIP) goto ok_or_after_trg_err; if (res == VIEW_CHECK_ERROR) goto before_trg_err; @@ -1755,7 +1731,7 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info) error != HA_ERR_RECORD_IS_THE_SAME) { if (info->ignore && - !table->file->is_fatal_error(error, HA_CHECK_DUP_KEY)) + !table->file->is_fatal_error(error, HA_CHECK_ALL)) { if (!(thd->variables.old_behavior & OLD_MODE_NO_DUP_KEY_WARNINGS_WITH_IGNORE)) @@ -1885,7 +1861,7 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info) { DEBUG_SYNC(thd, "write_row_noreplace"); if (!info->ignore || - table->file->is_fatal_error(error, HA_CHECK_DUP)) + table->file->is_fatal_error(error, HA_CHECK_ALL)) goto err; if (!(thd->variables.old_behavior & OLD_MODE_NO_DUP_KEY_WARNINGS_WITH_IGNORE)) @@ -2015,7 +1991,7 @@ public: TABLE *table; mysql_mutex_t mutex; mysql_cond_t cond, cond_client; - volatile uint tables_in_use,stacked_inserts; + uint tables_in_use, stacked_inserts; volatile bool status; bool retry; /** @@ -2041,7 +2017,8 @@ public: MDL_request grl_protection; Delayed_insert(SELECT_LEX *current_select) - :locks_in_memory(0), table(0),tables_in_use(0),stacked_inserts(0), + :locks_in_memory(0), thd(next_thread_id()), + table(0),tables_in_use(0), stacked_inserts(0), status(0), retry(0), handler_thread_initialized(FALSE), group_count(0) { DBUG_ENTER("Delayed_insert constructor"); @@ -2072,7 +2049,6 @@ public: delayed_lock= global_system_variables.low_priority_updates ? TL_WRITE_LOW_PRIORITY : TL_WRITE; mysql_mutex_unlock(&LOCK_thread_count); - thread_safe_increment32(&thread_count); DBUG_VOID_RETURN; } ~Delayed_insert() @@ -2103,7 +2079,6 @@ public: my_free(thd.query()); thd.security_ctx->user= 0; thd.security_ctx->host= 0; - dec_thread_count(); } /* The following is for checking when we can delete ourselves */ @@ -2362,11 +2337,12 @@ TABLE *Delayed_insert::get_local_table(THD* client_thd) { my_ptrdiff_t adjust_ptrs; Field **field,**org_field, *found_next_number_field; - Field **UNINIT_VAR(vfield), **UNINIT_VAR(dfield_ptr); + Field **vfield= 0, **dfield_ptr= 0; TABLE *copy; TABLE_SHARE *share; uchar *bitmap; char *copy_tmp; + uint bitmaps_used; DBUG_ENTER("Delayed_insert::get_local_table"); /* First request insert thread to get a lock */ @@ -2420,13 +2396,14 @@ TABLE *Delayed_insert::get_local_table(THD* client_thd) copy_tmp= (char*) client_thd->alloc(sizeof(*copy)+ (share->fields+1)*sizeof(Field**)+ share->reclength + - share->column_bitmap_size*3); + share->column_bitmap_size*4); if (!copy_tmp) goto error; - if (share->vfields) + if (share->virtual_fields) { - vfield= (Field **) client_thd->alloc((share->vfields+1)*sizeof(Field*)); + vfield= (Field **) client_thd->alloc((share->virtual_fields+1)* + sizeof(Field*)); if (!vfield) goto error; } @@ -2434,16 +2411,19 @@ TABLE *Delayed_insert::get_local_table(THD* client_thd) /* Copy the TABLE object. */ copy= new (copy_tmp) TABLE; *copy= *table; + /* We don't need to change the file handler here */ /* Assign the pointers for the field pointers array and the record. */ field= copy->field= (Field**) (copy + 1); bitmap= (uchar*) (field + share->fields + 1); - copy->record[0]= (bitmap + share->column_bitmap_size*3); + copy->record[0]= (bitmap + share->column_bitmap_size*4); memcpy((char*) copy->record[0], (char*) table->record[0], share->reclength); - if (share->default_fields) + if (share->default_fields || share->default_expressions) { - copy->default_field= (Field**) client_thd->alloc((share->default_fields+1)* - sizeof(Field**)); + copy->default_field= (Field**) + client_thd->alloc((share->default_fields + + share->default_expressions + 1)* + sizeof(Field*)); if (!copy->default_field) goto error; dfield_ptr= copy->default_field; @@ -2466,48 +2446,60 @@ TABLE *Delayed_insert::get_local_table(THD* client_thd) if (!(*field= (*org_field)->make_new_field(client_thd->mem_root, copy, 1))) goto error; + (*field)->unireg_check= (*org_field)->unireg_check; (*field)->orig_table= copy; // Remove connection (*field)->move_field_offset(adjust_ptrs); // Point at copy->record[0] if (*org_field == found_next_number_field) (*field)->table->found_next_number_field= *field; - if (share->default_fields && - ((*org_field)->has_insert_default_function() || - (*org_field)->has_update_default_function())) - { - /* Put the newly copied field into the set of default fields. */ - *dfield_ptr= *field; - (*dfield_ptr)->unireg_check= (*org_field)->unireg_check; - dfield_ptr++; - } } *field=0; - if (share->vfields) + if (share->virtual_fields || share->default_expressions || + share->default_fields) { + bool error_reported= FALSE; if (!(copy->def_vcol_set= (MY_BITMAP*) alloc_root(client_thd->mem_root, sizeof(MY_BITMAP)))) goto error; copy->vfield= vfield; for (field= copy->field; *field; field++) { + Virtual_column_info *vcol; if ((*field)->vcol_info) { - bool error_reported= FALSE; - if (unpack_vcol_info_from_frm(client_thd, - client_thd->mem_root, - copy, - *field, - &(*field)->vcol_info->expr_str, - &error_reported)) + if (!(vcol= unpack_vcol_info_from_frm(client_thd, + client_thd->mem_root, + copy, + 0, + (*field)->vcol_info, + &error_reported))) goto error; + (*field)->vcol_info= vcol; *vfield++= *field; } + if ((*field)->default_value) + { + if (!(vcol= unpack_vcol_info_from_frm(client_thd, + client_thd->mem_root, + copy, + 0, + (*field)->default_value, + &error_reported))) + goto error; + (*field)->default_value= vcol; + *dfield_ptr++= *field; + } + else + if ((*field)->has_update_default_function()) + *dfield_ptr++= *field; } - *vfield= 0; + if (vfield) + *vfield= 0; + if (dfield_ptr) + *dfield_ptr= 0; } - if (share->default_fields) - *dfield_ptr= NULL; + switch_defaults_to_nullable_trigger_fields(copy); /* Adjust in_use for pointing to client thread */ copy->in_use= client_thd; @@ -2519,15 +2511,28 @@ TABLE *Delayed_insert::get_local_table(THD* client_thd) copy->def_read_set.bitmap= (my_bitmap_map*) bitmap; copy->def_write_set.bitmap= ((my_bitmap_map*) (bitmap + share->column_bitmap_size)); - if (share->vfields) + bitmaps_used= 2; + if (share->virtual_fields) { my_bitmap_init(copy->def_vcol_set, - (my_bitmap_map*) (bitmap + 2*share->column_bitmap_size), + (my_bitmap_map*) (bitmap + + bitmaps_used*share->column_bitmap_size), share->fields, FALSE); + bitmaps_used++; copy->vcol_set= copy->def_vcol_set; } + if (share->default_fields) + { + if (!(copy->has_value_set= (MY_BITMAP*) alloc_root(client_thd->mem_root, + sizeof(MY_BITMAP)))) + goto error; + my_bitmap_init(copy->has_value_set, + (my_bitmap_map*) (bitmap + + bitmaps_used*share->column_bitmap_size), + share->fields, FALSE); + } copy->tmp_set.bitmap= 0; // To catch errors - bzero((char*) bitmap, share->column_bitmap_size * (share->vfields ? 3 : 2)); + bzero((char*) bitmap, share->column_bitmap_size * bitmaps_used); copy->read_set= ©->def_read_set; copy->write_set= ©->def_write_set; @@ -2672,14 +2677,16 @@ static void end_delayed_insert(THD *thd) void kill_delayed_threads(void) { + DBUG_ENTER("kill_delayed_threads"); mysql_mutex_lock(&LOCK_delayed_insert); // For unlink from list I_List_iterator it(delayed_threads); Delayed_insert *di; while ((di= it++)) { - di->thd.killed= KILL_CONNECTION; mysql_mutex_lock(&di->thd.LOCK_thd_data); + if (di->thd.killed < KILL_CONNECTION) + di->thd.killed= KILL_CONNECTION; if (di->thd.mysys_var) { mysql_mutex_lock(&di->thd.mysys_var->mutex); @@ -2700,6 +2707,7 @@ void kill_delayed_threads(void) mysql_mutex_unlock(&di->thd.LOCK_thd_data); } mysql_mutex_unlock(&LOCK_delayed_insert); // For unlink from list + DBUG_VOID_RETURN; } @@ -2794,11 +2802,11 @@ bool Delayed_insert::open_and_lock_table() return TRUE; } - if (table->triggers) + if (table->triggers || table->check_constraints) { /* - Table has triggers. This is not an error, but we do - not support triggers with delayed insert. Terminate the delayed + Table has triggers or check constraints. This is not an error, but we do + not support these with delayed insert. Terminate the delayed thread without an error and thus request lock upgrade. */ return TRUE; @@ -2819,7 +2827,6 @@ pthread_handler_t handle_delayed_insert(void *arg) pthread_detach_this_thread(); /* Add thread to THD list so that's it's visible in 'show processlist' */ - thd->thread_id= thd->variables.pseudo_thread_id= next_thread_id(); thd->set_current_time(); add_to_active_threads(thd); if (abort_loop) @@ -2902,6 +2909,12 @@ pthread_handler_t handle_delayed_insert(void *arg) /* Tell client that the thread is initialized */ mysql_cond_signal(&di->cond_client); + /* + Inform mdl that it needs to call mysql_lock_abort to abort locks + for delayed insert. + */ + thd->mdl_context.set_needs_thr_lock_abort(TRUE); + di->table->mark_columns_needed_for_insert(); /* Now wait until we get an insert or lock to handle */ @@ -2912,6 +2925,7 @@ pthread_handler_t handle_delayed_insert(void *arg) if (thd->killed) { uint lock_count; + DBUG_PRINT("delayed", ("Insert delayed killed")); /* Remove this from delay insert list so that no one can request a table from this @@ -2922,11 +2936,15 @@ pthread_handler_t handle_delayed_insert(void *arg) lock_count=di->lock_count(); mysql_mutex_unlock(&LOCK_delayed_insert); mysql_mutex_lock(&di->mutex); - if (!lock_count && !di->tables_in_use && !di->stacked_inserts) + if (!lock_count && !di->tables_in_use && !di->stacked_inserts && + !thd->lock) break; // Time to die } /* Shouldn't wait if killed or an insert is waiting. */ + DBUG_PRINT("delayed", + ("thd->killed: %d di->status: %d di->stacked_inserts: %d", + thd->killed, di->status, di->stacked_inserts)); if (!thd->killed && !di->status && !di->stacked_inserts) { struct timespec abstime; @@ -2966,6 +2984,9 @@ pthread_handler_t handle_delayed_insert(void *arg) mysql_mutex_unlock(&di->thd.mysys_var->mutex); mysql_mutex_lock(&di->mutex); } + DBUG_PRINT("delayed", + ("thd->killed: %d di->tables_in_use: %d thd->lock: %d", + thd->killed, di->tables_in_use, thd->lock != 0)); if (di->tables_in_use && ! thd->lock && !thd->killed) { @@ -3026,9 +3047,19 @@ pthread_handler_t handle_delayed_insert(void *arg) { DBUG_ENTER("handle_delayed_insert-cleanup"); di->table=0; - thd->killed= KILL_CONNECTION; // If error mysql_mutex_unlock(&di->mutex); + /* + Protect against mdl_locks trying to access open tables + We use KILL_CONNECTION_HARD here to ensure that + THD::notify_shared_lock() dosn't try to access open tables after + this. + */ + mysql_mutex_lock(&thd->LOCK_thd_data); + thd->killed= KILL_CONNECTION_HARD; // If error + thd->mdl_context.set_needs_thr_lock_abort(0); + mysql_mutex_unlock(&thd->LOCK_thd_data); + close_thread_tables(thd); // Free the table thd->mdl_context.release_transactional_locks(); mysql_cond_broadcast(&di->cond_client); // Safety @@ -3427,8 +3458,8 @@ select_insert::select_insert(THD *thd_arg, TABLE_LIST *table_list_par, info.ignore= ignore_check_option_errors; info.update_fields= update_fields; info.update_values= update_values; - if (table_list_par) - info.view= (table_list_par->view ? table_list_par : 0); + info.view= (table_list_par->view ? table_list_par : 0); + info.table_list= table_list_par; } @@ -3659,7 +3690,7 @@ int select_insert::send_data(List &values) thd->count_cuted_fields= CHECK_FIELD_WARN; // Calculate cuted fields store_values(values); - if (table->default_field && table->update_default_fields()) + if (table->default_field && table->update_default_fields(0, info.ignore)) DBUG_RETURN(1); thd->count_cuted_fields= CHECK_FIELD_ERROR_FOR_NULL; if (thd->is_error()) @@ -3903,10 +3934,10 @@ void select_insert::abort_result_set() { CREATE TABLE (SELECT) ... ***************************************************************************/ -Field *Item::create_field_for_create_select(THD *thd, TABLE *table) +Field *Item::create_field_for_create_select(TABLE *table) { Field *def_field, *tmp_field; - return ::create_tmp_field(thd, table, this, type(), + return ::create_tmp_field(table->in_use, table, this, type(), (Item ***) 0, &tmp_field, &def_field, 0, 0, 0, 0); } @@ -3981,7 +4012,7 @@ static TABLE *create_table_from_items(THD *thd, while ((item=it++)) { - Field *tmp_field= item->create_field_for_create_select(thd, &tmp_table); + Field *tmp_field= item->create_field_for_create_select(&tmp_table); if (!tmp_field) DBUG_RETURN(NULL); @@ -4080,7 +4111,12 @@ static TABLE *create_table_from_items(THD *thd, } else { - if (open_temporary_table(thd, create_table)) + /* + The pointer to the newly created temporary table has been stored in + table->create_info. + */ + create_table->table= create_info->table; + if (!create_table->table) { /* This shouldn't happen as creation of temporary table should make @@ -4089,7 +4125,6 @@ static TABLE *create_table_from_items(THD *thd, */ DBUG_ASSERT(0); } - DBUG_ASSERT(create_table->table == create_info->table); } } else @@ -4224,6 +4259,18 @@ select_create::prepare(List &values, SELECT_LEX_UNIT *u) /* abort() deletes table */ DBUG_RETURN(-1); + if (create_info->tmp_table()) + { + /* + When the temporary table was created & opened in create_table_impl(), + the table's TABLE_SHARE (and thus TABLE) object was also linked to THD + temporary tables lists. So, we must temporarily remove it from the + list to keep them inaccessible from inner statements. + e.g. CREATE TEMPORARY TABLE `t1` AS SELECT * FROM `t1`; + */ + saved_tmp_table_share= thd->save_tmp_table_share(create_table->table); + } + if (extra_lock) { DBUG_ASSERT(m_plock == NULL); @@ -4339,6 +4386,27 @@ bool select_create::send_eof() DBUG_RETURN(true); } + if (table->s->tmp_table) + { + /* + Now is good time to add the new table to THD temporary tables list. + But, before that we need to check if same table got created by the sub- + statement. + */ + if (thd->find_tmp_table_share(table->s->table_cache_key.str, + table->s->table_cache_key.length)) + { + my_error(ER_TABLE_EXISTS_ERROR, MYF(0), table->alias.c_ptr()); + abort_result_set(); + DBUG_RETURN(true); + } + else + { + DBUG_ASSERT(saved_tmp_table_share); + thd->restore_tmp_table_share(saved_tmp_table_share); + } + } + /* Do an implicit commit at end of statement for non-temporary tables. This can fail, but we should unlock the table @@ -4463,6 +4531,13 @@ void select_create::abort_result_set() if (table) { bool tmp_table= table->s->tmp_table; + + if (tmp_table) + { + DBUG_ASSERT(saved_tmp_table_share); + thd->restore_tmp_table_share(saved_tmp_table_share); + } + table->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY); table->file->extra(HA_EXTRA_WRITE_CANNOT_REPLACE); table->auto_increment_field_not_null= FALSE; diff --git a/sql/sql_join_cache.cc b/sql/sql_join_cache.cc index 818598110ca..d5883b1304e 100644 --- a/sql/sql_join_cache.cc +++ b/sql/sql_join_cache.cc @@ -281,8 +281,7 @@ void JOIN_CACHE::collect_info_on_key_args() Item *ref_item= ref->items[i]; if (!(tab->table->map & ref_item->used_tables())) continue; - ref_item->walk(&Item::add_field_to_set_processor, 1, - (uchar *) tab->table); + ref_item->walk(&Item::add_field_to_set_processor, 1, tab->table); } if ((key_args= bitmap_bits_set(&tab->table->tmp_set))) { diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index d0fa273b0b0..08b619668fb 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -232,7 +232,6 @@ void st_parsing_options::reset() { allows_variable= TRUE; - allows_derived= TRUE; } @@ -1245,11 +1244,11 @@ int MYSQLlex(YYSTYPE *yylval, THD *thd) lip->lookahead_token= -1; *yylval= *(lip->lookahead_yylval); lip->lookahead_yylval= NULL; - lip->add_digest_token(token, yylval); return token; } token= lex_one_token(yylval, thd); + lip->add_digest_token(token, yylval); switch(token) { case WITH: @@ -1261,12 +1260,11 @@ int MYSQLlex(YYSTYPE *yylval, THD *thd) which sql_yacc.yy can process. */ token= lex_one_token(yylval, thd); + lip->add_digest_token(token, yylval); switch(token) { case CUBE_SYM: - lip->add_digest_token(WITH_CUBE_SYM, yylval); return WITH_CUBE_SYM; case ROLLUP_SYM: - lip->add_digest_token(WITH_ROLLUP_SYM, yylval); return WITH_ROLLUP_SYM; default: /* @@ -1275,15 +1273,12 @@ int MYSQLlex(YYSTYPE *yylval, THD *thd) lip->lookahead_yylval= lip->yylval; lip->yylval= NULL; lip->lookahead_token= token; - lip->add_digest_token(WITH, yylval); return WITH; } break; default: break; } - - lip->add_digest_token(token, yylval); return token; } @@ -1696,32 +1691,35 @@ static int lex_one_token(YYSTYPE *yylval, THD *thd) return (BIN_NUM); case MY_LEX_CMP_OP: // Incomplete comparison operator + lip->next_state= MY_LEX_START; // Allow signed numbers if (state_map[(uchar) lip->yyPeek()] == MY_LEX_CMP_OP || state_map[(uchar) lip->yyPeek()] == MY_LEX_LONG_CMP_OP) - lip->yySkip(); - if ((tokval = find_keyword(lip, lip->yyLength() + 1, 0))) { - lip->next_state= MY_LEX_START; // Allow signed numbers - return(tokval); + lip->yySkip(); + if ((tokval= find_keyword(lip, 2, 0))) + return(tokval); + lip->yyUnget(); } - state = MY_LEX_CHAR; // Something fishy found - break; + return(c); case MY_LEX_LONG_CMP_OP: // Incomplete comparison operator + lip->next_state= MY_LEX_START; if (state_map[(uchar) lip->yyPeek()] == MY_LEX_CMP_OP || state_map[(uchar) lip->yyPeek()] == MY_LEX_LONG_CMP_OP) { lip->yySkip(); if (state_map[(uchar) lip->yyPeek()] == MY_LEX_CMP_OP) + { lip->yySkip(); + if ((tokval= find_keyword(lip, 3, 0))) + return(tokval); + lip->yyUnget(); + } + if ((tokval= find_keyword(lip, 2, 0))) + return(tokval); + lip->yyUnget(); } - if ((tokval = find_keyword(lip, lip->yyLength() + 1, 0))) - { - lip->next_state= MY_LEX_START; // Found long op - return(tokval); - } - state = MY_LEX_CHAR; // Something fishy found - break; + return(c); case MY_LEX_BOOL: if (c != lip->yyPeek()) @@ -2953,7 +2951,7 @@ bool LEX::can_be_merged() tmp_unit= tmp_unit->next_unit()) { if (tmp_unit->first_select()->parent_lex == this && - (tmp_unit->item == 0 || + (tmp_unit->item != 0 && (tmp_unit->item->place() != IN_WHERE && tmp_unit->item->place() != IN_ON && tmp_unit->item->place() != SELECT_LIST))) diff --git a/sql/sql_lex.h b/sql/sql_lex.h index e8402abf861..128b57438f0 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -1830,7 +1830,6 @@ private: struct st_parsing_options { bool allows_variable; - bool allows_derived; st_parsing_options() { reset(); } void reset(); @@ -2091,10 +2090,9 @@ public: return m_tok_start; } - /** Get the token start position, in the pre-processed buffer. */ - const char *get_cpp_tok_start() + void set_cpp_tok_start(const char *pos) { - return m_cpp_tok_start; + m_cpp_tok_start= pos; } /** Get the token end position, in the raw buffer. */ @@ -2103,12 +2101,6 @@ public: return m_tok_end; } - /** Get the token end position, in the pre-processed buffer. */ - const char *get_cpp_tok_end() - { - return m_cpp_tok_end; - } - /** Get the previous token start position, in the raw buffer. */ const char *get_tok_start_prev() { @@ -2121,12 +2113,6 @@ public: return m_ptr; } - /** Get the current stream pointer, in the pre-processed buffer. */ - const char *get_cpp_ptr() - { - return m_cpp_ptr; - } - /** Get the length of the current token, in the raw buffer. */ uint yyLength() { @@ -2138,6 +2124,30 @@ public: return (uint) ((m_ptr - m_tok_start) - 1); } + /** Get the previus token start position, in the pre-processed buffer. */ + const char *get_cpp_start_prev() + { + return m_cpp_tok_start_prev; + } + + /** Get the token start position, in the pre-processed buffer. */ + const char *get_cpp_tok_start() + { + return m_cpp_tok_start; + } + + /** Get the token end position, in the pre-processed buffer. */ + const char *get_cpp_tok_end() + { + return m_cpp_tok_end; + } + + /** Get the current stream pointer, in the pre-processed buffer. */ + const char *get_cpp_ptr() + { + return m_cpp_ptr; + } + /** Get the utf8-body string. */ const char *get_body_utf8_str() { @@ -2987,6 +2997,13 @@ public: alter_info.key_list.push_back(last_key); return false; } + // Add a constraint as a part of CREATE TABLE or ALTER TABLE + bool add_constraint(LEX_STRING *name, Virtual_column_info *constr) + { + constr->name= *name; + alter_info.check_constraint_list.push_back(constr); + return false; + } void set_command(enum_sql_command command, DDL_options_st options) { diff --git a/sql/sql_list.h b/sql/sql_list.h index 94e97e55aa7..8f6f7337f1c 100644 --- a/sql/sql_list.h +++ b/sql/sql_list.h @@ -660,7 +660,7 @@ struct ilink if (next) next->prev=prev; prev=0 ; next=0; } - inline void assert_if_linked() + inline void assert_linked() { DBUG_ASSERT(prev != 0 && next != 0); } diff --git a/sql/sql_load.cc b/sql/sql_load.cc index a4044dd0d59..b1167534491 100644 --- a/sql/sql_load.cc +++ b/sql/sql_load.cc @@ -1,6 +1,6 @@ /* - Copyright (c) 2000, 2015, Oracle and/or its affiliates. - Copyright (c) 2010, 2015, MariaDB + Copyright (c) 2000, 2016, Oracle and/or its affiliates. + Copyright (c) 2010, 2016, MariaDB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -348,6 +348,7 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list, { DBUG_RETURN(TRUE); } + thd_proc_info(thd, "executing"); /* Let us emit an error if we are loading data to table which is used in subselect in SET clause like we do it for INSERT. @@ -399,9 +400,6 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list, set_fields, MARK_COLUMNS_WRITE, 0, 0) || check_that_all_fields_are_given_values(thd, table, table_list)) DBUG_RETURN(TRUE); - /* Add all fields with default functions to table->write_set. */ - if (table->default_field) - table->mark_default_fields_for_write(); /* Fix the expressions in SET clause */ if (setup_fields(thd, Ref_ptr_array(), set_values, MARK_COLUMNS_READ, 0, 0)) DBUG_RETURN(TRUE); @@ -412,18 +410,8 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list, table->prepare_triggers_for_insert_stmt_or_event(); table->mark_columns_needed_for_insert(); - - if (table->vfield) - { - for (Field **vfield_ptr= table->vfield; *vfield_ptr; vfield_ptr++) - { - if ((*vfield_ptr)->vcol_info->stored_in_db) - { - thd->lex->unit.insert_table_with_stored_vcol= table; - break; - } - } - } + if (table->s->virtual_stored_fields) + thd->lex->unit.insert_table_with_stored_vcol= table; uint tot_length=0; bool use_blobs= 0, use_vars= 0; @@ -989,8 +977,7 @@ read_fixed_length(THD *thd, COPY_INFO &info, TABLE_LIST *table_list, if (thd->killed || fill_record_n_invoke_before_triggers(thd, table, set_fields, set_values, ignore_check_option_errors, - TRG_EVENT_INSERT) || - (table->default_field && table->update_default_fields())) + TRG_EVENT_INSERT)) DBUG_RETURN(1); switch (table_list->view_check_option(thd, ignore_check_option_errors)) { @@ -1211,10 +1198,10 @@ read_sep_field(THD *thd, COPY_INFO &info, TABLE_LIST *table_list, } if (thd->killed || - fill_record_n_invoke_before_triggers(thd, table, set_fields, set_values, + fill_record_n_invoke_before_triggers(thd, table, set_fields, + set_values, ignore_check_option_errors, - TRG_EVENT_INSERT) || - (table->default_field && table->update_default_fields())) + TRG_EVENT_INSERT)) DBUG_RETURN(1); switch (table_list->view_check_option(thd, @@ -1393,8 +1380,7 @@ read_xml_field(THD *thd, COPY_INFO &info, TABLE_LIST *table_list, if (thd->killed || fill_record_n_invoke_before_triggers(thd, table, set_fields, set_values, ignore_check_option_errors, - TRG_EVENT_INSERT) || - (table->default_field && table->update_default_fields())) + TRG_EVENT_INSERT)) DBUG_RETURN(1); switch (table_list->view_check_option(thd, diff --git a/sql/sql_locale.cc b/sql/sql_locale.cc index 5ac069de98b..58443a9a977 100644 --- a/sql/sql_locale.cc +++ b/sql/sql_locale.cc @@ -427,7 +427,7 @@ MY_LOCALE my_locale_da_DK /***** LOCALE BEGIN de_AT: German - Austria *****/ static const char *my_locale_month_names_de_AT[13] = - {"Jänner","Feber","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember", NullS }; + {"Jänner","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember", NullS }; static const char *my_locale_ab_month_names_de_AT[13] = {"Jän","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez", NullS }; static const char *my_locale_day_names_de_AT[8] = diff --git a/sql/sql_locale.h b/sql/sql_locale.h index e231393eec6..ec2f3d29e15 100644 --- a/sql/sql_locale.h +++ b/sql/sql_locale.h @@ -61,6 +61,8 @@ public: grouping(grouping_par), errmsgs(errmsgs_par) {} + uint repertoire() const + { return is_ascii ? MY_REPERTOIRE_ASCII : MY_REPERTOIRE_EXTENDED; } }; /* Exported variables */ diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 7dc0ef42b71..c152984876e 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1,5 +1,5 @@ /* Copyright (c) 2000, 2015, Oracle and/or its affiliates. - Copyright (c) 2008, 2015, MariaDB + Copyright (c) 2008, 2016, MariaDB Corporation This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -23,7 +23,10 @@ // set_handler_table_locks, // lock_global_read_lock, // make_global_read_lock_block_commit -#include "sql_base.h" // find_temporary_table +#include "sql_base.h" // open_tables, open_and_lock_tables, + // lock_tables, unique_table, + // close_thread_tables, is_temporary_table + // table_cache.h #include "sql_cache.h" // QUERY_CACHE_FLAGS_SIZE, query_cache_* #include "sql_show.h" // mysqld_list_*, mysqld_show_*, // calc_sum_of_all_status @@ -389,9 +392,9 @@ const LEX_STRING command_name[257]={ { 0, 0 }, //248 { 0, 0 }, //249 { 0, 0 }, //250 - { 0, 0 }, //251 - { 0, 0 }, //252 - { 0, 0 }, //253 + { C_STRING_WITH_LEN("Slave_worker") }, //251 + { C_STRING_WITH_LEN("Slave_IO") }, //252 + { C_STRING_WITH_LEN("Slave_SQL") }, //253 { C_STRING_WITH_LEN("Com_multi") }, //254 { C_STRING_WITH_LEN("Error") } // Last command number 255 }; @@ -418,7 +421,7 @@ static bool some_non_temp_table_to_be_updated(THD *thd, TABLE_LIST *tables) for (TABLE_LIST *table= tables; table; table= table->next_global) { DBUG_ASSERT(table->db && table->table_name); - if (table->updating && !find_temporary_table(thd, table)) + if (table->updating && !thd->find_tmp_table_share(table)) return 1; } return 0; @@ -1076,16 +1079,11 @@ void do_handle_bootstrap(THD *thd) handle_bootstrap_impl(thd); end: + in_bootstrap= FALSE; delete thd; #ifndef EMBEDDED_LIBRARY - DBUG_ASSERT(thread_count == 1); - in_bootstrap= FALSE; - /* - dec_thread_count will signal bootstrap() function that we have ended as - thread_count will become 0. - */ - dec_thread_count(); + DBUG_ASSERT(thread_count == 0); my_thread_end(); pthread_exit(0); #endif @@ -1712,10 +1710,8 @@ bool dispatch_command(enum enum_server_command command, THD *thd, decrease_user_connections(thd->user_connect); thd->user_connect= save_user_connect; thd->reset_db(save_db, save_db_length); - thd->variables.character_set_client= save_character_set_client; - thd->variables.collation_connection= save_collation_connection; - thd->variables.character_set_results= save_character_set_results; - thd->update_charset(); + thd->update_charset(save_character_set_client, save_collation_connection, + save_character_set_results); thd->failed_com_change_user++; my_sleep(1000000); } @@ -1796,6 +1792,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd, while (!thd->killed && (parser_state.m_lip.found_semicolon != NULL) && ! thd->is_error()) { + thd->get_stmt_da()->set_skip_flush(); /* Multiple queries exist, execute them individually */ @@ -1972,7 +1969,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd, thd->set_query(fields, query_length); general_log_print(thd, command, "%s %s", table_list.table_name, fields); - if (open_temporary_tables(thd, &table_list)) + if (thd->open_temporary_tables(&table_list)) break; if (check_table_access(thd, SELECT_ACL, &table_list, @@ -3269,7 +3266,7 @@ mysql_execute_command(THD *thd) */ if (sql_command_flags[lex->sql_command] & CF_PREOPEN_TMP_TABLES) { - if (open_temporary_tables(thd, all_tables)) + if (thd->open_temporary_tables(all_tables)) goto error; } @@ -4071,7 +4068,7 @@ end_with_restore_list: Temporary tables should be opened for SHOW CREATE TABLE, but not for SHOW CREATE VIEW. */ - if (open_temporary_tables(thd, all_tables)) + if (thd->open_temporary_tables(all_tables)) goto error; /* @@ -4279,7 +4276,8 @@ end_with_restore_list: */ if (first_table->lock_type != TL_WRITE_DELAYED) { - if ((res= open_temporary_tables(thd, all_tables))) + res= (thd->open_temporary_tables(all_tables)) ? TRUE : FALSE; + if (res) break; } @@ -4591,7 +4589,7 @@ end_with_restore_list: { if (!lex->tmp_table() && (!thd->is_current_stmt_binlog_format_row() || - !find_temporary_table(thd, table))) + !thd->find_temporary_table(table))) { WSREP_TO_ISOLATION_BEGIN(NULL, NULL, all_tables); break; @@ -4744,7 +4742,7 @@ end_with_restore_list: CF_PREOPEN_TMP_TABLES was set and the tables would be pre-opened in a usual way, they would have been closed. */ - if (open_temporary_tables(thd, all_tables)) + if (thd->open_temporary_tables(all_tables)) goto error; if (lock_tables_precheck(thd, all_tables)) @@ -5338,27 +5336,21 @@ end_with_restore_list: #ifndef NO_EMBEDDED_ACCESS_CHECKS case SQLCOM_SHOW_CREATE_USER: - case SQLCOM_SHOW_GRANTS: { LEX_USER *grant_user= lex->grant_user; - Security_context *sctx= thd->security_ctx; if (!grant_user) goto error; - if (grant_user->user.str && !strcmp(sctx->priv_user, grant_user->user.str) && - grant_user->host.str && !strcmp(sctx->priv_host, grant_user->host.str)) - grant_user->user= current_user; + res = mysql_show_create_user(thd, grant_user); + break; + } + case SQLCOM_SHOW_GRANTS: + { + LEX_USER *grant_user= lex->grant_user; + if (!grant_user) + goto error; - if (grant_user->user.str == current_user.str || - grant_user->user.str == current_role.str || - grant_user->user.str == current_user_and_current_role.str || - !check_access(thd, SELECT_ACL, "mysql", NULL, NULL, 1, 0)) - { - if (lex->sql_command == SQLCOM_SHOW_GRANTS) - res = mysql_show_grants(thd, grant_user); - else - res = mysql_show_create_user(thd, grant_user); - } + res = mysql_show_grants(thd, grant_user); break; } #endif @@ -6785,7 +6777,7 @@ static bool check_show_access(THD *thd, TABLE_LIST *table) /* Open temporary tables to be able to detect them during privilege check. */ - if (open_temporary_tables(thd, dst_table)) + if (thd->open_temporary_tables(dst_table)) return TRUE; if (check_access(thd, SELECT_ACL, dst_table->db, @@ -7066,6 +7058,7 @@ bool check_global_access(THD *thd, ulong want_access, bool no_errors) temporary table flag) @param alter_info [in] Initial list of columns and indexes for the table to be created + @param create_db [in] Database of the created table @retval false ok. @@ -7074,7 +7067,8 @@ bool check_global_access(THD *thd, ulong want_access, bool no_errors) */ bool check_fk_parent_table_access(THD *thd, HA_CREATE_INFO *create_info, - Alter_info *alter_info) + Alter_info *alter_info, + const char* create_db) { Key *key; List_iterator key_iterator(alter_info->key_list); @@ -7114,10 +7108,28 @@ bool check_fk_parent_table_access(THD *thd, return true; } } - else if (thd->lex->copy_db_to(&db_name.str, &db_name.length)) - return true; else - is_qualified_table_name= false; + { + if (!thd->db) + { + db_name.str= (char *) thd->memdup(create_db, strlen(create_db)+1); + db_name.length= strlen(create_db); + is_qualified_table_name= true; + + if(create_db && check_db_name(&db_name)) + { + my_error(ER_WRONG_DB_NAME, MYF(0), db_name.str); + return true; + } + } + else + { + if (thd->lex->copy_db_to(&db_name.str, &db_name.length)) + return true; + else + is_qualified_table_name= false; + } + } // if lower_case_table_names is set then convert tablename to lower case. if (lower_case_table_names) @@ -9330,7 +9342,7 @@ bool create_table_precheck(THD *thd, TABLE_LIST *tables, goto err; } - if (check_fk_parent_table_access(thd, &lex->create_info, &lex->alter_info)) + if (check_fk_parent_table_access(thd, &lex->create_info, &lex->alter_info, create_table->db)) goto err; /* diff --git a/sql/sql_parse.h b/sql/sql_parse.h index aa8d0813870..ad29bb2cdd3 100644 --- a/sql/sql_parse.h +++ b/sql/sql_parse.h @@ -49,7 +49,8 @@ bool create_table_precheck(THD *thd, TABLE_LIST *tables, TABLE_LIST *create_table); bool check_fk_parent_table_access(THD *thd, HA_CREATE_INFO *create_info, - Alter_info *alter_info); + Alter_info *alter_info, + const char* create_db); bool parse_sql(THD *thd, Parser_state *parser_state, Object_creation_ctx *creation_ctx, bool do_pfs_digest=false); diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index 832f218fb51..b45f85528a6 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -104,46 +104,21 @@ static const char *end_paren_str= ")"; static const char *begin_paren_str= "("; static const char *comma_str= ","; -int get_partition_id_list_col(partition_info *part_info, - uint32 *part_id, - longlong *func_value); -int get_partition_id_list(partition_info *part_info, - uint32 *part_id, - longlong *func_value); -int get_partition_id_range_col(partition_info *part_info, - uint32 *part_id, - longlong *func_value); -int get_partition_id_range(partition_info *part_info, - uint32 *part_id, - longlong *func_value); -static int get_part_id_charset_func_part(partition_info *part_info, - uint32 *part_id, - longlong *func_value); -static int get_part_id_charset_func_subpart(partition_info *part_info, - uint32 *part_id); -int get_partition_id_hash_nosub(partition_info *part_info, - uint32 *part_id, - longlong *func_value); -int get_partition_id_key_nosub(partition_info *part_info, - uint32 *part_id, - longlong *func_value); -int get_partition_id_linear_hash_nosub(partition_info *part_info, - uint32 *part_id, - longlong *func_value); -int get_partition_id_linear_key_nosub(partition_info *part_info, - uint32 *part_id, - longlong *func_value); -int get_partition_id_with_sub(partition_info *part_info, - uint32 *part_id, - longlong *func_value); -int get_partition_id_hash_sub(partition_info *part_info, - uint32 *part_id); -int get_partition_id_key_sub(partition_info *part_info, - uint32 *part_id); -int get_partition_id_linear_hash_sub(partition_info *part_info, - uint32 *part_id); -int get_partition_id_linear_key_sub(partition_info *part_info, - uint32 *part_id); +static int get_partition_id_list_col(partition_info *, uint32 *, longlong *); +static int get_partition_id_list(partition_info *, uint32 *, longlong *); +static int get_partition_id_range_col(partition_info *, uint32 *, longlong *); +static int get_partition_id_range(partition_info *, uint32 *, longlong *); +static int get_part_id_charset_func_part(partition_info *, uint32 *, longlong *); +static int get_part_id_charset_func_subpart(partition_info *, uint32 *); +static int get_partition_id_hash_nosub(partition_info *, uint32 *, longlong *); +static int get_partition_id_key_nosub(partition_info *, uint32 *, longlong *); +static int get_partition_id_linear_hash_nosub(partition_info *, uint32 *, longlong *); +static int get_partition_id_linear_key_nosub(partition_info *, uint32 *, longlong *); +static int get_partition_id_with_sub(partition_info *, uint32 *, longlong *); +static int get_partition_id_hash_sub(partition_info *part_info, uint32 *part_id); +static int get_partition_id_key_sub(partition_info *part_info, uint32 *part_id); +static int get_partition_id_linear_hash_sub(partition_info *part_info, uint32 *part_id); +static int get_partition_id_linear_key_sub(partition_info *part_info, uint32 *part_id); static uint32 get_next_partition_via_walking(PARTITION_ITERATOR*); static void set_up_range_analysis_info(partition_info *part_info); static uint32 get_next_subpartition_via_walking(PARTITION_ITERATOR*); @@ -962,8 +937,7 @@ static bool fix_fields_part_func(THD *thd, Item* func_expr, TABLE *table, if (init_lex_with_single_table(thd, table, &lex)) goto end; - func_expr->walk(&Item::change_context_processor, 0, - (uchar*) &lex.select_lex.context); + func_expr->walk(&Item::change_context_processor, 0, &lex.select_lex.context); thd->where= "partition function"; /* In execution we must avoid the use of thd->change_item_tree since @@ -1018,8 +992,7 @@ static bool fix_fields_part_func(THD *thd, Item* func_expr, TABLE *table, easier maintenance. This exception should be deprecated at some point in future so that we always throw an error. */ - if (func_expr->walk(&Item::check_valid_arguments_processor, - 0, NULL)) + if (func_expr->walk(&Item::check_valid_arguments_processor, 0, NULL)) { if (is_create_table_ind) { @@ -1038,8 +1011,7 @@ static bool fix_fields_part_func(THD *thd, Item* func_expr, TABLE *table, end: end_lex_with_single_table(thd, table, old_lex); #if !defined(DBUG_OFF) - func_expr->walk(&Item::change_context_processor, 0, - (uchar*) 0); + func_expr->walk(&Item::change_context_processor, 0, 0); #endif DBUG_RETURN(result); } diff --git a/sql/sql_partition_admin.cc b/sql/sql_partition_admin.cc index 9e67a21e8f4..18f25ab7cf7 100644 --- a/sql/sql_partition_admin.cc +++ b/sql/sql_partition_admin.cc @@ -1,5 +1,6 @@ /* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. Copyright (c) 2014, SkySQL Ab. + Copyright (c) 2016, MariaDB Corporation This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -534,12 +535,9 @@ bool Sql_cmd_alter_table_exchange_partition:: #ifdef WITH_WSREP if (WSREP_ON) { - /* Forward declaration */ - TABLE *find_temporary_table(THD *thd, const TABLE_LIST *tl); - if ((!thd->is_current_stmt_binlog_format_row() || /* TODO: Do we really need to check for temp tables in this case? */ - !find_temporary_table(thd, table_list)) && + !thd->find_temporary_table(table_list)) && wsrep_to_isolation_begin(thd, table_list->db, table_list->table_name, NULL)) { @@ -783,11 +781,9 @@ bool Sql_cmd_alter_table_truncate_partition::execute(THD *thd) DBUG_RETURN(TRUE); #ifdef WITH_WSREP - /* Forward declaration */ - TABLE *find_temporary_table(THD *thd, const TABLE_LIST *tl); - - if (WSREP(thd) && (!thd->is_current_stmt_binlog_format_row() || - !find_temporary_table(thd, first_table)) && + if (WSREP(thd) && + (!thd->is_current_stmt_binlog_format_row() || + !thd->find_temporary_table(first_table)) && wsrep_to_isolation_begin( thd, first_table->db, first_table->table_name, NULL) ) diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index f540c268923..848358e517a 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -1769,7 +1769,7 @@ static void plugin_load(MEM_ROOT *tmp_root) TABLE *table; READ_RECORD read_record_info; int error; - THD *new_thd= new THD; + THD *new_thd= new THD(0); bool result; DBUG_ENTER("plugin_load"); diff --git a/sql/sql_plugin.h b/sql/sql_plugin.h index 2bfdcb29dfc..efa48b22ce8 100644 --- a/sql/sql_plugin.h +++ b/sql/sql_plugin.h @@ -152,7 +152,7 @@ typedef int (*plugin_type_init)(struct st_plugin_int *); extern I_List *opt_plugin_load_list_ptr; extern char *opt_plugin_dir_ptr; -extern char opt_plugin_dir[FN_REFLEN]; +extern MYSQL_PLUGIN_IMPORT char opt_plugin_dir[FN_REFLEN]; extern const LEX_STRING plugin_type_names[]; extern ulong plugin_maturity; extern TYPELIB plugin_maturity_values; diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index 0c7e26c7b04..e8a7dce5771 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -1,5 +1,5 @@ /* Copyright (c) 2002, 2015, Oracle and/or its affiliates. - Copyright (c) 2008, 2015, MariaDB + Copyright (c) 2008, 2016, MariaDB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1259,7 +1259,7 @@ static bool mysql_test_insert(Prepared_statement *stmt, */ if (table_list->lock_type != TL_WRITE_DELAYED) { - if (open_temporary_tables(thd, table_list)) + if (thd->open_temporary_tables(table_list)) goto error; } @@ -2028,7 +2028,7 @@ static bool mysql_test_create_view(Prepared_statement *stmt) Since we can't pre-open temporary tables for SQLCOM_CREATE_VIEW, (see mysql_create_view) we have to do it here instead. */ - if (open_temporary_tables(thd, tables)) + if (thd->open_temporary_tables(tables)) goto err; if (open_normal_and_derived_tables(thd, tables, MYSQL_OPEN_FORCE_SHARED_MDL, @@ -2280,7 +2280,7 @@ static bool check_prepared_statement(Prepared_statement *stmt) */ if (sql_command_flags[sql_command] & CF_PREOPEN_TMP_TABLES) { - if (open_temporary_tables(thd, tables)) + if (thd->open_temporary_tables(tables)) goto error; } diff --git a/sql/sql_priv.h b/sql/sql_priv.h index b15a80a889a..40349d3802a 100644 --- a/sql/sql_priv.h +++ b/sql/sql_priv.h @@ -126,7 +126,7 @@ #define TMP_TABLE_ALL_COLUMNS (1ULL << 12) // SELECT, intern #define OPTION_WARNINGS (1ULL << 13) // THD, user #define OPTION_AUTO_IS_NULL (1ULL << 14) // THD, user, binlog -#define OPTION_FOUND_COMMENT (1ULL << 15) // SELECT, intern, parser +#define OPTION_NO_CHECK_CONSTRAINT_CHECKS (1ULL << 14) #define OPTION_SAFE_UPDATES (1ULL << 16) // THD, user #define OPTION_BUFFER_RESULT (1ULL << 17) // SELECT, user #define OPTION_BIN_LOG (1ULL << 18) // THD, user @@ -183,6 +183,7 @@ #define OPTION_ALLOW_BATCH (1ULL << 36) // THD, intern (slave) #define OPTION_SKIP_REPLICATION (1ULL << 37) // THD, user #define OPTION_RPL_SKIP_PARALLEL (1ULL << 38) +#define OPTION_FOUND_COMMENT (1ULL << 39) // SELECT, intern, parser /* The rest of the file is included in the server only */ #ifndef MYSQL_CLIENT @@ -224,7 +225,7 @@ #define OPTIMIZER_SWITCH_TABLE_ELIMINATION (1ULL << 26) #define OPTIMIZER_SWITCH_EXTENDED_KEYS (1ULL << 27) #define OPTIMIZER_SWITCH_EXISTS_TO_IN (1ULL << 28) -#define OPTIMIZER_SWITCH_USE_CONDITION_SELECTIVITY (1ULL << 29) +#define OPTIMIZER_SWITCH_ORDERBY_EQ_PROP (1ULL << 29) #define OPTIMIZER_SWITCH_DEFAULT (OPTIMIZER_SWITCH_INDEX_MERGE | \ OPTIMIZER_SWITCH_INDEX_MERGE_UNION | \ diff --git a/sql/sql_profile.cc b/sql/sql_profile.cc index a169823e25e..f3b62991c5c 100644 --- a/sql/sql_profile.cc +++ b/sql/sql_profile.cc @@ -328,14 +328,28 @@ PROFILING::PROFILING() } PROFILING::~PROFILING() +{ + restart(); +} + +/* + Restart profiling from scratch +*/ + +void PROFILING::restart() { while (! history.is_empty()) delete history.pop(); if (current != NULL) delete current; + /* Ensure that profiling object can be reused */ + profile_id_counter= 1; + current= NULL; + last= NULL; } + /** Throw away the current profile, because it's useless or unwanted or corrupted. @@ -675,6 +689,6 @@ int PROFILING::fill_statistics_info(THD *thd_arg, TABLE_LIST *tables, Item *cond void PROFILING::reset() { - enabled= thd->variables.option_bits & OPTION_PROFILING; + enabled= (thd->variables.option_bits & OPTION_PROFILING) != 0; } #endif /* ENABLED_PROFILING */ diff --git a/sql/sql_profile.h b/sql/sql_profile.h index 1d770ca1147..38682f3ddec 100644 --- a/sql/sql_profile.h +++ b/sql/sql_profile.h @@ -324,6 +324,7 @@ public: /* ... from INFORMATION_SCHEMA.PROFILING ... */ int fill_statistics_info(THD *thd, TABLE_LIST *tables, Item *cond); void reset(); + void restart(); }; # endif /* ENABLED_PROFILING */ diff --git a/sql/sql_reload.cc b/sql/sql_reload.cc index 089f60a2dd8..2fef615831b 100644 --- a/sql/sql_reload.cc +++ b/sql/sql_reload.cc @@ -1,4 +1,5 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2016, Oracle and/or its affiliates. + Copyright (c) 2011, 2016, MariaDB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -72,7 +73,7 @@ bool reload_acl_and_cache(THD *thd, unsigned long long options, If reload_acl_and_cache() is called from SIGHUP handler we have to allocate temporary THD for execution of acl_reload()/grant_reload(). */ - if (!thd && (thd= (tmp_thd= new THD))) + if (!thd && (thd= (tmp_thd= new THD(0)))) { thd->thread_stack= (char*) &tmp_thd; thd->store_globals(); diff --git a/sql/sql_rename.cc b/sql/sql_rename.cc index 17b297f63bd..b312077898f 100644 --- a/sql/sql_rename.cc +++ b/sql/sql_rename.cc @@ -27,7 +27,6 @@ #include "sql_table.h" // build_table_filename #include "sql_view.h" // mysql_frm_type, mysql_rename_view #include "sql_trigger.h" -#include "lock.h" // MYSQL_OPEN_SKIP_TEMPORARY #include "sql_base.h" // tdc_remove_table, lock_table_names, #include "sql_handler.h" // mysql_ha_rm_tables #include "sql_statistics.h" diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index 36f0cd84cbf..6ece9b793c9 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -2116,12 +2116,6 @@ static int init_binlog_sender(binlog_send_info *info, info->error= ER_MASTER_FATAL_ERROR_READING_BINLOG; return 1; } - if (!server_id_supplied) - { - info->errmsg= "Misconfigured master - server id was not set"; - info->error= ER_MASTER_FATAL_ERROR_READING_BINLOG; - return 1; - } char search_file_name[FN_REFLEN]; const char *name=search_file_name; @@ -3072,12 +3066,6 @@ int start_slave(THD* thd , Master_info* mi, bool net_report) if (init_master_info(mi,master_info_file_tmp,relay_log_info_file_tmp, 0, thread_mask)) slave_errno=ER_MASTER_INFO; - else if (!server_id_supplied) - { - slave_errno= ER_BAD_SLAVE; net_report= 0; - my_message(slave_errno, "Misconfigured slave: server_id was not set; Fix in config file", - MYF(0)); - } else if (!*mi->host) { slave_errno= ER_BAD_SLAVE; net_report= 0; diff --git a/sql/sql_repl.h b/sql/sql_repl.h index e2000bbca73..4105bdddf4e 100644 --- a/sql/sql_repl.h +++ b/sql/sql_repl.h @@ -36,7 +36,6 @@ struct slave_connection_state; extern my_bool opt_show_slave_auth_info; extern char *master_host, *master_info_file; -extern bool server_id_supplied; extern int max_binlog_dump_events; extern my_bool opt_sporadic_binlog_dump_fail; diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 5885529d37d..e6bb6e03e43 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2015 Oracle and/or its affiliates. +/* Copyright (c) 2000, 2016 Oracle and/or its affiliates. Copyright (c) 2009, 2016 MariaDB This program is free software; you can redistribute it and/or modify @@ -462,8 +462,7 @@ fix_inner_refs(THD *thd, List &all_fields, SELECT_LEX *select, List_iterator_fast ref_it(select->inner_refs_list); for (ORDER *group= select->join->group_list; group; group= group->next) { - (*group->item)->walk(&Item::check_inner_refs_processor, - TRUE, (uchar *) &ref_it); + (*group->item)->walk(&Item::check_inner_refs_processor, TRUE, &ref_it); } while ((ref= ref_it++)) @@ -1170,7 +1169,7 @@ JOIN::optimize_inner() conversion happened (which done in the same way. */ if (select_lex->first_cond_optimization && - conds && conds->walk(&Item::exists2in_processor, 0, (uchar *)thd)) + conds && conds->walk(&Item::exists2in_processor, 0, thd)) DBUG_RETURN(1); /* TODO @@ -1178,7 +1177,7 @@ JOIN::optimize_inner() for (TABLE_LIST *tbl= tables_list; tbl; tbl= tbl->next_local) { if (tbl->on_expr && - tbl->on_expr->walk(&Item::exists2in_processor, 0, (uchar *)thd)) + tbl->on_expr->walk(&Item::exists2in_processor, 0, thd)) DBUG_RETURN(1); } */ @@ -2036,7 +2035,7 @@ JOIN::optimize_inner() } } } - else if (order && // ORDER BY wo/ preceeding GROUP BY + else if (order && // ORDER BY wo/ preceding GROUP BY (simple_order || skip_sort_order)) // which is possibly skippable { if (test_if_skip_sort_order(tab, order, select_limit, false, @@ -5398,8 +5397,7 @@ void count_cond_for_nj(SELECT_LEX *sel, TABLE_LIST *nested_join_table) count_cond_for_nj(sel, table); } if (nested_join_table->on_expr) - nested_join_table->on_expr->walk(&Item::count_sargable_conds, - 0, (uchar*) sel); + nested_join_table->on_expr->walk(&Item::count_sargable_conds, 0, sel); } @@ -5440,12 +5438,11 @@ update_ref_and_keys(THD *thd, DYNAMIC_ARRAY *keyuse,JOIN_TAB *join_tab, sel->cond_count= 0; sel->between_count= 0; if (cond) - cond->walk(&Item::count_sargable_conds, 0, (uchar*) sel); + cond->walk(&Item::count_sargable_conds, 0, sel); for (i=0 ; i < tables ; i++) { if (*join_tab[i].on_expr_ref) - (*join_tab[i].on_expr_ref)->walk(&Item::count_sargable_conds, - 0, (uchar*) sel); + (*join_tab[i].on_expr_ref)->walk(&Item::count_sargable_conds, 0, sel); } { List_iterator li(*join_tab->join->join_list); @@ -5810,7 +5807,7 @@ add_group_and_distinct_keys(JOIN *join, JOIN_TAB *join_tab) { /* Collect all query fields referenced in the GROUP clause. */ for (cur_group= join->group_list; cur_group; cur_group= cur_group->next) (*cur_group->item)->walk(&Item::collect_item_field_processor, 0, - (uchar*) &indexed_fields); + &indexed_fields); } else if (join->select_distinct) { /* Collect all query fields referenced in the SELECT clause. */ @@ -5818,8 +5815,7 @@ add_group_and_distinct_keys(JOIN *join, JOIN_TAB *join_tab) List_iterator select_items_it(select_items); Item *item; while ((item= select_items_it++)) - item->walk(&Item::collect_item_field_processor, 0, - (uchar*) &indexed_fields); + item->walk(&Item::collect_item_field_processor, 0, &indexed_fields); } else if (join->tmp_table_param.sum_func_count && is_indexed_agg_distinct(join, &indexed_fields)) @@ -12231,7 +12227,50 @@ remove_const(JOIN *join,ORDER *first_order, COND *cond, DBUG_PRINT("info",("removing: %s", order->item[0]->full_name())); continue; } - *simple_order=0; // Must do a temp table to sort + /* + UseMultipleEqualitiesToRemoveTempTable: + Can use multiple-equalities here to check that ORDER BY columns + can be used without tmp. table. + */ + bool can_subst_to_first_table= false; + if (optimizer_flag(join->thd, OPTIMIZER_SWITCH_ORDERBY_EQ_PROP) && + first_is_base_table && + order->item[0]->real_item()->type() == Item::FIELD_ITEM && + join->cond_equal) + { + table_map first_table_bit= + join->join_tab[join->const_tables].table->map; + + Item *item= order->item[0]; + + /* + TODO: equality substitution in the context of ORDER BY is + sometimes allowed when it is not allowed in the general case. + + We make the below call for its side effect: it will locate the + multiple equality the item belongs to and set item->item_equal + accordingly. + */ + Item *res= item->propagate_equal_fields(join->thd, + Value_source:: + Context_identity(), + join->cond_equal); + Item_equal *item_eq; + if ((item_eq= res->get_item_equal())) + { + Item *first= item_eq->get_first(NO_PARTICULAR_TAB, NULL); + if (first->const_item() || first->used_tables() == + first_table_bit) + { + can_subst_to_first_table= true; + } + } + } + + if (!can_subst_to_first_table) + { + *simple_order=0; // Must do a temp table to sort + } } } } @@ -14331,6 +14370,8 @@ simplify_joins(JOIN *join, List *join_list, COND *conds, bool top, if (table->outer_join && !table->embedding && table->table) table->table->maybe_null= FALSE; table->outer_join= 0; + if (!(straight_join || table->straight)) + table->dep_tables= table->embedding? table->embedding->dep_tables: 0; if (table->on_expr) { /* Add ON expression to the WHERE or upper-level ON condition. */ @@ -15741,7 +15782,7 @@ Field *Item::create_tmp_field(bool group, TABLE *table, uint convert_int_length) new_field= tmp_table_field_from_field_type(table, true, false); else new_field= make_string_field(table); - new_field->set_derivation(collation.derivation); + new_field->set_derivation(collation.derivation, collation.repertoire); break; case DECIMAL_RESULT: new_field= Field_new_decimal::create_from_item(mem_root, this); @@ -16008,7 +16049,8 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type, modify_item); case Item::TYPE_HOLDER: result= ((Item_type_holder *)item)->make_field_by_type(table); - result->set_derivation(item->collation.derivation); + result->set_derivation(item->collation.derivation, + item->collation.repertoire); return result; default: // Dosen't have to be stored return 0; @@ -16028,7 +16070,7 @@ setup_tmp_table_column_bitmaps(TABLE *table, uchar *bitmaps, uint field_count) { uint bitmap_size= bitmap_buffer_size(field_count); - DBUG_ASSERT(table->s->vfields == 0 && table->def_vcol_set == 0); + DBUG_ASSERT(table->s->virtual_fields == 0 && table->def_vcol_set == 0); my_bitmap_init(&table->def_read_set, (my_bitmap_map*) bitmaps, field_count, FALSE); @@ -20379,6 +20421,8 @@ part_of_refkey(TABLE *table,Field *field) /** Test if one can use the key to resolve ORDER BY. + @param join if not NULL, can use the join's top-level + multiple-equalities. @param order Sort order @param table Table to sort @param idx Index to check @@ -20401,7 +20445,8 @@ part_of_refkey(TABLE *table,Field *field) -1 Reverse key can be used */ -static int test_if_order_by_key(ORDER *order, TABLE *table, uint idx, +static int test_if_order_by_key(JOIN *join, + ORDER *order, TABLE *table, uint idx, uint *used_key_parts= NULL) { KEY_PART_INFO *key_part,*key_part_end; @@ -20424,7 +20469,8 @@ static int test_if_order_by_key(ORDER *order, TABLE *table, uint idx, for (; order ; order=order->next, const_key_parts>>=1) { - Field *field=((Item_field*) (*order->item)->real_item())->field; + Item_field *item_field= ((Item_field*) (*order->item)->real_item()); + Field *field= item_field->field; int flag; /* @@ -20466,6 +20512,17 @@ static int test_if_order_by_key(ORDER *order, TABLE *table, uint idx, DBUG_RETURN(0); } + if (key_part->field != field) + { + /* + Check if there is a multiple equality that allows to infer that field + and key_part->field are equal + (see also: compute_part_of_sort_key_for_equals) + */ + if (item_field->item_equal && + item_field->item_equal->contains(key_part->field)) + field= key_part->field; + } if (key_part->field != field || !field->part_of_sortkey.is_set(idx)) DBUG_RETURN(0); @@ -20595,7 +20652,7 @@ test_if_subkey(ORDER *order, TABLE *table, uint ref, uint ref_key_parts, table->key_info[nr].user_defined_key_parts >= ref_key_parts && is_subkey(table->key_info[nr].key_part, ref_key_part, ref_key_part_end) && - test_if_order_by_key(order, table, nr)) + test_if_order_by_key(NULL, order, table, nr)) { min_length= table->key_info[nr].key_length; best= nr; @@ -20734,6 +20791,71 @@ find_field_in_item_list (Field *field, void *data) } +/* + Fill *col_keys with a union of Field::part_of_sortkey of all fields + that belong to 'table' and are equal to 'item_field'. +*/ + +void compute_part_of_sort_key_for_equals(JOIN *join, TABLE *table, + Item_field *item_field, + key_map *col_keys) +{ + col_keys->clear_all(); + col_keys->merge(item_field->field->part_of_sortkey); + + if (!optimizer_flag(join->thd, OPTIMIZER_SWITCH_ORDERBY_EQ_PROP)) + return; + + Item_equal *item_eq= NULL; + + if (item_field->item_equal) + { + /* + The item_field is from ORDER structure, but it already has an item_equal + pointer set (UseMultipleEqualitiesToRemoveTempTable code have set it) + */ + item_eq= item_field->item_equal; + } + else + { + /* + Walk through join's muliple equalities and find the one that contains + item_field. + */ + if (!join->cond_equal) + return; + table_map needed_tbl_map= item_field->used_tables() | table->map; + List_iterator li(join->cond_equal->current_level); + Item_equal *cur_item_eq; + while ((cur_item_eq= li++)) + { + if ((cur_item_eq->used_tables() & needed_tbl_map) && + cur_item_eq->contains(item_field->field)) + { + item_eq= cur_item_eq; + item_field->item_equal= item_eq; // Save the pointer to our Item_equal. + break; + } + } + } + + if (item_eq) + { + Item_equal_fields_iterator it(*item_eq); + Item *item; + /* Loop through other members that belong to table table */ + while ((item= it++)) + { + if (item->type() == Item::FIELD_ITEM && + ((Item_field*)item)->field->table == table) + { + col_keys->merge(((Item_field*)item)->field->part_of_sortkey); + } + } + } +} + + /** Test if we can skip the ORDER BY by using an index. @@ -20790,7 +20912,27 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit, usable_keys.clear_all(); DBUG_RETURN(0); } - usable_keys.intersect(((Item_field*) item)->field->part_of_sortkey); + + /* + Take multiple-equalities into account. Suppose we have + ORDER BY col1, col10 + and there are + multiple-equal(col1, col2, col3), + multiple-equal(col10, col11). + + Then, + - when item=col1, we find the set of indexes that cover one of {col1, + col2, col3} + - when item=col10, we find the set of indexes that cover one of {col10, + col11} + + And we compute an intersection of these sets to find set of indexes that + cover all ORDER BY components. + */ + key_map col_keys; + compute_part_of_sort_key_for_equals(tab->join, table, (Item_field*)item, + &col_keys); + usable_keys.intersect(col_keys); if (usable_keys.is_clear_all()) goto use_filesort; // No usable keys } @@ -20948,7 +21090,7 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit, } /* Check if we get the rows in requested sorted order by using the key */ if (usable_keys.is_set(ref_key) && - (order_direction= test_if_order_by_key(order,table,ref_key, + (order_direction= test_if_order_by_key(tab->join, order,table,ref_key, &used_key_parts))) goto check_reverse_order; } @@ -21294,7 +21436,7 @@ create_sort_index(THD *thd, JOIN *join, JOIN_TAB *tab, Filesort *fsort) if (table->s->tmp_table) table->file->info(HA_STATUS_VARIABLE); // Get record count - file_sort= filesort(thd, table, fsort, fsort->tracker); + file_sort= filesort(thd, table, fsort, fsort->tracker, join, tab->table->map); DBUG_ASSERT(tab->filesort_result == 0); tab->filesort_result= file_sort; tab->records= 0; @@ -24556,7 +24698,8 @@ static void print_table_array(THD *thd, continue; } - if (curr->outer_join) + /* JOIN_TYPE_OUTER is just a marker unrelated to real join */ + if (curr->outer_join & (JOIN_TYPE_LEFT|JOIN_TYPE_RIGHT)) { /* MySQL converts right to left joins */ str->append(STRING_WITH_LEN(" left join ")); @@ -24612,33 +24755,53 @@ static void print_join(THD *thd, /* List is reversed => we should reverse it before using */ List_iterator_fast ti(*tables); TABLE_LIST **table; - uint non_const_tables= 0; DBUG_ENTER("print_join"); + /* + If the QT_NO_DATA_EXPANSION flag is specified, we print the + original table list, including constant tables that have been + optimized away, as the constant tables may be referenced in the + expression printed by Item_field::print() when this flag is given. + Otherwise, only non-const tables are printed. + + Example: + + Original SQL: + select * from (select 1) t + + Printed without QT_NO_DATA_EXPANSION: + select '1' AS `1` from dual + + Printed with QT_NO_DATA_EXPANSION: + select `t`.`1` from (select 1 AS `1`) `t` + */ + const bool print_const_tables= (query_type & QT_NO_DATA_EXPANSION); + size_t tables_to_print= 0; + for (TABLE_LIST *t= ti++; t ; t= ti++) { - /* - See comment in print_table_array() about the second part of the - condition - */ - if (!t->optimized_away && !is_eliminated_table(eliminated_tables, t)) - non_const_tables++; + /* See comment in print_table_array() about the second condition */ + if (print_const_tables || !t->optimized_away) + if (!is_eliminated_table(eliminated_tables, t)) + tables_to_print++; } - if (!non_const_tables) + if (tables_to_print == 0) { str->append(STRING_WITH_LEN("dual")); DBUG_VOID_RETURN; // all tables were optimized away } ti.rewind(); - if (!(table= (TABLE_LIST **)thd->alloc(sizeof(TABLE_LIST*) * - non_const_tables))) + if (!(table= static_cast(thd->alloc(sizeof(TABLE_LIST*) * + tables_to_print)))) DBUG_VOID_RETURN; // out of memory - TABLE_LIST *tmp, **t= table + (non_const_tables - 1); + TABLE_LIST *tmp, **t= table + (tables_to_print - 1); while ((tmp= ti++)) { - if (tmp->optimized_away || is_eliminated_table(eliminated_tables, tmp)) + if (tmp->optimized_away && !print_const_tables) + continue; + if (is_eliminated_table(eliminated_tables, tmp)) continue; *t--= tmp; } @@ -24658,7 +24821,7 @@ static void print_join(THD *thd, */ if ((*table)->sj_inner_tables) { - TABLE_LIST **end= table + non_const_tables; + TABLE_LIST **end= table + tables_to_print; for (TABLE_LIST **t2= table; t2!=end; t2++) { if (!(*t2)->sj_inner_tables) @@ -24671,7 +24834,7 @@ static void print_join(THD *thd, } } print_table_array(thd, eliminated_tables, str, table, - table + non_const_tables, query_type); + table + tables_to_print, query_type); DBUG_VOID_RETURN; } @@ -25094,7 +25257,7 @@ void JOIN::save_query_plan(Join_plan_state *save_to) } memcpy((uchar*) save_to->best_positions, (uchar*) best_positions, sizeof(POSITION) * (table_count + 1)); - memset(best_positions, 0, sizeof(POSITION) * (table_count + 1)); + memset((uchar*) best_positions, 0, sizeof(POSITION) * (table_count + 1)); /* Save SJM nests */ List_iterator it(select_lex->sj_nests); @@ -25522,7 +25685,8 @@ test_if_cheaper_ordering(const JOIN_TAB *tab, ORDER *order, TABLE *table, uint used_key_parts= 0; if (keys.is_set(nr) && - (direction= test_if_order_by_key(order, table, nr, &used_key_parts))) + (direction= test_if_order_by_key(join, order, table, nr, + &used_key_parts))) { /* At this point we are sure that ref_key is a non-ordering @@ -25765,7 +25929,7 @@ uint get_index_for_order(ORDER *order, TABLE *table, SQL_SELECT *select, } uint used_key_parts; - switch (test_if_order_by_key(order, table, select->quick->index, + switch (test_if_order_by_key(NULL, order, table, select->quick->index, &used_key_parts)) { case 1: // desired order *need_sort= FALSE; diff --git a/sql/sql_select.h b/sql/sql_select.h index 12a40996258..24c7e0f9ff7 100644 --- a/sql/sql_select.h +++ b/sql/sql_select.h @@ -1940,8 +1940,6 @@ bool error_if_full_join(JOIN *join); int report_error(TABLE *table, int error); int safe_index_read(JOIN_TAB *tab); int get_quick_record(SQL_SELECT *select); -SORT_FIELD * make_unireg_sortorder(THD *thd, ORDER *order, uint *length, - SORT_FIELD *sortorder); int setup_order(THD *thd, Ref_ptr_array ref_pointer_array, TABLE_LIST *tables, List &fields, List &all_fields, ORDER *order, bool search_in_all_fields= true); diff --git a/sql/sql_servers.cc b/sql/sql_servers.cc index 196c138c04d..836b0563e23 100644 --- a/sql/sql_servers.cc +++ b/sql/sql_servers.cc @@ -162,7 +162,7 @@ bool servers_init(bool dont_read_servers_table) /* To be able to run this from boot, we allocate a temporary THD */ - if (!(thd=new THD)) + if (!(thd=new THD(0))) DBUG_RETURN(TRUE); thd->thread_stack= (char*) &thd; thd->store_globals(); diff --git a/sql/sql_show.cc b/sql/sql_show.cc index f41fb394b47..a446e05d427 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -815,12 +815,24 @@ ignore_db_dirs_process_additions() for (i= 0; i < ignore_db_dirs_array.elements; i++) { get_dynamic(&ignore_db_dirs_array, (uchar *) &dir, i); - if (my_hash_insert(&ignore_db_dirs_hash, (uchar *) dir)) - return true; - ptr= strnmov(ptr, dir->str, dir->length); - if (i + 1 < ignore_db_dirs_array.elements) - ptr= strmov(ptr, ","); + if (my_hash_insert(&ignore_db_dirs_hash, (uchar *)dir)) + { + /* ignore duplicates from the config file */ + if (my_hash_search(&ignore_db_dirs_hash, (uchar *)dir->str, dir->length)) + { + sql_print_warning("Duplicate ignore-db-dir directory name '%.*s' " + "found in the config file(s). Ignoring the duplicate.", + (int) dir->length, dir->str); + my_free(dir); + goto continue_loop; + } + return true; + } + ptr= strnmov(ptr, dir->str, dir->length); + *(ptr++)= ','; + +continue_loop: /* Set the transferred array element to NULL to avoid double free in case of error. @@ -829,6 +841,12 @@ ignore_db_dirs_process_additions() set_dynamic(&ignore_db_dirs_array, (uchar *) &dir, i); } + if (ptr > opt_ignore_db_dirs) + { + ptr--; + DBUG_ASSERT(*ptr == ','); + } + /* make sure the string is terminated */ DBUG_ASSERT(ptr - opt_ignore_db_dirs <= (ptrdiff_t) len); *ptr= 0; @@ -1616,29 +1634,32 @@ static bool get_field_default_value(THD *thd, Field *field, String *def_value, bool quoted) { bool has_default; - bool has_now_default; enum enum_field_types field_type= field->type(); - /* - We are using CURRENT_TIMESTAMP instead of NOW because it is - more standard - */ - has_now_default= field->has_insert_default_function(); - - has_default= (field_type != FIELD_TYPE_BLOB && - !(field->flags & NO_DEFAULT_VALUE_FLAG) && - field->unireg_check != Field::NEXT_NUMBER && - !((thd->variables.sql_mode & (MODE_MYSQL323 | MODE_MYSQL40)) - && has_now_default)); + has_default= (field->default_value || + (!(field->flags & NO_DEFAULT_VALUE_FLAG) && + field->unireg_check != Field::NEXT_NUMBER)); def_value->length(0); if (has_default) { - if (has_now_default) + if (field->default_value) { - def_value->append(STRING_WITH_LEN("CURRENT_TIMESTAMP")); - if (field->decimals() > 0) - def_value->append_parenthesized(field->decimals()); + if (field->default_value->expr_item->need_parentheses_in_default()) + { + def_value->set_charset(&my_charset_utf8mb4_general_ci); + def_value->append('('); + def_value->append(field->default_value->expr_str.str, + field->default_value->expr_str.length); + def_value->append(')'); + } + else if (field->unireg_check) + def_value->append(field->default_value->expr_str.str, + field->default_value->expr_str.length); + else + def_value->set(field->default_value->expr_str.str, + field->default_value->expr_str.length, + &my_charset_utf8mb4_general_ci); } else if (!field->is_null()) { // Not null by default @@ -1656,7 +1677,11 @@ static bool get_field_default_value(THD *thd, Field *field, String *def_value, quoted= 0; } else + { field->val_str(&type); + if (!field->str_needs_quotes()) + quoted= 0; + } if (type.length()) { String def_val; @@ -1667,13 +1692,13 @@ static bool get_field_default_value(THD *thd, Field *field, String *def_value, if (quoted) append_unescaped(def_value, def_val.ptr(), def_val.length()); else - def_value->append(def_val.ptr(), def_val.length()); + def_value->move(def_val); } else if (quoted) - def_value->append(STRING_WITH_LEN("''")); + def_value->set(STRING_WITH_LEN("''"), system_charset_info); } else if (field->maybe_null() && quoted) - def_value->append(STRING_WITH_LEN("NULL")); // Null as default + def_value->set(STRING_WITH_LEN("NULL"), system_charset_info); // Null as default else return 0; @@ -1760,8 +1785,8 @@ int show_create_table(THD *thd, TABLE_LIST *table_list, String *packet, List field_list; char tmp[MAX_FIELD_WIDTH], *for_str, buff[128], def_value_buf[MAX_FIELD_WIDTH]; const char *alias; - String type(tmp, sizeof(tmp), system_charset_info); - String def_value(def_value_buf, sizeof(def_value_buf), system_charset_info); + String type; + String def_value; Field **ptr,*field; uint primary_key; KEY *key_info; @@ -1854,12 +1879,8 @@ int show_create_table(THD *thd, TABLE_LIST *table_list, String *packet, packet->append(STRING_WITH_LEN(" ")); append_identifier(thd,packet,field->field_name, strlen(field->field_name)); packet->append(' '); - // check for surprises from the previous call to Field::sql_type() - if (type.ptr() != tmp) - type.set(tmp, sizeof(tmp), system_charset_info); - else - type.set_charset(system_charset_info); + type.set(tmp, sizeof(tmp), system_charset_info); field->sql_type(type); packet->append(type.ptr(), type.length(), system_charset_info); @@ -1886,7 +1907,7 @@ int show_create_table(THD *thd, TABLE_LIST *table_list, String *packet, packet->append(STRING_WITH_LEN(" AS (")); packet->append(field->vcol_info->expr_str.str, field->vcol_info->expr_str.length, - system_charset_info); + &my_charset_utf8mb4_general_ci); packet->append(STRING_WITH_LEN(")")); if (field->vcol_info->stored_in_db) packet->append(STRING_WITH_LEN(" PERSISTENT")); @@ -1906,6 +1927,7 @@ int show_create_table(THD *thd, TABLE_LIST *table_list, String *packet, packet->append(STRING_WITH_LEN(" NULL")); } + def_value.set(def_value_buf, sizeof(def_value_buf), system_charset_info); if (get_field_default_value(thd, field, &def_value, 1)) { packet->append(STRING_WITH_LEN(" DEFAULT ")); @@ -1923,6 +1945,14 @@ int show_create_table(THD *thd, TABLE_LIST *table_list, String *packet, !(sql_mode & MODE_NO_FIELD_OPTIONS)) packet->append(STRING_WITH_LEN(" AUTO_INCREMENT")); } + if (field->check_constraint) + { + packet->append(STRING_WITH_LEN(" CHECK (")); + packet->append(field->check_constraint->expr_str.str, + field->check_constraint->expr_str.length, + &my_charset_utf8mb4_general_ci); + packet->append(STRING_WITH_LEN(")")); + } if (field->comment.length) { @@ -2012,6 +2042,28 @@ int show_create_table(THD *thd, TABLE_LIST *table_list, String *packet, file->free_foreign_key_create_info(for_str); } + /* Add table level check constraints */ + if (share->table_check_constraints) + { + for (uint i= share->field_check_constraints; + i < share->table_check_constraints ; i++) + { + Virtual_column_info *check= table->check_constraints[i]; + + packet->append(STRING_WITH_LEN(",\n ")); + if (check->name.length) + { + packet->append(STRING_WITH_LEN("CONSTRAINT ")); + append_identifier(thd, packet, check->name.str, check->name.length); + } + packet->append(STRING_WITH_LEN(" CHECK (")); + packet->append(check->expr_str.str, + check->expr_str.length, + &my_charset_utf8mb4_general_ci); + packet->append(STRING_WITH_LEN(")")); + } + } + packet->append(STRING_WITH_LEN("\n)")); if (show_table_options) { @@ -2624,7 +2676,7 @@ int select_result_explain_buffer::send_data(List &items) DBUG_ENTER("select_result_explain_buffer::send_data"); /* - Switch to the recieveing thread, so that we correctly count memory used + Switch to the receiveing thread, so that we correctly count memory used by it. This is needed as it's the receiving thread that will free the memory. */ @@ -4155,7 +4207,7 @@ fill_schema_table_by_open(THD *thd, bool is_show_fields_or_keys, 'only_view_structure()'. */ lex->sql_command= SQLCOM_SHOW_FIELDS; - result= (open_temporary_tables(thd, table_list) || + result= (thd->open_temporary_tables(table_list) || open_normal_and_derived_tables(thd, table_list, (MYSQL_OPEN_IGNORE_FLUSH | MYSQL_OPEN_FORCE_SHARED_HIGH_PRIO_MDL | @@ -4218,6 +4270,7 @@ end: all tables open within this Open_tables_state. */ thd->temporary_tables= NULL; + close_thread_tables(thd); /* Release metadata lock we might have acquired. @@ -8778,7 +8831,7 @@ ST_FIELD_INFO processlist_fields_info[]= {"MAX_STAGE", 2, MYSQL_TYPE_TINY, 0, 0, "Max_stage", SKIP_OPEN_TABLE}, {"PROGRESS", 703, MYSQL_TYPE_DECIMAL, 0, 0, "Progress", SKIP_OPEN_TABLE}, - {"MEMORY_USED", 7, MYSQL_TYPE_LONG, 0, 0, "Memory_used", SKIP_OPEN_TABLE}, + {"MEMORY_USED", 7, MYSQL_TYPE_LONGLONG, 0, 0, "Memory_used", SKIP_OPEN_TABLE}, {"EXAMINED_ROWS", 7, MYSQL_TYPE_LONG, 0, 0, "Examined_rows", SKIP_OPEN_TABLE}, {"QUERY_ID", 4, MYSQL_TYPE_LONGLONG, 0, 0, 0, SKIP_OPEN_TABLE}, {"INFO_BINARY", PROCESS_LIST_INFO_WIDTH, MYSQL_TYPE_BLOB, 0, 1, diff --git a/sql/sql_statistics.cc b/sql/sql_statistics.cc index f6811b020eb..83c7db8b510 100644 --- a/sql/sql_statistics.cc +++ b/sql/sql_statistics.cc @@ -30,6 +30,7 @@ #include "opt_range.h" #include "uniques.h" #include "my_atomic.h" +#include "sql_show.h" /* The system variable 'use_stat_tables' can take one of the @@ -3195,6 +3196,10 @@ int delete_statistics_for_table(THD *thd, LEX_STRING *db, LEX_STRING *tab) rc= 1; } + err= del_global_table_stat(thd, db, tab); + if (err & !rc) + rc= 1; + thd->restore_stmt_binlog_format(save_binlog_format); close_system_tables(thd, &open_tables_backup); @@ -3341,6 +3346,10 @@ int delete_statistics_for_index(THD *thd, TABLE *tab, KEY *key_info, } } + err= del_global_index_stat(thd, tab, key_info); + if (err && !rc) + rc= 1; + thd->restore_stmt_binlog_format(save_binlog_format); close_system_tables(thd, &open_tables_backup); diff --git a/sql/sql_string.cc b/sql/sql_string.cc index 40339d599af..767154e019d 100644 --- a/sql/sql_string.cc +++ b/sql/sql_string.cc @@ -136,7 +136,7 @@ bool String::set_real(double num,uint decimals, CHARSET_INFO *cs) size_t len; str_charset=cs; - if (decimals >= NOT_FIXED_DEC) + if (decimals >= FLOATING_POINT_DECIMALS) { len= my_gcvt(num, MY_GCVT_ARG_DOUBLE, sizeof(buff) - 1, buff, NULL); return copy(buff, len, &my_charset_latin1, cs, &dummy_errors); diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 758757ea7dd..c9194bcb276 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2015, Oracle and/or its affiliates. + Copyright (c) 2000, 2016, Oracle and/or its affiliates. Copyright (c) 2010, 2016, MariaDB This program is free software; you can redistribute it and/or modify @@ -25,7 +25,7 @@ #include "sql_table.h" #include "sql_parse.h" // test_if_data_home_dir #include "sql_cache.h" // query_cache_* -#include "sql_base.h" // open_table_uncached, lock_table_names +#include "sql_base.h" // lock_table_names #include "lock.h" // mysql_unlock_tables #include "strfunc.h" // find_type2, find_set #include "sql_truncate.h" // regenerate_locked_table @@ -37,8 +37,7 @@ #include "sql_time.h" // make_truncated_value_warning #include "records.h" // init_read_record, end_read_record #include "filesort.h" // filesort_free_buffers -#include "sql_select.h" // setup_order, - // make_unireg_sortorder +#include "sql_select.h" // setup_order #include "sql_handler.h" // mysql_ha_rm_tables #include "discover.h" // readfrm #include "my_pthread.h" // pthread_mutex_t @@ -65,6 +64,9 @@ const char *primary_key_name="PRIMARY"; static bool check_if_keyname_exists(const char *name,KEY *start, KEY *end); static char *make_unique_key_name(THD *thd, const char *field_name, KEY *start, KEY *end); +static void make_unique_constraint_name(THD *thd, LEX_STRING *name, + List *vcol, + uint *nr); static int copy_data_between_tables(THD *thd, TABLE *from,TABLE *to, List &create, bool ignore, uint order_num, ORDER *order, @@ -1642,7 +1644,7 @@ void execute_ddl_log_recovery() /* To be able to run this from boot, we allocate a temporary THD */ - if (!(thd=new THD)) + if (!(thd=new THD(0))) DBUG_VOID_RETURN; thd->thread_stack= (char*) &thd; thd->store_globals(); @@ -2030,7 +2032,7 @@ bool mysql_rm_table(THD *thd,TABLE_LIST *tables, my_bool if_exists, LEX_STRING db_name= { table->db, table->db_length }; LEX_STRING table_name= { table->table_name, table->table_name_length }; if (table->open_type == OT_BASE_ONLY || - !find_temporary_table(thd, table)) + !thd->find_temporary_table(table)) (void) delete_statistics_for_table(thd, &db_name, &table_name); } } @@ -2283,23 +2285,17 @@ int mysql_rm_table_no_locks(THD *thd, TABLE_LIST *tables, bool if_exists, */ DBUG_ASSERT(!(thd->locked_tables_mode && table->open_type != OT_BASE_ONLY && - find_temporary_table(thd, table) && + thd->find_temporary_table(table) && table->mdl_request.ticket != NULL)); - /* - drop_temporary_table may return one of the following error codes: - . 0 - a temporary table was successfully dropped. - . 1 - a temporary table was not found. - . -1 - a temporary table is used by an outer statement. - */ if (table->open_type == OT_BASE_ONLY || !is_temporary_table(table)) error= 1; else { table_creation_was_logged= table->table->s->table_creation_was_logged; - if ((error= drop_temporary_table(thd, table->table, &is_trans)) == -1) + if (thd->drop_temporary_table(table->table, &is_trans, true)) { - DBUG_ASSERT(thd->in_sub_stmt); + error= 1; goto err; } table->table= 0; @@ -2882,7 +2878,8 @@ int prepare_create_field(Column_definition *sql_field, uint *blob_columns, longlong table_flags) { - unsigned int dup_val_count; + uint dup_val_count; + uint decimals= sql_field->decimals; DBUG_ENTER("prepare_create_field"); /* @@ -3000,8 +2997,18 @@ int prepare_create_field(Column_definition *sql_field, FIELDFLAG_DECIMAL) | (sql_field->flags & ZEROFILL_FLAG ? FIELDFLAG_ZEROFILL : 0) | - (sql_field->decimals << FIELDFLAG_DEC_SHIFT)); + (decimals << FIELDFLAG_DEC_SHIFT)); break; + case MYSQL_TYPE_FLOAT: + case MYSQL_TYPE_DOUBLE: + /* + User specified FLOAT() or DOUBLE() without precision. Change to + FLOATING_POINT_DECIMALS to keep things compatible with earlier MariaDB + versions. + */ + if (decimals >= FLOATING_POINT_DECIMALS) + decimals= FLOATING_POINT_DECIMALS; + /* fall-trough */ case MYSQL_TYPE_TIMESTAMP: case MYSQL_TYPE_TIMESTAMP2: /* fall-through */ @@ -3012,7 +3019,7 @@ int prepare_create_field(Column_definition *sql_field, (sql_field->flags & ZEROFILL_FLAG ? FIELDFLAG_ZEROFILL : 0) | f_settype((uint) sql_field->sql_type) | - (sql_field->decimals << FIELDFLAG_DEC_SHIFT)); + (decimals << FIELDFLAG_DEC_SHIFT)); break; } if (!(sql_field->flags & NOT_NULL_FLAG) || @@ -3065,19 +3072,20 @@ CHARSET_INFO* get_sql_field_charset(Create_field *sql_field, @param column_definitions The list of column definitions, in the physical order in which they appear in the table. - */ +*/ + void promote_first_timestamp_column(List *column_definitions) { - List_iterator it(*column_definitions); + List_iterator_fast it(*column_definitions); Create_field *column_definition; while ((column_definition= it++) != NULL) { - if (is_timestamp_type(column_definition->sql_type) || // TIMESTAMP + if (is_timestamp_type(column_definition->sql_type) || // TIMESTAMP column_definition->unireg_check == Field::TIMESTAMP_OLD_FIELD) // Legacy { if ((column_definition->flags & NOT_NULL_FLAG) != 0 && // NOT NULL, - column_definition->def == NULL && // no constant default, + column_definition->default_value == NULL && // no constant default, column_definition->unireg_check == Field::NONE && // no function default column_definition->vcol_info == NULL) { @@ -3116,8 +3124,8 @@ static void check_duplicate_key(THD *thd, if (!key->key_create_info.check_for_duplicate_indexes || key->generated) return; - List_iterator key_list_iterator(*key_list); - List_iterator key_column_iterator(key->columns); + List_iterator_fast key_list_iterator(*key_list); + List_iterator_fast key_column_iterator(key->columns); Key *k; while ((k= key_list_iterator++)) @@ -3141,7 +3149,7 @@ static void check_duplicate_key(THD *thd, Check that the keys have identical columns in the same order. */ - List_iterator k_column_iterator(k->columns); + List_iterator_fast k_column_iterator(k->columns); bool all_columns_are_identical= true; @@ -3219,7 +3227,7 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info, KEY_PART_INFO *key_part_info; int field_no,dup_no; int select_field_pos,auto_increment=0; - List_iterator it(alter_info->create_list); + List_iterator_fast it(alter_info->create_list); List_iterator it2(alter_info->create_list); uint total_uneven_bit_length= 0; int select_field_count= C_CREATE_SELECT(create_table_mode); @@ -3247,37 +3255,6 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info, !(sql_field->charset= find_bin_collation(sql_field->charset))) DBUG_RETURN(TRUE); - /* - Convert the default value from client character - set into the column character set if necessary. - */ - if (sql_field->def && - save_cs != sql_field->def->collation.collation && - (sql_field->sql_type == MYSQL_TYPE_VAR_STRING || - sql_field->sql_type == MYSQL_TYPE_STRING || - sql_field->sql_type == MYSQL_TYPE_SET || - sql_field->sql_type == MYSQL_TYPE_ENUM)) - { - /* - Starting from 5.1 we work here with a copy of Create_field - created by the caller, not with the instance that was - originally created during parsing. It's OK to create - a temporary item and initialize with it a member of the - copy -- this item will be thrown away along with the copy - at the end of execution, and thus not introduce a dangling - pointer in the parsed tree of a prepared statement or a - stored procedure statement. - */ - sql_field->def= sql_field->def->safe_charset_converter(thd, save_cs); - - if (sql_field->def == NULL) - { - /* Could not convert */ - my_error(ER_INVALID_DEFAULT, MYF(0), sql_field->field_name); - DBUG_RETURN(TRUE); - } - } - if (sql_field->sql_type == MYSQL_TYPE_SET || sql_field->sql_type == MYSQL_TYPE_ENUM) { @@ -3343,36 +3320,6 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info, if (sql_field->sql_type == MYSQL_TYPE_SET) { uint32 field_length; - if (sql_field->def != NULL) - { - char *not_used; - uint not_used2; - bool not_found= 0; - String str, *def= sql_field->def->val_str(&str); - if (def == NULL) /* SQL "NULL" maps to NULL */ - { - if ((sql_field->flags & NOT_NULL_FLAG) != 0) - { - my_error(ER_INVALID_DEFAULT, MYF(0), sql_field->field_name); - DBUG_RETURN(TRUE); - } - - /* else, NULL is an allowed value */ - (void) find_set(interval, NULL, 0, - cs, ¬_used, ¬_used2, ¬_found); - } - else /* not NULL */ - { - (void) find_set(interval, def->ptr(), def->length(), - cs, ¬_used, ¬_used2, ¬_found); - } - - if (not_found) - { - my_error(ER_INVALID_DEFAULT, MYF(0), sql_field->field_name); - DBUG_RETURN(TRUE); - } - } calculate_interval_lengths(cs, interval, &dummy, &field_length); sql_field->length= field_length + (interval->count - 1); } @@ -3380,29 +3327,6 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info, { uint32 field_length; DBUG_ASSERT(sql_field->sql_type == MYSQL_TYPE_ENUM); - if (sql_field->def != NULL) - { - String str, *def= sql_field->def->val_str(&str); - if (def == NULL) /* SQL "NULL" maps to NULL */ - { - if ((sql_field->flags & NOT_NULL_FLAG) != 0) - { - my_error(ER_INVALID_DEFAULT, MYF(0), sql_field->field_name); - DBUG_RETURN(TRUE); - } - - /* else, the defaults yield the correct length for NULLs. */ - } - else /* not NULL */ - { - def->length(cs->cset->lengthsp(cs, def->ptr(), def->length())); - if (find_type2(interval, def->ptr(), def->length(), cs) == 0) /* not found */ - { - my_error(ER_INVALID_DEFAULT, MYF(0), sql_field->field_name); - DBUG_RETURN(TRUE); - } - } - } calculate_interval_lengths(cs, interval, &field_length, &dummy); sql_field->length= field_length; } @@ -3422,6 +3346,112 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info, if (prepare_blob_field(thd, sql_field)) DBUG_RETURN(TRUE); + if (sql_field->default_value) + { + Virtual_column_info *def= sql_field->default_value; + + if (!sql_field->has_default_expression()) + def->expr_str= null_lex_str; + + if (!def->expr_item->basic_const_item() && !def->flags) + { + Item *expr= def->expr_item; + int err= !expr->fixed && // may be already fixed if ALTER TABLE + expr->fix_fields(thd, &expr); + if (!err) + { + if (expr->result_type() == REAL_RESULT) + { // don't convert floats to string and back, it can be lossy + double res= expr->val_real(); + if (expr->null_value) + expr= new (thd->mem_root) Item_null(thd); + else + expr= new (thd->mem_root) Item_float(thd, res, expr->decimals); + } + else + { + StringBuffer buf; + String *res= expr->val_str(&buf); + if (expr->null_value) + expr= new (thd->mem_root) Item_null(thd); + else + { + char *str= (char*) thd->strmake(res->ptr(), res->length()); + expr= new (thd->mem_root) Item_string(thd, str, res->length(), res->charset()); + } + } + thd->change_item_tree(&def->expr_item, expr); + } + } + } + + /* + Convert the default value from client character + set into the column character set if necessary. + We can only do this for constants as we have not yet run fix_fields. + */ + if (sql_field->default_value && + sql_field->default_value->expr_item->basic_const_item() && + save_cs != sql_field->default_value->expr_item->collation.collation && + (sql_field->sql_type == MYSQL_TYPE_VAR_STRING || + sql_field->sql_type == MYSQL_TYPE_STRING || + sql_field->sql_type == MYSQL_TYPE_SET || + sql_field->sql_type == MYSQL_TYPE_TINY_BLOB || + sql_field->sql_type == MYSQL_TYPE_MEDIUM_BLOB || + sql_field->sql_type == MYSQL_TYPE_LONG_BLOB || + sql_field->sql_type == MYSQL_TYPE_BLOB || + sql_field->sql_type == MYSQL_TYPE_ENUM)) + { + Item *item; + if (!(item= sql_field->default_value->expr_item-> + safe_charset_converter(thd, save_cs))) + { + /* Could not convert */ + my_error(ER_INVALID_DEFAULT, MYF(0), sql_field->field_name); + DBUG_RETURN(TRUE); + } + /* Fix for prepare statement */ + thd->change_item_tree(&sql_field->default_value->expr_item, item); + } + + if (sql_field->default_value && + sql_field->default_value->expr_item->basic_const_item() && + (sql_field->sql_type == MYSQL_TYPE_SET || + sql_field->sql_type == MYSQL_TYPE_ENUM)) + { + StringBuffer str; + String *def= sql_field->default_value->expr_item->val_str(&str); + bool not_found; + if (def == NULL) /* SQL "NULL" maps to NULL */ + { + not_found= sql_field->flags & NOT_NULL_FLAG; + } + else + { + not_found= false; + if (sql_field->sql_type == MYSQL_TYPE_SET) + { + char *not_used; + uint not_used2; + find_set(sql_field->interval, def->ptr(), def->length(), + sql_field->charset, ¬_used, ¬_used2, ¬_found); + } + else /* MYSQL_TYPE_ENUM */ + { + def->length(sql_field->charset->cset->lengthsp(sql_field->charset, + def->ptr(), def->length())); + not_found= !find_type2(sql_field->interval, def->ptr(), + def->length(), sql_field->charset); + } + } + + if (not_found) + { + my_error(ER_INVALID_DEFAULT, MYF(0), sql_field->field_name); + DBUG_RETURN(TRUE); + } + } + if (!(sql_field->flags & NOT_NULL_FLAG)) null_fields++; @@ -3459,7 +3489,7 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info, file->ha_table_flags() & HA_CAN_BIT_FIELD) total_uneven_bit_length-= sql_field->length & 7; - sql_field->def= dup_field->def; + sql_field->default_value= dup_field->default_value; sql_field->sql_type= dup_field->sql_type; /* @@ -3573,7 +3603,7 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info, therefore mark it as unsafe. */ if (select_field_count > 0 && auto_increment) - thd->lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_CREATE_SELECT_AUTOINC); + thd->lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_CREATE_SELECT_AUTOINC); /* Create keys */ @@ -4124,7 +4154,7 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info, it is NOT NULL, not an AUTO_INCREMENT field, not a TIMESTAMP and not updated trough a NOW() function. */ - if (!sql_field->def && + if (!sql_field->default_value && !sql_field->has_default_function() && (sql_field->flags & NOT_NULL_FLAG) && !is_timestamp_type(sql_field->sql_type)) @@ -4134,7 +4164,7 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info, } if (thd->variables.sql_mode & MODE_NO_ZERO_DATE && - !sql_field->def && + !sql_field->default_value && is_timestamp_type(sql_field->sql_type) && (sql_field->flags & NOT_NULL_FLAG) && (type == Field::NONE || type == Field::TIMESTAMP_UN_FIELD)) @@ -4158,6 +4188,31 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info, } } + /* Check table level constraints */ + create_info->check_constraint_list= &alter_info->check_constraint_list; + { + uint nr= 1; + List_iterator_fast c_it(alter_info->check_constraint_list); + Virtual_column_info *check; + while ((check= c_it++)) + { + if (!check->name.length) + make_unique_constraint_name(thd, &check->name, + &alter_info->check_constraint_list, + &nr); + + if (check_string_char_length(&check->name, 0, NAME_CHAR_LEN, + system_charset_info, 1)) + { + my_error(ER_TOO_LONG_IDENT, MYF(0), key->name.str); + DBUG_RETURN(TRUE); + } + if (check_expression(check, "CONSTRAINT CHECK", + check->name.str ? check->name.str : "", 0)) + DBUG_RETURN(TRUE); + } + } + /* Give warnings for not supported table options */ #if defined(WITH_ARIA_STORAGE_ENGINE) extern handlerton *maria_hton; @@ -4226,7 +4281,7 @@ bool validate_comment_length(THD *thd, LEX_STRING *comment, size_t max_len, create_info Table create information DESCRIPTION - If the table character set was not given explicitely, + If the table character set was not given explicitly, let's fetch the database default character set and apply it to the table. */ @@ -4273,7 +4328,7 @@ static bool prepare_blob_field(THD *thd, Column_definition *sql_field) /* Convert long VARCHAR columns to TEXT or BLOB */ char warn_buff[MYSQL_ERRMSG_SIZE]; - if (sql_field->def || thd->is_strict_mode()) + if (thd->is_strict_mode()) { my_error(ER_TOO_BIG_FIELDLENGTH, MYF(0), sql_field->field_name, static_cast(MAX_FIELD_VARCHARLENGTH / @@ -4352,7 +4407,7 @@ void sp_prepare_create_field(THD *thd, Column_definition *sql_field) FIELDFLAG_TREAT_BIT_AS_CHAR; } sql_field->create_length_to_internal_length(); - DBUG_ASSERT(sql_field->def == 0); + DBUG_ASSERT(sql_field->default_value == 0); /* Can't go wrong as sql_field->def is not defined */ (void) prepare_blob_field(thd, sql_field); } @@ -4635,7 +4690,8 @@ err: which was created. @param[out] key_count Number of keys in table which was created. - If one creates a temporary table, this is automatically opened + If one creates a temporary table, its is automatically opened and its + TABLE_SHARE is added to THD::all_temp_tables list. Note that this function assumes that caller already have taken exclusive metadata lock on table being created or used some other @@ -4695,20 +4751,22 @@ int create_table_impl(THD *thd, /* Check if table exists */ if (create_info->tmp_table()) { - TABLE *tmp_table; - if (find_and_use_temporary_table(thd, db, table_name, &tmp_table)) - goto err; + /* + If a table exists, it must have been pre-opened. Try looking for one + in-use in THD::all_temp_tables list of TABLE_SHAREs. + */ + TABLE *tmp_table= thd->find_temporary_table(db, table_name); + if (tmp_table) { bool table_creation_was_logged= tmp_table->s->table_creation_was_logged; if (options.or_replace()) { - bool tmp; /* We are using CREATE OR REPLACE on an existing temporary table Remove the old table so that we can re-create it. */ - if (drop_temporary_table(thd, tmp_table, &tmp)) + if (thd->drop_temporary_table(tmp_table, NULL, true)) goto err; } else if (options.if_not_exists()) @@ -4847,17 +4905,12 @@ int create_table_impl(THD *thd, create_info->table= 0; if (!frm_only && create_info->tmp_table()) { - /* - Open a table (skipping table cache) and add it into - THD::temporary_tables list. - */ - - TABLE *table= open_table_uncached(thd, create_info->db_type, frm, path, - db, table_name, true, true); + TABLE *table= thd->create_and_open_tmp_table(create_info->db_type, frm, + path, db, table_name, true); if (!table) { - (void) rm_temporary_table(create_info->db_type, path); + (void) thd->rm_temporary_table(create_info->db_type, path); goto err; } @@ -4889,7 +4942,7 @@ int create_table_impl(THD *thd, open_table_from_share(thd, &share, "", 0, (uint) READ_ALL, 0, &table, true)); if (!result) - (void) closefrm(&table, 0); + (void) closefrm(&table); free_table_share(&share); @@ -5119,6 +5172,38 @@ make_unique_key_name(THD *thd, const char *field_name,KEY *start,KEY *end) return (char*) "not_specified"; // Should never happen } +/** + Make an unique name for constraints without a name +*/ + +static void make_unique_constraint_name(THD *thd, LEX_STRING *name, + List *vcol, + uint *nr) +{ + char buff[MAX_FIELD_NAME], *end; + List_iterator_fast it(*vcol); + + end=strmov(buff, "CONSTRAINT_"); + for (;;) + { + Virtual_column_info *check; + char *real_end= int10_to_str((*nr)++, end, 10); + it.rewind(); + while ((check= it++)) + { + if (check->name.str && + !my_strcasecmp(system_charset_info, buff, check->name.str)) + break; + } + if (!check) // Found unique name + { + name->length= (size_t) (real_end - buff); + name->str= thd->strmake(buff, name->length); + return; + } + } +} + /**************************************************************************** ** Alter a table definition @@ -5424,6 +5509,9 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table, /* We have to write the query before we unlock the tables. */ + if (thd->is_current_stmt_binlog_disabled()) + goto err; + if (thd->is_current_stmt_binlog_format_row()) { /* @@ -5494,6 +5582,21 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table, */ if (!table->view) { + /* + After opening a MERGE table add the children to the query list of + tables, so that children tables info can be used on "CREATE TABLE" + statement generation by the binary log. + Note that placeholders don't have the handler open. + */ + if (table->table->file->extra(HA_EXTRA_ADD_CHILDREN_LIST)) + goto err; + + /* + As the reference table is temporary and may not exist on slave, we must + force the ENGINE to be present into CREATE TABLE. + */ + create_info->used_fields|= HA_CREATE_USED_ENGINE; + int result __attribute__((unused))= show_create_table(thd, table, &query, create_info, WITH_DB_NAME); @@ -5797,7 +5900,19 @@ drop_create_field: } } } - else /* Alter_drop::KEY */ + else if (drop->type == Alter_drop::CHECK_CONSTRAINT) + { + for (uint i=table->s->field_check_constraints; i < table->s->table_check_constraints; i++) + { + if (my_strcasecmp(system_charset_info, drop->name, + table->check_constraints[i]->name.str) == 0) + { + remove_drop= FALSE; + break; + } + } + } + else /* Alter_drop::KEY and Alter_drop::FOREIGN_KEY */ { uint n_key; if (drop->type != Alter_drop::FOREIGN_KEY) @@ -5854,7 +5969,7 @@ drop_create_field: push_warning_printf(thd, Sql_condition::WARN_LEVEL_NOTE, ER_CANT_DROP_FIELD_OR_KEY, ER_THD(thd, ER_CANT_DROP_FIELD_OR_KEY), - drop->name); + drop->type_name(), drop->name); drop_it.remove(); if (alter_info->drop_list.is_empty()) alter_info->flags&= ~(Alter_info::ALTER_DROP_COLUMN | @@ -6173,6 +6288,10 @@ static bool fill_alter_inplace_info(THD *thd, /* Check for: ALTER TABLE FORCE, ALTER TABLE ENGINE and OPTIMIZE TABLE. */ if (alter_info->flags & Alter_info::ALTER_RECREATE) ha_alter_info->handler_flags|= Alter_inplace_info::RECREATE_TABLE; + if (alter_info->flags & Alter_info::ALTER_ADD_CHECK_CONSTRAINT) + ha_alter_info->handler_flags|= Alter_inplace_info::ALTER_ADD_CHECK_CONSTRAINT; + if (alter_info->flags & Alter_info::ALTER_DROP_CHECK_CONSTRAINT) + ha_alter_info->handler_flags|= Alter_inplace_info::ALTER_DROP_CHECK_CONSTRAINT; /* If we altering table with old VARCHAR fields we will be automatically @@ -6920,6 +7039,14 @@ static bool is_inplace_alter_impossible(TABLE *table, if (!table->s->mysql_version) DBUG_RETURN(true); + /* + If we are using a MySQL 5.7 table with virtual fields, ALTER TABLE must + recreate the table as we need to rewrite generated fields + */ + if (table->s->mysql_version > 50700 && table->s->mysql_version < 100000 && + table->s->virtual_fields) + DBUG_RETURN(TRUE); + DBUG_RETURN(false); } @@ -7143,7 +7270,8 @@ static bool mysql_inplace_alter_table(THD *thd, HA_EXTRA_NOT_USED, NULL); table_list->table= table= NULL; - close_temporary_table(thd, altered_table, true, false); + + thd->drop_temporary_table(altered_table, NULL, false); /* Replace the old .FRM with the new .FRM, but keep the old name for now. @@ -7233,7 +7361,7 @@ static bool mysql_inplace_alter_table(THD *thd, thd->locked_tables_list.unlink_all_closed_tables(thd, NULL, 0); /* QQ; do something about metadata locks ? */ } - close_temporary_table(thd, altered_table, true, false); + thd->drop_temporary_table(altered_table, NULL, false); // Delete temporary .frm/.par (void) quick_rm_table(thd, create_info->db_type, alter_ctx->new_db, alter_ctx->tmp_name, FN_IS_TMP | NO_HA_TABLE); @@ -7329,6 +7457,7 @@ mysql_prepare_alter_table(THD *thd, TABLE *table, List_iterator find_it(new_create_list); List_iterator field_it(new_create_list); List key_parts; + List new_constraint_list; uint db_create_options= (table->s->db_create_options & ~(HA_OPTION_PACK_RECORD)); uint used_fields; @@ -7473,12 +7602,7 @@ mysql_prepare_alter_table(THD *thd, TABLE *table, } if (alter) { - if (def->sql_type == MYSQL_TYPE_BLOB) - { - my_error(ER_BLOB_CANT_HAVE_DEFAULT, MYF(0), def->change); - goto err; - } - if ((def->def=alter->def)) // Use new default + if ((def->default_value= alter->default_value)) def->flags&= ~NO_DEFAULT_VALUE_FLAG; else def->flags|= NO_DEFAULT_VALUE_FLAG; @@ -7752,6 +7876,33 @@ mysql_prepare_alter_table(THD *thd, TABLE *table, } } + /* Add all table level constraints which are not in the drop list */ + if (table->s->table_check_constraints) + { + TABLE_SHARE *share= table->s; + + for (uint i= share->field_check_constraints; + i < share->table_check_constraints ; i++) + { + Virtual_column_info *check= table->check_constraints[i]; + Alter_drop *drop; + drop_it.rewind(); + while ((drop=drop_it++)) + { + if (drop->type == Alter_drop::CHECK_CONSTRAINT && + !my_strcasecmp(system_charset_info, check->name.str, drop->name)) + { + drop_it.remove(); + break; + } + } + if (!drop) + new_constraint_list.push_back(check, thd->mem_root); + } + } + /* Add new constraints */ + new_constraint_list.append(&alter_info->check_constraint_list); + if (alter_info->drop_list.elements) { Alter_drop *drop; @@ -7760,8 +7911,9 @@ mysql_prepare_alter_table(THD *thd, TABLE *table, switch (drop->type) { case Alter_drop::KEY: case Alter_drop::COLUMN: - my_error(ER_CANT_DROP_FIELD_OR_KEY, MYF(0), - alter_info->drop_list.head()->name); + case Alter_drop::CHECK_CONSTRAINT: + my_error(ER_CANT_DROP_FIELD_OR_KEY, MYF(0), drop->type_name(), + alter_info->drop_list.head()->name); goto err; case Alter_drop::FOREIGN_KEY: // Leave the DROP FOREIGN KEY names in the alter_info->drop_list. @@ -7769,12 +7921,6 @@ mysql_prepare_alter_table(THD *thd, TABLE *table, } } } - if (alter_info->alter_list.elements) - { - my_error(ER_CANT_DROP_FIELD_OR_KEY, MYF(0), - alter_info->alter_list.head()->name); - goto err; - } if (!create_info->comment.str) { @@ -7807,6 +7953,7 @@ mysql_prepare_alter_table(THD *thd, TABLE *table, rc= FALSE; alter_info->create_list.swap(new_create_list); alter_info->key_list.swap(new_key_list); + alter_info->check_constraint_list.swap(new_constraint_list); err: DBUG_RETURN(rc); } @@ -8129,6 +8276,72 @@ static bool fk_prepare_copy_alter_table(THD *thd, TABLE *table, DBUG_RETURN(false); } +/** + Rename temporary table and/or turn indexes on/off without touching .FRM. + Its a variant of simple_rename_or_index_change() to be used exclusively + for temporary tables. + + @param thd Thread handler + @param table_list TABLE_LIST for the table to change + @param keys_onoff ENABLE or DISABLE KEYS? + @param alter_ctx ALTER TABLE runtime context. + + @return Operation status + @retval false Success + @retval true Failure +*/ +static bool +simple_tmp_rename_or_index_change(THD *thd, TABLE_LIST *table_list, + Alter_info::enum_enable_or_disable keys_onoff, + Alter_table_ctx *alter_ctx) +{ + DBUG_ENTER("simple_tmp_rename_or_index_change"); + + TABLE *table= table_list->table; + bool error= false; + + DBUG_ASSERT(table->s->tmp_table); + + if (keys_onoff != Alter_info::LEAVE_AS_IS) + { + THD_STAGE_INFO(thd, stage_manage_keys); + error= alter_table_manage_keys(table, table->file->indexes_are_disabled(), + keys_onoff); + } + + if (!error && alter_ctx->is_table_renamed()) + { + THD_STAGE_INFO(thd, stage_rename); + + /* + If THD::rename_temporary_table() fails, there is no need to rename it + back to the original name (unlike the case for non-temporary tables), + as it was an allocation error and the table was not renamed. + */ + error= thd->rename_temporary_table(table, alter_ctx->new_db, + alter_ctx->new_alias); + } + + if (!error) + { + int res= 0; + /* + We do not replicate alter table statement on temporary tables under + ROW-based replication. + */ + if (!thd->is_current_stmt_binlog_format_row()) + { + res= write_bin_log(thd, true, thd->query(), thd->query_length()); + } + if (res != 0) + error= true; + else + my_ok(thd); + } + + DBUG_RETURN(error); +} + /** Rename table and/or turn indexes on/off without touching .FRM @@ -8165,6 +8378,7 @@ simple_rename_or_index_change(THD *thd, TABLE_LIST *table_list, if (lock_tables(thd, table_list, alter_ctx->tables_opened, 0)) DBUG_RETURN(true); + THD_STAGE_INFO(thd, stage_manage_keys); error= alter_table_manage_keys(table, table->file->indexes_are_disabled(), keys_onoff); @@ -8385,7 +8599,12 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name, { if (table->s->tmp_table != NO_TMP_TABLE) { - if (find_temporary_table(thd, alter_ctx.new_db, alter_ctx.new_name)) + /* + Check whether a temporary table exists with same requested new name. + If such table exists, there must be a corresponding TABLE_SHARE in + THD::all_temp_tables list. + */ + if (thd->find_tmp_table_share(alter_ctx.new_db, alter_ctx.new_name)) { my_error(ER_TABLE_EXISTS_ERROR, MYF(0), alter_ctx.new_alias); DBUG_RETURN(true); @@ -8480,7 +8699,7 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name, till this point for the alter operation. */ if ((alter_info->flags & Alter_info::ADD_FOREIGN_KEY) && - check_fk_parent_table_access(thd, create_info, alter_info)) + check_fk_parent_table_access(thd, create_info, alter_info, new_db)) DBUG_RETURN(true); /* @@ -8538,29 +8757,48 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name, thd->get_stmt_da()->current_statement_warn_count()); my_ok(thd, 0L, 0L, alter_ctx.tmp_name); - if (write_bin_log(thd, true, thd->query(), thd->query_length())) - DBUG_RETURN(true); + /* We don't replicate alter table statement on temporary tables */ + if (table->s->tmp_table == NO_TMP_TABLE || + !thd->is_current_stmt_binlog_format_row()) + { + if (write_bin_log(thd, true, thd->query(), thd->query_length())) + DBUG_RETURN(true); + } DBUG_RETURN(false); } + /* + Test if we are only doing RENAME or KEYS ON/OFF. This works + as we are testing if flags == 0 above. + */ if (!(alter_info->flags & ~(Alter_info::ALTER_RENAME | Alter_info::ALTER_KEYS_ONOFF)) && alter_info->requested_algorithm != - Alter_info::ALTER_TABLE_ALGORITHM_COPY && - !table->s->tmp_table) // no need to touch frm + Alter_info::ALTER_TABLE_ALGORITHM_COPY) // No need to touch frm. { - // This requires X-lock, no other lock levels supported. - if (alter_info->requested_lock != Alter_info::ALTER_TABLE_LOCK_DEFAULT && - alter_info->requested_lock != Alter_info::ALTER_TABLE_LOCK_EXCLUSIVE) + bool res; + + if (!table->s->tmp_table) { - my_error(ER_ALTER_OPERATION_NOT_SUPPORTED, MYF(0), - "LOCK=NONE/SHARED", "LOCK=EXCLUSIVE"); - DBUG_RETURN(true); + // This requires X-lock, no other lock levels supported. + if (alter_info->requested_lock != Alter_info::ALTER_TABLE_LOCK_DEFAULT && + alter_info->requested_lock != Alter_info::ALTER_TABLE_LOCK_EXCLUSIVE) + { + my_error(ER_ALTER_OPERATION_NOT_SUPPORTED, MYF(0), + "LOCK=NONE/SHARED", "LOCK=EXCLUSIVE"); + DBUG_RETURN(true); + } + res= simple_rename_or_index_change(thd, table_list, + alter_info->keys_onoff, + &alter_ctx); + } + else + { + res= simple_tmp_rename_or_index_change(thd, table_list, + alter_info->keys_onoff, + &alter_ctx); } - bool res= simple_rename_or_index_change(thd, table_list, - alter_info->keys_onoff, - &alter_ctx); DBUG_RETURN(res); } @@ -8821,11 +9059,11 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name, // We assume that the table is non-temporary. DBUG_ASSERT(!table->s->tmp_table); - if (!(altered_table= open_table_uncached(thd, new_db_type, &frm, - alter_ctx.get_tmp_path(), - alter_ctx.new_db, - alter_ctx.tmp_name, - true, false))) + if (!(altered_table= + thd->create_and_open_tmp_table(new_db_type, &frm, + alter_ctx.get_tmp_path(), + alter_ctx.new_db, alter_ctx.tmp_name, + false))) goto err_new_table_cleanup; /* Set markers for fields in TABLE object for altered table. */ @@ -8839,7 +9077,10 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name, altered_table->column_bitmaps_set_no_signal(&altered_table->s->all_set, &altered_table->s->all_set); restore_record(altered_table, s->default_values); // Create empty record - if (altered_table->default_field && altered_table->update_default_fields()) + /* Check that we can call default functions with default field values */ + altered_table->reset_default_fields(); + if (altered_table->default_field && + altered_table->update_default_fields(0, 1)) goto err_new_table_cleanup; // Ask storage engine whether to use copy or in-place @@ -8865,7 +9106,7 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name, { ha_alter_info.report_unsupported_error("LOCK=NONE/SHARED", "LOCK=EXCLUSIVE"); - close_temporary_table(thd, altered_table, true, false); + thd->drop_temporary_table(altered_table, NULL, false); goto err_new_table_cleanup; } break; @@ -8876,7 +9117,7 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name, Alter_info::ALTER_TABLE_LOCK_NONE) { ha_alter_info.report_unsupported_error("LOCK=NONE", "LOCK=SHARED"); - close_temporary_table(thd, altered_table, true, false); + thd->drop_temporary_table(altered_table, NULL, false); goto err_new_table_cleanup; } break; @@ -8890,7 +9131,7 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name, { ha_alter_info.report_unsupported_error("ALGORITHM=INPLACE", "ALGORITHM=COPY"); - close_temporary_table(thd, altered_table, true, false); + thd->drop_temporary_table(altered_table, NULL, false); goto err_new_table_cleanup; } // COPY with LOCK=NONE is not supported, no point in trying. @@ -8898,7 +9139,7 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name, Alter_info::ALTER_TABLE_LOCK_NONE) { ha_alter_info.report_unsupported_error("LOCK=NONE", "LOCK=SHARED"); - close_temporary_table(thd, altered_table, true, false); + thd->drop_temporary_table(altered_table, NULL, false); goto err_new_table_cleanup; } // Otherwise use COPY @@ -8906,7 +9147,7 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name, break; case HA_ALTER_ERROR: default: - close_temporary_table(thd, altered_table, true, false); + thd->drop_temporary_table(altered_table, NULL, false); goto err_new_table_cleanup; } @@ -8925,7 +9166,7 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name, } else { - close_temporary_table(thd, altered_table, true, false); + thd->drop_temporary_table(altered_table, NULL, false); } } @@ -8978,13 +9219,18 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name, if (create_info->tmp_table()) { - if (!open_table_uncached(thd, new_db_type, &frm, - alter_ctx.get_tmp_path(), - alter_ctx.new_db, alter_ctx.tmp_name, - true, true)) + TABLE *tmp_table= + thd->create_and_open_tmp_table(new_db_type, &frm, + alter_ctx.get_tmp_path(), + alter_ctx.new_db, alter_ctx.tmp_name, + true); + if (!tmp_table) + { goto err_new_table_cleanup; + } } + /* Open the table since we need to copy the data. */ if (table->s->tmp_table != NO_TMP_TABLE) { @@ -8992,18 +9238,24 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name, tbl.init_one_table(alter_ctx.new_db, strlen(alter_ctx.new_db), alter_ctx.tmp_name, strlen(alter_ctx.tmp_name), alter_ctx.tmp_name, TL_READ_NO_INSERT); - /* Table is in thd->temporary_tables */ - (void) open_temporary_table(thd, &tbl); + /* + Table can be found in the list of open tables in THD::all_temp_tables + list. + */ + tbl.table= thd->find_temporary_table(&tbl); new_table= tbl.table; } else { - /* table is a normal table: Create temporary table in same directory */ - /* Open our intermediate table. */ - new_table= open_table_uncached(thd, new_db_type, &frm, - alter_ctx.get_tmp_path(), - alter_ctx.new_db, alter_ctx.tmp_name, - true, true); + /* + table is a normal table: Create temporary table in same directory. + Open our intermediate table. + */ + new_table= + thd->create_and_open_tmp_table(new_db_type, &frm, + alter_ctx.get_tmp_path(), + alter_ctx.new_db, alter_ctx.tmp_name, + true); } if (!new_table) goto err_new_table_cleanup; @@ -9071,10 +9323,10 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name, new_table->s->table_creation_was_logged= table->s->table_creation_was_logged; /* Remove link to old table and rename the new one */ - close_temporary_table(thd, table, true, true); + thd->drop_temporary_table(table, NULL, true); /* Should pass the 'new_name' as we store table name in the cache */ - if (rename_temporary_table(thd, new_table, - alter_ctx.new_db, alter_ctx.new_name)) + if (thd->rename_temporary_table(new_table, alter_ctx.new_db, + alter_ctx.new_name)) goto err_new_table_cleanup; /* We don't replicate alter table statement on temporary tables */ if (!thd->is_current_stmt_binlog_format_row() && @@ -9086,10 +9338,10 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name, /* Close the intermediate table that will be the new table, but do - not delete it! Even altough MERGE tables do not have their children - attached here it is safe to call close_temporary_table(). + not delete it! Even though MERGE tables do not have their children + attached here it is safe to call THD::drop_temporary_table(). */ - close_temporary_table(thd, new_table, true, false); + thd->drop_temporary_table(new_table, NULL, false); new_table= NULL; DEBUG_SYNC(thd, "alter_table_before_rename_result_table"); @@ -9231,8 +9483,7 @@ err_new_table_cleanup: my_free(const_cast(frm.str)); if (new_table) { - /* close_temporary_table() frees the new_table pointer. */ - close_temporary_table(thd, new_table, true, true); + thd->drop_temporary_table(new_table, NULL, true); } else (void) quick_rm_table(thd, new_db_type, @@ -9278,6 +9529,9 @@ err_new_table_cleanup: err_with_mdl_after_alter: /* the table was altered. binlog the operation */ + DBUG_ASSERT(!(mysql_bin_log.is_open() && + thd->is_current_stmt_binlog_format_row() && + (create_info->tmp_table()))); write_bin_log(thd, true, thd->query(), thd->query_length()); err_with_mdl: @@ -9416,7 +9670,7 @@ copy_data_between_tables(THD *thd, TABLE *from, TABLE *to, Old fields keep their current values, and therefore should not be present in the set of autoupdate fields. */ - if ((*ptr)->has_insert_default_function()) + if ((*ptr)->default_value) { *(dfield_ptr++)= *ptr; ++to->s->default_fields; @@ -9463,7 +9717,9 @@ copy_data_between_tables(THD *thd, TABLE *from, TABLE *to, THD_STAGE_INFO(thd, stage_copy_to_tmp_table); /* Tell handler that we have values for all columns in the to table */ to->use_all_columns(); - to->mark_virtual_columns_for_write(TRUE); + /* Add virtual columns to vcol_set to ensure they are updated */ + if (to->vfield) + to->mark_virtual_columns_for_write(TRUE); if (init_read_record(&info, thd, from, (SQL_SELECT *) 0, file_sort, 1, 1, FALSE)) goto err; @@ -9473,8 +9729,7 @@ copy_data_between_tables(THD *thd, TABLE *from, TABLE *to, to->file->extra(HA_EXTRA_IGNORE_DUP_KEY); thd->get_stmt_da()->reset_current_row_for_warning(); restore_record(to, s->default_values); // Create empty record - if (to->default_field && to->update_default_fields()) - goto err; + to->reset_default_fields(); thd->progress.max_counter= from->file->records(); time_to_report_progress= MY_HOW_OFTEN_TO_WRITE/10; @@ -9515,8 +9770,14 @@ copy_data_between_tables(THD *thd, TABLE *from, TABLE *to, copy_ptr->do_copy(copy_ptr); } prev_insert_id= to->file->next_insert_id; + if (to->default_field) + to->update_default_fields(0, ignore); if (to->vfield) update_virtual_fields(thd, to, VCOL_UPDATE_FOR_WRITE); + + /* This will set thd->is_error() if fatal failure */ + if (to->verify_constraints(ignore) == VIEW_CHECK_SKIP) + continue; if (thd->is_error()) { error= 1; @@ -9586,7 +9847,7 @@ copy_data_between_tables(THD *thd, TABLE *from, TABLE *to, THD_STAGE_INFO(thd, stage_enabling_keys); thd_progress_next_stage(thd); - if (error > 0) + if (error > 0 && !from->s->tmp_table) { /* We are going to drop the temporary table */ to->file->extra(HA_EXTRA_PREPARE_FOR_DROP); @@ -9615,7 +9876,8 @@ copy_data_between_tables(THD *thd, TABLE *from, TABLE *to, to->file->ha_release_auto_increment(); if (to->file->ha_external_lock(thd,F_UNLCK)) error=1; - if (error < 0 && to->file->extra(HA_EXTRA_PREPARE_FOR_RENAME)) + if (error < 0 && !from->s->tmp_table && + to->file->extra(HA_EXTRA_PREPARE_FOR_RENAME)) error= 1; thd_progress_end(thd); DBUG_RETURN(error > 0 ? -1 : 0); @@ -9732,7 +9994,7 @@ bool mysql_checksum_table(THD *thd, TABLE_LIST *tables, /* Allow to open real tables only. */ table->required_type= FRMTYPE_TABLE; - if (open_temporary_tables(thd, table) || + if (thd->open_temporary_tables(table) || open_and_lock_tables(thd, table, FALSE, 0)) { t= NULL; diff --git a/sql/sql_test.cc b/sql/sql_test.cc index 50d51dcc8cc..e70872af6c5 100644 --- a/sql/sql_test.cc +++ b/sql/sql_test.cc @@ -73,16 +73,15 @@ print_where(COND *cond,const char *info, enum_query_type query_type) DBUG_UNLOCK_FILE; } +#ifdef EXTRA_DEBUG /* This is for debugging purposes */ - - static my_bool print_cached_tables_callback(TDC_element *element, void *arg __attribute__((unused))) { TABLE *entry; mysql_mutex_lock(&element->LOCK_table_share); - TDC_element::All_share_tables_list::Iterator it(element->all_tables); + All_share_tables_list::Iterator it(element->all_tables); while ((entry= it++)) { THD *in_use= entry->in_use; @@ -112,6 +111,7 @@ static void print_cached_tables(void) /* purecov: end */ return; } +#endif void TEST_filesort(SORT_FIELD *sortorder,uint s_length) @@ -559,7 +559,6 @@ C_MODE_END void mysql_print_status() { char current_dir[FN_REFLEN]; - char llbuff[10][22]; STATUS_VAR tmp; uint count; @@ -616,6 +615,7 @@ Next alarm time: %lu\n", display_table_locks(); #ifdef HAVE_MALLINFO struct mallinfo info= mallinfo(); + char llbuff[10][22]; printf("\nMemory status:\n\ Non-mmapped space allocated from system: %s\n\ Number of free chunks: %lu\n\ diff --git a/sql/sql_time.cc b/sql/sql_time.cc index eddf14bfbf3..5ef036965b8 100644 --- a/sql/sql_time.cc +++ b/sql/sql_time.cc @@ -427,7 +427,7 @@ bool decimal_to_datetime_with_warn(const my_decimal *value, MYSQL_TIME *ltime, bool int_to_datetime_with_warn(bool neg, ulonglong value, MYSQL_TIME *ltime, ulonglong fuzzydate, const char *field_name) { - const ErrConvInteger str(neg ? -value : value, !neg); + const ErrConvInteger str(neg ? - (longlong) value : (longlong) value, !neg); return number_to_time_with_warn(neg, value, 0, ltime, fuzzydate, &str, field_name); } diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc index 63093620805..5213c21e8a2 100644 --- a/sql/sql_trigger.cc +++ b/sql/sql_trigger.cc @@ -24,7 +24,7 @@ #include "sql_parse.h" // parse_sql #include "parse_file.h" #include "sp.h" -#include "sql_base.h" // find_temporary_table +#include "sql_base.h" #include "sql_show.h" // append_definer, append_identifier #include "sql_table.h" // build_table_filename, // check_n_cut_mysql50_prefix @@ -507,7 +507,7 @@ bool mysql_create_or_drop_trigger(THD *thd, TABLE_LIST *tables, bool create) DBUG_ASSERT(tables->next_global == 0); /* We do not allow creation of triggers on temporary tables. */ - if (create && find_temporary_table(thd, tables)) + if (create && thd->find_tmp_table_share(tables)) { my_error(ER_TRG_ON_VIEW_OR_TEMP_TABLE, MYF(0), tables->alias); goto end; diff --git a/sql/sql_udf.cc b/sql/sql_udf.cc index 502bc88c489..db2ef93204c 100644 --- a/sql/sql_udf.cc +++ b/sql/sql_udf.cc @@ -154,7 +154,7 @@ void udf_init() mysql_rwlock_init(key_rwlock_THR_LOCK_udf, &THR_LOCK_udf); init_sql_alloc(&mem, UDF_ALLOC_BLOCK_SIZE, 0, MYF(0)); - THD *new_thd = new THD; + THD *new_thd = new THD(0); if (!new_thd || my_hash_init(&udf_hash,system_charset_info,32,0,0,get_hash_key, NULL, 0)) { diff --git a/sql/sql_union.cc b/sql/sql_union.cc index 40f01a4db38..a0499f2997d 100644 --- a/sql/sql_union.cc +++ b/sql/sql_union.cc @@ -431,9 +431,9 @@ st_select_lex_unit::init_prepare_fake_select_lex(THD *thd_arg, order=order->next) { (*order->item)->walk(&Item::change_context_processor, 0, - (uchar*) &fake_select_lex->context); + &fake_select_lex->context); (*order->item)->walk(&Item::set_fake_select_as_master_processor, 0, - (uchar*) fake_select_lex); + fake_select_lex); } } @@ -712,8 +712,7 @@ bool st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result, ORDER *ord; Item_func::Functype ft= Item_func::FT_FUNC; for (ord= global_parameters()->order_list.first; ord; ord= ord->next) - if ((*ord->item)->walk (&Item::find_function_processor, FALSE, - (uchar *) &ft)) + if ((*ord->item)->walk (&Item::find_function_processor, FALSE, &ft)) { my_error (ER_CANT_USE_OPTION_HERE, MYF(0), "MATCH()"); goto err; diff --git a/sql/sql_update.cc b/sql/sql_update.cc index 6c60350844e..d59b8b7e048 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -1,5 +1,5 @@ -/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. - Copyright (c) 2011, 2015, MariaDB +/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. + Copyright (c) 2011, 2016, MariaDB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -95,8 +95,8 @@ bool compare_record(const TABLE *table) /* The storage engine has read all columns, so it's safe to compare all bits - including those not in the write_set. This is cheaper than the field-by-field - comparison done above. + including those not in the write_set. This is cheaper than the + field-by-field comparison done above. */ if (table->s->can_cmp_whole_record) return cmp_record(table,record[1]); @@ -353,8 +353,6 @@ int mysql_update(THD *thd, my_error(ER_NON_UPDATABLE_TABLE, MYF(0), table_list->alias, "UPDATE"); DBUG_RETURN(1); } - if (table->default_field) - table->mark_default_fields_for_write(); #ifndef NO_EMBEDDED_ACCESS_CHECKS /* Check values */ @@ -373,7 +371,7 @@ int mysql_update(THD *thd, switch_to_nullable_trigger_fields(fields, table); switch_to_nullable_trigger_fields(values, table); - /* Apply the IN=>EXISTS transformation to all subqueries and optimize them. */ + /* Apply the IN=>EXISTS transformation to all subqueries and optimize them */ if (select_lex->optimize_unflattened_subqueries(false)) DBUG_RETURN(TRUE); @@ -394,14 +392,6 @@ int mysql_update(THD *thd, } } - /* - If a timestamp field settable on UPDATE is present then to avoid wrong - update force the table handler to retrieve write-only fields to be able - to compare records and detect data change. - */ - if ((table->file->ha_table_flags() & HA_PARTIAL_COLUMN_READ) && - table->default_field && table->has_default_function(true)) - bitmap_union(table->read_set, table->write_set); // Don't count on usage of 'only index' when calculating which key to use table->covering_keys.clear_all(); @@ -763,7 +753,7 @@ int mysql_update(THD *thd, if (!can_compare_record || compare_record(table)) { - if (table->default_field && table->update_default_fields()) + if (table->default_field && table->update_default_fields(1, ignore)) { error= 1; break; @@ -828,7 +818,7 @@ int mysql_update(THD *thd, error= 0; } else if (!ignore || - table->file->is_fatal_error(error, HA_CHECK_DUP_KEY)) + table->file->is_fatal_error(error, HA_CHECK_ALL)) { /* If (ignore && error is ignorable) we don't have to @@ -836,7 +826,7 @@ int mysql_update(THD *thd, */ myf flags= 0; - if (table->file->is_fatal_error(error, HA_CHECK_DUP_KEY)) + if (table->file->is_fatal_error(error, HA_CHECK_ALL)) flags|= ME_FATALERROR; /* Other handler errors are fatal */ prepare_record_for_error_message(error, table); @@ -1234,10 +1224,8 @@ bool unsafe_key_update(List leaves, table_map tables_for_update) { // Partitioned key is updated my_error(ER_MULTI_UPDATE_KEY_CONFLICT, MYF(0), - tl->belong_to_view ? tl->belong_to_view->alias - : tl->alias, - tl2->belong_to_view ? tl2->belong_to_view->alias - : tl2->alias); + tl->top_table()->alias, + tl2->top_table()->alias); return true; } @@ -1255,10 +1243,8 @@ bool unsafe_key_update(List leaves, table_map tables_for_update) { // Clustered primary key is updated my_error(ER_MULTI_UPDATE_KEY_CONFLICT, MYF(0), - tl->belong_to_view ? tl->belong_to_view->alias - : tl->alias, - tl2->belong_to_view ? tl2->belong_to_view->alias - : tl2->alias); + tl->top_table()->alias, + tl2->top_table()->alias); return true; } } @@ -1459,11 +1445,13 @@ int mysql_multi_update_prepare(THD *thd) { if (!tl->single_table_updatable() || check_key_in_view(thd, tl)) { - my_error(ER_NON_UPDATABLE_TABLE, MYF(0), tl->alias, "UPDATE"); + my_error(ER_NON_UPDATABLE_TABLE, MYF(0), + tl->top_table()->alias, "UPDATE"); DBUG_RETURN(TRUE); } - DBUG_PRINT("info",("setting table `%s` for update", tl->alias)); + DBUG_PRINT("info",("setting table `%s` for update", + tl->top_table()->alias)); /* If table will be updated we should not downgrade lock for it and leave it as is. @@ -1605,7 +1593,7 @@ bool mysql_multi_update(THD *thd, DBUG_RETURN(TRUE); } - thd->abort_on_warning= thd->is_strict_mode(); + thd->abort_on_warning= !ignore && thd->is_strict_mode(); List total_list; res= mysql_select(thd, @@ -1718,17 +1706,8 @@ int multi_update::prepare(List ¬_used_values, { table->read_set= &table->def_read_set; bitmap_union(table->read_set, &table->tmp_set); - /* - If a timestamp field settable on UPDATE is present then to avoid wrong - update force the table handler to retrieve write-only fields to be able - to compare records and detect data change. - */ - if ((table->file->ha_table_flags() & HA_PARTIAL_COLUMN_READ) && - table->default_field && table->has_default_function(true)) - bitmap_union(table->read_set, table->write_set); } } - if (error) DBUG_RETURN(1); @@ -2119,11 +2098,11 @@ int multi_update::send_data(List ¬_used_values) table->status|= STATUS_UPDATED; store_record(table,record[1]); - if (fill_record_n_invoke_before_triggers(thd, table, *fields_for_table[offset], + if (fill_record_n_invoke_before_triggers(thd, table, + *fields_for_table[offset], *values_for_table[offset], 0, TRG_EVENT_UPDATE)) DBUG_RETURN(1); - /* Reset the table->auto_increment_field_not_null as it is valid for only one row. @@ -2134,7 +2113,7 @@ int multi_update::send_data(List ¬_used_values) { int error; - if (table->default_field && table->update_default_fields()) + if (table->default_field && table->update_default_fields(1, ignore)) DBUG_RETURN(1); if ((error= cur_table->view_check_option(thd, ignore)) != @@ -2161,7 +2140,7 @@ int multi_update::send_data(List ¬_used_values) { updated--; if (!ignore || - table->file->is_fatal_error(error, HA_CHECK_DUP_KEY)) + table->file->is_fatal_error(error, HA_CHECK_ALL)) { /* If (ignore && error == is ignorable) we don't have to @@ -2169,7 +2148,7 @@ int multi_update::send_data(List ¬_used_values) */ myf flags= 0; - if (table->file->is_fatal_error(error, HA_CHECK_DUP_KEY)) + if (table->file->is_fatal_error(error, HA_CHECK_ALL)) flags|= ME_FATALERROR; /* Other handler errors are fatal */ prepare_record_for_error_message(error, table); @@ -2424,7 +2403,8 @@ int multi_update::do_updates() if (!can_compare_record || compare_record(table)) { int error; - if (table->default_field && (error= table->update_default_fields())) + if (table->default_field && + (error= table->update_default_fields(1, ignore))) goto err2; if (table->vfield && update_virtual_fields(thd, table, @@ -2446,7 +2426,7 @@ int multi_update::do_updates() local_error != HA_ERR_RECORD_IS_THE_SAME) { if (!ignore || - table->file->is_fatal_error(local_error, HA_CHECK_DUP_KEY)) + table->file->is_fatal_error(local_error, HA_CHECK_ALL)) { err_table= table; goto err; diff --git a/sql/sql_view.cc b/sql/sql_view.cc index 75b4021d91a..4744b442842 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -1,5 +1,5 @@ /* Copyright (c) 2004, 2013, Oracle and/or its affiliates. - Copyright (c) 2011, 2015, MariaDB + Copyright (c) 2011, 2016, MariaDB Corporation This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -435,8 +435,8 @@ bool mysql_create_view(THD *thd, TABLE_LIST *views, res= TRUE; goto err; } - - if (open_temporary_tables(thd, lex->query_tables) || + + if (thd->open_temporary_tables(lex->query_tables) || open_and_lock_tables(thd, lex->query_tables, TRUE, 0)) { view= lex->unlink_first_table(&link_to_local); diff --git a/sql/sql_window.cc b/sql/sql_window.cc index e3e42fc4f75..4c5ef53d854 100644 --- a/sql/sql_window.cc +++ b/sql/sql_window.cc @@ -696,7 +696,7 @@ public: - in table->record[0].. - rownum parameter has the row number. */ - void on_next_partition(int rownum) + void on_next_partition(ha_rows rownum) { /* Remember the sort key value from the new partition */ bound_tracker.check_if_next_group(); @@ -706,7 +706,7 @@ public: /* Moves to a new row. The row is assumed to be within the current partition */ - void move_to(int rownum) { tbl_cursor.move_to(rownum); } + void move_to(ha_rows rownum) { tbl_cursor.move_to(rownum); } /* This returns -1 when end of partition was reached. @@ -796,8 +796,8 @@ public: - The callee may move tbl->file and tbl->record[0] to point to some other row. */ - virtual void pre_next_partition(longlong rownum, Item_sum* item){}; - virtual void next_partition(longlong rownum, Item_sum* item)=0; + virtual void pre_next_partition(ha_rows rownum, Item_sum* item){}; + virtual void next_partition(ha_rows rownum, Item_sum* item)=0; /* The current row has moved one row forward. @@ -872,13 +872,13 @@ public: item_add->fix_fields(thd, &item_add); } - void pre_next_partition(longlong rownum, Item_sum* item) + void pre_next_partition(ha_rows rownum, Item_sum* item) { // Save the value of FUNC(current_row) range_expr->fetch_value_from(item_add); } - void next_partition(longlong rownum, Item_sum* item) + void next_partition(ha_rows rownum, Item_sum* item) { cursor.move_to(rownum); walk_till_non_peer(item); @@ -982,7 +982,7 @@ public: item_add->fix_fields(thd, &item_add); } - void pre_next_partition(longlong rownum, Item_sum* item) + void pre_next_partition(ha_rows rownum, Item_sum* item) { // Save the value of FUNC(current_row) range_expr->fetch_value_from(item_add); @@ -991,7 +991,7 @@ public: end_of_partition= false; } - void next_partition(longlong rownum, Item_sum* item) + void next_partition(ha_rows rownum, Item_sum* item) { cursor.move_to(rownum); walk_till_non_peer(item); @@ -1068,7 +1068,7 @@ public: peer_tracker.init(thd, order_list); } - void pre_next_partition(longlong rownum, Item_sum* item) + void pre_next_partition(ha_rows rownum, Item_sum* item) { // Save the value of the current_row peer_tracker.check_if_next_group(); @@ -1080,7 +1080,7 @@ public: } } - void next_partition(longlong rownum, Item_sum* item) + void next_partition(ha_rows rownum, Item_sum* item) { walk_till_non_peer(item); } @@ -1158,14 +1158,14 @@ public: peer_tracker.init(thd, order_list); } - void pre_next_partition(longlong rownum, Item_sum* item) + void pre_next_partition(ha_rows rownum, Item_sum* item) { // Fetch the value from the first row peer_tracker.check_if_next_group(); cursor.move_to(rownum+1); } - void next_partition(longlong rownum, Item_sum* item) {} + void next_partition(ha_rows rownum, Item_sum* item) {} void pre_next_row(Item_sum* item) { @@ -1214,7 +1214,7 @@ public: class Frame_unbounded_preceding : public Frame_cursor { public: - void next_partition(longlong rownum, Item_sum* item) + void next_partition(ha_rows rownum, Item_sum* item) { /* UNBOUNDED PRECEDING frame end just stays on the first row. @@ -1245,12 +1245,12 @@ public: cursor.init(thd, info, partition_list); } - void pre_next_partition(longlong rownum, Item_sum* item) + void pre_next_partition(ha_rows rownum, Item_sum* item) { cursor.on_next_partition(rownum); } - void next_partition(longlong rownum, Item_sum* item) + void next_partition(ha_rows rownum, Item_sum* item) { if (!rownum) { @@ -1279,9 +1279,9 @@ class Frame_unbounded_following_set_count : public Frame_unbounded_following public: // pre_next_partition is inherited - void next_partition(longlong rownum, Item_sum* item) + void next_partition(ha_rows rownum, Item_sum* item) { - ulonglong num_rows_in_partition= 0; + ha_rows num_rows_in_partition= 0; if (!rownum) { /* Read the first row */ @@ -1330,7 +1330,7 @@ public: cursor.init(info); } - void next_partition(longlong rownum, Item_sum* item) + void next_partition(ha_rows rownum, Item_sum* item) { /* Position our cursor to point at the first row in the new partition @@ -1391,11 +1391,11 @@ public: class Frame_rows_current_row_bottom : public Frame_cursor { public: - void pre_next_partition(longlong rownum, Item_sum* item) + void pre_next_partition(ha_rows rownum, Item_sum* item) { item->add(); } - void next_partition(longlong rownum, Item_sum* item) {} + void next_partition(ha_rows rownum, Item_sum* item) {} void pre_next_row(Item_sum* item) { /* Temp table's current row is current_row. Add it to the window func */ @@ -1456,7 +1456,7 @@ public: at_partition_end= false; } - void pre_next_partition(longlong rownum, Item_sum* item) + void pre_next_partition(ha_rows rownum, Item_sum* item) { at_partition_end= false; @@ -1476,10 +1476,10 @@ public: } /* Move our cursor to be n_rows ahead. */ - void next_partition(longlong rownum, Item_sum* item) + void next_partition(ha_rows rownum, Item_sum* item) { - longlong i_end= n_rows + ((rownum==0)?1:0)- is_top_bound; - for (longlong i= 0; i < i_end; i++) + ha_rows i_end= n_rows + ((rownum==0)?1:0)- is_top_bound; + for (ha_rows i= 0; i < i_end; i++) { if (next_row_intern(item)) break; @@ -1561,10 +1561,10 @@ Frame_cursor *get_frame_cursor(Window_frame *frame, bool is_top_bound) if (frame->units == Window_frame::UNITS_ROWS) { - longlong n_rows= bound->offset->val_int(); + ha_rows n_rows= bound->offset->val_int(); /* These should be handled in the parser */ DBUG_ASSERT(!bound->offset->null_value); - DBUG_ASSERT(n_rows >= 0); + DBUG_ASSERT((longlong) n_rows >= 0); if (is_preceding) return new Frame_n_rows_preceding(is_top_bound, n_rows); else @@ -1676,7 +1676,7 @@ void get_window_func_required_cursors( bool compute_window_func_with_frames(Item_window_func *item_win, TABLE *tbl, READ_RECORD *info) { - THD *thd= current_thd; + THD *thd= tbl->in_use; int err= 0; Item_sum *sum_func= item_win->window_func(); @@ -1695,7 +1695,7 @@ bool compute_window_func_with_frames(Item_window_func *item_win, } bool is_error= false; - longlong rownum= 0; + ha_rows rownum= 0; uchar *rowid_buf= (uchar*) my_malloc(tbl->file->ref_length, MYF(0)); while (true) diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index e6b0c8e353a..8a263ae23f7 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -1,6 +1,6 @@ /* Copyright (c) 2000, 2015, Oracle and/or its affiliates. - Copyright (c) 2010, 2015, MariaDB + Copyright (c) 2010, 2016, MariaDB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -102,6 +102,9 @@ int yylex(void *yylval, void *yythd); MYSQL_YYABORT; \ } +#define my_yyabort_error(A) \ + do { my_error A; MYSQL_YYABORT; } while(0) + #ifndef DBUG_OFF #define YYDEBUG 1 #else @@ -737,13 +740,6 @@ bool setup_select_in_parentheses(LEX *lex) my_parse_error(lex->thd, ER_SYNTAX_ERROR); return TRUE; } - if (sel->linkage == UNION_TYPE && - sel->olap != UNSPECIFIED_OLAP_TYPE && - sel->master_unit()->fake_select_lex) - { - my_error(ER_WRONG_USAGE, MYF(0), "CUBE/ROLLUP", "ORDER BY"); - return TRUE; - } return FALSE; } @@ -943,6 +939,32 @@ bool LEX::set_bincmp(CHARSET_INFO *cs, bool bin) MYSQL_YYABORT; \ } while(0) +Virtual_column_info *add_virtual_expression(THD *thd, const char *txt, + size_t size, Item *expr) +{ + CHARSET_INFO *cs= thd->charset(); + Virtual_column_info *v= new (thd->mem_root) Virtual_column_info(); + if (!v) + { + mem_alloc_error(sizeof(Virtual_column_info)); + return 0; + } + /* + We have to remove white space as remember_cur_pos may have pointed to end + of previous expression. + */ + while (cs->state_map[*(uchar*)txt] == MY_LEX_SKIP) + { + txt++; + size--; + } + v->expr_str.str= (char* ) thd->strmake(txt, size); + v->expr_str.length= size; + v->expr_item= expr; + v->utf8= 0; /* connection charset */ + return v; +} + %} %union { int num; @@ -993,6 +1015,7 @@ bool LEX::set_bincmp(CHARSET_INFO *cs, bool bin) class sp_name *spname; class sp_variable *spvar; class With_clause *with_clause; + class Virtual_column_info *virtual_column; handlerton *db_type; st_select_lex *select_lex; @@ -1038,10 +1061,10 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); %parse-param { THD *thd } %lex-param { THD *thd } /* - Currently there are 102 shift/reduce conflicts. + Currently there are 103 shift/reduce conflicts. We should not introduce new conflicts any more. */ -%expect 102 +%expect 103 /* Comments for TOKENS. @@ -1226,7 +1249,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); %token ENGINES_SYM %token ENGINE_SYM %token ENUM -%token EQ /* OPERATOR */ %token EQUAL_SYM /* OPERATOR */ %token ERROR_SYM %token ERRORS @@ -1278,7 +1300,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); %token GRANTS %token GROUP_SYM /* SQL-2003-R */ %token GROUP_CONCAT_SYM -%token GT_SYM /* OPERATOR */ %token HANDLER_SYM %token HARD_SYM %token HASH_SYM @@ -1358,7 +1379,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); %token LONG_SYM %token LOOP_SYM %token LOW_PRIORITY -%token LT /* OPERATOR */ %token MASTER_CONNECT_RETRY_SYM %token MASTER_GTID_POS_SYM %token MASTER_HOST_SYM @@ -1613,6 +1633,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); %token STD_SYM %token STOP_SYM %token STORAGE_SYM +%token STORED_SYM %token STRAIGHT_JOIN %token STRING_SYM %token SUBCLASS_ORIGIN_SYM /* SQL-2003-N */ @@ -1729,7 +1750,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); %left XOR %left AND_SYM AND_AND_SYM %left BETWEEN_SYM CASE_SYM WHEN_SYM THEN_SYM ELSE -%left EQ EQUAL_SYM GE GT_SYM LE LT NE IS LIKE REGEXP IN_SYM +%left '=' EQUAL_SYM GE '>' LE '<' NE IS LIKE REGEXP IN_SYM %left '|' %left '&' %left SHIFT_LEFT SHIFT_RIGHT @@ -1758,7 +1779,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); table_ident_opt_wild create_like %type - remember_name remember_end opt_db remember_tok_start + remember_name remember_end opt_db remember_tok_start remember_cur_pos wild_and_where field_length opt_field_length opt_field_length_default_1 @@ -1833,11 +1854,11 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); literal text_literal insert_ident order_ident temporal_literal simple_ident expr opt_expr opt_else sum_expr in_sum_expr variable variable_aux bool_pri - predicate bit_expr - table_wild simple_expr udf_expr + predicate bit_expr parenthesized_expr + table_wild simple_expr column_default_non_parenthesized_expr udf_expr expr_or_default set_expr_or_default - geometry_function - signed_literal now_or_signed_literal opt_escape + geometry_function signed_literal expr_or_literal + opt_escape sp_opt_default simple_ident_nospvar simple_ident_q field_or_var limit_option @@ -1936,6 +1957,9 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); %type select_outvar +%type opt_check_constraint check_constraint virtual_column_func + column_default_expr + %type analyze_stmt_command query verb_clause create change select do drop insert replace insert2 @@ -1949,7 +1973,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); persistent_column_stat_spec persistent_index_stat_spec table_column_list table_index_list table_index_name check start checksum - field_list field_list_item kill key_def + field_list field_list_item kill key_def constraint_def keycache_list keycache_list_or_parts assign_to_keycache assign_to_keycache_parts preload_list preload_list_or_parts preload_keys preload_keys_parts @@ -1999,7 +2023,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); definer_opt no_definer definer get_diagnostics parse_vcol_expr vcol_opt_specifier vcol_opt_attribute vcol_opt_attribute_list vcol_attribute - explainable_command + explainable_command opt_impossible_action END_OF_INPUT %type call sp_proc_stmts sp_proc_stmts1 sp_proc_stmt @@ -2089,10 +2113,8 @@ query: { if (!thd->bootstrap && (!(thd->lex->select_lex.options & OPTION_FOUND_COMMENT))) - { - my_message(ER_EMPTY_QUERY, ER_THD(thd, ER_EMPTY_QUERY), MYF(0)); - MYSQL_YYABORT; - } + my_yyabort_error((ER_EMPTY_QUERY, MYF(0))); + thd->lex->sql_command= SQLCOM_EMPTY_QUERY; YYLIP->found_semicolon= NULL; } @@ -2275,10 +2297,7 @@ help: HELP_SYM { if (Lex->sphead) - { - my_error(ER_SP_BADSTATEMENT, MYF(0), "HELP"); - MYSQL_YYABORT; - } + my_yyabort_error((ER_SP_BADSTATEMENT, MYF(0), "HELP")); } ident_or_text { @@ -2305,77 +2324,73 @@ master_defs: ; master_def: - MASTER_HOST_SYM EQ TEXT_STRING_sys + MASTER_HOST_SYM '=' TEXT_STRING_sys { Lex->mi.host = $3.str; } - | MASTER_USER_SYM EQ TEXT_STRING_sys + | MASTER_USER_SYM '=' TEXT_STRING_sys { Lex->mi.user = $3.str; } - | MASTER_PASSWORD_SYM EQ TEXT_STRING_sys + | MASTER_PASSWORD_SYM '=' TEXT_STRING_sys { Lex->mi.password = $3.str; } - | MASTER_PORT_SYM EQ ulong_num + | MASTER_PORT_SYM '=' ulong_num { Lex->mi.port = $3; } - | MASTER_CONNECT_RETRY_SYM EQ ulong_num + | MASTER_CONNECT_RETRY_SYM '=' ulong_num { Lex->mi.connect_retry = $3; } - | MASTER_SSL_SYM EQ ulong_num + | MASTER_SSL_SYM '=' ulong_num { Lex->mi.ssl= $3 ? LEX_MASTER_INFO::LEX_MI_ENABLE : LEX_MASTER_INFO::LEX_MI_DISABLE; } - | MASTER_SSL_CA_SYM EQ TEXT_STRING_sys + | MASTER_SSL_CA_SYM '=' TEXT_STRING_sys { Lex->mi.ssl_ca= $3.str; } - | MASTER_SSL_CAPATH_SYM EQ TEXT_STRING_sys + | MASTER_SSL_CAPATH_SYM '=' TEXT_STRING_sys { Lex->mi.ssl_capath= $3.str; } - | MASTER_SSL_CERT_SYM EQ TEXT_STRING_sys + | MASTER_SSL_CERT_SYM '=' TEXT_STRING_sys { Lex->mi.ssl_cert= $3.str; } - | MASTER_SSL_CIPHER_SYM EQ TEXT_STRING_sys + | MASTER_SSL_CIPHER_SYM '=' TEXT_STRING_sys { Lex->mi.ssl_cipher= $3.str; } - | MASTER_SSL_KEY_SYM EQ TEXT_STRING_sys + | MASTER_SSL_KEY_SYM '=' TEXT_STRING_sys { Lex->mi.ssl_key= $3.str; } - | MASTER_SSL_VERIFY_SERVER_CERT_SYM EQ ulong_num + | MASTER_SSL_VERIFY_SERVER_CERT_SYM '=' ulong_num { Lex->mi.ssl_verify_server_cert= $3 ? LEX_MASTER_INFO::LEX_MI_ENABLE : LEX_MASTER_INFO::LEX_MI_DISABLE; } - | MASTER_SSL_CRL_SYM EQ TEXT_STRING_sys + | MASTER_SSL_CRL_SYM '=' TEXT_STRING_sys { Lex->mi.ssl_crl= $3.str; } - | MASTER_SSL_CRLPATH_SYM EQ TEXT_STRING_sys + | MASTER_SSL_CRLPATH_SYM '=' TEXT_STRING_sys { Lex->mi.ssl_crlpath= $3.str; } - | MASTER_HEARTBEAT_PERIOD_SYM EQ NUM_literal + | MASTER_HEARTBEAT_PERIOD_SYM '=' NUM_literal { Lex->mi.heartbeat_period= (float) $3->val_real(); if (Lex->mi.heartbeat_period > SLAVE_MAX_HEARTBEAT_PERIOD || Lex->mi.heartbeat_period < 0.0) - { - const char format[]= "%d"; - char buf[4*sizeof(SLAVE_MAX_HEARTBEAT_PERIOD) + sizeof(format)]; - sprintf(buf, format, SLAVE_MAX_HEARTBEAT_PERIOD); - my_error(ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE, MYF(0), buf); - MYSQL_YYABORT; - } + my_yyabort_error((ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE, MYF(0), + SLAVE_MAX_HEARTBEAT_PERIOD)); + if (Lex->mi.heartbeat_period > slave_net_timeout) { push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, @@ -2395,15 +2410,15 @@ master_def: } Lex->mi.heartbeat_opt= LEX_MASTER_INFO::LEX_MI_ENABLE; } - | IGNORE_SERVER_IDS_SYM EQ '(' ignore_server_id_list ')' + | IGNORE_SERVER_IDS_SYM '=' '(' ignore_server_id_list ')' { Lex->mi.repl_ignore_server_ids_opt= LEX_MASTER_INFO::LEX_MI_ENABLE; } - | DO_DOMAIN_IDS_SYM EQ '(' do_domain_id_list ')' + | DO_DOMAIN_IDS_SYM '=' '(' do_domain_id_list ')' { Lex->mi.repl_do_domain_ids_opt= LEX_MASTER_INFO::LEX_MI_ENABLE; } - | IGNORE_DOMAIN_IDS_SYM EQ '(' ignore_domain_id_list ')' + | IGNORE_DOMAIN_IDS_SYM '=' '(' ignore_domain_id_list ')' { Lex->mi.repl_ignore_domain_ids_opt= LEX_MASTER_INFO::LEX_MI_ENABLE; } @@ -2451,60 +2466,51 @@ ignore_domain_id: ; master_file_def: - MASTER_LOG_FILE_SYM EQ TEXT_STRING_sys + MASTER_LOG_FILE_SYM '=' TEXT_STRING_sys { Lex->mi.log_file_name = $3.str; } - | MASTER_LOG_POS_SYM EQ ulonglong_num + | MASTER_LOG_POS_SYM '=' ulonglong_num { /* If the user specified a value < BIN_LOG_HEADER_SIZE, adjust it instead of causing subsequent errors. We need to do it in this file, because only there we know that - MASTER_LOG_POS has been explicitely specified. On the contrary + MASTER_LOG_POS has been explicitly specified. On the contrary in change_master() (sql_repl.cc) we cannot distinguish between 0 - (MASTER_LOG_POS explicitely specified as 0) and 0 (unspecified), + (MASTER_LOG_POS explicitly specified as 0) and 0 (unspecified), whereas we want to distinguish (specified 0 means "read the binlog from 0" (4 in fact), unspecified means "don't change the position (keep the preceding value)"). */ Lex->mi.pos= MY_MAX(BIN_LOG_HEADER_SIZE, $3); } - | RELAY_LOG_FILE_SYM EQ TEXT_STRING_sys + | RELAY_LOG_FILE_SYM '=' TEXT_STRING_sys { Lex->mi.relay_log_name = $3.str; } - | RELAY_LOG_POS_SYM EQ ulong_num + | RELAY_LOG_POS_SYM '=' ulong_num { Lex->mi.relay_log_pos = $3; /* Adjust if < BIN_LOG_HEADER_SIZE (same comment as Lex->mi.pos) */ Lex->mi.relay_log_pos= MY_MAX(BIN_LOG_HEADER_SIZE, Lex->mi.relay_log_pos); } - | MASTER_USE_GTID_SYM EQ CURRENT_POS_SYM + | MASTER_USE_GTID_SYM '=' CURRENT_POS_SYM { if (Lex->mi.use_gtid_opt != LEX_MASTER_INFO::LEX_GTID_UNCHANGED) - { - my_error(ER_DUP_ARGUMENT, MYF(0), "MASTER_use_gtid"); - MYSQL_YYABORT; - } + my_yyabort_error((ER_DUP_ARGUMENT, MYF(0), "MASTER_use_gtid")); Lex->mi.use_gtid_opt= LEX_MASTER_INFO::LEX_GTID_CURRENT_POS; } - | MASTER_USE_GTID_SYM EQ SLAVE_POS_SYM + | MASTER_USE_GTID_SYM '=' SLAVE_POS_SYM { if (Lex->mi.use_gtid_opt != LEX_MASTER_INFO::LEX_GTID_UNCHANGED) - { - my_error(ER_DUP_ARGUMENT, MYF(0), "MASTER_use_gtid"); - MYSQL_YYABORT; - } + my_yyabort_error((ER_DUP_ARGUMENT, MYF(0), "MASTER_use_gtid")); Lex->mi.use_gtid_opt= LEX_MASTER_INFO::LEX_GTID_SLAVE_POS; } - | MASTER_USE_GTID_SYM EQ NO_SYM + | MASTER_USE_GTID_SYM '=' NO_SYM { if (Lex->mi.use_gtid_opt != LEX_MASTER_INFO::LEX_GTID_UNCHANGED) - { - my_error(ER_DUP_ARGUMENT, MYF(0), "MASTER_use_gtid"); - MYSQL_YYABORT; - } + my_yyabort_error((ER_DUP_ARGUMENT, MYF(0), "MASTER_use_gtid")); Lex->mi.use_gtid_opt= LEX_MASTER_INFO::LEX_GTID_NO; } ; @@ -2524,10 +2530,7 @@ connection_name: Lex->mi.connection_name= $1; #ifdef HAVE_REPLICATION if (check_master_connection_name(&$1)) - { - my_error(ER_WRONG_ARGUMENTS, MYF(0), "MASTER_CONNECTION_NAME"); - MYSQL_YYABORT; - } + my_yyabort_error((ER_WRONG_ARGUMENTS, MYF(0), "MASTER_CONNECTION_NAME")); #endif } ; @@ -2838,10 +2841,7 @@ ev_sql_stmt: - CREATE PROCEDURE ... BEGIN DROP EVENT ... END| */ if (lex->sphead) - { - my_error(ER_EVENT_RECURSION_FORBIDDEN, MYF(0)); - MYSQL_YYABORT; - } + my_yyabort_error((ER_EVENT_RECURSION_FORBIDDEN, MYF(0))); if (!make_sp_head(thd, lex->event_parse_data->identifier, TYPE_ENUM_PROCEDURE)) MYSQL_YYABORT; @@ -2880,14 +2880,9 @@ sp_name: ident '.' ident { if (!$1.str || check_db_name(&$1)) - { - my_error(ER_WRONG_DB_NAME, MYF(0), $1.str); - MYSQL_YYABORT; - } + my_yyabort_error((ER_WRONG_DB_NAME, MYF(0), $1.str)); if (check_routine_name(&$3)) - { MYSQL_YYABORT; - } $$= new (thd->mem_root) sp_name($1, $3, true); if ($$ == NULL) MYSQL_YYABORT; @@ -2903,7 +2898,7 @@ sp_name: } if (lex->copy_db_to(&db.str, &db.length)) MYSQL_YYABORT; - $$= new (lex->thd->mem_root) sp_name(db, $1, false); + $$= new (thd->mem_root) sp_name(db, $1, false); if ($$ == NULL) MYSQL_YYABORT; $$->init_qname(thd); @@ -3008,10 +3003,7 @@ sp_param_name_and_type: sp_pcontext *spc= lex->spcont; if (spc->find_variable($1, TRUE)) - { - my_error(ER_SP_DUP_PARAM, MYF(0), $1.str); - MYSQL_YYABORT; - } + my_yyabort_error((ER_SP_DUP_PARAM, MYF(0), $1.str)); sp_variable *spvar= spc->add_variable(thd, $1); @@ -3079,17 +3071,9 @@ sp_decls: shift/reduce conflicts with the wrong result. (And we get better error handling this way.) */ if (($2.vars || $2.conds) && ($1.curs || $1.hndlrs)) - { /* Variable or condition following cursor or handler */ - my_message(ER_SP_VARCOND_AFTER_CURSHNDLR, - ER_THD(thd, ER_SP_VARCOND_AFTER_CURSHNDLR), MYF(0)); - MYSQL_YYABORT; - } + my_yyabort_error((ER_SP_VARCOND_AFTER_CURSHNDLR, MYF(0))); if ($2.curs && $1.hndlrs) - { /* Cursor following handler */ - my_message(ER_SP_CURSOR_AFTER_HANDLER, - ER_THD(thd, ER_SP_CURSOR_AFTER_HANDLER), MYF(0)); - MYSQL_YYABORT; - } + my_yyabort_error((ER_SP_CURSOR_AFTER_HANDLER, MYF(0))); $$.vars= $1.vars + $2.vars; $$.conds= $1.conds + $2.conds; $$.hndlrs= $1.hndlrs + $2.hndlrs; @@ -3154,16 +3138,11 @@ sp_decl: /* The last instruction is responsible for freeing LEX. */ - sp_instr_set *is= (new (lex->thd->mem_root) + sp_instr_set *is= new (lex->thd->mem_root) sp_instr_set(lex->sphead->instructions(), - pctx, - var_idx, - dflt_value_item, - $4.field_type(), - lex, - last)); - if (is == NULL || - lex->sphead->add_instr(is)) + pctx, var_idx, dflt_value_item, + $4.field_type(), lex, last); + if (is == NULL || lex->sphead->add_instr(is)) MYSQL_YYABORT; } @@ -3179,10 +3158,7 @@ sp_decl: sp_pcontext *spc= lex->spcont; if (spc->find_condition($2, TRUE)) - { - my_error(ER_SP_DUP_COND, MYF(0), $2.str); - MYSQL_YYABORT; - } + my_yyabort_error((ER_SP_DUP_COND, MYF(0), $2.str)); if(spc->add_condition(thd, $2, $5)) MYSQL_YYABORT; $$.vars= $$.hndlrs= $$.curs= 0; @@ -3201,7 +3177,7 @@ sp_decl: sp_pcontext *ctx= lex->spcont; sp_instr_hpush_jump *i= - new (lex->thd->mem_root) sp_instr_hpush_jump(sp->instructions(), + new (thd->mem_root) sp_instr_hpush_jump(sp->instructions(), ctx, h); if (i == NULL || sp->add_instr(i)) @@ -3225,7 +3201,7 @@ sp_decl: if ($2 == sp_handler::CONTINUE) { - i= new (lex->thd->mem_root) + i= new (thd->mem_root) sp_instr_hreturn(sp->instructions(), ctx); if (i == NULL || sp->add_instr(i)) @@ -3233,7 +3209,7 @@ sp_decl: } else { /* EXIT or UNDO handler, just jump to the end of the block */ - i= new (lex->thd->mem_root) + i= new (thd->mem_root) sp_instr_hreturn(sp->instructions(), ctx); if (i == NULL || sp->add_instr(i) || @@ -3256,17 +3232,12 @@ sp_decl: sp_instr_cpush *i; if (ctx->find_cursor($2, &offp, TRUE)) - { - my_error(ER_SP_DUP_CURS, MYF(0), $2.str); - delete $5; - MYSQL_YYABORT; - } - i= new (lex->thd->mem_root) - sp_instr_cpush(sp->instructions(), ctx, $5, - ctx->current_cursor_count()); - if (i == NULL || - sp->add_instr(i) || - ctx->add_cursor($2)) + my_yyabort_error((ER_SP_DUP_CURS, MYF(0), $2.str)); + + i= new (thd->mem_root) + sp_instr_cpush(sp->instructions(), ctx, $5, + ctx->current_cursor_count()); + if (i == NULL || sp->add_instr(i) || ctx->add_cursor($2)) MYSQL_YYABORT; $$.vars= $$.conds= $$.hndlrs= 0; $$.curs= 1; @@ -3284,11 +3255,7 @@ sp_cursor_stmt: DBUG_ASSERT(lex->sql_command == SQLCOM_SELECT); if (lex->result) - { - my_message(ER_SP_BAD_CURSOR_SELECT, ER_THD(thd, ER_SP_BAD_CURSOR_SELECT), - MYF(0)); - MYSQL_YYABORT; - } + my_yyabort_error((ER_SP_BAD_CURSOR_SELECT, MYF(0))); lex->sp_lex_in_use= TRUE; $$= lex; if (lex->sphead->restore_lex(thd)) @@ -3317,17 +3284,10 @@ sp_hcond_element: sp_pcontext *ctx= lex->spcont->parent_context(); if (ctx->check_duplicate_handler($1)) - { - my_message(ER_SP_DUP_HANDLER, ER_THD(thd, ER_SP_DUP_HANDLER), MYF(0)); - MYSQL_YYABORT; - } - else - { - sp_instr_hpush_jump *i= - (sp_instr_hpush_jump *)sp->last_instruction(); + my_yyabort_error((ER_SP_DUP_HANDLER, MYF(0))); - i->add_condition($1); - } + sp_instr_hpush_jump *i= (sp_instr_hpush_jump *)sp->last_instruction(); + i->add_condition($1); } ; @@ -3335,10 +3295,7 @@ sp_cond: ulong_num { /* mysql errno */ if ($1 == 0) - { - my_error(ER_WRONG_VALUE, MYF(0), "CONDITION", "0"); - MYSQL_YYABORT; - } + my_yyabort_error((ER_WRONG_VALUE, MYF(0), "CONDITION", "0")); $$= new (thd->mem_root) sp_condition_value($1); if ($$ == NULL) MYSQL_YYABORT; @@ -3358,10 +3315,7 @@ sqlstate: condition. */ if (!is_sqlstate_valid(&$3) || is_sqlstate_completion($3.str)) - { - my_error(ER_SP_BAD_SQLSTATE, MYF(0), $3.str); - MYSQL_YYABORT; - } + my_yyabort_error((ER_SP_BAD_SQLSTATE, MYF(0), $3.str)); $$= new (thd->mem_root) sp_condition_value($3.str); if ($$ == NULL) MYSQL_YYABORT; @@ -3382,10 +3336,7 @@ sp_hcond: { $$= Lex->spcont->find_condition($1, false); if ($$ == NULL) - { - my_error(ER_SP_COND_MISMATCH, MYF(0), $1.str); - MYSQL_YYABORT; - } + my_yyabort_error((ER_SP_COND_MISMATCH, MYF(0), $1.str)); } | SQLWARNING_SYM /* SQLSTATEs 01??? */ { @@ -3426,23 +3377,15 @@ signal_value: { LEX *lex= Lex; sp_condition_value *cond; + + /* SIGNAL foo cannot be used outside of stored programs */ if (lex->spcont == NULL) - { - /* SIGNAL foo cannot be used outside of stored programs */ - my_error(ER_SP_COND_MISMATCH, MYF(0), $1.str); - MYSQL_YYABORT; - } + my_yyabort_error((ER_SP_COND_MISMATCH, MYF(0), $1.str)); cond= lex->spcont->find_condition($1, false); if (cond == NULL) - { - my_error(ER_SP_COND_MISMATCH, MYF(0), $1.str); - MYSQL_YYABORT; - } + my_yyabort_error((ER_SP_COND_MISMATCH, MYF(0), $1.str)); if (cond->type != sp_condition_value::SQLSTATE) - { - my_error(ER_SIGNAL_BAD_CONDITION_TYPE, MYF(0)); - MYSQL_YYABORT; - } + my_yyabort_error((ER_SIGNAL_BAD_CONDITION_TYPE, MYF(0))); $$= cond; } | sqlstate @@ -3465,7 +3408,7 @@ opt_set_signal_information: ; signal_information_item_list: - signal_condition_information_item_name EQ signal_allowed_expr + signal_condition_information_item_name '=' signal_allowed_expr { Set_signal_information *info; info= &thd->m_parser_state->m_yacc.m_set_signal_info; @@ -3474,17 +3417,14 @@ signal_information_item_list: info->m_item[index]= $3; } | signal_information_item_list ',' - signal_condition_information_item_name EQ signal_allowed_expr + signal_condition_information_item_name '=' signal_allowed_expr { Set_signal_information *info; info= &thd->m_parser_state->m_yacc.m_set_signal_info; int index= (int) $3; if (info->m_item[index] != NULL) - { - my_error(ER_DUP_SIGNAL_SET, MYF(0), - Diag_condition_item_names[index].str); - MYSQL_YYABORT; - } + my_yyabort_error((ER_DUP_SIGNAL_SET, MYF(0), + Diag_condition_item_names[index].str)); info->m_item[index]= $5; } ; @@ -3613,7 +3553,7 @@ statement_information: ; statement_information_item: - simple_target_specification EQ statement_information_item_name + simple_target_specification '=' statement_information_item_name { $$= new (thd->mem_root) Statement_information_item($3, $1); if ($$ == NULL) @@ -3670,7 +3610,7 @@ condition_information: ; condition_information_item: - simple_target_specification EQ condition_information_item_name + simple_target_specification '=' condition_information_item_name { $$= new (thd->mem_root) Condition_information_item($3, $1); if ($$ == NULL) @@ -3715,10 +3655,7 @@ sp_decl_idents: sp_pcontext *spc= lex->spcont; if (spc->find_variable($1, TRUE)) - { - my_error(ER_SP_DUP_VAR, MYF(0), $1.str); - MYSQL_YYABORT; - } + my_yyabort_error((ER_SP_DUP_VAR, MYF(0), $1.str)); spc->add_variable(thd, $1); $$= 1; } @@ -3730,10 +3667,7 @@ sp_decl_idents: sp_pcontext *spc= lex->spcont; if (spc->find_variable($3, TRUE)) - { - my_error(ER_SP_DUP_VAR, MYF(0), $3.str); - MYSQL_YYABORT; - } + my_yyabort_error((ER_SP_DUP_VAR, MYF(0), $3.str)); spc->add_variable(thd, $3); $$= $1 + 1; } @@ -3804,11 +3738,9 @@ sp_proc_stmt_statement: sp_head *sp= lex->sphead; sp->m_flags|= sp_get_flags_for_command(lex); + /* "USE db" doesn't work in a procedure */ if (lex->sql_command == SQLCOM_CHANGE_DB) - { /* "USE db" doesn't work in a procedure */ - my_error(ER_SP_BADSTATEMENT, MYF(0), "USE"); - MYSQL_YYABORT; - } + my_yyabort_error((ER_SP_BADSTATEMENT, MYF(0), "USE")); /* Don't add an instruction for SET statements, since all instructions for them were already added during processing @@ -3818,7 +3750,7 @@ sp_proc_stmt_statement: lex->var_list.is_empty()); if (lex->sql_command != SQLCOM_SET_OPTION) { - sp_instr_stmt *i=new (lex->thd->mem_root) + sp_instr_stmt *i=new (thd->mem_root) sp_instr_stmt(sp->instructions(), lex->spcont, lex); if (i == NULL) MYSQL_YYABORT; @@ -3852,22 +3784,17 @@ sp_proc_stmt_return: sp_head *sp= lex->sphead; if (sp->m_type != TYPE_ENUM_FUNCTION) - { - my_message(ER_SP_BADRETURN, ER_THD(thd, ER_SP_BADRETURN), MYF(0)); - MYSQL_YYABORT; - } - else - { - sp_instr_freturn *i; + my_yyabort_error((ER_SP_BADRETURN, MYF(0))); - i= new (lex->thd->mem_root) + sp_instr_freturn *i; + + i= new (thd->mem_root) sp_instr_freturn(sp->instructions(), lex->spcont, $3, sp->m_return_field_def.sql_type, lex); - if (i == NULL || - sp->add_instr(i)) - MYSQL_YYABORT; - sp->m_flags|= sp_head::HAS_RETURN; - } + if (i == NULL || sp->add_instr(i)) + MYSQL_YYABORT; + sp->m_flags|= sp_head::HAS_RETURN; + if (sp->restore_lex(thd)) MYSQL_YYABORT; } @@ -3882,49 +3809,44 @@ sp_proc_stmt_leave: sp_label *lab= ctx->find_label($2); if (! lab) - { - my_error(ER_SP_LILABEL_MISMATCH, MYF(0), "LEAVE", $2.str); - MYSQL_YYABORT; - } - else - { - sp_instr_jump *i; - uint ip= sp->instructions(); - uint n; - /* - When jumping to a BEGIN-END block end, the target jump - points to the block hpop/cpop cleanup instructions, - so we should exclude the block context here. - When jumping to something else (i.e., SP_LAB_ITER), - there are no hpop/cpop at the jump destination, - so we should include the block context here for cleanup. - */ - bool exclusive= (lab->type == sp_label::BEGIN); + my_yyabort_error((ER_SP_LILABEL_MISMATCH, MYF(0), "LEAVE", $2.str)); - n= ctx->diff_handlers(lab->ctx, exclusive); - if (n) - { - sp_instr_hpop *hpop= new (lex->thd->mem_root) - sp_instr_hpop(ip++, ctx, n); - if (hpop == NULL) - MYSQL_YYABORT; - sp->add_instr(hpop); - } - n= ctx->diff_cursors(lab->ctx, exclusive); - if (n) - { - sp_instr_cpop *cpop= new (lex->thd->mem_root) - sp_instr_cpop(ip++, ctx, n); - if (cpop == NULL) - MYSQL_YYABORT; - sp->add_instr(cpop); - } - i= new (lex->thd->mem_root) sp_instr_jump(ip, ctx); - if (i == NULL) + sp_instr_jump *i; + uint ip= sp->instructions(); + uint n; + /* + When jumping to a BEGIN-END block end, the target jump + points to the block hpop/cpop cleanup instructions, + so we should exclude the block context here. + When jumping to something else (i.e., SP_LAB_ITER), + there are no hpop/cpop at the jump destination, + so we should include the block context here for cleanup. + */ + bool exclusive= (lab->type == sp_label::BEGIN); + + n= ctx->diff_handlers(lab->ctx, exclusive); + if (n) + { + sp_instr_hpop *hpop= new (thd->mem_root) + sp_instr_hpop(ip++, ctx, n); + if (hpop == NULL) MYSQL_YYABORT; - sp->push_backpatch(thd, i, lab); /* Jumping forward */ - sp->add_instr(i); + sp->add_instr(hpop); } + n= ctx->diff_cursors(lab->ctx, exclusive); + if (n) + { + sp_instr_cpop *cpop= new (thd->mem_root) + sp_instr_cpop(ip++, ctx, n); + if (cpop == NULL) + MYSQL_YYABORT; + sp->add_instr(cpop); + } + i= new (thd->mem_root) sp_instr_jump(ip, ctx); + if (i == NULL) + MYSQL_YYABORT; + sp->push_backpatch(thd, i, lab); /* Jumping forward */ + sp->add_instr(i); } ; @@ -3937,40 +3859,35 @@ sp_proc_stmt_iterate: sp_label *lab= ctx->find_label($2); if (! lab || lab->type != sp_label::ITERATION) - { - my_error(ER_SP_LILABEL_MISMATCH, MYF(0), "ITERATE", $2.str); - MYSQL_YYABORT; - } - else - { - sp_instr_jump *i; - uint ip= sp->instructions(); - uint n; + my_yyabort_error((ER_SP_LILABEL_MISMATCH, MYF(0), "ITERATE", $2.str)); - n= ctx->diff_handlers(lab->ctx, FALSE); /* Inclusive the dest. */ - if (n) - { - sp_instr_hpop *hpop= new (lex->thd->mem_root) - sp_instr_hpop(ip++, ctx, n); - if (hpop == NULL || - sp->add_instr(hpop)) - MYSQL_YYABORT; - } - n= ctx->diff_cursors(lab->ctx, FALSE); /* Inclusive the dest. */ - if (n) - { - sp_instr_cpop *cpop= new (lex->thd->mem_root) - sp_instr_cpop(ip++, ctx, n); - if (cpop == NULL || - sp->add_instr(cpop)) - MYSQL_YYABORT; - } - i= new (lex->thd->mem_root) - sp_instr_jump(ip, ctx, lab->ip); /* Jump back */ - if (i == NULL || - sp->add_instr(i)) + sp_instr_jump *i; + uint ip= sp->instructions(); + uint n; + + n= ctx->diff_handlers(lab->ctx, FALSE); /* Inclusive the dest. */ + if (n) + { + sp_instr_hpop *hpop= new (thd->mem_root) + sp_instr_hpop(ip++, ctx, n); + if (hpop == NULL || + sp->add_instr(hpop)) MYSQL_YYABORT; } + n= ctx->diff_cursors(lab->ctx, FALSE); /* Inclusive the dest. */ + if (n) + { + sp_instr_cpop *cpop= new (thd->mem_root) + sp_instr_cpop(ip++, ctx, n); + if (cpop == NULL || + sp->add_instr(cpop)) + MYSQL_YYABORT; + } + i= new (thd->mem_root) + sp_instr_jump(ip, ctx, lab->ip); /* Jump back */ + if (i == NULL || + sp->add_instr(i)) + MYSQL_YYABORT; } ; @@ -3983,11 +3900,8 @@ sp_proc_stmt_open: sp_instr_copen *i; if (! lex->spcont->find_cursor($2, &offset, false)) - { - my_error(ER_SP_CURSOR_MISMATCH, MYF(0), $2.str); - MYSQL_YYABORT; - } - i= new (lex->thd->mem_root) + my_yyabort_error((ER_SP_CURSOR_MISMATCH, MYF(0), $2.str)); + i= new (thd->mem_root) sp_instr_copen(sp->instructions(), lex->spcont, offset); if (i == NULL || sp->add_instr(i)) @@ -4004,11 +3918,8 @@ sp_proc_stmt_fetch: sp_instr_cfetch *i; if (! lex->spcont->find_cursor($3, &offset, false)) - { - my_error(ER_SP_CURSOR_MISMATCH, MYF(0), $3.str); - MYSQL_YYABORT; - } - i= new (lex->thd->mem_root) + my_yyabort_error((ER_SP_CURSOR_MISMATCH, MYF(0), $3.str)); + i= new (thd->mem_root) sp_instr_cfetch(sp->instructions(), lex->spcont, offset); if (i == NULL || sp->add_instr(i)) @@ -4027,11 +3938,8 @@ sp_proc_stmt_close: sp_instr_cclose *i; if (! lex->spcont->find_cursor($2, &offset, false)) - { - my_error(ER_SP_CURSOR_MISMATCH, MYF(0), $2.str); - MYSQL_YYABORT; - } - i= new (lex->thd->mem_root) + my_yyabort_error((ER_SP_CURSOR_MISMATCH, MYF(0), $2.str)); + i= new (thd->mem_root) sp_instr_cclose(sp->instructions(), lex->spcont, offset); if (i == NULL || sp->add_instr(i)) @@ -4054,17 +3962,11 @@ sp_fetch_list: sp_variable *spv; if (!spc || !(spv = spc->find_variable($1, false))) - { - my_error(ER_SP_UNDECLARED_VAR, MYF(0), $1.str); - MYSQL_YYABORT; - } - else - { - /* An SP local variable */ - sp_instr_cfetch *i= (sp_instr_cfetch *)sp->last_instruction(); + my_yyabort_error((ER_SP_UNDECLARED_VAR, MYF(0), $1.str)); - i->add_to_varlist(spv); - } + /* An SP local variable */ + sp_instr_cfetch *i= (sp_instr_cfetch *)sp->last_instruction(); + i->add_to_varlist(spv); } | sp_fetch_list ',' ident { @@ -4074,17 +3976,11 @@ sp_fetch_list: sp_variable *spv; if (!spc || !(spv = spc->find_variable($3, false))) - { - my_error(ER_SP_UNDECLARED_VAR, MYF(0), $3.str); - MYSQL_YYABORT; - } - else - { - /* An SP local variable */ - sp_instr_cfetch *i= (sp_instr_cfetch *)sp->last_instruction(); + my_yyabort_error((ER_SP_UNDECLARED_VAR, MYF(0), $3.str)); - i->add_to_varlist(spv); - } + /* An SP local variable */ + sp_instr_cfetch *i= (sp_instr_cfetch *)sp->last_instruction(); + i->add_to_varlist(spv); } ; @@ -4096,7 +3992,7 @@ sp_if: sp_head *sp= lex->sphead; sp_pcontext *ctx= lex->spcont; uint ip= sp->instructions(); - sp_instr_jump_if_not *i= new (lex->thd->mem_root) + sp_instr_jump_if_not *i= new (thd->mem_root) sp_instr_jump_if_not(ip, ctx, $2, lex); if (i == NULL || sp->push_backpatch(thd, i, ctx->push_label(thd, empty_lex_str, 0)) || @@ -4304,10 +4200,7 @@ sp_labeled_block: sp_label *lab= ctx->find_label($1); if (lab) - { - my_error(ER_SP_LABEL_REDEFINE, MYF(0), $1.str); - MYSQL_YYABORT; - } + my_yyabort_error((ER_SP_LABEL_REDEFINE, MYF(0), $1.str)); lex->name= $1; } sp_block_content sp_opt_label @@ -4315,10 +4208,7 @@ sp_labeled_block: if ($6.str) { if (my_strcasecmp(system_charset_info, $6.str, $5->name.str) != 0) - { - my_error(ER_SP_LABEL_MISMATCH, MYF(0), $6.str); - MYSQL_YYABORT; - } + my_yyabort_error((ER_SP_LABEL_MISMATCH, MYF(0), $6.str)); } } ; @@ -4372,7 +4262,7 @@ sp_block_content: } if ($2.curs) { - i= new (lex->thd->mem_root) + i= new (thd->mem_root) sp_instr_cpop(sp->instructions(), ctx, $2.curs); if (i == NULL || sp->add_instr(i)) @@ -4389,7 +4279,7 @@ loop_body: LEX *lex= Lex; uint ip= lex->sphead->instructions(); sp_label *lab= lex->spcont->last_label(); /* Jumping back */ - sp_instr_jump *i= new (lex->thd->mem_root) + sp_instr_jump *i= new (thd->mem_root) sp_instr_jump(ip, lex->spcont, lab->ip); if (i == NULL || lex->sphead->add_instr(i)) @@ -4403,7 +4293,7 @@ while_body: LEX *lex= Lex; sp_head *sp= lex->sphead; uint ip= sp->instructions(); - sp_instr_jump_if_not *i= new (lex->thd->mem_root) + sp_instr_jump_if_not *i= new (thd->mem_root) sp_instr_jump_if_not(ip, lex->spcont, $1, lex); if (i == NULL || /* Jumping forward */ @@ -4419,7 +4309,7 @@ while_body: LEX *lex= Lex; uint ip= lex->sphead->instructions(); sp_label *lab= lex->spcont->last_label(); /* Jumping back */ - sp_instr_jump *i= new (lex->thd->mem_root) + sp_instr_jump *i= new (thd->mem_root) sp_instr_jump(ip, lex->spcont, lab->ip); if (i == NULL || lex->sphead->add_instr(i)) @@ -4436,7 +4326,7 @@ repeat_body: LEX *lex= Lex; uint ip= lex->sphead->instructions(); sp_label *lab= lex->spcont->last_label(); /* Jumping back */ - sp_instr_jump_if_not *i= new (lex->thd->mem_root) + sp_instr_jump_if_not *i= new (thd->mem_root) sp_instr_jump_if_not(ip, lex->spcont, $4, lab->ip, lex); if (i == NULL || lex->sphead->add_instr(i)) @@ -4457,10 +4347,7 @@ pop_sp_label: { if (my_strcasecmp(system_charset_info, $1.str, lab->name.str) != 0) - { - my_error(ER_SP_LABEL_MISMATCH, MYF(0), $1.str); - MYSQL_YYABORT; - } + my_yyabort_error((ER_SP_LABEL_MISMATCH, MYF(0), $1.str)); } } ; @@ -4827,10 +4714,7 @@ opt_ts_nodegroup: { LEX *lex= Lex; if (lex->alter_tablespace_info->nodegroup_id != UNDEF_NODEGROUP) - { - my_error(ER_FILEGROUP_OPTION_ONLY_ONCE,MYF(0),"NODEGROUP"); - MYSQL_YYABORT; - } + my_yyabort_error((ER_FILEGROUP_OPTION_ONLY_ONCE,MYF(0),"NODEGROUP")); lex->alter_tablespace_info->nodegroup_id= $3; } ; @@ -4840,10 +4724,7 @@ opt_ts_comment: { LEX *lex= Lex; if (lex->alter_tablespace_info->ts_comment != NULL) - { - my_error(ER_FILEGROUP_OPTION_ONLY_ONCE,MYF(0),"COMMENT"); - MYSQL_YYABORT; - } + my_yyabort_error((ER_FILEGROUP_OPTION_ONLY_ONCE,MYF(0),"COMMENT")); lex->alter_tablespace_info->ts_comment= $3.str; } ; @@ -4853,11 +4734,8 @@ opt_ts_engine: { LEX *lex= Lex; if (lex->alter_tablespace_info->storage_engine != NULL) - { - my_error(ER_FILEGROUP_OPTION_ONLY_ONCE,MYF(0), - "STORAGE ENGINE"); - MYSQL_YYABORT; - } + my_yyabort_error((ER_FILEGROUP_OPTION_ONLY_ONCE, MYF(0), + "STORAGE ENGINE")); lex->alter_tablespace_info->storage_engine= $4; } ; @@ -4877,10 +4755,7 @@ ts_wait: { LEX *lex= Lex; if (!(lex->alter_tablespace_info->wait_until_completed)) - { - my_error(ER_FILEGROUP_OPTION_ONLY_ONCE,MYF(0),"NO_WAIT"); - MYSQL_YYABORT; - } + my_yyabort_error((ER_FILEGROUP_OPTION_ONLY_ONCE,MYF(0),"NO_WAIT")); lex->alter_tablespace_info->wait_until_completed= FALSE; } ; @@ -4912,23 +4787,14 @@ size_number: text_shift_number+=10; break; default: - { - my_error(ER_WRONG_SIZE_NUMBER, MYF(0)); - MYSQL_YYABORT; - } + my_yyabort_error((ER_WRONG_SIZE_NUMBER, MYF(0))); } if (prefix_number >> 31) - { - my_error(ER_SIZE_OVERFLOW_ERROR, MYF(0)); - MYSQL_YYABORT; - } + my_yyabort_error((ER_SIZE_OVERFLOW_ERROR, MYF(0))); number= prefix_number << text_shift_number; } else - { - my_error(ER_WRONG_SIZE_NUMBER, MYF(0)); - MYSQL_YYABORT; - } + my_yyabort_error((ER_WRONG_SIZE_NUMBER, MYF(0))); $$= number; } ; @@ -4948,7 +4814,10 @@ create_body: CREATE TABLE t1 (SELECT 1); */ | '(' create_select_query_specification ')' - { Select->set_braces(1);} union_opt {} + | '(' create_select_query_specification ')' + { Select->set_braces(1);} union_list {} + | '(' create_select_query_specification ')' + { Select->set_braces(1);} union_order_or_limit {} | create_like { @@ -4980,7 +4849,10 @@ create_select_query_expression_body: | SELECT_SYM create_select_part2 create_select_part3_union_not_ready create_select_part4 | '(' create_select_query_specification ')' - { Select->set_braces(1);} union_opt {} + | '(' create_select_query_specification ')' + { Select->set_braces(1);} union_list {} + | '(' create_select_query_specification ')' + { Select->set_braces(1);} union_order_or_limit {} ; opt_create_partitioning: @@ -5049,15 +4921,11 @@ have_partitioning: #ifdef WITH_PARTITION_STORAGE_ENGINE LEX_STRING partition_name={C_STRING_WITH_LEN("partition")}; if (!plugin_is_ready(&partition_name, MYSQL_STORAGE_ENGINE_PLUGIN)) - { - my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0), - "--skip-partition"); - MYSQL_YYABORT; - } + my_yyabort_error((ER_OPTION_PREVENTS_STATEMENT, MYF(0), + "--skip-partition")); #else - my_error(ER_FEATURE_DISABLED, MYF(0), "partitioning", - "--with-plugin-partition"); - MYSQL_YYABORT; + my_yyabort_error((ER_FEATURE_DISABLED, MYF(0), "partitioning", + "--with-plugin-partition")); #endif } ; @@ -5080,7 +4948,9 @@ partition_entry: ; partition: - BY part_type_def opt_num_parts opt_sub_part part_defs + BY + { Lex->safe_to_cache_query= 1; } + part_type_def opt_num_parts opt_sub_part part_defs ; part_type_def: @@ -5113,7 +4983,7 @@ opt_linear: opt_key_algo: /* empty */ { Lex->part_info->key_algorithm= partition_info::KEY_ALGORITHM_NONE;} - | ALGORITHM_SYM EQ real_ulong_num + | ALGORITHM_SYM '=' real_ulong_num { switch ($3) { case 1: @@ -5150,11 +5020,8 @@ part_field_item: MYSQL_YYABORT; } if (part_info->num_columns > MAX_REF_PARTS) - { - my_error(ER_TOO_MANY_PARTITION_FUNC_FIELDS_ERROR, MYF(0), - "list of partition fields"); - MYSQL_YYABORT; - } + my_yyabort_error((ER_TOO_MANY_PARTITION_FUNC_FIELDS_ERROR, MYF(0), + "list of partition fields")); } ; @@ -5195,10 +5062,7 @@ opt_num_parts: uint num_parts= $2; partition_info *part_info= Lex->part_info; if (num_parts == 0) - { - my_error(ER_NO_PARTS_ERROR, MYF(0), "partitions"); - MYSQL_YYABORT; - } + my_yyabort_error((ER_NO_PARTS_ERROR, MYF(0), "partitions")); part_info->num_parts= num_parts; part_info->use_default_num_partitions= FALSE; @@ -5235,22 +5099,15 @@ sub_part_field_item: MYSQL_YYABORT; } if (part_info->subpart_field_list.elements > MAX_REF_PARTS) - { - my_error(ER_TOO_MANY_PARTITION_FUNC_FIELDS_ERROR, MYF(0), - "list of subpartition fields"); - MYSQL_YYABORT; - } + my_yyabort_error((ER_TOO_MANY_PARTITION_FUNC_FIELDS_ERROR, MYF(0), + "list of subpartition fields")); } ; part_func_expr: bit_expr { - LEX *lex= Lex; - bool not_corr_func; - not_corr_func= !lex->safe_to_cache_query; - lex->safe_to_cache_query= 1; - if (not_corr_func) + if (!Lex->safe_to_cache_query) { my_parse_error(thd, ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR); MYSQL_YYABORT; @@ -5266,10 +5123,7 @@ opt_num_subparts: uint num_parts= $2; LEX *lex= Lex; if (num_parts == 0) - { - my_error(ER_NO_PARTS_ERROR, MYF(0), "subpartitions"); - MYSQL_YYABORT; - } + my_yyabort_error((ER_NO_PARTS_ERROR, MYF(0), "subpartitions")); lex->part_info->num_subparts= num_parts; lex->part_info->use_default_num_subpartitions= FALSE; } @@ -5280,17 +5134,11 @@ part_defs: { partition_info *part_info= Lex->part_info; if (part_info->part_type == RANGE_PARTITION) - { - my_error(ER_PARTITIONS_MUST_BE_DEFINED_ERROR, MYF(0), - "RANGE"); - MYSQL_YYABORT; - } - else if (part_info->part_type == LIST_PARTITION) - { - my_error(ER_PARTITIONS_MUST_BE_DEFINED_ERROR, MYF(0), - "LIST"); - MYSQL_YYABORT; - } + my_yyabort_error((ER_PARTITIONS_MUST_BE_DEFINED_ERROR, MYF(0), + "RANGE")); + if (part_info->part_type == LIST_PARTITION) + my_yyabort_error((ER_PARTITIONS_MUST_BE_DEFINED_ERROR, MYF(0), + "LIST")); } | '(' part_def_list ')' { @@ -5360,17 +5208,11 @@ opt_part_values: if (! lex->is_partition_management()) { if (part_info->part_type == RANGE_PARTITION) - { - my_error(ER_PARTITION_REQUIRES_VALUES_ERROR, MYF(0), - "RANGE", "LESS THAN"); - MYSQL_YYABORT; - } + my_yyabort_error((ER_PARTITION_REQUIRES_VALUES_ERROR, MYF(0), + "RANGE", "LESS THAN")); if (part_info->part_type == LIST_PARTITION) - { - my_error(ER_PARTITION_REQUIRES_VALUES_ERROR, MYF(0), - "LIST", "IN"); - MYSQL_YYABORT; - } + my_yyabort_error((ER_PARTITION_REQUIRES_VALUES_ERROR, MYF(0), + "LIST", "IN")); } else part_info->part_type= HASH_PARTITION; @@ -5382,11 +5224,8 @@ opt_part_values: if (! lex->is_partition_management()) { if (part_info->part_type != RANGE_PARTITION) - { - my_error(ER_PARTITION_WRONG_VALUES_ERROR, MYF(0), - "RANGE", "LESS THAN"); - MYSQL_YYABORT; - } + my_yyabort_error((ER_PARTITION_WRONG_VALUES_ERROR, MYF(0), + "RANGE", "LESS THAN")); } else part_info->part_type= RANGE_PARTITION; @@ -5399,11 +5238,8 @@ opt_part_values: if (! lex->is_partition_management()) { if (part_info->part_type != LIST_PARTITION) - { - my_error(ER_PARTITION_WRONG_VALUES_ERROR, MYF(0), - "LIST", "IN"); - MYSQL_YYABORT; - } + my_yyabort_error((ER_PARTITION_WRONG_VALUES_ERROR, MYF(0), + "LIST", "IN")); } else part_info->part_type= LIST_PARTITION; @@ -6017,12 +5853,16 @@ create_table_option: } | IDENT_sys equal TEXT_STRING_sys { + if ($3.length > ENGINE_OPTION_MAX_LENGTH) + my_yyabort_error((ER_VALUE_TOO_LONG, MYF(0), $1.str)); new (thd->mem_root) engine_option_value($1, $3, true, &Lex->create_info.option_list, &Lex->option_list_last); } | IDENT_sys equal ident { + if ($3.length > ENGINE_OPTION_MAX_LENGTH) + my_yyabort_error((ER_VALUE_TOO_LONG, MYF(0), $1.str)); new (thd->mem_root) engine_option_value($1, $3, false, &Lex->create_info.option_list, &Lex->option_list_last); @@ -6077,10 +5917,7 @@ storage_engines: else { if (thd->variables.sql_mode & MODE_NO_ENGINE_SUBSTITUTION) - { - my_error(ER_UNKNOWN_STORAGE_ENGINE, MYF(0), $1.str); - MYSQL_YYABORT; - } + my_yyabort_error((ER_UNKNOWN_STORAGE_ENGINE, MYF(0), $1.str)); $$= 0; push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, ER_UNKNOWN_STORAGE_ENGINE, @@ -6097,10 +5934,7 @@ known_storage_engines: if ((plugin= ha_resolve_by_name(thd, &$1, false))) $$= plugin_hton(plugin); else - { - my_error(ER_UNKNOWN_STORAGE_ENGINE, MYF(0), $1.str); - MYSQL_YYABORT; - } + my_yyabort_error((ER_UNKNOWN_STORAGE_ENGINE, MYF(0), $1.str)); } ; @@ -6143,11 +5977,14 @@ field_list: field_list_item: column_def { } | key_def + | constraint_def ; column_def: - field_spec opt_check_constraint { $$= $1; } - | field_spec references { $$= $1; } + field_spec opt_check_constraint + { $$= $1; $$->check_constraint= $2; } + | field_spec references + { $$= $1; } ; key_def: @@ -6231,16 +6068,31 @@ key_def: /* Only used for ALTER TABLE. Ignored otherwise. */ lex->alter_info.flags|= Alter_info::ADD_FOREIGN_KEY; } - | opt_constraint check_constraint { } - ; + ; + +constraint_def: + opt_constraint check_constraint + { + Lex->add_constraint(&$1, $2); + } + ; opt_check_constraint: - /* empty */ - | check_constraint + /* empty */ { $$= (Virtual_column_info*) 0; } + | check_constraint { $$= $1;} ; check_constraint: - CHECK_SYM '(' expr ')' + CHECK_SYM '(' remember_name expr remember_end ')' + { + Virtual_column_info *v= + add_virtual_expression(thd, $3+1, (uint)($5 - $3) - 1, $4); + if (!v) + { + MYSQL_YYABORT; + } + $$= v; + } ; opt_constraint: @@ -6260,10 +6112,7 @@ field_spec: if (check_string_char_length(&$1, 0, NAME_CHAR_LEN, system_charset_info, 1)) - { - my_error(ER_TOO_LONG_IDENT, MYF(0), $1.str); - MYSQL_YYABORT; - } + my_yyabort_error((ER_TOO_LONG_IDENT, MYF(0), $1.str)); if (!f) MYSQL_YYABORT; @@ -6292,8 +6141,8 @@ field_spec: field_def: opt_attribute - | opt_generated_always AS - '(' virtual_column_func ')' + | opt_generated_always AS virtual_column_func + { Lex->last_field->vcol_info= $3; } vcol_opt_specifier vcol_opt_attribute ; @@ -6315,6 +6164,10 @@ vcol_opt_specifier: { Lex->last_field->vcol_info->set_stored_in_db_flag(TRUE); } + | STORED_SYM + { + Lex->last_field->vcol_info->set_stored_in_db_flag(TRUE); + } ; vcol_opt_attribute: @@ -6344,38 +6197,65 @@ vcol_attribute: ; parse_vcol_expr: - PARSE_VCOL_EXPR_SYM '(' virtual_column_func ')' + PARSE_VCOL_EXPR_SYM virtual_column_func { /* "PARSE_VCOL_EXPR" can only be used by the SQL server when reading a '*.frm' file. Prevent the end user from invoking this command. */ - if (!Lex->parse_vcol_expr) - { - my_message(ER_SYNTAX_ERROR, ER_THD(thd, ER_SYNTAX_ERROR), MYF(0)); - MYSQL_YYABORT; - } + MYSQL_YYABORT_UNLESS(Lex->parse_vcol_expr); + Lex->last_field->vcol_info= $2; } ; -virtual_column_func: - remember_name expr remember_end +parenthesized_expr: + subselect { - Virtual_column_info *v= new (thd->mem_root) Virtual_column_info(); + $$= new (thd->mem_root) Item_singlerow_subselect(thd, $1); + if ($$ == NULL) + MYSQL_YYABORT; + } + | expr + | expr ',' expr_list + { + $3->push_front($1, thd->mem_root); + $$= new (thd->mem_root) Item_row(thd, *$3); + if ($$ == NULL) + MYSQL_YYABORT; + } + ; + +virtual_column_func: + '(' remember_cur_pos parenthesized_expr remember_end ')' + { + Virtual_column_info *v= + add_virtual_expression(thd, $2, (uint)($4 - $2), $3); if (!v) { - mem_alloc_error(sizeof(Virtual_column_info)); MYSQL_YYABORT; } - uint expr_len= (uint)($3 - $1) - 1; - v->expr_str.str= (char* ) thd->memdup($1 + 1, expr_len); - v->expr_str.length= expr_len; - v->expr_item= $2; - Lex->last_field->vcol_info= v; + $$= v; } ; +expr_or_literal: column_default_non_parenthesized_expr | signed_literal ; + +column_default_expr: + virtual_column_func + | remember_name expr_or_literal opt_impossible_action remember_end + { + if (!($$= add_virtual_expression(thd, $1, (uint) ($4- $1), $2))) + MYSQL_YYABORT; + } + ; + +/* This is to force remember_end to look at next token */ +opt_impossible_action: + IMPOSSIBLE_ACTION {} + | /* empty */ {} + + field_type: int_type opt_field_length field_options { $$.set($1, $2); } | real_type opt_precision field_options { $$.set($1, $2); } @@ -6387,12 +6267,9 @@ field_type: int err; ulonglong tmp_length= my_strtoll10($2.length(), NULL, &err); if (err || tmp_length > PRECISION_FOR_DOUBLE) - { - my_error(ER_WRONG_FIELD_SPEC, MYF(0), - Lex->last_field->field_name); - MYSQL_YYABORT; - } - else if (tmp_length > PRECISION_FOR_FLOAT) + my_yyabort_error((ER_WRONG_FIELD_SPEC, MYF(0), + Lex->last_field->field_name)); + if (tmp_length > PRECISION_FOR_FLOAT) $$.set(MYSQL_TYPE_DOUBLE); else $$.set(MYSQL_TYPE_FLOAT); @@ -6498,9 +6375,8 @@ field_type: Lex->last_field->geom_type= $1; $$.set(MYSQL_TYPE_GEOMETRY, $2); #else - my_error(ER_FEATURE_DISABLED, MYF(0), - sym_group_geom.name, sym_group_geom.needed_define); - MYSQL_YYABORT; + my_yyabort_error((ER_FEATURE_DISABLED, MYF(0), sym_group_geom.name, + sym_group_geom.needed_define)); #endif } | MEDIUMBLOB @@ -6605,7 +6481,7 @@ srid_option: /* empty */ { Lex->last_field->srid= 0; } | - REF_SYSTEM_ID_SYM EQ NUM + REF_SYSTEM_ID_SYM '=' NUM { Lex->last_field->srid=atoi($3.str); } @@ -6669,7 +6545,7 @@ opt_attribute_list: attribute: NULL_SYM { Lex->last_field->flags&= ~ NOT_NULL_FLAG; } | not NULL_SYM { Lex->last_field->flags|= NOT_NULL_FLAG; } - | DEFAULT now_or_signed_literal { Lex->last_field->def= $2; } + | DEFAULT column_default_expr { Lex->last_field->default_value= $2; } | ON UPDATE_SYM NOW_SYM opt_default_time_precision { Item *item= new (thd->mem_root) Item_func_now_local(thd, $4); @@ -6706,24 +6582,22 @@ attribute: | COLLATE_SYM collation_name { if (Lex->charset && !my_charset_same(Lex->charset,$2)) - { - my_error(ER_COLLATION_CHARSET_MISMATCH, MYF(0), - $2->name,Lex->charset->csname); - MYSQL_YYABORT; - } - else - { - Lex->last_field->charset= $2; - } + my_yyabort_error((ER_COLLATION_CHARSET_MISMATCH, MYF(0), + $2->name,Lex->charset->csname)); + Lex->last_field->charset= $2; } | IDENT_sys equal TEXT_STRING_sys { + if ($3.length > ENGINE_OPTION_MAX_LENGTH) + my_yyabort_error((ER_VALUE_TOO_LONG, MYF(0), $1.str)); new (thd->mem_root) engine_option_value($1, $3, true, &Lex->last_field->option_list, &Lex->option_list_last); } | IDENT_sys equal ident { + if ($3.length > ENGINE_OPTION_MAX_LENGTH) + my_yyabort_error((ER_VALUE_TOO_LONG, MYF(0), $1.str)); new (thd->mem_root) engine_option_value($1, $3, false, &Lex->last_field->option_list, &Lex->option_list_last); @@ -6756,18 +6630,6 @@ type_with_opt_collate: } ; - -now_or_signed_literal: - NOW_SYM opt_default_time_precision - { - $$= new (thd->mem_root) Item_func_now_local(thd, $2); - if ($$ == NULL) - MYSQL_YYABORT; - } - | signed_literal - { $$=$1; } - ; - charset: CHAR_SYM SET {} | CHARSET {} @@ -6777,10 +6639,7 @@ charset_name: ident_or_text { if (!($$=get_charset_by_csname($1.str,MY_CS_PRIMARY,MYF(0)))) - { - my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), $1.str); - MYSQL_YYABORT; - } + my_yyabort_error((ER_UNKNOWN_CHARACTER_SET, MYF(0), $1.str)); } | BINARY { $$= &my_charset_bin; } ; @@ -6800,10 +6659,7 @@ old_or_new_charset_name: { if (!($$=get_charset_by_csname($1.str,MY_CS_PRIMARY,MYF(0))) && !($$=get_old_charset_by_name($1.str))) - { - my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), $1.str); - MYSQL_YYABORT; - } + my_yyabort_error((ER_UNKNOWN_CHARACTER_SET, MYF(0), $1.str)); } | BINARY { $$= &my_charset_bin; } ; @@ -6842,10 +6698,7 @@ charset_or_alias: | UNICODE_SYM { if (!($$= get_charset_by_csname("ucs2", MY_CS_PRIMARY,MYF(0)))) - { - my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), "ucs2"); - MYSQL_YYABORT; - } + my_yyabort_error((ER_UNKNOWN_CHARACTER_SET, MYF(0), "ucs2")); } ; @@ -7061,9 +6914,8 @@ spatial: #ifdef HAVE_SPATIAL $$= Key::SPATIAL; #else - my_error(ER_FEATURE_DISABLED, MYF(0), - sym_group_geom.name, sym_group_geom.needed_define); - MYSQL_YYABORT; + my_yyabort_error((ER_FEATURE_DISABLED, MYF(0), sym_group_geom.name, + sym_group_geom.needed_define)); #endif } ; @@ -7122,12 +6974,16 @@ all_key_opt: { Lex->last_key->key_create_info.comment= $2; } | IDENT_sys equal TEXT_STRING_sys { + if ($3.length > ENGINE_OPTION_MAX_LENGTH) + my_yyabort_error((ER_VALUE_TOO_LONG, MYF(0), $1.str)); new (thd->mem_root) engine_option_value($1, $3, true, &Lex->option_list, &Lex->option_list_last); } | IDENT_sys equal ident { + if ($3.length > ENGINE_OPTION_MAX_LENGTH) + my_yyabort_error((ER_VALUE_TOO_LONG, MYF(0), $1.str)); new (thd->mem_root) engine_option_value($1, $3, false, &Lex->option_list, &Lex->option_list_last); @@ -7161,10 +7017,7 @@ fulltext_key_opt: if (plugin_is_ready(&$3, MYSQL_FTPARSER_PLUGIN)) Lex->last_key->key_create_info.parser_name= $3; else - { - my_error(ER_FUNCTION_NOT_DEFINED, MYF(0), $3.str); - MYSQL_YYABORT; - } + my_yyabort_error((ER_FUNCTION_NOT_DEFINED, MYF(0), $3.str)); } ; @@ -7196,9 +7049,7 @@ key_part: { int key_part_len= atoi($3.str); if (!key_part_len) - { - my_error(ER_KEY_PART_0, MYF(0), $1.str); - } + my_yyabort_error((ER_KEY_PART_0, MYF(0), $1.str)); $$= new (thd->mem_root) Key_part_spec($1, (uint) key_part_len); if ($$ == NULL) MYSQL_YYABORT; @@ -7278,10 +7129,7 @@ alter: { LEX *lex= Lex; if (lex->sphead) - { - my_error(ER_SP_NO_DROP_SP, MYF(0), "DATABASE"); - MYSQL_YYABORT; - } + my_yyabort_error((ER_SP_NO_DROP_SP, MYF(0), "DATABASE")); lex->sql_command= SQLCOM_ALTER_DB_UPGRADE; lex->name= $3; } @@ -7290,10 +7138,7 @@ alter: LEX *lex= Lex; if (lex->sphead) - { - my_error(ER_SP_NO_DROP_SP, MYF(0), "PROCEDURE"); - MYSQL_YYABORT; - } + my_yyabort_error((ER_SP_NO_DROP_SP, MYF(0), "PROCEDURE")); bzero((char *)&lex->sp_chistics, sizeof(st_sp_chistics)); } sp_a_chistics @@ -7308,10 +7153,7 @@ alter: LEX *lex= Lex; if (lex->sphead) - { - my_error(ER_SP_NO_DROP_SP, MYF(0), "FUNCTION"); - MYSQL_YYABORT; - } + my_yyabort_error((ER_SP_NO_DROP_SP, MYF(0), "FUNCTION")); bzero((char *)&lex->sp_chistics, sizeof(st_sp_chistics)); } sp_a_chistics @@ -7326,10 +7168,7 @@ alter: LEX *lex= Lex; if (lex->sphead) - { - my_error(ER_SP_BADSTATEMENT, MYF(0), "ALTER VIEW"); - MYSQL_YYABORT; - } + my_yyabort_error((ER_SP_BADSTATEMENT, MYF(0), "ALTER VIEW")); lex->create_view_mode= VIEW_ALTER; } view_tail @@ -7344,10 +7183,7 @@ alter: LEX *lex= Lex; if (lex->sphead) - { - my_error(ER_SP_BADSTATEMENT, MYF(0), "ALTER VIEW"); - MYSQL_YYABORT; - } + my_yyabort_error((ER_SP_BADSTATEMENT, MYF(0), "ALTER VIEW")); lex->create_view_algorithm= VIEW_ALGORITHM_INHERIT; lex->create_view_mode= VIEW_ALTER; } @@ -7720,6 +7556,10 @@ alter_list_item: Lex->alter_info.flags|= Alter_info::ALTER_ADD_COLUMN | Alter_info::ALTER_ADD_INDEX; } + | ADD constraint_def + { + Lex->alter_info.flags|= Alter_info::ALTER_ADD_CHECK_CONSTRAINT; + } | CHANGE opt_column opt_if_exists_table_element field_ident field_spec opt_place { @@ -7746,6 +7586,17 @@ alter_list_item: lex->alter_info.drop_list.push_back(ad, thd->mem_root); lex->alter_info.flags|= Alter_info::ALTER_DROP_COLUMN; } + | DROP CONSTRAINT opt_if_exists_table_element field_ident + { + LEX *lex=Lex; + Alter_drop *ad= (new (thd->mem_root) + Alter_drop(Alter_drop::CHECK_CONSTRAINT, + $4.str, $3)); + if (ad == NULL) + MYSQL_YYABORT; + lex->alter_info.drop_list.push_back(ad, thd->mem_root); + lex->alter_info.flags|= Alter_info::ALTER_DROP_CHECK_CONSTRAINT; + } | DROP FOREIGN KEY_SYM opt_if_exists_table_element field_ident { LEX *lex=Lex; @@ -7789,7 +7640,7 @@ alter_list_item: lex->alter_info.keys_onoff= Alter_info::ENABLE; lex->alter_info.flags|= Alter_info::ALTER_KEYS_ONOFF; } - | ALTER opt_column field_ident SET DEFAULT signed_literal + | ALTER opt_column field_ident SET DEFAULT column_default_expr { LEX *lex=Lex; Alter_column *ac= new (thd->mem_root) Alter_column($3.str,$6); @@ -7802,7 +7653,7 @@ alter_list_item: { LEX *lex=Lex; Alter_column *ac= (new (thd->mem_root) - Alter_column($3.str, (Item*) 0)); + Alter_column($3.str, (Virtual_column_info*) 0)); if (ac == NULL) MYSQL_YYABORT; lex->alter_info.alter_list.push_back(ac, thd->mem_root); @@ -7820,10 +7671,7 @@ alter_list_item: } if (check_table_name($3->table.str,$3->table.length, FALSE) || ($3->db.str && check_db_name(&$3->db))) - { - my_error(ER_WRONG_TABLE_NAME, MYF(0), $3->table.str); - MYSQL_YYABORT; - } + my_yyabort_error((ER_WRONG_TABLE_NAME, MYF(0), $3->table.str)); lex->name= $3->table; lex->alter_info.flags|= Alter_info::ALTER_RENAME; } @@ -7835,15 +7683,11 @@ alter_list_item: } $5= $5 ? $5 : $4; if (!my_charset_same($4,$5)) - { - my_error(ER_COLLATION_CHARSET_MISMATCH, MYF(0), - $5->name, $4->csname); + my_yyabort_error((ER_COLLATION_CHARSET_MISMATCH, MYF(0), + $5->name, $4->csname)); + if (Lex->create_info.add_alter_list_item_convert_to_charset($5)) MYSQL_YYABORT; - } - LEX *lex= Lex; - if (lex->create_info.add_alter_list_item_convert_to_charset($5)) - MYSQL_YYABORT; - lex->alter_info.flags|= Alter_info::ALTER_CONVERT; + Lex->alter_info.flags|= Alter_info::ALTER_CONVERT; } | create_table_options_space_separated { @@ -7884,10 +7728,7 @@ alter_algorithm_option: | ALGORITHM_SYM opt_equal ident { if (Lex->alter_info.set_requested_algorithm(&$3)) - { - my_error(ER_UNKNOWN_ALTER_ALGORITHM, MYF(0), $3.str); - MYSQL_YYABORT; - } + my_yyabort_error((ER_UNKNOWN_ALTER_ALGORITHM, MYF(0), $3.str)); } ; @@ -7900,10 +7741,7 @@ alter_lock_option: | LOCK_SYM opt_equal ident { if (Lex->alter_info.set_requested_lock(&$3)) - { - my_error(ER_UNKNOWN_ALTER_LOCK, MYF(0), $3.str); - MYSQL_YYABORT; - } + my_yyabort_error((ER_UNKNOWN_ALTER_LOCK, MYF(0), $3.str)); } ; @@ -7963,7 +7801,7 @@ opt_place: opt_to: /* empty */ {} | TO_SYM {} - | EQ {} + | '=' {} | AS {} ; @@ -8079,13 +7917,9 @@ slave_until: (lex->mi.relay_log_name || lex->mi.relay_log_pos)) || !((lex->mi.log_file_name && lex->mi.pos) || (lex->mi.relay_log_name && lex->mi.relay_log_pos))) - { - my_message(ER_BAD_SLAVE_UNTIL_COND, - ER_THD(thd, ER_BAD_SLAVE_UNTIL_COND), MYF(0)); - MYSQL_YYABORT; - } + my_yyabort_error((ER_BAD_SLAVE_UNTIL_COND, MYF(0))); } - | UNTIL_SYM MASTER_GTID_POS_SYM EQ TEXT_STRING_sys + | UNTIL_SYM MASTER_GTID_POS_SYM '=' TEXT_STRING_sys { Lex->mi.gtid_pos_str = $4; } @@ -8101,7 +7935,7 @@ checksum: { LEX *lex=Lex; lex->sql_command = SQLCOM_CHECKSUM; - /* Will be overriden during execution. */ + /* Will be overridden during execution. */ YYPS->m_lock_type= TL_UNLOCK; } table_list opt_checksum_type @@ -8127,7 +7961,7 @@ repair: lex->no_write_to_binlog= $2; lex->check_opt.init(); lex->alter_info.reset(); - /* Will be overriden during execution. */ + /* Will be overridden during execution. */ YYPS->m_lock_type= TL_UNLOCK; } repair_table_or_view @@ -8169,7 +8003,7 @@ analyze: lex->no_write_to_binlog= $2; lex->check_opt.init(); lex->alter_info.reset(); - /* Will be overriden during execution. */ + /* Will be overridden during execution. */ YYPS->m_lock_type= TL_UNLOCK; } analyze_table_list @@ -8291,17 +8125,14 @@ check: CHECK_SYM lex->sql_command = SQLCOM_CHECK; lex->check_opt.init(); lex->alter_info.reset(); - /* Will be overriden during execution. */ + /* Will be overridden during execution. */ YYPS->m_lock_type= TL_UNLOCK; } check_view_or_table { LEX* lex= thd->lex; if (lex->sphead) - { - my_error(ER_SP_BADSTATEMENT, MYF(0), "CHECK"); - MYSQL_YYABORT; - } + my_yyabort_error((ER_SP_BADSTATEMENT, MYF(0), "CHECK")); DBUG_ASSERT(!lex->m_sql_cmd); lex->m_sql_cmd= new (thd->mem_root) Sql_cmd_check_table(); if (lex->m_sql_cmd == NULL) @@ -8341,7 +8172,7 @@ optimize: lex->no_write_to_binlog= $2; lex->check_opt.init(); lex->alter_info.reset(); - /* Will be overriden during execution. */ + /* Will be overridden during execution. */ YYPS->m_lock_type= TL_UNLOCK; } table_list @@ -8398,9 +8229,9 @@ table_to_table: { LEX *lex=Lex; SELECT_LEX *sl= lex->current_select; - if (!sl->add_table_to_list(lex->thd, $1,NULL,TL_OPTION_UPDATING, + if (!sl->add_table_to_list(thd, $1,NULL,TL_OPTION_UPDATING, TL_IGNORE, MDL_EXCLUSIVE) || - !sl->add_table_to_list(lex->thd, $3,NULL,TL_OPTION_UPDATING, + !sl->add_table_to_list(thd, $3,NULL,TL_OPTION_UPDATING, TL_IGNORE, MDL_EXCLUSIVE)) MYSQL_YYABORT; } @@ -8539,12 +8370,16 @@ select: select_init: SELECT_SYM select_options_and_item_list select_init3 - | '(' select_paren ')' union_opt + | '(' select_paren ')' + | '(' select_paren ')' union_list + | '(' select_paren ')' union_order_or_limit ; union_list_part2: SELECT_SYM select_options_and_item_list select_init3_union_query_term - | '(' select_paren_union_query_term ')' union_opt + | '(' select_paren_union_query_term ')' + | '(' select_paren_union_query_term ')' union_list + | '(' select_paren_union_query_term ')' union_order_or_limit ; select_paren: @@ -8758,10 +8593,7 @@ select_options: | select_option_list { if (Select->options & SELECT_DISTINCT && Select->options & SELECT_ALL) - { - my_error(ER_WRONG_USAGE, MYF(0), "ALL", "DISTINCT"); - MYSQL_YYABORT; - } + my_yyabort_error((ER_WRONG_USAGE, MYF(0), "ALL", "DISTINCT")); } ; @@ -8779,26 +8611,15 @@ select_option: SQL_CACHE wasn't specified, and only once per query. */ if (Lex->current_select != &Lex->select_lex) - { - my_error(ER_CANT_USE_OPTION_HERE, MYF(0), "SQL_NO_CACHE"); - MYSQL_YYABORT; - } - else if (Lex->select_lex.sql_cache == SELECT_LEX::SQL_CACHE) - { - my_error(ER_WRONG_USAGE, MYF(0), "SQL_CACHE", "SQL_NO_CACHE"); - MYSQL_YYABORT; - } - else if (Lex->select_lex.sql_cache == SELECT_LEX::SQL_NO_CACHE) - { - my_error(ER_DUP_ARGUMENT, MYF(0), "SQL_NO_CACHE"); - MYSQL_YYABORT; - } - else - { - Lex->safe_to_cache_query=0; - Lex->select_lex.options&= ~OPTION_TO_QUERY_CACHE; - Lex->select_lex.sql_cache= SELECT_LEX::SQL_NO_CACHE; - } + my_yyabort_error((ER_CANT_USE_OPTION_HERE, MYF(0), "SQL_NO_CACHE")); + if (Lex->select_lex.sql_cache == SELECT_LEX::SQL_CACHE) + my_yyabort_error((ER_WRONG_USAGE, MYF(0), "SQL_CACHE", "SQL_NO_CACHE")); + if (Lex->select_lex.sql_cache == SELECT_LEX::SQL_NO_CACHE) + my_yyabort_error((ER_DUP_ARGUMENT, MYF(0), "SQL_NO_CACHE")); + + Lex->safe_to_cache_query=0; + Lex->select_lex.options&= ~OPTION_TO_QUERY_CACHE; + Lex->select_lex.sql_cache= SELECT_LEX::SQL_NO_CACHE; } | SQL_CACHE_SYM { @@ -8807,26 +8628,15 @@ select_option: SQL_NO_CACHE wasn't specified, and only once per query. */ if (Lex->current_select != &Lex->select_lex) - { - my_error(ER_CANT_USE_OPTION_HERE, MYF(0), "SQL_CACHE"); - MYSQL_YYABORT; - } - else if (Lex->select_lex.sql_cache == SELECT_LEX::SQL_NO_CACHE) - { - my_error(ER_WRONG_USAGE, MYF(0), "SQL_NO_CACHE", "SQL_CACHE"); - MYSQL_YYABORT; - } - else if (Lex->select_lex.sql_cache == SELECT_LEX::SQL_CACHE) - { - my_error(ER_DUP_ARGUMENT, MYF(0), "SQL_CACHE"); - MYSQL_YYABORT; - } - else - { - Lex->safe_to_cache_query=1; - Lex->select_lex.options|= OPTION_TO_QUERY_CACHE; - Lex->select_lex.sql_cache= SELECT_LEX::SQL_CACHE; - } + my_yyabort_error((ER_CANT_USE_OPTION_HERE, MYF(0), "SQL_CACHE")); + if (Lex->select_lex.sql_cache == SELECT_LEX::SQL_NO_CACHE) + my_yyabort_error((ER_WRONG_USAGE, MYF(0), "SQL_NO_CACHE", "SQL_CACHE")); + if (Lex->select_lex.sql_cache == SELECT_LEX::SQL_CACHE) + my_yyabort_error((ER_DUP_ARGUMENT, MYF(0), "SQL_CACHE")); + + Lex->safe_to_cache_query=1; + Lex->select_lex.options|= OPTION_TO_QUERY_CACHE; + Lex->select_lex.sql_cache= SELECT_LEX::SQL_CACHE; } ; @@ -8879,10 +8689,7 @@ select_item: { if (Lex->sql_command == SQLCOM_CREATE_VIEW && check_column_name($4.str)) - { - my_error(ER_WRONG_COLUMN_NAME, MYF(0), $4.str); - MYSQL_YYABORT; - } + my_yyabort_error((ER_WRONG_COLUMN_NAME, MYF(0), $4.str)); $2->is_autogenerated_name= FALSE; $2->set_name(thd, $4.str, $4.length, system_charset_info); } @@ -8899,6 +8706,12 @@ remember_tok_start: } ; +remember_cur_pos: + { + $$= (char*) YYLIP->get_cpp_ptr(); + } + ; + remember_name: { $$= (char*) YYLIP->get_cpp_tok_start(); @@ -9103,13 +8916,13 @@ bool_pri: if ($$ == NULL) MYSQL_YYABORT; } - | bool_pri comp_op predicate %prec EQ + | bool_pri comp_op predicate %prec '=' { $$= (*$2)(0)->create(thd, $1, $3); if ($$ == NULL) MYSQL_YYABORT; } - | bool_pri comp_op all_or_any '(' subselect ')' %prec EQ + | bool_pri comp_op all_or_any '(' subselect ')' %prec '=' { $$= all_any_subquery_creator(thd, $1, $2, $3, $5); if ($$ == NULL) @@ -9333,11 +9146,11 @@ not2: ; comp_op: - EQ { $$ = &comp_eq_creator; } + '=' { $$ = &comp_eq_creator; } | GE { $$ = &comp_ge_creator; } - | GT_SYM { $$ = &comp_gt_creator; } + | '>' { $$ = &comp_gt_creator; } | LE { $$ = &comp_le_creator; } - | LT { $$ = &comp_lt_creator; } + | '<' { $$ = &comp_lt_creator; } | NE { $$ = &comp_ne_creator; } ; @@ -9427,71 +9240,45 @@ dyncall_create_list: } ; -simple_expr: +/* + Expressions that the parser allows in a column DEFAULT clause + without parentheses. These expressions cannot end with a COLLATE clause. + + If we allowed any "expr" in DEFAULT clause, there would be a confusion + in queries like this: + CREATE TABLE t1 (a TEXT DEFAULT 'a' COLLATE latin1_bin); + It would be not clear what COLLATE stands for: + - the collation of the column `a`, or + - the collation of the string literal 'a' + + This restriction allows to parse the above query unambiguiusly: + COLLATE belongs to the column rather than the literal. + If one needs COLLATE to belong to the literal, parentheses must be used: + CREATE TABLE t1 (a TEXT DEFAULT ('a' COLLATE latin1_bin)); + Note: the COLLATE clause is rather meaningless here, but the query + is syntactically correct. + + Note, some of the expressions are not actually allowed in DEFAULT, + e.g. sum_expr, window_func_expr, ROW(...), VALUES(). + We could move them to simple_expr, but that would make + these two queries return a different error messages: + CREATE TABLE t1 (a INT DEFAULT AVG(1)); + CREATE TABLE t1 (a INT DEFAULT (AVG(1))); + The first query would return "syntax error". + Currenly both return: + Function or expression 'avg(' is not allowed for 'DEFAULT' ... +*/ +column_default_non_parenthesized_expr: simple_ident | function_call_keyword | function_call_nonkeyword | function_call_generic | function_call_conflict - | simple_expr COLLATE_SYM ident_or_text %prec NEG - { - Item *i1= new (thd->mem_root) Item_string(thd, $3.str, - $3.length, - thd->charset()); - if (i1 == NULL) - MYSQL_YYABORT; - $$= new (thd->mem_root) Item_func_set_collation(thd, $1, i1); - if ($$ == NULL) - MYSQL_YYABORT; - } | literal | param_marker { $$= $1; } | variable | sum_expr | window_func_expr - | simple_expr OR_OR_SYM simple_expr - { - $$= new (thd->mem_root) Item_func_concat(thd, $1, $3); - if ($$ == NULL) - MYSQL_YYABORT; - } - | '+' simple_expr %prec NEG - { - $$= $2; - } - | '-' simple_expr %prec NEG - { - $$= new (thd->mem_root) Item_func_neg(thd, $2); - if ($$ == NULL) - MYSQL_YYABORT; - } - | '~' simple_expr %prec NEG - { - $$= new (thd->mem_root) Item_func_bit_neg(thd, $2); - if ($$ == NULL) - MYSQL_YYABORT; - } - | not2 simple_expr %prec NEG - { - $$= negate_expression(thd, $2); - if ($$ == NULL) - MYSQL_YYABORT; - } - | '(' subselect ')' - { - $$= new (thd->mem_root) Item_singlerow_subselect(thd, $2); - if ($$ == NULL) - MYSQL_YYABORT; - } - | '(' expr ')' - { $$= $2; } - | '(' expr ',' expr_list ')' - { - $4->push_front($2, thd->mem_root); - $$= new (thd->mem_root) Item_row(thd, *$4); - if ($$ == NULL) - MYSQL_YYABORT; - } | ROW_SYM '(' expr ',' expr_list ')' { $5->push_front($3, thd->mem_root); @@ -9539,13 +9326,6 @@ simple_expr: Select->add_ftfunc_to_list(thd, i1); $$= i1; } - | BINARY simple_expr %prec NEG - { - $$= create_func_cast(thd, $2, ITEM_CAST_CHAR, NULL, NULL, - &my_charset_bin); - if ($$ == NULL) - MYSQL_YYABORT; - } | CAST_SYM '(' expr AS cast_type ')' { LEX *lex= Lex; @@ -9577,11 +9357,7 @@ simple_expr: { Item_splocal *il= $3->get_item_splocal(); if (il) - { - - my_error(ER_WRONG_COLUMN_NAME, MYF(0), il->my_name()->str); - MYSQL_YYABORT; - } + my_yyabort_error((ER_WRONG_COLUMN_NAME, MYF(0), il->my_name()->str)); $$= new (thd->mem_root) Item_default_value(thd, Lex->current_context(), $3); if ($$ == NULL) @@ -9594,6 +9370,57 @@ simple_expr: if ($$ == NULL) MYSQL_YYABORT; } + ; + +simple_expr: + column_default_non_parenthesized_expr + | simple_expr COLLATE_SYM ident_or_text %prec NEG + { + Item *i1= new (thd->mem_root) Item_string(thd, $3.str, + $3.length, + thd->charset()); + if (i1 == NULL) + MYSQL_YYABORT; + $$= new (thd->mem_root) Item_func_set_collation(thd, $1, i1); + if ($$ == NULL) + MYSQL_YYABORT; + } + | '(' parenthesized_expr ')' { $$= $2; } + | BINARY simple_expr %prec NEG + { + $$= create_func_cast(thd, $2, ITEM_CAST_CHAR, NULL, NULL, + &my_charset_bin); + if ($$ == NULL) + MYSQL_YYABORT; + } + | simple_expr OR_OR_SYM simple_expr + { + $$= new (thd->mem_root) Item_func_concat(thd, $1, $3); + if ($$ == NULL) + MYSQL_YYABORT; + } + | '+' simple_expr %prec NEG + { + $$= $2; + } + | '-' simple_expr %prec NEG + { + $$= $2->neg(thd); + if ($$ == NULL) + MYSQL_YYABORT; + } + | '~' simple_expr %prec NEG + { + $$= new (thd->mem_root) Item_func_bit_neg(thd, $2); + if ($$ == NULL) + MYSQL_YYABORT; + } + | not2 simple_expr %prec NEG + { + $$= negate_expression(thd, $2); + if ($$ == NULL) + MYSQL_YYABORT; + } | INTERVAL_SYM expr interval '+' expr %prec INTERVAL_SYM /* we cannot put interval before - */ { @@ -10197,9 +10024,8 @@ function_call_conflict: if ($$ == NULL) MYSQL_YYABORT; #else - my_error(ER_FEATURE_DISABLED, MYF(0), - sym_group_geom.name, sym_group_geom.needed_define); - MYSQL_YYABORT; + my_yyabort_error((ER_FEATURE_DISABLED, MYF(0), sym_group_geom.name, + sym_group_geom.needed_define)); #endif } ; @@ -10361,10 +10187,7 @@ function_call_generic: */ if (!$1.str || check_db_name(&$1)) - { - my_error(ER_WRONG_DB_NAME, MYF(0), $1.str); - MYSQL_YYABORT; - } + my_yyabort_error((ER_WRONG_DB_NAME, MYF(0), $1.str)); if (check_routine_name(&$3)) { MYSQL_YYABORT; @@ -10674,10 +10497,7 @@ variable: '@' { if (! Lex->parsing_options.allows_variable) - { - my_error(ER_VIEW_SELECT_VARIABLE, MYF(0)); - MYSQL_YYABORT; - } + my_yyabort_error((ER_VIEW_SELECT_VARIABLE, MYF(0))); } variable_aux { @@ -10736,20 +10556,7 @@ opt_gconcat_separator: opt_gorder_clause: /* empty */ - | ORDER_SYM BY - { - LEX *lex= Lex; - SELECT_LEX *sel= lex->current_select; - if (sel->linkage != GLOBAL_OPTIONS_TYPE && - sel->olap != UNSPECIFIED_OLAP_TYPE && - (sel->linkage != UNION_TYPE || sel->braces)) - { - my_error(ER_WRONG_USAGE, MYF(0), - "CUBE/ROLLUP", "ORDER BY"); - MYSQL_YYABORT; - } - } - gorder_list; + | ORDER_SYM BY gorder_list; ; gorder_list: @@ -10882,7 +10689,7 @@ table_ref: | join_table { LEX *lex= Lex; - if (!($$= lex->current_select->nest_last_join(lex->thd))) + if (!($$= lex->current_select->nest_last_join(thd))) { my_parse_error(thd, ER_SYNTAX_ERROR); MYSQL_YYABORT; @@ -11145,7 +10952,7 @@ table_primary_derived: Table_ident *ti= new (thd->mem_root) Table_ident(unit); if (ti == NULL) MYSQL_YYABORT; - if (!($$= sel->add_table_to_list(lex->thd, + if (!($$= sel->add_table_to_list(thd, ti, $5, 0, TL_READ, MDL_SHARED_READ))) @@ -11366,11 +11173,6 @@ get_select_lex_derived: select_derived_init: { LEX *lex= Lex; - if (! lex->parsing_options.allows_derived) - { - my_error(ER_VIEW_SELECT_DERIVED, MYF(0)); - MYSQL_YYABORT; - } TABLE_LIST *embedding= lex->current_select->embedding; $$= embedding && @@ -11505,7 +11307,7 @@ date_time_type: table_alias: /* empty */ | AS - | EQ + | '=' ; opt_table_alias: @@ -11601,14 +11403,11 @@ olap_opt: */ LEX *lex=Lex; if (lex->current_select->linkage == GLOBAL_OPTIONS_TYPE) - { - my_error(ER_WRONG_USAGE, MYF(0), "WITH CUBE", - "global union parameters"); - MYSQL_YYABORT; - } + my_yyabort_error((ER_WRONG_USAGE, MYF(0), "WITH CUBE", + "global union parameters")); lex->current_select->olap= CUBE_TYPE; - my_error(ER_NOT_SUPPORTED_YET, MYF(0), "CUBE"); - MYSQL_YYABORT; + + my_yyabort_error((ER_NOT_SUPPORTED_YET, MYF(0), "CUBE")); } | WITH_ROLLUP_SYM { @@ -11621,11 +11420,8 @@ olap_opt: */ LEX *lex= Lex; if (lex->current_select->linkage == GLOBAL_OPTIONS_TYPE) - { - my_error(ER_WRONG_USAGE, MYF(0), "WITH ROLLUP", - "global union parameters"); - MYSQL_YYABORT; - } + my_yyabort_error((ER_WRONG_USAGE, MYF(0), "WITH ROLLUP", + "global union parameters")); lex->current_select->olap= ROLLUP_TYPE; } ; @@ -11839,7 +11635,7 @@ order_clause: if (!unit->is_union() && (first_sl->order_list.elements || first_sl->select_limit) && - unit->add_fake_select_lex(lex->thd)) + unit->add_fake_select_lex(thd)) MYSQL_YYABORT; } if (sel->master_unit()->is_union() && !sel->braces) @@ -11956,15 +11752,9 @@ limit_option: lex->safe_to_cache_query=0; } else - { - my_error(ER_SP_UNDECLARED_VAR, MYF(0), $1.str); - MYSQL_YYABORT; - } + my_yyabort_error((ER_SP_UNDECLARED_VAR, MYF(0), $1.str)); if (splocal->type() != Item::INT_ITEM) - { - my_error(ER_WRONG_SPVAR_TYPE_IN_LIMIT, MYF(0)); - MYSQL_YYABORT; - } + my_yyabort_error((ER_WRONG_SPVAR_TYPE_IN_LIMIT, MYF(0))); splocal->limit_clause_param= TRUE; $$= splocal; } @@ -12085,7 +11875,7 @@ procedure_clause: NULL, NULL, $2.str); if (item == NULL) MYSQL_YYABORT; - if (add_proc_to_list(lex->thd, item)) + if (add_proc_to_list(thd, item)) MYSQL_YYABORT; Lex->uncacheable(UNCACHEABLE_SIDEEFFECT); @@ -12169,10 +11959,7 @@ select_outvar: sp_variable *t; if (!Lex->spcont || !(t= Lex->spcont->find_variable($1, false))) - { - my_error(ER_SP_UNDECLARED_VAR, MYF(0), $1.str); - MYSQL_YYABORT; - } + my_yyabort_error((ER_SP_UNDECLARED_VAR, MYF(0), $1.str)); $$ = Lex->result ? (new (thd->mem_root) my_var_sp($1, t->offset, t->sql_type(), Lex->sphead)) : @@ -12259,7 +12046,7 @@ drop: lex->alter_info.reset(); lex->alter_info.flags= Alter_info::ALTER_DROP_INDEX; lex->alter_info.drop_list.push_back(ad, thd->mem_root); - if (!lex->current_select->add_table_to_list(lex->thd, $6, NULL, + if (!lex->current_select->add_table_to_list(thd, $6, NULL, TL_OPTION_UPDATING, TL_READ_NO_INSERT, MDL_SHARED_UPGRADABLE)) @@ -12276,17 +12063,11 @@ drop: LEX *lex= thd->lex; sp_name *spname; if ($4.str && check_db_name(&$4)) - { - my_error(ER_WRONG_DB_NAME, MYF(0), $4.str); - MYSQL_YYABORT; - } + my_yyabort_error((ER_WRONG_DB_NAME, MYF(0), $4.str)); if (lex->sphead) - { - my_error(ER_SP_NO_DROP_SP, MYF(0), "FUNCTION"); - MYSQL_YYABORT; - } + my_yyabort_error((ER_SP_NO_DROP_SP, MYF(0), "FUNCTION")); lex->set_command(SQLCOM_DROP_FUNCTION, $3); - spname= new (lex->thd->mem_root) sp_name($4, $6, true); + spname= new (thd->mem_root) sp_name($4, $6, true); if (spname == NULL) MYSQL_YYABORT; spname->init_qname(thd); @@ -12298,14 +12079,11 @@ drop: LEX_STRING db= {0, 0}; sp_name *spname; if (lex->sphead) - { - my_error(ER_SP_NO_DROP_SP, MYF(0), "FUNCTION"); - MYSQL_YYABORT; - } + my_yyabort_error((ER_SP_NO_DROP_SP, MYF(0), "FUNCTION")); if (thd->db && lex->copy_db_to(&db.str, &db.length)) MYSQL_YYABORT; lex->set_command(SQLCOM_DROP_FUNCTION, $3); - spname= new (lex->thd->mem_root) sp_name(db, $4, false); + spname= new (thd->mem_root) sp_name(db, $4, false); if (spname == NULL) MYSQL_YYABORT; spname->init_qname(thd); @@ -12315,10 +12093,7 @@ drop: { LEX *lex=Lex; if (lex->sphead) - { - my_error(ER_SP_NO_DROP_SP, MYF(0), "PROCEDURE"); - MYSQL_YYABORT; - } + my_yyabort_error((ER_SP_NO_DROP_SP, MYF(0), "PROCEDURE")); lex->set_command(SQLCOM_DROP_PROCEDURE, $3); lex->spname= $4; } @@ -12574,7 +12349,7 @@ ident_eq_value: ; equal: - EQ {} + '=' {} | SET_VAR {} ; @@ -13352,19 +13127,14 @@ opt_extended_describe: opt_format_json: /* empty */ {} - | FORMAT_SYM EQ ident_or_text + | FORMAT_SYM '=' ident_or_text { if (!my_strcasecmp(system_charset_info, $3.str, "JSON")) Lex->explain_json= true; else if (!my_strcasecmp(system_charset_info, $3.str, "TRADITIONAL")) - { DBUG_ASSERT(Lex->explain_json==false); - } else - { - my_error(ER_UNKNOWN_EXPLAIN_FORMAT, MYF(0), $3.str); - MYSQL_YYABORT; - } + my_yyabort_error((ER_UNKNOWN_EXPLAIN_FORMAT, MYF(0), $3.str)); } ; @@ -13461,10 +13231,7 @@ flush_option: { LEX *lex= Lex; if (lex->type & REFRESH_RELAY_LOG) - { - my_error(ER_WRONG_USAGE, MYF(0), "FLUSH", "RELAY LOGS"); - MYSQL_YYABORT; - } + my_yyabort_error((ER_WRONG_USAGE, MYF(0), "FLUSH", "RELAY LOGS")); lex->type|= REFRESH_RELAY_LOG; lex->relay_log_connection_name= lex->mi.connection_name; } @@ -13485,10 +13252,7 @@ flush_option: { LEX *lex= Lex; if (lex->type & REFRESH_SLAVE) - { - my_error(ER_WRONG_USAGE, MYF(0), "FLUSH","SLAVE"); - MYSQL_YYABORT; - } + my_yyabort_error((ER_WRONG_USAGE, MYF(0), "FLUSH","SLAVE")); lex->type|= REFRESH_SLAVE; lex->reset_slave_info.all= false; } @@ -13967,25 +13731,18 @@ param_marker: Lex_input_stream *lip= YYLIP; Item_param *item; if (! lex->parsing_options.allows_variable) - { - my_error(ER_VIEW_SELECT_VARIABLE, MYF(0)); - MYSQL_YYABORT; - } + my_yyabort_error((ER_VIEW_SELECT_VARIABLE, MYF(0))); const char *query_start= lex->sphead ? lex->sphead->m_tmp_query : thd->query(); item= new (thd->mem_root) Item_param(thd, lip->get_tok_start() - query_start); if (!($$= item) || lex->param_list.push_back(item, thd->mem_root)) - { - my_message(ER_OUT_OF_RESOURCES, ER_THD(thd, ER_OUT_OF_RESOURCES), MYF(0)); - MYSQL_YYABORT; - } + my_yyabort_error((ER_OUT_OF_RESOURCES, MYF(0))); } ; signed_literal: - literal { $$ = $1; } - | '+' NUM_literal { $$ = $2; } + '+' NUM_literal { $$ = $2; } | '-' NUM_literal { $2->max_length++; @@ -14268,10 +14025,7 @@ simple_ident: { /* We're compiling a stored procedure and found a variable */ if (! lex->parsing_options.allows_variable) - { - my_error(ER_VIEW_SELECT_VARIABLE, MYF(0)); - MYSQL_YYABORT; - } + my_yyabort_error((ER_VIEW_SELECT_VARIABLE, MYF(0))); Item_splocal *splocal; splocal= new (thd->mem_root) @@ -14347,17 +14101,11 @@ simple_ident_q: if (lex->trg_chistics.event == TRG_EVENT_INSERT && !new_row) - { - my_error(ER_TRG_NO_SUCH_ROW_IN_TRG, MYF(0), "OLD", "on INSERT"); - MYSQL_YYABORT; - } + my_yyabort_error((ER_TRG_NO_SUCH_ROW_IN_TRG, MYF(0), "OLD", "on INSERT")); if (lex->trg_chistics.event == TRG_EVENT_DELETE && new_row) - { - my_error(ER_TRG_NO_SUCH_ROW_IN_TRG, MYF(0), "NEW", "on DELETE"); - MYSQL_YYABORT; - } + my_yyabort_error((ER_TRG_NO_SUCH_ROW_IN_TRG, MYF(0), "NEW", "on DELETE")); DBUG_ASSERT(!new_row || (lex->trg_chistics.event == TRG_EVENT_INSERT || @@ -14466,26 +14214,17 @@ field_ident: { TABLE_LIST *table= Select->table_list.first; if (my_strcasecmp(table_alias_charset, $1.str, table->db)) - { - my_error(ER_WRONG_DB_NAME, MYF(0), $1.str); - MYSQL_YYABORT; - } + my_yyabort_error((ER_WRONG_DB_NAME, MYF(0), $1.str)); if (my_strcasecmp(table_alias_charset, $3.str, table->table_name)) - { - my_error(ER_WRONG_TABLE_NAME, MYF(0), $3.str); - MYSQL_YYABORT; - } + my_yyabort_error((ER_WRONG_TABLE_NAME, MYF(0), $3.str)); $$=$5; } | ident '.' ident { TABLE_LIST *table= Select->table_list.first; if (my_strcasecmp(table_alias_charset, $1.str, table->alias)) - { - my_error(ER_WRONG_TABLE_NAME, MYF(0), $1.str); - MYSQL_YYABORT; - } + my_yyabort_error((ER_WRONG_TABLE_NAME, MYF(0), $1.str)); $$=$3; } | '.' ident { $$=$2;} /* For Delphi */ @@ -14760,6 +14499,7 @@ keyword: | SONAME_SYM {} | START_SYM {} | STOP_SYM {} + | STORED_SYM {} | TRUNCATE_SYM {} | UNICODE_SYM {} | UNINSTALL_SYM {} @@ -15121,10 +14861,7 @@ set: { LEX *lex= Lex; if (lex->table_or_sp_used()) - { - my_error(ER_SUBQUERIES_NOT_SUPPORTED, MYF(0), "SET STATEMENT"); - MYSQL_YYABORT; - } + my_yyabort_error((ER_SUBQUERIES_NOT_SUPPORTED, MYF(0), "SET STATEMENT")); lex->stmt_var_list= lex->var_list; lex->var_list.empty(); } @@ -15453,10 +15190,7 @@ internal_variable_name: !my_strcasecmp(system_charset_info, $1.str, "OLD"))) { if ($1.str[0]=='O' || $1.str[0]=='o') - { - my_error(ER_TRG_CANT_CHANGE_ROW, MYF(0), "OLD", ""); - MYSQL_YYABORT; - } + my_yyabort_error((ER_TRG_CANT_CHANGE_ROW, MYF(0), "OLD", "")); if (lex->trg_chistics.event == TRG_EVENT_DELETE) { my_error(ER_TRG_NO_SUCH_ROW_IN_TRG, MYF(0), @@ -15464,10 +15198,7 @@ internal_variable_name: MYSQL_YYABORT; } if (lex->trg_chistics.action_time == TRG_ACTION_AFTER) - { - my_error(ER_TRG_CANT_CHANGE_ROW, MYF(0), "NEW", "after "); - MYSQL_YYABORT; - } + my_yyabort_error((ER_TRG_CANT_CHANGE_ROW, MYF(0), "NEW", "after ")); /* This special combination will denote field of NEW row */ $$.var= trg_new_row_fake_var; $$.base_name= $3; @@ -15559,10 +15290,7 @@ opt_for_user: LEX_STRING pw= { C_STRING_WITH_LEN("password") }; if (spc && spc->find_variable(pw, false)) - { - my_error(ER_SP_BAD_VAR_SHADOW, MYF(0), pw.str); - MYSQL_YYABORT; - } + my_yyabort_error((ER_SP_BAD_VAR_SHADOW, MYF(0), pw.str)); if (!(lex->definer= (LEX_USER*) thd->calloc(sizeof(LEX_USER)))) MYSQL_YYABORT; lex->definer->user= current_user; @@ -15615,10 +15343,7 @@ lock: LEX *lex= Lex; if (lex->sphead) - { - my_error(ER_SP_BADSTATEMENT, MYF(0), "LOCK"); - MYSQL_YYABORT; - } + my_yyabort_error((ER_SP_BADSTATEMENT, MYF(0), "LOCK")); lex->sql_command= SQLCOM_LOCK_TABLES; } table_lock_list @@ -15668,10 +15393,7 @@ unlock: LEX *lex= Lex; if (lex->sphead) - { - my_error(ER_SP_BADSTATEMENT, MYF(0), "UNLOCK"); - MYSQL_YYABORT; - } + my_yyabort_error((ER_SP_BADSTATEMENT, MYF(0), "UNLOCK")); lex->sql_command= SQLCOM_UNLOCK_TABLES; } table_or_tables @@ -15687,34 +15409,25 @@ handler: { LEX *lex= Lex; if (lex->sphead) - { - my_error(ER_SP_BADSTATEMENT, MYF(0), "HANDLER"); - MYSQL_YYABORT; - } + my_yyabort_error((ER_SP_BADSTATEMENT, MYF(0), "HANDLER")); lex->sql_command = SQLCOM_HA_OPEN; - if (!lex->current_select->add_table_to_list(lex->thd, $2, $4, 0)) + if (!lex->current_select->add_table_to_list(thd, $2, $4, 0)) MYSQL_YYABORT; } | HANDLER_SYM table_ident_nodb CLOSE_SYM { LEX *lex= Lex; if (lex->sphead) - { - my_error(ER_SP_BADSTATEMENT, MYF(0), "HANDLER"); - MYSQL_YYABORT; - } + my_yyabort_error((ER_SP_BADSTATEMENT, MYF(0), "HANDLER")); lex->sql_command = SQLCOM_HA_CLOSE; - if (!lex->current_select->add_table_to_list(lex->thd, $2, 0, 0)) + if (!lex->current_select->add_table_to_list(thd, $2, 0, 0)) MYSQL_YYABORT; } | HANDLER_SYM table_ident_nodb READ_SYM { LEX *lex=Lex; if (lex->sphead) - { - my_error(ER_SP_BADSTATEMENT, MYF(0), "HANDLER"); - MYSQL_YYABORT; - } + my_yyabort_error((ER_SP_BADSTATEMENT, MYF(0), "HANDLER")); lex->expr_allows_subselect= FALSE; lex->sql_command = SQLCOM_HA_READ; lex->ha_rkey_mode= HA_READ_KEY_EXACT; /* Avoid purify warnings */ @@ -15724,7 +15437,7 @@ handler: lex->current_select->select_limit= one; lex->current_select->offset_limit= 0; lex->limit_rows_examined= 0; - if (!lex->current_select->add_table_to_list(lex->thd, $2, 0, 0)) + if (!lex->current_select->add_table_to_list(thd, $2, 0, 0)) MYSQL_YYABORT; } handler_read_or_scan opt_where_clause opt_limit_clause @@ -15768,11 +15481,11 @@ handler_rkey_function: ; handler_rkey_mode: - EQ { $$=HA_READ_KEY_EXACT; } + '=' { $$=HA_READ_KEY_EXACT; } | GE { $$=HA_READ_KEY_OR_NEXT; } | LE { $$=HA_READ_KEY_OR_PREV; } - | GT_SYM { $$=HA_READ_AFTER_KEY; } - | LT { $$=HA_READ_BEFORE_KEY; } + | '>' { $$=HA_READ_AFTER_KEY; } + | '<' { $$=HA_READ_BEFORE_KEY; } ; /* GRANT / REVOKE */ @@ -15930,10 +15643,7 @@ grant_role: /* trim end spaces (as they'll be lost in mysql.user anyway) */ $1.length= cs->cset->lengthsp(cs, $1.str, $1.length); if ($1.length == 0) - { - my_error(ER_INVALID_ROLE, MYF(0), ""); - MYSQL_YYABORT; - } + my_yyabort_error((ER_INVALID_ROLE, MYF(0), "")); if (!($$=(LEX_USER*) thd->alloc(sizeof(st_lex_user)))) MYSQL_YYABORT; $$->user = $1; @@ -16028,30 +15738,21 @@ require_list_element: { LEX *lex=Lex; if (lex->x509_subject) - { - my_error(ER_DUP_ARGUMENT, MYF(0), "SUBJECT"); - MYSQL_YYABORT; - } + my_yyabort_error((ER_DUP_ARGUMENT, MYF(0), "SUBJECT")); lex->x509_subject=$2.str; } | ISSUER_SYM TEXT_STRING { LEX *lex=Lex; if (lex->x509_issuer) - { - my_error(ER_DUP_ARGUMENT, MYF(0), "ISSUER"); - MYSQL_YYABORT; - } + my_yyabort_error((ER_DUP_ARGUMENT, MYF(0), "ISSUER")); lex->x509_issuer=$2.str; } | CIPHER_SYM TEXT_STRING { LEX *lex=Lex; if (lex->ssl_cipher) - { - my_error(ER_DUP_ARGUMENT, MYF(0), "CIPHER"); - MYSQL_YYABORT; - } + my_yyabort_error((ER_DUP_ARGUMENT, MYF(0), "CIPHER")); lex->ssl_cipher=$2.str; } ; @@ -16066,11 +15767,7 @@ grant_ident: if (lex->grant == GLOBAL_ACLS) lex->grant = DB_ACLS & ~GRANT_ACL; else if (lex->columns.elements) - { - my_message(ER_ILLEGAL_GRANT_FOR_TABLE, - ER_THD(thd, ER_ILLEGAL_GRANT_FOR_TABLE), MYF(0)); - MYSQL_YYABORT; - } + my_yyabort_error((ER_ILLEGAL_GRANT_FOR_TABLE, MYF(0))); } | ident '.' '*' { @@ -16079,11 +15776,7 @@ grant_ident: if (lex->grant == GLOBAL_ACLS) lex->grant = DB_ACLS & ~GRANT_ACL; else if (lex->columns.elements) - { - my_message(ER_ILLEGAL_GRANT_FOR_TABLE, - ER_THD(thd, ER_ILLEGAL_GRANT_FOR_TABLE), MYF(0)); - MYSQL_YYABORT; - } + my_yyabort_error((ER_ILLEGAL_GRANT_FOR_TABLE, MYF(0))); } | '*' '.' '*' { @@ -16092,16 +15785,12 @@ grant_ident: if (lex->grant == GLOBAL_ACLS) lex->grant= GLOBAL_ACLS & ~GRANT_ACL; else if (lex->columns.elements) - { - my_message(ER_ILLEGAL_GRANT_FOR_TABLE, - ER_THD(thd, ER_ILLEGAL_GRANT_FOR_TABLE), MYF(0)); - MYSQL_YYABORT; - } + my_yyabort_error((ER_ILLEGAL_GRANT_FOR_TABLE, MYF(0))); } | table_ident { LEX *lex=Lex; - if (!lex->current_select->add_table_to_list(lex->thd, $1,NULL, + if (!lex->current_select->add_table_to_list(thd, $1,NULL, TL_OPTION_UPDATING)) MYSQL_YYABORT; if (lex->grant == GLOBAL_ACLS) @@ -16442,12 +16131,6 @@ union_list_view: } ; -union_opt: - /* Empty */ - | union_order_or_limit - | union_list - ; - union_order_or_limit: { LEX *lex= thd->lex; @@ -16674,7 +16357,7 @@ no_definer: ; definer: - DEFINER_SYM EQ user_or_role + DEFINER_SYM '=' user_or_role { Lex->definer= $3; Lex->ssl_type= SSL_TYPE_NOT_SPECIFIED; @@ -16690,11 +16373,11 @@ definer: **************************************************************************/ view_algorithm: - ALGORITHM_SYM EQ UNDEFINED_SYM + ALGORITHM_SYM '=' UNDEFINED_SYM { Lex->create_view_algorithm= DTYPE_ALGORITHM_UNDEFINED; } - | ALGORITHM_SYM EQ MERGE_SYM + | ALGORITHM_SYM '=' MERGE_SYM { Lex->create_view_algorithm= VIEW_ALGORITHM_MERGE; } - | ALGORITHM_SYM EQ TEMPTABLE_SYM + | ALGORITHM_SYM '=' TEMPTABLE_SYM { Lex->create_view_algorithm= VIEW_ALGORITHM_TMPTABLE; } ; @@ -16750,7 +16433,6 @@ view_select: { LEX *lex= Lex; lex->parsing_options.allows_variable= FALSE; - lex->parsing_options.allows_derived= FALSE; lex->create_view_select.str= (char *) YYLIP->get_cpp_ptr(); } opt_with_clause query_expression_body_view view_check_option @@ -16762,7 +16444,6 @@ view_select: lex->create_view_select.str= (char *) create_view_select; trim_whitespace(thd->charset(), &lex->create_view_select); lex->parsing_options.allows_variable= TRUE; - lex->parsing_options.allows_derived= TRUE; lex->current_select->set_with_clause($2); } ; @@ -16824,10 +16505,7 @@ trigger_tail: Lex_input_stream *lip= YYLIP; if (lex->sphead) - { - my_error(ER_SP_NO_RECURSIVE_CREATE, MYF(0), "TRIGGER"); - MYSQL_YYABORT; - } + my_yyabort_error((ER_SP_NO_RECURSIVE_CREATE, MYF(0), "TRIGGER")); lex->stmt_definition_begin= $2; lex->ident.str= $9; @@ -16884,10 +16562,7 @@ udf_tail2: if (lex->add_create_options_with_check($2)) MYSQL_YYABORT; if (is_native_function(thd, & $3)) - { - my_error(ER_NATIVE_FCT_NAME_COLLISION, MYF(0), $3.str); - MYSQL_YYABORT; - } + my_yyabort_error((ER_NATIVE_FCT_NAME_COLLISION, MYF(0), $3.str)); lex->sql_command= SQLCOM_CREATE_FUNCTION; lex->udf.name= $3; lex->udf.returns= (Item_result) $5; @@ -16910,10 +16585,7 @@ sf_tail: lex->spname= $3; if (lex->sphead) - { - my_error(ER_SP_NO_RECURSIVE_CREATE, MYF(0), "FUNCTION"); - MYSQL_YYABORT; - } + my_yyabort_error((ER_SP_NO_RECURSIVE_CREATE, MYF(0), "FUNCTION")); if (!make_sp_head(thd, $3, TYPE_ENUM_FUNCTION)) MYSQL_YYABORT; @@ -16956,10 +16628,7 @@ sf_tail: lex->sql_command= SQLCOM_CREATE_SPFUNCTION; sp->set_stmt_end(thd); if (!(sp->m_flags & sp_head::HAS_RETURN)) - { - my_error(ER_SP_NORETURN, MYF(0), sp->m_qname.str); - MYSQL_YYABORT; - } + my_yyabort_error((ER_SP_NORETURN, MYF(0), sp->m_qname.str)); if (is_native_function(thd, & sp->m_name)) { /* @@ -17006,10 +16675,7 @@ sp_tail: MYSQL_YYABORT; if (Lex->sphead) - { - my_error(ER_SP_NO_RECURSIVE_CREATE, MYF(0), "PROCEDURE"); - MYSQL_YYABORT; - } + my_yyabort_error((ER_SP_NO_RECURSIVE_CREATE, MYF(0), "PROCEDURE")); if (!make_sp_head(thd, $3, TYPE_ENUM_PROCEDURE)) MYSQL_YYABORT; diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index 29bb49a0083..37a58af1439 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -1,5 +1,5 @@ /* Copyright (c) 2002, 2015, Oracle and/or its affiliates. - Copyright (c) 2012, 2015, MariaDB + Copyright (c) 2012, 2016, MariaDB Corporation This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -477,7 +477,8 @@ static bool binlog_format_check(sys_var *self, THD *thd, set_var *var) switching @@SESSION.binlog_format from MIXED to STATEMENT when there are open temp tables and we are logging in row format. */ - if (thd->temporary_tables && var->type == OPT_SESSION && + if (thd->has_thd_temporary_tables() && + var->type == OPT_SESSION && var->save_result.ulonglong_value == BINLOG_FORMAT_STMT && ((thd->variables.binlog_format == BINLOG_FORMAT_MIXED && thd->is_current_stmt_binlog_format_row()) || @@ -2388,7 +2389,9 @@ export const char *optimizer_switch_names[]= "table_elimination", "extended_keys", "exists_to_in", - "default", NullS + "orderby_uses_equalities", + "default", + NullS }; static bool fix_optimizer_switch(sys_var *self, THD *thd, enum_var_type type) @@ -2853,7 +2856,6 @@ static bool fix_server_id(sys_var *self, THD *thd, enum_var_type type) { if (type == OPT_GLOBAL) { - server_id_supplied = 1; thd->variables.server_id= global_system_variables.server_id; /* Historically, server_id was a global variable that is exported to @@ -2870,7 +2872,7 @@ static Sys_var_ulong Sys_server_id( "Uniquely identifies the server instance in the community of " "replication partners", SESSION_VAR(server_id), CMD_LINE(REQUIRED_ARG, OPT_SERVER_ID), - VALID_RANGE(0, UINT_MAX32), DEFAULT(0), BLOCK_SIZE(1), NO_MUTEX_GUARD, + VALID_RANGE(1, UINT_MAX32), DEFAULT(1), BLOCK_SIZE(1), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(check_has_super), ON_UPDATE(fix_server_id)); static Sys_var_mybool Sys_slave_compressed_protocol( @@ -3706,6 +3708,12 @@ static Sys_var_bit Sys_unique_checks( REVERSE(OPTION_RELAXED_UNIQUE_CHECKS), DEFAULT(TRUE), NO_MUTEX_GUARD, IN_BINLOG); +static Sys_var_bit Sys_no_check_constraint( + "check_constraint_checks", "check_constraint_checks", + SESSION_VAR(option_bits), NO_CMD_LINE, + REVERSE(OPTION_NO_CHECK_CONSTRAINT_CHECKS), + DEFAULT(TRUE), NO_MUTEX_GUARD, IN_BINLOG); + #ifdef ENABLED_PROFILING static bool update_profiling(sys_var *self, THD *thd, enum_var_type type) { @@ -4730,7 +4738,7 @@ static Sys_var_charptr Sys_wsrep_cluster_address ( static Sys_var_charptr Sys_wsrep_node_name ( "wsrep_node_name", "Node name", PREALLOCATED GLOBAL_VAR(wsrep_node_name), CMD_LINE(REQUIRED_ARG), - IN_SYSTEM_CHARSET, DEFAULT(""), NO_MUTEX_GUARD, NOT_IN_BINLOG, + IN_SYSTEM_CHARSET, DEFAULT(glob_hostname), NO_MUTEX_GUARD, NOT_IN_BINLOG, wsrep_node_name_check, wsrep_node_name_update); static Sys_var_charptr Sys_wsrep_node_address ( @@ -4872,7 +4880,8 @@ static bool fix_wsrep_causal_reads(sys_var *self, THD* thd, enum_var_type var_ty static Sys_var_mybool Sys_wsrep_causal_reads( "wsrep_causal_reads", "Setting this variable is equivalent " "to setting wsrep_sync_wait READ flag", - SESSION_VAR(wsrep_causal_reads), CMD_LINE(OPT_ARG), DEFAULT(FALSE), + SESSION_VAR(wsrep_causal_reads), + CMD_LINE(OPT_ARG, OPT_WSREP_CAUSAL_READS), DEFAULT(FALSE), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), ON_UPDATE(fix_wsrep_causal_reads), DEPRECATED("'@@wsrep_sync_wait=1'")); @@ -4882,7 +4891,7 @@ static Sys_var_uint Sys_wsrep_sync_wait( "an operation of the type specified by bitmask: 1 - READ(includes " "SELECT, SHOW and BEGIN/START TRANSACTION); 2 - UPDATE and DELETE; 4 - " "INSERT and REPLACE", - SESSION_VAR(wsrep_sync_wait), CMD_LINE(OPT_ARG), + SESSION_VAR(wsrep_sync_wait), CMD_LINE(OPT_ARG, OPT_WSREP_SYNC_WAIT), VALID_RANGE(WSREP_SYNC_WAIT_NONE, WSREP_SYNC_WAIT_MAX), DEFAULT(WSREP_SYNC_WAIT_NONE), BLOCK_SIZE(1), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), diff --git a/sql/sys_vars.ic b/sql/sys_vars.ic index 2488e804310..ca6634849a1 100644 --- a/sql/sys_vars.ic +++ b/sql/sys_vars.ic @@ -30,6 +30,7 @@ #include "strfunc.h" #include "tztime.h" // my_tz_find, my_tz_SYSTEM, struct Time_zone #include "rpl_mi.h" // For Multi-Source Replication +#include "debug_sync.h" /* a set of mostly trivial (as in f(X)=X) defines below to make system variable diff --git a/sql/table.cc b/sql/table.cc index 3dff8ac7f59..6e5caf7f998 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -1,5 +1,5 @@ /* Copyright (c) 2000, 2015, Oracle and/or its affiliates. - Copyright (c) 2008, 2015, MariaDB + Copyright (c) 2008, 2016, MariaDB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -43,6 +43,11 @@ #include "rpl_filter.h" #include "sql_cte.h" +/* For MySQL 5.7 virtual fields */ +#define MYSQL57_GENERATED_FIELD 128 +#define MYSQL57_GCOL_HEADER_SIZE 4 + + /* INFORMATION_SCHEMA name */ LEX_STRING INFORMATION_SCHEMA_NAME= {C_STRING_WITH_LEN("information_schema")}; @@ -62,7 +67,7 @@ LEX_STRING SLOW_LOG_NAME= {C_STRING_WITH_LEN("slow_log")}; Keyword added as a prefix when parsing the defining expression for a virtual column read from the column definition saved in the frm file */ -LEX_STRING parse_vcol_keyword= { C_STRING_WITH_LEN("PARSE_VCOL_EXPR ") }; +static LEX_STRING parse_vcol_keyword= { C_STRING_WITH_LEN("PARSE_VCOL_EXPR ") }; static int64 last_table_id; @@ -122,10 +127,7 @@ Default_object_creation_ctx::create_backup_ctx(THD *thd) const void Default_object_creation_ctx::change_env(THD *thd) const { - thd->variables.character_set_client= m_client_cs; - thd->variables.collation_connection= m_connection_cl; - - thd->update_charset(); + thd->update_charset(m_client_cs, m_connection_cl); } /************************************************************************** @@ -280,7 +282,8 @@ TABLE_CATEGORY get_table_category(const LEX_STRING *db, const LEX_STRING *name) SYNOPSIS alloc_table_share() - TABLE_LIST Take database and table name from there + db Database name + table_name Table name key Table cache key (db \0 table_name \0...) key_length Length of key @@ -353,7 +356,7 @@ TABLE_SHARE *alloc_table_share(const char *db, const char *table_name, thd thread handle share Share to fill key Table_cache_key, as generated from tdc_create_key. - must start with db name. + must start with db name. key_length Length of key table_name Table name path Path to file (possible in lower case) without .frm @@ -393,7 +396,7 @@ void init_tmp_table_share(THD *thd, TABLE_SHARE *share, const char *key, share->path.str= (char*) path; share->normalized_path.str= (char*) path; share->path.length= share->normalized_path.length= strlen(path); - share->frm_version= FRM_VER_TRUE_VARCHAR; + share->frm_version= FRM_VER_CURRENT; share->cached_row_logging_check= 0; // No row logging @@ -535,7 +538,7 @@ inline bool is_system_table_name(const char *name, uint length) my_tolower(ci, name[1]) == 'n' && my_tolower(ci, name[2]) == 'n' && my_tolower(ci, name[3]) == 'o')) || - + /* mysql.event table */ (my_tolower(ci, name[0]) == 'e' && my_tolower(ci, name[1]) == 'v' && @@ -710,8 +713,8 @@ static bool create_key_infos(const uchar *strpos, const uchar *frm_image_end, When in the future we support others schemes of extending of secondary keys with components of the primary key we'll have - to change the type of this flag for an enumeration type. - */ + to change the type of this flag for an enumeration type. + */ for (i=0 ; i < keys ; i++, keyinfo++) { @@ -908,6 +911,52 @@ static uint upgrade_collation(ulong mysql_version, uint cs_number) } +/* + In MySQL 5.7 the null bits for not stored virtual fields are last. + Calculate the position for these bits +*/ + +static void mysql57_calculate_null_position(TABLE_SHARE *share, + uchar **null_pos, + uint *null_bit_pos, + const uchar *strpos, + const uchar *vcol_screen_pos) +{ + uint field_pack_length= 17; + + for (uint i=0 ; i < share->fields; i++, strpos+= field_pack_length) + { + uint field_length, pack_flag; + enum_field_types field_type; + + if ((strpos[10] & MYSQL57_GENERATED_FIELD)) + { + /* Skip virtual (not stored) generated field */ + bool stored_in_db= (bool) (uint) (vcol_screen_pos[3]); + vcol_screen_pos+= (uint2korr(vcol_screen_pos + 1) + + MYSQL57_GCOL_HEADER_SIZE); + if (! stored_in_db) + continue; + } + field_length= uint2korr(strpos+3); + pack_flag= uint2korr(strpos+8); + field_type= (enum_field_types) (uint) strpos[13]; + if (field_type == MYSQL_TYPE_BIT && !f_bit_as_char(pack_flag)) + { + if (((*null_bit_pos)+= field_length & 7) > 7) + { + (*null_pos)++; + (*null_bit_pos)-= 8; + } + } + if (f_maybe_null(pack_flag)) + { + if (!((*null_bit_pos)= ((*null_bit_pos) + 1) & 7)) + (*null_pos)++; + } + } +} + /** Read data from a binary .frm file image into a TABLE_SHARE @@ -932,14 +981,14 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, uint new_frm_ver, field_pack_length, new_field_pack_flag; uint interval_count, interval_parts, read_length, int_length; uint db_create_options, keys, key_parts, n_length; - uint com_length, null_bit_pos; + uint com_length, null_bit_pos, mysql57_vcol_null_bit_pos, bitmap_count; uint extra_rec_buf_length; uint i; - bool use_hash; + bool use_hash, mysql57_null_bits= 0; char *keynames, *names, *comment_pos; const uchar *forminfo, *extra2; const uchar *frm_image_end = frm_image + frm_length; - uchar *record, *null_flags, *null_pos; + uchar *record, *null_flags, *null_pos, *mysql57_vcol_null_pos; const uchar *disk_buff, *strpos; ulong pos, record_offset; ulong rec_buff_length; @@ -952,7 +1001,7 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, my_bitmap_map *bitmaps; bool null_bits_are_used; uint vcol_screen_length, UNINIT_VAR(options_len); - char *vcol_screen_pos; + uchar *vcol_screen_pos; const uchar *options= 0; uint UNINIT_VAR(gis_options_len); const uchar *gis_options= 0; @@ -960,11 +1009,12 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, uint len; uint ext_key_parts= 0; plugin_ref se_plugin= 0; - keyinfo= &first_keyinfo; - share->ext_key_parts= 0; MEM_ROOT *old_root= thd->mem_root; + Virtual_column_info **table_check_constraints; DBUG_ENTER("TABLE_SHARE::init_from_binary_frm_image"); + keyinfo= &first_keyinfo; + share->ext_key_parts= 0; thd->mem_root= &share->mem_root; if (write && write_frm_image(frm_image, frm_length)) @@ -973,6 +1023,16 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, if (frm_length < FRM_HEADER_SIZE + FRM_FORMINFO_SIZE) goto err; + share->frm_version= frm_image[2]; + /* + Check if .frm file created by MySQL 5.0. In this case we want to + display CHAR fields as CHAR and not as VARCHAR. + We do it this way as we want to keep the old frm version to enable + MySQL 4.1 to read these files. + */ + if (share->frm_version == FRM_VER_TRUE_VARCHAR -1 && frm_image[33] == 5) + share->frm_version= FRM_VER_TRUE_VARCHAR; + new_field_pack_flag= frm_image[27]; new_frm_ver= (frm_image[2] - FRM_VER); field_pack_length= new_frm_ver < 2 ? 11 : 17; @@ -1061,16 +1121,6 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, if (forminfo + FRM_FORMINFO_SIZE >= frm_image_end) goto err; - share->frm_version= frm_image[2]; - /* - Check if .frm file created by MySQL 5.0. In this case we want to - display CHAR fields as CHAR and not as VARCHAR. - We do it this way as we want to keep the old frm version to enable - MySQL 4.1 to read these files. - */ - if (share->frm_version == FRM_VER_TRUE_VARCHAR -1 && frm_image[33] == 5) - share->frm_version= FRM_VER_TRUE_VARCHAR; - #ifdef WITH_PARTITION_STORAGE_ENGINE if (frm_image[61] && !share->default_part_plugin) { @@ -1098,7 +1148,7 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, uint cs_new= upgrade_collation(share->mysql_version, cs_org); if (cs_org != cs_new) share->incompatible_version|= HA_CREATE_USED_CHARSET; - + share->avg_row_length= uint4korr(frm_image+34); share->transactional= (ha_choice) enum_value_with_check(thd, share, "transactional", frm_image[39] & 3, HA_CHOICE_MAX); @@ -1112,6 +1162,7 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, share->null_field_first= 1; share->stats_sample_pages= uint2korr(frm_image+42); share->stats_auto_recalc= (enum_stats_auto_recalc)(frm_image[44]); + share->table_check_constraints= uint2korr(frm_image+45); } if (!share->table_charset) { @@ -1369,8 +1420,8 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, share->null_fields= uint2korr(forminfo+282); com_length= uint2korr(forminfo+284); vcol_screen_length= uint2korr(forminfo+286); - share->vfields= 0; - share->default_fields= 0; + share->virtual_fields= share->default_expressions= + share->field_check_constraints= share->default_fields= 0; share->stored_fields= share->fields; if (forminfo[46] != (uchar)255) { @@ -1381,42 +1432,38 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, DBUG_PRINT("info",("i_count: %d i_parts: %d index: %d n_length: %d int_length: %d com_length: %d vcol_screen_length: %d", interval_count,interval_parts, keys,n_length,int_length, com_length, vcol_screen_length)); + if (!multi_alloc_root(&share->mem_root, + &share->field, (uint)(share->fields+1)*sizeof(Field*), + &share->intervals, (uint)interval_count*sizeof(TYPELIB), + &share->check_constraints, (uint) share->table_check_constraints * sizeof(Virtual_column_info*), + &interval_array, (uint) (share->fields+interval_parts+ keys+3)*sizeof(char *), + &names, (uint) (n_length+int_length), + &comment_pos, (uint) com_length, + &vcol_screen_pos, vcol_screen_length, + NullS)) - if (!(field_ptr = (Field **) - alloc_root(&share->mem_root, - (uint) ((share->fields+1)*sizeof(Field*)+ - interval_count*sizeof(TYPELIB)+ - (share->fields+interval_parts+ - keys+3)*sizeof(char *)+ - (n_length+int_length+com_length+ - vcol_screen_length))))) - goto err; /* purecov: inspected */ + goto err; - share->field= field_ptr; + field_ptr= share->field; + table_check_constraints= share->check_constraints; read_length=(uint) (share->fields * field_pack_length + pos+ (uint) (n_length+int_length+com_length+ vcol_screen_length)); strpos= disk_buff+pos; - share->intervals= (TYPELIB*) (field_ptr+share->fields+1); - interval_array= (const char **) (share->intervals+interval_count); - names= (char*) (interval_array+share->fields+interval_parts+keys+3); if (!interval_count) share->intervals= 0; // For better debugging - memcpy((char*) names, strpos+(share->fields*field_pack_length), - (uint) (n_length+int_length)); - comment_pos= names+(n_length+int_length); + + memcpy(names, strpos+(share->fields*field_pack_length), n_length+int_length); memcpy(comment_pos, disk_buff+read_length-com_length-vcol_screen_length, com_length); - vcol_screen_pos= names+(n_length+int_length+com_length); memcpy(vcol_screen_pos, disk_buff+read_length-vcol_screen_length, vcol_screen_length); fix_type_pointers(&interval_array, &share->fieldnames, 1, &names); if (share->fieldnames.count != share->fields) goto err; - fix_type_pointers(&interval_array, share->intervals, interval_count, - &names); + fix_type_pointers(&interval_array, share->intervals, interval_count, &names); { /* Set ENUM and SET lengths */ @@ -1478,6 +1525,22 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, share->fields,0,0, (my_hash_get_key) get_field_name,0,0); + if (share->mysql_version >= 50700 && share->mysql_version < 100000 && + vcol_screen_length) + { + /* + MySQL 5.7 stores the null bits for not stored fields last. + Calculate the position for them. + */ + mysql57_null_bits= 1; + mysql57_vcol_null_pos= null_pos; + mysql57_vcol_null_bit_pos= null_bit_pos; + mysql57_calculate_null_position(share, &mysql57_vcol_null_pos, + &mysql57_vcol_null_bit_pos, + strpos, + vcol_screen_pos); + } + for (i=0 ; i < share->fields; i++, strpos+=field_pack_length, field_ptr++) { uint pack_flag, interval_nr, unireg_type, recpos, field_length; @@ -1488,8 +1551,8 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, Field::geometry_type geom_type= Field::GEOM_GEOMETRY; LEX_STRING comment; Virtual_column_info *vcol_info= 0; - bool fld_stored_in_db= TRUE; uint gis_length, gis_decimals, srid= 0; + Field::utype unireg_check; if (new_frm_ver >= 3) { @@ -1545,7 +1608,8 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, if ((uchar)field_type == (uchar)MYSQL_TYPE_VIRTUAL) { DBUG_ASSERT(interval_nr); // Expect non-null expression - /* + /* + MariaDB version 10.0 version. The interval_id byte in the .frm file stores the length of the expression statement for a virtual column. */ @@ -1565,17 +1629,43 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, comment_pos+= comment_length; } + if (unireg_type & MYSQL57_GENERATED_FIELD) + { + unireg_type&= MYSQL57_GENERATED_FIELD; + + if ((uint)(vcol_screen_pos)[0] != 1) + goto err; + vcol_info= new (&share->mem_root) Virtual_column_info(); + vcol_info_length= uint2korr(vcol_screen_pos + 1); + DBUG_ASSERT(vcol_info_length); + vcol_info->stored_in_db= (bool) (uint) vcol_screen_pos[3]; + if (!(vcol_info->expr_str.str= + (char *)memdup_root(&share->mem_root, + vcol_screen_pos + MYSQL57_GCOL_HEADER_SIZE, + vcol_info_length))) + goto err; + vcol_info->expr_str.length= vcol_info_length; + vcol_info->utf8= 0; + vcol_screen_pos+= vcol_info_length + MYSQL57_GCOL_HEADER_SIZE;; + share->virtual_fields++; + vcol_info_length= 0; + } + if (vcol_info_length) { /* + Old virtual field information before 10.2 + Get virtual column data stored in the .frm file as follows: byte 1 = 1 | 2 byte 2 = sql_type - byte 3 = flags (as of now, 0 - no flags, 1 - field is physically stored) - [byte 4] = optional interval_id for sql_type (only if byte 1 == 2) + byte 3 = flags (as of now, 0 - no flags, + 1 - field is physically stored) + [byte 4] = optional interval_id for sql_type (if byte 1 == 2) next byte ... = virtual column expression (text data) */ - vcol_info= new Virtual_column_info(); + + vcol_info= new (&share->mem_root) Virtual_column_info(); bool opt_interval_id= (uint)vcol_screen_pos[0] == 2; field_type= (enum_field_types) (uchar) vcol_screen_pos[1]; if (opt_interval_id) @@ -1583,20 +1673,21 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, else if ((uint)vcol_screen_pos[0] != 1) goto err; - fld_stored_in_db= (bool) (uint) vcol_screen_pos[2]; + vcol_info->stored_in_db= (bool) (uint) vcol_screen_pos[2]; vcol_expr_length= vcol_info_length - - (uint)(FRM_VCOL_HEADER_SIZE(opt_interval_id)); + (uint)(FRM_VCOL_OLD_HEADER_SIZE(opt_interval_id)); if (!(vcol_info->expr_str.str= (char *)memdup_root(&share->mem_root, vcol_screen_pos + - (uint) FRM_VCOL_HEADER_SIZE(opt_interval_id), + (uint) FRM_VCOL_OLD_HEADER_SIZE(opt_interval_id), vcol_expr_length))) goto err; if (opt_interval_id) interval_nr= (uint) vcol_screen_pos[3]; vcol_info->expr_str.length= vcol_expr_length; + vcol_info->utf8= 0; // before 10.2.1 the charset was unknown vcol_screen_pos+= vcol_info_length; - share->vfields++; + share->virtual_fields++; } } else @@ -1615,7 +1706,7 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, /* Try to choose the best 4.1 type: - for 4.0 "CHAR(N) BINARY" or "VARCHAR(N) BINARY" - try to find a binary collation for character set. + try to find a binary collation for character set. - for other types (e.g. BLOB) just use my_charset_bin. */ if (!f_is_blob(pack_flag)) @@ -1633,13 +1724,17 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, bzero((char*) &comment, sizeof(comment)); } + /* Remove >32 decimals from old files */ + if (share->mysql_version < 100200) + pack_flag&= ~(FIELDFLAG_LEFT_FULLSCREEN); + if (interval_nr && charset->mbminlen > 1) { /* Unescape UCS2 intervals from HEX notation */ TYPELIB *interval= share->intervals + interval_nr - 1; unhex_type2(interval); } - + #ifndef TO_BE_DELETED_ON_PRODUCTION if (field_type == MYSQL_TYPE_NEWDECIMAL && !share->mysql_version) { @@ -1667,30 +1762,45 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, } #endif + if (mysql57_null_bits && vcol_info && !vcol_info->stored_in_db) + { + swap_variables(uchar*, null_pos, mysql57_vcol_null_pos); + swap_variables(uint, null_bit_pos, mysql57_vcol_null_bit_pos); + } + + /* Convert pre-10.2.2 timestamps to use Field::default_value */ + unireg_check= (Field::utype) MTYP_TYPENR(unireg_type); + if (unireg_check == Field::TIMESTAMP_DNUN_FIELD) + unireg_check= Field::TIMESTAMP_UN_FIELD; + if (unireg_check == Field::TIMESTAMP_DN_FIELD) + unireg_check= Field::NONE; + *field_ptr= reg_field= - make_field(share, &share->mem_root, record+recpos, - (uint32) field_length, - null_pos, null_bit_pos, - pack_flag, - field_type, - charset, - geom_type, srid, - (Field::utype) MTYP_TYPENR(unireg_type), - (interval_nr ? - share->intervals+interval_nr-1 : - (TYPELIB*) 0), + make_field(share, &share->mem_root, record+recpos, (uint32) field_length, + null_pos, null_bit_pos, pack_flag, field_type, charset, + geom_type, srid, unireg_check, + (interval_nr ? share->intervals+interval_nr-1 : NULL), share->fieldnames.type_names[i]); if (!reg_field) // Not supported field type goto err; + if (unireg_check != (Field::utype) MTYP_TYPENR(unireg_type)) + { + char buf[32]; + if (reg_field->decimals()) + my_snprintf(buf, sizeof(buf), "CURRENT_TIMESTAMP(%d)", reg_field->decimals()); + else + strmov(buf, "CURRENT_TIMESTAMP"); + + reg_field->default_value= new (&share->mem_root) Virtual_column_info(); + reg_field->default_value->stored_in_db= 1; + thd->make_lex_string(®_field->default_value->expr_str, buf, strlen(buf)); + share->default_expressions++; + } reg_field->field_index= i; reg_field->comment=comment; reg_field->vcol_info= vcol_info; - if (vcol_info) - reg_field->vcol_info->stored_in_db= fld_stored_in_db; - else - DBUG_ASSERT(fld_stored_in_db == true); if (field_type == MYSQL_TYPE_BIT && !f_bit_as_char(pack_flag)) { null_bits_are_used= 1; @@ -1705,6 +1815,14 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, if (!(null_bit_pos= (null_bit_pos + 1) & 7)) null_pos++; } + + if (mysql57_null_bits && vcol_info && !vcol_info->stored_in_db) + { + /* MySQL 5.7 has null bits last */ + swap_variables(uchar*, null_pos, mysql57_vcol_null_pos); + swap_variables(uint, null_bit_pos, mysql57_vcol_null_bit_pos); + } + if (f_no_default(pack_flag)) reg_field->flags|= NO_DEFAULT_VALUE_FLAG; @@ -1719,15 +1837,26 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, if (share->stored_rec_length>=recpos) share->stored_rec_length= recpos-1; } - if (reg_field->has_insert_default_function() || - reg_field->has_update_default_function()) - ++share->default_fields; + if (reg_field->has_update_default_function()) + { + has_update_default_function= 1; + if (!reg_field->default_value) + share->default_fields++; + } } *field_ptr=0; // End marker /* Sanity checks: */ DBUG_ASSERT(share->fields>=share->stored_fields); DBUG_ASSERT(share->reclength>=share->stored_rec_length); + if (mysql57_null_bits) + { + /* We want to store the value for the last bits */ + swap_variables(uchar*, null_pos, mysql57_vcol_null_pos); + swap_variables(uint, null_bit_pos, mysql57_vcol_null_bit_pos); + DBUG_ASSERT((null_pos + (null_bit_pos + 7) / 8) <= share->field[0]->ptr); + } + /* Fix key->name and key_part->field */ if (key_parts) { @@ -1859,7 +1988,7 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, keyinfo->key_part= new_key_part; } } - + /* Fix fulltext keys for old .frm files */ if (share->key_info[key].flags & HA_FULLTEXT) share->key_info[key].algorithm= HA_KEY_ALG_FULLTEXT; @@ -2033,6 +2162,97 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, null_length, 255); } + /* Handle virtual expressions */ + if (vcol_screen_length && share->frm_version >= FRM_VER_EXPRESSSIONS) + { + uchar *vcol_screen_end= vcol_screen_pos + vcol_screen_length; + + /* Skip header */ + vcol_screen_pos+= FRM_VCOL_NEW_BASE_SIZE; + + /* + Read virtual columns, default values and check constraints + See pack_expression() for how data is stored + */ + while (vcol_screen_pos < vcol_screen_end) + { + Virtual_column_info *vcol_info; + uint type= (uint) vcol_screen_pos[0]; + uint field_nr= uint2korr(vcol_screen_pos+1); + uint expr_length= uint2korr(vcol_screen_pos+3); + uint name_length= (uint) vcol_screen_pos[5]; + LEX_STRING name; + char *expr; + + vcol_screen_pos+= FRM_VCOL_NEW_HEADER_SIZE; + + name.str= 0; + if ((name.length= name_length)) + { + if (!(name.str= strmake_root(&share->mem_root, + (char*) vcol_screen_pos, + name_length))) + goto err; + } + vcol_screen_pos+= name_length; + if (!(vcol_info= new (&share->mem_root) Virtual_column_info()) || + !(expr= (char *) strmake_root(&share->mem_root, + (char*) vcol_screen_pos, + expr_length))) + goto err; + vcol_info->name= name; + + /* The following can only be true for check_constraints */ + if (field_nr != UINT_MAX16) + { + DBUG_ASSERT(field_nr < share->fields); + reg_field= share->field[field_nr]; + } + + vcol_info->expr_str.str= expr; + vcol_info->expr_str.length= expr_length; + vcol_screen_pos+= expr_length; + + switch (type) { + case 0: // Generated virtual field + { + uint recpos; + reg_field->vcol_info= vcol_info; + share->virtual_fields++; + share->stored_fields--; + /* Correct stored_rec_length as non stored fields are last */ + recpos= (uint) (reg_field->ptr - record); + if (share->stored_rec_length >= recpos) + share->stored_rec_length= recpos-1; + break; + } + case 1: // Generated stored field + vcol_info->stored_in_db= 1; + DBUG_ASSERT(!reg_field->vcol_info); + reg_field->vcol_info= vcol_info; + share->virtual_fields++; + share->virtual_stored_fields++; // For insert/load data + break; + case 2: // Default expression + vcol_info->stored_in_db= 1; + DBUG_ASSERT(!reg_field->default_value); + reg_field->default_value= vcol_info; + share->default_expressions++; + break; + case 3: // Field check constraint + DBUG_ASSERT(!reg_field->check_constraint); + reg_field->check_constraint= vcol_info; + share->field_check_constraints++; + break; + case 4: // Table check constraint + *(table_check_constraints++)= vcol_info; + break; + } + } + } + DBUG_ASSERT((table_check_constraints - share->check_constraints) == + share->table_check_constraints - share->field_check_constraints); + if (options) { DBUG_ASSERT(options_len); @@ -2084,11 +2304,33 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, share->column_bitmap_size= bitmap_buffer_size(share->fields); + bitmap_count= 1; + if (share->table_check_constraints) + { + feature_check_constraint++; + if (!(share->check_set= (MY_BITMAP*) + alloc_root(&share->mem_root, sizeof(*share->check_set)))) + goto err; + bitmap_count++; + } if (!(bitmaps= (my_bitmap_map*) alloc_root(&share->mem_root, - share->column_bitmap_size))) + share->column_bitmap_size * + bitmap_count))) goto err; my_bitmap_init(&share->all_set, bitmaps, share->fields, FALSE); bitmap_set_all(&share->all_set); + if (share->check_set) + { + /* + Bitmap for fields used by CHECK constraint. Will be filled up + at first usage of table. + */ + my_bitmap_init(share->check_set, + (my_bitmap_map*) ((uchar*) bitmaps + + share->column_bitmap_size), + share->fields, FALSE); + bitmap_clear_all(share->check_set); + } delete handler_file; #ifndef DBUG_OFF @@ -2173,7 +2415,6 @@ int TABLE_SHARE::init_from_sql_statement_string(THD *thd, bool write, handlerton *hton= plugin_hton(db_plugin); LEX_CUSTRING frm= {0,0}; LEX_STRING db_backup= { thd->db, thd->db_length }; - DBUG_ENTER("TABLE_SHARE::init_from_sql_statement_string"); /* @@ -2280,28 +2521,65 @@ void TABLE_SHARE::free_frm_image(const uchar *frm) } -/* - @brief - Clear GET_FIXED_FIELDS_FLAG in all fields of a table - - @param - table The table for whose fields the flags are to be cleared - - @note - This routine is used for error handling purposes. - - @return - none -*/ - -static void clear_field_flag(TABLE *table) +static bool fix_vcol_expr(THD *thd, Virtual_column_info *vcol) { - Field **ptr; - DBUG_ENTER("clear_field_flag"); + DBUG_ENTER("fix_vcol_expr"); - for (ptr= table->field; *ptr; ptr++) - (*ptr)->flags&= (~GET_FIXED_FIELDS_FLAG); - DBUG_VOID_RETURN; + const enum enum_mark_columns save_mark_used_columns= thd->mark_used_columns; + thd->mark_used_columns= MARK_COLUMNS_NONE; + + const char *save_where= thd->where; + thd->where= "virtual column function"; + + int error= vcol->expr_item->fix_fields(thd, &vcol->expr_item); + + thd->mark_used_columns= save_mark_used_columns; + thd->where= save_where; + + if (unlikely(error)) + { + my_error(ER_ERROR_EVALUATING_EXPRESSION, MYF(0), vcol->expr_str); + DBUG_RETURN(1); + } + + DBUG_RETURN(0); +} + +/** rerun fix_fields for vcols that returns time- or session- dependent values + + @note this is done for all vcols for INSERT/UPDATE/DELETE, + and only as needed for SELECTs. +*/ +bool fix_session_vcol_expr(THD *thd, Virtual_column_info *vcol) +{ + DBUG_ENTER("fix_session_vcol_expr"); + if (!(vcol->flags & (VCOL_TIME_FUNC|VCOL_SESSION_FUNC))) + DBUG_RETURN(0); + + vcol->expr_item->cleanup(); + DBUG_ASSERT(!vcol->expr_item->fixed); + DBUG_RETURN(fix_vcol_expr(thd, vcol)); +} + + +/** invoke fix_session_vcol_expr for a vcol + + @note this is called for generated column or a DEFAULT expression from + their corresponding fix_fields on SELECT. +*/ +bool fix_session_vcol_expr_for_read(THD *thd, Field *field, + Virtual_column_info *vcol) +{ + DBUG_ENTER("fix_session_vcol_expr_for_read"); + TABLE_LIST *tl= field->table->pos_in_table_list; + if (!tl || tl->lock_type >= TL_WRITE_ALLOW_WRITE) + DBUG_RETURN(0); + Security_context *save_security_ctx= thd->security_ctx; + if (tl->security_ctx) + thd->security_ctx= tl->security_ctx; + bool res= fix_session_vcol_expr(thd, vcol); + thd->security_ctx= save_security_ctx; + DBUG_RETURN(res); } @@ -2309,12 +2587,11 @@ static void clear_field_flag(TABLE *table) @brief Perform semantic analysis of the defining expression for a virtual column - @param - thd The thread object - @param - table The table containing the virtual column - @param - vcol_field The virtual field whose defining expression is to be analyzed + @param thd The thread object + @param table The table containing the virtual column + @param field Field if this is a DEFAULT or AS, otherwise NULL + @param vcol The Virtual_column object + @details The function performs semantic analysis of the defining expression for @@ -2322,156 +2599,132 @@ static void clear_field_flag(TABLE *table) values of this column. @note - The function exploits the fact that the fix_fields method sets the flag - GET_FIXED_FIELDS_FLAG for all fields in the item tree. - This flag must always be unset before returning from this function - since it is used for other purposes as well. - + If the virtual column has stored_in_db set and it uses non deterministic + function then table->non_determinstic_insert is set. + This is used in replication to ensure that row based replication is used + for inserts. + @retval TRUE An error occurred, something was wrong with the function @retval FALSE Otherwise */ -bool fix_vcol_expr(THD *thd, - TABLE *table, - Field *vcol_field) +static bool fix_and_check_vcol_expr(THD *thd, TABLE *table, Field *field, + Virtual_column_info *vcol) { - Virtual_column_info *vcol_info= vcol_field->vcol_info; - Item* func_expr= vcol_info->expr_item; - bool result= TRUE; - TABLE_LIST tables; - int error= 0; - const char *save_where; - Field **ptr, *field; - enum_mark_columns save_mark_used_columns= thd->mark_used_columns; + Item* func_expr= vcol->expr_item; + DBUG_ENTER("fix_and_check_vcol_expr"); + DBUG_PRINT("info", ("vcol: %p", vcol)); DBUG_ASSERT(func_expr); - DBUG_ENTER("fix_vcol_expr"); - thd->mark_used_columns= MARK_COLUMNS_NONE; + if (func_expr->fixed) + DBUG_RETURN(0); // nothing to do - save_where= thd->where; - thd->where= "virtual column function"; + if (fix_vcol_expr(thd, vcol)) + DBUG_RETURN(1); - /* Fix fields referenced to by the virtual column function */ - if (!func_expr->fixed) - error= func_expr->fix_fields(thd, &vcol_info->expr_item); - /* fix_fields could change the expression */ - func_expr= vcol_info->expr_item; - /* Number of columns will be checked later */ + if (vcol->flags) + DBUG_RETURN(0); // already checked, no need to do it again - if (unlikely(error)) - { - DBUG_PRINT("info", - ("Field in virtual column expression does not belong to the table")); - goto end; - } - thd->where= save_where; + /* fix_fields could've changed the expression */ + func_expr= vcol->expr_item; + + /* this was checked in check_expression(), but the frm could be mangled... */ if (unlikely(func_expr->result_type() == ROW_RESULT)) { - my_error(ER_ROW_EXPR_FOR_VCOL, MYF(0)); - goto end; + my_error(ER_OPERAND_COLUMNS, MYF(0), 1); + DBUG_RETURN(1); } -#ifdef PARANOID + /* Walk through the Item tree checking if all items are valid - to be part of the virtual column + to be part of the virtual column */ - error= func_expr->walk(&Item::check_vcol_func_processor, 0, NULL); - if (error) - { - my_error(ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED, MYF(0), field_name); - goto end; - } -#endif - if (unlikely(func_expr->const_item())) - { - my_error(ER_CONST_EXPR_IN_VCOL, MYF(0)); - goto end; - } - /* Ensure that this virtual column is not based on another virtual field. */ - ptr= table->field; - while ((field= *(ptr++))) - { - if ((field->flags & GET_FIXED_FIELDS_FLAG) && - (field->vcol_info)) - { - my_error(ER_VCOL_BASED_ON_VCOL, MYF(0)); - goto end; - } - } - result= FALSE; + Item::vcol_func_processor_result res; + res.errors= 0; -end: + int error= func_expr->walk(&Item::check_vcol_func_processor, 0, &res); + if (error || (res.errors & VCOL_IMPOSSIBLE)) + { // this can only happen if the frm was corrupted + my_error(ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED, MYF(0), res.name, + "???", field ? field->field_name : "?????"); + DBUG_RETURN(1); + } + vcol->flags= res.errors; - /* Clear GET_FIXED_FIELDS_FLAG for the fields of the table */ - clear_field_flag(table); + /* + Mark what kind of default / virtual fields the table has + */ + if (vcol->stored_in_db && + vcol->flags & (VCOL_NON_DETERMINISTIC | VCOL_SESSION_FUNC)) + table->s->non_determinstic_insert= true; - table->get_fields_in_item_tree= FALSE; - thd->mark_used_columns= save_mark_used_columns; - table->map= 0; //Restore old value - - DBUG_RETURN(result); + if (vcol->flags & VCOL_SESSION_FUNC) + table->s->vcols_need_refixing= true; + + DBUG_RETURN(0); } + /* @brief Unpack the definition of a virtual column from its linear representation - @param - thd The thread object - @param - mem_root The mem_root object where to allocated memory - @param - table The table containing the virtual column - @param - field The field for the virtual - @param - vcol_expr The string representation of the defining expression - @param[out] - error_reported The flag to inform the caller that no other error - messages are to be generated + @param thd The thread object + @param mem_root Where to allocate memory + @param table The table containing the virtual column + @param vcol The Virtual_column object + @param field Field if this is a DEFAULT or AS, otherwise NULL + @param[out] error_reported Flag to inform the caller that no + other error messages are to be generated @details - The function takes string representation 'vcol_expr' of the defining - expression for the virtual field 'field' of the table 'table' and - parses it, building an item object for it. The pointer to this item is - placed into in field->vcol_info.expr_item. After this the function performs - semantic analysis of the item by calling the the function fix_vcol_expr. - Since the defining expression is part of the table definition the item for - it is created in table->memroot within the special arena TABLE::expr_arena. + + The function takes string expression from the 'vcol' object of the + table 'table' and parses it, building an item object for it. The + pointer to this item is placed into in a Virtual_column_info object + that is created. After this the function performs + semantic analysis of the item by calling the the function + fix_and_check_vcol_expr(). Since the defining expression is part of the table + definition the item for it is created in table->memroot within the + special arena TABLE::expr_arena or in the thd memroot for INSERT DELAYED @note - Before passing 'vcol_expr" to the parser the function embraces it in - parenthesis and prepands it a special keyword. + Before passing 'vcol_expr' to the parser the function wraps it in + parentheses and prepends a special keyword. @retval - FALSE If a success + Virtual_column_info* If a success @retval - TRUE Otherwise + NULL Error */ -bool unpack_vcol_info_from_frm(THD *thd, - MEM_ROOT *mem_root, - TABLE *table, - Field *field, - LEX_STRING *vcol_expr, - bool *error_reported) + +Virtual_column_info *unpack_vcol_info_from_frm(THD *thd, + MEM_ROOT *mem_root, + TABLE *table, + Field *field, + Virtual_column_info *vcol, + bool *error_reported) { - bool rc; char *vcol_expr_str; int str_len; - CHARSET_INFO *old_character_set_client; + CHARSET_INFO *save_character_set_client, *save_collation; Query_arena *backup_stmt_arena_ptr; Query_arena backup_arena; Query_arena *vcol_arena= 0; Create_field vcol_storage; // placeholder for vcol_info Parser_state parser_state; + Virtual_column_info *vcol_info= 0; + LEX_STRING *vcol_expr= &vcol->expr_str; LEX *old_lex= thd->lex; LEX lex; + bool error; DBUG_ENTER("unpack_vcol_info_from_frm"); DBUG_ASSERT(vcol_expr); - old_character_set_client= thd->variables.character_set_client; + save_character_set_client= thd->variables.character_set_client; + save_collation= thd->variables.collation_connection; backup_stmt_arena_ptr= thd->stmt_arena; /* @@ -2482,24 +2735,15 @@ bool unpack_vcol_info_from_frm(THD *thd, if (!(vcol_expr_str= (char*) alloc_root(mem_root, vcol_expr->length + - parse_vcol_keyword.length + 3))) - { - DBUG_RETURN(TRUE); - } - memcpy(vcol_expr_str, - (char*) parse_vcol_keyword.str, - parse_vcol_keyword.length); + parse_vcol_keyword.length + 3))) + DBUG_RETURN(0); + memcpy(vcol_expr_str, parse_vcol_keyword.str, parse_vcol_keyword.length); str_len= parse_vcol_keyword.length; - memcpy(vcol_expr_str + str_len, "(", 1); - str_len++; - memcpy(vcol_expr_str + str_len, - (char*) vcol_expr->str, - vcol_expr->length); + vcol_expr_str[str_len++]= '('; + memcpy(vcol_expr_str + str_len, vcol_expr->str, vcol_expr->length); str_len+= vcol_expr->length; - memcpy(vcol_expr_str + str_len, ")", 1); - str_len++; - memcpy(vcol_expr_str + str_len, "\0", 1); - str_len++; + vcol_expr_str[str_len++]= ')'; + vcol_expr_str[str_len++]= 0; if (parser_state.init(thd, vcol_expr_str, str_len)) goto err; @@ -2517,7 +2761,7 @@ bool unpack_vcol_info_from_frm(THD *thd, Query_arena expr_arena(mem_root, Query_arena::STMT_CONVENTIONAL_EXECUTION); if (!(vcol_arena= (Query_arena *) alloc_root(mem_root, - sizeof(Query_arena)))) + sizeof(Query_arena)))) goto err; *vcol_arena= expr_arena; table->expr_arena= vcol_arena; @@ -2534,38 +2778,44 @@ bool unpack_vcol_info_from_frm(THD *thd, /* Step 3: Use the parser to build an Item object from vcol_expr_str. */ - if (parse_sql(thd, &parser_state, NULL)) + if (vcol->utf8) { - goto err; + thd->update_charset(&my_charset_utf8mb4_general_ci, + table->s->table_charset); } - /* From now on use vcol_info generated by the parser. */ - field->vcol_info= vcol_storage.vcol_info; + error= parse_sql(thd, &parser_state, NULL); + if (error) + goto err; - /* copy the stored_in_db property, the parser doesn't generate it */ - field->vcol_info->stored_in_db= - table->s->field[field->field_index]->vcol_info->stored_in_db; - - /* Validate the Item tree. */ - if (fix_vcol_expr(thd, table, field)) + vcol_storage.vcol_info->stored_in_db= vcol->stored_in_db; + vcol_storage.vcol_info->name= vcol->name; + vcol_storage.vcol_info->utf8= vcol->utf8; + if (!fix_and_check_vcol_expr(thd, table, field, vcol_storage.vcol_info)) { - *error_reported= TRUE; - field->vcol_info= 0; - goto err; + vcol_info= vcol_storage.vcol_info; // Expression ok + goto end; } - rc= FALSE; - goto end; + *error_reported= TRUE; err: - rc= TRUE; thd->free_items(); end: thd->stmt_arena= backup_stmt_arena_ptr; if (vcol_arena) thd->restore_active_arena(vcol_arena, &backup_arena); end_lex_with_single_table(thd, table, old_lex); - thd->variables.character_set_client= old_character_set_client; + if (vcol->utf8) + thd->update_charset(save_character_set_client, save_collation); - DBUG_RETURN(rc); + DBUG_RETURN(vcol_info); +} + +static bool check_vcol_forward_refs(Field *field, Virtual_column_info *vcol) +{ + bool res= vcol && + vcol->expr_item->walk(&Item::check_field_expression_processor, 0, + field); + return res; } /* @@ -2606,7 +2856,7 @@ enum open_frm_error open_table_from_share(THD *thd, TABLE_SHARE *share, uint records, i, bitmap_size, bitmap_count; bool error_reported= FALSE; uchar *record, *bitmaps; - Field **field_ptr, **UNINIT_VAR(vfield_ptr), **UNINIT_VAR(dfield_ptr); + Field **field_ptr; uint8 save_context_analysis_only= thd->lex->context_analysis_only; DBUG_ENTER("open_table_from_share"); DBUG_PRINT("enter",("name: '%s.%s' form: 0x%lx", share->db.str, @@ -2663,7 +2913,7 @@ enum open_frm_error open_table_from_share(THD *thd, TABLE_SHARE *share, records++; if (!(record= (uchar*) alloc_root(&outparam->mem_root, - share->rec_buff_length * records))) + share->rec_buff_length * records))) goto err; /* purecov: inspected */ if (records == 0) @@ -2732,7 +2982,7 @@ enum open_frm_error open_table_from_share(THD *thd, TABLE_SHARE *share, key_info->key_part= key_part; key_part_end= key_part + (share->use_ext_keys ? key_info->ext_key_parts : - key_info->user_defined_key_parts) ; + key_info->user_defined_key_parts) ; for ( ; key_part < key_part_end; key_part++) { Field *field= key_part->field= outparam->field[key_part->fieldnr - 1]; @@ -2757,54 +3007,128 @@ enum open_frm_error open_table_from_share(THD *thd, TABLE_SHARE *share, /* Process virtual and default columns, if any. */ - if (share->vfields) + if (share->virtual_fields || share->default_fields || + share->default_expressions || share->table_check_constraints) { - if (!(vfield_ptr = (Field **) alloc_root(&outparam->mem_root, - (uint) ((share->vfields+1)* - sizeof(Field*))))) + Field **vfield_ptr, **dfield_ptr; + Virtual_column_info **check_constraint_ptr; + + if (!multi_alloc_root(&outparam->mem_root, + &vfield_ptr, (uint) ((share->virtual_fields + 1)* + sizeof(Field*)), + &dfield_ptr, (uint) ((share->default_fields + + share->default_expressions +1)* + sizeof(Field*)), + &check_constraint_ptr, + (uint) ((share->table_check_constraints + 1)* + sizeof(Virtual_column_info*)), + NullS)) goto err; + if (share->virtual_fields) + outparam->vfield= vfield_ptr; + if (share->default_fields + share->default_expressions) + outparam->default_field= dfield_ptr; + if (share->table_check_constraints || share->field_check_constraints) + outparam->check_constraints= check_constraint_ptr; - outparam->vfield= vfield_ptr; - } - - if (share->default_fields) - { - if (!(dfield_ptr = (Field **) alloc_root(&outparam->mem_root, - (uint) ((share->default_fields+1)* - sizeof(Field*))))) - goto err; - - outparam->default_field= dfield_ptr; - } - - if (share->vfields || share->default_fields) - { - /* Reuse the same loop both for virtual and default fields. */ + /* Reuse the same loop both for virtual, default and check fields */ for (field_ptr= outparam->field; *field_ptr; field_ptr++) { - if (share->vfields && (*field_ptr)->vcol_info) + Field *field= *field_ptr; + if (field->vcol_info) { - if (unpack_vcol_info_from_frm(thd, - &outparam->mem_root, - outparam, - *field_ptr, - &(*field_ptr)->vcol_info->expr_str, - &error_reported)) + Virtual_column_info *vcol; + field->vcol_info->name.str= (char*) field->field_name; + if (!(vcol= unpack_vcol_info_from_frm(thd, &outparam->mem_root, + outparam, *field_ptr, + field->vcol_info, + &error_reported))) { error= OPEN_FRM_CORRUPTED; goto err; } + field->vcol_info= vcol; *(vfield_ptr++)= *field_ptr; } - if (share->default_fields && - ((*field_ptr)->has_insert_default_function() || - (*field_ptr)->has_update_default_function())) + + if (field->check_constraint) + { + Virtual_column_info *vcol; + field->check_constraint->name.str= + (char*) field->field_name; + if (!(vcol= unpack_vcol_info_from_frm(thd, &outparam->mem_root, + outparam, 0, + field->check_constraint, + &error_reported))) + { + error= OPEN_FRM_CORRUPTED; + goto err; + } + field->check_constraint= vcol; + *(check_constraint_ptr++)= vcol; + } + + if (field->default_value) + { + Virtual_column_info *vcol; + field->default_value->name.str= + (char*) field->field_name; + if (!(vcol= unpack_vcol_info_from_frm(thd, &outparam->mem_root, + outparam, *field_ptr, + field->default_value, + &error_reported))) + { + error= OPEN_FRM_CORRUPTED; + goto err; + } + field->default_value= vcol; *(dfield_ptr++)= *field_ptr; + } + else + if (field->has_update_default_function()) + *(dfield_ptr++)= *field_ptr; + } - if (share->vfields) - *vfield_ptr= 0; // End marker - if (share->default_fields) - *dfield_ptr= 0; // End marker + *vfield_ptr= 0; // End marker + *dfield_ptr= 0; // End marker + + /* Check that expressions aren't refering to not yet initialized fields */ + for (field_ptr= outparam->field; *field_ptr; field_ptr++) + { + Field *field= *field_ptr; + if (check_vcol_forward_refs(field, field->vcol_info) || + check_vcol_forward_refs(field, field->check_constraint) || + check_vcol_forward_refs(field, field->default_value)) + { + error= OPEN_FRM_CORRUPTED; + goto err; + } + } + + /* Update to use trigger fields */ + switch_defaults_to_nullable_trigger_fields(outparam); + + /* Copy table level constraints to check_constraint_ptr */ + for (i= 0 ; + i < share->table_check_constraints - share->field_check_constraints; + i++) + { + if (!(*check_constraint_ptr= + unpack_vcol_info_from_frm(thd, + &outparam->mem_root, + outparam, + 0, + share->check_constraints[i], + &error_reported))) + { + error= OPEN_FRM_CORRUPTED; + goto err; + } + (*check_constraint_ptr)->name= share->check_constraints[i]->name; + check_constraint_ptr++; + } + + *check_constraint_ptr= 0; // End marker } #ifdef WITH_PARTITION_STORAGE_ENGINE @@ -2875,7 +3199,7 @@ partititon_err: #endif /* Check virtual columns against table's storage engine. */ - if (share->vfields && + if (share->virtual_fields && (outparam->file && !(outparam->file->ha_table_flags() & HA_CAN_VIRTUAL_COLUMNS))) { @@ -2889,13 +3213,11 @@ partititon_err: bitmap_size= share->column_bitmap_size; bitmap_count= 6; - if (share->vfields) - { - if (!(outparam->def_vcol_set= (MY_BITMAP*) - alloc_root(&outparam->mem_root, sizeof(*outparam->def_vcol_set)))) - goto err; + if (share->virtual_fields) bitmap_count++; - } + if (outparam->default_field) + bitmap_count++; + if (!(bitmaps= (uchar*) alloc_root(&outparam->mem_root, bitmap_size * bitmap_count))) goto err; @@ -2906,13 +3228,27 @@ partititon_err: my_bitmap_init(&outparam->def_write_set, (my_bitmap_map*) bitmaps, share->fields, FALSE); bitmaps+= bitmap_size; - if (share->vfields) + + /* Don't allocate vcol_bitmap or explicit_value if we don't need it */ + if (share->virtual_fields) { - /* Don't allocate vcol_bitmap if we don't need it */ + if (!(outparam->def_vcol_set= (MY_BITMAP*) + alloc_root(&outparam->mem_root, sizeof(*outparam->def_vcol_set)))) + goto err; my_bitmap_init(outparam->def_vcol_set, (my_bitmap_map*) bitmaps, share->fields, FALSE); bitmaps+= bitmap_size; } + if (outparam->default_field) + { + if (!(outparam->has_value_set= (MY_BITMAP*) + alloc_root(&outparam->mem_root, sizeof(*outparam->has_value_set)))) + goto err; + my_bitmap_init(outparam->has_value_set, + (my_bitmap_map*) bitmaps, share->fields, FALSE); + bitmaps+= bitmap_size; + } + my_bitmap_init(&outparam->tmp_set, (my_bitmap_map*) bitmaps, share->fields, FALSE); bitmaps+= bitmap_size; @@ -2967,11 +3303,13 @@ partititon_err: if (share->db_type()->discover_table && (ha_err == ENOENT || ha_err == HA_ERR_NO_SUCH_TABLE)) error= OPEN_FRM_DISCOVER; - + goto err; } } + outparam->mark_columns_used_by_check_constraints(); + if (share->table_category == TABLE_CATEGORY_LOG) { outparam->no_replicate= TRUE; @@ -3021,21 +3359,16 @@ partititon_err: SYNOPSIS closefrm() table TABLE object to free - free_share Is 1 if we also want to free table_share */ -int closefrm(register TABLE *table, bool free_share) +int closefrm(register TABLE *table) { int error=0; DBUG_ENTER("closefrm"); DBUG_PRINT("enter", ("table: 0x%lx", (long) table)); if (table->db_stat) - { - if (table->s->deleting) - table->file->extra(HA_EXTRA_PREPARE_FOR_DROP); error=table->file->ha_close(); - } table->alias.free(); if (table->expr_arena) table->expr_arena->free_items(); @@ -3058,13 +3391,6 @@ int closefrm(register TABLE *table, bool free_share) table->part_info= 0; } #endif - if (free_share) - { - if (table->s->tmp_table == NO_TMP_TABLE) - tdc_release_share(table->s); - else - free_table_share(table->s); - } free_root(&table->mem_root, MYF(0)); DBUG_RETURN(error); } @@ -3349,7 +3675,8 @@ void prepare_frm_header(THD *thd, uint reclength, uchar *fileinfo, /* header */ fileinfo[0]=(uchar) 254; fileinfo[1]= 1; - fileinfo[2]= FRM_VER + 3 + MY_TEST(create_info->varchar); + fileinfo[2]= (create_info->expression_length == 0 ? FRM_VER_TRUE_VARCHAR : + FRM_VER_EXPRESSSIONS); DBUG_ASSERT(ha_storage_engine_is_enabled(create_info->db_type)); fileinfo[3]= (uchar) ha_legacy_type(create_info->db_type); @@ -3400,9 +3727,9 @@ void prepare_frm_header(THD *thd, uint reclength, uchar *fileinfo, /* Bytes 41-46 were for RAID support; now reused for other purposes */ fileinfo[41]= (uchar) (csid >> 8); int2store(fileinfo+42, create_info->stats_sample_pages & 0xffff); - fileinfo[44]= (uchar) create_info->stats_auto_recalc; - fileinfo[45]= 0; - fileinfo[46]= 0; + fileinfo[44]= (uchar) create_info->stats_auto_recalc; + int2store(fileinfo+45, (create_info->check_constraint_list->elements+ + create_info->field_check_constraints)); int4store(fileinfo+47, key_length); tmp= MYSQL_VERSION_ID; // Store to avoid warning from int4store int4store(fileinfo+51, tmp); @@ -3464,18 +3791,23 @@ bool get_field(MEM_ROOT *mem, Field *field, String *res) { char buff[MAX_FIELD_WIDTH], *to; String str(buff,sizeof(buff),&my_charset_bin); - uint length; + bool rc; + THD *thd= field->get_thd(); + ulonglong sql_mode_backup= thd->variables.sql_mode; + thd->variables.sql_mode&= ~MODE_PAD_CHAR_TO_FULL_LENGTH; field->val_str(&str); - if (!(length= str.length())) + if ((rc= !str.length() || + !(to= strmake_root(mem, str.ptr(), str.length())))) { res->length(0); - return 1; + goto ex; } - if (!(to= strmake_root(mem, str.ptr(), length))) - length= 0; // Safety fix - res->set(to, length, field->charset()); - return 0; + res->set(to, str.length(), field->charset()); + +ex: + thd->variables.sql_mode= sql_mode_backup; + return rc; } @@ -3494,17 +3826,10 @@ bool get_field(MEM_ROOT *mem, Field *field, String *res) char *get_field(MEM_ROOT *mem, Field *field) { - char buff[MAX_FIELD_WIDTH], *to; - String str(buff,sizeof(buff),&my_charset_bin); - uint length; - - field->val_str(&str); - length= str.length(); - if (!length || !(to= (char*) alloc_root(mem,length+1))) - return NullS; - memcpy(to,str.ptr(),(uint) length); - to[length]=0; - return to; + String str; + bool rc= get_field(mem, field, &str); + DBUG_ASSERT(rc || str.ptr()[str.length()] == '\0'); + return rc ? NullS : (char *) str.ptr(); } /* @@ -3934,7 +4259,7 @@ bool TABLE_SHARE::visit_subgraph(Wait_for_flush *wait_for_flush, tdc->all_tables_refs++; mysql_mutex_unlock(&tdc->LOCK_table_share); - TDC_element::All_share_tables_list::Iterator tables_it(tdc->all_tables); + All_share_tables_list::Iterator tables_it(tdc->all_tables); /* In case of multiple searches running in parallel, avoid going @@ -4333,7 +4658,7 @@ bool TABLE_LIST::setup_underlying(THD *thd) if (!view || (!field_translation && merge_underlying_list)) { SELECT_LEX *select= get_single_select(); - + if (create_field_translation(thd)) DBUG_RETURN(TRUE); @@ -4449,13 +4774,14 @@ bool TABLE_LIST::single_table_updatable() { if (!updatable) return false; - if (view_tables && view_tables->elements == 1) + if (view && view->select_lex.table_list.elements == 1) { /* We need to check deeply only single table views. Multi-table views will be turned to multi-table updates and then checked by leaf tables */ - return view_tables->head()->single_table_updatable(); + return (((TABLE_LIST *)view->select_lex.table_list.first)-> + single_table_updatable()); } return true; } @@ -4686,7 +5012,7 @@ void TABLE_LIST::cleanup_items() /* - check CHECK OPTION condition + check CHECK OPTION condition both for view and underlying table SYNOPSIS TABLE_LIST::view_check_option() @@ -4698,24 +5024,45 @@ void TABLE_LIST::cleanup_items() VIEW_CHECK_SKIP FAILED, but continue */ +const LEX_STRING view_check_name= { C_STRING_WITH_LEN("WITH CHECK OPTION") }; + + int TABLE_LIST::view_check_option(THD *thd, bool ignore_failure) { + /* VIEW's CHECK OPTION CLAUSE */ if (check_option && check_option->val_int() == 0) { TABLE_LIST *main_view= top_table(); - if (ignore_failure) - { - push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, - ER_VIEW_CHECK_FAILED, - ER_THD(thd, ER_VIEW_CHECK_FAILED), - main_view->view_db.str, main_view->view_name.str); - return(VIEW_CHECK_SKIP); - } - my_error(ER_VIEW_CHECK_FAILED, MYF(0), main_view->view_db.str, - main_view->view_name.str); - return(VIEW_CHECK_ERROR); + const char *name_db= (main_view->view ? main_view->view_db.str : + main_view->db); + const char *name_table= (main_view->view ? main_view->view_name.str : + main_view->table_name); + my_error(ER_VIEW_CHECK_FAILED, MYF(ignore_failure ? ME_JUST_WARNING : 0), + name_db, name_table); + return ignore_failure ? VIEW_CHECK_SKIP : VIEW_CHECK_ERROR; } - return(VIEW_CHECK_OK); + return table->verify_constraints(ignore_failure); +} + + +int TABLE::verify_constraints(bool ignore_failure) +{ + /* go trough check option clauses for fields and table */ + if (check_constraints && + !(in_use->variables.option_bits & OPTION_NO_CHECK_CONSTRAINT_CHECKS)) + { + for (Virtual_column_info **chk= check_constraints ; *chk ; chk++) + { + if ((*chk)->expr_item->val_int() == 0) + { + my_error(ER_CONSTRAINT_FAILED, + MYF(ignore_failure ? ME_JUST_WARNING : 0), (*chk)->name.str, + s->db.str, s->table_name.str); + return ignore_failure ? VIEW_CHECK_SKIP : VIEW_CHECK_ERROR; + } + } + } + return VIEW_CHECK_OK; } @@ -5500,6 +5847,8 @@ const char *Field_iterator_table_ref::get_table_name() { if (table_ref->view) return table_ref->view_name.str; + if (table_ref->is_derived()) + return table_ref->table->s->table_name.str; else if (table_ref->is_natural_join) return natural_join_it.column_ref()->table_name(); @@ -5699,12 +6048,12 @@ void TABLE::clear_column_bitmaps() Reset column read/write usage. It's identical to: bitmap_clear_all(&table->def_read_set); bitmap_clear_all(&table->def_write_set); - if (s->vfields) bitmap_clear_all(table->def_vcol_set); + if (s->virtual_fields) bitmap_clear_all(table->def_vcol_set); The code assumes that the bitmaps are allocated after each other, as guaranteed by open_table_from_share() */ bzero((char*) def_read_set.bitmap, - s->column_bitmap_size * (s->vfields ? 3 : 2)); + s->column_bitmap_size * (s->virtual_fields ? 3 : 2)); column_bitmaps_set(&def_read_set, &def_write_set, def_vcol_set); rpl_write_set= 0; // Safety } @@ -5816,8 +6165,7 @@ void TABLE::mark_columns_used_by_index_no_reset(uint index, if (key_part->field->vcol_info && key_part->field->vcol_info->expr_item) key_part->field->vcol_info-> - expr_item->walk(&Item::register_field_in_bitmap, - 1, (uchar *) bitmap); + expr_item->walk(&Item::register_field_in_bitmap, 1, bitmap); } } @@ -5894,6 +6242,8 @@ void TABLE::mark_columns_needed_for_delete() file->column_bitmaps_signal(); } } + if (check_constraints) + mark_check_constraint_columns_for_read(); } @@ -5950,8 +6300,22 @@ void TABLE::mark_columns_needed_for_update() file->column_bitmaps_signal(); } } + if (default_field) + mark_default_fields_for_write(FALSE); /* Mark all virtual columns needed for update */ - mark_virtual_columns_for_write(FALSE); + if (vfield) + mark_virtual_columns_for_write(FALSE); + if (check_constraints) + mark_check_constraint_columns_for_read(); + + /* + If a timestamp field settable on UPDATE is present then to avoid wrong + update force the table handler to retrieve write-only fields to be able + to compare records and detect data change. + */ + if ((file->ha_table_flags() & HA_PARTIAL_COLUMN_READ) && + default_field && s->has_update_default_function) + bitmap_union(read_set, write_set); DBUG_VOID_RETURN; } @@ -5965,6 +6329,7 @@ void TABLE::mark_columns_needed_for_update() void TABLE::mark_columns_needed_for_insert() { + DBUG_ENTER("mark_columns_needed_for_insert"); mark_columns_per_binlog_row_image(); if (triggers) @@ -5980,8 +6345,14 @@ void TABLE::mark_columns_needed_for_insert() } if (found_next_number_field) mark_auto_increment_column(); + if (default_field) + mark_default_fields_for_write(TRUE); /* Mark virtual columns for insert */ - mark_virtual_columns_for_write(TRUE); + if (vfield) + mark_virtual_columns_for_write(TRUE); + if (check_constraints) + mark_check_constraint_columns_for_read(); + DBUG_VOID_RETURN; } /* @@ -6126,7 +6497,7 @@ bool TABLE::mark_virtual_col(Field *field) { Item *vcol_item= field->vcol_info->expr_item; DBUG_ASSERT(vcol_item); - vcol_item->walk(&Item::register_field_in_read_map, 1, (uchar *) 0); + vcol_item->walk(&Item::register_field_in_read_map, 1, 0); } return res; } @@ -6134,7 +6505,7 @@ bool TABLE::mark_virtual_col(Field *field) /* @brief Mark virtual columns for update/insert commands - + @param insert_fl <-> virtual columns are marked for insert command @details @@ -6142,7 +6513,7 @@ bool TABLE::mark_virtual_col(Field *field) in the vcol_set bitmap. For an insert command a virtual column is always marked in write_set if it is a stored column. - If a virtual column is from write_set it is always marked in vcol_set. + If a virtual column is from write_set it is always marked in vcol_set. If a stored virtual column is not from write_set but it is computed through columns from write_set it is also marked in vcol_set, and, besides, it is added to write_set. @@ -6157,7 +6528,7 @@ bool TABLE::mark_virtual_col(Field *field) column b will be placed into read_set. If column c was a virtual column, but not a stored virtual column then it would not be added to any of the sets. Column b would not - be added to read_set either. + be added to read_set either. */ void TABLE::mark_virtual_columns_for_write(bool insert_fl) @@ -6165,12 +6536,6 @@ void TABLE::mark_virtual_columns_for_write(bool insert_fl) Field **vfield_ptr, *tmp_vfield; bool bitmap_updated= FALSE; - if (!vfield) - return; - - if (!vfield) - return; - for (vfield_ptr= vfield; *vfield_ptr; vfield_ptr++) { tmp_vfield= *vfield_ptr; @@ -6187,7 +6552,7 @@ void TABLE::mark_virtual_columns_for_write(bool insert_fl) bitmap_clear_all(&tmp_set); save_read_set= read_set; read_set= &tmp_set; - vcol_item->walk(&Item::register_field_in_read_map, 1, (uchar *) 0); + vcol_item->walk(&Item::register_field_in_read_map, 1, 0); read_set= save_read_set; bitmap_intersect(&tmp_set, write_set); mark_fl= !bitmap_is_clear_all(&tmp_set); @@ -6198,35 +6563,41 @@ void TABLE::mark_virtual_columns_for_write(bool insert_fl) mark_virtual_col(tmp_vfield); bitmap_updated= TRUE; } - } + } } if (bitmap_updated) file->column_bitmaps_signal(); } - -/** - Check if a table has a default function either for INSERT or UPDATE-like - operation - @retval true there is a default function - @retval false there is no default function +/* + Mark fields used by check constraints. + This is done once for the TABLE_SHARE the first time the table is opened. + The marking must be done non-destructively to handle the case when + this could be run in parallely by two threads */ -bool TABLE::has_default_function(bool is_update) +void TABLE::mark_columns_used_by_check_constraints(void) { - Field **dfield_ptr, *dfield; - bool res= false; - for (dfield_ptr= default_field; *dfield_ptr; dfield_ptr++) - { - dfield= (*dfield_ptr); - if (is_update) - res= dfield->has_update_default_function(); - else - res= dfield->has_insert_default_function(); - if (res) - return res; - } - return res; + MY_BITMAP *save_read_set; + /* If there is no check constraints or if check_set is already initialized */ + if (!s->check_set || s->check_set_initialized) + return; + + save_read_set= read_set; + read_set= s->check_set; + + for (Virtual_column_info **chk= check_constraints ; *chk ; chk++) + (*chk)->expr_item->walk(&Item::register_field_in_read_map, 1, 0); + + read_set= save_read_set; + s->check_set_initialized= 1; +} + +/* Add fields used by CHECK CONSTRAINT to read map */ + +void TABLE::mark_check_constraint_columns_for_read(void) +{ + bitmap_union(read_set, s->check_set); } @@ -6234,19 +6605,23 @@ bool TABLE::has_default_function(bool is_update) Add all fields that have a default function to the table write set. */ -void TABLE::mark_default_fields_for_write() +void TABLE::mark_default_fields_for_write(bool is_insert) { - Field **dfield_ptr, *dfield; - enum_sql_command cmd= in_use->lex->sql_command; - for (dfield_ptr= default_field; *dfield_ptr; dfield_ptr++) + DBUG_ENTER("mark_default_fields_for_write"); + Field **field_ptr, *field; + for (field_ptr= default_field; *field_ptr; field_ptr++) { - dfield= (*dfield_ptr); - if (((sql_command_flags[cmd] & CF_INSERTS_DATA) && - dfield->has_insert_default_function()) || - ((sql_command_flags[cmd] & CF_UPDATES_DATA) && - dfield->has_update_default_function())) - bitmap_set_bit(write_set, dfield->field_index); + field= (*field_ptr); + if (is_insert && field->default_value) + { + bitmap_set_bit(write_set, field->field_index); + field->default_value->expr_item-> + walk(&Item::register_field_in_read_map, 1, 0); + } + else if (!is_insert && field->has_update_default_function()) + bitmap_set_bit(write_set, field->field_index); } + DBUG_VOID_RETURN; } @@ -6598,7 +6973,7 @@ void TABLE_LIST::reinit_before_use(THD *thd) */ Item_subselect *TABLE_LIST::containing_subselect() -{ +{ return (select_lex ? select_lex->master_unit()->item : 0); } @@ -6628,7 +7003,7 @@ Item_subselect *TABLE_LIST::containing_subselect() is equivalent to USE INDEX (i1,i2) and means "consider only i1 and i2". - + Similarly USE INDEX () USE INDEX (i1) is equivalent to @@ -6637,7 +7012,7 @@ Item_subselect *TABLE_LIST::containing_subselect() It is OK to have the same index several times, e.g. "USE INDEX (i1,i1)" is not an error. - + Different kind of hints (USE/FORCE/IGNORE) are processed in the following order: 1. All indexes in USE (or FORCE) INDEX are added to the mask. @@ -6880,16 +7255,17 @@ bool is_simple_order(ORDER *order) @param thd Thread handle @param table The TABLE object - @param vcol_update_mode Specifies what virtual column are computed + @param vcol_update_mode Specifies what virtual column are computed @details The function computes the values of the virtual columns of the table and stores them in the table record buffer. If vcol_update_mode is set to VCOL_UPDATE_ALL then all virtual column are - computed. Otherwise, only fields from vcol_set are computed: all of them, - if vcol_update_mode is set to VCOL_UPDATE_FOR_WRITE, and, only those with - the stored_in_db flag set to false, if vcol_update_mode is equal to - VCOL_UPDATE_FOR_READ. + computed. + If vcol_update_mode is set to VCOL_UPDATE_FOR_WRITE then all + fields that are set in vcol_set are updated. + If vcol_update_mode is set to VCOL_UPDATE_FOR_READ then all + fields that are set in vcol_set and are not stored are updated. @retval 0 Success @@ -6914,7 +7290,8 @@ int update_virtual_fields(THD *thd, TABLE *table, DBUG_ASSERT(vcol_info); DBUG_ASSERT(vcol_info->expr_item); if ((bitmap_is_set(table->vcol_set, vfield->field_index) && - (vcol_update_mode == VCOL_UPDATE_FOR_WRITE || !vcol_info->stored_in_db)) || + (vcol_update_mode == VCOL_UPDATE_FOR_WRITE || + !vcol_info->stored_in_db)) || vcol_update_mode == VCOL_UPDATE_ALL) { /* Compute the actual value of the virtual fields */ @@ -6941,47 +7318,67 @@ int update_virtual_fields(THD *thd, TABLE *table, definition and the current operation one or the other kind of update function is evaluated. + @param update_command True if command was an update else insert + @param ignore_errors True if we should ignore errors + @retval 0 Success @retval - >0 Error occurred when storing a virtual field value + >0 Error occurred when storing a virtual field value and + ignore_errors == 0. If set then an error was generated. */ -int TABLE::update_default_fields() +int TABLE::update_default_fields(bool update_command, bool ignore_errors) { DBUG_ENTER("update_default_fields"); - Field **dfield_ptr, *dfield; + Field **field_ptr; int res= 0; - enum_sql_command cmd= in_use->lex->sql_command; - DBUG_ASSERT(default_field); + in_use->reset_arena_for_cached_items(expr_arena); + /* Iterate over fields with default functions in the table */ - for (dfield_ptr= default_field; *dfield_ptr; dfield_ptr++) + for (field_ptr= default_field; *field_ptr ; field_ptr++) { - dfield= (*dfield_ptr); + Field *field= (*field_ptr); /* - If an explicit default value for a filed overrides the default, + If an explicit default value for a field overrides the default, do not update the field with its automatic default value. */ - if (!(dfield->flags & HAS_EXPLICIT_VALUE)) + if (!field->has_explicit_value()) { - if (sql_command_flags[cmd] & CF_INSERTS_DATA) - res= dfield->evaluate_insert_default_function(); - if (sql_command_flags[cmd] & CF_UPDATES_DATA) - res= dfield->evaluate_update_default_function(); - if (res) - DBUG_RETURN(res); + if (!update_command) + { + if (field->default_value && + (field->default_value->flags || field->flags & BLOB_FLAG)) + res|= (field->default_value->expr_item->save_in_field(field, 0) < 0); + else + res|= field->evaluate_insert_default_function(); + } + else + res|= field->evaluate_update_default_function(); + if (!ignore_errors && res) + { + my_error(ER_CALCULATING_DEFAULT_VALUE, MYF(0), field->field_name); + break; + } + res= 0; } } + in_use->reset_arena_for_cached_items(0); DBUG_RETURN(res); } +/** + Reset markers that fields are being updated +*/ + void TABLE::reset_default_fields() { - if (default_field) - for (Field **df= default_field; *df; df++) - (*df)->flags&= ~HAS_EXPLICIT_VALUE; + DBUG_ENTER("reset_default_fields"); + if (has_value_set) + bitmap_clear_all(has_value_set); + DBUG_VOID_RETURN; } /* @@ -7317,6 +7714,7 @@ bool TABLE_LIST::init_derived(THD *thd, bool init_view) /* A subquery might be forced to be materialized due to a side-effect. */ if (!is_materialized_derived() && first_select->is_mergeable() && optimizer_flag(thd, OPTIMIZER_SWITCH_DERIVED_MERGE) && + !thd->lex->can_not_use_merged() && !(thd->lex->sql_command == SQLCOM_UPDATE_MULTI || thd->lex->sql_command == SQLCOM_DELETE_MULTI) && !is_recursive_with_table()) diff --git a/sql/table.h b/sql/table.h index e0b993d5c05..6b2f20b3875 100644 --- a/sql/table.h +++ b/sql/table.h @@ -2,6 +2,7 @@ #define TABLE_INCLUDED /* Copyright (c) 2000, 2013, Oracle and/or its affiliates. Copyright (c) 2009, 2014, SkySQL Ab. + Copyright (c) 2016, MariaDB Corporation This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -49,7 +50,9 @@ class ACL_internal_table_access; class Field; class Table_statistics; class With_element; -class TDC_element; +struct TDC_element; +class Virtual_column_info; +class Table_triggers_list; /* Used to identify NESTED_JOIN structures within a join (applicable only to @@ -327,8 +330,6 @@ enum enum_vcol_update_mode VCOL_UPDATE_ALL }; -class Field_blob; -class Table_triggers_list; /** Category of table found in the table share. @@ -578,6 +579,7 @@ struct TABLE_SHARE Field **field; Field **found_next_number_field; KEY *key_info; /* data of keys in database */ + Virtual_column_info **check_constraints; uint *blob_field; /* Index to blobs in Field arrray*/ TABLE_STATISTICS_CB stats_cb; @@ -586,6 +588,7 @@ struct TABLE_SHARE LEX_STRING comment; /* Comment about table */ CHARSET_INFO *table_charset; /* Default charset of string fields */ + MY_BITMAP *check_set; /* Fields used by check constrant */ MY_BITMAP all_set; /* Key which is used for looking-up table in table cache and in the list @@ -665,7 +668,9 @@ struct TABLE_SHARE uint open_errno; /* error from open_table_def() */ uint column_bitmap_size; uchar frm_version; - uint vfields; /* Number of computed (virtual) fields */ + uint virtual_fields; + uint default_expressions; + uint table_check_constraints, field_check_constraints; uint default_fields; /* Number of default fields */ bool use_ext_keys; /* Extended keys can be used */ bool null_field_first; @@ -673,9 +678,13 @@ struct TABLE_SHARE bool crypted; /* If .frm file is crypted */ bool crashed; bool is_view; - bool deleting; /* going to delete this table */ bool can_cmp_whole_record; bool table_creation_was_logged; + bool non_determinstic_insert; + bool vcols_need_refixing; + bool virtual_stored_fields; + bool check_set_initialized; + bool has_update_default_function; ulong table_map_id; /* for row-based replication */ /* @@ -691,7 +700,6 @@ struct TABLE_SHARE */ const File_parser *view_def; - /* Cache for row-based replication table share checks that does not need to be repeated. Possible values are: -1 when cache value is @@ -968,7 +976,7 @@ public: @param length string length @retval Pointer to the copied string. - @retval 0 if an error occured. + @retval 0 if an error occurred. */ char *store(const char *from, uint length) { @@ -1013,7 +1021,7 @@ private: One should use methods of I_P_List template instead. */ TABLE *share_all_next, **share_all_prev; - friend class TDC_element; + friend struct All_share_tables; public: @@ -1055,6 +1063,7 @@ public: Field **vfield; /* Pointer to virtual fields*/ /* Fields that are updated automatically on INSERT or UPDATE. */ Field **default_field; + Virtual_column_info **check_constraints; /* Table's triggers, 0 if there are no of them */ Table_triggers_list *triggers; @@ -1078,6 +1087,8 @@ public: MY_BITMAP *read_set, *write_set, *rpl_write_set; /* Set if using virtual fields */ MY_BITMAP *vcol_set, *def_vcol_set; + /* On INSERT: fields that the user specified a value for */ + MY_BITMAP *has_value_set; /* The ID of the query that opened and is using this table. Has different @@ -1295,8 +1306,10 @@ public: void mark_columns_per_binlog_row_image(void); bool mark_virtual_col(Field *field); void mark_virtual_columns_for_write(bool insert_fl); - void mark_default_fields_for_write(); - bool has_default_function(bool is_update); + void mark_default_fields_for_write(bool insert_fl); + void mark_columns_used_by_check_constraints(void); + void mark_check_constraint_columns_for_read(void); + int verify_constraints(bool ignore_failure); inline void column_bitmaps_set(MY_BITMAP *read_set_arg, MY_BITMAP *write_set_arg) { @@ -1406,7 +1419,7 @@ public: uint actual_n_key_parts(KEY *keyinfo); ulong actual_key_flags(KEY *keyinfo); - int update_default_fields(); + int update_default_fields(bool update, bool ignore_errors); void reset_default_fields(); inline ha_rows stat_records() { return used_stat_records; } @@ -1438,6 +1451,19 @@ struct TABLE_share } }; +struct All_share_tables +{ + static inline TABLE **next_ptr(TABLE *l) + { + return &l->share_all_next; + } + static inline TABLE ***prev_ptr(TABLE *l) + { + return &l->share_all_prev; + } +}; + +typedef I_P_List All_share_tables_list; enum enum_schema_table_state { @@ -2024,8 +2050,6 @@ struct TABLE_LIST */ bool is_fqtn; - bool deleting; /* going to delete this table */ - /* TRUE <=> derived table should be filled right after optimization. */ bool fill_me; /* TRUE <=> view/DT is merged. */ @@ -2604,9 +2628,14 @@ enum open_frm_error open_table_from_share(THD *thd, TABLE_SHARE *share, const char *alias, uint db_stat, uint prgflag, uint ha_open_flags, TABLE *outparam, bool is_create_table); -bool unpack_vcol_info_from_frm(THD *thd, MEM_ROOT *mem_root, - TABLE *table, Field *field, - LEX_STRING *vcol_expr, bool *error_reported); +bool fix_session_vcol_expr(THD *thd, Virtual_column_info *vcol); +bool fix_session_vcol_expr_for_read(THD *thd, Field *field, + Virtual_column_info *vcol); +Virtual_column_info *unpack_vcol_info_from_frm(THD *thd, MEM_ROOT *mem_root, + TABLE *table, + Field *field, + Virtual_column_info *vcol, + bool *error_reported); TABLE_SHARE *alloc_table_share(const char *db, const char *table_name, const char *key, uint key_length); void init_tmp_table_share(THD *thd, TABLE_SHARE *share, const char *key, @@ -2630,7 +2659,7 @@ bool get_field(MEM_ROOT *mem, Field *field, class String *res); bool validate_comment_length(THD *thd, LEX_STRING *comment, size_t max_len, uint err_code, const char *name); -int closefrm(TABLE *table, bool free_share); +int closefrm(TABLE *table); void free_blobs(TABLE *table); void free_field_buffers_larger_than(TABLE *table, uint32 size); ulong get_form_pos(File file, uchar *head, TYPELIB *save_names); @@ -2674,15 +2703,6 @@ inline bool is_infoschema_db(const char *name) TYPELIB *typelib(MEM_ROOT *mem_root, List &strings); -/** - return true if the table was created explicitly. -*/ -inline bool is_user_table(TABLE * table) -{ - const char *name= table->s->table_name.str; - return strncmp(name, tmp_file_prefix, tmp_file_prefix_length); -} - inline void mark_as_null_row(TABLE *table) { table->null_row=1; diff --git a/sql/table_cache.cc b/sql/table_cache.cc index b6c1e32b350..bfe51df5de1 100644 --- a/sql/table_cache.cc +++ b/sql/table_cache.cc @@ -36,8 +36,6 @@ - get number of TABLE objects in cache (tc_records()) Dependencies: - - intern_close_table(): frees TABLE object - - kill_delayed_threads_for_table() - close_cached_tables(): flush tables on shutdown - alloc_table_share() - free_table_share() @@ -83,14 +81,14 @@ static int32 tc_count; /**< Number of TABLE objects in table cache. */ static mysql_mutex_t LOCK_unused_shares; #ifdef HAVE_PSI_INTERFACE -PSI_mutex_key key_LOCK_unused_shares, key_TABLE_SHARE_LOCK_table_share; +static PSI_mutex_key key_LOCK_unused_shares, key_TABLE_SHARE_LOCK_table_share; static PSI_mutex_info all_tc_mutexes[]= { { &key_LOCK_unused_shares, "LOCK_unused_shares", PSI_FLAG_GLOBAL }, { &key_TABLE_SHARE_LOCK_table_share, "TABLE_SHARE::tdc.LOCK_table_share", 0 } }; -PSI_cond_key key_TABLE_SHARE_COND_release; +static PSI_cond_key key_TABLE_SHARE_COND_release; static PSI_cond_info all_tc_conds[]= { { &key_TABLE_SHARE_COND_release, "TABLE_SHARE::tdc.COND_release", 0 } @@ -127,6 +125,25 @@ static int fix_thd_pins(THD *thd) part of table definition cache. */ +static void intern_close_table(TABLE *table) +{ + DBUG_ENTER("intern_close_table"); + DBUG_PRINT("tcache", ("table: '%s'.'%s' 0x%lx", + table->s ? table->s->db.str : "?", + table->s ? table->s->table_name.str : "?", + (long) table)); + + delete table->triggers; + if (table->file) // Not true if placeholder + { + (void) closefrm(table); + tdc_release_share(table->s); + } + table->alias.free(); + my_free(table); + DBUG_VOID_RETURN; +} + /** Get number of TABLE objects (used and unused) in table cache. @@ -138,6 +155,19 @@ uint tc_records(void) } +/** + Wait for MDL deadlock detector to complete traversing tdc.all_tables. + + Must be called before updating TABLE_SHARE::tdc.all_tables. +*/ + +static void tc_wait_for_mdl_deadlock_detector(TDC_element *element) +{ + while (element->all_tables_refs) + mysql_cond_wait(&element->COND_release, &element->LOCK_table_share); +} + + /** Remove TABLE object from table cache. @@ -147,11 +177,37 @@ uint tc_records(void) static void tc_remove_table(TABLE *table) { + mysql_mutex_assert_owner(&table->s->tdc->LOCK_table_share); + tc_wait_for_mdl_deadlock_detector(table->s->tdc); my_atomic_add32_explicit(&tc_count, -1, MY_MEMORY_ORDER_RELAXED); table->s->tdc->all_tables.remove(table); } +static void tc_remove_all_unused_tables(TDC_element *element, + TDC_element::TABLE_list *purge_tables, + bool mark_flushed) +{ + TABLE *table; + + /* + Mark share flushed in order to ensure that it gets + automatically deleted once it is no longer referenced. + + Note that code in TABLE_SHARE::wait_for_old_version() assumes that + marking share flushed is followed by purge of unused table + shares. + */ + if (mark_flushed) + element->flushed= true; + while ((table= element->free_tables.pop_front())) + { + tc_remove_table(table); + purge_tables->push_front(table); + } +} + + /** Free all unused TABLE objects. @@ -176,17 +232,8 @@ struct tc_purge_arg static my_bool tc_purge_callback(TDC_element *element, tc_purge_arg *arg) { - TABLE *table; - mysql_mutex_lock(&element->LOCK_table_share); - element->wait_for_mdl_deadlock_detector(); - if (arg->mark_flushed) - element->flushed= true; - while ((table= element->free_tables.pop_front())) - { - tc_remove_table(table); - arg->purge_tables.push_front(table); - } + tc_remove_all_unused_tables(element, &arg->purge_tables, arg->mark_flushed); mysql_mutex_unlock(&element->LOCK_table_share); return FALSE; } @@ -204,6 +251,20 @@ void tc_purge(bool mark_flushed) } +/** + Get last element of free_tables. +*/ + +static TABLE *tc_free_tables_back(TDC_element *element) +{ + TDC_element::TABLE_list::Iterator it(element->free_tables); + TABLE *entry, *last= 0; + while ((entry= it++)) + last= entry; + return last; +} + + /** Add new TABLE object to table cache. @@ -228,12 +289,12 @@ struct tc_add_table_arg }; -my_bool tc_add_table_callback(TDC_element *element, tc_add_table_arg *arg) +static my_bool tc_add_table_callback(TDC_element *element, tc_add_table_arg *arg) { TABLE *table; mysql_mutex_lock(&element->LOCK_table_share); - if ((table= element->free_tables_back()) && table->tc_time < arg->purge_time) + if ((table= tc_free_tables_back(element)) && table->tc_time < arg->purge_time) { memcpy(arg->key, element->m_key, element->m_key_length); arg->key_length= element->m_key_length; @@ -249,7 +310,7 @@ void tc_add_table(THD *thd, TABLE *table) bool need_purge; DBUG_ASSERT(table->in_use == thd); mysql_mutex_lock(&table->s->tdc->LOCK_table_share); - table->s->tdc->wait_for_mdl_deadlock_detector(); + tc_wait_for_mdl_deadlock_detector(table->s->tdc); table->s->tdc->all_tables.push_front(table); mysql_mutex_unlock(&table->s->tdc->LOCK_table_share); @@ -274,14 +335,13 @@ void tc_add_table(THD *thd, TABLE *table) TABLE *entry; mysql_mutex_lock(&element->LOCK_table_share); lf_hash_search_unpin(thd->tdc_hash_pins); - element->wait_for_mdl_deadlock_detector(); /* It may happen that oldest table was acquired meanwhile. In this case just go ahead, number of objects in table cache will normalize eventually. */ - if ((entry= element->free_tables_back()) && + if ((entry= tc_free_tables_back(element)) && entry->tc_time == argument.purge_time) { element->free_tables.remove(entry); @@ -297,6 +357,36 @@ void tc_add_table(THD *thd, TABLE *table) } +/** + Acquire TABLE object from table cache. + + @pre share must be protected against removal. + + Acquired object cannot be evicted or acquired again. + + @return TABLE object, or NULL if no unused objects. +*/ + +static TABLE *tc_acquire_table(THD *thd, TDC_element *element) +{ + TABLE *table; + + mysql_mutex_lock(&element->LOCK_table_share); + table= element->free_tables.pop_front(); + if (table) + { + DBUG_ASSERT(!table->in_use); + table->in_use= thd; + /* The ex-unused table must be fully functional. */ + DBUG_ASSERT(table->db_stat && table->file); + /* The children must be detached from the table. */ + DBUG_ASSERT(!table->file->extra(HA_EXTRA_IS_ATTACHED_CHILDREN)); + } + mysql_mutex_unlock(&element->LOCK_table_share); + return table; +} + + /** Release TABLE object to table cache. @@ -352,7 +442,6 @@ bool tc_release_table(TABLE *table) return false; purge: - table->s->tdc->wait_for_mdl_deadlock_detector(); tc_remove_table(table); mysql_mutex_unlock(&table->s->tdc->LOCK_table_share); table->in_use= 0; @@ -361,6 +450,19 @@ purge: } +static void tdc_assert_clean_share(TDC_element *element) +{ + DBUG_ASSERT(element->share == 0); + DBUG_ASSERT(element->ref_count == 0); + DBUG_ASSERT(element->m_flush_tickets.is_empty()); + DBUG_ASSERT(element->all_tables.is_empty()); + DBUG_ASSERT(element->free_tables.is_empty()); + DBUG_ASSERT(element->all_tables_refs == 0); + DBUG_ASSERT(element->next == 0); + DBUG_ASSERT(element->prev == 0); +} + + /** Delete share from hash and free share object. */ @@ -403,7 +505,7 @@ static void tdc_delete_share_from_hash(TDC_element *element) pins= lf_hash_get_pins(&tdc_hash); DBUG_ASSERT(pins); // What can we do about it? - element->assert_clean_share(); + tdc_assert_clean_share(element); lf_hash_delete(&tdc_hash, pins, element->m_key, element->m_key_length); if (!thd) lf_hash_put_pins(pins); @@ -412,6 +514,61 @@ static void tdc_delete_share_from_hash(TDC_element *element) } +/** + Prepeare table share for use with table definition cache. +*/ + +static void lf_alloc_constructor(uchar *arg) +{ + TDC_element *element= (TDC_element*) (arg + LF_HASH_OVERHEAD); + DBUG_ENTER("lf_alloc_constructor"); + mysql_mutex_init(key_TABLE_SHARE_LOCK_table_share, + &element->LOCK_table_share, MY_MUTEX_INIT_FAST); + mysql_cond_init(key_TABLE_SHARE_COND_release, &element->COND_release, 0); + element->m_flush_tickets.empty(); + element->all_tables.empty(); + element->free_tables.empty(); + element->all_tables_refs= 0; + element->share= 0; + element->ref_count= 0; + element->next= 0; + element->prev= 0; + DBUG_VOID_RETURN; +} + + +/** + Release table definition cache specific resources of table share. +*/ + +static void lf_alloc_destructor(uchar *arg) +{ + TDC_element *element= (TDC_element*) (arg + LF_HASH_OVERHEAD); + DBUG_ENTER("lf_alloc_destructor"); + tdc_assert_clean_share(element); + mysql_cond_destroy(&element->COND_release); + mysql_mutex_destroy(&element->LOCK_table_share); + DBUG_VOID_RETURN; +} + + +static void tdc_hash_initializer(LF_HASH *hash __attribute__((unused)), + TDC_element *element, LEX_STRING *key) +{ + memcpy(element->m_key, key->str, key->length); + element->m_key_length= key->length; + tdc_assert_clean_share(element); +} + + +static uchar *tdc_hash_key(const TDC_element *element, size_t *length, + my_bool not_used __attribute__((unused))) +{ + *length= element->m_key_length; + return (uchar*) element->m_key; +} + + /** Initialize table definition cache. */ @@ -427,11 +584,11 @@ void tdc_init(void) MY_MUTEX_INIT_FAST); tdc_version= 1L; /* Increments on each reload */ lf_hash_init(&tdc_hash, sizeof(TDC_element), LF_HASH_UNIQUE, 0, 0, - (my_hash_get_key) TDC_element::key, + (my_hash_get_key) tdc_hash_key, &my_charset_bin); - tdc_hash.alloc.constructor= TDC_element::lf_alloc_constructor; - tdc_hash.alloc.destructor= TDC_element::lf_alloc_destructor; - tdc_hash.initializer= (lf_hash_initializer) TDC_element::lf_hash_initializer; + tdc_hash.alloc.constructor= lf_alloc_constructor; + tdc_hash.alloc.destructor= lf_alloc_destructor; + tdc_hash.initializer= (lf_hash_initializer) tdc_hash_initializer; DBUG_VOID_RETURN; } @@ -584,10 +741,9 @@ void tdc_unlock_share(TDC_element *element) tdc_acquire_share() thd Thread handle - table_list Table that should be opened - key Table cache key - key_length Length of key + tl Table that should be opened flags operation: what to open table or view + out_table TABLE for the requested table IMPLEMENTATION Get a table definition from the table definition cache. @@ -665,7 +821,7 @@ retry: if (out_table && (flags & GTS_TABLE)) { - if ((*out_table= element->acquire_table(thd))) + if ((*out_table= tc_acquire_table(thd, element))) { lf_hash_search_unpin(thd->tdc_hash_pins); DBUG_ASSERT(!(flags & GTS_NOLOCK)); @@ -798,6 +954,47 @@ void tdc_release_share(TABLE_SHARE *share) } +/** + Auxiliary function which allows to kill delayed threads for + particular table identified by its share. + + @param share Table share. + + @pre Caller should have TABLE_SHARE::tdc.LOCK_table_share mutex. +*/ + +static void kill_delayed_threads_for_table(TDC_element *element) +{ + All_share_tables_list::Iterator it(element->all_tables); + TABLE *tab; + + mysql_mutex_assert_owner(&element->LOCK_table_share); + + if (!delayed_insert_threads) + return; + + while ((tab= it++)) + { + THD *in_use= tab->in_use; + + DBUG_ASSERT(in_use && tab->s->tdc->flushed); + if ((in_use->system_thread & SYSTEM_THREAD_DELAYED_INSERT) && + ! in_use->killed) + { + in_use->killed= KILL_SYSTEM_THREAD; + mysql_mutex_lock(&in_use->mysys_var->mutex); + if (in_use->mysys_var->current_cond) + { + mysql_mutex_lock(in_use->mysys_var->current_mutex); + mysql_cond_broadcast(in_use->mysys_var->current_cond); + mysql_mutex_unlock(in_use->mysys_var->current_mutex); + } + mysql_mutex_unlock(&in_use->mysys_var->mutex); + } + } +} + + /** Remove all or some (depending on parameter) instances of TABLE and TABLE_SHARE from the table definition cache. @@ -880,30 +1077,16 @@ bool tdc_remove_table(THD *thd, enum_tdc_remove_table_type remove_type, element->ref_count++; - element->wait_for_mdl_deadlock_detector(); - /* - Mark share flushed in order to ensure that it gets - automatically deleted once it is no longer referenced. + tc_remove_all_unused_tables(element, &purge_tables, + remove_type != TDC_RT_REMOVE_NOT_OWN_KEEP_SHARE); - Note that code in TABLE_SHARE::wait_for_old_version() assumes that - marking share flushed is followed by purge of unused table - shares. - */ - if (remove_type != TDC_RT_REMOVE_NOT_OWN_KEEP_SHARE) - element->flushed= true; - - while ((table= element->free_tables.pop_front())) - { - tc_remove_table(table); - purge_tables.push_front(table); - } if (kill_delayed_threads) kill_delayed_threads_for_table(element); if (remove_type == TDC_RT_REMOVE_NOT_OWN || remove_type == TDC_RT_REMOVE_NOT_OWN_KEEP_SHARE) { - TDC_element::All_share_tables_list::Iterator it(element->all_tables); + All_share_tables_list::Iterator it(element->all_tables); while ((table= it++)) { my_refs++; diff --git a/sql/table_cache.h b/sql/table_cache.h index 2efc535c425..c05baae1f15 100644 --- a/sql/table_cache.h +++ b/sql/table_cache.h @@ -1,3 +1,5 @@ +#ifndef TABLE_CACHE_H_INCLUDED +#define TABLE_CACHE_H_INCLUDED /* Copyright (c) 2000, 2012, Oracle and/or its affiliates. Copyright (c) 2010, 2011 Monty Program Ab Copyright (C) 2013 Sergey Vojtovich and MariaDB Foundation @@ -16,14 +18,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifdef HAVE_PSI_INTERFACE -extern PSI_mutex_key key_TABLE_SHARE_LOCK_table_share; -extern PSI_cond_key key_TABLE_SHARE_COND_release; -#endif - -class TDC_element +struct TDC_element { -public: uchar m_key[NAME_LEN + 1 + NAME_LEN + 1]; uint m_key_length; ulong version; @@ -31,9 +27,6 @@ public: TABLE_SHARE *share; typedef I_P_List TABLE_list; - typedef I_P_List > - All_share_tables_list; /** Protects ref_count, m_flush_tickets, all_tables, free_tables, flushed, all_tables_refs. @@ -53,138 +46,6 @@ public: */ All_share_tables_list all_tables; TABLE_list free_tables; - - TDC_element() {} - - TDC_element(const char *key_arg, uint key_length) : m_key_length(key_length) - { - memcpy(m_key, key_arg, key_length); - } - - - void assert_clean_share() - { - DBUG_ASSERT(share == 0); - DBUG_ASSERT(ref_count == 0); - DBUG_ASSERT(m_flush_tickets.is_empty()); - DBUG_ASSERT(all_tables.is_empty()); - DBUG_ASSERT(free_tables.is_empty()); - DBUG_ASSERT(all_tables_refs == 0); - DBUG_ASSERT(next == 0); - DBUG_ASSERT(prev == 0); - } - - - /** - Acquire TABLE object from table cache. - - @pre share must be protected against removal. - - Acquired object cannot be evicted or acquired again. - - @return TABLE object, or NULL if no unused objects. - */ - - TABLE *acquire_table(THD *thd) - { - TABLE *table; - - mysql_mutex_lock(&LOCK_table_share); - table= free_tables.pop_front(); - if (table) - { - DBUG_ASSERT(!table->in_use); - table->in_use= thd; - /* The ex-unused table must be fully functional. */ - DBUG_ASSERT(table->db_stat && table->file); - /* The children must be detached from the table. */ - DBUG_ASSERT(!table->file->extra(HA_EXTRA_IS_ATTACHED_CHILDREN)); - } - mysql_mutex_unlock(&LOCK_table_share); - return table; - } - - - /** - Get last element of free_tables. - */ - - TABLE *free_tables_back() - { - TABLE_list::Iterator it(free_tables); - TABLE *entry, *last= 0; - while ((entry= it++)) - last= entry; - return last; - } - - - /** - Wait for MDL deadlock detector to complete traversing tdc.all_tables. - - Must be called before updating TABLE_SHARE::tdc.all_tables. - */ - - void wait_for_mdl_deadlock_detector() - { - while (all_tables_refs) - mysql_cond_wait(&COND_release, &LOCK_table_share); - } - - - /** - Prepeare table share for use with table definition cache. - */ - - static void lf_alloc_constructor(uchar *arg) - { - TDC_element *element= (TDC_element*) (arg + LF_HASH_OVERHEAD); - DBUG_ENTER("lf_alloc_constructor"); - mysql_mutex_init(key_TABLE_SHARE_LOCK_table_share, - &element->LOCK_table_share, MY_MUTEX_INIT_FAST); - mysql_cond_init(key_TABLE_SHARE_COND_release, &element->COND_release, 0); - element->m_flush_tickets.empty(); - element->all_tables.empty(); - element->free_tables.empty(); - element->all_tables_refs= 0; - element->share= 0; - element->ref_count= 0; - element->next= 0; - element->prev= 0; - DBUG_VOID_RETURN; - } - - - /** - Release table definition cache specific resources of table share. - */ - - static void lf_alloc_destructor(uchar *arg) - { - TDC_element *element= (TDC_element*) (arg + LF_HASH_OVERHEAD); - DBUG_ENTER("lf_alloc_destructor"); - element->assert_clean_share(); - mysql_cond_destroy(&element->COND_release); - mysql_mutex_destroy(&element->LOCK_table_share); - DBUG_VOID_RETURN; - } - - - static void lf_hash_initializer(LF_HASH *hash __attribute__((unused)), - TDC_element *element, LEX_STRING *key) - { - memcpy(element->m_key, key->str, key->length); - element->m_key_length= key->length; - element->assert_clean_share(); - } - - - static uchar *key(const TDC_element *element, size_t *length, - my_bool not_used __attribute__((unused))) - { - *length= element->m_key_length; - return (uchar*) element->m_key; - } }; @@ -247,3 +108,4 @@ inline uint tdc_create_key(char *key, const char *db, const char *table_name) return (uint) (strmake(strmake(key, db, NAME_LEN) + 1, table_name, NAME_LEN) - key + 1); } +#endif /* TABLE_CACHE_H_INCLUDED */ diff --git a/sql/temporary_tables.cc b/sql/temporary_tables.cc new file mode 100644 index 00000000000..9a85c09b08e --- /dev/null +++ b/sql/temporary_tables.cc @@ -0,0 +1,1548 @@ +/* + Copyright (c) 2016 MariaDB Corporation + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +/** + All methods pertaining to temporary tables. +*/ + +#include "sql_acl.h" /* TMP_TABLE_ACLS */ +#include "sql_base.h" /* tdc_create_key */ +#include "lock.h" /* mysql_lock_remove */ +#include "log_event.h" /* Query_log_event */ +#include "sql_show.h" /* append_identifier */ +#include "sql_handler.h" /* mysql_ha_rm_temporary_tables */ +#include "rpl_rli.h" /* rpl_group_info */ + +#define IS_USER_TABLE(A) ((A->tmp_table == TRANSACTIONAL_TMP_TABLE) || \ + (A->tmp_table == NON_TRANSACTIONAL_TMP_TABLE)) + +/** + Check whether temporary tables exist. The decision is made based on the + existence of TMP_TABLE_SHAREs in Open_tables_state::temporary_tables list. + + @return false Temporary tables exist + true No temporary table exist +*/ +bool THD::has_thd_temporary_tables() +{ + DBUG_ENTER("THD::has_thd_temporary_tables"); + bool result= (temporary_tables && !temporary_tables->is_empty()); + DBUG_RETURN(result); +} + + +/** + Create a temporary table, open it and return the TABLE handle. + + @param hton [IN] Handlerton + @param frm [IN] Binary frm image + @param path [IN] File path (without extension) + @param db [IN] Schema name + @param table_name [IN] Table name + @param open_in_engine [IN] Whether open table in SE + + + @return Success A pointer to table object + Failure NULL +*/ +TABLE *THD::create_and_open_tmp_table(handlerton *hton, + LEX_CUSTRING *frm, + const char *path, + const char *db, + const char *table_name, + bool open_in_engine) +{ + DBUG_ENTER("THD::create_and_open_tmp_table"); + + TMP_TABLE_SHARE *share; + TABLE *table= NULL; + + if ((share= create_temporary_table(hton, frm, path, db, table_name))) + { + table= open_temporary_table(share, table_name, open_in_engine); + + /* + Failed to open a temporary table instance. As we are not passing + the created TMP_TABLE_SHARE to the caller, we must remove it from + the list and free it here. + */ + if (!table) + { + /* Remove the TABLE_SHARE from the list of temporary tables. */ + temporary_tables->remove(share); + + /* Free the TMP_TABLE_SHARE. */ + free_tmp_table_share(share, false); + } + } + + DBUG_RETURN(table); +} + + +/** + Check whether an open table with db/table name is in use. + + @param db [IN] Database name + @param table_name [IN] Table name + + @return Success Pointer to first used table instance. + Failure NULL +*/ +TABLE *THD::find_temporary_table(const char *db, + const char *table_name) +{ + DBUG_ENTER("THD::find_temporary_table"); + + TABLE *table; + char key[MAX_DBKEY_LENGTH]; + uint key_length; + bool locked; + + if (!has_temporary_tables()) + { + DBUG_RETURN(NULL); + } + + key_length= create_tmp_table_def_key(key, db, table_name); + + locked= lock_temporary_tables(); + table = find_temporary_table(key, key_length, TMP_TABLE_IN_USE); + if (locked) + { + DBUG_ASSERT(m_tmp_tables_locked); + unlock_temporary_tables(); + } + + DBUG_RETURN(table); +} + + +/** + Check whether an open table specified in TABLE_LIST is in use. + + @return tl [IN] TABLE_LIST + + @return Success Pointer to first used table instance. + Failure NULL +*/ +TABLE *THD::find_temporary_table(const TABLE_LIST *tl) +{ + DBUG_ENTER("THD::find_temporary_table"); + + if (!has_temporary_tables()) + { + DBUG_RETURN(NULL); + } + + TABLE *table= find_temporary_table(tl->get_db_name(), tl->get_table_name()); + DBUG_RETURN(table); +} + + +/** + Check whether a temporary table exists with the specified key. + The key, in this case, is not the usual key used for temporary tables. + It does not contain server_id & pseudo_thread_id. This function is + essentially used use to check whether there is any temporary table + which _shadows_ a base table. + (see: Query_cache::send_result_to_client()) + + @return Success A pointer to table share object + Failure NULL +*/ +TMP_TABLE_SHARE *THD::find_tmp_table_share_w_base_key(const char *key, + uint key_length) +{ + DBUG_ENTER("THD::find_tmp_table_share_w_base_key"); + + TMP_TABLE_SHARE *share; + TMP_TABLE_SHARE *result= NULL; + bool locked; + + if (!has_temporary_tables()) + { + DBUG_RETURN(NULL); + } + + locked= lock_temporary_tables(); + + All_tmp_tables_list::Iterator it(*temporary_tables); + while ((share= it++)) + { + if ((share->table_cache_key.length - TMP_TABLE_KEY_EXTRA) == key_length + && !memcmp(share->table_cache_key.str, key, key_length)) + { + result= share; + } + } + + if (locked) + { + DBUG_ASSERT(m_tmp_tables_locked); + unlock_temporary_tables(); + } + + DBUG_RETURN(result); +} + + +/** + Lookup the TMP_TABLE_SHARE using the given db/table_name.The server_id and + pseudo_thread_id used to generate table definition key is taken from THD + (see create_tmp_table_def_key()). Return NULL is none found. + + @return Success A pointer to table share object + Failure NULL +*/ +TMP_TABLE_SHARE *THD::find_tmp_table_share(const char *db, + const char *table_name) +{ + DBUG_ENTER("THD::find_tmp_table_share"); + + TMP_TABLE_SHARE *share; + char key[MAX_DBKEY_LENGTH]; + uint key_length; + + key_length= create_tmp_table_def_key(key, db, table_name); + share= find_tmp_table_share(key, key_length); + + DBUG_RETURN(share); +} + + +/** + Lookup TMP_TABLE_SHARE using the specified TABLE_LIST element. + Return NULL is none found. + + @param tl [IN] Table + + @return Success A pointer to table share object + Failure NULL +*/ +TMP_TABLE_SHARE *THD::find_tmp_table_share(const TABLE_LIST *tl) +{ + DBUG_ENTER("THD::find_tmp_table_share"); + TMP_TABLE_SHARE *share= find_tmp_table_share(tl->get_db_name(), + tl->get_table_name()); + DBUG_RETURN(share); +} + + +/** + Lookup TMP_TABLE_SHARE using the specified table definition key. + Return NULL is none found. + + @return Success A pointer to table share object + Failure NULL +*/ +TMP_TABLE_SHARE *THD::find_tmp_table_share(const char *key, uint key_length) +{ + DBUG_ENTER("THD::find_tmp_table_share"); + + TMP_TABLE_SHARE *share; + TMP_TABLE_SHARE *result= NULL; + bool locked; + + if (!has_temporary_tables()) + { + DBUG_RETURN(NULL); + } + + locked= lock_temporary_tables(); + + All_tmp_tables_list::Iterator it(*temporary_tables); + while ((share= it++)) + { + if (share->table_cache_key.length == key_length && + !(memcmp(share->table_cache_key.str, key, key_length))) + { + result= share; + break; + } + } + + if (locked) + { + DBUG_ASSERT(m_tmp_tables_locked); + unlock_temporary_tables(); + } + + DBUG_RETURN(result); +} + + +/** + Find a temporary table specified by TABLE_LIST instance in the open table + list and prepare its TABLE instance for use. If + + This function tries to resolve this table in the list of temporary tables + of this thread. Temporary tables are thread-local and "shadow" base + tables with the same name. + + @note In most cases one should use THD::open_tables() instead + of this call. + + @note One should finalize process of opening temporary table for table + list element by calling open_and_process_table(). This function + is responsible for table version checking and handling of merge + tables. + + @note We used to check global_read_lock before opening temporary tables. + However, that limitation was artificial and is removed now. + + @param tl [IN] TABLE_LIST + + @return Error status. + @retval false On success. If a temporary table exists + for the given key, tl->table is set. + @retval true On error. my_error() has been called. +*/ +bool THD::open_temporary_table(TABLE_LIST *tl) +{ + DBUG_ENTER("THD::open_temporary_table"); + DBUG_PRINT("enter", ("table: '%s'.'%s'", tl->db, tl->table_name)); + + TMP_TABLE_SHARE *share; + TABLE *table= NULL; + + /* + Since temporary tables are not safe for parallel replication, lets + wait for the prior commits in case the table is found to be in use. + */ + if (rgi_slave && + rgi_slave->is_parallel_exec && + find_temporary_table(tl) && + wait_for_prior_commit()) + DBUG_RETURN(true); + + /* + Code in open_table() assumes that TABLE_LIST::table can be non-zero only + for pre-opened temporary tables. + */ + DBUG_ASSERT(tl->table == NULL); + + /* + This function should not be called for cases when derived or I_S + tables can be met since table list elements for such tables can + have invalid db or table name. + Instead THD::open_tables() should be used. + */ + DBUG_ASSERT(!tl->derived && !tl->schema_table); + + if (tl->open_type == OT_BASE_ONLY || !has_temporary_tables()) + { + DBUG_PRINT("info", ("skip_temporary is set or no temporary tables")); + DBUG_RETURN(false); + } + + /* + First check if there is a reusable open table available in the + open table list. + */ + if (find_and_use_tmp_table(tl, &table)) + { + DBUG_RETURN(true); /* Error */ + } + + /* + No reusable table was found. We will have to open a new instance. + */ + if (!table && (share= find_tmp_table_share(tl))) + { + table= open_temporary_table(share, tl->get_table_name(), true); + } + + if (!table) + { + if (tl->open_type == OT_TEMPORARY_ONLY && + tl->open_strategy == TABLE_LIST::OPEN_NORMAL) + { + my_error(ER_NO_SUCH_TABLE, MYF(0), tl->db, tl->table_name); + DBUG_RETURN(true); + } + DBUG_RETURN(false); + } + + /* + Temporary tables are not safe for parallel replication. They were + designed to be visible to one thread only, so have no table locking. + Thus there is no protection against two conflicting transactions + committing in parallel and things like that. + + So for now, anything that uses temporary tables will be serialised + with anything before it, when using parallel replication. + + TODO: We might be able to introduce a reference count or something + on temp tables, and have slave worker threads wait for it to reach + zero before being allowed to use the temp table. Might not be worth + it though, as statement-based replication using temporary tables is + in any case rather fragile. + */ + if (rgi_slave && + rgi_slave->is_parallel_exec && + wait_for_prior_commit()) + DBUG_RETURN(true); + +#ifdef WITH_PARTITION_STORAGE_ENGINE + if (tl->partition_names) + { + /* Partitioned temporary tables is not supported. */ + DBUG_ASSERT(!table->part_info); + my_error(ER_PARTITION_CLAUSE_ON_NONPARTITIONED, MYF(0)); + DBUG_RETURN(true); + } +#endif + + table->query_id= query_id; + thread_specific_used= true; + + /* It is neither a derived table nor non-updatable view. */ + tl->updatable= true; + tl->table= table; + + table->init(this, tl); + + DBUG_PRINT("info", ("Using temporary table")); + DBUG_RETURN(false); +} + + +/** + Pre-open temporary tables corresponding to table list elements. + + @note One should finalize process of opening temporary tables + by calling open_tables(). This function is responsible + for table version checking and handling of merge tables. + + @param tl [IN] TABLE_LIST + + @return false On success. If a temporary table exists + for the given element, tl->table is set. + true On error. my_error() has been called. +*/ +bool THD::open_temporary_tables(TABLE_LIST *tl) +{ + DBUG_ENTER("THD::open_temporary_tables"); + + TABLE_LIST *first_not_own= lex->first_not_own_table(); + + for (TABLE_LIST *table= tl; table && table != first_not_own; + table= table->next_global) + { + if (table->derived || table->schema_table) + { + /* + Derived and I_S tables will be handled by a later call to open_tables(). + */ + continue; + } + + if (open_temporary_table(table)) + { + DBUG_RETURN(true); + } + } + + DBUG_RETURN(false); +} + + +/** + Close all temporary tables created by 'CREATE TEMPORARY TABLE' for thread + creates one DROP TEMPORARY TABLE binlog event for each pseudo-thread. + + Temporary tables created in a sql slave is closed by + Relay_log_info::close_temporary_tables(). + + @return false Success + true Failure +*/ +bool THD::close_temporary_tables() +{ + DBUG_ENTER("THD::close_temporary_tables"); + + TMP_TABLE_SHARE *share; + TABLE *table; + + bool error= false; + + if (!has_thd_temporary_tables()) + { + if (temporary_tables) + { + my_free(temporary_tables); + temporary_tables= NULL; + } + DBUG_RETURN(false); + } + + DBUG_ASSERT(!rgi_slave); + + /* + Ensure we don't have open HANDLERs for tables we are about to close. + This is necessary when THD::close_temporary_tables() is called as + part of execution of BINLOG statement (e.g. for format description event). + */ + mysql_ha_rm_temporary_tables(this); + + /* Close all open temporary tables. */ + All_tmp_tables_list::Iterator it(*temporary_tables); + while ((share= it++)) + { + /* Traverse the table list. */ + while ((table= share->all_tmp_tables.pop_front())) + { + free_temporary_table(table); + } + } + + // Write DROP TEMPORARY TABLE query log events to binary log. + if (mysql_bin_log.is_open()) + { + error= log_events_and_free_tmp_shares(); + } + else + { + while ((share= temporary_tables->pop_front())) + { + free_tmp_table_share(share, true); + } + } + + /* By now, there mustn't be any elements left in the list. */ + DBUG_ASSERT(temporary_tables->is_empty()); + + my_free(temporary_tables); + temporary_tables= NULL; + + DBUG_RETURN(error); +} + + +/** + Rename a temporary table. + + @param table [IN] Table handle + @param db [IN] New schema name + @param table_name [IN] New table name + + @return false Success + true Error +*/ +bool THD::rename_temporary_table(TABLE *table, + const char *db, + const char *table_name) +{ + DBUG_ENTER("THD::rename_temporary_table"); + + char *key; + uint key_length; + + TABLE_SHARE *share= table->s; + + if (!(key= (char *) alloc_root(&share->mem_root, MAX_DBKEY_LENGTH))) + { + DBUG_RETURN(true); + } + + /* + Temporary tables are renamed by simply changing their table definition key. + */ + key_length= create_tmp_table_def_key(key, db, table_name); + share->set_table_cache_key(key, key_length); + + DBUG_RETURN(false); +} + + +/** + Drop a temporary table. + + Try to locate the table in the list of open temporary tables. + If the table is found: + - If the table is locked with LOCK TABLES or by prelocking, + unlock it and remove it from the list of locked tables + (THD::lock). Currently only transactional temporary tables + are locked. + - Close the temporary table, remove its .FRM. + - Remove the table share from the list of temporary table shares. + + This function is used to drop user temporary tables, as well as + internal tables created in CREATE TEMPORARY TABLE ... SELECT + or ALTER TABLE. + + @param table [IN] Temporary table to be deleted + @param is_trans [OUT] Is set to the type of the table: + transactional (e.g. innodb) as true or + non-transactional (e.g. myisam) as false. + @paral delete_table [IN] Whether to delete the table files? + + @return false Table was dropped + true Error +*/ +bool THD::drop_temporary_table(TABLE *table, + bool *is_trans, + bool delete_table) +{ + DBUG_ENTER("THD::drop_temporary_table"); + + TMP_TABLE_SHARE *share; + TABLE *tab; + bool result= false; + bool locked; + + DBUG_ASSERT(table); + DBUG_PRINT("tmptable", ("Dropping table: '%s'.'%s'", + table->s->db.str, table->s->table_name.str)); + + locked= lock_temporary_tables(); + + share= tmp_table_share(table); + + /* Table might be in use by some outer statement. */ + All_share_tables_list::Iterator it(share->all_tmp_tables); + while ((tab= it++)) + { + if (tab != table && tab->query_id != 0) + { + /* Found a table instance in use. This table cannot be be dropped. */ + my_error(ER_CANT_REOPEN_TABLE, MYF(0), table->alias.c_ptr()); + result= true; + goto end; + } + } + + if (is_trans) + *is_trans= table->file->has_transactions(); + + /* + Iterate over the list of open tables and close them. + */ + while ((tab= share->all_tmp_tables.pop_front())) + { + /* + We need to set the THD as it may be different in case of + parallel replication + */ + tab->in_use= this; + + free_temporary_table(tab); + } + + DBUG_ASSERT(temporary_tables); + + /* Remove the TABLE_SHARE from the list of temporary tables. */ + temporary_tables->remove(share); + + /* Free the TABLE_SHARE and/or delete the files. */ + free_tmp_table_share(share, delete_table); + +end: + if (locked) + { + DBUG_ASSERT(m_tmp_tables_locked); + unlock_temporary_tables(); + } + + DBUG_RETURN(result); +} + + +/** + Delete the temporary table files. + + @param base [IN] Handlerton for table to be deleted. + @param path [IN] Path to the table to be deleted (i.e. path + to its .frm without an extension). + + @return false Success + true Error +*/ +bool THD::rm_temporary_table(handlerton *base, const char *path) +{ + DBUG_ENTER("THD::rm_temporary_table"); + + bool error= false; + handler *file; + char frm_path[FN_REFLEN + 1]; + + strxnmov(frm_path, sizeof(frm_path) - 1, path, reg_ext, NullS); + if (mysql_file_delete(key_file_frm, frm_path, MYF(0))) + { + error= true; + } + file= get_new_handler((TABLE_SHARE*) 0, current_thd->mem_root, base); + if (file && file->ha_delete_table(path)) + { + error= true; + sql_print_warning("Could not remove temporary table: '%s', error: %d", + path, my_errno); + } + + delete file; + DBUG_RETURN(error); +} + + +/** + Mark all temporary tables which were used by the current statement or + sub-statement as free for reuse, but only if the query_id can be cleared. + + @remark For temp tables associated with a open SQL HANDLER the query_id + is not reset until the HANDLER is closed. +*/ +void THD::mark_tmp_tables_as_free_for_reuse() +{ + DBUG_ENTER("THD::mark_tmp_tables_as_free_for_reuse"); + + TMP_TABLE_SHARE *share; + TABLE *table; + bool locked; + + if (query_id == 0) + { + /* + Thread has not executed any statement and has not used any + temporary tables. + */ + DBUG_VOID_RETURN; + } + + if (!has_temporary_tables()) + { + DBUG_VOID_RETURN; + } + + locked= lock_temporary_tables(); + + All_tmp_tables_list::Iterator it(*temporary_tables); + while ((share= it++)) + { + All_share_tables_list::Iterator tables_it(share->all_tmp_tables); + while ((table= tables_it++)) + { + if ((table->query_id == query_id) && !table->open_by_handler) + { + mark_tmp_table_as_free_for_reuse(table); + } + } + } + + if (locked) + { + DBUG_ASSERT(m_tmp_tables_locked); + unlock_temporary_tables(); + } + + if (rgi_slave) + { + /* + Temporary tables are shared with other by sql execution threads. + As a safety measure, clear the pointer to the common area. + */ + temporary_tables= NULL; + } + + DBUG_VOID_RETURN; +} + + +/** + Reset a single temporary table. Effectively this "closes" one temporary + table in a session. + + @param table Temporary table + + @return void +*/ +void THD::mark_tmp_table_as_free_for_reuse(TABLE *table) +{ + DBUG_ENTER("THD::mark_tmp_table_as_free_for_reuse"); + + DBUG_ASSERT(table->s->tmp_table); + + table->query_id= 0; + table->file->ha_reset(); + + /* Detach temporary MERGE children from temporary parent. */ + DBUG_ASSERT(table->file); + table->file->extra(HA_EXTRA_DETACH_CHILDREN); + + /* + Reset temporary table lock type to it's default value (TL_WRITE). + + Statements such as INSERT INTO .. SELECT FROM tmp, CREATE TABLE + .. SELECT FROM tmp and UPDATE may under some circumstances modify + the lock type of the tables participating in the statement. This + isn't a problem for non-temporary tables since their lock type is + reset at every open, but the same does not occur for temporary + tables for historical reasons. + + Furthermore, the lock type of temporary tables is not really that + important because they can only be used by one query at a time. + Nonetheless, it's safer from a maintenance point of view to reset + the lock type of this singleton TABLE object as to not cause problems + when the table is reused. + + Even under LOCK TABLES mode its okay to reset the lock type as + LOCK TABLES is allowed (but ignored) for a temporary table. + */ + table->reginfo.lock_type= TL_WRITE; + DBUG_VOID_RETURN; +} + + +/** + Remove and return the specified table's TABLE_SHARE from the temporary + tables list. + + @param table [IN] Table + + @return TMP_TABLE_SHARE of the specified table. +*/ +TMP_TABLE_SHARE *THD::save_tmp_table_share(TABLE *table) +{ + DBUG_ENTER("THD::save_tmp_table_share"); + + TMP_TABLE_SHARE *share; + + lock_temporary_tables(); + DBUG_ASSERT(temporary_tables); + share= tmp_table_share(table); + temporary_tables->remove(share); + unlock_temporary_tables(); + + DBUG_RETURN(share); +} + + +/** + Add the specified TMP_TABLE_SHARE to the temporary tables list. + + @param share [IN] Table share + + @return void +*/ +void THD::restore_tmp_table_share(TMP_TABLE_SHARE *share) +{ + DBUG_ENTER("THD::restore_tmp_table_share"); + + lock_temporary_tables(); + DBUG_ASSERT(temporary_tables); + temporary_tables->push_front(share); + unlock_temporary_tables(); + + DBUG_VOID_RETURN; +} + + +/** + If its a replication slave, report whether slave temporary tables + exist (Relay_log_info::save_temporary_tables) or report about THD + temporary table (Open_tables_state::temporary_tables) otherwise. + + @return false Temporary tables exist + true No temporary table exist +*/ +inline bool THD::has_temporary_tables() +{ + DBUG_ENTER("THD::has_temporary_tables"); + bool result= (rgi_slave + ? (rgi_slave->rli->save_temporary_tables && + !rgi_slave->rli->save_temporary_tables->is_empty()) + : (has_thd_temporary_tables())); + DBUG_RETURN(result); +} + + +/** + Create a table definition key. + + @param key [OUT] Buffer for the key to be created (must + be of size MAX_DBKRY_LENGTH) + @param db [IN] Database name + @param table_name [IN] Table name + + @return Key length. + + @note + The table key is create from: + db + \0 + table_name + \0 + + Additionally, we add the following to make each temporary table unique on + the slave. + + 4 bytes of master thread id + 4 bytes of pseudo thread id +*/ +uint THD::create_tmp_table_def_key(char *key, const char *db, + const char *table_name) +{ + DBUG_ENTER("THD::create_tmp_table_def_key"); + + uint key_length; + + key_length= tdc_create_key(key, db, table_name); + int4store(key + key_length, variables.server_id); + int4store(key + key_length + 4, variables.pseudo_thread_id); + key_length += TMP_TABLE_KEY_EXTRA; + + DBUG_RETURN(key_length); +} + + +/** + Create a temporary table. + + @param hton [IN] Handlerton + @param frm [IN] Binary frm image + @param path [IN] File path (without extension) + @param db [IN] Schema name + @param table_name [IN] Table name + + @return Success A pointer to table share object + Failure NULL +*/ +TMP_TABLE_SHARE *THD::create_temporary_table(handlerton *hton, + LEX_CUSTRING *frm, + const char *path, + const char *db, + const char *table_name) +{ + DBUG_ENTER("THD::create_temporary_table"); + + TMP_TABLE_SHARE *share; + char key_cache[MAX_DBKEY_LENGTH]; + char *saved_key_cache; + char *tmp_path; + uint key_length; + bool locked; + int res; + + /* Temporary tables are not safe for parallel replication. */ + if (rgi_slave && + rgi_slave->is_parallel_exec && + wait_for_prior_commit()) + DBUG_RETURN(NULL); + + /* Create the table definition key for the temporary table. */ + key_length= create_tmp_table_def_key(key_cache, db, table_name); + + if (!(share= (TMP_TABLE_SHARE *) my_malloc(sizeof(TMP_TABLE_SHARE) + + strlen(path) + 1 + key_length, + MYF(MY_WME)))) + { + DBUG_RETURN(NULL); /* Out of memory */ + } + + tmp_path= (char *)(share + 1); + saved_key_cache= strmov(tmp_path, path) + 1; + memcpy(saved_key_cache, key_cache, key_length); + + init_tmp_table_share(this, share, saved_key_cache, key_length, + strend(saved_key_cache) + 1, tmp_path); + + share->db_plugin= ha_lock_engine(this, hton); + + /* + Prefer using frm image over file. The image might not be available in + ALTER TABLE, when the discovering engine took over the ownership (see + TABLE::read_frm_image). + */ + res= (frm->str) + ? share->init_from_binary_frm_image(this, false, frm->str, frm->length) + : open_table_def(this, share, GTS_TABLE | GTS_USE_DISCOVERY); + + if (res) + { + /* + No need to lock share->mutex as this is not needed for temporary tables. + */ + free_table_share(share); + my_free(share); + DBUG_RETURN(NULL); + } + + share->m_psi= PSI_CALL_get_table_share(true, share); + + locked= lock_temporary_tables(); + + /* Initialize the all_tmp_tables list. */ + share->all_tmp_tables.empty(); + + /* + We need to alloc & initialize temporary_tables if this happens + to be the very first temporary table. + */ + if (!temporary_tables) + { + if ((temporary_tables= + (All_tmp_tables_list *) my_malloc(sizeof(All_tmp_tables_list), + MYF(MY_WME)))) + { + temporary_tables->empty(); + } + else + { + DBUG_RETURN(NULL); /* Out of memory */ + } + } + + /* Add share to the head of the temporary table share list. */ + temporary_tables->push_front(share); + + if (locked) + { + DBUG_ASSERT(m_tmp_tables_locked); + unlock_temporary_tables(); + } + + DBUG_RETURN(share); +} + + +/** + Find a table with the specified key. + + @param key [IN] Key + @param key_length [IN] Key length + @param state [IN] Open table state to look for + + @return Success Pointer to the table instance. + Failure NULL +*/ +TABLE *THD::find_temporary_table(const char *key, uint key_length, + Temporary_table_state state) +{ + DBUG_ENTER("THD::find_temporary_table"); + + TMP_TABLE_SHARE *share; + TABLE *table; + TABLE *result= NULL; + bool locked; + + locked= lock_temporary_tables(); + + All_tmp_tables_list::Iterator it(*temporary_tables); + while ((share= it++)) + { + if (share->table_cache_key.length == key_length && + !(memcmp(share->table_cache_key.str, key, key_length))) + { + /* A matching TMP_TABLE_SHARE is found. */ + All_share_tables_list::Iterator tables_it(share->all_tmp_tables); + + while ((table= tables_it++)) + { + switch (state) + { + case TMP_TABLE_IN_USE: + if (table->query_id > 0) + { + result= table; + goto done; + } + break; + case TMP_TABLE_NOT_IN_USE: + if (table->query_id == 0) + { + result= table; + goto done; + } + break; + case TMP_TABLE_ANY: + { + result= table; + goto done; + } + break; + default: /* Invalid */ + DBUG_ASSERT(0); + goto done; + } + } + } + } + +done: + if (locked) + { + DBUG_ASSERT(m_tmp_tables_locked); + unlock_temporary_tables(); + } + + DBUG_RETURN(result); +} + + + +/** + Open a table from the specified TABLE_SHARE with the given alias. + + @param share [IN] Table share + @param alias [IN] Table alias + @param open_in_engine [IN] Whether open table in SE + + @return Success A pointer to table object + Failure NULL +*/ +TABLE *THD::open_temporary_table(TMP_TABLE_SHARE *share, + const char *alias, + bool open_in_engine) +{ + DBUG_ENTER("THD::open_temporary_table"); + + TABLE *table; + + if (!(table= (TABLE *) my_malloc(sizeof(TABLE), MYF(MY_WME)))) + { + DBUG_RETURN(NULL); /* Out of memory */ + } + + if (open_table_from_share(this, share, alias, + (open_in_engine) ? + (uint) (HA_OPEN_KEYFILE | HA_OPEN_RNDFILE | + HA_GET_INDEX) : 0, + (uint) (READ_KEYINFO | COMPUTE_TYPES | + EXTRA_RECORD), + ha_open_options, + table, + open_in_engine ? false : true)) + { + my_free(table); + DBUG_RETURN(NULL); + } + + table->reginfo.lock_type= TL_WRITE; /* Simulate locked */ + table->grant.privilege= TMP_TABLE_ACLS; + share->tmp_table= (table->file->has_transactions() ? + TRANSACTIONAL_TMP_TABLE : NON_TRANSACTIONAL_TMP_TABLE); + + table->pos_in_table_list= 0; + table->query_id= query_id; + + /* Add table to the head of table list. */ + share->all_tmp_tables.push_front(table); + + /* Increment Slave_open_temp_table_definitions status variable count. */ + if (rgi_slave) + { + thread_safe_increment32(&slave_open_temp_tables); + } + + DBUG_PRINT("tmptable", ("Opened table: '%s'.'%s' 0x%lx", table->s->db.str, + table->s->table_name.str, (long) table)); + DBUG_RETURN(table); +} + + +/** + Find a reusable table in the open table list using the specified TABLE_LIST. + + @param tl [IN] Table list + @param out_table [OUT] Pointer to the requested TABLE object + + @return Success false + Failure true +*/ +bool THD::find_and_use_tmp_table(const TABLE_LIST *tl, + TABLE **out_table) +{ + DBUG_ENTER("THD::find_and_use_tmp_table"); + + char key[MAX_DBKEY_LENGTH]; + uint key_length; + bool result; + + key_length= create_tmp_table_def_key(key, tl->get_db_name(), + tl->get_table_name()); + result= + use_temporary_table(find_temporary_table(key, key_length, + TMP_TABLE_NOT_IN_USE), + out_table); + + DBUG_RETURN(result); +} + +/** + Mark table as in-use. + + @param table [IN] Table to be marked in-use + @param out_table [OUT] Pointer to the specified table + + @return false Success + true Error +*/ +bool THD::use_temporary_table(TABLE *table, TABLE **out_table) +{ + DBUG_ENTER("THD::use_temporary_table"); + + *out_table= table; + + /* The following can happen if find_temporary_table() returns NULL */ + if (!table) + DBUG_RETURN(false); + + /* + Temporary tables are not safe for parallel replication. They were + designed to be visible to one thread only, so have no table locking. + Thus there is no protection against two conflicting transactions + committing in parallel and things like that. + + So for now, anything that uses temporary tables will be serialised + with anything before it, when using parallel replication. + + TODO: We might be able to introduce a reference count or something + on temp tables, and have slave worker threads wait for it to reach + zero before being allowed to use the temp table. Might not be worth + it though, as statement-based replication using temporary tables is + in any case rather fragile. + */ + if (rgi_slave && + rgi_slave->is_parallel_exec && + wait_for_prior_commit()) + DBUG_RETURN(true); + + /* + We need to set the THD as it may be different in case of + parallel replication + */ + table->in_use= this; + + DBUG_RETURN(false); +} + + +/** + Close a temporary table. + + @param table [IN] Table handle + + @return void +*/ +void THD::close_temporary_table(TABLE *table) +{ + DBUG_ENTER("THD::close_temporary_table"); + + DBUG_PRINT("tmptable", ("closing table: '%s'.'%s' 0x%lx alias: '%s'", + table->s->db.str, table->s->table_name.str, + (long) table, table->alias.c_ptr())); + + closefrm(table); + my_free(table); + + if (rgi_slave) + { + /* Natural invariant of temporary_tables */ + DBUG_ASSERT(slave_open_temp_tables || !temporary_tables); + /* Decrement Slave_open_temp_table_definitions status variable count. */ + thread_safe_decrement32(&slave_open_temp_tables); + } + + DBUG_VOID_RETURN; +} + + +/** + Write query log events with "DROP TEMPORARY TABLES .." for each pseudo + thread to the binary log. + + @return false Success + true Error +*/ +bool THD::log_events_and_free_tmp_shares() +{ + DBUG_ENTER("THD::log_events_and_free_tmp_shares"); + + DBUG_ASSERT(!rgi_slave); + + TMP_TABLE_SHARE *share; + TMP_TABLE_SHARE *sorted; + TMP_TABLE_SHARE *prev_sorted; + // Assume thd->variables.option_bits has OPTION_QUOTE_SHOW_CREATE. + bool was_quote_show= true; + bool error= false; + bool found_user_tables= false; + // Better add "IF EXISTS" in case a RESET MASTER has been done. + const char stub[]= "DROP /*!40005 TEMPORARY */ TABLE IF EXISTS "; + char buf[FN_REFLEN]; + + String s_query(buf, sizeof(buf), system_charset_info); + s_query.copy(stub, sizeof(stub) - 1, system_charset_info); + + /* + Insertion sort of temporary tables by pseudo_thread_id to build ordered + list of sublists of equal pseudo_thread_id. + */ + All_tmp_tables_list::Iterator it_sorted(*temporary_tables); + All_tmp_tables_list::Iterator it_unsorted(*temporary_tables); + uint sorted_count= 0; + while((share= it_unsorted++)) + { + if (IS_USER_TABLE(share)) + { + prev_sorted= NULL; + + if (!found_user_tables) found_user_tables= true; + + for (uint i= 0; i < sorted_count; i ++) + { + sorted= it_sorted ++; + + if (!IS_USER_TABLE(sorted) || + (tmpkeyval(sorted) > tmpkeyval(share))) + { + /* + Insert this share before the current element in + the sorted part of the list. + */ + temporary_tables->remove(share); + + if (prev_sorted) + { + temporary_tables->insert_after(prev_sorted, share); + } + else + { + temporary_tables->push_front(share); + } + break; + } + prev_sorted= sorted; + } + it_sorted.rewind(); + } + sorted_count ++; + } + + /* + We always quote db & table names. + */ + if (found_user_tables && + !(was_quote_show= MY_TEST(variables.option_bits & + OPTION_QUOTE_SHOW_CREATE))) + { + variables.option_bits |= OPTION_QUOTE_SHOW_CREATE; + } + + /* + Scan sorted temporary tables to generate sequence of DROP. + */ + share= temporary_tables->pop_front(); + while (share) + { + if (IS_USER_TABLE(share)) + { + bool save_thread_specific_used= thread_specific_used; + my_thread_id save_pseudo_thread_id= variables.pseudo_thread_id; + char db_buf[FN_REFLEN]; + String db(db_buf, sizeof(db_buf), system_charset_info); + + /* + Set pseudo_thread_id to be that of the processed table. + */ + variables.pseudo_thread_id= tmpkeyval(share); + + db.copy(share->db.str, share->db.length, system_charset_info); + /* + Reset s_query() if changed by previous loop. + */ + s_query.length(sizeof(stub) - 1); + + /* + Loop forward through all tables that belong to a common database + within the sublist of common pseudo_thread_id to create single + DROP query. + */ + for (; + share && IS_USER_TABLE(share) && + tmpkeyval(share) == variables.pseudo_thread_id && + share->db.length == db.length() && + memcmp(share->db.str, db.ptr(), db.length()) == 0; + /* Get the next TABLE_SHARE in the list. */ + share= temporary_tables->pop_front()) + { + /* + We are going to add ` around the table names and possible more + due to special characters. + */ + append_identifier(this, &s_query, share->table_name.str, + share->table_name.length); + s_query.append(','); + rm_temporary_table(share->db_type(), share->path.str); + free_table_share(share); + my_free(share); + } + + clear_error(); + CHARSET_INFO *cs_save= variables.character_set_client; + variables.character_set_client= system_charset_info; + thread_specific_used= true; + + Query_log_event qinfo(this, s_query.ptr(), + s_query.length() - 1 /* to remove trailing ',' */, + false, true, false, 0); + qinfo.db= db.ptr(); + qinfo.db_len= db.length(); + variables.character_set_client= cs_save; + + get_stmt_da()->set_overwrite_status(true); + if ((error= (mysql_bin_log.write(&qinfo) || error))) + { + /* + If we're here following THD::cleanup, thence the connection + has been closed already. So lets print a message to the + error log instead of pushing yet another error into the + stmt_da. + + Also, we keep the error flag so that we propagate the error + up in the stack. This way, if we're the SQL thread we notice + that THD::close_tables failed. (Actually, the SQL + thread only calls THD::close_tables while applying + old Start_log_event_v3 events.) + */ + sql_print_error("Failed to write the DROP statement for " + "temporary tables to binary log"); + } + + get_stmt_da()->set_overwrite_status(false); + variables.pseudo_thread_id= save_pseudo_thread_id; + thread_specific_used= save_thread_specific_used; + } + else + { + free_tmp_table_share(share, true); + /* Get the next TABLE_SHARE in the list. */ + share= temporary_tables->pop_front(); + } + } + + if (!was_quote_show) + { + /* + Restore option. + */ + variables.option_bits&= ~OPTION_QUOTE_SHOW_CREATE; + } + + DBUG_RETURN(error); +} + + +/** + Delete the files and free the specified table share. + + @param share [IN] TABLE_SHARE to free + @param delete_table [IN] Whether to delete the table files? + + @return void +*/ +void THD::free_tmp_table_share(TMP_TABLE_SHARE *share, + bool delete_table) +{ + DBUG_ENTER("THD::free_tmp_table_share"); + + if (delete_table) + { + rm_temporary_table(share->db_type(), share->path.str); + } + free_table_share(share); + my_free(share); + + DBUG_VOID_RETURN; +} + + +/** + Free the specified table object. + + @param table [IN] Table object to free. + + @return void +*/ +void THD::free_temporary_table(TABLE *table) +{ + DBUG_ENTER("THD::free_temporary_table"); + + /* + If LOCK TABLES list is not empty and contains this table, unlock the table + and remove the table from this list. + */ + mysql_lock_remove(this, lock, table); + + close_temporary_table(table); + + DBUG_VOID_RETURN; +} + + +/** + On replication slave, acquire the Relay_log_info's data_lock and use slave + temporary tables. + + @return true Lock acquired + false Lock wasn't acquired +*/ +bool THD::lock_temporary_tables() +{ + DBUG_ENTER("THD::lock_temporary_tables"); + + /* Do not proceed if a lock has already been taken. */ + if (m_tmp_tables_locked) + { + DBUG_RETURN(false); + } + + if (rgi_slave) + { + mysql_mutex_lock(&rgi_slave->rli->data_lock); + temporary_tables= rgi_slave->rli->save_temporary_tables; + m_tmp_tables_locked= true; + } + + DBUG_RETURN(m_tmp_tables_locked); +} + + +/** + On replication slave, release the Relay_log_info::data_lock previously + acquired to use slave temporary tables. + + @return void +*/ +void THD::unlock_temporary_tables() +{ + DBUG_ENTER("THD::unlock_temporary_tables"); + + if (!m_tmp_tables_locked) + { + DBUG_VOID_RETURN; + } + + if (rgi_slave) + { + rgi_slave->rli->save_temporary_tables= temporary_tables; + temporary_tables= NULL; /* Safety */ + mysql_mutex_unlock(&rgi_slave->rli->data_lock); + m_tmp_tables_locked= false; + } + + DBUG_VOID_RETURN; +} + diff --git a/sql/threadpool_common.cc b/sql/threadpool_common.cc index 2cfa3473222..a7996efc382 100644 --- a/sql/threadpool_common.cc +++ b/sql/threadpool_common.cc @@ -122,7 +122,7 @@ THD* threadpool_add_connection(CONNECT *connect, void *scheduler_data) pthread_setspecific(THR_KEY_mysys, 0); my_thread_init(); st_my_thread_var* mysys_var= (st_my_thread_var *)pthread_getspecific(THR_KEY_mysys); - if (!mysys_var ||!(thd= connect->create_thd())) + if (!mysys_var ||!(thd= connect->create_thd(NULL))) { /* Out of memory? */ connect->close_and_delete(); @@ -200,7 +200,7 @@ void threadpool_remove_connection(THD *thd) end_connection(thd); close_connection(thd, 0); unlink_thd(thd); - mysql_cond_broadcast(&COND_thread_count); + delete thd; /* Free resources associated with this connection: diff --git a/sql/threadpool_unix.cc b/sql/threadpool_unix.cc index 91b392eb766..4079091e217 100644 --- a/sql/threadpool_unix.cc +++ b/sql/threadpool_unix.cc @@ -170,6 +170,7 @@ struct pool_timer_t volatile uint64 next_timeout_check; int tick_interval; bool shutdown; + pthread_t timer_thread_id; }; static pool_timer_t pool_timer; @@ -607,12 +608,12 @@ void check_stall(thread_group_t *thread_group) static void start_timer(pool_timer_t* timer) { - pthread_t thread_id; DBUG_ENTER("start_timer"); mysql_mutex_init(key_timer_mutex,&timer->mutex, NULL); mysql_cond_init(key_timer_cond, &timer->cond, NULL); timer->shutdown = false; - mysql_thread_create(key_timer_thread,&thread_id, NULL, timer_thread, timer); + mysql_thread_create(key_timer_thread, &timer->timer_thread_id, NULL, + timer_thread, timer); DBUG_VOID_RETURN; } @@ -624,6 +625,7 @@ static void stop_timer(pool_timer_t *timer) timer->shutdown = true; mysql_cond_signal(&timer->cond); mysql_mutex_unlock(&timer->mutex); + pthread_join(timer->timer_thread_id, NULL); DBUG_VOID_RETURN; } diff --git a/sql/threadpool_win.cc b/sql/threadpool_win.cc index 2ca815a6062..9b1d8f6a7d8 100644 --- a/sql/threadpool_win.cc +++ b/sql/threadpool_win.cc @@ -32,16 +32,6 @@ #include -/* - Threadpool API is not available on XP. We still want to compile a single - version on Windows, but use the latest functionality if available. - We cannot use threadpool functionality directly, since executable won't - start on XP and loader will complain about missing symbols. - - We solve using the usual way it is done on Windows, i.e with dynamic loading. - We'll need to load a lot of function, and make this less painful with the - WEAK_SYMBOL macro below -*/ /* WEAK_SYMBOL(return_type, function_name, argument_type1,..,argument_typeN) @@ -61,107 +51,10 @@ static pFN_##function my_##function = (pFN_##function) \ (GetProcAddress(GetModuleHandle("kernel32"),#function)) -WEAK_SYMBOL(VOID, CancelThreadpoolIo, PTP_IO); -#define CancelThreadpoolIo my_CancelThreadpoolIo -WEAK_SYMBOL(VOID, CloseThreadpool, PTP_POOL); -#define CloseThreadpool my_CloseThreadpool - -WEAK_SYMBOL(VOID, CloseThreadpoolIo, PTP_IO); -#define CloseThreadpoolIo my_CloseThreadpoolIo - -WEAK_SYMBOL(VOID, CloseThreadpoolTimer,PTP_TIMER); -#define CloseThreadpoolTimer my_CloseThreadpoolTimer - -WEAK_SYMBOL(VOID, CloseThreadpoolWait,PTP_WAIT); -#define CloseThreadpoolWait my_CloseThreadpoolWait - -WEAK_SYMBOL(PTP_POOL, CreateThreadpool,PVOID); -#define CreateThreadpool my_CreateThreadpool - -WEAK_SYMBOL(PTP_IO, CreateThreadpoolIo, HANDLE, PTP_WIN32_IO_CALLBACK, PVOID , - PTP_CALLBACK_ENVIRON); -#define CreateThreadpoolIo my_CreateThreadpoolIo - -WEAK_SYMBOL(PTP_TIMER, CreateThreadpoolTimer, PTP_TIMER_CALLBACK , - PVOID pv, PTP_CALLBACK_ENVIRON pcbe); -#define CreateThreadpoolTimer my_CreateThreadpoolTimer - -WEAK_SYMBOL(PTP_WAIT, CreateThreadpoolWait, PTP_WAIT_CALLBACK, PVOID, - PTP_CALLBACK_ENVIRON); -#define CreateThreadpoolWait my_CreateThreadpoolWait - -WEAK_SYMBOL(VOID, DisassociateCurrentThreadFromCallback, PTP_CALLBACK_INSTANCE); -#define DisassociateCurrentThreadFromCallback my_DisassociateCurrentThreadFromCallback - -WEAK_SYMBOL(DWORD, FlsAlloc, PFLS_CALLBACK_FUNCTION); -#define FlsAlloc my_FlsAlloc - -WEAK_SYMBOL(PVOID, FlsGetValue, DWORD); -#define FlsGetValue my_FlsGetValue - -WEAK_SYMBOL(BOOL, FlsSetValue, DWORD, PVOID); -#define FlsSetValue my_FlsSetValue - -WEAK_SYMBOL(VOID, SetThreadpoolThreadMaximum, PTP_POOL, DWORD); -#define SetThreadpoolThreadMaximum my_SetThreadpoolThreadMaximum - -WEAK_SYMBOL(BOOL, SetThreadpoolThreadMinimum, PTP_POOL, DWORD); -#define SetThreadpoolThreadMinimum my_SetThreadpoolThreadMinimum - -WEAK_SYMBOL(VOID, SetThreadpoolTimer, PTP_TIMER, PFILETIME,DWORD,DWORD); -#define SetThreadpoolTimer my_SetThreadpoolTimer - -WEAK_SYMBOL(VOID, SetThreadpoolWait, PTP_WAIT,HANDLE,PFILETIME); -#define SetThreadpoolWait my_SetThreadpoolWait - -WEAK_SYMBOL(VOID, StartThreadpoolIo, PTP_IO); -#define StartThreadpoolIo my_StartThreadpoolIo - -WEAK_SYMBOL(VOID, WaitForThreadpoolIoCallbacks,PTP_IO, BOOL); -#define WaitForThreadpoolIoCallbacks my_WaitForThreadpoolIoCallbacks - -WEAK_SYMBOL(VOID, WaitForThreadpoolTimerCallbacks, PTP_TIMER, BOOL); -#define WaitForThreadpoolTimerCallbacks my_WaitForThreadpoolTimerCallbacks - -WEAK_SYMBOL(VOID, WaitForThreadpoolWaitCallbacks, PTP_WAIT, BOOL); -#define WaitForThreadpoolWaitCallbacks my_WaitForThreadpoolWaitCallbacks - -WEAK_SYMBOL(BOOL, SetFileCompletionNotificationModes, HANDLE, UCHAR); -#define SetFileCompletionNotificationModes my_SetFileCompletionNotificationModes - -WEAK_SYMBOL(BOOL, TrySubmitThreadpoolCallback, PTP_SIMPLE_CALLBACK pfns, - PVOID pv,PTP_CALLBACK_ENVIRON pcbe); -#define TrySubmitThreadpoolCallback my_TrySubmitThreadpoolCallback - -WEAK_SYMBOL(PTP_WORK, CreateThreadpoolWork, PTP_WORK_CALLBACK pfnwk, PVOID pv, - PTP_CALLBACK_ENVIRON pcbe); -#define CreateThreadpoolWork my_CreateThreadpoolWork - -WEAK_SYMBOL(VOID, SubmitThreadpoolWork,PTP_WORK pwk); -#define SubmitThreadpoolWork my_SubmitThreadpoolWork - -WEAK_SYMBOL(VOID, CloseThreadpoolWork, PTP_WORK pwk); -#define CloseThreadpoolWork my_CloseThreadpoolWork - -WEAK_SYMBOL(BOOL, CallbackMayRunLong, PTP_CALLBACK_INSTANCE pci); -#define CallbackMayRunLong my_CallbackMayRunLong - -#if _MSC_VER >= 1600 -/* Stack size manipulation available only on Win7+ /declarations in VS10 */ WEAK_SYMBOL(BOOL, SetThreadpoolStackInformation, PTP_POOL, PTP_POOL_STACK_INFORMATION); #define SetThreadpoolStackInformation my_SetThreadpoolStackInformation -#else /* _MSC_VER < 1600 */ -#define SetThreadpoolCallbackPriority(env,prio) -typedef enum _TP_CALLBACK_PRIORITY { - TP_CALLBACK_PRIORITY_HIGH, - TP_CALLBACK_PRIORITY_NORMAL, - TP_CALLBACK_PRIORITY_LOW, - TP_CALLBACK_PRIORITY_INVALID -} TP_CALLBACK_PRIORITY; -#endif - /* Log a warning */ static void tp_log_warning(const char *msg, const char *fct) diff --git a/sql/tztime.cc b/sql/tztime.cc index ce0272d996d..a9db91668bb 100644 --- a/sql/tztime.cc +++ b/sql/tztime.cc @@ -1620,7 +1620,7 @@ my_tz_init(THD *org_thd, const char *default_tzname, my_bool bootstrap) /* To be able to run this from boot, we allocate a temporary THD */ - if (!(thd= new THD)) + if (!(thd= new THD(0))) DBUG_RETURN(1); thd->thread_stack= (char*) &thd; thd->store_globals(); diff --git a/sql/unireg.cc b/sql/unireg.cc index f565fc97d86..d3a9b832aaf 100644 --- a/sql/unireg.cc +++ b/sql/unireg.cc @@ -40,11 +40,17 @@ #define ALLOCA_THRESHOLD 2048 static uint pack_keys(uchar *,uint, KEY *, ulong); -static bool pack_header(THD *, uchar *, List &, uint, ulong, handler *); +static bool pack_header(THD *, uchar *, List &, HA_CREATE_INFO *, + ulong, handler *); static uint get_interval_id(uint *,List &, Create_field *); -static bool pack_fields(uchar *, List &, ulong); +static bool pack_fields(uchar **, List &, HA_CREATE_INFO*, + ulong); +static void pack_constraints(uchar **buff, List *constr); static size_t packed_fields_length(List &); -static bool make_empty_rec(THD *, uchar *, uint, List &, uint, ulong); +static size_t packed_constraints_length(THD *, HA_CREATE_INFO*, + List *); +static bool make_empty_rec(THD *, uchar *, uint, List &, uint, + ulong); /* write the length as @@ -121,13 +127,13 @@ LEX_CUSTRING build_frm_image(THD *thd, const char *table, create_info->null_bits++; data_offset= (create_info->null_bits + 7) / 8; - error= pack_header(thd, forminfo, create_fields, create_info->table_options, + error= pack_header(thd, forminfo, create_fields, create_info, data_offset, db_file); if (error) DBUG_RETURN(frm); - reclength=uint2korr(forminfo+266); + reclength= uint2korr(forminfo+266); /* Calculate extra data segment length */ str_db_type= *hton_name(create_info->db_type); @@ -219,8 +225,10 @@ LEX_CUSTRING build_frm_image(THD *thd, const char *table, filepos= frm.length; frm.length+= FRM_FORMINFO_SIZE; // forminfo frm.length+= packed_fields_length(create_fields); + frm.length+= create_info->expression_length; - if (frm.length > FRM_MAX_SIZE) + if (frm.length > FRM_MAX_SIZE || + create_info->expression_length > UINT_MAX32) { my_error(ER_TABLE_DEFINITION_TOO_BIG, MYF(0), table); DBUG_RETURN(frm); @@ -326,7 +334,8 @@ LEX_CUSTRING build_frm_image(THD *thd, const char *table, } memcpy(frm_ptr + filepos, forminfo, 288); - if (pack_fields(frm_ptr + filepos + 288, create_fields, data_offset)) + pos= frm_ptr + filepos + 288; + if (pack_fields(&pos, create_fields, create_info, data_offset)) goto err; { @@ -488,15 +497,107 @@ static uint pack_keys(uchar *keybuff, uint key_count, KEY *keyinfo, } /* pack_keys */ +/** + Calculate and check length of stored expression (virtual, def, check) + + Convert string to utf8, if it isn't already + + @param thd Thread handler. Used for memory allocation + @param v_col Virtual expression. Can be 0 + @param CREATE INFO For characterset + @param length Sum total lengths here + + Note to make calls easier, one can call this with v_col == 0 + + @return 0 ok + @return 1 error (out of memory or wrong characters in expression) +*/ + +static bool add_expr_length(THD *thd, Virtual_column_info **v_col_ptr, + size_t *length) +{ + Virtual_column_info *v_col= *v_col_ptr; + if (!v_col) + return 0; + + /* + Convert string to utf8 for storage. + */ + if (!v_col->utf8) + { + /* + This v_col comes from the parser (e.g. CREATE TABLE) or + from old (before 10.2.1) frm. + + We have to create a new Virtual_column_info as for alter table, + the current one may be shared with the original table. + */ + Virtual_column_info *new_vcol= new (thd->mem_root) Virtual_column_info(); + LEX_STRING to; + if (thd->copy_with_error(&my_charset_utf8mb4_general_ci, + &to, + thd->variables.character_set_client, + v_col->expr_str.str, v_col->expr_str.length)) + return 1; + *new_vcol= *v_col; + new_vcol->expr_str= to; + new_vcol->utf8= 1; + *v_col_ptr= new_vcol; + v_col= new_vcol; + } + + /* + Sum up the length of the expression string, it's optional name + and the header. + */ + (*length)+= (FRM_VCOL_NEW_HEADER_SIZE + v_col->name.length + + v_col->expr_str.length); + return 0; +} + + +/* + pack_expression + + The data is stored as: + 1 byte type (0 virtual, 1 virtual stored, 2 def, 3 check) + 2 bytes field_number + 2 bytes length of expression + 1 byte length of name + name + next bytes column expression (text data) +*/ + +static void pack_expression(uchar **buff, Virtual_column_info *vcol, + uint offset, uint type) +{ + (*buff)[0]= (uchar) type; + int2store((*buff)+1, offset); + /* + expr_str.length < 64K as we have checked that the total size of the + frm file is < 64K + */ + int2store((*buff)+3, vcol->expr_str.length); + (*buff)[5]= vcol->name.length; + (*buff)+= FRM_VCOL_NEW_HEADER_SIZE; + memcpy((*buff), vcol->name.str, vcol->name.length); + (*buff)+= vcol->name.length; + memcpy((*buff), vcol->expr_str.str, vcol->expr_str.length); + (*buff)+= vcol->expr_str.length; +} + + /* Make formheader */ static bool pack_header(THD *thd, uchar *forminfo, List &create_fields, - uint table_options, ulong data_offset, handler *file) + HA_CREATE_INFO *create_info, ulong data_offset, + handler *file) { uint length,int_count,int_length,no_empty, int_parts; uint time_stamp_pos,null_fields; - ulong reclength, totlength, n_length, com_length, vcol_info_length; + uint table_options= create_info->table_options; + size_t reclength, totlength, n_length, com_length, expression_length; DBUG_ENTER("pack_header"); if (create_fields.elements > MAX_FIELDS) @@ -508,8 +609,19 @@ static bool pack_header(THD *thd, uchar *forminfo, totlength= 0L; reclength= data_offset; no_empty=int_count=int_parts=int_length=time_stamp_pos=null_fields=0; - com_length=vcol_info_length=0; + com_length= 0; n_length=2L; + create_info->field_check_constraints= 0; + + if (create_info->check_constraint_list->elements) + { + expression_length= packed_constraints_length(thd, create_info, + create_info->check_constraint_list); + if (!expression_length) + DBUG_RETURN(1); // Wrong characterset + } + else + expression_length= 0; /* Check fields */ List_iterator it(create_fields); @@ -520,30 +632,13 @@ static bool pack_header(THD *thd, uchar *forminfo, ER_TOO_LONG_FIELD_COMMENT, field->field_name)) DBUG_RETURN(1); - if (field->vcol_info) - { - uint col_expr_maxlen= field->virtual_col_expr_maxlen(); - uint tmp_len= my_charpos(system_charset_info, - field->vcol_info->expr_str.str, - field->vcol_info->expr_str.str + - field->vcol_info->expr_str.length, - col_expr_maxlen); - - if (tmp_len < field->vcol_info->expr_str.length) - { - my_error(ER_WRONG_STRING_LENGTH, MYF(0), - field->vcol_info->expr_str.str,"VIRTUAL COLUMN EXPRESSION", - col_expr_maxlen); - DBUG_RETURN(1); - } - /* - Sum up the length of the expression string and the length of the - mandatory header to the total length of info on the defining - expressions saved in the frm file for virtual columns. - */ - vcol_info_length+= field->vcol_info->expr_str.length+ - FRM_VCOL_HEADER_SIZE(field->interval); - } + if (add_expr_length(thd, &field->vcol_info, &expression_length)) + DBUG_RETURN(1); + if (field->default_value && field->default_value->expr_str.length) + if (add_expr_length(thd, &field->default_value, &expression_length)) + DBUG_RETURN(1); + if (add_expr_length(thd, &field->check_constraint, &expression_length)) + DBUG_RETURN(1); totlength+= field->length; com_length+= field->comment.length; @@ -554,8 +649,8 @@ static bool pack_header(THD *thd, uchar *forminfo, MTYP_NOEMPTY_BIT); no_empty++; } - /* - We mark first TIMESTAMP field with NOW() in DEFAULT or ON UPDATE + /* + We mark first TIMESTAMP field with NOW() in DEFAULT or ON UPDATE as auto-update field. */ if (field->sql_type == MYSQL_TYPE_TIMESTAMP && @@ -616,6 +711,8 @@ static bool pack_header(THD *thd, uchar *forminfo, } if (f_maybe_null(field->pack_flag)) null_fields++; + if (field->check_constraint) + create_info->field_check_constraints++; } int_length+=int_count*2; // 255 prefix + 0 suffix @@ -625,23 +722,30 @@ static bool pack_header(THD *thd, uchar *forminfo, my_error(ER_TOO_BIG_ROWSIZE, MYF(0), static_cast(file->max_record_length())); DBUG_RETURN(1); } + + if (expression_length) + { + expression_length+= FRM_VCOL_NEW_BASE_SIZE; + create_info->expression_length= expression_length; + } + /* Hack to avoid bugs with small static rows in MySQL */ reclength=MY_MAX(file->min_record_length(table_options),reclength); if ((ulong) create_fields.elements*FCOMP+FRM_FORMINFO_SIZE+ - n_length+int_length+com_length+vcol_info_length > 65535L || + n_length+int_length+com_length+expression_length > 65535L || int_count > 255) { - my_message(ER_TOO_MANY_FIELDS, ER_THD(thd, ER_TOO_MANY_FIELDS), MYF(0)); + my_message(ER_TOO_MANY_FIELDS, "Table definition is too large", MYF(0)); DBUG_RETURN(1); } bzero((char*)forminfo,FRM_FORMINFO_SIZE); length=(create_fields.elements*FCOMP+FRM_FORMINFO_SIZE+n_length+int_length+ - com_length+vcol_info_length); + com_length+expression_length); int2store(forminfo,length); forminfo[256] = 0; int2store(forminfo+258,create_fields.elements); - int2store(forminfo+260,0); + int2store(forminfo+260,0); // Screen length, not used anymore int2store(forminfo+262,totlength); int2store(forminfo+264,no_empty); int2store(forminfo+266,reclength); @@ -654,7 +758,7 @@ static bool pack_header(THD *thd, uchar *forminfo, int2store(forminfo+280,22); /* Rows needed */ int2store(forminfo+282,null_fields); int2store(forminfo+284,com_length); - int2store(forminfo+286,vcol_info_length); + int2store(forminfo+286,expression_length); DBUG_RETURN(0); } /* pack_header */ @@ -707,26 +811,46 @@ static size_t packed_fields_length(List &create_fields) } length++; } - if (field->vcol_info) - { - length+= field->vcol_info->expr_str.length + - FRM_VCOL_HEADER_SIZE(field->interval); - } + length+= FCOMP; length+= strlen(field->field_name)+1; length+= field->comment.length; } - length++; - length++; + length+= 2; DBUG_RETURN(length); } + +static size_t packed_constraints_length(THD *thd, HA_CREATE_INFO *info, + List *constr) +{ + List_iterator it(*constr); + size_t length= 0; + Virtual_column_info *check; + + while ((check= it++)) + if (add_expr_length(thd, it.ref(), &length)) + return 0; + return length; +} + +static void pack_constraints(uchar **buff, List *constr) +{ + List_iterator it(*constr); + Virtual_column_info *check; + while ((check= it++)) + pack_expression(buff, check, UINT_MAX32, 4); +} + + /* Save fields, fieldnames and intervals */ -static bool pack_fields(uchar *buff, List &create_fields, +static bool pack_fields(uchar **buff_arg, List &create_fields, + HA_CREATE_INFO *create_info, ulong data_offset) { - uint int_count, comment_length= 0, vcol_info_length=0; + uchar *buff= *buff_arg; + uint int_count, comment_length= 0; Create_field *field; DBUG_ENTER("pack_fields"); @@ -736,7 +860,6 @@ static bool pack_fields(uchar *buff, List &create_fields, while ((field=it++)) { uint recpos; - uint cur_vcol_expr_len= 0; int2store(buff+3, field->length); /* The +1 is here becasue the col offset in .frm file have offset 1 */ recpos= field->offset+1 + (uint) data_offset; @@ -745,7 +868,7 @@ static bool pack_fields(uchar *buff, List &create_fields, DBUG_ASSERT(field->unireg_check < 256); buff[10]= (uchar) field->unireg_check; buff[12]= (uchar) field->interval_id; - buff[13]= (uchar) field->sql_type; + buff[13]= (uchar) field->sql_type; if (field->sql_type == MYSQL_TYPE_GEOMETRY) { buff[11]= 0; @@ -763,17 +886,7 @@ static bool pack_fields(uchar *buff, List &create_fields, { buff[11]= buff[14]= 0; // Numerical } - if (field->vcol_info) - { - /* - Use the interval_id place in the .frm file to store the length of - the additional data saved for the virtual field - */ - buff[12]= cur_vcol_expr_len= field->vcol_info->expr_str.length + - FRM_VCOL_HEADER_SIZE(field->interval); - vcol_info_length+= cur_vcol_expr_len; - buff[13]= (uchar) MYSQL_TYPE_VIRTUAL; - } + int2store(buff+15, field->comment.length); comment_length+= field->comment.length; set_if_bigger(int_count,field->interval_id); @@ -844,7 +957,6 @@ static bool pack_fields(uchar *buff, List &create_fields, *buff++= sep; } *buff++= 0; - } } } @@ -857,35 +969,31 @@ static bool pack_fields(uchar *buff, List &create_fields, buff+= field->comment.length; } } - if (vcol_info_length) + + if (create_info->expression_length) { + /* Store header for packed fields (extra space for future) */ + bzero(buff, FRM_VCOL_NEW_BASE_SIZE); + buff+= FRM_VCOL_NEW_BASE_SIZE; + + /* Store expressions */ it.rewind(); - while ((field=it++)) + for (uint field_nr=0 ; (field= it++) ; field_nr++) { - /* - Pack each virtual field as follows: - byte 1 = interval_id == 0 ? 1 : 2 - byte 2 = sql_type - byte 3 = flags (as of now, 0 - no flags, 1 - field is physically stored) - [byte 4] = possible interval_id for sql_type - next byte ... = virtual column expression (text data) - */ - if (field->vcol_info && field->vcol_info->expr_str.length) - { - *buff++= (uchar) (1 + MY_TEST(field->interval)); - *buff++= (uchar) field->sql_type; - *buff++= (uchar) field->vcol_info->stored_in_db; - if (field->interval) - *buff++= (uchar) field->interval_id; - memcpy(buff, field->vcol_info->expr_str.str, field->vcol_info->expr_str.length); - buff+= field->vcol_info->expr_str.length; - } + if (field->vcol_info) + pack_expression(&buff, field->vcol_info, field_nr, + field->vcol_info->stored_in_db ? 1 : 0); + if (field->default_value && field->default_value->expr_str.length) + pack_expression(&buff, field->default_value, field_nr, 2); + if (field->check_constraint) + pack_expression(&buff, field->check_constraint, field_nr, 3); } + pack_constraints(&buff, create_info->check_constraint_list); } + *buff_arg= buff; DBUG_RETURN(0); } - /* save an empty record on start of formfile */ static bool make_empty_rec(THD *thd, uchar *buff, uint table_options, @@ -931,7 +1039,10 @@ static bool make_empty_rec(THD *thd, uchar *buff, uint table_options, field->sql_type, field->charset, field->geom_type, field->srid, - field->unireg_check, + field->unireg_check == Field::TIMESTAMP_DNUN_FIELD + ? Field::TIMESTAMP_UN_FIELD + : field->unireg_check == Field::TIMESTAMP_DN_FIELD + ? Field::NONE : field->unireg_check, field->save_interval ? field->save_interval : field->interval, field->field_name); @@ -955,9 +1066,9 @@ static bool make_empty_rec(THD *thd, uchar *buff, uint table_options, type= (Field::utype) MTYP_TYPENR(field->unireg_check); - if (field->def) + if (field->default_value && !field->has_default_expression()) { - int res= field->def->save_in_field(regfield, 1); + int res= field->default_value->expr_item->save_in_field(regfield, 1); /* If not ok or warning of level 'note' */ if (res != 0 && res != 3) { diff --git a/sql/unireg.h b/sql/unireg.h index 251597c1884..8e74519862e 100644 --- a/sql/unireg.h +++ b/sql/unireg.h @@ -211,7 +211,7 @@ static inline bool is_binary_frm_header(uchar *head) return head[0] == 254 && head[1] == 1 && head[2] >= FRM_VER - && head[2] <= FRM_VER+4; + && head[2] <= FRM_VER_CURRENT; } #endif diff --git a/sql/winservice.c b/sql/winservice.c index 1cf9f8d7823..74e9e56acc6 100644 --- a/sql/winservice.c +++ b/sql/winservice.c @@ -81,8 +81,10 @@ void normalize_path(char *path, size_t size) and services. We do not want to mess up with these installations. We will just ignore such services, pretending it is not MySQL. - ´@return - TRUE, if this service should be excluded from UI lists etc (OEM install) + We also exclude MySQL5.7+ since we cannot upgrade it (and it is not an upgrade anyway) + + @return + TRUE, if this service should be excluded from UI lists etc FALSE otherwise. */ BOOL exclude_service(mysqld_service_properties *props) @@ -104,7 +106,12 @@ BOOL exclude_service(mysqld_service_properties *props) if (strstr(buf, exclude_patterns[i])) return TRUE; } - + if ((props->version_major == 0) || + (props->version_major > 5 && props->version_major < 10) || + (props->version_major == 5 && props->version_minor > 6)) + { + return TRUE; + } return FALSE; } diff --git a/sql/wsrep_applier.cc b/sql/wsrep_applier.cc index cf1feb49f41..b4557cfe1b7 100644 --- a/sql/wsrep_applier.cc +++ b/sql/wsrep_applier.cc @@ -62,7 +62,6 @@ err: #include "transaction.h" // trans_commit(), trans_rollback() #include "rpl_rli.h" // class Relay_log_info; -#include "sql_base.h" // close_temporary_table() void wsrep_set_apply_format(THD* thd, Format_description_log_event* ev) { @@ -253,6 +252,9 @@ wsrep_cb_status_t wsrep_apply_cb(void* const ctx, else thd->variables.option_bits&= ~OPTION_NO_FOREIGN_KEY_CHECKS; + /* With galera we assume that the master has done the constraint checks */ + thd->variables.option_bits|= OPTION_NO_CHECK_CONSTRAINT_CHECKS; + if (flags & WSREP_FLAG_ISOLATION) { thd->wsrep_apply_toi= true; @@ -277,14 +279,11 @@ wsrep_cb_status_t wsrep_apply_cb(void* const ctx, wsrep_dump_rbr_buf_with_header(thd, buf, buf_len); } - TABLE *tmp; - while ((tmp = thd->temporary_tables)) + if (thd->has_thd_temporary_tables()) { - WSREP_DEBUG("Applier %lld, has temporary tables: %s.%s", - (longlong) thd->thread_id, - (tmp->s) ? tmp->s->db.str : "void", - (tmp->s) ? tmp->s->table_name.str : "void"); - close_temporary_table(thd, tmp, 1, 1); + WSREP_DEBUG("Applier %lld has temporary tables. Closing them now..", + thd->thread_id); + thd->close_temporary_tables(); } return rcode; diff --git a/sql/wsrep_applier.h b/sql/wsrep_applier.h index b6497776e87..d58d3cdc54e 100644 --- a/sql/wsrep_applier.h +++ b/sql/wsrep_applier.h @@ -23,6 +23,7 @@ void wsrep_set_apply_format(THD* thd, Format_description_log_event* ev); Format_description_log_event* wsrep_get_apply_format(THD* thd); /* wsrep callback prototypes */ +extern "C" { wsrep_cb_status_t wsrep_apply_cb(void *ctx, const void* buf, size_t buf_len, @@ -39,4 +40,5 @@ wsrep_cb_status_t wsrep_unordered_cb(void* ctx, const void* data, size_t size); +} /* extern "C" */ #endif /* WSREP_APPLIER_H */ diff --git a/sql/wsrep_binlog.h b/sql/wsrep_binlog.h index d8a2eb51d4a..1e820529211 100644 --- a/sql/wsrep_binlog.h +++ b/sql/wsrep_binlog.h @@ -38,10 +38,10 @@ int wsrep_write_cache_buf(IO_CACHE *cache, uchar **buf, size_t *buf_len); @param len total amount of data written @return wsrep error status */ -int wsrep_write_cache (wsrep_t* wsrep, - THD* thd, - IO_CACHE* cache, - size_t* len); +int wsrep_write_cache (wsrep_t* const wsrep, + THD* const thd, + IO_CACHE* const cache, + size_t* const len); /* Dump replication buffer to disk */ void wsrep_dump_rbr_buf(THD *thd, const void* rbr_buf, size_t buf_len); diff --git a/sql/wsrep_check_opts.cc b/sql/wsrep_check_opts.cc index 818ef843cb5..bc77c434525 100644 --- a/sql/wsrep_check_opts.cc +++ b/sql/wsrep_check_opts.cc @@ -18,8 +18,6 @@ #include "sys_vars_shared.h" #include "wsrep.h" #include "wsrep_sst.h" -//#include -//#include "wsrep_mysqld.h" extern char *my_bind_addr_str; diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc index 3cdf95e2bf2..75e15db0b8d 100644 --- a/sql/wsrep_mysqld.cc +++ b/sql/wsrep_mysqld.cc @@ -52,49 +52,64 @@ rpl_sidno wsrep_sidno= -1; my_bool wsrep_preordered_opt= FALSE; /* - * Begin configuration options and their default values + * Begin configuration options */ extern my_bool plugins_are_initialized; extern uint kill_cached_threads; extern mysql_cond_t COND_thread_cache; -const char* wsrep_data_home_dir = NULL; -const char* wsrep_dbug_option = ""; +/* System variables. */ +const char *wsrep_provider; +const char *wsrep_provider_options; +const char *wsrep_cluster_address; +const char *wsrep_cluster_name; +const char *wsrep_node_name; +const char *wsrep_node_address; +const char *wsrep_node_incoming_address; +const char *wsrep_start_position; +const char *wsrep_data_home_dir; +const char *wsrep_dbug_option; +const char *wsrep_notify_cmd; +const char *wsrep_sst_method; +const char *wsrep_sst_receive_address; +const char *wsrep_sst_donor; +const char *wsrep_sst_auth; +my_bool wsrep_debug; // Enable debug level logging +my_bool wsrep_convert_LOCK_to_trx; // Convert locking sessions to trx +my_bool wsrep_auto_increment_control; // Control auto increment variables +my_bool wsrep_drupal_282555_workaround; // Retry autoinc insert after dupkey +my_bool wsrep_certify_nonPK; // Certify, even when no primary key +my_bool wsrep_recovery; // Recovery +my_bool wsrep_replicate_myisam; // Enable MyISAM replication +my_bool wsrep_log_conflicts; +my_bool wsrep_load_data_splitting; // Commit load data every 10K intervals +my_bool wsrep_slave_UK_checks; // Slave thread does UK checks +my_bool wsrep_slave_FK_checks; // Slave thread does FK checks +my_bool wsrep_sst_donor_rejects_queries; +my_bool wsrep_restart_slave; // Should mysql slave thread be + // restarted, when node joins back? +my_bool wsrep_desync; // De(re)synchronize the node from the + // cluster +long wsrep_slave_threads; // No. of slave appliers threads +ulong wsrep_retry_autocommit; // Retry aborted autocommit trx +ulong wsrep_max_ws_size; // Max allowed ws (RBR buffer) size +ulong wsrep_max_ws_rows; // Max number of rows in ws +ulong wsrep_forced_binlog_format; +ulong wsrep_mysql_replication_bundle; +bool wsrep_gtid_mode; // Use wsrep_gtid_domain_id + // for galera transactions? +uint32 wsrep_gtid_domain_id; // gtid_domain_id for galera + // transactions -long wsrep_slave_threads = 1; // # of slave action appliers wanted -int wsrep_slave_count_change = 0; // # of appliers to stop or start -my_bool wsrep_debug = 0; // enable debug level logging -my_bool wsrep_convert_LOCK_to_trx = 1; // convert locking sessions to trx -ulong wsrep_retry_autocommit = 5; // retry aborted autocommit trx -my_bool wsrep_auto_increment_control = 1; // control auto increment variables -my_bool wsrep_drupal_282555_workaround = 1; // retry autoinc insert after dupkey -my_bool wsrep_incremental_data_collection = 0; // incremental data collection -ulong wsrep_max_ws_size = 1073741824UL;//max ws (RBR buffer) size -ulong wsrep_max_ws_rows = 65536; // max number of rows in ws -int wsrep_to_isolation = 0; // # of active TO isolation threads -my_bool wsrep_certify_nonPK = 1; // certify, even when no primary key -long wsrep_max_protocol_version = 3; // maximum protocol version to use -ulong wsrep_forced_binlog_format = BINLOG_FORMAT_UNSPEC; -my_bool wsrep_recovery = 0; // recovery -my_bool wsrep_replicate_myisam = 0; // enable myisam replication -my_bool wsrep_log_conflicts = 0; -ulong wsrep_mysql_replication_bundle = 0; -my_bool wsrep_desync = 0; // desynchronize the node from the - // cluster -my_bool wsrep_load_data_splitting = 1; // commit load data every 10K intervals -my_bool wsrep_restart_slave = 0; // should mysql slave thread be - // restarted, if node joins back -my_bool wsrep_restart_slave_activated = 0; // node has dropped, and slave - // restart will be needed -my_bool wsrep_slave_UK_checks = 0; // slave thread does UK checks -my_bool wsrep_slave_FK_checks = 0; // slave thread does FK checks -bool wsrep_new_cluster = false; // Bootstrap the cluster ? - -// Use wsrep_gtid_domain_id for galera transactions? -bool wsrep_gtid_mode = 0; -// gtid_domain_id for galera transactions. -uint32 wsrep_gtid_domain_id = 0; +/* Other configuration variables and their default values. */ +my_bool wsrep_incremental_data_collection= 0; // Incremental data collection +my_bool wsrep_restart_slave_activated= 0; // Node has dropped, and slave + // restart will be needed +bool wsrep_new_cluster= false; // Bootstrap the cluster? +int wsrep_slave_count_change= 0; // No. of appliers to stop/start +int wsrep_to_isolation= 0; // No. of active TO isolation threads +long wsrep_max_protocol_version= 3; // Maximum protocol version to use /* * End configuration options @@ -556,12 +571,13 @@ int wsrep_init() int rcode= -1; DBUG_ASSERT(wsrep_inited == 0); - if (strcmp(wsrep_start_position, WSREP_START_POSITION_ZERO)) - wsrep_start_position_init(wsrep_start_position); + if (strcmp(wsrep_start_position, WSREP_START_POSITION_ZERO) && + wsrep_start_position_init(wsrep_start_position)) + { + return 1; + } - wsrep_sst_auth_init(wsrep_sst_auth); - - wsrep_causal_reads_update(&global_system_variables); + wsrep_sst_auth_init(); wsrep_ready_set(FALSE); assert(wsrep_provider); @@ -789,7 +805,7 @@ void wsrep_init_startup (bool first) (wsrep_on_fun)wsrep_on); /* Skip replication start if no cluster address */ - if (!wsrep_cluster_address || strlen(wsrep_cluster_address) == 0) return; + if (!wsrep_cluster_address || wsrep_cluster_address[0] == 0) return; if (first) wsrep_sst_grab(); // do it so we can wait for SST below @@ -888,6 +904,9 @@ bool wsrep_start_replication() { wsrep_status_t rcode; + /* wsrep provider must be loaded. */ + DBUG_ASSERT(wsrep); + /* if provider is trivial, don't even try to connect, but resume local node operation @@ -899,7 +918,7 @@ bool wsrep_start_replication() return true; } - if (!wsrep_cluster_address || strlen(wsrep_cluster_address)== 0) + if (!wsrep_cluster_address || wsrep_cluster_address[0]== 0) { // if provider is non-trivial, but no address is specified, wait for address wsrep_ready_set(FALSE); @@ -1082,8 +1101,6 @@ static bool wsrep_prepare_keys_for_isolation(THD* thd, ka->keys= 0; ka->keys_len= 0; - extern TABLE* find_temporary_table(THD*, const TABLE_LIST*); - if (db || table) { TABLE_LIST tmp_table; @@ -1095,7 +1112,7 @@ static bool wsrep_prepare_keys_for_isolation(THD* thd, (table) ? table : "", MDL_INTENTION_EXCLUSIVE, MDL_STATEMENT); - if (!table || !find_temporary_table(thd, &tmp_table)) + if (!table || !thd->find_temporary_table(&tmp_table)) { if (!(ka->keys= (wsrep_key_t*)my_malloc(sizeof(wsrep_key_t), MYF(0)))) { @@ -1123,7 +1140,7 @@ static bool wsrep_prepare_keys_for_isolation(THD* thd, for (const TABLE_LIST* table= table_list; table; table= table->next_global) { - if (!find_temporary_table(thd, table)) + if (!thd->find_temporary_table(table)) { wsrep_key_t* tmp; tmp= (wsrep_key_t*)my_realloc( @@ -1267,7 +1284,7 @@ wsrep_alter_query_string(THD *thd, String *buf) return 0; } -int wsrep_alter_event_query(THD *thd, uchar** buf, size_t* buf_len) +static int wsrep_alter_event_query(THD *thd, uchar** buf, size_t* buf_len) { String log_query; @@ -1363,6 +1380,10 @@ create_view_query(THD *thd, uchar** buf, size_t* buf_len) return wsrep_to_buf_helper(thd, buff.ptr(), buff.length(), buf, buf_len); } +/* Forward declarations. */ +static int wsrep_create_sp(THD *thd, uchar** buf, size_t* buf_len); +static int wsrep_create_trigger_query(THD *thd, uchar** buf, size_t* buf_len); + /* returns: 0: statement was replicated as TOI @@ -1678,22 +1699,41 @@ void wsrep_to_isolation_end(THD *thd) @retval FALSE Lock request cannot be granted */ -bool -wsrep_grant_mdl_exception(MDL_context *requestor_ctx, - MDL_ticket *ticket, - const MDL_key *key -) { +bool wsrep_grant_mdl_exception(MDL_context *requestor_ctx, + MDL_ticket *ticket, + const MDL_key *key) +{ /* Fallback to the non-wsrep behaviour */ if (!WSREP_ON) return FALSE; - THD *request_thd = requestor_ctx->get_thd(); - THD *granted_thd = ticket->get_ctx()->get_thd(); - bool ret = FALSE; + THD *request_thd= requestor_ctx->get_thd(); + THD *granted_thd= ticket->get_ctx()->get_thd(); + bool ret= false; const char* schema= key->db_name(); int schema_len= key->db_name_length(); mysql_mutex_lock(&request_thd->LOCK_wsrep_thd); + + /* + We consider granting MDL exceptions only for appliers (BF THD) and ones + executing under TOI mode. + + Rules: + 1. If granted/owner THD is also an applier (BF THD) or one executing + under TOI mode, then we grant the requested lock to the requester + THD. + @return true + + 2. If granted/owner THD is executing a FLUSH command or already has an + explicit lock, then do not grant the requested lock to the requester + THD and it has to wait. + @return false + + 3. In all other cases the granted/owner THD is aborted and the requested + lock is not granted to the requester THD, thus it has to wait. + @return false + */ if (request_thd->wsrep_exec_mode == TOTAL_ORDER || request_thd->wsrep_exec_mode == REPL_RECV) { @@ -1710,7 +1750,7 @@ wsrep_grant_mdl_exception(MDL_context *requestor_ctx, request_thd, granted_thd); ticket->wsrep_report(true); mysql_mutex_unlock(&granted_thd->LOCK_wsrep_thd); - ret = TRUE; + ret= true; } else if (granted_thd->lex->sql_command == SQLCOM_FLUSH || granted_thd->mdl_context.has_explicit_locks()) @@ -1718,38 +1758,39 @@ wsrep_grant_mdl_exception(MDL_context *requestor_ctx, WSREP_DEBUG("BF thread waiting for FLUSH"); ticket->wsrep_report(wsrep_debug); mysql_mutex_unlock(&granted_thd->LOCK_wsrep_thd); - ret = FALSE; - } - else if (request_thd->lex->sql_command == SQLCOM_DROP_TABLE) - { - WSREP_DEBUG("DROP caused BF abort"); - ticket->wsrep_report(wsrep_debug); - mysql_mutex_unlock(&granted_thd->LOCK_wsrep_thd); - wsrep_abort_thd((void*)request_thd, (void*)granted_thd, 1); - ret = FALSE; - } - else if (granted_thd->wsrep_query_state == QUERY_COMMITTING) - { - WSREP_DEBUG("MDL granted, but committing thd abort scheduled"); - ticket->wsrep_report(wsrep_debug); - mysql_mutex_unlock(&granted_thd->LOCK_wsrep_thd); - wsrep_abort_thd((void*)request_thd, (void*)granted_thd, 1); - ret = FALSE; + ret= false; } else { - WSREP_MDL_LOG(DEBUG, "MDL conflict-> BF abort", schema, schema_len, - request_thd, granted_thd); - ticket->wsrep_report(wsrep_debug); + /* Print some debug information. */ + if (wsrep_debug) + { + if ((request_thd->lex->sql_command == SQLCOM_DROP_TABLE)) + { + WSREP_DEBUG("DROP caused BF abort"); + } + else if ((granted_thd->wsrep_query_state == QUERY_COMMITTING)) + { + WSREP_DEBUG("MDL granted, but committing thd abort scheduled"); + } + else + { + WSREP_MDL_LOG(DEBUG, "MDL conflict-> BF abort", schema, schema_len, + request_thd, granted_thd); + } + ticket->wsrep_report(true); + } + mysql_mutex_unlock(&granted_thd->LOCK_wsrep_thd); - wsrep_abort_thd((void*)request_thd, (void*)granted_thd, 1); - ret = FALSE; + wsrep_abort_thd((void *) request_thd, (void *) granted_thd, 1); + ret= false; } } else { mysql_mutex_unlock(&request_thd->LOCK_wsrep_thd); } + return ret; } @@ -1759,13 +1800,11 @@ pthread_handler_t start_wsrep_THD(void *arg) THD *thd; wsrep_thd_processor_fun processor= (wsrep_thd_processor_fun)arg; - if (my_thread_init() || (!(thd= new THD(true)))) + if (my_thread_init() || (!(thd= new THD(next_thread_id(), true)))) { goto error; } - thd->thread_id= next_thread_id(); - mysql_mutex_lock(&LOCK_thread_count); if (wsrep_gtid_mode) @@ -1775,7 +1814,6 @@ pthread_handler_t start_wsrep_THD(void *arg) } thd->real_id=pthread_self(); // Keep purify happy - thread_count++; thread_created++; threads.append(thd); @@ -1873,7 +1911,6 @@ pthread_handler_t start_wsrep_THD(void *arg) thd->unlink(); mysql_mutex_unlock(&LOCK_thread_count); delete thd; - dec_thread_count(); } my_thread_end(); return(NULL); @@ -2176,7 +2213,7 @@ void wsrep_kill_mysql(THD *thd) } -int wsrep_create_sp(THD *thd, uchar** buf, size_t* buf_len) +static int wsrep_create_sp(THD *thd, uchar** buf, size_t* buf_len) { String log_query; sp_head *sp = thd->lex->sphead; @@ -2444,26 +2481,13 @@ bool wsrep_create_like_table(THD* thd, TABLE_LIST* table, TABLE_LIST* src_table, HA_CREATE_INFO *create_info) { - TABLE *tmp_table; - bool is_tmp_table= FALSE; - - for (tmp_table= thd->temporary_tables; tmp_table; tmp_table=tmp_table->next) - { - if (!strcmp(src_table->db, tmp_table->s->db.str) && - !strcmp(src_table->table_name, tmp_table->s->table_name.str)) - { - is_tmp_table= TRUE; - break; - } - } if (create_info->tmp_table()) { - /* CREATE TEMPORARY TABLE LIKE must be skipped from replication */ WSREP_DEBUG("CREATE TEMPORARY TABLE LIKE... skipped replication\n %s", thd->query()); } - else if (!is_tmp_table) + else if (!(thd->find_temporary_table(src_table))) { /* this is straight CREATE TABLE LIKE... eith no tmp tables */ WSREP_TO_ISOLATION_BEGIN(table->db, table->table_name, NULL); @@ -2478,7 +2502,7 @@ bool wsrep_create_like_table(THD* thd, TABLE_LIST* table, bzero((void*) &tbl, sizeof(tbl)); tbl.db= src_table->db; tbl.table_name= tbl.alias= src_table->table_name; - tbl.table= tmp_table; + tbl.table= src_table->table; char buf[2048]; String query(buf, sizeof(buf), system_charset_info); query.length(0); // Have to zero it since constructor doesn't @@ -2503,7 +2527,7 @@ error: } -int wsrep_create_trigger_query(THD *thd, uchar** buf, size_t* buf_len) +static int wsrep_create_trigger_query(THD *thd, uchar** buf, size_t* buf_len) { LEX *lex= thd->lex; String stmt_query; diff --git a/sql/wsrep_mysqld.h b/sql/wsrep_mysqld.h index e91ed2302a2..ea81384da75 100644 --- a/sql/wsrep_mysqld.h +++ b/sql/wsrep_mysqld.h @@ -280,10 +280,7 @@ void wsrep_to_isolation_end(THD *thd); void wsrep_cleanup_transaction(THD *thd); int wsrep_to_buf_helper( THD* thd, const char *query, uint query_len, uchar** buf, size_t* buf_len); -int wsrep_create_sp(THD *thd, uchar** buf, size_t* buf_len); -int wsrep_create_trigger_query(THD *thd, uchar** buf, size_t* buf_len); int wsrep_create_event_query(THD *thd, uchar** buf, size_t* buf_len); -int wsrep_alter_event_query(THD *thd, uchar** buf, size_t* buf_len); extern bool wsrep_grant_mdl_exception(MDL_context *requestor_ctx, @@ -304,14 +301,12 @@ void wsrep_close_applier_threads(int count); void wsrep_wait_appliers_close(THD *thd); void wsrep_kill_mysql(THD *thd); void wsrep_close_threads(THD *thd); -int wsrep_create_sp(THD *thd, uchar** buf, size_t* buf_len); void wsrep_copy_query(THD *thd); bool wsrep_is_show_query(enum enum_sql_command command); void wsrep_replay_transaction(THD *thd); bool wsrep_create_like_table(THD* thd, TABLE_LIST* table, TABLE_LIST* src_table, HA_CREATE_INFO *create_info); -int wsrep_create_trigger_query(THD *thd, uchar** buf, size_t* buf_len); #else /* WITH_WSREP */ diff --git a/sql/wsrep_notify.cc b/sql/wsrep_notify.cc index e7d30d5a9c1..d1beb9c38d6 100644 --- a/sql/wsrep_notify.cc +++ b/sql/wsrep_notify.cc @@ -17,7 +17,6 @@ #include "wsrep_priv.h" #include "wsrep_utils.h" -const char* wsrep_notify_cmd=""; static const char* _status_str(wsrep_member_status_t status) { diff --git a/sql/wsrep_priv.h b/sql/wsrep_priv.h index 30dce78c1a4..e2dc526608f 100644 --- a/sql/wsrep_priv.h +++ b/sql/wsrep_priv.h @@ -40,8 +40,12 @@ extern wsrep_uuid_t local_uuid; extern wsrep_seqno_t local_seqno; // a helper function -void wsrep_sst_received(wsrep_t*, const wsrep_uuid_t&, wsrep_seqno_t, - const void*, size_t); +bool wsrep_sst_received (wsrep_t* const wsrep, + const wsrep_uuid_t& uuid, + const wsrep_seqno_t seqno, + const void* const state, + const size_t state_len, + const bool implicit); /*! SST thread signals init thread about sst completion */ void wsrep_sst_complete(const wsrep_uuid_t*, wsrep_seqno_t, bool); diff --git a/sql/wsrep_sst.cc b/sql/wsrep_sst.cc index 3ebbedaa04c..ba6bb18bf37 100644 --- a/sql/wsrep_sst.cc +++ b/sql/wsrep_sst.cc @@ -34,14 +34,8 @@ char wsrep_defaults_file[FN_REFLEN * 2 + 10 + sizeof(WSREP_SST_OPT_CONF) + sizeof(WSREP_SST_OPT_EXTRA_CONF)] = {0}; -const char* wsrep_sst_method = WSREP_SST_DEFAULT; -const char* wsrep_sst_receive_address = WSREP_SST_ADDRESS_AUTO; -const char* wsrep_sst_donor = ""; - char* wsrep_sst_auth = NULL; - // container for real auth string static const char* sst_auth_real = NULL; -my_bool wsrep_sst_donor_rejects_queries = FALSE; bool wsrep_sst_method_check (sys_var *self, THD* thd, set_var* var) { @@ -175,10 +169,9 @@ bool wsrep_sst_auth_update (sys_var *self, THD* thd, enum_var_type type) return sst_auth_real_set (wsrep_sst_auth); } -void wsrep_sst_auth_init (const char* value) +void wsrep_sst_auth_init () { - if (wsrep_sst_auth == value) wsrep_sst_auth = NULL; - if (value) sst_auth_real_set (value); + sst_auth_real_set(wsrep_sst_auth); } bool wsrep_sst_donor_check (sys_var *self, THD* thd, set_var* var) @@ -264,52 +257,110 @@ void wsrep_sst_complete (const wsrep_uuid_t* sst_uuid, mysql_mutex_unlock (&LOCK_wsrep_sst); } -void wsrep_sst_received (wsrep_t* const wsrep, - const wsrep_uuid_t& uuid, - wsrep_seqno_t const seqno, - const void* const state, - size_t const state_len) -{ - wsrep_get_SE_checkpoint(local_uuid, local_seqno); +/* + If wsrep provider is loaded, inform that the new state snapshot + has been received. Also update the local checkpoint. - if (memcmp(&local_uuid, &uuid, sizeof(wsrep_uuid_t)) || - local_seqno < seqno || seqno < 0) + @param wsrep [IN] wsrep handle + @param uuid [IN] Initial state UUID + @param seqno [IN] Initial state sequence number + @param state [IN] Always NULL, also ignored by wsrep provider (?) + @param state_len [IN] Always 0, also ignored by wsrep provider (?) + @param implicit [IN] Whether invoked implicitly due to SST + (true) or explicitly because if change + in wsrep_start_position by user (false). + @return false Success + true Error + +*/ +bool wsrep_sst_received (wsrep_t* const wsrep, + const wsrep_uuid_t& uuid, + const wsrep_seqno_t seqno, + const void* const state, + const size_t state_len, + const bool implicit) +{ + /* + To keep track of whether the local uuid:seqno should be updated. Also, note + that local state (uuid:seqno) is updated/checkpointed only after we get an + OK from wsrep provider. By doing so, the values remain consistent across + the server & wsrep provider. + */ + bool do_update= false; + + // Get the locally stored uuid:seqno. + if (wsrep_get_SE_checkpoint(local_uuid, local_seqno)) + { + return true; + } + + if (memcmp(&local_uuid, &uuid, sizeof(wsrep_uuid_t)) || + local_seqno < seqno) + { + do_update= true; + } + else if (local_seqno > seqno) + { + WSREP_WARN("SST position can't be set in past. Requested: %lld, Current: " + " %lld.", (long long)seqno, (long long)local_seqno); + /* + If we are here because of SET command, simply return true (error) instead of + aborting. + */ + if (implicit) { - wsrep_set_SE_checkpoint(uuid, seqno); - local_uuid = uuid; - local_seqno = seqno; + WSREP_WARN("Can't continue."); + unireg_abort(1); } - else if (local_seqno > seqno) + else { - WSREP_WARN("SST postion is in the past: %lld, current: %lld. " - "Can't continue.", - (long long)seqno, (long long)local_seqno); - unireg_abort(1); + return true; } + } #ifdef GTID_SUPPORT - wsrep_init_sidno(uuid); + wsrep_init_sidno(uuid); #endif /* GTID_SUPPORT */ - if (wsrep) - { - int const rcode(seqno < 0 ? seqno : 0); - wsrep_gtid_t const state_id = { - uuid, (rcode ? WSREP_SEQNO_UNDEFINED : seqno) - }; + if (wsrep) + { + int const rcode(seqno < 0 ? seqno : 0); + wsrep_gtid_t const state_id= {uuid, + (rcode ? WSREP_SEQNO_UNDEFINED : seqno)}; - wsrep->sst_received(wsrep, &state_id, state, state_len, rcode); + wsrep_status_t ret= wsrep->sst_received(wsrep, &state_id, state, + state_len, rcode); + + if (ret != WSREP_OK) + { + return true; } + } + + // Now is the good time to update the local state and checkpoint. + if (do_update) + { + if (wsrep_set_SE_checkpoint(uuid, seqno)) + { + return true; + } + + local_uuid= uuid; + local_seqno= seqno; + } + + return false; } // Let applier threads to continue -void wsrep_sst_continue () +bool wsrep_sst_continue () { if (sst_needed) { WSREP_INFO("Signalling provider to continue."); - wsrep_sst_received (wsrep, local_uuid, local_seqno, NULL, 0); + return wsrep_sst_received (wsrep, local_uuid, local_seqno, NULL, 0, true); } + return false; } struct sst_thread_arg @@ -340,6 +391,7 @@ static int sst_scan_uuid_seqno (const char* str, wsrep_uuid_t* uuid, wsrep_seqno_t* seqno) { int offt = wsrep_uuid_scan (str, strlen(str), uuid); + errno= 0; /* Reset the errno */ if (offt > 0 && strlen(str) > (unsigned int)offt && ':' == str[offt]) { *seqno = strtoll (str + offt + 1, NULL, 10); diff --git a/sql/wsrep_sst.h b/sql/wsrep_sst.h index 49dd5b39fad..460046bc4ad 100644 --- a/sql/wsrep_sst.h +++ b/sql/wsrep_sst.h @@ -55,15 +55,16 @@ extern const char* wsrep_sst_method; extern const char* wsrep_sst_receive_address; extern const char* wsrep_sst_donor; -extern char* wsrep_sst_auth; -extern my_bool wsrep_sst_donor_rejects_queries; +extern const char* wsrep_sst_auth; +extern my_bool wsrep_sst_donor_rejects_queries; /*! Synchronizes applier thread start with init thread */ extern void wsrep_sst_grab(); /*! Init thread waits for SST completion */ extern bool wsrep_sst_wait(); /*! Signals wsrep that initialization is complete, writesets can be applied */ -extern void wsrep_sst_continue(); +extern bool wsrep_sst_continue(); +extern void wsrep_sst_auth_init(); extern void wsrep_sst_auth_free(); extern void wsrep_SE_init_grab(); /*! grab init critical section */ @@ -75,7 +76,7 @@ extern void wsrep_SE_initialized(); /*! mark SE initialization complete */ #define wsrep_SE_initialized() do { } while(0) #define wsrep_SE_init_grab() do { } while(0) #define wsrep_SE_init_done() do { } while(0) -#define wsrep_sst_continue() do { } while(0) +#define wsrep_sst_continue() (0) #endif /* WITH_WSREP */ #endif /* WSREP_SST_H */ diff --git a/sql/wsrep_thd.cc b/sql/wsrep_thd.cc index 3835c925745..36768a37973 100644 --- a/sql/wsrep_thd.cc +++ b/sql/wsrep_thd.cc @@ -360,13 +360,10 @@ static void wsrep_replication_process(THD *thd) mysql_cond_broadcast(&COND_thread_count); mysql_mutex_unlock(&LOCK_thread_count); - TABLE *tmp; - while ((tmp = thd->temporary_tables)) + if(thd->has_thd_temporary_tables()) { - WSREP_WARN("Applier %lld, has temporary tables at exit: %s.%s", - (longlong) thd->thread_id, - (tmp->s) ? tmp->s->db.str : "void", - (tmp->s) ? tmp->s->table_name.str : "void"); + WSREP_WARN("Applier %lld has temporary tables at exit.", + thd->thread_id); } wsrep_return_from_bf_mode(thd, &shadow); DBUG_VOID_RETURN; diff --git a/sql/wsrep_utils.cc b/sql/wsrep_utils.cc index 56f1018deac..e7d60652355 100644 --- a/sql/wsrep_utils.cc +++ b/sql/wsrep_utils.cc @@ -414,7 +414,7 @@ process::wait () return err_; } -thd::thd (my_bool won) : init(), ptr(new THD) +thd::thd (my_bool won) : init(), ptr(new THD(0)) { if (ptr) { diff --git a/sql/wsrep_utils.h b/sql/wsrep_utils.h index 54235cf5273..e4f421930f4 100644 --- a/sql/wsrep_utils.h +++ b/sql/wsrep_utils.h @@ -19,7 +19,7 @@ #include "wsrep_priv.h" #include "wsrep_mysqld.h" -unsigned int wsrep_check_ip (const char* addr, bool *is_ipv6); +unsigned int wsrep_check_ip (const char* const addr, bool *is_ipv6); size_t wsrep_guess_ip (char* buf, size_t buf_len); namespace wsp { @@ -155,6 +155,7 @@ private: } bool parse_port(const char *port) { + errno= 0; /* Reset the errno */ m_port= strtol(port, NULL, 10); if (errno == EINVAL || errno == ERANGE) { diff --git a/sql/wsrep_var.cc b/sql/wsrep_var.cc index 9c01e54f48d..f48f08852dc 100644 --- a/sql/wsrep_var.cc +++ b/sql/wsrep_var.cc @@ -26,14 +26,6 @@ #include #include -const char* wsrep_provider = 0; -const char* wsrep_provider_options = 0; -const char* wsrep_cluster_address = 0; -const char* wsrep_cluster_name = 0; -const char* wsrep_node_name = 0; -const char* wsrep_node_address = 0; -const char* wsrep_node_incoming_address = 0; -const char* wsrep_start_position = 0; int wsrep_init_vars() { @@ -45,8 +37,6 @@ int wsrep_init_vars() wsrep_node_address = my_strdup("", MYF(MY_WME)); wsrep_node_incoming_address= my_strdup(WSREP_NODE_INCOMING_AUTO, MYF(MY_WME)); wsrep_start_position = my_strdup(WSREP_START_POSITION_ZERO, MYF(MY_WME)); - - global_system_variables.binlog_format=BINLOG_FORMAT_ROW; return 0; } @@ -81,32 +71,68 @@ bool wsrep_sync_wait_update (sys_var* self, THD* thd, enum_var_type var_type) return false; } -static int wsrep_start_position_verify (const char* start_str) + +/* + Verify the format of the given UUID:seqno. + + @return + true Fail + false Pass +*/ +static +bool wsrep_start_position_verify (const char* start_str) { size_t start_len; wsrep_uuid_t uuid; ssize_t uuid_len; + // Check whether it has minimum acceptable length. start_len = strlen (start_str); if (start_len < 34) - return 1; + return true; + /* + Parse the input to check whether UUID length is acceptable + and seqno has been provided. + */ uuid_len = wsrep_uuid_scan (start_str, start_len, &uuid); if (uuid_len < 0 || (start_len - uuid_len) < 2) - return 1; + return true; - if (start_str[uuid_len] != ':') // separator should follow UUID - return 1; + // Separator must follow the UUID. + if (start_str[uuid_len] != ':') + return true; char* endptr; wsrep_seqno_t const seqno __attribute__((unused)) // to avoid GCC warnings (strtoll(&start_str[uuid_len + 1], &endptr, 10)); - if (*endptr == '\0') return 0; // remaining string was seqno + // Remaining string was seqno. + if (*endptr == '\0') return false; - return 1; + return true; } + +static +bool wsrep_set_local_position(const char* const value, size_t length, + bool const sst) +{ + wsrep_uuid_t uuid; + size_t const uuid_len = wsrep_uuid_scan(value, length, &uuid); + wsrep_seqno_t const seqno = strtoll(value + uuid_len + 1, NULL, 10); + + if (sst) { + return wsrep_sst_received (wsrep, uuid, seqno, NULL, 0, false); + } else { + // initialization + local_uuid = uuid; + local_seqno = seqno; + } + return false; +} + + bool wsrep_start_position_check (sys_var *self, THD* thd, set_var* var) { char start_pos_buf[FN_REFLEN]; @@ -119,52 +145,52 @@ bool wsrep_start_position_check (sys_var *self, THD* thd, set_var* var) var->save_result.string_value.length); start_pos_buf[var->save_result.string_value.length]= 0; - if (!wsrep_start_position_verify(start_pos_buf)) return 0; + // Verify the format. + if (wsrep_start_position_verify(start_pos_buf)) return true; + + /* + As part of further verification, we try to update the value and catch + errors (if any). + */ + if (wsrep_set_local_position(var->save_result.string_value.str, + var->save_result.string_value.length, + true)) + { + goto err; + } + + return false; err: my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), var->var->name.str, var->save_result.string_value.str ? var->save_result.string_value.str : "NULL"); - return 1; -} - -static -void wsrep_set_local_position(const char* const value, bool const sst) -{ - size_t const value_len = strlen(value); - wsrep_uuid_t uuid; - size_t const uuid_len = wsrep_uuid_scan(value, value_len, &uuid); - wsrep_seqno_t const seqno = strtoll(value + uuid_len + 1, NULL, 10); - - if (sst) { - wsrep_sst_received (wsrep, uuid, seqno, NULL, 0); - } else { - // initialization - local_uuid = uuid; - local_seqno = seqno; - } + return true; } bool wsrep_start_position_update (sys_var *self, THD* thd, enum_var_type type) { - WSREP_INFO ("wsrep_start_position var submitted: '%s'", - wsrep_start_position); - // since this value passed wsrep_start_position_check, don't check anything - // here - wsrep_set_local_position (wsrep_start_position, true); - return 0; + // Print a confirmation that wsrep_start_position has been updated. + WSREP_INFO ("wsrep_start_position set to '%s'", wsrep_start_position); + return false; } -void wsrep_start_position_init (const char* val) +bool wsrep_start_position_init (const char* val) { if (NULL == val || wsrep_start_position_verify (val)) { WSREP_ERROR("Bad initial value for wsrep_start_position: %s", (val ? val : "")); - return; + return true; } - wsrep_set_local_position (val, false); + if (wsrep_set_local_position (val, strlen(val), false)) + { + WSREP_ERROR("Failed to set initial wsep_start_position: %s", val); + return true; + } + + return false; } static bool refresh_provider_options() @@ -330,14 +356,14 @@ bool wsrep_cluster_address_check (sys_var *self, THD* thd, set_var* var) char addr_buf[FN_REFLEN]; if ((! var->save_result.string_value.str) || - (var->save_result.string_value.length > (FN_REFLEN - 1))) // safety + (var->save_result.string_value.length >= sizeof(addr_buf))) // safety goto err; - memcpy(addr_buf, var->save_result.string_value.str, - var->save_result.string_value.length); - addr_buf[var->save_result.string_value.length]= 0; + strmake(addr_buf, var->save_result.string_value.str, + MY_MIN(sizeof(addr_buf)-1, var->save_result.string_value.length)); - if (!wsrep_cluster_address_verify(addr_buf)) return 0; + if (!wsrep_cluster_address_verify(addr_buf)) + return 0; err: my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), var->var->name.str, @@ -348,7 +374,16 @@ bool wsrep_cluster_address_check (sys_var *self, THD* thd, set_var* var) bool wsrep_cluster_address_update (sys_var *self, THD* thd, enum_var_type type) { - bool wsrep_on_saved= thd->variables.wsrep_on; + bool wsrep_on_saved; + + /* Do not proceed if wsrep provider is not loaded. */ + if (!wsrep) + { + WSREP_INFO("wsrep provider is not loaded, can't re(start) replication."); + return false; + } + + wsrep_on_saved= thd->variables.wsrep_on; thd->variables.wsrep_on= false; /* stop replication is heavy operation, and includes closing all client @@ -386,8 +421,8 @@ void wsrep_cluster_address_init (const char* value) (wsrep_cluster_address) ? wsrep_cluster_address : "null", (value) ? value : "null"); - if (wsrep_cluster_address) my_free ((void*)wsrep_cluster_address); - wsrep_cluster_address = (value) ? my_strdup(value, MYF(0)) : NULL; + my_free((void*) wsrep_cluster_address); + wsrep_cluster_address= my_strdup(value ? value : "", MYF(0)); } /* wsrep_cluster_name cannot be NULL or an empty string. */ diff --git a/sql/wsrep_var.h b/sql/wsrep_var.h index 377b54f2d18..0eccf64edb8 100644 --- a/sql/wsrep_var.h +++ b/sql/wsrep_var.h @@ -48,7 +48,7 @@ extern bool wsrep_on_update UPDATE_ARGS; extern bool wsrep_sync_wait_update UPDATE_ARGS; extern bool wsrep_start_position_check CHECK_ARGS; extern bool wsrep_start_position_update UPDATE_ARGS; -extern void wsrep_start_position_init INIT_ARGS; +extern bool wsrep_start_position_init INIT_ARGS; extern bool wsrep_provider_check CHECK_ARGS; extern bool wsrep_provider_update UPDATE_ARGS; @@ -81,7 +81,6 @@ extern bool wsrep_sst_receive_address_update UPDATE_ARGS; extern bool wsrep_sst_auth_check CHECK_ARGS; extern bool wsrep_sst_auth_update UPDATE_ARGS; -extern void wsrep_sst_auth_init INIT_ARGS; extern bool wsrep_sst_donor_check CHECK_ARGS; extern bool wsrep_sst_donor_update UPDATE_ARGS; @@ -98,7 +97,6 @@ extern bool wsrep_desync_update UPDATE_ARGS; #define wsrep_provider_init(X) #define wsrep_init_vars() (0) #define wsrep_start_position_init(X) -#define wsrep_sst_auth_init(X) #endif /* WITH_WSREP */ #endif /* WSREP_VAR_H */ diff --git a/sql/wsrep_xid.cc b/sql/wsrep_xid.cc index 133e9cba825..876f791da69 100644 --- a/sql/wsrep_xid.cc +++ b/sql/wsrep_xid.cc @@ -89,16 +89,17 @@ static my_bool set_SE_checkpoint(THD* unused, plugin_ref plugin, void* arg) return FALSE; } -void wsrep_set_SE_checkpoint(XID& xid) +bool wsrep_set_SE_checkpoint(XID& xid) { - plugin_foreach(NULL, set_SE_checkpoint, MYSQL_STORAGE_ENGINE_PLUGIN, &xid); + return plugin_foreach(NULL, set_SE_checkpoint, MYSQL_STORAGE_ENGINE_PLUGIN, + &xid); } -void wsrep_set_SE_checkpoint(const wsrep_uuid_t& uuid, wsrep_seqno_t seqno) +bool wsrep_set_SE_checkpoint(const wsrep_uuid_t& uuid, wsrep_seqno_t seqno) { XID xid; wsrep_xid_init(&xid, uuid, seqno); - wsrep_set_SE_checkpoint(xid); + return wsrep_set_SE_checkpoint(xid); } static my_bool get_SE_checkpoint(THD* unused, plugin_ref plugin, void* arg) @@ -118,12 +119,13 @@ static my_bool get_SE_checkpoint(THD* unused, plugin_ref plugin, void* arg) return FALSE; } -void wsrep_get_SE_checkpoint(XID& xid) +bool wsrep_get_SE_checkpoint(XID& xid) { - plugin_foreach(NULL, get_SE_checkpoint, MYSQL_STORAGE_ENGINE_PLUGIN, &xid); + return plugin_foreach(NULL, get_SE_checkpoint, MYSQL_STORAGE_ENGINE_PLUGIN, + &xid); } -void wsrep_get_SE_checkpoint(wsrep_uuid_t& uuid, wsrep_seqno_t& seqno) +bool wsrep_get_SE_checkpoint(wsrep_uuid_t& uuid, wsrep_seqno_t& seqno) { uuid= WSREP_UUID_UNDEFINED; seqno= WSREP_SEQNO_UNDEFINED; @@ -132,16 +134,24 @@ void wsrep_get_SE_checkpoint(wsrep_uuid_t& uuid, wsrep_seqno_t& seqno) memset(&xid, 0, sizeof(xid)); xid.formatID= -1; - wsrep_get_SE_checkpoint(xid); + if (wsrep_get_SE_checkpoint(xid)) + { + return true; + } - if (xid.formatID == -1) return; // nil XID + if (xid.formatID == -1) // nil XID + { + return false; + } if (!wsrep_is_wsrep_xid(&xid)) { WSREP_WARN("Read non-wsrep XID from storage engines."); - return; + return false; } uuid= *wsrep_xid_uuid(xid); seqno= wsrep_xid_seqno(xid); + + return false; } diff --git a/sql/wsrep_xid.h b/sql/wsrep_xid.h index c3cad0231d7..5b33a904de1 100644 --- a/sql/wsrep_xid.h +++ b/sql/wsrep_xid.h @@ -28,9 +28,9 @@ const wsrep_uuid_t* wsrep_xid_uuid(const XID&); wsrep_seqno_t wsrep_xid_seqno(const XID&); //void wsrep_get_SE_checkpoint(XID&); /* uncomment if needed */ -void wsrep_get_SE_checkpoint(wsrep_uuid_t&, wsrep_seqno_t&); +bool wsrep_get_SE_checkpoint(wsrep_uuid_t&, wsrep_seqno_t&); //void wsrep_set_SE_checkpoint(XID&); /* uncomment if needed */ -void wsrep_set_SE_checkpoint(const wsrep_uuid_t&, wsrep_seqno_t); +bool wsrep_set_SE_checkpoint(const wsrep_uuid_t&, wsrep_seqno_t); #endif /* WITH_WSREP */ #endif /* WSREP_UTILS_H */ diff --git a/storage/archive/azio.c b/storage/archive/azio.c index c1efe19e91f..cc2140e838e 100644 --- a/storage/archive/azio.c +++ b/storage/archive/azio.c @@ -220,7 +220,7 @@ int write_header(azio_stream *s) AZHEADER_SIZE + AZMETA_BUFFER_SIZE); /* FRM position */ *(ptr + AZ_DIRTY_POS)= (unsigned char)s->dirty; /* Start of Data Block Index Block */ - /* Always begin at the begining, and end there as well */ + /* Always begin at the beginning, and end there as well */ return my_pwrite(s->file, (uchar*) buffer, AZHEADER_SIZE + AZMETA_BUFFER_SIZE, 0, MYF(MY_NABP)) ? 1 : 0; } diff --git a/storage/connect/.gitignore b/storage/connect/.gitignore new file mode 100644 index 00000000000..e2fa07ee143 --- /dev/null +++ b/storage/connect/.gitignore @@ -0,0 +1,264 @@ +# Edited by Olivier Bertrand +*-t +*.a +*.ctest +*.o +*.reject +*.so +*.so.* +*.spec +*~ +*.bak +*.log +*.cmake +*.tgz +*.msg +.*.swp +*.ninja +.ninja_* +.gdb_history + +CMakeFiles/ +connect.dir/ +connect.dir-Copie/ +Debug/ +MinSizeRel/ +Release/ +RelWithDebInfo/ + +# C and C++ + +# Compiled Object files +*.slo +*.lo +*.o +*.ko +*.obj +*.elf +*.exp +*.manifest +*.dep +*.idb +*.res + +# Precompiled Headers +*.gch +*.pch + +# Compiled Static libraries +*.lib +*.a +*.la +*.lai +*.lo + +# Compiled Dynamic libraries +*.so +*.so.* +*.dylib +*.dll + +# Executables +*.exe +*.out +*.app +*.i*86 +*.x86_64 +*.hex + + +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates +*.ncb +*.sln + +*.vcproj +*.vcproj.* +*.vcproj.*.* +*.vcproj.*.*.* +*.vcxproj +*.vcxproj.* +*.vcxproj.*.* +*.vcxproj.*.*.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +build/ +bld/ +[Bb]in/ +[Oo]bj/ + +# Roslyn cache directories +*.ide/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +#NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding addin-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# If using the old MSBuild-Integrated Package Restore, uncomment this: +#!**/packages/repositories.config + +# Windows Azure Build Output +csx/ +*.build.csdef + +# Windows Store app package directory +AppPackages/ + +# Others +# sql/ +*.Cache +ClientBin/ +[Ss]tyle[Cc]op.* +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.pfx +*.publishsettings +node_modules/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ diff --git a/storage/connect/CMakeLists.txt b/storage/connect/CMakeLists.txt index f6b42e7f360..c6b808acc60 100644 --- a/storage/connect/CMakeLists.txt +++ b/storage/connect/CMakeLists.txt @@ -45,6 +45,7 @@ add_definitions( -DHUGE_SUPPORT -DZIP_SUPPORT -DPIVOT_SUPPORT ) # OS specific C flags, definitions and source files. # IF(UNIX) + if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") # Bar: -Wfatal-errors removed (does not present in gcc on solaris10) if(WITH_WARNINGS) add_definitions(-Wall -Wextra -Wmissing-declarations) @@ -71,6 +72,7 @@ IF(UNIX) #message(STATUS "CONNECT: GCC: Some warnings disabled") endif(WITH_WARNINGS) + endif() add_definitions( -DUNIX -DLINUX -DUBUNTU ) @@ -126,37 +128,10 @@ IF(WIN32) OPTION(CONNECT_WITH_MSXML "Compile CONNECT storage engine with MSXML support" ON) IF(CONNECT_WITH_MSXML) - find_library(MSXML_LIBRARY - NAMES msxml6 msxml4 msxml3 msxml2 - PATHS - "C:/Program Files/Microsoft SDKs/Windows/v7.0A/Lib" - "C:/Program Files/Microsoft SDKs/Windows/v6.0A/Lib" - "C:/Program Files (x86)/Microsoft SDKs/Windows/v7.0A/Lib" - DOC "Specify the MSXML? library here." - ) - IF(MSXML_LIBRARY MATCHES .*msxml6[.].*) - add_definitions(-DMSX6 -DDOMDOC_SUPPORT) - message(STATUS "MSXML library version: msxml6") - SET(MSXML_FOUND 1) - SET(CONNECT_SOURCES ${CONNECT_SOURCES} domdoc.cpp domdoc.h) - ELSEIF(MSXML_LIBRARY MATCHES .*msxml4[.].*) - add_definitions(-DMSX4 -DDOMDOC_SUPPORT) - message("MSXML library version: msxml4") - SET(MSXML_FOUND 1) - SET(CONNECT_SOURCES ${CONNECT_SOURCES} domdoc.cpp domdoc.h) - ELSEIF(MSXML_LIBRARY MATCHES .*msxml3[.].*) - message("MSXML library version: msxml3") - add_definitions(-DMSX3 -DDOMDOC_SUPPORT) - SET(MSXML_FOUND 1) - SET(CONNECT_SOURCES ${CONNECT_SOURCES} domdoc.cpp domdoc.h) - ELSEIF(MSXML_LIBRARY MATCHES .*msxml2[.].*) - message("MSXML library version: msxml2") - add_definitions(-DMXS2 -DDOMDOC_SUPPORT) - SET(MSXML_FOUND 1) - SET(CONNECT_SOURCES ${CONNECT_SOURCES} domdoc.cpp domdoc.h) - ELSE() - message(STATUS "msxml? library not found") - ENDIF() + add_definitions(-DMSX6 -DDOMDOC_SUPPORT) + message(STATUS "MSXML library version: msxml6") + SET(MSXML_FOUND 1) + SET(CONNECT_SOURCES ${CONNECT_SOURCES} domdoc.cpp domdoc.h) ENDIF(CONNECT_WITH_MSXML) ENDIF(WIN32) @@ -257,6 +232,34 @@ int main() { ENDIF(UNIX) ENDIF(CONNECT_WITH_ODBC) +# +# JDBC +# + +OPTION(CONNECT_WITH_JDBC "Compile CONNECT storage engine with JDBC support" ON) + +IF(CONNECT_WITH_JDBC) + # TODO: detect Java SDK and the presence of JDBC connectors + # TODO: Find how to compile and install the java wrapper class + # Find required libraries and include directories + + FIND_PACKAGE(Java 1.6) + FIND_PACKAGE(JNI) + IF (JAVA_FOUND AND JNI_FOUND) + INCLUDE_DIRECTORIES(${JAVA_INCLUDE_PATH}) + INCLUDE_DIRECTORIES(${JAVA_INCLUDE_PATH2}) + # SET(JDBC_LIBRARY ${JAVA_JVM_LIBRARY}) + SET(CONNECT_SOURCES ${CONNECT_SOURCES} + JdbcInterface.java JdbcInterface.class + JdbcDSInterface.java JdbcDSInterface.class + JdbcApacheInterface.java JdbcApacheInterface.class + jdbconn.cpp tabjdbc.cpp jdbconn.h tabjdbc.h jdbccat.h) + add_definitions(-DJDBC_SUPPORT) + ELSE() + SET(JDBC_LIBRARY "") + ENDIF() +ENDIF(CONNECT_WITH_JDBC) + # # XMAP @@ -277,5 +280,5 @@ MYSQL_ADD_PLUGIN(connect ${CONNECT_SOURCES} COMPONENT connect-engine RECOMPILE_FOR_EMBEDDED LINK_LIBRARIES ${ZLIB_LIBRARY} ${XML_LIBRARY} ${ICONV_LIBRARY} - ${ODBC_LIBRARY} ${IPHLPAPI_LIBRARY}) + ${ODBC_LIBRARY} ${JDBC_LIBRARY} ${IPHLPAPI_LIBRARY}) diff --git a/storage/connect/JdbcApacheInterface.class b/storage/connect/JdbcApacheInterface.class new file mode 100644 index 00000000000..acd4258e3d3 Binary files /dev/null and b/storage/connect/JdbcApacheInterface.class differ diff --git a/storage/connect/JdbcApacheInterface.java b/storage/connect/JdbcApacheInterface.java new file mode 100644 index 00000000000..fdbc5bff203 --- /dev/null +++ b/storage/connect/JdbcApacheInterface.java @@ -0,0 +1,709 @@ +import java.math.*; +import java.sql.*; +import java.util.Collections; +import java.util.Hashtable; +import java.util.List; + +import org.apache.commons.dbcp2.BasicDataSource; + +public class JdbcApacheInterface { + boolean DEBUG = false; + String Errmsg = "No error"; + Connection conn = null; + DatabaseMetaData dbmd = null; + Statement stmt = null; + PreparedStatement pstmt = null; + ResultSet rs = null; + ResultSetMetaData rsmd = null; + static Hashtable pool = new Hashtable(); + + // === Constructors/finalize ========================================= + public JdbcApacheInterface() { + this(true); + } // end of default constructor + + public JdbcApacheInterface(boolean b) { + DEBUG = b; + } // end of constructor + + private void SetErrmsg(Exception e) { + if (DEBUG) + System.out.println(e.getMessage()); + + Errmsg = e.toString(); + } // end of SetErrmsg + + private void SetErrmsg(String s) { + if (DEBUG) + System.out.println(s); + + Errmsg = s; + } // end of SetErrmsg + + public String GetErrmsg() { + String err = Errmsg; + + Errmsg = "No error"; + return err; + } // end of GetErrmsg + + public int JdbcConnect(String[] parms, int fsize, boolean scrollable) { + int rc = 0; + String url = parms[1]; + BasicDataSource ds = null; + + if (url == null) { + SetErrmsg("URL cannot be null"); + return -1; + } // endif url + + try { + if ((ds = pool.get(url)) == null) { + ds = new BasicDataSource(); + ds.setDriverClassName(parms[0]); + ds.setUrl(url); + ds.setUsername(parms[2]); + ds.setPassword(parms[3]); + pool.put(url, ds); + } // endif ds + + // Get a connection from the data source + conn = ds.getConnection(); + + // Get the data base meta data object + dbmd = conn.getMetaData(); + + // Get a statement from the connection + if (scrollable) + stmt = conn.createStatement(java.sql.ResultSet.TYPE_SCROLL_INSENSITIVE, java.sql.ResultSet.CONCUR_READ_ONLY); + else + stmt = conn.createStatement(java.sql.ResultSet.TYPE_FORWARD_ONLY, java.sql.ResultSet.CONCUR_READ_ONLY); + + if (DEBUG) + System.out.println("Statement type = " + stmt.getResultSetType() + + " concurrency = " + stmt.getResultSetConcurrency()); + + if (DEBUG) // Get the fetch size of a statement + System.out.println("Default fetch size = " + stmt.getFetchSize()); + + if (fsize != 0) { + // Set the fetch size + stmt.setFetchSize(fsize); + + if (DEBUG) + System.out.println("New fetch size = " + stmt.getFetchSize()); + + } // endif fsize + + } catch (SQLException se) { + SetErrmsg(se); + rc = -2; + } catch( Exception e ) { + SetErrmsg(e); + rc = -3; + } // end try/catch + + return rc; + } // end of JdbcConnect + + public int CreatePrepStmt(String sql) { + int rc = 0; + + try { + pstmt = conn.prepareStatement(sql); + } catch (SQLException se) { + SetErrmsg(se); + rc = -1; + } catch (Exception e) { + SetErrmsg(e); + rc = -2; + } // end try/catch + + return rc; + } // end of CreatePrepStmt + + public void SetStringParm(int i, String s) { + try { + pstmt.setString(i, s); + } catch (Exception e) { + SetErrmsg(e); + } // end try/catch + + } // end of SetStringParm + + public void SetIntParm(int i, int n) { + try { + pstmt.setInt(i, n); + } catch (Exception e) { + SetErrmsg(e); + } // end try/catch + + } // end of SetIntParm + + public void SetShortParm(int i, short n) { + try { + pstmt.setShort(i, n); + } catch (Exception e) { + SetErrmsg(e); + } // end try/catch + + } // end of SetShortParm + + public void SetBigintParm(int i, long n) { + try { + pstmt.setLong(i, n); + } catch (Exception e) { + SetErrmsg(e); + } // end try/catch + + } // end of SetBigintParm + + public void SetFloatParm(int i, float f) { + try { + pstmt.setFloat(i, f); + } catch (Exception e) { + SetErrmsg(e); + } // end try/catch + + } // end of SetFloatParm + + public void SetDoubleParm(int i, double d) { + try { + pstmt.setDouble(i, d); + } catch (Exception e) { + SetErrmsg(e); + } // end try/catch + + } // end of SetDoubleParm + + public void SetTimestampParm(int i, Timestamp t) { + try { + pstmt.setTimestamp(i, t); + } catch (Exception e) { + SetErrmsg(e); + } // end try/catch + + } // end of SetTimestampParm + + public int ExecutePrep() { + int n = -3; + + if (pstmt != null) try { + n = pstmt.executeUpdate(); + } catch (SQLException se) { + SetErrmsg(se); + n = -1; + } catch (Exception e) { + SetErrmsg(e); + n = -2; + } //end try/catch + + return n; + } // end of ExecutePrep + + public boolean ClosePrepStmt() { + boolean b = false; + + if (pstmt != null) try { + pstmt.close(); + pstmt = null; + } catch (SQLException se) { + SetErrmsg(se); + b = true; + } catch (Exception e) { + SetErrmsg(e); + b = true; + } // end try/catch + + return b; + } // end of ClosePrepStmt + + public int JdbcDisconnect() { + int rc = 0; + + // Cancel pending statement + if (stmt != null) + try { + System.out.println("Cancelling statement"); + stmt.cancel(); + } catch(SQLException se) { + SetErrmsg(se); + rc += 1; + } // nothing more we can do + + // Close the statement and the connection + if (rs != null) + try { + if (DEBUG) + System.out.println("Closing result set"); + + rs.close(); + } catch(SQLException se) { + SetErrmsg(se); + rc = 2; + } // nothing more we can do + + if (stmt != null) + try { + if (DEBUG) + System.out.println("Closing statement"); + + stmt.close(); + } catch(SQLException se) { + SetErrmsg(se); + rc += 4; + } // nothing more we can do + + ClosePrepStmt(); + + if (conn != null) + try { + if (DEBUG) + System.out.println("Closing connection"); + + conn.close(); + } catch (SQLException se) { + SetErrmsg(se); + rc += 8; + } //end try/catch + + if (DEBUG) + System.out.println("All closed"); + + return rc; + } // end of JdbcDisconnect + + public int GetMaxValue(int n) { + int m = 0; + + try { + switch (n) { + case 1: // Max columns in table + m = dbmd.getMaxColumnsInTable(); + break; + case 2: // Max catalog name length + m = dbmd.getMaxCatalogNameLength(); + break; + case 3: // Max schema name length + m = dbmd.getMaxSchemaNameLength(); + break; + case 4: // Max table name length + m = dbmd.getMaxTableNameLength(); + break; + case 5: // Max column name length + m = dbmd.getMaxColumnNameLength(); + break; + } // endswitch n + + } catch(Exception e) { + SetErrmsg(e); + m = -1; + } // end try/catch + + return m; + } // end of GetMaxValue + + public int GetColumns(String[] parms) { + int ncol = 0; + + try { + if (rs != null) rs.close(); + rs = dbmd.getColumns(parms[0], parms[1], parms[2], parms[3]); + + if (rs != null) { + rsmd = rs.getMetaData(); + ncol = rsmd.getColumnCount(); + } // endif rs + + } catch(SQLException se) { + SetErrmsg(se); + } // end try/catch + + return ncol; + } // end of GetColumns + + public int GetTables(String[] parms) { + int ncol = 0; + String[] typ = null; + + if (parms[3] != null) { + typ = new String[1]; + typ[0] = parms[3]; + } // endif parms + + try { + if (rs != null) rs.close(); + rs = dbmd.getTables(parms[0], parms[1], parms[2], typ); + + if (rs != null) { + rsmd = rs.getMetaData(); + ncol = rsmd.getColumnCount(); + } // endif rs + + } catch(SQLException se) { + SetErrmsg(se); + } // end try/catch + + return ncol; + } // end of GetColumns + + public int Execute(String query) { + int n = 0; + + if (DEBUG) + System.out.println("Executing '" + query + "'"); + + try { + boolean b = stmt.execute(query); + + if (b == false) { + n = stmt.getUpdateCount(); + if (rs != null) rs.close(); + } // endif b + + if (DEBUG) + System.out.println("Query '" + query + "' executed: n = " + n); + + } catch (SQLException se) { + SetErrmsg(se); + n = -1; + } catch (Exception e) { + SetErrmsg(e); + n = -2; + } //end try/catch + + return n; + } // end of Execute + + public int GetResult() { + int ncol = 0; + + try { + rs = stmt.getResultSet(); + + if (rs != null) { + rsmd = rs.getMetaData(); + ncol = rsmd.getColumnCount(); + + if (DEBUG) + System.out.println("Result set has " + rsmd.getColumnCount() + " column(s)"); + + } // endif rs + + } catch (SQLException se) { + SetErrmsg(se); + ncol = -1; + } catch (Exception e) { + SetErrmsg(e); + ncol = -2; + } //end try/catch + + return ncol; + } // end of GetResult + + public int ExecuteQuery(String query) { + int ncol = 0; + + if (DEBUG) + System.out.println("Executing query '" + query + "'"); + + try { + rs = stmt.executeQuery(query); + rsmd = rs.getMetaData(); + ncol = rsmd.getColumnCount(); + + if (DEBUG) { + System.out.println("Query '" + query + "' executed successfully"); + System.out.println("Result set has " + rsmd.getColumnCount() + " column(s)"); + } // endif DEBUG + + } catch (SQLException se) { + SetErrmsg(se); + ncol = -1; + } catch (Exception e) { + SetErrmsg(e); + ncol = -2; + } //end try/catch + + return ncol; + } // end of ExecuteQuery + + public int ExecuteUpdate(String query) { + int n = 0; + + if (DEBUG) + System.out.println("Executing update query '" + query + "'"); + + try { + n = stmt.executeUpdate(query); + + if (DEBUG) + System.out.println("Update Query '" + query + "' executed: n = " + n); + + } catch (SQLException se) { + SetErrmsg(se); + n = -1; + } catch (Exception e) { + SetErrmsg(e); + n = -2; + } //end try/catch + + return n; + } // end of ExecuteUpdate + + public int ReadNext() { + if (rs != null) { + try { + return rs.next() ? 1 : 0; + } catch (SQLException se) { + SetErrmsg(se); + return -1; + } //end try/catch + + } else + return 0; + + } // end of ReadNext + + public boolean Fetch(int row) { + if (rs != null) { + try { + return rs.absolute(row); + } catch (SQLException se) { + SetErrmsg(se); + return false; + } //end try/catch + + } else + return false; + + } // end of Fetch + + public String ColumnName(int n) { + if (rsmd == null) { + System.out.println("No result metadata"); + } else try { + return rsmd.getColumnLabel(n); + } catch (SQLException se) { + SetErrmsg(se); + } //end try/catch + + return null; + } // end of ColumnName + + public int ColumnType(int n, String name) { + if (rsmd == null) { + System.out.println("No result metadata"); + } else try { + if (n == 0) + n = rs.findColumn(name); + + return rsmd.getColumnType(n); + } catch (SQLException se) { + SetErrmsg(se); + } //end try/catch + + return 666; // Not a type + } // end of ColumnType + + public String ColumnDesc(int n, int[] val) { + if (rsmd == null) { + System.out.println("No result metadata"); + return null; + } else try { + val[0] = rsmd.getColumnType(n); + val[1] = rsmd.getPrecision(n); + val[2] = rsmd.getScale(n); + val[3] = rsmd.isNullable(n); + return rsmd.getColumnLabel(n); + } catch (SQLException se) { + SetErrmsg(se); + } //end try/catch + + return null; + } // end of ColumnDesc + + public String StringField(int n, String name) { + if (rs == null) { + System.out.println("No result set"); + } else try { + return (n > 0) ? rs.getString(n) : rs.getString(name); + } catch (SQLException se) { + SetErrmsg(se); + } //end try/catch + + return null; + } // end of StringField + + public int IntField(int n, String name) { + if (rs == null) { + System.out.println("No result set"); + } else try { + return (n > 0) ? rs.getInt(n) : rs.getInt(name); + } catch (SQLException se) { + SetErrmsg(se); + } //end try/catch + + return 0; + } // end of IntField + + public long BigintField(int n, String name) { + if (rs == null) { + System.out.println("No result set"); + } else try { + BigDecimal bigDecimal = (n > 0) ? rs.getBigDecimal(n) : rs.getBigDecimal(name); + return bigDecimal != null ? bigDecimal.longValue() : 0; + } catch (SQLException se) { + SetErrmsg(se); + } //end try/catch + + return 0; + } // end of BiginttField + + public double DoubleField(int n, String name) { + if (rs == null) { + System.out.println("No result set"); + } else try { + return (n > 0) ? rs.getDouble(n) : rs.getDouble(name); + } catch (SQLException se) { + SetErrmsg(se); + } //end try/catch + + return 0.; + } // end of DoubleField + + public float FloatField(int n, String name) { + if (rs == null) { + System.out.println("No result set"); + } else try { + return (n > 0) ? rs.getFloat(n) : rs.getFloat(name); + } catch (SQLException se) { + SetErrmsg(se); + } //end try/catch + + return 0; + } // end of FloatField + + public boolean BooleanField(int n, String name) { + if (rs == null) { + System.out.println("No result set"); + } else try { + return (n > 0) ? rs.getBoolean(n) : rs.getBoolean(name); + } catch (SQLException se) { + SetErrmsg(se); + } //end try/catch + + return false; + } // end of BooleanField + + public Date DateField(int n, String name) { + if (rs == null) { + System.out.println("No result set"); + } else try { + return (n > 0) ? rs.getDate(n) : rs.getDate(name); + } catch (SQLException se) { + SetErrmsg(se); + } //end try/catch + + return null; + } // end of DateField + + public Time TimeField(int n, String name) { + if (rs == null) { + System.out.println("No result set"); + } else try { + return (n > 0) ? rs.getTime(n) : rs.getTime(name); + } catch (SQLException se) { + SetErrmsg(se); + } //end try/catch + + return null; + } // end of TimeField + + public Timestamp TimestampField(int n, String name) { + if (rs == null) { + System.out.println("No result set"); + } else try { + return (n > 0) ? rs.getTimestamp(n) : rs.getTimestamp(name); + } catch (SQLException se) { + SetErrmsg(se); + } //end try/catch + + return null; + } // end of TimestampField + + public String ObjectField(int n, String name) { + if (rs == null) { + System.out.println("No result set"); + } else try { + return (n > 0) ? rs.getObject(n).toString() : rs.getObject(name).toString(); + } catch (SQLException se) { + SetErrmsg(se); + } //end try/catch + + return null; + } // end of ObjectField + + public int GetDrivers(String[] s, int mxs) { + int n = 0; + List drivers = Collections.list(DriverManager.getDrivers()); + int size = Math.min(mxs, drivers.size()); + + for (int i = 0; i < size; i++) { + Driver driver = (Driver)drivers.get(i); + + // Get name of driver + s[n++] = driver.getClass().getName(); + + // Get version info + s[n++] = driver.getMajorVersion() + "." + driver.getMinorVersion(); + s[n++] = driver.jdbcCompliant() ? "Yes" : "No"; + s[n++] = driver.toString(); + } // endfor i + + return size; + } // end of GetDrivers + + /** + * Adds the specified path to the java library path + * from Fahd Shariff blog + * + * @param pathToAdd the path to add + static public int addLibraryPath(String pathToAdd) { + System.out.println("jpath = " + pathToAdd); + + try { + Field usrPathsField = ClassLoader.class.getDeclaredField("usr_paths"); + usrPathsField.setAccessible(true); + + //get array of paths + String[] paths = (String[])usrPathsField.get(null); + + //check if the path to add is already present + for (String path : paths) { + System.out.println("path = " + path); + + if (path.equals(pathToAdd)) + return -5; + + } // endfor path + + //add the new path + String[] newPaths = Arrays.copyOf(paths, paths.length + 1); + newPaths[paths.length] = pathToAdd; + usrPathsField.set(null, newPaths); + System.setProperty("java.library.path", + System.getProperty("java.library.path") + File.pathSeparator + pathToAdd); + Field fieldSysPath = ClassLoader.class.getDeclaredField("sys_paths"); + fieldSysPath.setAccessible(true); + fieldSysPath.set(null, null); + } catch (Exception e) { + SetErrmsg(e); + return -1; + } // end try/catch + + return 0; + } // end of addLibraryPath + */ + +} // end of class JdbcApacheInterface diff --git a/storage/connect/JdbcDSInterface.class b/storage/connect/JdbcDSInterface.class new file mode 100644 index 00000000000..d56c04bd81f Binary files /dev/null and b/storage/connect/JdbcDSInterface.class differ diff --git a/storage/connect/JdbcDSInterface.java b/storage/connect/JdbcDSInterface.java new file mode 100644 index 00000000000..09f545bfb74 --- /dev/null +++ b/storage/connect/JdbcDSInterface.java @@ -0,0 +1,743 @@ +import java.math.*; +import java.sql.*; +import java.util.Collections; +import java.util.Hashtable; +import java.util.List; + +import javax.sql.DataSource; + +import org.mariadb.jdbc.MariaDbDataSource; +import org.postgresql.jdbc2.optional.PoolingDataSource; +import com.mysql.cj.jdbc.MysqlDataSource; +import oracle.jdbc.pool.OracleDataSource; + +public class JdbcDSInterface { + boolean DEBUG = false; + String Errmsg = "No error"; + Connection conn = null; + DatabaseMetaData dbmd = null; + Statement stmt = null; + PreparedStatement pstmt = null; + ResultSet rs = null; + ResultSetMetaData rsmd = null; + Hashtable dst = null; + + // === Constructors/finalize ========================================= + public JdbcDSInterface() { + this(true); + } // end of default constructor + + public JdbcDSInterface(boolean b) { + DEBUG = b; + dst = new Hashtable(); + } // end of constructor + + private void SetErrmsg(Exception e) { + if (DEBUG) + System.out.println(e.getMessage()); + + Errmsg = e.toString(); + } // end of SetErrmsg + + private void SetErrmsg(String s) { + if (DEBUG) + System.out.println(s); + + Errmsg = s; + } // end of SetErrmsg + + public String GetErrmsg() { + String err = Errmsg; + + Errmsg = "No error"; + return err; + } // end of GetErrmsg + + public int JdbcConnect(String[] parms, int fsize, boolean scrollable) { + int rc = 0; + String url = parms[1]; + DataSource ds = null; + MysqlDataSource mds = null; + MariaDbDataSource ads = null; + OracleDataSource ods = null; + PoolingDataSource pds = null; + + if (url == null) { + SetErrmsg("URL cannot be null"); + return -1; + } // endif driver + + try { + if ((ds = dst.get(url)) == null) { + if (url.toLowerCase().contains("mysql")) { + mds = new MysqlDataSource(); + mds.setURL(url); + mds.setUser(parms[2]); + mds.setPassword(parms[3]); + ds = mds; + } else if (url.toLowerCase().contains("mariadb")) { + ads = new MariaDbDataSource(); + ads.setUrl(url); + ads.setUser(parms[2]); + ads.setPassword(parms[3]); + ds = ads; + } else if (url.toLowerCase().contains("oracle")) { + ods = new OracleDataSource(); + ods.setURL(url); + ods.setUser(parms[2]); + ods.setPassword(parms[3]); + ds = ods; + } else if (url.toLowerCase().contains("postgresql")) { + pds = new PoolingDataSource(); + pds.setUrl(url); + pds.setUser(parms[2]); + pds.setPassword(parms[3]); + ds = pds; + } else { + SetErrmsg("Unsupported driver"); + return -4; + } // endif driver + + dst.put(url, ds); + } // endif ds + + // Get a connection from the data source + conn = ds.getConnection(); + + // Get the data base meta data object + dbmd = conn.getMetaData(); + + // Get a statement from the connection + if (scrollable) + stmt = conn.createStatement(java.sql.ResultSet.TYPE_SCROLL_INSENSITIVE, java.sql.ResultSet.CONCUR_READ_ONLY); + else + stmt = conn.createStatement(java.sql.ResultSet.TYPE_FORWARD_ONLY, java.sql.ResultSet.CONCUR_READ_ONLY); + + if (DEBUG) + System.out.println("Statement type = " + stmt.getResultSetType() + + " concurrency = " + stmt.getResultSetConcurrency()); + + if (DEBUG) // Get the fetch size of a statement + System.out.println("Default fetch size = " + stmt.getFetchSize()); + + if (fsize != 0) { + // Set the fetch size + stmt.setFetchSize(fsize); + + if (DEBUG) + System.out.println("New fetch size = " + stmt.getFetchSize()); + + } // endif fsize + + } catch (SQLException se) { + SetErrmsg(se); + rc = -2; + } catch( Exception e ) { + SetErrmsg(e); + rc = -3; + } // end try/catch + + return rc; + } // end of JdbcConnect + + public int CreatePrepStmt(String sql) { + int rc = 0; + + try { + pstmt = conn.prepareStatement(sql); + } catch (SQLException se) { + SetErrmsg(se); + rc = -1; + } catch (Exception e) { + SetErrmsg(e); + rc = -2; + } // end try/catch + + return rc; + } // end of CreatePrepStmt + + public void SetStringParm(int i, String s) { + try { + pstmt.setString(i, s); + } catch (Exception e) { + SetErrmsg(e); + } // end try/catch + + } // end of SetStringParm + + public void SetIntParm(int i, int n) { + try { + pstmt.setInt(i, n); + } catch (Exception e) { + SetErrmsg(e); + } // end try/catch + + } // end of SetIntParm + + public void SetShortParm(int i, short n) { + try { + pstmt.setShort(i, n); + } catch (Exception e) { + SetErrmsg(e); + } // end try/catch + + } // end of SetShortParm + + public void SetBigintParm(int i, long n) { + try { + pstmt.setLong(i, n); + } catch (Exception e) { + SetErrmsg(e); + } // end try/catch + + } // end of SetBigintParm + + public void SetFloatParm(int i, float f) { + try { + pstmt.setFloat(i, f); + } catch (Exception e) { + SetErrmsg(e); + } // end try/catch + + } // end of SetFloatParm + + public void SetDoubleParm(int i, double d) { + try { + pstmt.setDouble(i, d); + } catch (Exception e) { + SetErrmsg(e); + } // end try/catch + + } // end of SetDoubleParm + + public void SetTimestampParm(int i, Timestamp t) { + try { + pstmt.setTimestamp(i, t); + } catch (Exception e) { + SetErrmsg(e); + } // end try/catch + + } // end of SetTimestampParm + + public int ExecutePrep() { + int n = -3; + + if (pstmt != null) try { + n = pstmt.executeUpdate(); + } catch (SQLException se) { + SetErrmsg(se); + n = -1; + } catch (Exception e) { + SetErrmsg(e); + n = -2; + } //end try/catch + + return n; + } // end of ExecutePrep + + public boolean ClosePrepStmt() { + boolean b = false; + + if (pstmt != null) try { + pstmt.close(); + pstmt = null; + } catch (SQLException se) { + SetErrmsg(se); + b = true; + } catch (Exception e) { + SetErrmsg(e); + b = true; + } // end try/catch + + return b; + } // end of ClosePrepStmt + + public int JdbcDisconnect() { + int rc = 0; + + // Cancel pending statement + if (stmt != null) + try { + System.out.println("Cancelling statement"); + stmt.cancel(); + } catch(SQLException se) { + SetErrmsg(se); + rc += 1; + } // nothing more we can do + + // Close the statement and the connection + if (rs != null) + try { + if (DEBUG) + System.out.println("Closing result set"); + + rs.close(); + } catch(SQLException se) { + SetErrmsg(se); + rc = 2; + } // nothing more we can do + + if (stmt != null) + try { + if (DEBUG) + System.out.println("Closing statement"); + + stmt.close(); + } catch(SQLException se) { + SetErrmsg(se); + rc += 4; + } // nothing more we can do + + ClosePrepStmt(); + + if (conn != null) + try { + if (DEBUG) + System.out.println("Closing connection"); + + conn.close(); + } catch (SQLException se) { + SetErrmsg(se); + rc += 8; + } //end try/catch + + if (DEBUG) + System.out.println("All closed"); + + return rc; + } // end of JdbcDisconnect + + public int GetMaxValue(int n) { + int m = 0; + + try { + switch (n) { + case 1: // Max columns in table + m = dbmd.getMaxColumnsInTable(); + break; + case 2: // Max catalog name length + m = dbmd.getMaxCatalogNameLength(); + break; + case 3: // Max schema name length + m = dbmd.getMaxSchemaNameLength(); + break; + case 4: // Max table name length + m = dbmd.getMaxTableNameLength(); + break; + case 5: // Max column name length + m = dbmd.getMaxColumnNameLength(); + break; + } // endswitch n + + } catch(Exception e) { + SetErrmsg(e); + m = -1; + } // end try/catch + + return m; + } // end of GetMaxValue + + public int GetColumns(String[] parms) { + int ncol = 0; + + try { + if (rs != null) rs.close(); + rs = dbmd.getColumns(parms[0], parms[1], parms[2], parms[3]); + + if (rs != null) { + rsmd = rs.getMetaData(); + ncol = rsmd.getColumnCount(); + } // endif rs + + } catch(SQLException se) { + SetErrmsg(se); + } // end try/catch + + return ncol; + } // end of GetColumns + + public int GetTables(String[] parms) { + int ncol = 0; + String[] typ = null; + + if (parms[3] != null) { + typ = new String[1]; + typ[0] = parms[3]; + } // endif parms + + try { + if (rs != null) rs.close(); + rs = dbmd.getTables(parms[0], parms[1], parms[2], typ); + + if (rs != null) { + rsmd = rs.getMetaData(); + ncol = rsmd.getColumnCount(); + } // endif rs + + } catch(SQLException se) { + SetErrmsg(se); + } // end try/catch + + return ncol; + } // end of GetColumns + + public int Execute(String query) { + int n = 0; + + if (DEBUG) + System.out.println("Executing '" + query + "'"); + + try { + boolean b = stmt.execute(query); + + if (b == false) { + n = stmt.getUpdateCount(); + if (rs != null) rs.close(); + } // endif b + + if (DEBUG) + System.out.println("Query '" + query + "' executed: n = " + n); + + } catch (SQLException se) { + SetErrmsg(se); + n = -1; + } catch (Exception e) { + SetErrmsg(e); + n = -2; + } //end try/catch + + return n; + } // end of Execute + + public int GetResult() { + int ncol = 0; + + try { + rs = stmt.getResultSet(); + + if (rs != null) { + rsmd = rs.getMetaData(); + ncol = rsmd.getColumnCount(); + + if (DEBUG) + System.out.println("Result set has " + rsmd.getColumnCount() + " column(s)"); + + } // endif rs + + } catch (SQLException se) { + SetErrmsg(se); + ncol = -1; + } catch (Exception e) { + SetErrmsg(e); + ncol = -2; + } //end try/catch + + return ncol; + } // end of GetResult + + public int ExecuteQuery(String query) { + int ncol = 0; + + if (DEBUG) + System.out.println("Executing query '" + query + "'"); + + try { + rs = stmt.executeQuery(query); + rsmd = rs.getMetaData(); + ncol = rsmd.getColumnCount(); + + if (DEBUG) { + System.out.println("Query '" + query + "' executed successfully"); + System.out.println("Result set has " + rsmd.getColumnCount() + " column(s)"); + } // endif DEBUG + + } catch (SQLException se) { + SetErrmsg(se); + ncol = -1; + } catch (Exception e) { + SetErrmsg(e); + ncol = -2; + } //end try/catch + + return ncol; + } // end of ExecuteQuery + + public int ExecuteUpdate(String query) { + int n = 0; + + if (DEBUG) + System.out.println("Executing update query '" + query + "'"); + + try { + n = stmt.executeUpdate(query); + + if (DEBUG) + System.out.println("Update Query '" + query + "' executed: n = " + n); + + } catch (SQLException se) { + SetErrmsg(se); + n = -1; + } catch (Exception e) { + SetErrmsg(e); + n = -2; + } //end try/catch + + return n; + } // end of ExecuteUpdate + + public int ReadNext() { + if (rs != null) { + try { + return rs.next() ? 1 : 0; + } catch (SQLException se) { + SetErrmsg(se); + return -1; + } //end try/catch + + } else + return 0; + + } // end of ReadNext + + public boolean Fetch(int row) { + if (rs != null) { + try { + return rs.absolute(row); + } catch (SQLException se) { + SetErrmsg(se); + return false; + } //end try/catch + + } else + return false; + + } // end of Fetch + + public String ColumnName(int n) { + if (rsmd == null) { + System.out.println("No result metadata"); + } else try { + return rsmd.getColumnLabel(n); + } catch (SQLException se) { + SetErrmsg(se); + } //end try/catch + + return null; + } // end of ColumnName + + public int ColumnType(int n, String name) { + if (rsmd == null) { + System.out.println("No result metadata"); + } else try { + if (n == 0) + n = rs.findColumn(name); + + return rsmd.getColumnType(n); + } catch (SQLException se) { + SetErrmsg(se); + } //end try/catch + + return 666; // Not a type + } // end of ColumnType + + public String ColumnDesc(int n, int[] val) { + if (rsmd == null) { + System.out.println("No result metadata"); + return null; + } else try { + val[0] = rsmd.getColumnType(n); + val[1] = rsmd.getPrecision(n); + val[2] = rsmd.getScale(n); + val[3] = rsmd.isNullable(n); + return rsmd.getColumnLabel(n); + } catch (SQLException se) { + SetErrmsg(se); + } //end try/catch + + return null; + } // end of ColumnDesc + + public String StringField(int n, String name) { + if (rs == null) { + System.out.println("No result set"); + } else try { + return (n > 0) ? rs.getString(n) : rs.getString(name); + } catch (SQLException se) { + SetErrmsg(se); + } //end try/catch + + return null; + } // end of StringField + + public int IntField(int n, String name) { + if (rs == null) { + System.out.println("No result set"); + } else try { + return (n > 0) ? rs.getInt(n) : rs.getInt(name); + } catch (SQLException se) { + SetErrmsg(se); + } //end try/catch + + return 0; + } // end of IntField + + public long BigintField(int n, String name) { + if (rs == null) { + System.out.println("No result set"); + } else try { + BigDecimal bigDecimal = (n > 0) ? rs.getBigDecimal(n) : rs.getBigDecimal(name); + return bigDecimal != null ? bigDecimal.longValue() : 0; + } catch (SQLException se) { + SetErrmsg(se); + } //end try/catch + + return 0; + } // end of BiginttField + + public double DoubleField(int n, String name) { + if (rs == null) { + System.out.println("No result set"); + } else try { + return (n > 0) ? rs.getDouble(n) : rs.getDouble(name); + } catch (SQLException se) { + SetErrmsg(se); + } //end try/catch + + return 0.; + } // end of DoubleField + + public float FloatField(int n, String name) { + if (rs == null) { + System.out.println("No result set"); + } else try { + return (n > 0) ? rs.getFloat(n) : rs.getFloat(name); + } catch (SQLException se) { + SetErrmsg(se); + } //end try/catch + + return 0; + } // end of FloatField + + public boolean BooleanField(int n, String name) { + if (rs == null) { + System.out.println("No result set"); + } else try { + return (n > 0) ? rs.getBoolean(n) : rs.getBoolean(name); + } catch (SQLException se) { + SetErrmsg(se); + } //end try/catch + + return false; + } // end of BooleanField + + public Date DateField(int n, String name) { + if (rs == null) { + System.out.println("No result set"); + } else try { + return (n > 0) ? rs.getDate(n) : rs.getDate(name); + } catch (SQLException se) { + SetErrmsg(se); + } //end try/catch + + return null; + } // end of DateField + + public Time TimeField(int n, String name) { + if (rs == null) { + System.out.println("No result set"); + } else try { + return (n > 0) ? rs.getTime(n) : rs.getTime(name); + } catch (SQLException se) { + SetErrmsg(se); + } //end try/catch + + return null; + } // end of TimeField + + public Timestamp TimestampField(int n, String name) { + if (rs == null) { + System.out.println("No result set"); + } else try { + return (n > 0) ? rs.getTimestamp(n) : rs.getTimestamp(name); + } catch (SQLException se) { + SetErrmsg(se); + } //end try/catch + + return null; + } // end of TimestampField + + public String ObjectField(int n, String name) { + if (rs == null) { + System.out.println("No result set"); + } else try { + return (n > 0) ? rs.getObject(n).toString() : rs.getObject(name).toString(); + } catch (SQLException se) { + SetErrmsg(se); + } //end try/catch + + return null; + } // end of ObjectField + + public int GetDrivers(String[] s, int mxs) { + int n = 0; + List drivers = Collections.list(DriverManager.getDrivers()); + int size = Math.min(mxs, drivers.size()); + + for (int i = 0; i < size; i++) { + Driver driver = (Driver)drivers.get(i); + + // Get name of driver + s[n++] = driver.getClass().getName(); + + // Get version info + s[n++] = driver.getMajorVersion() + "." + driver.getMinorVersion(); + s[n++] = driver.jdbcCompliant() ? "Yes" : "No"; + s[n++] = driver.toString(); + } // endfor i + + return size; + } // end of GetDrivers + + /** + * Adds the specified path to the java library path + * from Fahd Shariff blog + * + * @param pathToAdd the path to add + static public int addLibraryPath(String pathToAdd) { + System.out.println("jpath = " + pathToAdd); + + try { + Field usrPathsField = ClassLoader.class.getDeclaredField("usr_paths"); + usrPathsField.setAccessible(true); + + //get array of paths + String[] paths = (String[])usrPathsField.get(null); + + //check if the path to add is already present + for (String path : paths) { + System.out.println("path = " + path); + + if (path.equals(pathToAdd)) + return -5; + + } // endfor path + + //add the new path + String[] newPaths = Arrays.copyOf(paths, paths.length + 1); + newPaths[paths.length] = pathToAdd; + usrPathsField.set(null, newPaths); + System.setProperty("java.library.path", + System.getProperty("java.library.path") + File.pathSeparator + pathToAdd); + Field fieldSysPath = ClassLoader.class.getDeclaredField("sys_paths"); + fieldSysPath.setAccessible(true); + fieldSysPath.set(null, null); + } catch (Exception e) { + SetErrmsg(e); + return -1; + } // end try/catch + + return 0; + } // end of addLibraryPath + */ + +} // end of class JdbcDSInterface diff --git a/storage/connect/JdbcInterface.class b/storage/connect/JdbcInterface.class new file mode 100644 index 00000000000..51a0e69bad5 Binary files /dev/null and b/storage/connect/JdbcInterface.class differ diff --git a/storage/connect/JdbcInterface.java b/storage/connect/JdbcInterface.java new file mode 100644 index 00000000000..8c4db1db8c3 --- /dev/null +++ b/storage/connect/JdbcInterface.java @@ -0,0 +1,712 @@ +import java.math.*; +import java.sql.*; +//import java.util.Arrays; +import java.util.Collections; +import java.util.List; +//import java.io.File; +//import java.lang.reflect.Field; + +public class JdbcInterface { + boolean DEBUG = false; + String Errmsg = "No error"; + Connection conn = null; + DatabaseMetaData dbmd = null; + Statement stmt = null; + PreparedStatement pstmt = null; + ResultSet rs = null; + ResultSetMetaData rsmd = null; + + // === Constructors/finalize ========================================= + public JdbcInterface() { + this(true); + } // end of default constructor + + public JdbcInterface(boolean b) { + DEBUG = b; + } // end of constructor + + private void SetErrmsg(Exception e) { + if (DEBUG) + System.out.println(e.getMessage()); + + Errmsg = e.toString(); + } // end of SetErrmsg + + public String GetErrmsg() { + String err = Errmsg; + + Errmsg = "No error"; + return err; + } // end of GetErrmsg + + public int JdbcConnect(String[] parms, int fsize, boolean scrollable) { + int rc = 0; + + if (DEBUG) + System.out.println("In JdbcInterface: driver=" + parms[0]); + + try { + if (DEBUG) + System.out.println("In try block"); + + if (parms[0] != null && !parms[0].isEmpty()) { + if (DEBUG) + System.out.println("Loading class" + parms[0]); + + Class.forName(parms[0]); //loads the driver + } // endif driver + + if (DEBUG) + System.out.println("URL=" + parms[1]); + + if (parms[2] != null && !parms[2].isEmpty()) { + if (DEBUG) + System.out.println("user=" + parms[2] + " pwd=" + parms[3]); + + conn = DriverManager.getConnection(parms[1], parms[2], parms[3]); + } else + conn = DriverManager.getConnection(parms[1]); + + if (DEBUG) + System.out.println("Connection " + conn.toString() + " established"); + + // Get the data base meta data object + dbmd = conn.getMetaData(); + + // Get a statement from the connection + if (scrollable) + stmt = conn.createStatement(java.sql.ResultSet.TYPE_SCROLL_INSENSITIVE, java.sql.ResultSet.CONCUR_READ_ONLY); + else + stmt = conn.createStatement(java.sql.ResultSet.TYPE_FORWARD_ONLY, java.sql.ResultSet.CONCUR_READ_ONLY); + + if (DEBUG) + System.out.println("Statement type = " + stmt.getResultSetType() + + " concurrency = " + stmt.getResultSetConcurrency()); + + if (DEBUG) // Get the fetch size of a statement + System.out.println("Default fetch size = " + stmt.getFetchSize()); + + if (fsize != 0) { + // Set the fetch size + stmt.setFetchSize(fsize); + + if (DEBUG) + System.out.println("New fetch size = " + stmt.getFetchSize()); + + } // endif fsize + + } catch(ClassNotFoundException e) { + SetErrmsg(e); + rc = -1; + } catch (SQLException se) { + SetErrmsg(se); + rc = -2; + } catch( Exception e ) { + SetErrmsg(e); + rc = -3; + } // end try/catch + + return rc; + } // end of JdbcConnect + + public int CreatePrepStmt(String sql) { + int rc = 0; + + try { + pstmt = conn.prepareStatement(sql); + } catch (SQLException se) { + SetErrmsg(se); + rc = -1; + } catch (Exception e) { + SetErrmsg(e); + rc = -2; + } // end try/catch + + return rc; + } // end of CreatePrepStmt + + public void SetStringParm(int i, String s) { + try { + pstmt.setString(i, s); + } catch (Exception e) { + SetErrmsg(e); + } // end try/catch + + } // end of SetStringParm + + public void SetIntParm(int i, int n) { + try { + pstmt.setInt(i, n); + } catch (Exception e) { + SetErrmsg(e); + } // end try/catch + + } // end of SetIntParm + + public void SetShortParm(int i, short n) { + try { + pstmt.setShort(i, n); + } catch (Exception e) { + SetErrmsg(e); + } // end try/catch + + } // end of SetShortParm + + public void SetBigintParm(int i, long n) { + try { + pstmt.setLong(i, n); + } catch (Exception e) { + SetErrmsg(e); + } // end try/catch + + } // end of SetBigintParm + + public void SetFloatParm(int i, float f) { + try { + pstmt.setFloat(i, f); + } catch (Exception e) { + SetErrmsg(e); + } // end try/catch + + } // end of SetFloatParm + + public void SetDoubleParm(int i, double d) { + try { + pstmt.setDouble(i, d); + } catch (Exception e) { + SetErrmsg(e); + } // end try/catch + + } // end of SetDoubleParm + + public void SetTimestampParm(int i, Timestamp t) { + try { + pstmt.setTimestamp(i, t); + } catch (Exception e) { + SetErrmsg(e); + } // end try/catch + + } // end of SetTimestampParm + + public int ExecutePrep() { + int n = -3; + + if (pstmt != null) try { + n = pstmt.executeUpdate(); + } catch (SQLException se) { + SetErrmsg(se); + n = -1; + } catch (Exception e) { + SetErrmsg(e); + n = -2; + } //end try/catch + + return n; + } // end of ExecutePrep + + public boolean ClosePrepStmt() { + boolean b = false; + + if (pstmt != null) try { + pstmt.close(); + pstmt = null; + } catch (SQLException se) { + SetErrmsg(se); + b = true; + } catch (Exception e) { + SetErrmsg(e); + b = true; + } // end try/catch + + return b; + } // end of ClosePrepStmt + + public int JdbcDisconnect() { + int rc = 0; + + // Cancel pending statement + if (stmt != null) + try { + System.out.println("Cancelling statement"); + stmt.cancel(); + } catch(SQLException se) { + SetErrmsg(se); + rc += 1; + } // nothing more we can do + + // Close the statement and the connection + if (rs != null) + try { + if (DEBUG) + System.out.println("Closing result set"); + + rs.close(); + } catch(SQLException se) { + SetErrmsg(se); + rc = 2; + } // nothing more we can do + + if (stmt != null) + try { + if (DEBUG) + System.out.println("Closing statement"); + + stmt.close(); + } catch(SQLException se) { + SetErrmsg(se); + rc += 4; + } // nothing more we can do + + ClosePrepStmt(); + + if (conn != null) + try { + if (DEBUG) + System.out.println("Closing connection"); + + conn.close(); + } catch (SQLException se) { + SetErrmsg(se); + rc += 8; + } //end try/catch + + if (DEBUG) + System.out.println("All closed"); + + return rc; + } // end of JdbcDisconnect + + public int GetMaxValue(int n) { + int m = 0; + + try { + switch (n) { + case 1: // Max columns in table + m = dbmd.getMaxColumnsInTable(); + break; + case 2: // Max catalog name length + m = dbmd.getMaxCatalogNameLength(); + break; + case 3: // Max schema name length + m = dbmd.getMaxSchemaNameLength(); + break; + case 4: // Max table name length + m = dbmd.getMaxTableNameLength(); + break; + case 5: // Max column name length + m = dbmd.getMaxColumnNameLength(); + break; + } // endswitch n + + } catch(Exception e) { + SetErrmsg(e); + m = -1; + } // end try/catch + + return m; + } // end of GetMaxValue + + public int GetColumns(String[] parms) { + int ncol = -1; + + try { + if (rs != null) rs.close(); + rs = dbmd.getColumns(parms[0], parms[1], parms[2], parms[3]); + + if (rs != null) { + rsmd = rs.getMetaData(); + ncol = rsmd.getColumnCount(); + } // endif rs + + } catch(SQLException se) { + SetErrmsg(se); + } // end try/catch + + return ncol; + } // end of GetColumns + + public int GetTables(String[] parms) { + int ncol = 0; + String[] typ = null; + + if (parms[3] != null) { + typ = new String[1]; + typ[0] = parms[3]; + } // endif parms + + try { + if (rs != null) rs.close(); + rs = dbmd.getTables(parms[0], parms[1], parms[2], typ); + + if (rs != null) { + rsmd = rs.getMetaData(); + ncol = rsmd.getColumnCount(); + } // endif rs + + } catch(SQLException se) { + SetErrmsg(se); + } // end try/catch + + return ncol; + } // end of GetColumns + + public int Execute(String query) { + int n = 0; + + if (DEBUG) + System.out.println("Executing '" + query + "'"); + + try { + boolean b = stmt.execute(query); + + if (b == false) { + n = stmt.getUpdateCount(); + if (rs != null) rs.close(); + } // endif b + + if (DEBUG) + System.out.println("Query '" + query + "' executed: n = " + n); + + } catch (SQLException se) { + SetErrmsg(se); + n = -1; + } catch (Exception e) { + SetErrmsg(e); + n = -2; + } //end try/catch + + return n; + } // end of Execute + + public int GetResult() { + int ncol = 0; + + try { + rs = stmt.getResultSet(); + + if (rs != null) { + rsmd = rs.getMetaData(); + ncol = rsmd.getColumnCount(); + + if (DEBUG) + System.out.println("Result set has " + rsmd.getColumnCount() + " column(s)"); + + } // endif rs + + } catch (SQLException se) { + SetErrmsg(se); + ncol = -1; + } catch (Exception e) { + SetErrmsg(e); + ncol = -2; + } //end try/catch + + return ncol; + } // end of GetResult + + public int ExecuteQuery(String query) { + int ncol = 0; + + if (DEBUG) + System.out.println("Executing query '" + query + "'"); + + try { + rs = stmt.executeQuery(query); + rsmd = rs.getMetaData(); + ncol = rsmd.getColumnCount(); + + if (DEBUG) { + System.out.println("Query '" + query + "' executed successfully"); + System.out.println("Result set has " + rsmd.getColumnCount() + " column(s)"); + } // endif DEBUG + + } catch (SQLException se) { + SetErrmsg(se); + ncol = -1; + } catch (Exception e) { + SetErrmsg(e); + ncol = -2; + } //end try/catch + + return ncol; + } // end of ExecuteQuery + + public int ExecuteUpdate(String query) { + int n = 0; + + if (DEBUG) + System.out.println("Executing update query '" + query + "'"); + + try { + n = stmt.executeUpdate(query); + + if (DEBUG) + System.out.println("Update Query '" + query + "' executed: n = " + n); + + } catch (SQLException se) { + SetErrmsg(se); + n = -1; + } catch (Exception e) { + SetErrmsg(e); + n = -2; + } //end try/catch + + return n; + } // end of ExecuteUpdate + + public int ReadNext() { + if (rs != null) { + try { + return rs.next() ? 1 : 0; + } catch (SQLException se) { + SetErrmsg(se); + return -1; + } //end try/catch + + } else + return 0; + + } // end of ReadNext + + public boolean Fetch(int row) { + if (rs != null) { + try { + return rs.absolute(row); + } catch (SQLException se) { + SetErrmsg(se); + return false; + } //end try/catch + + } else + return false; + + } // end of Fetch + + public String ColumnName(int n) { + if (rsmd == null) { + System.out.println("No result metadata"); + } else try { + return rsmd.getColumnLabel(n); + } catch (SQLException se) { + SetErrmsg(se); + } //end try/catch + + return null; + } // end of ColumnName + + public int ColumnType(int n, String name) { + if (rsmd == null) { + System.out.println("No result metadata"); + } else try { + if (n == 0) + n = rs.findColumn(name); + + return rsmd.getColumnType(n); + } catch (SQLException se) { + SetErrmsg(se); + } //end try/catch + + return 666; // Not a type + } // end of ColumnType + + public String ColumnDesc(int n, int[] val) { + if (rsmd == null) { + System.out.println("No result metadata"); + return null; + } else try { + val[0] = rsmd.getColumnType(n); + val[1] = rsmd.getPrecision(n); + val[2] = rsmd.getScale(n); + val[3] = rsmd.isNullable(n); + return rsmd.getColumnLabel(n); + } catch (SQLException se) { + SetErrmsg(se); + } //end try/catch + + return null; + } // end of ColumnDesc + + public String StringField(int n, String name) { + if (rs == null) { + System.out.println("No result set"); + } else try { + return (n > 0) ? rs.getString(n) : rs.getString(name); + } catch (SQLException se) { + SetErrmsg(se); + } //end try/catch + + return null; + } // end of StringField + + public int IntField(int n, String name) { + if (rs == null) { + System.out.println("No result set"); + } else try { + return (n > 0) ? rs.getInt(n) : rs.getInt(name); + } catch (SQLException se) { + SetErrmsg(se); + } //end try/catch + + return 0; + } // end of IntField + + public long BigintField(int n, String name) { + if (rs == null) { + System.out.println("No result set"); + } else try { + BigDecimal bigDecimal = (n > 0) ? rs.getBigDecimal(n) : rs.getBigDecimal(name); + return bigDecimal != null ? bigDecimal.longValue() : 0; + } catch (SQLException se) { + SetErrmsg(se); + } //end try/catch + + return 0; + } // end of BiginttField + + public double DoubleField(int n, String name) { + if (rs == null) { + System.out.println("No result set"); + } else try { + return (n > 0) ? rs.getDouble(n) : rs.getDouble(name); + } catch (SQLException se) { + SetErrmsg(se); + } //end try/catch + + return 0.; + } // end of DoubleField + + public float FloatField(int n, String name) { + if (rs == null) { + System.out.println("No result set"); + } else try { + return (n > 0) ? rs.getFloat(n) : rs.getFloat(name); + } catch (SQLException se) { + SetErrmsg(se); + } //end try/catch + + return 0; + } // end of FloatField + + public boolean BooleanField(int n, String name) { + if (rs == null) { + System.out.println("No result set"); + } else try { + return (n > 0) ? rs.getBoolean(n) : rs.getBoolean(name); + } catch (SQLException se) { + SetErrmsg(se); + } //end try/catch + + return false; + } // end of BooleanField + + public Date DateField(int n, String name) { + if (rs == null) { + System.out.println("No result set"); + } else try { + return (n > 0) ? rs.getDate(n) : rs.getDate(name); + } catch (SQLException se) { + SetErrmsg(se); + } //end try/catch + + return null; + } // end of DateField + + public Time TimeField(int n, String name) { + if (rs == null) { + System.out.println("No result set"); + } else try { + return (n > 0) ? rs.getTime(n) : rs.getTime(name); + } catch (SQLException se) { + SetErrmsg(se); + } //end try/catch + + return null; + } // end of TimeField + + public Timestamp TimestampField(int n, String name) { + if (rs == null) { + System.out.println("No result set"); + } else try { + return (n > 0) ? rs.getTimestamp(n) : rs.getTimestamp(name); + } catch (SQLException se) { + SetErrmsg(se); + } //end try/catch + + return null; + } // end of TimestampField + + public String ObjectField(int n, String name) { + if (rs == null) { + System.out.println("No result set"); + } else try { + return (n > 0) ? rs.getObject(n).toString() : rs.getObject(name).toString(); + } catch (SQLException se) { + SetErrmsg(se); + } //end try/catch + + return null; + } // end of ObjectField + + public int GetDrivers(String[] s, int mxs) { + int n = 0; + List drivers = Collections.list(DriverManager.getDrivers()); + int size = Math.min(mxs, drivers.size()); + + for (int i = 0; i < size; i++) { + Driver driver = (Driver)drivers.get(i); + + // Get name of driver + s[n++] = driver.getClass().getName(); + + // Get version info + s[n++] = driver.getMajorVersion() + "." + driver.getMinorVersion(); + s[n++] = driver.jdbcCompliant() ? "Yes" : "No"; + s[n++] = driver.toString(); + } // endfor i + + return size; + } // end of GetDrivers + + /** + * Adds the specified path to the java library path + * from Fahd Shariff blog + * + * @param pathToAdd the path to add + static public int addLibraryPath(String pathToAdd) { + System.out.println("jpath = " + pathToAdd); + + try { + Field usrPathsField = ClassLoader.class.getDeclaredField("usr_paths"); + usrPathsField.setAccessible(true); + + //get array of paths + String[] paths = (String[])usrPathsField.get(null); + + //check if the path to add is already present + for (String path : paths) { + System.out.println("path = " + path); + + if (path.equals(pathToAdd)) + return -5; + + } // endfor path + + //add the new path + String[] newPaths = Arrays.copyOf(paths, paths.length + 1); + newPaths[paths.length] = pathToAdd; + usrPathsField.set(null, newPaths); + System.setProperty("java.library.path", + System.getProperty("java.library.path") + File.pathSeparator + pathToAdd); + Field fieldSysPath = ClassLoader.class.getDeclaredField("sys_paths"); + fieldSysPath.setAccessible(true); + fieldSysPath.set(null, null); + } catch (Exception e) { + SetErrmsg(e); + return -1; + } // end try/catch + + return 0; + } // end of addLibraryPath + */ + +} // end of class JdbcInterface diff --git a/storage/connect/connect.cc b/storage/connect/connect.cc index 56a0fc4fd4f..460d47bcf62 100644 --- a/storage/connect/connect.cc +++ b/storage/connect/connect.cc @@ -752,7 +752,7 @@ RCODE CntIndexRead(PGLOBAL g, PTDB ptdb, OPVAL op, return RC_FX; } else if (x == 2) { // Remote index - if (ptdb->ReadKey(g, op, kr)) + if (op != OP_SAME && ptdb->ReadKey(g, op, kr)) return RC_FX; goto rnd; diff --git a/storage/connect/connect.h b/storage/connect/connect.h index bbefda52274..b877f1ffb6c 100644 --- a/storage/connect/connect.h +++ b/storage/connect/connect.h @@ -57,6 +57,7 @@ class DOXDEF: public DOSDEF { /* This is the DOS/UNIX Access Method base class declaration. */ /***********************************************************************/ class TDBDOX: public TDBDOS { + TDBDOX(): TDBDOS((PGLOBAL)0,(PTDBDOS) 0) {} /* Never called */ friend int MakeIndex(PGLOBAL, PTDB, PIXDEF); friend int CntCloseTable(PGLOBAL, PTDB, bool, bool); friend int CntIndexInit(PGLOBAL, PTDB, int, bool); diff --git a/storage/connect/csort.cpp b/storage/connect/csort.cpp index 2f918782c80..e89c5ecdbc9 100644 --- a/storage/connect/csort.cpp +++ b/storage/connect/csort.cpp @@ -721,7 +721,7 @@ int CSORT::Qsortc(void) void CSORT::Qstc(int *base, int *max) { register int *i, *j, *jj, *lt, *eq, *gt, *mid; - int c, lo, hi, rc; + int c= 0, lo, hi, rc; size_t zlo, zhi, cnm; zlo = zhi = cnm = 0; // Avoid warning message @@ -775,7 +775,11 @@ void CSORT::Qstc(int *base, int *max) /* Small group. Do special quicker processing. */ /*****************************************************************/ if ((rc = Qcompare(base, (i = base + 1))) > 0) - c = *base, *base = *i, *i = c; + { + c = *base; + *base = *i; + *i = c; + } if (Pof) Pof[base - Pex] = Pof[i - Pex] = (rc) ? 1 : 2; diff --git a/storage/connect/filamdbf.cpp b/storage/connect/filamdbf.cpp index 8afda723578..327bcf376df 100644 --- a/storage/connect/filamdbf.cpp +++ b/storage/connect/filamdbf.cpp @@ -655,7 +655,7 @@ bool DBFFAM::AllocateBuffer(PGLOBAL g) } // endif Headlen /**************************************************************************/ - /* Position the file at the begining of the data. */ + /* Position the file at the beginning of the data. */ /**************************************************************************/ if (Tdbp->GetMode() == MODE_INSERT) rc = fseek(Stream, 0, SEEK_END); @@ -969,7 +969,7 @@ bool DBMFAM::AllocateBuffer(PGLOBAL g) } // endif Headlen /**************************************************************************/ - /* Position the file at the begining of the data. */ + /* Position the file at the beginning of the data. */ /**************************************************************************/ Fpos = Mempos = Memory + Headlen; Top--; // Because of EOF marker diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc index d96d7455d8b..dd347dca73a 100644 --- a/storage/connect/ha_connect.cc +++ b/storage/connect/ha_connect.cc @@ -21,8 +21,8 @@ based on external data. Principally they are based on plain files of many different types, but also on collections of such files, collection of tables, local or remote MySQL/MariaDB tables retrieved via MySQL API, - ODBC tables retrieving data from other DBMS having an ODBC server, and even - virtual tables. + ODBC/JDBC tables retrieving data from other DBMS having an ODBC/JDBC server, + and even virtual tables. @details ha_connect will let you create/open/delete tables, the created table can be @@ -115,13 +115,11 @@ #include "sql_parse.h" #include "sql_base.h" #include -#if defined(NEW_WAY) -#include "sql_table.h" -#endif // NEW_WAY #include "sql_partition.h" #undef OFFSET #define NOPARSE +#define NJDBC #if defined(UNIX) #include "osutil.h" #endif // UNIX @@ -130,6 +128,10 @@ #if defined(ODBC_SUPPORT) #include "odbccat.h" #endif // ODBC_SUPPORT +#if defined(JDBC_SUPPORT) +#include "tabjdbc.h" +#include "jdbconn.h" +#endif // JDBC_SUPPORT #include "xtable.h" #include "tabmysql.h" #include "filamdbf.h" @@ -169,7 +171,7 @@ #define JSONMAX 10 // JSON Default max grp size extern "C" { - char version[]= "Version 1.04.0006 March 12, 2016"; + char version[]= "Version 1.04.0006 May 08, 2016"; #if defined(__WIN__) char compver[]= "Version 1.04.0006 " __DATE__ " " __TIME__; char slash= '\\'; @@ -190,6 +192,18 @@ extern "C" { } // extern "C" #endif // XMSG +#if defined(JDBC_SUPPORT) + char *JvmPath; + char *ClassPath; + char *Wrapper; +#endif // JDBC_SUPPORT + +#if defined(__WIN__) +CRITICAL_SECTION parsec; // Used calling the Flex parser +#else // !__WIN__ +pthread_mutex_t parmut = PTHREAD_MUTEX_INITIALIZER; +#endif // !__WIN__ + /***********************************************************************/ /* Utility functions. */ /***********************************************************************/ @@ -197,6 +211,7 @@ PQRYRES OEMColumns(PGLOBAL g, PTOS topt, char *tab, char *db, bool info); PQRYRES VirColumns(PGLOBAL g, bool info); PQRYRES JSONColumns(PGLOBAL g, char *db, PTOS topt, bool info); PQRYRES XMLColumns(PGLOBAL g, char *db, char *tab, PTOS topt, bool info); +int TranslateJDBCType(int stp, int prec, int& len, char& v); void PushWarning(PGLOBAL g, THD *thd, int level); bool CheckSelf(PGLOBAL g, TABLE_SHARE *s, const char *host, const char *db, char *tab, const char *src, int port); @@ -633,6 +648,7 @@ static int connect_init_func(void *p) #if defined(__WIN__) sql_print_information("CONNECT: %s", compver); + InitializeCriticalSection((LPCRITICAL_SECTION)&parsec); #else // !__WIN__ sql_print_information("CONNECT: %s", version); #endif // !__WIN__ @@ -659,6 +675,9 @@ static int connect_init_func(void *p) DTVAL::SetTimeShift(); // Initialize time zone shift once for all BINCOL::SetEndian(); // Initialize host endian setting +#if defined(JDBC_SUPPORT) + JDBConn::SetJVM(); +#endif // JDBC_SUPPORT DBUG_RETURN(0); } // end of connect_init_func @@ -675,11 +694,17 @@ static int connect_done_func(void *) #ifdef LIBXML2_SUPPORT XmlCleanupParserLib(); -#endif // LIBXML2_SUPPORT +#endif // LIBXML2_SUPPORT -#if !defined(__WIN__) -//PROFILE_End(); Causes signal 11 -#endif // !__WIN__ +#ifdef JDBC_SUPPORT + JDBConn::ResetJVM(); +#endif // JDBC_SUPPORT + +#if defined(__WIN__) + DeleteCriticalSection((LPCRITICAL_SECTION)&parsec); +#else // !__WIN__ + PROFILE_End(); +#endif // !__WIN__ for (pc= user_connect::to_users; pc; pc= pn) { if (pc->g) @@ -757,7 +782,7 @@ ha_connect::ha_connect(handlerton *hton, TABLE_SHARE *table_arg) sdvalout= NULL; xmod= MODE_ANY; istable= false; - *partname= 0; + memset(partname, 0, sizeof(partname)); bzero((char*) &xinfo, sizeof(XINFO)); valid_info= false; valid_query_id= 0; @@ -1098,7 +1123,7 @@ bool GetBooleanTableOption(PGLOBAL g, PTOS options, char *opname, bool bdef) /****************************************************************************/ int GetIntegerTableOption(PGLOBAL g, PTOS options, char *opname, int idef) { - ulonglong opval= NO_IVAL; + ulonglong opval= (ulonglong) NO_IVAL; if (!options) return idef; @@ -1150,7 +1175,7 @@ char *ha_connect::GetRealString(const char *s) { char *sv; - if (IsPartitioned() && s) { + if (IsPartitioned() && s && partname && *partname) { sv= (char*)PlugSubAlloc(xp->g, NULL, 0); sprintf(sv, s, partname); PlugSubAlloc(xp->g, NULL, strlen(sv) + 1); @@ -1173,7 +1198,9 @@ char *ha_connect::GetStringOption(char *opname, char *sdef) : table->s->connect_string; if (cnc.length) - opval= GetRealString(strz(xp->g, cnc)); + opval= strz(xp->g, cnc); + else + opval= GetListOption(xp->g, opname, options->oplist); } else if (!stricmp(opname, "Query_String")) opval= thd_query_string(table->in_use)->str; @@ -1756,9 +1783,10 @@ int ha_connect::OpenTable(PGLOBAL g, bool del) break; } // endswitch xmode - if (xmod != MODE_INSERT || tdbp->GetAmType() == TYPE_AM_ODBC - || tdbp->GetAmType() == TYPE_AM_MYSQL) { - // Get the list of used fields (columns) + if (xmod != MODE_INSERT || tdbp->GetAmType() == TYPE_AM_MYSQL + || tdbp->GetAmType() == TYPE_AM_ODBC + || tdbp->GetAmType() == TYPE_AM_JDBC) { + // Get the list of used fields (columns) char *p; unsigned int k1, k2, n1, n2; Field* *field; @@ -1933,7 +1961,7 @@ int ha_connect::MakeRecord(char *buf) if (trace > 1) htrc("Maps: read=%08X write=%08X vcol=%08X defr=%08X defw=%08X\n", *table->read_set->bitmap, *table->write_set->bitmap, - *table->vcol_set->bitmap, + (table->vcol_set) ? *table->vcol_set->bitmap : 0, *table->def_read_set.bitmap, *table->def_write_set.bitmap); // Avoid asserts in field::store() for columns that are not updated @@ -2074,8 +2102,9 @@ int ha_connect::ScanRecord(PGLOBAL g, uchar *) continue; // Is a virtual column possible here ??? if ((xmod == MODE_INSERT && tdbp->GetAmType() != TYPE_AM_MYSQL - && tdbp->GetAmType() != TYPE_AM_ODBC) || - bitmap_is_set(table->write_set, fp->field_index)) { + && tdbp->GetAmType() != TYPE_AM_ODBC + && tdbp->GetAmType() != TYPE_AM_JDBC) || + bitmap_is_set(table->write_set, fp->field_index)) { for (colp= tp->GetSetCols(); colp; colp= colp->GetNext()) if (!stricmp(colp->GetName(), fp->field_name)) break; @@ -2285,7 +2314,7 @@ bool ha_connect::MakeKeyWhere(PGLOBAL g, PSTRG qry, OPVAL vop, char q, op= OP_EQ; break; case HA_READ_AFTER_KEY: - op= (stlen >= len) ? (!i ? OP_GT : OP_LE) : OP_GE; + op= (stlen >= len || i > 0) ? (i > 0 ? OP_LE : OP_GT) : OP_GE; break; case HA_READ_KEY_OR_NEXT: op= OP_GE; @@ -2624,7 +2653,7 @@ PFIL ha_connect::CondFilter(PGLOBAL g, Item *cond) } // end of CondFilter /***********************************************************************/ -/* Check the WHERE condition and return a MYSQL/ODBC/WQL filter. */ +/* Check the WHERE condition and return a MYSQL/ODBC/JDBC/WQL filter. */ /***********************************************************************/ PCFIL ha_connect::CheckCond(PGLOBAL g, PCFIL filp, const Item *cond) { @@ -2632,8 +2661,8 @@ PCFIL ha_connect::CheckCond(PGLOBAL g, PCFIL filp, const Item *cond) char *body= filp->Body; unsigned int i; bool ismul= false, x= (tty == TYPE_AM_MYX || tty == TYPE_AM_XDBC); - bool nonul= (tty == TYPE_AM_ODBC && (tdbp->GetMode() == MODE_INSERT || - tdbp->GetMode() == MODE_DELETE)); + bool nonul= ((tty == TYPE_AM_ODBC || tty == TYPE_AM_JDBC) && + (tdbp->GetMode() == MODE_INSERT || tdbp->GetMode() == MODE_DELETE)); OPVAL vop= OP_XX; if (!cond) @@ -2955,7 +2984,7 @@ const COND *ha_connect::cond_push(const COND *cond) bool x= (tty == TYPE_AM_MYX || tty == TYPE_AM_XDBC); bool b= (tty == TYPE_AM_WMI || tty == TYPE_AM_ODBC || tty == TYPE_AM_TBL || tty == TYPE_AM_MYSQL || - tty == TYPE_AM_PLG || x); + tty == TYPE_AM_PLG || tty == TYPE_AM_JDBC || x); // Save stack and allocation environment and prepare error return if (g->jump_level == MAX_JUMP) { @@ -3120,13 +3149,14 @@ int ha_connect::open(const char *name, int mode, uint test_if_locked) #if defined(WITH_PARTITION_STORAGE_ENGINE) if (table->part_info) { if (GetStringOption("Filename") || GetStringOption("Tabname") - || GetStringOption("Connect")) { - strcpy(partname, decode(g, strrchr(name, '#') + 1)); + || GetStringOption("Connect")) { + strncpy(partname, decode(g, strrchr(name, '#') + 1), sizeof(partname) - 1); // strcpy(partname, table->part_info->curr_part_elem->partition_name); - part_id= &table->part_info->full_part_field_set; +// part_id= &table->part_info->full_part_field_set; } else // Inward table - strcpy(partname, strrchr(name, slash) + 1); - part_id= &table->part_info->full_part_field_set; // Temporary + strncpy(partname, strrchr(name, slash) + 1, sizeof(partname) - 1); + + part_id= &table->part_info->full_part_field_set; // Temporary } // endif part_info #endif // WITH_PARTITION_STORAGE_ENGINE } else @@ -3359,7 +3389,7 @@ int ha_connect::delete_row(const uchar *) /****************************************************************************/ -/* We seem to come here at the begining of an index use. */ +/* We seem to come here at the beginning of an index use. */ /****************************************************************************/ int ha_connect::index_init(uint idx, bool sorted) { @@ -4053,7 +4083,7 @@ int ha_connect::delete_all_rows() } // end of delete_all_rows -bool ha_connect::check_privileges(THD *thd, PTOS options, char *dbn) +bool ha_connect::check_privileges(THD *thd, PTOS options, char *dbn, bool quick) { const char *db= (dbn && *dbn) ? dbn : NULL; TABTYPE type=GetRealType(options); @@ -4080,6 +4110,7 @@ bool ha_connect::check_privileges(THD *thd, PTOS options, char *dbn) case TAB_VEC: case TAB_JSON: if (options->filename && *options->filename) { + if (!quick) { char *s, path[FN_REFLEN], dbpath[FN_REFLEN]; #if defined(__WIN__) s= "\\"; @@ -4098,13 +4129,14 @@ bool ha_connect::check_privileges(THD *thd, PTOS options, char *dbn) my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0), "--secure-file-priv"); return true; } // endif path - + } } else return false; /* Fall through to check FILE_ACL */ case TAB_ODBC: - case TAB_MYSQL: + case TAB_JDBC: + case TAB_MYSQL: case TAB_DIR: case TAB_MAC: case TAB_WMI: @@ -4120,10 +4152,13 @@ bool ha_connect::check_privileges(THD *thd, PTOS options, char *dbn) Otherwise it's a DML, the table was normally opened, locked, privilege were already checked, and table->grant.privilege is set. With SQL SECURITY DEFINER, table->grant.privilege has definer's privileges. + + Unless we're in prelocking mode, in this case table->grant.privilege + is only checked in start_stmt(), not in external_lock(). */ if (!table || !table->mdl_ticket || table->mdl_ticket->get_type() == MDL_EXCLUSIVE) return check_access(thd, FILE_ACL, db, NULL, NULL, 0, 0); - if (table->grant.privilege & FILE_ACL) + if ((!quick && thd->lex->requires_prelocking()) || table->grant.privilege & FILE_ACL) return false; status_var_increment(thd->status_var.access_denied_errors); my_error(access_denied_error_code(thd->password), MYF(0), @@ -4307,6 +4342,9 @@ int ha_connect::start_stmt(THD *thd, thr_lock_type lock_type) PGLOBAL g= GetPlug(thd, xp); DBUG_ENTER("ha_connect::start_stmt"); + if (check_privileges(thd, GetTableOptionStruct(), table->s->db.str, true)) + DBUG_RETURN(HA_ERR_INTERNAL_ERROR); + // Action will depend on lock_type switch (lock_type) { case TL_WRITE_ALLOW_WRITE: @@ -4768,7 +4806,11 @@ int ha_connect::delete_or_rename_table(const char *name, const char *to) DBUG_RETURN(rc); // Get the share info from the .frm file - if (!open_table_def(thd, share)) { + Dummy_error_handler error_handler; + thd->push_internal_handler(&error_handler); + bool got_error= open_table_def(thd, share); + thd->pop_internal_handler(); + if (!got_error) { // Now we can work if ((pos= share->option_struct)) { if (check_privileges(thd, pos, db)) @@ -4781,12 +4823,6 @@ int ha_connect::delete_or_rename_table(const char *name, const char *to) } // endif open_table_def -// This below was done to avoid DBUG_ASSERT in some case that -// we don't know anymore what they were. It was suppressed because -// it did cause assertion in other cases (see MDEV-7935) -// } else // Avoid infamous DBUG_ASSERT -// thd->get_stmt_da()->reset_diagnostics_area(); - free_table_share(share); } else // Temporary file ok= true; @@ -5120,11 +5156,17 @@ static int connect_assisted_discovery(handlerton *, THD* thd, int port= 0, hdr= 0, mxr= 0, mxe= 0, rc= 0; int cop __attribute__((unused))= 0, lrecl= 0; #if defined(ODBC_SUPPORT) - POPARM sop = NULL; - char *ucnc = NULL; + POPARM sop= NULL; + char *ucnc= NULL; bool cnc= false; int cto= -1, qto= -1; #endif // ODBC_SUPPORT +#if defined(JDBC_SUPPORT) + PJPARM sjp= NULL; + char *driver= NULL; + char *url= NULL; + char *tabtyp = NULL; +#endif // JDBC_SUPPORT uint tm, fnc= FNC_NO, supfnc= (FNC_NO | FNC_COL); bool bif, ok= false, dbf= false; TABTYPE ttp= TAB_UNDEF; @@ -5135,15 +5177,10 @@ static int connect_assisted_discovery(handlerton *, THD* thd, PDBUSER dup= PlgGetUser(g); PCATLG cat= (dup) ? dup->Catalog : NULL; PTOS topt= table_s->option_struct; -#if defined(NEW_WAY) -//CHARSET_INFO *cs; - Alter_info alter_info; -#else // !NEW_WAY char buf[1024]; String sql(buf, sizeof(buf), system_charset_info); sql.copy(STRING_WITH_LEN("CREATE TABLE whatever ("), system_charset_info); -#endif // !NEW_WAY if (!g) return HA_ERR_INTERNAL_ERROR; @@ -5162,7 +5199,7 @@ static int connect_assisted_discovery(handlerton *, THD* thd, spc= (!sep) ? ',' : *sep; qch= topt->qchar ? *topt->qchar : (signed)topt->quoted >= 0 ? '"' : 0; hdr= (int)topt->header; - tbl= topt->tablist; + tbl= topt->tablist; col= topt->colist; if (topt->oplist) { @@ -5191,6 +5228,11 @@ static int connect_assisted_discovery(handlerton *, THD* thd, if ((ucnc= GetListOption(g, "UseDSN", topt->oplist))) cnc= (!*ucnc || *ucnc == 'y' || *ucnc == 'Y' || atoi(ucnc) != 0); #endif +#if defined(JDBC_SUPPORT) + driver= GetListOption(g, "Driver", topt->oplist, NULL); +// url= GetListOption(g, "URL", topt->oplist, NULL); + tabtyp = GetListOption(g, "Tabtype", topt->oplist, NULL); +#endif // JDBC_SUPPORT mxe= atoi(GetListOption(g,"maxerr", topt->oplist, "0")); #if defined(PROMPT_OK) cop= atoi(GetListOption(g, "checkdsn", topt->oplist, "0")); @@ -5251,44 +5293,75 @@ static int connect_assisted_discovery(handlerton *, THD* thd, } else if (ttp != TAB_ODBC || !(fnc & (FNC_TABLE | FNC_COL))) tab= table_s->table_name.str; // Default value -#if defined(NEW_WAY) -// add_option(thd, create_info, "tabname", tab); -#endif // NEW_WAY } // endif tab - switch (ttp) { + switch (ttp) { #if defined(ODBC_SUPPORT) - case TAB_ODBC: - dsn= strz(g, create_info->connect_string); + case TAB_ODBC: + dsn= strz(g, create_info->connect_string); - if (fnc & (FNC_DSN | FNC_DRIVER)) { - ok= true; + if (fnc & (FNC_DSN | FNC_DRIVER)) { + ok= true; #if defined(PROMPT_OK) - } else if (!stricmp(thd->main_security_ctx.host, "localhost") - && cop == 1) { - if ((dsn = ODBCCheckConnection(g, dsn, cop)) != NULL) { - thd->make_lex_string(&create_info->connect_string, dsn, strlen(dsn)); - ok= true; - } // endif dsn + } else if (!stricmp(thd->main_security_ctx.host, "localhost") + && cop == 1) { + if ((dsn = ODBCCheckConnection(g, dsn, cop)) != NULL) { + thd->make_lex_string(&create_info->connect_string, dsn, strlen(dsn)); + ok= true; + } // endif dsn #endif // PROMPT_OK - } else if (!dsn) { - sprintf(g->Message, "Missing %s connection string", topt->type); - } else { - // Store ODBC additional parameters - sop= (POPARM)PlugSubAlloc(g, NULL, sizeof(ODBCPARM)); - sop->User= (char*)user; - sop->Pwd= (char*)pwd; - sop->Cto= cto; - sop->Qto= qto; - sop->UseCnc= cnc; - ok= true; - } // endif's + } else if (!dsn) { + sprintf(g->Message, "Missing %s connection string", topt->type); + } else { + // Store ODBC additional parameters + sop= (POPARM)PlugSubAlloc(g, NULL, sizeof(ODBCPARM)); + sop->User= (char*)user; + sop->Pwd= (char*)pwd; + sop->Cto= cto; + sop->Qto= qto; + sop->UseCnc= cnc; + ok= true; + } // endif's - supfnc |= (FNC_TABLE | FNC_DSN | FNC_DRIVER); - break; + supfnc |= (FNC_TABLE | FNC_DSN | FNC_DRIVER); + break; #endif // ODBC_SUPPORT - case TAB_DBF: +#if defined(JDBC_SUPPORT) + case TAB_JDBC: + if (fnc & FNC_DRIVER) { + ok= true; + } else if (!(url= strz(g, create_info->connect_string))) { + strcpy(g->Message, "Missing URL"); + } else { + // Store JDBC additional parameters + int rc; + PJDBCDEF jdef= new(g) JDBCDEF(); + + jdef->SetName(create_info->alias); + sjp= (PJPARM)PlugSubAlloc(g, NULL, sizeof(JDBCPARM)); + sjp->Driver= driver; + sjp->Fsize= 0; + sjp->Scrollable= false; + + if ((rc = jdef->ParseURL(g, url, false)) == RC_OK) { + sjp->Url= url; + sjp->User= (char*)user; + sjp->Pwd= (char*)pwd; + ok= true; + } else if (rc == RC_NF) { + if (jdef->GetTabname()) + tab= jdef->GetTabname(); + + ok= jdef->SetParms(sjp); + } // endif rc + + } // endif's + + supfnc |= (FNC_DRIVER | FNC_TABLE); + break; +#endif // JDBC_SUPPORT + case TAB_DBF: dbf= true; // Passthru case TAB_CSV: @@ -5407,7 +5480,7 @@ static int connect_assisted_discovery(handlerton *, THD* thd, dpath= SetPath(g, table_s->db.str); - if (src && ttp != TAB_PIVOT && ttp != TAB_ODBC) { + if (src && ttp != TAB_PIVOT && ttp != TAB_ODBC && ttp != TAB_JDBC) { qrp= SrcColumns(g, host, db, user, pwd, src, port); if (qrp && ttp == TAB_OCCUR) @@ -5434,7 +5507,7 @@ static int connect_assisted_discovery(handlerton *, THD* thd, break; case FNC_TABLE: - qrp= ODBCTables(g, dsn, shm, tab, mxr, true, sop); + qrp= ODBCTables(g, dsn, shm, tab, NULL, mxr, true, sop); break; case FNC_DSN: qrp= ODBCDataSources(g, mxr, true); @@ -5449,7 +5522,37 @@ static int connect_assisted_discovery(handlerton *, THD* thd, break; #endif // ODBC_SUPPORT - case TAB_MYSQL: +#if defined(JDBC_SUPPORT) + case TAB_JDBC: + switch (fnc) { + case FNC_NO: + case FNC_COL: + if (src) { + qrp= JDBCSrcCols(g, (char*)src, sjp); + src= NULL; // for next tests + } else + qrp= JDBCColumns(g, shm, tab, NULL, mxr, fnc == FNC_COL, sjp); + + break; + case FNC_TABLE: + qrp= JDBCTables(g, shm, tab, tabtyp, mxr, true, sjp); + break; +#if 0 + case FNC_DSN: + qrp= JDBCDataSources(g, mxr, true); + break; +#endif // 0 + case FNC_DRIVER: + qrp= JDBCDrivers(g, mxr, true); + break; + default: + sprintf(g->Message, "invalid catfunc %s", fncn); + break; + } // endswitch info + + break; +#endif // JDBC_SUPPORT + case TAB_MYSQL: qrp= MyColumns(g, thd, host, db, user, pwd, tab, NULL, port, fnc == FNC_COL); break; @@ -5515,21 +5618,16 @@ static int connect_assisted_discovery(handlerton *, THD* thd, len= crp->Length; dec= crp->Prec; flg= crp->Flag; - v= crp->Var; + v= (crp->Kdata->IsUnsigned()) ? 'U' : crp->Var; tm= (crp->Kdata->IsNullable()) ? 0 : NOT_NULL_FLAG; if (!len && typ == TYPE_STRING) len= 256; // STRBLK's have 0 length // Now add the field -#if defined(NEW_WAY) - rc= add_fields(g, thd, &alter_info, cnm, typ, len, dec, - tm, "", flg, dbf, v); -#else // !NEW_WAY if (add_field(&sql, cnm, typ, len, dec, NULL, tm, NULL, NULL, NULL, NULL, flg, dbf, v)) rc= HA_ERR_OUT_OF_MEM; -#endif // !NEW_WAY } // endfor crp } else { @@ -5552,12 +5650,7 @@ static int connect_assisted_discovery(handlerton *, THD* thd, cnm= (char*)"noname"; dft= xtra= key= fmt= NULL; v= ' '; -#if defined(NEW_WAY) - rem= ""; -// cs= NULL; -#else // !NEW_WAY rem= NULL; -#endif // !NEW_WAY for (crp= qrp->Colresp; crp; crp= crp->Next) switch (crp->Fld) { @@ -5626,10 +5719,10 @@ static int connect_assisted_discovery(handlerton *, THD* thd, "Several %s tables found, specify DBNAME", tab); my_message(ER_UNKNOWN_ERROR, g->Message, MYF(0)); goto err; - } else if (!schem) + } else if (!schem) schem= crp->Kdata->GetCharValue(i); - } // endif ttp + } // endif ttp #endif // ODBC_SUPPORT default: break; // Ignore @@ -5678,7 +5771,40 @@ static int connect_assisted_discovery(handlerton *, THD* thd, } else #endif // ODBC_SUPPORT - // Make the arguments as required by add_fields +#if defined(JDBC_SUPPORT) + if (ttp == TAB_JDBC) { + int plgtyp; + + // typ must be PLG type, not SQL type + if (!(plgtyp= TranslateJDBCType(typ, dec, prec, v))) { + if (GetTypeConv() == TPC_SKIP) { + // Skip this column + sprintf(g->Message, "Column %s skipped (unsupported type %d)", + cnm, typ); + push_warning(thd, Sql_condition::WARN_LEVEL_WARN, 0, g->Message); + continue; + } else { + sprintf(g->Message, "Unsupported SQL type %d", typ); + my_message(ER_UNKNOWN_ERROR, g->Message, MYF(0)); + goto err; + } // endif type_conv + + } else + typ= plgtyp; + + switch (typ) { + case TYPE_DOUBLE: + case TYPE_DECIM: + // Some data sources do not count dec in length (prec) + prec += (dec + 2); // To be safe + break; + default: + dec= 0; + } // endswitch typ + + } else +#endif // ODBC_SUPPORT + // Make the arguments as required by add_fields if (typ == TYPE_DOUBLE) prec= len; @@ -5686,25 +5812,15 @@ static int connect_assisted_discovery(handlerton *, THD* thd, prec= 0; // Now add the field -#if defined(NEW_WAY) - rc= add_fields(g, thd, &alter_info, cnm, typ, prec, dec, - tm, rem, 0, dbf, v); -#else // !NEW_WAY if (add_field(&sql, cnm, typ, prec, dec, key, tm, rem, dft, xtra, fmt, 0, dbf, v)) rc= HA_ERR_OUT_OF_MEM; -#endif // !NEW_WAY } // endfor i } // endif fnc -#if defined(NEW_WAY) - rc= init_table_share(thd, table_s, create_info, &alter_info); -#else // !NEW_WAY if (!rc) rc= init_table_share(thd, table_s, create_info, &sql); -// rc= init_table_share(thd, table_s, create_info, dsn, &sql); -#endif // !NEW_WAY g->jump_level--; return rc; @@ -6141,7 +6257,7 @@ int ha_connect::create(const char *name, TABLE *table_arg, strcpy(dbpath, name); p= strrchr(dbpath, slash); - strcpy(partname, ++p); + strncpy(partname, ++p, sizeof(partname) - 1); strcat(strcat(strcpy(buf, p), "."), lwt); *p= 0; } else { @@ -6192,7 +6308,7 @@ int ha_connect::create(const char *name, TABLE *table_arg, #if defined(WITH_PARTITION_STORAGE_ENGINE) if (part_info && !inward) - strcpy(partname, decode(g, strrchr(name, '#') + 1)); + strncpy(partname, decode(g, strrchr(name, '#') + 1), sizeof(partname) - 1); // strcpy(partname, part_info->curr_part_elem->partition_name); #endif // WITH_PARTITION_STORAGE_ENGINE @@ -6233,8 +6349,9 @@ int ha_connect::create(const char *name, TABLE *table_arg, #if defined(WITH_PARTITION_STORAGE_ENGINE) if (part_info) - strcpy(partname, - decode(g, strrchr(name, (inward ? slash : '#')) + 1)); + strncpy(partname, + decode(g, strrchr(name, (inward ? slash : '#')) + 1), + sizeof(partname) - 1); #endif // WITH_PARTITION_STORAGE_ENGINE if ((rc= optimize(table->in_use, NULL))) { @@ -6745,6 +6862,27 @@ static MYSQL_SYSVAR_STR(errmsg_dir_path, msg_path, "../../../../storage/connect/"); // for testing #endif // XMSG +#if defined(JDBC_SUPPORT) +static MYSQL_SYSVAR_STR(jvm_path, JvmPath, + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_MEMALLOC, + "Path to the directory where is the JVM lib", + // check_jvm_path, update_jvm_path, + NULL, NULL, NULL); + +static MYSQL_SYSVAR_STR(class_path, ClassPath, + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_MEMALLOC, + "Java class path", + // check_class_path, update_class_path, + NULL, NULL, NULL); + +static MYSQL_SYSVAR_STR(java_wrapper, Wrapper, + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_MEMALLOC, + "Java wrapper class", + // check_class_path, update_class_path, + NULL, NULL, "JdbcInterface"); +#endif // JDBC_SUPPORT + + static struct st_mysql_sys_var* connect_system_variables[]= { MYSQL_SYSVAR(xtrace), MYSQL_SYSVAR(conv_size), @@ -6762,7 +6900,12 @@ static struct st_mysql_sys_var* connect_system_variables[]= { MYSQL_SYSVAR(errmsg_dir_path), #endif // XMSG MYSQL_SYSVAR(json_grp_size), - NULL +#if defined(JDBC_SUPPORT) + MYSQL_SYSVAR(jvm_path), + MYSQL_SYSVAR(class_path), + MYSQL_SYSVAR(java_wrapper), +#endif // JDBC_SUPPORT + NULL }; maria_declare_plugin(connect) diff --git a/storage/connect/ha_connect.h b/storage/connect/ha_connect.h index 05cc872fa2a..60194ac0e3c 100644 --- a/storage/connect/ha_connect.h +++ b/storage/connect/ha_connect.h @@ -536,7 +536,7 @@ private: DsMrr_impl ds_mrr; protected: - bool check_privileges(THD *thd, PTOS options, char *dbn); + bool check_privileges(THD *thd, PTOS options, char *dbn, bool quick=false); MODE CheckMode(PGLOBAL g, THD *thd, MODE newmode, bool *chk, bool *cras); char *GetDBfromName(const char *name); @@ -554,7 +554,7 @@ protected: PVAL sdvalin4; // Used to convert date values PVAL sdvalout; // Used to convert date values bool istable; // True for table handler - char partname[64]; // The partition name + char partname[65]; // The partition name MODE xmod; // Table mode XINFO xinfo; // The table info structure bool valid_info; // True if xinfo is valid diff --git a/storage/connect/inihandl.c b/storage/connect/inihandl.c index 542b807f899..46102557b20 100644 --- a/storage/connect/inihandl.c +++ b/storage/connect/inihandl.c @@ -622,13 +622,16 @@ void PROFILE_End(void) if (trace) htrc("PROFILE_End: CurProfile=%p N=%d\n", CurProfile, N_CACHED_PROFILES); + if (!CurProfile) // Sergey Vojtovich + return; + /* Close all opened files and free the cache structure */ for (i = 0; i < N_CACHED_PROFILES; i++) { if (trace) htrc("MRU=%s i=%d\n", SVP(MRUProfile[i]->filename), i); - CurProfile = MRUProfile[i]; - PROFILE_ReleaseFile(); +// CurProfile = MRUProfile[i]; Sergey Vojtovich +// PROFILE_ReleaseFile(); see MDEV-9997 free(MRUProfile[i]); } // endfor i diff --git a/storage/connect/jdbccat.h b/storage/connect/jdbccat.h new file mode 100644 index 00000000000..37f33d7063d --- /dev/null +++ b/storage/connect/jdbccat.h @@ -0,0 +1,29 @@ +// Timeout and net wait defaults +#define DEFAULT_LOGIN_TIMEOUT -1 // means do not set +#define DEFAULT_QUERY_TIMEOUT -1 // means do not set + +typedef struct jdbc_parms { + int CheckSize(int rows); + char *Driver; // JDBC driver + char *Url; // Driver URL + char *User; // User connect info + char *Pwd; // Password connect info +//int Cto; // Connect timeout +//int Qto; // Query timeout + int Fsize; // Fetch size + bool Scrollable; // Scrollable cursor +} JDBCPARM, *PJPARM; + +/***********************************************************************/ +/* JDBC catalog function prototypes. */ +/***********************************************************************/ +#if defined(PROMPT_OK) +char *JDBCCheckConnection(PGLOBAL g, char *dsn, int cop); +#endif // PROMPT_OK +//PQRYRES JDBCDataSources(PGLOBAL g, int maxres, bool info); +PQRYRES JDBCColumns(PGLOBAL g, char *db, char *table, + char *colpat, int maxres, bool info, PJPARM sop); +PQRYRES JDBCSrcCols(PGLOBAL g, char *src, PJPARM sop); +PQRYRES JDBCTables(PGLOBAL g, char *db, char *tabpat, + char *tabtyp, int maxres, bool info, PJPARM sop); +PQRYRES JDBCDrivers(PGLOBAL g, int maxres, bool info); diff --git a/storage/connect/jdbconn.cpp b/storage/connect/jdbconn.cpp new file mode 100644 index 00000000000..9b479277df2 --- /dev/null +++ b/storage/connect/jdbconn.cpp @@ -0,0 +1,2114 @@ +/************ Jdbconn C++ Functions Source Code File (.CPP) ************/ +/* Name: JDBCONN.CPP Version 1.0 */ +/* */ +/* (C) Copyright to the author Olivier BERTRAND 2016 */ +/* */ +/* This file contains the JDBC connection classes functions. */ +/***********************************************************************/ + +/***********************************************************************/ +/* Include relevant MariaDB header file. */ +/***********************************************************************/ +#include +#include +#if defined(__WIN__) +//nclude +//nclude +#include // for getcwd +#if defined(__BORLANDC__) +#define __MFC_COMPAT__ // To define min/max as macro +#endif // __BORLANDC__ +//#include +#else // !__WIN__ +#if defined(UNIX) +#include +#else // !UNIX +//nclude +#endif // !UNIX +#include +#include // for getenv +//nclude +#define NODW +#endif // !__WIN__ + +/***********************************************************************/ +/* Required objects includes. */ +/***********************************************************************/ +#include "global.h" +#include "plgdbsem.h" +#include "xobject.h" +#include "xtable.h" +#include "tabjdbc.h" +//#include "jdbconn.h" +//#include "plgcnx.h" // For DB types +#include "resource.h" +#include "valblk.h" +#include "osutil.h" + + +#if defined(__WIN__) +extern "C" HINSTANCE s_hModule; // Saved module handle +#else // !__WIN__ +#define nullptr 0 +#endif // !__WIN__ + +int GetConvSize(); +extern char *JvmPath; // The connect_jvm_path global variable value +extern char *ClassPath; // The connect_class_path global variable value +extern char *Wrapper; // The connect_java_wrapper global variable value + +/***********************************************************************/ +/* Static JDBConn objects. */ +/***********************************************************************/ +void *JDBConn::LibJvm = NULL; +CRTJVM JDBConn::CreateJavaVM = NULL; +GETJVM JDBConn::GetCreatedJavaVMs = NULL; +#if defined(_DEBUG) +GETDEF JDBConn::GetDefaultJavaVMInitArgs = NULL; +#endif // _DEBUG + +/***********************************************************************/ +/* Some macro's (should be defined elsewhere to be more accessible) */ +/***********************************************************************/ +#if defined(_DEBUG) +#define ASSERT(f) assert(f) +#define DEBUG_ONLY(f) (f) +#else // !_DEBUG +#define ASSERT(f) ((void)0) +#define DEBUG_ONLY(f) ((void)0) +#endif // !_DEBUG + +// To avoid gcc warning +int TranslateJDBCType(int stp, int prec, int& len, char& v); + +/***********************************************************************/ +/* GetJDBCType: returns the SQL_TYPE corresponding to a PLG type. */ +/***********************************************************************/ +static short GetJDBCType(int type) +{ + short tp = 0; // NULL + + switch (type) { + case TYPE_STRING: tp = 12; break; // VARCHAR + case TYPE_SHORT: tp = 5; break; // SMALLINT + case TYPE_INT: tp = 4; break; // INTEGER + case TYPE_DATE: tp = 93; break; // DATE +//case TYPE_TIME: tp = 92; break; // TIME +//case TYPE_TIMESTAMP: tp = 93; break; // TIMESTAMP + case TYPE_BIGINT: tp = -5; break; // BIGINT + case TYPE_DOUBLE: tp = 8; break; // DOUBLE + case TYPE_TINY: tp = -6; break; // TINYINT + case TYPE_DECIM: tp = 3; break; // DECIMAL + } // endswitch type + + return tp; +} // end of GetJDBCType + +/***********************************************************************/ +/* TranslateJDBCType: translate a JDBC Type to a PLG type. */ +/***********************************************************************/ +int TranslateJDBCType(int stp, int prec, int& len, char& v) +{ + int type; + + switch (stp) { + case -1: // LONGVARCHAR + len = MY_MIN(abs(len), GetConvSize()); + case 12: // VARCHAR + v = 'V'; + case 1: // CHAR + type = TYPE_STRING; + break; + case 2: // NUMERIC + case 3: // DECIMAL + case -3: // VARBINARY + type = TYPE_DECIM; + break; + case 4: // INTEGER + type = TYPE_INT; + break; + case 5: // SMALLINT + type = TYPE_SHORT; + break; + case -6: // TINYINT + case -7: // BIT + type = TYPE_TINY; + break; + case 6: // FLOAT + case 7: // REAL + case 8: // DOUBLE + type = TYPE_DOUBLE; + break; + case 93: // TIMESTAMP + type = TYPE_DATE; + len = 19 + ((prec) ? (prec+1) : 0); + v = 'S'; + break; + case 91: // TYPE_DATE + type = TYPE_DATE; + len = 10; + v = 'D'; + break; + case 92: // TYPE_TIME + type = TYPE_DATE; + len = 8 + ((prec) ? (prec+1) : 0); + v = 'T'; + break; + case -5: // BIGINT + type = TYPE_BIGINT; + break; + case 0: // NULL + case -2: // BINARY + case -4: // LONGVARBINARY + default: + type = TYPE_ERROR; + len = 0; + } // endswitch type + + return type; +} // end of TranslateJDBCType + +/***********************************************************************/ +/* Allocate the structure used to refer to the result set. */ +/***********************************************************************/ +static JCATPARM *AllocCatInfo(PGLOBAL g, JCATINFO fid, char *db, + char *tab, PQRYRES qrp) +{ + JCATPARM *cap; + +#if defined(_DEBUG) + assert(qrp); +#endif + + if ((cap = (JCATPARM *)PlgDBSubAlloc(g, NULL, sizeof(JCATPARM)))) { + memset(cap, 0, sizeof(JCATPARM)); + cap->Id = fid; + cap->Qrp = qrp; + cap->DB = db; + cap->Tab = tab; + } // endif cap + + return cap; +} // end of AllocCatInfo + +/***********************************************************************/ +/* JDBCColumns: constructs the result blocks containing all columns */ +/* of a JDBC table that will be retrieved by GetData commands. */ +/***********************************************************************/ +PQRYRES JDBCColumns(PGLOBAL g, char *db, char *table, char *colpat, + int maxres, bool info, PJPARM sjp) +{ + int buftyp[] = {TYPE_STRING, TYPE_STRING, TYPE_STRING, TYPE_STRING, + TYPE_SHORT, TYPE_STRING, TYPE_INT, TYPE_INT, + TYPE_SHORT, TYPE_SHORT, TYPE_SHORT, TYPE_STRING}; + XFLD fldtyp[] = {FLD_CAT, FLD_SCHEM, FLD_TABNAME, FLD_NAME, + FLD_TYPE, FLD_TYPENAME, FLD_PREC, FLD_LENGTH, + FLD_SCALE, FLD_RADIX, FLD_NULL, FLD_REM}; + unsigned int length[] = {0, 0, 0, 0, 6, 0, 10, 10, 6, 6, 6, 0}; + bool b[] = {true, true, false, false, false, false, false, false, true, true, false, true}; + int i, n, ncol = 12; + PCOLRES crp; + PQRYRES qrp; + JCATPARM *cap; + JDBConn *jcp = NULL; + + /************************************************************************/ + /* Do an evaluation of the result size. */ + /************************************************************************/ + if (!info) { + jcp = new(g)JDBConn(g, NULL); + + if (jcp->Open(sjp) != RC_OK) // openReadOnly + noJDBCdialog + return NULL; + + if (table && !strchr(table, '%')) { + // We fix a MySQL limit because some data sources return 32767 + n = jcp->GetMaxValue(1); // MAX_COLUMNS_IN_TABLE) + maxres = (n > 0) ? MY_MIN(n, 4096) : 4096; + } else if (!maxres) + maxres = 20000; + + // n = jcp->GetMaxValue(2); MAX_CATALOG_NAME_LEN + // length[0] = (n) ? (n + 1) : 0; + // n = jcp->GetMaxValue(3); MAX_SCHEMA_NAME_LEN + // length[1] = (n) ? (n + 1) : 0; + // n = jcp->GetMaxValue(4); MAX_TABLE_NAME_LEN + // length[2] = (n) ? (n + 1) : 0; + n = jcp->GetMaxValue(5); // MAX_COLUMN_NAME_LEN + length[3] = (n > 0) ? (n + 1) : 128; + } else { // Info table + maxres = 0; + length[0] = 128; + length[1] = 128; + length[2] = 128; + length[3] = 128; + length[5] = 30; + length[11] = 255; + } // endif jcp + + if (trace) + htrc("JDBCColumns: max=%d len=%d,%d,%d,%d\n", + maxres, length[0], length[1], length[2], length[3]); + + /************************************************************************/ + /* Allocate the structures used to refer to the result set. */ + /************************************************************************/ + qrp = PlgAllocResult(g, ncol, maxres, IDS_COLUMNS, + buftyp, fldtyp, length, false, true); + + for (i = 0, crp = qrp->Colresp; crp; i++, crp = crp->Next) + if (b[i]) + crp->Kdata->SetNullable(true); + + if (info || !qrp) // Info table + return qrp; + + if (trace) + htrc("Getting col results ncol=%d\n", qrp->Nbcol); + + if (!(cap = AllocCatInfo(g, CAT_COL, db, table, qrp))) + return NULL; + + // Colpat cannot be null or empty for some drivers + cap->Pat = (colpat && *colpat) ? colpat : "%"; + + /************************************************************************/ + /* Now get the results into blocks. */ + /************************************************************************/ + if ((n = jcp->GetCatInfo(cap)) >= 0) { + qrp->Nblin = n; + // ResetNullValues(cap); + + if (trace) + htrc("Columns: NBCOL=%d NBLIN=%d\n", qrp->Nbcol, qrp->Nblin); + + } else + qrp = NULL; + + /* Cleanup */ + jcp->Close(); + + /************************************************************************/ + /* Return the result pointer for use by GetData routines. */ + /************************************************************************/ + return qrp; +} // end of JDBCColumns + +/**************************************************************************/ +/* JDBCSrcCols: constructs the result blocks containing the */ +/* description of all the columns of a Srcdef option. */ +/**************************************************************************/ +PQRYRES JDBCSrcCols(PGLOBAL g, char *src, PJPARM sjp) +{ + PQRYRES qrp; + JDBConn *jcp = new(g)JDBConn(g, NULL); + + if (jcp->Open(sjp)) + return NULL; + + qrp = jcp->GetMetaData(g, src); + jcp->Close(); + return qrp; +} // end of JDBCSrcCols + +/**************************************************************************/ +/* JDBCTables: constructs the result blocks containing all tables in */ +/* an JDBC database that will be retrieved by GetData commands. */ +/**************************************************************************/ +PQRYRES JDBCTables(PGLOBAL g, char *db, char *tabpat, char *tabtyp, + int maxres, bool info, PJPARM sjp) +{ + int buftyp[] = {TYPE_STRING, TYPE_STRING, TYPE_STRING, + TYPE_STRING, TYPE_STRING}; + XFLD fldtyp[] = {FLD_CAT, FLD_SCHEM, FLD_NAME, FLD_TYPE, FLD_REM}; + unsigned int length[] = {0, 0, 0, 16, 0}; + bool b[] = {true, true, false, false, true}; + int i, n, ncol = 5; + PCOLRES crp; + PQRYRES qrp; + JCATPARM *cap; + JDBConn *jcp = NULL; + + /************************************************************************/ + /* Do an evaluation of the result size. */ + /************************************************************************/ + if (!info) { + /**********************************************************************/ + /* Open the connection with the JDBC data source. */ + /**********************************************************************/ + jcp = new(g)JDBConn(g, NULL); + + if (jcp->Open(sjp) == RC_FX) + return NULL; + + if (!maxres) + maxres = 10000; // This is completely arbitrary + + n = jcp->GetMaxValue(2); // Max catalog name length + +// if (n < 0) +// return NULL; + + length[0] = (n > 0) ? (n + 1) : 0; + n = jcp->GetMaxValue(3); // Max schema name length + length[1] = (n > 0) ? (n + 1) : 0; + n = jcp->GetMaxValue(4); // Max table name length + length[2] = (n > 0) ? (n + 1) : 128; + } else { + maxres = 0; + length[0] = 128; + length[1] = 128; + length[2] = 128; + length[4] = 255; + } // endif info + + if (trace) + htrc("JDBCTables: max=%d len=%d,%d\n", maxres, length[0], length[1]); + + /************************************************************************/ + /* Allocate the structures used to refer to the result set. */ + /************************************************************************/ + qrp = PlgAllocResult(g, ncol, maxres, IDS_TABLES, buftyp, + fldtyp, length, false, true); + + for (i = 0, crp = qrp->Colresp; crp; i++, crp = crp->Next) + if (b[i]) + crp->Kdata->SetNullable(true); + + if (info || !qrp) + return qrp; + + if (!(cap = AllocCatInfo(g, CAT_TAB, db, tabpat, qrp))) + return NULL; + + cap->Pat = tabtyp; + + if (trace) + htrc("Getting table results ncol=%d\n", cap->Qrp->Nbcol); + + /************************************************************************/ + /* Now get the results into blocks. */ + /************************************************************************/ + if ((n = jcp->GetCatInfo(cap)) >= 0) { + qrp->Nblin = n; + // ResetNullValues(cap); + + if (trace) + htrc("Tables: NBCOL=%d NBLIN=%d\n", qrp->Nbcol, qrp->Nblin); + + } else + qrp = NULL; + + /************************************************************************/ + /* Close any local connection. */ + /************************************************************************/ + jcp->Close(); + + /************************************************************************/ + /* Return the result pointer for use by GetData routines. */ + /************************************************************************/ + return qrp; +} // end of JDBCTables + +/*************************************************************************/ +/* JDBCDrivers: constructs the result blocks containing all JDBC */ +/* drivers available on the local host. */ +/* Called with info=true to have result column names. */ +/*************************************************************************/ +PQRYRES JDBCDrivers(PGLOBAL g, int maxres, bool info) +{ + int buftyp[] ={TYPE_STRING, TYPE_STRING, TYPE_STRING, TYPE_STRING}; + XFLD fldtyp[] ={FLD_NAME, FLD_EXTRA, FLD_DEFAULT, FLD_REM }; + unsigned int length[] ={ 128, 32, 4, 256 }; + bool b[] ={ false, false, false, true }; + int i, ncol = 4; + PCOLRES crp; + PQRYRES qrp; + JDBConn *jcp = NULL; + + /************************************************************************/ + /* Do an evaluation of the result size. */ + /************************************************************************/ + if (!info) { + jcp = new(g) JDBConn(g, NULL); + + if (jcp->Open(NULL) != RC_OK) + return NULL; + + if (!maxres) + maxres = 256; // Estimated max number of drivers + + } else + maxres = 0; + + if (trace) + htrc("JDBCDrivers: max=%d len=%d\n", maxres, length[0]); + + /************************************************************************/ + /* Allocate the structures used to refer to the result set. */ + /************************************************************************/ + qrp = PlgAllocResult(g, ncol, maxres, 0, buftyp, fldtyp, length, false, true); + + for (i = 0, crp = qrp->Colresp; crp; i++, crp = crp->Next) { + if (b[i]) + crp->Kdata->SetNullable(true); + + switch (i) { + case 0: crp->Name = "Name"; break; + case 1: crp->Name = "Version"; break; + case 2: crp->Name = "Compliant"; break; + case 3: crp->Name = "Description"; break; + } // endswitch + + } // endfor i + + /************************************************************************/ + /* Now get the results into blocks. */ + /************************************************************************/ + if (!info && qrp && jcp->GetDrivers(qrp)) + qrp = NULL; + + if (!info) + jcp->Close(); + + /************************************************************************/ + /* Return the result pointer for use by GetData routines. */ + /************************************************************************/ + return qrp; +} // end of JDBCDrivers + +#if 0 +/*************************************************************************/ +/* JDBCDataSources: constructs the result blocks containing all JDBC */ +/* data sources available on the local host. */ +/* Called with info=true to have result column names. */ +/*************************************************************************/ +PQRYRES JDBCDataSources(PGLOBAL g, int maxres, bool info) +{ + int buftyp[] ={ TYPE_STRING, TYPE_STRING }; + XFLD fldtyp[] ={ FLD_NAME, FLD_REM }; + unsigned int length[] ={ 0, 256 }; + bool b[] ={ false, true }; + int i, n = 0, ncol = 2; + PCOLRES crp; + PQRYRES qrp; + JDBConn *jcp = NULL; + + /************************************************************************/ + /* Do an evaluation of the result size. */ + /************************************************************************/ + if (!info) { + jcp = new(g)JDBConn(g, NULL); + n = jcp->GetMaxValue(SQL_MAX_DSN_LENGTH); + length[0] = (n) ? (n + 1) : 256; + + if (!maxres) + maxres = 512; // Estimated max number of data sources + + } else { + length[0] = 256; + maxres = 0; + } // endif info + + if (trace) + htrc("JDBCDataSources: max=%d len=%d\n", maxres, length[0]); + + /************************************************************************/ + /* Allocate the structures used to refer to the result set. */ + /************************************************************************/ + qrp = PlgAllocResult(g, ncol, maxres, IDS_DSRC, + buftyp, fldtyp, length, false, true); + + for (i = 0, crp = qrp->Colresp; crp; i++, crp = crp->Next) + if (b[i]) + crp->Kdata->SetNullable(true); + + /************************************************************************/ + /* Now get the results into blocks. */ + /************************************************************************/ + if (!info && qrp && jcp->GetDataSources(qrp)) + qrp = NULL; + + /************************************************************************/ + /* Return the result pointer for use by GetData routines. */ + /************************************************************************/ + return qrp; +} // end of JDBCDataSources + +/**************************************************************************/ +/* PrimaryKeys: constructs the result blocks containing all the */ +/* JDBC catalog information concerning primary keys. */ +/**************************************************************************/ +PQRYRES JDBCPrimaryKeys(PGLOBAL g, JDBConn *op, char *dsn, char *table) +{ + static int buftyp[] ={ TYPE_STRING, TYPE_STRING, TYPE_STRING, + TYPE_STRING, TYPE_SHORT, TYPE_STRING }; + static unsigned int length[] ={ 0, 0, 0, 0, 6, 128 }; + int n, ncol = 5; + int maxres; + PQRYRES qrp; + JCATPARM *cap; + JDBConn *jcp = op; + + if (!op) { + /**********************************************************************/ + /* Open the connection with the JDBC data source. */ + /**********************************************************************/ + jcp = new(g)JDBConn(g, NULL); + + if (jcp->Open(dsn, 2) < 1) // 2 is openReadOnly + return NULL; + + } // endif op + + /************************************************************************/ + /* Do an evaluation of the result size. */ + /************************************************************************/ + n = jcp->GetMaxValue(SQL_MAX_COLUMNS_IN_TABLE); + maxres = (n) ? (int)n : 250; + n = jcp->GetMaxValue(SQL_MAX_CATALOG_NAME_LEN); + length[0] = (n) ? (n + 1) : 128; + n = jcp->GetMaxValue(SQL_MAX_SCHEMA_NAME_LEN); + length[1] = (n) ? (n + 1) : 128; + n = jcp->GetMaxValue(SQL_MAX_TABLE_NAME_LEN); + length[2] = (n) ? (n + 1) : 128; + n = jcp->GetMaxValue(SQL_MAX_COLUMN_NAME_LEN); + length[3] = (n) ? (n + 1) : 128; + + if (trace) + htrc("JDBCPrimaryKeys: max=%d len=%d,%d,%d\n", + maxres, length[0], length[1], length[2]); + + /************************************************************************/ + /* Allocate the structure used to refer to the result set. */ + /************************************************************************/ + qrp = PlgAllocResult(g, ncol, maxres, IDS_PKEY, + buftyp, NULL, length, false, true); + + if (trace) + htrc("Getting pkey results ncol=%d\n", qrp->Nbcol); + + cap = AllocCatInfo(g, CAT_KEY, NULL, table, qrp); + + /************************************************************************/ + /* Now get the results into blocks. */ + /************************************************************************/ + if ((n = jcp->GetCatInfo(cap)) >= 0) { + qrp->Nblin = n; + // ResetNullValues(cap); + + if (trace) + htrc("PrimaryKeys: NBCOL=%d NBLIN=%d\n", qrp->Nbcol, qrp->Nblin); + + } else + qrp = NULL; + + /************************************************************************/ + /* Close any local connection. */ + /************************************************************************/ + if (!op) + jcp->Close(); + + /************************************************************************/ + /* Return the result pointer for use by GetData routines. */ + /************************************************************************/ + return qrp; +} // end of JDBCPrimaryKeys +#endif // 0 + +/***********************************************************************/ +/* JDBConn construction/destruction. */ +/***********************************************************************/ +JDBConn::JDBConn(PGLOBAL g, TDBJDBC *tdbp) +{ + m_G = g; + m_Tdb = tdbp; + jvm = nullptr; // Pointer to the JVM (Java Virtual Machine) + env= nullptr; // Pointer to native interface + jdi = nullptr; // Pointer to the java wrapper class + job = nullptr; // The java wrapper class object + xqid = xuid = xid = grs = readid = fetchid = typid = errid = nullptr; + prepid = xpid = pcid = nullptr; + chrfldid = intfldid = dblfldid = fltfldid = datfldid = bigfldid = nullptr; +//m_LoginTimeout = DEFAULT_LOGIN_TIMEOUT; +//m_QueryTimeout = DEFAULT_QUERY_TIMEOUT; +//m_UpdateOptions = 0; + Msg = NULL; + m_Driver = NULL; + m_Url = NULL; + m_User = NULL; + m_Pwd = NULL; + m_Ncol = 0; + m_Aff = 0; + m_Rows = 0; + m_Fetch = 0; + m_RowsetSize = 0; + m_Updatable = true; + m_Transact = false; + m_Scrollable = false; + m_Full = false; + m_Opened = false; + m_IDQuoteChar[0] = '"'; + m_IDQuoteChar[1] = 0; + //*m_ErrMsg = '\0'; +} // end of JDBConn + +//JDBConn::~JDBConn() +// { +//if (Connected()) +// EndCom(); + +// } // end of ~JDBConn + +/***********************************************************************/ +/* Screen for errors. */ +/***********************************************************************/ +bool JDBConn::Check(jint rc) +{ + jstring s; + + if (env->ExceptionCheck()) { + jthrowable exc = env->ExceptionOccurred(); + jmethodID tid = env->GetMethodID(env->FindClass("java/lang/Object"), + "toString", "()Ljava/lang/String;"); + + if (exc != nullptr && tid != nullptr) { + jstring s = (jstring)env->CallObjectMethod(exc, tid); + const char *utf = env->GetStringUTFChars(s, (jboolean)false); + env->DeleteLocalRef(s); + Msg = PlugDup(m_G, utf); + } else + Msg = "Exception occured"; + + env->ExceptionClear(); + } else if (rc < 0) { + s = (jstring)env->CallObjectMethod(job, errid); + Msg = (char*)env->GetStringUTFChars(s, (jboolean)false); + } else + Msg = NULL; + + return (Msg != NULL); +} // end of Check + +/***********************************************************************/ +/* Get MethodID if not exists yet. */ +/***********************************************************************/ +bool JDBConn::gmID(PGLOBAL g, jmethodID& mid, const char *name, const char *sig) +{ + if (mid == nullptr) { + mid = env->GetMethodID(jdi, name, sig); + + if (Check()) { + strcpy(g->Message, Msg); + return true; + } else + return false; + + } else + return false; + +} // end of gmID + +#if 0 +/***********************************************************************/ +/* Utility routine. */ +/***********************************************************************/ +PSZ JDBConn::GetStringInfo(ushort infotype) +{ + //ASSERT(m_hdbc != SQL_NULL_HDBC); + char *p, buffer[MAX_STRING_INFO]; + SWORD result; + RETCODE rc; + + rc = SQLGetInfo(m_hdbc, infotype, buffer, sizeof(buffer), &result); + + if (!Check(rc)) { + ThrowDJX(rc, "SQLGetInfo"); // Temporary + // *buffer = '\0'; + } // endif rc + + p = PlugDup(m_G, buffer); + return p; +} // end of GetStringInfo + +/***********************************************************************/ +/* Utility routines. */ +/***********************************************************************/ +void JDBConn::OnSetOptions(HSTMT hstmt) +{ + RETCODE rc; + ASSERT(m_hdbc != SQL_NULL_HDBC); + + if ((signed)m_QueryTimeout != -1) { + // Attempt to set query timeout. Ignore failure + rc = SQLSetStmtOption(hstmt, SQL_QUERY_TIMEOUT, m_QueryTimeout); + + if (!Check(rc)) + // don't attempt it again + m_QueryTimeout = (DWORD)-1; + + } // endif m_QueryTimeout + + if (m_RowsetSize > 0) { + // Attempt to set rowset size. + // In case of failure reset it to 0 to use Fetch. + rc = SQLSetStmtOption(hstmt, SQL_ROWSET_SIZE, m_RowsetSize); + + if (!Check(rc)) + // don't attempt it again + m_RowsetSize = 0; + + } // endif m_RowsetSize + +} // end of OnSetOptions +#endif // 0 + +/***********************************************************************/ +/* Utility routine. */ +/***********************************************************************/ +int JDBConn::GetMaxValue(int n) +{ + jint m; + jmethodID maxid = nullptr; + + if (gmID(m_G, maxid, "GetMaxValue", "(I)I")) + return -1; + + // call method + if (Check(m = env->CallIntMethod(job, maxid, n))) + htrc("GetMaxValue: %s", Msg); + + return (int)m; +} // end of GetMaxValue + +/***********************************************************************/ +/* Reset the JVM library. */ +/***********************************************************************/ +void JDBConn::ResetJVM(void) +{ + if (LibJvm) { +#if defined(__WIN__) + FreeLibrary((HMODULE)LibJvm); +#else // !__WIN__ + dlclose(LibJvm); +#endif // !__WIN__ + LibJvm = NULL; + CreateJavaVM = NULL; + GetCreatedJavaVMs = NULL; +#if defined(_DEBUG) + GetDefaultJavaVMInitArgs = NULL; +#endif // _DEBUG + } // endif LibJvm + +} // end of ResetJVM + +/***********************************************************************/ +/* Dynamically link the JVM library. */ +/* The purpose of this function is to allow using the CONNECT plugin */ +/* for other table types when the Java JDK is not installed. */ +/***********************************************************************/ +bool JDBConn::GetJVM(PGLOBAL g) +{ + if (!LibJvm) { + char soname[512]; + +#if defined(__WIN__) + if (JvmPath) + strcat(strcpy(soname, JvmPath), "\\jvm.dll"); + else + strcpy(soname, "jvm.dll"); + + // Load the desired shared library + if (!(LibJvm = LoadLibrary(soname))) { + char buf[256]; + DWORD rc = GetLastError(); + + sprintf(g->Message, MSG(DLL_LOAD_ERROR), rc, soname); + FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, NULL, rc, 0, + (LPTSTR)buf, sizeof(buf), NULL); + strcat(strcat(g->Message, ": "), buf); + } else if (!(CreateJavaVM = (CRTJVM)GetProcAddress((HINSTANCE)LibJvm, + "JNI_CreateJavaVM"))) { + sprintf(g->Message, MSG(PROCADD_ERROR), GetLastError(), "JNI_CreateJavaVM"); + FreeLibrary((HMODULE)LibJvm); + LibJvm = NULL; + } else if (!(GetCreatedJavaVMs = (GETJVM)GetProcAddress((HINSTANCE)LibJvm, + "JNI_GetCreatedJavaVMs"))) { + sprintf(g->Message, MSG(PROCADD_ERROR), GetLastError(), "JNI_GetCreatedJavaVMs"); + FreeLibrary((HMODULE)LibJvm); + LibJvm = NULL; +#if defined(_DEBUG) + } else if (!(GetDefaultJavaVMInitArgs = (GETDEF)GetProcAddress((HINSTANCE)LibJvm, + "JNI_GetDefaultJavaVMInitArgs"))) { + sprintf(g->Message, MSG(PROCADD_ERROR), GetLastError(), + "JNI_GetDefaultJavaVMInitArgs"); + FreeLibrary((HMODULE)LibJvm); + LibJvm = NULL; +#endif // _DEBUG + } // endif LibJvm +#else // !__WIN__ + const char *error = NULL; + + if (JvmPath) + strcat(strcpy(soname, JvmPath), "/libjvm.so"); + else + strcpy(soname, "libjvm.so"); + + // Load the desired shared library + if (!(LibJvm = dlopen(soname, RTLD_LAZY))) { + error = dlerror(); + sprintf(g->Message, MSG(SHARED_LIB_ERR), soname, SVP(error)); + } else if (!(CreateJavaVM = (CRTJVM)dlsym(LibJvm, "JNI_CreateJavaVM"))) { + error = dlerror(); + sprintf(g->Message, MSG(GET_FUNC_ERR), "JNI_CreateJavaVM", SVP(error)); + dlclose(LibJvm); + LibJvm = NULL; + } else if (!(GetCreatedJavaVMs = (GETJVM)dlsym(LibJvm, "JNI_GetCreatedJavaVMs"))) { + error = dlerror(); + sprintf(g->Message, MSG(GET_FUNC_ERR), "JNI_GetCreatedJavaVMs", SVP(error)); + dlclose(LibJvm); + LibJvm = NULL; +#if defined(_DEBUG) + } else if (!(GetDefaultJavaVMInitArgs = (GETDEF)dlsym(LibJvm, + "JNI_GetDefaultJavaVMInitArgs"))) { + error = dlerror(); + sprintf(g->Message, MSG(GET_FUNC_ERR), "JNI_GetDefaultJavaVMInitArgs", SVP(error)); + dlclose(LibJvm); + LibJvm = NULL; +#endif // _DEBUG + } // endif LibJvm +#endif // !__WIN__ + + } // endif LibJvm + + return LibJvm == NULL; +} // end of GetJVM + +/***********************************************************************/ +/* Open: connect to a data source. */ +/***********************************************************************/ +int JDBConn::Open(PJPARM sop) +{ + bool err = false; + PGLOBAL& g = m_G; + + // Link or check whether jvm library was linked + if (GetJVM(g)) + return RC_FX; + + // Firstly check whether the jvm was already created + JavaVM* jvms[1]; + jsize jsz; + jint rc = GetCreatedJavaVMs(jvms, 1, &jsz); + + if (rc == JNI_OK && jsz == 1) { + // jvm already existing + jvm = jvms[0]; + rc = jvm->AttachCurrentThread((void**)&env, nullptr); + + if (rc != JNI_OK) { + strcpy(g->Message, "Cannot attach jvm to the current thread"); + return RC_FX; + } // endif rc + + } else { + /*******************************************************************/ + /* Create a new jvm */ + /*******************************************************************/ + PSTRG jpop = new(g)STRING(g, 512, "-Djava.class.path=."); + char *cp = NULL; + char sep; + +#if defined(__WIN__) + sep = ';'; +#define N 1 +//#define N 2 +//#define N 3 +#else + sep = ':'; +#define N 1 +#endif + + //================== prepare loading of Java VM ============================ + JavaVMInitArgs vm_args; // Initialization arguments + JavaVMOption* options = new JavaVMOption[N]; // JVM invocation options + + // where to find java .class + if (ClassPath && *ClassPath) { + jpop->Append(sep); + jpop->Append(ClassPath); + } // endif ClassPath + + if ((cp = getenv("CLASSPATH"))) { + jpop->Append(sep); + jpop->Append(cp); + } // endif cp + + if (trace) { + htrc("ClassPath=%s\n", ClassPath); + htrc("CLASSPATH=%s\n", cp); + htrc("%s\n", jpop->GetStr()); + } // endif trace + + options[0].optionString = jpop->GetStr(); +#if N == 2 + options[1].optionString = "-Xcheck:jni"; +#endif +#if N == 3 + options[1].optionString = "-Xms256M"; + options[2].optionString = "-Xmx512M"; +#endif +#if defined(_DEBUG) + vm_args.version = JNI_VERSION_1_2; // minimum Java version + rc = GetDefaultJavaVMInitArgs(&vm_args); +#else + vm_args.version = JNI_VERSION_1_6; // minimum Java version +#endif // _DEBUG + vm_args.nOptions = N; // number of options + vm_args.options = options; + vm_args.ignoreUnrecognized = false; // invalid options make the JVM init fail + + //=============== load and initialize Java VM and JNI interface ============= + rc = CreateJavaVM(&jvm, (void**)&env, &vm_args); // YES !! + delete options; // we then no longer need the initialisation options. + + switch (rc) { + case JNI_OK: + strcpy(g->Message, "VM successfully created"); + break; + case JNI_ERR: + strcpy(g->Message, "Initialising JVM failed: unknown error"); + return RC_FX; + case JNI_EDETACHED: + strcpy(g->Message, "Thread detached from the VM"); + return RC_FX; + case JNI_EVERSION: + strcpy(g->Message, "JNI version error"); + return RC_FX; + case JNI_ENOMEM: + strcpy(g->Message, "Not enough memory"); + return RC_FX; + case JNI_EEXIST: + strcpy(g->Message, "VM already created"); + return RC_FX; + case JNI_EINVAL: + strcpy(g->Message, "Invalid arguments"); + return RC_FX; + default: + sprintf(g->Message, "Unknown return code %d", rc); + return RC_FX; + } // endswitch rc + + } // endif rc + + //=============== Display JVM version ======================================= +#if defined(_DEBUG) + jint ver = env->GetVersion(); + printf("JVM Version %d.%d\n", ((ver>>16)&0x0f), (ver&0x0f)); +#endif //_DEBUG + + // try to find the java wrapper class + jdi = env->FindClass(Wrapper); + + if (jdi == nullptr) { + sprintf(g->Message, "ERROR: class %s not found!", Wrapper); + return RC_FX; + } // endif jdi + +#if 0 // Suppressed because it does not make any usable change + if (b && jpath && *jpath) { + // Try to add that path the the jvm class path + jmethodID alp = env->GetStaticMethodID(jdi, "addLibraryPath", + "(Ljava/lang/String;)I"); + + if (alp == nullptr) { + env->ExceptionDescribe(); + env->ExceptionClear(); + } else { + char *msg; + jstring path = env->NewStringUTF(jpath); + rc = env->CallStaticIntMethod(jdi, alp, path); + + if ((msg = Check(rc))) { + strcpy(g->Message, msg); + env->DeleteLocalRef(path); + return RC_FX; + } else switch (rc) { + case JNI_OK: + printf("jpath added\n"); + break; + case JNI_EEXIST: + printf("jpath already exist\n"); + break; + case JNI_ERR: + default: + strcpy(g->Message, "Error adding jpath"); + env->DeleteLocalRef(path); + return RC_FX; + } // endswitch rc + + env->DeleteLocalRef(path); + } // endif alp + + } // endif jpath +#endif // 0 + + // if class found, continue + jmethodID ctor = env->GetMethodID(jdi, "", "()V"); + + if (ctor == nullptr) { + sprintf(g->Message, "ERROR: %s constructor not found!", Wrapper); + return RC_FX; + } else + job = env->NewObject(jdi, ctor); + + // If the object is successfully constructed, + // we can then search for the method we want to call, + // and invoke it for the object: + if (job == nullptr) { + sprintf(g->Message, "%s class object not constructed!", Wrapper); + return RC_FX; + } // endif job + + errid = env->GetMethodID(jdi, "GetErrmsg", "()Ljava/lang/String;"); + + if (env->ExceptionCheck()) { + strcpy(g->Message, "ERROR: method GetErrmsg() not found!"); + env->ExceptionDescribe(); + env->ExceptionClear(); + return RC_FX; + } // endif Check + + if (!sop) // DRIVER catalog table + return RC_OK; + + jmethodID cid = nullptr; + + if (gmID(g, cid, "JdbcConnect", "([Ljava/lang/String;IZ)I")) + return RC_FX; + + // Build the java string array + jobjectArray parms = env->NewObjectArray(4, // constructs java array of 4 + env->FindClass("java/lang/String"), NULL); // Strings + + m_Driver = sop->Driver; + m_Url = sop->Url; + m_User = sop->User; + m_Pwd = sop->Pwd; + m_Scrollable = sop->Scrollable; + m_RowsetSize = sop->Fsize; + //m_LoginTimeout = sop->Cto; + //m_QueryTimeout = sop->Qto; + //m_UseCnc = sop->UseCnc; + + // change some elements + if (m_Driver) + env->SetObjectArrayElement(parms, 0, env->NewStringUTF(m_Driver)); + + if (m_Url) + env->SetObjectArrayElement(parms, 1, env->NewStringUTF(m_Url)); + + if (m_User) + env->SetObjectArrayElement(parms, 2, env->NewStringUTF(m_User)); + + if (m_Pwd) + env->SetObjectArrayElement(parms, 3, env->NewStringUTF(m_Pwd)); + + // call method + rc = env->CallIntMethod(job, cid, parms, m_RowsetSize, m_Scrollable); + err = Check(rc); + env->DeleteLocalRef(parms); // Not used anymore + + if (err) { + sprintf(g->Message, "Connecting: %s rc=%d", Msg, (int)rc); + return RC_FX; + } // endif Msg + + if (gmID(g, typid, "ColumnType", "(ILjava/lang/String;)I")) + return RC_FX; + else + m_Opened = true; + + return RC_OK; +} // end of Open + +/***********************************************************************/ +/* Execute an SQL command. */ +/***********************************************************************/ +int JDBConn::ExecSQLcommand(char *sql) +{ + int rc; + jint n; + jstring qry; + PGLOBAL& g = m_G; + + // Get the methods used to execute a query and get the result + if (gmID(g, xid, "Execute", "(Ljava/lang/String;)I") || + gmID(g, grs, "GetResult", "()I")) + return RC_FX; + + qry = env->NewStringUTF(sql); + n = env->CallIntMethod(job, xid, qry); + env->DeleteLocalRef(qry); + + if (Check(n)) { + sprintf(g->Message, "Execute: %s", Msg); + return RC_FX; + } // endif n + + m_Ncol = env->CallIntMethod(job, grs); + + if (Check(m_Ncol)) { + sprintf(g->Message, "GetResult: %s", Msg); + rc = RC_FX; + } else if (m_Ncol) { + strcpy(g->Message, "Result set column number"); + rc = RC_OK; // A result set was returned + } else { + m_Aff = (int)n; // Affected rows + strcpy(g->Message, "Affected rows"); + rc = RC_NF; + } // endif ncol + + return rc; +} // end of ExecSQLcommand + +/***********************************************************************/ +/* Fetch next row. */ +/***********************************************************************/ +int JDBConn::Fetch(int pos) +{ + jint rc = JNI_ERR; + PGLOBAL& g = m_G; + + if (m_Full) // Result set has one row + return 1; + + if (pos) { + if (!m_Scrollable) { + strcpy(g->Message, "Cannot fetch(pos) if FORWARD ONLY"); + return rc; + } else if (gmID(m_G, fetchid, "Fetch", "(I)Z")) + return rc; + + if (env->CallBooleanMethod(job, fetchid, pos)) + rc = m_Rows; + + } else { + if (gmID(g, readid, "ReadNext", "()I")) + return rc; + + rc = env->CallBooleanMethod(job, readid); + + if (!Check(rc)) { + if (rc == 0) + m_Full = (m_Fetch == 1); + else + m_Fetch++; + + m_Rows += (int)rc; + } else + sprintf(g->Message, "Fetch: %s", Msg); + + } // endif pos + + return (int)rc; +} // end of Fetch + +/***********************************************************************/ +/* Restart from beginning of result set */ +/***********************************************************************/ +int JDBConn::Rewind(char *sql) +{ + int rbuf = -1; + + if (m_Full) + rbuf = m_Rows; // No need to "rewind" + else if (m_Scrollable) { + if (gmID(m_G, fetchid, "Fetch", "(I)Z")) + return -1; + + jboolean b = env->CallBooleanMethod(job, fetchid, 0); + + rbuf = m_Rows; + } else if (ExecSQLcommand(sql) != RC_FX) + rbuf = 0; + + return rbuf; +} // end of Rewind + +/***********************************************************************/ +/* Disconnect connection */ +/***********************************************************************/ +void JDBConn::Close() +{ + if (m_Opened) { + jint rc; + jmethodID did = nullptr; + + if (gmID(m_G, did, "JdbcDisconnect", "()I")) + printf("%s\n", Msg); + else if (Check(env->CallIntMethod(job, did))) + printf("jdbcDisconnect: %s\n", Msg); + + if ((rc = jvm->DetachCurrentThread()) != JNI_OK) + printf("DetachCurrentThread: rc=%d\n", (int)rc); + + //rc = jvm->DestroyJavaVM(); + m_Opened = false; + } // endif m_Opened + +} // end of Close + +/***********************************************************************/ +/* Retrieve and set the column value from the result set. */ +/***********************************************************************/ +void JDBConn::SetColumnValue(int rank, PSZ name, PVAL val) +{ + PGLOBAL& g = m_G; + jint ctyp; + jlong dtv; + jstring cn, jn = nullptr; + jobject dob; + + if (rank == 0) + if (!name || (jn = env->NewStringUTF(name)) == nullptr) { + sprintf(g->Message, "Fail to allocate jstring %s", SVP(name)); + longjmp(g->jumper[g->jump_level], TYPE_AM_JDBC); + } // endif name + + // Returns 666 is case of error + ctyp = env->CallIntMethod(job, typid, rank, jn); + + if (Check((ctyp == 666) ? -1 : 1)) { + sprintf(g->Message, "Getting ctyp: %s", Msg); + longjmp(g->jumper[g->jump_level], TYPE_AM_JDBC); + } // endif Check + + switch (ctyp) { + case 12: // VARCHAR + case -1: // LONGVARCHAR + case 1: // CHAR + if (!gmID(g, chrfldid, "StringField", "(ILjava/lang/String;)Ljava/lang/String;")) { + cn = (jstring)env->CallObjectMethod(job, chrfldid, (jint)rank, jn); + + if (cn) { + const char *field = env->GetStringUTFChars(cn, (jboolean)false); + val->SetValue_psz((PSZ)field); + } else { + val->Reset(); + val->SetNull(true); + } // endif cn + + } else + val->Reset(); + + break; + case 4: // INTEGER + case 5: // SMALLINT + case -6: // TINYINT + case -7: // BIT + if (!gmID(g, intfldid, "IntField", "(ILjava/lang/String;)I")) + val->SetValue((int)env->CallIntMethod(job, intfldid, rank, jn)); + else + val->Reset(); + + break; + case 8: // DOUBLE + case 2: // NUMERIC + case 3: // DECIMAL + if (!gmID(g, dblfldid, "DoubleField", "(ILjava/lang/String;)D")) + val->SetValue((double)env->CallDoubleMethod(job, dblfldid, rank, jn)); + else + val->Reset(); + + break; + case 7: // REAL + case 6: // FLOAT + if (!gmID(g, fltfldid, "FloatField", "(ILjava/lang/String;)F")) + val->SetValue((float)env->CallFloatMethod(job, fltfldid, rank, jn)); + else + val->Reset(); + + break; + case 91: // DATE + case 92: // TIME + case 93: // TIMESTAMP + if (!gmID(g, datfldid, "TimestampField", + "(ILjava/lang/String;)Ljava/sql/Timestamp;")) { + dob = env->CallObjectMethod(job, datfldid, (jint)rank, jn); + + if (dob) { + jclass jts = env->FindClass("java/sql/Timestamp"); + + if (env->ExceptionCheck()) { + val->Reset(); + } else { + jmethodID getTime = env->GetMethodID(jts, "getTime", "()J"); + + if (getTime != nullptr) { + dtv = env->CallLongMethod(dob, getTime); + val->SetValue((int)(dtv / 1000)); + } else + val->Reset(); + + } // endif check + + } else + val->Reset(); + + } else + val->Reset(); + + break; + case -5: // BIGINT + if (!gmID(g, bigfldid, "BigintField", "(ILjava/lang/String;)J")) + val->SetValue((long long)env->CallLongMethod(job, bigfldid, (jint)rank, jn)); + else + val->Reset(); + + break; + /* case java.sql.Types.SMALLINT: + System.out.print(jdi.IntField(i)); + break; + case java.sql.Types.BOOLEAN: + System.out.print(jdi.BooleanField(i)); */ + case 0: // NULL + val->SetNull(true); + // passthru + default: + val->Reset(); + } // endswitch Type + + if (Check()) { + if (rank == 0) + env->DeleteLocalRef(jn); + + sprintf(g->Message, "SetColumnValue: %s rank=%d ctyp=%d", Msg, rank, (int)ctyp); + longjmp(g->jumper[g->jump_level], TYPE_AM_JDBC); + } // endif Check + + if (rank == 0) + env->DeleteLocalRef(jn); + +} // end of SetColumnValue + +/***********************************************************************/ +/* Prepare an SQL statement for insert. */ +/***********************************************************************/ +bool JDBConn::PrepareSQL(char *sql) +{ + bool b = true; + PGLOBAL& g = m_G; + + if (!gmID(g, prepid, "CreatePrepStmt", "(Ljava/lang/String;)I")) { + // Create the prepared statement + jstring qry = env->NewStringUTF(sql); + + if (Check(env->CallBooleanMethod(job, prepid, qry))) + sprintf(g->Message, "CreatePrepStmt: %s", Msg); + else + b = false; + + env->DeleteLocalRef(qry); + } // endif prepid + + return b; +} // end of PrepareSQL + +/***********************************************************************/ +/* Execute an SQL query that returns a result set. */ +/***********************************************************************/ +int JDBConn::ExecuteQuery(char *sql) +{ + int rc = RC_FX; + jint ncol; + jstring qry; + PGLOBAL& g = m_G; + + // Get the methods used to execute a query and get the result + if (!gmID(g, xqid, "ExecuteQuery", "(Ljava/lang/String;)I")) { + qry = env->NewStringUTF(sql); + ncol = env->CallIntMethod(job, xqid, qry); + + if (!Check(ncol)) { + m_Ncol = (int)ncol; + m_Aff = 0; // Affected rows + rc = RC_OK; + } else + sprintf(g->Message, "ExecuteQuery: %s", Msg); + + env->DeleteLocalRef(qry); + } // endif xqid + + return rc; +} // end of ExecuteQuery + +/***********************************************************************/ +/* Execute an SQL query and get the affected rows. */ +/***********************************************************************/ +int JDBConn::ExecuteUpdate(char *sql) +{ + int rc = RC_FX; + jint n; + jstring qry; + PGLOBAL& g = m_G; + + // Get the methods used to execute a query and get the affected rows + if (!gmID(g, xuid, "ExecuteUpdate", "(Ljava/lang/String;)I")) { + qry = env->NewStringUTF(sql); + n = env->CallIntMethod(job, xuid, qry); + + if (!Check(n)) { + m_Ncol = 0; + m_Aff = (int)n; // Affected rows + rc = RC_OK; + } else + sprintf(g->Message, "ExecuteUpdate: %s n=%d", Msg, n); + + env->DeleteLocalRef(qry); + } // endif xuid + + return rc; +} // end of ExecuteUpdate + +/***********************************************************************/ +/* Get the number of lines of the result set. */ +/***********************************************************************/ +int JDBConn::GetResultSize(char *sql, JDBCCOL *colp) +{ + int rc, n = 0; + + if ((rc = ExecuteQuery(sql)) != RC_OK) + return -1; + + if ((rc = Fetch()) > 0) + SetColumnValue(1, NULL, colp->GetValue()); + else + return -2; + + if ((rc = Fetch()) != 0) + return -3; + + m_Full = false; + return colp->GetIntValue(); +} // end of GetResultSize + +/***********************************************************************/ +/* Execute a prepared statement. */ +/***********************************************************************/ +int JDBConn::ExecuteSQL(void) +{ + int rc = RC_FX; + PGLOBAL& g = m_G; + + // Get the methods used to execute a prepared statement + if (!gmID(g, xpid, "ExecutePrep", "()I")) { + jint n = env->CallIntMethod(job, xpid); + + if (n == -3) + strcpy(g->Message, "SQL statement is not prepared"); + else if (Check(n)) + sprintf(g->Message, "ExecutePrep: %s", Msg); + else { + m_Aff = (int)n; + rc = RC_OK; + } // endswitch n + + } // endif xpid + + return rc; +} // end of ExecuteSQL + +/***********************************************************************/ +/* Set a parameter for inserting. */ +/***********************************************************************/ +bool JDBConn::SetParam(JDBCCOL *colp) +{ + PGLOBAL& g = m_G; + bool rc = false; + PVAL val = colp->GetValue(); + jint n, i = (jint)colp->GetRank(); + jshort s; + jlong lg; +//jfloat f; + jdouble d; + jclass dat; + jobject datobj; + jstring jst = nullptr; + jmethodID dtc, setid = nullptr; + + switch (val->GetType()) { + case TYPE_STRING: + if (gmID(g, setid, "SetStringParm", "(ILjava/lang/String;)V")) + return true; + + jst = env->NewStringUTF(val->GetCharValue()); + env->CallVoidMethod(job, setid, i, jst); + break; + case TYPE_INT: + if (gmID(g, setid, "SetIntParm", "(II)V")) + return true; + + n = (jint)val->GetIntValue(); + env->CallVoidMethod(job, setid, i, n); + break; + case TYPE_TINY: + case TYPE_SHORT: + if (gmID(g, setid, "SetShortParm", "(IS)V")) + return true; + + s = (jshort)val->GetShortValue(); + env->CallVoidMethod(job, setid, i, s); + break; + case TYPE_BIGINT: + if (gmID(g, setid, "SetBigintParm", "(IJ)V")) + return true; + + lg = (jlong)val->GetBigintValue(); + env->CallVoidMethod(job, setid, i, lg); + break; + case TYPE_DOUBLE: + case TYPE_DECIM: + if (gmID(g, setid, "SetDoubleParm", "(ID)V")) + return true; + + d = (jdouble)val->GetFloatValue(); + env->CallVoidMethod(job, setid, i, d); + break; + case TYPE_DATE: + if ((dat = env->FindClass("java/sql/Timestamp")) == nullptr) { + strcpy(g->Message, "Cannot find Timestamp class"); + return true; + } else if (!(dtc = env->GetMethodID(dat, "", "(J)V"))) { + strcpy(g->Message, "Cannot find Timestamp class constructor"); + return true; + } // endif's + + lg = (jlong)val->GetBigintValue() * 1000; + + if ((datobj = env->NewObject(dat, dtc, lg)) == nullptr) { + strcpy(g->Message, "Cannot make Timestamp object"); + return true; + } else if (gmID(g, setid, "SetTimestampParm", "(ILjava/sql/Timestamp;)V")) + return true; + + env->CallVoidMethod(job, setid, i, datobj); + break; + default: + sprintf(g->Message, "Parm type %d not supported", val->GetType()); + return true; + } // endswitch Type + + if (Check()) { + sprintf(g->Message, "SetParam: col=%s msg=%s", colp->GetName(), Msg); + rc = true; + } // endif msg + + if (jst) + env->DeleteLocalRef(jst); + + return rc; + } // end of SetParam + +#if 0 + /***********************************************************************/ + /* Get the list of Data Sources and set it in qrp. */ + /***********************************************************************/ + bool JDBConn::GetDataSources(PQRYRES qrp) + { + bool rv = false; + UCHAR *dsn, *des; + UWORD dir = SQL_FETCH_FIRST; + SWORD n1, n2, p1, p2; + PCOLRES crp1 = qrp->Colresp, crp2 = qrp->Colresp->Next; + RETCODE rc; + + n1 = crp1->Clen; + n2 = crp2->Clen; + + try { + rc = SQLAllocEnv(&m_henv); + + if (!Check(rc)) + ThrowDJX(rc, "SQLAllocEnv"); // Fatal + + for (int i = 0; i < qrp->Maxres; i++) { + dsn = (UCHAR*)crp1->Kdata->GetValPtr(i); + des = (UCHAR*)crp2->Kdata->GetValPtr(i); + rc = SQLDataSources(m_henv, dir, dsn, n1, &p1, des, n2, &p2); + + if (rc == SQL_NO_DATA_FOUND) + break; + else if (!Check(rc)) + ThrowDJX(rc, "SQLDataSources"); + + qrp->Nblin++; + dir = SQL_FETCH_NEXT; + } // endfor i + + } + catch (DJX *x) { + sprintf(m_G->Message, "%s: %s", x->m_Msg, x->GetErrorMessage(0)); + rv = true; + } // end try/catch + + Close(); + return rv; + } // end of GetDataSources +#endif // 0 + + /***********************************************************************/ + /* Get the list of Drivers and set it in qrp. */ + /***********************************************************************/ + bool JDBConn::GetDrivers(PQRYRES qrp) + { + PSZ sval; + int i, n, size; + PCOLRES crp; + jstring js; + jmethodID gdid = nullptr; + + if (gmID(m_G, gdid, "GetDrivers", "([Ljava/lang/String;I)I")) + return true; + + // Build the java string array + jobjectArray s = env->NewObjectArray(4 * qrp->Maxres, + env->FindClass("java/lang/String"), NULL); + + size = env->CallIntMethod(job, gdid, s, qrp->Maxres); + + for (i = 0, n = 0; i < size; i++) { + crp = qrp->Colresp; + js = (jstring)env->GetObjectArrayElement(s, n++); + sval = (PSZ)env->GetStringUTFChars(js, 0); + crp->Kdata->SetValue(sval, i); + crp = crp->Next; + js = (jstring)env->GetObjectArrayElement(s, n++); + sval = (PSZ)env->GetStringUTFChars(js, 0); + crp->Kdata->SetValue(sval, i); + crp = crp->Next; + js = (jstring)env->GetObjectArrayElement(s, n++); + sval = (PSZ)env->GetStringUTFChars(js, 0); + crp->Kdata->SetValue(sval, i); + crp = crp->Next; + js = (jstring)env->GetObjectArrayElement(s, n++); + sval = (PSZ)env->GetStringUTFChars(js, 0); + crp->Kdata->SetValue(sval, i); + } // endfor i + + // Not used anymore + env->DeleteLocalRef(s); + + qrp->Nblin = size; + return false; + } // end of GetDrivers + + /**************************************************************************/ + /* GetMetaData: constructs the result blocks containing the */ + /* description of all the columns of an SQL command. */ + /**************************************************************************/ + PQRYRES JDBConn::GetMetaData(PGLOBAL g, char *src) + { + static int buftyp[] = {TYPE_STRING, TYPE_INT, TYPE_INT, + TYPE_INT, TYPE_INT}; + static XFLD fldtyp[] = {FLD_NAME, FLD_TYPE, FLD_PREC, + FLD_SCALE, FLD_NULL }; + static unsigned int length[] = {0, 6, 10, 6, 6}; + const char *name; + int len, qcol = 5; + PQRYRES qrp = NULL; + PCOLRES crp; + ushort i; + jint *n = nullptr; + jstring label; + jmethodID colid = nullptr; + int rc = ExecSQLcommand(src); + + if (rc == RC_NF) { + strcpy(g->Message, "Srcdef is not returning a result set"); + return NULL; + } else if ((rc) == RC_FX) { + return NULL; + } else if (m_Ncol == 0) { + strcpy(g->Message, "Invalid Srcdef"); + return NULL; + } // endif's + + if (gmID(g, colid, "ColumnDesc", "(I[I)Ljava/lang/String;")) + return NULL; + + // Get max column name length + len = GetMaxValue(5); + length[0] = (len > 0) ? len + 1 : 128; + + /************************************************************************/ + /* Allocate the structures used to refer to the result set. */ + /************************************************************************/ + if (!(qrp = PlgAllocResult(g, qcol, m_Ncol, IDS_COLUMNS + 3, + buftyp, fldtyp, length, false, true))) + return NULL; + + // Some columns must be renamed + for (i = 0, crp = qrp->Colresp; crp; crp = crp->Next) + switch (++i) { + case 3: crp->Name = "Precision"; break; + case 4: crp->Name = "Scale"; break; + case 5: crp->Name = "Nullable"; break; + } // endswitch i + + // Build the java string array + jintArray val = env->NewIntArray(4); + + if (val == nullptr) { + strcpy(m_G->Message, "Cannot allocate jint array"); + return NULL; + } // endif colid + + /************************************************************************/ + /* Now get the results into blocks. */ + /************************************************************************/ + for (i = 0; i < m_Ncol; i++) { + if (!(label = (jstring)env->CallObjectMethod(job, colid, i + 1, val))) { + if (Check()) + sprintf(g->Message, "ColumnDesc: %s", Msg); + else + strcpy(g->Message, "No result metadata"); + + env->ReleaseIntArrayElements(val, n, 0); + return NULL; + } // endif label + + name = env->GetStringUTFChars(label, (jboolean)false); + crp = qrp->Colresp; // Column_Name + crp->Kdata->SetValue((char*)name, i); + n = env->GetIntArrayElements(val, 0); + crp = crp->Next; // Data_Type + crp->Kdata->SetValue((int)n[0], i); + crp = crp->Next; // Precision (length) + crp->Kdata->SetValue((int)n[1], i); + crp = crp->Next; // Scale + crp->Kdata->SetValue((int)n[2], i); + crp = crp->Next; // Nullable + crp->Kdata->SetValue((int)n[3], i); + qrp->Nblin++; + } // endfor i + + /* Cleanup */ + env->ReleaseIntArrayElements(val, n, 0); + + /************************************************************************/ + /* Return the result pointer for use by GetData routines. */ + /************************************************************************/ + return qrp; + } // end of GetMetaData + + /***********************************************************************/ + /* A helper class to split an optionally qualified table name into */ + /* components. */ + /* These formats are understood: */ + /* "CatalogName.SchemaName.TableName" */ + /* "SchemaName.TableName" */ + /* "TableName" */ + /***********************************************************************/ + class SQLQualifiedName + { + static const uint max_parts= 3; // Catalog.Schema.Table + MYSQL_LEX_STRING m_part[max_parts]; + char m_buf[512]; + + void lex_string_set(MYSQL_LEX_STRING *S, char *str, size_t length) + { + S->str= str; + S->length= length; + } // end of lex_string_set + + void lex_string_shorten_down(MYSQL_LEX_STRING *S, size_t offs) + { + DBUG_ASSERT(offs <= S->length); + S->str+= offs; + S->length-= offs; + } // end of lex_string_shorten_down + + /*********************************************************************/ + /* Find the rightmost '.' delimiter and return the length */ + /* of the qualifier, including the rightmost '.' delimier. */ + /* For example, for the string {"a.b.c",5} it will return 4, */ + /* which is the length of the qualifier "a.b." */ + /*********************************************************************/ + size_t lex_string_find_qualifier(MYSQL_LEX_STRING *S) + { + size_t i; + for (i= S->length; i > 0; i--) + { + if (S->str[i - 1] == '.') + { + S->str[i - 1]= '\0'; + return i; + } + } + return 0; + } // end of lex_string_find_qualifier + + public: + /*********************************************************************/ + /* Initialize to the given optionally qualified name. */ + /* NULL pointer in "name" is supported. */ + /* name qualifier has precedence over schema. */ + /*********************************************************************/ + SQLQualifiedName(JCATPARM *cap) + { + const char *name = (const char *)cap->Tab; + char *db = (char *)cap->DB; + size_t len, i; + + // Initialize the parts + for (i = 0; i < max_parts; i++) + lex_string_set(&m_part[i], NULL, 0); + + if (name) { + // Initialize the first (rightmost) part + lex_string_set(&m_part[0], m_buf, + strmake(m_buf, name, sizeof(m_buf) - 1) - m_buf); + + // Initialize the other parts, if exist. + for (i= 1; i < max_parts; i++) { + if (!(len= lex_string_find_qualifier(&m_part[i - 1]))) + break; + + lex_string_set(&m_part[i], m_part[i - 1].str, len - 1); + lex_string_shorten_down(&m_part[i - 1], len); + } // endfor i + + } // endif name + + // If it was not specified, set schema as the passed db name + if (db && !m_part[1].length) + lex_string_set(&m_part[1], db, strlen(db)); + + } // end of SQLQualifiedName + + char *ptr(uint i) + { + DBUG_ASSERT(i < max_parts); + return (char *)(m_part[i].length ? m_part[i].str : NULL); + } // end of ptr + + size_t length(uint i) + { + DBUG_ASSERT(i < max_parts); + return m_part[i].length; + } // end of length + + }; // end of class SQLQualifiedName + + /***********************************************************************/ + /* Allocate recset and call SQLTables, SQLColumns or SQLPrimaryKeys. */ + /***********************************************************************/ + int JDBConn::GetCatInfo(JCATPARM *cap) + { + PGLOBAL& g = m_G; +// void *buffer; + int i, ncol; + PSZ fnc = "Unknown"; + uint n; + short len, tp; + int crow = 0; + PQRYRES qrp = cap->Qrp; + PCOLRES crp; + jboolean rc = false; +// HSTMT hstmt = NULL; +// SQLLEN *vl, *vlen = NULL; + PVAL *pval = NULL; + char* *pbuf = NULL; + jobjectArray parms; + jmethodID catid = nullptr; + + if (qrp->Maxres <= 0) + return 0; // 0-sized result" + + SQLQualifiedName name(cap); + + // Build the java string array + parms = env->NewObjectArray(4, env->FindClass("java/lang/String"), NULL); + env->SetObjectArrayElement(parms, 0, env->NewStringUTF(name.ptr(2))); + env->SetObjectArrayElement(parms, 1, env->NewStringUTF(name.ptr(1))); + env->SetObjectArrayElement(parms, 2, env->NewStringUTF(name.ptr(0))); + env->SetObjectArrayElement(parms, 3, env->NewStringUTF((const char*)cap->Pat)); + + // Now do call the proper JDBC API + switch (cap->Id) { + case CAT_COL: + fnc = "GetColumns"; + break; + case CAT_TAB: + fnc = "GetTables"; + break; +#if 0 + case CAT_KEY: + fnc = "SQLPrimaryKeys"; + rc = SQLPrimaryKeys(hstmt, name.ptr(2), name.length(2), + name.ptr(1), name.length(1), + name.ptr(0), name.length(0)); + break; + case CAT_STAT: + fnc = "SQLStatistics"; + rc = SQLStatistics(hstmt, name.ptr(2), name.length(2), + name.ptr(1), name.length(1), + name.ptr(0), name.length(0), + cap->Unique, cap->Accuracy); + break; + case CAT_SPC: + ThrowDJX("SQLSpecialColumns not available yet"); +#endif // 0 + default: + sprintf(g->Message, "Invalid SQL function id"); + return -1; + } // endswitch infotype + + if (gmID(g, catid, fnc, "([Ljava/lang/String;)I")) + return -1; + + // call method + ncol = env->CallIntMethod(job, catid, parms); + + if (Check(ncol)) { + sprintf(g->Message, "%s: %s", fnc, Msg); + env->DeleteLocalRef(parms); + return -1; + } // endif Check + + // Not used anymore + env->DeleteLocalRef(parms); + + if (trace) + htrc("Method %s returned %d columns\n", fnc, ncol); + + // n because we no more ignore the first column + if ((n = qrp->Nbcol) > (uint)ncol) { + strcpy(g->Message, MSG(COL_NUM_MISM)); + return -1; + } // endif n + + // Unconditional to handle STRBLK's + pval = (PVAL *)PlugSubAlloc(g, NULL, n * sizeof(PVAL)); +// vlen = (SQLLEN *)PlugSubAlloc(g, NULL, n * sizeof(SQLLEN)); + pbuf = (char**)PlugSubAlloc(g, NULL, n * sizeof(char*)); + + // Prepare retrieving column values + for (n = 0, crp = qrp->Colresp; crp; crp = crp->Next) { + if (!(tp = GetJDBCType(crp->Type))) { + sprintf(g->Message, MSG(INV_COLUMN_TYPE), crp->Type, crp->Name); + return -1; + } // endif tp + + if (!(len = GetTypeSize(crp->Type, crp->Length))) { + len = 255; // for STRBLK's + ((STRBLK*)crp->Kdata)->SetSorted(true); + } // endif len + + pval[n] = AllocateValue(g, crp->Type, len); + + if (crp->Type == TYPE_STRING) { + pbuf[n] = (char*)PlugSubAlloc(g, NULL, len); +// buffer = pbuf[n]; + } // endif Type +// } else +// buffer = pval[n]->GetTo_Val(); + + n++; + } // endfor n + + // Now fetch the result + for (i = 0; i < qrp->Maxres; i++) { + if (Check(rc = Fetch(0))) { + sprintf(g->Message, "Fetch: %s", Msg); + return -1; + } if (rc == 0) { + if (trace) + htrc("End of fetches i=%d\n", i); + + break; + } // endif rc + + for (n = 0, crp = qrp->Colresp; crp; n++, crp = crp->Next) { + SetColumnValue(n + 1, nullptr, pval[n]); + crp->Kdata->SetValue(pval[n], i); + } // endfor n + + } // endfor i + + if (rc > 0) + qrp->Truncated = true; + + return i; + } // end of GetCatInfo + + /***********************************************************************/ + /* Allocate a CONNECT result structure from the JDBC result. */ + /***********************************************************************/ + PQRYRES JDBConn::AllocateResult(PGLOBAL g) + { + bool uns; + PJDBCCOL colp; + PCOLRES *pcrp, crp; + PQRYRES qrp; + + if (!m_Rows) { + strcpy(g->Message, "Void result"); + return NULL; + } // endif m_Rows + + /*********************************************************************/ + /* Allocate the result storage for future retrieval. */ + /*********************************************************************/ + qrp = (PQRYRES)PlugSubAlloc(g, NULL, sizeof(QRYRES)); + pcrp = &qrp->Colresp; + qrp->Continued = FALSE; + qrp->Truncated = FALSE; + qrp->Info = FALSE; + qrp->Suball = TRUE; + qrp->BadLines = 0; + qrp->Maxsize = m_Rows; + qrp->Maxres = m_Rows; + qrp->Nbcol = 0; + qrp->Nblin = 0; + qrp->Cursor = 0; + + for (colp = (PJDBCCOL)m_Tdb->Columns; colp; + colp = (PJDBCCOL)colp->GetNext()) + if (!colp->IsSpecial()) { + *pcrp = (PCOLRES)PlugSubAlloc(g, NULL, sizeof(COLRES)); + crp = *pcrp; + pcrp = &crp->Next; + memset(crp, 0, sizeof(COLRES)); + crp->Ncol = ++qrp->Nbcol; + crp->Name = colp->GetName(); + crp->Type = colp->GetResultType(); + crp->Prec = colp->GetScale(); + crp->Length = colp->GetLength(); + crp->Clen = colp->GetValue()->GetClen(); + uns = colp->IsUnsigned(); + + if (!(crp->Kdata = AllocValBlock(g, NULL, crp->Type, m_Rows, + crp->Clen, 0, FALSE, TRUE, uns))) { + sprintf(g->Message, MSG(INV_RESULT_TYPE), + GetFormatType(crp->Type)); + return NULL; + } // endif Kdata + + if (!colp->IsNullable()) + crp->Nulls = NULL; + else { + crp->Nulls = (char*)PlugSubAlloc(g, NULL, m_Rows); + memset(crp->Nulls, ' ', m_Rows); + } // endelse Nullable + + colp->SetCrp(crp); + } // endif colp + + *pcrp = NULL; + //qrp->Nblin = n; + return qrp; + } // end of AllocateResult diff --git a/storage/connect/jdbconn.h b/storage/connect/jdbconn.h new file mode 100644 index 00000000000..abec3919e52 --- /dev/null +++ b/storage/connect/jdbconn.h @@ -0,0 +1,193 @@ +/***********************************************************************/ +/* JDBConn.h : header file for the JDBC connection classes. */ +/***********************************************************************/ +//nclude /* Windows include file */ +//nclude /* Message crackers */ + +/***********************************************************************/ +/* Included C-definition files required by the interface. */ +/***********************************************************************/ +#include "block.h" + +/***********************************************************************/ +/* JDBC interface. */ +/***********************************************************************/ +#include + +/***********************************************************************/ +/* Constants and defines. */ +/***********************************************************************/ +// Miscellaneous sizing info +#define MAX_NUM_OF_MSG 10 // Max number of error messages +//efine MAX_CURRENCY 30 // Max size of Currency($) string +#define MAX_TNAME_LEN 32 // Max size of table names +//efine MAX_FNAME_LEN 256 // Max size of field names +//efine MAX_STRING_INFO 256 // Max size of string from SQLGetInfo +//efine MAX_DNAME_LEN 256 // Max size of Recordset names +#define MAX_CONNECT_LEN 512 // Max size of Connect string +//efine MAX_CURSOR_NAME 18 // Max size of a cursor name +#define DEFAULT_FIELD_TYPE 0 // TYPE_NULL + +#if !defined(__WIN__) +typedef unsigned char *PUCHAR; +#endif // !__WIN__ + +enum JCATINFO { + CAT_TAB = 1, // JDBC Tables + CAT_COL = 2, // JDBC Columns + CAT_KEY = 3, // JDBC PrimaryKeys +//CAT_STAT = 4, // SQLStatistics +//CAT_SPC = 5 // SQLSpecialColumns +}; + +/***********************************************************************/ +/* This structure is used to control the catalog functions. */ +/***********************************************************************/ +typedef struct tagJCATPARM { + JCATINFO Id; // Id to indicate function + PQRYRES Qrp; // Result set pointer + char *DB; // Database (Schema) + char *Tab; // Table name or pattern + char *Pat; // Table type or column pattern +} JCATPARM; + +typedef jint(JNICALL *CRTJVM) (JavaVM **, void **, void *); +typedef jint(JNICALL *GETJVM) (JavaVM **, jsize, jsize *); +#if defined(_DEBUG) +typedef jint(JNICALL *GETDEF) (void *); +#endif // _DEBUG + +// JDBC connection to a data source +class TDBJDBC; +class JDBCCOL; +class JDBConn; +class TDBXJDC; + +/***********************************************************************/ +/* JDBConn class. */ +/***********************************************************************/ +class JDBConn : public BLOCK { + friend class TDBJDBC; + friend class TDBXJDC; +//friend PQRYRES GetColumnInfo(PGLOBAL, char*&, char *, int, PVBLK&); +private: + JDBConn(); // Standard (unused) constructor + +public: + JDBConn(PGLOBAL g, TDBJDBC *tdbp); + + int Open(PJPARM sop); + int Rewind(char *sql); + void Close(void); + PQRYRES AllocateResult(PGLOBAL g); + + // Attributes +public: + char *GetQuoteChar(void) { return m_IDQuoteChar; } + // Database successfully opened? + bool IsOpen(void) { return m_Opened; } +//PSZ GetStringInfo(ushort infotype); + int GetMaxValue(int infotype); +//PSZ GetConnect(void) { return m_Connect; } + +public: + // Operations + //void SetLoginTimeout(DWORD sec) {m_LoginTimeout = sec;} + //void SetQueryTimeout(DWORD sec) {m_QueryTimeout = sec;} + //void SetUserName(PSZ user) {m_User = user;} + //void SetUserPwd(PSZ pwd) {m_Pwd = pwd;} + int GetResultSize(char *sql, JDBCCOL *colp); + int ExecuteQuery(char *sql); + int ExecuteUpdate(char *sql); + int Fetch(int pos = 0); + bool PrepareSQL(char *sql); + int ExecuteSQL(void); + bool SetParam(JDBCCOL *colp); + int ExecSQLcommand(char *sql); + void SetColumnValue(int rank, PSZ name, PVAL val); + int GetCatInfo(JCATPARM *cap); + //bool GetDataSources(PQRYRES qrp); + bool GetDrivers(PQRYRES qrp); + PQRYRES GetMetaData(PGLOBAL g, char *src); + +public: + // Set static variables + static void SetJVM(void) { + LibJvm = NULL; + CreateJavaVM = NULL; + GetCreatedJavaVMs = NULL; +#if defined(_DEBUG) + GetDefaultJavaVMInitArgs = NULL; +#endif // _DEBUG + } // end of SetJVM + + static void ResetJVM(void); + static bool GetJVM(PGLOBAL g); + + // Implementation +public: + //virtual ~JDBConn(); + + // JDBC operations +protected: + bool gmID(PGLOBAL g, jmethodID& mid, const char *name, const char *sig); + bool Check(jint rc = 0); +//void ThrowDJX(int rc, PSZ msg/*, HSTMT hstmt = SQL_NULL_HSTMT*/); +//void ThrowDJX(PSZ msg); +//void Free(void); + +protected: + // Members +#if defined(__WIN__) + static HANDLE LibJvm; // Handle to the jvm DLL +#else // !__WIN__ + static void *LibJvm; // Handle for the jvm shared library +#endif // !__WIN__ + static CRTJVM CreateJavaVM; + static GETJVM GetCreatedJavaVMs; +#if defined(_DEBUG) + static GETDEF GetDefaultJavaVMInitArgs; +#endif // _DEBUG + PGLOBAL m_G; + TDBJDBC *m_Tdb; + JavaVM *jvm; // Pointer to the JVM (Java Virtual Machine) + JNIEnv *env; // Pointer to native interface + jclass jdi; // Pointer to the java wrapper class + jobject job; // The java wrapper class object + jmethodID xqid; // The ExecuteQuery method ID + jmethodID xuid; // The ExecuteUpdate method ID + jmethodID xid; // The Execute method ID + jmethodID grs; // The GetResult method ID + jmethodID readid; // The ReadNext method ID + jmethodID fetchid; // The Fetch method ID + jmethodID typid; // The ColumnType method ID + jmethodID prepid; // The CreatePrepStmt method ID + jmethodID xpid; // The ExecutePrep method ID + jmethodID pcid; // The ClosePrepStmt method ID + jmethodID errid; // The GetErrmsg method ID + jmethodID chrfldid; // The StringField method ID + jmethodID intfldid; // The IntField method ID + jmethodID dblfldid; // The DoubleField method ID + jmethodID fltfldid; // The FloatField method ID + jmethodID datfldid; // The TimestampField method ID + jmethodID bigfldid; // The BigintField method ID + //DWORD m_LoginTimeout; +//DWORD m_QueryTimeout; +//DWORD m_UpdateOptions; + char *Msg; + char m_IDQuoteChar[2]; + PSZ m_Driver; + PSZ m_Url; + PSZ m_User; + PSZ m_Pwd; + int m_Ncol; + int m_Aff; + int m_Rows; + int m_Fetch; + int m_RowsetSize; + jboolean m_Updatable; + jboolean m_Transact; + jboolean m_Scrollable; + bool m_Opened; + bool m_Full; +}; // end of JDBConn class definition diff --git a/storage/connect/jsonudf.cpp b/storage/connect/jsonudf.cpp index 25c77cea534..43bb6edf748 100644 --- a/storage/connect/jsonudf.cpp +++ b/storage/connect/jsonudf.cpp @@ -1,6 +1,6 @@ /****************** jsonudf C++ Program Source Code File (.CPP) ******************/ -/* PROGRAM NAME: jsonudf Version 1.3 */ -/* (C) Copyright to the author Olivier BERTRAND 2015 */ +/* PROGRAM NAME: jsonudf Version 1.4 */ +/* (C) Copyright to the author Olivier BERTRAND 2015-2016 */ /* This program are the JSON User Defined Functions . */ /*********************************************************************************/ @@ -533,7 +533,7 @@ PVAL JSNX::CalculateArray(PGLOBAL g, PJAR arp, int n) /*********************************************************************************/ my_bool JSNX::CheckPath(PGLOBAL g) { - PJVAL val; + PJVAL val= NULL; PJSON row = Row; for (int i = 0; i < Nod && row; i++) { @@ -1302,7 +1302,7 @@ static my_bool CalcLen(UDF_ARGS *args, my_bool obj, { char fn[_MAX_PATH]; unsigned long i, k, m, n; - long fl, j = -1; + long fl= 0, j = -1; reslen = args->arg_count + 2; @@ -1370,7 +1370,6 @@ static my_bool CalcLen(UDF_ARGS *args, my_bool obj, memlen += (k + sizeof(JOBJECT) + sizeof(JPAIR)); } else memlen += sizeof(JARRAY); - switch (args->arg_type[i]) { case STRING_RESULT: if (n == 2 && args->args[i]) { @@ -1433,7 +1432,7 @@ static my_bool CheckMemory(PGLOBAL g, UDF_INIT *initid, UDF_ARGS *args, uint n, char *p = args->args[0]; // Is this a file name? - if (!strchr("[{ \t\r\n", *p) && (len = GetFileLength(p))) + if (p && !strchr("[{ \t\r\n", *p) && (len = GetFileLength(p))) ml += len * (M + 1); else ml += args->lengths[0] * M; @@ -1805,7 +1804,20 @@ my_bool json_array_add_values_init(UDF_INIT *initid, UDF_ARGS *args, char *messa } else CalcLen(args, false, reslen, memlen); - return JsonInit(initid, args, message, true, reslen, memlen); + if (!JsonInit(initid, args, message, true, reslen, memlen)) { + PGLOBAL g = (PGLOBAL)initid->ptr; + + // This is a constant function + g->N = (initid->const_item) ? 1 : 0; + + // This is to avoid double execution when using prepared statements + if (IsJson(args, 0) > 1) + initid->const_item = 0; + + return false; + } else + return true; + } // end of json_array_add_values_init char *json_array_add_values(UDF_INIT *initid, UDF_ARGS *args, char *result, @@ -1850,7 +1862,7 @@ char *json_array_add_values(UDF_INIT *initid, UDF_ARGS *args, char *result, } // endif str // Keep result of constant function - g->Xchk = (initid->const_item) ? str : NULL; + g->Xchk = (g->N) ? str : NULL; } else str = (char*)g->Xchk; @@ -1873,7 +1885,7 @@ void json_array_add_values_deinit(UDF_INIT* initid) /*********************************************************************************/ my_bool json_array_add_init(UDF_INIT *initid, UDF_ARGS *args, char *message) { - unsigned long reslen, memlen; + unsigned long reslen, memlen; if (args->arg_count < 2) { strcpy(message, "This function must have at least 2 arguments"); @@ -1884,7 +1896,20 @@ my_bool json_array_add_init(UDF_INIT *initid, UDF_ARGS *args, char *message) } else CalcLen(args, false, reslen, memlen, true); - return JsonInit(initid, args, message, true, reslen, memlen); + if (!JsonInit(initid, args, message, true, reslen, memlen)) { + PGLOBAL g = (PGLOBAL)initid->ptr; + + // This is a constant function + g->N = (initid->const_item) ? 1 : 0; + + // This is to avoid double execution when using prepared statements + if (IsJson(args, 0) > 1) + initid->const_item = 0; + + return false; + } else + return true; + } // end of json_array_add_init char *json_array_add(UDF_INIT *initid, UDF_ARGS *args, char *result, @@ -1930,7 +1955,7 @@ char *json_array_add(UDF_INIT *initid, UDF_ARGS *args, char *result, if (!str) str = MakePSZ(g, args, 0); - if (initid->const_item) + if (g->N) // Keep result of constant function g->Xchk = str; @@ -1966,7 +1991,20 @@ my_bool json_array_delete_init(UDF_INIT *initid, UDF_ARGS *args, char *message) } else CalcLen(args, false, reslen, memlen, true); - return JsonInit(initid, args, message, true, reslen, memlen); + if (!JsonInit(initid, args, message, true, reslen, memlen)) { + PGLOBAL g = (PGLOBAL)initid->ptr; + + // This is a constant function + g->N = (initid->const_item) ? 1 : 0; + + // This is to avoid double execution when using prepared statements + if (IsJson(args, 0) > 1) + initid->const_item = 0; + + return false; + } else + return true; + } // end of json_array_delete_init char *json_array_delete(UDF_INIT *initid, UDF_ARGS *args, char *result, @@ -2008,7 +2046,7 @@ char *json_array_delete(UDF_INIT *initid, UDF_ARGS *args, char *result, if (!str) str = MakePSZ(g, args, 0); - if (initid->const_item) + if (g->N) // Keep result of constant function g->Xchk = str; @@ -2087,7 +2125,7 @@ my_bool json_object_nonull_init(UDF_INIT *initid, UDF_ARGS *args, char *json_object_nonull(UDF_INIT *initid, UDF_ARGS *args, char *result, unsigned long *res_length, char *, char *) { - char *str; + char *str= 0; PGLOBAL g = (PGLOBAL)initid->ptr; if (!g->Xchk) { @@ -2184,7 +2222,20 @@ my_bool json_object_add_init(UDF_INIT *initid, UDF_ARGS *args, char *message) } else CalcLen(args, true, reslen, memlen, true); - return JsonInit(initid, args, message, true, reslen, memlen); + if (!JsonInit(initid, args, message, true, reslen, memlen)) { + PGLOBAL g = (PGLOBAL)initid->ptr; + + // This is a constant function + g->N = (initid->const_item) ? 1 : 0; + + // This is to avoid double execution when using prepared statements + if (IsJson(args, 0) > 1) + initid->const_item = 0; + + return false; + } else + return true; + } // end of json_object_add_init char *json_object_add(UDF_INIT *initid, UDF_ARGS *args, char *result, @@ -2227,7 +2278,7 @@ char *json_object_add(UDF_INIT *initid, UDF_ARGS *args, char *result, if (!str) str = MakePSZ(g, args, 0); - if (initid->const_item) + if (g->N) // Keep result of constant function g->Xchk = str; @@ -2266,7 +2317,20 @@ my_bool json_object_delete_init(UDF_INIT *initid, UDF_ARGS *args, char *message) } else CalcLen(args, true, reslen, memlen, true); - return JsonInit(initid, args, message, true, reslen, memlen); + if (!JsonInit(initid, args, message, true, reslen, memlen)) { + PGLOBAL g = (PGLOBAL)initid->ptr; + + // This is a constant function + g->N = (initid->const_item) ? 1 : 0; + + // This is to avoid double execution when using prepared statements + if (IsJson(args, 0) > 1) + initid->const_item = 0; + + return false; + } else + return true; + } // end of json_object_delete_init char *json_object_delete(UDF_INIT *initid, UDF_ARGS *args, char *result, @@ -2307,7 +2371,7 @@ char *json_object_delete(UDF_INIT *initid, UDF_ARGS *args, char *result, if (!str) str = MakePSZ(g, args, 0); - if (initid->const_item) + if (g->N) // Keep result of constant function g->Xchk = str; @@ -2605,7 +2669,20 @@ my_bool json_item_merge_init(UDF_INIT *initid, UDF_ARGS *args, char *message) } else CalcLen(args, false, reslen, memlen, true); - return JsonInit(initid, args, message, true, reslen, memlen); + if (!JsonInit(initid, args, message, true, reslen, memlen)) { + PGLOBAL g = (PGLOBAL)initid->ptr; + + // This is a constant function + g->N = (initid->const_item) ? 1 : 0; + + // This is to avoid double execution when using prepared statements + if (IsJson(args, 0) > 1) + initid->const_item = 0; + + return false; + } else + return true; + } // end of json_item_merge_init char *json_item_merge(UDF_INIT *initid, UDF_ARGS *args, char *result, @@ -2621,7 +2698,7 @@ char *json_item_merge(UDF_INIT *initid, UDF_ARGS *args, char *result, } // endif Xchk if (!CheckMemory(g, initid, args, 2, false, false, true)) { - PJSON top; + PJSON top= 0; PJVAL jvp; PJSON jsp[2] = {NULL, NULL}; @@ -2651,7 +2728,7 @@ char *json_item_merge(UDF_INIT *initid, UDF_ARGS *args, char *result, if (!str) str = MakePSZ(g, args, 0); - if (initid->const_item) + if (g->N) // Keep result of constant function g->Xchk = str; @@ -3538,37 +3615,9 @@ void jsoncontains_path_deinit(UDF_INIT* initid) } // end of jsoncontains_path_deinit /*********************************************************************************/ -/* Set Json items of a Json document according to path. */ +/* This function is used by the json_set/insert/update_item functions. */ /*********************************************************************************/ -my_bool json_set_item_init(UDF_INIT *initid, UDF_ARGS *args, char *message) -{ - unsigned long reslen, memlen; - int n = IsJson(args, 0); - - if (!(args->arg_count % 2)) { - strcpy(message, "This function must have an odd number of arguments"); - return true; - } else if (!n && args->arg_type[0] != STRING_RESULT) { - strcpy(message, "First argument must be a json item"); - return true; - } else - CalcLen(args, false, reslen, memlen); - - if (n == 2 && args->args[0]) { - char fn[_MAX_PATH]; - long fl; - - memcpy(fn, args->args[0], args->lengths[0]); - fn[args->lengths[0]] = 0; - fl = GetFileLength(fn); - memlen += fl * 3; - } else if (n != 3) - memlen += args->lengths[0] * 3; - - return JsonInit(initid, args, message, true, reslen, memlen); -} // end of json_set_item_init - -char *json_set_item(UDF_INIT *initid, UDF_ARGS *args, char *result, +static char *handle_item(UDF_INIT *initid, UDF_ARGS *args, char *result, unsigned long *res_length, char *is_null, char *error) { char *p, *path, *str = NULL; @@ -3580,18 +3629,22 @@ char *json_set_item(UDF_INIT *initid, UDF_ARGS *args, char *result, PGLOBAL g = (PGLOBAL)initid->ptr; PGLOBAL gb = GetMemPtr(g, args, 0); - if (g->N) { + if (g->Alchecked) { str = (char*)g->Activityp; goto fin; - } else if (initid->const_item) - g->N = 1; + } else if (g->N) + g->Alchecked = 1; - if (!strcmp(result, "$insert")) + if (!strcmp(result, "$set")) + w = 0; + else if (!strcmp(result, "$insert")) w = 1; else if (!strcmp(result, "$update")) w = 2; - else - w = 0; + else { + PUSH_WARNING("Logical error, please contact CONNECT developer"); + goto err; + } // endelse // Save stack and allocation environment and prepare error return if (g->jump_level == MAX_JUMP) { @@ -3656,14 +3709,14 @@ char *json_set_item(UDF_INIT *initid, UDF_ARGS *args, char *result, if (!(str = MakeResult(g, args, jsp, INT_MAX32))) str = MakePSZ(g, args, 0); - if (initid->const_item) + if (g->N) // Keep result of constant function g->Activityp = (PACTIVITY)str; - err: +err: g->jump_level--; - fin: +fin: if (!str) { *is_null = 1; *res_length = 0; @@ -3671,6 +3724,58 @@ char *json_set_item(UDF_INIT *initid, UDF_ARGS *args, char *result, *res_length = strlen(str); return str; +} // end of handle_item + +/*********************************************************************************/ +/* Set Json items of a Json document according to path. */ +/*********************************************************************************/ +my_bool json_set_item_init(UDF_INIT *initid, UDF_ARGS *args, char *message) +{ + unsigned long reslen, memlen; + int n = IsJson(args, 0); + + if (!(args->arg_count % 2)) { + strcpy(message, "This function must have an odd number of arguments"); + return true; + } else if (!n && args->arg_type[0] != STRING_RESULT) { + strcpy(message, "First argument must be a json item"); + return true; + } else + CalcLen(args, false, reslen, memlen); + + if (n == 2 && args->args[0]) { + char fn[_MAX_PATH]; + long fl; + + memcpy(fn, args->args[0], args->lengths[0]); + fn[args->lengths[0]] = 0; + fl = GetFileLength(fn); + memlen += fl * 3; + } else if (n != 3) + memlen += args->lengths[0] * 3; + + if (!JsonInit(initid, args, message, true, reslen, memlen)) { + PGLOBAL g = (PGLOBAL)initid->ptr; + + // This is a constant function + g->N = (initid->const_item) ? 1 : 0; + + // This is to avoid double execution when using prepared statements + if (IsJson(args, 0) > 1) + initid->const_item = 0; + + g->Alchecked = 0; + return false; + } else + return true; + +} // end of json_set_item_init + +char *json_set_item(UDF_INIT *initid, UDF_ARGS *args, char *result, + unsigned long *res_length, char *is_null, char *p) +{ + strcpy(result, "$set"); + return handle_item(initid, args, result, res_length, is_null, p); } // end of json_set_item void json_set_item_deinit(UDF_INIT* initid) @@ -3690,7 +3795,7 @@ char *json_insert_item(UDF_INIT *initid, UDF_ARGS *args, char *result, unsigned long *res_length, char *is_null, char *p) { strcpy(result, "$insert"); - return json_set_item(initid, args, result, res_length, is_null, p); + return handle_item(initid, args, result, res_length, is_null, p); } // end of json_insert_item void json_insert_item_deinit(UDF_INIT* initid) @@ -3710,7 +3815,7 @@ char *json_update_item(UDF_INIT *initid, UDF_ARGS *args, char *result, unsigned long *res_length, char *is_null, char *p) { strcpy(result, "$update"); - return json_set_item(initid, args, result, res_length, is_null, p); + return handle_item(initid, args, result, res_length, is_null, p); } // end of json_update_item void json_update_item_deinit(UDF_INIT* initid) @@ -3728,8 +3833,8 @@ my_bool json_file_init(UDF_INIT *initid, UDF_ARGS *args, char *message) if (args->arg_count < 1 || args->arg_count > 4) { strcpy(message, "This function only accepts 1 to 4 arguments"); return true; - } else if (!args->args[0] || args->arg_type[0] != STRING_RESULT) { - strcpy(message, "First argument must be a constant string (file name)"); + } else if (args->arg_type[0] != STRING_RESULT) { + strcpy(message, "First argument must be a string (file name)"); return true; } // endif's args[0] @@ -3747,7 +3852,12 @@ my_bool json_file_init(UDF_INIT *initid, UDF_ARGS *args, char *message) initid->maybe_null = 1; CalcLen(args, false, reslen, memlen); - fl = GetFileLength(args->args[0]); + + if (args->args[0]) + fl = GetFileLength(args->args[0]); + else + fl = 100; // What can be done here? + reslen += fl; if (initid->const_item) @@ -4006,7 +4116,18 @@ void jbin_array_deinit(UDF_INIT* initid) /*********************************************************************************/ my_bool jbin_array_add_values_init(UDF_INIT *initid, UDF_ARGS *args, char *message) { - return json_array_add_values_init(initid, args, message); + unsigned long reslen, memlen; + + if (args->arg_count < 2) { + strcpy(message, "This function must have at least 2 arguments"); + return true; + } else if (!IsJson(args, 0) && args->arg_type[0] != STRING_RESULT) { + strcpy(message, "First argument must be a json string or item"); + return true; + } else + CalcLen(args, false, reslen, memlen); + + return JsonInit(initid, args, message, true, reslen, memlen); } // end of jbin_array_add_values_init char *jbin_array_add_values(UDF_INIT *initid, UDF_ARGS *args, char *result, @@ -4076,7 +4197,18 @@ void jbin_array_add_values_deinit(UDF_INIT* initid) /*********************************************************************************/ my_bool jbin_array_add_init(UDF_INIT *initid, UDF_ARGS *args, char *message) { - return json_array_add_init(initid, args, message); + unsigned long reslen, memlen; + + if (args->arg_count < 2) { + strcpy(message, "This function must have at least 2 arguments"); + return true; + } else if (!IsJson(args, 0)) { + strcpy(message, "First argument must be a json item"); + return true; + } else + CalcLen(args, false, reslen, memlen, true); + + return JsonInit(initid, args, message, true, reslen, memlen); } // end of jbin_array_add_init char *jbin_array_add(UDF_INIT *initid, UDF_ARGS *args, char *result, @@ -4146,8 +4278,19 @@ void jbin_array_add_deinit(UDF_INIT* initid) /*********************************************************************************/ my_bool jbin_array_delete_init(UDF_INIT *initid, UDF_ARGS *args, char *message) { - return json_array_delete_init(initid, args, message); -} // end of jbin_array_delete_init + unsigned long reslen, memlen; + + if (args->arg_count < 2) { + strcpy(message, "This function must have at least 2 arguments"); + return true; + } else if (!IsJson(args, 0)) { + strcpy(message, "First argument must be a json item"); + return true; + } else + CalcLen(args, false, reslen, memlen, true); + + return JsonInit(initid, args, message, true, reslen, memlen); + } // end of jbin_array_delete_init char *jbin_array_delete(UDF_INIT *initid, UDF_ARGS *args, char *result, unsigned long *res_length, char *is_null, char *error) @@ -4369,8 +4512,19 @@ void jbin_object_key_deinit(UDF_INIT* initid) /*********************************************************************************/ my_bool jbin_object_add_init(UDF_INIT *initid, UDF_ARGS *args, char *message) { - return json_object_add_init(initid, args, message); -} // end of jbin_object_add_init + unsigned long reslen, memlen; + + if (args->arg_count < 2) { + strcpy(message, "This function must have at least 2 arguments"); + return true; + } else if (!IsJson(args, 0)) { + strcpy(message, "First argument must be a json item"); + return true; + } else + CalcLen(args, true, reslen, memlen, true); + + return JsonInit(initid, args, message, true, reslen, memlen); + } // end of jbin_object_add_init char *jbin_object_add(UDF_INIT *initid, UDF_ARGS *args, char *result, unsigned long *res_length, char *is_null, char *error) @@ -4435,8 +4589,22 @@ void jbin_object_add_deinit(UDF_INIT* initid) /*********************************************************************************/ my_bool jbin_object_delete_init(UDF_INIT *initid, UDF_ARGS *args, char *message) { - return json_object_delete_init(initid, args, message); -} // end of jbin_object_delete_init + unsigned long reslen, memlen; + + if (args->arg_count < 2) { + strcpy(message, "This function must have 2 or 3 arguments"); + return true; + } else if (!IsJson(args, 0)) { + strcpy(message, "First argument must be a json item"); + return true; + } else if (args->arg_type[1] != STRING_RESULT) { + strcpy(message, "Second argument must be a key string"); + return true; + } else + CalcLen(args, true, reslen, memlen, true); + + return JsonInit(initid, args, message, true, reslen, memlen); + } // end of jbin_object_delete_init char *jbin_object_delete(UDF_INIT *initid, UDF_ARGS *args, char *result, unsigned long *res_length, char *is_null, char *error) @@ -4645,8 +4813,22 @@ void jbin_get_item_deinit(UDF_INIT* initid) /*********************************************************************************/ my_bool jbin_item_merge_init(UDF_INIT *initid, UDF_ARGS *args, char *message) { - return json_item_merge_init(initid, args, message); -} // end of jbin_item_merge_init + unsigned long reslen, memlen; + + if (args->arg_count < 2) { + strcpy(message, "This function must have at least 2 arguments"); + return true; + } else if (!IsJson(args, 0)) { + strcpy(message, "First argument must be a json item"); + return true; + } else if (!IsJson(args, 1)) { + strcpy(message, "Second argument must be a json item"); + return true; + } else + CalcLen(args, false, reslen, memlen, true); + + return JsonInit(initid, args, message, true, reslen, memlen); + } // end of jbin_item_merge_init char *jbin_item_merge(UDF_INIT *initid, UDF_ARGS *args, char *result, unsigned long *res_length, char *is_null, char *error) @@ -4706,14 +4888,9 @@ void jbin_item_merge_deinit(UDF_INIT* initid) } // end of jbin_item_merge_deinit /*********************************************************************************/ -/* Set Json items of a Json document according to path. */ +/* This function is used by the jbin_set/insert/update functions. */ /*********************************************************************************/ -my_bool jbin_set_item_init(UDF_INIT *initid, UDF_ARGS *args, char *message) -{ - return json_set_item_init(initid, args, message); -} // end of jbin_set_item_init - -char *jbin_set_item(UDF_INIT *initid, UDF_ARGS *args, char *result, +static char *bin_handle_item(UDF_INIT *initid, UDF_ARGS *args, char *result, unsigned long *res_length, char *is_null, char *error) { char *p, *path; @@ -4721,7 +4898,7 @@ char *jbin_set_item(UDF_INIT *initid, UDF_ARGS *args, char *result, my_bool b = true; PJSON jsp; PJSNX jsx; - PJVAL jvp; + PJVAL jvp= 0; PBSON bsp = NULL; PGLOBAL g = (PGLOBAL)initid->ptr; PGLOBAL gb = GetMemPtr(g, args, 0); @@ -4732,16 +4909,21 @@ char *jbin_set_item(UDF_INIT *initid, UDF_ARGS *args, char *result, } else if (initid->const_item) g->N = 1; - if (!strcmp(result, "$insert")) + if (!strcmp(result, "$set")) + w = 0; + else if (!strcmp(result, "$insert")) w = 1; else if (!strcmp(result, "$update")) w = 2; - else - w = 0; + else { + PUSH_WARNING("Logical error, please contact CONNECT developer"); + goto fin; + } // endelse if (!g->Xchk) { if (CheckMemory(g, initid, args, 1, true, false, true)) { PUSH_WARNING("CheckMemory error"); + goto fin; } else jvp = MakeValue(g, args, 0); @@ -4791,7 +4973,7 @@ char *jbin_set_item(UDF_INIT *initid, UDF_ARGS *args, char *result, // Keep result of constant function g->Activityp = (PACTIVITY)bsp; - fin: +fin: if (!bsp) { *is_null = 1; *res_length = 0; @@ -4799,6 +4981,44 @@ char *jbin_set_item(UDF_INIT *initid, UDF_ARGS *args, char *result, *res_length = sizeof(BSON); return (char*)bsp; +} // end of bin_handle_item + +/*********************************************************************************/ +/* Set Json items of a Json document according to path. */ +/*********************************************************************************/ +my_bool jbin_set_item_init(UDF_INIT *initid, UDF_ARGS *args, char *message) +{ + unsigned long reslen, memlen; + int n = IsJson(args, 0); + + if (!(args->arg_count % 2)) { + strcpy(message, "This function must have an odd number of arguments"); + return true; + } else if (!n && args->arg_type[0] != STRING_RESULT) { + strcpy(message, "First argument must be a json item"); + return true; + } else + CalcLen(args, false, reslen, memlen); + + if (n == 2 && args->args[0]) { + char fn[_MAX_PATH]; + long fl; + + memcpy(fn, args->args[0], args->lengths[0]); + fn[args->lengths[0]] = 0; + fl = GetFileLength(fn); + memlen += fl * 3; + } else if (n != 3) + memlen += args->lengths[0] * 3; + + return JsonInit(initid, args, message, true, reslen, memlen); + } // end of jbin_set_item_init + +char *jbin_set_item(UDF_INIT *initid, UDF_ARGS *args, char *result, + unsigned long *res_length, char *is_null, char *p) +{ + strcpy(result, "$set"); + return bin_handle_item(initid, args, result, res_length, is_null, p); } // end of jbin_set_item void jbin_set_item_deinit(UDF_INIT* initid) @@ -4818,7 +5038,7 @@ char *jbin_insert_item(UDF_INIT *initid, UDF_ARGS *args, char *result, unsigned long *res_length, char *is_null, char *p) { strcpy(result, "$insert"); - return jbin_set_item(initid, args, result, res_length, is_null, p); + return bin_handle_item(initid, args, result, res_length, is_null, p); } // end of jbin_insert_item void jbin_insert_item_deinit(UDF_INIT* initid) @@ -4838,7 +5058,7 @@ char *jbin_update_item(UDF_INIT *initid, UDF_ARGS *args, char *result, unsigned long *res_length, char *is_null, char *p) { strcpy(result, "$update"); - return jbin_set_item(initid, args, result, res_length, is_null, p); + return bin_handle_item(initid, args, result, res_length, is_null, p); } // end of jbin_update_item void jbin_update_item_deinit(UDF_INIT* initid) @@ -4963,7 +5183,7 @@ my_bool json_serialize_init(UDF_INIT *initid, UDF_ARGS *args, char *message) if (args->arg_count != 1) { strcpy(message, "This function must have 1 argument"); return true; - } else if (IsJson(args, 0) != 3) { + } else if (args->args[0] && IsJson(args, 0) != 3) { strcpy(message, "Argument must be a Jbin tree"); return true; } else @@ -4973,21 +5193,27 @@ my_bool json_serialize_init(UDF_INIT *initid, UDF_ARGS *args, char *message) } // end of json_serialize_init char *json_serialize(UDF_INIT *initid, UDF_ARGS *args, char *result, - unsigned long *res_length, char *, char *) + unsigned long *res_length, char *, char *error) { char *str; PGLOBAL g = (PGLOBAL)initid->ptr; if (!g->Xchk) { - PBSON bsp = (PBSON)args->args[0]; + if (IsJson(args, 0) == 3) { + PBSON bsp = (PBSON)args->args[0]; - JsonSubSet(g); + JsonSubSet(g); - if (!(str = Serialize(g, bsp->Jsp, NULL, 0))) - str = strcpy(result, g->Message); + if (!(str = Serialize(g, bsp->Jsp, NULL, 0))) + str = strcpy(result, g->Message); + + // Keep result of constant function + g->Xchk = (initid->const_item) ? str : NULL; + } else { + *error = 1; + str = strcpy(result, "Argument is not a Jbin tree"); + } // endif - // Keep result of constant function - g->Xchk = (initid->const_item) ? str : NULL; } else str = (char*)g->Xchk; @@ -4999,3 +5225,37 @@ void json_serialize_deinit(UDF_INIT* initid) { JsonFreeMem((PGLOBAL)initid->ptr); } // end of json_serialize_deinit + +/*********************************************************************************/ +/* Utility function returning an environment variable value. */ +/*********************************************************************************/ +my_bool envar_init(UDF_INIT *initid, UDF_ARGS *args, char *message) +{ + if (args->arg_count != 1) { + strcpy(message, "Unique argument must be an environment variable name"); + return true; + } else { + initid->maybe_null = true; + return false; + } // endif count + +} // end of envar_init + +char *envar(UDF_INIT *initid, UDF_ARGS *args, char *result, + unsigned long *res_length, char *is_null, char *) +{ + char *str, name[256]; + int n = MY_MIN(args->lengths[0], sizeof(name) - 1); + + memcpy(name, args->args[0], n); + name[n] = 0; + + if (!(str = getenv(name))) { + *res_length = 0; + *is_null = 1; + } else + *res_length = strlen(str); + + return str; +} // end of envar + diff --git a/storage/connect/jsonudf.h b/storage/connect/jsonudf.h index b7e9b8ecabb..1406d9f2f2e 100644 --- a/storage/connect/jsonudf.h +++ b/storage/connect/jsonudf.h @@ -218,8 +218,12 @@ extern "C" { DllExport my_bool json_serialize_init(UDF_INIT*, UDF_ARGS*, char*); DllExport char *json_serialize(UDF_EXEC_ARGS); DllExport void json_serialize_deinit(UDF_INIT*); + + DllExport my_bool envar_init(UDF_INIT*, UDF_ARGS*, char*); + DllExport char *envar(UDF_EXEC_ARGS); } // extern "C" + /*********************************************************************************/ /* Structure JPN. Used to make the locate path. */ /*********************************************************************************/ diff --git a/storage/connect/maputil.cpp b/storage/connect/maputil.cpp index c4e016f1511..87263b3adf6 100644 --- a/storage/connect/maputil.cpp +++ b/storage/connect/maputil.cpp @@ -190,8 +190,8 @@ bool CloseMemMap(void *memory, size_t dwSize) { if (memory) { // All this must be redesigned - int rc = msync(memory, dwSize, MS_SYNC); - return (munmap(memory, dwSize) < 0) ? true : false; + int rc = msync((char*)memory, dwSize, MS_SYNC); + return (munmap((char*)memory, dwSize) < 0) ? true : false; } else return false; diff --git a/storage/connect/mycat.cc b/storage/connect/mycat.cc index 97ad980dd6a..b4b03e6ba4a 100644 --- a/storage/connect/mycat.cc +++ b/storage/connect/mycat.cc @@ -80,6 +80,10 @@ #define NODBC #include "tabodbc.h" #endif // ODBC_SUPPORT +#if defined(JDBC_SUPPORT) +#define NJDBC +#include "tabjdbc.h" +#endif // ODBC_SUPPORT #if defined(PIVOT_SUPPORT) #include "tabpivot.h" #endif // PIVOT_SUPPORT @@ -105,19 +109,7 @@ PQRYRES OEMColumns(PGLOBAL g, PTOS topt, char *tab, char *db, bool info); /***********************************************************************/ char *GetPluginDir(void) { - char *plugin_dir; - -#if defined(_WIN64) - plugin_dir = (char *)GetProcAddress(GetModuleHandle(NULL), - "?opt_plugin_dir@@3PADEA"); -#elif defined(_WIN32) - plugin_dir = (char*)GetProcAddress(GetModuleHandle(NULL), - "?opt_plugin_dir@@3PADA"); -#else - plugin_dir = opt_plugin_dir; -#endif - - return plugin_dir; + return opt_plugin_dir; } // end of GetPluginDir /***********************************************************************/ @@ -140,7 +132,10 @@ TABTYPE GetTypeID(const char *type) #ifdef ODBC_SUPPORT : (!stricmp(type, "ODBC")) ? TAB_ODBC #endif - : (!stricmp(type, "MYSQL")) ? TAB_MYSQL +#ifdef JDBC_SUPPORT + : (!stricmp(type, "JDBC")) ? TAB_JDBC +#endif + : (!stricmp(type, "MYSQL")) ? TAB_MYSQL : (!stricmp(type, "MYPRX")) ? TAB_MYSQL : (!stricmp(type, "DIR")) ? TAB_DIR #ifdef __WIN__ @@ -301,12 +296,12 @@ int GetIndexType(TABTYPE type) break; case TAB_MYSQL: case TAB_ODBC: - xtyp= 2; + case TAB_JDBC: + xtyp= 2; break; case TAB_VIR: xtyp= 3; break; -// case TAB_ODBC: default: xtyp= 0; break; @@ -558,6 +553,9 @@ PRELDEF MYCAT::MakeTableDesc(PGLOBAL g, PTABLE tablep, LPCSTR am) #if defined(ODBC_SUPPORT) case TAB_ODBC: tdp= new(g) ODBCDEF; break; #endif // ODBC_SUPPORT +#if defined(JDBC_SUPPORT) + case TAB_JDBC: tdp= new(g)JDBCDEF; break; +#endif // JDBC_SUPPORT #if defined(__WIN__) case TAB_MAC: tdp= new(g) MACDEF; break; case TAB_WMI: tdp= new(g) WMIDEF; break; diff --git a/storage/connect/myconn.cpp b/storage/connect/myconn.cpp index ada0109a820..644ca019e4a 100644 --- a/storage/connect/myconn.cpp +++ b/storage/connect/myconn.cpp @@ -5,7 +5,7 @@ /* */ /* COPYRIGHT: */ /* ---------- */ -/* (C) Copyright to the author Olivier BERTRAND 2007-2015 */ +/* (C) Copyright to the author Olivier BERTRAND 2007-2016 */ /* */ /* WHAT THIS PROGRAM DOES: */ /* ----------------------- */ @@ -401,8 +401,10 @@ PQRYRES SrcColumns(PGLOBAL g, const char *host, const char *db, MYSQLC::MYSQLC(void) { m_DB = NULL; - m_Stmt = NULL; - m_Res = NULL; +#if defined (MYSQL_PREPARED_STATEMENTS) + m_Stmt = NULL; +#endif // MYSQL_PREPARED_STATEMENTS + m_Res = NULL; m_Rows = -1; m_Row = NULL; m_Fields = -1; @@ -444,7 +446,10 @@ int MYSQLC::Open(PGLOBAL g, const char *host, const char *db, return RC_FX; } // endif m_DB - // Removed to do like FEDERATED do + if (trace) + htrc("MYSQLC Open: m_DB=%.4X size=%d\n", m_DB, (int)sizeof(*m_DB)); + + // Removed to do like FEDERATED do //mysql_options(m_DB, MYSQL_READ_DEFAULT_GROUP, "client-mariadb"); mysql_options(m_DB, MYSQL_OPT_USE_REMOTE_CONNECTION, NULL); mysql_options(m_DB, MYSQL_OPT_CONNECT_TIMEOUT, &cto); @@ -701,6 +706,11 @@ int MYSQLC::ExecSQL(PGLOBAL g, const char *query, int *w) } else { m_Fields = mysql_num_fields(m_Res); m_Rows = (!m_Use) ? (int)mysql_num_rows(m_Res) : 0; + + if (trace) + htrc("ExecSQL: m_Res=%.4X size=%d m_Fields=%d m_Rows=%d\n", + m_Res, sizeof(*m_Res), m_Fields, m_Rows); + } // endif m_Res } else { @@ -901,8 +911,12 @@ PQRYRES MYSQLC::GetResult(PGLOBAL g, bool pdb) if (fld->flags & NOT_NULL_FLAG) crp->Nulls = NULL; else { - crp->Nulls = (char*)PlugSubAlloc(g, NULL, m_Rows); - memset(crp->Nulls, ' ', m_Rows); + if (m_Rows) { + crp->Nulls = (char*)PlugSubAlloc(g, NULL, m_Rows); + memset(crp->Nulls, ' ', m_Rows); + } // endif m_Rows + + crp->Kdata->SetNullable(true); } // endelse fld->flags } // endfor fld @@ -959,11 +973,16 @@ void MYSQLC::FreeResult(void) /***********************************************************************/ /* Place the cursor at the beginning of the result set. */ /***********************************************************************/ -void MYSQLC::Rewind(void) +int MYSQLC::Rewind(PGLOBAL g, PSZ sql) { - if (m_Res) - DataSeek(0); + int rc = RC_OK; + if (m_Res) + DataSeek(0); + else if (sql) + rc = ExecSQL(g, sql); + + return rc; } // end of Rewind /***********************************************************************/ @@ -1008,7 +1027,11 @@ int MYSQLC::ExecSQLcmd(PGLOBAL g, const char *query, int *w) void MYSQLC::Close(void) { FreeResult(); - mysql_close(m_DB); + + if (trace) + htrc("MYSQLC Close: m_DB=%.4X\n", m_DB); + + mysql_close(m_DB); m_DB = NULL; } // end of Close diff --git a/storage/connect/myconn.h b/storage/connect/myconn.h index fa34edd804c..9ebd37527a6 100644 --- a/storage/connect/myconn.h +++ b/storage/connect/myconn.h @@ -80,7 +80,7 @@ class DllItem MYSQLC { int Fetch(PGLOBAL g, int pos); char *GetCharField(int i); int GetFieldLength(int i); - void Rewind(void); + int Rewind(PGLOBAL g, PSZ sql); void FreeResult(void); void Close(void); @@ -90,8 +90,10 @@ class DllItem MYSQLC { // Members MYSQL *m_DB; // The return from MySQL connection - MYSQL_STMT *m_Stmt; // Prepared statement handle - MYSQL_RES *m_Res; // Points to MySQL Result +#if defined (MYSQL_PREPARED_STATEMENTS) + MYSQL_STMT *m_Stmt; // Prepared statement handle +#endif // MYSQL_PREPARED_STATEMENTS + MYSQL_RES *m_Res; // Points to MySQL Result MYSQL_ROW m_Row; // Point to current row int m_Rows; // The number of rows of the result int N; diff --git a/storage/connect/mysql-test/connect/disabled.def b/storage/connect/mysql-test/connect/disabled.def index 67acb5dff29..4e07b5c0576 100644 --- a/storage/connect/mysql-test/connect/disabled.def +++ b/storage/connect/mysql-test/connect/disabled.def @@ -1 +1,15 @@ -json_udf_bin : broken upstream in --ps +############################################################################## +# +# List the test cases that are to be disabled temporarily. +# +# Separate the test case name and the comment with ':'. +# +# : BUG# +# +# Do not use any TAB characters for whitespace. +# +############################################################################## +jdbc : Variable settings depend on machine configuration +jdbc_new : Variable settings depend on machine configuration +jdbc_oracle : Variable settings depend on machine configuration +jdbc_postgresql : Variable settings depend on machine configuration diff --git a/storage/connect/mysql-test/connect/r/bin.result b/storage/connect/mysql-test/connect/r/bin.result index 4ba353ac705..1baa18a1e4d 100644 --- a/storage/connect/mysql-test/connect/r/bin.result +++ b/storage/connect/mysql-test/connect/r/bin.result @@ -57,7 +57,7 @@ t1 CREATE TABLE `t1` ( `name` char(10) NOT NULL, `birth` date NOT NULL, `id` char(5) NOT NULL `FIELD_FORMAT`='S', - `salary` double(9,2) NOT NULL DEFAULT '0.00' `FIELD_FORMAT`='F', + `salary` double(9,2) NOT NULL DEFAULT 0.00 `FIELD_FORMAT`='F', `dept` int(4) NOT NULL `FIELD_FORMAT`='S' ) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`=BIN `FILE_NAME`='Testbal.dat' `OPTION_LIST`='Endian=Little' `READONLY`=NO INSERT INTO t1 VALUES (7777,'BILL','1973-06-30',4444,5555.555,777); @@ -76,7 +76,7 @@ t1 CREATE TABLE `t1` ( `name` char(10) NOT NULL, `birth` date NOT NULL, `id` char(5) NOT NULL `FIELD_FORMAT`='S', - `salary` double(9,2) NOT NULL DEFAULT '0.00' `FIELD_FORMAT`='F', + `salary` double(9,2) NOT NULL DEFAULT 0.00 `FIELD_FORMAT`='F', `dept` int(4) NOT NULL `FIELD_FORMAT`='S' ) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`=BIN `FILE_NAME`='Testbal.dat' `OPTION_LIST`='Endian=Little' `READONLY`=YES INSERT INTO t1 VALUES (7777,'BILL','1973-06-30',4444,5555.555,777); diff --git a/storage/connect/mysql-test/connect/r/drop-open-error.result b/storage/connect/mysql-test/connect/r/drop-open-error.result new file mode 100644 index 00000000000..f0ad8553d8b --- /dev/null +++ b/storage/connect/mysql-test/connect/r/drop-open-error.result @@ -0,0 +1,13 @@ +create table t1 (c varchar(8)); +create table tcon engine=connect table_type=mysql CONNECTION='mysql://root@localhost/test/t1' SRCDEF='select c from t1 where c in ("foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar")'; +ERROR HY000: Too long value for 'SRCDEF' +drop table mdev9949; +drop table t1; +select @@secure_file_priv 'must be NULL'; +must be NULL +NULL +create table t1 (a char(16)) engine=myisam; +insert into t1 values('Hello World!'); +create table t2 engine=connect file_name='foo/bar.txt' as select * from t1; +ERROR HY000: Got error 174 'Open(a+b) error 2 on foo/bar.txt: No such file or directory' from CONNECT +drop table t1; diff --git a/storage/connect/mysql-test/connect/r/grant3.result b/storage/connect/mysql-test/connect/r/grant3.result new file mode 100644 index 00000000000..2f9d37bdb35 --- /dev/null +++ b/storage/connect/mysql-test/connect/r/grant3.result @@ -0,0 +1,5 @@ +create table tcon (i int) engine=Connect table_type=DOS file_name='tcon.dos'; +create table tin (i int); +create trigger tr after insert on tin for each row insert into tcon values (new.i); +insert into tin values (1); +drop table tin,tcon; diff --git a/storage/connect/mysql-test/connect/r/jdbc.result b/storage/connect/mysql-test/connect/r/jdbc.result new file mode 100644 index 00000000000..5e844bc9900 --- /dev/null +++ b/storage/connect/mysql-test/connect/r/jdbc.result @@ -0,0 +1,269 @@ +CREATE DATABASE connect; +USE connect; +CREATE TABLE t2 ( +id bigint not null, +msg varchar(500), +tm time, +dt date, +dtm datetime, +ts timestamp); +INSERT INTO t2 VALUES(455000000000, 'A very big number', '18:10:25', '2016-03-16', '1999-12-11 23:01:52', '2015-07-24 09:32:45'); +SELECT * FROM t2; +id msg tm dt dtm ts +455000000000 A very big number 18:10:25 2016-03-16 1999-12-11 23:01:52 2015-07-24 09:32:45 +# +# Testing JDBC connection to MySQL driver +# +USE test; +CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC TABNAME=t2 CONNECTION='jdbc:mysql://localhost:PORT/connect?user=root'; +SELECT * FROM t1; +id msg tm dt dtm ts +455000000000 A very big number 18:10:25 2016-03-16 1999-12-11 23:01:52 2015-07-24 09:32:45 +INSERT INTO t1 VALUES(786325481247, 'Hello!', '19:45:03', '1933-08-10', '1985-11-12 09:02:44', '2014-06-17 10:32:01'); +Warnings: +Note 1105 t2: 1 affected rows +SELECT * FROM t1; +id msg tm dt dtm ts +455000000000 A very big number 18:10:25 2016-03-16 1999-12-11 23:01:52 2015-07-24 09:32:45 +786325481247 Hello! 19:45:03 1933-08-09 1985-11-12 09:02:44 2014-06-17 10:32:01 +DELETE FROM t1 WHERE msg = 'Hello!'; +Warnings: +Note 1105 t2: 1 affected rows +SELECT * FROM t1; +id msg tm dt dtm ts +455000000000 A very big number 18:10:25 2016-03-16 1999-12-11 23:01:52 2015-07-24 09:32:45 +DROP TABLE t1; +# +# Testing JDBC view +# +CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC SRCDEF='select id, msg, tm, dt from t2' CONNECTION='jdbc:mysql://localhost:PORT/connect?user=root'; +SELECT * FROM t1; +id msg tm dt +455000000000 A very big number 18:10:25 2016-03-16 +SELECT msg, dt FROM t1; +msg dt +A very big number 2016-03-16 +DROP TABLE t1, connect.t2; +# +# Testing JDBC write operations +# +USE connect; +CREATE TABLE boys ( +name CHAR(12) NOT NULL, +city CHAR(11), +birth DATE DATE_FORMAT='DD/MM/YYYY', +hired DATE DATE_FORMAT='DD/MM/YYYY' flag=36) +ENGINE=CONNECT TABLE_TYPE=FIX FILE_NAME='boys.txt' ENDING=1; +SELECT * FROM boys; +name city birth hired +John Boston 1986-01-25 2010-06-02 +Henry Boston 1987-06-07 2008-04-01 +George San Jose 1981-08-10 2010-06-02 +Sam Chicago 1979-11-22 2007-10-10 +James Dallas 1992-05-13 2009-12-14 +Bill Boston 1986-09-11 2008-02-10 +USE test; +CREATE TABLE t3 ( +name CHAR(12) NOT NULL, +city CHAR(12), +birth DATE, +hired DATE); +INSERT INTO t3 VALUES('Donald','Atlanta','1999-04-01','2016-03-31'),('Mick','New York','1980-01-20','2002-09-11'); +SELECT * FROM t3; +name city birth hired +Donald Atlanta 1999-04-01 2016-03-31 +Mick New York 1980-01-20 2002-09-11 +CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC TABNAME=boys CONNECTION='jdbc:mysql://localhost:PORT/connect?user=root' OPTION_LIST='scrollable=1'; +SELECT * FROM t1; +name city birth hired +John Boston 1986-01-25 2010-06-02 +Henry Boston 1987-06-07 2008-04-01 +George San Jose 1981-08-10 2010-06-02 +Sam Chicago 1979-11-22 2007-10-10 +James Dallas 1992-05-13 2009-12-14 +Bill Boston 1986-09-11 2008-02-10 +UPDATE t1 SET city = 'Phoenix' WHERE name = 'Henry'; +Warnings: +Note 1105 boys: 1 affected rows +INSERT INTO t1 SELECT * FROM t3; +Warnings: +Note 1105 boys: 2 affected rows +INSERT INTO t1 VALUES('Tom','Seatle','2002-03-15',NULL); +Warnings: +Note 1105 boys: 1 affected rows +SELECT * FROM t1; +name city birth hired +John Boston 1986-01-25 2010-06-02 +Henry Phoenix 1987-06-07 2008-04-01 +George San Jose 1981-08-10 2010-06-02 +Sam Chicago 1979-11-22 2007-10-10 +James Dallas 1992-05-13 2009-12-14 +Bill Boston 1986-09-11 2008-02-10 +Donald Atlanta 1999-04-01 2016-03-31 +Mick New York 1980-01-20 2002-09-11 +Tom Seatle 2002-03-15 1970-01-01 +DROP TABLE t3; +# +# Testing JDBC join operations +# +CREATE TABLE t3 ( +name CHAR(9) NOT NULL, +city CHAR(12) NOT NULL, +age INT(2)) +engine=CONNECT table_type=FIX file_name='girls.txt'; +SELECT g.name, b.name, g.city FROM t3 g STRAIGHT_JOIN connect.boys b where g.city = b.city; +name name city +Mary John Boston +Susan Sam Chicago +Betty Sam Chicago +Mary Bill Boston +SELECT g.name, b.name, g.city FROM t3 g STRAIGHT_JOIN t1 b where g.city = b.city; +name name city +Mary John Boston +Susan Sam Chicago +Betty Sam Chicago +Mary Bill Boston +DROP TABLE t1, t3, connect.boys; +# +# Testing MariaDB JDBC driver +# +USE connect; +CREATE TABLE emp ( +serialno CHAR(5) NOT NULL, +name VARCHAR(12) NOT NULL FLAG=6, +sex TINYINT(1) NOT NULL, +title VARCHAR(15) NOT NULL FLAG=20, +manager CHAR(5) NOT NULL, +department CHAR(4) NOT NULL FLAG=41, +secretary CHAR(5) NOT NULL FLAG=46, +salary DOUBLE(8,2) NOT NULL FLAG=52) +ENGINE=connect TABLE_TYPE=fix FILE_NAME='employee.dat' ENDING=1; +SELECT * FROM emp; +serialno name sex title manager department secretary salary +74200 BANCROFT 2 SALESMAN 70012 0318 24888 9600.00 +02345 SMITH 1 ENGINEER 31416 2452 11111 9000.00 +78943 MERCHANT 1 SALESMAN 70012 0318 24888 8700.00 +07654 FUNNIGUY 1 ADMINISTRATOR 40567 0319 33333 8500.00 +45678 BUGHAPPY 1 PROGRAMMER 40567 0319 12345 8500.00 +34567 BIGHEAD 1 SCIENTIST 31416 2452 11111 8000.00 +77777 SHRINKY 2 ADMINISTRATOR 70012 0318 27845 7500.00 +74234 WALTER 1 ENGINEER 70012 0318 24888 7400.00 +56789 FODDERMAN 1 SALESMAN 40567 0319 12345 7000.00 +73452 TONGHO 1 ENGINEER 70012 0318 24888 6800.00 +22222 SHORTSIGHT 2 SECRETARY 87777 0021 5500.00 +55555 MESSIFUL 2 SECRETARY 40567 0319 12345 5000.50 +27845 HONEY 2 SECRETARY 70012 0318 24888 4900.00 +98765 GOOSEPEN 1 ADMINISTRATOR 07654 0319 33333 4700.00 +11111 CHERRY 2 SECRETARY 31416 2452 4500.00 +33333 MONAPENNY 2 SECRETARY 07654 0319 3800.00 +12345 KITTY 2 TYPIST 40567 0319 3000.45 +24888 PLUMHEAD 2 TYPIST 27845 0318 2800.00 +87777 STRONG 1 DIRECTOR 0021 22222 23000.00 +76543 BULLOZER 1 SALESMAN 40567 0319 12345 14800.00 +70012 WERTHER 1 DIRECTOR 87777 0318 27845 14500.00 +40567 QUINN 1 DIRECTOR 87777 0319 55555 14000.00 +31416 ORELLY 1 ENGINEER 87777 2452 11111 13400.00 +36666 BIGHORN 1 SCIENTIST 31416 2452 11111 11000.00 +00137 BROWNY 1 ENGINEER 40567 0319 12345 10500.00 +73111 WHEELFOR 1 SALESMAN 70012 0318 24888 10030.00 +00023 MARTIN 1 ENGINEER 40567 0319 12345 10000.00 +USE test; +CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC TABNAME=emp CONNECTION='jdbc:mariadb://localhost:PORT/connect?user=root'; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `serialno` char(5) NOT NULL, + `name` varchar(12) NOT NULL, + `sex` tinyint(3) NOT NULL, + `title` varchar(15) NOT NULL, + `manager` char(5) NOT NULL, + `department` char(4) NOT NULL, + `secretary` char(5) NOT NULL, + `salary` double(12,2) NOT NULL +) ENGINE=CONNECT DEFAULT CHARSET=latin1 CONNECTION='jdbc:mariadb://localhost:PORT/connect?user=root' `TABLE_TYPE`='JDBC' `TABNAME`='emp' +SELECT * FROM t1; +serialno name sex title manager department secretary salary +74200 BANCROFT 2 SALESMAN 70012 0318 24888 9600.00 +02345 SMITH 1 ENGINEER 31416 2452 11111 9000.00 +78943 MERCHANT 1 SALESMAN 70012 0318 24888 8700.00 +07654 FUNNIGUY 1 ADMINISTRATOR 40567 0319 33333 8500.00 +45678 BUGHAPPY 1 PROGRAMMER 40567 0319 12345 8500.00 +34567 BIGHEAD 1 SCIENTIST 31416 2452 11111 8000.00 +77777 SHRINKY 2 ADMINISTRATOR 70012 0318 27845 7500.00 +74234 WALTER 1 ENGINEER 70012 0318 24888 7400.00 +56789 FODDERMAN 1 SALESMAN 40567 0319 12345 7000.00 +73452 TONGHO 1 ENGINEER 70012 0318 24888 6800.00 +22222 SHORTSIGHT 2 SECRETARY 87777 0021 5500.00 +55555 MESSIFUL 2 SECRETARY 40567 0319 12345 5000.50 +27845 HONEY 2 SECRETARY 70012 0318 24888 4900.00 +98765 GOOSEPEN 1 ADMINISTRATOR 07654 0319 33333 4700.00 +11111 CHERRY 2 SECRETARY 31416 2452 4500.00 +33333 MONAPENNY 2 SECRETARY 07654 0319 3800.00 +12345 KITTY 2 TYPIST 40567 0319 3000.45 +24888 PLUMHEAD 2 TYPIST 27845 0318 2800.00 +87777 STRONG 1 DIRECTOR 0021 22222 23000.00 +76543 BULLOZER 1 SALESMAN 40567 0319 12345 14800.00 +70012 WERTHER 1 DIRECTOR 87777 0318 27845 14500.00 +40567 QUINN 1 DIRECTOR 87777 0319 55555 14000.00 +31416 ORELLY 1 ENGINEER 87777 2452 11111 13400.00 +36666 BIGHORN 1 SCIENTIST 31416 2452 11111 11000.00 +00137 BROWNY 1 ENGINEER 40567 0319 12345 10500.00 +73111 WHEELFOR 1 SALESMAN 70012 0318 24888 10030.00 +00023 MARTIN 1 ENGINEER 40567 0319 12345 10000.00 +SELECT name, title, salary FROM t1 WHERE sex = 1; +name title salary +SMITH ENGINEER 9000.00 +MERCHANT SALESMAN 8700.00 +FUNNIGUY ADMINISTRATOR 8500.00 +BUGHAPPY PROGRAMMER 8500.00 +BIGHEAD SCIENTIST 8000.00 +WALTER ENGINEER 7400.00 +FODDERMAN SALESMAN 7000.00 +TONGHO ENGINEER 6800.00 +GOOSEPEN ADMINISTRATOR 4700.00 +STRONG DIRECTOR 23000.00 +BULLOZER SALESMAN 14800.00 +WERTHER DIRECTOR 14500.00 +QUINN DIRECTOR 14000.00 +ORELLY ENGINEER 13400.00 +BIGHORN SCIENTIST 11000.00 +BROWNY ENGINEER 10500.00 +WHEELFOR SALESMAN 10030.00 +MARTIN ENGINEER 10000.00 +DROP TABLE t1, connect.emp; +CREATE TABLE t2 (command varchar(128) not null,number int(5) not null flag=1,message varchar(255) flag=2) ENGINE=CONNECT TABLE_TYPE=JDBC CONNECTION='jdbc:mariadb://localhost:PORT/connect' OPTION_LIST='User=root,Execsrc=1'; +SELECT * FROM t2 WHERE command='drop table tx1'; +command number message +drop table tx1 0 Execute: java.sql.SQLSyntaxErrorException: Unknown table 'connect.tx1' +Query is : drop table tx1 +SELECT * FROM t2 WHERE command = 'create table tx1 (a int not null, b char(32), c double(8,2))'; +command number message +create table tx1 (a int not null, b char(32), c double(8,2)) 0 Affected rows +SELECT * FROM t2 WHERE command in ('insert into tx1 values(1,''The number one'',456.12)',"insert into tx1(a,b) values(2,'The number two'),(3,'The number three')"); +command number message +insert into tx1 values(1,'The number one',456.12) 1 Affected rows +insert into tx1(a,b) values(2,'The number two'),(3,'The number three') 2 Affected rows +SELECT * FROM t2 WHERE command='update tx1 set c = 3.1416 where a = 2'; +command number message +update tx1 set c = 3.1416 where a = 2 1 Affected rows +SELECT * FROM t2 WHERE command='select * from tx1'; +command number message +select * from tx1 3 Result set column number +SELECT * FROM t2 WHERE command='delete from tx1 where a = 2'; +command number message +delete from tx1 where a = 2 1 Affected rows +SELECT * FROM connect.tx1; +a b c +1 The number one 456.12 +3 The number three NULL +DROP TABLE t2; +CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC CATFUNC=tables CONNECTION='jdbc:mariadb://localhost:PORT/connect' option_list='User=root,Maxres=50'; +SELECT * FROM t1; +Table_Cat Table_Schema Table_Name Table_Type Remark +connect NULL tx1 BASE TABLE +DROP TABLE t1; +DROP TABLE connect.tx1; +DROP DATABASE connect; +SET GLOBAL connect_jvm_path=NULL; +SET GLOBAL connect_class_path=NULL; +SET GLOBAL time_zone = SYSTEM; diff --git a/storage/connect/mysql-test/connect/r/jdbc_new.result b/storage/connect/mysql-test/connect/r/jdbc_new.result new file mode 100644 index 00000000000..e5356edd5d8 --- /dev/null +++ b/storage/connect/mysql-test/connect/r/jdbc_new.result @@ -0,0 +1,216 @@ +CREATE TABLE t1 (a int, b char(10)); +INSERT INTO t1 VALUES (NULL,NULL),(0,'test00'),(1,'test01'),(2,'test02'),(3,'test03'); +SELECT * FROM t1; +a b +NULL NULL +0 test00 +1 test01 +2 test02 +3 test03 +# +# Testing errors +# +CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC +CONNECTION='jdbc:mysql://127.0.0.1:SLAVE_PORT/test?user=unknown'; +SELECT * FROM t1; +ERROR HY000: Got error 174 'Connecting: java.sql.SQLException: Access denied for user 'unknown'@'localhost' (using password: NO) rc=-2' from CONNECT +DROP TABLE t1; +CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC +CONNECTION='jdbc:mysql://127.0.0.1:SLAVE_PORT/unknown?user=root'; +ERROR HY000: Connecting: java.sql.SQLSyntaxErrorException: Unknown database 'unknown' rc=-2 +CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC TABNAME='unknown' + CONNECTION='jdbc:mysql://127.0.0.1:SLAVE_PORT/test?user=root'; +ERROR HY000: Cannot get columns from unknown +SHOW CREATE TABLE t1; +ERROR 42S02: Table 'test.t1' doesn't exist +CREATE TABLE t1 (x int, y char(10)) ENGINE=CONNECT TABLE_TYPE=JDBC +CONNECTION='jdbc:mysql://127.0.0.1:SLAVE_PORT/test?user=root'; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `x` int(11) DEFAULT NULL, + `y` char(10) DEFAULT NULL +) ENGINE=CONNECT DEFAULT CHARSET=latin1 CONNECTION='jdbc:mysql://127.0.0.1:SLAVE_PORT/test?user=root' `TABLE_TYPE`=JDBC +SELECT * FROM t1; +ERROR HY000: Got error 174 'ExecuteQuery: java.sql.SQLSyntaxErrorException: Unknown column 'x' in 'field list' +Query is : SELECT x, y FROM t1' from CONNECT +DROP TABLE t1; +CREATE TABLE t1 (a int, b char(10)) ENGINE=CONNECT TABLE_TYPE=JDBC +CONNECTION='jdbc:mysql://127.0.0.1:SLAVE_PORT/test?user=root'; +ALTER TABLE t1 RENAME t1backup; +SELECT * FROM t1; +ERROR HY000: Got error 174 'ExecuteQuery: java.sql.SQLSyntaxErrorException: Table 'test.t1' doesn't exist +Query is : SELECT a, b FROM t1' from CONNECT +ALTER TABLE t1backup RENAME t1; +DROP TABLE t1; +# +# Testing SELECT, etc. +# +CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC +CONNECTION='jdbc:mysql://127.0.0.1:SLAVE_PORT/test?user=root'; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(10) DEFAULT NULL, + `b` char(10) DEFAULT NULL +) ENGINE=CONNECT DEFAULT CHARSET=latin1 CONNECTION='jdbc:mysql://127.0.0.1:SLAVE_PORT/test?user=root' `TABLE_TYPE`='JDBC' +SELECT * FROM t1; +a b +0 NULL +0 test00 +1 test01 +2 test02 +3 test03 +DROP TABLE t1; +CREATE TABLE t1 (a int, b char(10)) ENGINE=CONNECT TABLE_TYPE=JDBC TABNAME='t1' + CONNECTION='jdbc:mysql://127.0.0.1:SLAVE_PORT/test?user=root'; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(10) DEFAULT NULL +) ENGINE=CONNECT DEFAULT CHARSET=latin1 CONNECTION='jdbc:mysql://127.0.0.1:SLAVE_PORT/test?user=root' `TABLE_TYPE`=JDBC `TABNAME`='t1' +SELECT * FROM t1; +a b +0 NULL +0 test00 +1 test01 +2 test02 +3 test03 +DROP TABLE t1; +CREATE TABLE t1 (a INT NOT NULL, b CHAR(10) NOT NULL) ENGINE=CONNECT TABLE_TYPE=JDBC +CONNECTION='jdbc:mysql://127.0.0.1:SLAVE_PORT/test?user=root'; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) NOT NULL, + `b` char(10) NOT NULL +) ENGINE=CONNECT DEFAULT CHARSET=latin1 CONNECTION='jdbc:mysql://127.0.0.1:SLAVE_PORT/test?user=root' `TABLE_TYPE`=JDBC +SELECT * FROM t1; +a b +0 +0 test00 +1 test01 +2 test02 +3 test03 +DROP TABLE t1; +CREATE TABLE t1 (a char(10), b int) ENGINE=CONNECT TABLE_TYPE=JDBC +CONNECTION='jdbc:mysql://127.0.0.1:SLAVE_PORT/test?user=root'; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(10) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) ENGINE=CONNECT DEFAULT CHARSET=latin1 CONNECTION='jdbc:mysql://127.0.0.1:SLAVE_PORT/test?user=root' `TABLE_TYPE`=JDBC +SELECT * FROM t1; +a b +0 NULL +0 0 +1 0 +2 0 +3 0 +DROP TABLE t1; +DROP TABLE t1; +# +# Testing numeric data types +# +CREATE TABLE t1 (a tinyint, b smallint, c mediumint, d int, e bigint, f float, g double, h decimal(20,5)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` tinyint(4) DEFAULT NULL, + `b` smallint(6) DEFAULT NULL, + `c` mediumint(9) DEFAULT NULL, + `d` int(11) DEFAULT NULL, + `e` bigint(20) DEFAULT NULL, + `f` float DEFAULT NULL, + `g` double DEFAULT NULL, + `h` decimal(20,5) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES(100,3333,41235,1234567890,235000000000,3.14159265,3.14159265,3141.59265); +CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC +CONNECTION='jdbc:mysql://127.0.0.1:SLAVE_PORT/test?user=root'; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` tinyint(3) DEFAULT NULL, + `b` smallint(5) DEFAULT NULL, + `c` int(7) DEFAULT NULL, + `d` int(10) DEFAULT NULL, + `e` bigint(19) DEFAULT NULL, + `f` double(14,0) DEFAULT NULL, + `g` double(24,0) DEFAULT NULL, + `h` decimal(27,5) DEFAULT NULL +) ENGINE=CONNECT DEFAULT CHARSET=latin1 CONNECTION='jdbc:mysql://127.0.0.1:SLAVE_PORT/test?user=root' `TABLE_TYPE`='JDBC' +SELECT * FROM t1; +a b c d e f g h +100 3333 41235 1234567890 235000000000 3 3 3141.59265 +DROP TABLE t1; +DROP TABLE t1; +# +# Testing character data types +# +CREATE TABLE t1 (a char(12), b varchar(12)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(12) DEFAULT NULL, + `b` varchar(12) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES('Welcome','Hello, World'); +SELECT * FROM t1; +a b +Welcome Hello, World +CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC +CONNECTION='jdbc:mysql://127.0.0.1:SLAVE_PORT/test?user=root'; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(12) DEFAULT NULL, + `b` varchar(12) DEFAULT NULL +) ENGINE=CONNECT DEFAULT CHARSET=latin1 CONNECTION='jdbc:mysql://127.0.0.1:SLAVE_PORT/test?user=root' `TABLE_TYPE`='JDBC' +SELECT * FROM t1; +a b +Welcome Hello, World +DROP TABLE t1; +DROP TABLE t1; +# +# Testing temporal data types +# +CREATE TABLE t1 (a date, b datetime, c time, d timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, e year); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` date DEFAULT NULL, + `b` datetime DEFAULT NULL, + `c` time DEFAULT NULL, + `d` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `e` year(4) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES('2003-05-27 10:45:23','2003-05-27 10:45:23','2003-05-27 10:45:23','2003-05-27 10:45:23','2003-05-27 10:45:23'); +Warnings: +Note 1265 Data truncated for column 'a' at row 1 +Note 1265 Data truncated for column 'c' at row 1 +Warning 1265 Data truncated for column 'e' at row 1 +SELECT * FROM t1; +a b c d e +2003-05-27 2003-05-27 10:45:23 10:45:23 2003-05-27 10:45:23 2003 +CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC +CONNECTION='jdbc:mysql://127.0.0.1:SLAVE_PORT/test?user=root'; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` date DEFAULT NULL, + `b` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `c` time DEFAULT NULL, + `d` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', + `e` date DEFAULT NULL +) ENGINE=CONNECT DEFAULT CHARSET=latin1 CONNECTION='jdbc:mysql://127.0.0.1:SLAVE_PORT/test?user=root' `TABLE_TYPE`='JDBC' +SELECT * FROM t1; +a b c d e +2003-05-27 2003-05-27 10:45:23 10:45:23 2003-05-27 10:45:23 1970-01-01 +DROP TABLE t1; +DROP TABLE t1; +SET GLOBAL connect_jvm_path=NULL; +SET GLOBAL connect_class_path=NULL; +SET GLOBAL time_zone = SYSTEM; diff --git a/storage/connect/mysql-test/connect/r/jdbc_oracle.result b/storage/connect/mysql-test/connect/r/jdbc_oracle.result new file mode 100644 index 00000000000..2e36891a037 --- /dev/null +++ b/storage/connect/mysql-test/connect/r/jdbc_oracle.result @@ -0,0 +1,70 @@ +CREATE TABLE t2 ( +command varchar(128) not null, +number int(5) not null flag=1, +message varchar(255) flag=2) +ENGINE=CONNECT TABLE_TYPE=JDBC CONNECTION='jdbc:oracle:thin:@localhost:1521:xe' +OPTION_LIST='User=system,Password=manager,Execsrc=1'; +SELECT * FROM t2 WHERE command = 'drop table employee'; +command number message +drop table employee 0 Execute: java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist + +SELECT * FROM t2 WHERE command = 'create table employee (id int not null, name varchar(32), title char(16), salary number(8,2))'; +command number message +create table employee (id int not null, name varchar(32), title char(16), salary number(8,2)) 0 Affected rows +SELECT * FROM t2 WHERE command = "insert into employee values(4567,'Johnson', 'Engineer', 12560.50)"; +command number message +insert into employee values(4567,'Johnson', 'Engineer', 12560.50) 1 Affected rows +CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC CATFUNC=tables +CONNECTION='jdbc:oracle:thin:@localhost:1521:xe' +OPTION_LIST='User=system,Password=manager'; +SELECT * FROM t1 WHERE table_name='employee'; +Table_Cat Table_Schema Table_Name Table_Type Remark +NULL SYSTEM EMPLOYEE TABLE NULL +DROP TABLE t1; +CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC TABNAME='EMPLOYEE' CATFUNC=columns +CONNECTION='jdbc:oracle:thin:@localhost:1521:xe' +OPTION_LIST='User=system,Password=manager'; +SELECT * FROM t1; +Table_Cat Table_Schema Table_Name Column_Name Data_Type Type_Name Column_Size Buffer_Length Decimal_Digits Radix Nullable Remarks +NULL SYSTEM EMPLOYEE ID 3 NUMBER 38 0 0 10 0 NULL +NULL SYSTEM EMPLOYEE NAME 12 VARCHAR2 32 0 0 10 1 NULL +NULL SYSTEM EMPLOYEE TITLE 1 CHAR 16 0 0 10 1 NULL +NULL SYSTEM EMPLOYEE SALARY 3 NUMBER 8 0 2 10 1 NULL +DROP TABLE t1; +CREATE SERVER 'oracle' FOREIGN DATA WRAPPER 'oracle.jdbc.driver.OracleDriver' OPTIONS ( +HOST 'jdbc:oracle:thin:@localhost:1521:xe', +DATABASE 'SYSTEM', +USER 'system', +PASSWORD 'manager', +PORT 0, +SOCKET '', +OWNER 'SYSTEM'); +CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC CONNECTION='oracle' tabname='EMPLOYEE'; +SELECT * FROM t1; +ID NAME TITLE SALARY +4567 Johnson Engineer 12560.50 +INSERT INTO t1 VALUES(6214, 'Clinton', 'Retired', NULL); +Warnings: +Note 1105 EMPLOYEE: 1 affected rows +UPDATE t1 set name='Trump' WHERE id = 4567; +Warnings: +Note 1105 EMPLOYEE: 1 affected rows +SELECT * FROM t1; +ID NAME TITLE SALARY +4567 Trump Engineer 12560.50 +6214 Clinton Retired 0.00 +DELETE FROM t1 WHERE id = 6214; +Warnings: +Note 1105 EMPLOYEE: 1 affected rows +SELECT * FROM t1; +ID NAME TITLE SALARY +4567 Trump Engineer 12560.50 +DROP TABLE t1; +SELECT * FROM t2 WHERE command = 'drop table employee'; +command number message +drop table employee 0 Affected rows +DROP TABLE t2; +DROP SERVER 'oracle'; +SET GLOBAL connect_jvm_path=NULL; +SET GLOBAL connect_class_path=NULL; +SET GLOBAL time_zone = SYSTEM; diff --git a/storage/connect/mysql-test/connect/r/jdbc_postgresql.result b/storage/connect/mysql-test/connect/r/jdbc_postgresql.result new file mode 100644 index 00000000000..6d77d79d5d3 --- /dev/null +++ b/storage/connect/mysql-test/connect/r/jdbc_postgresql.result @@ -0,0 +1,65 @@ +CREATE TABLE t2 ( +command varchar(128) not null, +number int(5) not null flag=1, +message varchar(255) flag=2) +ENGINE=CONNECT TABLE_TYPE=JDBC CONNECTION='jdbc:postgresql://localhost/mtr' +OPTION_LIST='User=mtr,Password=mtr,Schema=public,Execsrc=1'; +SELECT * FROM t2 WHERE command='drop table employee'; +command number message +drop table employee 0 Execute: org.postgresql.util.PSQLException: ERREUR: la table « employee » n'existe pas +SELECT * FROM t2 WHERE command = 'create table employee (id int not null, name varchar(32), title char(16), salary decimal(8,2))'; +command number message +create table employee (id int not null, name varchar(32), title char(16), salary decimal(8,2)) 0 Affected rows +SELECT * FROM t2 WHERE command = "insert into employee values(4567,'Johnson', 'Engineer', 12560.50)"; +command number message +insert into employee values(4567,'Johnson', 'Engineer', 12560.50) 1 Affected rows +CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC CATFUNC=tables +CONNECTION='jdbc:postgresql://localhost/mtr' +OPTION_LIST='User=mtr,Password=mtr,Schema=public,Tabtype=TABLE,Maxres=10'; +SELECT * FROM t1; +Table_Cat Table_Schema Table_Name Table_Type Remark + public employee TABLE NULL + public t1 TABLE NULL + public t2 TABLE NULL +DROP TABLE t1; +CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC CATFUNC=columns +CONNECTION='jdbc:postgresql://localhost/mtr' tabname=employee +OPTION_LIST='User=mtr,Password=mtr,Maxres=10'; +SELECT * FROM t1; +Table_Cat Table_Schema Table_Name Column_Name Data_Type Type_Name Column_Size Buffer_Length Decimal_Digits Radix Nullable Remarks +NULL public employee id 4 int4 10 0 0 10 0 NULL +NULL public employee name 12 varchar 32 0 0 10 1 NULL +NULL public employee title 1 bpchar 16 0 0 10 1 NULL +NULL public employee salary 2 numeric 8 0 2 10 1 NULL +DROP TABLE t1; +CREATE SERVER 'postgresql' FOREIGN DATA WRAPPER 'postgresql' OPTIONS ( +HOST 'localhost', +DATABASE 'mtr', +USER 'mtr', +PASSWORD 'mtr', +PORT 0, +SOCKET '', +OWNER 'root'); +CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC CONNECTION='postgresql/public.employee'; +SELECT * FROM t1; +id name title salary +4567 Johnson Engineer 12560.50 +INSERT INTO t1 VALUES(3126,'Smith', 'Clerk', 5230.00); +Warnings: +Note 1105 public.employee: 1 affected rows +UPDATE t1 SET salary = salary + 100.00; +Warnings: +Note 1105 public.employee: 2 affected rows +SELECT * FROM t1; +id name title salary +4567 Johnson Engineer 12660.50 +3126 Smith Clerk 5330.00 +DROP TABLE t1; +DROP SERVER 'postgresql'; +SELECT * FROM t2 WHERE command='drop table employee'; +command number message +drop table employee 0 Affected rows +DROP TABLE t2; +SET GLOBAL connect_jvm_path=NULL; +SET GLOBAL connect_class_path=NULL; +SET GLOBAL time_zone = SYSTEM; diff --git a/storage/connect/mysql-test/connect/r/mysql_discovery.result b/storage/connect/mysql-test/connect/r/mysql_discovery.result index 220df6f7b92..32bd4761f37 100644 --- a/storage/connect/mysql-test/connect/r/mysql_discovery.result +++ b/storage/connect/mysql-test/connect/r/mysql_discovery.result @@ -19,8 +19,8 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `id` int(20) NOT NULL, - `group` int(11) NOT NULL DEFAULT '1', - `a\\b` int(11) NOT NULL DEFAULT '2', + `group` int(11) NOT NULL DEFAULT 1, + `a\\b` int(11) NOT NULL DEFAULT 2, `a\\` int(10) unsigned DEFAULT NULL, `name` varchar(32) DEFAULT 'name' ) ENGINE=CONNECT DEFAULT CHARSET=latin1 CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/test/t1' `TABLE_TYPE`='MYSQL' diff --git a/storage/connect/mysql-test/connect/r/mysql_index.result b/storage/connect/mysql-test/connect/r/mysql_index.result index 4ebf10802ae..dd1864529ca 100644 --- a/storage/connect/mysql-test/connect/r/mysql_index.result +++ b/storage/connect/mysql-test/connect/r/mysql_index.result @@ -112,3 +112,324 @@ id msg 6 Six DROP TABLE t2; DROP TABLE t1; +# +# Make local FIX table with indices matricule and nom/prenom +# +CREATE TABLE t1 +( +matricule INT(4) KEY NOT NULL field_format='Z', +nom VARCHAR(16) NOT NULL, +prenom VARCHAR(20) NOT NULL, +sexe SMALLINT(1) NOT NULL COMMENT 'sexe 1:M 2:F', +aanais INT(4) NOT NULL, +mmnais INT(2) NOT NULL, +ddentree DATE NOT NULL date_format='YYYYMM', +ddnom DATE NOT NULL date_format='YYYYMM', +brut INT(5) NOT NULL, +net DOUBLE(8,2) NOT NULL, +service INT(2) NOT NULL, +sitmat CHAR(1) NOT NULL, +formation CHAR(5) NOT NULL, +INDEX NP(nom,prenom) +) ENGINE=CONNECT TABLE_TYPE=FIX FILE_NAME='emp.txt' ENDING=2; +# +# Make MYSQL table with same indices +# +CREATE TABLE t2 +( +matricule INT(4) KEY NOT NULL, +nom VARCHAR(16) NOT NULL, +prenom VARCHAR(20) NOT NULL, +sexe SMALLINT(1) NOT NULL, +aanais INT(4) NOT NULL, +mmnais INT(2) NOT NULL, +ddentree DATE NOT NULL date_format='YYYYMM', +ddnom DATE NOT NULL date_format='YYYYMM', +brut INT(5) NOT NULL, +net DOUBLE(8,2) NOT NULL, +service INT(2) NOT NULL, +sitmat CHAR(1) NOT NULL, +formation CHAR(5) NOT NULL, +INDEX NP(nom,prenom) +) ENGINE=CONNECT TABLE_TYPE=MYSQL CONNECTIOn='mysql://root@localhost/test/t1'; +SELECT * FROM t2 limit 10; +matricule nom prenom sexe aanais mmnais ddentree ddnom brut net service sitmat formation +5745 ESCOURCHE BENEDICTE 2 1935 7 1962-12-01 1994-05-01 18345 14275.50 0 M TECHN +9692 VICENTE LAURENCE 2 1941 8 1967-10-01 1989-01-01 16212 13032.80 0 M ANGL +9146 NICOLAS ROGER 1 1941 6 1964-07-01 1995-02-01 34173 25098.65 0 M SANS +2985 TESSEREAU MARIE HELENE 2 1941 9 1967-01-01 1990-01-01 19323 14933.78 0 V SANS +3368 MOGADOR ALAIN 1 1941 1 1961-09-01 1993-11-01 43303 31420.55 0 C SANS +7394 CHAUSSEE ERIC DENIS 1 1944 9 1965-11-01 1983-12-01 32002 23583.86 0 M ANGL +4655 MAILLOT GEORGES 1 1945 5 1970-09-01 1986-12-01 24700 18541.64 0 C ANGL +2825 CAMILLE NADINE 2 1956 9 1994-01-01 1993-01-01 19494 15050.45 0 M SANS +1460 BRUYERES JEAN MARC 1 1958 8 1984-08-01 1988-05-01 20902 15980.07 0 M SANS +4974 LONES GERARD 1 1959 10 1979-01-01 1994-12-01 16081 12916.70 0 M SANS +SELECT matricule, nom, prenom FROM t2 WHERE nom IN ('FOCH','MOGADOR'); +matricule nom prenom +1977 FOCH BERNADETTE +5707 FOCH DENIS +2552 FOCH FRANCK +2634 FOCH JOCELYNE +5765 FOCH ROBERT +4080 FOCH SERGE +3368 MOGADOR ALAIN +SELECT matricule, nom, prenom FROM t2 WHERE nom = 'FOCH' OR nom = 'MOGADOR'; +matricule nom prenom +1977 FOCH BERNADETTE +5707 FOCH DENIS +2552 FOCH FRANCK +2634 FOCH JOCELYNE +5765 FOCH ROBERT +4080 FOCH SERGE +3368 MOGADOR ALAIN +SELECT matricule, nom, prenom FROM t2 WHERE nom < 'ADDAX'; +matricule nom prenom +4552 ABBADIE MONIQUE +307 ABBAYE ANNICK +6627 ABBAYE GERALD +7961 ABBE KATIA +1340 ABBE MICHELE +9270 ABBE SOPHIE +2945 ABBEVILLE PASCAL +8596 ABEBERRY PATRICK +6399 ABEILLES RENE +8673 ABEL JEAN PIERRE +6124 ABELIAS DELIA +6314 ABERDEN EVELYNE +895 ABORD CHANTAL +2728 ABOUT CATHERINE MARIE +398 ABREUVOIR JEAN LUC +1122 ACACIAS SERGE +1644 ACARDIE BEATE +115 ACHILLE JACQUES +4038 ADAM JANICK +3395 ADAM JEAN CLAUDE +SELECT matricule, nom, prenom FROM t2 WHERE nom <= 'ABEL'; +matricule nom prenom +4552 ABBADIE MONIQUE +307 ABBAYE ANNICK +6627 ABBAYE GERALD +7961 ABBE KATIA +1340 ABBE MICHELE +9270 ABBE SOPHIE +2945 ABBEVILLE PASCAL +8596 ABEBERRY PATRICK +6399 ABEILLES RENE +8673 ABEL JEAN PIERRE +SELECT matricule, nom, prenom FROM t2 WHERE nom > 'YVON'; +matricule nom prenom +9742 YZENGREMER MICHEL +8738 ZILINA JEAN LOUIS +5357 ZOLA BERNARD +5441 ZOLA BRIGITTE +1325 ZOLA CHRISTINE +4859 ZORI CATHERINE +4102 ZOUAVES ALAIN +SELECT matricule, nom, prenom FROM t2 WHERE nom >= 'YVON'; +matricule nom prenom +5389 YVON CAROLE +9742 YZENGREMER MICHEL +8738 ZILINA JEAN LOUIS +5357 ZOLA BERNARD +5441 ZOLA BRIGITTE +1325 ZOLA CHRISTINE +4859 ZORI CATHERINE +4102 ZOUAVES ALAIN +SELECT matricule, nom, prenom FROM t2 WHERE nom <= 'ABEL' OR nom > 'YVON'; +matricule nom prenom +4552 ABBADIE MONIQUE +307 ABBAYE ANNICK +6627 ABBAYE GERALD +7961 ABBE KATIA +1340 ABBE MICHELE +9270 ABBE SOPHIE +2945 ABBEVILLE PASCAL +8596 ABEBERRY PATRICK +6399 ABEILLES RENE +8673 ABEL JEAN PIERRE +9742 YZENGREMER MICHEL +8738 ZILINA JEAN LOUIS +5357 ZOLA BERNARD +5441 ZOLA BRIGITTE +1325 ZOLA CHRISTINE +4859 ZORI CATHERINE +4102 ZOUAVES ALAIN +SELECT matricule, nom, prenom FROM t2 WHERE nom > 'HELEN' AND nom < 'HEROS'; +matricule nom prenom +9096 HELENA PHILIPPE +3309 HELENE ISABELLE +8365 HELIOTROPES LISE +4666 HELLEN PIERRE +5781 HELSINKI DANIELLE +7626 HENIN PHILIPPE +4254 HENIN SERGE +2673 HENNER LILIANE +9716 HENRI JACQUES +2085 HEOL GUY PAUL +2579 HERANDIERE PIERRE +7093 HERAULTS DANIEL +4050 HERBILLON FRANCOIS +9231 HERBILLON MADELEINE +1291 HERMITAGE XAVIER +6185 HERMITTE FRANCOIS +403 HERMITTE PHILIPPE +9749 HEROLD ISABELLE +SELECT matricule, nom, prenom FROM t2 WHERE nom BETWEEN 'HELEN' AND 'HEROS'; +matricule nom prenom +6199 HELEN MARTIAL +9096 HELENA PHILIPPE +3309 HELENE ISABELLE +8365 HELIOTROPES LISE +4666 HELLEN PIERRE +5781 HELSINKI DANIELLE +7626 HENIN PHILIPPE +4254 HENIN SERGE +2673 HENNER LILIANE +9716 HENRI JACQUES +2085 HEOL GUY PAUL +2579 HERANDIERE PIERRE +7093 HERAULTS DANIEL +4050 HERBILLON FRANCOIS +9231 HERBILLON MADELEINE +1291 HERMITAGE XAVIER +6185 HERMITTE FRANCOIS +403 HERMITTE PHILIPPE +9749 HEROLD ISABELLE +8445 HEROS SYLVIE +SELECT matricule, nom, prenom FROM t2 WHERE nom BETWEEN 'HELEN' AND 'HEROS' AND prenom = 'PHILIPPE'; +matricule nom prenom +9096 HELENA PHILIPPE +7626 HENIN PHILIPPE +403 HERMITTE PHILIPPE +SELECT matricule, nom, prenom FROM t2 ORDER BY nom LIMIT 10; +matricule nom prenom +4552 ABBADIE MONIQUE +6627 ABBAYE GERALD +307 ABBAYE ANNICK +7961 ABBE KATIA +1340 ABBE MICHELE +9270 ABBE SOPHIE +2945 ABBEVILLE PASCAL +8596 ABEBERRY PATRICK +6399 ABEILLES RENE +8673 ABEL JEAN PIERRE +SELECT a.nom, a.prenom, b.nom FROM t1 a STRAIGHT_JOIN t2 b ON a.prenom = b.prenom WHERE a.nom = 'FOCH' AND a.nom != b.nom; +nom prenom nom +FOCH SERGE ACACIAS +FOCH ROBERT AGRIANT +FOCH JOCELYNE ALEXIS +FOCH DENIS AMBOISE +FOCH SERGE ANDALUCIA +FOCH ROBERT ANNECY +FOCH SERGE ARCACHON +FOCH JOCELYNE AUGUSTE +FOCH JOCELYNE BASSE +FOCH SERGE BEACH +FOCH FRANCK BEARN +FOCH SERGE BELLES +FOCH DENIS BERARD +FOCH DENIS BERIN +FOCH BERNADETTE BERTIN +FOCH DENIS BILLEHOU +FOCH DENIS BOILEAU +FOCH BERNADETTE BOISSY +FOCH ROBERT BONVIN +FOCH SERGE BOUTON +FOCH SERGE BREUIL +FOCH SERGE CARREFOUR +FOCH JOCELYNE CARRERE +FOCH JOCELYNE CHAPELLE +FOCH SERGE CHATEAU +FOCH ROBERT CHENIER +FOCH SERGE COLLETTE +FOCH DENIS CONNE +FOCH SERGE COOLE +FOCH DENIS COULOUBRIER +FOCH DENIS COUTURIER +FOCH ROBERT CURAT +FOCH ROBERT DAUDET +FOCH SERGE ECLUSE +FOCH SERGE EGUILLON +FOCH DENIS EPINETTES +FOCH DENIS FIGOURNAS +FOCH JOCELYNE FLEMING +FOCH JOCELYNE GAMBADES +FOCH ROBERT GIOTERAIE +FOCH SERGE GOAS +FOCH ROBERT GRAFFIANE +FOCH SERGE GREFFIER +FOCH ROBERT GUILLOTIERE +FOCH SERGE HENIN +FOCH BERNADETTE HUNTZIGER +FOCH FRANCK ILLIERS +FOCH DENIS ISTANBUL +FOCH DENIS ITALIE +FOCH SERGE JARDIN +FOCH FRANCK JEANPIERRE +FOCH JOCELYNE KENNEDY +FOCH FRANCK LABBE +FOCH DENIS LACATE +FOCH FRANCK LACOMBE +FOCH ROBERT LAMOTHE +FOCH BERNADETTE LATECOERE +FOCH BERNADETTE LEGER +FOCH SERGE LEONIE +FOCH FRANCK LEROY +FOCH SERGE LOZERE +FOCH DENIS MAROLLES +FOCH ROBERT MARRONIERS +FOCH SERGE MARSAT +FOCH SERGE MONTAGNE +FOCH FRANCK MONTALEIGNE +FOCH DENIS MONTELIER +FOCH DENIS MONTILS +FOCH BERNADETTE MONTJUSTIN +FOCH SERGE MORIZET +FOCH ROBERT NIMES +FOCH ROBERT NORD +FOCH SERGE NOVEMBRE +FOCH BERNADETTE ONZE +FOCH SERGE ORANGERIE +FOCH FRANCK ORVEAU +FOCH BERNADETTE PALMAROLE +FOCH JOCELYNE PEYBERT +FOCH ROBERT PEYNIBLOU +FOCH ROBERT PIECE +FOCH JOCELYNE PIED +FOCH ROBERT PLAGNE +FOCH SERGE PLAISANCE +FOCH BERNADETTE PLOUHARNEL +FOCH DENIS POINTE +FOCH ROBERT POMMERY +FOCH JOCELYNE PONTAROUX +FOCH DENIS PORTO +FOCH ROBERT PRESIDENT +FOCH ROBERT PUJADE +FOCH FRANCK PURPAN +FOCH ROBERT QUILICHINI +FOCH DENIS REINOTS +FOCH DENIS REMPART +FOCH SERGE RESISTANCE +FOCH SERGE RESTANQUES +FOCH ROBERT RIOU +FOCH FRANCK ROCQUENCOURT +FOCH ROBERT ROLL +FOCH ROBERT ROSSA +FOCH SERGE ROSSAYS +FOCH DENIS ROUSSIER +FOCH FRANCK RUSSIE +FOCH ROBERT SABLONS +FOCH SERGE SARTRE +FOCH SERGE SAVIGNAC +FOCH SERGE SEGUR +FOCH ROBERT STRASBOURG +FOCH ROBERT TIRE +FOCH DENIS TORTE +FOCH DENIS TOULON +FOCH ROBERT TUBY +FOCH DENIS VALMANTE +FOCH SERGE VANOEL +FOCH ROBERT VIARMES +FOCH SERGE WILSON +DROP TABLE t2; +DROP TABLE t1; diff --git a/storage/connect/mysql-test/connect/r/odbc_firebird.result b/storage/connect/mysql-test/connect/r/odbc_firebird.result index 7688c188f59..b0c2582abeb 100644 --- a/storage/connect/mysql-test/connect/r/odbc_firebird.result +++ b/storage/connect/mysql-test/connect/r/odbc_firebird.result @@ -1,58 +1,123 @@ SET NAMES utf8; CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='Bad connection string'; -ERROR HY000: SQLDriverConnect: [unixODBC][Driver Manager]Data source name not found, and no default driver specified CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CATFUNC=Sources; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `Name` varchar(256) NOT NULL, - `Description` varchar(256) NOT NULL + `Description` varchar(256) DEFAULT NULL ) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`='ODBC' `CATFUNC`='Sources' SELECT * FROM t1; Name Description -Firebird Firebird +dBASE Files Microsoft Access dBASE Driver (*.dbf, *.ndx, *.mdx) +PLUGDB_DEBUG PLUGODBC_Driver +PLUGDB_ODBC PLUGODBC_Driver +SafeDB_ODBC SDB_ODBC_Driver +Firebird Firebird/InterBase(r) driver +ConnectEngineXLS Microsoft Excel Driver (*.xls) +Excel Files Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb) +MariaODBC MySQL ODBC 5.2a Driver +MariaODBCbeta MariaDB ODBC 1.0 Driver +MyODBC MySQL ODBC 5.2a Driver +MS Access Database Microsoft Access Driver (*.mdb, *.accdb) +MS Access Db1 Microsoft Access Driver (*.mdb) +MySQL-ANSI MySQL ODBC 5.3 ANSI Driver +MySQL-Unicode MySQL ODBC 5.3 Unicode Driver +Xtreme Sample Database 2008 Microsoft Access Driver (*.mdb) +PlugDB test PLUGODBC_Driver +SQLite3 Datasource SQLite3 ODBC Driver +SQLite Datasource SQLite ODBC Driver +SQLite UTF-8 Datasource SQLite ODBC (UTF-8) Driver +ORACLE_TEST Oracle in XE +ConnectEnginePostgresql PostgreSQL ODBC Driver(ANSI) +ConnectEngineOracle Oracle in XE +ConnectEngineSQLServer SQL Server DROP TABLE t1; CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CATFUNC=Drivers; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `Description` char(128) NOT NULL, - `Attributes` varchar(256) NOT NULL + `Attributes` varchar(256) DEFAULT NULL ) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`='ODBC' `CATFUNC`='Drivers' SELECT * FROM t1; Description Attributes -Firebird Description=Firebird ODBC Driver in usr;Driver=/usr/local/lib/libOdbcFb.so;Setup=/usr/local/lib/libOdbcFb.so;FileUsage=1; +SQL Server UsageCount=1;SQLLevel=1;FileUsage=0;DriverODBCVer=03.50;ConnectFunctions=YYY;APILevel=2;CPTimeout=60; +Microsoft ODBC for Oracle UsageCount=1;SQLLevel=1;FileUsage=0;DriverODBCVer=02.50;ConnectFunctions=YYY;APILevel=1;CPTimeout=120; +Microsoft Access Driver (*.mdb) UsageCount=1;APILevel=1;ConnectFunctions=YYN;DriverODBCVer=02.50;FileUsage=2;FileExtns=*.mdb;SQLLevel=0; +Microsoft Access-Treiber (*.mdb) UsageCount=1;APILevel=1;ConnectFunctions=YYN;DriverODBCVer=02.50;FileUsage=2;FileExtns=*.mdb;SQLLevel=0; +Driver do Microsoft Access (*.mdb) UsageCount=1;APILevel=1;ConnectFunctions=YYN;DriverODBCVer=02.50;FileUsage=2;FileExtns=*.mdb;SQLLevel=0; +Microsoft dBase Driver (*.dbf) UsageCount=1;APILevel=1;ConnectFunctions=YYN;DriverODBCVer=02.50;FileUsage=1;FileExtns=*.dbf,*.ndx,*.mdx;SQLLevel=0; +Microsoft dBase-Treiber (*.dbf) UsageCount=1;APILevel=1;ConnectFunctions=YYN;DriverODBCVer=02.50;FileUsage=1;FileExtns=*.dbf,*.ndx,*.mdx;SQLLevel=0; +Driver do Microsoft dBase (*.dbf) UsageCount=1;APILevel=1;ConnectFunctions=YYN;DriverODBCVer=02.50;FileUsage=1;FileExtns=*.dbf,*.ndx,*.mdx;SQLLevel=0; +Microsoft Excel Driver (*.xls) UsageCount=1;APILevel=1;ConnectFunctions=YYN;DriverODBCVer=02.50;FileUsage=1;FileExtns=*.xls;SQLLevel=0; +Microsoft Excel-Treiber (*.xls) UsageCount=1;APILevel=1;ConnectFunctions=YYN;DriverODBCVer=02.50;FileUsage=1;FileExtns=*.xls;SQLLevel=0; +Driver do Microsoft Excel(*.xls) UsageCount=1;APILevel=1;ConnectFunctions=YYN;DriverODBCVer=02.50;FileUsage=1;FileExtns=*.xls;SQLLevel=0; +Microsoft Paradox Driver (*.db ) UsageCount=1;APILevel=1;ConnectFunctions=YYN;DriverODBCVer=02.50;FileUsage=1;FileExtns=*.db;SQLLevel=0; +Microsoft Paradox-Treiber (*.db ) UsageCount=1;APILevel=1;ConnectFunctions=YYN;DriverODBCVer=02.50;FileUsage=1;FileExtns=*.db;SQLLevel=0; +Driver do Microsoft Paradox (*.db ) UsageCount=1;APILevel=1;ConnectFunctions=YYN;DriverODBCVer=02.50;FileUsage=1;FileExtns=*.db;SQLLevel=0; +Microsoft Text Driver (*.txt; *.csv) UsageCount=1;APILevel=1;ConnectFunctions=YYN;DriverODBCVer=02.50;FileUsage=1;FileExtns=*.,*.asc,*.csv,*.tab,*.txt,*.csv;SQLLevel=0; +Microsoft Text-Treiber (*.txt; *.csv) UsageCount=1;APILevel=1;ConnectFunctions=YYN;DriverODBCVer=02.50;FileUsage=1;FileExtns=*.,*.asc,*.csv,*.tab,*.txt,*.csv;SQLLevel=0; +Driver da Microsoft para arquivos texto (*.txt; *.csv) UsageCount=1;APILevel=1;ConnectFunctions=YYN;DriverODBCVer=02.50;FileUsage=1;FileExtns=*.,*.asc,*.csv,*.tab,*.txt,*.csv;SQLLevel=0; +Microsoft Visual FoxPro Driver UsageCount=1;APILevel=0;ConnectFunctions=YYN;DriverODBCVer=02.50;FileUsage=1;FileExtns=*.dbf,*.cdx,*.idx,*.fpt;SQLLevel=0; +Microsoft FoxPro VFP Driver (*.dbf) UsageCount=1;APILevel=0;ConnectFunctions=YYN;DriverODBCVer=02.50;FileUsage=1;FileExtns=*.dbf,*.cdx,*.idx,*.fpt;SQLLevel=0; +Microsoft dBase VFP Driver (*.dbf) UsageCount=1;APILevel=0;ConnectFunctions=YYN;DriverODBCVer=02.50;FileUsage=1;FileExtns=*.dbf,*.cdx,*.idx,*.fpt;SQLLevel=0; +Microsoft Visual FoxPro-Treiber UsageCount=1;APILevel=0;ConnectFunctions=YYN;DriverODBCVer=02.50;FileUsage=1;FileExtns=*.dbf,*.cdx,*.idx,*.fpt;SQLLevel=0; +Driver para o Microsoft Visual FoxPro UsageCount=1;APILevel=0;ConnectFunctions=YYN;DriverODBCVer=02.50;FileUsage=1;FileExtns=*.dbf,*.cdx,*.idx,*.fpt;SQLLevel=0; +SQL Native Client UsageCount=1;APILevel=2;ConnectFunctions=YYY;CPTimeout=60;DriverODBCVer=09.00;FileUsage=0;SQLLevel=1; +CR Sybase Wire Protocol ODBC Driver 6.0 UsageCount=1;APILevel=1;ConnectFunctions=YYY;DriverODBCVer=3.52;FileUsage=0;SQLLevel=0;CPTimeout=60;HelpRootDirectory=C:\Program Files\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\win32_x86\odbc\help; +CR SQL Server Native Wire Protocol ODBC Driver 6.0 UsageCount=1;APILevel=1;ConnectFunctions=YYY;DriverODBCVer=3.52;FileUsage=0;SQLLevel=1;CPTimeout=60;HelpRootDirectory=C:\Program Files\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\win32_x86\odbc\help; +CR SQL Server Classic Wire Protocol ODBC Driver 6.0 UsageCount=1;APILevel=1;ConnectFunctions=YYY;DriverODBCVer=3.52;FileUsage=0;SQLLevel=1;CPTimeout=60;HelpRootDirectory=C:\Program Files\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\win32_x86\odbc\help; +CR TextFile ODBC Driver 6.0 UsageCount=1;APILevel=1;ConnectFunctions=YYY;DriverODBCVer=3.52;FileUsage=1;FileExtns=*.*;SQLLevel=0;CPTimeout=60;HelpRootDirectory=C:\Program Files\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\win32_x86\odbc\help; +PLUGODBC_Driver UsageCount=1; +SDB_ODBC_Driver UsageCount=2; +Microsoft Access Text Driver (*.txt, *.csv) SQLLevel=0;FileExtns=*.txt, *.csv;FileUsage=2;DriverODBCVer=02.50;ConnectFunctions=YYN;APILevel=1;UsageCount=3; +Microsoft Access dBASE Driver (*.dbf, *.ndx, *.mdx) SQLLevel=0;FileExtns=*.dbf, *.ndx, *.mdx;FileUsage=2;DriverODBCVer=02.50;ConnectFunctions=YYN;APILevel=1;UsageCount=3; +Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb) SQLLevel=0;FileExtns=*.xls,*.xlsx, *.xlsb;FileUsage=2;DriverODBCVer=02.50;ConnectFunctions=YYN;APILevel=1;UsageCount=3; +Microsoft Access Driver (*.mdb, *.accdb) SQLLevel=0;FileExtns=*.mdb,*.accdb;FileUsage=2;DriverODBCVer=02.50;ConnectFunctions=YYN;APILevel=1;UsageCount=3; +SQLite3 ODBC Driver UsageCount=1; +SQLite ODBC Driver UsageCount=1; +SQLite ODBC (UTF-8) Driver UsageCount=1; +Oracle in XE ConnectionFunctions=YYY;DriverODBCVer=03.51;CPTimeout=60;FileUsage=0;APILevel=1;SQLLevel=1; +Oracle in instantclient_12_1 APILevel=1;ConnectionFunctions=YYY;CPTimeout=60;DriverODBCVer=03.51;FileUsage=0;SQLLevel=1; +PostgreSQL ODBC Driver(ANSI) APILevel=1;ConnectFunctions=YYN;DriverODBCVer=09.02.0100;FileUsage=0;SQLLevel=1; +PostgreSQL ODBC Driver(UNICODE) APILevel=1;ConnectFunctions=YYN;DriverODBCVer=09.02.0100;FileUsage=0;SQLLevel=1; +SQL Server Native Client 11.0 UsageCount=1;APILevel=2;ConnectFunctions=YYY;CPTimeout=60;DriverODBCVer=03.80;FileUsage=0;SQLLevel=1; +MariaDB ODBC 1.0 Driver UsageCount=1; +Firebird/InterBase(r) driver UsageCount=1;FileExtns=*.fdb,*.gdb;APILevel=1;ConnectFunctions=YYY;FileUsage=0;DriverODBCVer=03.51;SQLLevel=1; +MySQL ODBC 5.3 ANSI Driver UsageCount=1; +MySQL ODBC 5.3 Unicode Driver UsageCount=1; DROP TABLE t1; CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CATFUNC=Tables CONNECTION='Not important'; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `Table_Cat` char(128) NOT NULL, - `Table_Schema` char(128) NOT NULL, + `Table_Cat` char(128) DEFAULT NULL, + `Table_Schema` char(128) DEFAULT NULL, `Table_Name` char(128) NOT NULL, `Table_Type` char(16) NOT NULL, - `Remark` char(255) NOT NULL + `Remark` char(255) DEFAULT NULL ) ENGINE=CONNECT DEFAULT CHARSET=latin1 CONNECTION='Not important' `TABLE_TYPE`='ODBC' `CATFUNC`='Tables' DROP TABLE t1; CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CATFUNC=Columns CONNECTION='Not important'; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `Table_Cat` char(128) NOT NULL, - `Table_Schema` char(128) NOT NULL, + `Table_Cat` char(128) DEFAULT NULL, + `Table_Schema` char(128) DEFAULT NULL, `Table_Name` char(128) NOT NULL, `Column_Name` char(128) NOT NULL, `Data_Type` smallint(6) NOT NULL, `Type_Name` char(30) NOT NULL, `Column_Size` int(10) NOT NULL, `Buffer_Length` int(10) NOT NULL, - `Decimal_Digits` smallint(6) NOT NULL, - `Radix` smallint(6) NOT NULL, + `Decimal_Digits` smallint(6) DEFAULT NULL, + `Radix` smallint(6) DEFAULT NULL, `Nullable` smallint(6) NOT NULL, - `Remarks` char(255) NOT NULL + `Remarks` char(255) DEFAULT NULL ) ENGINE=CONNECT DEFAULT CHARSET=latin1 CONNECTION='Not important' `TABLE_TYPE`='ODBC' `CATFUNC`='Columns' DROP TABLE t1; -CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC TABNAME='EMPLOYEE' CONNECTION='DSN=Firebird;UID=SYSDBA;PWD=manager'; +CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC TABNAME='EMPLOYEE' CONNECTION='DSN=Firebird;UID=SYSDBA;PWD=masterkey'; SELECT * FROM t1; EMP_NO FIRST_NAME LAST_NAME PHONE_EXT HIRE_DATE DEPT_NO JOB_CODE JOB_GRADE JOB_COUNTRY SALARY FULL_NAME 2 Robert Nelson 250 1988-12-28 00:00:00 600 VP 2 USA 105900.00 Nelson, Robert diff --git a/storage/connect/mysql-test/connect/r/part_table.result b/storage/connect/mysql-test/connect/r/part_table.result index 122c328fa59..f3a556ae784 100644 --- a/storage/connect/mysql-test/connect/r/part_table.result +++ b/storage/connect/mysql-test/connect/r/part_table.result @@ -191,6 +191,31 @@ id msg 35 thirty five 81 big DROP TABLE t1; +CREATE TABLE t1 ( +id INT KEY NOT NULL, +msg VARCHAR(32)) +ENGINE=CONNECT TABLE_TYPE=MYSQL +OPTION_LIST='connect=mysql://root@localhost/test/xt%s' +PARTITION BY RANGE COLUMNS(id) ( +PARTITION `1` VALUES LESS THAN(10), +PARTITION `2` VALUES LESS THAN(50), +PARTITION `3` VALUES LESS THAN(MAXVALUE)); +Warnings: +Warning 1105 Data repartition in 1 is unchecked +Warning 1105 Data repartition in 2 is unchecked +Warning 1105 Data repartition in 3 is unchecked +SELECT * FROM t1; +id msg +4 four +7 sept +1 one +8 eight +40 forty +10 ten +11 eleven +35 thirty five +81 big +DROP TABLE t1; DROP TABLE xt1; DROP TABLE xt2; DROP TABLE xt3; diff --git a/storage/connect/mysql-test/connect/r/xml_mdev5261.result b/storage/connect/mysql-test/connect/r/xml_mdev5261.result index 3d67edd34ab..f91194d570c 100644 --- a/storage/connect/mysql-test/connect/r/xml_mdev5261.result +++ b/storage/connect/mysql-test/connect/r/xml_mdev5261.result @@ -19,7 +19,7 @@ SELECT * FROM t1 WHERE i = 5; i 5 ALTER TABLE t1 DROP INDEX i; -ERROR 42000: Can't DROP 'i'; check that column/key exists +ERROR 42000: Can't DROP INDEX `i`; check that it exists DROP INDEX i ON t1; -ERROR 42000: Can't DROP 'i'; check that column/key exists +ERROR 42000: Can't DROP INDEX `i`; check that it exists DROP TABLE t1; diff --git a/storage/connect/mysql-test/connect/std_data/girls.txt b/storage/connect/mysql-test/connect/std_data/girls.txt new file mode 100644 index 00000000000..12ce8babbaf --- /dev/null +++ b/storage/connect/mysql-test/connect/std_data/girls.txt @@ -0,0 +1,5 @@ +Mary Boston 25 +Nancy Palo Alto 23 +Susan Chicago 18 +Betty Chicago 32 +Anne Denver 23 diff --git a/storage/connect/mysql-test/connect/std_data/mdev9949.frm b/storage/connect/mysql-test/connect/std_data/mdev9949.frm new file mode 100644 index 00000000000..56bb9a71263 Binary files /dev/null and b/storage/connect/mysql-test/connect/std_data/mdev9949.frm differ diff --git a/storage/connect/mysql-test/connect/t/drop-open-error.opt b/storage/connect/mysql-test/connect/t/drop-open-error.opt new file mode 100644 index 00000000000..22520f0aa99 --- /dev/null +++ b/storage/connect/mysql-test/connect/t/drop-open-error.opt @@ -0,0 +1 @@ +--secure-file-priv="" diff --git a/storage/connect/mysql-test/connect/t/drop-open-error.test b/storage/connect/mysql-test/connect/t/drop-open-error.test new file mode 100644 index 00000000000..0b73ac98779 --- /dev/null +++ b/storage/connect/mysql-test/connect/t/drop-open-error.test @@ -0,0 +1,29 @@ +# +# tests for the case when open_table_def() fails from inside +# ha_connect::delete_or_rename_table() +# +# +# MDEV-9949 Connect Engine: long SRCDEF leads to broken table +# +let $datadir=`select @@datadir`; + +create table t1 (c varchar(8)); +error ER_VALUE_TOO_LONG; +# 34K SRCDEF line: +create table tcon engine=connect table_type=mysql CONNECTION='mysql://root@localhost/test/t1' SRCDEF='select c from t1 where c in ("foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar", "foo", "bar", "qux", "foobar")'; + +# copy the invalid frm (as created by the statement above before the MDEV-9949 fix) +copy_file $MTR_SUITE_DIR/std_data/mdev9949.frm $datadir/test/mdev9949.frm; +drop table mdev9949; +drop table t1; + +# +# MDEV-7935 CREATE TABLE ... AS SELECT ... can cause a Server crash (Assertion `0' in Protocol::end_statement) +# +select @@secure_file_priv 'must be NULL'; # otherwise foo/bar.txt won't be allowed +create table t1 (a char(16)) engine=myisam; +insert into t1 values('Hello World!'); +replace_regex @on .*/foo/@on foo/@; +error ER_GET_ERRMSG; +create table t2 engine=connect file_name='foo/bar.txt' as select * from t1; +drop table t1; diff --git a/storage/connect/mysql-test/connect/t/grant3.test b/storage/connect/mysql-test/connect/t/grant3.test new file mode 100644 index 00000000000..9f05ca796c5 --- /dev/null +++ b/storage/connect/mysql-test/connect/t/grant3.test @@ -0,0 +1,11 @@ +# +# MDEV-9610 Trigger on normal table can't insert into CONNECT engine table - Access Denied +# +create table tcon (i int) engine=Connect table_type=DOS file_name='tcon.dos'; +create table tin (i int); +create trigger tr after insert on tin for each row insert into tcon values (new.i); +insert into tin values (1); +drop table tin,tcon; + +let datadir=`select @@datadir`; +remove_file $datadir/test/tcon.dos; diff --git a/storage/connect/mysql-test/connect/t/jdbc.test b/storage/connect/mysql-test/connect/t/jdbc.test new file mode 100644 index 00000000000..9389747ad9c --- /dev/null +++ b/storage/connect/mysql-test/connect/t/jdbc.test @@ -0,0 +1,143 @@ +-- source jdbconn.inc + +let $MYSQLD_DATADIR= `select @@datadir`; +--copy_file $MTR_SUITE_DIR/std_data/girls.txt $MYSQLD_DATADIR/test/girls.txt + +let $PORT= `select @@port`; + +# +# This test is run against a local MariaDB server +# +CREATE DATABASE connect; +USE connect; +CREATE TABLE t2 ( + id bigint not null, + msg varchar(500), + tm time, + dt date, + dtm datetime, + ts timestamp); +INSERT INTO t2 VALUES(455000000000, 'A very big number', '18:10:25', '2016-03-16', '1999-12-11 23:01:52', '2015-07-24 09:32:45'); +SELECT * FROM t2; + +--echo # +--echo # Testing JDBC connection to MySQL driver +--echo # +USE test; +--replace_result $PORT PORT +--eval CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC TABNAME=t2 CONNECTION='jdbc:mysql://localhost:$PORT/connect?user=root' +SELECT * FROM t1; +INSERT INTO t1 VALUES(786325481247, 'Hello!', '19:45:03', '1933-08-10', '1985-11-12 09:02:44', '2014-06-17 10:32:01'); +SELECT * FROM t1; +DELETE FROM t1 WHERE msg = 'Hello!'; +SELECT * FROM t1; +DROP TABLE t1; + +--echo # +--echo # Testing JDBC view +--echo # +--replace_result $PORT PORT +--eval CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC SRCDEF='select id, msg, tm, dt from t2' CONNECTION='jdbc:mysql://localhost:$PORT/connect?user=root' +SELECT * FROM t1; +SELECT msg, dt FROM t1; +DROP TABLE t1, connect.t2; + +--echo # +--echo # Testing JDBC write operations +--echo # +USE connect; +--copy_file $MTR_SUITE_DIR/std_data/boys.txt $MYSQLD_DATADIR/connect/boys.txt +CREATE TABLE boys ( + name CHAR(12) NOT NULL, + city CHAR(11), + birth DATE DATE_FORMAT='DD/MM/YYYY', + hired DATE DATE_FORMAT='DD/MM/YYYY' flag=36) +ENGINE=CONNECT TABLE_TYPE=FIX FILE_NAME='boys.txt' ENDING=1; +SELECT * FROM boys; + +USE test; +CREATE TABLE t3 ( + name CHAR(12) NOT NULL, + city CHAR(12), + birth DATE, + hired DATE); +INSERT INTO t3 VALUES('Donald','Atlanta','1999-04-01','2016-03-31'),('Mick','New York','1980-01-20','2002-09-11'); +SELECT * FROM t3; + +--replace_result $PORT PORT +--eval CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC TABNAME=boys CONNECTION='jdbc:mysql://localhost:$PORT/connect?user=root' OPTION_LIST='scrollable=1' +SELECT * FROM t1; +UPDATE t1 SET city = 'Phoenix' WHERE name = 'Henry'; +INSERT INTO t1 SELECT * FROM t3; +INSERT INTO t1 VALUES('Tom','Seatle','2002-03-15',NULL); +SELECT * FROM t1; +DROP TABLE t3; + +--echo # +--echo # Testing JDBC join operations +--echo # +CREATE TABLE t3 ( + name CHAR(9) NOT NULL, + city CHAR(12) NOT NULL, + age INT(2)) +engine=CONNECT table_type=FIX file_name='girls.txt'; +SELECT g.name, b.name, g.city FROM t3 g STRAIGHT_JOIN connect.boys b where g.city = b.city; +SELECT g.name, b.name, g.city FROM t3 g STRAIGHT_JOIN t1 b where g.city = b.city; +DROP TABLE t1, t3, connect.boys; + +--echo # +--echo # Testing MariaDB JDBC driver +--echo # +USE connect; +--copy_file $MTR_SUITE_DIR/std_data/employee.dat $MYSQLD_DATADIR/connect/employee.dat +CREATE TABLE emp ( + serialno CHAR(5) NOT NULL, + name VARCHAR(12) NOT NULL FLAG=6, + sex TINYINT(1) NOT NULL, + title VARCHAR(15) NOT NULL FLAG=20, + manager CHAR(5) NOT NULL, + department CHAR(4) NOT NULL FLAG=41, + secretary CHAR(5) NOT NULL FLAG=46, + salary DOUBLE(8,2) NOT NULL FLAG=52) +ENGINE=connect TABLE_TYPE=fix FILE_NAME='employee.dat' ENDING=1; +SELECT * FROM emp; + +USE test; +--replace_result $PORT PORT +--eval CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC TABNAME=emp CONNECTION='jdbc:mariadb://localhost:$PORT/connect?user=root' +--replace_result $PORT PORT +--eval SHOW CREATE TABLE t1 +SELECT * FROM t1; +SELECT name, title, salary FROM t1 WHERE sex = 1; + +DROP TABLE t1, connect.emp; + +# +# Testing remote command execution +# +--replace_result $PORT PORT +--eval CREATE TABLE t2 (command varchar(128) not null,number int(5) not null flag=1,message varchar(255) flag=2) ENGINE=CONNECT TABLE_TYPE=JDBC CONNECTION='jdbc:mariadb://localhost:$PORT/connect' OPTION_LIST='User=root,Execsrc=1' +SELECT * FROM t2 WHERE command='drop table tx1'; +SELECT * FROM t2 WHERE command = 'create table tx1 (a int not null, b char(32), c double(8,2))'; +SELECT * FROM t2 WHERE command in ('insert into tx1 values(1,''The number one'',456.12)',"insert into tx1(a,b) values(2,'The number two'),(3,'The number three')"); +SELECT * FROM t2 WHERE command='update tx1 set c = 3.1416 where a = 2'; +SELECT * FROM t2 WHERE command='select * from tx1'; +SELECT * FROM t2 WHERE command='delete from tx1 where a = 2'; +SELECT * FROM connect.tx1; +DROP TABLE t2; + +--replace_result $PORT PORT +--eval CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC CATFUNC=tables CONNECTION='jdbc:mariadb://localhost:$PORT/connect' option_list='User=root,Maxres=50' +SELECT * FROM t1; +DROP TABLE t1; +DROP TABLE connect.tx1; + +# +# Clean up +# +--remove_file $MYSQLD_DATADIR/connect/boys.txt +--remove_file $MYSQLD_DATADIR/connect/employee.dat +DROP DATABASE connect; +--remove_file $MYSQLD_DATADIR/test/girls.txt + +-- source jdbconn_cleanup.inc diff --git a/storage/connect/mysql-test/connect/t/jdbc_new.test b/storage/connect/mysql-test/connect/t/jdbc_new.test new file mode 100644 index 00000000000..33ec1b343cc --- /dev/null +++ b/storage/connect/mysql-test/connect/t/jdbc_new.test @@ -0,0 +1,179 @@ +# +# This test is run against a remote MySQL server +# +connect (master,127.0.0.1,root,,test,$MASTER_MYPORT,); +connect (slave,127.0.0.1,root,,test,$SLAVE_MYPORT,); +connection master; + +-- source jdbconn.inc + +connection slave; +CREATE TABLE t1 (a int, b char(10)); +INSERT INTO t1 VALUES (NULL,NULL),(0,'test00'),(1,'test01'),(2,'test02'),(3,'test03'); +SELECT * FROM t1; + +--echo # +--echo # Testing errors +--echo # +connection master; + +# Bad user name +# Suppress "mysql_real_connect failed:" (printed in _DEBUG build) +--replace_result $SLAVE_MYPORT SLAVE_PORT "mysql_real_connect failed: " "" +eval CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC + CONNECTION='jdbc:mysql://127.0.0.1:$SLAVE_MYPORT/test?user=unknown'; +--error ER_GET_ERRMSG +SELECT * FROM t1; +DROP TABLE t1; + +# Bad database name +--replace_result $SLAVE_MYPORT SLAVE_PORT "mysql_real_connect failed: " "" +--error ER_UNKNOWN_ERROR +eval CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC + CONNECTION='jdbc:mysql://127.0.0.1:$SLAVE_MYPORT/unknown?user=root'; + +# Bad table name +--replace_result $SLAVE_MYPORT SLAVE_PORT +--error ER_UNKNOWN_ERROR +eval CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC TABNAME='unknown' + CONNECTION='jdbc:mysql://127.0.0.1:$SLAVE_MYPORT/test?user=root'; +--error ER_NO_SUCH_TABLE +SHOW CREATE TABLE t1; + +# Bad column name +--replace_result $SLAVE_MYPORT SLAVE_PORT +eval CREATE TABLE t1 (x int, y char(10)) ENGINE=CONNECT TABLE_TYPE=JDBC + CONNECTION='jdbc:mysql://127.0.0.1:$SLAVE_MYPORT/test?user=root'; +--replace_result $SLAVE_MYPORT SLAVE_PORT +SHOW CREATE TABLE t1; +--error ER_GET_ERRMSG +SELECT * FROM t1; +DROP TABLE t1; + +# The remote table disappeared +--replace_result $SLAVE_MYPORT SLAVE_PORT +eval CREATE TABLE t1 (a int, b char(10)) ENGINE=CONNECT TABLE_TYPE=JDBC + CONNECTION='jdbc:mysql://127.0.0.1:$SLAVE_MYPORT/test?user=root'; + +connection slave; +ALTER TABLE t1 RENAME t1backup; + +connection master; +--error ER_GET_ERRMSG +SELECT * FROM t1; + +connection slave; +ALTER TABLE t1backup RENAME t1; + +connection master; +DROP TABLE t1; + +--echo # +--echo # Testing SELECT, etc. +--echo # + +# Automatic table structure +--replace_result $SLAVE_MYPORT SLAVE_PORT +eval CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC + CONNECTION='jdbc:mysql://127.0.0.1:$SLAVE_MYPORT/test?user=root'; +--replace_result $SLAVE_MYPORT SLAVE_PORT +SHOW CREATE TABLE t1; +SELECT * FROM t1; +DROP TABLE t1; + +# Explicit table structure +--replace_result $SLAVE_MYPORT SLAVE_PORT +eval CREATE TABLE t1 (a int, b char(10)) ENGINE=CONNECT TABLE_TYPE=JDBC TABNAME='t1' + CONNECTION='jdbc:mysql://127.0.0.1:$SLAVE_MYPORT/test?user=root'; +--replace_result $SLAVE_MYPORT SLAVE_PORT +SHOW CREATE TABLE t1; +SELECT * FROM t1; +DROP TABLE t1; + +# Explicit table structure: remote NULL, local NOT NULL +--replace_result $SLAVE_MYPORT SLAVE_PORT +eval CREATE TABLE t1 (a INT NOT NULL, b CHAR(10) NOT NULL) ENGINE=CONNECT TABLE_TYPE=JDBC + CONNECTION='jdbc:mysql://127.0.0.1:$SLAVE_MYPORT/test?user=root'; +--replace_result $SLAVE_MYPORT SLAVE_PORT +SHOW CREATE TABLE t1; +SELECT * FROM t1; +DROP TABLE t1; + +# Explicit table structure with wrong column types +--replace_result $SLAVE_MYPORT SLAVE_PORT +eval CREATE TABLE t1 (a char(10), b int) ENGINE=CONNECT TABLE_TYPE=JDBC + CONNECTION='jdbc:mysql://127.0.0.1:$SLAVE_MYPORT/test?user=root'; +--replace_result $SLAVE_MYPORT SLAVE_PORT +SHOW CREATE TABLE t1; +SELECT * FROM t1; +DROP TABLE t1; + +connection slave; +DROP TABLE t1; + +--echo # +--echo # Testing numeric data types +--echo # + +# TODO: mediumint is converted to int, float is converted to double, decimal is converted to double +CREATE TABLE t1 (a tinyint, b smallint, c mediumint, d int, e bigint, f float, g double, h decimal(20,5)); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES(100,3333,41235,1234567890,235000000000,3.14159265,3.14159265,3141.59265); + +connection master; +--replace_result $SLAVE_MYPORT SLAVE_PORT +eval CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC + CONNECTION='jdbc:mysql://127.0.0.1:$SLAVE_MYPORT/test?user=root'; +--replace_result $SLAVE_MYPORT SLAVE_PORT +SHOW CREATE TABLE t1; +SELECT * FROM t1; +DROP TABLE t1; + +connection slave; +DROP TABLE t1; + +--echo # +--echo # Testing character data types +--echo # + +CREATE TABLE t1 (a char(12), b varchar(12)); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES('Welcome','Hello, World'); +SELECT * FROM t1; + +connection master; +--replace_result $SLAVE_MYPORT SLAVE_PORT +eval CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC + CONNECTION='jdbc:mysql://127.0.0.1:$SLAVE_MYPORT/test?user=root'; +--replace_result $SLAVE_MYPORT SLAVE_PORT +SHOW CREATE TABLE t1; +SELECT * FROM t1; +DROP TABLE t1; + +connection slave; +DROP TABLE t1; + +--echo # +--echo # Testing temporal data types +--echo # + +CREATE TABLE t1 (a date, b datetime, c time, d timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, e year); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES('2003-05-27 10:45:23','2003-05-27 10:45:23','2003-05-27 10:45:23','2003-05-27 10:45:23','2003-05-27 10:45:23'); +SELECT * FROM t1; + +connection master; +--replace_result $SLAVE_MYPORT SLAVE_PORT +eval CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC + CONNECTION='jdbc:mysql://127.0.0.1:$SLAVE_MYPORT/test?user=root'; +--replace_result $SLAVE_MYPORT SLAVE_PORT +SHOW CREATE TABLE t1; +SELECT * FROM t1; +DROP TABLE t1; + +connection slave; +DROP TABLE t1; + +connection master; +-- source jdbconn_cleanup.inc + diff --git a/storage/connect/mysql-test/connect/t/jdbc_oracle.test b/storage/connect/mysql-test/connect/t/jdbc_oracle.test new file mode 100644 index 00000000000..10cb7a7b77d --- /dev/null +++ b/storage/connect/mysql-test/connect/t/jdbc_oracle.test @@ -0,0 +1,56 @@ +-- source jdbconn.inc + +# +# This test is run against Oracle driver +# +CREATE TABLE t2 ( + command varchar(128) not null, + number int(5) not null flag=1, + message varchar(255) flag=2) +ENGINE=CONNECT TABLE_TYPE=JDBC CONNECTION='jdbc:oracle:thin:@localhost:1521:xe' +OPTION_LIST='User=system,Password=manager,Execsrc=1'; +SELECT * FROM t2 WHERE command = 'drop table employee'; +SELECT * FROM t2 WHERE command = 'create table employee (id int not null, name varchar(32), title char(16), salary number(8,2))'; +SELECT * FROM t2 WHERE command = "insert into employee values(4567,'Johnson', 'Engineer', 12560.50)"; + +CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC CATFUNC=tables +CONNECTION='jdbc:oracle:thin:@localhost:1521:xe' +OPTION_LIST='User=system,Password=manager'; +SELECT * FROM t1 WHERE table_name='employee'; +DROP TABLE t1; + +CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC TABNAME='EMPLOYEE' CATFUNC=columns +CONNECTION='jdbc:oracle:thin:@localhost:1521:xe' +OPTION_LIST='User=system,Password=manager'; +SELECT * FROM t1; +DROP TABLE t1; + +# +# Test connecting via a Federated server +# +CREATE SERVER 'oracle' FOREIGN DATA WRAPPER 'oracle.jdbc.driver.OracleDriver' OPTIONS ( +HOST 'jdbc:oracle:thin:@localhost:1521:xe', +DATABASE 'SYSTEM', +USER 'system', +PASSWORD 'manager', +PORT 0, +SOCKET '', +OWNER 'SYSTEM'); + +CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC CONNECTION='oracle' tabname='EMPLOYEE'; +SELECT * FROM t1; +INSERT INTO t1 VALUES(6214, 'Clinton', 'Retired', NULL); +UPDATE t1 set name='Trump' WHERE id = 4567; +SELECT * FROM t1; +DELETE FROM t1 WHERE id = 6214; +SELECT * FROM t1; +DROP TABLE t1; +SELECT * FROM t2 WHERE command = 'drop table employee'; +DROP TABLE t2; +DROP SERVER 'oracle'; + +# +# Clean up +# + +-- source jdbconn_cleanup.inc diff --git a/storage/connect/mysql-test/connect/t/jdbc_postgresql.test b/storage/connect/mysql-test/connect/t/jdbc_postgresql.test new file mode 100644 index 00000000000..1041ef468d7 --- /dev/null +++ b/storage/connect/mysql-test/connect/t/jdbc_postgresql.test @@ -0,0 +1,53 @@ +-- source jdbconn.inc + +# +# This test is run against Postgresql driver +# +CREATE TABLE t2 ( + command varchar(128) not null, + number int(5) not null flag=1, + message varchar(255) flag=2) +ENGINE=CONNECT TABLE_TYPE=JDBC CONNECTION='jdbc:postgresql://localhost/mtr' +OPTION_LIST='User=mtr,Password=mtr,Schema=public,Execsrc=1'; +SELECT * FROM t2 WHERE command='drop table employee'; +SELECT * FROM t2 WHERE command = 'create table employee (id int not null, name varchar(32), title char(16), salary decimal(8,2))'; +SELECT * FROM t2 WHERE command = "insert into employee values(4567,'Johnson', 'Engineer', 12560.50)"; + +CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC CATFUNC=tables +CONNECTION='jdbc:postgresql://localhost/mtr' +OPTION_LIST='User=mtr,Password=mtr,Schema=public,Tabtype=TABLE,Maxres=10'; +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC CATFUNC=columns +CONNECTION='jdbc:postgresql://localhost/mtr' tabname=employee +OPTION_LIST='User=mtr,Password=mtr,Maxres=10'; +SELECT * FROM t1; +DROP TABLE t1; + +# +# Test connecting via a Federated server +# +CREATE SERVER 'postgresql' FOREIGN DATA WRAPPER 'postgresql' OPTIONS ( +HOST 'localhost', +DATABASE 'mtr', +USER 'mtr', +PASSWORD 'mtr', +PORT 0, +SOCKET '', +OWNER 'root'); + +CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC CONNECTION='postgresql/public.employee'; +SELECT * FROM t1; +INSERT INTO t1 VALUES(3126,'Smith', 'Clerk', 5230.00); +UPDATE t1 SET salary = salary + 100.00; +SELECT * FROM t1; +DROP TABLE t1; +DROP SERVER 'postgresql'; +SELECT * FROM t2 WHERE command='drop table employee'; +DROP TABLE t2; + +# +# Clean up +# +-- source jdbconn_cleanup.inc diff --git a/storage/connect/mysql-test/connect/t/jdbconn.inc b/storage/connect/mysql-test/connect/t/jdbconn.inc new file mode 100644 index 00000000000..0bac0b35fc4 --- /dev/null +++ b/storage/connect/mysql-test/connect/t/jdbconn.inc @@ -0,0 +1,31 @@ +--source include/not_embedded.inc + +--disable_query_log +--error 0,ER_UNKNOWN_ERROR +CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC CATFUNC=drivers; +if (!`SELECT count(*) FROM INFORMATION_SCHEMA.TABLES + WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1' + AND ENGINE='CONNECT' + AND (CREATE_OPTIONS LIKE "%`table_type`='JDBC'%" OR CREATE_OPTIONS LIKE '%`table_type`=JDBC%')`) +{ + Skip Need Java support; +} +DROP TABLE t1; + +# This is specific and explains why this test is disabled. +# You should edit this file to reflect what is the required files location on your machine. +# This is the path to the JVM library (dll or so) +SET GLOBAL connect_jvm_path='C:\\Program Files\\Java\\jdk1.8.0_77\\jre\\bin\\client'; + +# The complete class path send when creating the Java Virtual Machine is, in that order: +# 1 - The current directory. +# 2 - The paths of the connect_class_path global variable. +# 3 - The paths of the CLASSPATH environment variable. +# These are the paths to the needed classes or jar files. The Apache ones are only for the JdbcApacheInterface wrapper. +SET GLOBAL connect_class_path='E:\\MariaDB-10.1\\Connect\\storage\\connect;E:\\MariaDB-10.1\\Connect\\sql\\data\\postgresql-9.4.1208.jar;E:\\Oracle\\ojdbc6.jar;E:\\Apache\\commons-dbcp2-2.1.1\\commons-dbcp2-2.1.1.jar;E:\\Apache\\commons-pool2-2.4.2\\commons-pool2-2.4.2.jar;E:\\Apache\\commons-logging-1.2\\commons-logging-1.2.jar'; + +# On my machine, paths to the JDK classes and to the MySQL and MariaDB drivers are defined in the CLASSPATH environment variable +#CREATE FUNCTION envar RETURNS STRING SONAME 'ha_connect.dll'; +#SELECT envar('CLASSPATH'); + +--enable_query_log diff --git a/storage/connect/mysql-test/connect/t/jdbconn_cleanup.inc b/storage/connect/mysql-test/connect/t/jdbconn_cleanup.inc new file mode 100644 index 00000000000..48e321495ad --- /dev/null +++ b/storage/connect/mysql-test/connect/t/jdbconn_cleanup.inc @@ -0,0 +1,6 @@ +--disable_warnings +#DROP FUNCTION envar; +SET GLOBAL connect_jvm_path=NULL; +SET GLOBAL connect_class_path=NULL; +SET GLOBAL time_zone = SYSTEM; +--enable_warnings diff --git a/storage/connect/mysql-test/connect/t/mysql_index.test b/storage/connect/mysql-test/connect/t/mysql_index.test index 9a162b4d8e3..81fdcad9330 100644 --- a/storage/connect/mysql-test/connect/t/mysql_index.test +++ b/storage/connect/mysql-test/connect/t/mysql_index.test @@ -64,3 +64,70 @@ SELECT * FROM t2; DROP TABLE t2; DROP TABLE t1; + +let $MYSQLD_DATADIR= `select @@datadir`; +--copy_file $MTR_SUITE_DIR/std_data/emp.txt $MYSQLD_DATADIR/test/emp.txt + +--echo # +--echo # Make local FIX table with indices matricule and nom/prenom +--echo # +CREATE TABLE t1 +( + matricule INT(4) KEY NOT NULL field_format='Z', + nom VARCHAR(16) NOT NULL, + prenom VARCHAR(20) NOT NULL, + sexe SMALLINT(1) NOT NULL COMMENT 'sexe 1:M 2:F', + aanais INT(4) NOT NULL, + mmnais INT(2) NOT NULL, + ddentree DATE NOT NULL date_format='YYYYMM', + ddnom DATE NOT NULL date_format='YYYYMM', + brut INT(5) NOT NULL, + net DOUBLE(8,2) NOT NULL, + service INT(2) NOT NULL, + sitmat CHAR(1) NOT NULL, + formation CHAR(5) NOT NULL, + INDEX NP(nom,prenom) +) ENGINE=CONNECT TABLE_TYPE=FIX FILE_NAME='emp.txt' ENDING=2; + +--echo # +--echo # Make MYSQL table with same indices +--echo # +CREATE TABLE t2 +( + matricule INT(4) KEY NOT NULL, + nom VARCHAR(16) NOT NULL, + prenom VARCHAR(20) NOT NULL, + sexe SMALLINT(1) NOT NULL, + aanais INT(4) NOT NULL, + mmnais INT(2) NOT NULL, + ddentree DATE NOT NULL date_format='YYYYMM', + ddnom DATE NOT NULL date_format='YYYYMM', + brut INT(5) NOT NULL, + net DOUBLE(8,2) NOT NULL, + service INT(2) NOT NULL, + sitmat CHAR(1) NOT NULL, + formation CHAR(5) NOT NULL, + INDEX NP(nom,prenom) +) ENGINE=CONNECT TABLE_TYPE=MYSQL CONNECTIOn='mysql://root@localhost/test/t1'; +SELECT * FROM t2 limit 10; +SELECT matricule, nom, prenom FROM t2 WHERE nom IN ('FOCH','MOGADOR'); +SELECT matricule, nom, prenom FROM t2 WHERE nom = 'FOCH' OR nom = 'MOGADOR'; +SELECT matricule, nom, prenom FROM t2 WHERE nom < 'ADDAX'; +SELECT matricule, nom, prenom FROM t2 WHERE nom <= 'ABEL'; +SELECT matricule, nom, prenom FROM t2 WHERE nom > 'YVON'; +SELECT matricule, nom, prenom FROM t2 WHERE nom >= 'YVON'; +SELECT matricule, nom, prenom FROM t2 WHERE nom <= 'ABEL' OR nom > 'YVON'; +SELECT matricule, nom, prenom FROM t2 WHERE nom > 'HELEN' AND nom < 'HEROS'; +SELECT matricule, nom, prenom FROM t2 WHERE nom BETWEEN 'HELEN' AND 'HEROS'; +SELECT matricule, nom, prenom FROM t2 WHERE nom BETWEEN 'HELEN' AND 'HEROS' AND prenom = 'PHILIPPE'; +SELECT matricule, nom, prenom FROM t2 ORDER BY nom LIMIT 10; +SELECT a.nom, a.prenom, b.nom FROM t1 a STRAIGHT_JOIN t2 b ON a.prenom = b.prenom WHERE a.nom = 'FOCH' AND a.nom != b.nom; + +DROP TABLE t2; +DROP TABLE t1; + +# +# Clean up +# +--remove_file $MYSQLD_DATADIR/test/emp.txt +--remove_file $MYSQLD_DATADIR/test/emp.fnx diff --git a/storage/connect/mysql-test/connect/t/odbc_firebird.test b/storage/connect/mysql-test/connect/t/odbc_firebird.test index c89ffe5dfb2..c9279eec385 100644 --- a/storage/connect/mysql-test/connect/t/odbc_firebird.test +++ b/storage/connect/mysql-test/connect/t/odbc_firebird.test @@ -4,7 +4,7 @@ SET NAMES utf8; # MS ODBC and unixODBC return different error message text, # so disable displaying error messages -#--disable_result_log ONCE +--disable_result_log ONCE --error ER_UNKNOWN_ERROR CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='Bad connection string'; @@ -30,6 +30,6 @@ CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CATFUNC=Columns CONNECTION='Not i SHOW CREATE TABLE t1; DROP TABLE t1; -CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC TABNAME='EMPLOYEE' CONNECTION='DSN=Firebird;UID=SYSDBA;PWD=manager'; +CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC TABNAME='EMPLOYEE' CONNECTION='DSN=Firebird;UID=SYSDBA;PWD=masterkey'; SELECT * FROM t1; DROP TABLE t1; diff --git a/storage/connect/mysql-test/connect/t/part_table.test b/storage/connect/mysql-test/connect/t/part_table.test index d839337ba6f..5edd5766bd6 100644 --- a/storage/connect/mysql-test/connect/t/part_table.test +++ b/storage/connect/mysql-test/connect/t/part_table.test @@ -82,6 +82,21 @@ SELECT * FROM t1; DELETE FROM t1 WHERE id in (60,72); SELECT * FROM t1; DROP TABLE t1; + +# +# Using a connection string +# +CREATE TABLE t1 ( +id INT KEY NOT NULL, +msg VARCHAR(32)) +ENGINE=CONNECT TABLE_TYPE=MYSQL +OPTION_LIST='connect=mysql://root@localhost/test/xt%s' +PARTITION BY RANGE COLUMNS(id) ( +PARTITION `1` VALUES LESS THAN(10), +PARTITION `2` VALUES LESS THAN(50), +PARTITION `3` VALUES LESS THAN(MAXVALUE)); +SELECT * FROM t1; +DROP TABLE t1; DROP TABLE xt1; DROP TABLE xt2; DROP TABLE xt3; diff --git a/storage/connect/odbccat.h b/storage/connect/odbccat.h index 1b5febadd3a..3b729bcb4bb 100644 --- a/storage/connect/odbccat.h +++ b/storage/connect/odbccat.h @@ -21,5 +21,5 @@ PQRYRES ODBCColumns(PGLOBAL g, char *dsn, char *db, char *table, char *colpat, int maxres, bool info, POPARM sop); PQRYRES ODBCSrcCols(PGLOBAL g, char *dsn, char *src, POPARM sop); PQRYRES ODBCTables(PGLOBAL g, char *dsn, char *db, char *tabpat, - int maxres, bool info, POPARM sop); + char *tabtyp, int maxres, bool info, POPARM sop); PQRYRES ODBCDrivers(PGLOBAL g, int maxres, bool info); diff --git a/storage/connect/odbconn.cpp b/storage/connect/odbconn.cpp index 55ccbdbada1..3ed4e9af393 100644 --- a/storage/connect/odbconn.cpp +++ b/storage/connect/odbconn.cpp @@ -606,7 +606,7 @@ PQRYRES ODBCDataSources(PGLOBAL g, int maxres, bool info) /* an ODBC database that will be retrieved by GetData commands. */ /**************************************************************************/ PQRYRES ODBCTables(PGLOBAL g, char *dsn, char *db, char *tabpat, - int maxres, bool info, POPARM sop) + char *tabtyp, int maxres, bool info, POPARM sop) { int buftyp[] = {TYPE_STRING, TYPE_STRING, TYPE_STRING, TYPE_STRING, TYPE_STRING}; @@ -668,7 +668,7 @@ PQRYRES ODBCTables(PGLOBAL g, char *dsn, char *db, char *tabpat, if (!(cap = AllocCatInfo(g, CAT_TAB, db, tabpat, qrp))) return NULL; -//cap->Pat = (PUCHAR)tabtyp; + cap->Pat = (PUCHAR)tabtyp; if (trace) htrc("Getting table results ncol=%d\n", cap->Qrp->Nbcol); @@ -1458,7 +1458,7 @@ int ODBConn::ExecDirectSQL(char *sql, ODBCCOL *tocols) n++; // n can be 0 for query such as Select count(*) from table - if (n && n != (UWORD)ncol) + if (n && n > (UWORD)ncol) ThrowDBX(MSG(COL_NUM_MISM)); // Now bind the column buffers @@ -1752,7 +1752,7 @@ bool ODBConn::BindParam(ODBCCOL *colp) void *buf; int buftype = colp->GetResultType(); SQLUSMALLINT n = colp->GetRank(); - SQLSMALLINT ct, sqlt, dec, nul; + SQLSMALLINT ct, sqlt, dec, nul __attribute__((unused)); SQLULEN colsize; SQLLEN len; SQLLEN *strlen = colp->GetStrLen(); diff --git a/storage/connect/plgdbsem.h b/storage/connect/plgdbsem.h index b57d9e20ceb..910ce97f48a 100644 --- a/storage/connect/plgdbsem.h +++ b/storage/connect/plgdbsem.h @@ -77,7 +77,8 @@ enum TABTYPE {TAB_UNDEF = 0, /* Table of undefined type */ TAB_JSON = 23, /* JSON tables */ TAB_JCT = 24, /* Junction tables NIY */ TAB_DMY = 25, /* DMY Dummy tables NIY */ - TAB_NIY = 26}; /* Table not implemented yet */ + TAB_JDBC = 26, /* Table accessed via JDBC */ + TAB_NIY = 27}; /* Table not implemented yet */ enum AMT {TYPE_AM_ERROR = 0, /* Type not defined */ TYPE_AM_ROWID = 1, /* ROWID type (special column) */ @@ -109,7 +110,9 @@ enum AMT {TYPE_AM_ERROR = 0, /* Type not defined */ TYPE_AM_DIR = 90, /* DIR access method type no */ TYPE_AM_ODBC = 100, /* ODBC access method type no */ TYPE_AM_XDBC = 101, /* XDBC access method type no */ - TYPE_AM_OEM = 110, /* OEM access method type no */ + TYPE_AM_JDBC = 102, /* JDBC access method type no */ + TYPE_AM_XJDC = 103, /* XJDC access method type no */ + TYPE_AM_OEM = 110, /* OEM access method type no */ TYPE_AM_TBL = 115, /* TBL access method type no */ TYPE_AM_PIVOT = 120, /* PIVOT access method type no */ TYPE_AM_SRC = 121, /* PIVOT multiple column type no */ @@ -146,8 +149,9 @@ enum RECFM {RECFM_NAF = -2, /* Not a file */ RECFM_BIN = 2, /* Binary DOS files (also fixed) */ RECFM_VCT = 3, /* VCT formatted files */ RECFM_ODBC = 4, /* Table accessed via ODBC */ - RECFM_PLG = 5, /* Table accessed via PLGconn */ - RECFM_DBF = 6}; /* DBase formatted file */ + RECFM_JDBC = 5, /* Table accessed via JDBC */ + RECFM_PLG = 6, /* Table accessed via PLGconn */ + RECFM_DBF = 7}; /* DBase formatted file */ enum MISC {DB_TABNO = 1, /* DB routines in Utility Table */ MAX_MULT_KEY = 10, /* Max multiple key number */ diff --git a/storage/connect/plgdbutl.cpp b/storage/connect/plgdbutl.cpp index 1ec1108c639..13c0dfd1e18 100644 --- a/storage/connect/plgdbutl.cpp +++ b/storage/connect/plgdbutl.cpp @@ -5,7 +5,7 @@ /* */ /* COPYRIGHT: */ /* ---------- */ -/* (C) Copyright to the author Olivier BERTRAND 1998-2015 */ +/* (C) Copyright to the author Olivier BERTRAND 1998-2016 */ /* */ /* WHAT THIS PROGRAM DOES: */ /* ----------------------- */ @@ -46,9 +46,9 @@ #else // !__WIN__ #include #include -#if defined(THREAD) +//#if defined(THREAD) #include -#endif // THREAD +//#endif // THREAD #include #define BIGMEM 2147483647 // Max int value #endif // !__WIN__ @@ -69,17 +69,6 @@ #include "valblk.h" #include "rcmsg.h" -/***********************************************************************/ -/* Macro or external routine definition */ -/***********************************************************************/ -#if defined(THREAD) -#if defined(__WIN__) -extern CRITICAL_SECTION parsec; // Used calling the Flex parser -#else // !__WIN__ -extern pthread_mutex_t parmut; -#endif // !__WIN__ -#endif // THREAD - /***********************************************************************/ /* DB static variables. */ /***********************************************************************/ @@ -90,6 +79,12 @@ extern "C" { extern char version[]; } // extern "C" +#if defined(__WIN__) +extern CRITICAL_SECTION parsec; // Used calling the Flex parser +#else // !__WIN__ +extern pthread_mutex_t parmut; +#endif // !__WIN__ + // The debug trace used by the main thread FILE *pfile = NULL; @@ -702,21 +697,21 @@ PDTP MakeDateFormat(PGLOBAL g, PSZ dfmt, bool in, bool out, int flag) /* Call the FLEX generated parser. In multi-threading mode the next */ /* instruction is included in an Enter/LeaveCriticalSection bracket. */ /*********************************************************************/ -#if defined(THREAD) + //#if defined(THREAD) #if defined(__WIN__) EnterCriticalSection((LPCRITICAL_SECTION)&parsec); #else // !__WIN__ pthread_mutex_lock(&parmut); #endif // !__WIN__ -#endif // THREAD +//#endif // THREAD rc = fmdflex(pdp); -#if defined(THREAD) +//#if defined(THREAD) #if defined(__WIN__) LeaveCriticalSection((LPCRITICAL_SECTION)&parsec); #else // !__WIN__ pthread_mutex_unlock(&parmut); #endif // !__WIN__ -#endif // THREAD +//#endif // THREAD if (trace) htrc("Done: in=%s out=%s rc=%d\n", SVP(pdp->InFmt), SVP(pdp->OutFmt), rc); @@ -1102,7 +1097,8 @@ char *GetAmName(PGLOBAL g, AMT am, void *memp) case TYPE_AM_DOM: strcpy(amn, "DOM"); break; case TYPE_AM_DIR: strcpy(amn, "DIR"); break; case TYPE_AM_ODBC: strcpy(amn, "ODBC"); break; - case TYPE_AM_MAC: strcpy(amn, "MAC"); break; + case TYPE_AM_JDBC: strcpy(amn, "JDBC"); break; + case TYPE_AM_MAC: strcpy(amn, "MAC"); break; case TYPE_AM_OEM: strcpy(amn, "OEM"); break; case TYPE_AM_OUT: strcpy(amn, "OUT"); break; default: sprintf(amn, "OEM(%d)", am); diff --git a/storage/connect/plugutil.c b/storage/connect/plugutil.c index 38e28a171b2..2551b603349 100644 --- a/storage/connect/plugutil.c +++ b/storage/connect/plugutil.c @@ -516,7 +516,9 @@ void *PlugSubAlloc(PGLOBAL g, void *memp, size_t size) if (trace) htrc("PlugSubAlloc: %s\n", g->Message); - longjmp(g->jumper[g->jump_level], 1); + /* Nothing we can do if longjmp is not initialized. */ + assert(g->jump_level >= 0); + longjmp(g->jumper[g->jump_level], 1); } /* endif size OS32 code */ /*********************************************************************/ diff --git a/storage/connect/reldef.cpp b/storage/connect/reldef.cpp index e455bc8f1a5..2c8ada52e6f 100644 --- a/storage/connect/reldef.cpp +++ b/storage/connect/reldef.cpp @@ -305,7 +305,7 @@ int TABDEF::GetColCatInfo(PGLOBAL g) case TAB_OEM: poff = 0; // Offset represents an independant flag break; - default: // VCT PLG ODBC MYSQL WMI... + default: // VCT PLG ODBC JDBC MYSQL WMI... poff = 0; // NA break; } // endswitch tc @@ -514,10 +514,11 @@ PTABDEF OEMDEF::GetXdef(PGLOBAL g) } // endif getdef #else // !__WIN__ const char *error = NULL; - Dl_info dl_info; #if 0 // Don't know what all this stuff does - // The OEM lib must retrieve exported CONNECT variables + Dl_info dl_info; + + // The OEM lib must retrieve exported CONNECT variables if (dladdr(&connect_hton, &dl_info)) { if (dlopen(dl_info.dli_fname, RTLD_NOLOAD | RTLD_NOW | RTLD_GLOBAL) == 0) { error = dlerror(); diff --git a/storage/connect/tabcol.cpp b/storage/connect/tabcol.cpp index 662c0b514cf..fde1baa6317 100644 --- a/storage/connect/tabcol.cpp +++ b/storage/connect/tabcol.cpp @@ -50,7 +50,7 @@ XTAB::XTAB(PTABLE tp) : Name(tp->Name) Qualifier = tp->Qualifier; if (trace) - htrc(" making copy TABLE %s %s\n", Name, Srcdef); + htrc(" making copy TABLE %s %s\n", Name, SVP(Srcdef)); } // end of XTAB constructor diff --git a/storage/connect/tabfmt.cpp b/storage/connect/tabfmt.cpp index 015f8d93b15..b786fb64b56 100644 --- a/storage/connect/tabfmt.cpp +++ b/storage/connect/tabfmt.cpp @@ -964,7 +964,7 @@ bool TDBCSV::PrepareWriting(PGLOBAL g) if (!strlen(Field[i])) { // Generally null fields are not quoted if (Quoted > 2) - // Except if explicitely required + // Except if explicitly required strcat(strcat(To_Line, qot), qot); } else if (Qot && (strchr(Field[i], Sep) || *Field[i] == Qot diff --git a/storage/connect/tabjdbc.cpp b/storage/connect/tabjdbc.cpp new file mode 100644 index 00000000000..e6782e71753 --- /dev/null +++ b/storage/connect/tabjdbc.cpp @@ -0,0 +1,1824 @@ +/************* TabJDBC C++ Program Source Code File (.CPP) *************/ +/* PROGRAM NAME: TABJDBC */ +/* ------------- */ +/* Version 1.1 */ +/* */ +/* COPYRIGHT: */ +/* ---------- */ +/* (C) Copyright to the author Olivier BERTRAND 2016 */ +/* */ +/* WHAT THIS PROGRAM DOES: */ +/* ----------------------- */ +/* This program are the TABJDBC class DB execution routines. */ +/* */ +/* WHAT YOU NEED TO COMPILE THIS PROGRAM: */ +/* -------------------------------------- */ +/* */ +/* REQUIRED FILES: */ +/* --------------- */ +/* TABJDBC.CPP - Source code */ +/* PLGDBSEM.H - DB application declaration file */ +/* TABJDBC.H - TABJDBC classes declaration file */ +/* GLOBAL.H - Global declaration file */ +/* */ +/* REQUIRED LIBRARIES: */ +/* ------------------- */ +/* Large model C library */ +/* */ +/* REQUIRED PROGRAMS: */ +/* ------------------ */ +/* IBM, Borland, GNU or Microsoft C++ Compiler and Linker */ +/* */ +/***********************************************************************/ + +/***********************************************************************/ +/* Include relevant MariaDB header file. */ +/***********************************************************************/ +#define MYSQL_SERVER 1 +#include "my_global.h" +#include "sql_class.h" +#include "sql_servers.h" +#if defined(__WIN__) +#include +#include +#if defined(__BORLANDC__) +#define __MFC_COMPAT__ // To define min/max as macro +#endif +//#include +#include +#else +#if defined(UNIX) +#include +#define NODW +#include "osutil.h" +#else +#include +#endif +#include +#endif + +/***********************************************************************/ +/* Include application header files: */ +/* global.h is header containing all global declarations. */ +/* plgdbsem.h is header containing the DB application declarations. */ +/* kindex.h is kindex header that also includes tabdos.h. */ +/* tabJDBC.h is header containing the TABJDBC class declarations. */ +/* JDBConn.h is header containing JDBC connection declarations. */ +/***********************************************************************/ +#include "global.h" +#include "plgdbsem.h" +#include "mycat.h" +#include "xtable.h" +#include "tabjdbc.h" +#include "tabmul.h" +#include "reldef.h" +#include "tabcol.h" +#include "valblk.h" +#include "ha_connect.h" + +#include "sql_string.h" + +/***********************************************************************/ +/* DB static variables. */ +/***********************************************************************/ +// int num_read, num_there, num_eq[2], num_nf; // Statistics +extern int num_read, num_there, num_eq[2]; // Statistics + +/***********************************************************************/ +/* External function. */ +/***********************************************************************/ +bool ExactInfo(void); + +/* -------------------------- Class JDBCDEF -------------------------- */ + +/***********************************************************************/ +/* Constructor. */ +/***********************************************************************/ +JDBCDEF::JDBCDEF(void) +{ + Driver = Url = Tabname = Tabschema = Username = Colpat = NULL; + Password = Tabcat = Tabtype = Srcdef = Qchar = Qrystr = Sep = NULL; + Options = Quoted = Maxerr = Maxres = Memory = 0; + Scrollable = Xsrc = false; +} // end of JDBCDEF constructor + +/***********************************************************************/ +/* Called on table construction. */ +/***********************************************************************/ +bool JDBCDEF::SetParms(PJPARM sjp) +{ + sjp->Url= Url; + sjp->User= Username; + sjp->Pwd= Password; + return true; +} // end of SetParms + +/***********************************************************************/ +/* Parse connection string */ +/* */ +/* SYNOPSIS */ +/* ParseURL() */ +/* Url The connection string to parse */ +/* */ +/* DESCRIPTION */ +/* This is used to set the Url in case a wrapper server as been */ +/* specified. This is rather experimental yet. */ +/* */ +/* RETURN VALUE */ +/* RC_OK Url was a true URL */ +/* RC_NF Url was a server name/table */ +/* RC_FX Error */ +/* */ +/***********************************************************************/ +int JDBCDEF::ParseURL(PGLOBAL g, char *url, bool b) +{ + if (strncmp(url, "jdbc:", 5)) { + // No "jdbc:" in connection string. Must be a straight + // "server" or "server/table" + // ok, so we do a little parsing, but not completely! + if ((Tabname= strchr(url, '/'))) { + // If there is a single '/' in the connection string, + // this means the user is specifying a table name + *Tabname++= '\0'; + + // there better not be any more '/'s ! + if (strchr(Tabname, '/')) + return RC_FX; + + } else if (b) { + // Otherwise, straight server name, + Tabname = GetStringCatInfo(g, "Name", NULL); + Tabname = GetStringCatInfo(g, "Tabname", Tabname); + } // endelse + + if (trace) + htrc("server: %s Tabname: %s", url, Tabname); + + // Now make the required URL + FOREIGN_SERVER *server, server_buffer; + + // get_server_by_name() clones the server if exists + if (!(server= get_server_by_name(current_thd->mem_root, url, &server_buffer))) { + sprintf(g->Message, "Server %s does not exist!", url); + return RC_FX; + } // endif server + + if (strncmp(server->host, "jdbc:", 5)) { + // Now make the required URL + Url = (PSZ)PlugSubAlloc(g, NULL, 0); + strcat(strcpy(Url, "jdbc:"), server->scheme); + strcat(strcat(Url, "://"), server->host); + + if (server->port) { + char buf[16]; + + sprintf(buf, "%ld", server->port); + strcat(strcat(Url, ":"), buf); + } // endif port + + if (server->db) + strcat(strcat(Url, "/"), server->db); + + PlugSubAlloc(g, NULL, strlen(Url) + 1); + } else // host is a URL + Url = PlugDup(g, server->host); + + if (server->username) + Username = PlugDup(g, server->username); + + if (server->password) + Password = PlugDup(g, server->password); + + return RC_NF; + } // endif + + // Url was a JDBC URL, nothing to do + return RC_OK; +} // end of ParseURL + +/***********************************************************************/ +/* DefineAM: define specific AM block values from JDBC file. */ +/***********************************************************************/ +bool JDBCDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff) +{ + int rc = RC_OK; + + Driver = GetStringCatInfo(g, "Driver", NULL); + Desc = Url = GetStringCatInfo(g, "Connect", NULL); + + if (!Url && !Catfunc) { + // Look in the option list (deprecated) + Url = GetStringCatInfo(g, "Url", NULL); + + if (!Url) { + sprintf(g->Message, "Missing URL for JDBC table %s", Name); + return true; + } // endif Url + + } // endif Connect + + if (Url) + rc = ParseURL(g, Url); + + if (rc == RC_FX) // Error + return true; + else if (rc == RC_OK) { // Url was not a server name + Tabname = GetStringCatInfo(g, "Name", + (Catfunc & (FNC_TABLE | FNC_COL)) ? NULL : Name); + Tabname = GetStringCatInfo(g, "Tabname", Tabname); + Username = GetStringCatInfo(g, "User", NULL); + Password = GetStringCatInfo(g, "Password", NULL); + } // endif rc + + if ((Srcdef = GetStringCatInfo(g, "Srcdef", NULL))) + Read_Only = true; + + Tabcat = GetStringCatInfo(g, "Qualifier", NULL); + Tabcat = GetStringCatInfo(g, "Catalog", Tabcat); + Tabschema = GetStringCatInfo(g, "Dbname", NULL); + Tabschema = GetStringCatInfo(g, "Schema", Tabschema); + + if (Catfunc == FNC_COL) + Colpat = GetStringCatInfo(g, "Colpat", NULL); + + if (Catfunc == FNC_TABLE) + Tabtype = GetStringCatInfo(g, "Tabtype", NULL); + + Qrystr = GetStringCatInfo(g, "Query_String", "?"); + Sep = GetStringCatInfo(g, "Separator", NULL); + Xsrc = GetBoolCatInfo("Execsrc", FALSE); + Maxerr = GetIntCatInfo("Maxerr", 0); + Maxres = GetIntCatInfo("Maxres", 0); + Quoted = GetIntCatInfo("Quoted", 0); +//Cto= GetIntCatInfo("ConnectTimeout", DEFAULT_LOGIN_TIMEOUT); +//Qto= GetIntCatInfo("QueryTimeout", DEFAULT_QUERY_TIMEOUT); + Scrollable = GetBoolCatInfo("Scrollable", false); + Memory = GetIntCatInfo("Memory", 0); + Pseudo = 2; // FILID is Ok but not ROWID + return false; +} // end of DefineAM + +/***********************************************************************/ +/* GetTable: makes a new Table Description Block. */ +/***********************************************************************/ +PTDB JDBCDEF::GetTable(PGLOBAL g, MODE m) +{ + PTDBASE tdbp = NULL; + + /*********************************************************************/ + /* Allocate a TDB of the proper type. */ + /* Column blocks will be allocated only when needed. */ + /*********************************************************************/ + if (Xsrc) + tdbp = new(g)TDBXJDC(this); + else switch (Catfunc) { + case FNC_COL: + tdbp = new(g)TDBJDBCL(this); + break; +#if 0 + case FNC_DSN: + tdbp = new(g)TDBJSRC(this); + break; +#endif // 0 + case FNC_TABLE: + tdbp = new(g)TDBJTB(this); + break; + case FNC_DRIVER: + tdbp = new(g)TDBJDRV(this); + break; + default: + tdbp = new(g)TDBJDBC(this); + + if (Multiple == 1) + tdbp = new(g)TDBMUL(tdbp); + else if (Multiple == 2) + strcpy(g->Message, "NO_JDBC_MUL"); + + } // endswitch Catfunc + + return tdbp; +} // end of GetTable + +/***********************************************************************/ +/* The MySQL and MariaDB JDBC drivers return by default a result set */ +/* containing the entire result of the executed query. This can be an */ +/* issue for big tables and memory error can occur. An alternative is */ +/* to use streaming (reading one row at a time) but to specify this, */ +/* a fech size of the integer min value must be send to the driver. */ +/***********************************************************************/ +int JDBCPARM::CheckSize(int rows) +{ + if (Url && rows == 1) { + // Are we connected to a MySQL JDBC connector? + bool b = (!strncmp(Url, "jdbc:mysql:", 11) || + !strncmp(Url, "jdbc:mariadb:", 13)); + return b ? INT_MIN32 : rows; + } else + return rows; + +} // end of CheckSize + +/* -------------------------- Class TDBJDBC -------------------------- */ + +/***********************************************************************/ +/* Implementation of the TDBJDBC class. */ +/***********************************************************************/ +TDBJDBC::TDBJDBC(PJDBCDEF tdp) : TDBASE(tdp) +{ + Jcp = NULL; + Cnp = NULL; + + if (tdp) { + Ops.Driver = tdp->Driver; + Ops.Url = tdp->Url; + TableName = tdp->Tabname; + Schema = tdp->Tabschema; + Ops.User = tdp->Username; + Ops.Pwd = tdp->Password; + Catalog = tdp->Tabcat; + Srcdef = tdp->Srcdef; + Qrystr = tdp->Qrystr; + Sep = tdp->GetSep(); + Options = tdp->Options; +// Ops.Cto = tdp->Cto; +// Ops.Qto = tdp->Qto; + Quoted = MY_MAX(0, tdp->GetQuoted()); + Rows = tdp->GetElemt(); + Memory = tdp->Memory; + Ops.Scrollable = tdp->Scrollable; + } else { + TableName = NULL; + Schema = NULL; + Ops.Driver = NULL; + Ops.Url = NULL; + Ops.User = NULL; + Ops.Pwd = NULL; + Catalog = NULL; + Srcdef = NULL; + Qrystr = NULL; + Sep = 0; + Options = 0; +// Ops.Cto = DEFAULT_LOGIN_TIMEOUT; +// Ops.Qto = DEFAULT_QUERY_TIMEOUT; + Quoted = 0; + Rows = 0; + Memory = 0; + Ops.Scrollable = false; + } // endif tdp + + Quote = NULL; + Query = NULL; + Count = NULL; +//Where = NULL; + MulConn = NULL; + DBQ = NULL; + Qrp = NULL; + Fpos = 0; + Curpos = 0; + AftRows = 0; + CurNum = 0; + Rbuf = 0; + BufSize = 0; + Ncol = 0; + Nparm = 0; + Placed = false; + Prepared = false; + Werr = false; + Rerr = false; + Ops.Fsize = Ops.CheckSize(Rows); +} // end of TDBJDBC standard constructor + +TDBJDBC::TDBJDBC(PTDBJDBC tdbp) : TDBASE(tdbp) +{ + Jcp = tdbp->Jcp; // is that right ? + Cnp = tdbp->Cnp; + TableName = tdbp->TableName; + Schema = tdbp->Schema; + Ops = tdbp->Ops; + Catalog = tdbp->Catalog; + Srcdef = tdbp->Srcdef; + Qrystr = tdbp->Qrystr; + Memory = tdbp->Memory; +//Scrollable = tdbp->Scrollable; + Quote = tdbp->Quote; + Query = tdbp->Query; + Count = tdbp->Count; +//Where = tdbp->Where; + MulConn = tdbp->MulConn; + DBQ = tdbp->DBQ; + Options = tdbp->Options; + Quoted = tdbp->Quoted; + Rows = tdbp->Rows; + Fpos = 0; + Curpos = 0; + AftRows = 0; + CurNum = 0; + Rbuf = 0; + BufSize = tdbp->BufSize; + Nparm = tdbp->Nparm; + Qrp = tdbp->Qrp; + Placed = false; +} // end of TDBJDBC copy constructor + +// Method +PTDB TDBJDBC::CopyOne(PTABS t) +{ + PTDB tp; + PJDBCCOL cp1, cp2; + PGLOBAL g = t->G; // Is this really useful ??? + + tp = new(g)TDBJDBC(this); + + for (cp1 = (PJDBCCOL)Columns; cp1; cp1 = (PJDBCCOL)cp1->GetNext()) { + cp2 = new(g)JDBCCOL(cp1, tp); // Make a copy + NewPointer(t, cp1, cp2); + } // endfor cp1 + + return tp; +} // end of CopyOne + +/***********************************************************************/ +/* Allocate JDBC column description block. */ +/***********************************************************************/ +PCOL TDBJDBC::MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n) +{ + return new(g)JDBCCOL(cdp, this, cprec, n); +} // end of MakeCol + +/******************************************************************/ +/* Convert an UTF-8 string to latin characters. */ +/******************************************************************/ +int TDBJDBC::Decode(char *txt, char *buf, size_t n) +{ + uint dummy_errors; + uint32 len= copy_and_convert(buf, n, &my_charset_latin1, + txt, strlen(txt), + &my_charset_utf8_general_ci, + &dummy_errors); + buf[len]= '\0'; + return 0; +} // end of Decode + +/***********************************************************************/ +/* MakeSQL: make the SQL statement use with JDBC connection. */ +/* TODO: when implementing EOM filtering, column only used in local */ +/* filter should be removed from column list. */ +/***********************************************************************/ +bool TDBJDBC::MakeSQL(PGLOBAL g, bool cnt) +{ + char *schmp = NULL, *catp = NULL, buf[NAM_LEN * 3]; + int len; + bool oom = false, first = true; + PTABLE tablep = To_Table; + PCOL colp; + + if (Srcdef) { + Query = new(g)STRING(g, 0, Srcdef); + return false; + } // endif Srcdef + + // Allocate the string used to contain the Query + Query = new(g)STRING(g, 1023, "SELECT "); + + if (!cnt) { + if (Columns) { + // Normal SQL statement to retrieve results + for (colp = Columns; colp; colp = colp->GetNext()) + if (!colp->IsSpecial()) { + if (!first) + oom |= Query->Append(", "); + else + first = false; + + // Column name can be encoded in UTF-8 + Decode(colp->GetName(), buf, sizeof(buf)); + + if (Quote) { + // Put column name between identifier quotes in case in contains blanks + oom |= Query->Append(Quote); + oom |= Query->Append(buf); + oom |= Query->Append(Quote); + } else + oom |= Query->Append(buf); + + ((PJDBCCOL)colp)->Rank = ++Ncol; + } // endif colp + + } else + // !Columns can occur for queries such that sql count(*) from... + // for which we will count the rows from sql * from... + oom |= Query->Append('*'); + + } else + // SQL statement used to retrieve the size of the result + oom |= Query->Append("count(*)"); + + oom |= Query->Append(" FROM "); + + if (Catalog && *Catalog) + catp = Catalog; + + if (tablep->GetSchema()) + schmp = (char*)tablep->GetSchema(); + else if (Schema && *Schema) + schmp = Schema; + + if (catp) { + oom |= Query->Append(catp); + + if (schmp) { + oom |= Query->Append('.'); + oom |= Query->Append(schmp); + } // endif schmp + + oom |= Query->Append('.'); + } else if (schmp) { + oom |= Query->Append(schmp); + oom |= Query->Append('.'); + } // endif schmp + + // Table name can be encoded in UTF-8 + Decode(TableName, buf, sizeof(buf)); + + if (Quote) { + // Put table name between identifier quotes in case in contains blanks + oom |= Query->Append(Quote); + oom |= Query->Append(buf); + oom |= Query->Append(Quote); + } else + oom |= Query->Append(buf); + + len = Query->GetLength(); + + if (To_CondFil) { + if (Mode == MODE_READ) { + oom |= Query->Append(" WHERE "); + oom |= Query->Append(To_CondFil->Body); + len = Query->GetLength() + 1; + } else + len += (strlen(To_CondFil->Body) + 256); + + } else + len += ((Mode == MODE_READX) ? 256 : 1); + + if (oom || Query->Resize(len)) { + strcpy(g->Message, "MakeSQL: Out of memory"); + return true; + } // endif oom + + if (trace) + htrc("Query=%s\n", Query->GetStr()); + + return false; +} // end of MakeSQL + +/***********************************************************************/ +/* MakeInsert: make the Insert statement used with JDBC connection. */ +/***********************************************************************/ +bool TDBJDBC::MakeInsert(PGLOBAL g) +{ + char *schmp = NULL, *catp = NULL, buf[NAM_LEN * 3]; + int len = 0; + uint pos; + bool b = false, oom = false; + PTABLE tablep = To_Table; + PCOL colp; + + for (colp = Columns; colp; colp = colp->GetNext()) + if (colp->IsSpecial()) { + strcpy(g->Message, "No JDBC special columns"); + return true; + } else { + // Column name can be encoded in UTF-8 + Decode(colp->GetName(), buf, sizeof(buf)); + len += (strlen(buf) + 6); // comma + quotes + valist + ((PJDBCCOL)colp)->Rank = ++Nparm; + } // endif colp + + // Below 32 is enough to contain the fixed part of the query + if (Catalog && *Catalog) + catp = Catalog; + + if (catp) + len += strlen(catp) + 1; + + if (tablep->GetSchema()) + schmp = (char*)tablep->GetSchema(); + else if (Schema && *Schema) + schmp = Schema; + + if (schmp) + len += strlen(schmp) + 1; + + // Table name can be encoded in UTF-8 + Decode(TableName, buf, sizeof(buf)); + len += (strlen(buf) + 32); + Query = new(g)STRING(g, len, "INSERT INTO "); + + if (catp) { + oom |= Query->Append(catp); + + if (schmp) { + oom |= Query->Append('.'); + oom |= Query->Append(schmp); + } // endif schmp + + oom |= Query->Append('.'); + } else if (schmp) { + oom |= Query->Append(schmp); + oom |= Query->Append('.'); + } // endif schmp + + if (Quote) { + // Put table name between identifier quotes in case in contains blanks + oom |= Query->Append(Quote); + oom |= Query->Append(buf); + oom |= Query->Append(Quote); + } else + oom |= Query->Append(buf); + + oom |= Query->Append('('); + + for (colp = Columns; colp; colp = colp->GetNext()) { + if (b) + oom |= Query->Append(", "); + else + b = true; + + // Column name can be in UTF-8 encoding + Decode(colp->GetName(), buf, sizeof(buf)); + + if (Quote) { + // Put column name between identifier quotes in case in contains blanks + oom |= Query->Append(Quote); + oom |= Query->Append(buf); + oom |= Query->Append(Quote); + } else + oom |= Query->Append(buf); + + } // endfor colp + + if ((oom |= Query->Append(") VALUES ("))) { + strcpy(g->Message, "MakeInsert: Out of memory"); + return true; + } else // in case prepared statement fails + pos = Query->GetLength(); + + // Make prepared statement + for (int i = 0; i < Nparm; i++) + oom |= Query->Append("?,"); + + if (oom) { + strcpy(g->Message, "MakeInsert: Out of memory"); + return true; + } else + Query->RepLast(')'); + + // Now see if we can use prepared statement + if (Jcp->PrepareSQL(Query->GetStr())) + Query->Truncate(pos); // Restore query to not prepared + else + Prepared = true; + + return false; +} // end of MakeInsert + +/***********************************************************************/ +/* JDBC Set Parameter function. */ +/***********************************************************************/ +bool TDBJDBC::SetParameters(PGLOBAL g) +{ + PJDBCCOL colp; + + for (colp = (PJDBCCOL)Columns; colp; colp = (PJDBCCOL)colp->Next) + if (Jcp->SetParam(colp)) + return true; + + return false; +} // end of SetParameters + +/***********************************************************************/ +/* MakeCommand: make the Update or Delete statement to send to the */ +/* MySQL server. Limited to remote values and filtering. */ +/***********************************************************************/ +bool TDBJDBC::MakeCommand(PGLOBAL g) +{ + char *p, *stmt, name[68], *body = NULL, *qc = Jcp->GetQuoteChar(); + char *qrystr = (char*)PlugSubAlloc(g, NULL, strlen(Qrystr) + 1); + bool qtd = Quoted > 0; + int i = 0, k = 0; + + // Make a lower case copy of the originale query and change + // back ticks to the data source identifier quoting character + do { + qrystr[i] = (Qrystr[i] == '`') ? *qc : tolower(Qrystr[i]); + } while (Qrystr[i++]); + + if (To_CondFil && (p = strstr(qrystr, " where "))) { + p[7] = 0; // Remove where clause + Qrystr[(p - qrystr) + 7] = 0; + body = To_CondFil->Body; + stmt = (char*)PlugSubAlloc(g, NULL, strlen(qrystr) + + strlen(body) + 64); + } else + stmt = (char*)PlugSubAlloc(g, NULL, strlen(Qrystr) + 64); + + // Check whether the table name is equal to a keyword + // If so, it must be quoted in the original query + strlwr(strcat(strcat(strcpy(name, " "), Name), " ")); + + if (!strstr(" update delete low_priority ignore quick from ", name)) + strlwr(strcpy(name, Name)); // Not a keyword + else + strlwr(strcat(strcat(strcpy(name, qc), Name), qc)); + + if ((p = strstr(qrystr, name))) { + for (i = 0; i < p - qrystr; i++) + stmt[i] = (Qrystr[i] == '`') ? *qc : Qrystr[i]; + + stmt[i] = 0; + k = i + (int)strlen(Name); + + if (qtd && *(p-1) == ' ') + strcat(strcat(strcat(stmt, qc), TableName), qc); + else + strcat(stmt, TableName); + + i = (int)strlen(stmt); + + do { + stmt[i++] = (Qrystr[k] == '`') ? *qc : Qrystr[k]; + } while (Qrystr[k++]); + + if (body) + strcat(stmt, body); + + } else { + sprintf(g->Message, "Cannot use this %s command", + (Mode == MODE_UPDATE) ? "UPDATE" : "DELETE"); + return NULL; + } // endif p + + Query = new(g)STRING(g, 0, stmt); + return (!Query->GetSize()); +} // end of MakeCommand + +/***********************************************************************/ +/* ResetSize: call by TDBMUL when calculating size estimate. */ +/***********************************************************************/ +void TDBJDBC::ResetSize(void) +{ + MaxSize = -1; + + if (Jcp && Jcp->IsOpen()) + Jcp->Close(); + +} // end of ResetSize + +/***********************************************************************/ +/* JDBC Cardinality: returns table size in number of rows. */ +/***********************************************************************/ +int TDBJDBC::Cardinality(PGLOBAL g) +{ + if (!g) + return (Mode == MODE_ANY && !Srcdef) ? 1 : 0; + +#if 0 + if (Cardinal < 0 && Mode == MODE_ANY && !Srcdef && ExactInfo()) { + // Info command, we must return the exact table row number + char qry[96], tbn[64]; + JDBConn *jcp = new(g)JDBConn(g, this); + + if (jcp->Open(&Ops) == RC_FX) + return -1; + + // Table name can be encoded in UTF-8 + Decode(TableName, tbn, sizeof(tbn)); + strcpy(qry, "SELECT COUNT(*) FROM "); + + if (Quote) + strcat(strcat(strcat(qry, Quote), tbn), Quote); + else + strcat(qry, tbn); + + // Allocate a Count(*) column (must not use the default constructor) + Cnp = new(g)JDBCCOL; + Cnp->InitValue(g); + + if ((Cardinal = jcp->GetResultSize(qry, Cnp)) < 0) + return -3; + + jcp->Close(); + } else +#endif // 0 + Cardinal = 10; // To make MariaDB happy + + return Cardinal; +} // end of Cardinality + +/***********************************************************************/ +/* JDBC GetMaxSize: returns table size estimate in number of lines. */ +/***********************************************************************/ +int TDBJDBC::GetMaxSize(PGLOBAL g) +{ + if (MaxSize < 0) { + if (Mode == MODE_DELETE) + // Return 0 in mode DELETE in case of delete all. + MaxSize = 0; + else if (!Cardinality(NULL)) + MaxSize = 10; // To make MySQL happy + else if ((MaxSize = Cardinality(g)) < 0) + MaxSize = 12; // So we can see an error occured + + } // endif MaxSize + + return MaxSize; +} // end of GetMaxSize + +/***********************************************************************/ +/* Return max size value. */ +/***********************************************************************/ +int TDBJDBC::GetProgMax(PGLOBAL g) +{ + return GetMaxSize(g); +} // end of GetProgMax + +/***********************************************************************/ +/* JDBC Access Method opening routine. */ +/* New method now that this routine is called recursively (last table */ +/* first in reverse order): index blocks are immediately linked to */ +/* join block of next table if it exists or else are discarted. */ +/***********************************************************************/ +bool TDBJDBC::OpenDB(PGLOBAL g) +{ + bool rc = true; + + if (trace) + htrc("JDBC OpenDB: tdbp=%p tdb=R%d use=%d mode=%d\n", + this, Tdb_No, Use, Mode); + + if (Use == USE_OPEN) { + /*******************************************************************/ + /* Table already open, just replace it at its beginning. */ + /*******************************************************************/ + if (Memory == 1) { + if ((Qrp = Jcp->AllocateResult(g))) + Memory = 2; // Must be filled + else + Memory = 0; // Allocation failed, don't use it + + } else if (Memory == 2) + Memory = 3; // Ok to use memory result + + if (Memory < 3) { + // Method will depend on cursor type + if ((Rbuf = Jcp->Rewind(Query->GetStr())) < 0) + if (Mode != MODE_READX) { + Jcp->Close(); + return true; + } else + Rbuf = 0; + + } else + Rbuf = Qrp->Nblin; + + CurNum = 0; + Fpos = 0; + Curpos = 1; + return false; + } // endif use + + /*********************************************************************/ + /* Open an JDBC connection for this table. */ + /* Note: this may not be the proper way to do. Perhaps it is better */ + /* to test whether a connection is already open for this datasource */ + /* and if so to allocate just a new result set. But this only for */ + /* drivers allowing concurency in getting results ??? */ + /*********************************************************************/ + if (!Jcp) + Jcp = new(g)JDBConn(g, this); + else if (Jcp->IsOpen()) + Jcp->Close(); + + if (Jcp->Open(&Ops) == RC_FX) + return true; + else if (Quoted) + Quote = Jcp->GetQuoteChar(); + + Use = USE_OPEN; // Do it now in case we are recursively called + + /*********************************************************************/ + /* Make the command and allocate whatever is used for getting results. */ + /*********************************************************************/ + if (Mode == MODE_READ || Mode == MODE_READX) { + if (Memory > 1 && !Srcdef) { + int n; + + if (!MakeSQL(g, true)) { + // Allocate a Count(*) column + Cnp = new(g)JDBCCOL; + Cnp->InitValue(g); + + if ((n = Jcp->GetResultSize(Query->GetStr(), Cnp)) < 0) { + sprintf(g->Message, "Cannot get result size rc=%d", n); + return true; + } else if (n) { + Jcp->m_Rows = n; + + if ((Qrp = Jcp->AllocateResult(g))) + Memory = 2; // Must be filled + else { + strcpy(g->Message, "Result set memory allocation failed"); + return true; + } // endif n + + } else // Void result + Memory = 0; + + Jcp->m_Rows = 0; + } else + return true; + + } // endif Memory + + if (!(rc = MakeSQL(g, false))) { +// for (PJDBCCOL colp = (PJDBCCOL)Columns; colp; colp = (PJDBCCOL)colp->GetNext()) +// if (!colp->IsSpecial()) +// colp->AllocateBuffers(g, Rows); + + rc = (Mode == MODE_READ) + ? (Jcp->ExecuteQuery(Query->GetStr()) != RC_OK) + : false; + } // endif rc + + } else if (Mode == MODE_INSERT) { +#if 0 + if (!(rc = MakeInsert(g))) { + if (Nparm != Jcp->PrepareSQL(Query->GetStr())) { + strcpy(g->Message, MSG(PARM_CNT_MISS)); + rc = true; + } else + rc = BindParameters(g); + + } // endif rc +#endif // 0 + rc = MakeInsert(g); + } else if (Mode == MODE_UPDATE || Mode == MODE_DELETE) { + rc = false; // wait for CheckCond before calling MakeCommand(g); + } else + sprintf(g->Message, "Invalid mode %d", Mode); + + if (rc) { + Jcp->Close(); + return true; + } // endif rc + + /*********************************************************************/ + /* Reset statistics values. */ + /*********************************************************************/ + num_read = num_there = num_eq[0] = num_eq[1] = 0; + return false; +} // end of OpenDB + +/***********************************************************************/ +/* GetRecpos: return the position of last read record. */ +/***********************************************************************/ +int TDBJDBC::GetRecpos(void) +{ + return Fpos; +} // end of GetRecpos + +/***********************************************************************/ +/* SetRecpos: set the position of next read record. */ +/***********************************************************************/ +bool TDBJDBC::SetRecpos(PGLOBAL g, int recpos) +{ + if (Jcp->m_Full) { + Fpos = 0; +// CurNum = 0; + CurNum = 1; + } else if (Memory == 3) { +// Fpos = recpos; +// CurNum = -1; + Fpos = 0; + CurNum = recpos; + } else if (Ops.Scrollable) { + // Is new position in the current row set? +// if (recpos >= Curpos && recpos < Curpos + Rbuf) { +// CurNum = recpos - Curpos; +// Fpos = 0; + if (recpos > 0 && recpos <= Rbuf) { + CurNum = recpos; + Fpos = recpos; + } else { + strcpy(g->Message, "Scrolling out of row set NIY"); + return true; + } // endif recpos + + } else { + strcpy(g->Message, "This action requires a scrollable cursor"); + return true; + } // endif's + + // Indicate the table position was externally set + Placed = true; + return false; +} // end of SetRecpos + +/***********************************************************************/ +/* Data Base indexed read routine for JDBC access method. */ +/***********************************************************************/ +bool TDBJDBC::ReadKey(PGLOBAL g, OPVAL op, const key_range *kr) +{ + char c = Quote ? *Quote : 0; + int rc, oldlen = Query->GetLength(); + PHC hc = To_Def->GetHandler(); + + if (!(kr || hc->end_range) || op == OP_NEXT || + Mode == MODE_UPDATE || Mode == MODE_DELETE) { + if (!kr && Mode == MODE_READX) { + // This is a false indexed read + rc = Jcp->ExecuteQuery((char*)Query->GetStr()); + Mode = MODE_READ; + Rows = 1; // ??? + return (rc != RC_OK); + } // endif key + + return false; + } else { + if (hc->MakeKeyWhere(g, Query, op, c, kr)) + return true; + + if (To_CondFil) { + if (To_CondFil->Idx != hc->active_index) { + To_CondFil->Idx = hc->active_index; + To_CondFil->Body= (char*)PlugSubAlloc(g, NULL, 0); + *To_CondFil->Body= 0; + + if ((To_CondFil = hc->CheckCond(g, To_CondFil, To_CondFil->Cond))) + PlugSubAlloc(g, NULL, strlen(To_CondFil->Body) + 1); + + } // endif active_index + + if (To_CondFil) + if (Query->Append(" AND ") || Query->Append(To_CondFil->Body)) { + strcpy(g->Message, "Readkey: Out of memory"); + return true; + } // endif Append + + } // endif To_Condfil + + Mode = MODE_READ; + } // endif's op + + if (trace) + htrc("JDBC ReadKey: Query=%s\n", Query->GetStr()); + + rc = Jcp->ExecuteQuery((char*)Query->GetStr()); + Query->Truncate(oldlen); + Rows = 1; // ??? + return (rc != RC_OK); +} // end of ReadKey + +/***********************************************************************/ +/* Data Base read routine for JDBC access method. */ +/***********************************************************************/ +int TDBJDBC::ReadDB(PGLOBAL g) +{ + int rc; + + if (trace > 1) + htrc("JDBC ReadDB: R%d Mode=%d key=%p link=%p Kindex=%p\n", + GetTdb_No(), Mode, To_Key_Col, To_Link, To_Kindex); + + if (Mode == MODE_UPDATE || Mode == MODE_DELETE) { + if (!Query && MakeCommand(g)) + return RC_FX; + + // Send the UPDATE/DELETE command to the remote table + rc = Jcp->ExecuteUpdate(Query->GetStr()); + + if (rc == RC_OK) { + AftRows = Jcp->m_Aff; + return RC_EF; // Nothing else to do + } else { + Werr = true; + return RC_FX; + } // endif rc + + } // endif Mode + + if (To_Kindex) { + // Direct access of JDBC tables is not implemented + strcpy(g->Message, "No JDBC direct access"); + return RC_FX; + } // endif To_Kindex + + /*********************************************************************/ + /* Now start the reading process. */ + /* Here is the place to fetch the line(s). */ + /*********************************************************************/ + if (Placed) { + if (Fpos && CurNum >= 0) + Rbuf = Jcp->Fetch((Curpos = Fpos)); + else + Fpos = CurNum; + + rc = (Rbuf > 0) ? RC_OK : (Rbuf == 0) ? RC_EF : RC_FX; + Placed = false; + } else { + if (Memory != 3) { + if (++CurNum >= Rbuf) { + Rbuf = Jcp->Fetch(); + Curpos = Fpos + 1; + CurNum = 0; + } // endif CurNum + + rc = (Rbuf > 0) ? RC_OK : (Rbuf == 0) ? RC_EF : RC_FX; + } else // Getting result from memory + rc = (Fpos < Qrp->Nblin) ? RC_OK : RC_EF; + + if (rc == RC_OK) { + if (Memory == 2) + Qrp->Nblin++; + + Fpos++; // Used for memory and pos + } // endif rc + + } // endif placed + + if (trace > 1) + htrc(" Read: Rbuf=%d rc=%d\n", Rbuf, rc); + + return rc; +} // end of ReadDB + +/***********************************************************************/ +/* Data Base Insert write routine for JDBC access method. */ +/***********************************************************************/ +int TDBJDBC::WriteDB(PGLOBAL g) +{ + int rc; + + if (Prepared) { + if (SetParameters(g)) { + Werr = true; + rc = RC_FX; + } else if ((rc = Jcp->ExecuteSQL()) == RC_OK) + AftRows += Jcp->m_Aff; + else + Werr = true; + + return rc; + } // endif Prepared + + // Statement was not prepared, we must construct and execute + // an insert query for each line to insert + uint len = Query->GetLength(); + char buf[64]; + bool oom = false; + + // Make the Insert command value list + for (PCOL colp = Columns; colp; colp = colp->GetNext()) { + if (!colp->GetValue()->IsNull()) { + char *s = colp->GetValue()->GetCharString(buf); + + if (colp->GetResultType() == TYPE_STRING) + oom |= Query->Append_quoted(s); + else if (colp->GetResultType() == TYPE_DATE) { + DTVAL *dtv = (DTVAL*)colp->GetValue(); + + if (dtv->IsFormatted()) + oom |= Query->Append_quoted(s); + else + oom |= Query->Append(s); + + } else + oom |= Query->Append(s); + + } else + oom |= Query->Append("NULL"); + + oom |= Query->Append(','); + } // endfor colp + + if (unlikely(oom)) { + strcpy(g->Message, "WriteDB: Out of memory"); + return RC_FX; + } // endif oom + + Query->RepLast(')'); + rc = Jcp->ExecuteUpdate(Query->GetStr()); + Query->Truncate(len); // Restore query + + if (rc == RC_OK) + AftRows += Jcp->m_Aff; + else + Werr = true; + + return rc; +} // end of WriteDB + +/***********************************************************************/ +/* Data Base delete line routine for JDBC access method. */ +/***********************************************************************/ +int TDBJDBC::DeleteDB(PGLOBAL g, int irc) +{ + if (irc == RC_FX) { + if (!Query && MakeCommand(g)) + return RC_FX; + + // Send the DELETE (all) command to the remote table + if (Jcp->ExecuteUpdate(Query->GetStr()) == RC_OK) { + AftRows = Jcp->m_Aff; + sprintf(g->Message, "%s: %d affected rows", TableName, AftRows); + + if (trace) + htrc("%s\n", g->Message); + + PushWarning(g, this, 0); // 0 means a Note + return RC_OK; // This is a delete all + } else + return RC_FX; // Error + + } else + return RC_OK; // Ignore + +} // end of DeleteDB + +/***********************************************************************/ +/* Data Base close routine for JDBC access method. */ +/***********************************************************************/ +void TDBJDBC::CloseDB(PGLOBAL g) +{ + //if (To_Kindex) { + // To_Kindex->Close(); + // To_Kindex = NULL; + // } // endif + + if (Jcp) + Jcp->Close(); + + if (trace) + htrc("JDBC CloseDB: closing %s\n", Name); + + if (!Werr && + (Mode == MODE_INSERT || Mode == MODE_UPDATE || Mode == MODE_DELETE)) { + sprintf(g->Message, "%s: %d affected rows", TableName, AftRows); + + if (trace) + htrc("%s\n", g->Message); + + PushWarning(g, this, 0); // 0 means a Note + } // endif Mode + + Prepared = false; +} // end of CloseDB + +/* --------------------------- JDBCCOL ------------------------------- */ + +/***********************************************************************/ +/* JDBCCOL public constructor. */ +/***********************************************************************/ +JDBCCOL::JDBCCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PSZ am) + : COLBLK(cdp, tdbp, i) +{ + if (cprec) { + Next = cprec->GetNext(); + cprec->SetNext(this); + } else { + Next = tdbp->GetColumns(); + tdbp->SetColumns(this); + } // endif cprec + + // Set additional JDBC access method information for column. + Crp = NULL; + //Long = cdp->GetLong(); + Long = Precision; + //strcpy(F_Date, cdp->F_Date); + To_Val = NULL; +//Slen = 0; +//StrLen = &Slen; +//Sqlbuf = NULL; + Bufp = NULL; + Blkp = NULL; + Rank = 0; // Not known yet + + if (trace) + htrc(" making new %sCOL C%d %s at %p\n", am, Index, Name, this); + +} // end of JDBCCOL constructor + +/***********************************************************************/ +/* JDBCCOL private constructor. */ +/***********************************************************************/ +JDBCCOL::JDBCCOL(void) : COLBLK() +{ + Crp = NULL; + Buf_Type = TYPE_INT; // This is a count(*) column + // Set additional Dos access method information for column. + Long = sizeof(int); + To_Val = NULL; +//Slen = 0; +//StrLen = &Slen; +//Sqlbuf = NULL; + Bufp = NULL; + Blkp = NULL; + Rank = 1; +} // end of JDBCCOL constructor + +/***********************************************************************/ +/* JDBCCOL constructor used for copying columns. */ +/* tdbp is the pointer to the new table descriptor. */ +/***********************************************************************/ +JDBCCOL::JDBCCOL(JDBCCOL *col1, PTDB tdbp) : COLBLK(col1, tdbp) +{ + Crp = col1->Crp; + Long = col1->Long; + //strcpy(F_Date, col1->F_Date); + To_Val = col1->To_Val; +//Slen = col1->Slen; +//StrLen = col1->StrLen; +//Sqlbuf = col1->Sqlbuf; + Bufp = col1->Bufp; + Blkp = col1->Blkp; + Rank = col1->Rank; +} // end of JDBCCOL copy constructor + +/***********************************************************************/ +/* SetBuffer: prepare a column block for write operation. */ +/***********************************************************************/ +bool JDBCCOL::SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check) +{ + if (!(To_Val = value)) { + sprintf(g->Message, MSG(VALUE_ERROR), Name); + return true; + } else if (Buf_Type == value->GetType()) { + // Values are of the (good) column type + if (Buf_Type == TYPE_DATE) { + // If any of the date values is formatted + // output format must be set for the receiving table + if (GetDomain() || ((DTVAL *)value)->IsFormatted()) + goto newval; // This will make a new value; + + } else if (Buf_Type == TYPE_DOUBLE) + // Float values must be written with the correct (column) precision + // Note: maybe this should be forced by ShowValue instead of this ? + value->SetPrec(GetScale()); + + Value = value; // Directly access the external value + } else { + // Values are not of the (good) column type + if (check) { + sprintf(g->Message, MSG(TYPE_VALUE_ERR), Name, + GetTypeName(Buf_Type), GetTypeName(value->GetType())); + return true; + } // endif check + + newval: + if (InitValue(g)) // Allocate the matching value block + return true; + + } // endif's Value, Buf_Type + + // Because Colblk's have been made from a copy of the original TDB in + // case of Update, we must reset them to point to the original one. + if (To_Tdb->GetOrig()) + To_Tdb = (PTDB)To_Tdb->GetOrig(); + + // Set the Column + Status = (ok) ? BUF_EMPTY : BUF_NO; + return false; +} // end of SetBuffer + +/***********************************************************************/ +/* ReadColumn: when SQLFetch is used there is nothing to do as the */ +/* column buffer was bind to the record set. This is also the case */ +/* when calculating MaxSize (Bufp is NULL even when Rows is not). */ +/***********************************************************************/ +void JDBCCOL::ReadColumn(PGLOBAL g) +{ + PTDBJDBC tdbp = (PTDBJDBC)To_Tdb; + int i = tdbp->Fpos - 1, n = tdbp->CurNum; + + if (tdbp->Memory == 3) { + // Get the value from the stored memory + if (Crp->Nulls && Crp->Nulls[i] == '*') { + Value->Reset(); + Value->SetNull(true); + } else { + Value->SetValue_pvblk(Crp->Kdata, i); + Value->SetNull(false); + } // endif Nulls + + return; + } // endif Memory + + /*********************************************************************/ + /* Get the column value. */ + /*********************************************************************/ + tdbp->Jcp->SetColumnValue(Rank, Name, Value); + + if (tdbp->Memory != 2) + return; + + /*********************************************************************/ + /* Fill the allocated result structure. */ + /*********************************************************************/ + if (Value->IsNull()) { + if (Crp->Nulls) + Crp->Nulls[i] = '*'; // Null value + + Crp->Kdata->Reset(i); + } else + Crp->Kdata->SetValue(Value, i); + +} // end of ReadColumn + +#if 0 +/***********************************************************************/ +/* AllocateBuffers: allocate the extended buffer for SQLExtendedFetch */ +/* or Fetch. Note: we use Long+1 here because JDBC must have space */ +/* for the ending null character. */ +/***********************************************************************/ +void JDBCCOL::AllocateBuffers(PGLOBAL g, int rows) +{ + if (Buf_Type == TYPE_DATE) + Sqlbuf = (TIMESTAMP_STRUCT*)PlugSubAlloc(g, NULL, + sizeof(TIMESTAMP_STRUCT)); + + if (!rows) + return; + + if (Buf_Type == TYPE_DATE) + Bufp = PlugSubAlloc(g, NULL, rows * sizeof(TIMESTAMP_STRUCT)); + else { + Blkp = AllocValBlock(g, NULL, Buf_Type, rows, GetBuflen(), + GetScale(), true, false, false); + Bufp = Blkp->GetValPointer(); + } // endelse + + if (rows > 1) + StrLen = (SQLLEN *)PlugSubAlloc(g, NULL, rows * sizeof(SQLLEN)); + +} // end of AllocateBuffers + +/***********************************************************************/ +/* Returns the buffer to use for Fetch or Extended Fetch. */ +/***********************************************************************/ +void *JDBCCOL::GetBuffer(DWORD rows) +{ + if (rows && To_Tdb) { + assert(rows == (DWORD)((TDBJDBC*)To_Tdb)->Rows); + return Bufp; + } else + return (Buf_Type == TYPE_DATE) ? Sqlbuf : Value->GetTo_Val(); + +} // end of GetBuffer + +/***********************************************************************/ +/* Returns the buffer length to use for Fetch or Extended Fetch. */ +/***********************************************************************/ +SWORD JDBCCOL::GetBuflen(void) +{ + SWORD flen; + + switch (Buf_Type) { + case TYPE_DATE: + flen = (SWORD)sizeof(TIMESTAMP_STRUCT); + break; + case TYPE_STRING: + case TYPE_DECIM: + flen = (SWORD)Value->GetClen() + 1; + break; + default: + flen = (SWORD)Value->GetClen(); + } // endswitch Buf_Type + + return flen; +} // end of GetBuflen +#endif // 0 + +/***********************************************************************/ +/* WriteColumn: make sure the bind buffer is updated. */ +/***********************************************************************/ +void JDBCCOL::WriteColumn(PGLOBAL g) +{ + /*********************************************************************/ + /* Do convert the column value if necessary. */ + /*********************************************************************/ + if (Value != To_Val) + Value->SetValue_pval(To_Val, FALSE); // Convert the inserted value + +#if 0 + if (Buf_Type == TYPE_DATE) { + struct tm tm, *dbtime = ((DTVAL*)Value)->GetGmTime(&tm); + + Sqlbuf->second = dbtime->tm_sec; + Sqlbuf->minute = dbtime->tm_min; + Sqlbuf->hour = dbtime->tm_hour; + Sqlbuf->day = dbtime->tm_mday; + Sqlbuf->month = dbtime->tm_mon + 1; + Sqlbuf->year = dbtime->tm_year + 1900; + Sqlbuf->fraction = 0; + } else if (Buf_Type == TYPE_DECIM) { + // Some data sources require local decimal separator + char *p, sep = ((PTDBJDBC)To_Tdb)->Sep; + + if (sep && (p = strchr(Value->GetCharValue(), '.'))) + *p = sep; + + } // endif Buf_Type + + if (Nullable) + *StrLen = (Value->IsNull()) ? SQL_NULL_DATA : + (IsTypeChar(Buf_Type)) ? SQL_NTS : 0; +#endif // 0 +} // end of WriteColumn + +/* -------------------------- Class TDBXJDC -------------------------- */ + +/***********************************************************************/ +/* Implementation of the TDBXJDC class. */ +/***********************************************************************/ +TDBXJDC::TDBXJDC(PJDBCDEF tdp) : TDBJDBC(tdp) +{ + Cmdlist = NULL; + Cmdcol = NULL; + Mxr = tdp->Maxerr; + Nerr = 0; +} // end of TDBXJDC constructor + +/***********************************************************************/ +/* Allocate XSRC column description block. */ +/***********************************************************************/ +PCOL TDBXJDC::MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n) +{ + PJSRCCOL colp = new(g)JSRCCOL(cdp, this, cprec, n); + + if (!colp->Flag) + Cmdcol = colp->GetName(); + + return colp; +} // end of MakeCol + +/***********************************************************************/ +/* MakeCMD: make the SQL statement to send to JDBC connection. */ +/***********************************************************************/ +PCMD TDBXJDC::MakeCMD(PGLOBAL g) +{ + PCMD xcmd = NULL; + + if (To_CondFil) { + if (Cmdcol) { + if (!stricmp(Cmdcol, To_CondFil->Body) && + (To_CondFil->Op == OP_EQ || To_CondFil->Op == OP_IN)) { + xcmd = To_CondFil->Cmds; + } else + strcpy(g->Message, "Invalid command specification filter"); + + } else + strcpy(g->Message, "No command column in select list"); + + } else if (!Srcdef) + strcpy(g->Message, "No Srcdef default command"); + else + xcmd = new(g) CMD(g, Srcdef); + + return xcmd; +} // end of MakeCMD + +#if 0 +/***********************************************************************/ +/* JDBC Bind Parameter function. */ +/***********************************************************************/ +bool TDBXJDC::BindParameters(PGLOBAL g) +{ + PJDBCCOL colp; + + for (colp = (PJDBCCOL)Columns; colp; colp = (PJDBCCOL)colp->Next) { + colp->AllocateBuffers(g, 0); + + if (Jcp->BindParam(colp)) + return true; + + } // endfor colp + + return false; +} // end of BindParameters +#endif // 0 + +/***********************************************************************/ +/* XDBC GetMaxSize: returns table size (not always one row). */ +/***********************************************************************/ +int TDBXJDC::GetMaxSize(PGLOBAL g) +{ + if (MaxSize < 0) + MaxSize = 2; // Just a guess + + return MaxSize; +} // end of GetMaxSize + +/***********************************************************************/ +/* JDBC Access Method opening routine. */ +/* New method now that this routine is called recursively (last table */ +/* first in reverse order): index blocks are immediately linked to */ +/* join block of next table if it exists or else are discarted. */ +/***********************************************************************/ +bool TDBXJDC::OpenDB(PGLOBAL g) +{ + bool rc = false; + + if (trace) + htrc("JDBC OpenDB: tdbp=%p tdb=R%d use=%d mode=%d\n", + this, Tdb_No, Use, Mode); + + if (Use == USE_OPEN) { + strcpy(g->Message, "Multiple execution is not allowed"); + return true; + } // endif use + + /*********************************************************************/ + /* Open an JDBC connection for this table. */ + /* Note: this may not be the proper way to do. Perhaps it is better */ + /* to test whether a connection is already open for this datasource */ + /* and if so to allocate just a new result set. But this only for */ + /* drivers allowing concurency in getting results ??? */ + /*********************************************************************/ + if (!Jcp) { + Jcp = new(g) JDBConn(g, this); + } else if (Jcp->IsOpen()) + Jcp->Close(); + + if (Jcp->Open(&Ops) == RC_FX) + return true; + + Use = USE_OPEN; // Do it now in case we are recursively called + + if (Mode != MODE_READ && Mode != MODE_READX) { + strcpy(g->Message, "No INSERT/DELETE/UPDATE of XJDBC tables"); + return true; + } // endif Mode + + /*********************************************************************/ + /* Get the command to execute. */ + /*********************************************************************/ + if (!(Cmdlist = MakeCMD(g))) { + Jcp->Close(); + return true; + } // endif Query + + Rows = 1; + return false; +} // end of OpenDB + +/***********************************************************************/ +/* ReadDB: Data Base read routine for xdbc access method. */ +/***********************************************************************/ +int TDBXJDC::ReadDB(PGLOBAL g) +{ + if (Cmdlist) { + int rc; + + if (!Query) + Query = new(g) STRING(g, 0, Cmdlist->Cmd); + else + Query->Set(Cmdlist->Cmd); + + if ((rc = Jcp->ExecSQLcommand(Query->GetStr())) == RC_FX) + Nerr++; + + if (rc == RC_NF) + AftRows = Jcp->m_Aff; + else if (rc == RC_OK) + AftRows = Jcp->m_Ncol; + + Fpos++; // Used for progress info + Cmdlist = (Nerr > Mxr) ? NULL : Cmdlist->Next; + return RC_OK; + } else + return RC_EF; + +} // end of ReadDB + +/***********************************************************************/ +/* Data Base write line routine for JDBC access method. */ +/***********************************************************************/ +int TDBXJDC::WriteDB(PGLOBAL g) +{ + strcpy(g->Message, "Execsrc tables are read only"); + return RC_FX; +} // end of DeleteDB + +/***********************************************************************/ +/* Data Base delete line routine for JDBC access method. */ +/***********************************************************************/ +int TDBXJDC::DeleteDB(PGLOBAL g, int irc) +{ + strcpy(g->Message, "NO_XJDBC_DELETE"); + return RC_FX; +} // end of DeleteDB + +/* --------------------------- JSRCCOL ------------------------------- */ + +/***********************************************************************/ +/* JSRCCOL public constructor. */ +/***********************************************************************/ +JSRCCOL::JSRCCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PSZ am) + : JDBCCOL(cdp, tdbp, cprec, i, am) +{ + // Set additional JDBC access method information for column. + Flag = cdp->GetOffset(); +} // end of JSRCCOL constructor + +/***********************************************************************/ +/* ReadColumn: set column value according to Flag. */ +/***********************************************************************/ +void JSRCCOL::ReadColumn(PGLOBAL g) +{ + PTDBXJDC tdbp = (PTDBXJDC)To_Tdb; + + switch (Flag) { + case 0: Value->SetValue_psz(tdbp->Query->GetStr()); break; + case 1: Value->SetValue(tdbp->AftRows); break; + case 2: Value->SetValue_psz(g->Message); break; + default: Value->SetValue_psz("Invalid Flag"); break; + } // endswitch Flag + +} // end of ReadColumn + +/***********************************************************************/ +/* WriteColumn: Should never be called. */ +/***********************************************************************/ +void JSRCCOL::WriteColumn(PGLOBAL g) +{ + // Should never be called +} // end of WriteColumn + +/* ---------------------------TDBJDRV class -------------------------- */ + +/***********************************************************************/ +/* GetResult: Get the list of JDBC drivers. */ +/***********************************************************************/ +PQRYRES TDBJDRV::GetResult(PGLOBAL g) +{ + return JDBCDrivers(g, Maxres, false); +} // end of GetResult + +/* ---------------------------TDBJTB class --------------------------- */ + +/***********************************************************************/ +/* TDBJTB class constructor. */ +/***********************************************************************/ +TDBJTB::TDBJTB(PJDBCDEF tdp) : TDBJDRV(tdp) +{ + Schema = tdp->Tabschema; + Tab = tdp->Tabname; + Tabtype = tdp->Tabtype; + Ops.Driver = tdp->Driver; + Ops.Url = tdp->Url; + Ops.User = tdp->Username; + Ops.Pwd = tdp->Password; + Ops.Fsize = 0; + Ops.Scrollable = false; +} // end of TDBJTB constructor + +/***********************************************************************/ +/* GetResult: Get the list of JDBC tables. */ +/***********************************************************************/ +PQRYRES TDBJTB::GetResult(PGLOBAL g) +{ + return JDBCTables(g, Schema, Tab, Tabtype, Maxres, false, &Ops); +} // end of GetResult + +/* --------------------------TDBJDBCL class -------------------------- */ + +/***********************************************************************/ +/* TDBJDBCL class constructor. */ +/***********************************************************************/ +TDBJDBCL::TDBJDBCL(PJDBCDEF tdp) : TDBJTB(tdp) +{ + Colpat = tdp->Colpat; +} // end of TDBJDBCL constructor + +/***********************************************************************/ +/* GetResult: Get the list of JDBC table columns. */ +/***********************************************************************/ +PQRYRES TDBJDBCL::GetResult(PGLOBAL g) +{ + return JDBCColumns(g, Schema, Tab, Colpat, Maxres, false, &Ops); +} // end of GetResult + +#if 0 +/* ---------------------------TDBJSRC class -------------------------- */ + +/***********************************************************************/ +/* GetResult: Get the list of JDBC data sources. */ +/***********************************************************************/ +PQRYRES TDBJSRC::GetResult(PGLOBAL g) +{ + return JDBCDataSources(g, Maxres, false); +} // end of GetResult + +/* ------------------------ End of TabJDBC --------------------------- */ +#endif // 0 diff --git a/storage/connect/tabjdbc.h b/storage/connect/tabjdbc.h new file mode 100644 index 00000000000..cf5e662c9d1 --- /dev/null +++ b/storage/connect/tabjdbc.h @@ -0,0 +1,349 @@ +/*************** Tabjdbc H Declares Source Code File (.H) **************/ +/* Name: TABJDBC.H Version 1.0 */ +/* */ +/* (C) Copyright to the author Olivier BERTRAND 2016 */ +/* */ +/* This file contains the TDBJDBC classes declares. */ +/***********************************************************************/ +#include "colblk.h" +#include "resource.h" +#include "jdbccat.h" + +typedef class JDBCDEF *PJDBCDEF; +typedef class TDBJDBC *PTDBJDBC; +typedef class JDBCCOL *PJDBCCOL; +typedef class TDBXJDC *PTDBXJDC; +typedef class JSRCCOL *PJSRCCOL; +//typedef class TDBOIF *PTDBOIF; +//typedef class OIFCOL *POIFCOL; +//typedef class TDBJSRC *PTDBJSRC; + +/***********************************************************************/ +/* JDBC table. */ +/***********************************************************************/ +class DllExport JDBCDEF : public TABDEF { /* Logical table description */ + friend class TDBJDBC; + friend class TDBXJDC; + friend class TDBJDRV; + friend class TDBJTB; + friend class TDBJDBCL; +public: + // Constructor + JDBCDEF(void); + + // Implementation + virtual const char *GetType(void) { return "JDBC"; } + PSZ GetTabname(void) { return Tabname; } + PSZ GetTabschema(void) { return Tabschema; } + PSZ GetTabcat(void) { return Tabcat; } + PSZ GetSrcdef(void) { return Srcdef; } + char GetSep(void) { return (Sep) ? *Sep : 0; } + int GetQuoted(void) { return Quoted; } +//int GetCatver(void) { return Catver; } + int GetOptions(void) { return Options; } + + // Methods + virtual int Indexable(void) { return 2; } + virtual bool DefineAM(PGLOBAL g, LPCSTR am, int poff); + virtual PTDB GetTable(PGLOBAL g, MODE m); + int ParseURL(PGLOBAL g, char *url, bool b = true); + bool SetParms(PJPARM sjp); + +protected: + // Members + PSZ Driver; /* JDBC driver */ + PSZ Url; /* JDBC driver URL */ + PSZ Tabname; /* External table name */ + PSZ Tabschema; /* External table schema */ + PSZ Username; /* User connect name */ + PSZ Password; /* Password connect info */ + PSZ Tabcat; /* External table catalog */ + PSZ Tabtype; /* External table type */ + PSZ Colpat; /* Catalog column pattern */ + PSZ Srcdef; /* The source table SQL definition */ + PSZ Qchar; /* Identifier quoting character */ + PSZ Qrystr; /* The original query */ + PSZ Sep; /* Decimal separator */ + int Options; /* Open connection options */ +//int Cto; /* Open connection timeout */ +//int Qto; /* Query (command) timeout */ + int Quoted; /* Identifier quoting level */ + int Maxerr; /* Maxerr for an Exec table */ + int Maxres; /* Maxres for a catalog table */ + int Memory; /* Put result set in memory */ + bool Scrollable; /* Use scrollable cursor */ + bool Xsrc; /* Execution type */ +}; // end of JDBCDEF + +#if !defined(NJDBC) +#include "jdbconn.h" + +/***********************************************************************/ +/* This is the JDBC Access Method class declaration for files from */ +/* other DB drivers to be accessed via JDBC. */ +/***********************************************************************/ +class TDBJDBC : public TDBASE { + friend class JDBCCOL; + friend class JDBConn; +public: + // Constructor + TDBJDBC(PJDBCDEF tdp = NULL); + TDBJDBC(PTDBJDBC tdbp); + + // Implementation + virtual AMT GetAmType(void) { return TYPE_AM_JDBC; } + virtual PTDB Duplicate(PGLOBAL g) { return (PTDB)new(g)TDBJDBC(this); } + + // Methods + virtual PTDB CopyOne(PTABS t); + virtual int GetRecpos(void); + virtual bool SetRecpos(PGLOBAL g, int recpos); +//virtual PSZ GetFile(PGLOBAL g); +//virtual void SetFile(PGLOBAL g, PSZ fn); + virtual void ResetSize(void); + //virtual int GetAffectedRows(void) {return AftRows;} + virtual PSZ GetServer(void) { return "JDBC"; } + virtual int Indexable(void) { return 2; } + + // Database routines + virtual PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n); + virtual int Cardinality(PGLOBAL g); + virtual int GetMaxSize(PGLOBAL g); + virtual int GetProgMax(PGLOBAL g); + virtual bool OpenDB(PGLOBAL g); + virtual int ReadDB(PGLOBAL g); + virtual int WriteDB(PGLOBAL g); + virtual int DeleteDB(PGLOBAL g, int irc); + virtual void CloseDB(PGLOBAL g); + virtual bool ReadKey(PGLOBAL g, OPVAL op, const key_range *kr); + +protected: + // Internal functions + int Decode(char *utf, char *buf, size_t n); + bool MakeSQL(PGLOBAL g, bool cnt); + bool MakeInsert(PGLOBAL g); + bool MakeCommand(PGLOBAL g); + //bool MakeFilter(PGLOBAL g, bool c); + bool SetParameters(PGLOBAL g); + //char *MakeUpdate(PGLOBAL g); + //char *MakeDelete(PGLOBAL g); + + // Members + JDBConn *Jcp; // Points to a JDBC connection class + JDBCCOL *Cnp; // Points to count(*) column + JDBCPARM Ops; // Additional parameters + PSTRG Query; // Constructed SQL query + char *TableName; // Points to JDBC table name + char *Schema; // Points to JDBC table Schema + char *User; // User connect info + char *Pwd; // Password connect info + char *Catalog; // Points to JDBC table Catalog + char *Srcdef; // The source table SQL definition + char *Count; // Points to count(*) SQL statement +//char *Where; // Points to local where clause + char *Quote; // The identifier quoting character + char *MulConn; // Used for multiple JDBC tables + char *DBQ; // The address part of Connect string + char *Qrystr; // The original query + char Sep; // The decimal separator + int Options; // Connect options +//int Cto; // Connect timeout +//int Qto; // Query timeout + int Quoted; // The identifier quoting level + int Fpos; // Position of last read record + int Curpos; // Cursor position of last fetch + int AftRows; // The number of affected rows + int Rows; // Rowset size + int CurNum; // Current buffer line number + int Rbuf; // Number of lines read in buffer + int BufSize; // Size of connect string buffer + int Ncol; // The column number + int Nparm; // The number of statement parameters + int Memory; // 0: No 1: Alloc 2: Put 3: Get +//bool Scrollable; // Use scrollable cursor --> in Ops + bool Placed; // True for position reading + bool Prepared; // True when using prepared statement + bool Werr; // Write error + bool Rerr; // Rewind error + PQRYRES Qrp; // Points to storage result +}; // end of class TDBJDBC + +/***********************************************************************/ +/* Class JDBCCOL: JDBC access method column descriptor. */ +/* This A.M. is used for JDBC tables. */ +/***********************************************************************/ +class JDBCCOL : public COLBLK { + friend class TDBJDBC; +public: + // Constructors + JDBCCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PSZ am = "JDBC"); + JDBCCOL(JDBCCOL *colp, PTDB tdbp); // Constructor used in copy process + + // Implementation + virtual int GetAmType(void) { return TYPE_AM_JDBC; } +//SQLLEN *GetStrLen(void) { return StrLen; } + int GetRank(void) { return Rank; } +//PVBLK GetBlkp(void) {return Blkp;} + void SetCrp(PCOLRES crp) { Crp = crp; } + + // Methods + virtual bool SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check); + virtual void ReadColumn(PGLOBAL g); + virtual void WriteColumn(PGLOBAL g); +//void AllocateBuffers(PGLOBAL g, int rows); +//void *GetBuffer(DWORD rows); +//SWORD GetBuflen(void); + // void Print(PGLOBAL g, FILE *, uint); + +protected: + // Constructor used by GetMaxSize + JDBCCOL(void); + + // Members + //TIMESTAMP_STRUCT *Sqlbuf; // To get SQL_TIMESTAMP's + PCOLRES Crp; // To storage result + void *Bufp; // To extended buffer + PVBLK Blkp; // To Value Block + //char F_Date[12]; // Internal Date format + PVAL To_Val; // To value used for Insert +//SQLLEN *StrLen; // As returned by JDBC +//SQLLEN Slen; // Used with Fetch + int Rank; // Rank (position) number in the query +}; // end of class JDBCCOL + +/***********************************************************************/ +/* This is the JDBC Access Method class declaration that send */ +/* commands to be executed by other DB JDBC drivers. */ +/***********************************************************************/ +class TDBXJDC : public TDBJDBC { + friend class JSRCCOL; + friend class JDBConn; +public: + // Constructors + TDBXJDC(PJDBCDEF tdp = NULL); + + // Implementation + virtual AMT GetAmType(void) {return TYPE_AM_XDBC;} + + // Methods + //virtual int GetRecpos(void); + //virtual PSZ GetFile(PGLOBAL g); + //virtual void SetFile(PGLOBAL g, PSZ fn); + //virtual void ResetSize(void); + //virtual int GetAffectedRows(void) {return AftRows;} + //virtual PSZ GetServer(void) {return "JDBC";} + + // Database routines + virtual PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n); + //virtual int GetProgMax(PGLOBAL g); + virtual int GetMaxSize(PGLOBAL g); + virtual bool OpenDB(PGLOBAL g); + virtual int ReadDB(PGLOBAL g); + virtual int WriteDB(PGLOBAL g); + virtual int DeleteDB(PGLOBAL g, int irc); + //virtual void CloseDB(PGLOBAL g); + +protected: + // Internal functions + PCMD MakeCMD(PGLOBAL g); + //bool BindParameters(PGLOBAL g); + + // Members + PCMD Cmdlist; // The commands to execute + char *Cmdcol; // The name of the Xsrc command column + int Mxr; // Maximum errors before closing + int Nerr; // Number of errors so far +}; // end of class TDBXJDC + +/***********************************************************************/ +/* Used by table in source execute mode. */ +/***********************************************************************/ +class JSRCCOL : public JDBCCOL { + friend class TDBXJDC; +public: + // Constructors + JSRCCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PSZ am = "JDBC"); + + // Implementation + //virtual int GetAmType(void) {return TYPE_AM_JDBC;} + + // Methods + virtual void ReadColumn(PGLOBAL g); + virtual void WriteColumn(PGLOBAL g); + // void Print(PGLOBAL g, FILE *, uint); + +protected: + // Members + char *Buffer; // To get returned message + int Flag; // Column content desc +}; // end of class JSRCCOL + +/***********************************************************************/ +/* This is the class declaration for the Drivers catalog table. */ +/***********************************************************************/ +class TDBJDRV : public TDBCAT { +public: + // Constructor + TDBJDRV(PJDBCDEF tdp) : TDBCAT(tdp) {Maxres = tdp->Maxres;} + +protected: + // Specific routines + virtual PQRYRES GetResult(PGLOBAL g); + + // Members + int Maxres; // Returned lines limit +}; // end of class TDBJDRV + +/***********************************************************************/ +/* This is the class declaration for the tables catalog table. */ +/***********************************************************************/ +class TDBJTB : public TDBJDRV { +public: + // Constructor + TDBJTB(PJDBCDEF tdp); + +protected: + // Specific routines + virtual PQRYRES GetResult(PGLOBAL g); + + // Members + char *Schema; // Points to schema name or NULL + char *Tab; // Points to JDBC table name or pattern + char *Tabtype; // Points to JDBC table type + JDBCPARM Ops; // Additional parameters +}; // end of class TDBJTB + +/***********************************************************************/ +/* This is the class declaration for the columns catalog table. */ +/***********************************************************************/ +class TDBJDBCL : public TDBJTB { +public: + // Constructor + TDBJDBCL(PJDBCDEF tdp); + +protected: + // Specific routines + virtual PQRYRES GetResult(PGLOBAL g); + + // Members + char *Colpat; // Points to catalog column pattern +}; // end of class TDBJDBCL + +#if 0 +/***********************************************************************/ +/* This is the class declaration for the Data Sources catalog table. */ +/***********************************************************************/ +class TDBJSRC : public TDBJDRV { +public: + // Constructor + TDBJSRC(PJDBCDEF tdp) : TDBJDRV(tdp) {} + +protected: + // Specific routines + virtual PQRYRES GetResult(PGLOBAL g); + + // No additional Members +}; // end of class TDBJSRC +#endif // 0 + +#endif // !NJDBC diff --git a/storage/connect/tabmysql.cpp b/storage/connect/tabmysql.cpp index 47497f465e3..98a476bf94f 100644 --- a/storage/connect/tabmysql.cpp +++ b/storage/connect/tabmysql.cpp @@ -19,7 +19,7 @@ /* --------------- */ /* TABMYSQL.CPP - Source code */ /* PLGDBSEM.H - DB application declaration file */ -/* TABMYSQL.H - TABODBC classes declaration file */ +/* TABMYSQL.H - TABMYSQL classes declaration file */ /* GLOBAL.H - Global declaration file */ /* */ /* REQUIRED LIBRARIES: */ @@ -857,7 +857,9 @@ bool TDBMYSQL::OpenDB(PGLOBAL g) /*******************************************************************/ /* Table already open, just replace it at its beginning. */ /*******************************************************************/ - Myc.Rewind(); + if (Myc.Rewind(g, (Mode == MODE_READX) ? Query->GetStr() : NULL) != RC_OK) + return true; + N = -1; return false; } // endif use diff --git a/storage/connect/tabodbc.cpp b/storage/connect/tabodbc.cpp index c555f2a5abb..e76d9c46bd3 100644 --- a/storage/connect/tabodbc.cpp +++ b/storage/connect/tabodbc.cpp @@ -1,7 +1,7 @@ /************* Tabodbc C++ Program Source Code File (.CPP) *************/ /* PROGRAM NAME: TABODBC */ /* ------------- */ -/* Version 3.0 */ +/* Version 3.1 */ /* */ /* COPYRIGHT: */ /* ---------- */ @@ -96,9 +96,9 @@ bool ExactInfo(void); ODBCDEF::ODBCDEF(void) { Connect = Tabname = Tabschema = Username = Password = NULL; - Tabcat = Srcdef = Qchar = Qrystr = Sep = NULL; - Catver = Options = Cto = Qto = Quoted = Maxerr = Maxres = 0; - Scrollable = Memory = Xsrc = UseCnc = false; + Tabcat = Colpat = Srcdef = Qchar = Qrystr = Sep = NULL; + Catver = Options = Cto = Qto = Quoted = Maxerr = Maxres = Memory = 0; + Scrollable = Xsrc = UseCnc = false; } // end of ODBCDEF constructor /***********************************************************************/ @@ -120,7 +120,7 @@ bool ODBCDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff) Tabschema = GetStringCatInfo(g, "Schema", Tabschema); Tabcat = GetStringCatInfo(g, "Qualifier", NULL); Tabcat = GetStringCatInfo(g, "Catalog", Tabcat); - Username = GetStringCatInfo(g, "User", NULL); + Username = GetStringCatInfo(g, "User", NULL); Password = GetStringCatInfo(g, "Password", NULL); if ((Srcdef = GetStringCatInfo(g, "Srcdef", NULL))) @@ -141,7 +141,13 @@ bool ODBCDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff) if ((Scrollable = GetBoolCatInfo("Scrollable", false)) && !Elemt) Elemt = 1; // Cannot merge SQLFetch and SQLExtendedFetch - UseCnc = GetBoolCatInfo("UseDSN", false); + if (Catfunc == FNC_COL) + Colpat = GetStringCatInfo(g, "Colpat", NULL); + + if (Catfunc == FNC_TABLE) + Tabtyp = GetStringCatInfo(g, "Tabtype", NULL); + + UseCnc = GetBoolCatInfo("UseDSN", false); // Memory was Boolean, it is now integer if (!(Memory = GetIntCatInfo("Memory", 0))) @@ -681,7 +687,7 @@ bool TDBODBC::MakeCommand(PGLOBAL g) } else { sprintf(g->Message, "Cannot use this %s command", (Mode == MODE_UPDATE) ? "UPDATE" : "DELETE"); - return NULL; + return false; } // endif p Query = new(g) STRING(g, 0, stmt); @@ -1009,7 +1015,7 @@ bool TDBODBC::SetRecpos(PGLOBAL g, int recpos) } // end of SetRecpos /***********************************************************************/ -/* Data Base indexed read routine for MYSQL access method. */ +/* Data Base indexed read routine for ODBC access method. */ /***********************************************************************/ bool TDBODBC::ReadKey(PGLOBAL g, OPVAL op, const key_range *kr) { @@ -1028,7 +1034,7 @@ bool TDBODBC::ReadKey(PGLOBAL g, OPVAL op, const key_range *kr) return false; } else { - if (To_Def->GetHandler()->MakeKeyWhere(g, Query, op, c, kr)) + if (hc->MakeKeyWhere(g, Query, op, c, kr)) return true; if (To_CondFil) { @@ -1768,6 +1774,7 @@ TDBOTB::TDBOTB(PODEF tdp) : TDBDRV(tdp) Dsn = tdp->GetConnect(); Schema = tdp->GetTabschema(); Tab = tdp->GetTabname(); + Tabtyp = tdp->Tabtyp; Ops.User = tdp->Username; Ops.Pwd = tdp->Password; Ops.Cto = tdp->Cto; @@ -1780,17 +1787,25 @@ TDBOTB::TDBOTB(PODEF tdp) : TDBDRV(tdp) /***********************************************************************/ PQRYRES TDBOTB::GetResult(PGLOBAL g) { - return ODBCTables(g, Dsn, Schema, Tab, Maxres, false, &Ops); + return ODBCTables(g, Dsn, Schema, Tab, Tabtyp, Maxres, false, &Ops); } // end of GetResult /* ---------------------------TDBOCL class --------------------------- */ +/***********************************************************************/ +/* TDBOCL class constructor. */ +/***********************************************************************/ +TDBOCL::TDBOCL(PODEF tdp) : TDBOTB(tdp) +{ + Colpat = tdp->Colpat; +} // end of TDBOTB constructor + /***********************************************************************/ /* GetResult: Get the list of ODBC table columns. */ /***********************************************************************/ PQRYRES TDBOCL::GetResult(PGLOBAL g) { - return ODBCColumns(g, Dsn, Schema, Tab, NULL, Maxres, false, &Ops); + return ODBCColumns(g, Dsn, Schema, Tab, Colpat, Maxres, false, &Ops); } // end of GetResult /* ------------------------ End of Tabodbc --------------------------- */ diff --git a/storage/connect/tabodbc.h b/storage/connect/tabodbc.h index 6440dee830d..aa6592d8abf 100644 --- a/storage/connect/tabodbc.h +++ b/storage/connect/tabodbc.h @@ -25,7 +25,8 @@ class DllExport ODBCDEF : public TABDEF { /* Logical table description */ friend class TDBXDBC; friend class TDBDRV; friend class TDBOTB; - public: + friend class TDBOCL; +public: // Constructor ODBCDEF(void); @@ -54,7 +55,9 @@ class DllExport ODBCDEF : public TABDEF { /* Logical table description */ PSZ Username; /* User connect name */ PSZ Password; /* Password connect info */ PSZ Tabcat; /* External table catalog */ - PSZ Srcdef; /* The source table SQL definition */ + PSZ Tabtyp; /* Catalog table type */ + PSZ Colpat; /* Catalog column pattern */ + PSZ Srcdef; /* The source table SQL definition */ PSZ Qchar; /* Identifier quoting character */ PSZ Qrystr; /* The original query */ PSZ Sep; /* Decimal separator */ @@ -326,7 +329,8 @@ class TDBOTB : public TDBDRV { char *Dsn; // Points to connection string char *Schema; // Points to schema name or NULL char *Tab; // Points to ODBC table name or pattern - ODBCPARM Ops; // Additional parameters + char *Tabtyp; // Points to ODBC table type + ODBCPARM Ops; // Additional parameters }; // end of class TDBOTB /***********************************************************************/ @@ -335,13 +339,14 @@ class TDBOTB : public TDBDRV { class TDBOCL : public TDBOTB { public: // Constructor - TDBOCL(PODEF tdp) : TDBOTB(tdp) {} + TDBOCL(PODEF tdp); protected: // Specific routines virtual PQRYRES GetResult(PGLOBAL g); - // No additional Members + // Members + char *Colpat; // Points to column pattern }; // end of class TDBOCL #endif // !NODBC diff --git a/storage/connect/tabtbl.cpp b/storage/connect/tabtbl.cpp index 36849146746..e3baf7c3da5 100644 --- a/storage/connect/tabtbl.cpp +++ b/storage/connect/tabtbl.cpp @@ -569,6 +569,9 @@ pthread_handler_t ThreadOpen(void *p) if (!my_thread_init()) { set_current_thd(cmp->Thd); + if (trace) + htrc("ThreadOpen: Thd=%d\n", cmp->Thd); + // Try to open the connection if (!cmp->Tap->GetTo_Tdb()->OpenDB(cmp->G)) { cmp->Ready = true; @@ -604,9 +607,14 @@ void TDBTBM::ResetDB(void) if (colp->GetAmType() == TYPE_AM_TABID) colp->COLBLK::Reset(); + // Local tables for (PTABLE tabp = Tablist; tabp; tabp = tabp->GetNext()) ((PTDBASE)tabp->GetTo_Tdb())->ResetDB(); + // Remote tables + for (PTBMT tp = Tmp; tp; tp = tp->Next) + ((PTDBASE)tp->Tap->GetTo_Tdb())->ResetDB(); + Tdbp = (Tablist) ? (PTDBASE)Tablist->GetTo_Tdb() : NULL; Crp = 0; } // end of ResetDB diff --git a/storage/connect/xindex.cpp b/storage/connect/xindex.cpp index a2d75cec8ab..69aa7e2c20e 100755 --- a/storage/connect/xindex.cpp +++ b/storage/connect/xindex.cpp @@ -1279,7 +1279,7 @@ bool XINDEX::MapInit(PGLOBAL g) IOFF *noff = (IOFF*)mbase; // Position the memory base at the offset of this index - mbase += noff[id].Low; + mbase += noff[id].v.Low; } // endif id // Now start the mapping process. @@ -2347,10 +2347,10 @@ bool XFILE::Open(PGLOBAL g, char *filename, int id, MODE mode) return true; } // endif - NewOff.Low = (int)ftell(Xfile); + NewOff.v.Low = (int)ftell(Xfile); if (trace) - htrc("XFILE Open: NewOff.Low=%d\n", NewOff.Low); + htrc("XFILE Open: NewOff.v.Low=%d\n", NewOff.v.Low); } else if (mode == MODE_WRITE) { if (id >= 0) { @@ -2358,10 +2358,10 @@ bool XFILE::Open(PGLOBAL g, char *filename, int id, MODE mode) memset(noff, 0, sizeof(noff)); Write(g, noff, sizeof(IOFF), MAX_INDX, rc); fseek(Xfile, 0, SEEK_END); - NewOff.Low = (int)ftell(Xfile); + NewOff.v.Low = (int)ftell(Xfile); if (trace) - htrc("XFILE Open: NewOff.Low=%d\n", NewOff.Low); + htrc("XFILE Open: NewOff.v.Low=%d\n", NewOff.v.Low); } // endif id @@ -2373,10 +2373,10 @@ bool XFILE::Open(PGLOBAL g, char *filename, int id, MODE mode) } // endif MAX_INDX if (trace) - htrc("XFILE Open: noff[%d].Low=%d\n", id, noff[id].Low); + htrc("XFILE Open: noff[%d].v.Low=%d\n", id, noff[id].v.Low); // Position the cursor at the offset of this index - if (fseek(Xfile, noff[id].Low, SEEK_SET)) { + if (fseek(Xfile, noff[id].v.Low, SEEK_SET)) { sprintf(g->Message, MSG(FUNC_ERRNO), errno, "Xseek"); return true; } // endif @@ -2566,14 +2566,14 @@ bool XHUGE::Open(PGLOBAL g, char *filename, int id, MODE mode) return true; } // endif - NewOff.Low = (int)rc; - NewOff.High = (int)high; + NewOff.v.Low = (int)rc; + NewOff.v.High = (int)high; } else if (mode == MODE_WRITE) { if (id >= 0) { // New not sep index file. Write the header. memset(noff, 0, sizeof(noff)); rc = WriteFile(Hfile, noff, sizeof(noff), &drc, NULL); - NewOff.Low = (int)drc; + NewOff.v.Low = (int)drc; } // endif id } else if (mode == MODE_READ && id >= 0) { @@ -2586,8 +2586,8 @@ bool XHUGE::Open(PGLOBAL g, char *filename, int id, MODE mode) } // endif rc // Position the cursor at the offset of this index - rc = SetFilePointer(Hfile, noff[id].Low, - (PLONG)&noff[id].High, FILE_BEGIN); + rc = SetFilePointer(Hfile, noff[id].v.Low, + (PLONG)&noff[id].v.High, FILE_BEGIN); if (rc == INVALID_SET_FILE_POINTER) { sprintf(g->Message, MSG(FUNC_ERRNO), GetLastError(), "SetFilePointer"); @@ -2649,7 +2649,7 @@ bool XHUGE::Open(PGLOBAL g, char *filename, int id, MODE mode) if (id >= 0) { // New not sep index file. Write the header. memset(noff, 0, sizeof(noff)); - NewOff.Low = write(Hfile, &noff, sizeof(noff)); + NewOff.v.Low = write(Hfile, &noff, sizeof(noff)); } // endif id if (trace) diff --git a/storage/connect/xindex.h b/storage/connect/xindex.h index 51b678992ea..ef2e934e5ee 100644 --- a/storage/connect/xindex.h +++ b/storage/connect/xindex.h @@ -66,9 +66,9 @@ typedef struct index_def : public BLOCK { typedef struct index_off { union { #if defined(WORDS_BIGENDIAN) - struct {int High; int Low;}; + struct {int High; int Low;} v; #else // !WORDS_BIGENDIAN - struct {int Low; int High;}; + struct {int Low; int High;} v; #endif //!WORDS_BIGENDIAN longlong Val; // File position }; // end of union diff --git a/storage/federatedx/ha_federatedx.cc b/storage/federatedx/ha_federatedx.cc index 56d900c6720..cc12673f86f 100644 --- a/storage/federatedx/ha_federatedx.cc +++ b/storage/federatedx/ha_federatedx.cc @@ -1318,7 +1318,7 @@ bool ha_federatedx::create_where_from_key(String *to, break; } DBUG_PRINT("info", ("federatedx HA_READ_AFTER_KEY %d", i)); - if (store_length >= length) /* end key */ + if (store_length >= length || i > 0) /* end key */ { if (emit_key_part_name(&tmp, key_part)) goto err; diff --git a/storage/innobase/CMakeLists.txt b/storage/innobase/CMakeLists.txt index 8c608e82388..7e667d5ebb2 100644 --- a/storage/innobase/CMakeLists.txt +++ b/storage/innobase/CMakeLists.txt @@ -491,14 +491,6 @@ SET(INNOBASE_SOURCES ut/ut0wqueue.cc ut/ut0timer.cc) -IF(CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64le") - enable_language(ASM) - LIST(APPEND INNOBASE_SOURCES - ut/crc32_power8/crc32.S - ut/crc32_power8/crc32_wrapper.c - ) -ENDIF() - IF(WITH_INNODB) # Legacy option SET(WITH_INNOBASE_STORAGE_ENGINE TRUE) @@ -517,5 +509,5 @@ ENDIF() MYSQL_ADD_PLUGIN(innobase ${INNOBASE_SOURCES} STORAGE_ENGINE MODULE_ONLY MODULE_OUTPUT_NAME ha_innodb - LINK_LIBRARIES ${ZLIB_LIBRARY} ${LINKER_SCRIPT}) + LINK_LIBRARIES ${ZLIB_LIBRARY} ${CRC32_VPMSUM_LIBRARY} ${LINKER_SCRIPT}) diff --git a/storage/innobase/btr/btr0btr.cc b/storage/innobase/btr/btr0btr.cc index be5b04787dd..33ca57c9654 100644 --- a/storage/innobase/btr/btr0btr.cc +++ b/storage/innobase/btr/btr0btr.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1994, 2015, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2012, Facebook Inc. Copyright (c) 2014, 2015, MariaDB Corporation @@ -1126,7 +1126,7 @@ that the caller has made the reservation for free extents! @retval block, rw_lock_x_lock_count(&block->lock) == 1 if allocation succeeded (init_mtr == mtr, or the page was not previously freed in mtr) @retval block (not allocated or initialized) otherwise */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) buf_block_t* btr_page_alloc_low( /*===============*/ @@ -2181,7 +2181,8 @@ btr_parse_page_reorganize( { ulint level = page_zip_level; - ut_ad(ptr && end_ptr); + ut_ad(ptr != NULL); + ut_ad(end_ptr != NULL); /* If dealing with a compressed page the record has the compression level used during original compression written in @@ -2653,7 +2654,7 @@ func_exit: Returns TRUE if the insert fits on the appropriate half-page with the chosen split_rec. @return true if fits */ -static __attribute__((nonnull(1,3,4,6), warn_unused_result)) +static MY_ATTRIBUTE((nonnull(1,3,4,6), warn_unused_result)) bool btr_page_insert_fits( /*=================*/ @@ -2796,7 +2797,7 @@ btr_insert_on_non_leaf_level_func( /**************************************************************//** Attaches the halves of an index page on the appropriate level in an index tree. */ -static __attribute__((nonnull)) +static MY_ATTRIBUTE((nonnull)) void btr_attach_half_pages( /*==================*/ @@ -2932,7 +2933,7 @@ btr_attach_half_pages( /*************************************************************//** Determine if a tuple is smaller than any record on the page. @return TRUE if smaller */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) bool btr_page_tuple_smaller( /*===================*/ @@ -3524,7 +3525,8 @@ btr_level_list_remove_func( ulint prev_page_no; ulint next_page_no; - ut_ad(page && mtr); + ut_ad(page != NULL); + ut_ad(mtr != NULL); ut_ad(mtr_memo_contains_page(mtr, page, MTR_MEMO_PAGE_X_FIX)); ut_ad(space == page_get_space_id(page)); /* Get the previous and next page numbers of page */ diff --git a/storage/innobase/btr/btr0cur.cc b/storage/innobase/btr/btr0cur.cc index a6bb258344f..f1d4e03e230 100644 --- a/storage/innobase/btr/btr0cur.cc +++ b/storage/innobase/btr/btr0cur.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1994, 2015, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2008, Google Inc. Copyright (c) 2012, Facebook Inc. Copyright (c) 2015, MariaDB Corporation. @@ -1139,7 +1139,7 @@ This has to be done either within the same mini-transaction, or by invoking ibuf_reset_free_bits() before mtr_commit(). @return pointer to inserted record if succeed, else NULL */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) rec_t* btr_cur_insert_if_possible( /*=======================*/ @@ -1182,7 +1182,7 @@ btr_cur_insert_if_possible( /*************************************************************//** For an insert, checks the locks and does the undo logging if desired. @return DB_SUCCESS, DB_WAIT_LOCK, DB_FAIL, or error number */ -UNIV_INLINE __attribute__((warn_unused_result, nonnull(2,3,5,6))) +UNIV_INLINE MY_ATTRIBUTE((warn_unused_result, nonnull(2,3,5,6))) dberr_t btr_cur_ins_lock_and_undo( /*======================*/ @@ -1717,7 +1717,7 @@ btr_cur_pessimistic_insert( /*************************************************************//** For an update, checks the locks and does the undo logging. @return DB_SUCCESS, DB_WAIT_LOCK, or error number */ -UNIV_INLINE __attribute__((warn_unused_result, nonnull(2,3,6,7))) +UNIV_INLINE MY_ATTRIBUTE((warn_unused_result, nonnull(2,3,6,7))) dberr_t btr_cur_upd_lock_and_undo( /*======================*/ @@ -1736,7 +1736,7 @@ btr_cur_upd_lock_and_undo( const rec_t* rec; dberr_t err; - ut_ad(thr || (flags & BTR_NO_LOCKING_FLAG)); + ut_ad((thr != NULL) || (flags & BTR_NO_LOCKING_FLAG)); rec = btr_cur_get_rec(cursor); index = cursor->index; @@ -3035,7 +3035,7 @@ btr_cur_del_mark_set_clust_rec( ut_ad(page_is_leaf(page_align(rec))); #ifdef UNIV_DEBUG - if (btr_cur_print_record_ops && thr) { + if (btr_cur_print_record_ops && (thr != NULL)) { btr_cur_trx_report(thr_get_trx(thr)->id, index, "del mark "); rec_print_new(stderr, rec, offsets); } @@ -3183,7 +3183,7 @@ btr_cur_del_mark_set_sec_rec( rec = btr_cur_get_rec(cursor); #ifdef UNIV_DEBUG - if (btr_cur_print_record_ops && thr) { + if (btr_cur_print_record_ops && (thr != NULL)) { btr_cur_trx_report(thr_get_trx(thr)->id, cursor->index, "del mark "); rec_print(stderr, rec, cursor->index); @@ -4070,7 +4070,7 @@ btr_estimate_number_of_different_key_vals( */ if (index->stat_index_size > 1) { n_sample_pages = (srv_stats_transient_sample_pages < index->stat_index_size) ? - ut_min(index->stat_index_size, + (ulint) ut_min((double) index->stat_index_size, log2(index->stat_index_size)*srv_stats_transient_sample_pages) : index->stat_index_size; @@ -5134,7 +5134,7 @@ btr_free_externally_stored_field( ulint i, /*!< in: field number of field_ref; ignored if rec == NULL */ enum trx_rb_ctx rb_ctx, /*!< in: rollback context */ - mtr_t* local_mtr __attribute__((unused))) /*!< in: mtr + mtr_t* local_mtr MY_ATTRIBUTE((unused))) /*!< in: mtr containing the latch to data an an X-latch to the index tree */ { diff --git a/storage/innobase/btr/btr0defragment.cc b/storage/innobase/btr/btr0defragment.cc index 26bab936de5..4d9eab8f2bd 100644 --- a/storage/innobase/btr/btr0defragment.cc +++ b/storage/innobase/btr/btr0defragment.cc @@ -151,7 +151,7 @@ void btr_defragment_init() { srv_defragment_interval = ut_microseconds_to_timer( - 1000000.0 / srv_defragment_frequency); + (ulonglong) (1000000.0 / srv_defragment_frequency)); mutex_create(btr_defragment_mutex_key, &btr_defragment_mutex, SYNC_ANY_LATCH); os_thread_create(btr_defragment_thread, NULL, NULL); diff --git a/storage/innobase/btr/btr0sea.cc b/storage/innobase/btr/btr0sea.cc index dcb508a7f29..d1263969ce9 100644 --- a/storage/innobase/btr/btr0sea.cc +++ b/storage/innobase/btr/btr0sea.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2008, Google Inc. Portions of this file contain modifications contributed and copyrighted by @@ -50,17 +50,10 @@ UNIV_INTERN char btr_search_enabled = TRUE; /** A dummy variable to fool the compiler */ UNIV_INTERN ulint btr_search_this_is_zero = 0; -#ifdef UNIV_SEARCH_PERF_STAT -/** Number of successful adaptive hash index lookups */ -UNIV_INTERN ulint btr_search_n_succ = 0; -/** Number of failed adaptive hash index lookups */ -UNIV_INTERN ulint btr_search_n_hash_fail = 0; -#endif /* UNIV_SEARCH_PERF_STAT */ - /** padding to prevent other memory update hotspots from residing on the same memory cache line as btr_search_latch */ -UNIV_INTERN byte btr_sea_pad1[64]; +UNIV_INTERN byte btr_sea_pad1[CACHE_LINE_SIZE]; /** The latch protecting the adaptive search system: this latch protects the (1) positions of records on those pages where a hash index has been built. @@ -74,7 +67,7 @@ UNIV_INTERN rw_lock_t* btr_search_latch_temp; /** padding to prevent other memory update hotspots from residing on the same memory cache line */ -UNIV_INTERN byte btr_sea_pad2[64]; +UNIV_INTERN byte btr_sea_pad2[CACHE_LINE_SIZE]; /** The adaptive hash index */ UNIV_INTERN btr_search_sys_t* btr_search_sys; @@ -473,7 +466,7 @@ btr_search_update_block_hash_info( /*==============================*/ btr_search_t* info, /*!< in: search info */ buf_block_t* block, /*!< in: buffer block */ - btr_cur_t* cursor __attribute__((unused))) + btr_cur_t* cursor MY_ATTRIBUTE((unused))) /*!< in: cursor */ { #ifdef UNIV_SYNC_DEBUG @@ -651,10 +644,6 @@ btr_search_info_update_slow( if (cursor->flag == BTR_CUR_HASH_FAIL) { /* Update the hash node reference, if appropriate */ -#ifdef UNIV_SEARCH_PERF_STAT - btr_search_n_hash_fail++; -#endif /* UNIV_SEARCH_PERF_STAT */ - rw_lock_x_lock(&btr_search_latch); btr_search_update_hash_ref(info, block, cursor); @@ -1010,9 +999,6 @@ btr_search_guess_on_hash( #endif info->last_hash_succ = TRUE; -#ifdef UNIV_SEARCH_PERF_STAT - btr_search_n_succ++; -#endif if (UNIV_LIKELY(!has_search_latch) && buf_page_peek_if_too_old(&block->page)) { diff --git a/storage/innobase/buf/buf0buddy.cc b/storage/innobase/buf/buf0buddy.cc index 958b3b5cfad..f2ab73217e0 100644 --- a/storage/innobase/buf/buf0buddy.cc +++ b/storage/innobase/buf/buf0buddy.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2006, 2013, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2006, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -112,7 +112,7 @@ buf_buddy_mem_invalid( /**********************************************************************//** Check if a buddy is stamped free. @return whether the buddy is free */ -UNIV_INLINE __attribute__((warn_unused_result)) +UNIV_INLINE MY_ATTRIBUTE((warn_unused_result)) bool buf_buddy_stamp_is_free( /*====================*/ @@ -225,7 +225,7 @@ Checks if a buf is free i.e.: in the zip_free[]. @retval BUF_BUDDY_STATE_FREE if fully free @retval BUF_BUDDY_STATE_USED if currently in use @retval BUF_BUDDY_STATE_PARTIALLY_USED if partially in use. */ -static __attribute__((warn_unused_result)) +static MY_ATTRIBUTE((warn_unused_result)) buf_buddy_state_t buf_buddy_is_free( /*==============*/ diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc index bd424b7b598..7b0cf339ef1 100644 --- a/storage/innobase/buf/buf0buf.cc +++ b/storage/innobase/buf/buf0buf.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2008, Google Inc. Copyright (c) 2013, 2016, MariaDB Corporation. All Rights Reserved. @@ -3740,7 +3740,7 @@ buf_page_init_low( /********************************************************************//** Inits a page to the buffer buf_pool. */ -static __attribute__((nonnull)) +static MY_ATTRIBUTE((nonnull)) void buf_page_init( /*==========*/ diff --git a/storage/innobase/buf/buf0dblwr.cc b/storage/innobase/buf/buf0dblwr.cc index 35188b8ba16..16877818ba9 100644 --- a/storage/innobase/buf/buf0dblwr.cc +++ b/storage/innobase/buf/buf0dblwr.cc @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1995, 2014, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2013, 2015, MariaDB Corporation. All Rights Reserved. +Copyright (c) 2013, 2016, MariaDB Corporation. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -37,6 +37,7 @@ Created 2011/12/19 #include "page0zip.h" #include "trx0sys.h" #include "fil0crypt.h" +#include "fil0pagecompress.h" #ifndef UNIV_HOTBACKUP @@ -500,6 +501,7 @@ buf_dblwr_process() for (std::list::iterator i = recv_dblwr.pages.begin(); i != recv_dblwr.pages.end(); ++i, ++page_no_dblwr ) { + bool is_compressed = false; page = *i; page_no = mach_read_from_4(page + FIL_PAGE_OFFSET); @@ -533,6 +535,16 @@ buf_dblwr_process() NULL, 0); + /* Is page compressed ? */ + is_compressed = fil_page_is_compressed_encrypted(read_buf) | + fil_page_is_compressed(read_buf); + + /* If page was compressed, decompress it before we + check checksum. */ + if (is_compressed) { + fil_decompress_page(NULL, read_buf, UNIV_PAGE_SIZE, NULL, true); + } + if (fil_space_verify_crypt_checksum(read_buf, zip_size)) { /* page is encrypted and checksum is OK */ } else if (buf_page_is_corrupted(true, read_buf, zip_size)) { @@ -546,6 +558,16 @@ buf_dblwr_process() " the doublewrite buffer.\n", (ulong) space_id, (ulong) page_no); + /* Is page compressed ? */ + is_compressed = fil_page_is_compressed_encrypted(page) | + fil_page_is_compressed(page); + + /* If page was compressed, decompress it before we + check checksum. */ + if (is_compressed) { + fil_decompress_page(NULL, page, UNIV_PAGE_SIZE, NULL, true); + } + if (fil_space_verify_crypt_checksum(page, zip_size)) { /* the doublewrite buffer page is encrypted and OK */ } else if (buf_page_is_corrupted(true, diff --git a/storage/innobase/buf/buf0dump.cc b/storage/innobase/buf/buf0dump.cc index 6f3aca0e1fb..0abf7118b4f 100644 --- a/storage/innobase/buf/buf0dump.cc +++ b/storage/innobase/buf/buf0dump.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2011, 2015, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2011, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -105,7 +105,7 @@ SELECT variable_value FROM information_schema.global_status WHERE variable_name = 'INNODB_BUFFER_POOL_DUMP_STATUS'; or by: SHOW STATUS LIKE 'innodb_buffer_pool_dump_status'; */ -static __attribute__((nonnull, format(printf, 2, 3))) +static MY_ATTRIBUTE((nonnull, format(printf, 2, 3))) void buf_dump_status( /*============*/ @@ -137,7 +137,7 @@ SELECT variable_value FROM information_schema.global_status WHERE variable_name = 'INNODB_BUFFER_POOL_LOAD_STATUS'; or by: SHOW STATUS LIKE 'innodb_buffer_pool_load_status'; */ -static __attribute__((nonnull, format(printf, 2, 3))) +static MY_ATTRIBUTE((nonnull, format(printf, 2, 3))) void buf_load_status( /*============*/ @@ -684,7 +684,7 @@ extern "C" UNIV_INTERN os_thread_ret_t DECLARE_THREAD(buf_dump_thread)( /*============================*/ - void* arg __attribute__((unused))) /*!< in: a dummy parameter + void* arg MY_ATTRIBUTE((unused))) /*!< in: a dummy parameter required by os_thread_create */ { ut_ad(!srv_read_only_mode); diff --git a/storage/innobase/buf/buf0flu.cc b/storage/innobase/buf/buf0flu.cc index 780230b38ba..f7721e69128 100644 --- a/storage/innobase/buf/buf0flu.cc +++ b/storage/innobase/buf/buf0flu.cc @@ -1,7 +1,7 @@ /***************************************************************************** -Copyright (c) 1995, 2015, Oracle and/or its affiliates -Copyright (c) 2013, 2015, MariaDB Corporation +Copyright (c) 1995, 2016, Oracle and/or its affiliates +Copyright (c) 2013, 2016, MariaDB Corporation Copyright (c) 2013, 2014, Fusion-io This program is free software; you can redistribute it and/or modify it under @@ -2066,7 +2066,7 @@ ulint af_get_pct_for_dirty() /*==================*/ { - ulint dirty_pct = buf_get_modified_ratio_pct(); + ulint dirty_pct = (ulint) buf_get_modified_ratio_pct(); if (dirty_pct > 0 && srv_max_buf_pool_modified_pct == 0) { return(100); @@ -2086,7 +2086,7 @@ af_get_pct_for_dirty() } } else if (dirty_pct > srv_max_dirty_pages_pct_lwm) { /* We should start flushing pages gradually. */ - return((dirty_pct * 100) + return (ulint) ((dirty_pct * 100) / (srv_max_buf_pool_modified_pct + 1)); } @@ -2104,8 +2104,8 @@ af_get_pct_for_lsn( { lsn_t max_async_age; lsn_t lsn_age_factor; - lsn_t af_lwm = (srv_adaptive_flushing_lwm - * log_get_capacity()) / 100; + lsn_t af_lwm = (lsn_t) ((srv_adaptive_flushing_lwm + * log_get_capacity()) / 100); if (age < af_lwm) { /* No adaptive flushing. */ @@ -2285,7 +2285,7 @@ extern "C" UNIV_INTERN os_thread_ret_t DECLARE_THREAD(buf_flush_page_cleaner_thread)( /*==========================================*/ - void* arg __attribute__((unused))) + void* arg MY_ATTRIBUTE((unused))) /*!< in: a dummy parameter required by os_thread_create */ { diff --git a/storage/innobase/buf/buf0lru.cc b/storage/innobase/buf/buf0lru.cc index 7591e4476d6..30b991d24cf 100644 --- a/storage/innobase/buf/buf0lru.cc +++ b/storage/innobase/buf/buf0lru.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -146,7 +146,7 @@ If a compressed page is freed other compressed pages may be relocated. caller needs to free the page to the free list @retval false if BUF_BLOCK_ZIP_PAGE was removed from page_hash. In this case the block is already returned to the buddy allocator. */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) bool buf_LRU_block_remove_hashed( /*========================*/ @@ -370,7 +370,7 @@ want to hog the CPU and resources. Release the buffer pool and block mutex and try to force a context switch. Then reacquire the same mutexes. The current page is "fixed" before the release of the mutexes and then "unfixed" again once we have reacquired the mutexes. */ -static __attribute__((nonnull)) +static MY_ATTRIBUTE((nonnull)) void buf_flush_yield( /*============*/ @@ -411,7 +411,7 @@ If we have hogged the resources for too long then release the buffer pool and flush list mutex and do a thread yield. Set the current page to "sticky" so that it is not relocated during the yield. @return true if yielded */ -static __attribute__((nonnull(1), warn_unused_result)) +static MY_ATTRIBUTE((nonnull(1), warn_unused_result)) bool buf_flush_try_yield( /*================*/ @@ -454,7 +454,7 @@ buf_flush_try_yield( Removes a single page from a given tablespace inside a specific buffer pool instance. @return true if page was removed. */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) bool buf_flush_or_remove_page( /*=====================*/ @@ -535,7 +535,7 @@ the list as they age towards the tail of the LRU. @retval DB_SUCCESS if all freed @retval DB_FAIL if not all freed @retval DB_INTERRUPTED if the transaction was interrupted */ -static __attribute__((nonnull(1), warn_unused_result)) +static MY_ATTRIBUTE((nonnull(1), warn_unused_result)) dberr_t buf_flush_or_remove_pages( /*======================*/ @@ -641,7 +641,7 @@ Remove or flush all the dirty pages that belong to a given tablespace inside a specific buffer pool instance. The pages will remain in the LRU list and will be evicted from the LRU list as they age and move towards the tail of the LRU list. */ -static __attribute__((nonnull(1))) +static MY_ATTRIBUTE((nonnull(1))) void buf_flush_dirty_pages( /*==================*/ @@ -681,7 +681,7 @@ buf_flush_dirty_pages( /******************************************************************//** Remove all pages that belong to a given tablespace inside a specific buffer pool instance when we are DISCARDing the tablespace. */ -static __attribute__((nonnull)) +static MY_ATTRIBUTE((nonnull)) void buf_LRU_remove_all_pages( /*=====================*/ @@ -829,7 +829,7 @@ buffer pool instance when we are deleting the data file(s) of that tablespace. The pages still remain a part of LRU and are evicted from the list as they age towards the tail of the LRU only if buf_remove is BUF_REMOVE_FLUSH_NO_WRITE. */ -static __attribute__((nonnull(1))) +static MY_ATTRIBUTE((nonnull(1))) void buf_LRU_remove_pages( /*=================*/ diff --git a/storage/innobase/data/data0data.cc b/storage/innobase/data/data0data.cc index 179de79b69f..593af089b00 100644 --- a/storage/innobase/data/data0data.cc +++ b/storage/innobase/data/data0data.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1994, 2012, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -67,7 +67,8 @@ dtuple_coll_cmp( ulint n_fields; ulint i; - ut_ad(tuple1 && tuple2); + ut_ad(tuple1 != NULL); + ut_ad(tuple2 != NULL); ut_ad(tuple1->magic_n == DATA_TUPLE_MAGIC_N); ut_ad(tuple2->magic_n == DATA_TUPLE_MAGIC_N); ut_ad(dtuple_check_typed(tuple1)); @@ -715,7 +716,7 @@ UNIV_INTERN void dtuple_convert_back_big_rec( /*========================*/ - dict_index_t* index __attribute__((unused)), /*!< in: index */ + dict_index_t* index MY_ATTRIBUTE((unused)), /*!< in: index */ dtuple_t* entry, /*!< in: entry whose data was put to vector */ big_rec_t* vector) /*!< in, own: big rec vector; it is freed in this function */ diff --git a/storage/innobase/dict/dict0boot.cc b/storage/innobase/dict/dict0boot.cc index 0dff05567d7..80724372f27 100644 --- a/storage/innobase/dict/dict0boot.cc +++ b/storage/innobase/dict/dict0boot.cc @@ -468,7 +468,7 @@ dict_boot(void) } else { ib_logf(IB_LOG_LEVEL_WARN, "Change buffer not empty when --innodb-read-only " - "is set! but srv_force_recovery = %d, ignoring.", + "is set! but srv_force_recovery = %lu, ignoring.", srv_force_recovery); } } diff --git a/storage/innobase/dict/dict0crea.cc b/storage/innobase/dict/dict0crea.cc index 4a8dcd2f840..d423f16f61c 100644 --- a/storage/innobase/dict/dict0crea.cc +++ b/storage/innobase/dict/dict0crea.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2014, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -246,7 +246,7 @@ dict_create_sys_columns_tuple( /***************************************************************//** Builds a table definition to insert. @return DB_SUCCESS or error code */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t dict_build_table_def_step( /*======================*/ @@ -574,7 +574,7 @@ dict_create_search_tuple( /***************************************************************//** Builds an index definition row to insert. @return DB_SUCCESS or error code */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t dict_build_index_def_step( /*======================*/ @@ -649,7 +649,7 @@ dict_build_field_def_step( /***************************************************************//** Creates an index tree for the index if it is not a member of a cluster. @return DB_SUCCESS or DB_OUT_OF_FILE_SPACE */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t dict_create_index_tree_step( /*========================*/ @@ -1187,7 +1187,7 @@ dict_create_index_step( >= UNIV_FORMAT_B); node->index = dict_index_get_if_in_cache_low(index_id); - ut_a(err == DB_SUCCESS ? node->index != NULL : node->index == NULL); + ut_a((node->index == NULL) == (err != DB_SUCCESS)); if (err != DB_SUCCESS) { @@ -1369,7 +1369,7 @@ dict_create_or_check_foreign_constraint_tables(void) ib_logf(IB_LOG_LEVEL_WARN, "Dropping incompletely created " "SYS_FOREIGN table."); - row_drop_table_for_mysql("SYS_FOREIGN", trx, TRUE); + row_drop_table_for_mysql("SYS_FOREIGN", trx, TRUE, TRUE); } if (sys_foreign_cols_err == DB_CORRUPTION) { @@ -1377,7 +1377,7 @@ dict_create_or_check_foreign_constraint_tables(void) "Dropping incompletely created " "SYS_FOREIGN_COLS table."); - row_drop_table_for_mysql("SYS_FOREIGN_COLS", trx, TRUE); + row_drop_table_for_mysql("SYS_FOREIGN_COLS", trx, TRUE, TRUE); } ib_logf(IB_LOG_LEVEL_WARN, @@ -1431,8 +1431,8 @@ dict_create_or_check_foreign_constraint_tables(void) ut_ad(err == DB_OUT_OF_FILE_SPACE || err == DB_TOO_MANY_CONCURRENT_TRXS); - row_drop_table_for_mysql("SYS_FOREIGN", trx, TRUE); - row_drop_table_for_mysql("SYS_FOREIGN_COLS", trx, TRUE); + row_drop_table_for_mysql("SYS_FOREIGN", trx, TRUE, TRUE); + row_drop_table_for_mysql("SYS_FOREIGN_COLS", trx, TRUE, TRUE); if (err == DB_OUT_OF_FILE_SPACE) { err = DB_MUST_GET_MORE_FILE_SPACE; @@ -1468,7 +1468,7 @@ dict_create_or_check_foreign_constraint_tables(void) /****************************************************************//** Evaluate the given foreign key SQL statement. @return error code or DB_SUCCESS */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t dict_foreign_eval_sql( /*==================*/ @@ -1534,7 +1534,7 @@ dict_foreign_eval_sql( Add a single foreign key field definition to the data dictionary tables in the database. @return error code or DB_SUCCESS */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t dict_create_add_foreign_field_to_dictionary( /*========================================*/ @@ -1857,7 +1857,7 @@ dict_create_or_check_sys_tablespace(void) ib_logf(IB_LOG_LEVEL_WARN, "Dropping incompletely created " "SYS_TABLESPACES table."); - row_drop_table_for_mysql("SYS_TABLESPACES", trx, TRUE); + row_drop_table_for_mysql("SYS_TABLESPACES", trx, TRUE, TRUE); } if (sys_datafiles_err == DB_CORRUPTION) { @@ -1865,7 +1865,7 @@ dict_create_or_check_sys_tablespace(void) "Dropping incompletely created " "SYS_DATAFILES table."); - row_drop_table_for_mysql("SYS_DATAFILES", trx, TRUE); + row_drop_table_for_mysql("SYS_DATAFILES", trx, TRUE, TRUE); } ib_logf(IB_LOG_LEVEL_INFO, @@ -1901,8 +1901,8 @@ dict_create_or_check_sys_tablespace(void) ut_a(err == DB_OUT_OF_FILE_SPACE || err == DB_TOO_MANY_CONCURRENT_TRXS); - row_drop_table_for_mysql("SYS_TABLESPACES", trx, TRUE); - row_drop_table_for_mysql("SYS_DATAFILES", trx, TRUE); + row_drop_table_for_mysql("SYS_TABLESPACES", trx, TRUE, TRUE); + row_drop_table_for_mysql("SYS_DATAFILES", trx, TRUE, TRUE); if (err == DB_OUT_OF_FILE_SPACE) { err = DB_MUST_GET_MORE_FILE_SPACE; diff --git a/storage/innobase/dict/dict0dict.cc b/storage/innobase/dict/dict0dict.cc index c51deb0a048..0310e5e1d66 100644 --- a/storage/innobase/dict/dict0dict.cc +++ b/storage/innobase/dict/dict0dict.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2015, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2012, Facebook Inc. Copyright (c) 2013, 2015, MariaDB Corporation. @@ -6309,7 +6309,7 @@ dict_set_corrupted_index_cache_only( dict_index_t* index, /*!< in/out: index */ dict_table_t* table) /*!< in/out: table */ { - ut_ad(index); + ut_ad(index != NULL); ut_ad(mutex_own(&dict_sys->mutex)); ut_ad(!dict_table_is_comp(dict_sys->sys_tables)); ut_ad(!dict_table_is_comp(dict_sys->sys_indexes)); @@ -6319,8 +6319,9 @@ dict_set_corrupted_index_cache_only( if (dict_index_is_clust(index)) { dict_table_t* corrupt_table; - corrupt_table = table ? table : index->table; - ut_ad(!index->table || !table || index->table == table); + corrupt_table = (table != NULL) ? table : index->table; + ut_ad((index->table != NULL) || (table != NULL) + || index->table == table); if (corrupt_table) { corrupt_table->corrupted = TRUE; @@ -6400,11 +6401,6 @@ dict_table_get_index_on_name( { dict_index_t* index; - /* If name is NULL, just return */ - if (!name) { - return(NULL); - } - index = dict_table_get_first_index(table); while (index != NULL) { diff --git a/storage/innobase/dict/dict0load.cc b/storage/innobase/dict/dict0load.cc index d8bd0a66ade..04e31aff088 100644 --- a/storage/innobase/dict/dict0load.cc +++ b/storage/innobase/dict/dict0load.cc @@ -1,6 +1,7 @@ /***************************************************************************** -Copyright (c) 1996, 2013, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2016, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -488,7 +489,7 @@ err_len: return("incorrect column length in SYS_FOREIGN"); } - /* This recieves a dict_foreign_t* that points to a stack variable. + /* This receives a dict_foreign_t* that points to a stack variable. So mem_heap_free(foreign->heap) is not used as elsewhere. Since the heap used here is freed elsewhere, foreign->heap is not assigned. */ @@ -1750,7 +1751,7 @@ err_len: goto err_len; } type = mach_read_from_4(field); - if (type & (~0 << DICT_IT_BITS)) { + if (type & (~0U << DICT_IT_BITS)) { return("unknown SYS_INDEXES.TYPE bits"); } @@ -1789,7 +1790,7 @@ Loads definitions for table indexes. Adds them to the data dictionary cache. @return DB_SUCCESS if ok, DB_CORRUPTION if corruption of dictionary table or DB_UNSUPPORTED if table has unknown index type */ -static __attribute__((nonnull)) +static MY_ATTRIBUTE((nonnull)) dberr_t dict_load_indexes( /*==============*/ @@ -2241,8 +2242,9 @@ dict_get_and_save_data_dir_path( bool dict_mutex_own) /*!< in: true if dict_sys->mutex is owned already */ { - if (DICT_TF_HAS_DATA_DIR(table->flags) - && (!table->data_dir_path)) { + bool is_temp = DICT_TF2_FLAG_IS_SET(table, DICT_TF2_TEMPORARY); + + if (!is_temp && !table->data_dir_path && table->space) { char* path = fil_space_get_first_path(table->space); if (!dict_mutex_own) { @@ -2254,6 +2256,7 @@ dict_get_and_save_data_dir_path( } if (path) { + table->flags |= (1 << DICT_TF_POS_DATA_DIR); dict_save_data_dir_path(table, path); mem_free(path); } @@ -2394,16 +2397,14 @@ err_exit: } /* Use the remote filepath if needed. */ - if (DICT_TF_HAS_DATA_DIR(table->flags)) { - /* This needs to be added to the table - from SYS_DATAFILES */ - dict_get_and_save_data_dir_path(table, true); + /* This needs to be added to the tablex1 + from SYS_DATAFILES */ + dict_get_and_save_data_dir_path(table, true); - if (table->data_dir_path) { - filepath = os_file_make_remote_pathname( + if (table->data_dir_path) { + filepath = os_file_make_remote_pathname( table->data_dir_path, table->name, "ibd"); - } } /* Try to open the tablespace. We set the @@ -2537,6 +2538,7 @@ func_exit: /* the table->fts could be created in dict_load_column when a user defined FTS_DOC_ID is present, but no FTS */ + fts_optimize_remove_table(table); fts_free(table); } else { fts_optimize_add_table(table); @@ -2602,14 +2604,13 @@ dict_load_table_on_id( btr_pcur_open_on_user_rec(sys_table_ids, tuple, PAGE_CUR_GE, BTR_SEARCH_LEAF, &pcur, &mtr); -check_rec: rec = btr_pcur_get_rec(&pcur); if (page_rec_is_user_rec(rec)) { /*---------------------------------------------------*/ /* Now we have the record in the secondary index containing the table ID and NAME */ - +check_rec: field = rec_get_nth_field_old( rec, DICT_FLD__SYS_TABLE_IDS__ID, &len); ut_ad(len == 8); @@ -2619,12 +2620,14 @@ check_rec: if (rec_get_deleted_flag(rec, 0)) { /* Until purge has completed, there may be delete-marked duplicate records - for the same SYS_TABLES.ID. - Due to Bug #60049, some delete-marked - records may survive the purge forever. */ - if (btr_pcur_move_to_next(&pcur, &mtr)) { + for the same SYS_TABLES.ID, but different + SYS_TABLES.NAME. */ + while (btr_pcur_move_to_next(&pcur, &mtr)) { + rec = btr_pcur_get_rec(&pcur); - goto check_rec; + if (page_rec_is_user_rec(rec)) { + goto check_rec; + } } } else { /* Now we get the table name from the record */ @@ -2886,7 +2889,7 @@ dict_load_foreign_cols( /***********************************************************************//** Loads a foreign key constraint to the dictionary cache. @return DB_SUCCESS or error code */ -static __attribute__((nonnull(1), warn_unused_result)) +static MY_ATTRIBUTE((nonnull(1), warn_unused_result)) dberr_t dict_load_foreign( /*==============*/ diff --git a/storage/innobase/dict/dict0mem.cc b/storage/innobase/dict/dict0mem.cc index 1724ac024fa..f8ea0005665 100644 --- a/storage/innobase/dict/dict0mem.cc +++ b/storage/innobase/dict/dict0mem.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2015, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2012, Facebook Inc. This program is free software; you can redistribute it and/or modify it under @@ -303,7 +303,7 @@ dict_mem_table_add_col( /**********************************************************************//** Renames a column of a table in the data dictionary cache. */ -static __attribute__((nonnull)) +static MY_ATTRIBUTE((nonnull)) void dict_mem_table_col_rename_low( /*==========================*/ diff --git a/storage/innobase/dict/dict0stats_bg.cc b/storage/innobase/dict/dict0stats_bg.cc index 076ceb79613..7aefa6a1d4d 100644 --- a/storage/innobase/dict/dict0stats_bg.cc +++ b/storage/innobase/dict/dict0stats_bg.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2012, 2013, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2012, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -527,7 +527,7 @@ extern "C" UNIV_INTERN os_thread_ret_t DECLARE_THREAD(dict_stats_thread)( /*==============================*/ - void* arg __attribute__((unused))) /*!< in: a dummy parameter + void* arg MY_ATTRIBUTE((unused))) /*!< in: a dummy parameter required by os_thread_create */ { ut_a(!srv_read_only_mode); diff --git a/storage/innobase/fil/fil0crypt.cc b/storage/innobase/fil/fil0crypt.cc index ceffa950739..2db3063d6b5 100644 --- a/storage/innobase/fil/fil0crypt.cc +++ b/storage/innobase/fil/fil0crypt.cc @@ -474,7 +474,7 @@ fil_parse_write_crypt_data( 4 + // size of key_id 1; // fil_encryption_t - if (end_ptr - ptr < entry_size){ + if ((uint) (end_ptr - ptr) < entry_size){ return NULL; } @@ -500,7 +500,7 @@ fil_parse_write_crypt_data( fil_encryption_t encryption = (fil_encryption_t)mach_read_from_1(ptr); ptr +=1; - if (end_ptr - ptr < len) { + if ((uint) (end_ptr - ptr) < len) { return NULL; } @@ -1351,7 +1351,7 @@ fil_crypt_space_needs_rotation( last_scrub_completed; bool need_scrubbing = crypt_data->rotate_state.scrubbing.is_active - && diff >= srv_background_scrub_data_interval; + && diff >= (time_t) srv_background_scrub_data_interval; if (need_key_rotation == false && need_scrubbing == false) break; @@ -2247,7 +2247,7 @@ DECLARE_THREAD(fil_crypt_thread)( time_t waited = time(0) - wait_start; - if (waited >= srv_background_scrub_data_check_interval) { + if (waited >= (time_t) srv_background_scrub_data_check_interval) { break; } } diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc index 22abf592adc..e9e164e5e1a 100644 --- a/storage/innobase/fil/fil0fil.cc +++ b/storage/innobase/fil/fil0fil.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1995, 2015, Oracle and/or its affiliates. +Copyright (c) 1995, 2016, Oracle and/or its affiliates. Copyright (c) 2013, 2016, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under @@ -717,16 +717,23 @@ fil_node_open_file( } if (UNIV_UNLIKELY(space->flags != flags)) { - fprintf(stderr, - "InnoDB: Error: table flags are 0x%lx" - " in the data dictionary\n" - "InnoDB: but the flags in file %s are 0x%lx!\n", - space->flags, node->name, flags); + ulint sflags = (space->flags & ~FSP_FLAGS_MASK_DATA_DIR); + ulint fflags = (flags & ~FSP_FLAGS_MASK_DATA_DIR_ORACLE); - ut_error; - } + /* DATA_DIR option is on different place on MariaDB + compared to MySQL. If this is the difference. Fix + it. */ + + if (sflags == fflags) { + fprintf(stderr, + "InnoDB: Warning: Table flags 0x%lx" + " in the data dictionary but in file %s are 0x%lx!\n" + " Temporally corrected because DATA_DIR option to 0x%lx.\n", + space->flags, node->name, flags, space->flags); + + flags = space->flags; + } - if (UNIV_UNLIKELY(space->flags != flags)) { if (!dict_tf_verify_flags(space->flags, flags)) { fprintf(stderr, "InnoDB: Error: table flags are 0x%lx" @@ -1802,7 +1809,7 @@ fil_set_max_space_id_if_bigger( Writes the flushed lsn and the latest archived log number to the page header of the first page of a data file of the system tablespace (space 0), which is uncompressed. */ -static __attribute__((warn_unused_result)) +static MY_ATTRIBUTE((warn_unused_result)) dberr_t fil_write_lsn_and_arch_no_to_file( /*==============================*/ @@ -1810,7 +1817,7 @@ fil_write_lsn_and_arch_no_to_file( ulint sum_of_sizes, /*!< in: combined size of previous files in space, in database pages */ lsn_t lsn, /*!< in: lsn to write */ - ulint arch_log_no __attribute__((unused))) + ulint arch_log_no MY_ATTRIBUTE((unused))) /*!< in: archived log number to write */ { byte* buf1; @@ -1898,7 +1905,7 @@ Checks the consistency of the first data page of a tablespace at database startup. @retval NULL on success, or if innodb_force_recovery is set @return pointer to an error message string */ -static __attribute__((warn_unused_result)) +static MY_ATTRIBUTE((warn_unused_result)) const char* fil_check_first_page( /*=================*/ @@ -3186,8 +3193,6 @@ fil_create_link_file( const char* tablename, /*!< in: tablename */ const char* filepath) /*!< in: pathname of tablespace */ { - os_file_t file; - ibool success; dberr_t err = DB_SUCCESS; char* link_filepath; char* prev_filepath = fil_read_link_file(tablename); @@ -3205,16 +3210,25 @@ fil_create_link_file( } link_filepath = fil_make_isl_name(tablename); - /* Note that OS_FILE_READ_WRITE_CACHED used here to avoid - unnecessary errors on O_DIRECT, link files are not really - a data files. */ - file = os_file_create_simple_no_error_handling( - innodb_file_data_key, link_filepath, - OS_FILE_CREATE, OS_FILE_READ_WRITE_CACHED, &success, 0); - if (!success) { - /* The following call will print an error message */ - ulint error = os_file_get_last_error(true); + /** Check if the file already exists. */ + FILE* file = NULL; + ibool exists; + os_file_type_t ftype; + + bool success = os_file_status(link_filepath, &exists, &ftype); + + ulint error = 0; + if (success && !exists) { + file = fopen(link_filepath, "w"); + if (file == NULL) { + /* This call will print its own error message */ + error = os_file_get_last_error(true); + } + } else { + error = OS_FILE_ALREADY_EXISTS; + } + if (error != 0) { ut_print_timestamp(stderr); fputs(" InnoDB: Cannot create file ", stderr); @@ -3239,13 +3253,17 @@ fil_create_link_file( return(err); } - if (!os_file_write(link_filepath, file, filepath, 0, - strlen(filepath))) { + ulint rbytes = fwrite(filepath, 1, strlen(filepath), file); + if (rbytes != strlen(filepath)) { + os_file_get_last_error(true); + ib_logf(IB_LOG_LEVEL_ERROR, + "cannot write link file " + "%s",filepath); err = DB_ERROR; } /* Close the file, we only need it at startup */ - os_file_close(file); + fclose(file); mem_free(link_filepath); @@ -3797,8 +3815,18 @@ fil_open_single_table_tablespace( /* Validate this single-table-tablespace with SYS_TABLES, but do not compare the DATA_DIR flag, in case the tablespace was relocated. */ + + ulint newf = def.flags; + if (newf != mod_flags) { + if (FSP_FLAGS_HAS_DATA_DIR(newf)) { + newf = (newf & ~FSP_FLAGS_MASK_DATA_DIR); + } else if(FSP_FLAGS_HAS_DATA_DIR_ORACLE(newf)) { + newf = (newf & ~FSP_FLAGS_MASK_DATA_DIR_ORACLE); + } + } + if (def.valid && def.id == id - && (def.flags & ~FSP_FLAGS_MASK_DATA_DIR) == mod_flags) { + && newf == mod_flags) { valid_tablespaces_found++; } else { def.valid = false; @@ -3826,8 +3854,17 @@ fil_open_single_table_tablespace( /* Validate this single-table-tablespace with SYS_TABLES, but do not compare the DATA_DIR flag, in case the tablespace was relocated. */ + ulint newf = remote.flags; + if (newf != mod_flags) { + if (FSP_FLAGS_HAS_DATA_DIR(newf)) { + newf = (newf & ~FSP_FLAGS_MASK_DATA_DIR); + } else if(FSP_FLAGS_HAS_DATA_DIR_ORACLE(newf)) { + newf = (newf & ~FSP_FLAGS_MASK_DATA_DIR_ORACLE); + } + } + if (remote.valid && remote.id == id - && (remote.flags & ~FSP_FLAGS_MASK_DATA_DIR) == mod_flags) { + && newf == mod_flags) { valid_tablespaces_found++; } else { remote.valid = false; @@ -3856,8 +3893,17 @@ fil_open_single_table_tablespace( /* Validate this single-table-tablespace with SYS_TABLES, but do not compare the DATA_DIR flag, in case the tablespace was relocated. */ + ulint newf = dict.flags; + if (newf != mod_flags) { + if (FSP_FLAGS_HAS_DATA_DIR(newf)) { + newf = (newf & ~FSP_FLAGS_MASK_DATA_DIR); + } else if(FSP_FLAGS_HAS_DATA_DIR_ORACLE(newf)) { + newf = (newf & ~FSP_FLAGS_MASK_DATA_DIR_ORACLE); + } + } + if (dict.valid && dict.id == id - && (dict.flags & ~FSP_FLAGS_MASK_DATA_DIR) == mod_flags) { + && newf == mod_flags) { valid_tablespaces_found++; } else { dict.valid = false; @@ -5262,12 +5308,15 @@ retry: os_offset_t offset = ((os_offset_t) (start_page_no - file_start_page_no)) * page_size; + + const char* name = node->name == NULL ? space->name : node->name; + #ifdef UNIV_HOTBACKUP - success = os_file_write(node->name, node->handle, buf, + success = os_file_write(name, node->handle, buf, offset, page_size * n_pages); #else success = os_aio(OS_FILE_WRITE, 0, OS_AIO_SYNC, - node->name, node->handle, buf, + name, node->handle, buf, offset, page_size * n_pages, page_size, node, NULL, 0); #endif /* UNIV_HOTBACKUP */ @@ -5904,30 +5953,22 @@ fil_io( ut_a(byte_offset % OS_FILE_LOG_BLOCK_SIZE == 0); ut_a((len % OS_FILE_LOG_BLOCK_SIZE) == 0); + const char* name = node->name == NULL ? space->name : node->name; + #ifdef UNIV_HOTBACKUP /* In mysqlbackup do normal i/o, not aio */ if (type == OS_FILE_READ) { ret = os_file_read(node->handle, buf, offset, len); } else { ut_ad(!srv_read_only_mode); - ret = os_file_write(node->name, node->handle, buf, + ret = os_file_write(name, node->handle, buf, offset, len); } #else /* Queue the aio request */ - ret = os_aio( - type, - is_log, - mode | wake_later, - node->name, - node->handle, - buf, - offset, - len, - zip_size ? zip_size : UNIV_PAGE_SIZE, - node, - message, - write_size); + ret = os_aio(type, is_log, mode | wake_later, name, node->handle, buf, + offset, len, zip_size ? zip_size : UNIV_PAGE_SIZE, node, + message, write_size); #endif /* UNIV_HOTBACKUP */ diff --git a/storage/innobase/fil/fil0pagecompress.cc b/storage/innobase/fil/fil0pagecompress.cc index 85bdeaf053f..5c6ef3bfd0d 100644 --- a/storage/innobase/fil/fil0pagecompress.cc +++ b/storage/innobase/fil/fil0pagecompress.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (C) 2013, 2015, MariaDB Corporation. All Rights Reserved. +Copyright (C) 2013, 2016, MariaDB Corporation. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -447,8 +447,11 @@ fil_decompress_page( byte* buf, /*!< out: buffer from which to read; in aio this must be appropriately aligned */ ulong len, /*!< in: length of output buffer.*/ - ulint* write_size) /*!< in/out: Actual payload size of + ulint* write_size, /*!< in/out: Actual payload size of the compressed data. */ + bool return_error) /*!< in: true if only an error should + be produced when decompression fails. + By default this parameter is false. */ { int err = 0; ulint actual_size = 0; @@ -493,6 +496,9 @@ fil_decompress_page( mach_read_from_2(buf+FIL_PAGE_TYPE), len); fflush(stderr); + if (return_error) { + goto error_return; + } ut_error; } @@ -512,6 +518,9 @@ fil_decompress_page( " actual size %lu compression %s.", actual_size, fil_get_compression_alg_name(compression_alg)); fflush(stderr); + if (return_error) { + goto error_return; + } ut_error; } @@ -543,6 +552,9 @@ fil_decompress_page( fflush(stderr); + if (return_error) { + goto error_return; + } ut_error; } break; @@ -559,6 +571,9 @@ fil_decompress_page( err, actual_size, len); fflush(stderr); + if (return_error) { + goto error_return; + } ut_error; } break; @@ -577,6 +592,9 @@ fil_decompress_page( olen, actual_size, len); fflush(stderr); + if (return_error) { + goto error_return; + } ut_error; } break; @@ -610,6 +628,9 @@ fil_decompress_page( dst_pos, actual_size, len); fflush(stderr); + if (return_error) { + goto error_return; + } ut_error; } @@ -636,6 +657,9 @@ fil_decompress_page( dst_pos, actual_size, len, err); fflush(stderr); + if (return_error) { + goto error_return; + } ut_error; } break; @@ -661,6 +685,9 @@ fil_decompress_page( olen, actual_size, len, (int)cstatus); fflush(stderr); + if (return_error) { + goto error_return; + } ut_error; } break; @@ -674,6 +701,9 @@ fil_decompress_page( ,fil_get_compression_alg_name(compression_alg)); fflush(stderr); + if (return_error) { + goto error_return; + } ut_error; break; } @@ -684,6 +714,7 @@ fil_decompress_page( really any other options. */ memcpy(buf, in_buf, len); +error_return: // Need to free temporal buffer if no buffer was given if (page_buf == NULL) { ut_free(in_buf); diff --git a/storage/innobase/fsp/fsp0fsp.cc b/storage/innobase/fsp/fsp0fsp.cc index bbd7ee1b650..d51e36bc0ba 100644 --- a/storage/innobase/fsp/fsp0fsp.cc +++ b/storage/innobase/fsp/fsp0fsp.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -94,7 +94,7 @@ fseg_n_reserved_pages_low( /********************************************************************//** Marks a page used. The page must reside within the extents of the given segment. */ -static __attribute__((nonnull)) +static MY_ATTRIBUTE((nonnull)) void fseg_mark_page_used( /*================*/ @@ -133,7 +133,7 @@ fsp_fill_free_list( ulint space, /*!< in: space */ fsp_header_t* header, /*!< in/out: space header */ mtr_t* mtr) /*!< in/out: mini-transaction */ - UNIV_COLD __attribute__((nonnull)); + UNIV_COLD MY_ATTRIBUTE((nonnull)); /**********************************************************************//** Allocates a single free page from a segment. This function implements the intelligent allocation strategy which tries to minimize file space @@ -162,7 +162,7 @@ fseg_alloc_free_page_low( in which the page should be initialized. If init_mtr!=mtr, but the page is already latched in mtr, do not initialize the page. */ - __attribute__((warn_unused_result, nonnull)); + MY_ATTRIBUTE((warn_unused_result, nonnull)); #endif /* !UNIV_HOTBACKUP */ /**********************************************************************//** @@ -426,7 +426,7 @@ descriptor resides is x-locked. This function no longer extends the data file. @return pointer to the extent descriptor, NULL if the page does not exist in the space or if the offset is >= the free limit */ -UNIV_INLINE __attribute__((nonnull, warn_unused_result)) +UNIV_INLINE MY_ATTRIBUTE((nonnull, warn_unused_result)) xdes_t* xdes_get_descriptor_with_space_hdr( /*===============================*/ @@ -488,7 +488,7 @@ is necessary to make the descriptor defined, as they are uninitialized above the free limit. @return pointer to the extent descriptor, NULL if the page does not exist in the space or if the offset exceeds the free limit */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) xdes_t* xdes_get_descriptor( /*================*/ @@ -615,7 +615,7 @@ byte* fsp_parse_init_file_page( /*=====================*/ byte* ptr, /*!< in: buffer */ - byte* end_ptr __attribute__((unused)), /*!< in: buffer end */ + byte* end_ptr MY_ATTRIBUTE((unused)), /*!< in: buffer end */ buf_block_t* block) /*!< in: block or NULL */ { ut_ad(ptr && end_ptr); @@ -856,7 +856,7 @@ fsp_header_get_tablespace_size(void) Tries to extend a single-table tablespace so that a page would fit in the data file. @return TRUE if success */ -static UNIV_COLD __attribute__((nonnull, warn_unused_result)) +static UNIV_COLD MY_ATTRIBUTE((nonnull, warn_unused_result)) ibool fsp_try_extend_data_file_with_pages( /*================================*/ @@ -888,7 +888,7 @@ fsp_try_extend_data_file_with_pages( /***********************************************************************//** Tries to extend the last data file of a tablespace if it is auto-extending. @return FALSE if not auto-extending */ -static UNIV_COLD __attribute__((nonnull)) +static UNIV_COLD MY_ATTRIBUTE((nonnull)) ibool fsp_try_extend_data_file( /*=====================*/ @@ -1070,7 +1070,8 @@ fsp_fill_free_list( ulint i; mtr_t ibuf_mtr; - ut_ad(header && mtr); + ut_ad(header != NULL); + ut_ad(mtr != NULL); ut_ad(page_offset(header) == FSP_HEADER_OFFSET); /* Check if we can fill free list from above the free list limit */ @@ -1242,7 +1243,7 @@ fsp_alloc_free_extent( /**********************************************************************//** Allocates a single free page from a space. */ -static __attribute__((nonnull)) +static MY_ATTRIBUTE((nonnull)) void fsp_alloc_from_free_frag( /*=====================*/ @@ -1333,7 +1334,7 @@ Allocates a single free page from a space. The page is marked as used. @retval block, rw_lock_x_lock_count(&block->lock) == 1 if allocation succeeded (init_mtr == mtr, or the page was not previously freed in mtr) @retval block (not allocated or initialized) otherwise */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) buf_block_t* fsp_alloc_free_page( /*================*/ @@ -1582,9 +1583,9 @@ fsp_seg_inode_page_get_nth_inode( /*=============================*/ page_t* page, /*!< in: segment inode page */ ulint i, /*!< in: inode index on page */ - ulint zip_size __attribute__((unused)), + ulint zip_size MY_ATTRIBUTE((unused)), /*!< in: compressed page size, or 0 */ - mtr_t* mtr __attribute__((unused))) + mtr_t* mtr MY_ATTRIBUTE((unused))) /*!< in/out: mini-transaction */ { ut_ad(i < FSP_SEG_INODES_PER_PAGE(zip_size)); @@ -1883,7 +1884,7 @@ fseg_get_nth_frag_page_no( /*======================*/ fseg_inode_t* inode, /*!< in: segment inode */ ulint n, /*!< in: slot index */ - mtr_t* mtr __attribute__((unused))) + mtr_t* mtr MY_ATTRIBUTE((unused))) /*!< in/out: mini-transaction */ { ut_ad(inode && mtr); @@ -2736,7 +2737,7 @@ fsp_reserve_free_extents( ulint zip_size; ulint n_free; ulint n_free_up; - ulint reserve; + ulint reserve= 0; ibool success; ulint n_pages_added; size_t total_reserved = 0; @@ -2978,7 +2979,7 @@ fsp_get_available_space_in_free_extents( /********************************************************************//** Marks a page used. The page must reside within the extents of the given segment. */ -static __attribute__((nonnull)) +static MY_ATTRIBUTE((nonnull)) void fseg_mark_page_used( /*================*/ @@ -3050,7 +3051,8 @@ fseg_free_page_low( ib_id_t seg_id; ulint i; - ut_ad(seg_inode && mtr); + ut_ad(seg_inode != NULL); + ut_ad(mtr != NULL); ut_ad(mach_read_from_4(seg_inode + FSEG_MAGIC_N) == FSEG_MAGIC_N_VALUE); ut_ad(!((page_offset(seg_inode) - FSEG_ARR_OFFSET) % FSEG_INODE_SIZE)); @@ -3259,7 +3261,8 @@ fseg_free_extent( ulint descr_n_used; ulint i; - ut_ad(seg_inode && mtr); + ut_ad(seg_inode != NULL); + ut_ad(mtr != NULL); descr = xdes_get_descriptor(space, zip_size, page, mtr); diff --git a/storage/innobase/fts/fts0blex.cc b/storage/innobase/fts/fts0blex.cc index 7d0acb00a3b..2d71934fa0e 100644 --- a/storage/innobase/fts/fts0blex.cc +++ b/storage/innobase/fts/fts0blex.cc @@ -305,9 +305,9 @@ YY_BUFFER_STATE fts0b_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner YY_BUFFER_STATE fts0b_scan_string (yyconst char *yy_str ,yyscan_t yyscanner ); YY_BUFFER_STATE fts0b_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner ); -void *fts0balloc (yy_size_t , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) ); -void *fts0brealloc (void *,yy_size_t , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) ); -void fts0bfree (void * , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) ); +void *fts0balloc (yy_size_t , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) ); +void *fts0brealloc (void *,yy_size_t , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) ); +void fts0bfree (void * , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) ); #define yy_new_buffer fts0b_create_buffer @@ -347,7 +347,7 @@ typedef int yy_state_type; static yy_state_type yy_get_previous_state (yyscan_t yyscanner ); static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner); static int yy_get_next_buffer (yyscan_t yyscanner ); -static void yy_fatal_error (yyconst char msg[] , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) ); +static void yy_fatal_error (yyconst char msg[] , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) ); /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. @@ -451,7 +451,7 @@ static yyconst flex_int16_t yy_chk[32] = #line 1 "fts0blex.l" /***************************************************************************** -Copyright (c) 2007, 2014, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2007, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -579,11 +579,11 @@ extern int fts0bwrap (yyscan_t yyscanner ); #endif #ifndef yytext_ptr -static void yy_flex_strncpy (char *,yyconst char *,int , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused))); +static void yy_flex_strncpy (char *,yyconst char *,int , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused))); #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused))); +static int yy_flex_strlen (yyconst char * , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused))); #endif #ifndef YY_NO_INPUT @@ -1609,7 +1609,7 @@ YY_BUFFER_STATE fts0b_scan_bytes (yyconst char * yybytes, int _yybytes_len , y #define YY_EXIT_FAILURE 2 #endif -static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused))) +static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused))) { (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); @@ -1910,7 +1910,7 @@ int fts0blex_destroy (yyscan_t yyscanner) */ #ifndef yytext_ptr -static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused))) +static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused))) { register int i; for ( i = 0; i < n; ++i ) @@ -1919,7 +1919,7 @@ static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yys #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused))) +static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused))) { register int n; for ( n = 0; s[n]; ++n ) @@ -1929,12 +1929,12 @@ static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner __at } #endif -void *fts0balloc (yy_size_t size , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused))) +void *fts0balloc (yy_size_t size , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused))) { return (void *) malloc( size ); } -void *fts0brealloc (void * ptr, yy_size_t size , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused))) +void *fts0brealloc (void * ptr, yy_size_t size , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused))) { /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those @@ -1946,7 +1946,7 @@ void *fts0brealloc (void * ptr, yy_size_t size , yyscan_t yyscanner return (void *) realloc( (char *) ptr, size ); } -void fts0bfree (void * ptr , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused))) +void fts0bfree (void * ptr , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused))) { free( (char *) ptr ); /* see fts0brealloc() for (char *) cast */ } diff --git a/storage/innobase/fts/fts0fts.cc b/storage/innobase/fts/fts0fts.cc index ee06f9432b8..0337cf6dfe7 100644 --- a/storage/innobase/fts/fts0fts.cc +++ b/storage/innobase/fts/fts0fts.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2011, 2015, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2011, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -260,16 +260,18 @@ static const char* fts_config_table_insert_values_sql = "INSERT INTO \"%s\" VALUES ('" FTS_TABLE_STATE "', '0');\n"; -/****************************************************************//** -Run SYNC on the table, i.e., write out data from the cache to the +/** Run SYNC on the table, i.e., write out data from the cache to the FTS auxiliary INDEX table and clear the cache at the end. -@return DB_SUCCESS if all OK */ +@param[in,out] sync sync state +@param[in] unlock_cache whether unlock cache lock when write node +@param[in] wait whether wait when a sync is in progress +@return DB_SUCCESS if all OK */ static dberr_t fts_sync( -/*=====*/ - fts_sync_t* sync) /*!< in: sync state */ - __attribute__((nonnull)); + fts_sync_t* sync, + bool unlock_cache, + bool wait); /****************************************************************//** Release all resources help by the words rb tree e.g., the node ilist. */ @@ -278,7 +280,7 @@ void fts_words_free( /*===========*/ ib_rbt_t* words) /*!< in: rb tree of words */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); #ifdef FTS_CACHE_SIZE_DEBUG /****************************************************************//** Read the max cache size parameter from the config table. */ @@ -300,7 +302,7 @@ fts_add_doc_by_id( /*==============*/ fts_trx_table_t*ftt, /*!< in: FTS trx table */ doc_id_t doc_id, /*!< in: doc id */ - ib_vector_t* fts_indexes __attribute__((unused))); + ib_vector_t* fts_indexes MY_ATTRIBUTE((unused))); /*!< in: affected fts indexes */ #ifdef FTS_DOC_STATS_DEBUG /****************************************************************//** @@ -315,7 +317,7 @@ fts_is_word_in_index( fts_table_t* fts_table, /*!< in: table instance */ const fts_string_t* word, /*!< in: the word to check */ ibool* found) /*!< out: TRUE if exists */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); #endif /* FTS_DOC_STATS_DEBUG */ /******************************************************************//** @@ -330,7 +332,7 @@ fts_update_sync_doc_id( const char* table_name, /*!< in: table name, or NULL */ doc_id_t doc_id, /*!< in: last document id */ trx_t* trx) /*!< in: update trx, or NULL */ - __attribute__((nonnull(1))); + MY_ATTRIBUTE((nonnull(1))); /****************************************************************//** This function loads the default InnoDB stopword list */ @@ -653,6 +655,7 @@ fts_cache_create( mem_heap_zalloc(heap, sizeof(fts_sync_t))); cache->sync->table = table; + cache->sync->event = os_event_create(); /* Create the index cache vector that will hold the inverted indexes. */ cache->indexes = ib_vector_create( @@ -1072,13 +1075,12 @@ fts_words_free( } } -/*********************************************************************//** -Clear cache. */ +/** Clear cache. +@param[in,out] cache fts cache */ UNIV_INTERN void fts_cache_clear( -/*============*/ - fts_cache_t* cache) /*!< in: cache */ + fts_cache_t* cache) { ulint i; @@ -1207,6 +1209,7 @@ fts_cache_destroy( mutex_free(&cache->optimize_lock); mutex_free(&cache->deleted_lock); mutex_free(&cache->doc_id_lock); + os_event_free(cache->sync->event); if (cache->stopword_info.cached_stopword) { rbt_free(cache->stopword_info.cached_stopword); @@ -1435,7 +1438,7 @@ fts_cache_add_doc( ib_vector_last(word->nodes)); } - if (fts_node == NULL + if (fts_node == NULL || fts_node->synced || fts_node->ilist_size > FTS_ILIST_MAX_SIZE || doc_id < fts_node->last_doc_id) { @@ -1473,7 +1476,7 @@ fts_cache_add_doc( /****************************************************************//** Drops a table. If the table can't be found we return a SUCCESS code. @return DB_SUCCESS or error code */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t fts_drop_table( /*===========*/ @@ -1515,7 +1518,7 @@ fts_drop_table( /****************************************************************//** Rename a single auxiliary table due to database name change. @return DB_SUCCESS or error code */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t fts_rename_one_aux_table( /*=====================*/ @@ -1624,7 +1627,7 @@ Drops the common ancillary tables needed for supporting an FTS index on the given table. row_mysql_lock_data_dictionary must have been called before this. @return DB_SUCCESS or error code */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t fts_drop_common_tables( /*===================*/ @@ -1751,7 +1754,7 @@ Drops FTS ancillary tables needed for supporting an FTS index on the given table. row_mysql_lock_data_dictionary must have been called before this. @return DB_SUCCESS or error code */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t fts_drop_all_index_tables( /*======================*/ @@ -1915,7 +1918,7 @@ func_exit: trx_rollback_to_savepoint(trx, NULL); - row_drop_table_for_mysql(table->name, trx, FALSE); + row_drop_table_for_mysql(table->name, trx, FALSE, TRUE); trx->error_state = DB_SUCCESS; } @@ -2067,7 +2070,7 @@ fts_create_index_tables_low( trx_rollback_to_savepoint(trx, NULL); - row_drop_table_for_mysql(table_name, trx, FALSE); + row_drop_table_for_mysql(table_name, trx, FALSE, TRUE); trx->error_state = DB_SUCCESS; } @@ -2659,7 +2662,7 @@ fts_get_next_doc_id( This function fetch the Doc ID from CONFIG table, and compare with the Doc ID supplied. And store the larger one to the CONFIG table. @return DB_SUCCESS if OK */ -static __attribute__((nonnull)) +static MY_ATTRIBUTE((nonnull)) dberr_t fts_cmp_set_sync_doc_id( /*====================*/ @@ -2886,41 +2889,34 @@ fts_doc_ids_free( } /*********************************************************************//** -Do commit-phase steps necessary for the insertion of a new row. -@return DB_SUCCESS or error code */ -static __attribute__((nonnull, warn_unused_result)) -dberr_t +Do commit-phase steps necessary for the insertion of a new row. */ +void fts_add( /*====*/ fts_trx_table_t*ftt, /*!< in: FTS trx table */ fts_trx_row_t* row) /*!< in: row */ { dict_table_t* table = ftt->table; - dberr_t error = DB_SUCCESS; doc_id_t doc_id = row->doc_id; ut_a(row->state == FTS_INSERT || row->state == FTS_MODIFY); fts_add_doc_by_id(ftt, doc_id, row->fts_indexes); - if (error == DB_SUCCESS) { - mutex_enter(&table->fts->cache->deleted_lock); - ++table->fts->cache->added; - mutex_exit(&table->fts->cache->deleted_lock); + mutex_enter(&table->fts->cache->deleted_lock); + ++table->fts->cache->added; + mutex_exit(&table->fts->cache->deleted_lock); - if (!DICT_TF2_FLAG_IS_SET(table, DICT_TF2_FTS_HAS_DOC_ID) - && doc_id >= table->fts->cache->next_doc_id) { - table->fts->cache->next_doc_id = doc_id + 1; - } + if (!DICT_TF2_FLAG_IS_SET(table, DICT_TF2_FTS_HAS_DOC_ID) + && doc_id >= table->fts->cache->next_doc_id) { + table->fts->cache->next_doc_id = doc_id + 1; } - - return(error); } /*********************************************************************//** Do commit-phase steps necessary for the deletion of a row. @return DB_SUCCESS or error code */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t fts_delete( /*=======*/ @@ -3011,7 +3007,7 @@ fts_delete( /*********************************************************************//** Do commit-phase steps necessary for the modification of a row. @return DB_SUCCESS or error code */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t fts_modify( /*=======*/ @@ -3025,7 +3021,7 @@ fts_modify( error = fts_delete(ftt, row); if (error == DB_SUCCESS) { - error = fts_add(ftt, row); + fts_add(ftt, row); } return(error); @@ -3082,7 +3078,7 @@ fts_create_doc_id( The given transaction is about to be committed; do whatever is necessary from the FTS system's POV. @return DB_SUCCESS or error code */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t fts_commit_table( /*=============*/ @@ -3114,7 +3110,7 @@ fts_commit_table( switch (row->state) { case FTS_INSERT: - error = fts_add(ftt, row); + fts_add(ftt, row); break; case FTS_MODIFY: @@ -3416,7 +3412,7 @@ fts_add_doc_by_id( /*==============*/ fts_trx_table_t*ftt, /*!< in: FTS trx table */ doc_id_t doc_id, /*!< in: doc id */ - ib_vector_t* fts_indexes __attribute__((unused))) + ib_vector_t* fts_indexes MY_ATTRIBUTE((unused))) /*!< in: affected fts indexes */ { mtr_t mtr; @@ -3536,7 +3532,7 @@ fts_add_doc_by_id( get_doc, clust_index, doc_pcur, offsets, &doc); if (doc.found) { - ibool success __attribute__((unused)); + ibool success MY_ATTRIBUTE((unused)); btr_pcur_store_position(doc_pcur, &mtr); mtr_commit(&mtr); @@ -3554,16 +3550,34 @@ fts_add_doc_by_id( get_doc->index_cache, doc_id, doc.tokens); + bool need_sync = false; + if ((cache->total_size > fts_max_cache_size / 10 + || fts_need_sync) + && !cache->sync->in_progress) { + need_sync = true; + } + rw_lock_x_unlock(&table->fts->cache->lock); DBUG_EXECUTE_IF( "fts_instrument_sync", - fts_sync(cache->sync); + fts_optimize_request_sync_table(table); + os_event_wait(cache->sync->event); ); - if (cache->total_size > fts_max_cache_size - || fts_need_sync) { - fts_sync(cache->sync); + DBUG_EXECUTE_IF( + "fts_instrument_sync_debug", + fts_sync(cache->sync, true, true); + ); + + DEBUG_SYNC_C("fts_instrument_sync_request"); + DBUG_EXECUTE_IF( + "fts_instrument_sync_request", + fts_optimize_request_sync_table(table); + ); + + if (need_sync) { + fts_optimize_request_sync_table(table); } mtr_start(&mtr); @@ -3627,7 +3641,7 @@ fts_get_max_doc_id( dict_table_t* table) /*!< in: user table */ { dict_index_t* index; - dict_field_t* dfield __attribute__((unused)) = NULL; + dict_field_t* dfield MY_ATTRIBUTE((unused)) = NULL; doc_id_t doc_id = 0; mtr_t mtr; btr_pcur_t pcur; @@ -3885,7 +3899,7 @@ fts_write_node( /*********************************************************************//** Add rows to the DELETED_CACHE table. @return DB_SUCCESS if all went well else error code*/ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t fts_sync_add_deleted_cache( /*=======================*/ @@ -3934,16 +3948,17 @@ fts_sync_add_deleted_cache( return(error); } -/*********************************************************************//** -Write the words and ilist to disk. +/** Write the words and ilist to disk. +@param[in,out] trx transaction +@param[in] index_cache index cache +@param[in] unlock_cache whether unlock cache when write node @return DB_SUCCESS if all went well else error code */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t fts_sync_write_words( -/*=================*/ - trx_t* trx, /*!< in: transaction */ - fts_index_cache_t* - index_cache) /*!< in: index cache */ + trx_t* trx, + fts_index_cache_t* index_cache, + bool unlock_cache) { fts_table_t fts_table; ulint n_nodes = 0; @@ -3951,8 +3966,8 @@ fts_sync_write_words( const ib_rbt_node_t* rbt_node; dberr_t error = DB_SUCCESS; ibool print_error = FALSE; -#ifdef FTS_DOC_STATS_DEBUG dict_table_t* table = index_cache->index->table; +#ifdef FTS_DOC_STATS_DEBUG ulint n_new_words = 0; #endif /* FTS_DOC_STATS_DEBUG */ @@ -3965,7 +3980,7 @@ fts_sync_write_words( since we want to free the memory used during caching. */ for (rbt_node = rbt_first(index_cache->words); rbt_node; - rbt_node = rbt_first(index_cache->words)) { + rbt_node = rbt_next(index_cache->words, rbt_node)) { ulint i; ulint selected; @@ -3998,27 +4013,47 @@ fts_sync_write_words( } #endif /* FTS_DOC_STATS_DEBUG */ - n_nodes += ib_vector_size(word->nodes); - - /* We iterate over all the nodes even if there was an error, - this is to free the memory of the fts_node_t elements. */ + /* We iterate over all the nodes even if there was an error */ for (i = 0; i < ib_vector_size(word->nodes); ++i) { fts_node_t* fts_node = static_cast( ib_vector_get(word->nodes, i)); + if (fts_node->synced) { + continue; + } else { + fts_node->synced = true; + } + + /*FIXME: we need to handle the error properly. */ if (error == DB_SUCCESS) { + if (unlock_cache) { + rw_lock_x_unlock( + &table->fts->cache->lock); + } error = fts_write_node( trx, &index_cache->ins_graph[selected], &fts_table, &word->text, fts_node); - } - ut_free(fts_node->ilist); - fts_node->ilist = NULL; + DEBUG_SYNC_C("fts_write_node"); + DBUG_EXECUTE_IF("fts_write_node_crash", + DBUG_SUICIDE();); + + DBUG_EXECUTE_IF("fts_instrument_sync_sleep", + os_thread_sleep(1000000); + ); + + if (unlock_cache) { + rw_lock_x_lock( + &table->fts->cache->lock); + } + } } + n_nodes += ib_vector_size(word->nodes); + if (error != DB_SUCCESS && !print_error) { ut_print_timestamp(stderr); fprintf(stderr, " InnoDB: Error (%s) writing " @@ -4027,9 +4062,6 @@ fts_sync_write_words( print_error = TRUE; } - - /* NOTE: We are responsible for free'ing the node */ - ut_free(rbt_remove_node(index_cache->words, rbt_node)); } #ifdef FTS_DOC_STATS_DEBUG @@ -4057,7 +4089,7 @@ fts_sync_write_words( /*********************************************************************//** Write a single documents statistics to disk. @return DB_SUCCESS if all went well else error code */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t fts_sync_write_doc_stat( /*====================*/ @@ -4311,7 +4343,7 @@ fts_sync_begin( Run SYNC on the table, i.e., write out data from the index specific cache to the FTS aux INDEX table and FTS aux doc id stats table. @return DB_SUCCESS if all OK */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t fts_sync_index( /*===========*/ @@ -4330,7 +4362,7 @@ fts_sync_index( ut_ad(rbt_validate(index_cache->words)); - error = fts_sync_write_words(trx, index_cache); + error = fts_sync_write_words(sync->trx, index_cache, sync->unlock_cache); #ifdef FTS_DOC_STATS_DEBUG /* FTS_RESOLVE: the word counter info in auxiliary table "DOC_ID" @@ -4346,10 +4378,40 @@ fts_sync_index( return(error); } +/** Check if index cache has been synced completely +@param[in,out] sync sync state +@param[in,out] index_cache index cache +@return true if index is synced, otherwise false. */ +static +bool +fts_sync_index_check( + fts_sync_t* sync, + fts_index_cache_t* index_cache) +{ + const ib_rbt_node_t* rbt_node; + + for (rbt_node = rbt_first(index_cache->words); + rbt_node != NULL; + rbt_node = rbt_next(index_cache->words, rbt_node)) { + + fts_tokenizer_word_t* word; + word = rbt_value(fts_tokenizer_word_t, rbt_node); + + fts_node_t* fts_node; + fts_node = static_cast(ib_vector_last(word->nodes)); + + if (!fts_node->synced) { + return(false); + } + } + + return(true); +} + /*********************************************************************//** Commit the SYNC, change state of processed doc ids etc. @return DB_SUCCESS if all OK */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t fts_sync_commit( /*============*/ @@ -4411,32 +4473,63 @@ fts_sync_commit( return(error); } -/*********************************************************************//** -Rollback a sync operation */ +/** Rollback a sync operation +@param[in,out] sync sync state */ static void fts_sync_rollback( -/*==============*/ - fts_sync_t* sync) /*!< in: sync state */ + fts_sync_t* sync) { trx_t* trx = sync->trx; fts_cache_t* cache = sync->table->fts->cache; + for (ulint i = 0; i < ib_vector_size(cache->indexes); ++i) { + ulint j; + fts_index_cache_t* index_cache; + + index_cache = static_cast( + ib_vector_get(cache->indexes, i)); + + for (j = 0; fts_index_selector[j].value; ++j) { + + if (index_cache->ins_graph[j] != NULL) { + + fts_que_graph_free_check_lock( + NULL, index_cache, + index_cache->ins_graph[j]); + + index_cache->ins_graph[j] = NULL; + } + + if (index_cache->sel_graph[j] != NULL) { + + fts_que_graph_free_check_lock( + NULL, index_cache, + index_cache->sel_graph[j]); + + index_cache->sel_graph[j] = NULL; + } + } + } + rw_lock_x_unlock(&cache->lock); fts_sql_rollback(trx); trx_free_for_background(trx); } -/****************************************************************//** -Run SYNC on the table, i.e., write out data from the cache to the +/** Run SYNC on the table, i.e., write out data from the cache to the FTS auxiliary INDEX table and clear the cache at the end. +@param[in,out] sync sync state +@param[in] unlock_cache whether unlock cache lock when write node +@param[in] wait whether wait when a sync is in progress @return DB_SUCCESS if all OK */ static dberr_t fts_sync( -/*=====*/ - fts_sync_t* sync) /*!< in: sync state */ + fts_sync_t* sync, + bool unlock_cache, + bool wait) { ulint i; dberr_t error = DB_SUCCESS; @@ -4444,8 +4537,35 @@ fts_sync( rw_lock_x_lock(&cache->lock); + /* Check if cache is being synced. + Note: we release cache lock in fts_sync_write_words() to + avoid long wait for the lock by other threads. */ + while (sync->in_progress) { + rw_lock_x_unlock(&cache->lock); + + if (wait) { + os_event_wait(sync->event); + } else { + return(DB_SUCCESS); + } + + rw_lock_x_lock(&cache->lock); + } + + sync->unlock_cache = unlock_cache; + sync->in_progress = true; + + DEBUG_SYNC_C("fts_sync_begin"); fts_sync_begin(sync); +begin_sync: + if (cache->total_size > fts_max_cache_size) { + /* Avoid the case: sync never finish when + insert/update keeps comming. */ + ut_ad(sync->unlock_cache); + sync->unlock_cache = false; + } + for (i = 0; i < ib_vector_size(cache->indexes); ++i) { fts_index_cache_t* index_cache; @@ -4460,21 +4580,43 @@ fts_sync( if (error != DB_SUCCESS && !sync->interrupted) { - break; + goto end_sync; } } DBUG_EXECUTE_IF("fts_instrument_sync_interrupted", sync->interrupted = true; error = DB_INTERRUPTED; + goto end_sync; ); + /* Make sure all the caches are synced. */ + for (i = 0; i < ib_vector_size(cache->indexes); ++i) { + fts_index_cache_t* index_cache; + + index_cache = static_cast( + ib_vector_get(cache->indexes, i)); + + if (index_cache->index->to_be_dropped + || fts_sync_index_check(sync, index_cache)) { + continue; + } + + goto begin_sync; + } + +end_sync: if (error == DB_SUCCESS && !sync->interrupted) { error = fts_sync_commit(sync); } else { fts_sync_rollback(sync); } + rw_lock_x_lock(&cache->lock); + sync->in_progress = false; + os_event_set(sync->event); + rw_lock_x_unlock(&cache->lock); + /* We need to check whether an optimize is required, for that we make copies of the two variables that control the trigger. These variables can change behind our back and we don't want to hold the @@ -4489,21 +4631,25 @@ fts_sync( return(error); } -/****************************************************************//** -Run SYNC on the table, i.e., write out data from the cache to the -FTS auxiliary INDEX table and clear the cache at the end. */ +/** Run SYNC on the table, i.e., write out data from the cache to the +FTS auxiliary INDEX table and clear the cache at the end. +@param[in,out] table fts table +@param[in] unlock_cache whether unlock cache when write node +@param[in] wait whether wait for existing sync to finish +@return DB_SUCCESS on success, error code on failure. */ UNIV_INTERN dberr_t fts_sync_table( -/*===========*/ - dict_table_t* table) /*!< in: table */ + dict_table_t* table, + bool unlock_cache, + bool wait) { dberr_t err = DB_SUCCESS; ut_ad(table->fts); if (!dict_table_is_discarded(table) && table->fts->cache) { - err = fts_sync(table->fts->cache->sync); + err = fts_sync(table->fts->cache->sync, unlock_cache, wait); } return(err); @@ -6022,7 +6168,7 @@ fts_update_hex_format_flag( /*********************************************************************//** Rename an aux table to HEX format. It's called when "%016llu" is used to format an object id in table name, which only happens in Windows. */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t fts_rename_one_aux_table_to_hex_format( /*===================================*/ @@ -6113,7 +6259,7 @@ Note the ids in tables are correct but the names are old ambiguous ones. This function should make sure that either all the parent table and aux tables are set DICT_TF2_FTS_AUX_HEX_NAME with flags2 or none of them are set */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t fts_rename_aux_tables_to_hex_format_low( /*====================================*/ @@ -6267,7 +6413,7 @@ fts_fake_hex_to_dec( { ib_id_t dec_id = 0; char tmp_id[FTS_AUX_MIN_TABLE_ID_LENGTH]; - int ret __attribute__((unused)); + int ret MY_ATTRIBUTE((unused)); ret = sprintf(tmp_id, UINT64PFx, id); ut_ad(ret == 16); @@ -6589,7 +6735,7 @@ fts_drop_aux_table_from_vector( Check and drop all orphaned FTS auxiliary tables, those that don't have a parent table or FTS index defined on them. @return DB_SUCCESS or error code */ -static __attribute__((nonnull)) +static MY_ATTRIBUTE((nonnull)) void fts_check_and_drop_orphaned_tables( /*===============================*/ diff --git a/storage/innobase/fts/fts0opt.cc b/storage/innobase/fts/fts0opt.cc index 00b3b4682c3..d9f2532578e 100644 --- a/storage/innobase/fts/fts0opt.cc +++ b/storage/innobase/fts/fts0opt.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2007, 2015, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2007, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -87,6 +87,7 @@ enum fts_msg_type_t { FTS_MSG_DEL_TABLE, /*!< Remove a table from the optimize threads work queue */ + FTS_MSG_SYNC_TABLE /*!< Sync fts cache of a table */ }; /** Compressed list of words that have been read from FTS INDEX @@ -796,7 +797,7 @@ fts_zip_deflate_end( Read the words from the FTS INDEX. @return DB_SUCCESS if all OK, DB_TABLE_NOT_FOUND if no more indexes to search else error code */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t fts_index_fetch_words( /*==================*/ @@ -1130,7 +1131,7 @@ fts_optimize_lookup( /**********************************************************************//** Encode the word pos list into the node @return DB_SUCCESS or error code*/ -static __attribute__((nonnull)) +static MY_ATTRIBUTE((nonnull)) dberr_t fts_optimize_encode_node( /*=====================*/ @@ -1219,7 +1220,7 @@ fts_optimize_encode_node( /**********************************************************************//** Optimize the data contained in a node. @return DB_SUCCESS or error code*/ -static __attribute__((nonnull)) +static MY_ATTRIBUTE((nonnull)) dberr_t fts_optimize_node( /*==============*/ @@ -1317,7 +1318,7 @@ test_again: /**********************************************************************//** Determine the starting pos within the deleted doc id vector for a word. @return delete position */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) int fts_optimize_deleted_pos( /*=====================*/ @@ -1446,7 +1447,7 @@ fts_optimize_word( /**********************************************************************//** Update the FTS index table. This is a delete followed by an insert. @return DB_SUCCESS or error code */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t fts_optimize_write_word( /*====================*/ @@ -1549,7 +1550,7 @@ fts_word_free( /**********************************************************************//** Optimize the word ilist and rewrite data to the FTS index. @return status one of RESTART, EXIT, ERROR */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t fts_optimize_compact( /*=================*/ @@ -1644,7 +1645,7 @@ fts_optimize_create( /**********************************************************************//** Get optimize start time of an FTS index. @return DB_SUCCESS if all OK else error code */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t fts_optimize_get_index_start_time( /*==============================*/ @@ -1660,7 +1661,7 @@ fts_optimize_get_index_start_time( /**********************************************************************//** Set the optimize start time of an FTS index. @return DB_SUCCESS if all OK else error code */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t fts_optimize_set_index_start_time( /*==============================*/ @@ -1676,7 +1677,7 @@ fts_optimize_set_index_start_time( /**********************************************************************//** Get optimize end time of an FTS index. @return DB_SUCCESS if all OK else error code */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t fts_optimize_get_index_end_time( /*============================*/ @@ -1691,7 +1692,7 @@ fts_optimize_get_index_end_time( /**********************************************************************//** Set the optimize end time of an FTS index. @return DB_SUCCESS if all OK else error code */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t fts_optimize_set_index_end_time( /*============================*/ @@ -1911,7 +1912,7 @@ fts_optimize_set_next_word( Optimize is complete. Set the completion time, and reset the optimize start string for this FTS index to "". @return DB_SUCCESS if all OK */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t fts_optimize_index_completed( /*=========================*/ @@ -1951,7 +1952,7 @@ fts_optimize_index_completed( Read the list of words from the FTS auxiliary index that will be optimized in this pass. @return DB_SUCCESS if all OK */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t fts_optimize_index_read_words( /*==========================*/ @@ -2008,7 +2009,7 @@ fts_optimize_index_read_words( Run OPTIMIZE on the given FTS index. Note: this can take a very long time (hours). @return DB_SUCCESS if all OK */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t fts_optimize_index( /*===============*/ @@ -2079,7 +2080,7 @@ fts_optimize_index( /**********************************************************************//** Delete the document ids in the delete, and delete cache tables. @return DB_SUCCESS if all OK */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t fts_optimize_purge_deleted_doc_ids( /*===============================*/ @@ -2148,7 +2149,7 @@ fts_optimize_purge_deleted_doc_ids( /**********************************************************************//** Delete the document ids in the pending delete, and delete tables. @return DB_SUCCESS if all OK */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t fts_optimize_purge_deleted_doc_id_snapshot( /*=======================================*/ @@ -2198,7 +2199,7 @@ Copy the deleted doc ids that will be purged during this optimize run to the being deleted FTS auxiliary tables. The transaction is committed upon successfull copy and rolled back on DB_DUPLICATE_KEY error. @return DB_SUCCESS if all OK */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t fts_optimize_create_deleted_doc_id_snapshot( /*========================================*/ @@ -2236,7 +2237,7 @@ fts_optimize_create_deleted_doc_id_snapshot( Read in the document ids that are to be purged during optimize. The transaction is committed upon successfully read. @return DB_SUCCESS if all OK */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t fts_optimize_read_deleted_doc_id_snapshot( /*======================================*/ @@ -2273,7 +2274,7 @@ Optimze all the FTS indexes, skipping those that have already been optimized, since the FTS auxiliary indexes are not guaranteed to be of the same cardinality. @return DB_SUCCESS if all OK */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t fts_optimize_indexes( /*=================*/ @@ -2343,7 +2344,7 @@ fts_optimize_indexes( /*********************************************************************//** Cleanup the snapshot tables and the master deleted table. @return DB_SUCCESS if all OK */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t fts_optimize_purge_snapshot( /*========================*/ @@ -2372,7 +2373,7 @@ fts_optimize_purge_snapshot( /*********************************************************************//** Reset the start time to 0 so that a new optimize can be started. @return DB_SUCCESS if all OK */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t fts_optimize_reset_start_time( /*==========================*/ @@ -2411,7 +2412,7 @@ fts_optimize_reset_start_time( /*********************************************************************//** Run OPTIMIZE on the given table by a background thread. @return DB_SUCCESS if all OK */ -static __attribute__((nonnull)) +static MY_ATTRIBUTE((nonnull)) dberr_t fts_optimize_table_bk( /*==================*/ @@ -2652,6 +2653,39 @@ fts_optimize_remove_table( os_event_free(event); } +/** Send sync fts cache for the table. +@param[in] table table to sync */ +UNIV_INTERN +void +fts_optimize_request_sync_table( + dict_table_t* table) +{ + fts_msg_t* msg; + table_id_t* table_id; + + /* if the optimize system not yet initialized, return */ + if (!fts_optimize_wq) { + return; + } + + /* FTS optimizer thread is already exited */ + if (fts_opt_start_shutdown) { + ib_logf(IB_LOG_LEVEL_INFO, + "Try to sync table %s after FTS optimize" + " thread exiting.", table->name); + return; + } + + msg = fts_optimize_create_msg(FTS_MSG_SYNC_TABLE, NULL); + + table_id = static_cast( + mem_heap_alloc(msg->heap, sizeof(table_id_t))); + *table_id = table->id; + msg->ptr = table_id; + + ib_wqueue_add(fts_optimize_wq, msg, msg->heap); +} + /**********************************************************************//** Find the slot for a particular table. @return slot if found else NULL. */ @@ -2723,6 +2757,7 @@ fts_optimize_new_table( empty_slot = i; } else if (slot->table->id == table->id) { /* Already exists in our optimize queue. */ + ut_ad(slot->table_id = table->id); return(FALSE); } } @@ -2932,6 +2967,34 @@ fts_optimize_need_sync( } #endif +/** Sync fts cache of a table +@param[in] table_id table id */ +void +fts_optimize_sync_table( + table_id_t table_id) +{ + dict_table_t* table = NULL; + + /* Prevent DROP INDEX etc. from running when we are syncing + cache in background. */ + if (!rw_lock_s_lock_nowait(&dict_operation_lock, __FILE__, __LINE__)) { + /* Exit when fail to get dict operation lock. */ + return; + } + + table = dict_table_open_on_id(table_id, FALSE, DICT_TABLE_OP_NORMAL); + + if (table) { + if (dict_table_has_fts_index(table) && table->fts->cache) { + fts_sync_table(table, true, false); + } + + dict_table_close(table, FALSE, FALSE); + } + + rw_lock_s_unlock(&dict_operation_lock); +} + /**********************************************************************//** Optimize all FTS tables. @return Dummy return */ @@ -3053,6 +3116,11 @@ fts_optimize_thread( ((fts_msg_del_t*) msg->ptr)->event); break; + case FTS_MSG_SYNC_TABLE: + fts_optimize_sync_table( + *static_cast(msg->ptr)); + break; + default: ut_error; } @@ -3079,26 +3147,7 @@ fts_optimize_thread( ib_vector_get(tables, i)); if (slot->state != FTS_STATE_EMPTY) { - dict_table_t* table = NULL; - - /*slot->table may be freed, so we try to open - table by slot->table_id.*/ - table = dict_table_open_on_id( - slot->table_id, FALSE, - DICT_TABLE_OP_NORMAL); - - if (table) { - - if (dict_table_has_fts_index(table)) { - fts_sync_table(table); - } - - if (table->fts) { - fts_free(table); - } - - dict_table_close(table, FALSE, FALSE); - } + fts_optimize_sync_table(slot->table_id); } } } diff --git a/storage/innobase/fts/fts0que.cc b/storage/innobase/fts/fts0que.cc index 9fa38cde561..26bd0378aed 100644 --- a/storage/innobase/fts/fts0que.cc +++ b/storage/innobase/fts/fts0que.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2007, 2015, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2007, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -287,7 +287,7 @@ fts_expand_query( dict_index_t* index, /*!< in: FTS index to search */ fts_query_t* query) /*!< in: query result, to be freed by the client */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /*************************************************************//** This function finds documents that contain all words in a phrase or proximity search. And if proximity search, verify @@ -1128,7 +1128,7 @@ cont_search: /*****************************************************************//** Set difference. @return DB_SUCCESS if all go well */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t fts_query_difference( /*=================*/ @@ -1220,7 +1220,7 @@ fts_query_difference( /*****************************************************************//** Intersect the token doc ids with the current set. @return DB_SUCCESS if all go well */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t fts_query_intersect( /*================*/ @@ -1398,7 +1398,7 @@ fts_query_cache( /*****************************************************************//** Set union. @return DB_SUCCESS if all go well */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t fts_query_union( /*============*/ @@ -2015,7 +2015,7 @@ fts_query_select( Read the rows from the FTS index, that match word and where the doc id is between first and last doc id. @return DB_SUCCESS if all go well else error code */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t fts_query_find_term( /*================*/ @@ -2155,7 +2155,7 @@ fts_query_sum( /******************************************************************** Calculate the total documents that contain a particular word (term). @return DB_SUCCESS if all go well else error code */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t fts_query_total_docs_containing_term( /*=================================*/ @@ -2234,7 +2234,7 @@ fts_query_total_docs_containing_term( /******************************************************************** Get the total number of words in a documents. @return DB_SUCCESS if all go well else error code */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t fts_query_terms_in_document( /*========================*/ @@ -2315,7 +2315,7 @@ fts_query_terms_in_document( /*****************************************************************//** Retrieve the document and match the phrase tokens. @return DB_SUCCESS or error code */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t fts_query_match_document( /*=====================*/ @@ -2361,7 +2361,7 @@ fts_query_match_document( This function fetches the original documents and count the words in between matching words to see that is in specified distance @return DB_SUCCESS if all OK */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) bool fts_query_is_in_proximity_range( /*============================*/ @@ -2416,7 +2416,7 @@ fts_query_is_in_proximity_range( Iterate over the matched document ids and search the for the actual phrase in the text. @return DB_SUCCESS if all OK */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t fts_query_search_phrase( /*====================*/ @@ -2504,7 +2504,7 @@ func_exit: /*****************************************************************//** Text/Phrase search. @return DB_SUCCESS or error code */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t fts_query_phrase_search( /*====================*/ @@ -2755,7 +2755,7 @@ func_exit: /*****************************************************************//** Find the word and evaluate. @return DB_SUCCESS if all go well */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t fts_query_execute( /*==============*/ @@ -4126,7 +4126,7 @@ words in documents found in the first search pass will be used as search arguments to search the document again, thus "expand" the search result set. @return DB_SUCCESS if success, otherwise the error code */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t fts_expand_query( /*=============*/ diff --git a/storage/innobase/fts/fts0tlex.cc b/storage/innobase/fts/fts0tlex.cc index b744fbf0763..d4d9b4c48d1 100644 --- a/storage/innobase/fts/fts0tlex.cc +++ b/storage/innobase/fts/fts0tlex.cc @@ -305,9 +305,9 @@ YY_BUFFER_STATE fts0t_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner YY_BUFFER_STATE fts0t_scan_string (yyconst char *yy_str ,yyscan_t yyscanner ); YY_BUFFER_STATE fts0t_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner ); -void *fts0talloc (yy_size_t , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) ); -void *fts0trealloc (void *,yy_size_t , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) ); -void fts0tfree (void * , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) ); +void *fts0talloc (yy_size_t , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) ); +void *fts0trealloc (void *,yy_size_t , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) ); +void fts0tfree (void * , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) ); #define yy_new_buffer fts0t_create_buffer @@ -347,7 +347,7 @@ typedef int yy_state_type; static yy_state_type yy_get_previous_state (yyscan_t yyscanner ); static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner); static int yy_get_next_buffer (yyscan_t yyscanner ); -static void yy_fatal_error (yyconst char msg[] , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) ); +static void yy_fatal_error (yyconst char msg[] , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) ); /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. @@ -447,7 +447,7 @@ static yyconst flex_int16_t yy_chk[29] = #line 1 "fts0tlex.l" /***************************************************************************** -Copyright (c) 2007, 2014, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2007, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -575,11 +575,11 @@ extern int fts0twrap (yyscan_t yyscanner ); #endif #ifndef yytext_ptr -static void yy_flex_strncpy (char *,yyconst char *,int , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused))); +static void yy_flex_strncpy (char *,yyconst char *,int , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused))); #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused))); +static int yy_flex_strlen (yyconst char * , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused))); #endif #ifndef YY_NO_INPUT @@ -1602,7 +1602,7 @@ YY_BUFFER_STATE fts0t_scan_bytes (yyconst char * yybytes, int _yybytes_len , y #define YY_EXIT_FAILURE 2 #endif -static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused))) +static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused))) { (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); @@ -1903,7 +1903,7 @@ int fts0tlex_destroy (yyscan_t yyscanner) */ #ifndef yytext_ptr -static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused))) +static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused))) { register int i; for ( i = 0; i < n; ++i ) @@ -1912,7 +1912,7 @@ static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yys #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused))) +static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused))) { register int n; for ( n = 0; s[n]; ++n ) @@ -1922,12 +1922,12 @@ static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner __at } #endif -void *fts0talloc (yy_size_t size , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused))) +void *fts0talloc (yy_size_t size , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused))) { return (void *) malloc( size ); } -void *fts0trealloc (void * ptr, yy_size_t size , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused))) +void *fts0trealloc (void * ptr, yy_size_t size , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused))) { /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those @@ -1939,7 +1939,7 @@ void *fts0trealloc (void * ptr, yy_size_t size , yyscan_t yyscanner return (void *) realloc( (char *) ptr, size ); } -void fts0tfree (void * ptr , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused))) +void fts0tfree (void * ptr , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused))) { free( (char *) ptr ); /* see fts0trealloc() for (char *) cast */ } diff --git a/storage/innobase/fts/make_parser.sh b/storage/innobase/fts/make_parser.sh index 2c072914c8b..52b63eff674 100755 --- a/storage/innobase/fts/make_parser.sh +++ b/storage/innobase/fts/make_parser.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (c) 2007, 2011, Oracle and/or its affiliates. All Rights Reserved. +# Copyright (c) 2007, 2016, Oracle and/or its affiliates. All Rights Reserved. # # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free Software @@ -22,15 +22,15 @@ make -f Makefile.query echo '#include "univ.i"' > $TMPF # This is to avoid compiler warning about unused parameters. -# FIXME: gcc extension "__attribute__" causing compilation errors on windows +# FIXME: gcc extension "MY_ATTRIBUTE" causing compilation errors on windows # platform. Quote them out for now. sed -e ' -s/^\(static.*void.*yy_fatal_error.*msg.*,\)\(.*yyscanner\)/\1 \2 __attribute__((unused))/; -s/^\(static.*void.*yy_flex_strncpy.*n.*,\)\(.*yyscanner\)/\1 \2 __attribute__((unused))/; -s/^\(static.*int.*yy_flex_strlen.*s.*,\)\(.*yyscanner\)/\1 \2 __attribute__((unused))/; -s/^\(\(static\|void\).*fts0[bt]alloc.*,\)\(.*yyscanner\)/\1 \3 __attribute__((unused))/; -s/^\(\(static\|void\).*fts0[bt]realloc.*,\)\(.*yyscanner\)/\1 \3 __attribute__((unused))/; -s/^\(\(static\|void\).*fts0[bt]free.*,\)\(.*yyscanner\)/\1 \3 __attribute__((unused))/; +s/^\(static.*void.*yy_fatal_error.*msg.*,\)\(.*yyscanner\)/\1 \2 MY_ATTRIBUTE((unused))/; +s/^\(static.*void.*yy_flex_strncpy.*n.*,\)\(.*yyscanner\)/\1 \2 MY_ATTRIBUTE((unused))/; +s/^\(static.*int.*yy_flex_strlen.*s.*,\)\(.*yyscanner\)/\1 \2 MY_ATTRIBUTE((unused))/; +s/^\(\(static\|void\).*fts0[bt]alloc.*,\)\(.*yyscanner\)/\1 \3 MY_ATTRIBUTE((unused))/; +s/^\(\(static\|void\).*fts0[bt]realloc.*,\)\(.*yyscanner\)/\1 \3 MY_ATTRIBUTE((unused))/; +s/^\(\(static\|void\).*fts0[bt]free.*,\)\(.*yyscanner\)/\1 \3 MY_ATTRIBUTE((unused))/; ' < fts0blex.cc >> $TMPF mv $TMPF fts0blex.cc @@ -38,12 +38,12 @@ mv $TMPF fts0blex.cc echo '#include "univ.i"' > $TMPF sed -e ' -s/^\(static.*void.*yy_fatal_error.*msg.*,\)\(.*yyscanner\)/\1 \2 __attribute__((unused))/; -s/^\(static.*void.*yy_flex_strncpy.*n.*,\)\(.*yyscanner\)/\1 \2 __attribute__((unused))/; -s/^\(static.*int.*yy_flex_strlen.*s.*,\)\(.*yyscanner\)/\1 \2 __attribute__((unused))/; -s/^\(\(static\|void\).*fts0[bt]alloc.*,\)\(.*yyscanner\)/\1 \3 __attribute__((unused))/; -s/^\(\(static\|void\).*fts0[bt]realloc.*,\)\(.*yyscanner\)/\1 \3 __attribute__((unused))/; -s/^\(\(static\|void\).*fts0[bt]free.*,\)\(.*yyscanner\)/\1 \3 __attribute__((unused))/; +s/^\(static.*void.*yy_fatal_error.*msg.*,\)\(.*yyscanner\)/\1 \2 MY_ATTRIBUTE((unused))/; +s/^\(static.*void.*yy_flex_strncpy.*n.*,\)\(.*yyscanner\)/\1 \2 MY_ATTRIBUTE((unused))/; +s/^\(static.*int.*yy_flex_strlen.*s.*,\)\(.*yyscanner\)/\1 \2 MY_ATTRIBUTE((unused))/; +s/^\(\(static\|void\).*fts0[bt]alloc.*,\)\(.*yyscanner\)/\1 \3 MY_ATTRIBUTE((unused))/; +s/^\(\(static\|void\).*fts0[bt]realloc.*,\)\(.*yyscanner\)/\1 \3 MY_ATTRIBUTE((unused))/; +s/^\(\(static\|void\).*fts0[bt]free.*,\)\(.*yyscanner\)/\1 \3 MY_ATTRIBUTE((unused))/; ' < fts0tlex.cc >> $TMPF mv $TMPF fts0tlex.cc diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 150f21ad8ae..604adfadae3 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2000, 2015, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2000, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2008, 2009 Google Inc. Copyright (c) 2009, Percona Inc. Copyright (c) 2012, Facebook Inc. @@ -1752,7 +1752,7 @@ thd_set_lock_wait_time( /********************************************************************//** Obtain the InnoDB transaction of a MySQL thread. @return reference to transaction pointer */ -__attribute__((warn_unused_result, nonnull)) +MY_ATTRIBUTE((warn_unused_result, nonnull)) static inline trx_t*& thd_to_trx( @@ -2726,7 +2726,7 @@ ha_innobase::ha_innobase( :handler(hton, table_arg), int_table_flags(HA_REC_NOT_IN_SEQ | HA_NULL_IN_KEY | HA_CAN_VIRTUAL_COLUMNS | - HA_CAN_INDEX_BLOBS | + HA_CAN_INDEX_BLOBS | HA_CONCURRENT_OPTIMIZE | HA_CAN_SQL_HANDLER | HA_PRIMARY_KEY_REQUIRED_FOR_POSITION | HA_PRIMARY_KEY_IN_READ_INDEX | @@ -3807,6 +3807,14 @@ innobase_change_buffering_inited_ok: innobase_open_files = tc_size; } } + + if (innobase_open_files > (long) tc_size) { + fprintf(stderr, + "innodb_open_files should not be greater" + " than the open_files_limit.\n"); + innobase_open_files = tc_size; + } + srv_max_n_open_files = (ulint) innobase_open_files; srv_innodb_status = (ibool) innobase_create_status_file; @@ -3975,7 +3983,7 @@ int innobase_end( /*=========*/ handlerton* hton, /*!< in/out: InnoDB handlerton */ - ha_panic_function type __attribute__((unused))) + ha_panic_function type MY_ATTRIBUTE((unused))) /*!< in: ha_panic() parameter */ { int err= 0; @@ -5934,20 +5942,14 @@ table_opened: prebuilt->clust_index_was_generated = FALSE; if (UNIV_UNLIKELY(primary_key >= MAX_KEY)) { - sql_print_error("Table %s has a primary key in " - "InnoDB data dictionary, but not " - "in MySQL!", name); + ib_table->dict_frm_mismatch = DICT_FRM_NO_PK; /* This mismatch could cause further problems if not attended, bring this to the user's attention by printing a warning in addition to log a message in the errorlog */ - push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, - ER_NO_SUCH_INDEX, - "InnoDB: Table %s has a " - "primary key in InnoDB data " - "dictionary, but not in " - "MySQL!", name); + + ib_push_frm_error(thd, ib_table, table, 0, true); /* If primary_key >= MAX_KEY, its (primary_key) value could be out of bound if continue to index @@ -5994,27 +5996,14 @@ table_opened: } } else { if (primary_key != MAX_KEY) { - sql_print_error( - "Table %s has no primary key in InnoDB data " - "dictionary, but has one in MySQL! If you " - "created the table with a MySQL version < " - "3.23.54 and did not define a primary key, " - "but defined a unique key with all non-NULL " - "columns, then MySQL internally treats that " - "key as the primary key. You can fix this " - "error by dump + DROP + CREATE + reimport " - "of the table.", name); + + ib_table->dict_frm_mismatch = DICT_NO_PK_FRM_HAS; /* This mismatch could cause further problems if not attended, bring this to the user attention by printing a warning in addition to log a message in the errorlog */ - push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, - ER_NO_SUCH_INDEX, - "InnoDB: Table %s has no " - "primary key in InnoDB data " - "dictionary, but has one in " - "MySQL!", name); + ib_push_frm_error(thd, ib_table, table, 0, true); } prebuilt->clust_index_was_generated = TRUE; @@ -10604,7 +10593,7 @@ create_table_check_doc_id_col( /*****************************************************************//** Creates a table definition to an InnoDB database. */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) int create_table_def( /*=============*/ @@ -12278,6 +12267,25 @@ ha_innobase::discard_or_import_tablespace( /* Commit the transaction in order to release the table lock. */ trx_commit_for_mysql(prebuilt->trx); + if (err == DB_SUCCESS && !discard + && dict_stats_is_persistent_enabled(dict_table)) { + dberr_t ret; + + /* Adjust the persistent statistics. */ + ret = dict_stats_update(dict_table, + DICT_STATS_RECALC_PERSISTENT); + + if (ret != DB_SUCCESS) { + push_warning_printf( + ha_thd(), + Sql_condition::WARN_LEVEL_WARN, + ER_ALTER_INFO, + "Error updating stats for table '%s'" + " after table rebuild: %s", + dict_table->name, ut_strerr(ret)); + } + } + DBUG_RETURN(convert_error_code_to_mysql(err, dict_table->flags, NULL)); } @@ -12399,7 +12407,8 @@ ha_innobase::delete_table( /* Drop the table in InnoDB */ err = row_drop_table_for_mysql( - norm_name, trx, thd_sql_command(thd) == SQLCOM_DROP_DB); + norm_name, trx, thd_sql_command(thd) == SQLCOM_DROP_DB, + FALSE); if (err == DB_TABLE_NOT_FOUND @@ -12430,7 +12439,8 @@ ha_innobase::delete_table( #endif err = row_drop_table_for_mysql( par_case_name, trx, - thd_sql_command(thd) == SQLCOM_DROP_DB); + thd_sql_command(thd) == SQLCOM_DROP_DB, + FALSE); } } @@ -12622,7 +12632,7 @@ innobase_drop_database( /*********************************************************************//** Renames an InnoDB table. @return DB_SUCCESS or error code */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t innobase_rename_table( /*==================*/ @@ -13484,12 +13494,8 @@ ha_innobase::info_low( } if (table->s->keys != num_innodb_index) { - sql_print_error("InnoDB: Table %s contains %lu " - "indexes inside InnoDB, which " - "is different from the number of " - "indexes %u defined in the MySQL ", - ib_table->name, num_innodb_index, - table->s->keys); + ib_table->dict_frm_mismatch = DICT_FRM_INCONSISTENT_KEYS; + ib_push_frm_error(user_thd, ib_table, table, num_innodb_index, true); } if (!(flag & HA_STATUS_NO_LOCK)) { @@ -13509,15 +13515,8 @@ ha_innobase::info_low( dict_index_t* index = innobase_get_index(i); if (index == NULL) { - sql_print_error("Table %s contains fewer " - "indexes inside InnoDB than " - "are defined in the MySQL " - ".frm file. Have you mixed up " - ".frm files from different " - "installations? See " - REFMAN - "innodb-troubleshooting.html\n", - ib_table->name); + ib_table->dict_frm_mismatch = DICT_FRM_INCONSISTENT_KEYS; + ib_push_frm_error(user_thd, ib_table, table, num_innodb_index, true); break; } @@ -13547,14 +13546,15 @@ ha_innobase::info_low( break; } - DBUG_EXECUTE_IF("ib_ha_innodb_stat_not_initialized", + DBUG_EXECUTE_IF("ib_ha_innodb_stat_not_initialized", index->table->stat_initialized = FALSE;); if (!ib_table->stat_initialized || (index->table != ib_table || !index->table->stat_initialized)) { fprintf(stderr, - "InnoDB: Warning: Index %s points to table %s" " and ib_table %s statistics is initialized %d " + "InnoDB: Warning: Index %s points to table %s" + " and ib_table %s statistics is initialized %d " " but index table %s initialized %d " " mysql table is %s. Have you mixed " "up .frm files from different " @@ -13732,7 +13732,7 @@ ha_innobase::optimize( if (innodb_optimize_fulltext_only) { if (prebuilt->table->fts && prebuilt->table->fts->cache && !dict_table_is_discarded(prebuilt->table)) { - fts_sync_table(prebuilt->table); + fts_sync_table(prebuilt->table, false, true); fts_optimize_table(prebuilt->table); } return(HA_ADMIN_OK); @@ -13794,6 +13794,35 @@ ha_innobase::check( DBUG_RETURN(HA_ADMIN_CORRUPT); } + if (prebuilt->table->corrupted) { + char index_name[MAX_FULL_NAME_LEN + 1]; + /* If some previous operation has marked the table as + corrupted in memory, and has not propagated such to + clustered index, we will do so here */ + index = dict_table_get_first_index(prebuilt->table); + + if (!dict_index_is_corrupted(index)) { + row_mysql_lock_data_dictionary(prebuilt->trx); + dict_set_corrupted(index, prebuilt->trx, "CHECK TABLE"); + row_mysql_unlock_data_dictionary(prebuilt->trx); + } + + innobase_format_name(index_name, sizeof index_name, + index->name, TRUE); + + push_warning_printf(thd, + Sql_condition::WARN_LEVEL_WARN, + HA_ERR_INDEX_CORRUPT, + "InnoDB: Index %s is marked as" + " corrupted", index_name); + + /* Now that the table is already marked as corrupted, + there is no need to check any index of this table */ + prebuilt->trx->op_info = ""; + + DBUG_RETURN(HA_ADMIN_CORRUPT); + } + prebuilt->trx->op_info = "checking table"; old_isolation_level = prebuilt->trx->isolation_level; @@ -13877,6 +13906,15 @@ ha_innobase::check( prebuilt->index_usable = row_merge_is_index_usable( prebuilt->trx, prebuilt->index); + DBUG_EXECUTE_IF( + "dict_set_index_corrupted", + if (!dict_index_is_clust(index)) { + prebuilt->index_usable = FALSE; + row_mysql_lock_data_dictionary(prebuilt->trx); + dict_set_corrupted(index, prebuilt->trx, "dict_set_index_corrupted");; + row_mysql_unlock_data_dictionary(prebuilt->trx); + }); + if (UNIV_UNLIKELY(!prebuilt->index_usable)) { innobase_format_name( index_name, sizeof index_name, @@ -15464,6 +15502,7 @@ ha_innobase::store_lock( /* Use consistent read for checksum table */ if (sql_command == SQLCOM_CHECKSUM + || (sql_command == SQLCOM_ANALYZE && lock_type == TL_READ) || ((srv_locks_unsafe_for_binlog || trx->isolation_level <= TRX_ISO_READ_COMMITTED) && trx->isolation_level != TRX_ISO_SERIALIZABLE @@ -17596,7 +17635,7 @@ static char* srv_buffer_pool_evict; Evict all uncompressed pages of compressed tables from the buffer pool. Keep the compressed pages in the buffer pool. @return whether all uncompressed pages were evicted */ -static __attribute__((warn_unused_result)) +static MY_ATTRIBUTE((warn_unused_result)) bool innodb_buffer_pool_evict_uncompressed(void) /*=======================================*/ @@ -17753,7 +17792,7 @@ innodb_defragment_frequency_update( { srv_defragment_frequency = (*static_cast(save)); srv_defragment_interval = ut_microseconds_to_timer( - 1000000.0 / srv_defragment_frequency); + (ulonglong) (1000000.0 / srv_defragment_frequency)); } /****************************************************************//** @@ -17941,13 +17980,13 @@ void purge_run_now_set( /*==============*/ THD* thd /*!< in: thread handle */ - __attribute__((unused)), + MY_ATTRIBUTE((unused)), struct st_mysql_sys_var* var /*!< in: pointer to system variable */ - __attribute__((unused)), + MY_ATTRIBUTE((unused)), void* var_ptr /*!< out: where the formal string goes */ - __attribute__((unused)), + MY_ATTRIBUTE((unused)), const void* save) /*!< in: immediate result from check function */ { @@ -17964,13 +18003,13 @@ void purge_stop_now_set( /*===============*/ THD* thd /*!< in: thread handle */ - __attribute__((unused)), + MY_ATTRIBUTE((unused)), struct st_mysql_sys_var* var /*!< in: pointer to system variable */ - __attribute__((unused)), + MY_ATTRIBUTE((unused)), void* var_ptr /*!< out: where the formal string goes */ - __attribute__((unused)), + MY_ATTRIBUTE((unused)), const void* save) /*!< in: immediate result from check function */ { @@ -17986,13 +18025,13 @@ void checkpoint_now_set( /*===============*/ THD* thd /*!< in: thread handle */ - __attribute__((unused)), + MY_ATTRIBUTE((unused)), struct st_mysql_sys_var* var /*!< in: pointer to system variable */ - __attribute__((unused)), + MY_ATTRIBUTE((unused)), void* var_ptr /*!< out: where the formal string goes */ - __attribute__((unused)), + MY_ATTRIBUTE((unused)), const void* save) /*!< in: immediate result from check function */ { @@ -18013,13 +18052,13 @@ void buf_flush_list_now_set( /*===================*/ THD* thd /*!< in: thread handle */ - __attribute__((unused)), + MY_ATTRIBUTE((unused)), struct st_mysql_sys_var* var /*!< in: pointer to system variable */ - __attribute__((unused)), + MY_ATTRIBUTE((unused)), void* var_ptr /*!< out: where the formal string goes */ - __attribute__((unused)), + MY_ATTRIBUTE((unused)), const void* save) /*!< in: immediate result from check function */ { @@ -18116,13 +18155,13 @@ void buffer_pool_dump_now( /*=================*/ THD* thd /*!< in: thread handle */ - __attribute__((unused)), + MY_ATTRIBUTE((unused)), struct st_mysql_sys_var* var /*!< in: pointer to system variable */ - __attribute__((unused)), + MY_ATTRIBUTE((unused)), void* var_ptr /*!< out: where the formal string goes */ - __attribute__((unused)), + MY_ATTRIBUTE((unused)), const void* save) /*!< in: immediate result from check function */ { @@ -18308,22 +18347,22 @@ wsrep_innobase_kill_one_trx( if (!thd) { DBUG_PRINT("wsrep", ("no thd for conflicting lock")); - WSREP_WARN("no THD for trx: %lu", victim_trx->id); + WSREP_WARN("no THD for trx: %lu", (ulong) victim_trx->id); DBUG_RETURN(1); } if (!bf_thd) { DBUG_PRINT("wsrep", ("no BF thd for conflicting lock")); - WSREP_WARN("no BF THD for trx: %lu", (bf_trx) ? bf_trx->id : 0); + WSREP_WARN("no BF THD for trx: %lu", (bf_trx) ? (ulong) bf_trx->id : (ulong) 0); DBUG_RETURN(1); } WSREP_LOG_CONFLICT(bf_thd, thd, TRUE); - WSREP_DEBUG("BF kill (%lu, seqno: %lld), victim: (%lu) trx: %lu", + WSREP_DEBUG("BF kill (%lu, seqno: %lld), victim: (%lu) trx: %llu", signal, (long long)bf_seqno, thd_get_thread_id(thd), - victim_trx->id); + (ulonglong) victim_trx->id); WSREP_DEBUG("Aborting query: %s", (thd && wsrep_thd_query(thd)) ? wsrep_thd_query(thd) : "void"); @@ -18340,14 +18379,15 @@ wsrep_innobase_kill_one_trx( if (wsrep_thd_query_state(thd) == QUERY_EXITING) { - WSREP_DEBUG("kill trx EXITING for %lu", victim_trx->id); + WSREP_DEBUG("kill trx EXITING for %llu", + (ulonglong) victim_trx->id); wsrep_thd_UNLOCK(thd); DBUG_RETURN(0); } if(wsrep_thd_exec_mode(thd) != LOCAL_STATE) { - WSREP_DEBUG("withdraw for BF trx: %lu, state: %d", - victim_trx->id, + WSREP_DEBUG("withdraw for BF trx: %llu, state: %d", + (longlong) victim_trx->id, wsrep_thd_get_conflict_state(thd)); } @@ -18356,8 +18396,8 @@ wsrep_innobase_kill_one_trx( wsrep_thd_set_conflict_state(thd, MUST_ABORT); break; case MUST_ABORT: - WSREP_DEBUG("victim %lu in MUST ABORT state", - victim_trx->id); + WSREP_DEBUG("victim %llu in MUST ABORT state", + (longlong) victim_trx->id); wsrep_thd_UNLOCK(thd); wsrep_thd_awake(thd, signal); DBUG_RETURN(0); @@ -18365,8 +18405,9 @@ wsrep_innobase_kill_one_trx( case ABORTED: case ABORTING: // fall through default: - WSREP_DEBUG("victim %lu in state %d", - victim_trx->id, wsrep_thd_get_conflict_state(thd)); + WSREP_DEBUG("victim %llu in state %d", + (longlong) victim_trx->id, + wsrep_thd_get_conflict_state(thd)); wsrep_thd_UNLOCK(thd); DBUG_RETURN(0); break; @@ -18378,8 +18419,8 @@ wsrep_innobase_kill_one_trx( WSREP_DEBUG("kill query for: %ld", thd_get_thread_id(thd)); - WSREP_DEBUG("kill trx QUERY_COMMITTING for %lu", - victim_trx->id); + WSREP_DEBUG("kill trx QUERY_COMMITTING for %llu", + (longlong) victim_trx->id); if (wsrep_thd_exec_mode(thd) == REPL_RECV) { wsrep_abort_slave_trx(bf_seqno, @@ -18393,8 +18434,8 @@ wsrep_innobase_kill_one_trx( switch (rcode) { case WSREP_WARNING: - WSREP_DEBUG("cancel commit warning: %lu", - victim_trx->id); + WSREP_DEBUG("cancel commit warning: %llu", + (ulonglong) victim_trx->id); wsrep_thd_UNLOCK(thd); wsrep_thd_awake(thd, signal); DBUG_RETURN(1); @@ -18403,9 +18444,9 @@ wsrep_innobase_kill_one_trx( break; default: WSREP_ERROR( - "cancel commit bad exit: %d %lu", + "cancel commit bad exit: %d %llu", rcode, - victim_trx->id); + (ulonglong) victim_trx->id); /* unable to interrupt, must abort */ /* note: kill_mysql() will block, if we cannot. * kill the lock holder first. @@ -18421,7 +18462,8 @@ wsrep_innobase_kill_one_trx( /* it is possible that victim trx is itself waiting for some * other lock. We need to cancel this waiting */ - WSREP_DEBUG("kill trx QUERY_EXEC for %lu", victim_trx->id); + WSREP_DEBUG("kill trx QUERY_EXEC for %llu", + (ulonglong) victim_trx->id); victim_trx->lock.was_chosen_as_deadlock_victim= TRUE; if (victim_trx->lock.wait_lock) { @@ -18456,7 +18498,7 @@ wsrep_innobase_kill_one_trx( break; case QUERY_IDLE: { - WSREP_DEBUG("kill IDLE for %lu", victim_trx->id); + WSREP_DEBUG("kill IDLE for %llu", (ulonglong) victim_trx->id); if (wsrep_thd_exec_mode(thd) == REPL_RECV) { WSREP_DEBUG("kill BF IDLE, seqno: %lld", @@ -18473,7 +18515,7 @@ wsrep_innobase_kill_one_trx( if (wsrep_aborting_thd_contains(thd)) { WSREP_WARN("duplicate thd aborter %lu", - thd_get_thread_id(thd)); + (ulong) thd_get_thread_id(thd)); } else { wsrep_aborting_thd_enqueue(thd); DBUG_PRINT("wsrep",("enqueuing trx abort for %lu", @@ -20617,3 +20659,96 @@ ib_push_warning( my_free(buf); va_end(args); } + +/********************************************************************//** +Helper function to push frm mismatch error to error log and +if needed to sql-layer. */ +UNIV_INTERN +void +ib_push_frm_error( +/*==============*/ + THD* thd, /*!< in: MySQL thd */ + dict_table_t* ib_table, /*!< in: InnoDB table */ + TABLE* table, /*!< in: MySQL table */ + ulint n_keys, /*!< in: InnoDB #keys */ + bool push_warning) /*!< in: print warning ? */ +{ + switch (ib_table->dict_frm_mismatch) { + case DICT_FRM_NO_PK: + sql_print_error("Table %s has a primary key in " + "InnoDB data dictionary, but not " + "in MySQL!" + " Have you mixed up " + ".frm files from different " + "installations? See " + REFMAN + "innodb-troubleshooting.html\n", + ib_table->name); + + if (push_warning) { + push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, + ER_NO_SUCH_INDEX, + "InnoDB: Table %s has a " + "primary key in InnoDB data " + "dictionary, but not in " + "MySQL!", ib_table->name); + } + break; + case DICT_NO_PK_FRM_HAS: + sql_print_error( + "Table %s has no primary key in InnoDB data " + "dictionary, but has one in MySQL! If you " + "created the table with a MySQL version < " + "3.23.54 and did not define a primary key, " + "but defined a unique key with all non-NULL " + "columns, then MySQL internally treats that " + "key as the primary key. You can fix this " + "error by dump + DROP + CREATE + reimport " + "of the table.", ib_table->name); + + if (push_warning) { + push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, + ER_NO_SUCH_INDEX, + "InnoDB: Table %s has no " + "primary key in InnoDB data " + "dictionary, but has one in " + "MySQL!", + ib_table->name); + } + break; + + case DICT_FRM_INCONSISTENT_KEYS: + sql_print_error("InnoDB: Table %s contains %lu " + "indexes inside InnoDB, which " + "is different from the number of " + "indexes %u defined in the MySQL " + " Have you mixed up " + ".frm files from different " + "installations? See " + REFMAN + "innodb-troubleshooting.html\n", + ib_table->name, n_keys, + table->s->keys); + + if (push_warning) { + push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, + ER_NO_SUCH_INDEX, + "InnoDB: Table %s contains %lu " + "indexes inside InnoDB, which " + "is different from the number of " + "indexes %u defined in the MySQL ", + ib_table->name, n_keys, + table->s->keys); + } + break; + + case DICT_FRM_CONSISTENT: + default: + sql_print_error("InnoDB: Table %s is consistent " + "on InnoDB data dictionary and MySQL " + " FRM file.", + ib_table->name); + ut_error; + break; + } +} diff --git a/storage/innobase/handler/ha_innodb.h b/storage/innobase/handler/ha_innodb.h index 4f4a0b2f999..478187e0b23 100644 --- a/storage/innobase/handler/ha_innodb.h +++ b/storage/innobase/handler/ha_innodb.h @@ -1,7 +1,7 @@ /***************************************************************************** -Copyright (c) 2000, 2012, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2013, SkySQL Ab. All Rights Reserved. +Copyright (c) 2000, 2016, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2013, 2016, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -462,7 +462,7 @@ enum durability_properties thd_get_durability_property(const MYSQL_THD thd); @return True if sql_mode has strict mode (all or trans), false otherwise. */ bool thd_is_strict_mode(const MYSQL_THD thd) -__attribute__((nonnull)); +MY_ATTRIBUTE((nonnull)); } /* extern "C" */ /** Get the file name and position of the MySQL binlog corresponding to the @@ -507,7 +507,7 @@ innobase_index_name_is_reserved( const KEY* key_info, /*!< in: Indexes to be created */ ulint num_of_keys) /*!< in: Number of indexes to be created. */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /*****************************************************************//** #ifdef WITH_WSREP @@ -527,7 +527,7 @@ innobase_table_flags( outside system tablespace */ ulint* flags, /*!< out: DICT_TF flags */ ulint* flags2) /*!< out: DICT_TF2 flags */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /*****************************************************************//** Validates the create options. We may build on this function @@ -544,7 +544,7 @@ create_options_are_invalid( columns and indexes */ HA_CREATE_INFO* create_info, /*!< in: create info. */ bool use_tablespace) /*!< in: srv_file_per_table */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /*********************************************************************//** Retrieve the FTS Relevance Ranking result for doc with doc_id @@ -574,7 +574,7 @@ void innobase_fts_close_ranking( /*=======================*/ FT_INFO* fts_hdl) /*!< in: FTS handler */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /*****************************************************************//** Initialize the table FTS stopword list @return TRUE if success */ @@ -585,7 +585,7 @@ innobase_fts_load_stopword( dict_table_t* table, /*!< in: Table has the FTS */ trx_t* trx, /*!< in: transaction */ THD* thd) /*!< in: current thread */ - __attribute__((nonnull(1,3), warn_unused_result)); + MY_ATTRIBUTE((nonnull(1,3), warn_unused_result)); /** Some defines for innobase_fts_check_doc_id_index() return value */ enum fts_doc_id_index_enum { @@ -607,7 +607,7 @@ innobase_fts_check_doc_id_index( that is being altered */ ulint* fts_doc_col_no) /*!< out: The column number for Doc ID */ - __attribute__((warn_unused_result)); + MY_ATTRIBUTE((warn_unused_result)); /*******************************************************************//** Check whether the table has a unique index with FTS_DOC_ID_INDEX_NAME @@ -620,7 +620,7 @@ innobase_fts_check_doc_id_index_in_def( /*===================================*/ ulint n_key, /*!< in: Number of keys */ const KEY* key_info) /*!< in: Key definitions */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /*********************************************************************** @return version of the extended FTS API */ @@ -675,3 +675,16 @@ innobase_copy_frm_flags_from_table_share( /*=====================================*/ dict_table_t* innodb_table, /*!< in/out: InnoDB table */ const TABLE_SHARE* table_share); /*!< in: table share */ + +/********************************************************************//** +Helper function to push frm mismatch error to error log and +if needed to sql-layer. */ +UNIV_INTERN +void +ib_push_frm_error( +/*==============*/ + THD* thd, /*!< in: MySQL thd */ + dict_table_t* ib_table, /*!< in: InnoDB table */ + TABLE* table, /*!< in: MySQL table */ + ulint n_keys, /*!< in: InnoDB #keys */ + bool push_warning); /*!< in: print warning ? */ diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc index 332c5f319fa..bb7efa104fa 100644 --- a/storage/innobase/handler/handler0alter.cc +++ b/storage/innobase/handler/handler0alter.cc @@ -1,7 +1,7 @@ /***************************************************************************** -Copyright (c) 2005, 2015, Oracle and/or its affiliates -Copyright (c) 2013, 2015, MariaDB Corporation. All Rights Reserved. +Copyright (c) 2005, 2016, Oracle and/or its affiliates +Copyright (c) 2013, 2016, MariaDB Corporation. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -101,7 +101,7 @@ static const Alter_inplace_info::HA_ALTER_FLAGS INNOBASE_ALTER_NOREBUILD | Alter_inplace_info::ALTER_COLUMN_NAME; /* Report an InnoDB error to the client by invoking my_error(). */ -static UNIV_COLD __attribute__((nonnull)) +static UNIV_COLD MY_ATTRIBUTE((nonnull)) void my_error_innodb( /*============*/ @@ -203,7 +203,7 @@ Determine if ALTER TABLE needs to rebuild the table. @param ha_alter_info the DDL operation @param altered_table MySQL original table @return whether it is necessary to rebuild the table */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) bool innobase_need_rebuild( /*==================*/ @@ -448,7 +448,7 @@ ha_innobase::check_if_supported_inplace_alter( we must use "Copy" method. */ if (is_timestamp_type(def->sql_type)) { if ((def->flags & NOT_NULL_FLAG) != 0 && // NOT NULL - (def->def != NULL || // constant default ? + (def->default_value != NULL || // constant default ? def->unireg_check != Field::NONE)) { // function default ha_alter_info->unsupported_reason = innobase_get_err_msg( ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_NOT_NULL); @@ -459,6 +459,20 @@ ha_innobase::check_if_supported_inplace_alter( } } + ulint n_indexes = UT_LIST_GET_LEN((prebuilt->table)->indexes); + + /* If InnoDB dictionary and MySQL frm file are not consistent + use "Copy" method. */ + if (prebuilt->table->dict_frm_mismatch) { + + ha_alter_info->unsupported_reason = innobase_get_err_msg( + ER_NO_SUCH_INDEX); + ib_push_frm_error(user_thd, prebuilt->table, altered_table, + n_indexes, true); + + DBUG_RETURN(HA_ALTER_INPLACE_NOT_SUPPORTED); + } + /* We should be able to do the operation in-place. See if we can do it online (LOCK=NONE). */ bool online = true; @@ -632,7 +646,7 @@ ha_innobase::check_if_supported_inplace_alter( /*************************************************************//** Initialize the dict_foreign_t structure with supplied info @return true if added, false if duplicate foreign->id */ -static __attribute__((nonnull(1,3,5,7))) +static MY_ATTRIBUTE((nonnull(1,3,5,7))) bool innobase_init_foreign( /*==================*/ @@ -721,7 +735,7 @@ innobase_init_foreign( /*************************************************************//** Check whether the foreign key options is legit @return true if it is */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) bool innobase_check_fk_option( /*=====================*/ @@ -753,7 +767,7 @@ innobase_check_fk_option( /*************************************************************//** Set foreign key options @return true if successfully set */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) bool innobase_set_foreign_key_option( /*============================*/ @@ -798,7 +812,7 @@ innobase_set_foreign_key_option( Check if a foreign key constraint can make use of an index that is being created. @return useable index, or NULL if none found */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) const KEY* innobase_find_equiv_index( /*======================*/ @@ -854,7 +868,7 @@ no_match: Find an index whose first fields are the columns in the array in the same order and is not marked for deletion @return matching index, NULL if not found */ -static __attribute__((nonnull(1,2,6), warn_unused_result)) +static MY_ATTRIBUTE((nonnull(1,2,6), warn_unused_result)) dict_index_t* innobase_find_fk_index( /*===================*/ @@ -902,7 +916,7 @@ next_rec: Create InnoDB foreign key structure from MySQL alter_info @retval true if successful @retval false on error (will call my_error()) */ -static __attribute__((nonnull(1,2,3,7,8), warn_unused_result)) +static MY_ATTRIBUTE((nonnull(1,2,3,7,8), warn_unused_result)) bool innobase_get_foreign_key_info( /*==========================*/ @@ -1402,7 +1416,7 @@ innobase_rec_reset( /*******************************************************************//** This function checks that index keys are sensible. @return 0 or error number */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) int innobase_check_index_keys( /*======================*/ @@ -1523,7 +1537,7 @@ name_ok: /*******************************************************************//** Create index field definition for key part */ -static __attribute__((nonnull(2,3))) +static MY_ATTRIBUTE((nonnull(2,3))) void innobase_create_index_field_def( /*============================*/ @@ -1572,7 +1586,7 @@ innobase_create_index_field_def( /*******************************************************************//** Create index definition for key */ -static __attribute__((nonnull)) +static MY_ATTRIBUTE((nonnull)) void innobase_create_index_def( /*======================*/ @@ -1862,7 +1876,7 @@ ELSE ENDIF @return key definitions */ -static __attribute__((nonnull, warn_unused_result, malloc)) +static MY_ATTRIBUTE((nonnull, warn_unused_result, malloc)) index_def_t* innobase_create_key_defs( /*=====================*/ @@ -2086,7 +2100,7 @@ created_clustered: /*******************************************************************//** Check each index column size, make sure they do not exceed the max limit @return true if index column size exceeds limit */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) bool innobase_check_column_length( /*=========================*/ @@ -2236,7 +2250,7 @@ online_retry_drop_indexes_low( /********************************************************************//** Drop any indexes that we were not able to free previously due to open table handles. */ -static __attribute__((nonnull)) +static MY_ATTRIBUTE((nonnull)) void online_retry_drop_indexes( /*======================*/ @@ -2266,7 +2280,7 @@ online_retry_drop_indexes( /********************************************************************//** Commit a dictionary transaction and drop any indexes that we were not able to free previously due to open table handles. */ -static __attribute__((nonnull)) +static MY_ATTRIBUTE((nonnull)) void online_retry_drop_indexes_with_trx( /*===============================*/ @@ -2295,7 +2309,7 @@ online_retry_drop_indexes_with_trx( @param drop_fk constraints being dropped @param n_drop_fk number of constraints that are being dropped @return whether the constraint is being dropped */ -inline __attribute__((pure, nonnull, warn_unused_result)) +inline MY_ATTRIBUTE((pure, nonnull, warn_unused_result)) bool innobase_dropping_foreign( /*======================*/ @@ -2322,7 +2336,7 @@ column that is being dropped or modified to NOT NULL. @retval true Not allowed (will call my_error()) @retval false Allowed */ -static __attribute__((pure, nonnull, warn_unused_result)) +static MY_ATTRIBUTE((pure, nonnull, warn_unused_result)) bool innobase_check_foreigns_low( /*========================*/ @@ -2422,7 +2436,7 @@ column that is being dropped or modified to NOT NULL. @retval true Not allowed (will call my_error()) @retval false Allowed */ -static __attribute__((pure, nonnull, warn_unused_result)) +static MY_ATTRIBUTE((pure, nonnull, warn_unused_result)) bool innobase_check_foreigns( /*====================*/ @@ -2467,7 +2481,7 @@ innobase_check_foreigns( @param dfield InnoDB data field to copy to @param field MySQL value for the column @param comp nonzero if in compact format */ -static __attribute__((nonnull)) +static MY_ATTRIBUTE((nonnull)) void innobase_build_col_map_add( /*=======================*/ @@ -2501,7 +2515,7 @@ adding columns. @param heap Memory heap where allocated @return array of integers, mapping column numbers in the table to column numbers in altered_table */ -static __attribute__((nonnull(1,2,3,4,5,7), warn_unused_result)) +static MY_ATTRIBUTE((nonnull(1,2,3,4,5,7), warn_unused_result)) const ulint* innobase_build_col_map( /*===================*/ @@ -2651,7 +2665,7 @@ innobase_drop_fts_index_table( @param user_table InnoDB table as it is before the ALTER operation @param heap Memory heap for the allocation @return array of new column names in rebuilt_table, or NULL if not renamed */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) const char** innobase_get_col_names( Alter_inplace_info* ha_alter_info, @@ -2714,7 +2728,7 @@ while preparing ALTER TABLE. @retval true Failure @retval false Success */ -static __attribute__((warn_unused_result, nonnull(1,2,3,4))) +static MY_ATTRIBUTE((warn_unused_result, nonnull(1,2,3,4))) bool prepare_inplace_alter_table_dict( /*=============================*/ @@ -3368,7 +3382,7 @@ err_exit: /* Check whether an index is needed for the foreign key constraint. If so, if it is dropped, is there an equivalent index can play its role. @return true if the index is needed and can't be dropped */ -static __attribute__((nonnull(1,2,3,5), warn_unused_result)) +static MY_ATTRIBUTE((nonnull(1,2,3,5), warn_unused_result)) bool innobase_check_foreign_key_index( /*=============================*/ @@ -3775,7 +3789,7 @@ check_if_ok_to_rename: } my_error(ER_CANT_DROP_FIELD_OR_KEY, MYF(0), - drop->name); + drop->type_name(), drop->name); goto err_exit; found_fk: continue; @@ -3912,6 +3926,24 @@ check_if_can_drop_indexes: drop_index = NULL; } + /* Check if any of the existing indexes are marked as corruption + and if they are, refuse adding more indexes. */ + if (ha_alter_info->handler_flags & Alter_inplace_info::ADD_INDEX) { + for (dict_index_t* index = dict_table_get_first_index(indexed_table); + index != NULL; index = dict_table_get_next_index(index)) { + + if (!index->to_be_dropped && dict_index_is_corrupted(index)) { + char index_name[MAX_FULL_NAME_LEN + 1]; + + innobase_format_name(index_name, sizeof index_name, + index->name, TRUE); + + my_error(ER_INDEX_CORRUPT, MYF(0), index_name); + DBUG_RETURN(true); + } + } + } + n_add_fk = 0; if (ha_alter_info->handler_flags @@ -4282,7 +4314,7 @@ temparary index prefix @param locked TRUE=table locked, FALSE=may need to do a lazy drop @param trx the transaction */ -static __attribute__((nonnull)) +static MY_ATTRIBUTE((nonnull)) void innobase_rollback_sec_index( /*========================*/ @@ -4316,7 +4348,7 @@ during prepare, but might not be during commit). @retval true Failure @retval false Success */ -inline __attribute__((nonnull, warn_unused_result)) +inline MY_ATTRIBUTE((nonnull, warn_unused_result)) bool rollback_inplace_alter_table( /*=========================*/ @@ -4448,7 +4480,7 @@ func_exit: @param foreign_id Foreign key constraint identifier @retval true Failure @retval false Success */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) bool innobase_drop_foreign_try( /*======================*/ @@ -4505,7 +4537,7 @@ innobase_drop_foreign_try( @param new_clustered whether the table has been rebuilt @retval true Failure @retval false Success */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) bool innobase_rename_column_try( /*=======================*/ @@ -4714,7 +4746,7 @@ rename_foreign: @param table_name Table name in MySQL @retval true Failure @retval false Success */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) bool innobase_rename_columns_try( /*========================*/ @@ -4764,7 +4796,7 @@ as part of commit_cache_norebuild(). @param ha_alter_info Data used during in-place alter. @param table the TABLE @param user_table InnoDB table that was being altered */ -static __attribute__((nonnull)) +static MY_ATTRIBUTE((nonnull)) void innobase_rename_columns_cache( /*==========================*/ @@ -4808,7 +4840,7 @@ processed_field: @param altered_table MySQL table that is being altered @param old_table MySQL table as it is before the ALTER operation @return the next auto-increment value (0 if not present) */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) ulonglong commit_get_autoinc( /*===============*/ @@ -4892,7 +4924,7 @@ but do not touch the data dictionary cache. @retval true Failure @retval false Success */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) bool innobase_update_foreign_try( /*========================*/ @@ -4976,7 +5008,7 @@ after the changes to data dictionary tables were committed. @param ctx In-place ALTER TABLE context @param user_thd MySQL connection @return InnoDB error code (should always be DB_SUCCESS) */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t innobase_update_foreign_cache( /*==========================*/ @@ -5061,7 +5093,7 @@ when rebuilding the table. @retval true Failure @retval false Success */ -inline __attribute__((nonnull, warn_unused_result)) +inline MY_ATTRIBUTE((nonnull, warn_unused_result)) bool commit_try_rebuild( /*===============*/ @@ -5223,7 +5255,7 @@ commit_try_rebuild( /** Apply the changes made during commit_try_rebuild(), to the data dictionary cache and the file system. @param ctx In-place ALTER TABLE context */ -inline __attribute__((nonnull)) +inline MY_ATTRIBUTE((nonnull)) void commit_cache_rebuild( /*=================*/ @@ -5318,7 +5350,7 @@ when not rebuilding the table. @retval true Failure @retval false Success */ -inline __attribute__((nonnull, warn_unused_result)) +inline MY_ATTRIBUTE((nonnull, warn_unused_result)) bool commit_try_norebuild( /*=================*/ @@ -5428,7 +5460,7 @@ after a successful commit_try_norebuild() call. @param trx Data dictionary transaction object (will be started and committed) @return whether all replacements were found for dropped indexes */ -inline __attribute__((nonnull, warn_unused_result)) +inline MY_ATTRIBUTE((nonnull, warn_unused_result)) bool commit_cache_norebuild( /*===================*/ diff --git a/storage/innobase/ibuf/ibuf0ibuf.cc b/storage/innobase/ibuf/ibuf0ibuf.cc index 9e8d8659739..0a2140c4a29 100644 --- a/storage/innobase/ibuf/ibuf0ibuf.cc +++ b/storage/innobase/ibuf/ibuf0ibuf.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1997, 2014, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1997, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2016, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under @@ -670,7 +670,7 @@ byte* ibuf_parse_bitmap_init( /*===================*/ byte* ptr, /*!< in: buffer */ - byte* end_ptr __attribute__((unused)), /*!< in: buffer end */ + byte* end_ptr MY_ATTRIBUTE((unused)), /*!< in: buffer end */ buf_block_t* block, /*!< in: block or NULL */ mtr_t* mtr) /*!< in: mtr or NULL */ { @@ -2513,7 +2513,7 @@ ibuf_get_merge_page_nos_func( /*******************************************************************//** Get the matching records for space id. @return current rec or NULL */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) const rec_t* ibuf_get_user_rec( /*===============*/ @@ -2535,7 +2535,7 @@ ibuf_get_user_rec( Reads page numbers for a space id from an ibuf tree. @return a lower limit for the combined volume of records which will be merged */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) ulint ibuf_get_merge_pages( /*=================*/ @@ -2643,40 +2643,22 @@ ibuf_merge_pages( } /*********************************************************************//** -Get the table instance from the table id. -@return table instance */ -static __attribute__((warn_unused_result)) -dict_table_t* -ibuf_get_table( -/*===========*/ - table_id_t table_id) /*!< in: valid table id */ -{ - rw_lock_s_lock_func(&dict_operation_lock, 0, __FILE__, __LINE__); - - dict_table_t* table = dict_table_open_on_id( - table_id, FALSE, DICT_TABLE_OP_NORMAL); - - rw_lock_s_unlock_gen(&dict_operation_lock, 0); - - return(table); -} - -/*********************************************************************//** -Contracts insert buffer trees by reading pages to the buffer pool. -@return a lower limit for the combined size in bytes of entries which -will be merged from ibuf trees to the pages read, 0 if ibuf is -empty */ -static +Contracts insert buffer trees by reading pages referring to space_id +to the buffer pool. +@returns number of pages merged.*/ +UNIV_INTERN ulint ibuf_merge_space( /*=============*/ - ulint space, /*!< in: tablespace id to merge */ - ulint* n_pages)/*!< out: number of pages to which merged */ + ulint space) /*!< in: tablespace id to merge */ { mtr_t mtr; btr_pcur_t pcur; mem_heap_t* heap = mem_heap_create(512); dtuple_t* tuple = ibuf_search_tuple_build(space, 0, heap); + ulint n_pages = 0; + + ut_ad(space < SRV_LOG_SPACE_FIRST_ID); ibuf_mtr_start(&mtr); @@ -2708,50 +2690,47 @@ ibuf_merge_space( } else { sum_sizes = ibuf_get_merge_pages( - &pcur, space, IBUF_MAX_N_PAGES_MERGED, - &pages[0], &spaces[0], &versions[0], n_pages, - &mtr); + &pcur, space, IBUF_MAX_N_PAGES_MERGED, + &pages[0], &spaces[0], &versions[0], &n_pages, + &mtr); + ib_logf(IB_LOG_LEVEL_INFO,"\n Size of pages merged %lu" + ,sum_sizes); - ++sum_sizes; } ibuf_mtr_commit(&mtr); btr_pcur_close(&pcur); - if (sum_sizes > 0) { - - ut_a(*n_pages > 0 || sum_sizes == 1); + if (n_pages > 0) { #ifdef UNIV_DEBUG - ut_ad(*n_pages <= UT_ARR_SIZE(pages)); + ut_ad(n_pages <= UT_ARR_SIZE(pages)); - for (ulint i = 0; i < *n_pages; ++i) { + for (ulint i = 0; i < n_pages; ++i) { ut_ad(spaces[i] == space); ut_ad(i == 0 || versions[i] == versions[i - 1]); } #endif /* UNIV_DEBUG */ buf_read_ibuf_merge_pages( - true, spaces, versions, pages, *n_pages); + true, spaces, versions, pages, n_pages); } - return(sum_sizes); + return(n_pages); } -/*********************************************************************//** -Contracts insert buffer trees by reading pages to the buffer pool. +/** Contract the change buffer by reading pages to the buffer pool. +@param[out] n_pages number of pages merged +@param[in] sync whether the caller waits for +the issued reads to complete @return a lower limit for the combined size in bytes of entries which will be merged from ibuf trees to the pages read, 0 if ibuf is empty */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) ulint ibuf_merge( /*=======*/ - table_id_t table_id, /*!< in: if merge should be - done only for a specific - table, for all tables this - should be 0 */ ulint* n_pages, /*!< out: number of pages to which merged */ bool sync) /*!< in: TRUE if the caller @@ -2759,8 +2738,6 @@ ibuf_merge( read with the highest tablespace address to complete */ { - dict_table_t* table; - *n_pages = 0; /* We perform a dirty read of ibuf->empty, without latching @@ -2774,55 +2751,45 @@ ibuf_merge( } else if (ibuf_debug) { return(0); #endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */ - } else if (table_id == 0) { + } else { return(ibuf_merge_pages(n_pages, sync)); - } else if ((table = ibuf_get_table(table_id)) == 0) { - /* Table has been dropped. */ - return(0); } - - ulint volume = ibuf_merge_space(table->space, n_pages); - - dict_table_close(table, FALSE, FALSE); - - return(volume); } -/*********************************************************************//** -Contracts insert buffer trees by reading pages to the buffer pool. +/** Contract the change buffer by reading pages to the buffer pool. +@param[in] sync whether the caller waits for +the issued reads to complete @return a lower limit for the combined size in bytes of entries which -will be merged from ibuf trees to the pages read, 0 if ibuf is -empty */ +will be merged from ibuf trees to the pages read, 0 if ibuf is empty */ static ulint ibuf_contract( /*==========*/ - ibool sync) /*!< in: TRUE if the caller wants to wait for the + bool sync) /*!< in: TRUE if the caller wants to wait for the issued read with the highest tablespace address to complete */ { ulint n_pages; - return(ibuf_merge(0, &n_pages, sync)); + return(ibuf_merge_pages(&n_pages, sync)); } -/*********************************************************************//** -Contracts insert buffer trees by reading pages to the buffer pool. +/** Contract the change buffer by reading pages to the buffer pool. +@param[in] full If true, do a full contraction based +on PCT_IO(100). If false, the size of contract batch is determined +based on the current size of the change buffer. @return a lower limit for the combined size in bytes of entries which will be merged from ibuf trees to the pages read, 0 if ibuf is empty */ UNIV_INTERN ulint -ibuf_contract_in_background( -/*========================*/ - table_id_t table_id, /*!< in: if merge should be done only - for a specific table, for all tables - this should be 0 */ - ibool full) /*!< in: TRUE if the caller wants to - do a full contract based on PCT_IO(100). - If FALSE then the size of contract - batch is determined based on the - current size of the ibuf tree. */ +ibuf_merge_in_background( +/*=====================*/ + bool full) /*!< in: TRUE if the caller wants to + do a full contract based on PCT_IO(100). + If FALSE then the size of contract + batch is determined based on the + current size of the ibuf tree. */ { ulint sum_bytes = 0; ulint sum_pages = 0; @@ -2830,7 +2797,7 @@ ibuf_contract_in_background( ulint n_pages; #if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG - if (srv_ibuf_disable_background_merge && table_id == 0) { + if (srv_ibuf_disable_background_merge) { return(0); } #endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */ @@ -2867,7 +2834,7 @@ ibuf_contract_in_background( while (sum_pages < n_pages) { ulint n_bytes; - n_bytes = ibuf_merge(table_id, &n_pag2, FALSE); + n_bytes = ibuf_merge(&n_pag2, false); if (n_bytes == 0) { return(sum_bytes); @@ -3471,7 +3438,7 @@ ibuf_get_entry_counter_func( Buffer an operation in the insert/delete buffer, instead of doing it directly to the disk page, if this is possible. @return DB_SUCCESS, DB_STRONG_FAIL or other error */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t ibuf_insert_low( /*============*/ @@ -3538,8 +3505,7 @@ ibuf_insert_low( #ifdef UNIV_IBUF_DEBUG fputs("Ibuf too big\n", stderr); #endif - /* Use synchronous contract (== TRUE) */ - ibuf_contract(TRUE); + ibuf_contract(true); return(DB_STRONG_FAIL); } @@ -3962,7 +3928,7 @@ skip_watch: During merge, inserts to an index page a secondary index entry extracted from the insert buffer. @return newly inserted record */ -static __attribute__((nonnull)) +static MY_ATTRIBUTE((nonnull)) rec_t* ibuf_insert_to_index_page_low( /*==========================*/ @@ -4393,7 +4359,7 @@ ibuf_delete( /*********************************************************************//** Restores insert buffer tree cursor position @return TRUE if the position was restored; FALSE if not */ -static __attribute__((nonnull)) +static MY_ATTRIBUTE((nonnull)) ibool ibuf_restore_pos( /*=============*/ @@ -4448,7 +4414,7 @@ Deletes from ibuf the record on which pcur is positioned. If we have to resort to a pessimistic delete, this function commits mtr and closes the cursor. @return TRUE if mtr was committed and pcur closed in this operation */ -static __attribute__((warn_unused_result)) +static MY_ATTRIBUTE((warn_unused_result)) ibool ibuf_delete_rec( /*============*/ diff --git a/storage/innobase/include/api0api.h b/storage/innobase/include/api0api.h index e4c9c941de5..500bf4fe3b2 100644 --- a/storage/innobase/include/api0api.h +++ b/storage/innobase/include/api0api.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2011, 2015, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2011, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -36,7 +36,7 @@ InnoDB Native API #endif #if defined(__GNUC__) && (__GNUC__ > 2) && ! defined(__INTEL_COMPILER) -#define UNIV_NO_IGNORE __attribute__ ((warn_unused_result)) +#define UNIV_NO_IGNORE MY_ATTRIBUTE ((warn_unused_result)) #else #define UNIV_NO_IGNORE #endif /* __GNUC__ && __GNUC__ > 2 && !__INTEL_COMPILER */ diff --git a/storage/innobase/include/btr0btr.h b/storage/innobase/include/btr0btr.h index 95ce104e7ea..bf3f4a76301 100644 --- a/storage/innobase/include/btr0btr.h +++ b/storage/innobase/include/btr0btr.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1994, 2013, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2012, Facebook Inc. Copyright (c) 2014, 2015, MariaDB Corporation. All Rights Reserved. @@ -115,7 +115,7 @@ btr_corruption_report( /*==================*/ const buf_block_t* block, /*!< in: corrupted block */ const dict_index_t* index) /*!< in: index tree */ - UNIV_COLD __attribute__((nonnull)); + UNIV_COLD MY_ATTRIBUTE((nonnull)); /** Assert that a B-tree page is not corrupted. @param block buffer block containing a B-tree page @@ -157,7 +157,7 @@ btr_blob_dbg_add_blob( ulint page_no, /*!< in: start page of the column */ dict_index_t* index, /*!< in/out: index tree */ const char* ctx) /*!< in: context (for logging) */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /**************************************************************//** Display the references to off-page columns. This function is to be called from a debugger, @@ -167,7 +167,7 @@ void btr_blob_dbg_print( /*===============*/ const dict_index_t* index) /*!< in: index tree */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /**************************************************************//** Check that there are no references to off-page columns from or to the given page. Invoked when freeing or clearing a page. @@ -178,7 +178,7 @@ btr_blob_dbg_is_empty( /*==================*/ dict_index_t* index, /*!< in: index */ ulint page_no) /*!< in: page number */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /**************************************************************//** Modify the 'deleted' flag of a record. */ @@ -190,7 +190,7 @@ btr_blob_dbg_set_deleted_flag( dict_index_t* index, /*!< in/out: index */ const ulint* offsets,/*!< in: rec_get_offs(rec, index) */ ibool del) /*!< in: TRUE=deleted, FALSE=exists */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /**************************************************************//** Change the ownership of an off-page column. */ UNIV_INTERN @@ -202,7 +202,7 @@ btr_blob_dbg_owner( const ulint* offsets,/*!< in: rec_get_offs(rec, index) */ ulint i, /*!< in: ith field in rec */ ibool own) /*!< in: TRUE=owned, FALSE=disowned */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /** Assert that there are no BLOB references to or from the given page. */ # define btr_blob_dbg_assert_empty(index, page_no) \ ut_a(btr_blob_dbg_is_empty(index, page_no)) @@ -222,7 +222,7 @@ btr_root_get( /*=========*/ const dict_index_t* index, /*!< in: index tree */ mtr_t* mtr) /*!< in: mtr */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /**************************************************************//** Checks and adjusts the root node of a tree during IMPORT TABLESPACE. @@ -232,7 +232,7 @@ dberr_t btr_root_adjust_on_import( /*======================*/ const dict_index_t* index) /*!< in: index tree */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /**************************************************************//** Gets the height of the B-tree (the level of the root, when the leaf @@ -245,7 +245,7 @@ btr_height_get( /*===========*/ dict_index_t* index, /*!< in: index tree */ mtr_t* mtr) /*!< in/out: mini-transaction */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /**************************************************************//** Gets a buffer page and declares its latching order level. */ UNIV_INLINE @@ -307,7 +307,7 @@ index_id_t btr_page_get_index_id( /*==================*/ const page_t* page) /*!< in: index page */ - __attribute__((nonnull, pure, warn_unused_result)); + MY_ATTRIBUTE((nonnull, pure, warn_unused_result)); #ifndef UNIV_HOTBACKUP /********************************************************//** Gets the node level field in an index page. @@ -317,7 +317,7 @@ ulint btr_page_get_level_low( /*===================*/ const page_t* page) /*!< in: index page */ - __attribute__((nonnull, pure, warn_unused_result)); + MY_ATTRIBUTE((nonnull, pure, warn_unused_result)); #define btr_page_get_level(page, mtr) btr_page_get_level_low(page) /********************************************************//** Gets the next index page number. @@ -328,7 +328,7 @@ btr_page_get_next( /*==============*/ const page_t* page, /*!< in: index page */ mtr_t* mtr) /*!< in: mini-transaction handle */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /********************************************************//** Gets the previous index page number. @return prev page number */ @@ -338,7 +338,7 @@ btr_page_get_prev( /*==============*/ const page_t* page, /*!< in: index page */ mtr_t* mtr) /*!< in: mini-transaction handle */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /*************************************************************//** Gets pointer to the previous user record in the tree. It is assumed that the caller has appropriate latches on the page and its neighbor. @@ -350,7 +350,7 @@ btr_get_prev_user_rec( rec_t* rec, /*!< in: record on leaf level */ mtr_t* mtr) /*!< in: mtr holding a latch on the page, and if needed, also to the previous page */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /*************************************************************//** Gets pointer to the next user record in the tree. It is assumed that the caller has appropriate latches on the page and its neighbor. @@ -362,7 +362,7 @@ btr_get_next_user_rec( rec_t* rec, /*!< in: record on leaf level */ mtr_t* mtr) /*!< in: mtr holding a latch on the page, and if needed, also to the next page */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /**************************************************************//** Releases the latch on a leaf page and bufferunfixes it. */ UNIV_INLINE @@ -373,7 +373,7 @@ btr_leaf_page_release( ulint latch_mode, /*!< in: BTR_SEARCH_LEAF or BTR_MODIFY_LEAF */ mtr_t* mtr) /*!< in: mtr */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /**************************************************************//** Gets the child node file address in a node pointer. NOTE: the offsets array must contain all offsets for the record since @@ -387,7 +387,7 @@ btr_node_ptr_get_child_page_no( /*===========================*/ const rec_t* rec, /*!< in: node pointer record */ const ulint* offsets)/*!< in: array returned by rec_get_offsets() */ - __attribute__((nonnull, pure, warn_unused_result)); + MY_ATTRIBUTE((nonnull, pure, warn_unused_result)); /************************************************************//** Creates the root node for a new index tree. @return page number of the created root, FIL_NULL if did not succeed */ @@ -402,7 +402,7 @@ btr_create( index_id_t index_id,/*!< in: index id */ dict_index_t* index, /*!< in: index */ mtr_t* mtr) /*!< in: mini-transaction handle */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /************************************************************//** Frees a B-tree except the root page, which MUST be freed after this by calling btr_free_root. */ @@ -425,7 +425,7 @@ btr_free_root( or 0 for uncompressed pages */ ulint root_page_no, /*!< in: root page number */ mtr_t* mtr) /*!< in/out: mini-transaction */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /*************************************************************//** Makes tree one level higher by splitting the root, and inserts the tuple. It is assumed that mtr contains an x-latch on the tree. @@ -474,7 +474,7 @@ btr_page_reorganize_low( page_cur_t* cursor, /*!< in/out: page cursor */ dict_index_t* index, /*!< in: the index tree of the page */ mtr_t* mtr) /*!< in/out: mini-transaction */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /*************************************************************//** Reorganizes an index page. @@ -493,7 +493,7 @@ btr_page_reorganize( page_cur_t* cursor, /*!< in/out: page cursor */ dict_index_t* index, /*!< in: the index tree of the page */ mtr_t* mtr) /*!< in/out: mini-transaction */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /*************************************************************//** Decides if the page should be split at the convergence point of inserts converging to left. @@ -506,7 +506,7 @@ btr_page_get_split_rec_to_left( rec_t** split_rec)/*!< out: if split recommended, the first record on upper half page, or NULL if tuple should be first */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /*************************************************************//** Decides if the page should be split at the convergence point of inserts converging to right. @@ -519,7 +519,7 @@ btr_page_get_split_rec_to_right( rec_t** split_rec)/*!< out: if split recommended, the first record on upper half page, or NULL if tuple should be first */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /*************************************************************//** Splits an index page to halves and inserts the tuple. It is assumed that mtr holds an x-latch to the index tree. NOTE: the tree x-latch is @@ -558,7 +558,7 @@ btr_insert_on_non_leaf_level_func( const char* file, /*!< in: file name */ ulint line, /*!< in: line where called */ mtr_t* mtr) /*!< in: mtr */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); # define btr_insert_on_non_leaf_level(f,i,l,t,m) \ btr_insert_on_non_leaf_level_func(f,i,l,t,__FILE__,__LINE__,m) #endif /* !UNIV_HOTBACKUP */ @@ -570,7 +570,7 @@ btr_set_min_rec_mark( /*=================*/ rec_t* rec, /*!< in/out: record */ mtr_t* mtr) /*!< in: mtr */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); #ifndef UNIV_HOTBACKUP /*************************************************************//** Deletes on the upper level the node pointer to a page. */ @@ -581,7 +581,7 @@ btr_node_ptr_delete( dict_index_t* index, /*!< in: index tree */ buf_block_t* block, /*!< in: page whose node pointer is deleted */ mtr_t* mtr) /*!< in: mtr */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); #ifdef UNIV_DEBUG /************************************************************//** Checks that the node pointer to a page is appropriate. @@ -593,7 +593,7 @@ btr_check_node_ptr( dict_index_t* index, /*!< in: index tree */ buf_block_t* block, /*!< in: index page */ mtr_t* mtr) /*!< in: mtr */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); #endif /* UNIV_DEBUG */ /*************************************************************//** Tries to merge the page first to the left immediate brother if such a @@ -616,7 +616,7 @@ btr_compress( ibool adjust, /*!< in: TRUE if should adjust the cursor position even if compression occurs */ mtr_t* mtr) /*!< in/out: mini-transaction */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /*************************************************************//** Discards a page from a B-tree. This is used to remove the last record from a B-tree page: the whole page must be removed at the same time. This cannot @@ -628,7 +628,7 @@ btr_discard_page( btr_cur_t* cursor, /*!< in: cursor on the page to discard: not on the root page */ mtr_t* mtr) /*!< in: mtr */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); #endif /* !UNIV_HOTBACKUP */ /****************************************************************//** Parses the redo log record for setting an index record as the predefined @@ -643,7 +643,7 @@ btr_parse_set_min_rec_mark( ulint comp, /*!< in: nonzero=compact page format */ page_t* page, /*!< in: page or NULL */ mtr_t* mtr) /*!< in: mtr or NULL */ - __attribute__((nonnull(1,2), warn_unused_result)); + MY_ATTRIBUTE((nonnull(1,2), warn_unused_result)); /***********************************************************//** Parses a redo log record of reorganizing a page. @return end of log record or NULL */ @@ -657,7 +657,7 @@ btr_parse_page_reorganize( bool compressed,/*!< in: true if compressed page */ buf_block_t* block, /*!< in: page to be reorganized, or NULL */ mtr_t* mtr) /*!< in: mtr or NULL */ - __attribute__((nonnull(1,2,3), warn_unused_result)); + MY_ATTRIBUTE((nonnull(1,2,3), warn_unused_result)); #ifndef UNIV_HOTBACKUP /**************************************************************//** Gets the number of pages in a B-tree. @@ -670,7 +670,7 @@ btr_get_size( ulint flag, /*!< in: BTR_N_LEAF_PAGES or BTR_TOTAL_SIZE */ mtr_t* mtr) /*!< in/out: mini-transaction where index is s-latched */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /**************************************************************//** Gets the number of reserved and used pages in a B-tree. @return number of pages reserved, or ULINT_UNDEFINED if the index @@ -708,7 +708,7 @@ btr_page_alloc( mtr_t* init_mtr) /*!< in/out: mini-transaction for x-latching and initializing the page */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /**************************************************************//** Frees a file page used in an index tree. NOTE: cannot free field external storage pages because the page must contain info on its level. */ @@ -719,7 +719,7 @@ btr_page_free( dict_index_t* index, /*!< in: index tree */ buf_block_t* block, /*!< in: block to be freed, x-latched */ mtr_t* mtr) /*!< in: mtr */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /**************************************************************//** Frees a file page used in an index tree. Can be used also to BLOB external storage pages, because the page level 0 can be given as an @@ -769,7 +769,7 @@ void btr_print_size( /*===========*/ dict_index_t* index) /*!< in: index tree */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /**************************************************************//** Prints directories and other info of all nodes in the index. */ UNIV_INTERN @@ -779,7 +779,7 @@ btr_print_index( dict_index_t* index, /*!< in: index */ ulint width) /*!< in: print this many entries from start and end */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); #endif /* UNIV_BTR_PRINT */ /************************************************************//** Checks the size and number of fields in a record based on the definition of @@ -794,7 +794,7 @@ btr_index_rec_validate( ibool dump_on_error) /*!< in: TRUE if the function should print hex dump of record and page on error */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /**************************************************************//** Checks the consistency of an index tree. @return DB_SUCCESS if ok, error code if not */ @@ -804,7 +804,7 @@ btr_validate_index( /*===============*/ dict_index_t* index, /*!< in: index */ const trx_t* trx) /*!< in: transaction or 0 */ - __attribute__((nonnull(1), warn_unused_result)); + MY_ATTRIBUTE((nonnull(1), warn_unused_result)); #ifdef UNIV_SYNC_DEBUG /*************************************************************//** diff --git a/storage/innobase/include/btr0btr.ic b/storage/innobase/include/btr0btr.ic index 5fc621f469d..64b3d5a0975 100644 --- a/storage/innobase/include/btr0btr.ic +++ b/storage/innobase/include/btr0btr.ic @@ -1,7 +1,7 @@ /***************************************************************************** -Copyright (c) 1994, 2012, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2015, MariaDB Corporation. +Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2015, 2016, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -165,10 +165,11 @@ ulint btr_page_get_next( /*==============*/ const page_t* page, /*!< in: index page */ - mtr_t* mtr __attribute__((unused))) + mtr_t* mtr MY_ATTRIBUTE((unused))) /*!< in: mini-transaction handle */ { - ut_ad(page && mtr); + ut_ad(page != NULL); + ut_ad(mtr != NULL); #ifndef UNIV_INNOCHECKSUM ut_ad(mtr_memo_contains_page(mtr, page, MTR_MEMO_PAGE_X_FIX) || mtr_memo_contains_page(mtr, page, MTR_MEMO_PAGE_S_FIX)); @@ -188,7 +189,8 @@ btr_page_set_next( ulint next, /*!< in: next page number */ mtr_t* mtr) /*!< in: mini-transaction handle */ { - ut_ad(page && mtr); + ut_ad(page != NULL); + ut_ad(mtr != NULL); if (page_zip) { mach_write_to_4(page + FIL_PAGE_NEXT, next); @@ -206,9 +208,10 @@ ulint btr_page_get_prev( /*==============*/ const page_t* page, /*!< in: index page */ - mtr_t* mtr __attribute__((unused))) /*!< in: mini-transaction handle */ + mtr_t* mtr MY_ATTRIBUTE((unused))) /*!< in: mini-transaction handle */ { - ut_ad(page && mtr); + ut_ad(page != NULL); + ut_ad(mtr != NULL); return(mach_read_from_4(page + FIL_PAGE_PREV)); } @@ -225,7 +228,8 @@ btr_page_set_prev( ulint prev, /*!< in: previous page number */ mtr_t* mtr) /*!< in: mini-transaction handle */ { - ut_ad(page && mtr); + ut_ad(page != NULL); + ut_ad(mtr != NULL); if (page_zip) { mach_write_to_4(page + FIL_PAGE_PREV, prev); diff --git a/storage/innobase/include/btr0cur.h b/storage/innobase/include/btr0cur.h index 88e3b84e04b..aa799e0fc00 100644 --- a/storage/innobase/include/btr0cur.h +++ b/storage/innobase/include/btr0cur.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1994, 2014, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -186,7 +186,7 @@ btr_cur_open_at_index_side_func( const char* file, /*!< in: file name */ ulint line, /*!< in: line where called */ mtr_t* mtr) /*!< in/out: mini-transaction */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); #define btr_cur_open_at_index_side(f,i,l,c,lv,m) \ btr_cur_open_at_index_side_func(f,i,l,c,lv,__FILE__,__LINE__,m) /**********************************************************************//** @@ -235,7 +235,7 @@ btr_cur_optimistic_insert( compressed tablespace, the caller must mtr_commit(mtr) before latching any further pages */ - __attribute__((nonnull(2,3,4,5,6,7,10), warn_unused_result)); + MY_ATTRIBUTE((nonnull(2,3,4,5,6,7,10), warn_unused_result)); /*************************************************************//** Performs an insert on a page of an index tree. It is assumed that mtr holds an x-latch on the tree and on the cursor page. If the insert is @@ -266,7 +266,7 @@ btr_cur_pessimistic_insert( ulint n_ext, /*!< in: number of externally stored columns */ que_thr_t* thr, /*!< in: query thread or NULL */ mtr_t* mtr) /*!< in/out: mini-transaction */ - __attribute__((nonnull(2,3,4,5,6,7,10), warn_unused_result)); + MY_ATTRIBUTE((nonnull(2,3,4,5,6,7,10), warn_unused_result)); /*************************************************************//** See if there is enough place in the page modification log to log an update-in-place. @@ -293,7 +293,7 @@ btr_cur_update_alloc_zip_func( bool create, /*!< in: true=delete-and-insert, false=update-in-place */ mtr_t* mtr) /*!< in/out: mini-transaction */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); #ifdef UNIV_DEBUG # define btr_cur_update_alloc_zip(page_zip,cursor,index,offsets,len,cr,mtr) \ btr_cur_update_alloc_zip_func(page_zip,cursor,index,offsets,len,cr,mtr) @@ -325,7 +325,7 @@ btr_cur_update_in_place( is a secondary index, the caller must mtr_commit(mtr) before latching any further pages */ - __attribute__((warn_unused_result, nonnull)); + MY_ATTRIBUTE((warn_unused_result, nonnull)); /***********************************************************//** Writes a redo log record of updating a record in-place. */ UNIV_INTERN @@ -339,7 +339,7 @@ btr_cur_update_in_place_log( trx_id_t trx_id, /*!< in: transaction id */ roll_ptr_t roll_ptr, /*!< in: roll ptr */ mtr_t* mtr) /*!< in: mtr */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /*************************************************************//** Tries to update a record on a page in an index tree. It is assumed that mtr holds an x-latch on the page. The operation does not succeed if there is too @@ -371,7 +371,7 @@ btr_cur_optimistic_update( is a secondary index, the caller must mtr_commit(mtr) before latching any further pages */ - __attribute__((warn_unused_result, nonnull)); + MY_ATTRIBUTE((warn_unused_result, nonnull)); /*************************************************************//** Performs an update of a record on a page of a tree. It is assumed that mtr holds an x-latch on the tree and on the cursor page. If the @@ -405,7 +405,7 @@ btr_cur_pessimistic_update( trx_id_t trx_id, /*!< in: transaction id */ mtr_t* mtr) /*!< in/out: mini-transaction; must be committed before latching any further pages */ - __attribute__((warn_unused_result, nonnull)); + MY_ATTRIBUTE((warn_unused_result, nonnull)); /***********************************************************//** Marks a clustered index record deleted. Writes an undo log record to undo log on this delete marking. Writes in the trx id field the id @@ -422,7 +422,7 @@ btr_cur_del_mark_set_clust_rec( const ulint* offsets,/*!< in: rec_get_offsets(rec) */ que_thr_t* thr, /*!< in: query thread */ mtr_t* mtr) /*!< in/out: mini-transaction */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /***********************************************************//** Sets a secondary index record delete mark to TRUE or FALSE. @return DB_SUCCESS, DB_LOCK_WAIT, or error number */ @@ -435,7 +435,7 @@ btr_cur_del_mark_set_sec_rec( ibool val, /*!< in: value to set */ que_thr_t* thr, /*!< in: query thread */ mtr_t* mtr) /*!< in/out: mini-transaction */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /*************************************************************//** Tries to compress a page of the tree if it seems useful. It is assumed that mtr holds an x-latch on the tree and on the cursor page. To avoid @@ -453,7 +453,7 @@ btr_cur_compress_if_useful( ibool adjust, /*!< in: TRUE if should adjust the cursor position even if compression occurs */ mtr_t* mtr) /*!< in/out: mini-transaction */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /*******************************************************//** Removes the record on which the tree cursor is positioned. It is assumed that the mtr has an x-latch on the page where the cursor is positioned, @@ -474,7 +474,7 @@ btr_cur_optimistic_delete_func( TRUE on a leaf page of a secondary index, the mtr must be committed before latching any further pages */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); # ifdef UNIV_DEBUG # define btr_cur_optimistic_delete(cursor, flags, mtr) \ btr_cur_optimistic_delete_func(cursor, flags, mtr) @@ -510,7 +510,7 @@ btr_cur_pessimistic_delete( ulint flags, /*!< in: BTR_CREATE_FLAG or 0 */ enum trx_rb_ctx rb_ctx, /*!< in: rollback context */ mtr_t* mtr) /*!< in: mtr */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); #endif /* !UNIV_HOTBACKUP */ /***********************************************************//** Parses a redo log record of updating a record in-place. @@ -604,7 +604,7 @@ btr_cur_disown_inherited_fields( const ulint* offsets,/*!< in: array returned by rec_get_offsets() */ const upd_t* update, /*!< in: update vector */ mtr_t* mtr) /*!< in/out: mini-transaction */ - __attribute__((nonnull(2,3,4,5,6))); + MY_ATTRIBUTE((nonnull(2,3,4,5,6))); /** Operation code for btr_store_big_rec_extern_fields(). */ enum blob_op { @@ -624,7 +624,7 @@ ibool btr_blob_op_is_update( /*==================*/ enum blob_op op) /*!< in: operation */ - __attribute__((warn_unused_result)); + MY_ATTRIBUTE((warn_unused_result)); /*******************************************************************//** Stores the fields in big_rec_vec to the tablespace and puts pointers to @@ -649,7 +649,7 @@ btr_store_big_rec_extern_fields( mtr_t* btr_mtr, /*!< in: mtr containing the latches to the clustered index */ enum blob_op op) /*! in: operation code */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /*******************************************************************//** Frees the space in an externally stored field to the file space @@ -746,7 +746,7 @@ btr_push_update_extern_fields( dtuple_t* tuple, /*!< in/out: data tuple */ const upd_t* update, /*!< in: update vector */ mem_heap_t* heap) /*!< in: memory heap */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /***********************************************************//** Sets a secondary index record's delete mark to the given value. This function is only used by the insert buffer merge mechanism. */ diff --git a/storage/innobase/include/btr0pcur.h b/storage/innobase/include/btr0pcur.h index d8e7cf6b283..dafe14ce556 100644 --- a/storage/innobase/include/btr0pcur.h +++ b/storage/innobase/include/btr0pcur.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2013, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -155,7 +155,7 @@ btr_pcur_open_at_index_side( ulint level, /*!< in: level to search for (0=leaf) */ mtr_t* mtr) /*!< in/out: mini-transaction */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /**************************************************************//** Gets the up_match value for a pcur after a search. @return number of matched fields at the cursor or to the right if diff --git a/storage/innobase/include/btr0sea.h b/storage/innobase/include/btr0sea.h index 848bde451a0..e25e2a4d49c 100644 --- a/storage/innobase/include/btr0sea.h +++ b/storage/innobase/include/btr0sea.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2011, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -69,7 +69,7 @@ btr_search_t* btr_search_get_info( /*================*/ dict_index_t* index) /*!< in: index */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /*****************************************************************//** Creates and initializes a search info struct. @return own: search info struct */ @@ -256,13 +256,6 @@ struct btr_search_sys_t{ /** The adaptive hash index */ extern btr_search_sys_t* btr_search_sys; -#ifdef UNIV_SEARCH_PERF_STAT -/** Number of successful adaptive hash index lookups */ -extern ulint btr_search_n_succ; -/** Number of failed adaptive hash index lookups */ -extern ulint btr_search_n_hash_fail; -#endif /* UNIV_SEARCH_PERF_STAT */ - /** After change in n_fields or n_bytes in info, this many rounds are waited before starting the hash analysis again: this is to save CPU time when there is no hope in building a hash index. */ diff --git a/storage/innobase/include/btr0types.h b/storage/innobase/include/btr0types.h index c1a4531f861..04b69d8145c 100644 --- a/storage/innobase/include/btr0types.h +++ b/storage/innobase/include/btr0types.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2011, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -81,7 +81,7 @@ btr_blob_dbg_rbt_insert( dict_index_t* index, /*!< in/out: index tree */ const btr_blob_dbg_t* b, /*!< in: the reference */ const char* ctx) /*!< in: context (for logging) */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /** Remove from index->blobs a reference to an off-page column. @param index the index tree @@ -94,7 +94,7 @@ btr_blob_dbg_rbt_delete( dict_index_t* index, /*!< in/out: index tree */ const btr_blob_dbg_t* b, /*!< in: the reference */ const char* ctx) /*!< in: context (for logging) */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /**************************************************************//** Add to index->blobs any references to off-page columns from a record. @@ -107,7 +107,7 @@ btr_blob_dbg_add_rec( dict_index_t* index, /*!< in/out: index */ const ulint* offsets,/*!< in: offsets */ const char* ctx) /*!< in: context (for logging) */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /**************************************************************//** Remove from index->blobs any references to off-page columns from a record. @return number of references removed */ @@ -119,7 +119,7 @@ btr_blob_dbg_remove_rec( dict_index_t* index, /*!< in/out: index */ const ulint* offsets,/*!< in: offsets */ const char* ctx) /*!< in: context (for logging) */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /**************************************************************//** Count and add to index->blobs any references to off-page columns from records on a page. @@ -131,7 +131,7 @@ btr_blob_dbg_add( const page_t* page, /*!< in: rewritten page */ dict_index_t* index, /*!< in/out: index */ const char* ctx) /*!< in: context (for logging) */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /**************************************************************//** Count and remove from index->blobs any references to off-page columns from records on a page. @@ -144,7 +144,7 @@ btr_blob_dbg_remove( const page_t* page, /*!< in: b-tree page */ dict_index_t* index, /*!< in/out: index */ const char* ctx) /*!< in: context (for logging) */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /**************************************************************//** Restore in index->blobs any references to off-page columns Used when page reorganize fails due to compressed page overflow. */ @@ -156,7 +156,7 @@ btr_blob_dbg_restore( const page_t* page, /*!< in: copy of original page */ dict_index_t* index, /*!< in/out: index */ const char* ctx) /*!< in: context (for logging) */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /** Operation that processes the BLOB references of an index record @param[in] rec record on index page @@ -180,7 +180,7 @@ btr_blob_dbg_op( dict_index_t* index, /*!< in/out: index */ const char* ctx, /*!< in: context (for logging) */ const btr_blob_dbg_op_f op) /*!< in: operation on records */ - __attribute__((nonnull(1,3,4,5))); + MY_ATTRIBUTE((nonnull(1,3,4,5))); #else /* UNIV_BLOB_DEBUG */ # define btr_blob_dbg_add_rec(rec, index, offsets, ctx) ((void) 0) # define btr_blob_dbg_add(page, index, ctx) ((void) 0) diff --git a/storage/innobase/include/buf0buddy.h b/storage/innobase/include/buf0buddy.h index fab9a4b828b..7fc4408505d 100644 --- a/storage/innobase/include/buf0buddy.h +++ b/storage/innobase/include/buf0buddy.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2006, 2011, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2006, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -54,7 +54,7 @@ buf_buddy_alloc( storage was allocated from the LRU list and buf_pool->mutex was temporarily released */ - __attribute__((malloc, nonnull)); + MY_ATTRIBUTE((malloc, nonnull)); /**********************************************************************//** Deallocate a block. */ @@ -68,7 +68,7 @@ buf_buddy_free( be pointed to by the buffer pool */ ulint size) /*!< in: block size, up to UNIV_PAGE_SIZE */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); #ifndef UNIV_NONINL # include "buf0buddy.ic" diff --git a/storage/innobase/include/buf0buddy.ic b/storage/innobase/include/buf0buddy.ic index be2f950162d..4352ebe8945 100644 --- a/storage/innobase/include/buf0buddy.ic +++ b/storage/innobase/include/buf0buddy.ic @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2006, 2011, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2006, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -50,7 +50,7 @@ buf_buddy_alloc_low( allocated from the LRU list and buf_pool->mutex was temporarily released */ - __attribute__((malloc, nonnull)); + MY_ATTRIBUTE((malloc, nonnull)); /**********************************************************************//** Deallocate a block. */ @@ -63,7 +63,7 @@ buf_buddy_free_low( pointed to by the buffer pool */ ulint i) /*!< in: index of buf_pool->zip_free[], or BUF_BUDDY_SIZES */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /**********************************************************************//** Get the index of buf_pool->zip_free[] for a given block size. diff --git a/storage/innobase/include/buf0buf.h b/storage/innobase/include/buf0buf.h index 985bddd1317..c737f3a6f1d 100644 --- a/storage/innobase/include/buf0buf.h +++ b/storage/innobase/include/buf0buf.h @@ -1,7 +1,7 @@ /***************************************************************************** -Copyright (c) 1995, 2014, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2013, 2015, MariaDB Corporation. +Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2013, 2016, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -256,7 +256,7 @@ buf_relocate( buf_page_get_state(bpage) must be BUF_BLOCK_ZIP_DIRTY or BUF_BLOCK_ZIP_PAGE */ buf_page_t* dpage) /*!< in/out: destination control block */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /*********************************************************************//** Gets the current size of buffer buf_pool in bytes. @return size in bytes */ @@ -287,7 +287,7 @@ UNIV_INLINE buf_page_t* buf_page_alloc_descriptor(void) /*===========================*/ - __attribute__((malloc)); + MY_ATTRIBUTE((malloc)); /********************************************************************//** Free a buf_page_t descriptor. */ UNIV_INLINE @@ -295,7 +295,7 @@ void buf_page_free_descriptor( /*=====================*/ buf_page_t* bpage) /*!< in: bpage descriptor to free. */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /********************************************************************//** Allocates a buffer block. @@ -536,7 +536,7 @@ ulint buf_page_get_freed_page_clock( /*==========================*/ const buf_page_t* bpage) /*!< in: block */ - __attribute__((pure)); + MY_ATTRIBUTE((pure)); /********************************************************************//** Reads the freed_page_clock of a buffer block. @return freed_page_clock */ @@ -545,7 +545,7 @@ ulint buf_block_get_freed_page_clock( /*===========================*/ const buf_block_t* block) /*!< in: block */ - __attribute__((pure)); + MY_ATTRIBUTE((pure)); /********************************************************************//** Tells if a block is still close enough to the MRU end of the LRU list @@ -608,7 +608,7 @@ buf_block_buf_fix_inc_func( ulint line, /*!< in: line */ # endif /* UNIV_SYNC_DEBUG */ buf_block_t* block) /*!< in/out: block to bufferfix */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /*******************************************************************//** Increments the bufferfix count. */ @@ -654,7 +654,7 @@ buf_page_is_corrupted( const byte* read_buf, /*!< in: a database page */ ulint zip_size) /*!< in: size of compressed page; 0 for uncompressed pages */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /********************************************************************//** Checks if a page is all zeroes. @return TRUE if the page is all zeroes */ @@ -684,7 +684,7 @@ ulint buf_block_get_lock_hash_val( /*========================*/ const buf_block_t* block) /*!< in: block */ - __attribute__((pure)); + MY_ATTRIBUTE((pure)); #ifdef UNIV_DEBUG /*********************************************************************//** Finds a block in the buffer pool that points to a @@ -745,7 +745,7 @@ buf_page_print( ulint flags) /*!< in: 0 or BUF_PAGE_PRINT_NO_CRASH or BUF_PAGE_PRINT_NO_FULL */ - UNIV_COLD __attribute__((nonnull)); + UNIV_COLD MY_ATTRIBUTE((nonnull)); /********************************************************************//** Decompress a block. @return TRUE if successful */ @@ -882,7 +882,7 @@ enum buf_page_state buf_block_get_state( /*================*/ const buf_block_t* block) /*!< in: pointer to the control block */ - __attribute__((pure)); + MY_ATTRIBUTE((pure)); /*********************************************************************//** Sets the state of a block. */ UNIV_INLINE @@ -907,7 +907,7 @@ ibool buf_page_in_file( /*=============*/ const buf_page_t* bpage) /*!< in: pointer to control block */ - __attribute__((pure)); + MY_ATTRIBUTE((pure)); #ifndef UNIV_HOTBACKUP /*********************************************************************//** Determines if a block should be on unzip_LRU list. @@ -917,7 +917,7 @@ ibool buf_page_belongs_to_unzip_LRU( /*==========================*/ const buf_page_t* bpage) /*!< in: pointer to control block */ - __attribute__((pure)); + MY_ATTRIBUTE((pure)); /*********************************************************************//** Gets the mutex of a block. @@ -927,7 +927,7 @@ ib_mutex_t* buf_page_get_mutex( /*===============*/ const buf_page_t* bpage) /*!< in: pointer to control block */ - __attribute__((pure)); + MY_ATTRIBUTE((pure)); /*********************************************************************//** Get the flush type of a page. @@ -937,7 +937,7 @@ buf_flush_t buf_page_get_flush_type( /*====================*/ const buf_page_t* bpage) /*!< in: buffer page */ - __attribute__((pure)); + MY_ATTRIBUTE((pure)); /*********************************************************************//** Set the flush type of a page. */ UNIV_INLINE @@ -963,7 +963,7 @@ enum buf_io_fix buf_page_get_io_fix( /*================*/ const buf_page_t* bpage) /*!< in: pointer to the control block */ - __attribute__((pure)); + MY_ATTRIBUTE((pure)); /*********************************************************************//** Gets the io_fix state of a block. @return io_fix state */ @@ -972,7 +972,7 @@ enum buf_io_fix buf_block_get_io_fix( /*================*/ const buf_block_t* block) /*!< in: pointer to the control block */ - __attribute__((pure)); + MY_ATTRIBUTE((pure)); /*********************************************************************//** Sets the io_fix state of a block. */ UNIV_INLINE @@ -1018,7 +1018,7 @@ ibool buf_page_can_relocate( /*==================*/ const buf_page_t* bpage) /*!< control block being relocated */ - __attribute__((pure)); + MY_ATTRIBUTE((pure)); /*********************************************************************//** Determine if a block has been flagged old. @@ -1028,7 +1028,7 @@ ibool buf_page_is_old( /*============*/ const buf_page_t* bpage) /*!< in: control block */ - __attribute__((pure)); + MY_ATTRIBUTE((pure)); /*********************************************************************//** Flag a block old. */ UNIV_INLINE @@ -1045,7 +1045,7 @@ unsigned buf_page_is_accessed( /*=================*/ const buf_page_t* bpage) /*!< in: control block */ - __attribute__((nonnull, pure)); + MY_ATTRIBUTE((nonnull, pure)); /*********************************************************************//** Flag a block accessed. */ UNIV_INLINE @@ -1053,7 +1053,7 @@ void buf_page_set_accessed( /*==================*/ buf_page_t* bpage) /*!< in/out: control block */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /*********************************************************************//** Gets the buf_block_t handle of a buffered file block if an uncompressed page frame exists, or NULL. Note: even though bpage is not declared a @@ -1064,7 +1064,7 @@ buf_block_t* buf_page_get_block( /*===============*/ buf_page_t* bpage) /*!< in: control block, or NULL */ - __attribute__((pure)); + MY_ATTRIBUTE((pure)); #endif /* !UNIV_HOTBACKUP */ #ifdef UNIV_DEBUG /*********************************************************************//** @@ -1075,7 +1075,7 @@ buf_frame_t* buf_block_get_frame( /*================*/ const buf_block_t* block) /*!< in: pointer to the control block */ - __attribute__((pure)); + MY_ATTRIBUTE((pure)); #else /* UNIV_DEBUG */ # define buf_block_get_frame(block) (block)->frame #endif /* UNIV_DEBUG */ @@ -1087,7 +1087,7 @@ ulint buf_page_get_space( /*===============*/ const buf_page_t* bpage) /*!< in: pointer to the control block */ - __attribute__((pure)); + MY_ATTRIBUTE((pure)); /*********************************************************************//** Gets the space id of a block. @return space id */ @@ -1096,7 +1096,7 @@ ulint buf_block_get_space( /*================*/ const buf_block_t* block) /*!< in: pointer to the control block */ - __attribute__((pure)); + MY_ATTRIBUTE((pure)); /*********************************************************************//** Gets the page number of a block. @return page number */ @@ -1105,7 +1105,7 @@ ulint buf_page_get_page_no( /*=================*/ const buf_page_t* bpage) /*!< in: pointer to the control block */ - __attribute__((pure)); + MY_ATTRIBUTE((pure)); /*********************************************************************//** Gets the page number of a block. @return page number */ @@ -1114,7 +1114,7 @@ ulint buf_block_get_page_no( /*==================*/ const buf_block_t* block) /*!< in: pointer to the control block */ - __attribute__((pure)); + MY_ATTRIBUTE((pure)); /*********************************************************************//** Gets the compressed page size of a block. @return compressed page size, or 0 */ @@ -1123,7 +1123,7 @@ ulint buf_page_get_zip_size( /*==================*/ const buf_page_t* bpage) /*!< in: pointer to the control block */ - __attribute__((pure)); + MY_ATTRIBUTE((pure)); /*********************************************************************//** Gets the compressed page size of a block. @return compressed page size, or 0 */ @@ -1132,7 +1132,7 @@ ulint buf_block_get_zip_size( /*===================*/ const buf_block_t* block) /*!< in: pointer to the control block */ - __attribute__((pure)); + MY_ATTRIBUTE((pure)); /*********************************************************************//** Gets the compressed page descriptor corresponding to an uncompressed page if applicable. */ @@ -1223,7 +1223,7 @@ buf_page_address_fold( /*==================*/ ulint space, /*!< in: space id */ ulint offset) /*!< in: offset of the page within space */ - __attribute__((const)); + MY_ATTRIBUTE((const)); /********************************************************************//** Calculates the index of a buffer pool to the buf_pool[] array. @return the position of the buffer pool in buf_pool[] */ @@ -1232,7 +1232,7 @@ ulint buf_pool_index( /*===========*/ const buf_pool_t* buf_pool) /*!< in: buffer pool */ - __attribute__((nonnull, const)); + MY_ATTRIBUTE((nonnull, const)); /******************************************************************//** Returns the buffer pool instance given a page instance @return buf_pool */ @@ -1372,7 +1372,7 @@ buf_pool_watch_is_sentinel( /*=======================*/ buf_pool_t* buf_pool, /*!< buffer pool instance */ const buf_page_t* bpage) /*!< in: block */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /****************************************************************//** Add watch for the given page to be read in. Caller must have the buffer pool @return NULL if watch set, block if the page is in the buffer pool */ @@ -1383,7 +1383,7 @@ buf_pool_watch_set( ulint space, /*!< in: space id */ ulint offset, /*!< in: page number */ ulint fold) /*!< in: buf_page_address_fold(space, offset) */ - __attribute__((warn_unused_result)); + MY_ATTRIBUTE((warn_unused_result)); /****************************************************************//** Stop watching if the page has been read in. buf_pool_watch_set(space,offset) must have returned NULL before. */ @@ -1404,7 +1404,7 @@ buf_pool_watch_occurred( /*====================*/ ulint space, /*!< in: space id */ ulint offset) /*!< in: page number */ - __attribute__((warn_unused_result)); + MY_ATTRIBUTE((warn_unused_result)); /********************************************************************//** Get total buffer pool statistics. */ UNIV_INTERN diff --git a/storage/innobase/include/buf0buf.ic b/storage/innobase/include/buf0buf.ic index 5b66d65dcba..e77c5a84202 100644 --- a/storage/innobase/include/buf0buf.ic +++ b/storage/innobase/include/buf0buf.ic @@ -302,6 +302,20 @@ buf_page_set_state( ut_a(state == BUF_BLOCK_NOT_USED); break; case BUF_BLOCK_FILE_PAGE: + if (!(state == BUF_BLOCK_NOT_USED + || state == BUF_BLOCK_REMOVE_HASH)) { + const char *old_state_name = buf_get_state_name((buf_block_t*)bpage); + bpage->state = state; + + fprintf(stderr, + "InnoDB: Error: block old state %d (%s) " + " new state %d (%s) not correct\n", + old_state, + old_state_name, + state, + buf_get_state_name((buf_block_t*)bpage)); + } + ut_a(state == BUF_BLOCK_NOT_USED || state == BUF_BLOCK_REMOVE_HASH); break; diff --git a/storage/innobase/include/buf0flu.h b/storage/innobase/include/buf0flu.h index 3ab3f7c308a..f1ca1039ccb 100644 --- a/storage/innobase/include/buf0flu.h +++ b/storage/innobase/include/buf0flu.h @@ -1,7 +1,7 @@ /***************************************************************************** -Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2014, 2014, SkySQL Ab. +Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2014, 2016, MariaDB Corporation This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -97,7 +97,7 @@ buf_flush_page_try( /*===============*/ buf_pool_t* buf_pool, /*!< in/out: buffer pool instance */ buf_block_t* block) /*!< in/out: buffer control block */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); # endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */ /*******************************************************************//** This utility flushes dirty blocks from the end of the flush list of @@ -266,7 +266,7 @@ buf_flush_ready_for_flush( buf_page_t* bpage, /*!< in: buffer control block, must be buf_page_in_file(bpage) */ buf_flush_t flush_type)/*!< in: type of flush */ - __attribute__((warn_unused_result)); + MY_ATTRIBUTE((warn_unused_result)); #ifdef UNIV_DEBUG /******************************************************************//** diff --git a/storage/innobase/include/buf0lru.h b/storage/innobase/include/buf0lru.h index f1f6abd2d68..a7a65df33aa 100644 --- a/storage/innobase/include/buf0lru.h +++ b/storage/innobase/include/buf0lru.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -93,7 +93,7 @@ buf_LRU_free_page( buf_page_t* bpage, /*!< in: block to be freed */ bool zip) /*!< in: true if should remove also the compressed page of an uncompressed page */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /******************************************************************//** Try to free a replaceable block. @return TRUE if found and freed */ @@ -105,7 +105,7 @@ buf_LRU_scan_and_free_block( ibool scan_all) /*!< in: scan whole LRU list if TRUE, otherwise scan only 'old' blocks. */ - __attribute__((nonnull,warn_unused_result)); + MY_ATTRIBUTE((nonnull,warn_unused_result)); /******************************************************************//** Returns a free block from the buf_pool. The block is taken off the free list. If it is empty, returns NULL. @@ -144,7 +144,7 @@ buf_block_t* buf_LRU_get_free_block( /*===================*/ buf_pool_t* buf_pool) /*!< in/out: buffer pool instance */ - __attribute__((nonnull,warn_unused_result)); + MY_ATTRIBUTE((nonnull,warn_unused_result)); /******************************************************************//** Determines if the unzip_LRU list should be used for evicting a victim instead of the general LRU list. @@ -227,7 +227,7 @@ buf_LRU_free_one_page( buf_page_t* bpage) /*!< in/out: block, must contain a file page and be in a state where it can be freed; there may or may not be a hash index to the page */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /******************************************************************//** Adjust LRU hazard pointers if needed. */ diff --git a/storage/innobase/include/data0data.h b/storage/innobase/include/data0data.h index a548c7b89b3..1d954bfc07c 100644 --- a/storage/innobase/include/data0data.h +++ b/storage/innobase/include/data0data.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1994, 2012, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -46,7 +46,7 @@ dtype_t* dfield_get_type( /*============*/ const dfield_t* field) /*!< in: SQL data field */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /*********************************************************************//** Gets pointer to the data in a field. @return pointer to data */ @@ -55,7 +55,7 @@ void* dfield_get_data( /*============*/ const dfield_t* field) /*!< in: field */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); #else /* UNIV_DEBUG */ # define dfield_get_type(field) (&(field)->type) # define dfield_get_data(field) ((field)->data) @@ -68,7 +68,7 @@ dfield_set_type( /*============*/ dfield_t* field, /*!< in: SQL data field */ const dtype_t* type) /*!< in: pointer to data type struct */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /*********************************************************************//** Gets length of field data. @return length of data; UNIV_SQL_NULL if SQL null data */ @@ -77,7 +77,7 @@ ulint dfield_get_len( /*===========*/ const dfield_t* field) /*!< in: field */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /*********************************************************************//** Sets length in a field. */ UNIV_INLINE @@ -86,7 +86,7 @@ dfield_set_len( /*===========*/ dfield_t* field, /*!< in: field */ ulint len) /*!< in: length or UNIV_SQL_NULL */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /*********************************************************************//** Determines if a field is SQL NULL @return nonzero if SQL null data */ @@ -95,7 +95,7 @@ ulint dfield_is_null( /*===========*/ const dfield_t* field) /*!< in: field */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /*********************************************************************//** Determines if a field is externally stored @return nonzero if externally stored */ @@ -104,7 +104,7 @@ ulint dfield_is_ext( /*==========*/ const dfield_t* field) /*!< in: field */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /*********************************************************************//** Sets the "external storage" flag */ UNIV_INLINE @@ -112,7 +112,7 @@ void dfield_set_ext( /*===========*/ dfield_t* field) /*!< in/out: field */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /*********************************************************************//** Sets pointer to the data and length in a field. */ UNIV_INLINE @@ -122,7 +122,7 @@ dfield_set_data( dfield_t* field, /*!< in: field */ const void* data, /*!< in: data */ ulint len) /*!< in: length or UNIV_SQL_NULL */ - __attribute__((nonnull(1))); + MY_ATTRIBUTE((nonnull(1))); /*********************************************************************//** Sets a data field to SQL NULL. */ UNIV_INLINE @@ -130,7 +130,7 @@ void dfield_set_null( /*============*/ dfield_t* field) /*!< in/out: field */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /**********************************************************************//** Writes an SQL null field full of zeros. */ UNIV_INLINE @@ -139,7 +139,7 @@ data_write_sql_null( /*================*/ byte* data, /*!< in: pointer to a buffer of size len */ ulint len) /*!< in: SQL null size in bytes */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /*********************************************************************//** Copies the data and len fields. */ UNIV_INLINE @@ -148,7 +148,7 @@ dfield_copy_data( /*=============*/ dfield_t* field1, /*!< out: field to copy to */ const dfield_t* field2) /*!< in: field to copy from */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /*********************************************************************//** Copies a data field to another. */ UNIV_INLINE @@ -157,7 +157,7 @@ dfield_copy( /*========*/ dfield_t* field1, /*!< out: field to copy to */ const dfield_t* field2) /*!< in: field to copy from */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /*********************************************************************//** Copies the data pointed to by a data field. */ UNIV_INLINE @@ -166,7 +166,7 @@ dfield_dup( /*=======*/ dfield_t* field, /*!< in/out: data field */ mem_heap_t* heap) /*!< in: memory heap where allocated */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); #ifndef UNIV_HOTBACKUP /*********************************************************************//** Tests if two data fields are equal. @@ -181,7 +181,7 @@ dfield_datas_are_binary_equal( const dfield_t* field2, /*!< in: field */ ulint len) /*!< in: maximum prefix to compare, or 0 to compare the whole field length */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /*********************************************************************//** Tests if dfield data length and content is equal to the given. @return TRUE if equal */ @@ -192,7 +192,7 @@ dfield_data_is_binary_equal( const dfield_t* field, /*!< in: field */ ulint len, /*!< in: data length or UNIV_SQL_NULL */ const byte* data) /*!< in: data */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); #endif /* !UNIV_HOTBACKUP */ /*********************************************************************//** Gets number of fields in a data tuple. @@ -202,7 +202,7 @@ ulint dtuple_get_n_fields( /*================*/ const dtuple_t* tuple) /*!< in: tuple */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); #ifdef UNIV_DEBUG /*********************************************************************//** Gets nth field of a tuple. @@ -224,7 +224,7 @@ ulint dtuple_get_info_bits( /*=================*/ const dtuple_t* tuple) /*!< in: tuple */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /*********************************************************************//** Sets info bits in a data tuple. */ UNIV_INLINE @@ -233,7 +233,7 @@ dtuple_set_info_bits( /*=================*/ dtuple_t* tuple, /*!< in: tuple */ ulint info_bits) /*!< in: info bits */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /*********************************************************************//** Gets number of fields used in record comparisons. @return number of fields used in comparisons in rem0cmp.* */ @@ -242,7 +242,7 @@ ulint dtuple_get_n_fields_cmp( /*====================*/ const dtuple_t* tuple) /*!< in: tuple */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /*********************************************************************//** Gets number of fields used in record comparisons. */ UNIV_INLINE @@ -252,7 +252,7 @@ dtuple_set_n_fields_cmp( dtuple_t* tuple, /*!< in: tuple */ ulint n_fields_cmp) /*!< in: number of fields used in comparisons in rem0cmp.* */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /* Estimate the number of bytes that are going to be allocated when creating a new dtuple_t object */ @@ -272,7 +272,7 @@ dtuple_create_from_mem( void* buf, /*!< in, out: buffer to use */ ulint buf_size, /*!< in: buffer size */ ulint n_fields) /*!< in: number of fields */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /**********************************************************//** Creates a data tuple to a memory heap. The default value for number @@ -286,7 +286,7 @@ dtuple_create( is created, DTUPLE_EST_ALLOC(n_fields) bytes will be allocated from this heap */ ulint n_fields)/*!< in: number of fields */ - __attribute__((nonnull, malloc)); + MY_ATTRIBUTE((nonnull, malloc)); /*********************************************************************//** Sets number of fields used in a tuple. Normally this is set in @@ -297,7 +297,7 @@ dtuple_set_n_fields( /*================*/ dtuple_t* tuple, /*!< in: tuple */ ulint n_fields) /*!< in: number of fields */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /*********************************************************************//** Copies a data tuple to another. This is a shallow copy; if a deep copy is desired, dfield_dup() will have to be invoked on each field. @@ -309,7 +309,7 @@ dtuple_copy( const dtuple_t* tuple, /*!< in: tuple to copy from */ mem_heap_t* heap) /*!< in: memory heap where the tuple is created */ - __attribute__((nonnull, malloc)); + MY_ATTRIBUTE((nonnull, malloc)); /**********************************************************//** The following function returns the sum of data lengths of a tuple. The space occupied by the field structs or the tuple struct is not counted. @@ -320,7 +320,7 @@ dtuple_get_data_size( /*=================*/ const dtuple_t* tuple, /*!< in: typed data tuple */ ulint comp) /*!< in: nonzero=ROW_FORMAT=COMPACT */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /*********************************************************************//** Computes the number of externally stored fields in a data tuple. @return number of fields */ @@ -329,7 +329,7 @@ ulint dtuple_get_n_ext( /*=============*/ const dtuple_t* tuple) /*!< in: tuple */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /************************************************************//** Compare two data tuples, respecting the collation of character fields. @return 1, 0 , -1 if tuple1 is greater, equal, less, respectively, @@ -340,7 +340,7 @@ dtuple_coll_cmp( /*============*/ const dtuple_t* tuple1, /*!< in: tuple 1 */ const dtuple_t* tuple2) /*!< in: tuple 2 */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /************************************************************//** Folds a prefix given as the number of fields of a tuple. @return the folded value */ @@ -353,7 +353,7 @@ dtuple_fold( ulint n_bytes,/*!< in: number of bytes to fold in an incomplete last field */ index_id_t tree_id)/*!< in: index tree id */ - __attribute__((nonnull, pure, warn_unused_result)); + MY_ATTRIBUTE((nonnull, pure, warn_unused_result)); /*******************************************************************//** Sets types of fields binary in a tuple. */ UNIV_INLINE @@ -362,7 +362,7 @@ dtuple_set_types_binary( /*====================*/ dtuple_t* tuple, /*!< in: data tuple */ ulint n) /*!< in: number of fields to set */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /**********************************************************************//** Checks if a dtuple contains an SQL null value. @return TRUE if some field is SQL null */ @@ -371,7 +371,7 @@ ibool dtuple_contains_null( /*=================*/ const dtuple_t* tuple) /*!< in: dtuple */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /**********************************************************//** Checks that a data field is typed. Asserts an error if not. @return TRUE if ok */ @@ -380,7 +380,7 @@ ibool dfield_check_typed( /*===============*/ const dfield_t* field) /*!< in: data field */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /**********************************************************//** Checks that a data tuple is typed. Asserts an error if not. @return TRUE if ok */ @@ -389,7 +389,7 @@ ibool dtuple_check_typed( /*===============*/ const dtuple_t* tuple) /*!< in: tuple */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /**********************************************************//** Checks that a data tuple is typed. @return TRUE if ok */ @@ -398,7 +398,7 @@ ibool dtuple_check_typed_no_assert( /*=========================*/ const dtuple_t* tuple) /*!< in: tuple */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); #ifdef UNIV_DEBUG /**********************************************************//** Validates the consistency of a tuple which must be complete, i.e, @@ -409,7 +409,7 @@ ibool dtuple_validate( /*============*/ const dtuple_t* tuple) /*!< in: tuple */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); #endif /* UNIV_DEBUG */ /*************************************************************//** Pretty prints a dfield value according to its data type. */ @@ -418,7 +418,7 @@ void dfield_print( /*=========*/ const dfield_t* dfield) /*!< in: dfield */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /*************************************************************//** Pretty prints a dfield value according to its data type. Also the hex string is printed if a string contains non-printable characters. */ @@ -427,7 +427,7 @@ void dfield_print_also_hex( /*==================*/ const dfield_t* dfield) /*!< in: dfield */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /**********************************************************//** The following function prints the contents of a tuple. */ UNIV_INTERN @@ -436,7 +436,7 @@ dtuple_print( /*=========*/ FILE* f, /*!< in: output stream */ const dtuple_t* tuple) /*!< in: tuple */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /**************************************************************//** Moves parts of long fields in entry to the big record vector so that the size of tuple drops below the maximum record size allowed in the @@ -453,7 +453,7 @@ dtuple_convert_big_rec( dtuple_t* entry, /*!< in/out: index entry */ ulint* n_ext) /*!< in/out: number of externally stored columns */ - __attribute__((nonnull, malloc, warn_unused_result)); + MY_ATTRIBUTE((nonnull, malloc, warn_unused_result)); /**************************************************************//** Puts back to entry the data stored in vector. Note that to ensure the fields in entry can accommodate the data, vector must have been created @@ -466,7 +466,7 @@ dtuple_convert_back_big_rec( dtuple_t* entry, /*!< in: entry whose data was put to vector */ big_rec_t* vector) /*!< in, own: big rec vector; it is freed in this function */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /**************************************************************//** Frees the memory in a big rec vector. */ UNIV_INLINE @@ -475,7 +475,7 @@ dtuple_big_rec_free( /*================*/ big_rec_t* vector) /*!< in, own: big rec vector; it is freed in this function */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /*######################################################################*/ diff --git a/storage/innobase/include/data0data.ic b/storage/innobase/include/data0data.ic index 6937d55d211..11499ab928c 100644 --- a/storage/innobase/include/data0data.ic +++ b/storage/innobase/include/data0data.ic @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1994, 2012, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -56,7 +56,8 @@ dfield_set_type( dfield_t* field, /*!< in: SQL data field */ const dtype_t* type) /*!< in: pointer to data type struct */ { - ut_ad(field && type); + ut_ad(field != NULL); + ut_ad(type != NULL); field->type = *type; } @@ -194,7 +195,8 @@ dfield_copy_data( dfield_t* field1, /*!< out: field to copy to */ const dfield_t* field2) /*!< in: field to copy from */ { - ut_ad(field1 && field2); + ut_ad(field1 != NULL); + ut_ad(field2 != NULL); field1->data = field2->data; field1->len = field2->len; diff --git a/storage/innobase/include/dict0boot.h b/storage/innobase/include/dict0boot.h index a994c9d8ff1..477e1150f43 100644 --- a/storage/innobase/include/dict0boot.h +++ b/storage/innobase/include/dict0boot.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -95,7 +95,7 @@ UNIV_INTERN dberr_t dict_boot(void) /*===========*/ - __attribute__((warn_unused_result)); + MY_ATTRIBUTE((warn_unused_result)); /*****************************************************************//** Creates and initializes the data dictionary at the server bootstrap. @@ -104,7 +104,7 @@ UNIV_INTERN dberr_t dict_create(void) /*=============*/ - __attribute__((warn_unused_result)); + MY_ATTRIBUTE((warn_unused_result)); /*********************************************************************//** Check if a table id belongs to system table. @@ -114,7 +114,7 @@ bool dict_is_sys_table( /*==============*/ table_id_t id) /*!< in: table id to check */ - __attribute__((warn_unused_result)); + MY_ATTRIBUTE((warn_unused_result)); /* Space id and page no where the dictionary header resides */ #define DICT_HDR_SPACE 0 /* the SYSTEM tablespace */ diff --git a/storage/innobase/include/dict0crea.h b/storage/innobase/include/dict0crea.h index 564fad35748..150c76b2e65 100644 --- a/storage/innobase/include/dict0crea.h +++ b/storage/innobase/include/dict0crea.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2014, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -137,7 +137,7 @@ dict_create_add_foreign_id( incremented if used */ const char* name, /*!< in: table name */ dict_foreign_t* foreign)/*!< in/out: foreign key */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /** Adds the given set of foreign key objects to the dictionary tables in the database. This function does not modify the dictionary cache. The @@ -156,7 +156,7 @@ dict_create_add_foreigns_to_dictionary( const dict_foreign_set& local_fk_set, const dict_table_t* table, trx_t* trx) - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /****************************************************************//** Creates the tablespaces and datafiles system tables inside InnoDB at server bootstrap or server start if they are not found or are @@ -192,7 +192,7 @@ dict_create_add_foreign_to_dictionary( const char* name, /*!< in: table name */ const dict_foreign_t* foreign,/*!< in: foreign key */ trx_t* trx) /*!< in/out: dictionary transaction */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /********************************************************************//** Construct foreign key constraint defintion from data dictionary information. diff --git a/storage/innobase/include/dict0crea.ic b/storage/innobase/include/dict0crea.ic index 2d0d9dcb858..1cbaa47032b 100644 --- a/storage/innobase/include/dict0crea.ic +++ b/storage/innobase/include/dict0crea.ic @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -33,7 +33,7 @@ UNIV_INTERN bool row_is_mysql_tmp_table_name( /*========================*/ - const char* name) __attribute__((warn_unused_result)); + const char* name) MY_ATTRIBUTE((warn_unused_result)); /*!< in: table name in the form 'database/tablename' */ diff --git a/storage/innobase/include/dict0dict.h b/storage/innobase/include/dict0dict.h index b15d364948c..42f93b5a889 100644 --- a/storage/innobase/include/dict0dict.h +++ b/storage/innobase/include/dict0dict.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2015, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2012, Facebook Inc. Copyright (c) 2013, 2015, MariaDB Corporation. @@ -59,7 +59,7 @@ void dict_casedn_str( /*============*/ char* a) /*!< in/out: string to put in lower case */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /********************************************************************//** Get the database name length in a table name. @return database name length */ @@ -69,7 +69,7 @@ dict_get_db_name_len( /*=================*/ const char* name) /*!< in: table name in the form dbname '/' tablename */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /*********************************************************************//** Open a table from its database and table name, this is currently used by foreign constraint parser to get the referenced table. @@ -113,7 +113,7 @@ dict_remove_db_name( /*================*/ const char* name) /*!< in: table name in the form dbname '/' tablename */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /** Operation to perform when opening a table */ enum dict_table_op_t { @@ -161,7 +161,7 @@ dict_table_close( ibool try_drop) /*!< in: TRUE=try to drop any orphan indexes after an aborted online index creation */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /**********************************************************************//** Inits the data dictionary module. */ UNIV_INTERN @@ -186,7 +186,7 @@ ulint dict_col_get_mbminlen( /*==================*/ const dict_col_t* col) /*!< in: column */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /*********************************************************************//** Gets the maximum number of bytes per character. @return maximum multi-byte char size, in bytes */ @@ -195,7 +195,7 @@ ulint dict_col_get_mbmaxlen( /*==================*/ const dict_col_t* col) /*!< in: column */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /*********************************************************************//** Sets the minimum and maximum number of bytes per character. */ UNIV_INLINE @@ -207,7 +207,7 @@ dict_col_set_mbminmaxlen( character size, in bytes */ ulint mbmaxlen) /*!< in: minimum multi-byte character size, in bytes */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /*********************************************************************//** Gets the column data type. */ UNIV_INLINE @@ -216,7 +216,7 @@ dict_col_copy_type( /*===============*/ const dict_col_t* col, /*!< in: column */ dtype_t* type) /*!< out: data type */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /**********************************************************************//** Determine bytes of column prefix to be stored in the undo log. Please note if the table format is UNIV_FORMAT_A (< UNIV_FORMAT_B), no prefix @@ -229,7 +229,7 @@ dict_max_field_len_store_undo( dict_table_t* table, /*!< in: table */ const dict_col_t* col) /*!< in: column which index prefix is based on */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); #endif /* !UNIV_HOTBACKUP */ #ifdef UNIV_DEBUG /*********************************************************************//** @@ -241,7 +241,7 @@ dict_col_type_assert_equal( /*=======================*/ const dict_col_t* col, /*!< in: column */ const dtype_t* type) /*!< in: data type */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); #endif /* UNIV_DEBUG */ #ifndef UNIV_HOTBACKUP /***********************************************************************//** @@ -252,7 +252,7 @@ ulint dict_col_get_min_size( /*==================*/ const dict_col_t* col) /*!< in: column */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /***********************************************************************//** Returns the maximum size of the column. @return maximum size */ @@ -261,7 +261,7 @@ ulint dict_col_get_max_size( /*==================*/ const dict_col_t* col) /*!< in: column */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /***********************************************************************//** Returns the size of a fixed size column, 0 if not a fixed size column. @return fixed size, or 0 */ @@ -271,7 +271,7 @@ dict_col_get_fixed_size( /*====================*/ const dict_col_t* col, /*!< in: column */ ulint comp) /*!< in: nonzero=ROW_FORMAT=COMPACT */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /***********************************************************************//** Returns the ROW_FORMAT=REDUNDANT stored SQL NULL size of a column. For fixed length types it is the fixed length of the type, otherwise 0. @@ -282,7 +282,7 @@ dict_col_get_sql_null_size( /*=======================*/ const dict_col_t* col, /*!< in: column */ ulint comp) /*!< in: nonzero=ROW_FORMAT=COMPACT */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /*********************************************************************//** Gets the column number. @return col->ind, table column position (starting from 0) */ @@ -291,7 +291,7 @@ ulint dict_col_get_no( /*============*/ const dict_col_t* col) /*!< in: column */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /*********************************************************************//** Gets the column position in the clustered index. */ UNIV_INLINE @@ -300,7 +300,7 @@ dict_col_get_clust_pos( /*===================*/ const dict_col_t* col, /*!< in: table column */ const dict_index_t* clust_index) /*!< in: clustered index */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /****************************************************************//** If the given column name is reserved for InnoDB system columns, return TRUE. @@ -310,7 +310,7 @@ ibool dict_col_name_is_reserved( /*======================*/ const char* name) /*!< in: column name */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /********************************************************************//** Acquire the autoinc lock. */ UNIV_INTERN @@ -318,7 +318,7 @@ void dict_table_autoinc_lock( /*====================*/ dict_table_t* table) /*!< in/out: table */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /********************************************************************//** Unconditionally set the autoinc counter. */ UNIV_INTERN @@ -327,7 +327,7 @@ dict_table_autoinc_initialize( /*==========================*/ dict_table_t* table, /*!< in/out: table */ ib_uint64_t value) /*!< in: next value to assign to a row */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /** Store autoinc value when the table is evicted. @param[in] table table evicted */ @@ -352,7 +352,7 @@ ib_uint64_t dict_table_autoinc_read( /*====================*/ const dict_table_t* table) /*!< in: table */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /********************************************************************//** Updates the autoinc counter if the value supplied is greater than the current value. */ @@ -363,7 +363,7 @@ dict_table_autoinc_update_if_greater( dict_table_t* table, /*!< in/out: table */ ib_uint64_t value) /*!< in: value which was assigned to a row */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /********************************************************************//** Release the autoinc lock. */ UNIV_INTERN @@ -371,7 +371,7 @@ void dict_table_autoinc_unlock( /*======================*/ dict_table_t* table) /*!< in/out: table */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); #endif /* !UNIV_HOTBACKUP */ /**********************************************************************//** Adds system columns to a table object. */ @@ -381,7 +381,7 @@ dict_table_add_system_columns( /*==========================*/ dict_table_t* table, /*!< in/out: table */ mem_heap_t* heap) /*!< in: temporary heap */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); #ifndef UNIV_HOTBACKUP /**********************************************************************//** Adds a table object to the dictionary cache. */ @@ -392,7 +392,7 @@ dict_table_add_to_cache( dict_table_t* table, /*!< in: table */ ibool can_be_evicted, /*!< in: TRUE if can be evicted*/ mem_heap_t* heap) /*!< in: temporary heap */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /**********************************************************************//** Removes a table object from the dictionary cache. */ UNIV_INTERN @@ -400,7 +400,7 @@ void dict_table_remove_from_cache( /*=========================*/ dict_table_t* table) /*!< in, own: table */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /**********************************************************************//** Removes a table object from the dictionary cache. */ UNIV_INTERN @@ -423,7 +423,7 @@ dict_table_rename_in_cache( /*!< in: in ALTER TABLE we want to preserve the original table name in constraints which reference it */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /**********************************************************************//** Removes an index from the dictionary cache. */ UNIV_INTERN @@ -432,7 +432,7 @@ dict_index_remove_from_cache( /*=========================*/ dict_table_t* table, /*!< in/out: table */ dict_index_t* index) /*!< in, own: index */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /**********************************************************************//** Change the id of a table object in the dictionary cache. This is used in DISCARD TABLESPACE. */ @@ -442,7 +442,7 @@ dict_table_change_id_in_cache( /*==========================*/ dict_table_t* table, /*!< in/out: table object already in cache */ table_id_t new_id) /*!< in: new id to set */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /**********************************************************************//** Removes a foreign constraint struct from the dictionary cache. */ UNIV_INTERN @@ -450,7 +450,7 @@ void dict_foreign_remove_from_cache( /*===========================*/ dict_foreign_t* foreign) /*!< in, own: foreign constraint */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /**********************************************************************//** Adds a foreign key constraint object to the dictionary cache. May free the object if there already is an object with the same identifier in. @@ -471,7 +471,7 @@ dict_foreign_add_to_cache( compatibility */ dict_err_ignore_t ignore_err) /*!< in: error to be ignored */ - __attribute__((nonnull(1), warn_unused_result)); + MY_ATTRIBUTE((nonnull(1), warn_unused_result)); /*********************************************************************//** Checks if a table is referenced by foreign keys. @return TRUE if table is referenced by a foreign key */ @@ -480,7 +480,7 @@ ibool dict_table_is_referenced_by_foreign_key( /*====================================*/ const dict_table_t* table) /*!< in: InnoDB table */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /**********************************************************************//** Replace the index passed in with another equivalent index in the foreign key lists of the table. @@ -494,7 +494,7 @@ dict_foreign_replace_index( /*!< in: column names, or NULL to use table->col_names */ const dict_index_t* index) /*!< in: index to be replaced */ - __attribute__((nonnull(1,3), warn_unused_result)); + MY_ATTRIBUTE((nonnull(1,3), warn_unused_result)); /**********************************************************************//** Determines whether a string starts with the specified keyword. @return TRUE if str starts with keyword */ @@ -505,7 +505,7 @@ dict_str_starts_with_keyword( THD* thd, /*!< in: MySQL thread handle */ const char* str, /*!< in: string to scan for keyword */ const char* keyword) /*!< in: keyword to look for */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /*********************************************************************//** Scans a table create SQL string and adds to the data dictionary the foreign key constraints declared in the string. This function @@ -534,7 +534,7 @@ dict_create_foreign_constraints( ibool reject_fks) /*!< in: if TRUE, fail with error code DB_CANNOT_ADD_CONSTRAINT if any foreign keys are found. */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /**********************************************************************//** Parses the CONSTRAINT id's to be dropped in an ALTER TABLE statement. @return DB_SUCCESS or DB_CANNOT_DROP_CONSTRAINT if syntax error or the @@ -551,7 +551,7 @@ dict_foreign_parse_drop_constraints( to drop */ const char*** constraints_to_drop) /*!< out: id's of the constraints to drop */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /**********************************************************************//** Returns a table object and increments its open handle count. NOTE! This is a high-level function to be used mainly from outside the @@ -570,7 +570,7 @@ dict_table_open_on_name( dict_err_ignore_t ignore_err) /*!< in: error to be ignored when loading the table */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /*********************************************************************//** Tries to find an index whose first fields are the columns in the array, @@ -607,7 +607,7 @@ dict_foreign_find_index( /*!< out: index where error happened */ - __attribute__((nonnull(1,3), warn_unused_result)); + MY_ATTRIBUTE((nonnull(1,3), warn_unused_result)); /**********************************************************************//** Returns a column's name. @return column name. NOTE: not guaranteed to stay valid if table is @@ -618,7 +618,7 @@ dict_table_get_col_name( /*====================*/ const dict_table_t* table, /*!< in: table */ ulint col_nr) /*!< in: column number */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /**********************************************************************//** Returns a column's name. @return column name. NOTE: not guaranteed to stay valid if table is @@ -629,7 +629,7 @@ dict_table_get_col_name_for_mysql( /*==============================*/ const dict_table_t* table, /*!< in: table */ const char* col_name)/*!< in: MySQL table column name */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /**********************************************************************//** Prints a table data. */ UNIV_INTERN @@ -637,7 +637,7 @@ void dict_table_print( /*=============*/ dict_table_t* table) /*!< in: table */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /**********************************************************************//** Outputs info on foreign keys of a table. */ UNIV_INTERN @@ -669,7 +669,7 @@ dict_index_name_print( FILE* file, /*!< in: output stream */ const trx_t* trx, /*!< in: transaction */ const dict_index_t* index) /*!< in: index to print */ - __attribute__((nonnull(1,3))); + MY_ATTRIBUTE((nonnull(1,3))); /*********************************************************************//** Tries to find an index whose first fields are the columns in the array, in the same order and is not marked for deletion and is not the same @@ -705,7 +705,7 @@ dict_foreign_qualify_index( dict_index_t** err_index) /*!< out: index where error happened */ - __attribute__((nonnull(1,3), warn_unused_result)); + MY_ATTRIBUTE((nonnull(1,3), warn_unused_result)); #ifdef UNIV_DEBUG /********************************************************************//** Gets the first index on the table (the clustered index). @@ -715,7 +715,7 @@ dict_index_t* dict_table_get_first_index( /*=======================*/ const dict_table_t* table) /*!< in: table */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /********************************************************************//** Gets the last index on the table. @return index, NULL if none exists */ @@ -724,7 +724,7 @@ dict_index_t* dict_table_get_last_index( /*=======================*/ const dict_table_t* table) /*!< in: table */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /********************************************************************//** Gets the next index on the table. @return index, NULL if none left */ @@ -733,7 +733,7 @@ dict_index_t* dict_table_get_next_index( /*======================*/ const dict_index_t* index) /*!< in: index */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); #else /* UNIV_DEBUG */ # define dict_table_get_first_index(table) UT_LIST_GET_FIRST((table)->indexes) # define dict_table_get_last_index(table) UT_LIST_GET_LAST((table)->indexes) @@ -762,7 +762,7 @@ ulint dict_index_is_clust( /*================*/ const dict_index_t* index) /*!< in: index */ - __attribute__((nonnull, pure, warn_unused_result)); + MY_ATTRIBUTE((nonnull, pure, warn_unused_result)); /********************************************************************//** Check whether the index is unique. @return nonzero for unique index, zero for other indexes */ @@ -771,7 +771,7 @@ ulint dict_index_is_unique( /*=================*/ const dict_index_t* index) /*!< in: index */ - __attribute__((nonnull, pure, warn_unused_result)); + MY_ATTRIBUTE((nonnull, pure, warn_unused_result)); /********************************************************************//** Check whether the index is the insert buffer tree. @return nonzero for insert buffer, zero for other indexes */ @@ -780,7 +780,7 @@ ulint dict_index_is_ibuf( /*===============*/ const dict_index_t* index) /*!< in: index */ - __attribute__((nonnull, pure, warn_unused_result)); + MY_ATTRIBUTE((nonnull, pure, warn_unused_result)); /********************************************************************//** Check whether the index is a secondary index or the insert buffer tree. @return nonzero for insert buffer, zero for other indexes */ @@ -789,7 +789,7 @@ ulint dict_index_is_sec_or_ibuf( /*======================*/ const dict_index_t* index) /*!< in: index */ - __attribute__((nonnull, pure, warn_unused_result)); + MY_ATTRIBUTE((nonnull, pure, warn_unused_result)); /************************************************************************ Gets the all the FTS indexes for the table. NOTE: must not be called for @@ -801,7 +801,7 @@ dict_table_get_all_fts_indexes( /* out: number of indexes collected */ dict_table_t* table, /* in: table */ ib_vector_t* indexes)/* out: vector for collecting FTS indexes */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /********************************************************************//** Gets the number of user-defined columns in a table in the dictionary cache. @@ -811,7 +811,7 @@ ulint dict_table_get_n_user_cols( /*=======================*/ const dict_table_t* table) /*!< in: table */ - __attribute__((nonnull, pure, warn_unused_result)); + MY_ATTRIBUTE((nonnull, pure, warn_unused_result)); /********************************************************************//** Gets the number of system columns in a table in the dictionary cache. @return number of system (e.g., ROW_ID) columns of a table */ @@ -820,7 +820,7 @@ ulint dict_table_get_n_sys_cols( /*======================*/ const dict_table_t* table) /*!< in: table */ - __attribute__((nonnull, pure, warn_unused_result)); + MY_ATTRIBUTE((nonnull, pure, warn_unused_result)); /********************************************************************//** Gets the number of all columns (also system) in a table in the dictionary cache. @@ -830,7 +830,7 @@ ulint dict_table_get_n_cols( /*==================*/ const dict_table_t* table) /*!< in: table */ - __attribute__((nonnull, pure, warn_unused_result)); + MY_ATTRIBUTE((nonnull, pure, warn_unused_result)); /********************************************************************//** Gets the approximately estimated number of rows in the table. @return estimated number of rows */ @@ -839,7 +839,7 @@ ib_uint64_t dict_table_get_n_rows( /*==================*/ const dict_table_t* table) /*!< in: table */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /********************************************************************//** Increment the number of rows in the table by one. Notice that this operation is not protected by any latch, the number is @@ -849,7 +849,7 @@ void dict_table_n_rows_inc( /*==================*/ dict_table_t* table) /*!< in/out: table */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /********************************************************************//** Decrement the number of rows in the table by one. Notice that this operation is not protected by any latch, the number is @@ -859,7 +859,7 @@ void dict_table_n_rows_dec( /*==================*/ dict_table_t* table) /*!< in/out: table */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); #ifdef UNIV_DEBUG /********************************************************************//** Gets the nth column of a table. @@ -870,7 +870,7 @@ dict_table_get_nth_col( /*===================*/ const dict_table_t* table, /*!< in: table */ ulint pos) /*!< in: position of column */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /********************************************************************//** Gets the given system column of a table. @return pointer to column object */ @@ -880,7 +880,7 @@ dict_table_get_sys_col( /*===================*/ const dict_table_t* table, /*!< in: table */ ulint sys) /*!< in: DATA_ROW_ID, ... */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); #else /* UNIV_DEBUG */ #define dict_table_get_nth_col(table, pos) \ ((table)->cols + (pos)) @@ -896,7 +896,7 @@ dict_table_get_sys_col_no( /*======================*/ const dict_table_t* table, /*!< in: table */ ulint sys) /*!< in: DATA_ROW_ID, ... */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); #ifndef UNIV_HOTBACKUP /********************************************************************//** Returns the minimum data size of an index record. @@ -906,7 +906,7 @@ ulint dict_index_get_min_size( /*====================*/ const dict_index_t* index) /*!< in: index */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); #endif /* !UNIV_HOTBACKUP */ /********************************************************************//** Check whether the table uses the compact page format. @@ -916,7 +916,7 @@ ibool dict_table_is_comp( /*===============*/ const dict_table_t* table) /*!< in: table */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /********************************************************************//** Determine the file format of a table. @return file format version */ @@ -925,7 +925,7 @@ ulint dict_table_get_format( /*==================*/ const dict_table_t* table) /*!< in: table */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /********************************************************************//** Determine the file format from a dict_table_t::flags. @return file format version */ @@ -934,7 +934,7 @@ ulint dict_tf_get_format( /*===============*/ ulint flags) /*!< in: dict_table_t::flags */ - __attribute__((warn_unused_result)); + MY_ATTRIBUTE((warn_unused_result)); /********************************************************************//** Set the various values in a dict_table_t::flags pointer. */ UNIV_INLINE @@ -969,7 +969,7 @@ ulint dict_tf_to_fsp_flags( /*=================*/ ulint flags) /*!< in: dict_table_t::flags */ - __attribute__((const)); + MY_ATTRIBUTE((const)); /********************************************************************//** Extract the compressed page size from table flags. @return compressed page size, or 0 if not compressed */ @@ -988,7 +988,7 @@ ulint dict_table_zip_size( /*================*/ const dict_table_t* table) /*!< in: table */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); #ifndef UNIV_HOTBACKUP /*********************************************************************//** Obtain exclusive locks on all index trees of the table. This is to prevent @@ -999,7 +999,7 @@ void dict_table_x_lock_indexes( /*======================*/ dict_table_t* table) /*!< in: table */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /*********************************************************************//** Release the exclusive locks on all index tree. */ UNIV_INLINE @@ -1007,7 +1007,7 @@ void dict_table_x_unlock_indexes( /*========================*/ dict_table_t* table) /*!< in: table */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /********************************************************************//** Checks if a column is in the ordering columns of the clustered index of a table. Column prefixes are treated like whole columns. @@ -1018,7 +1018,7 @@ dict_table_col_in_clustered_key( /*============================*/ const dict_table_t* table, /*!< in: table */ ulint n) /*!< in: column number */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /*******************************************************************//** Check if the table has an FTS index. @return TRUE if table has an FTS index */ @@ -1027,7 +1027,7 @@ ibool dict_table_has_fts_index( /*=====================*/ dict_table_t* table) /*!< in: table */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /*******************************************************************//** Copies types of columns contained in table to tuple and sets all fields of the tuple to the SQL NULL value. This function should @@ -1038,7 +1038,7 @@ dict_table_copy_types( /*==================*/ dtuple_t* tuple, /*!< in/out: data tuple */ const dict_table_t* table) /*!< in: table */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /******************************************************************** Wait until all the background threads of the given table have exited, i.e., bg_threads == 0. Note: bg_threads_mutex must be reserved when @@ -1050,7 +1050,7 @@ dict_table_wait_for_bg_threads_to_exit( dict_table_t* table, /* in: table */ ulint delay) /* in: time in microseconds to wait between checks of bg_threads. */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /**********************************************************************//** Looks for an index with the given id. NOTE that we do not reserve the dictionary mutex: this function is for emergency purposes like @@ -1061,7 +1061,7 @@ dict_index_t* dict_index_find_on_id_low( /*======================*/ index_id_t id) /*!< in: index id */ - __attribute__((warn_unused_result)); + MY_ATTRIBUTE((warn_unused_result)); /**********************************************************************//** Make room in the table cache by evicting an unused table. The unused table should not be part of FK relationship and currently not used in any user @@ -1087,7 +1087,7 @@ dict_index_add_to_cache( ibool strict) /*!< in: TRUE=refuse to create the index if records could be too big to fit in an B-tree page */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /**********************************************************************//** Removes an index from the dictionary cache. */ UNIV_INTERN @@ -1096,7 +1096,7 @@ dict_index_remove_from_cache( /*=========================*/ dict_table_t* table, /*!< in/out: table */ dict_index_t* index) /*!< in, own: index */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); #endif /* !UNIV_HOTBACKUP */ /********************************************************************//** Gets the number of fields in the internal representation of an index, @@ -1109,7 +1109,7 @@ dict_index_get_n_fields( const dict_index_t* index) /*!< in: an internal representation of index (in the dictionary cache) */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /********************************************************************//** Gets the number of fields in the internal representation of an index that uniquely determine the position of an index entry in the index, if @@ -1122,7 +1122,7 @@ dict_index_get_n_unique( /*====================*/ const dict_index_t* index) /*!< in: an internal representation of index (in the dictionary cache) */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /********************************************************************//** Gets the number of fields in the internal representation of an index which uniquely determine the position of an index entry in the index, if @@ -1134,7 +1134,7 @@ dict_index_get_n_unique_in_tree( /*============================*/ const dict_index_t* index) /*!< in: an internal representation of index (in the dictionary cache) */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /********************************************************************//** Gets the number of user-defined ordering fields in the index. In the internal representation we add the row id to the ordering fields to make all indexes @@ -1147,7 +1147,7 @@ dict_index_get_n_ordering_defined_by_user( /*======================================*/ const dict_index_t* index) /*!< in: an internal representation of index (in the dictionary cache) */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); #ifdef UNIV_DEBUG /********************************************************************//** Gets the nth field of an index. @@ -1158,7 +1158,7 @@ dict_index_get_nth_field( /*=====================*/ const dict_index_t* index, /*!< in: index */ ulint pos) /*!< in: position of field */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); #else /* UNIV_DEBUG */ # define dict_index_get_nth_field(index, pos) ((index)->fields + (pos)) #endif /* UNIV_DEBUG */ @@ -1171,7 +1171,7 @@ dict_index_get_nth_col( /*===================*/ const dict_index_t* index, /*!< in: index */ ulint pos) /*!< in: position of the field */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /********************************************************************//** Gets the column number of the nth field in an index. @return column number */ @@ -1181,7 +1181,7 @@ dict_index_get_nth_col_no( /*======================*/ const dict_index_t* index, /*!< in: index */ ulint pos) /*!< in: position of the field */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /********************************************************************//** Looks for column n in an index. @return position in internal representation of the index; @@ -1218,7 +1218,7 @@ dict_index_contains_col_or_prefix( /*==============================*/ const dict_index_t* index, /*!< in: index */ ulint n) /*!< in: column number */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /********************************************************************//** Looks for a matching field in an index. The column has to be the same. The column in index must be complete, or must contain a prefix longer than the @@ -1233,7 +1233,7 @@ dict_index_get_nth_field_pos( const dict_index_t* index, /*!< in: index from which to search */ const dict_index_t* index2, /*!< in: index */ ulint n) /*!< in: field number in index2 */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /********************************************************************//** Looks for column n position in the clustered index. @return position in internal representation of the clustered index */ @@ -1243,7 +1243,7 @@ dict_table_get_nth_col_pos( /*=======================*/ const dict_table_t* table, /*!< in: table */ ulint n) /*!< in: column number */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /********************************************************************//** Returns the position of a system column in an index. @return position, ULINT_UNDEFINED if not contained */ @@ -1253,7 +1253,7 @@ dict_index_get_sys_col_pos( /*=======================*/ const dict_index_t* index, /*!< in: index */ ulint type) /*!< in: DATA_ROW_ID, ... */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /*******************************************************************//** Adds a column to index. */ UNIV_INTERN @@ -1264,7 +1264,7 @@ dict_index_add_col( const dict_table_t* table, /*!< in: table */ dict_col_t* col, /*!< in: column */ ulint prefix_len) /*!< in: column prefix length */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); #ifndef UNIV_HOTBACKUP /*******************************************************************//** Copies types of fields contained in index to tuple. */ @@ -1276,7 +1276,7 @@ dict_index_copy_types( const dict_index_t* index, /*!< in: index */ ulint n_fields) /*!< in: number of field types to copy */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); #endif /* !UNIV_HOTBACKUP */ /*********************************************************************//** Gets the field column. @@ -1286,7 +1286,7 @@ const dict_col_t* dict_field_get_col( /*===============*/ const dict_field_t* field) /*!< in: index field */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); #ifndef UNIV_HOTBACKUP /**********************************************************************//** Returns an index object if it is found in the dictionary cache. @@ -1297,7 +1297,7 @@ dict_index_t* dict_index_get_if_in_cache_low( /*===========================*/ index_id_t index_id) /*!< in: index id */ - __attribute__((warn_unused_result)); + MY_ATTRIBUTE((warn_unused_result)); #if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG /**********************************************************************//** Returns an index object if it is found in the dictionary cache. @@ -1307,7 +1307,7 @@ dict_index_t* dict_index_get_if_in_cache( /*=======================*/ index_id_t index_id) /*!< in: index id */ - __attribute__((warn_unused_result)); + MY_ATTRIBUTE((warn_unused_result)); #endif /* UNIV_DEBUG || UNIV_BUF_DEBUG */ #ifdef UNIV_DEBUG /**********************************************************************//** @@ -1320,7 +1320,7 @@ dict_index_check_search_tuple( /*==========================*/ const dict_index_t* index, /*!< in: index tree */ const dtuple_t* tuple) /*!< in: tuple used in a search */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /** Whether and when to allow temporary index names */ enum check_name { /** Require all indexes to be complete. */ @@ -1340,7 +1340,7 @@ dict_table_check_for_dup_indexes( in this table */ enum check_name check) /*!< in: whether and when to allow temporary index names */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); #endif /* UNIV_DEBUG */ /**********************************************************************//** Builds a node pointer out of a physical record and a page number. @@ -1358,7 +1358,7 @@ dict_index_build_node_ptr( created */ ulint level) /*!< in: level of rec in tree: 0 means leaf level */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /**********************************************************************//** Copies an initial segment of a physical record, long enough to specify an index entry uniquely. @@ -1374,7 +1374,7 @@ dict_index_copy_rec_order_prefix( byte** buf, /*!< in/out: memory buffer for the copied prefix, or NULL */ ulint* buf_size)/*!< in/out: buffer size */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /**********************************************************************//** Builds a typed data tuple out of a physical record. @return own: data tuple */ @@ -1386,7 +1386,7 @@ dict_index_build_data_tuple( rec_t* rec, /*!< in: record for which to build data tuple */ ulint n_fields,/*!< in: number of data fields */ mem_heap_t* heap) /*!< in: memory heap where tuple created */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /*********************************************************************//** Gets the space id of the root of the index tree. @return space id */ @@ -1395,7 +1395,7 @@ ulint dict_index_get_space( /*=================*/ const dict_index_t* index) /*!< in: index */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /*********************************************************************//** Sets the space id of the root of the index tree. */ UNIV_INLINE @@ -1404,7 +1404,7 @@ dict_index_set_space( /*=================*/ dict_index_t* index, /*!< in/out: index */ ulint space) /*!< in: space id */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /*********************************************************************//** Gets the page number of the root of the index tree. @return page number */ @@ -1413,7 +1413,7 @@ ulint dict_index_get_page( /*================*/ const dict_index_t* tree) /*!< in: index */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /*********************************************************************//** Gets the read-write lock of the index tree. @return read-write lock */ @@ -1422,7 +1422,7 @@ rw_lock_t* dict_index_get_lock( /*================*/ dict_index_t* index) /*!< in: index */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /********************************************************************//** Returns free space reserved for future updates of records. This is relevant only in the case of many consecutive inserts, as updates @@ -1442,7 +1442,7 @@ enum online_index_status dict_index_get_online_status( /*=========================*/ const dict_index_t* index) /*!< in: secondary index */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /********************************************************************//** Sets the status of online index creation. */ UNIV_INLINE @@ -1451,7 +1451,7 @@ dict_index_set_online_status( /*=========================*/ dict_index_t* index, /*!< in/out: index */ enum online_index_status status) /*!< in: status */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /********************************************************************//** Determines if a secondary index is being or has been created online, or if the table is being rebuilt online, allowing concurrent modifications @@ -1465,7 +1465,7 @@ bool dict_index_is_online_ddl( /*=====================*/ const dict_index_t* index) /*!< in: index */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /*********************************************************************//** Calculates the minimum record length in an index. */ UNIV_INTERN @@ -1473,7 +1473,7 @@ ulint dict_index_calc_min_rec_len( /*========================*/ const dict_index_t* index) /*!< in: index */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /********************************************************************//** Reserves the dictionary system mutex for MySQL. */ UNIV_INTERN @@ -1541,7 +1541,7 @@ dict_tables_have_same_db( dbname '/' tablename */ const char* name2) /*!< in: table name in the form dbname '/' tablename */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /*********************************************************************//** Removes an index from the cache */ UNIV_INTERN @@ -1550,7 +1550,7 @@ dict_index_remove_from_cache( /*=========================*/ dict_table_t* table, /*!< in/out: table */ dict_index_t* index) /*!< in, own: index */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /**********************************************************************//** Get index by name @return index, NULL if does not exist */ @@ -1560,7 +1560,7 @@ dict_table_get_index_on_name( /*=========================*/ dict_table_t* table, /*!< in: table */ const char* name) /*!< in: name of the index to find */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /**********************************************************************//** Looks for an index with the given id given a table instance. @return index or NULL */ @@ -1581,7 +1581,7 @@ dict_table_get_index_on_name_and_min_id( /*====================================*/ dict_table_t* table, /*!< in: table */ const char* name) /*!< in: name of the index to find */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /*************************************************************** Check whether a column exists in an FTS index. */ UNIV_INLINE @@ -1592,7 +1592,7 @@ dict_table_is_fts_column( the offset within the vector */ ib_vector_t* indexes,/* in: vector containing only FTS indexes */ ulint col_no) /* in: col number to search for */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /**********************************************************************//** Move a table to the non LRU end of the LRU list. */ UNIV_INTERN @@ -1600,7 +1600,7 @@ void dict_table_move_from_lru_to_non_lru( /*================================*/ dict_table_t* table) /*!< in: table to move from LRU to non-LRU */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /**********************************************************************//** Move a table to the LRU list from the non-LRU list. */ UNIV_INTERN @@ -1608,7 +1608,7 @@ void dict_table_move_from_non_lru_to_lru( /*================================*/ dict_table_t* table) /*!< in: table to move from non-LRU to LRU */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /**********************************************************************//** Move to the most recently used segment of the LRU list. */ UNIV_INTERN @@ -1616,7 +1616,7 @@ void dict_move_to_mru( /*=============*/ dict_table_t* table) /*!< in: table to move to MRU */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /** Maximum number of columns in a foreign key constraint. Please Note MySQL has a much lower limit on the number of columns allowed in a foreign key @@ -1740,7 +1740,7 @@ dict_table_schema_check( != DB_TABLE_NOT_FOUND is returned */ size_t errstr_sz) /*!< in: errstr size */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /* @} */ /*********************************************************************//** @@ -1758,7 +1758,7 @@ dict_fs2utf8( size_t db_utf8_size, /*!< in: dbname_utf8 size */ char* table_utf8, /*!< out: table name, e.g. aÑŽbØc */ size_t table_utf8_size)/*!< in: table_utf8 size */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /**********************************************************************//** Closes the data dictionary module. */ @@ -1775,7 +1775,7 @@ ulint dict_table_is_corrupted( /*====================*/ const dict_table_t* table) /*!< in: table */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /**********************************************************************//** Check whether the index is corrupted. @@ -1785,7 +1785,7 @@ ulint dict_index_is_corrupted( /*====================*/ const dict_index_t* index) /*!< in: index */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); #endif /* !UNIV_HOTBACKUP */ /**********************************************************************//** @@ -1798,7 +1798,7 @@ dict_set_corrupted( dict_index_t* index, /*!< in/out: index */ trx_t* trx, /*!< in/out: transaction */ const char* ctx) /*!< in: context */ - UNIV_COLD __attribute__((nonnull)); + UNIV_COLD MY_ATTRIBUTE((nonnull)); /**********************************************************************//** Flags an index corrupted in the data dictionary cache only. This @@ -1810,7 +1810,7 @@ dict_set_corrupted_index_cache_only( /*================================*/ dict_index_t* index, /*!< in/out: index */ dict_table_t* table) /*!< in/out: table */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /**********************************************************************//** Flags a table with specified space_id corrupted in the table dictionary @@ -1830,7 +1830,7 @@ bool dict_tf_is_valid( /*=============*/ ulint flags) /*!< in: table flags */ - __attribute__((warn_unused_result)); + MY_ATTRIBUTE((warn_unused_result)); /********************************************************************//** Check if the tablespace for the table has been discarded. @@ -1840,7 +1840,7 @@ bool dict_table_is_discarded( /*====================*/ const dict_table_t* table) /*!< in: table to check */ - __attribute__((nonnull, pure, warn_unused_result)); + MY_ATTRIBUTE((nonnull, pure, warn_unused_result)); /********************************************************************//** Check if it is a temporary table. @@ -1850,7 +1850,7 @@ bool dict_table_is_temporary( /*====================*/ const dict_table_t* table) /*!< in: table to check */ - __attribute__((nonnull, pure, warn_unused_result)); + MY_ATTRIBUTE((nonnull, pure, warn_unused_result)); #ifndef UNIV_HOTBACKUP /*********************************************************************//** @@ -1861,7 +1861,7 @@ void dict_index_zip_success( /*===================*/ dict_index_t* index) /*!< in/out: index to be updated. */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /*********************************************************************//** This function should be called whenever a page compression attempt fails. Updates the compression padding information. */ @@ -1870,7 +1870,7 @@ void dict_index_zip_failure( /*===================*/ dict_index_t* index) /*!< in/out: index to be updated. */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /*********************************************************************//** Return the optimal page size, for which page will likely compress. @return page size beyond which page may not compress*/ @@ -1880,7 +1880,7 @@ dict_index_zip_pad_optimal_page_size( /*=================================*/ dict_index_t* index) /*!< in: index for which page size is requested */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /*************************************************************//** Convert table flag to row format string. @return row format name */ diff --git a/storage/innobase/include/dict0dict.ic b/storage/innobase/include/dict0dict.ic index a3a3446d507..3d2f0dff0da 100644 --- a/storage/innobase/include/dict0dict.ic +++ b/storage/innobase/include/dict0dict.ic @@ -1,7 +1,7 @@ /***************************************************************************** -Copyright (c) 1996, 2015, Oracle and/or its affiliates -Copyright (c) 2013, 2015, SkySQL Ab +Copyright (c) 1996, 2016, Oracle and/or its affiliates +Copyright (c) 2013, 2016, MariaDB Corporation This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -81,7 +81,8 @@ dict_col_copy_type( const dict_col_t* col, /*!< in: column */ dtype_t* type) /*!< out: data type */ { - ut_ad(col && type); + ut_ad(col != NULL); + ut_ad(type != NULL); type->mtype = col->mtype; type->prtype = col->prtype; @@ -358,7 +359,7 @@ UNIV_INLINE ulint dict_table_get_n_sys_cols( /*======================*/ - const dict_table_t* table __attribute__((unused))) /*!< in: table */ + const dict_table_t* table MY_ATTRIBUTE((unused))) /*!< in: table */ { ut_ad(table); ut_ad(table->magic_n == DICT_TABLE_MAGIC_N); diff --git a/storage/innobase/include/dict0load.h b/storage/innobase/include/dict0load.h index 030190b1a8e..dcbc3de8e94 100644 --- a/storage/innobase/include/dict0load.h +++ b/storage/innobase/include/dict0load.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2013, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -243,7 +243,7 @@ dict_load_foreigns( bool check_charsets, /*!< in: whether to check charset compatibility */ dict_err_ignore_t ignore_err) /*!< in: error to be ignored */ - __attribute__((nonnull(1), warn_unused_result)); + MY_ATTRIBUTE((nonnull(1), warn_unused_result)); /********************************************************************//** Prints to the standard output information on all tables found in the data dictionary system table. */ diff --git a/storage/innobase/include/dict0mem.h b/storage/innobase/include/dict0mem.h index 53a5d6cb08b..f964447fb8f 100644 --- a/storage/innobase/include/dict0mem.h +++ b/storage/innobase/include/dict0mem.h @@ -1,8 +1,8 @@ /***************************************************************************** -Copyright (c) 1996, 2015, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2012, Facebook Inc. -Copyright (c) 2013, 2015, MariaDB Corporation. +Copyright (c) 2013, 2016, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -192,19 +192,19 @@ DEFAULT=0, ON = 1, OFF = 2 /** Bit mask of the COMPACT field */ #define DICT_TF_MASK_COMPACT \ - ((~(~0 << DICT_TF_WIDTH_COMPACT)) \ + ((~(~0U << DICT_TF_WIDTH_COMPACT)) \ << DICT_TF_POS_COMPACT) /** Bit mask of the ZIP_SSIZE field */ #define DICT_TF_MASK_ZIP_SSIZE \ - ((~(~0 << DICT_TF_WIDTH_ZIP_SSIZE)) \ + ((~(~0U << DICT_TF_WIDTH_ZIP_SSIZE)) \ << DICT_TF_POS_ZIP_SSIZE) /** Bit mask of the ATOMIC_BLOBS field */ #define DICT_TF_MASK_ATOMIC_BLOBS \ - ((~(~0 << DICT_TF_WIDTH_ATOMIC_BLOBS)) \ + ((~(~0U << DICT_TF_WIDTH_ATOMIC_BLOBS)) \ << DICT_TF_POS_ATOMIC_BLOBS) /** Bit mask of the DATA_DIR field */ #define DICT_TF_MASK_DATA_DIR \ - ((~(~0 << DICT_TF_WIDTH_DATA_DIR)) \ + ((~(~0U << DICT_TF_WIDTH_DATA_DIR)) \ << DICT_TF_POS_DATA_DIR) /** Bit mask of the PAGE_COMPRESSION field */ #define DICT_TF_MASK_PAGE_COMPRESSION \ @@ -279,7 +279,7 @@ for unknown bits in order to protect backward incompatibility. */ /* @{ */ /** Total number of bits in table->flags2. */ #define DICT_TF2_BITS 7 -#define DICT_TF2_BIT_MASK ~(~0 << DICT_TF2_BITS) +#define DICT_TF2_BIT_MASK ~(~0U << DICT_TF2_BITS) /** TEMPORARY; TRUE for tables from CREATE TEMPORARY TABLE. */ #define DICT_TF2_TEMPORARY 1 @@ -367,7 +367,7 @@ dict_mem_table_add_col( ulint mtype, /*!< in: main datatype */ ulint prtype, /*!< in: precise type */ ulint len) /*!< in: precision */ - __attribute__((nonnull(1))); + MY_ATTRIBUTE((nonnull(1))); /**********************************************************************//** Renames a column of a table in the data dictionary cache. */ UNIV_INTERN @@ -378,7 +378,7 @@ dict_mem_table_col_rename( unsigned nth_col,/*!< in: column index */ const char* from, /*!< in: old column name */ const char* to) /*!< in: new column name */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /**********************************************************************//** This function populates a dict_col_t memory structure with supplied information. */ @@ -1009,6 +1009,18 @@ if table->memcached_sync_count == DICT_TABLE_IN_DDL means there's DDL running on the table, DML from memcached will be blocked. */ #define DICT_TABLE_IN_DDL -1 +/** These are used when MySQL FRM and InnoDB data dictionary are +in inconsistent state. */ +typedef enum { + DICT_FRM_CONSISTENT = 0, /*!< Consistent state */ + DICT_FRM_NO_PK = 1, /*!< MySQL has no primary key + but InnoDB dictionary has + non-generated one. */ + DICT_NO_PK_FRM_HAS = 2, /*!< MySQL has primary key but + InnoDB dictionary has not. */ + DICT_FRM_INCONSISTENT_KEYS = 3 /*!< Key count mismatch */ +} dict_frm_t; + /** Data structure for a database table. Most fields will be initialized to 0, NULL or FALSE in dict_mem_table_create(). */ struct dict_table_t{ @@ -1069,6 +1081,10 @@ struct dict_table_t{ /*!< True if the table belongs to a system database (mysql, information_schema or performance_schema) */ + dict_frm_t dict_frm_mismatch; + /*!< !DICT_FRM_CONSISTENT==0 if data + dictionary information and + MySQL FRM information mismatch. */ #ifndef UNIV_HOTBACKUP hash_node_t name_hash; /*!< hash chain node */ hash_node_t id_hash; /*!< hash chain node */ diff --git a/storage/innobase/include/dict0stats.h b/storage/innobase/include/dict0stats.h index abf56b2f0c7..72501bf9429 100644 --- a/storage/innobase/include/dict0stats.h +++ b/storage/innobase/include/dict0stats.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2009, 2012, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2009, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -77,7 +77,7 @@ dict_stats_set_persistent( dict_table_t* table, /*!< in/out: table */ ibool ps_on, /*!< in: persistent stats explicitly enabled */ ibool ps_off) /*!< in: persistent stats explicitly disabled */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /*********************************************************************//** Check whether persistent statistics is enabled for a given table. @@ -87,7 +87,7 @@ ibool dict_stats_is_persistent_enabled( /*=============================*/ const dict_table_t* table) /*!< in: table */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /*********************************************************************//** Set the auto recalc flag for a given table (only honored for a persistent @@ -127,7 +127,7 @@ void dict_stats_deinit( /*==============*/ dict_table_t* table) /*!< in/out: table */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /*********************************************************************//** Calculates new estimates for table and index statistics. The statistics @@ -179,7 +179,7 @@ void dict_stats_update_for_index( /*========================*/ dict_index_t* index) /*!< in/out: index */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /*********************************************************************//** Renames a table in InnoDB persistent stats storage. diff --git a/storage/innobase/include/dict0stats_bg.h b/storage/innobase/include/dict0stats_bg.h index 32fac3015e8..34dc4657829 100644 --- a/storage/innobase/include/dict0stats_bg.h +++ b/storage/innobase/include/dict0stats_bg.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2012, 2013, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2012, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -96,7 +96,7 @@ bool dict_stats_stop_bg( /*===============*/ dict_table_t* table) /*!< in/out: table */ - __attribute__((warn_unused_result)); + MY_ATTRIBUTE((warn_unused_result)); /*****************************************************************//** Wait until background stats thread has stopped using the specified table. diff --git a/storage/innobase/include/dyn0dyn.h b/storage/innobase/include/dyn0dyn.h index 7f23302d1ff..1bd10b6bf58 100644 --- a/storage/innobase/include/dyn0dyn.h +++ b/storage/innobase/include/dyn0dyn.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2013, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -48,7 +48,7 @@ dyn_array_create( /*=============*/ dyn_array_t* arr) /*!< in/out memory buffer of size sizeof(dyn_array_t) */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /************************************************************//** Frees a dynamic array. */ UNIV_INLINE @@ -56,7 +56,7 @@ void dyn_array_free( /*===========*/ dyn_array_t* arr) /*!< in,own: dyn array */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /*********************************************************************//** Makes room on top of a dyn array and returns a pointer to a buffer in it. After copying the elements, the caller must close the buffer using @@ -69,7 +69,7 @@ dyn_array_open( dyn_array_t* arr, /*!< in: dynamic array */ ulint size) /*!< in: size in bytes of the buffer; MUST be smaller than DYN_ARRAY_DATA_SIZE! */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /*********************************************************************//** Closes the buffer returned by dyn_array_open. */ UNIV_INLINE @@ -78,7 +78,7 @@ dyn_array_close( /*============*/ dyn_array_t* arr, /*!< in: dynamic array */ const byte* ptr) /*!< in: end of used space */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /*********************************************************************//** Makes room on top of a dyn array and returns a pointer to the added element. The caller must copy the element to @@ -90,7 +90,7 @@ dyn_array_push( /*===========*/ dyn_array_t* arr, /*!< in/out: dynamic array */ ulint size) /*!< in: size in bytes of the element */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /************************************************************//** Returns pointer to an element in dyn array. @return pointer to element */ @@ -101,7 +101,7 @@ dyn_array_get_element( const dyn_array_t* arr, /*!< in: dyn array */ ulint pos) /*!< in: position of element in bytes from array start */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /************************************************************//** Returns the size of stored data in a dyn array. @return data size in bytes */ @@ -110,7 +110,7 @@ ulint dyn_array_get_data_size( /*====================*/ const dyn_array_t* arr) /*!< in: dyn array */ - __attribute__((nonnull, warn_unused_result, pure)); + MY_ATTRIBUTE((nonnull, warn_unused_result, pure)); /************************************************************//** Gets the first block in a dyn array. @param arr dyn array @@ -144,7 +144,7 @@ ulint dyn_block_get_used( /*===============*/ const dyn_block_t* block) /*!< in: dyn array block */ - __attribute__((nonnull, warn_unused_result, pure)); + MY_ATTRIBUTE((nonnull, warn_unused_result, pure)); /********************************************************************//** Gets pointer to the start of data in a dyn array block. @return pointer to data */ @@ -153,7 +153,7 @@ byte* dyn_block_get_data( /*===============*/ const dyn_block_t* block) /*!< in: dyn array block */ - __attribute__((nonnull, warn_unused_result, pure)); + MY_ATTRIBUTE((nonnull, warn_unused_result, pure)); /********************************************************//** Pushes n bytes to a dyn array. */ UNIV_INLINE @@ -163,7 +163,7 @@ dyn_push_string( dyn_array_t* arr, /*!< in/out: dyn array */ const byte* str, /*!< in: string to write */ ulint len) /*!< in: string length */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /*#################################################################*/ diff --git a/storage/innobase/include/dyn0dyn.ic b/storage/innobase/include/dyn0dyn.ic index 0296554e2ee..f18f2e6dff9 100644 --- a/storage/innobase/include/dyn0dyn.ic +++ b/storage/innobase/include/dyn0dyn.ic @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2013, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -36,7 +36,7 @@ dyn_block_t* dyn_array_add_block( /*================*/ dyn_array_t* arr) /*!< in/out: dyn array */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /********************************************************************//** Gets the number of used bytes in a dyn array block. diff --git a/storage/innobase/include/fil0fil.h b/storage/innobase/include/fil0fil.h index 7fe0cc88618..0c7ed7b3ab0 100644 --- a/storage/innobase/include/fil0fil.h +++ b/storage/innobase/include/fil0fil.h @@ -1,7 +1,7 @@ /***************************************************************************** -Copyright (c) 1995, 2015, Oracle and/or its affiliates. -Copyright (c) 2013, 2015, MariaDB Corporation. +Copyright (c) 1995, 2016, Oracle and/or its affiliates. +Copyright (c) 2013, 2016, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -443,7 +443,7 @@ fil_node_create( ulint id, /*!< in: space id where to append */ ibool is_raw) /*!< in: TRUE if a raw device or a raw disk partition */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); #ifdef UNIV_LOG_ARCHIVE /****************************************************************//** Drops files from the start of a file space, so that its size is cut by @@ -702,7 +702,7 @@ dberr_t fil_discard_tablespace( /*===================*/ ulint id) /*!< in: space id */ - __attribute__((warn_unused_result)); + MY_ATTRIBUTE((warn_unused_result)); #endif /* !UNIV_HOTBACKUP */ /** Test if a tablespace file can be renamed to a new filepath by checking @@ -1200,7 +1200,7 @@ fil_tablespace_iterate( dict_table_t* table, ulint n_io_buffers, PageCallback& callback) - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /*******************************************************************//** Checks if a single-table tablespace for a given table name exists in the @@ -1224,7 +1224,7 @@ fil_get_space_names( /*================*/ space_name_list_t& space_name_list) /*!< in/out: Vector for collecting the names. */ - __attribute__((warn_unused_result)); + MY_ATTRIBUTE((warn_unused_result)); /** Generate redo log for swapping two .ibd files @param[in] old_table old table @@ -1239,7 +1239,7 @@ fil_mtr_rename_log( const dict_table_t* new_table, const char* tmp_name, mtr_t* mtr) - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /*******************************************************************//** Finds the given page_no of the given space id from the double write buffer, diff --git a/storage/innobase/include/fil0pagecompress.h b/storage/innobase/include/fil0pagecompress.h index 8316083d52d..99a05f14ffe 100644 --- a/storage/innobase/include/fil0pagecompress.h +++ b/storage/innobase/include/fil0pagecompress.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (C) 2013, 2015 MariaDB Corporation. All Rights Reserved. +Copyright (C) 2013, 2016 MariaDB Corporation. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -117,8 +117,12 @@ fil_decompress_page( byte* buf, /*!< out: buffer from which to read; in aio this must be appropriately aligned */ ulong len, /*!< in: length of output buffer.*/ - ulint* write_size); /*!< in/out: Actual payload size of + ulint* write_size, /*!< in/out: Actual payload size of the compressed data. */ + bool return_error=false); + /*!< in: true if only an error should + be produced when decompression fails. + By default this parameter is false. */ /****************************************************************//** Get space id from fil node diff --git a/storage/innobase/include/fsp0fsp.h b/storage/innobase/include/fsp0fsp.h index 2bac42eb081..b9ff05b4bd4 100644 --- a/storage/innobase/include/fsp0fsp.h +++ b/storage/innobase/include/fsp0fsp.h @@ -1,7 +1,7 @@ /***************************************************************************** -Copyright (c) 1995, 2012, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2013, SkySQL Ab. All Rights Reserved. +Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2013, 2016, MariaDB Corporation. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -100,30 +100,37 @@ dictionary */ /** Zero relative shift position of the start of the UNUSED bits */ #define FSP_FLAGS_POS_DATA_DIR (FSP_FLAGS_POS_PAGE_SSIZE \ + FSP_FLAGS_WIDTH_PAGE_SSIZE) +#define FSP_FLAGS_POS_DATA_DIR_ORACLE (FSP_FLAGS_POS_ATOMIC_BLOBS \ + + FSP_FLAGS_WIDTH_ATOMIC_BLOBS \ + + FSP_FLAGS_WIDTH_PAGE_SSIZE) /** Zero relative shift position of the start of the UNUSED bits */ #define FSP_FLAGS_POS_UNUSED (FSP_FLAGS_POS_DATA_DIR \ + FSP_FLAGS_WIDTH_DATA_DIR) /** Bit mask of the POST_ANTELOPE field */ #define FSP_FLAGS_MASK_POST_ANTELOPE \ - ((~(~0 << FSP_FLAGS_WIDTH_POST_ANTELOPE)) \ + ((~(~0U << FSP_FLAGS_WIDTH_POST_ANTELOPE)) \ << FSP_FLAGS_POS_POST_ANTELOPE) /** Bit mask of the ZIP_SSIZE field */ #define FSP_FLAGS_MASK_ZIP_SSIZE \ - ((~(~0 << FSP_FLAGS_WIDTH_ZIP_SSIZE)) \ + ((~(~0U << FSP_FLAGS_WIDTH_ZIP_SSIZE)) \ << FSP_FLAGS_POS_ZIP_SSIZE) /** Bit mask of the ATOMIC_BLOBS field */ #define FSP_FLAGS_MASK_ATOMIC_BLOBS \ - ((~(~0 << FSP_FLAGS_WIDTH_ATOMIC_BLOBS)) \ + ((~(~0U << FSP_FLAGS_WIDTH_ATOMIC_BLOBS)) \ << FSP_FLAGS_POS_ATOMIC_BLOBS) /** Bit mask of the PAGE_SSIZE field */ #define FSP_FLAGS_MASK_PAGE_SSIZE \ - ((~(~0 << FSP_FLAGS_WIDTH_PAGE_SSIZE)) \ + ((~(~0U << FSP_FLAGS_WIDTH_PAGE_SSIZE)) \ << FSP_FLAGS_POS_PAGE_SSIZE) /** Bit mask of the DATA_DIR field */ #define FSP_FLAGS_MASK_DATA_DIR \ - ((~(~0 << FSP_FLAGS_WIDTH_DATA_DIR)) \ + ((~(~0U << FSP_FLAGS_WIDTH_DATA_DIR)) \ << FSP_FLAGS_POS_DATA_DIR) +/** Bit mask of the DATA_DIR field */ +#define FSP_FLAGS_MASK_DATA_DIR_ORACLE \ + ((~(~0 << FSP_FLAGS_WIDTH_DATA_DIR)) \ + << FSP_FLAGS_POS_DATA_DIR_ORACLE) /** Bit mask of the PAGE_COMPRESSION field */ #define FSP_FLAGS_MASK_PAGE_COMPRESSION \ ((~(~0 << FSP_FLAGS_WIDTH_PAGE_COMPRESSION)) \ @@ -156,6 +163,9 @@ dictionary */ #define FSP_FLAGS_HAS_DATA_DIR(flags) \ ((flags & FSP_FLAGS_MASK_DATA_DIR) \ >> FSP_FLAGS_POS_DATA_DIR) +#define FSP_FLAGS_HAS_DATA_DIR_ORACLE(flags) \ + ((flags & FSP_FLAGS_MASK_DATA_DIR_ORACLE) \ + >> FSP_FLAGS_POS_DATA_DIR_ORACLE) /** Return the contents of the UNUSED bits */ #define FSP_FLAGS_GET_UNUSED(flags) \ (flags >> FSP_FLAGS_POS_UNUSED) @@ -572,7 +582,7 @@ fseg_alloc_free_page_general( in which the page should be initialized. If init_mtr!=mtr, but the page is already latched in mtr, do not initialize the page. */ - __attribute__((warn_unused_result, nonnull)); + MY_ATTRIBUTE((warn_unused_result, nonnull)); /**********************************************************************//** Reserves free pages from a tablespace. All mini-transactions which may use several pages from the tablespace should call this function beforehand @@ -641,7 +651,7 @@ fseg_page_is_free( fseg_header_t* seg_header, /*!< in: segment header */ ulint space, /*!< in: space id */ ulint page) /*!< in: page offset */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /**********************************************************************//** Frees part of a segment. This function can be used to free a segment by repeatedly calling this function in different mini-transactions. @@ -737,7 +747,7 @@ bool fsp_flags_is_valid( /*===============*/ ulint flags) /*!< in: tablespace flags */ - __attribute__((warn_unused_result, const)); + MY_ATTRIBUTE((warn_unused_result, const)); /********************************************************************//** Determine if the tablespace is compressed from dict_table_t::flags. @return TRUE if compressed, FALSE if not compressed */ diff --git a/storage/innobase/include/fts0ast.h b/storage/innobase/include/fts0ast.h index b2380f78b39..50f62063893 100644 --- a/storage/innobase/include/fts0ast.h +++ b/storage/innobase/include/fts0ast.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2007, 2014, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2007, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -200,7 +200,7 @@ fts_ast_visit( and ignored processing an operator, currently we only ignore FTS_IGNORE operator */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /*****************************************************************//** Process (nested) sub-expression, create a new result set to store the sub-expression result by processing nodes under current sub-expression @@ -213,7 +213,7 @@ fts_ast_visit_sub_exp( fts_ast_node_t* node, /*!< in: instance to traverse*/ fts_ast_callback visitor, /*!< in: callback */ void* arg) /*!< in: callback arg */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /******************************************************************** Create a lex instance.*/ UNIV_INTERN @@ -223,7 +223,7 @@ fts_lexer_create( ibool boolean_mode, /*!< in: query type */ const byte* query, /*!< in: query string */ ulint query_len) /*!< in: query string len */ - __attribute__((nonnull, malloc, warn_unused_result)); + MY_ATTRIBUTE((nonnull, malloc, warn_unused_result)); /******************************************************************** Free an fts_lexer_t instance.*/ UNIV_INTERN @@ -232,7 +232,7 @@ fts_lexer_free( /*===========*/ fts_lexer_t* fts_lexer) /*!< in: lexer instance to free */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /** Create an ast string object, with NUL-terminator, so the string diff --git a/storage/innobase/include/fts0fts.h b/storage/innobase/include/fts0fts.h index d54ed281d9a..68d4d333245 100644 --- a/storage/innobase/include/fts0fts.h +++ b/storage/innobase/include/fts0fts.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2011, 2015, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2011, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -94,7 +94,10 @@ those defined in mysql file ft_global.h */ /** Threshold where our optimize thread automatically kicks in */ #define FTS_OPTIMIZE_THRESHOLD 10000000 -#define FTS_DOC_ID_MAX_STEP 10000 +/** Threshold to avoid exhausting of doc ids. Consecutive doc id difference +should not exceed FTS_DOC_ID_MAX_STEP */ +#define FTS_DOC_ID_MAX_STEP 65535 + /** Variable specifying the FTS parallel sort degree */ extern ulong fts_sort_pll_degree; @@ -408,7 +411,7 @@ fts_get_next_doc_id( /*================*/ const dict_table_t* table, /*!< in: table */ doc_id_t* doc_id) /*!< out: new document id */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /*********************************************************************//** Update the next and last Doc ID in the CONFIG table to be the input "doc_id" value (+ 1). We would do so after each FTS index build or @@ -421,7 +424,7 @@ fts_update_next_doc_id( const dict_table_t* table, /*!< in: table */ const char* table_name, /*!< in: table name, or NULL */ doc_id_t doc_id) /*!< in: DOC ID to set */ - __attribute__((nonnull(2))); + MY_ATTRIBUTE((nonnull(2))); /******************************************************************//** Create a new document id . @@ -437,7 +440,7 @@ fts_create_doc_id( current row that is being inserted. */ mem_heap_t* heap) /*!< in: heap */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /******************************************************************//** Create a new fts_doc_ids_t. @return new fts_doc_ids_t. */ @@ -466,7 +469,7 @@ fts_trx_add_op( fts_row_state state, /*!< in: state of the row */ ib_vector_t* fts_indexes) /*!< in: FTS indexes affected (NULL=all) */ - __attribute__((nonnull(1,2))); + MY_ATTRIBUTE((nonnull(1,2))); /******************************************************************//** Free an FTS trx. */ @@ -491,7 +494,7 @@ fts_create_common_tables( index */ const char* name, /*!< in: table name */ bool skip_doc_id_index) /*!< in: Skip index on doc id */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /******************************************************************//** Wrapper function of fts_create_index_tables_low(), create auxiliary tables for an FTS index @@ -503,7 +506,7 @@ fts_create_index_tables( trx_t* trx, /*!< in: transaction handle */ const dict_index_t* index) /*!< in: the FTS index instance */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /******************************************************************//** Creates the column specific ancillary tables needed for supporting an FTS index on the given table. row_mysql_lock_data_dictionary must have @@ -519,7 +522,7 @@ fts_create_index_tables_low( instance */ const char* table_name, /*!< in: the table name */ table_id_t table_id) /*!< in: the table id */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /******************************************************************//** Add the FTS document id hidden column. */ UNIV_INTERN @@ -528,7 +531,7 @@ fts_add_doc_id_column( /*==================*/ dict_table_t* table, /*!< in/out: Table with FTS index */ mem_heap_t* heap) /*!< in: temporary memory heap, or NULL */ - __attribute__((nonnull(1))); + MY_ATTRIBUTE((nonnull(1))); /*********************************************************************//** Drops the ancillary tables needed for supporting an FTS index on the @@ -542,7 +545,7 @@ fts_drop_tables( trx_t* trx, /*!< in: transaction */ dict_table_t* table) /*!< in: table has the FTS index */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /******************************************************************//** The given transaction is about to be committed; do whatever is necessary from the FTS system's POV. @@ -552,7 +555,7 @@ dberr_t fts_commit( /*=======*/ trx_t* trx) /*!< in: transaction */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /*******************************************************************//** FTS Query entry point. @@ -569,7 +572,7 @@ fts_query( in bytes */ fts_result_t** result) /*!< out: query result, to be freed by the caller.*/ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /******************************************************************//** Retrieve the FTS Relevance Ranking result for doc with doc_id @@ -687,7 +690,7 @@ dberr_t fts_optimize_table( /*===============*/ dict_table_t* table) /*!< in: table to optimiza */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /**********************************************************************//** Startup the optimize thread and create the work queue. */ @@ -713,7 +716,7 @@ fts_drop_index_tables( /*==================*/ trx_t* trx, /*!< in: transaction */ dict_index_t* index) /*!< in: Index to drop */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /******************************************************************//** Remove the table from the OPTIMIZER's list. We do wait for @@ -724,6 +727,13 @@ fts_optimize_remove_table( /*======================*/ dict_table_t* table); /*!< in: table to remove */ +/** Send sync fts cache for the table. +@param[in] table table to sync */ +UNIV_INTERN +void +fts_optimize_request_sync_table( + dict_table_t* table); + /**********************************************************************//** Signal the optimize thread to prepare for shutdown. */ UNIV_INTERN @@ -747,7 +757,7 @@ fts_savepoint_take( trx_t* trx, /*!< in: transaction */ fts_trx_t* fts_trx, /*!< in: fts transaction */ const char* name) /*!< in: savepoint name */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /**********************************************************************//** Refresh last statement savepoint. */ UNIV_INTERN @@ -755,7 +765,7 @@ void fts_savepoint_laststmt_refresh( /*===========================*/ trx_t* trx) /*!< in: transaction */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /**********************************************************************//** Release the savepoint data identified by name. */ UNIV_INTERN @@ -773,13 +783,12 @@ fts_cache_destroy( /*==============*/ fts_cache_t* cache); /*!< in: cache*/ -/*********************************************************************//** -Clear cache. */ +/** Clear cache. +@param[in,out] cache fts cache */ UNIV_INTERN void fts_cache_clear( -/*============*/ - fts_cache_t* cache); /*!< in: cache */ + fts_cache_t* cache); /*********************************************************************//** Initialize things in cache. */ @@ -824,17 +833,20 @@ fts_drop_index_split_tables( /*========================*/ trx_t* trx, /*!< in: transaction */ dict_index_t* index) /*!< in: fts instance */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); -/****************************************************************//** -Run SYNC on the table, i.e., write out data from the cache to the -FTS auxiliary INDEX table and clear the cache at the end. */ +/** Run SYNC on the table, i.e., write out data from the cache to the +FTS auxiliary INDEX table and clear the cache at the end. +@param[in,out] table fts table +@param[in] unlock_cache whether unlock cache when write node +@param[in] wait whether wait for existing sync to finish +@return DB_SUCCESS on success, error code on failure. */ UNIV_INTERN dberr_t fts_sync_table( -/*===========*/ - dict_table_t* table) /*!< in: table */ - __attribute__((nonnull)); + dict_table_t* table, + bool unlock_cache, + bool wait); /****************************************************************//** Free the query graph but check whether dict_sys->mutex is already @@ -1013,7 +1025,7 @@ fts_drop_index( dict_table_t* table, /*!< in: Table where indexes are dropped */ dict_index_t* index, /*!< in: Index to be dropped */ trx_t* trx) /*!< in: Transaction for the drop */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /****************************************************************//** Rename auxiliary tables for all fts index for a table diff --git a/storage/innobase/include/fts0priv.h b/storage/innobase/include/fts0priv.h index b4d9e1d41ec..2d4e9d88fd1 100644 --- a/storage/innobase/include/fts0priv.h +++ b/storage/innobase/include/fts0priv.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2011, 2013, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2011, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -121,7 +121,7 @@ fts_parse_sql( fts_table_t* fts_table, /*!< in: FTS aux table */ pars_info_t* info, /*!< in: info struct, or NULL */ const char* sql) /*!< in: SQL string to evaluate */ - __attribute__((nonnull(3), malloc, warn_unused_result)); + MY_ATTRIBUTE((nonnull(3), malloc, warn_unused_result)); /******************************************************************//** Evaluate a parsed SQL statement @return DB_SUCCESS or error code */ @@ -131,7 +131,7 @@ fts_eval_sql( /*=========*/ trx_t* trx, /*!< in: transaction */ que_t* graph) /*!< in: Parsed statement */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /******************************************************************//** Construct the name of an ancillary FTS table for the given table. @return own: table name, must be freed with mem_free() */ @@ -141,7 +141,7 @@ fts_get_table_name( /*===============*/ const fts_table_t* fts_table) /*!< in: FTS aux table info */ - __attribute__((nonnull, malloc, warn_unused_result)); + MY_ATTRIBUTE((nonnull, malloc, warn_unused_result)); /******************************************************************//** Construct the column specification part of the SQL string for selecting the indexed FTS columns for the given table. Adds the necessary bound @@ -164,7 +164,7 @@ fts_get_select_columns_str( dict_index_t* index, /*!< in: FTS index */ pars_info_t* info, /*!< in/out: parser info */ mem_heap_t* heap) /*!< in: memory heap */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /** define for fts_doc_fetch_by_doc_id() "option" value, defines whether we want to get Doc whose ID is equal to or greater or smaller than supplied @@ -191,7 +191,7 @@ fts_doc_fetch_by_doc_id( callback, /*!< in: callback to read records */ void* arg) /*!< in: callback arg */ - __attribute__((nonnull(6))); + MY_ATTRIBUTE((nonnull(6))); /*******************************************************************//** Callback function for fetch that stores the text of an FTS document, @@ -203,7 +203,7 @@ fts_query_expansion_fetch_doc( /*==========================*/ void* row, /*!< in: sel_node_t* */ void* user_arg) /*!< in: fts_doc_t* */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /******************************************************************** Write out a single word's data as new entry/entries in the INDEX table. @return DB_SUCCESS if all OK. */ @@ -216,7 +216,7 @@ fts_write_node( fts_table_t* fts_table, /*!< in: the FTS aux index */ fts_string_t* word, /*!< in: word in UTF-8 */ fts_node_t* node) /*!< in: node columns */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /*******************************************************************//** Tokenize a document. */ UNIV_INTERN @@ -227,7 +227,7 @@ fts_tokenize_document( tokenize */ fts_doc_t* result) /*!< out: if provided, save result tokens here */ - __attribute__((nonnull(1))); + MY_ATTRIBUTE((nonnull(1))); /*******************************************************************//** Continue to tokenize a document. */ @@ -241,7 +241,7 @@ fts_tokenize_document_next( tokens from this tokenization */ fts_doc_t* result) /*!< out: if provided, save result tokens here */ - __attribute__((nonnull(1))); + MY_ATTRIBUTE((nonnull(1))); /******************************************************************//** Initialize a document. */ UNIV_INTERN @@ -249,7 +249,7 @@ void fts_doc_init( /*=========*/ fts_doc_t* doc) /*!< in: doc to initialize */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /******************************************************************//** Do a binary search for a doc id in the array @@ -263,7 +263,7 @@ fts_bsearch( int lower, /*!< in: lower bound of array*/ int upper, /*!< in: upper bound of array*/ doc_id_t doc_id) /*!< in: doc id to lookup */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /******************************************************************//** Free document. */ UNIV_INTERN @@ -271,7 +271,7 @@ void fts_doc_free( /*=========*/ fts_doc_t* doc) /*!< in: document */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /******************************************************************//** Free fts_optimizer_word_t instanace.*/ UNIV_INTERN @@ -279,7 +279,7 @@ void fts_word_free( /*==========*/ fts_word_t* word) /*!< in: instance to free.*/ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /******************************************************************//** Read the rows from the FTS inde @return DB_SUCCESS or error code */ @@ -293,7 +293,7 @@ fts_index_fetch_nodes( const fts_string_t* word, /*!< in: the word to fetch */ fts_fetch_t* fetch) /*!< in: fetch callback.*/ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /******************************************************************//** Create a fts_optimizer_word_t instance. @return new instance */ @@ -304,7 +304,7 @@ fts_word_init( fts_word_t* word, /*!< in: word to initialize */ byte* utf8, /*!< in: UTF-8 string */ ulint len) /*!< in: length of string in bytes */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /******************************************************************//** Compare two fts_trx_table_t instances, we actually compare the table id's here. @@ -315,7 +315,7 @@ fts_trx_table_cmp( /*==============*/ const void* v1, /*!< in: id1 */ const void* v2) /*!< in: id2 */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /******************************************************************//** Compare a table id with a trx_table_t table id. @return < 0 if n1 < n2, 0 if n1 == n2, > 0 if n1 > n2 */ @@ -325,7 +325,7 @@ fts_trx_table_id_cmp( /*=================*/ const void* p1, /*!< in: id1 */ const void* p2) /*!< in: id2 */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /******************************************************************//** Commit a transaction. @return DB_SUCCESS if all OK */ @@ -334,7 +334,7 @@ dberr_t fts_sql_commit( /*===========*/ trx_t* trx) /*!< in: transaction */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /******************************************************************//** Rollback a transaction. @return DB_SUCCESS if all OK */ @@ -343,7 +343,7 @@ dberr_t fts_sql_rollback( /*=============*/ trx_t* trx) /*!< in: transaction */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /******************************************************************//** Parse an SQL string. %s is replaced with the table's id. Don't acquire the dict mutex @@ -355,7 +355,7 @@ fts_parse_sql_no_dict_lock( fts_table_t* fts_table, /*!< in: table with FTS index */ pars_info_t* info, /*!< in: parser info */ const char* sql) /*!< in: SQL string to evaluate */ - __attribute__((nonnull(3), malloc, warn_unused_result)); + MY_ATTRIBUTE((nonnull(3), malloc, warn_unused_result)); /******************************************************************//** Get value from config table. The caller must ensure that enough space is allocated for value to hold the column contents @@ -370,7 +370,7 @@ fts_config_get_value( this parameter name */ fts_string_t* value) /*!< out: value read from config table */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /******************************************************************//** Get value specific to an FTS index from the config table. The caller must ensure that enough space is allocated for value to hold the @@ -386,7 +386,7 @@ fts_config_get_index_value( this parameter name */ fts_string_t* value) /*!< out: value read from config table */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /******************************************************************//** Set the value in the config table for name. @return DB_SUCCESS or error code */ @@ -400,7 +400,7 @@ fts_config_set_value( this parameter name */ const fts_string_t* value) /*!< in: value to update */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /****************************************************************//** Set an ulint value in the config table. @return DB_SUCCESS if all OK else error code */ @@ -412,7 +412,7 @@ fts_config_set_ulint( fts_table_t* fts_table, /*!< in: the indexed FTS table */ const char* name, /*!< in: param name */ ulint int_value) /*!< in: value */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /******************************************************************//** Set the value specific to an FTS index in the config table. @return DB_SUCCESS or error code */ @@ -426,7 +426,7 @@ fts_config_set_index_value( this parameter name */ fts_string_t* value) /*!< out: value read from config table */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /******************************************************************//** Increment the value in the config table for column name. @return DB_SUCCESS or error code */ @@ -439,7 +439,7 @@ fts_config_increment_value( const char* name, /*!< in: increment config value for this parameter name */ ulint delta) /*!< in: increment by this much */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /******************************************************************//** Increment the per index value in the config table for column name. @return DB_SUCCESS or error code */ @@ -452,7 +452,7 @@ fts_config_increment_index_value( const char* name, /*!< in: increment config value for this parameter name */ ulint delta) /*!< in: increment by this much */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /******************************************************************//** Get an ulint value from the config table. @return DB_SUCCESS or error code */ @@ -464,7 +464,7 @@ fts_config_get_index_ulint( dict_index_t* index, /*!< in: FTS index */ const char* name, /*!< in: param name */ ulint* int_value) /*!< out: value */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /******************************************************************//** Set an ulint value int the config table. @return DB_SUCCESS or error code */ @@ -476,7 +476,7 @@ fts_config_set_index_ulint( dict_index_t* index, /*!< in: FTS index */ const char* name, /*!< in: param name */ ulint int_value) /*!< in: value */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /******************************************************************//** Get an ulint value from the config table. @return DB_SUCCESS or error code */ @@ -488,7 +488,7 @@ fts_config_get_ulint( fts_table_t* fts_table, /*!< in: the indexed FTS table */ const char* name, /*!< in: param name */ ulint* int_value) /*!< out: value */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /******************************************************************//** Search cache for word. @return the word node vector if found else NULL */ @@ -500,7 +500,7 @@ fts_cache_find_word( index_cache, /*!< in: cache to search */ const fts_string_t* text) /*!< in: word to search for */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /******************************************************************//** Check cache for deleted doc id. @return TRUE if deleted */ @@ -511,7 +511,7 @@ fts_cache_is_deleted_doc_id( const fts_cache_t* cache, /*!< in: cache ito search */ doc_id_t doc_id) /*!< in: doc id to search for */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /******************************************************************//** Append deleted doc ids to vector and sort the vector. */ UNIV_INTERN @@ -546,7 +546,7 @@ fts_get_total_word_count( trx_t* trx, /*!< in: transaction */ dict_index_t* index, /*!< in: for this index */ ulint* total) /*!< out: total words */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); #endif /******************************************************************//** Search the index specific cache for a particular FTS index. @@ -559,7 +559,7 @@ fts_find_index_cache( cache, /*!< in: cache to search */ const dict_index_t* index) /*!< in: index to search for */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /******************************************************************//** Write the table id to the given buffer (including final NUL). Buffer must be at least FTS_AUX_MIN_TABLE_ID_LENGTH bytes long. @@ -570,10 +570,10 @@ fts_write_object_id( /*================*/ ib_id_t id, /*!< in: a table/index id */ char* str, /*!< in: buffer to write the id to */ - bool hex_format __attribute__((unused))) + bool hex_format MY_ATTRIBUTE((unused))) /*!< in: true for fixed hex format, false for old ambiguous format */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /******************************************************************//** Read the table id from the string generated by fts_write_object_id(). @return TRUE if parse successful */ @@ -583,7 +583,7 @@ fts_read_object_id( /*===============*/ ib_id_t* id, /*!< out: a table id */ const char* str) /*!< in: buffer to read from */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /******************************************************************//** Get the table id. @return number of bytes written */ @@ -596,7 +596,7 @@ fts_get_table_id( char* table_id) /*!< out: table id, must be at least FTS_AUX_MIN_TABLE_ID_LENGTH bytes long */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /******************************************************************//** Add the table to add to the OPTIMIZER's list. */ UNIV_INTERN @@ -604,7 +604,7 @@ void fts_optimize_add_table( /*===================*/ dict_table_t* table) /*!< in: table to add */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /******************************************************************//** Optimize a table. */ UNIV_INTERN @@ -612,7 +612,7 @@ void fts_optimize_do_table( /*==================*/ dict_table_t* table) /*!< in: table to optimize */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /******************************************************************//** Construct the prefix name of an FTS table. @return own: table name, must be freed with mem_free() */ @@ -622,7 +622,7 @@ fts_get_table_name_prefix( /*======================*/ const fts_table_t* fts_table) /*!< in: Auxiliary table type */ - __attribute__((nonnull, malloc, warn_unused_result)); + MY_ATTRIBUTE((nonnull, malloc, warn_unused_result)); /******************************************************************//** Add node positions. */ UNIV_INTERN @@ -633,7 +633,7 @@ fts_cache_node_add_positions( fts_node_t* node, /*!< in: word node */ doc_id_t doc_id, /*!< in: doc id */ ib_vector_t* positions) /*!< in: fts_token_t::positions */ - __attribute__((nonnull(2,4))); + MY_ATTRIBUTE((nonnull(2,4))); /******************************************************************//** Create the config table name for retrieving index specific value. @@ -644,7 +644,7 @@ fts_config_create_index_param_name( /*===============================*/ const char* param, /*!< in: base name of param */ const dict_index_t* index) /*!< in: index for config */ - __attribute__((nonnull, malloc, warn_unused_result)); + MY_ATTRIBUTE((nonnull, malloc, warn_unused_result)); #ifndef UNIV_NONINL #include "fts0priv.ic" diff --git a/storage/innobase/include/fts0priv.ic b/storage/innobase/include/fts0priv.ic index ec61691870b..88f2d67c7b8 100644 --- a/storage/innobase/include/fts0priv.ic +++ b/storage/innobase/include/fts0priv.ic @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2011, 2013, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2011, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -33,7 +33,7 @@ fts_write_object_id( /*================*/ ib_id_t id, /* in: a table/index id */ char* str, /* in: buffer to write the id to */ - bool hex_format __attribute__((unused))) + bool hex_format MY_ATTRIBUTE((unused))) /* in: true for fixed hex format, false for old ambiguous format */ { diff --git a/storage/innobase/include/fts0types.h b/storage/innobase/include/fts0types.h index 64677428331..e495fe72a60 100644 --- a/storage/innobase/include/fts0types.h +++ b/storage/innobase/include/fts0types.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2007, 2011, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2007, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -122,7 +122,11 @@ struct fts_sync_t { doc_id_t max_doc_id; /*!< The doc id at which the cache was noted as being full, we use this to set the upper_limit field */ - ib_time_t start_time; /*!< SYNC start time */ + ib_time_t start_time; /*!< SYNC start time */ + bool in_progress; /*!< flag whether sync is in progress.*/ + bool unlock_cache; /*!< flag whether unlock cache when + write fts node */ + os_event_t event; /*!< sync finish event */ }; /** The cache for the FTS system. It is a memory-based inverted index @@ -165,7 +169,6 @@ struct fts_cache_t { objects, they are recreated after a SYNC is completed */ - ib_alloc_t* self_heap; /*!< This heap is the heap out of which an instance of the cache itself was created. Objects created using @@ -212,6 +215,7 @@ struct fts_node_t { ulint ilist_size_alloc; /*!< Allocated size of ilist in bytes */ + bool synced; /*!< flag whether the node is synced */ }; /** A tokenizer word. Contains information about one word. */ diff --git a/storage/innobase/include/ha_prototypes.h b/storage/innobase/include/ha_prototypes.h index 427bfaf2c05..12453099ef7 100644 --- a/storage/innobase/include/ha_prototypes.h +++ b/storage/innobase/include/ha_prototypes.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2006, 2015, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2006, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -136,7 +136,7 @@ enum durability_properties thd_requested_durability( /*=====================*/ const THD* thd) /*!< in: thread handle */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /******************************************************************//** Returns true if the transaction this thread is processing has edited @@ -177,7 +177,7 @@ innobase_mysql_cmp( const unsigned char* b, /*!< in: data field */ unsigned int b_length) /*!< in: data field length, not UNIV_SQL_NULL */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /*****************************************************************//** Log code calls this whenever log has been written and/or flushed up @@ -205,7 +205,7 @@ get_innobase_type_from_mysql_type( and unsigned integer types are 'unsigned types' */ const void* field) /*!< in: MySQL Field */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /******************************************************************//** Get the variable length bounds of the given character set. */ @@ -289,8 +289,10 @@ innobase_casedn_str( #ifdef WITH_WSREP UNIV_INTERN int -wsrep_innobase_kill_one_trx(void *thd_ptr, - const trx_t *bf_trx, trx_t *victim_trx, ibool signal); +wsrep_innobase_kill_one_trx(void * const thd_ptr, + const trx_t * const bf_trx, + trx_t *victim_trx, + ibool signal); int wsrep_innobase_mysql_sort(int mysql_type, uint charset_number, unsigned char* str, unsigned int str_length, unsigned int buf_length); @@ -313,7 +315,7 @@ innobase_get_stmt( /*==============*/ THD* thd, /*!< in: MySQL thread handle */ size_t* length) /*!< out: length of the SQL statement */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /******************************************************************//** This function is used to find the storage length in bytes of the first n characters for prefix indexes using a multibyte character set. The function @@ -339,7 +341,7 @@ enum icp_result innobase_index_cond( /*================*/ void* file) /*!< in/out: pointer to ha_innobase */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /******************************************************************//** Returns true if the thread supports XA, global value of innodb_supports_xa if thd is NULL. @@ -475,7 +477,7 @@ innobase_format_name( const char* name, /*!< in: index or table name to format */ ibool is_index_name) /*!< in: index name */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /** Corresponds to Sql_condition:enum_warning_level. */ enum ib_log_level_t { @@ -505,7 +507,7 @@ ib_errf( ib_uint32_t code, /*!< MySQL error code */ const char* format, /*!< printf format */ ...) /*!< Args */ - __attribute__((format(printf, 4, 5))); + MY_ATTRIBUTE((format(printf, 4, 5))); /******************************************************************//** Use this when the args are passed to the format string from @@ -536,7 +538,7 @@ ib_logf( ib_log_level_t level, /*!< in: warning level */ const char* format, /*!< printf format */ ...) /*!< Args */ - __attribute__((format(printf, 2, 3))); + MY_ATTRIBUTE((format(printf, 2, 3))); /******************************************************************//** Returns the NUL terminated value of glob_hostname. @@ -582,7 +584,7 @@ innobase_next_autoinc( ulonglong step, /*!< in: AUTOINC increment step */ ulonglong offset, /*!< in: AUTOINC offset */ ulonglong max_value) /*!< in: max value for type */ - __attribute__((pure, warn_unused_result)); + MY_ATTRIBUTE((pure, warn_unused_result)); /********************************************************************//** Get the upper limit of the MySQL integral and floating-point type. @@ -592,7 +594,7 @@ ulonglong innobase_get_int_col_max_value( /*===========================*/ const Field* field) /*!< in: MySQL field */ - __attribute__((nonnull, pure, warn_unused_result)); + MY_ATTRIBUTE((nonnull, pure, warn_unused_result)); /********************************************************************** Converts an identifier from my_charset_filename to UTF-8 charset. */ diff --git a/storage/innobase/include/handler0alter.h b/storage/innobase/include/handler0alter.h index 66b963ae39a..3dd6c99eb6d 100644 --- a/storage/innobase/include/handler0alter.h +++ b/storage/innobase/include/handler0alter.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2005, 2013, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2005, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -32,7 +32,7 @@ innobase_rec_to_mysql( const dict_index_t* index, /*!< in: index */ const ulint* offsets)/*!< in: rec_get_offsets( rec, index, ...) */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /*************************************************************//** Copies an InnoDB index entry to table->record[0]. */ @@ -43,7 +43,7 @@ innobase_fields_to_mysql( struct TABLE* table, /*!< in/out: MySQL table */ const dict_index_t* index, /*!< in: InnoDB index */ const dfield_t* fields) /*!< in: InnoDB index fields */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /*************************************************************//** Copies an InnoDB row to table->record[0]. */ @@ -54,7 +54,7 @@ innobase_row_to_mysql( struct TABLE* table, /*!< in/out: MySQL table */ const dict_table_t* itab, /*!< in: InnoDB table */ const dtuple_t* row) /*!< in: InnoDB row */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /*************************************************************//** Resets table->record[0]. */ @@ -63,7 +63,7 @@ void innobase_rec_reset( /*===============*/ struct TABLE* table) /*!< in/out: MySQL table */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /** Generate the next autoinc based on a snapshot of the session auto_increment_increment and auto_increment_offset variables. */ diff --git a/storage/innobase/include/ibuf0ibuf.h b/storage/innobase/include/ibuf0ibuf.h index badafe6befd..09c48822b9f 100644 --- a/storage/innobase/include/ibuf0ibuf.h +++ b/storage/innobase/include/ibuf0ibuf.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1997, 2013, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1997, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2016, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under @@ -120,7 +120,7 @@ void ibuf_mtr_start( /*===========*/ mtr_t* mtr) /*!< out: mini-transaction */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /***************************************************************//** Commits an insert buffer mini-transaction. */ UNIV_INLINE @@ -128,7 +128,7 @@ void ibuf_mtr_commit( /*============*/ mtr_t* mtr) /*!< in/out: mini-transaction */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /*********************************************************************//** Initializes an ibuf bitmap page. */ UNIV_INTERN @@ -254,7 +254,7 @@ ibool ibuf_inside( /*========*/ const mtr_t* mtr) /*!< in: mini-transaction */ - __attribute__((nonnull, pure)); + MY_ATTRIBUTE((nonnull, pure)); /***********************************************************************//** Checks if a page address is an ibuf bitmap page (level 3 page) address. @return TRUE if a bitmap page */ @@ -287,7 +287,7 @@ ibuf_page_low( is not one of the fixed address ibuf pages, or NULL, in which case a new transaction is created. */ - __attribute__((warn_unused_result)); + MY_ATTRIBUTE((warn_unused_result)); #ifdef UNIV_DEBUG /** Checks if a page is a level 2 or 3 page in the ibuf hierarchy of pages. Must not be called when recv_no_ibuf_operations==TRUE. @@ -366,23 +366,31 @@ void ibuf_delete_for_discarded_space( /*============================*/ ulint space); /*!< in: space id */ -/*********************************************************************//** -Contracts insert buffer trees by reading pages to the buffer pool. +/** Contract the change buffer by reading pages to the buffer pool. +@param[in] full If true, do a full contraction based +on PCT_IO(100). If false, the size of contract batch is determined +based on the current size of the change buffer. @return a lower limit for the combined size in bytes of entries which will be merged from ibuf trees to the pages read, 0 if ibuf is empty */ UNIV_INTERN ulint -ibuf_contract_in_background( -/*========================*/ - table_id_t table_id, /*!< in: if merge should be done only - for a specific table, for all tables - this should be 0 */ - ibool full); /*!< in: TRUE if the caller wants to - do a full contract based on PCT_IO(100). - If FALSE then the size of contract - batch is determined based on the - current size of the ibuf tree. */ +ibuf_merge_in_background( + bool full); /*!< in: TRUE if the caller wants to + do a full contract based on PCT_IO(100). + If FALSE then the size of contract + batch is determined based on the + current size of the ibuf tree. */ + +/** Contracts insert buffer trees by reading pages referring to space_id +to the buffer pool. +@returns number of pages merged.*/ +UNIV_INTERN +ulint +ibuf_merge_space( +/*=============*/ + ulint space); /*!< in: space id */ + #endif /* !UNIV_HOTBACKUP */ /*********************************************************************//** Parses a redo log record of an ibuf bitmap page init. @@ -447,7 +455,7 @@ ibuf_check_bitmap_on_import( /*========================*/ const trx_t* trx, /*!< in: transaction */ ulint space_id) /*!< in: tablespace identifier */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); #define IBUF_HEADER_PAGE_NO FSP_IBUF_HEADER_PAGE_NO #define IBUF_TREE_ROOT_PAGE_NO FSP_IBUF_TREE_ROOT_PAGE_NO diff --git a/storage/innobase/include/lock0lock.h b/storage/innobase/include/lock0lock.h index acfb8ef19c6..a6fafd95754 100644 --- a/storage/innobase/include/lock0lock.h +++ b/storage/innobase/include/lock0lock.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2014, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -276,7 +276,7 @@ lock_rec_expl_exist_on_page( /*========================*/ ulint space, /*!< in: space id */ ulint page_no)/*!< in: page number */ - __attribute__((warn_unused_result)); + MY_ATTRIBUTE((warn_unused_result)); /*********************************************************************//** Checks if locks of other transactions prevent an immediate insert of a record. If they do, first tests if the query thread should anyway @@ -299,7 +299,7 @@ lock_rec_insert_check_and_lock( inserted record maybe should inherit LOCK_GAP type locks from the successor record */ - __attribute__((nonnull(2,3,4,6,7), warn_unused_result)); + MY_ATTRIBUTE((nonnull(2,3,4,6,7), warn_unused_result)); /*********************************************************************//** Checks if locks of other transactions prevent an immediate modify (update, delete mark, or delete unmark) of a clustered index record. If they do, @@ -320,7 +320,7 @@ lock_clust_rec_modify_check_and_lock( dict_index_t* index, /*!< in: clustered index */ const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */ que_thr_t* thr) /*!< in: query thread */ - __attribute__((warn_unused_result, nonnull)); + MY_ATTRIBUTE((warn_unused_result, nonnull)); /*********************************************************************//** Checks if locks of other transactions prevent an immediate modify (delete mark or delete unmark) of a secondary index record. @@ -341,7 +341,7 @@ lock_sec_rec_modify_check_and_lock( que_thr_t* thr, /*!< in: query thread (can be NULL if BTR_NO_LOCKING_FLAG) */ mtr_t* mtr) /*!< in/out: mini-transaction */ - __attribute__((warn_unused_result, nonnull(2,3,4,6))); + MY_ATTRIBUTE((warn_unused_result, nonnull(2,3,4,6))); /*********************************************************************//** Like lock_clust_rec_read_check_and_lock(), but reads a secondary index record. @@ -428,7 +428,7 @@ lock_clust_rec_read_check_and_lock_alt( ulint gap_mode,/*!< in: LOCK_ORDINARY, LOCK_GAP, or LOCK_REC_NOT_GAP */ que_thr_t* thr) /*!< in: query thread */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /*********************************************************************//** Checks that a record is seen in a consistent read. @return true if sees, or false if an earlier version of the record @@ -460,7 +460,7 @@ lock_sec_rec_cons_read_sees( should be read or passed over by a read cursor */ const read_view_t* view) /*!< in: consistent read view */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /*********************************************************************//** Locks the specified database table in the mode given. If the lock cannot be granted immediately, the query thread is put to wait. @@ -475,7 +475,7 @@ lock_table( in dictionary cache */ enum lock_mode mode, /*!< in: lock mode */ que_thr_t* thr) /*!< in: query thread */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /*********************************************************************//** Creates a table IX lock object for a resurrected transaction. */ UNIV_INTERN @@ -530,7 +530,7 @@ lock_rec_fold( /*==========*/ ulint space, /*!< in: space */ ulint page_no)/*!< in: page number */ - __attribute__((const)); + MY_ATTRIBUTE((const)); /*********************************************************************//** Calculates the hash value of a page file address: used in inserting or searching for a lock in the hash table. @@ -580,7 +580,7 @@ lock_is_table_exclusive( /*====================*/ const dict_table_t* table, /*!< in: table */ const trx_t* trx) /*!< in: transaction */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /*********************************************************************//** Checks if a lock request lock1 has to wait for request lock2. @return TRUE if lock1 has to wait for lock2 to be removed */ @@ -604,7 +604,7 @@ lock_report_trx_id_insanity( dict_index_t* index, /*!< in: index */ const ulint* offsets, /*!< in: rec_get_offsets(rec, index) */ trx_id_t max_trx_id) /*!< in: trx_sys_get_max_trx_id() */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /*********************************************************************//** Prints info of a table lock. */ UNIV_INTERN @@ -631,7 +631,7 @@ lock_print_info_summary( /*====================*/ FILE* file, /*!< in: file where to print */ ibool nowait) /*!< in: whether to wait for the lock mutex */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /*********************************************************************//** Prints info of locks for each transaction. This function assumes that the caller holds the lock mutex and more importantly it will release the lock @@ -651,7 +651,7 @@ ulint lock_number_of_rows_locked( /*=======================*/ const trx_lock_t* trx_lock) /*!< in: transaction locks */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /*******************************************************************//** Gets the type of a lock. Non-inline version for using outside of the @@ -819,7 +819,7 @@ dberr_t lock_trx_handle_wait( /*=================*/ trx_t* trx) /*!< in/out: trx lock state */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /*********************************************************************//** Get the number of locks on a table. @return number of locks */ @@ -828,7 +828,7 @@ ulint lock_table_get_n_locks( /*===================*/ const dict_table_t* table) /*!< in: table */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); #ifdef UNIV_DEBUG /*********************************************************************//** Checks that a transaction id is sensible, i.e., not in the future. @@ -841,7 +841,7 @@ lock_check_trx_id_sanity( const rec_t* rec, /*!< in: user record */ dict_index_t* index, /*!< in: index */ const ulint* offsets) /*!< in: rec_get_offsets(rec, index) */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /*******************************************************************//** Check if the transaction holds any locks on the sys tables or its records. @@ -851,7 +851,7 @@ const lock_t* lock_trx_has_sys_table_locks( /*=========================*/ const trx_t* trx) /*!< in: transaction to check */ - __attribute__((warn_unused_result)); + MY_ATTRIBUTE((warn_unused_result)); /*******************************************************************//** Check if the transaction holds an exclusive lock on a record. @@ -864,7 +864,7 @@ lock_trx_has_rec_x_lock( const dict_table_t* table, /*!< in: table to check */ const buf_block_t* block, /*!< in: buffer block of the record */ ulint heap_no)/*!< in: record heap number */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); #endif /* UNIV_DEBUG */ /** Lock modes and types */ diff --git a/storage/innobase/include/lock0priv.h b/storage/innobase/include/lock0priv.h index 16423e6a282..b60dd0d92c8 100644 --- a/storage/innobase/include/lock0priv.h +++ b/storage/innobase/include/lock0priv.h @@ -1,7 +1,7 @@ /***************************************************************************** -Copyright (c) 2007, 2011, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2015, MariaDB Corporation +Copyright (c) 2007, 2016, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2015, 2016, MariaDB Corporation This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -124,7 +124,7 @@ lock_clust_rec_some_has_impl( const rec_t* rec, /*!< in: user record */ const dict_index_t* index, /*!< in: clustered index */ const ulint* offsets)/*!< in: rec_get_offsets(rec, index) */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); #ifndef UNIV_NONINL #include "lock0priv.ic" diff --git a/storage/innobase/include/log0log.h b/storage/innobase/include/log0log.h index a960bc50454..3ff69278ad9 100644 --- a/storage/innobase/include/log0log.h +++ b/storage/innobase/include/log0log.h @@ -784,7 +784,7 @@ struct log_group_t{ /** Redo log buffer */ struct log_t{ - byte pad[64]; /*!< padding to prevent other memory + byte pad[CACHE_LINE_SIZE]; /*!< padding to prevent other memory update hotspots from residing on the same memory cache line */ lsn_t lsn; /*!< log sequence number */ @@ -878,7 +878,7 @@ struct log_t{ pending flushes or writes */ /* NOTE on the 'flush' in names of the fields below: starting from 4.0.14, we separate the write of the log file and the actual fsync() - or other method to flush it to disk. The names below shhould really + or other method to flush it to disk. The names below should really be 'flush_or_write'! */ os_event_t no_flush_event; /*!< this event is in the reset state when a flush or a write is running; diff --git a/storage/innobase/include/log0recv.h b/storage/innobase/include/log0recv.h index 292953854f7..b6c977bdc74 100644 --- a/storage/innobase/include/log0recv.h +++ b/storage/innobase/include/log0recv.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1997, 2014, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1997, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -51,7 +51,7 @@ recv_read_checkpoint_info_for_backup( lsn_t* first_header_lsn) /*!< out: lsn of of the start of the first log file */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /*******************************************************************//** Scans the log segment and n_bytes_scanned is set to the length of valid log scanned. */ diff --git a/storage/innobase/include/mach0data.h b/storage/innobase/include/mach0data.h index d0087f56aaa..9859def0adc 100644 --- a/storage/innobase/include/mach0data.h +++ b/storage/innobase/include/mach0data.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1995, 2009, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -53,7 +53,7 @@ ulint mach_read_from_1( /*=============*/ const byte* b) /*!< in: pointer to byte */ - __attribute__((nonnull, pure)); + MY_ATTRIBUTE((nonnull, pure)); /*******************************************************//** The following function is used to store data in two consecutive bytes. We store the most significant byte to the lower address. */ @@ -72,7 +72,7 @@ ulint mach_read_from_2( /*=============*/ const byte* b) /*!< in: pointer to two bytes */ - __attribute__((nonnull, pure)); + MY_ATTRIBUTE((nonnull, pure)); /********************************************************//** The following function is used to convert a 16-bit data item @@ -84,7 +84,7 @@ uint16 mach_encode_2( /*==========*/ ulint n) /*!< in: integer in machine-dependent format */ - __attribute__((const)); + MY_ATTRIBUTE((const)); /********************************************************//** The following function is used to convert a 16-bit data item from the canonical format, for fast bytewise equality test @@ -95,7 +95,7 @@ ulint mach_decode_2( /*==========*/ uint16 n) /*!< in: 16-bit integer in canonical format */ - __attribute__((const)); + MY_ATTRIBUTE((const)); /*******************************************************//** The following function is used to store data in 3 consecutive bytes. We store the most significant byte to the lowest address. */ @@ -114,7 +114,7 @@ ulint mach_read_from_3( /*=============*/ const byte* b) /*!< in: pointer to 3 bytes */ - __attribute__((nonnull, pure)); + MY_ATTRIBUTE((nonnull, pure)); /*******************************************************//** The following function is used to store data in four consecutive bytes. We store the most significant byte to the lowest address. */ @@ -133,7 +133,7 @@ ulint mach_read_from_4( /*=============*/ const byte* b) /*!< in: pointer to four bytes */ - __attribute__((nonnull, pure)); + MY_ATTRIBUTE((nonnull, pure)); /*********************************************************//** Writes a ulint in a compressed form (1..5 bytes). @return stored size in bytes */ @@ -151,7 +151,7 @@ ulint mach_get_compressed_size( /*=====================*/ ulint n) /*!< in: ulint integer to be stored */ - __attribute__((const)); + MY_ATTRIBUTE((const)); /*********************************************************//** Reads a ulint in a compressed form. @return read integer */ @@ -160,7 +160,7 @@ ulint mach_read_compressed( /*=================*/ const byte* b) /*!< in: pointer to memory from where to read */ - __attribute__((nonnull, pure)); + MY_ATTRIBUTE((nonnull, pure)); /*******************************************************//** The following function is used to store data in 6 consecutive bytes. We store the most significant byte to the lowest address. */ @@ -179,7 +179,7 @@ ib_uint64_t mach_read_from_6( /*=============*/ const byte* b) /*!< in: pointer to 6 bytes */ - __attribute__((nonnull, pure)); + MY_ATTRIBUTE((nonnull, pure)); /*******************************************************//** The following function is used to store data in 7 consecutive bytes. We store the most significant byte to the lowest address. */ @@ -198,7 +198,7 @@ ib_uint64_t mach_read_from_7( /*=============*/ const byte* b) /*!< in: pointer to 7 bytes */ - __attribute__((nonnull, pure)); + MY_ATTRIBUTE((nonnull, pure)); /*******************************************************//** The following function is used to store data in 8 consecutive bytes. We store the most significant byte to the lowest address. */ @@ -217,7 +217,7 @@ ib_uint64_t mach_read_from_8( /*=============*/ const byte* b) /*!< in: pointer to 8 bytes */ - __attribute__((nonnull, pure)); + MY_ATTRIBUTE((nonnull, pure)); /*********************************************************//** Writes a 64-bit integer in a compressed form (5..9 bytes). @return size in bytes */ @@ -243,7 +243,7 @@ ib_uint64_t mach_ull_read_compressed( /*=====================*/ const byte* b) /*!< in: pointer to memory from where to read */ - __attribute__((nonnull, pure)); + MY_ATTRIBUTE((nonnull, pure)); /*********************************************************//** Writes a 64-bit integer in a compressed form (1..11 bytes). @return size in bytes */ @@ -261,7 +261,7 @@ ulint mach_ull_get_much_compressed_size( /*==============================*/ ib_uint64_t n) /*!< in: 64-bit integer to be stored */ - __attribute__((const)); + MY_ATTRIBUTE((const)); /*********************************************************//** Reads a 64-bit integer in a compressed form. @return the value read */ @@ -270,7 +270,7 @@ ib_uint64_t mach_ull_read_much_compressed( /*==========================*/ const byte* b) /*!< in: pointer to memory from where to read */ - __attribute__((nonnull, pure)); + MY_ATTRIBUTE((nonnull, pure)); /*********************************************************//** Reads a ulint in a compressed form if the log record fully contains it. @return pointer to end of the stored field, NULL if not complete */ @@ -301,7 +301,7 @@ double mach_double_read( /*=============*/ const byte* b) /*!< in: pointer to memory from where to read */ - __attribute__((nonnull, pure)); + MY_ATTRIBUTE((nonnull, pure)); /*********************************************************//** Writes a double. It is stored in a little-endian format. */ UNIV_INLINE @@ -318,7 +318,7 @@ float mach_float_read( /*============*/ const byte* b) /*!< in: pointer to memory from where to read */ - __attribute__((nonnull, pure)); + MY_ATTRIBUTE((nonnull, pure)); /*********************************************************//** Writes a float. It is stored in a little-endian format. */ UNIV_INLINE @@ -336,7 +336,7 @@ mach_read_from_n_little_endian( /*===========================*/ const byte* buf, /*!< in: from where to read */ ulint buf_size) /*!< in: from how many bytes to read */ - __attribute__((nonnull, pure)); + MY_ATTRIBUTE((nonnull, pure)); /*********************************************************//** Writes a ulint in the little-endian format. */ UNIV_INLINE @@ -354,7 +354,7 @@ ulint mach_read_from_2_little_endian( /*===========================*/ const byte* buf) /*!< in: from where to read */ - __attribute__((nonnull, pure)); + MY_ATTRIBUTE((nonnull, pure)); /*********************************************************//** Writes a ulint in the little-endian format. */ UNIV_INLINE diff --git a/storage/innobase/include/mem0mem.h b/storage/innobase/include/mem0mem.h index f30034f3074..de9b8b29fd9 100644 --- a/storage/innobase/include/mem0mem.h +++ b/storage/innobase/include/mem0mem.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1994, 2010, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -353,7 +353,7 @@ mem_heap_printf( /*============*/ mem_heap_t* heap, /*!< in: memory heap */ const char* format, /*!< in: format string */ - ...) __attribute__ ((format (printf, 2, 3))); + ...) MY_ATTRIBUTE ((format (printf, 2, 3))); #ifdef MEM_PERIODIC_CHECK /******************************************************************//** diff --git a/storage/innobase/include/mem0mem.ic b/storage/innobase/include/mem0mem.ic index 0d983d69e1a..63e68150b61 100644 --- a/storage/innobase/include/mem0mem.ic +++ b/storage/innobase/include/mem0mem.ic @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1994, 2010, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -476,9 +476,9 @@ void mem_heap_free_func( /*===============*/ mem_heap_t* heap, /*!< in, own: heap to be freed */ - const char* file_name __attribute__((unused)), + const char* file_name MY_ATTRIBUTE((unused)), /*!< in: file name where freed */ - ulint line __attribute__((unused))) + ulint line MY_ATTRIBUTE((unused))) { mem_block_t* block; mem_block_t* prev_block; diff --git a/storage/innobase/include/mtr0mtr.h b/storage/innobase/include/mtr0mtr.h index eae981f2fbb..c3307985532 100644 --- a/storage/innobase/include/mtr0mtr.h +++ b/storage/innobase/include/mtr0mtr.h @@ -1,7 +1,8 @@ /***************************************************************************** -Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2012, Facebook Inc. +Copyright (c) 2013, 2016, MariaDB Corporation This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -217,7 +218,7 @@ mtr_start_trx( /*======*/ mtr_t* mtr, /*!< out: mini-transaction */ trx_t* trx) /*!< in: transaction */ - __attribute__((nonnull (1))); + MY_ATTRIBUTE((nonnull (1))); /***************************************************************//** Starts a mini-transaction. */ UNIV_INLINE @@ -228,7 +229,7 @@ mtr_start( { mtr_start_trx(mtr, NULL); } - __attribute__((nonnull)) + MY_ATTRIBUTE((nonnull)) /***************************************************************//** Commits a mini-transaction. */ UNIV_INTERN @@ -236,7 +237,7 @@ void mtr_commit( /*=======*/ mtr_t* mtr) /*!< in/out: mini-transaction */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /**********************************************************//** Sets and returns a savepoint in mtr. @return savepoint */ @@ -341,7 +342,7 @@ mtr_memo_release( mtr_t* mtr, /*!< in/out: mini-transaction */ void* object, /*!< in: object */ ulint type) /*!< in: object type: MTR_MEMO_S_LOCK, ... */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); #ifdef UNIV_DEBUG # ifndef UNIV_HOTBACKUP /**********************************************************//** @@ -354,7 +355,7 @@ mtr_memo_contains( mtr_t* mtr, /*!< in: mtr */ const void* object, /*!< in: object to search */ ulint type) /*!< in: type of object */ - __attribute__((warn_unused_result, nonnull)); + MY_ATTRIBUTE((warn_unused_result, nonnull)); /**********************************************************//** Checks if memo contains the given page. diff --git a/storage/innobase/include/mtr0mtr.ic b/storage/innobase/include/mtr0mtr.ic index 44d548e9b64..37cea34d4eb 100644 --- a/storage/innobase/include/mtr0mtr.ic +++ b/storage/innobase/include/mtr0mtr.ic @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -37,7 +37,7 @@ ibool mtr_block_dirtied( /*==============*/ const buf_block_t* block) /*!< in: block being x-fixed */ - __attribute__((nonnull,warn_unused_result)); + MY_ATTRIBUTE((nonnull,warn_unused_result)); /***************************************************************//** Starts a mini-transaction. */ diff --git a/storage/innobase/include/os0file.h b/storage/innobase/include/os0file.h index dff5ebd524c..2425a682e22 100644 --- a/storage/innobase/include/os0file.h +++ b/storage/innobase/include/os0file.h @@ -1,6 +1,6 @@ /*********************************************************************** -Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2009, Percona Inc. Copyright (c) 2013, 2015, MariaDB Corporation. @@ -128,10 +128,7 @@ enum os_file_create_t { #define OS_FILE_READ_ONLY 333 #define OS_FILE_READ_WRITE 444 #define OS_FILE_READ_ALLOW_DELETE 555 /* for mysqlbackup */ -#define OS_FILE_READ_WRITE_CACHED 666 /* OS_FILE_READ_WRITE but never - O_DIRECT. Only for - os_file_create_simple_no_error_handling - currently. */ + /* Options for file_create */ #define OS_FILE_AIO 61 #define OS_FILE_NORMAL 62 @@ -640,7 +637,7 @@ pfs_os_file_create_simple_func( ibool* success,/*!< out: TRUE if succeed, FALSE if error */ const char* src_file,/*!< in: file name where func invoked */ ulint src_line)/*!< in: line where the func invoked */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /****************************************************************//** NOTE! Please use the corresponding macro @@ -667,7 +664,7 @@ pfs_os_file_create_simple_no_error_handling_func( value */ const char* src_file,/*!< in: file name where func invoked */ ulint src_line)/*!< in: line where the func invoked */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /****************************************************************//** NOTE! Please use the corresponding macro os_file_create(), not directly @@ -697,7 +694,7 @@ pfs_os_file_create_func( value*/ const char* src_file,/*!< in: file name where func invoked */ ulint src_line)/*!< in: line where the func invoked */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /***********************************************************************//** NOTE! Please use the corresponding macro os_file_close(), not directly @@ -883,7 +880,7 @@ os_offset_t os_file_get_size( /*=============*/ os_file_t file) /*!< in: handle to a file */ - __attribute__((warn_unused_result)); + MY_ATTRIBUTE((warn_unused_result)); /***********************************************************************//** Write the specified number of zeros to a newly created file. @return TRUE if success */ @@ -895,7 +892,7 @@ os_file_set_size( null-terminated string */ os_file_t file, /*!< in: handle to a file */ os_offset_t size) /*!< in: file size */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /***********************************************************************//** Truncates a file at its current position. @return TRUE if success */ diff --git a/storage/innobase/include/os0sync.h b/storage/innobase/include/os0sync.h index e192a3a6c94..1cf4e9ce501 100644 --- a/storage/innobase/include/os0sync.h +++ b/storage/innobase/include/os0sync.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2008, Google Inc. Portions of this file contain modifications contributed and copyrighted by @@ -466,28 +466,7 @@ amount to decrement. */ # define os_atomic_decrement_uint64(ptr, amount) \ os_atomic_decrement(ptr, amount) -# if defined(HAVE_IB_GCC_ATOMIC_TEST_AND_SET) - -/** Do an atomic test-and-set. -@param[in,out] ptr Memory location to set to non-zero -@return the previous value */ -inline -lock_word_t -os_atomic_test_and_set(volatile lock_word_t* ptr) -{ - return(__atomic_test_and_set(ptr, __ATOMIC_ACQUIRE)); -} - -/** Do an atomic clear. -@param[in,out] ptr Memory location to set to zero */ -inline -void -os_atomic_clear(volatile lock_word_t* ptr) -{ - __atomic_clear(ptr, __ATOMIC_RELEASE); -} - -# elif defined(HAVE_ATOMIC_BUILTINS) +# if defined(HAVE_ATOMIC_BUILTINS) /** Do an atomic test and set. @param[in,out] ptr Memory location to set to non-zero @@ -516,6 +495,27 @@ os_atomic_clear(volatile lock_word_t* ptr) return(__sync_lock_test_and_set(ptr, 0)); } +# elif defined(HAVE_IB_GCC_ATOMIC_TEST_AND_SET) + +/** Do an atomic test-and-set. +@param[in,out] ptr Memory location to set to non-zero +@return the previous value */ +inline +lock_word_t +os_atomic_test_and_set(volatile lock_word_t* ptr) +{ + return(__atomic_test_and_set(ptr, __ATOMIC_ACQUIRE)); +} + +/** Do an atomic clear. +@param[in,out] ptr Memory location to set to zero */ +inline +void +os_atomic_clear(volatile lock_word_t* ptr) +{ + __atomic_clear(ptr, __ATOMIC_RELEASE); +} + # else # error "Unsupported platform" diff --git a/storage/innobase/include/os0thread.h b/storage/innobase/include/os0thread.h index 37c54afae80..9a1ada8fa0d 100644 --- a/storage/innobase/include/os0thread.h +++ b/storage/innobase/include/os0thread.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1995, 2011, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -125,7 +125,7 @@ os_thread_exit( /*===========*/ void* exit_value) /*!< in: exit value; in Windows this void* is cast as a DWORD */ - UNIV_COLD __attribute__((noreturn)); + UNIV_COLD MY_ATTRIBUTE((noreturn)); /*****************************************************************//** Returns the thread identifier of current thread. @return current thread identifier */ diff --git a/storage/innobase/include/page0cur.h b/storage/innobase/include/page0cur.h index b1ad49b4915..f04667ff29c 100644 --- a/storage/innobase/include/page0cur.h +++ b/storage/innobase/include/page0cur.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1994, 2013, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -180,7 +180,7 @@ page_cur_tuple_insert( mem_heap_t** heap, /*!< in/out: pointer to memory heap, or NULL */ ulint n_ext, /*!< in: number of externally stored columns */ mtr_t* mtr) /*!< in: mini-transaction handle, or NULL */ - __attribute__((nonnull(1,2,3,4,5), warn_unused_result)); + MY_ATTRIBUTE((nonnull(1,2,3,4,5), warn_unused_result)); #endif /* !UNIV_HOTBACKUP */ /***********************************************************//** Inserts a record next to page cursor. Returns pointer to inserted record if @@ -218,7 +218,7 @@ page_cur_insert_rec_low( const rec_t* rec, /*!< in: pointer to a physical record */ ulint* offsets,/*!< in/out: rec_get_offsets(rec, index) */ mtr_t* mtr) /*!< in: mini-transaction handle, or NULL */ - __attribute__((nonnull(1,2,3,4), warn_unused_result)); + MY_ATTRIBUTE((nonnull(1,2,3,4), warn_unused_result)); /***********************************************************//** Inserts a record next to page cursor on a compressed and uncompressed page. Returns pointer to inserted record if succeed, i.e., @@ -240,7 +240,7 @@ page_cur_insert_rec_zip( const rec_t* rec, /*!< in: pointer to a physical record */ ulint* offsets,/*!< in/out: rec_get_offsets(rec, index) */ mtr_t* mtr) /*!< in: mini-transaction handle, or NULL */ - __attribute__((nonnull(1,2,3,4), warn_unused_result)); + MY_ATTRIBUTE((nonnull(1,2,3,4), warn_unused_result)); /*************************************************************//** Copies records from page to a newly created page, from a given record onward, including that record. Infimum and supremum records are not copied. diff --git a/storage/innobase/include/page0page.h b/storage/innobase/include/page0page.h index d83b6e1985d..e8b4265bc68 100644 --- a/storage/innobase/include/page0page.h +++ b/storage/innobase/include/page0page.h @@ -1,6 +1,7 @@ /***************************************************************************** -Copyright (c) 1994, 2015, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2013, 2016, MariaDB Corporation This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -172,7 +173,7 @@ page_t* page_align( /*=======*/ const void* ptr) /*!< in: pointer to page frame */ - __attribute__((const)); + MY_ATTRIBUTE((const)); /************************************************************//** Gets the offset within a page. @return offset from the start of the page */ @@ -181,7 +182,7 @@ ulint page_offset( /*========*/ const void* ptr) /*!< in: pointer to page frame */ - __attribute__((const)); + MY_ATTRIBUTE((const)); /*************************************************************//** Returns the max trx id field value. */ UNIV_INLINE @@ -239,7 +240,7 @@ page_header_get_offs( /*=================*/ const page_t* page, /*!< in: page */ ulint field) /*!< in: PAGE_FREE, ... */ - __attribute__((nonnull, pure)); + MY_ATTRIBUTE((nonnull, pure)); /*************************************************************//** Returns the pointer stored in the given header field, or NULL. */ @@ -299,7 +300,7 @@ page_rec_get_nth_const( /*===================*/ const page_t* page, /*!< in: page */ ulint nth) /*!< in: nth record */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /************************************************************//** Returns the nth record of the record list. This is the inverse function of page_rec_get_n_recs_before(). @@ -310,7 +311,7 @@ page_rec_get_nth( /*=============*/ page_t* page, /*< in: page */ ulint nth) /*!< in: nth record */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); #ifndef UNIV_HOTBACKUP /************************************************************//** @@ -323,7 +324,7 @@ rec_t* page_get_middle_rec( /*================*/ page_t* page) /*!< in: page */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /*************************************************************//** Compares a data tuple to a physical record. Differs from the function cmp_dtuple_rec_with_match in the way that the record must reside on an @@ -536,7 +537,7 @@ bool page_is_leaf( /*=========*/ const page_t* page) /*!< in: page */ - __attribute__((nonnull, pure)); + MY_ATTRIBUTE((nonnull, pure)); #ifndef UNIV_INNOCHECKSUM /************************************************************//** Determine whether the page is empty. @@ -546,7 +547,7 @@ bool page_is_empty( /*==========*/ const page_t* page) /*!< in: page */ - __attribute__((nonnull, pure)); + MY_ATTRIBUTE((nonnull, pure)); /************************************************************//** Determine whether the page contains garbage. @return true if the page contains garbage (PAGE_GARBAGE is not 0) */ @@ -555,7 +556,7 @@ bool page_has_garbage( /*=============*/ const page_t* page) /*!< in: page */ - __attribute__((nonnull, pure)); + MY_ATTRIBUTE((nonnull, pure)); /************************************************************//** Gets the pointer to the next record on the page. @return pointer to next record */ @@ -627,7 +628,7 @@ ibool page_rec_is_user_rec_low( /*=====================*/ ulint offset) /*!< in: record offset on page */ - __attribute__((const)); + MY_ATTRIBUTE((const)); /************************************************************//** TRUE if the record is the supremum record on a page. @return TRUE if the supremum record */ @@ -636,7 +637,7 @@ ibool page_rec_is_supremum_low( /*=====================*/ ulint offset) /*!< in: record offset on page */ - __attribute__((const)); + MY_ATTRIBUTE((const)); /************************************************************//** TRUE if the record is the infimum record on a page. @return TRUE if the infimum record */ @@ -645,7 +646,7 @@ ibool page_rec_is_infimum_low( /*====================*/ ulint offset) /*!< in: record offset on page */ - __attribute__((const)); + MY_ATTRIBUTE((const)); /************************************************************//** TRUE if the record is a user record on the page. @@ -655,7 +656,7 @@ ibool page_rec_is_user_rec( /*=================*/ const rec_t* rec) /*!< in: record */ - __attribute__((const)); + MY_ATTRIBUTE((const)); /************************************************************//** TRUE if the record is the supremum record on a page. @return TRUE if the supremum record */ @@ -664,7 +665,7 @@ ibool page_rec_is_supremum( /*=================*/ const rec_t* rec) /*!< in: record */ - __attribute__((const)); + MY_ATTRIBUTE((const)); /************************************************************//** TRUE if the record is the infimum record on a page. @@ -674,7 +675,7 @@ ibool page_rec_is_infimum( /*================*/ const rec_t* rec) /*!< in: record */ - __attribute__((const)); + MY_ATTRIBUTE((const)); /***************************************************************//** Looks for the record which owns the given record. @return the owner record */ @@ -694,7 +695,7 @@ page_rec_write_field( ulint i, /*!< in: index of the field to update */ ulint val, /*!< in: value to write */ mtr_t* mtr) /*!< in/out: mini-transaction */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); #endif /* !UNIV_HOTBACKUP */ /************************************************************//** Returns the maximum combined size of records which can be inserted on top @@ -724,7 +725,7 @@ ulint page_get_free_space_of_empty( /*=========================*/ ulint comp) /*!< in: nonzero=compact page format */ - __attribute__((const)); + MY_ATTRIBUTE((const)); /**********************************************************//** Returns the base extra size of a physical record. This is the size of the fixed header, independent of the record size. @@ -810,7 +811,7 @@ page_create_zip( ulint level, /*!< in: the B-tree level of the page */ trx_id_t max_trx_id, /*!< in: PAGE_MAX_TRX_ID */ mtr_t* mtr) /*!< in/out: mini-transaction */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /**********************************************************//** Empty a previously created B-tree index page. */ UNIV_INTERN @@ -820,7 +821,7 @@ page_create_empty( buf_block_t* block, /*!< in/out: B-tree block */ dict_index_t* index, /*!< in: the index of the page */ mtr_t* mtr) /*!< in/out: mini-transaction */ - __attribute__((nonnull(1,2))); + MY_ATTRIBUTE((nonnull(1,2))); /*************************************************************//** Differs from page_copy_rec_list_end, because this function does not touch the lock table and max trx id on page or compress the page. @@ -859,7 +860,7 @@ page_copy_rec_list_end( rec_t* rec, /*!< in: record on page */ dict_index_t* index, /*!< in: record descriptor */ mtr_t* mtr) /*!< in: mtr */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /*************************************************************//** Copies records from page to new_page, up to the given record, NOT including that record. Infimum and supremum records are not copied. @@ -881,7 +882,7 @@ page_copy_rec_list_start( rec_t* rec, /*!< in: record on page */ dict_index_t* index, /*!< in: record descriptor */ mtr_t* mtr) /*!< in: mtr */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /*************************************************************//** Deletes records from a page from a given record onward, including that record. The infimum and supremum records are not deleted. */ @@ -898,7 +899,7 @@ page_delete_rec_list_end( records in the end of the chain to delete, or ULINT_UNDEFINED if not known */ mtr_t* mtr) /*!< in: mtr */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /*************************************************************//** Deletes records from page, up to the given record, NOT including that record. Infimum and supremum records are not deleted. */ @@ -910,7 +911,7 @@ page_delete_rec_list_start( buf_block_t* block, /*!< in: buffer block of the page */ dict_index_t* index, /*!< in: record descriptor */ mtr_t* mtr) /*!< in: mtr */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /*************************************************************//** Moves record list end to another page. Moved records include split_rec. @@ -931,7 +932,7 @@ page_move_rec_list_end( rec_t* split_rec, /*!< in: first record to move */ dict_index_t* index, /*!< in: record descriptor */ mtr_t* mtr) /*!< in: mtr */ - __attribute__((nonnull(1, 2, 4, 5))); + MY_ATTRIBUTE((nonnull(1, 2, 4, 5))); /*************************************************************//** Moves record list start to another page. Moved records do not include split_rec. @@ -951,7 +952,7 @@ page_move_rec_list_start( rec_t* split_rec, /*!< in: first record not to move */ dict_index_t* index, /*!< in: record descriptor */ mtr_t* mtr) /*!< in: mtr */ - __attribute__((nonnull(1, 2, 4, 5))); + MY_ATTRIBUTE((nonnull(1, 2, 4, 5))); /****************************************************************//** Splits a directory slot which owns too many records. */ UNIV_INTERN @@ -962,7 +963,7 @@ page_dir_split_slot( page_zip_des_t* page_zip,/*!< in/out: compressed page whose uncompressed part will be written, or NULL */ ulint slot_no)/*!< in: the directory slot */ - __attribute__((nonnull(1))); + MY_ATTRIBUTE((nonnull(1))); /*************************************************************//** Tries to balance the given directory slot with too few records with the upper neighbor, so that there are at least the minimum number @@ -975,7 +976,7 @@ page_dir_balance_slot( page_t* page, /*!< in/out: index page */ page_zip_des_t* page_zip,/*!< in/out: compressed page, or NULL */ ulint slot_no)/*!< in: the directory slot */ - __attribute__((nonnull(1))); + MY_ATTRIBUTE((nonnull(1))); /**********************************************************//** Parses a log record of a record list end or start deletion. @return end of log record or NULL */ diff --git a/storage/innobase/include/page0types.h b/storage/innobase/include/page0types.h index fb9250a5a3b..2892e860875 100644 --- a/storage/innobase/include/page0types.h +++ b/storage/innobase/include/page0types.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1994, 2013, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -131,7 +131,7 @@ page_zip_rec_set_deleted( page_zip_des_t* page_zip,/*!< in/out: compressed page */ const byte* rec, /*!< in: record on the uncompressed page */ ulint flag) /*!< in: the deleted flag (nonzero=TRUE) */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /**********************************************************************//** Write the "owned" flag of a record on a compressed page. The n_owned field @@ -143,7 +143,7 @@ page_zip_rec_set_owned( page_zip_des_t* page_zip,/*!< in/out: compressed page */ const byte* rec, /*!< in: record on the uncompressed page */ ulint flag) /*!< in: the owned flag (nonzero=TRUE) */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /**********************************************************************//** Shift the dense page directory when a record is deleted. */ @@ -156,7 +156,7 @@ page_zip_dir_delete( dict_index_t* index, /*!< in: index of rec */ const ulint* offsets,/*!< in: rec_get_offsets(rec) */ const byte* free) /*!< in: previous start of the free list */ - __attribute__((nonnull(1,2,3,4))); + MY_ATTRIBUTE((nonnull(1,2,3,4))); /**********************************************************************//** Add a slot to the dense page directory. */ @@ -167,5 +167,5 @@ page_zip_dir_add_slot( page_zip_des_t* page_zip, /*!< in/out: compressed page */ ulint is_clustered) /*!< in: nonzero for clustered index, zero for others */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); #endif diff --git a/storage/innobase/include/page0zip.h b/storage/innobase/include/page0zip.h index 0c2abef4b09..4e362cec641 100644 --- a/storage/innobase/include/page0zip.h +++ b/storage/innobase/include/page0zip.h @@ -1,8 +1,9 @@ /***************************************************************************** -Copyright (c) 2005, 2013, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2005, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2012, Facebook Inc. +Copyright (c) 2013, 2016, MariaDB Corporation This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -62,7 +63,7 @@ ulint page_zip_get_size( /*==============*/ const page_zip_des_t* page_zip) /*!< in: compressed page */ - __attribute__((nonnull, pure)); + MY_ATTRIBUTE((nonnull, pure)); /**********************************************************************//** Set the size of a compressed page in bytes. */ UNIV_INLINE @@ -85,7 +86,7 @@ page_zip_rec_needs_ext( ulint n_fields, /*!< in: number of fields in the record; ignored if zip_size == 0 */ ulint zip_size) /*!< in: compressed page size in bytes, or 0 */ - __attribute__((const)); + MY_ATTRIBUTE((const)); /**********************************************************************//** Determine the guaranteed free space on an empty page. @@ -96,7 +97,7 @@ page_zip_empty_size( /*================*/ ulint n_fields, /*!< in: number of columns in the index */ ulint zip_size) /*!< in: compressed page size in bytes */ - __attribute__((const)); + MY_ATTRIBUTE((const)); #endif /* !UNIV_HOTBACKUP */ /**********************************************************************//** @@ -132,7 +133,7 @@ page_zip_compress( dict_index_t* index, /*!< in: index of the B-tree node */ ulint level, /*!< in: compression level */ mtr_t* mtr) /*!< in: mini-transaction, or NULL */ - __attribute__((nonnull(1,2,3))); + MY_ATTRIBUTE((nonnull(1,2,3))); /**********************************************************************//** Decompress a page. This function should tolerate errors on the compressed @@ -150,7 +151,7 @@ page_zip_decompress( FALSE=verify but do not copy some page header fields that should not change after page creation */ - __attribute__((nonnull(1,2))); + MY_ATTRIBUTE((nonnull(1,2))); #ifndef UNIV_INNOCHECKSUM #ifdef UNIV_DEBUG @@ -179,7 +180,7 @@ page_zip_validate_low( const dict_index_t* index, /*!< in: index of the page, if known */ ibool sloppy) /*!< in: FALSE=strict, TRUE=ignore the MIN_REC_FLAG */ - __attribute__((nonnull(1,2))); + MY_ATTRIBUTE((nonnull(1,2))); /**********************************************************************//** Check that the compressed and decompressed pages match. */ UNIV_INTERN @@ -189,7 +190,7 @@ page_zip_validate( const page_zip_des_t* page_zip,/*!< in: compressed page */ const page_t* page, /*!< in: uncompressed page */ const dict_index_t* index) /*!< in: index of the page, if known */ - __attribute__((nonnull(1,2))); + MY_ATTRIBUTE((nonnull(1,2))); #endif /* UNIV_ZIP_DEBUG */ #ifndef UNIV_INNOCHECKSUM @@ -203,7 +204,7 @@ page_zip_max_ins_size( /*==================*/ const page_zip_des_t* page_zip,/*!< in: compressed page */ ibool is_clust)/*!< in: TRUE if clustered index */ - __attribute__((nonnull, pure)); + MY_ATTRIBUTE((nonnull, pure)); /**********************************************************************//** Determine if enough space is available in the modification log. @@ -217,7 +218,7 @@ page_zip_available( ulint length, /*!< in: combined size of the record */ ulint create) /*!< in: nonzero=add the record to the heap */ - __attribute__((nonnull, pure)); + MY_ATTRIBUTE((nonnull, pure)); /**********************************************************************//** Write data to the uncompressed header portion of a page. The data must @@ -230,7 +231,7 @@ page_zip_write_header( const byte* str, /*!< in: address on the uncompressed page */ ulint length, /*!< in: length of the data */ mtr_t* mtr) /*!< in: mini-transaction, or NULL */ - __attribute__((nonnull(1,2))); + MY_ATTRIBUTE((nonnull(1,2))); /**********************************************************************//** Write an entire record on the compressed page. The data must already @@ -244,7 +245,7 @@ page_zip_write_rec( dict_index_t* index, /*!< in: the index the record belongs to */ const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */ ulint create) /*!< in: nonzero=insert, zero=update */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /***********************************************************//** Parses a log record of writing a BLOB pointer of a record. @@ -273,7 +274,7 @@ page_zip_write_blob_ptr( ulint n, /*!< in: column index */ mtr_t* mtr) /*!< in: mini-transaction handle, or NULL if no logging is needed */ - __attribute__((nonnull(1,2,3,4))); + MY_ATTRIBUTE((nonnull(1,2,3,4))); /***********************************************************//** Parses a log record of writing the node pointer of a record. @@ -298,7 +299,7 @@ page_zip_write_node_ptr( ulint size, /*!< in: data size of rec */ ulint ptr, /*!< in: node pointer */ mtr_t* mtr) /*!< in: mini-transaction, or NULL */ - __attribute__((nonnull(1,2))); + MY_ATTRIBUTE((nonnull(1,2))); /**********************************************************************//** Write the trx_id and roll_ptr of a record on a B-tree leaf node page. */ @@ -312,7 +313,7 @@ page_zip_write_trx_id_and_roll_ptr( ulint trx_id_col,/*!< in: column number of TRX_ID in rec */ trx_id_t trx_id, /*!< in: transaction identifier */ roll_ptr_t roll_ptr)/*!< in: roll_ptr */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /**********************************************************************//** Write the "deleted" flag of a record on a compressed page. The flag must @@ -324,7 +325,7 @@ page_zip_rec_set_deleted( page_zip_des_t* page_zip,/*!< in/out: compressed page */ const byte* rec, /*!< in: record on the uncompressed page */ ulint flag) /*!< in: the deleted flag (nonzero=TRUE) */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /**********************************************************************//** Write the "owned" flag of a record on a compressed page. The n_owned field @@ -336,7 +337,7 @@ page_zip_rec_set_owned( page_zip_des_t* page_zip,/*!< in/out: compressed page */ const byte* rec, /*!< in: record on the uncompressed page */ ulint flag) /*!< in: the owned flag (nonzero=TRUE) */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /**********************************************************************//** Insert a record to the dense page directory. */ @@ -363,7 +364,7 @@ page_zip_dir_delete( const ulint* offsets, /*!< in: rec_get_offsets(rec) */ const byte* free) /*!< in: previous start of the free list */ - __attribute__((nonnull(1,2,3,4))); + MY_ATTRIBUTE((nonnull(1,2,3,4))); /**********************************************************************//** Add a slot to the dense page directory. */ @@ -374,7 +375,7 @@ page_zip_dir_add_slot( page_zip_des_t* page_zip, /*!< in/out: compressed page */ ulint is_clustered) /*!< in: nonzero for clustered index, zero for others */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /***********************************************************//** Parses a log record of writing to the header of a page. @@ -402,7 +403,7 @@ page_zip_write_header( const byte* str, /*!< in: address on the uncompressed page */ ulint length, /*!< in: length of the data */ mtr_t* mtr) /*!< in: mini-transaction, or NULL */ - __attribute__((nonnull(1,2))); + MY_ATTRIBUTE((nonnull(1,2))); /**********************************************************************//** Reorganize and compress a page. This is a low-level operation for @@ -425,7 +426,7 @@ page_zip_reorganize( m_start, m_end, m_nonempty */ dict_index_t* index, /*!< in: index of the B-tree node */ mtr_t* mtr) /*!< in: mini-transaction */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); #endif /* !UNIV_INNOCHECKSUM */ #ifndef UNIV_HOTBACKUP @@ -446,7 +447,7 @@ page_zip_copy_recs( const page_t* src, /*!< in: page */ dict_index_t* index, /*!< in: index of the B-tree */ mtr_t* mtr) /*!< in: mini-transaction */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); #endif /* !UNIV_HOTBACKUP */ /**********************************************************************//** @@ -460,7 +461,7 @@ page_zip_parse_compress( byte* end_ptr,/*!< in: buffer end */ page_t* page, /*!< out: uncompressed page */ page_zip_des_t* page_zip)/*!< out: compressed page */ - __attribute__((nonnull(1,2))); + MY_ATTRIBUTE((nonnull(1,2))); /**********************************************************************//** Calculate the compressed page checksum. @@ -472,7 +473,7 @@ page_zip_calc_checksum( const void* data, /*!< in: compressed page */ ulint size, /*!< in: size of compressed page */ srv_checksum_algorithm_t algo) /*!< in: algorithm to use */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /**********************************************************************//** Verify a compressed page's checksum. @@ -508,7 +509,7 @@ page_zip_parse_compress_no_data( page_t* page, /*!< in: uncompressed page */ page_zip_des_t* page_zip, /*!< out: compressed page */ dict_index_t* index) /*!< in: index */ - __attribute__((nonnull(1,2))); + MY_ATTRIBUTE((nonnull(1,2))); /**********************************************************************//** Reset the counters used for filling diff --git a/storage/innobase/include/pars0pars.h b/storage/innobase/include/pars0pars.h index 65ff7533828..73585c78a6a 100644 --- a/storage/innobase/include/pars0pars.h +++ b/storage/innobase/include/pars0pars.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -472,7 +472,7 @@ pars_complete_graph_for_exec( query graph, or NULL for dummy graph */ trx_t* trx, /*!< in: transaction handle */ mem_heap_t* heap) /*!< in: memory heap from which allocated */ - __attribute__((nonnull(2,3), warn_unused_result)); + MY_ATTRIBUTE((nonnull(2,3), warn_unused_result)); /****************************************************************//** Create parser info struct. @@ -628,7 +628,7 @@ pars_info_bind_ull_literal( pars_info_t* info, /*!< in: info struct */ const char* name, /*!< in: name */ const ib_uint64_t* val) /*!< in: value */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /****************************************************************//** Add bound id. */ diff --git a/storage/innobase/include/read0read.h b/storage/innobase/include/read0read.h index 980faddf98e..ae75cfac6f5 100644 --- a/storage/innobase/include/read0read.h +++ b/storage/innobase/include/read0read.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1997, 2012, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1997, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -82,7 +82,7 @@ read_view_sees_trx_id( /*==================*/ const read_view_t* view, /*!< in: read view */ trx_id_t trx_id) /*!< in: trx id */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /*********************************************************************//** Prints a read view to stderr. */ UNIV_INTERN diff --git a/storage/innobase/include/rem0cmp.h b/storage/innobase/include/rem0cmp.h index cb3c85ac2c8..65116229fdc 100644 --- a/storage/innobase/include/rem0cmp.h +++ b/storage/innobase/include/rem0cmp.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1994, 2012, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -174,7 +174,7 @@ cmp_dtuple_rec_with_match_low( bytes within the first field not completely matched; when function returns, contains the value for current comparison */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); #define cmp_dtuple_rec_with_match(tuple,rec,offsets,fields,bytes) \ cmp_dtuple_rec_with_match_low( \ tuple,rec,offsets,dtuple_get_n_fields_cmp(tuple),fields,bytes) @@ -218,7 +218,7 @@ cmp_rec_rec_simple( struct TABLE* table) /*!< in: MySQL table, for reporting duplicate key value if applicable, or NULL */ - __attribute__((nonnull(1,2,3,4), warn_unused_result)); + MY_ATTRIBUTE((nonnull(1,2,3,4), warn_unused_result)); /*************************************************************//** This function is used to compare two physical records. Only the common first fields are compared, and if an externally stored field is diff --git a/storage/innobase/include/rem0rec.h b/storage/innobase/include/rem0rec.h index 22899c2a815..83286a98f8e 100644 --- a/storage/innobase/include/rem0rec.h +++ b/storage/innobase/include/rem0rec.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1994, 2012, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -101,7 +101,7 @@ rec_get_next_ptr_const( /*===================*/ const rec_t* rec, /*!< in: physical record */ ulint comp) /*!< in: nonzero=compact page format */ - __attribute__((nonnull, pure, warn_unused_result)); + MY_ATTRIBUTE((nonnull, pure, warn_unused_result)); /******************************************************//** The following function is used to get the pointer of the next chained record on the same page. @@ -112,7 +112,7 @@ rec_get_next_ptr( /*=============*/ rec_t* rec, /*!< in: physical record */ ulint comp) /*!< in: nonzero=compact page format */ - __attribute__((nonnull, pure, warn_unused_result)); + MY_ATTRIBUTE((nonnull, pure, warn_unused_result)); /******************************************************//** The following function is used to get the offset of the next chained record on the same page. @@ -123,7 +123,7 @@ rec_get_next_offs( /*==============*/ const rec_t* rec, /*!< in: physical record */ ulint comp) /*!< in: nonzero=compact page format */ - __attribute__((nonnull, pure, warn_unused_result)); + MY_ATTRIBUTE((nonnull, pure, warn_unused_result)); /******************************************************//** The following function is used to set the next record offset field of an old-style record. */ @@ -133,7 +133,7 @@ rec_set_next_offs_old( /*==================*/ rec_t* rec, /*!< in: old-style physical record */ ulint next) /*!< in: offset of the next record */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /******************************************************//** The following function is used to set the next record offset field of a new-style record. */ @@ -143,7 +143,7 @@ rec_set_next_offs_new( /*==================*/ rec_t* rec, /*!< in/out: new-style physical record */ ulint next) /*!< in: offset of the next record */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /******************************************************//** The following function is used to get the number of fields in an old-style record. @@ -153,7 +153,7 @@ ulint rec_get_n_fields_old( /*=================*/ const rec_t* rec) /*!< in: physical record */ - __attribute__((nonnull, pure, warn_unused_result)); + MY_ATTRIBUTE((nonnull, pure, warn_unused_result)); /******************************************************//** The following function is used to get the number of fields in a record. @@ -164,7 +164,7 @@ rec_get_n_fields( /*=============*/ const rec_t* rec, /*!< in: physical record */ const dict_index_t* index) /*!< in: record descriptor */ - __attribute__((nonnull, pure, warn_unused_result)); + MY_ATTRIBUTE((nonnull, pure, warn_unused_result)); /******************************************************//** The following function is used to get the number of records owned by the previous directory record. @@ -174,7 +174,7 @@ ulint rec_get_n_owned_old( /*================*/ const rec_t* rec) /*!< in: old-style physical record */ - __attribute__((nonnull, pure, warn_unused_result)); + MY_ATTRIBUTE((nonnull, pure, warn_unused_result)); /******************************************************//** The following function is used to set the number of owned records. */ UNIV_INLINE @@ -183,7 +183,7 @@ rec_set_n_owned_old( /*================*/ rec_t* rec, /*!< in: old-style physical record */ ulint n_owned) /*!< in: the number of owned */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /******************************************************//** The following function is used to get the number of records owned by the previous directory record. @@ -193,7 +193,7 @@ ulint rec_get_n_owned_new( /*================*/ const rec_t* rec) /*!< in: new-style physical record */ - __attribute__((nonnull, pure, warn_unused_result)); + MY_ATTRIBUTE((nonnull, pure, warn_unused_result)); /******************************************************//** The following function is used to set the number of owned records. */ UNIV_INLINE @@ -203,7 +203,7 @@ rec_set_n_owned_new( rec_t* rec, /*!< in/out: new-style physical record */ page_zip_des_t* page_zip,/*!< in/out: compressed page, or NULL */ ulint n_owned)/*!< in: the number of owned */ - __attribute__((nonnull(1))); + MY_ATTRIBUTE((nonnull(1))); /******************************************************//** The following function is used to retrieve the info bits of a record. @@ -214,7 +214,7 @@ rec_get_info_bits( /*==============*/ const rec_t* rec, /*!< in: physical record */ ulint comp) /*!< in: nonzero=compact page format */ - __attribute__((nonnull, pure, warn_unused_result)); + MY_ATTRIBUTE((nonnull, pure, warn_unused_result)); /******************************************************//** The following function is used to set the info bits of a record. */ UNIV_INLINE @@ -223,7 +223,7 @@ rec_set_info_bits_old( /*==================*/ rec_t* rec, /*!< in: old-style physical record */ ulint bits) /*!< in: info bits */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /******************************************************//** The following function is used to set the info bits of a record. */ UNIV_INLINE @@ -232,7 +232,7 @@ rec_set_info_bits_new( /*==================*/ rec_t* rec, /*!< in/out: new-style physical record */ ulint bits) /*!< in: info bits */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /******************************************************//** The following function retrieves the status bits of a new-style record. @return status bits */ @@ -241,7 +241,7 @@ ulint rec_get_status( /*===========*/ const rec_t* rec) /*!< in: physical record */ - __attribute__((nonnull, pure, warn_unused_result)); + MY_ATTRIBUTE((nonnull, pure, warn_unused_result)); /******************************************************//** The following function is used to set the status bits of a new-style record. */ @@ -251,7 +251,7 @@ rec_set_status( /*===========*/ rec_t* rec, /*!< in/out: physical record */ ulint bits) /*!< in: info bits */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /******************************************************//** The following function is used to retrieve the info and status @@ -263,7 +263,7 @@ rec_get_info_and_status_bits( /*=========================*/ const rec_t* rec, /*!< in: physical record */ ulint comp) /*!< in: nonzero=compact page format */ - __attribute__((nonnull, pure, warn_unused_result)); + MY_ATTRIBUTE((nonnull, pure, warn_unused_result)); /******************************************************//** The following function is used to set the info and status bits of a record. (Only compact records have status bits.) */ @@ -273,7 +273,7 @@ rec_set_info_and_status_bits( /*=========================*/ rec_t* rec, /*!< in/out: compact physical record */ ulint bits) /*!< in: info bits */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /******************************************************//** The following function tells if record is delete marked. @@ -284,7 +284,7 @@ rec_get_deleted_flag( /*=================*/ const rec_t* rec, /*!< in: physical record */ ulint comp) /*!< in: nonzero=compact page format */ - __attribute__((nonnull, pure, warn_unused_result)); + MY_ATTRIBUTE((nonnull, pure, warn_unused_result)); /******************************************************//** The following function is used to set the deleted bit. */ UNIV_INLINE @@ -293,7 +293,7 @@ rec_set_deleted_flag_old( /*=====================*/ rec_t* rec, /*!< in: old-style physical record */ ulint flag) /*!< in: nonzero if delete marked */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /******************************************************//** The following function is used to set the deleted bit. */ UNIV_INLINE @@ -303,7 +303,7 @@ rec_set_deleted_flag_new( rec_t* rec, /*!< in/out: new-style physical record */ page_zip_des_t* page_zip,/*!< in/out: compressed page, or NULL */ ulint flag) /*!< in: nonzero if delete marked */ - __attribute__((nonnull(1))); + MY_ATTRIBUTE((nonnull(1))); /******************************************************//** The following function tells if a new-style record is a node pointer. @return TRUE if node pointer */ @@ -312,7 +312,7 @@ ibool rec_get_node_ptr_flag( /*==================*/ const rec_t* rec) /*!< in: physical record */ - __attribute__((nonnull, pure, warn_unused_result)); + MY_ATTRIBUTE((nonnull, pure, warn_unused_result)); /******************************************************//** The following function is used to get the order number of an old-style record in the heap of the index page. @@ -322,7 +322,7 @@ ulint rec_get_heap_no_old( /*================*/ const rec_t* rec) /*!< in: physical record */ - __attribute__((nonnull, pure, warn_unused_result)); + MY_ATTRIBUTE((nonnull, pure, warn_unused_result)); /******************************************************//** The following function is used to set the heap number field in an old-style record. */ @@ -332,7 +332,7 @@ rec_set_heap_no_old( /*================*/ rec_t* rec, /*!< in: physical record */ ulint heap_no)/*!< in: the heap number */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /******************************************************//** The following function is used to get the order number of a new-style record in the heap of the index page. @@ -342,7 +342,7 @@ ulint rec_get_heap_no_new( /*================*/ const rec_t* rec) /*!< in: physical record */ - __attribute__((nonnull, pure, warn_unused_result)); + MY_ATTRIBUTE((nonnull, pure, warn_unused_result)); /******************************************************//** The following function is used to set the heap number field in a new-style record. */ @@ -352,7 +352,7 @@ rec_set_heap_no_new( /*================*/ rec_t* rec, /*!< in/out: physical record */ ulint heap_no)/*!< in: the heap number */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /******************************************************//** The following function is used to test whether the data offsets in the record are stored in one-byte or two-byte format. @@ -362,7 +362,7 @@ ibool rec_get_1byte_offs_flag( /*====================*/ const rec_t* rec) /*!< in: physical record */ - __attribute__((nonnull, pure, warn_unused_result)); + MY_ATTRIBUTE((nonnull, pure, warn_unused_result)); /******************************************************//** The following function is used to set the 1-byte offsets flag. */ @@ -372,7 +372,7 @@ rec_set_1byte_offs_flag( /*====================*/ rec_t* rec, /*!< in: physical record */ ibool flag) /*!< in: TRUE if 1byte form */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /******************************************************//** Returns the offset of nth field end if the record is stored in the 1-byte @@ -385,7 +385,7 @@ rec_1_get_field_end_info( /*=====================*/ const rec_t* rec, /*!< in: record */ ulint n) /*!< in: field index */ - __attribute__((nonnull, pure, warn_unused_result)); + MY_ATTRIBUTE((nonnull, pure, warn_unused_result)); /******************************************************//** Returns the offset of nth field end if the record is stored in the 2-byte @@ -399,7 +399,7 @@ rec_2_get_field_end_info( /*=====================*/ const rec_t* rec, /*!< in: record */ ulint n) /*!< in: field index */ - __attribute__((nonnull, pure, warn_unused_result)); + MY_ATTRIBUTE((nonnull, pure, warn_unused_result)); /******************************************************//** Returns nonzero if the field is stored off-page. @@ -411,7 +411,7 @@ rec_2_is_field_extern( /*==================*/ const rec_t* rec, /*!< in: record */ ulint n) /*!< in: field index */ - __attribute__((nonnull, pure, warn_unused_result)); + MY_ATTRIBUTE((nonnull, pure, warn_unused_result)); /******************************************************//** Determine how many of the first n columns in a compact @@ -424,7 +424,7 @@ rec_get_n_extern_new( const rec_t* rec, /*!< in: compact physical record */ const dict_index_t* index, /*!< in: record descriptor */ ulint n) /*!< in: number of columns to scan */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /******************************************************//** The following function determines the offsets to each field @@ -449,9 +449,9 @@ rec_get_offsets_func( #endif /* UNIV_DEBUG */ mem_heap_t** heap) /*!< in/out: memory heap */ #ifdef UNIV_DEBUG - __attribute__((nonnull(1,2,5,7),warn_unused_result)); + MY_ATTRIBUTE((nonnull(1,2,5,7),warn_unused_result)); #else /* UNIV_DEBUG */ - __attribute__((nonnull(1,2,5),warn_unused_result)); + MY_ATTRIBUTE((nonnull(1,2,5),warn_unused_result)); #endif /* UNIV_DEBUG */ #ifdef UNIV_DEBUG @@ -478,7 +478,7 @@ rec_get_offsets_reverse( 0=leaf node */ ulint* offsets)/*!< in/out: array consisting of offsets[0] allocated elements */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); #ifdef UNIV_DEBUG /************************************************************//** Validates offsets returned by rec_get_offsets(). @@ -491,7 +491,7 @@ rec_offs_validate( const dict_index_t* index, /*!< in: record descriptor or NULL */ const ulint* offsets)/*!< in: array returned by rec_get_offsets() */ - __attribute__((nonnull(3), warn_unused_result)); + MY_ATTRIBUTE((nonnull(3), warn_unused_result)); /************************************************************//** Updates debug data in offsets, in order to avoid bogus rec_offs_validate() failures. */ @@ -503,7 +503,7 @@ rec_offs_make_valid( const dict_index_t* index, /*!< in: record descriptor */ ulint* offsets)/*!< in: array returned by rec_get_offsets() */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); #else # define rec_offs_make_valid(rec, index, offsets) ((void) 0) #endif /* UNIV_DEBUG */ @@ -520,7 +520,7 @@ rec_get_nth_field_offs_old( ulint n, /*!< in: index of the field */ ulint* len) /*!< out: length of the field; UNIV_SQL_NULL if SQL null */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); #define rec_get_nth_field_old(rec, n, len) \ ((rec) + rec_get_nth_field_offs_old(rec, n, len)) /************************************************************//** @@ -534,7 +534,7 @@ rec_get_nth_field_size( /*===================*/ const rec_t* rec, /*!< in: record */ ulint n) /*!< in: index of the field */ - __attribute__((nonnull, pure, warn_unused_result)); + MY_ATTRIBUTE((nonnull, pure, warn_unused_result)); /************************************************************//** The following function is used to get an offset to the nth data field in a record. @@ -547,7 +547,7 @@ rec_get_nth_field_offs( ulint n, /*!< in: index of the field */ ulint* len) /*!< out: length of the field; UNIV_SQL_NULL if SQL null */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); #define rec_get_nth_field(rec, offsets, n, len) \ ((rec) + rec_get_nth_field_offs(offsets, n, len)) /******************************************************//** @@ -559,7 +559,7 @@ ulint rec_offs_comp( /*==========*/ const ulint* offsets)/*!< in: array returned by rec_get_offsets() */ - __attribute__((nonnull, pure, warn_unused_result)); + MY_ATTRIBUTE((nonnull, pure, warn_unused_result)); /******************************************************//** Determine if the offsets are for a record containing externally stored columns. @@ -569,7 +569,7 @@ ulint rec_offs_any_extern( /*================*/ const ulint* offsets)/*!< in: array returned by rec_get_offsets() */ - __attribute__((nonnull, pure, warn_unused_result)); + MY_ATTRIBUTE((nonnull, pure, warn_unused_result)); /******************************************************//** Determine if the offsets are for a record containing null BLOB pointers. @return first field containing a null BLOB pointer, or NULL if none found */ @@ -579,7 +579,7 @@ rec_offs_any_null_extern( /*=====================*/ const rec_t* rec, /*!< in: record */ const ulint* offsets) /*!< in: rec_get_offsets(rec) */ - __attribute__((nonnull, pure, warn_unused_result)); + MY_ATTRIBUTE((nonnull, pure, warn_unused_result)); /******************************************************//** Returns nonzero if the extern bit is set in nth field of rec. @return nonzero if externally stored */ @@ -589,7 +589,7 @@ rec_offs_nth_extern( /*================*/ const ulint* offsets,/*!< in: array returned by rec_get_offsets() */ ulint n) /*!< in: nth field */ - __attribute__((nonnull, pure, warn_unused_result)); + MY_ATTRIBUTE((nonnull, pure, warn_unused_result)); /******************************************************//** Returns nonzero if the SQL NULL bit is set in nth field of rec. @return nonzero if SQL NULL */ @@ -599,7 +599,7 @@ rec_offs_nth_sql_null( /*==================*/ const ulint* offsets,/*!< in: array returned by rec_get_offsets() */ ulint n) /*!< in: nth field */ - __attribute__((nonnull, pure, warn_unused_result)); + MY_ATTRIBUTE((nonnull, pure, warn_unused_result)); /******************************************************//** Gets the physical size of a field. @return length of field */ @@ -609,7 +609,7 @@ rec_offs_nth_size( /*==============*/ const ulint* offsets,/*!< in: array returned by rec_get_offsets() */ ulint n) /*!< in: nth field */ - __attribute__((nonnull, pure, warn_unused_result)); + MY_ATTRIBUTE((nonnull, pure, warn_unused_result)); /******************************************************//** Returns the number of extern bits set in a record. @@ -619,7 +619,7 @@ ulint rec_offs_n_extern( /*==============*/ const ulint* offsets)/*!< in: array returned by rec_get_offsets() */ - __attribute__((nonnull, pure, warn_unused_result)); + MY_ATTRIBUTE((nonnull, pure, warn_unused_result)); /***********************************************************//** This is used to modify the value of an already existing field in a record. The previous value must have exactly the same size as the new value. If len @@ -639,7 +639,7 @@ rec_set_nth_field( length as the previous value. If SQL null, previous value must be SQL null. */ - __attribute__((nonnull(1,2))); + MY_ATTRIBUTE((nonnull(1,2))); /**********************************************************//** The following function returns the data size of an old-style physical record, that is the sum of field lengths. SQL null fields @@ -651,7 +651,7 @@ ulint rec_get_data_size_old( /*==================*/ const rec_t* rec) /*!< in: physical record */ - __attribute__((nonnull, pure, warn_unused_result)); + MY_ATTRIBUTE((nonnull, pure, warn_unused_result)); /**********************************************************//** The following function returns the number of allocated elements for an array of offsets. @@ -661,7 +661,7 @@ ulint rec_offs_get_n_alloc( /*=================*/ const ulint* offsets)/*!< in: array for rec_get_offsets() */ - __attribute__((nonnull, pure, warn_unused_result)); + MY_ATTRIBUTE((nonnull, pure, warn_unused_result)); /**********************************************************//** The following function sets the number of allocated elements for an array of offsets. */ @@ -672,7 +672,7 @@ rec_offs_set_n_alloc( ulint* offsets, /*!< out: array for rec_get_offsets(), must be allocated */ ulint n_alloc) /*!< in: number of elements */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); #define rec_offs_init(offsets) \ rec_offs_set_n_alloc(offsets, (sizeof offsets) / sizeof *offsets) /**********************************************************//** @@ -683,7 +683,7 @@ ulint rec_offs_n_fields( /*==============*/ const ulint* offsets)/*!< in: array returned by rec_get_offsets() */ - __attribute__((nonnull, pure, warn_unused_result)); + MY_ATTRIBUTE((nonnull, pure, warn_unused_result)); /**********************************************************//** The following function returns the data size of a physical record, that is the sum of field lengths. SQL null fields @@ -695,7 +695,7 @@ ulint rec_offs_data_size( /*===============*/ const ulint* offsets)/*!< in: array returned by rec_get_offsets() */ - __attribute__((nonnull, pure, warn_unused_result)); + MY_ATTRIBUTE((nonnull, pure, warn_unused_result)); /**********************************************************//** Returns the total size of record minus data size of record. The value returned by the function is the distance from record @@ -706,7 +706,7 @@ ulint rec_offs_extra_size( /*================*/ const ulint* offsets)/*!< in: array returned by rec_get_offsets() */ - __attribute__((nonnull, pure, warn_unused_result)); + MY_ATTRIBUTE((nonnull, pure, warn_unused_result)); /**********************************************************//** Returns the total size of a physical record. @return size */ @@ -715,7 +715,7 @@ ulint rec_offs_size( /*==========*/ const ulint* offsets)/*!< in: array returned by rec_get_offsets() */ - __attribute__((nonnull, pure, warn_unused_result)); + MY_ATTRIBUTE((nonnull, pure, warn_unused_result)); #ifdef UNIV_DEBUG /**********************************************************//** Returns a pointer to the start of the record. @@ -726,7 +726,7 @@ rec_get_start( /*==========*/ const rec_t* rec, /*!< in: pointer to record */ const ulint* offsets)/*!< in: array returned by rec_get_offsets() */ - __attribute__((nonnull, pure, warn_unused_result)); + MY_ATTRIBUTE((nonnull, pure, warn_unused_result)); /**********************************************************//** Returns a pointer to the end of the record. @return pointer to end */ @@ -736,7 +736,7 @@ rec_get_end( /*========*/ const rec_t* rec, /*!< in: pointer to record */ const ulint* offsets)/*!< in: array returned by rec_get_offsets() */ - __attribute__((nonnull, pure, warn_unused_result)); + MY_ATTRIBUTE((nonnull, pure, warn_unused_result)); #else /* UNIV_DEBUG */ # define rec_get_start(rec, offsets) ((rec) - rec_offs_extra_size(offsets)) # define rec_get_end(rec, offsets) ((rec) + rec_offs_data_size(offsets)) @@ -751,7 +751,7 @@ rec_copy( void* buf, /*!< in: buffer */ const rec_t* rec, /*!< in: physical record */ const ulint* offsets)/*!< in: array returned by rec_get_offsets() */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); #ifndef UNIV_HOTBACKUP /**********************************************************//** Determines the size of a data tuple prefix in a temporary file. @@ -764,7 +764,7 @@ rec_get_converted_size_temp( const dfield_t* fields, /*!< in: array of data fields */ ulint n_fields,/*!< in: number of data fields */ ulint* extra) /*!< out: extra size */ - __attribute__((warn_unused_result, nonnull)); + MY_ATTRIBUTE((warn_unused_result, nonnull)); /******************************************************//** Determine the offset to each field in temporary file. @@ -777,7 +777,7 @@ rec_init_offsets_temp( const dict_index_t* index, /*!< in: record descriptor */ ulint* offsets)/*!< in/out: array of offsets; in: n=rec_offs_n_fields(offsets) */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /*********************************************************//** Builds a temporary file record out of a data tuple. @@ -790,7 +790,7 @@ rec_convert_dtuple_to_temp( const dict_index_t* index, /*!< in: record descriptor */ const dfield_t* fields, /*!< in: array of data fields */ ulint n_fields) /*!< in: number of fields */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /**************************************************************//** Copies the first n fields of a physical record to a new physical record in @@ -808,7 +808,7 @@ rec_copy_prefix_to_buf( for the copied prefix, or NULL */ ulint* buf_size) /*!< in/out: buffer size */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /************************************************************//** Folds a prefix of a physical record to a ulint. @return the folded value */ @@ -824,7 +824,7 @@ rec_fold( ulint n_bytes, /*!< in: number of bytes to fold in an incomplete last field */ index_id_t tree_id) /*!< in: index tree id */ - __attribute__((nonnull, pure, warn_unused_result)); + MY_ATTRIBUTE((nonnull, pure, warn_unused_result)); #endif /* !UNIV_HOTBACKUP */ /*********************************************************//** Builds a physical record out of a data tuple and @@ -840,7 +840,7 @@ rec_convert_dtuple_to_rec( const dtuple_t* dtuple, /*!< in: data tuple */ ulint n_ext) /*!< in: number of externally stored columns */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /**********************************************************//** Returns the extra size of an old-style physical record if we know its data size and number of fields. @@ -852,7 +852,7 @@ rec_get_converted_extra_size( ulint data_size, /*!< in: data size */ ulint n_fields, /*!< in: number of fields */ ulint n_ext) /*!< in: number of externally stored columns */ - __attribute__((const)); + MY_ATTRIBUTE((const)); /**********************************************************//** Determines the size of a data tuple prefix in ROW_FORMAT=COMPACT. @return total size */ @@ -864,7 +864,7 @@ rec_get_converted_size_comp_prefix( const dfield_t* fields, /*!< in: array of data fields */ ulint n_fields,/*!< in: number of data fields */ ulint* extra) /*!< out: extra size */ - __attribute__((warn_unused_result, nonnull(1,2))); + MY_ATTRIBUTE((warn_unused_result, nonnull(1,2))); /**********************************************************//** Determines the size of a data tuple in ROW_FORMAT=COMPACT. @return total size */ @@ -880,7 +880,7 @@ rec_get_converted_size_comp( const dfield_t* fields, /*!< in: array of data fields */ ulint n_fields,/*!< in: number of data fields */ ulint* extra) /*!< out: extra size */ - __attribute__((nonnull(1,3))); + MY_ATTRIBUTE((nonnull(1,3))); /**********************************************************//** The following function returns the size of a data tuple when converted to a physical record. @@ -892,7 +892,7 @@ rec_get_converted_size( dict_index_t* index, /*!< in: record descriptor */ const dtuple_t* dtuple, /*!< in: data tuple */ ulint n_ext) /*!< in: number of externally stored columns */ - __attribute__((warn_unused_result, nonnull)); + MY_ATTRIBUTE((warn_unused_result, nonnull)); #ifndef UNIV_HOTBACKUP /**************************************************************//** Copies the first n fields of a physical record to a data tuple. @@ -907,7 +907,7 @@ rec_copy_prefix_to_dtuple( ulint n_fields, /*!< in: number of fields to copy */ mem_heap_t* heap) /*!< in: memory heap */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); #endif /* !UNIV_HOTBACKUP */ /***************************************************************//** Validates the consistency of a physical record. @@ -918,7 +918,7 @@ rec_validate( /*=========*/ const rec_t* rec, /*!< in: physical record */ const ulint* offsets)/*!< in: array returned by rec_get_offsets() */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /***************************************************************//** Prints an old-style physical record. */ UNIV_INTERN @@ -927,7 +927,7 @@ rec_print_old( /*==========*/ FILE* file, /*!< in: file where to print */ const rec_t* rec) /*!< in: physical record */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); #ifndef UNIV_HOTBACKUP /***************************************************************//** Prints a physical record in ROW_FORMAT=COMPACT. Ignores the @@ -939,7 +939,7 @@ rec_print_comp( FILE* file, /*!< in: file where to print */ const rec_t* rec, /*!< in: physical record */ const ulint* offsets)/*!< in: array returned by rec_get_offsets() */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /***************************************************************//** Prints a physical record. */ UNIV_INTERN @@ -949,7 +949,7 @@ rec_print_new( FILE* file, /*!< in: file where to print */ const rec_t* rec, /*!< in: physical record */ const ulint* offsets)/*!< in: array returned by rec_get_offsets() */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /***************************************************************//** Prints a physical record. */ UNIV_INTERN @@ -959,7 +959,7 @@ rec_print( FILE* file, /*!< in: file where to print */ const rec_t* rec, /*!< in: physical record */ const dict_index_t* index) /*!< in: record descriptor */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); # ifdef UNIV_DEBUG /************************************************************//** @@ -971,7 +971,7 @@ rec_get_trx_id( /*===========*/ const rec_t* rec, /*!< in: record */ const dict_index_t* index) /*!< in: clustered index */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); # endif /* UNIV_DEBUG */ #endif /* UNIV_HOTBACKUP */ diff --git a/storage/innobase/include/rem0rec.ic b/storage/innobase/include/rem0rec.ic index a539320dd2a..5811a77a48b 100644 --- a/storage/innobase/include/rem0rec.ic +++ b/storage/innobase/include/rem0rec.ic @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1994, 2013, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -1540,7 +1540,8 @@ rec_copy( ulint extra_len; ulint data_len; - ut_ad(rec && buf); + ut_ad(rec != NULL); + ut_ad(buf != NULL); ut_ad(rec_offs_validate(rec, NULL, offsets)); ut_ad(rec_validate(rec, offsets)); diff --git a/storage/innobase/include/row0ftsort.h b/storage/innobase/include/row0ftsort.h index eeef10f3397..00bd3317de3 100644 --- a/storage/innobase/include/row0ftsort.h +++ b/storage/innobase/include/row0ftsort.h @@ -1,7 +1,7 @@ /***************************************************************************** -Copyright (c) 2010, 2012, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2015, MariaDB Corporation. +Copyright (c) 2010, 2016, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2015, 2016, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -193,7 +193,7 @@ row_fts_psort_info_init( instantiated */ fts_psort_t** merge) /*!< out: parallel merge info to be instantiated */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /********************************************************************//** Clean up and deallocate FTS parallel sort structures, and close temparary merge sort files */ @@ -281,5 +281,5 @@ row_fts_merge_insert( fts_psort_t* psort_info, /*!< parallel sort info */ ulint id) /* !< in: which auxiliary table's data to insert to */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); #endif /* row0ftsort_h */ diff --git a/storage/innobase/include/row0import.h b/storage/innobase/include/row0import.h index aa46fdb7c27..a821c230a3b 100644 --- a/storage/innobase/include/row0import.h +++ b/storage/innobase/include/row0import.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2012, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2012, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -46,7 +46,7 @@ row_import_for_mysql( dict_table_t* table, /*!< in/out: table */ row_prebuilt_t* prebuilt) /*!< in: prebuilt struct in MySQL */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /*****************************************************************//** Update the DICT_TF2_DISCARDED flag in SYS_TABLES. @@ -64,7 +64,7 @@ row_import_update_discarded_flag( bool dict_locked) /*!< in: Set to true if the caller already owns the dict_sys_t:: mutex. */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /*****************************************************************//** Update the (space, root page) of a table's indexes from the values @@ -83,7 +83,7 @@ row_import_update_index_root( bool dict_locked) /*!< in: Set to true if the caller already owns the dict_sys_t:: mutex. */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); #ifndef UNIV_NONINL #include "row0import.ic" #endif diff --git a/storage/innobase/include/row0ins.h b/storage/innobase/include/row0ins.h index 2a892d2f5df..71ee39070ef 100644 --- a/storage/innobase/include/row0ins.h +++ b/storage/innobase/include/row0ins.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -53,7 +53,7 @@ row_ins_check_foreign_constraint( table, else the referenced table */ dtuple_t* entry, /*!< in: index entry for index */ que_thr_t* thr) /*!< in: query thread */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /*********************************************************************//** Creates an insert node struct. @return own: insert node struct */ @@ -98,7 +98,7 @@ row_ins_clust_index_entry_low( dtuple_t* entry, /*!< in/out: index entry to insert */ ulint n_ext, /*!< in: number of externally stored columns */ que_thr_t* thr) /*!< in: query thread or NULL */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /***************************************************************//** Tries to insert an entry into a secondary index. If a record with exactly the same fields is found, the other record is necessarily marked deleted. @@ -123,7 +123,7 @@ row_ins_sec_index_entry_low( trx_id_t trx_id, /*!< in: PAGE_MAX_TRX_ID during row_log_table_apply(), or 0 */ que_thr_t* thr) /*!< in: query thread */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /***************************************************************//** Tries to insert the externally stored fields (off-page columns) of a clustered index entry. @@ -142,7 +142,7 @@ row_ins_index_entry_big_rec_func( const void* thd, /*!< in: connection, or NULL */ #endif /* DBUG_OFF */ ulint line) /*!< in: line number of caller */ - __attribute__((nonnull(1,2,3,4,5,6), warn_unused_result)); + MY_ATTRIBUTE((nonnull(1,2,3,4,5,6), warn_unused_result)); #ifdef DBUG_OFF # define row_ins_index_entry_big_rec(e,big,ofs,heap,index,thd,file,line) \ row_ins_index_entry_big_rec_func(e,big,ofs,heap,index,file,line) @@ -164,7 +164,7 @@ row_ins_clust_index_entry( dtuple_t* entry, /*!< in/out: index entry to insert */ que_thr_t* thr, /*!< in: query thread */ ulint n_ext) /*!< in: number of externally stored columns */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /***************************************************************//** Inserts an entry into a secondary index. Tries first optimistic, then pessimistic descent down the tree. If the entry matches enough @@ -178,7 +178,7 @@ row_ins_sec_index_entry( dict_index_t* index, /*!< in: secondary index */ dtuple_t* entry, /*!< in/out: index entry to insert */ que_thr_t* thr) /*!< in: query thread */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /***********************************************************//** Inserts a row to a table. This is a high-level function used in SQL execution graphs. diff --git a/storage/innobase/include/row0log.h b/storage/innobase/include/row0log.h index e127504c484..5ff148ff045 100644 --- a/storage/innobase/include/row0log.h +++ b/storage/innobase/include/row0log.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2011, 2015, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2011, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -58,7 +58,7 @@ row_log_allocate( const ulint* col_map,/*!< in: mapping of old column numbers to new ones, or NULL if !table */ const char* path) /*!< in: where to create temporary file */ - __attribute__((nonnull(1), warn_unused_result)); + MY_ATTRIBUTE((nonnull(1), warn_unused_result)); /******************************************************//** Free the row log for an index that was being created online. */ @@ -67,7 +67,7 @@ void row_log_free( /*=========*/ row_log_t*& log) /*!< in,own: row log */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /******************************************************//** Free the row log for an index on which online creation was aborted. */ @@ -76,7 +76,7 @@ void row_log_abort_sec( /*==============*/ dict_index_t* index) /*!< in/out: index (x-latched) */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /******************************************************//** Try to log an operation to a secondary index that is @@ -91,7 +91,7 @@ row_log_online_op_try( const dtuple_t* tuple, /*!< in: index tuple */ trx_id_t trx_id) /*!< in: transaction ID for insert, or 0 for delete */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /******************************************************//** Logs an operation to a secondary index that is (or was) being created. */ UNIV_INTERN @@ -102,7 +102,7 @@ row_log_online_op( const dtuple_t* tuple, /*!< in: index tuple */ trx_id_t trx_id) /*!< in: transaction ID for insert, or 0 for delete */ - UNIV_COLD __attribute__((nonnull)); + UNIV_COLD MY_ATTRIBUTE((nonnull)); /******************************************************//** Gets the error status of the online index rebuild log. @@ -113,7 +113,7 @@ row_log_table_get_error( /*====================*/ const dict_index_t* index) /*!< in: clustered index of a table that is being rebuilt online */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /******************************************************//** Logs a delete operation to a table that is being rebuilt. @@ -129,7 +129,7 @@ row_log_table_delete( const ulint* offsets,/*!< in: rec_get_offsets(rec,index) */ const byte* sys) /*!< in: DB_TRX_ID,DB_ROLL_PTR that should be logged, or NULL to use those in rec */ - UNIV_COLD __attribute__((nonnull(1,2,3))); + UNIV_COLD MY_ATTRIBUTE((nonnull(1,2,3))); /******************************************************//** Logs an update operation to a table that is being rebuilt. @@ -145,7 +145,7 @@ row_log_table_update( const ulint* offsets,/*!< in: rec_get_offsets(rec,index) */ const dtuple_t* old_pk) /*!< in: row_log_table_get_pk() before the update */ - UNIV_COLD __attribute__((nonnull(1,2,3))); + UNIV_COLD MY_ATTRIBUTE((nonnull(1,2,3))); /******************************************************//** Constructs the old PRIMARY KEY and DB_TRX_ID,DB_ROLL_PTR @@ -165,7 +165,7 @@ row_log_table_get_pk( byte* sys, /*!< out: DB_TRX_ID,DB_ROLL_PTR for row_log_table_delete(), or NULL */ mem_heap_t** heap) /*!< in/out: memory heap where allocated */ - UNIV_COLD __attribute__((nonnull(1,2,5), warn_unused_result)); + UNIV_COLD MY_ATTRIBUTE((nonnull(1,2,5), warn_unused_result)); /******************************************************//** Logs an insert to a table that is being rebuilt. @@ -179,7 +179,7 @@ row_log_table_insert( dict_index_t* index, /*!< in/out: clustered index, S-latched or X-latched */ const ulint* offsets)/*!< in: rec_get_offsets(rec,index) */ - UNIV_COLD __attribute__((nonnull)); + UNIV_COLD MY_ATTRIBUTE((nonnull)); /******************************************************//** Notes that a BLOB is being freed during online ALTER TABLE. */ UNIV_INTERN @@ -188,7 +188,7 @@ row_log_table_blob_free( /*====================*/ dict_index_t* index, /*!< in/out: clustered index, X-latched */ ulint page_no)/*!< in: starting page number of the BLOB */ - UNIV_COLD __attribute__((nonnull)); + UNIV_COLD MY_ATTRIBUTE((nonnull)); /******************************************************//** Notes that a BLOB is being allocated during online ALTER TABLE. */ UNIV_INTERN @@ -197,7 +197,7 @@ row_log_table_blob_alloc( /*=====================*/ dict_index_t* index, /*!< in/out: clustered index, X-latched */ ulint page_no)/*!< in: starting page number of the BLOB */ - UNIV_COLD __attribute__((nonnull)); + UNIV_COLD MY_ATTRIBUTE((nonnull)); /******************************************************//** Apply the row_log_table log to a table upon completing rebuild. @return DB_SUCCESS, or error code on failure */ @@ -210,7 +210,7 @@ row_log_table_apply( /*!< in: old table */ struct TABLE* table) /*!< in/out: MySQL table (for reporting duplicates) */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /******************************************************//** Get the latest transaction ID that has invoked row_log_online_op() @@ -221,7 +221,7 @@ trx_id_t row_log_get_max_trx( /*================*/ dict_index_t* index) /*!< in: index, must be locked */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /******************************************************//** Merge the row log to the index upon completing index creation. @@ -235,7 +235,7 @@ row_log_apply( dict_index_t* index, /*!< in/out: secondary index */ struct TABLE* table) /*!< in/out: MySQL table (for reporting duplicates) */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); #ifndef UNIV_NONINL #include "row0log.ic" diff --git a/storage/innobase/include/row0merge.h b/storage/innobase/include/row0merge.h index 53164b5197f..04d4010ad48 100644 --- a/storage/innobase/include/row0merge.h +++ b/storage/innobase/include/row0merge.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2005, 2015, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2005, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2015, 2016, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under @@ -144,7 +144,7 @@ row_merge_dup_report( /*=================*/ row_merge_dup_t* dup, /*!< in/out: for reporting duplicates */ const dfield_t* entry) /*!< in: duplicate index entry */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /*********************************************************************//** Sets an exclusive lock on a table, for the duration of creating indexes. @return error code or DB_SUCCESS */ @@ -155,7 +155,7 @@ row_merge_lock_table( trx_t* trx, /*!< in/out: transaction */ dict_table_t* table, /*!< in: table to lock */ enum lock_mode mode) /*!< in: LOCK_X or LOCK_S */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /*********************************************************************//** Drop indexes that were created before an error occurred. The data dictionary must have been locked exclusively by the caller, @@ -166,7 +166,7 @@ row_merge_drop_indexes_dict( /*========================*/ trx_t* trx, /*!< in/out: dictionary transaction */ table_id_t table_id)/*!< in: table identifier */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /*********************************************************************//** Drop those indexes which were created before an error occurred. The data dictionary must have been locked exclusively by the caller, @@ -179,7 +179,7 @@ row_merge_drop_indexes( dict_table_t* table, /*!< in/out: table containing the indexes */ ibool locked) /*!< in: TRUE=table locked, FALSE=may need to do a lazy drop */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /*********************************************************************//** Drop all partially created indexes during crash recovery. */ UNIV_INTERN @@ -195,7 +195,7 @@ UNIV_INTERN int row_merge_file_create_low( const char* path) - __attribute__((warn_unused_result)); + MY_ATTRIBUTE((warn_unused_result)); /*********************************************************************//** Destroy a merge file. And de-register the file from Performance Schema if UNIV_PFS_IO is defined. */ @@ -231,7 +231,7 @@ row_merge_rename_tables_dict( old_table->name */ const char* tmp_name, /*!< in: new name for old_table */ trx_t* trx) /*!< in/out: dictionary transaction */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /*********************************************************************//** Rename an index in the dictionary that was created. The data @@ -245,7 +245,7 @@ row_merge_rename_index_to_add( trx_t* trx, /*!< in/out: transaction */ table_id_t table_id, /*!< in: table identifier */ index_id_t index_id) /*!< in: index identifier */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /*********************************************************************//** Rename an index in the dictionary that is to be dropped. The data dictionary must have been locked exclusively by the caller, because @@ -258,7 +258,7 @@ row_merge_rename_index_to_drop( trx_t* trx, /*!< in/out: transaction */ table_id_t table_id, /*!< in: table identifier */ index_id_t index_id) /*!< in: index identifier */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /*********************************************************************//** Create the index and load in to the dictionary. @return index, or NULL on error */ @@ -294,7 +294,7 @@ row_merge_drop_table( /*=================*/ trx_t* trx, /*!< in: transaction */ dict_table_t* table) /*!< in: table instance to drop */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /*********************************************************************//** Build indexes on a table by reading a clustered index, creating a temporary file containing index entries, merge sorting @@ -327,7 +327,7 @@ row_merge_build_indexes( AUTO_INCREMENT column, or ULINT_UNDEFINED if none is added */ ib_sequence_t& sequence) /*!< in/out: autoinc sequence */ - __attribute__((nonnull(1,2,3,5,6,8), warn_unused_result)); + MY_ATTRIBUTE((nonnull(1,2,3,5,6,8), warn_unused_result)); /********************************************************************//** Write a buffer to a block. */ UNIV_INTERN @@ -337,7 +337,7 @@ row_merge_buf_write( const row_merge_buf_t* buf, /*!< in: sorted buffer */ const merge_file_t* of, /*!< in: output file */ row_merge_block_t* block) /*!< out: buffer for writing to file */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /********************************************************************//** Sort a buffer. */ UNIV_INTERN @@ -347,7 +347,7 @@ row_merge_buf_sort( row_merge_buf_t* buf, /*!< in/out: sort buffer */ row_merge_dup_t* dup) /*!< in/out: reporter of duplicates (NULL if non-unique index) */ - __attribute__((nonnull(1))); + MY_ATTRIBUTE((nonnull(1))); /********************************************************************//** Write a merge block to the file system. @return TRUE if request was successful, FALSE if fail */ @@ -371,7 +371,7 @@ row_merge_buf_t* row_merge_buf_empty( /*================*/ row_merge_buf_t* buf) /*!< in,own: sort buffer */ - __attribute__((warn_unused_result, nonnull)); + MY_ATTRIBUTE((warn_unused_result, nonnull)); /** Create a merge file in the given location. @param[out] merge_file merge file structure @@ -412,7 +412,7 @@ row_merge_buf_t* row_merge_buf_create( /*=================*/ dict_index_t* index) /*!< in: secondary index */ - __attribute__((warn_unused_result, nonnull, malloc)); + MY_ATTRIBUTE((warn_unused_result, nonnull, malloc)); /*********************************************************************//** Deallocate a sort buffer. */ UNIV_INTERN @@ -420,7 +420,7 @@ void row_merge_buf_free( /*===============*/ row_merge_buf_t* buf) /*!< in,own: sort buffer to be freed */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /*********************************************************************//** Destroy a merge file. */ UNIV_INTERN @@ -428,7 +428,7 @@ void row_merge_file_destroy( /*===================*/ merge_file_t* merge_file) /*!< in/out: merge file structure */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /********************************************************************//** Read a merge block from the file system. @return TRUE if request was successful, FALSE if fail */ diff --git a/storage/innobase/include/row0mysql.h b/storage/innobase/include/row0mysql.h index 7fda64e21b7..71e3b9bb19e 100644 --- a/storage/innobase/include/row0mysql.h +++ b/storage/innobase/include/row0mysql.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2000, 2012, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2000, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -168,7 +168,7 @@ row_mysql_handle_errors( trx_t* trx, /*!< in: transaction */ que_thr_t* thr, /*!< in: query thread, or NULL */ trx_savept_t* savept) /*!< in: savepoint, or NULL */ - __attribute__((nonnull(1,2))); + MY_ATTRIBUTE((nonnull(1,2))); /********************************************************************//** Create a prebuilt struct for a MySQL table handle. @return own: a prebuilt struct */ @@ -210,7 +210,7 @@ row_lock_table_autoinc_for_mysql( /*=============================*/ row_prebuilt_t* prebuilt) /*!< in: prebuilt struct in the MySQL table handle */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /*********************************************************************//** Sets a table lock on the table mentioned in prebuilt. @return error code or DB_SUCCESS */ @@ -226,7 +226,7 @@ row_lock_table_for_mysql( prebuilt->select_lock_type */ ulint mode) /*!< in: lock mode of table (ignored if table==NULL) */ - __attribute__((nonnull(1))); + MY_ATTRIBUTE((nonnull(1))); /*********************************************************************//** Does an insert for MySQL. @return error code or DB_SUCCESS */ @@ -237,7 +237,7 @@ row_insert_for_mysql( byte* mysql_rec, /*!< in: row in the MySQL format */ row_prebuilt_t* prebuilt) /*!< in: prebuilt struct in MySQL handle */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /*********************************************************************//** Builds a dummy query graph used in selects. */ UNIV_INTERN @@ -277,7 +277,7 @@ row_update_for_mysql( the MySQL format */ row_prebuilt_t* prebuilt) /*!< in: prebuilt struct in MySQL handle */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /*********************************************************************//** This can only be used when srv_locks_unsafe_for_binlog is TRUE or this session is using a READ COMMITTED or READ UNCOMMITTED isolation level. @@ -298,7 +298,7 @@ row_unlock_for_mysql( the records under pcur and clust_pcur, and we do not need to reposition the cursors. */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /*********************************************************************//** Checks if a table name contains the string "/#sql" which denotes temporary tables in MySQL. @@ -307,7 +307,7 @@ UNIV_INTERN bool row_is_mysql_tmp_table_name( /*========================*/ - const char* name) __attribute__((warn_unused_result)); + const char* name) MY_ATTRIBUTE((warn_unused_result)); /*!< in: table name in the form 'database/tablename' */ @@ -332,7 +332,7 @@ row_update_cascade_for_mysql( upd_node_t* node, /*!< in: update node used in the cascade or set null operation */ dict_table_t* table) /*!< in: table where we do the operation */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /*********************************************************************//** Locks the data dictionary exclusively for performing a table create or other data dictionary modification operation. */ @@ -409,7 +409,7 @@ row_create_index_for_mysql( index columns, which are then checked for not being too large. */ - __attribute__((nonnull(1,2), warn_unused_result)); + MY_ATTRIBUTE((nonnull(1,2), warn_unused_result)); /*********************************************************************//** Scans a table create SQL string and adds to the data dictionary the foreign key constraints declared in the string. This function @@ -435,7 +435,7 @@ row_table_add_foreign_constraints( ibool reject_fks) /*!< in: if TRUE, fail with error code DB_CANNOT_ADD_CONSTRAINT if any foreign keys are found. */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /*********************************************************************//** The master thread in srv0srv.cc calls this regularly to drop tables which we must drop in background after queries to them have ended. Such lazy @@ -464,7 +464,7 @@ row_mysql_lock_table( dict_table_t* table, /*!< in: table to lock */ enum lock_mode mode, /*!< in: LOCK_X or LOCK_S */ const char* op_info) /*!< in: string for trx->op_info */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /*********************************************************************//** Truncates a table for MySQL. @@ -475,7 +475,7 @@ row_truncate_table_for_mysql( /*=========================*/ dict_table_t* table, /*!< in: table handle */ trx_t* trx) /*!< in: transaction handle */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /*********************************************************************//** Drops a table for MySQL. If the name of the dropped table ends in one of "innodb_monitor", "innodb_lock_monitor", "innodb_tablespace_monitor", @@ -491,10 +491,13 @@ row_drop_table_for_mysql( const char* name, /*!< in: table name */ trx_t* trx, /*!< in: dictionary transaction handle */ bool drop_db,/*!< in: true=dropping whole database */ + ibool create_failed,/*!lock.trx_locks */ ulint heap_size) /*!< in: mem_heap_get_size(trx->lock.lock_heap) */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /**********************************************************************//** Prints info about a transaction. @@ -331,7 +331,7 @@ trx_print_latched( const trx_t* trx, /*!< in: transaction */ ulint max_query_len) /*!< in: max query length to print, or 0 to use the default max length */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /**********************************************************************//** Prints info about a transaction. @@ -344,7 +344,7 @@ trx_print( const trx_t* trx, /*!< in: transaction */ ulint max_query_len) /*!< in: max query length to print, or 0 to use the default max length */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /**********************************************************************//** Determine if a transaction is a dictionary operation. @@ -354,7 +354,7 @@ enum trx_dict_op_t trx_get_dict_operation( /*===================*/ const trx_t* trx) /*!< in: transaction */ - __attribute__((pure)); + MY_ATTRIBUTE((pure)); /**********************************************************************//** Flag a transaction a dictionary operation. */ UNIV_INLINE @@ -383,7 +383,7 @@ trx_state_eq( if state != TRX_STATE_NOT_STARTED asserts that trx->state != TRX_STATE_NOT_STARTED */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); # ifdef UNIV_DEBUG /**********************************************************************//** Asserts that a transaction has been started. @@ -394,7 +394,7 @@ ibool trx_assert_started( /*===============*/ const trx_t* trx) /*!< in: transaction */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); # endif /* UNIV_DEBUG */ /**********************************************************************//** diff --git a/storage/innobase/include/trx0undo.h b/storage/innobase/include/trx0undo.h index 45733921212..42ac62916e0 100644 --- a/storage/innobase/include/trx0undo.h +++ b/storage/innobase/include/trx0undo.h @@ -1,6 +1,7 @@ /***************************************************************************** -Copyright (c) 1996, 2013, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2013, 2016, MariaDB Corporation This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -75,7 +76,7 @@ bool trx_undo_trx_id_is_insert( /*======================*/ const byte* trx_id) /*!< in: DB_TRX_ID, followed by DB_ROLL_PTR */ - __attribute__((nonnull, pure, warn_unused_result)); + MY_ATTRIBUTE((nonnull, pure, warn_unused_result)); #endif /* !UNIV_HOTBACKUP */ /*****************************************************************//** Writes a roll ptr to an index page. In case that the size changes in @@ -216,7 +217,7 @@ trx_undo_add_page( mtr_t* mtr) /*!< in: mtr which does not have a latch to any undo log page; the caller must have reserved the rollback segment mutex */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /********************************************************************//** Frees the last undo log page. The caller must hold the rollback segment mutex. */ @@ -231,7 +232,7 @@ trx_undo_free_last_page_func( mtr_t* mtr) /*!< in/out: mini-transaction which does not have a latch to any undo log page or which has allocated the undo log page */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); #ifdef UNIV_DEBUG # define trx_undo_free_last_page(trx,undo,mtr) \ trx_undo_free_last_page_func(trx,undo,mtr) @@ -251,7 +252,7 @@ trx_undo_truncate_end( trx_undo_t* undo, /*!< in/out: undo log */ undo_no_t limit) /*!< in: all undo records with undo number >= this value should be truncated */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); /***********************************************************************//** Truncates an undo log from the start. This function is used during a purge @@ -293,7 +294,7 @@ trx_undo_assign_undo( /*=================*/ trx_t* trx, /*!< in: transaction */ ulint type) /*!< in: TRX_UNDO_INSERT or TRX_UNDO_UPDATE */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); /******************************************************************//** Sets the state of the undo log segment at a transaction finish. @return undo log segment header page, x-latched */ @@ -343,7 +344,7 @@ void trx_undo_free_prepared( /*===================*/ trx_t* trx) /*!< in/out: PREPARED transaction */ - UNIV_COLD __attribute__((nonnull)); + UNIV_COLD MY_ATTRIBUTE((nonnull)); #endif /* !UNIV_HOTBACKUP */ /***********************************************************//** Parses the redo log entry of an undo log page initialization. diff --git a/storage/innobase/include/univ.i b/storage/innobase/include/univ.i index c2451fa8c21..cd379f0fadd 100644 --- a/storage/innobase/include/univ.i +++ b/storage/innobase/include/univ.i @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1994, 2013, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2008, Google Inc. Copyright (c) 2013, 2015, MariaDB Corporation. @@ -45,7 +45,7 @@ Created 1/20/1994 Heikki Tuuri #define INNODB_VERSION_MAJOR 5 #define INNODB_VERSION_MINOR 6 -#define INNODB_VERSION_BUGFIX 29 +#define INNODB_VERSION_BUGFIX 31 /* The following is the InnoDB version as shown in SELECT plugin_version FROM information_schema.plugins; @@ -249,8 +249,9 @@ operations (very slow); also UNIV_DEBUG must be defined */ that are only referenced from within InnoDB, not from MySQL. We disable the GCC visibility directive on all Sun operating systems because there is no easy way to get it to work. See http://bugs.mysql.com/bug.php?id=52263. */ +#define MY_ATTRIBUTE __attribute__ #if defined(__GNUC__) && (__GNUC__ >= 4) && !defined(sun) || defined(__INTEL_COMPILER) -# define UNIV_INTERN __attribute__((visibility ("hidden"))) +# define UNIV_INTERN MY_ATTRIBUTE((visibility ("hidden"))) #else # define UNIV_INTERN #endif @@ -265,7 +266,7 @@ appears close together improving code locality of non-cold parts of program. The paths leading to call of cold functions within code are marked as unlikely by the branch prediction mechanism. optimize a rarely invoked function for size instead for speed. */ -# define UNIV_COLD __attribute__((cold)) +# define UNIV_COLD MY_ATTRIBUTE((cold)) #else # define UNIV_COLD /* empty */ #endif @@ -562,7 +563,7 @@ contains the sum of the following flag and the locally stored len. */ #if defined(__GNUC__) && (__GNUC__ > 2) && ! defined(__INTEL_COMPILER) #define HAVE_GCC_GT_2 /* Tell the compiler that variable/function is unused. */ -# define UNIV_UNUSED __attribute__ ((unused)) +# define UNIV_UNUSED MY_ATTRIBUTE ((unused)) #else # define UNIV_UNUSED #endif /* CHECK FOR GCC VER_GT_2 */ diff --git a/storage/innobase/include/ut0byte.h b/storage/innobase/include/ut0byte.h index 5bdd553ca80..4893ab9f9af 100644 --- a/storage/innobase/include/ut0byte.h +++ b/storage/innobase/include/ut0byte.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1994, 2009, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -39,7 +39,7 @@ ut_ull_create( /*==========*/ ulint high, /*!< in: high-order 32 bits */ ulint low) /*!< in: low-order 32 bits */ - __attribute__((const)); + MY_ATTRIBUTE((const)); /********************************************************//** Rounds a 64-bit integer downward to a multiple of a power of 2. @@ -80,7 +80,7 @@ ut_align_down( /*==========*/ const void* ptr, /*!< in: pointer */ ulint align_no) /*!< in: align by this number */ - __attribute__((const)); + MY_ATTRIBUTE((const)); /*********************************************************//** The following function computes the offset of a pointer from the nearest aligned address. @@ -91,7 +91,7 @@ ut_align_offset( /*============*/ const void* ptr, /*!< in: pointer */ ulint align_no) /*!< in: align by this number */ - __attribute__((const)); + MY_ATTRIBUTE((const)); /*****************************************************************//** Gets the nth bit of a ulint. @return TRUE if nth bit is 1; 0th bit is defined to be the least significant */ diff --git a/storage/innobase/include/ut0byte.ic b/storage/innobase/include/ut0byte.ic index 873d98c727e..1a7af5ae33d 100644 --- a/storage/innobase/include/ut0byte.ic +++ b/storage/innobase/include/ut0byte.ic @@ -110,7 +110,7 @@ ut_align_down( ut_ad(sizeof(void*) == sizeof(ulint)); - return((void*)((((ulint) ptr)) & ~(align_no - 1))); + return((void*)(((ulint) ptr) & ~(align_no - 1))); } /*********************************************************//** diff --git a/storage/innobase/include/ut0counter.h b/storage/innobase/include/ut0counter.h index 63a133a175d..447484ba985 100644 --- a/storage/innobase/include/ut0counter.h +++ b/storage/innobase/include/ut0counter.h @@ -32,11 +32,15 @@ Created 2012/04/12 by Sunny Bains #include "os0thread.h" /** CPU cache line size */ -#ifdef __powerpc__ -#define CACHE_LINE_SIZE 128 +#ifndef UNIV_HOTBACKUP +# ifdef CPU_LEVEL1_DCACHE_LINESIZE +# define CACHE_LINE_SIZE CPU_LEVEL1_DCACHE_LINESIZE +# else +# error CPU_LEVEL1_DCACHE_LINESIZE is undefined +# endif /* CPU_LEVEL1_DCACHE_LINESIZE */ #else -#define CACHE_LINE_SIZE 64 -#endif +# define CACHE_LINE_SIZE 64 +#endif /* UNIV_HOTBACKUP */ /** Default number of slots to use in ib_counter_t */ #define IB_N_SLOTS 64 diff --git a/storage/innobase/include/ut0dbg.h b/storage/innobase/include/ut0dbg.h index 6a4afe99597..3f5baef0a3c 100644 --- a/storage/innobase/include/ut0dbg.h +++ b/storage/innobase/include/ut0dbg.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1994, 2009, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -59,7 +59,7 @@ ut_dbg_assertion_failed( const char* expr, /*!< in: the failed assertion */ const char* file, /*!< in: source file containing the assertion */ ulint line) /*!< in: line number of the assertion */ - UNIV_COLD __attribute__((nonnull(2))); + UNIV_COLD MY_ATTRIBUTE((nonnull(2))); /** Abort the execution. */ # define UT_DBG_PANIC abort() diff --git a/storage/innobase/include/ut0mem.h b/storage/innobase/include/ut0mem.h index af7eb4e9b1d..81470358f2f 100644 --- a/storage/innobase/include/ut0mem.h +++ b/storage/innobase/include/ut0mem.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1994, 2011, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -87,7 +87,7 @@ ut_malloc_low( ulint n, /*!< in: number of bytes to allocate */ ibool assert_on_error) /*!< in: if TRUE, we crash mysqld if the memory cannot be allocated */ - __attribute__((malloc)); + MY_ATTRIBUTE((malloc)); /**********************************************************************//** Allocates memory. */ #define ut_malloc(n) ut_malloc_low(n, TRUE) diff --git a/storage/innobase/include/ut0rnd.h b/storage/innobase/include/ut0rnd.h index 53b769849a5..6ed3ee3b2e5 100644 --- a/storage/innobase/include/ut0rnd.h +++ b/storage/innobase/include/ut0rnd.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1994, 2009, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -96,7 +96,7 @@ ulint ut_fold_ull( /*========*/ ib_uint64_t d) /*!< in: 64-bit integer */ - __attribute__((const)); + MY_ATTRIBUTE((const)); /*************************************************************//** Folds a character string ending in the null character. @return folded value */ @@ -105,7 +105,7 @@ ulint ut_fold_string( /*===========*/ const char* str) /*!< in: null-terminated string */ - __attribute__((pure)); + MY_ATTRIBUTE((pure)); /***********************************************************//** Looks for a prime number slightly greater than the given argument. The prime is chosen so that it is not near any power of 2. @@ -115,7 +115,7 @@ ulint ut_find_prime( /*==========*/ ulint n) /*!< in: positive number > 100 */ - __attribute__((const)); + MY_ATTRIBUTE((const)); #endif /* !UNIV_INNOCHECKSUM */ @@ -128,7 +128,7 @@ ut_fold_ulint_pair( /*===============*/ ulint n1, /*!< in: ulint */ ulint n2) /*!< in: ulint */ - __attribute__((const)); + MY_ATTRIBUTE((const)); /*************************************************************//** Folds a binary string. @return folded value */ @@ -138,7 +138,7 @@ ut_fold_binary( /*===========*/ const byte* str, /*!< in: string of bytes */ ulint len) /*!< in: length */ - __attribute__((pure)); + MY_ATTRIBUTE((pure)); #ifndef UNIV_NONINL diff --git a/storage/innobase/include/ut0ut.h b/storage/innobase/include/ut0ut.h index 176f132704a..6786ad166e8 100644 --- a/storage/innobase/include/ut0ut.h +++ b/storage/innobase/include/ut0ut.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1994, 2014, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -241,7 +241,7 @@ ulint ut_2_power_up( /*==========*/ ulint n) /*!< in: number != 0 */ - __attribute__((const)); + MY_ATTRIBUTE((const)); #endif /* !UNIV_INNOCHECKSUM */ @@ -324,7 +324,7 @@ void ut_print_timestamp( /*===============*/ FILE* file) /*!< in: file where to print */ - UNIV_COLD __attribute__((nonnull)); + UNIV_COLD MY_ATTRIBUTE((nonnull)); #ifndef UNIV_INNOCHECKSUM @@ -524,7 +524,7 @@ ut_ulint_sort( ulint* aux_arr, /*!< in/out: aux array to use in sort */ ulint low, /*!< in: lower bound */ ulint high) /*!< in: upper bound */ - __attribute__((nonnull)); + MY_ATTRIBUTE((nonnull)); #ifndef UNIV_NONINL #include "ut0ut.ic" diff --git a/storage/innobase/lock/lock0lock.cc b/storage/innobase/lock/lock0lock.cc index bc7ec1d221b..437940be0d8 100644 --- a/storage/innobase/lock/lock0lock.cc +++ b/storage/innobase/lock/lock0lock.cc @@ -1,7 +1,7 @@ /***************************************************************************** -Copyright (c) 1996, 2015, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2014, 2015, MariaDB Corporation +Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2014, 2016, MariaDB Corporation This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -429,7 +429,7 @@ ibool lock_rec_validate_page( /*===================*/ const buf_block_t* block) /*!< in: buffer block */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); #endif /* UNIV_DEBUG */ /* The lock system */ @@ -513,7 +513,7 @@ Checks that a transaction id is sensible, i.e., not in the future. #ifdef UNIV_DEBUG UNIV_INTERN #else -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) #endif bool lock_check_trx_id_sanity( @@ -2387,7 +2387,7 @@ lock_rec_add_to_queue( if (wsrep_debug) { fprintf(stderr, "BF skipping wait: %lu\n", - trx->id); + (ulong) trx->id); lock_rec_print(stderr, lock); } } else @@ -4017,7 +4017,7 @@ lock_get_next_lock( ut_ad(heap_no == ULINT_UNDEFINED); ut_ad(lock_get_type_low(lock) == LOCK_TABLE); - lock = UT_LIST_GET_PREV(un_member.tab_lock.locks, lock); + lock = UT_LIST_GET_NEXT(un_member.tab_lock.locks, lock); } } while (lock != NULL && lock->trx->lock.deadlock_mark > ctx->mark_start); @@ -4067,7 +4067,8 @@ lock_get_first_lock( } else { *heap_no = ULINT_UNDEFINED; ut_ad(lock_get_type_low(lock) == LOCK_TABLE); - lock = UT_LIST_GET_PREV(un_member.tab_lock.locks, lock); + dict_table_t* table = lock->un_member.tab_lock.table; + lock = UT_LIST_GET_FIRST(table->locks); } ut_a(lock != NULL); @@ -4961,7 +4962,7 @@ lock_table_other_has_incompatible( #ifdef WITH_WSREP if(wsrep_thd_is_wsrep(trx->mysql_thd)) { if (wsrep_debug) { - fprintf(stderr, "WSREP: trx %ld table lock abort\n", + fprintf(stderr, "WSREP: trx " TRX_ID_FMT " table lock abort\n", trx->id); } trx_mutex_enter(lock->trx); @@ -4999,7 +5000,8 @@ lock_table( dberr_t err; const lock_t* wait_for; - ut_ad(table && thr); + ut_ad(table != NULL); + ut_ad(thr != NULL); if (flags & BTR_NO_LOCKING_FLAG) { @@ -6431,7 +6433,7 @@ lock_validate_table_locks( /*********************************************************************//** Validate record locks up to a limit. @return lock at limit or NULL if no more locks in the hash bucket */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) const lock_t* lock_rec_validate( /*==============*/ diff --git a/storage/innobase/lock/lock0wait.cc b/storage/innobase/lock/lock0wait.cc index a87adcf94c0..c7bd223c491 100644 --- a/storage/innobase/lock/lock0wait.cc +++ b/storage/innobase/lock/lock0wait.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2013, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -512,7 +512,7 @@ extern "C" UNIV_INTERN os_thread_ret_t DECLARE_THREAD(lock_wait_timeout_thread)( /*=====================================*/ - void* arg __attribute__((unused))) + void* arg MY_ATTRIBUTE((unused))) /* in: a dummy parameter required by os_thread_create */ { diff --git a/storage/innobase/log/log0crypt.cc b/storage/innobase/log/log0crypt.cc index db2e84d7e45..f518845b1a8 100644 --- a/storage/innobase/log/log0crypt.cc +++ b/storage/innobase/log/log0crypt.cc @@ -144,11 +144,11 @@ log_crypt_print_checkpoint_keys( ib_uint64_t checkpoint_no = log_block_get_checkpoint_no(log_block); if (crypt_info.size()) { - fprintf(stderr, "InnoDB: redo log checkpoint: %lu [ chk key ]: ", checkpoint_no); + fprintf(stderr, "InnoDB: redo log checkpoint: %lu [ chk key ]: ", (ulong) checkpoint_no); for (size_t i = 0; i < crypt_info.size(); i++) { struct crypt_info_t* it = &crypt_info[i]; fprintf(stderr, "[ %lu %u ] ", - it->checkpoint_no, + (ulong) it->checkpoint_no, it->key_version); } fprintf(stderr, "\n"); diff --git a/storage/innobase/log/log0log.cc b/storage/innobase/log/log0log.cc index 31104b395c1..89b616aba01 100644 --- a/storage/innobase/log/log0log.cc +++ b/storage/innobase/log/log0log.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2009, Google Inc. Copyright (C) 2014, 2016, MariaDB Corporation. All Rights Reserved. @@ -981,7 +981,7 @@ log_group_init( ulint space_id, /*!< in: space id of the file space which contains the log files of this group */ - ulint archive_space_id __attribute__((unused))) + ulint archive_space_id MY_ATTRIBUTE((unused))) /*!< in: space id of the file space which contains some archived log files for this group; currently, only @@ -2396,7 +2396,7 @@ void log_archived_file_name_gen( /*=======================*/ char* buf, /*!< in: buffer where to write */ - ulint id __attribute__((unused)), + ulint id MY_ATTRIBUTE((unused)), /*!< in: group id; currently we only archive the first group */ ulint file_no)/*!< in: file number */ diff --git a/storage/innobase/log/log0recv.cc b/storage/innobase/log/log0recv.cc index d574cd55397..9fde18757c5 100644 --- a/storage/innobase/log/log0recv.cc +++ b/storage/innobase/log/log0recv.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1997, 2015, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1997, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2012, Facebook Inc. Copyright (c) 2013, 2016, MariaDB Corporation. All Rights Reserved. @@ -334,7 +334,7 @@ extern "C" UNIV_INTERN os_thread_ret_t DECLARE_THREAD(recv_writer_thread)( /*===============================*/ - void* arg __attribute__((unused))) + void* arg MY_ATTRIBUTE((unused))) /*!< in: a dummy parameter required by os_thread_create */ { @@ -755,7 +755,7 @@ recv_check_cp_is_consistent( /********************************************************//** Looks for the maximum consistent checkpoint from the log groups. @return error code or DB_SUCCESS */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t recv_find_max_checkpoint( /*=====================*/ diff --git a/storage/innobase/mem/mem0dbg.cc b/storage/innobase/mem/mem0dbg.cc index 308c2979551..a77785a369a 100644 --- a/storage/innobase/mem/mem0dbg.cc +++ b/storage/innobase/mem/mem0dbg.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1994, 2011, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -248,7 +248,7 @@ void mem_field_erase( /*============*/ byte* buf, /*!< in: memory field */ - ulint n __attribute__((unused))) + ulint n MY_ATTRIBUTE((unused))) /*!< in: how many bytes the user requested */ { byte* usr_buf; @@ -450,7 +450,7 @@ void mem_heap_validate_or_print( /*=======================*/ mem_heap_t* heap, /*!< in: memory heap */ - byte* top __attribute__((unused)), + byte* top MY_ATTRIBUTE((unused)), /*!< in: calculate and validate only until this top pointer in the heap is reached, if this pointer is NULL, ignored */ diff --git a/storage/innobase/mtr/mtr0mtr.cc b/storage/innobase/mtr/mtr0mtr.cc index 400aa9bff57..5843dd80524 100644 --- a/storage/innobase/mtr/mtr0mtr.cc +++ b/storage/innobase/mtr/mtr0mtr.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -58,7 +58,7 @@ mtr_block_dirtied( /*****************************************************************//** Releases the item in the slot given. */ -static __attribute__((nonnull)) +static MY_ATTRIBUTE((nonnull)) void mtr_memo_slot_release_func( /*=======================*/ @@ -105,7 +105,7 @@ mtr_memo_slot_release_func( Releases the mlocks and other objects stored in an mtr memo. They are released in the order opposite to which they were pushed to the memo. */ -static __attribute__((nonnull)) +static MY_ATTRIBUTE((nonnull)) void mtr_memo_pop_all( /*=============*/ @@ -395,7 +395,7 @@ mtr_read_ulint( /*===========*/ const byte* ptr, /*!< in: pointer from where to read */ ulint type, /*!< in: MLOG_1BYTE, MLOG_2BYTES, MLOG_4BYTES */ - mtr_t* mtr __attribute__((unused))) + mtr_t* mtr MY_ATTRIBUTE((unused))) /*!< in: mini-transaction handle */ { ut_ad(mtr->state == MTR_ACTIVE); diff --git a/storage/innobase/mysql-test/storage_engine/lock_concurrent.rdiff b/storage/innobase/mysql-test/storage_engine/lock_concurrent.rdiff index fe4a0087fa9..c76a5fe7f15 100644 --- a/storage/innobase/mysql-test/storage_engine/lock_concurrent.rdiff +++ b/storage/innobase/mysql-test/storage_engine/lock_concurrent.rdiff @@ -1,7 +1,7 @@ --- suite/storage_engine/lock_concurrent.result 2012-06-24 23:55:19.539380000 +0400 +++ suite/storage_engine/lock_concurrent.reject 2012-07-15 17:50:21.279222746 +0400 -@@ -3,10 +3,19 @@ - LOCK TABLES t1 WRITE CONCURRENT, t1 AS t2 READ; +@@ -4,6 +4,14 @@ + connect con1,localhost,root,,; SET lock_wait_timeout = 1; LOCK TABLES t1 READ LOCAL; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction @@ -13,8 +13,11 @@ +# Also, this problem may cause a chain effect (more errors of different kinds in the test). +# ------------------------------------------- UNLOCK TABLES; + connection default; UNLOCK TABLES; +@@ -11,6 +19,7 @@ LOCK TABLES t1 READ LOCAL; + connection default; LOCK TABLES t1 WRITE CONCURRENT, t1 AS t2 READ; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction UNLOCK TABLES; diff --git a/storage/innobase/os/os0file.cc b/storage/innobase/os/os0file.cc index 3a0bd1fc328..e21ffa2defa 100644 --- a/storage/innobase/os/os0file.cc +++ b/storage/innobase/os/os0file.cc @@ -1,6 +1,6 @@ /*********************************************************************** -Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2009, Percona Inc. Copyright (c) 2013, 2016, MariaDB Corporation. @@ -1350,8 +1350,7 @@ os_file_create_simple_func( access = GENERIC_READ; - } else if (access_type == OS_FILE_READ_WRITE - || access_type == OS_FILE_READ_WRITE_CACHED) { + } else if (access_type == OS_FILE_READ_WRITE) { access = GENERIC_READ | GENERIC_WRITE; } else { ib_logf(IB_LOG_LEVEL_ERROR, @@ -1455,8 +1454,7 @@ os_file_create_simple_func( #ifdef USE_FILE_LOCK if (!srv_read_only_mode && *success - && (access_type == OS_FILE_READ_WRITE - || access_type == OS_FILE_READ_WRITE_CACHED) + && (access_type == OS_FILE_READ_WRITE) && os_file_lock(file, name)) { *success = FALSE; @@ -1470,31 +1468,6 @@ os_file_create_simple_func( return(file); } -/** Disable OS I/O caching on the file if the file type and server -configuration requires it. -@param file handle to the file -@param name name of the file, for diagnostics -@param mode_str operation on the file, for diagnostics -@param type OS_LOG_FILE or OS_DATA_FILE -@param access_type if OS_FILE_READ_WRITE_CACHED, then caching will be disabled -unconditionally, ignored otherwise */ -static -void -os_file_set_nocache_if_needed(os_file_t file, const char* name, - const char *mode_str, ulint type, - ulint access_type) -{ - if (srv_read_only_mode || access_type == OS_FILE_READ_WRITE_CACHED) { - return; - } - - if (type == OS_DATA_FILE - && (srv_unix_file_flush_method == SRV_UNIX_O_DIRECT - || (srv_unix_file_flush_method == SRV_UNIX_O_DIRECT_NO_FSYNC))) { - os_file_set_nocache(file, name, mode_str); - } -} - /****************************************************************//** NOTE! Use the corresponding macro os_file_create_simple_no_error_handling(), not directly this function! @@ -1550,8 +1523,7 @@ os_file_create_simple_no_error_handling_func( access = GENERIC_READ; } else if (srv_read_only_mode) { access = GENERIC_READ; - } else if (access_type == OS_FILE_READ_WRITE - || access_type == OS_FILE_READ_WRITE_CACHED) { + } else if (access_type == OS_FILE_READ_WRITE) { access = GENERIC_READ | GENERIC_WRITE; } else if (access_type == OS_FILE_READ_ALLOW_DELETE) { @@ -1623,8 +1595,7 @@ os_file_create_simple_no_error_handling_func( } else { ut_a(access_type == OS_FILE_READ_WRITE - || access_type == OS_FILE_READ_ALLOW_DELETE - || access_type == OS_FILE_READ_WRITE_CACHED); + || access_type == OS_FILE_READ_ALLOW_DELETE); create_flag = O_RDWR; } @@ -1656,16 +1627,18 @@ os_file_create_simple_no_error_handling_func( /* This function is always called for data files, we should disable OS caching (O_DIRECT) here as we do in os_file_create_func(), so we open the same file in the same mode, see man page of open(2). */ - if (*success) { - os_file_set_nocache_if_needed(file, name, mode_str, - OS_DATA_FILE, access_type); + if (!srv_read_only_mode + && *success + && (srv_unix_file_flush_method == SRV_UNIX_O_DIRECT + || srv_unix_file_flush_method == SRV_UNIX_O_DIRECT_NO_FSYNC)) { + + os_file_set_nocache(file, name, mode_str); } #ifdef USE_FILE_LOCK if (!srv_read_only_mode && *success - && (access_type == OS_FILE_READ_WRITE - || access_type == OS_FILE_READ_WRITE_CACHED) + && (access_type == OS_FILE_READ_WRITE) && os_file_lock(file, name)) { *success = FALSE; @@ -1708,8 +1681,8 @@ os_file_set_nocache( __attribute__((unused)), const char* file_name /*!< in: used in the diagnostic message */ - __attribute__((unused)), - const char* operation_name __attribute__((unused))) + MY_ATTRIBUTE((unused)), + const char* operation_name MY_ATTRIBUTE((unused))) /*!< in: "open" or "create"; used in the diagnostic message */ { @@ -2033,9 +2006,13 @@ os_file_create_func( } while (retry); /* We disable OS caching (O_DIRECT) only on data files */ + if (!srv_read_only_mode + && *success + && type != OS_LOG_FILE + && (srv_unix_file_flush_method == SRV_UNIX_O_DIRECT + || srv_unix_file_flush_method == SRV_UNIX_O_DIRECT_NO_FSYNC)) { - if (*success) { - os_file_set_nocache_if_needed(file, name, mode_str, type, 0); + os_file_set_nocache(file, name, mode_str); } #ifdef USE_FILE_LOCK @@ -2402,7 +2379,7 @@ os_file_set_size( fprintf(stderr, "InnoDB: Error: preallocating file " "space for file \'%s\' failed. Current size " "%lu, desired size %lu\n", - name, current_size, size); + name, (ulong) current_size, (ulong) size); os_file_handle_error_no_exit(name, "posix_fallocate", FALSE, __FILE__, __LINE__); return(FALSE); @@ -2638,7 +2615,7 @@ os_file_flush_func( /*******************************************************************//** Does a synchronous read operation in Posix. @return number of bytes read, -1 if error */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) ssize_t os_file_pread( /*==========*/ @@ -2749,7 +2726,7 @@ os_file_pread( /*******************************************************************//** Does a synchronous write operation in Posix. @return number of bytes written, -1 if error */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) ssize_t os_file_pwrite( /*===========*/ @@ -6298,7 +6275,7 @@ os_file_trim( fprintf(stderr, " InnoDB: Warning: fallocate call failed with error code %d.\n" " InnoDB: start: %lu len: %lu payload: %lu\n" - " InnoDB: Disabling fallocate for now.\n", errno, off, trim_len, len); + " InnoDB: Disabling fallocate for now.\n", errno, (ulong) off, (ulong) trim_len, (ulong) len); os_file_handle_error_no_exit(slot->name, " fallocate(FALLOC_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE) ", diff --git a/storage/innobase/page/page0page.cc b/storage/innobase/page/page0page.cc index fca8641342c..a09f270a54f 100644 --- a/storage/innobase/page/page0page.cc +++ b/storage/innobase/page/page0page.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1994, 2015, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2012, Facebook Inc. This program is free software; you can redistribute it and/or modify it under @@ -304,7 +304,7 @@ byte* page_parse_create( /*==============*/ byte* ptr, /*!< in: buffer */ - byte* end_ptr __attribute__((unused)), /*!< in: buffer end */ + byte* end_ptr MY_ATTRIBUTE((unused)), /*!< in: buffer end */ ulint comp, /*!< in: nonzero=compact page format */ buf_block_t* block, /*!< in: block or NULL */ mtr_t* mtr) /*!< in: mtr or NULL */ diff --git a/storage/innobase/page/page0zip.cc b/storage/innobase/page/page0zip.cc index 0842971c8d0..2bf1f324784 100644 --- a/storage/innobase/page/page0zip.cc +++ b/storage/innobase/page/page0zip.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2005, 2015, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2005, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2012, Facebook Inc. This program is free software; you can redistribute it and/or modify it under @@ -131,7 +131,7 @@ independently of any UNIV_ debugging conditions. */ #ifndef UNIV_INNOCHECKSUM #if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG # include -__attribute__((format (printf, 1, 2))) +MY_ATTRIBUTE((format (printf, 1, 2))) /**********************************************************************//** Report a failure to decompress or compress. @return number of characters printed */ @@ -752,8 +752,8 @@ static void page_zip_free( /*==========*/ - void* opaque __attribute__((unused)), /*!< in: memory heap */ - void* address __attribute__((unused)))/*!< in: object to free */ + void* opaque MY_ATTRIBUTE((unused)), /*!< in: memory heap */ + void* address MY_ATTRIBUTE((unused)))/*!< in: object to free */ { } @@ -4807,7 +4807,8 @@ page_zip_parse_compress( ulint size; ulint trailer_size; - ut_ad(ptr && end_ptr); + ut_ad(ptr != NULL); + ut_ad(end_ptr != NULL); ut_ad(!page == !page_zip); if (UNIV_UNLIKELY(ptr + (2 + 2) > end_ptr)) { @@ -4928,10 +4929,10 @@ page_zip_verify_checksum( stored = static_cast(mach_read_from_4( static_cast(data) + FIL_PAGE_SPACE_OR_CHKSUM)); - ulint page_no __attribute__((unused)) = + ulint page_no MY_ATTRIBUTE((unused)) = mach_read_from_4(static_cast (data) + FIL_PAGE_OFFSET); - ulint space_id __attribute__((unused)) = + ulint space_id MY_ATTRIBUTE((unused)) = mach_read_from_4(static_cast (data) + FIL_PAGE_SPACE_ID); diff --git a/storage/innobase/pars/lexyy.cc b/storage/innobase/pars/lexyy.cc index 1c01becd9ed..bfa8e2ea950 100644 --- a/storage/innobase/pars/lexyy.cc +++ b/storage/innobase/pars/lexyy.cc @@ -295,7 +295,7 @@ static int yy_start = 0; /* start state number */ static int yy_did_buffer_switch_on_eof; void yyrestart (FILE *input_file ); -__attribute__((unused)) static void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); +MY_ATTRIBUTE((unused)) static void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); static YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ); void yy_delete_buffer (YY_BUFFER_STATE b ); void yy_flush_buffer (YY_BUFFER_STATE b ); @@ -916,7 +916,7 @@ char *yytext; #line 1 "pars0lex.l" /***************************************************************************** -Copyright (c) 1997, 2011, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1997, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -1027,7 +1027,7 @@ static int yy_init_globals (void ); /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ -__attribute__((unused)) static int yylex_destroy (void ); +MY_ATTRIBUTE((unused)) static int yylex_destroy (void ); int yyget_debug (void ); @@ -2664,7 +2664,7 @@ static int yy_get_next_buffer (void) * @param new_buffer The new input buffer. * */ - __attribute__((unused)) static void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) + MY_ATTRIBUTE((unused)) static void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) { /* TODO. We should be able to replace this entire function body @@ -3042,7 +3042,7 @@ static int yy_init_globals (void) } /* yylex_destroy is for both reentrant and non-reentrant scanners. */ -__attribute__((unused)) static int yylex_destroy (void) +MY_ATTRIBUTE((unused)) static int yylex_destroy (void) { /* Pop the buffer stack, destroying each element. */ diff --git a/storage/innobase/pars/make_flex.sh b/storage/innobase/pars/make_flex.sh index 581fc2342aa..c3db8aea298 100755 --- a/storage/innobase/pars/make_flex.sh +++ b/storage/innobase/pars/make_flex.sh @@ -1,6 +1,6 @@ #!/bin/bash # -# Copyright (c) 1994, 2011, Oracle and/or its affiliates. All Rights Reserved. +# Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved. # # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free Software @@ -33,15 +33,15 @@ sed -e ' s/'"$TMPFILE"'/'"$OUTFILE"'/; s/\(int offset = \)\((yy_c_buf_p) - (yytext_ptr)\);/\1(int)(\2);/; s/\(void yy\(restart\|_\(delete\|flush\)_buffer\)\)/static \1/; -s/\(void yy_switch_to_buffer\)/__attribute__((unused)) static \1/; -s/\(void yy\(push\|pop\)_buffer_state\)/__attribute__((unused)) static \1/; +s/\(void yy_switch_to_buffer\)/MY_ATTRIBUTE((unused)) static \1/; +s/\(void yy\(push\|pop\)_buffer_state\)/MY_ATTRIBUTE((unused)) static \1/; s/\(YY_BUFFER_STATE yy_create_buffer\)/static \1/; -s/\(\(int\|void\) yy[gs]et_\)/__attribute__((unused)) static \1/; +s/\(\(int\|void\) yy[gs]et_\)/MY_ATTRIBUTE((unused)) static \1/; s/\(void \*\?yy\(\(re\)\?alloc\|free\)\)/static \1/; s/\(extern \)\?\(int yy\(leng\|lineno\|_flex_debug\)\)/static \2/; -s/\(int yylex_destroy\)/__attribute__((unused)) static \1/; +s/\(int yylex_destroy\)/MY_ATTRIBUTE((unused)) static \1/; s/\(extern \)\?\(int yylex \)/UNIV_INTERN \2/; -s/^\(\(FILE\|char\) *\* *yyget\)/__attribute__((unused)) static \1/; +s/^\(\(FILE\|char\) *\* *yyget\)/MY_ATTRIBUTE((unused)) static \1/; s/^\(extern \)\?\(\(FILE\|char\) *\* *yy\)/static \2/; ' < $TMPFILE >> $OUTFILE diff --git a/storage/innobase/pars/pars0pars.cc b/storage/innobase/pars/pars0pars.cc index da08939d78a..e6af3d25e86 100644 --- a/storage/innobase/pars/pars0pars.cc +++ b/storage/innobase/pars/pars0pars.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2013, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -1926,7 +1926,7 @@ pars_create_table( sym_node_t* column_defs, /*!< in: list of column names */ sym_node_t* compact, /* in: non-NULL if COMPACT table. */ sym_node_t* block_size, /* in: block size (can be NULL) */ - void* not_fit_in_memory __attribute__((unused))) + void* not_fit_in_memory MY_ATTRIBUTE((unused))) /*!< in: a non-NULL pointer means that this is a table which in simulations should be simulated as not fitting @@ -2143,7 +2143,7 @@ UNIV_INTERN que_fork_t* pars_stored_procedure_call( /*=======================*/ - sym_node_t* sym_node __attribute__((unused))) + sym_node_t* sym_node MY_ATTRIBUTE((unused))) /*!< in: stored procedure name */ { ut_error; @@ -2203,7 +2203,7 @@ UNIV_INTERN void yyerror( /*====*/ - const char* s __attribute__((unused))) + const char* s MY_ATTRIBUTE((unused))) /*!< in: error message string */ { ut_ad(s); diff --git a/storage/innobase/rem/rem0cmp.cc b/storage/innobase/rem/rem0cmp.cc index 426cf9e3ac5..616ef322fb5 100644 --- a/storage/innobase/rem/rem0cmp.cc +++ b/storage/innobase/rem/rem0cmp.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1994, 2012, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -75,7 +75,7 @@ cmp_debug_dtuple_rec_with_match( completely matched fields; when function returns, contains the value for current comparison */ - __attribute__((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull, warn_unused_result)); #endif /* UNIV_DEBUG */ /*************************************************************//** This function is used to compare two data fields for which the data type @@ -659,7 +659,10 @@ cmp_dtuple_rec_with_match_low( in current field */ int ret; /* return value */ - ut_ad(dtuple && rec && matched_fields && matched_bytes); + ut_ad(dtuple != NULL); + ut_ad(rec != NULL); + ut_ad(matched_fields != NULL); + ut_ad(matched_bytes != NULL); ut_ad(dtuple_check_typed(dtuple)); ut_ad(rec_offs_validate(rec, NULL, offsets)); @@ -920,7 +923,7 @@ Compare two physical record fields. @retval 1 if rec1 field is greater than rec2 @retval -1 if rec1 field is less than rec2 @retval 0 if rec1 field equals to rec2 */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) int cmp_rec_rec_simple_field( /*=====================*/ @@ -1139,7 +1142,9 @@ cmp_rec_rec_with_match( int ret = 0; /* return value */ ulint comp; - ut_ad(rec1 && rec2 && index); + ut_ad(rec1 != NULL); + ut_ad(rec2 != NULL); + ut_ad(index != NULL); ut_ad(rec_offs_validate(rec1, index, offsets1)); ut_ad(rec_offs_validate(rec2, index, offsets2)); ut_ad(rec_offs_comp(offsets1) == rec_offs_comp(offsets2)); @@ -1375,7 +1380,9 @@ cmp_debug_dtuple_rec_with_match( int ret; /* return value */ ulint cur_field; /* current field number */ - ut_ad(dtuple && rec && matched_fields); + ut_ad(dtuple != NULL); + ut_ad(rec != NULL); + ut_ad(matched_fields != NULL); ut_ad(dtuple_check_typed(dtuple)); ut_ad(rec_offs_validate(rec, NULL, offsets)); diff --git a/storage/innobase/rem/rem0rec.cc b/storage/innobase/rem/rem0rec.cc index 3ff71d5c59e..9218e757f6a 100644 --- a/storage/innobase/rem/rem0rec.cc +++ b/storage/innobase/rem/rem0rec.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1994, 2013, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -244,7 +244,7 @@ rec_get_n_extern_new( Determine the offset to each field in a leaf-page record in ROW_FORMAT=COMPACT. This is a special case of rec_init_offsets() and rec_get_offsets_func(). */ -UNIV_INLINE __attribute__((nonnull)) +UNIV_INLINE MY_ATTRIBUTE((nonnull)) void rec_init_offsets_comp_ordinary( /*===========================*/ @@ -788,7 +788,7 @@ rec_get_nth_field_offs_old( /**********************************************************//** Determines the size of a data tuple prefix in ROW_FORMAT=COMPACT. @return total size */ -UNIV_INLINE __attribute__((warn_unused_result, nonnull(1,2))) +UNIV_INLINE MY_ATTRIBUTE((warn_unused_result, nonnull(1,2))) ulint rec_get_converted_size_comp_prefix_low( /*===================================*/ @@ -1133,7 +1133,7 @@ rec_convert_dtuple_to_rec_old( /*********************************************************//** Builds a ROW_FORMAT=COMPACT record out of a data tuple. */ -UNIV_INLINE __attribute__((nonnull)) +UNIV_INLINE MY_ATTRIBUTE((nonnull)) void rec_convert_dtuple_to_rec_comp( /*===========================*/ @@ -1341,7 +1341,9 @@ rec_convert_dtuple_to_rec( { rec_t* rec; - ut_ad(buf && index && dtuple); + ut_ad(buf != NULL); + ut_ad(index != NULL); + ut_ad(dtuple != NULL); ut_ad(dtuple_validate(dtuple)); ut_ad(dtuple_check_typed(dtuple)); diff --git a/storage/innobase/row/row0ftsort.cc b/storage/innobase/row/row0ftsort.cc index 9e340f24213..bdd0e63c0a6 100644 --- a/storage/innobase/row/row0ftsort.cc +++ b/storage/innobase/row/row0ftsort.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2010, 2015, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2010, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2015, 2016, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under @@ -557,8 +557,18 @@ row_merge_fts_doc_tokenize( dfield_dup(field, buf->heap); /* One variable length column, word with its lenght less than - fts_max_token_size, add one extra size and one extra byte */ - cur_len += 2; + fts_max_token_size, add one extra size and one extra byte. + + Since the max length for FTS token now is larger than 255, + so we will need to signify length byte itself, so only 1 to 128 + bytes can be used for 1 bytes, larger than that 2 bytes. */ + if (t_str.f_len < 128) { + /* Extra size is one byte. */ + cur_len += 2; + } else { + /* Extra size is two bytes. */ + cur_len += 3; + } /* Reserve one byte for the end marker of row_merge_block_t and we have reserved ROW_MERGE_RESERVE_SIZE (= 4) for @@ -1042,7 +1052,7 @@ row_fts_start_parallel_merge( /********************************************************************//** Insert processed FTS data to auxillary index tables. @return DB_SUCCESS if insertion runs fine */ -static __attribute__((nonnull)) +static MY_ATTRIBUTE((nonnull)) dberr_t row_merge_write_fts_word( /*=====================*/ diff --git a/storage/innobase/row/row0import.cc b/storage/innobase/row/row0import.cc index 893ffcab3da..6dd3c4eea94 100644 --- a/storage/innobase/row/row0import.cc +++ b/storage/innobase/row/row0import.cc @@ -1,7 +1,7 @@ /***************************************************************************** -Copyright (c) 2012, 2015, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2015, MariaDB Corporation. +Copyright (c) 2012, 2016, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2015, 2016, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -2181,7 +2181,7 @@ PageConverter::operator() ( Clean up after import tablespace failure, this function will acquire the dictionary latches on behalf of the transaction if the transaction hasn't already acquired them. */ -static __attribute__((nonnull)) +static MY_ATTRIBUTE((nonnull)) void row_import_discard_changes( /*=======================*/ @@ -2232,7 +2232,7 @@ row_import_discard_changes( /*****************************************************************//** Clean up after import tablespace. */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t row_import_cleanup( /*===============*/ @@ -2267,7 +2267,7 @@ row_import_cleanup( /*****************************************************************//** Report error during tablespace import. */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t row_import_error( /*=============*/ @@ -2295,7 +2295,7 @@ row_import_error( Adjust the root page index node and leaf node segment headers, update with the new space id. For all the table's secondary indexes. @return error code */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t row_import_adjust_root_pages_of_secondary_indexes( /*==============================================*/ @@ -2411,7 +2411,7 @@ row_import_adjust_root_pages_of_secondary_indexes( /*****************************************************************//** Ensure that dict_sys->row_id exceeds SELECT MAX(DB_ROW_ID). @return error code */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t row_import_set_sys_max_row_id( /*==========================*/ @@ -2561,7 +2561,7 @@ row_import_cfg_read_string( /*********************************************************************//** Write the meta data (index user fields) config file. @return DB_SUCCESS or error code. */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t row_import_cfg_read_index_fields( /*=============================*/ @@ -2644,7 +2644,7 @@ row_import_cfg_read_index_fields( Read the index names and root page numbers of the indexes and set the values. Row format [root_page_no, len of str, str ... ] @return DB_SUCCESS or error code. */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t row_import_read_index_data( /*=======================*/ @@ -2839,7 +2839,7 @@ row_import_read_indexes( /*********************************************************************//** Read the meta data (table columns) config file. Deserialise the contents of dict_col_t structure, along with the column name. */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t row_import_read_columns( /*====================*/ @@ -2964,7 +2964,7 @@ row_import_read_columns( /*****************************************************************//** Read the contents of the .cfg file. @return DB_SUCCESS or error code. */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t row_import_read_v1( /*===============*/ @@ -3130,7 +3130,7 @@ row_import_read_v1( /** Read the contents of the .cfg file. @return DB_SUCCESS or error code. */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t row_import_read_meta_data( /*======================*/ @@ -3173,7 +3173,7 @@ row_import_read_meta_data( /** Read the contents of the .cfg file. @return DB_SUCCESS or error code. */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t row_import_read_cfg( /*================*/ diff --git a/storage/innobase/row/row0ins.cc b/storage/innobase/row/row0ins.cc index d3670bcfddd..e3817ea4de7 100644 --- a/storage/innobase/row/row0ins.cc +++ b/storage/innobase/row/row0ins.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2015, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -224,7 +224,7 @@ Does an insert operation by updating a delete-marked existing record in the index. This situation can occur if the delete-marked record is kept in the index for consistent reads. @return DB_SUCCESS or error code */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t row_ins_sec_index_entry_by_modify( /*==============================*/ @@ -319,7 +319,7 @@ Does an insert operation by delete unmarking and updating a delete marked existing record in the index. This situation can occur if the delete marked record is kept in the index for consistent reads. @return DB_SUCCESS, DB_FAIL, or error code */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t row_ins_clust_index_entry_by_modify( /*================================*/ @@ -427,7 +427,7 @@ row_ins_cascade_ancestor_updates_table( Returns the number of ancestor UPDATE or DELETE nodes of a cascaded update/delete node. @return number of ancestors */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) ulint row_ins_cascade_n_ancestors( /*========================*/ @@ -453,7 +453,7 @@ a cascaded update. can also be 0 if no foreign key fields changed; the returned value is ULINT_UNDEFINED if the column type in the child table is too short to fit the new value in the parent table: that means the update fails */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) ulint row_ins_cascade_calc_update_vec( /*============================*/ @@ -942,7 +942,7 @@ Perform referential actions or checks when a parent row is deleted or updated and the constraint had an ON DELETE or ON UPDATE condition which was not RESTRICT. @return DB_SUCCESS, DB_LOCK_WAIT, or error code */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t row_ins_foreign_check_on_constraint( /*================================*/ @@ -1784,7 +1784,7 @@ Otherwise does searches to the indexes of referenced tables and sets shared locks which lock either the success or the failure of a constraint. @return DB_SUCCESS or error code */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t row_ins_check_foreign_constraints( /*==============================*/ @@ -1925,7 +1925,7 @@ Scans a unique non-clustered index at a given index entry to determine whether a uniqueness violation has occurred for the key value of the entry. Set shared locks on possible duplicate records. @return DB_SUCCESS, DB_DUPLICATE_KEY, or DB_LOCK_WAIT */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t row_ins_scan_sec_index_for_duplicate( /*=================================*/ @@ -2067,7 +2067,7 @@ end_scan: @retval DB_SUCCESS_LOCKED_REC when rec is an exact match of entry or a newer version of entry (the entry should not be inserted) @retval DB_DUPLICATE_KEY when entry is a duplicate of rec */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t row_ins_duplicate_online( /*=====================*/ @@ -2108,7 +2108,7 @@ row_ins_duplicate_online( @retval DB_SUCCESS_LOCKED_REC when rec is an exact match of entry or a newer version of entry (the entry should not be inserted) @retval DB_DUPLICATE_KEY when entry is a duplicate of rec */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t row_ins_duplicate_error_in_clust_online( /*====================================*/ @@ -2151,7 +2151,7 @@ for a clustered index! record @retval DB_SUCCESS_LOCKED_REC if an exact match of the record was found in online table rebuild (flags & (BTR_KEEP_SYS_FLAG | BTR_NO_LOCKING_FLAG)) */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t row_ins_duplicate_error_in_clust( /*=============================*/ @@ -2576,7 +2576,7 @@ func_exit: /***************************************************************//** Starts a mini-transaction and checks if the index will be dropped. @return true if the index is to be dropped */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) bool row_ins_sec_mtr_start_trx_and_check_if_aborted( /*=======================================*/ @@ -3032,7 +3032,7 @@ row_ins_index_entry( /***********************************************************//** Sets the values of the dtuple fields in entry from the values of appropriate columns in row. */ -static __attribute__((nonnull)) +static MY_ATTRIBUTE((nonnull)) void row_ins_index_entry_set_vals( /*=========================*/ @@ -3085,7 +3085,7 @@ row_ins_index_entry_set_vals( Inserts a single index entry to the table. @return DB_SUCCESS if operation successfully completed, else error code or DB_LOCK_WAIT */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t row_ins_index_entry_step( /*=====================*/ @@ -3208,7 +3208,7 @@ row_ins_get_row_from_select( Inserts a row to a table. @return DB_SUCCESS if operation successfully completed, else error code or DB_LOCK_WAIT */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t row_ins( /*====*/ diff --git a/storage/innobase/row/row0log.cc b/storage/innobase/row/row0log.cc index bddc81d9fb3..5e32663ad32 100644 --- a/storage/innobase/row/row0log.cc +++ b/storage/innobase/row/row0log.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2011, 2015, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2011, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -205,7 +205,7 @@ struct row_log_t { /** Create the file or online log if it does not exist. @param[in,out] log online rebuild log @return file descriptor. */ -static __attribute__((warn_unused_result)) +static MY_ATTRIBUTE((warn_unused_result)) int row_log_tmpfile( row_log_t* log) @@ -221,7 +221,7 @@ row_log_tmpfile( /** Allocate the memory for the log buffer. @param[in,out] log_buf Buffer used for log operation @return TRUE if success, false if not */ -static __attribute__((warn_unused_result)) +static MY_ATTRIBUTE((warn_unused_result)) bool row_log_block_allocate( row_log_buf_t& log_buf) @@ -411,7 +411,7 @@ row_log_table_get_error( /******************************************************//** Starts logging an operation to a table that is being rebuilt. @return pointer to log, or NULL if no logging is necessary */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) byte* row_log_table_open( /*===============*/ @@ -446,7 +446,7 @@ err_exit: /******************************************************//** Stops logging an operation to a table that is being rebuilt. */ -static __attribute__((nonnull)) +static MY_ATTRIBUTE((nonnull)) void row_log_table_close_func( /*=====================*/ @@ -820,7 +820,7 @@ row_log_table_low_redundant( /******************************************************//** Logs an insert or update to a table that is being rebuilt. */ -static __attribute__((nonnull(1,2,3))) +static MY_ATTRIBUTE((nonnull(1,2,3))) void row_log_table_low( /*==============*/ @@ -1320,7 +1320,7 @@ row_log_table_blob_alloc( /******************************************************//** Converts a log record to a table row. @return converted row, or NULL if the conversion fails */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) const dtuple_t* row_log_table_apply_convert_mrec( /*=============================*/ @@ -1474,7 +1474,7 @@ blob_done: /******************************************************//** Replays an insert operation on a table that was rebuilt. @return DB_SUCCESS or error code */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t row_log_table_apply_insert_low( /*===========================*/ @@ -1556,7 +1556,7 @@ row_log_table_apply_insert_low( /******************************************************//** Replays an insert operation on a table that was rebuilt. @return DB_SUCCESS or error code */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t row_log_table_apply_insert( /*=======================*/ @@ -1608,7 +1608,7 @@ row_log_table_apply_insert( /******************************************************//** Deletes a record from a table that is being rebuilt. @return DB_SUCCESS or error code */ -static __attribute__((nonnull(1, 2, 4, 5), warn_unused_result)) +static MY_ATTRIBUTE((nonnull(1, 2, 4, 5), warn_unused_result)) dberr_t row_log_table_apply_delete_low( /*===========================*/ @@ -1706,7 +1706,7 @@ flag_ok: /******************************************************//** Replays a delete operation on a table that was rebuilt. @return DB_SUCCESS or error code */ -static __attribute__((nonnull(1, 3, 4, 5, 6, 7), warn_unused_result)) +static MY_ATTRIBUTE((nonnull(1, 3, 4, 5, 6, 7), warn_unused_result)) dberr_t row_log_table_apply_delete( /*=======================*/ @@ -1828,7 +1828,7 @@ all_done: /******************************************************//** Replays an update operation on a table that was rebuilt. @return DB_SUCCESS or error code */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t row_log_table_apply_update( /*=======================*/ @@ -2191,7 +2191,7 @@ func_exit_committed: Applies an operation to a table that was rebuilt. @return NULL on failure (mrec corruption) or when out of data; pointer to next record on success */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) const mrec_t* row_log_table_apply_op( /*===================*/ @@ -2482,7 +2482,7 @@ row_log_table_apply_op( /******************************************************//** Applies operations to a table was rebuilt. @return DB_SUCCESS, or error code on failure */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t row_log_table_apply_ops( /*====================*/ @@ -2982,7 +2982,7 @@ row_log_get_max_trx( /******************************************************//** Applies an operation to a secondary index that was being created. */ -static __attribute__((nonnull)) +static MY_ATTRIBUTE((nonnull)) void row_log_apply_op_low( /*=================*/ @@ -3209,7 +3209,7 @@ func_exit: Applies an operation to a secondary index that was being created. @return NULL on failure (mrec corruption) or when out of data; pointer to next record on success */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) const mrec_t* row_log_apply_op( /*=============*/ @@ -3334,7 +3334,7 @@ corrupted: /******************************************************//** Applies operations to a secondary index that was being created. @return DB_SUCCESS, or error code on failure */ -static __attribute__((nonnull)) +static MY_ATTRIBUTE((nonnull)) dberr_t row_log_apply_ops( /*==============*/ diff --git a/storage/innobase/row/row0merge.cc b/storage/innobase/row/row0merge.cc index 294facf9723..dbca52f820c 100644 --- a/storage/innobase/row/row0merge.cc +++ b/storage/innobase/row/row0merge.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2005, 2015, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2005, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -97,7 +97,7 @@ row_merge_encrypt_buf( key_version = encryption_key_get_latest_version(crypt_data->key_id); - /* Store key_version at the begining of the input buffer */ + /* Store key_version at the beginning of the input buffer */ mach_write_to_4((byte *)crypted_buf, key_version); int rc = encryption_scheme_encrypt(input_buf+ROW_MERGE_RESERVE_SIZE, @@ -109,9 +109,9 @@ row_merge_encrypt_buf( if (! ((rc == MY_AES_OK) && ((ulint)dstlen == srv_sort_buf_size-ROW_MERGE_RESERVE_SIZE))) { ib_logf(IB_LOG_LEVEL_FATAL, "Unable to encrypt data-block " - " src: %p srclen: %lu buf: %p buflen: %d." + " src: %p srclen: %lu buf: %p buflen: %u." " return-code: %d. Can't continue!\n", - input_buf, (size_t)srv_sort_buf_size, + input_buf, (ulong) srv_sort_buf_size, crypted_buf, dstlen, rc); ut_error; } @@ -134,7 +134,7 @@ row_merge_decrypt_buf( uint dstlen=0; os_offset_t ofs = (os_offset_t)srv_sort_buf_size * (os_offset_t)offset; - /* Read key_version from begining of the buffer */ + /* Read key_version from beginning of the buffer */ key_version = mach_read_from_4((byte *)input_buf); if (key_version == 0) { @@ -153,7 +153,7 @@ row_merge_decrypt_buf( "Unable to encrypt data-block " " src: %p srclen: %lu buf: %p buflen: %d." " return-code: %d. Can't continue!\n", - input_buf, (size_t)srv_sort_buf_size, + input_buf, (ulong) srv_sort_buf_size, crypted_buf, dstlen, rc); ut_error; } @@ -164,7 +164,7 @@ row_merge_decrypt_buf( #ifdef UNIV_DEBUG /******************************************************//** Display a merge tuple. */ -static __attribute__((nonnull)) +static MY_ATTRIBUTE((nonnull)) void row_merge_tuple_print( /*==================*/ @@ -199,7 +199,7 @@ row_merge_tuple_print( /******************************************************//** Encode an index record. */ -static __attribute__((nonnull)) +static MY_ATTRIBUTE((nonnull)) void row_merge_buf_encode( /*=================*/ @@ -236,7 +236,7 @@ row_merge_buf_encode( /******************************************************//** Allocate a sort buffer. @return own: sort buffer */ -static __attribute__((malloc, nonnull)) +static MY_ATTRIBUTE((malloc, nonnull)) row_merge_buf_t* row_merge_buf_create_low( /*=====================*/ @@ -736,7 +736,7 @@ row_merge_dup_report( /*************************************************************//** Compare two tuples. @return 1, 0, -1 if a is greater, equal, less, respectively, than b */ -static __attribute__((warn_unused_result)) +static MY_ATTRIBUTE((warn_unused_result)) int row_merge_tuple_cmp( /*================*/ @@ -815,7 +815,7 @@ UT_SORT_FUNCTION_BODY(). /**********************************************************************//** Merge sort the tuple buffer in main memory. */ -static __attribute__((nonnull(4,5))) +static MY_ATTRIBUTE((nonnull(4,5))) void row_merge_tuple_sort( /*=================*/ @@ -1391,7 +1391,7 @@ row_merge_write_eof( @param[in,out] tmpfd temporary file handle @param[in] path path to create temporary file @return file descriptor, or -1 on failure */ -static __attribute__((warn_unused_result)) +static MY_ATTRIBUTE((warn_unused_result)) int row_merge_tmpfile_if_needed( int* tmpfd, @@ -1410,7 +1410,7 @@ row_merge_tmpfile_if_needed( @param[in] nrec number of records in the file @param[in] path path to create temporary files @return file descriptor, or -1 on failure */ -static __attribute__((warn_unused_result)) +static MY_ATTRIBUTE((warn_unused_result)) int row_merge_file_create_if_needed( merge_file_t* file, @@ -1459,7 +1459,7 @@ containing the index entries for the indexes to be built. @param[in] crypt_data crypt data or NULL @param[in,out] crypt_block crypted file buffer return DB_SUCCESS or error */ -static __attribute__((nonnull(1,2,3,4,6,9,10,16), warn_unused_result)) +static MY_ATTRIBUTE((nonnull(1,2,3,4,6,9,10,16), warn_unused_result)) dberr_t row_merge_read_clustered_index( trx_t* trx, @@ -2067,7 +2067,7 @@ write_buffers: pct_cost : ((pct_cost * read_rows) / table_total_rows); /* presenting 10.12% as 1012 integer */ - onlineddl_pct_progress = curr_progress * 100; + onlineddl_pct_progress = (ulint) (curr_progress * 100); } } @@ -2169,7 +2169,8 @@ wait_again: if (max_doc_id && err == DB_SUCCESS) { /* Sync fts cache for other fts indexes to keep all fts indexes consistent in sync_doc_id. */ - err = fts_sync_table(const_cast(new_table)); + err = fts_sync_table(const_cast(new_table), + false, true); if (err == DB_SUCCESS) { fts_update_next_doc_id( @@ -2603,7 +2604,7 @@ row_merge_sort( /* Find the number N which 2^N is greater or equal than num_runs */ /* N is merge sort running count */ - total_merge_sort_count = ceil(my_log2f(num_runs)); + total_merge_sort_count = (ulint) ceil(my_log2f(num_runs)); if(total_merge_sort_count <= 0) { total_merge_sort_count=1; } @@ -2624,10 +2625,16 @@ row_merge_sort( of file marker). Thus, it must be at least one block. */ ut_ad(file->offset > 0); + /* These thd_progress* calls will crash on sol10-64 when innodb_plugin + is used. MDEV-9356: innodb.innodb_bug53290 fails (crashes) on + sol10-64 in buildbot. + */ +#ifndef UNIV_SOLARIS /* Progress report only for "normal" indexes. */ if (!(dup->index->type & DICT_FTS)) { thd_progress_init(trx->mysql_thd, 1); } +#endif /* UNIV_SOLARIS */ sql_print_information("InnoDB: Online DDL : merge-sorting has estimated %lu runs", num_runs); @@ -2636,9 +2643,11 @@ row_merge_sort( /* Report progress of merge sort to MySQL for show processlist progress field */ /* Progress report only for "normal" indexes. */ +#ifndef UNIV_SOLARIS if (!(dup->index->type & DICT_FTS)) { thd_progress_report(trx->mysql_thd, file->offset - num_runs, file->offset); } +#endif /* UNIV_SOLARIS */ error = row_merge(trx, dup, file, block, tmpfd, &num_runs, run_offset, @@ -2650,7 +2659,7 @@ row_merge_sort( pct_cost : ((pct_cost * merge_count) / total_merge_sort_count); /* presenting 10.12% as 1012 integer */; - onlineddl_pct_progress = (pct_progress + curr_progress) * 100; + onlineddl_pct_progress = (ulint) ((pct_progress + curr_progress) * 100); } if (error != DB_SUCCESS) { @@ -2663,16 +2672,18 @@ row_merge_sort( mem_free(run_offset); /* Progress report only for "normal" indexes. */ +#ifndef UNIV_SOLARIS if (!(dup->index->type & DICT_FTS)) { thd_progress_end(trx->mysql_thd); } +#endif /* UNIV_SOLARIS */ DBUG_RETURN(error); } /*************************************************************//** Copy externally stored columns to the data tuple. */ -static __attribute__((nonnull)) +static MY_ATTRIBUTE((nonnull)) void row_merge_copy_blobs( /*=================*/ @@ -2933,7 +2944,7 @@ row_merge_insert_index_tuples( ((pct_cost * inserted_rows) / table_total_rows); /* presenting 10.12% as 1012 integer */; - onlineddl_pct_progress = (pct_progress + curr_progress) * 100; + onlineddl_pct_progress = (ulint) ((pct_progress + curr_progress) * 100); } } } @@ -3754,7 +3765,7 @@ row_merge_rename_tables_dict( /*********************************************************************//** Create and execute a query graph for creating an index. @return DB_SUCCESS or error code */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t row_merge_create_index_graph( /*=========================*/ @@ -3906,7 +3917,7 @@ row_merge_drop_table( /* There must be no open transactions on the table. */ ut_a(table->n_ref_count == 0); - return(row_drop_table_for_mysql(table->name, trx, false, false)); + return(row_drop_table_for_mysql(table->name, trx, false, false, false)); } /*********************************************************************//** diff --git a/storage/innobase/row/row0mysql.cc b/storage/innobase/row/row0mysql.cc index 24d25a0b2c8..a5ab4f4911e 100644 --- a/storage/innobase/row/row0mysql.cc +++ b/storage/innobase/row/row0mysql.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2000, 2015, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2000, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -1432,9 +1432,12 @@ error_exit: } /* Difference between Doc IDs are restricted within - 4 bytes integer. See fts_get_encoded_len() */ + 4 bytes integer. See fts_get_encoded_len(). Consecutive + doc_ids difference should not exceed + FTS_DOC_ID_MAX_STEP value. */ - if (doc_id - next_doc_id >= FTS_DOC_ID_MAX_STEP) { + if (next_doc_id > 1 + && doc_id - next_doc_id >= FTS_DOC_ID_MAX_STEP) { fprintf(stderr, "InnoDB: Doc ID " UINT64PF " is too" " big. Its difference with largest" @@ -1700,7 +1703,8 @@ row_update_for_mysql( trx_t* trx = prebuilt->trx; ulint fk_depth = 0; - ut_ad(prebuilt && trx); + ut_ad(prebuilt != NULL); + ut_ad(trx != NULL); UT_NOT_USED(mysql_rec); if (prebuilt->table->ibd_file_missing) { @@ -1917,7 +1921,8 @@ row_unlock_for_mysql( btr_pcur_t* clust_pcur = &prebuilt->clust_pcur; trx_t* trx = prebuilt->trx; - ut_ad(prebuilt && trx); + ut_ad(prebuilt != NULL); + ut_ad(trx != NULL); if (UNIV_UNLIKELY (!srv_locks_unsafe_for_binlog @@ -2405,7 +2410,7 @@ err_exit: dict_table_close(table, TRUE, FALSE); - row_drop_table_for_mysql(table->name, trx, FALSE); + row_drop_table_for_mysql(table->name, trx, FALSE, TRUE); if (commit) { trx_commit_for_mysql(trx); @@ -2565,7 +2570,7 @@ error_handling: trx_rollback_to_savepoint(trx, NULL); - row_drop_table_for_mysql(table_name, trx, FALSE); + row_drop_table_for_mysql(table_name, trx, FALSE, TRUE); trx_commit_for_mysql(trx); @@ -2642,7 +2647,7 @@ row_table_add_foreign_constraints( trx_rollback_to_savepoint(trx, NULL); - row_drop_table_for_mysql(name, trx, FALSE); + row_drop_table_for_mysql(name, trx, FALSE, TRUE); trx_commit_for_mysql(trx); @@ -2683,7 +2688,7 @@ row_drop_table_for_mysql_in_background( /* Try to drop the table in InnoDB */ - error = row_drop_table_for_mysql(name, trx, FALSE); + error = row_drop_table_for_mysql(name, trx, FALSE, FALSE); /* Flush the log to reduce probability that the .frm files and the InnoDB data dictionary get out-of-sync if the user runs @@ -3830,6 +3835,9 @@ row_drop_table_for_mysql( const char* name, /*!< in: table name */ trx_t* trx, /*!< in: transaction handle */ bool drop_db,/*!< in: true=dropping whole database */ + ibool create_failed,/*!foreign_table_name_lookup); - if (foreign->foreign_table != table && !ref_ok) { + /* We should allow dropping a referenced table if creating + that referenced table has failed for some reason. For example + if referenced table is created but it column types that are + referenced do not match. */ + if (foreign->foreign_table != table && + !create_failed && !ref_ok) { FILE* ef = dict_foreign_err_file; @@ -4578,7 +4591,7 @@ row_mysql_drop_temp_tables(void) table = dict_load_table(table_name, TRUE, DICT_ERR_IGNORE_NONE); if (table) { - row_drop_table_for_mysql(table_name, trx, FALSE); + row_drop_table_for_mysql(table_name, trx, FALSE, FALSE); trx_commit_for_mysql(trx); } @@ -4598,7 +4611,7 @@ row_mysql_drop_temp_tables(void) Drop all foreign keys in a database, see Bug#18942. Called at the end of row_drop_database_for_mysql(). @return error code or DB_SUCCESS */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t drop_all_foreign_keys_in_db( /*========================*/ @@ -4747,7 +4760,7 @@ loop: goto loop; } - err = row_drop_table_for_mysql(table_name, trx, TRUE); + err = row_drop_table_for_mysql(table_name, trx, TRUE, FALSE); trx_commit_for_mysql(trx); if (err != DB_SUCCESS) { @@ -4790,7 +4803,7 @@ loop: Checks if a table name contains the string "/#sql" which denotes temporary tables in MySQL. @return true if temporary table */ -UNIV_INTERN __attribute__((warn_unused_result)) +UNIV_INTERN MY_ATTRIBUTE((warn_unused_result)) bool row_is_mysql_tmp_table_name( /*========================*/ @@ -4804,7 +4817,7 @@ row_is_mysql_tmp_table_name( /****************************************************************//** Delete a single constraint. @return error code or DB_SUCCESS */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t row_delete_constraint_low( /*======================*/ @@ -4827,7 +4840,7 @@ row_delete_constraint_low( /****************************************************************//** Delete a single constraint. @return error code or DB_SUCCESS */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t row_delete_constraint( /*==================*/ diff --git a/storage/innobase/row/row0purge.cc b/storage/innobase/row/row0purge.cc index b26ba971a95..bc2e0b0e1cb 100644 --- a/storage/innobase/row/row0purge.cc +++ b/storage/innobase/row/row0purge.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1997, 2015, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1997, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -69,7 +69,8 @@ row_purge_node_create( { purge_node_t* node; - ut_ad(parent && heap); + ut_ad(parent != NULL); + ut_ad(heap != NULL); node = static_cast( mem_heap_zalloc(heap, sizeof(*node))); @@ -120,7 +121,7 @@ row_purge_reposition_pcur( Removes a delete marked clustered index record if possible. @retval true if the row was not found, or it was successfully removed @retval false if the row was modified after the delete marking */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) bool row_purge_remove_clust_if_poss_low( /*===============================*/ @@ -202,7 +203,7 @@ marking. @retval true if the row was not found, or it was successfully removed @retval false the purge needs to be suspended because of running out of file space. */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) bool row_purge_remove_clust_if_poss( /*===========================*/ @@ -274,7 +275,7 @@ row_purge_poss_sec( Removes a secondary index entry if possible, by modifying the index tree. Does not try to buffer the delete. @return TRUE if success or if not found */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) ibool row_purge_remove_sec_if_poss_tree( /*==============================*/ @@ -396,7 +397,7 @@ Removes a secondary index entry without modifying the index tree, if possible. @retval true if success or if not found @retval false if row_purge_remove_sec_if_poss_tree() should be invoked */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) bool row_purge_remove_sec_if_poss_leaf( /*==============================*/ @@ -507,7 +508,7 @@ row_purge_remove_sec_if_poss_leaf( /***********************************************************//** Removes a secondary index entry if possible. */ -UNIV_INLINE __attribute__((nonnull(1,2))) +UNIV_INLINE MY_ATTRIBUTE((nonnull(1,2))) void row_purge_remove_sec_if_poss( /*=========================*/ @@ -554,7 +555,7 @@ Purges a delete marking of a record. @retval true if the row was not found, or it was successfully removed @retval false the purge needs to be suspended because of running out of file space */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) bool row_purge_del_mark( /*===============*/ @@ -745,7 +746,8 @@ row_purge_parse_undo_rec( ulint info_bits; ulint type; - ut_ad(node && thr); + ut_ad(node != NULL); + ut_ad(thr != NULL); ptr = trx_undo_rec_get_pars( undo_rec, &type, &node->cmpl_info, @@ -830,7 +832,7 @@ err_exit: /***********************************************************//** Purges the parsed record. @return true if purged, false if skipped */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) bool row_purge_record_func( /*==================*/ @@ -895,7 +897,7 @@ row_purge_record_func( Fetches an undo log record and does the purge for the recorded operation. If none left, or the current purge completed, returns the control to the parent node, which is always a query thread node. */ -static __attribute__((nonnull)) +static MY_ATTRIBUTE((nonnull)) void row_purge( /*======*/ diff --git a/storage/innobase/row/row0quiesce.cc b/storage/innobase/row/row0quiesce.cc index ecd6f47947b..583fbe60fb3 100644 --- a/storage/innobase/row/row0quiesce.cc +++ b/storage/innobase/row/row0quiesce.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2012, 2014, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2012, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -37,7 +37,7 @@ Created 2012-02-08 by Sunny Bains. /*********************************************************************//** Write the meta data (index user fields) config file. @return DB_SUCCESS or error code. */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t row_quiesce_write_index_fields( /*===========================*/ @@ -97,7 +97,7 @@ row_quiesce_write_index_fields( /*********************************************************************//** Write the meta data config file index information. @return DB_SUCCESS or error code. */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t row_quiesce_write_indexes( /*======================*/ @@ -210,7 +210,7 @@ Write the meta data (table columns) config file. Serialise the contents of dict_col_t structure, along with the column name. All fields are serialized as ib_uint32_t. @return DB_SUCCESS or error code. */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t row_quiesce_write_table( /*====================*/ @@ -293,7 +293,7 @@ row_quiesce_write_table( /*********************************************************************//** Write the meta data config file header. @return DB_SUCCESS or error code. */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t row_quiesce_write_header( /*=====================*/ @@ -415,7 +415,7 @@ row_quiesce_write_header( /*********************************************************************//** Write the table meta data after quiesce. @return DB_SUCCESS or error code */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t row_quiesce_write_cfg( /*==================*/ @@ -530,10 +530,8 @@ row_quiesce_table_start( trx_purge_stop(); } - ut_a(table->id > 0); - for (ulint count = 0; - ibuf_contract_in_background(table->id, TRUE) != 0 + ibuf_merge_space(table->space) != 0 && !trx_is_interrupted(trx); ++count) { if (!(count % 20)) { diff --git a/storage/innobase/row/row0row.cc b/storage/innobase/row/row0row.cc index be786f954fb..96d25e15777 100644 --- a/storage/innobase/row/row0row.cc +++ b/storage/innobase/row/row0row.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -240,7 +240,9 @@ row_build( ulint offsets_[REC_OFFS_NORMAL_SIZE]; rec_offs_init(offsets_); - ut_ad(index && rec && heap); + ut_ad(index != NULL); + ut_ad(rec != NULL); + ut_ad(heap != NULL); ut_ad(dict_index_is_clust(index)); ut_ad(!mutex_own(&trx_sys->mutex)); ut_ad(!col_map || col_table); @@ -409,7 +411,9 @@ row_rec_to_index_entry_low( ulint len; ulint rec_len; - ut_ad(rec && heap && index); + ut_ad(rec != NULL); + ut_ad(heap != NULL); + ut_ad(index != NULL); /* Because this function may be invoked by row0merge.cc on a record whose header is in different format, the check rec_offs_validate(rec, index, offsets) must be avoided here. */ @@ -464,7 +468,9 @@ row_rec_to_index_entry( byte* buf; const rec_t* copy_rec; - ut_ad(rec && heap && index); + ut_ad(rec != NULL); + ut_ad(heap != NULL); + ut_ad(index != NULL); ut_ad(rec_offs_validate(rec, index, offsets)); /* Take a copy of rec to heap */ @@ -523,7 +529,9 @@ row_build_row_ref( ulint* offsets = offsets_; rec_offs_init(offsets_); - ut_ad(index && rec && heap); + ut_ad(index != NULL); + ut_ad(rec != NULL); + ut_ad(heap != NULL); ut_ad(!dict_index_is_clust(index)); offsets = rec_get_offsets(rec, index, offsets, diff --git a/storage/innobase/row/row0sel.cc b/storage/innobase/row/row0sel.cc index ea2f93dd788..dab1bc58db5 100644 --- a/storage/innobase/row/row0sel.cc +++ b/storage/innobase/row/row0sel.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1997, 2015, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1997, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2008, Google Inc. Copyright (c) 2015, MariaDB Corporation. @@ -678,7 +678,7 @@ sel_enqueue_prefetched_row( /*********************************************************************//** Builds a previous version of a clustered index record for a consistent read @return DB_SUCCESS or error code */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t row_sel_build_prev_vers( /*====================*/ @@ -713,7 +713,7 @@ row_sel_build_prev_vers( /*********************************************************************//** Builds the last committed version of a clustered index record for a semi-consistent read. */ -static __attribute__((nonnull)) +static MY_ATTRIBUTE((nonnull)) void row_sel_build_committed_vers_for_mysql( /*===================================*/ @@ -811,7 +811,7 @@ row_sel_test_other_conds( Retrieves the clustered index record corresponding to a record in a non-clustered index. Does the necessary locking. @return DB_SUCCESS or error code */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t row_sel_get_clust_rec( /*==================*/ @@ -1314,7 +1314,7 @@ func_exit: /*********************************************************************//** Performs a select step. @return DB_SUCCESS or error code */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t row_sel( /*====*/ @@ -2561,7 +2561,7 @@ row_sel_store_row_id_to_prebuilt( /**************************************************************//** Stores a non-SQL-NULL field in the MySQL format. The counterpart of this function is row_mysql_store_col_in_innobase_format() in row0mysql.cc. */ -static __attribute__((nonnull)) +static MY_ATTRIBUTE((nonnull)) void row_sel_field_store_in_mysql_format_func( /*=====================================*/ @@ -2750,7 +2750,7 @@ row_sel_field_store_in_mysql_format_func( #endif /* UNIV_DEBUG */ /**************************************************************//** Convert a field in the Innobase format to a field in the MySQL format. */ -static __attribute__((warn_unused_result)) +static MY_ATTRIBUTE((warn_unused_result)) ibool row_sel_store_mysql_field_func( /*===========================*/ @@ -2900,7 +2900,7 @@ Note that the template in prebuilt may advise us to copy only a few columns to mysql_rec, other columns are left blank. All columns may not be needed in the query. @return TRUE on success, FALSE if not all columns could be retrieved */ -static __attribute__((warn_unused_result)) +static MY_ATTRIBUTE((warn_unused_result)) ibool row_sel_store_mysql_rec( /*====================*/ @@ -2967,7 +2967,7 @@ row_sel_store_mysql_rec( /*********************************************************************//** Builds a previous version of a clustered index record for a consistent read @return DB_SUCCESS or error code */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t row_sel_build_prev_vers_for_mysql( /*==============================*/ @@ -3004,7 +3004,7 @@ Retrieves the clustered index record corresponding to a record in a non-clustered index. Does the necessary locking. Used in the MySQL interface. @return DB_SUCCESS, DB_SUCCESS_LOCKED_REC, or error code */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t row_sel_get_clust_rec_for_mysql( /*============================*/ diff --git a/storage/innobase/row/row0uins.cc b/storage/innobase/row/row0uins.cc index 849bf096492..651042fb820 100644 --- a/storage/innobase/row/row0uins.cc +++ b/storage/innobase/row/row0uins.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1997, 2014, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1997, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -61,7 +61,7 @@ introduced where a call to log_free_check() is bypassed. */ Removes a clustered index record. The pcur in node was positioned on the record, now it is detached. @return DB_SUCCESS or DB_OUT_OF_FILE_SPACE */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t row_undo_ins_remove_clust_rec( /*==========================*/ @@ -176,7 +176,7 @@ func_exit: /***************************************************************//** Removes a secondary index entry if found. @return DB_SUCCESS, DB_FAIL, or DB_OUT_OF_FILE_SPACE */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t row_undo_ins_remove_sec_low( /*========================*/ @@ -251,7 +251,7 @@ func_exit_no_pcur: Removes a secondary index entry from the index if found. Tries first optimistic, then pessimistic descent down the tree. @return DB_SUCCESS or DB_OUT_OF_FILE_SPACE */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t row_undo_ins_remove_sec( /*====================*/ @@ -350,7 +350,7 @@ close_table: /***************************************************************//** Removes secondary index records. @return DB_SUCCESS or DB_OUT_OF_FILE_SPACE */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t row_undo_ins_remove_sec_rec( /*========================*/ diff --git a/storage/innobase/row/row0umod.cc b/storage/innobase/row/row0umod.cc index 7649add4b33..a64e41786d6 100644 --- a/storage/innobase/row/row0umod.cc +++ b/storage/innobase/row/row0umod.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1997, 2014, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1997, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -72,7 +72,7 @@ introduced where a call to log_free_check() is bypassed. */ /***********************************************************//** Undoes a modify in a clustered index record. @return DB_SUCCESS, DB_FAIL, or error code: we may run out of file space */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t row_undo_mod_clust_low( /*===================*/ @@ -154,7 +154,7 @@ This is attempted when the record was inserted by updating a delete-marked record and there no longer exist transactions that would see the delete-marked record. @return DB_SUCCESS, DB_FAIL, or error code: we may run out of file space */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t row_undo_mod_remove_clust_low( /*==========================*/ @@ -273,7 +273,7 @@ row_undo_mod_remove_clust_low( Undoes a modify in a clustered index record. Sets also the node state for the next round of undo. @return DB_SUCCESS or error code: we may run out of file space */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t row_undo_mod_clust( /*===============*/ @@ -417,7 +417,7 @@ row_undo_mod_clust( /***********************************************************//** Delete marks or removes a secondary index entry if found. @return DB_SUCCESS, DB_FAIL, or DB_OUT_OF_FILE_SPACE */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t row_undo_mod_del_mark_or_remove_sec_low( /*====================================*/ @@ -553,7 +553,7 @@ not cause problems because in row0sel.cc, in queries we always retrieve the clustered index record or an earlier version of it, if the secondary index record through which we do the search is delete-marked. @return DB_SUCCESS or DB_OUT_OF_FILE_SPACE */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t row_undo_mod_del_mark_or_remove_sec( /*================================*/ @@ -586,7 +586,7 @@ fields but alphabetically they stayed the same, e.g., 'abc' -> 'aBc'. @retval DB_OUT_OF_FILE_SPACE when running out of tablespace @retval DB_DUPLICATE_KEY if the value was missing and an insert would lead to a duplicate exists */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t row_undo_mod_del_unmark_sec_and_undo_update( /*========================================*/ @@ -782,7 +782,7 @@ func_exit_no_pcur: /***********************************************************//** Flags a secondary index corrupted. */ -static __attribute__((nonnull)) +static MY_ATTRIBUTE((nonnull)) void row_undo_mod_sec_flag_corrupted( /*============================*/ @@ -814,7 +814,7 @@ row_undo_mod_sec_flag_corrupted( /***********************************************************//** Undoes a modify in secondary indexes when undo record type is UPD_DEL. @return DB_SUCCESS or DB_OUT_OF_FILE_SPACE */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t row_undo_mod_upd_del_sec( /*=====================*/ @@ -881,7 +881,7 @@ row_undo_mod_upd_del_sec( /***********************************************************//** Undoes a modify in secondary indexes when undo record type is DEL_MARK. @return DB_SUCCESS or DB_OUT_OF_FILE_SPACE */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t row_undo_mod_del_mark_sec( /*======================*/ @@ -949,7 +949,7 @@ row_undo_mod_del_mark_sec( /***********************************************************//** Undoes a modify in secondary indexes when undo record type is UPD_EXIST. @return DB_SUCCESS or DB_OUT_OF_FILE_SPACE */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t row_undo_mod_upd_exist_sec( /*=======================*/ @@ -1065,7 +1065,7 @@ row_undo_mod_upd_exist_sec( /***********************************************************//** Parses the row reference and other info in a modify undo log record. */ -static __attribute__((nonnull)) +static MY_ATTRIBUTE((nonnull)) void row_undo_mod_parse_undo_rec( /*========================*/ @@ -1142,7 +1142,8 @@ row_undo_mod( dberr_t err; ibool dict_locked; - ut_ad(node && thr); + ut_ad(node != NULL); + ut_ad(thr != NULL); ut_ad(node->state == UNDO_NODE_MODIFY); dict_locked = thr_get_trx(thr)->dict_operation_lock_mode == RW_X_LATCH; diff --git a/storage/innobase/row/row0undo.cc b/storage/innobase/row/row0undo.cc index 9977a1e8f04..149dc671930 100644 --- a/storage/innobase/row/row0undo.cc +++ b/storage/innobase/row/row0undo.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1997, 2012, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1997, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -245,7 +245,7 @@ Fetches an undo log record and does the undo for the recorded operation. If none left, or a partial rollback completed, returns control to the parent node, which is always a query thread node. @return DB_SUCCESS if operation successfully completed, else error code */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t row_undo( /*=====*/ @@ -257,7 +257,8 @@ row_undo( roll_ptr_t roll_ptr; ibool locked_data_dict; - ut_ad(node && thr); + ut_ad(node != NULL); + ut_ad(thr != NULL); trx = node->trx; diff --git a/storage/innobase/row/row0upd.cc b/storage/innobase/row/row0upd.cc index 0ea4865d15f..85cd0e6d172 100644 --- a/storage/innobase/row/row0upd.cc +++ b/storage/innobase/row/row0upd.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2014, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -219,7 +219,7 @@ NOTE that this function will temporarily commit mtr and lose the pcur position! @return DB_SUCCESS or an error code */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t row_upd_check_references_constraints( /*=================================*/ @@ -775,7 +775,7 @@ row_upd_write_sys_vals_to_log( roll_ptr_t roll_ptr,/*!< in: roll ptr of the undo log record */ byte* log_ptr,/*!< pointer to a buffer of size > 20 opened in mlog */ - mtr_t* mtr __attribute__((unused))) /*!< in: mtr */ + mtr_t* mtr MY_ATTRIBUTE((unused))) /*!< in: mtr */ { ut_ad(dict_index_is_clust(index)); ut_ad(mtr); @@ -1810,7 +1810,7 @@ row_upd_store_row( Updates a secondary index entry of a row. @return DB_SUCCESS if operation successfully completed, else error code or DB_LOCK_WAIT */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t row_upd_sec_index_entry( /*====================*/ @@ -2049,7 +2049,7 @@ Updates the secondary index record if it is changed in the row update or deletes it if this is a delete. @return DB_SUCCESS if operation successfully completed, else error code or DB_LOCK_WAIT */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t row_upd_sec_step( /*=============*/ @@ -2082,7 +2082,7 @@ updated. We must mark them as inherited in entry, so that they are not freed in a rollback. A limited version of this function used to be called btr_cur_mark_dtuple_inherited_extern(). @return TRUE if any columns were inherited */ -static __attribute__((warn_unused_result)) +static MY_ATTRIBUTE((warn_unused_result)) ibool row_upd_clust_rec_by_insert_inherit_func( /*=====================================*/ @@ -2161,7 +2161,7 @@ fields of the clustered index record change. This should be quite rare in database applications. @return DB_SUCCESS if operation successfully completed, else error code or DB_LOCK_WAIT */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t row_upd_clust_rec_by_insert( /*========================*/ @@ -2320,7 +2320,7 @@ Updates a clustered index record of a row when the ordering fields do not change. @return DB_SUCCESS if operation successfully completed, else error code or DB_LOCK_WAIT */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t row_upd_clust_rec( /*==============*/ @@ -2479,7 +2479,7 @@ func_exit: /***********************************************************//** Delete marks a clustered index record. @return DB_SUCCESS if operation successfully completed, else error code */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t row_upd_del_mark_clust_rec( /*=======================*/ @@ -2572,7 +2572,7 @@ row_upd_del_mark_clust_rec( Updates the clustered index record. @return DB_SUCCESS if operation successfully completed, DB_LOCK_WAIT in case of a lock wait, else error code */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t row_upd_clust_step( /*===============*/ @@ -2780,7 +2780,7 @@ to this node, we assume that we have a persistent cursor which was on a record, and the position of the cursor is stored in the cursor. @return DB_SUCCESS if operation successfully completed, else error code or DB_LOCK_WAIT */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t row_upd( /*====*/ @@ -2789,7 +2789,8 @@ row_upd( { dberr_t err = DB_SUCCESS; - ut_ad(node && thr); + ut_ad(node != NULL); + ut_ad(thr != NULL); if (UNIV_LIKELY(node->in_mysql_interface)) { diff --git a/storage/innobase/srv/srv0conc.cc b/storage/innobase/srv/srv0conc.cc index 8942eb20080..7904cd8800d 100644 --- a/storage/innobase/srv/srv0conc.cc +++ b/storage/innobase/srv/srv0conc.cc @@ -109,7 +109,7 @@ UNIV_INTERN mysql_pfs_key_t srv_conc_mutex_key; /** Variables tracking the active and waiting threads. */ struct srv_conc_t { - char pad[64 - (sizeof(ulint) + sizeof(lint))]; + char pad[CACHE_LINE_SIZE - (sizeof(ulint) + sizeof(lint))]; /** Number of transactions that have declared_to_be_inside_innodb set. It used to be a non-error for this value to drop below zero temporarily. diff --git a/storage/innobase/srv/srv0srv.cc b/storage/innobase/srv/srv0srv.cc index c28f889dfcc..e17b27b44fc 100644 --- a/storage/innobase/srv/srv0srv.cc +++ b/storage/innobase/srv/srv0srv.cc @@ -1686,7 +1686,7 @@ extern "C" UNIV_INTERN os_thread_ret_t DECLARE_THREAD(srv_monitor_thread)( /*===============================*/ - void* arg __attribute__((unused))) + void* arg MY_ATTRIBUTE((unused))) /*!< in: a dummy parameter required by os_thread_create */ { @@ -1863,7 +1863,7 @@ extern "C" UNIV_INTERN os_thread_ret_t DECLARE_THREAD(srv_error_monitor_thread)( /*=====================================*/ - void* arg __attribute__((unused))) + void* arg MY_ATTRIBUTE((unused))) /*!< in: a dummy parameter required by os_thread_create */ { @@ -2309,7 +2309,7 @@ srv_master_do_active_tasks(void) /* Do an ibuf merge */ srv_main_thread_op_info = "doing insert buffer merge"; counter_time = ut_time_us(NULL); - ibuf_contract_in_background(0, FALSE); + ibuf_merge_in_background(false); MONITOR_INC_TIME_IN_MICRO_SECS( MONITOR_SRV_IBUF_MERGE_MICROSECOND, counter_time); @@ -2404,7 +2404,7 @@ srv_master_do_idle_tasks(void) /* Do an ibuf merge */ counter_time = ut_time_us(NULL); srv_main_thread_op_info = "doing insert buffer merge"; - ibuf_contract_in_background(0, TRUE); + ibuf_merge_in_background(true); MONITOR_INC_TIME_IN_MICRO_SECS( MONITOR_SRV_IBUF_MERGE_MICROSECOND, counter_time); @@ -2482,7 +2482,7 @@ srv_master_do_shutdown_tasks( /* Do an ibuf merge */ srv_main_thread_op_info = "doing insert buffer merge"; - n_bytes_merged = ibuf_contract_in_background(0, TRUE); + n_bytes_merged = ibuf_merge_in_background(true); /* Flush logs if needed */ srv_sync_log_buffer_in_background(); @@ -2522,7 +2522,7 @@ extern "C" UNIV_INTERN os_thread_ret_t DECLARE_THREAD(srv_master_thread)( /*==============================*/ - void* arg __attribute__((unused))) + void* arg MY_ATTRIBUTE((unused))) /*!< in: a dummy parameter required by os_thread_create */ { @@ -2666,7 +2666,7 @@ extern "C" UNIV_INTERN os_thread_ret_t DECLARE_THREAD(srv_worker_thread)( /*==============================*/ - void* arg __attribute__((unused))) /*!< in: a dummy parameter + void* arg MY_ATTRIBUTE((unused))) /*!< in: a dummy parameter required by os_thread_create */ { srv_slot_t* slot; @@ -2924,7 +2924,7 @@ extern "C" UNIV_INTERN os_thread_ret_t DECLARE_THREAD(srv_purge_coordinator_thread)( /*=========================================*/ - void* arg __attribute__((unused))) /*!< in: a dummy parameter + void* arg MY_ATTRIBUTE((unused))) /*!< in: a dummy parameter required by os_thread_create */ { srv_slot_t* slot; diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc index 4a457ae6f00..0b81ad86f1c 100644 --- a/storage/innobase/srv/srv0start.cc +++ b/storage/innobase/srv/srv0start.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved. Copyright (c) 2008, Google Inc. Copyright (c) 2009, Percona Inc. Copyright (c) 2013, 2015, MariaDB Corporation @@ -532,7 +532,7 @@ UNIV_INTERN void srv_normalize_path_for_win( /*=======================*/ - char* str __attribute__((unused))) /*!< in/out: null-terminated + char* str MY_ATTRIBUTE((unused))) /*!< in/out: null-terminated character string */ { #ifdef __WIN__ @@ -549,7 +549,7 @@ srv_normalize_path_for_win( /*********************************************************************//** Creates a log file. @return DB_SUCCESS or error code */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t create_log_file( /*============*/ @@ -757,7 +757,7 @@ create_log_files_rename( /*********************************************************************//** Opens a log file. @return DB_SUCCESS or error code */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t open_log_file( /*==========*/ @@ -785,7 +785,7 @@ open_log_file( /*********************************************************************//** Creates or opens database data files and closes them. @return DB_SUCCESS or error code */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t open_or_create_data_files( /*======================*/ diff --git a/storage/innobase/sync/sync0sync.cc b/storage/innobase/sync/sync0sync.cc index 7eb3d0bd6f2..3e3ce353724 100644 --- a/storage/innobase/sync/sync0sync.cc +++ b/storage/innobase/sync/sync0sync.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2008, Google Inc. Portions of this file contain modifications contributed and copyrighted by @@ -386,10 +386,10 @@ ulint mutex_enter_nowait_func( /*====================*/ ib_mutex_t* mutex, /*!< in: pointer to mutex */ - const char* file_name __attribute__((unused)), + const char* file_name MY_ATTRIBUTE((unused)), /*!< in: file name where mutex requested */ - ulint line __attribute__((unused))) + ulint line MY_ATTRIBUTE((unused))) /*!< in: line where requested */ { ut_ad(mutex_validate(mutex)); diff --git a/storage/innobase/trx/trx0purge.cc b/storage/innobase/trx/trx0purge.cc index 56d46311f62..efc600d16b1 100644 --- a/storage/innobase/trx/trx0purge.cc +++ b/storage/innobase/trx/trx0purge.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -913,7 +913,7 @@ Fetches the next undo log record from the history list to purge. It must be released with the corresponding release function. @return copy of an undo log record or pointer to trx_purge_dummy_rec, if the whole undo log can skipped in purge; NULL if none left */ -static __attribute__((warn_unused_result, nonnull)) +static MY_ATTRIBUTE((warn_unused_result, nonnull)) trx_undo_rec_t* trx_purge_fetch_next_rec( /*=====================*/ diff --git a/storage/innobase/trx/trx0rec.cc b/storage/innobase/trx/trx0rec.cc index fa3fe0904b8..74a63b60286 100644 --- a/storage/innobase/trx/trx0rec.cc +++ b/storage/innobase/trx/trx0rec.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -1133,7 +1133,7 @@ trx_undo_rec_get_partial_row( /***********************************************************************//** Erases the unused undo log page end. @return TRUE if the page contained something, FALSE if it was empty */ -static __attribute__((nonnull)) +static MY_ATTRIBUTE((nonnull)) ibool trx_undo_erase_page_end( /*====================*/ @@ -1159,7 +1159,7 @@ byte* trx_undo_parse_erase_page_end( /*==========================*/ byte* ptr, /*!< in: buffer */ - byte* end_ptr __attribute__((unused)), /*!< in: buffer end */ + byte* end_ptr MY_ATTRIBUTE((unused)), /*!< in: buffer end */ page_t* page, /*!< in: page or NULL */ mtr_t* mtr) /*!< in: mtr or NULL */ { @@ -1442,7 +1442,7 @@ NOTE: the caller must have latches on the clustered index page. @retval true if the undo log has been truncated and we cannot fetch the old version @retval false if the undo log record is available */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) bool trx_undo_get_undo_rec( /*==================*/ @@ -1470,7 +1470,7 @@ trx_undo_get_undo_rec( #ifdef UNIV_DEBUG #define ATTRIB_USED_ONLY_IN_DEBUG #else /* UNIV_DEBUG */ -#define ATTRIB_USED_ONLY_IN_DEBUG __attribute__((unused)) +#define ATTRIB_USED_ONLY_IN_DEBUG MY_ATTRIBUTE((unused)) #endif /* UNIV_DEBUG */ /*******************************************************************//** diff --git a/storage/innobase/trx/trx0roll.cc b/storage/innobase/trx/trx0roll.cc index e2c3c0b949c..c65d95a9817 100644 --- a/storage/innobase/trx/trx0roll.cc +++ b/storage/innobase/trx/trx0roll.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2014, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -336,7 +336,7 @@ the row, these locks are naturally released in the rollback. Savepoints which were set after this savepoint are deleted. @return if no savepoint of the name found then DB_NO_SAVEPOINT, otherwise DB_SUCCESS */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t trx_rollback_to_savepoint_for_mysql_low( /*====================================*/ @@ -641,7 +641,7 @@ trx_rollback_active( "in recovery", table->name, trx->table_id); - err = row_drop_table_for_mysql(table->name, trx, TRUE); + err = row_drop_table_for_mysql(table->name, trx, TRUE, FALSE); trx_commit_for_mysql(trx); ut_a(err == DB_SUCCESS); @@ -796,7 +796,7 @@ extern "C" UNIV_INTERN os_thread_ret_t DECLARE_THREAD(trx_rollback_or_clean_all_recovered)( /*================================================*/ - void* arg __attribute__((unused))) + void* arg MY_ATTRIBUTE((unused))) /*!< in: a dummy parameter required by os_thread_create */ { diff --git a/storage/innobase/trx/trx0sys.cc b/storage/innobase/trx/trx0sys.cc index 76c8613fdbf..029d5cce1b8 100644 --- a/storage/innobase/trx/trx0sys.cc +++ b/storage/innobase/trx/trx0sys.cc @@ -349,10 +349,17 @@ trx_sys_update_wsrep_checkpoint( unsigned char xid_uuid[16]; long long xid_seqno = read_wsrep_xid_seqno(xid); read_wsrep_xid_uuid(xid, xid_uuid); - if (!memcmp(xid_uuid, trx_sys_cur_xid_uuid, 8)) + if (!memcmp(xid_uuid, trx_sys_cur_xid_uuid, 16)) { + /* + This check is a protection against the initial seqno (-1) + assigned in read_wsrep_xid_uuid(), which, if not checked, + would cause the following assertion to fail. + */ + if (xid_seqno > -1 ) + { ut_ad(xid_seqno > trx_sys_cur_xid_seqno); - trx_sys_cur_xid_seqno = xid_seqno; + } } else { @@ -411,6 +418,8 @@ trx_sys_read_wsrep_checkpoint(XID* xid) + TRX_SYS_WSREP_XID_MAGIC_N_FLD)) != TRX_SYS_WSREP_XID_MAGIC_N) { memset(xid, 0, sizeof(*xid)); + long long seqno= -1; + memcpy(xid->data + 24, &seqno, sizeof(long long)); xid->formatID = -1; trx_sys_update_wsrep_checkpoint(xid, sys_header, &mtr); mtr_commit(&mtr); diff --git a/storage/innobase/trx/trx0trx.cc b/storage/innobase/trx/trx0trx.cc index 7f3cfa22255..1a99e159d41 100644 --- a/storage/innobase/trx/trx0trx.cc +++ b/storage/innobase/trx/trx0trx.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2015, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -973,7 +973,7 @@ trx_serialisation_number_get( /****************************************************************//** Assign the transaction its history serialisation number and write the update UNDO log record to the assigned rollback segment. */ -static __attribute__((nonnull)) +static MY_ATTRIBUTE((nonnull)) void trx_write_serialisation_history( /*============================*/ @@ -1060,7 +1060,7 @@ trx_write_serialisation_history( /******************************************************************** Finalize a transaction containing updates for a FTS table. */ -static __attribute__((nonnull)) +static MY_ATTRIBUTE((nonnull)) void trx_finalize_for_fts_table( /*=======================*/ @@ -1093,7 +1093,7 @@ trx_finalize_for_fts_table( /******************************************************************//** Finalize a transaction containing updates to FTS tables. */ -static __attribute__((nonnull)) +static MY_ATTRIBUTE((nonnull)) void trx_finalize_for_fts( /*=================*/ @@ -1161,7 +1161,7 @@ trx_flush_log_if_needed_low( /**********************************************************************//** If required, flushes the log to disk based on the value of innodb_flush_log_at_trx_commit. */ -static __attribute__((nonnull)) +static MY_ATTRIBUTE((nonnull)) void trx_flush_log_if_needed( /*====================*/ @@ -1176,7 +1176,7 @@ trx_flush_log_if_needed( /****************************************************************//** Commits a transaction in memory. */ -static __attribute__((nonnull)) +static MY_ATTRIBUTE((nonnull)) void trx_commit_in_memory( /*=================*/ @@ -2165,7 +2165,7 @@ which is in the prepared state @return trx on match, the trx->xid will be invalidated; note that the trx may have been committed, unless the caller is holding lock_sys->mutex */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) trx_t* trx_get_trx_by_xid_low( /*===================*/ diff --git a/storage/innobase/trx/trx0undo.cc b/storage/innobase/trx/trx0undo.cc index edb85a89c17..cdd23726f2e 100644 --- a/storage/innobase/trx/trx0undo.cc +++ b/storage/innobase/trx/trx0undo.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2013, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -419,11 +419,11 @@ trx_undo_page_init( Creates a new undo log segment in file. @return DB_SUCCESS if page creation OK possible error codes are: DB_TOO_MANY_CONCURRENT_TRXS DB_OUT_OF_FILE_SPACE */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t trx_undo_seg_create( /*================*/ - trx_rseg_t* rseg __attribute__((unused)),/*!< in: rollback segment */ + trx_rseg_t* rseg MY_ATTRIBUTE((unused)),/*!< in: rollback segment */ trx_rsegf_t* rseg_hdr,/*!< in: rollback segment header, page x-latched */ ulint type, /*!< in: type of the segment: TRX_UNDO_INSERT or @@ -443,7 +443,9 @@ trx_undo_seg_create( ibool success; dberr_t err = DB_SUCCESS; - ut_ad(mtr && id && rseg_hdr); + ut_ad(mtr != NULL); + ut_ad(id != NULL); + ut_ad(rseg_hdr != NULL); ut_ad(mutex_own(&(rseg->mutex))); /* fputs(type == TRX_UNDO_INSERT @@ -827,7 +829,7 @@ byte* trx_undo_parse_discard_latest( /*==========================*/ byte* ptr, /*!< in: buffer */ - byte* end_ptr __attribute__((unused)), /*!< in: buffer end */ + byte* end_ptr MY_ATTRIBUTE((unused)), /*!< in: buffer end */ page_t* page, /*!< in: page or NULL */ mtr_t* mtr) /*!< in: mtr or NULL */ { @@ -1555,7 +1557,7 @@ Creates a new undo log. @return DB_SUCCESS if successful in creating the new undo lob object, possible error codes are: DB_TOO_MANY_CONCURRENT_TRXS DB_OUT_OF_FILE_SPACE DB_OUT_OF_MEMORY */ -static __attribute__((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t trx_undo_create( /*============*/ diff --git a/storage/innobase/ut/ut0crc32.cc b/storage/innobase/ut/ut0crc32.cc index 8f3c699c24f..2f6429c09b2 100644 --- a/storage/innobase/ut/ut0crc32.cc +++ b/storage/innobase/ut/ut0crc32.cc @@ -104,6 +104,7 @@ UNIV_INTERN bool ut_crc32_power8_enabled = false; /********************************************************************//** Initializes the table that is used to generate the CRC32 if the CPU does not have support for it. */ +#ifndef HAVE_CRC32_VPMSUM static void ut_crc32_slice8_table_init() @@ -133,6 +134,7 @@ ut_crc32_slice8_table_init() ut_crc32_slice8_table_initialized = TRUE; } +#endif #if defined(__GNUC__) && defined(__x86_64__) /********************************************************************//** @@ -181,27 +183,22 @@ for RHEL4 support (GCC 3 doesn't support this instruction) */ len -= 8, buf += 8 #endif /* defined(__GNUC__) && defined(__x86_64__) */ -#if defined(__powerpc__) + +#ifdef HAVE_CRC32_VPMSUM extern "C" { -unsigned int crc32_vpmsum(unsigned int crc, const unsigned char *p, unsigned long len); +unsigned int crc32c_vpmsum(unsigned int crc, const unsigned char *p, unsigned long len); }; -#endif /* __powerpc__ */ UNIV_INLINE ib_uint32_t ut_crc32_power8( /*===========*/ const byte* buf, /*!< in: data over which to calculate CRC32 */ - ulint len) /*!< in: data length */ + ulint len) /*!< in: data length */ { -#if defined(__powerpc__) && !defined(WORDS_BIGENDIAN) - return crc32_vpmsum(0, buf, len); -#else - ut_error; - /* silence compiler warning about unused parameters */ - return((ib_uint32_t) buf[len]); -#endif /* __powerpc__ */ + return crc32c_vpmsum(0, buf, len); } +#endif /********************************************************************//** Calculates CRC32 using CPU instructions. @@ -338,18 +335,15 @@ ut_crc32_init() #endif /* defined(__GNUC__) && defined(__x86_64__) */ -#if defined(__linux__) && defined(__powerpc__) && defined(AT_HWCAP2) \ - && !defined(WORDS_BIGENDIAN) - if (getauxval(AT_HWCAP2) & PPC_FEATURE2_ARCH_2_07) - ut_crc32_power8_enabled = true; -#endif /* defined(__linux__) && defined(__powerpc__) */ - +#ifdef HAVE_CRC32_VPMSUM + ut_crc32_power8_enabled = true; + ut_crc32 = ut_crc32_power8; +#else if (ut_crc32_sse2_enabled) { ut_crc32 = ut_crc32_sse42; - } else if (ut_crc32_power8_enabled) { - ut_crc32 = ut_crc32_power8; } else { ut_crc32_slice8_table_init(); ut_crc32 = ut_crc32_slice8; } +#endif } diff --git a/storage/maria/ma_bitmap.c b/storage/maria/ma_bitmap.c index 60d57b95d86..8edaa418baa 100644 --- a/storage/maria/ma_bitmap.c +++ b/storage/maria/ma_bitmap.c @@ -105,7 +105,7 @@ - On checkpoint (Ie: When we do a checkpoint, we have to ensure that all bitmaps are put on disk even if they are not in the page cache). - - When explicitely requested (for example on backup or after recovery, + - When explicitly requested (for example on backup or after recovery, to simplify things) The flow of writing a row is that: diff --git a/storage/maria/ma_check_standalone.h b/storage/maria/ma_check_standalone.h index 6626a62c4ef..890d6ba3d31 100644 --- a/storage/maria/ma_check_standalone.h +++ b/storage/maria/ma_check_standalone.h @@ -23,7 +23,7 @@ void _mi_report_crashed(void *file __attribute__((unused)), { } -static unsigned int no_key() +static unsigned int no_key(unsigned int not_used __attribute__((unused))) { return ENCRYPTION_KEY_VERSION_INVALID; } diff --git a/storage/maria/ma_checkpoint.c b/storage/maria/ma_checkpoint.c index 36b729e6053..21b4758a720 100644 --- a/storage/maria/ma_checkpoint.c +++ b/storage/maria/ma_checkpoint.c @@ -46,7 +46,7 @@ static mysql_mutex_t LOCK_checkpoint; static mysql_cond_t COND_checkpoint; /** @brief control structure for checkpoint background thread */ static MA_SERVICE_THREAD_CONTROL checkpoint_control= - {THREAD_DEAD, FALSE, &LOCK_checkpoint, &COND_checkpoint}; + {0, FALSE, FALSE, &LOCK_checkpoint, &COND_checkpoint}; /* is ulong like pagecache->blocks_changed */ static ulong pages_to_flush_before_next_checkpoint; static PAGECACHE_FILE *dfiles, /**< data files to flush in background */ @@ -326,7 +326,6 @@ end: int ma_checkpoint_init(ulong interval) { - pthread_t th; int res= 0; DBUG_ENTER("ma_checkpoint_init"); if (ma_service_thread_control_init(&checkpoint_control)) @@ -334,14 +333,14 @@ int ma_checkpoint_init(ulong interval) else if (interval > 0) { compile_time_assert(sizeof(void *) >= sizeof(ulong)); - if (!(res= mysql_thread_create(key_thread_checkpoint, - &th, NULL, ma_checkpoint_background, - (void *)interval))) - { - /* thread lives, will have to be killed */ - checkpoint_control.status= THREAD_RUNNING; - } + if ((res= mysql_thread_create(key_thread_checkpoint, + &checkpoint_control.thread, NULL, + ma_checkpoint_background, + (void*) interval))) + checkpoint_control.killed= TRUE; } + else + checkpoint_control.killed= TRUE; DBUG_RETURN(res); } @@ -573,8 +572,6 @@ pthread_handler_t ma_checkpoint_background(void *arg) sleeps= 1; pages_to_flush_before_next_checkpoint= 0; - pthread_detach_this_thread(); - for(;;) /* iterations of checkpoints and dirty page flushing */ { #if 0 /* good for testing, to do a lot of checkpoints, finds a lot of bugs */ @@ -723,7 +720,6 @@ pthread_handler_t ma_checkpoint_background(void *arg) DBUG_EXECUTE_IF("maria_checkpoint_indirect", level= CHECKPOINT_INDIRECT;); ma_checkpoint_execute(level, FALSE); } - my_service_thread_signal_end(&checkpoint_control); my_thread_end(); return 0; } diff --git a/storage/maria/ma_checksum.c b/storage/maria/ma_checksum.c index da2d40d3687..48b29946cea 100644 --- a/storage/maria/ma_checksum.c +++ b/storage/maria/ma_checksum.c @@ -58,7 +58,7 @@ ha_checksum _ma_checksum(MARIA_HA *info, const uchar *record) length= _ma_calc_blob_length(blob_size_length, pos); if (length) { - memcpy(&pos, pos + blob_size_length, sizeof(char*)); + memcpy((char**) &pos, pos + blob_size_length, sizeof(char*)); crc= my_checksum(crc, pos, length); } continue; diff --git a/storage/maria/ma_extra.c b/storage/maria/ma_extra.c index fd21d2863f8..117a302b418 100644 --- a/storage/maria/ma_extra.c +++ b/storage/maria/ma_extra.c @@ -319,6 +319,7 @@ int maria_extra(MARIA_HA *info, enum ha_extra_function function, my_bool do_flush= MY_TEST(function != HA_EXTRA_PREPARE_FOR_DROP); my_bool save_global_changed; enum flush_type type; + DBUG_ASSERT(!share->temporary); /* This share, to have last_version=0, needs to save all its data/index blocks to disk if this is not for a DROP TABLE. Otherwise they would be diff --git a/storage/maria/ma_ft_update.c b/storage/maria/ma_ft_update.c index a166b7b21fb..59c134cd4d3 100644 --- a/storage/maria/ma_ft_update.c +++ b/storage/maria/ma_ft_update.c @@ -83,7 +83,7 @@ uint _ma_ft_segiterator(register FT_SEG_ITERATOR *ftsi) if (ftsi->seg->flag & HA_BLOB_PART) { ftsi->len= _ma_calc_blob_length(ftsi->seg->bit_start,ftsi->pos); - memcpy(&ftsi->pos, ftsi->pos+ftsi->seg->bit_start, sizeof(char*)); + memcpy((char**) &ftsi->pos, ftsi->pos+ftsi->seg->bit_start, sizeof(char*)); DBUG_RETURN(1); } ftsi->len=ftsi->seg->length; diff --git a/storage/maria/ma_loghandler.c b/storage/maria/ma_loghandler.c index 1e7cc9483a2..8bcb84c2a20 100644 --- a/storage/maria/ma_loghandler.c +++ b/storage/maria/ma_loghandler.c @@ -54,7 +54,7 @@ static mysql_mutex_t LOCK_soft_sync; static mysql_cond_t COND_soft_sync; /** @brief control structure for checkpoint background thread */ static MA_SERVICE_THREAD_CONTROL soft_sync_control= - {THREAD_DEAD, FALSE, &LOCK_soft_sync, &COND_soft_sync}; + {0, FALSE, FALSE, &LOCK_soft_sync, &COND_soft_sync}; /* transaction log file descriptor */ @@ -8790,7 +8790,6 @@ ma_soft_sync_background( void *arg __attribute__((unused))) if (my_service_thread_sleep(&soft_sync_control, sleep)) break; } - my_service_thread_signal_end(&soft_sync_control); my_thread_end(); DBUG_RETURN(0); } @@ -8803,7 +8802,6 @@ ma_soft_sync_background( void *arg __attribute__((unused))) int translog_soft_sync_start(void) { - pthread_t th; int res= 0; uint32 min, max; DBUG_ENTER("translog_soft_sync_start"); @@ -8818,9 +8816,10 @@ int translog_soft_sync_start(void) soft_need_sync= 1; if (!(res= ma_service_thread_control_init(&soft_sync_control))) - if (!(res= mysql_thread_create(key_thread_soft_sync, - &th, NULL, ma_soft_sync_background, NULL))) - soft_sync_control.status= THREAD_RUNNING; + if ((res= mysql_thread_create(key_thread_soft_sync, + &soft_sync_control.thread, NULL, + ma_soft_sync_background, NULL))) + soft_sync_control.killed= TRUE; DBUG_RETURN(res); } diff --git a/storage/maria/ma_pagecache.c b/storage/maria/ma_pagecache.c index ade91a159ca..2becc133237 100644 --- a/storage/maria/ma_pagecache.c +++ b/storage/maria/ma_pagecache.c @@ -500,8 +500,8 @@ static void test_key_cache(PAGECACHE *pagecache, const char *where, my_bool lock); #endif -#define PAGECACHE_HASH(p, f, pos) (((ulong) (pos) + \ - (ulong) (f).file) & (p->hash_entries-1)) +#define PAGECACHE_HASH(p, f, pos) (((size_t) (pos) + \ + (size_t) (f).file) & (p->hash_entries-1)) #define FILE_HASH(f,cache) ((uint) (f).file & (cache->changed_blocks_hash_size-1)) #define DEFAULT_PAGECACHE_DEBUG_LOG "pagecache_debug.log" @@ -641,10 +641,10 @@ static my_bool pagecache_fwrite(PAGECACHE *pagecache, { char buff[80]; uint len= my_sprintf(buff, - (buff, "fwrite: fd: %d id: %u page: %lu", + (buff, "fwrite: fd: %d id: %u page: %llu", filedesc->file, _ma_file_callback_to_id(filedesc->callback_data), - (ulong) pageno)); + pageno)); (void) translog_log_debug_info(0, LOGREC_DEBUG_INFO_QUERY, (uchar*) buff, len); } @@ -745,12 +745,12 @@ static inline uint next_power(uint value) */ -ulong init_pagecache(PAGECACHE *pagecache, size_t use_mem, +size_t init_pagecache(PAGECACHE *pagecache, size_t use_mem, uint division_limit, uint age_threshold, uint block_size, uint changed_blocks_hash_size, myf my_readwrite_flags) { - ulong blocks, hash_links, length; + size_t blocks, hash_links, length; int error; DBUG_ENTER("init_pagecache"); DBUG_ASSERT(block_size >= 512); @@ -787,10 +787,10 @@ ulong init_pagecache(PAGECACHE *pagecache, size_t use_mem, DBUG_PRINT("info", ("block_size: %u", block_size)); DBUG_ASSERT(((uint)(1 << pagecache->shift)) == block_size); - blocks= (ulong) (use_mem / (sizeof(PAGECACHE_BLOCK_LINK) + + blocks= use_mem / (sizeof(PAGECACHE_BLOCK_LINK) + 2 * sizeof(PAGECACHE_HASH_LINK) + sizeof(PAGECACHE_HASH_LINK*) * - 5/4 + block_size)); + 5/4 + block_size); /* Changed blocks hash needs to be a power of 2 */ changed_blocks_hash_size= my_round_up_to_next_power(MY_MAX(changed_blocks_hash_size, MIN_PAGECACHE_CHANGED_BLOCKS_HASH_SIZE)); @@ -826,7 +826,7 @@ ulong init_pagecache(PAGECACHE *pagecache, size_t use_mem, blocks--; /* Allocate memory for cache page buffers */ if ((pagecache->block_mem= - my_large_malloc((ulong) blocks * pagecache->block_size, + my_large_malloc(blocks * pagecache->block_size, MYF(MY_WME)))) { /* @@ -857,7 +857,7 @@ ulong init_pagecache(PAGECACHE *pagecache, size_t use_mem, blocks= blocks / 4*3; } pagecache->blocks_unused= blocks; - pagecache->disk_blocks= (long) blocks; + pagecache->disk_blocks= blocks; pagecache->hash_links= hash_links; pagecache->hash_links_used= 0; pagecache->free_hash_list= NULL; @@ -894,7 +894,7 @@ ulong init_pagecache(PAGECACHE *pagecache, size_t use_mem, pagecache->hash_links, (long) pagecache->hash_link_root)); pagecache->blocks= pagecache->disk_blocks > 0 ? pagecache->disk_blocks : 0; - DBUG_RETURN((ulong) pagecache->disk_blocks); + DBUG_RETURN((size_t)pagecache->disk_blocks); err: error= my_errno; @@ -985,11 +985,11 @@ static int flush_all_key_blocks(PAGECACHE *pagecache) So we disable it for now. */ #if NOT_USED /* keep disabled until code is fixed see above !! */ -ulong resize_pagecache(PAGECACHE *pagecache, +size_t resize_pagecache(PAGECACHE *pagecache, size_t use_mem, uint division_limit, uint age_threshold, uint changed_blocks_hash_size) { - ulong blocks; + size_t blocks; struct st_my_thread_var *thread; WQUEUE *wqueue; DBUG_ENTER("resize_pagecache"); @@ -1386,7 +1386,7 @@ static void link_block(PAGECACHE *pagecache, PAGECACHE_BLOCK_LINK *block, ("linked block: %u:%1u status: %x #requests: %u #available: %u", PCBLOCK_NUMBER(pagecache, block), at_end, block->status, block->requests, pagecache->blocks_available)); - KEYCACHE_DBUG_ASSERT((ulong) pagecache->blocks_available <= + KEYCACHE_DBUG_ASSERT(pagecache->blocks_available <= pagecache->blocks_used); #endif DBUG_VOID_RETURN; @@ -2027,7 +2027,7 @@ restart: /* There are some never used blocks, take first of them */ block= &pagecache->block_root[pagecache->blocks_used]; block->buffer= ADD_TO_PTR(pagecache->block_mem, - ((ulong) pagecache->blocks_used* + (pagecache->blocks_used* pagecache->block_size), uchar*); pagecache->blocks_used++; @@ -4880,7 +4880,7 @@ my_bool pagecache_collect_changed_blocks_with_lsn(PAGECACHE *pagecache, LSN *min_rec_lsn) { my_bool error= 0; - ulong stored_list_size= 0; + size_t stored_list_size= 0; uint file_hash; char *ptr; LSN minimum_rec_lsn= LSN_MAX; diff --git a/storage/maria/ma_pagecache.h b/storage/maria/ma_pagecache.h index e212a7b7029..207ad69711f 100644 --- a/storage/maria/ma_pagecache.h +++ b/storage/maria/ma_pagecache.h @@ -131,21 +131,21 @@ typedef struct st_pagecache_hash_link PAGECACHE_HASH_LINK; typedef struct st_pagecache { size_t mem_size; /* specified size of the cache memory */ - ulong min_warm_blocks; /* min number of warm blocks; */ - ulong age_threshold; /* age threshold for hot blocks */ + size_t min_warm_blocks; /* min number of warm blocks; */ + size_t age_threshold; /* age threshold for hot blocks */ ulonglong time; /* total number of block link operations */ - ulong hash_entries; /* max number of entries in the hash table */ - ulong changed_blocks_hash_size; /* Number of hash buckets for file blocks */ - long hash_links; /* max number of hash links */ - long hash_links_used; /* number of hash links taken from free links pool */ - long disk_blocks; /* max number of blocks in the cache */ - ulong blocks_used; /* maximum number of concurrently used blocks */ - ulong blocks_unused; /* number of currently unused blocks */ - ulong blocks_changed; /* number of currently dirty blocks */ - ulong warm_blocks; /* number of blocks in warm sub-chain */ - ulong cnt_for_resize_op; /* counter to block resize operation */ - ulong blocks_available; /* number of blocks available in the LRU chain */ - long blocks; /* max number of blocks in the cache */ + size_t hash_entries; /* max number of entries in the hash table */ + size_t changed_blocks_hash_size;/* Number of hash buckets for file blocks */ + ssize_t hash_links; /* max number of hash links */ + ssize_t hash_links_used; /* number of hash links taken from free links pool */ + ssize_t disk_blocks; /* max number of blocks in the cache */ + size_t blocks_used; /* maximum number of concurrently used blocks */ + size_t blocks_unused; /* number of currently unused blocks */ + size_t blocks_changed; /* number of currently dirty blocks */ + size_t warm_blocks; /* number of blocks in warm sub-chain */ + size_t cnt_for_resize_op; /* counter to block resize operation */ + size_t blocks_available; /* number of blocks available in the LRU chain */ + ssize_t blocks; /* max number of blocks in the cache */ uint32 block_size; /* size of the page buffer of a cache block */ PAGECACHE_HASH_LINK **hash_root;/* arr. of entries into hash table buckets */ PAGECACHE_HASH_LINK *hash_link_root;/* memory for hash table links */ @@ -170,12 +170,12 @@ typedef struct st_pagecache */ ulonglong param_buff_size; /* size the memory allocated for the cache */ - ulong param_block_size; /* size of the blocks in the key cache */ - ulong param_division_limit; /* min. percentage of warm blocks */ - ulong param_age_threshold; /* determines when hot block is downgraded */ + size_t param_block_size; /* size of the blocks in the key cache */ + size_t param_division_limit; /* min. percentage of warm blocks */ + size_t param_age_threshold; /* determines when hot block is downgraded */ /* Statistics variables. These are reset in reset_pagecache_counters(). */ - ulong global_blocks_changed; /* number of currently dirty blocks */ + size_t global_blocks_changed; /* number of currently dirty blocks */ ulonglong global_cache_w_requests;/* number of write requests (write hits) */ ulonglong global_cache_write; /* number of writes from cache to files */ ulonglong global_cache_r_requests;/* number of read requests (read hits) */ @@ -208,11 +208,11 @@ typedef enum pagecache_flush_filter_result /* The default key cache */ extern PAGECACHE dflt_pagecache_var, *dflt_pagecache; -extern ulong init_pagecache(PAGECACHE *pagecache, size_t use_mem, +extern size_t init_pagecache(PAGECACHE *pagecache, size_t use_mem, uint division_limit, uint age_threshold, uint block_size, uint changed_blocks_hash_size, myf my_read_flags); -extern ulong resize_pagecache(PAGECACHE *pagecache, +extern size_t resize_pagecache(PAGECACHE *pagecache, size_t use_mem, uint division_limit, uint age_threshold, uint changed_blocks_hash_size); extern void change_pagecache_param(PAGECACHE *pagecache, uint division_limit, diff --git a/storage/maria/ma_range.c b/storage/maria/ma_range.c index 7216480abd9..3d41cb9a37d 100644 --- a/storage/maria/ma_range.c +++ b/storage/maria/ma_range.c @@ -163,7 +163,7 @@ static ha_rows _ma_record_pos(MARIA_HA *info, const uchar *key_data, operations with a comment like "Not real duplicates", whatever this means. From the condition above we can see that 'skip_end_space' is always false for these operations. The result is that trailing space - counts in key comparison and hence, emtpy strings ('', string length + counts in key comparison and hence, empty strings ('', string length zero, but not NULL) compare less that strings starting with control characters and these in turn compare less than strings starting with blanks. diff --git a/storage/maria/ma_servicethread.c b/storage/maria/ma_servicethread.c index e5c949a7571..d92c5315933 100644 --- a/storage/maria/ma_servicethread.c +++ b/storage/maria/ma_servicethread.c @@ -33,7 +33,7 @@ int ma_service_thread_control_init(MA_SERVICE_THREAD_CONTROL *control) DBUG_ENTER("ma_service_thread_control_init"); DBUG_PRINT("init", ("control 0x%lx", (ulong) control)); control->inited= TRUE; - control->status= THREAD_DEAD; /* not yet born == dead */ + control->killed= FALSE; res= (mysql_mutex_init(key_SERVICE_THREAD_CONTROL_lock, control->LOCK_control, MY_MUTEX_INIT_SLOW) || mysql_cond_init(key_SERVICE_THREAD_CONTROL_cond, @@ -60,20 +60,17 @@ void ma_service_thread_control_end(MA_SERVICE_THREAD_CONTROL *control) DBUG_PRINT("init", ("control 0x%lx", (ulong) control)); DBUG_ASSERT(control->inited); mysql_mutex_lock(control->LOCK_control); - if (control->status != THREAD_DEAD) /* thread was started OK */ + if (!control->killed) { DBUG_PRINT("info",("killing Maria background thread")); - control->status= THREAD_DYING; /* kill it */ - do /* and wait for it to be dead */ - { - /* wake it up if it was in a sleep */ - mysql_cond_broadcast(control->COND_control); - DBUG_PRINT("info",("waiting for Maria background thread to die")); - mysql_cond_wait(control->COND_control, control->LOCK_control); - } - while (control->status != THREAD_DEAD); + control->killed= TRUE; /* kill it */ + mysql_cond_broadcast(control->COND_control); + mysql_mutex_unlock(control->LOCK_control); + DBUG_PRINT("info", ("waiting for Maria background thread to die")); + pthread_join(control->thread, NULL); } - mysql_mutex_unlock(control->LOCK_control); + else + mysql_mutex_unlock(control->LOCK_control); mysql_mutex_destroy(control->LOCK_control); mysql_cond_destroy(control->COND_control); control->inited= FALSE; @@ -100,7 +97,7 @@ my_bool my_service_thread_sleep(MA_SERVICE_THREAD_CONTROL *control, DBUG_ENTER("my_service_thread_sleep"); DBUG_PRINT("init", ("control 0x%lx", (ulong) control)); mysql_mutex_lock(control->LOCK_control); - if (control->status == THREAD_DYING) + if (control->killed) { mysql_mutex_unlock(control->LOCK_control); DBUG_RETURN(TRUE); @@ -119,34 +116,8 @@ my_bool my_service_thread_sleep(MA_SERVICE_THREAD_CONTROL *control, control->LOCK_control, &abstime); } #endif - if (control->status == THREAD_DYING) + if (control->killed) res= TRUE; mysql_mutex_unlock(control->LOCK_control); DBUG_RETURN(res); } - - -/** - inform about thread exiting - - @param control control block -*/ - -void my_service_thread_signal_end(MA_SERVICE_THREAD_CONTROL *control) -{ - DBUG_ENTER("my_service_thread_signal_end"); - DBUG_PRINT("init", ("control 0x%lx", (ulong) control)); - mysql_mutex_lock(control->LOCK_control); - control->status = THREAD_DEAD; /* indicate that we are dead */ - /* - wake up ma_service_thread_control_end which may be waiting for - our death - */ - mysql_cond_broadcast(control->COND_control); - /* - broadcast was inside unlock because ma_service_thread_control_end - destroys mutex - */ - mysql_mutex_unlock(control->LOCK_control); - DBUG_VOID_RETURN; -} diff --git a/storage/maria/ma_servicethread.h b/storage/maria/ma_servicethread.h index ed578d93c24..254225bd608 100644 --- a/storage/maria/ma_servicethread.h +++ b/storage/maria/ma_servicethread.h @@ -16,12 +16,10 @@ #include -enum ma_service_thread_state {THREAD_RUNNING, THREAD_DYING, THREAD_DEAD}; - typedef struct st_ma_service_thread_control { - /** 'kill' flag for the background thread */ - enum ma_service_thread_state status; + pthread_t thread; + my_bool killed; /** if thread module was inited or not */ my_bool inited; /** for killing the background thread */ @@ -35,4 +33,3 @@ int ma_service_thread_control_init(MA_SERVICE_THREAD_CONTROL *control); void ma_service_thread_control_end(MA_SERVICE_THREAD_CONTROL *control); my_bool my_service_thread_sleep(MA_SERVICE_THREAD_CONTROL *control, ulonglong sleep_time); -void my_service_thread_signal_end(MA_SERVICE_THREAD_CONTROL *control); diff --git a/storage/maria/ma_sort.c b/storage/maria/ma_sort.c index ef6e8506ac6..287ea36da60 100644 --- a/storage/maria/ma_sort.c +++ b/storage/maria/ma_sort.c @@ -195,8 +195,10 @@ int _ma_create_index_by_sort(MARIA_SORT_PARAM *info, my_bool no_messages, while ((maxbuffer= (uint) (records/(keys-1)+1)) != maxbuffer_org); } - if ((sort_keys=(uchar**) my_malloc(keys*(sort_length+sizeof(char*))+ - HA_FT_MAXBYTELEN, MYF(0)))) + if ((sort_keys= ((uchar**) + my_malloc((size_t) (keys*(sort_length+sizeof(char*))+ + HA_FT_MAXBYTELEN), + MYF(0))))) { if (my_init_dynamic_array(&buffpek, sizeof(BUFFPEK), maxbuffer, MY_MIN(maxbuffer/2, 1000), MYF(0))) @@ -364,192 +366,196 @@ err: } /* find_all_keys */ +static my_bool _ma_thr_find_all_keys_exec(MARIA_SORT_PARAM* sort_param) +{ + int error= 0; + ulonglong memavl, old_memavl; + longlong sortbuff_size; + ha_keys UNINIT_VAR(keys), idx; + uint sort_length; + uint maxbuffer; + uchar **sort_keys= NULL; + DBUG_ENTER("_ma_thr_find_all_keys_exec"); + DBUG_PRINT("enter", ("master: %d", sort_param->master)); + + if (sort_param->sort_info->got_error) + DBUG_RETURN(TRUE); + + set_sort_param_read_write(sort_param); + + my_b_clear(&sort_param->tempfile); + my_b_clear(&sort_param->tempfile_for_exceptions); + bzero((char*) &sort_param->buffpek, sizeof(sort_param->buffpek)); + bzero((char*) &sort_param->unique, sizeof(sort_param->unique)); + + sortbuff_size= sort_param->sortbuff_size; + memavl= MY_MAX(sortbuff_size, MIN_SORT_MEMORY); + idx= (ha_keys) sort_param->sort_info->max_records; + sort_length= sort_param->key_length; + maxbuffer= 1; + + while (memavl >= MIN_SORT_MEMORY) + { + if ((my_off_t) (idx+1)*(sort_length+sizeof(char*)) <= (my_off_t) memavl) + keys= idx+1; + else if ((sort_param->sort_info->param->testflag & + (T_FORCE_SORT_MEMORY | T_CREATE_MISSING_KEYS)) == + T_FORCE_SORT_MEMORY) + { + /* + Use all of the given sort buffer for key data. + Allocate 1000 buffers at a start for new data. More buffers + will be allocated when needed. + */ + keys= memavl / (sort_length+sizeof(char*)); + maxbuffer= (uint) MY_MIN((ulonglong) 1000, (idx / keys)+1); + } + else + { + uint maxbuffer_org; + do + { + maxbuffer_org= maxbuffer; + if (memavl < sizeof(BUFFPEK)*maxbuffer || + (keys=(memavl-sizeof(BUFFPEK)*maxbuffer)/ + (sort_length+sizeof(char*))) <= 1 || + keys < maxbuffer) + { + _ma_check_print_error(sort_param->sort_info->param, + "aria_sort_buffer_size is too small. Current aria_sort_buffer_size: %llu rows: %llu sort_length: %u", + sortbuff_size, (ulonglong) idx, sort_length); + goto err; + } + } + while ((maxbuffer= (uint) (idx/(keys-1)+1)) != maxbuffer_org); + } + if ((sort_keys= (uchar **) + my_malloc((size_t)(keys*(sort_length+sizeof(char*))+ + ((sort_param->keyinfo->flag & HA_FULLTEXT) ? + HA_FT_MAXBYTELEN : 0)), MYF(0)))) + { + if (my_init_dynamic_array(&sort_param->buffpek, sizeof(BUFFPEK), + maxbuffer, MY_MIN(maxbuffer / 2, 1000), MYF(0))) + { + my_free(sort_keys); + sort_keys= NULL; /* Safety against double free on error. */ + } + else + break; + } + old_memavl= memavl; + if ((memavl= memavl/4*3) < MIN_SORT_MEMORY && + old_memavl > MIN_SORT_MEMORY) + memavl= MIN_SORT_MEMORY; + } + if (memavl < MIN_SORT_MEMORY) + { + /* purecov: begin inspected */ + _ma_check_print_error(sort_param->sort_info->param, + "aria_sort_buffer_size is too small. Current aria_sort_buffer_size: %llu rows: %llu sort_length: %u", + sortbuff_size, (ulonglong) idx, sort_length); + my_errno= ENOMEM; + goto err; + /* purecov: end inspected */ + } + + if (sort_param->sort_info->param->testflag & T_VERBOSE) + my_fprintf(stdout, + "Key %d - Allocating buffer for %llu keys\n", + sort_param->key + 1, (ulonglong) keys); + sort_param->sort_keys= sort_keys; + + idx= error= 0; + sort_keys[0]= (uchar*) (sort_keys+keys); + + DBUG_PRINT("info", ("reading keys")); + while (!(error= sort_param->sort_info->got_error) && + !(error= (*sort_param->key_read)(sort_param, sort_keys[idx]))) + { + if (sort_param->real_key_length > sort_param->key_length) + { + if (write_key(sort_param, sort_keys[idx], + &sort_param->tempfile_for_exceptions)) + goto err; + continue; + } + + if (++idx == keys) + { + if (sort_param->write_keys(sort_param, sort_keys, idx - 1, + (BUFFPEK *)alloc_dynamic(&sort_param->buffpek), + &sort_param->tempfile)) + goto err; + sort_keys[0]= (uchar*) (sort_keys+keys); + memcpy(sort_keys[0], sort_keys[idx - 1], (size_t) sort_param->key_length); + idx= 1; + } + sort_keys[idx]= sort_keys[idx - 1] + sort_param->key_length; + } + if (error > 0) + goto err; + if (sort_param->buffpek.elements) + { + if (sort_param->write_keys(sort_param,sort_keys, idx, + (BUFFPEK *) alloc_dynamic(&sort_param->buffpek), + &sort_param->tempfile)) + goto err; + sort_param->keys= (sort_param->buffpek.elements - 1) * (keys - 1) + idx; + } + else + sort_param->keys= idx; + + DBUG_RETURN(FALSE); + +err: + DBUG_PRINT("error", ("got some error")); + my_free(sort_keys); + sort_param->sort_keys= 0; + delete_dynamic(& sort_param->buffpek); + close_cached_file(&sort_param->tempfile); + close_cached_file(&sort_param->tempfile_for_exceptions); + + DBUG_RETURN(TRUE); +} + /* Search after all keys and place them in a temp. file */ pthread_handler_t _ma_thr_find_all_keys(void *arg) { MARIA_SORT_PARAM *sort_param= (MARIA_SORT_PARAM*) arg; - int error; - size_t memavl, old_memavl; - longlong sortbuff_size; - ha_keys UNINIT_VAR(keys), idx; - uint sort_length; - uint maxbuffer; - uchar **sort_keys=0; + my_bool error= FALSE; + /* If my_thread_init fails */ + if (my_thread_init() || _ma_thr_find_all_keys_exec(sort_param)) + error= TRUE; - error=1; + /* + Thread must clean up after itself. + */ + free_root(&sort_param->wordroot, MYF(0)); + /* + Detach from the share if the writer is involved. Avoid others to + be blocked. This includes a flush of the write buffer. This will + also indicate EOF to the readers. + That means that a writer always gets here first and readers - + only when they see EOF. But if a reader finishes prematurely + because of an error it may reach this earlier - don't allow it + to detach the writer thread. + */ + if (sort_param->master && sort_param->sort_info->info->rec_cache.share) + remove_io_thread(&sort_param->sort_info->info->rec_cache); - if (my_thread_init()) - goto err; + /* Readers detach from the share if any. Avoid others to be blocked. */ + if (sort_param->read_cache.share) + remove_io_thread(&sort_param->read_cache); - { /* Add extra block since DBUG_ENTER declare variables */ - DBUG_ENTER("_ma_thr_find_all_keys"); - DBUG_PRINT("enter", ("master: %d", sort_param->master)); - if (sort_param->sort_info->got_error) - goto err; + mysql_mutex_lock(&sort_param->sort_info->mutex); + if (error) + sort_param->sort_info->got_error= 1; - set_sort_param_read_write(sort_param); + if (!--sort_param->sort_info->threads_running) + mysql_cond_signal(&sort_param->sort_info->cond); + mysql_mutex_unlock(&sort_param->sort_info->mutex); - my_b_clear(&sort_param->tempfile); - my_b_clear(&sort_param->tempfile_for_exceptions); - bzero((char*) &sort_param->buffpek,sizeof(sort_param->buffpek)); - bzero((char*) &sort_param->unique, sizeof(sort_param->unique)); - - sortbuff_size= sort_param->sortbuff_size; - memavl= MY_MAX(sortbuff_size, MIN_SORT_MEMORY); - idx= (ha_keys) sort_param->sort_info->max_records; - sort_length= sort_param->key_length; - maxbuffer= 1; - - while (memavl >= MIN_SORT_MEMORY) - { - if ((my_off_t) (idx+1)*(sort_length+sizeof(char*)) <= (my_off_t) memavl) - keys= idx+1; - else if ((sort_param->sort_info->param->testflag & - (T_FORCE_SORT_MEMORY | T_CREATE_MISSING_KEYS)) == - T_FORCE_SORT_MEMORY) - { - /* - Use all of the given sort buffer for key data. - Allocate 1000 buffers at a start for new data. More buffers - will be allocated when needed. - */ - keys= memavl / (sort_length+sizeof(char*)); - maxbuffer= (uint) MY_MIN((ulonglong) 1000, (idx / keys)+1); - } - else - { - uint maxbuffer_org; - do - { - maxbuffer_org= maxbuffer; - if (memavl < sizeof(BUFFPEK)*maxbuffer || - (keys=(memavl-sizeof(BUFFPEK)*maxbuffer)/ - (sort_length+sizeof(char*))) <= 1 || - keys < maxbuffer) - { - _ma_check_print_error(sort_param->sort_info->param, - "aria_sort_buffer_size is too small. Current aria_sort_buffer_size: %llu rows: %llu sort_length: %u", - sortbuff_size, (ulonglong) idx, sort_length); - goto err; - } - } - while ((maxbuffer= (uint) (idx/(keys-1)+1)) != maxbuffer_org); - } - if ((sort_keys= (uchar **) - my_malloc(keys*(sort_length+sizeof(char*))+ - ((sort_param->keyinfo->flag & HA_FULLTEXT) ? - HA_FT_MAXBYTELEN : 0), MYF(0)))) - { - if (my_init_dynamic_array(&sort_param->buffpek, sizeof(BUFFPEK), - maxbuffer, MY_MIN(maxbuffer/2, 1000), MYF(0))) - { - my_free(sort_keys); - sort_keys= (uchar **) NULL; /* for err: label */ - } - else - break; - } - old_memavl= memavl; - if ((memavl= memavl/4*3) < MIN_SORT_MEMORY && - old_memavl > MIN_SORT_MEMORY) - memavl= MIN_SORT_MEMORY; - } - if (memavl < MIN_SORT_MEMORY) - { - /* purecov: begin inspected */ - _ma_check_print_error(sort_param->sort_info->param, - "aria_sort_buffer_size is too small. Current aria_sort_buffer_size: %llu rows: %llu sort_length: %u", - sortbuff_size, (ulonglong) idx, sort_length); - my_errno= ENOMEM; - goto err; - /* purecov: end inspected */ - } - - if (sort_param->sort_info->param->testflag & T_VERBOSE) - my_fprintf(stdout, - "Key %d - Allocating buffer for %llu keys\n", - sort_param->key + 1, (ulonglong) keys); - sort_param->sort_keys= sort_keys; - - idx= error= 0; - sort_keys[0]= (uchar*) (sort_keys+keys); - - DBUG_PRINT("info", ("reading keys")); - while (!(error= sort_param->sort_info->got_error) && - !(error= (*sort_param->key_read)(sort_param, sort_keys[idx]))) - { - if (sort_param->real_key_length > sort_param->key_length) - { - if (write_key(sort_param, sort_keys[idx], - &sort_param->tempfile_for_exceptions)) - goto err; - continue; - } - - if (++idx == keys) - { - if (sort_param->write_keys(sort_param, sort_keys, idx - 1, - (BUFFPEK *)alloc_dynamic(&sort_param-> - buffpek), - &sort_param->tempfile)) - goto err; - sort_keys[0]= (uchar*) (sort_keys+keys); - memcpy(sort_keys[0], sort_keys[idx - 1], - (size_t) sort_param->key_length); - idx= 1; - } - sort_keys[idx]= sort_keys[idx - 1] + sort_param->key_length; - } - if (error > 0) - goto err; - if (sort_param->buffpek.elements) - { - if (sort_param->write_keys(sort_param,sort_keys, idx, - (BUFFPEK *) alloc_dynamic(&sort_param-> - buffpek), - &sort_param->tempfile)) - goto err; - sort_param->keys= (sort_param->buffpek.elements - 1) * (keys - 1) + idx; - } - else - sort_param->keys= idx; - - goto ok; - -err: - DBUG_PRINT("error", ("got some error")); - sort_param->sort_info->got_error= 1; /* no need to protect with a mutex */ - my_free(sort_keys); - sort_param->sort_keys= 0; - delete_dynamic(& sort_param->buffpek); - close_cached_file(&sort_param->tempfile); - close_cached_file(&sort_param->tempfile_for_exceptions); - -ok: - free_root(&sort_param->wordroot, MYF(0)); - /* - Detach from the share if the writer is involved. Avoid others to - be blocked. This includes a flush of the write buffer. This will - also indicate EOF to the readers. - That means that a writer always gets here first and readers - - only when they see EOF. But if a reader finishes prematurely - because of an error it may reach this earlier - don't allow it - to detach the writer thread. - */ - if (sort_param->master && sort_param->sort_info->info->rec_cache.share) - remove_io_thread(&sort_param->sort_info->info->rec_cache); - - /* Readers detach from the share if any. Avoid others to be blocked. */ - if (sort_param->read_cache.share) - remove_io_thread(&sort_param->read_cache); - - mysql_mutex_lock(&sort_param->sort_info->mutex); - if (!--sort_param->sort_info->threads_running) - mysql_cond_signal(&sort_param->sort_info->cond); - mysql_mutex_unlock(&sort_param->sort_info->mutex); - DBUG_PRINT("exit", ("======== ending thread ========")); - } my_thread_end(); return NULL; } @@ -559,7 +565,7 @@ int _ma_thr_write_keys(MARIA_SORT_PARAM *sort_param) { MARIA_SORT_INFO *sort_info=sort_param->sort_info; HA_CHECK *param=sort_info->param; - ulong UNINIT_VAR(length), keys; + size_t UNINIT_VAR(length), keys; double *rec_per_key_part= param->new_rec_per_key_part; int got_error=sort_info->got_error; uint i; @@ -624,7 +630,7 @@ int _ma_thr_write_keys(MARIA_SORT_PARAM *sort_param) length=param->sort_buffer_length; while (length >= MIN_SORT_MEMORY) { - if ((mergebuf= my_malloc(length, MYF(0)))) + if ((mergebuf= my_malloc((size_t) length, MYF(0)))) break; length=length*3/4; } @@ -728,8 +734,8 @@ static int write_keys(MARIA_SORT_PARAM *info, register uchar **sort_keys, if (!buffpek) DBUG_RETURN(1); /* Out of memory */ - my_qsort2((uchar*) sort_keys,count,sizeof(uchar*),(qsort2_cmp) info->key_cmp, - info); + my_qsort2((uchar*) sort_keys,(size_t) count, sizeof(uchar*), + (qsort2_cmp) info->key_cmp, info); if (!my_b_inited(tempfile) && open_cached_file(tempfile, my_tmpdir(info->tmpdir), "ST", DISK_BUFFER_SIZE, info->sort_info->param->myf_rw)) @@ -774,8 +780,8 @@ static int write_keys_varlen(MARIA_SORT_PARAM *info, if (!buffpek) DBUG_RETURN(1); /* Out of memory */ - my_qsort2((uchar*) sort_keys,count,sizeof(uchar*),(qsort2_cmp) info->key_cmp, - info); + my_qsort2((uchar*) sort_keys, (size_t) count, sizeof(uchar*), + (qsort2_cmp) info->key_cmp, info); if (!my_b_inited(tempfile) && open_cached_file(tempfile, my_tmpdir(info->tmpdir), "ST", DISK_BUFFER_SIZE, info->sort_info->param->myf_rw)) @@ -917,7 +923,8 @@ static my_off_t read_to_buffer(IO_CACHE *fromfile, BUFFPEK *buffpek, register ha_keys count; my_off_t length; - if ((count= (ha_keys) MY_MIN((ha_rows) buffpek->max_keys,buffpek->count))) + if ((count= (ha_keys) MY_MIN((ha_rows) buffpek->max_keys, + (ha_rows) buffpek->count))) { if (my_b_pread(fromfile, (uchar*) buffpek->base, (length= sort_length * count), buffpek->file_pos)) @@ -985,7 +992,7 @@ static int write_merge_key(MARIA_SORT_PARAM *info __attribute__((unused)), IO_CACHE *to_file, uchar *key, uint sort_length, ha_keys count) { - return my_b_write(to_file, key, ((size_t) sort_length) * count); + return my_b_write(to_file, key, (size_t) (sort_length * count)); } /* @@ -1045,7 +1052,7 @@ merge_buffers(MARIA_SORT_PARAM *info, ha_keys keys, IO_CACHE *from_file, if (to_file) { if (info->write_key(info,to_file, buffpek->key, - (uint) sort_length,1)) + sort_length, 1)) goto err; /* purecov: inspected */ } else @@ -1062,7 +1069,7 @@ merge_buffers(MARIA_SORT_PARAM *info, ha_keys keys, IO_CACHE *from_file, if (!(read_length= info->read_to_buffer(from_file,buffpek,sort_length))) { uchar *base= buffpek->base; - uint max_keys=buffpek->max_keys; + ha_keys max_keys=buffpek->max_keys; queue_remove_top(&queue); diff --git a/storage/maria/maria_def.h b/storage/maria/maria_def.h index 7337b01a981..a4c6e5295d2 100644 --- a/storage/maria/maria_def.h +++ b/storage/maria/maria_def.h @@ -67,7 +67,8 @@ typedef struct st_maria_sort_info pgcache_page_no_t page; ha_rows max_records; uint current_key, total_keys; - uint got_error, threads_running; + volatile uint got_error; + uint threads_running; myf myf_rw; enum data_file_type new_data_file_type, org_data_file_type; } MARIA_SORT_INFO; @@ -175,7 +176,7 @@ typedef struct st_maria_state_info uint changed; /* Changed since maria_chk */ /** Birthday of the table: no record in the log before this LSN should ever - be applied to the table. Updated when created, renamed, explicitely + be applied to the table. Updated when created, renamed, explicitly repaired (REPAIR|OPTIMIZE TABLE, ALTER TABLE ENABLE KEYS, maria_chk). */ LSN create_rename_lsn; diff --git a/storage/maria/unittest/sequence_storage.c b/storage/maria/unittest/sequence_storage.c index 4563ea76c64..0bd120c43d3 100644 --- a/storage/maria/unittest/sequence_storage.c +++ b/storage/maria/unittest/sequence_storage.c @@ -80,7 +80,7 @@ void seq_storage_destroy(SEQ_STORAGE *seq) /** - @brief Starts the sequence from begining + @brief Starts the sequence from beginning @param seq Reference on the sequence storage. */ diff --git a/storage/mroonga/ha_mroonga.cpp b/storage/mroonga/ha_mroonga.cpp index 75e029a7c9f..cd1f34dbaaf 100644 --- a/storage/mroonga/ha_mroonga.cpp +++ b/storage/mroonga/ha_mroonga.cpp @@ -4218,9 +4218,12 @@ int ha_mroonga::storage_open(const char *name, int mode, uint test_if_locked) if (!(ha_thd()->open_options & HA_OPEN_FOR_REPAIR)) { error = storage_open_indexes(name); if (error) { - // TODO: free grn_columns and set NULL; grn_obj_unlink(ctx, grn_table); grn_table = NULL; + // TODO: unlink elements + free(grn_columns); + // TODO: unlink elements + free(grn_column_ranges); DBUG_RETURN(error); } diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_after.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_after.result index 52a72155af3..16077d23155 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_after.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_after.result @@ -7,7 +7,7 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `body` text, + `body` text DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 ALTER TABLE diaries ADD title TEXT AFTER id; @@ -15,8 +15,8 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `body` text, + `title` text DEFAULT NULL, + `body` text DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries (title, body) values ("groonga (1)", "starting groonga."); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_first.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_first.result index 81feeefc589..2e1e87ab722 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_first.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_first.result @@ -7,16 +7,16 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `body` text, + `body` text DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 ALTER TABLE diaries ADD title TEXT FIRST; SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( - `title` text, + `title` text DEFAULT NULL, `id` int(11) NOT NULL AUTO_INCREMENT, - `body` text, + `body` text DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries (title, body) values ("groonga (1)", "starting groonga."); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_multiple.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_multiple.result index bb157539ac9..2222334060c 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_multiple.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_multiple.result @@ -7,7 +7,7 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, + `title` text DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries (title) VALUES ("survey"); @@ -34,10 +34,10 @@ started groonga. 3 0 groonga (2) 2014-02-09 12:19:00 SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( - `body` text, + `body` text DEFAULT NULL, `id` int(11) NOT NULL AUTO_INCREMENT, `published` tinyint(1) DEFAULT NULL, - `title` text, + `title` text DEFAULT NULL, `created_at` datetime DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_plain.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_plain.result index df5a15568d8..a7bb15d5c84 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_plain.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_plain.result @@ -7,7 +7,7 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, + `title` text DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries (title) VALUES ("survey"); @@ -30,8 +30,8 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `body` text, + `title` text DEFAULT NULL, + `body` text DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_column_rename_after.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_column_rename_after.result index 19d5d017fb2..974cb125626 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_column_rename_after.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_column_rename_after.result @@ -8,8 +8,8 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `body` text, + `title` text DEFAULT NULL, + `body` text DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 ALTER TABLE diaries CHANGE body description TEXT AFTER id; @@ -17,8 +17,8 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `description` text, - `title` text, + `description` text DEFAULT NULL, + `title` text DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries (title, description) values ("groonga (1)", "starting groonga."); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_column_rename_first.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_column_rename_first.result index cf2bcc0fc2c..5baf7cdb125 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_column_rename_first.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_column_rename_first.result @@ -8,17 +8,17 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `body` text, + `title` text DEFAULT NULL, + `body` text DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 ALTER TABLE diaries CHANGE body description TEXT FIRST; SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( - `description` text, + `description` text DEFAULT NULL, `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, + `title` text DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries (title, description) values ("groonga (1)", "starting groonga."); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_column_rename_multiple.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_column_rename_multiple.result index c73030805c8..31906776bf4 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_column_rename_multiple.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_column_rename_multiple.result @@ -8,8 +8,8 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `body` text, + `title` text DEFAULT NULL, + `body` text DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 ALTER TABLE diaries @@ -19,9 +19,9 @@ CHANGE id internal_id INT; SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( - `description` text, + `description` text DEFAULT NULL, `internal_id` int(11) NOT NULL, - `subject` text, + `subject` text DEFAULT NULL, PRIMARY KEY (`internal_id`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries (subject, description) diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_column_rename_no_order.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_column_rename_no_order.result index 6d60200e5ce..de6f0e3abc0 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_column_rename_no_order.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_column_rename_no_order.result @@ -8,8 +8,8 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `body` text, + `title` text DEFAULT NULL, + `body` text DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 ALTER TABLE diaries CHANGE body description TEXT; @@ -17,8 +17,8 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `description` text, + `title` text DEFAULT NULL, + `description` text DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries (title, description) values ("groonga (1)", "starting groonga."); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_engine.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_engine.result index 3a7413e389b..fb1cb9b5a93 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_engine.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_engine.result @@ -10,8 +10,8 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `body` text, + `title` text DEFAULT NULL, + `body` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `title_index` (`title`), FULLTEXT KEY `body_index` (`body`) @@ -28,8 +28,8 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `body` text, + `title` text DEFAULT NULL, + `body` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `title_index` (`title`), FULLTEXT KEY `body_index` (`body`) diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_drop_column_multiple.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_drop_column_multiple.result index 6475de51b21..26c429846ea 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_drop_column_multiple.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_drop_column_multiple.result @@ -8,8 +8,8 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `body` text, + `title` text DEFAULT NULL, + `body` text DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries (title, body) VALUES ("survey", "will start groonga!"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_drop_column_one.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_drop_column_one.result index cbc94cebccf..c911eecda3a 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_drop_column_one.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_drop_column_one.result @@ -8,8 +8,8 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `body` text, + `title` text DEFAULT NULL, + `body` text DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries (title, body) VALUES ("survey", "will start groonga!"); @@ -21,7 +21,7 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, + `title` text DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 SELECT * FROM diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_engine_decimal.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_engine_decimal.result index 6bbedd41e95..cf4fc866335 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_engine_decimal.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_engine_decimal.result @@ -8,7 +8,7 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, + `title` text DEFAULT NULL, `temperature` decimal(6,3) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 @@ -31,7 +31,7 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, + `title` text DEFAULT NULL, `temperature` decimal(6,3) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_fulltext_add_normal.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_fulltext_add_normal.result index d98dc431a0b..5910f28ddb3 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_fulltext_add_normal.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_fulltext_add_normal.result @@ -11,7 +11,7 @@ SHOW CREATE TABLE memos; Table Create Table memos CREATE TABLE `memos` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `content` text, + `content` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `content_index` (`content`) ) ENGINE=Mroonga AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_modify_column_after.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_modify_column_after.result index d831d02d76a..2893f417f41 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_modify_column_after.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_modify_column_after.result @@ -8,8 +8,8 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `body` text, + `title` text DEFAULT NULL, + `body` text DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries (title, body) values ("groonga (1)", "starting groonga."); @@ -21,8 +21,8 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `body` text, - `title` text, + `body` text DEFAULT NULL, + `title` text DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 INSERT INTO diaries (title, body) values ("groonga (2)", "started groonga."); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_modify_column_first.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_modify_column_first.result index bd936507211..a26249a81e7 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_modify_column_first.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_modify_column_first.result @@ -8,8 +8,8 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `body` text, + `title` text DEFAULT NULL, + `body` text DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries (title, body) values ("groonga (1)", "starting groonga."); @@ -20,9 +20,9 @@ ALTER TABLE diaries MODIFY body TEXT FIRST; SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( - `body` text, + `body` text DEFAULT NULL, `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, + `title` text DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 INSERT INTO diaries (title, body) values ("groonga (2)", "started groonga."); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_modify_column_no_order.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_modify_column_no_order.result index d8d963d87b4..6d3f4b83f37 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_modify_column_no_order.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_modify_column_no_order.result @@ -8,8 +8,8 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `body` text, + `title` text DEFAULT NULL, + `body` text DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries (title, body) values ("groonga (1)", "starting groonga."); @@ -22,7 +22,7 @@ Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, `title` varchar(100) DEFAULT NULL, - `body` text, + `body` text DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 INSERT INTO diaries (title, body) values ("groonga (2)", "started groonga."); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_recreate_anonymous_index_at_once.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_recreate_anonymous_index_at_once.result index 64f524de06c..b96bf53ee1c 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_recreate_anonymous_index_at_once.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_recreate_anonymous_index_at_once.result @@ -9,8 +9,8 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `body` text, + `title` text DEFAULT NULL, + `body` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `body` (`body`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 @@ -39,8 +39,8 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `body` text, + `title` text DEFAULT NULL, + `body` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `body` (`body`) ) ENGINE=Mroonga AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_rename_table.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_rename_table.result index eac322ceb26..043ef2db430 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_rename_table.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_rename_table.result @@ -10,8 +10,8 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `body` text, + `title` text DEFAULT NULL, + `body` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `title_index` (`title`), FULLTEXT KEY `body_index` (`body`) @@ -36,8 +36,8 @@ SHOW CREATE TABLE memos; Table Create Table memos CREATE TABLE `memos` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `body` text, + `title` text DEFAULT NULL, + `body` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `title_index` (`title`), FULLTEXT KEY `body_index` (`body`) diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_spatial.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_spatial.result index ed36927e7b9..0ec5b2cebe8 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_spatial.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_spatial.result @@ -124,7 +124,7 @@ SHOW CREATE TABLE shops; Table Create Table shops CREATE TABLE `shops` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `name` text, + `name` text DEFAULT NULL, `location` geometry NOT NULL, PRIMARY KEY (`id`), SPATIAL KEY `location_index` (`location`) diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_date_with_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_date_with_index.result index e24a56be3a2..ab03fe97083 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/column_date_with_index.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_date_with_index.result @@ -9,7 +9,7 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, + `title` text DEFAULT NULL, `created_at` date DEFAULT NULL, PRIMARY KEY (`id`), KEY `created_at` (`created_at`) diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_date_without_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_date_without_index.result index 018ee8eb5b8..be5aba2020a 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/column_date_without_index.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_date_without_index.result @@ -8,7 +8,7 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, + `title` text DEFAULT NULL, `created_at` date DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_32bit_2038.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_32bit_2038.result index 453f641968b..f7e0c7ed4e6 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_32bit_2038.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_32bit_2038.result @@ -8,7 +8,7 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, + `title` text DEFAULT NULL, `created_at` datetime DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_32bit_before_unix_epoch.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_32bit_before_unix_epoch.result index 10824d7c28d..fa0c74686a4 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_32bit_before_unix_epoch.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_32bit_before_unix_epoch.result @@ -8,7 +8,7 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, + `title` text DEFAULT NULL, `created_at` datetime DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_32bit_max.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_32bit_max.result index f3a7b27f342..45af052b8d4 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_32bit_max.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_32bit_max.result @@ -8,7 +8,7 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, + `title` text DEFAULT NULL, `created_at` datetime DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_32bit_out_of_range.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_32bit_out_of_range.result index d7acad79bab..bc91116f150 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_32bit_out_of_range.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_32bit_out_of_range.result @@ -8,7 +8,7 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, + `title` text DEFAULT NULL, `created_at` datetime DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_2038.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_2038.result index 56e38902f28..f2bc6332be6 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_2038.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_2038.result @@ -8,7 +8,7 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, + `title` text DEFAULT NULL, `created_at` datetime DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_before_unix_epoch.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_before_unix_epoch.result index c3ca2628bca..778ecf29dca 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_before_unix_epoch.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_before_unix_epoch.result @@ -8,7 +8,7 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, + `title` text DEFAULT NULL, `created_at` datetime DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_max.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_max.result index 0373d17530e..1477f32ce67 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_max.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_max.result @@ -8,7 +8,7 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, + `title` text DEFAULT NULL, `created_at` datetime DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_version_56_or_later_out_of_range.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_version_56_or_later_out_of_range.result index 962212c86f8..7cca8d2f83e 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_version_56_or_later_out_of_range.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_version_56_or_later_out_of_range.result @@ -8,7 +8,7 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, + `title` text DEFAULT NULL, `created_at` datetime DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_fractional_seconds_with_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_fractional_seconds_with_index.result index a31042f768d..db44acf133c 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_fractional_seconds_with_index.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_fractional_seconds_with_index.result @@ -9,7 +9,7 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, + `title` text DEFAULT NULL, `created_at` datetime(6) DEFAULT NULL, PRIMARY KEY (`id`), KEY `created_at` (`created_at`) diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_fractional_seconds_without_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_fractional_seconds_without_index.result index 0b1bf0f0eb4..21d18bcfe7d 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_fractional_seconds_without_index.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_fractional_seconds_without_index.result @@ -8,7 +8,7 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, + `title` text DEFAULT NULL, `created_at` datetime(6) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_null.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_null.result index 82f01b9f237..849d7d833b4 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_null.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_null.result @@ -8,7 +8,7 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, + `title` text DEFAULT NULL, `created_at` datetime DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_with_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_with_index.result index b205031dec1..9c460234261 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_with_index.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_with_index.result @@ -9,7 +9,7 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, + `title` text DEFAULT NULL, `created_at` datetime DEFAULT NULL, PRIMARY KEY (`id`), KEY `created_at` (`created_at`) diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_without_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_without_index.result index 6592df35fcb..b6c2b882c8f 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_without_index.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_without_index.result @@ -8,7 +8,7 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, + `title` text DEFAULT NULL, `created_at` datetime DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_decimal_fractional_seconds_with_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_decimal_fractional_seconds_with_index.result index 4a21d62dd14..8dc2d847acc 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/column_decimal_fractional_seconds_with_index.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_decimal_fractional_seconds_with_index.result @@ -9,7 +9,7 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, + `title` text DEFAULT NULL, `temperature` decimal(6,3) DEFAULT NULL, PRIMARY KEY (`id`), KEY `temperature` (`temperature`) diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_decimal_fractional_seconds_without_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_decimal_fractional_seconds_without_index.result index cd939fa5483..0b3fd4c53e1 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/column_decimal_fractional_seconds_without_index.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_decimal_fractional_seconds_without_index.result @@ -8,7 +8,7 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, + `title` text DEFAULT NULL, `temperature` decimal(6,3) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_decimal_with_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_decimal_with_index.result index 56a6a360dc9..97eda9f237a 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/column_decimal_with_index.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_decimal_with_index.result @@ -9,7 +9,7 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, + `title` text DEFAULT NULL, `temperature` decimal(10,0) DEFAULT NULL, PRIMARY KEY (`id`), KEY `temperature` (`temperature`) diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_decimal_without_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_decimal_without_index.result index 06162f76ddd..b635f4db2b7 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/column_decimal_without_index.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_decimal_without_index.result @@ -8,7 +8,7 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, + `title` text DEFAULT NULL, `temperature` decimal(10,0) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_time_fractional_seconds_with_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_time_fractional_seconds_with_index.result index 9c2a8e876e3..fa631bc8471 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/column_time_fractional_seconds_with_index.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_time_fractional_seconds_with_index.result @@ -10,7 +10,7 @@ SHOW CREATE TABLE running_records; Table Create Table running_records CREATE TABLE `running_records` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, + `title` text DEFAULT NULL, `average` time(6) DEFAULT NULL, `max` time(6) DEFAULT NULL, PRIMARY KEY (`id`), diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_time_with_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_time_with_index.result index da75fd97424..3f0b664d4fe 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/column_time_with_index.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_time_with_index.result @@ -10,7 +10,7 @@ SHOW CREATE TABLE running_records; Table Create Table running_records CREATE TABLE `running_records` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, + `title` text DEFAULT NULL, `average` time DEFAULT NULL, `max` time DEFAULT NULL, PRIMARY KEY (`id`), diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_timestamp_fractional_seconds_with_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_timestamp_fractional_seconds_with_index.result index da245535f2c..0190f4cdd30 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/column_timestamp_fractional_seconds_with_index.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_timestamp_fractional_seconds_with_index.result @@ -10,7 +10,7 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, + `title` text DEFAULT NULL, `created_at` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), `updated_at` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000', PRIMARY KEY (`id`), diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_timestamp_with_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_timestamp_with_index.result index b310de48111..4690200c872 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/column_timestamp_with_index.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_timestamp_with_index.result @@ -10,7 +10,7 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, + `title` text DEFAULT NULL, `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`id`), diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_year_with_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_year_with_index.result index 3ee91c1a408..1fc8e146c17 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/column_year_with_index.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_year_with_index.result @@ -9,7 +9,7 @@ SHOW CREATE TABLE aniversary_memos; Table Create Table aniversary_memos CREATE TABLE `aniversary_memos` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, + `title` text DEFAULT NULL, `party_year` year(4) DEFAULT NULL, PRIMARY KEY (`id`), KEY `party_year` (`party_year`) diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_year_without_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_year_without_index.result index 254a0c0718a..c55bc4c6df5 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/column_year_without_index.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_year_without_index.result @@ -8,7 +8,7 @@ SHOW CREATE TABLE aniversary_memos; Table Create Table aniversary_memos CREATE TABLE `aniversary_memos` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, + `title` text DEFAULT NULL, `party_year` year(4) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_field_flags_parameter.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_field_flags_parameter.result index 9e089e53f49..63bf6f666e7 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_field_flags_parameter.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_field_flags_parameter.result @@ -6,7 +6,7 @@ SHOW CREATE TABLE bugs; Table Create Table bugs CREATE TABLE `bugs` ( `id` int(10) unsigned NOT NULL, - `tags` text `FLAGS`='COLUMN_VECTOR', + `tags` text DEFAULT NULL `FLAGS`='COLUMN_VECTOR', PRIMARY KEY (`id`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 SELECT mroonga_command("dump --dump_plugins no"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_parser_comment.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_parser_comment.result index 4088caf49d5..5b593ef0383 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_parser_comment.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_parser_comment.result @@ -9,7 +9,7 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `body` text, + `body` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `body_index` (`body`) COMMENT 'parser "TokenBigramSplitSymbolAlphaDigit"' ) ENGINE=Mroonga DEFAULT CHARSET=utf8 diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_parser_default.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_parser_default.result index a18614d19fc..284ecdb6184 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_parser_default.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_parser_default.result @@ -10,7 +10,7 @@ show create table diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `body` text, + `body` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `body_index` (`body`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_parser_off.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_parser_off.result index 77765f61dc3..c3791d10399 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_parser_off.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_parser_off.result @@ -8,7 +8,7 @@ SHOW CREATE TABLE variables; Table Create Table variables CREATE TABLE `variables` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `name` text, + `name` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `name` (`name`) COMMENT 'parser "off"' ) ENGINE=Mroonga DEFAULT CHARSET=utf8 diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_tokenizer_comment.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_tokenizer_comment.result index 5b8d0cd780e..7c02b18d6a2 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_tokenizer_comment.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_tokenizer_comment.result @@ -9,7 +9,7 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `body` text, + `body` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `body_index` (`body`) COMMENT 'tokenizer "TokenBigramSplitSymbolAlphaDigit"' ) ENGINE=Mroonga DEFAULT CHARSET=utf8 diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_tokenizer_default.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_tokenizer_default.result index 9efa08bab53..b55a2ae52ee 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_tokenizer_default.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_tokenizer_default.result @@ -10,7 +10,7 @@ show create table diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `body` text, + `body` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `body_index` (`body`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_tokenizer_off.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_tokenizer_off.result index 780ac2faa3d..d332795199f 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_tokenizer_off.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_tokenizer_off.result @@ -8,7 +8,7 @@ SHOW CREATE TABLE variables; Table Create Table variables CREATE TABLE `variables` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `name` text, + `name` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `name` (`name`) COMMENT 'tokenizer "off"' ) ENGINE=Mroonga DEFAULT CHARSET=utf8 diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_tokenizer_parameter.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_tokenizer_parameter.result index 67170925826..0edc0a1b18e 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_tokenizer_parameter.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_tokenizer_parameter.result @@ -8,7 +8,7 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `body` text, + `body` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `body_index` (`body`) `TOKENIZER`='TokenBigramSplitSymbolAlphaDigit' ) ENGINE=Mroonga DEFAULT CHARSET=utf8 diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_leading_not.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_leading_not.result index d0e1a68f76b..6452fe4398c 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_leading_not.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_leading_not.result @@ -11,7 +11,7 @@ Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL, `title` varchar(255) DEFAULT NULL, - `content` text, + `content` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `content` (`content`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_charset_utf8mb4.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_charset_utf8mb4.result index 31d45181c96..cc6c0131854 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_charset_utf8mb4.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_charset_utf8mb4.result @@ -11,7 +11,7 @@ Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL, `title` varchar(255) DEFAULT NULL, - `content` text, + `content` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `content` (`content`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4 diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_found_rows.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_found_rows.result index c107991d151..ebaa41fcfb7 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_found_rows.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_found_rows.result @@ -18,7 +18,7 @@ diaries CREATE TABLE `diaries` ( `month` int(10) unsigned DEFAULT NULL, `day` int(10) unsigned DEFAULT NULL, `title` varchar(255) DEFAULT NULL, - `content` text, + `content` text DEFAULT NULL, PRIMARY KEY (`id`), KEY `day` (`day`), FULLTEXT KEY `content` (`content`) diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_index_recreate.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_index_recreate.result index 04996d30f36..faed6cffe54 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_index_recreate.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_index_recreate.result @@ -11,7 +11,7 @@ Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL, `title` varchar(255) DEFAULT NULL, - `content` text, + `content` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `title` (`title`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_insert_values.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_insert_values.result index 623c66daaf4..f05ee7dccd9 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_insert_values.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_insert_values.result @@ -4,7 +4,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` text, + `c2` text DEFAULT NULL, PRIMARY KEY (`c1`), FULLTEXT KEY `ft` (`c2`) ) ENGINE=Mroonga DEFAULT CHARSET=latin1 diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_multiple_column_index_delete.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_multiple_column_index_delete.result index 843c4b958ba..14984ed623a 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_multiple_column_index_delete.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_multiple_column_index_delete.result @@ -13,7 +13,7 @@ Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL, `title` varchar(255) DEFAULT NULL, - `content` text, + `content` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `title` (`title`,`content`), FULLTEXT KEY `title_2` (`title`), diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_multiple_column_index_insert.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_multiple_column_index_insert.result index 3856d7ecc10..cc8881bf99a 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_multiple_column_index_insert.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_multiple_column_index_insert.result @@ -13,7 +13,7 @@ Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL, `title` varchar(255) DEFAULT NULL, - `content` text, + `content` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `title` (`title`,`content`), FULLTEXT KEY `title_2` (`title`), diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_multiple_column_index_recreate.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_multiple_column_index_recreate.result index 59b26574c73..a3936cea11f 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_multiple_column_index_recreate.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_multiple_column_index_recreate.result @@ -13,7 +13,7 @@ Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL, `title` varchar(255) DEFAULT NULL, - `content` text, + `content` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `title` (`title`,`content`), FULLTEXT KEY `title_2` (`title`), diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_multiple_column_index_update.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_multiple_column_index_update.result index d17ff6adf83..2706ff665d9 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_multiple_column_index_update.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_multiple_column_index_update.result @@ -13,7 +13,7 @@ Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL, `title` varchar(255) DEFAULT NULL, - `content` text, + `content` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `title` (`title`,`content`), FULLTEXT KEY `title_2` (`title`), diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_multiple_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_multiple_index.result index 81b40261a4c..450687fb3b7 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_multiple_index.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_multiple_index.result @@ -10,8 +10,8 @@ show create table diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `body` text, + `title` text DEFAULT NULL, + `body` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `title_index` (`title`), FULLTEXT KEY `body_index` (`body`) diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_no_primary_key.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_no_primary_key.result index 5f85632575b..bb3831ea6d9 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_no_primary_key.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_no_primary_key.result @@ -9,7 +9,7 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `title` varchar(255) DEFAULT NULL, - `content` text, + `content` text DEFAULT NULL, FULLTEXT KEY `content` (`content`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries VALUES("Hello", "今日ã‹ã‚‰ã¯ã˜ã‚ã¾ã—ãŸã€‚"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/geometry_contains.result b/storage/mroonga/mysql-test/mroonga/storage/r/geometry_contains.result index 29fd989b4f4..e694166b930 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/geometry_contains.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/geometry_contains.result @@ -9,7 +9,7 @@ SHOW CREATE TABLE shops; Table Create Table shops CREATE TABLE `shops` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `name` text, + `name` text DEFAULT NULL, `location` geometry NOT NULL, PRIMARY KEY (`id`), SPATIAL KEY `location_index` (`location`) diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_date.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_date.result index a460c7d99d6..d6ce9873606 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_date.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_date.result @@ -7,7 +7,7 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `day` date NOT NULL, - `title` text, + `title` text DEFAULT NULL, PRIMARY KEY (`day`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries (day, title) VALUES ("2012-01-29", "clear day"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_datetime_with_fractional_seconds.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_datetime_with_fractional_seconds.result index ffbbfe3f460..2cf83ae6aa5 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_datetime_with_fractional_seconds.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_datetime_with_fractional_seconds.result @@ -7,7 +7,7 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `day` datetime(6) NOT NULL, - `title` text, + `title` text DEFAULT NULL, PRIMARY KEY (`day`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries (day, title) diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_datetime_without_fractional_seconds.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_datetime_without_fractional_seconds.result index 76c529f7fbb..f605346130b 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_datetime_without_fractional_seconds.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_datetime_without_fractional_seconds.result @@ -7,7 +7,7 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `day` datetime NOT NULL, - `title` text, + `title` text DEFAULT NULL, PRIMARY KEY (`day`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries (day, title) diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_decimal_with_fractional_seconds.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_decimal_with_fractional_seconds.result index 9b1e8e7d7e8..4e8386251e7 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_decimal_with_fractional_seconds.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_decimal_with_fractional_seconds.result @@ -7,7 +7,7 @@ SHOW CREATE TABLE releases; Table Create Table releases CREATE TABLE `releases` ( `version` decimal(6,3) NOT NULL, - `message` text, + `message` text DEFAULT NULL, PRIMARY KEY (`version`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO releases (version, message) VALUES (10.000, "10th release!"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_decimal_without_fractional_seconds.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_decimal_without_fractional_seconds.result index 0624ab2f2b2..c7d9f4db5c0 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_decimal_without_fractional_seconds.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_decimal_without_fractional_seconds.result @@ -7,7 +7,7 @@ SHOW CREATE TABLE releases; Table Create Table releases CREATE TABLE `releases` ( `version` decimal(10,0) NOT NULL, - `message` text, + `message` text DEFAULT NULL, PRIMARY KEY (`version`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO releases (version, message) VALUES (1, "the first release!!!"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_time_with_fractional_seconds.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_time_with_fractional_seconds.result index 639114875e9..705f311a5d8 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_time_with_fractional_seconds.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_time_with_fractional_seconds.result @@ -7,7 +7,7 @@ SHOW CREATE TABLE running_records; Table Create Table running_records CREATE TABLE `running_records` ( `time` time(6) NOT NULL, - `title` text, + `title` text DEFAULT NULL, PRIMARY KEY (`time`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO running_records (time, title) diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_time_without_fractional_seconds.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_time_without_fractional_seconds.result index 6a89cdc33dd..d8807f34257 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_time_without_fractional_seconds.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_time_without_fractional_seconds.result @@ -7,7 +7,7 @@ SHOW CREATE TABLE running_records; Table Create Table running_records CREATE TABLE `running_records` ( `time` time NOT NULL, - `title` text, + `title` text DEFAULT NULL, PRIMARY KEY (`time`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO running_records (time, title) diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_timestamp_with_fractional_seconds.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_timestamp_with_fractional_seconds.result index 7040cc22b2e..dc7127b7245 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_timestamp_with_fractional_seconds.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_timestamp_with_fractional_seconds.result @@ -7,7 +7,7 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), - `title` text, + `title` text DEFAULT NULL, PRIMARY KEY (`time`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries (time, title) diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_timestamp_without_fractional_seconds.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_timestamp_without_fractional_seconds.result index 38017f6f8cc..3a782044128 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_timestamp_without_fractional_seconds.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_timestamp_without_fractional_seconds.result @@ -7,7 +7,7 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `title` text, + `title` text DEFAULT NULL, PRIMARY KEY (`time`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries (time, title) VALUES ("2012-01-29 21:51:01", "clear day"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_year.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_year.result index af9b3a2dbfb..9bdf87dffcd 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_year.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_year.result @@ -7,7 +7,7 @@ SHOW CREATE TABLE aniversary_memos; Table Create Table aniversary_memos CREATE TABLE `aniversary_memos` ( `party_year` year(4) NOT NULL, - `title` text, + `title` text DEFAULT NULL, PRIMARY KEY (`party_year`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO aniversary_memos (party_year, title) diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/information_schema_tables_data_length.result b/storage/mroonga/mysql-test/mroonga/storage/r/information_schema_tables_data_length.result index d58afb1f6d4..91850d9d871 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/information_schema_tables_data_length.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/information_schema_tables_data_length.result @@ -11,7 +11,7 @@ Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL, `title` varchar(255) DEFAULT NULL, - `content` text, + `content` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `content` (`content`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/insert_on_duplicate_key_update_primary_key.result b/storage/mroonga/mysql-test/mroonga/storage/r/insert_on_duplicate_key_update_primary_key.result index 12d4b173eaa..595b3da00cd 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/insert_on_duplicate_key_update_primary_key.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/insert_on_duplicate_key_update_primary_key.result @@ -7,7 +7,7 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `day` date NOT NULL, - `title` text, + `title` text DEFAULT NULL, PRIMARY KEY (`day`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries (day, title) diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/insert_on_duplicate_key_update_unique_key.result b/storage/mroonga/mysql-test/mroonga/storage/r/insert_on_duplicate_key_update_unique_key.result index fbec44527f7..ff6925067e5 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/insert_on_duplicate_key_update_unique_key.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/insert_on_duplicate_key_update_unique_key.result @@ -10,7 +10,7 @@ Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, `day` date DEFAULT NULL, - `title` text, + `title` text DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `day` (`day`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_disabled.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_disabled.result index 9971d21e386..fd5f856d64c 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_disabled.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_disabled.result @@ -12,7 +12,7 @@ Table Create Table diaries CREATE TABLE `diaries` ( `id` int(10) unsigned NOT NULL, `title` varchar(255) DEFAULT NULL, - `content` text, + `content` text DEFAULT NULL, FULLTEXT KEY `content` (`content`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries VALUES(1, "Hello", "今日ã‹ã‚‰ã¯ã˜ã‚ã¾ã—ãŸã€‚"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_not_optimized_disabled.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_not_optimized_disabled.result index da15588ccd5..e2391c03e06 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_not_optimized_disabled.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_not_optimized_disabled.result @@ -20,7 +20,7 @@ diaries CREATE TABLE `diaries` ( `month` int(10) unsigned DEFAULT NULL, `day` int(10) unsigned DEFAULT NULL, `title` varchar(255) DEFAULT NULL, - `content` text, + `content` text DEFAULT NULL, KEY `month` (`month`), KEY `day` (`day`), FULLTEXT KEY `content` (`content`) diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_not_optimized_no_limit.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_not_optimized_no_limit.result index 0794b104a62..10d30798c89 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_not_optimized_no_limit.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_not_optimized_no_limit.result @@ -20,7 +20,7 @@ diaries CREATE TABLE `diaries` ( `month` int(10) unsigned DEFAULT NULL, `day` int(10) unsigned DEFAULT NULL, `title` varchar(255) DEFAULT NULL, - `content` text, + `content` text DEFAULT NULL, KEY `month` (`month`), KEY `day` (`day`), FULLTEXT KEY `content` (`content`) diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_between.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_between.result index bd34b040ad7..4ea3856d363 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_between.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_between.result @@ -13,7 +13,7 @@ Table Create Table diaries CREATE TABLE `diaries` ( `id` int(10) unsigned NOT NULL, `date` datetime DEFAULT NULL, - `content` text, + `content` text DEFAULT NULL, KEY `date` (`date`), FULLTEXT KEY `content` (`content`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_between_over.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_between_over.result index f495a3b5956..067e8bc7f61 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_between_over.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_between_over.result @@ -13,7 +13,7 @@ Table Create Table diaries CREATE TABLE `diaries` ( `id` int(10) unsigned NOT NULL, `date` datetime DEFAULT NULL, - `content` text, + `content` text DEFAULT NULL, KEY `date` (`date`), FULLTEXT KEY `content` (`content`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_equal.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_equal.result index b5be750690d..41129e1945f 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_equal.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_equal.result @@ -13,7 +13,7 @@ Table Create Table diaries CREATE TABLE `diaries` ( `id` int(10) unsigned NOT NULL, `date` datetime DEFAULT NULL, - `content` text, + `content` text DEFAULT NULL, KEY `date` (`date`), FULLTEXT KEY `content` (`content`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_greater_than.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_greater_than.result index 6f20f3b8b35..3a99051643d 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_greater_than.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_greater_than.result @@ -13,7 +13,7 @@ Table Create Table diaries CREATE TABLE `diaries` ( `id` int(10) unsigned NOT NULL, `date` datetime DEFAULT NULL, - `content` text, + `content` text DEFAULT NULL, KEY `date` (`date`), FULLTEXT KEY `content` (`content`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_greater_than_or_equal.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_greater_than_or_equal.result index 5df3c12ccd8..b6db34d113d 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_greater_than_or_equal.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_greater_than_or_equal.result @@ -13,7 +13,7 @@ Table Create Table diaries CREATE TABLE `diaries` ( `id` int(10) unsigned NOT NULL, `date` datetime DEFAULT NULL, - `content` text, + `content` text DEFAULT NULL, KEY `date` (`date`), FULLTEXT KEY `content` (`content`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_less_than.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_less_than.result index c12e69bf686..042e42ff36b 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_less_than.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_less_than.result @@ -13,7 +13,7 @@ Table Create Table diaries CREATE TABLE `diaries` ( `id` int(10) unsigned NOT NULL, `date` datetime DEFAULT NULL, - `content` text, + `content` text DEFAULT NULL, KEY `date` (`date`), FULLTEXT KEY `content` (`content`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_less_than_or_equal.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_less_than_or_equal.result index 6d00bac66eb..1c06397c7ea 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_less_than_or_equal.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_less_than_or_equal.result @@ -13,7 +13,7 @@ Table Create Table diaries CREATE TABLE `diaries` ( `id` int(10) unsigned NOT NULL, `date` datetime DEFAULT NULL, - `content` text, + `content` text DEFAULT NULL, KEY `date` (`date`), FULLTEXT KEY `content` (`content`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_have_primary_key.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_have_primary_key.result index 529f0d521ee..be68e8771b2 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_have_primary_key.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_have_primary_key.result @@ -19,7 +19,7 @@ diaries CREATE TABLE `diaries` ( `month` int(10) unsigned DEFAULT NULL, `day` int(10) unsigned DEFAULT NULL, `title` varchar(255) DEFAULT NULL, - `content` text, + `content` text DEFAULT NULL, PRIMARY KEY (`id`), KEY `day` (`day`), FULLTEXT KEY `content` (`content`) diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_equal.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_equal.result index 2320b0ffbc4..7e3c4293c50 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_equal.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_equal.result @@ -20,7 +20,7 @@ diaries CREATE TABLE `diaries` ( `month` int(10) unsigned DEFAULT NULL, `day` int(10) unsigned DEFAULT NULL, `title` varchar(255) DEFAULT NULL, - `content` text, + `content` text DEFAULT NULL, KEY `month` (`month`), KEY `day` (`day`), FULLTEXT KEY `content` (`content`) diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_greater_than.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_greater_than.result index c367aef808a..54bfcbc2b5c 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_greater_than.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_greater_than.result @@ -20,7 +20,7 @@ diaries CREATE TABLE `diaries` ( `month` int(10) unsigned DEFAULT NULL, `day` int(10) unsigned DEFAULT NULL, `title` varchar(255) DEFAULT NULL, - `content` text, + `content` text DEFAULT NULL, KEY `month` (`month`), KEY `day` (`day`), FULLTEXT KEY `content` (`content`) diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_greater_than_or_equal.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_greater_than_or_equal.result index b00a4e2a2c3..c4644584b0d 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_greater_than_or_equal.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_greater_than_or_equal.result @@ -20,7 +20,7 @@ diaries CREATE TABLE `diaries` ( `month` int(10) unsigned DEFAULT NULL, `day` int(10) unsigned DEFAULT NULL, `title` varchar(255) DEFAULT NULL, - `content` text, + `content` text DEFAULT NULL, KEY `month` (`month`), KEY `day` (`day`), FULLTEXT KEY `content` (`content`) diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_less_than.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_less_than.result index 5bf6bca4985..a4af585cd57 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_less_than.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_less_than.result @@ -20,7 +20,7 @@ diaries CREATE TABLE `diaries` ( `month` int(10) unsigned DEFAULT NULL, `day` int(10) unsigned DEFAULT NULL, `title` varchar(255) DEFAULT NULL, - `content` text, + `content` text DEFAULT NULL, KEY `month` (`month`), KEY `day` (`day`), FULLTEXT KEY `content` (`content`) diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_less_than_or_equal.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_less_than_or_equal.result index 5d6a19a936e..a11e9fc6e40 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_less_than_or_equal.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_less_than_or_equal.result @@ -20,7 +20,7 @@ diaries CREATE TABLE `diaries` ( `month` int(10) unsigned DEFAULT NULL, `day` int(10) unsigned DEFAULT NULL, `title` varchar(255) DEFAULT NULL, - `content` text, + `content` text DEFAULT NULL, KEY `month` (`month`), KEY `day` (`day`), FULLTEXT KEY `content` (`content`) diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_no_primary_key.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_no_primary_key.result index 6ee2991e51a..86f783b81f4 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_no_primary_key.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_no_primary_key.result @@ -19,7 +19,7 @@ diaries CREATE TABLE `diaries` ( `month` int(10) unsigned DEFAULT NULL, `day` int(10) unsigned DEFAULT NULL, `title` varchar(255) DEFAULT NULL, - `content` text, + `content` text DEFAULT NULL, KEY `day` (`day`), FULLTEXT KEY `content` (`content`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_order_by_asc.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_order_by_asc.result index e91e8af5391..acbb6af0be3 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_order_by_asc.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_order_by_asc.result @@ -20,7 +20,7 @@ diaries CREATE TABLE `diaries` ( `month` int(10) unsigned DEFAULT NULL, `day` int(10) unsigned DEFAULT NULL, `title` varchar(255) DEFAULT NULL, - `content` text, + `content` text DEFAULT NULL, KEY `month` (`month`), KEY `day` (`day`), FULLTEXT KEY `content` (`content`) diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_order_by_desc.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_order_by_desc.result index da01145e45a..6b12587a14d 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_order_by_desc.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_order_by_desc.result @@ -20,7 +20,7 @@ diaries CREATE TABLE `diaries` ( `month` int(10) unsigned DEFAULT NULL, `day` int(10) unsigned DEFAULT NULL, `title` varchar(255) DEFAULT NULL, - `content` text, + `content` text DEFAULT NULL, KEY `month` (`month`), KEY `day` (`day`), FULLTEXT KEY `content` (`content`) diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_order_by_id.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_order_by_id.result index bb541c014bd..30f4a08d1c9 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_order_by_id.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_order_by_id.result @@ -22,7 +22,7 @@ diaries CREATE TABLE `diaries` ( `month` int(10) unsigned DEFAULT NULL, `day` int(10) unsigned DEFAULT NULL, `title` varchar(255) DEFAULT NULL, - `content` text, + `content` text DEFAULT NULL, KEY `month` (`month`), KEY `day` (`day`), FULLTEXT KEY `content` (`content`) diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_order_by_match_against.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_order_by_match_against.result index fb9393687dc..abc2dbf06ce 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_order_by_match_against.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_order_by_match_against.result @@ -20,7 +20,7 @@ diaries CREATE TABLE `diaries` ( `month` int(10) unsigned DEFAULT NULL, `day` int(10) unsigned DEFAULT NULL, `title` varchar(255) DEFAULT NULL, - `content` text, + `content` text DEFAULT NULL, KEY `month` (`month`), KEY `day` (`day`), FULLTEXT KEY `content` (`content`) diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_select_match_against.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_select_match_against.result index 75ad884a268..52134fde180 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_select_match_against.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_select_match_against.result @@ -20,7 +20,7 @@ diaries CREATE TABLE `diaries` ( `month` int(10) unsigned DEFAULT NULL, `day` int(10) unsigned DEFAULT NULL, `title` varchar(255) DEFAULT NULL, - `content` text, + `content` text DEFAULT NULL, KEY `month` (`month`), KEY `day` (`day`), FULLTEXT KEY `content` (`content`) diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_between.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_between.result index bb4ac9c3b33..5b3ca0194e0 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_between.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_between.result @@ -13,7 +13,7 @@ Table Create Table memos CREATE TABLE `memos` ( `id` int(10) unsigned NOT NULL, `writing_time` time DEFAULT NULL, - `content` text, + `content` text DEFAULT NULL, KEY `writing_time` (`writing_time`), FULLTEXT KEY `content` (`content`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_between_over.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_between_over.result index 1b4d38e0107..98b92f3c021 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_between_over.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_between_over.result @@ -13,7 +13,7 @@ Table Create Table memos CREATE TABLE `memos` ( `id` int(10) unsigned NOT NULL, `writing_time` time DEFAULT NULL, - `content` text, + `content` text DEFAULT NULL, KEY `writing_time` (`writing_time`), FULLTEXT KEY `content` (`content`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_equal.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_equal.result index 4fff9f9185f..5a37d62785b 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_equal.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_equal.result @@ -13,7 +13,7 @@ Table Create Table memos CREATE TABLE `memos` ( `id` int(10) unsigned NOT NULL, `writing_time` time DEFAULT NULL, - `content` text, + `content` text DEFAULT NULL, KEY `writing_time` (`writing_time`), FULLTEXT KEY `content` (`content`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_greater_than.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_greater_than.result index 61119b2b74e..702f125c2b5 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_greater_than.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_greater_than.result @@ -13,7 +13,7 @@ Table Create Table memos CREATE TABLE `memos` ( `id` int(10) unsigned NOT NULL, `writing_time` time DEFAULT NULL, - `content` text, + `content` text DEFAULT NULL, KEY `writing_time` (`writing_time`), FULLTEXT KEY `content` (`content`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_greater_than_or_equal.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_greater_than_or_equal.result index 9bf8b91ea07..df3ab968803 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_greater_than_or_equal.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_greater_than_or_equal.result @@ -13,7 +13,7 @@ Table Create Table memos CREATE TABLE `memos` ( `id` int(10) unsigned NOT NULL, `writing_time` time DEFAULT NULL, - `content` text, + `content` text DEFAULT NULL, KEY `writing_time` (`writing_time`), FULLTEXT KEY `content` (`content`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_less_than.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_less_than.result index e4d41f5867e..da774b47b10 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_less_than.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_less_than.result @@ -13,7 +13,7 @@ Table Create Table memos CREATE TABLE `memos` ( `id` int(10) unsigned NOT NULL, `writing_time` time DEFAULT NULL, - `content` text, + `content` text DEFAULT NULL, KEY `writing_time` (`writing_time`), FULLTEXT KEY `content` (`content`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_less_than_or_equal.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_less_than_or_equal.result index 31a497ef8bb..0895545a96d 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_less_than_or_equal.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_less_than_or_equal.result @@ -13,7 +13,7 @@ Table Create Table memos CREATE TABLE `memos` ( `id` int(10) unsigned NOT NULL, `writing_time` time DEFAULT NULL, - `content` text, + `content` text DEFAULT NULL, KEY `writing_time` (`writing_time`), FULLTEXT KEY `content` (`content`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_varchar_equal_with_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_varchar_equal_with_index.result index 46c80ddcce7..51a9c1d4f6e 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_varchar_equal_with_index.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_varchar_equal_with_index.result @@ -21,7 +21,7 @@ diaries CREATE TABLE `diaries` ( `month` int(10) unsigned DEFAULT NULL, `day` int(10) unsigned DEFAULT NULL, `title` varchar(255) DEFAULT NULL, - `content` text, + `content` text DEFAULT NULL, KEY `title` (`title`), KEY `month` (`month`), KEY `day` (`day`), diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_varchar_equal_without_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_varchar_equal_without_index.result index 38263c1083f..0ebb303a96f 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_varchar_equal_without_index.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_varchar_equal_without_index.result @@ -20,7 +20,7 @@ diaries CREATE TABLE `diaries` ( `month` int(10) unsigned DEFAULT NULL, `day` int(10) unsigned DEFAULT NULL, `title` varchar(255) DEFAULT NULL, - `content` text, + `content` text DEFAULT NULL, KEY `month` (`month`), KEY `day` (`day`), FULLTEXT KEY `content` (`content`) diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/repair_table_no_index_file.result b/storage/mroonga/mysql-test/mroonga/storage/r/repair_table_no_index_file.result index 0812fc1089b..54515edbd0e 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/repair_table_no_index_file.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/repair_table_no_index_file.result @@ -10,8 +10,8 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `body` text, + `title` text DEFAULT NULL, + `body` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `body_index` (`body`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/replace_text.result b/storage/mroonga/mysql-test/mroonga/storage/r/replace_text.result index f2cf9667ac7..f7187258ddc 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/replace_text.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/replace_text.result @@ -9,7 +9,7 @@ show create table diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL, - `content` text, + `content` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `content` (`content`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/sub_query_fulltext.result b/storage/mroonga/mysql-test/mroonga/storage/r/sub_query_fulltext.result index 4f24d0d74b0..cd702ab7a02 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/sub_query_fulltext.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/sub_query_fulltext.result @@ -14,7 +14,7 @@ Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user_id` int(10) unsigned NOT NULL, - `title` text, + `title` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `title` (`title`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/temporary_table.result b/storage/mroonga/mysql-test/mroonga/storage/r/temporary_table.result index f6c036bbf9f..ff24e1b6102 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/temporary_table.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/temporary_table.result @@ -7,7 +7,7 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TEMPORARY TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, + `title` text DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries (title) VALUES ("clear day"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/truncate.result b/storage/mroonga/mysql-test/mroonga/storage/r/truncate.result index 104d1d51504..c59fc05ae2c 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/truncate.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/truncate.result @@ -18,7 +18,7 @@ diaries CREATE TABLE `diaries` ( `month` int(10) unsigned DEFAULT NULL, `day` int(10) unsigned DEFAULT NULL, `title` varchar(255) DEFAULT NULL, - `content` text, + `content` text DEFAULT NULL, PRIMARY KEY (`id`), KEY `day` (`day`), FULLTEXT KEY `content` (`content`) diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/variable_dry_write_delete.result b/storage/mroonga/mysql-test/mroonga/storage/r/variable_dry_write_delete.result index 6e690f45e61..deac880d265 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/variable_dry_write_delete.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_dry_write_delete.result @@ -8,7 +8,7 @@ show create table diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `body` text, + `body` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `body_index` (`body`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/variable_dry_write_insert.result b/storage/mroonga/mysql-test/mroonga/storage/r/variable_dry_write_insert.result index 8de55efaccc..13db5ec65f7 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/variable_dry_write_insert.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_dry_write_insert.result @@ -8,7 +8,7 @@ show create table diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `body` text, + `body` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `body_index` (`body`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/variable_dry_write_update.result b/storage/mroonga/mysql-test/mroonga/storage/r/variable_dry_write_update.result index dd3ee5b333c..7ba0c120a2c 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/variable_dry_write_update.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_dry_write_update.result @@ -8,7 +8,7 @@ show create table diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `body` text, + `body` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `body_index` (`body`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/variable_match_escalation_threshold_global.result b/storage/mroonga/mysql-test/mroonga/storage/r/variable_match_escalation_threshold_global.result index 04b22c22ea6..8abd41cece3 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/variable_match_escalation_threshold_global.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_match_escalation_threshold_global.result @@ -10,8 +10,8 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `tags` text, + `title` text DEFAULT NULL, + `tags` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `tags_index` (`tags`) COMMENT 'parser "TokenDelimit"' ) ENGINE=Mroonga DEFAULT CHARSET=utf8 diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/variable_match_escalation_threshold_session.result b/storage/mroonga/mysql-test/mroonga/storage/r/variable_match_escalation_threshold_session.result index 25a1aba61e2..37c2eeeb379 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/variable_match_escalation_threshold_session.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_match_escalation_threshold_session.result @@ -9,8 +9,8 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `tags` text, + `title` text DEFAULT NULL, + `tags` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `tags_index` (`tags`) COMMENT 'parser "TokenDelimit"' ) ENGINE=Mroonga DEFAULT CHARSET=utf8 diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_add_column.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_add_column.result index 22dbbff96ac..c47a5ccc354 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_add_column.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_add_column.result @@ -7,7 +7,7 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, + `title` text DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='ENGINE "InnoDB"' INSERT INTO diaries (title) VALUES ("survey"); @@ -30,8 +30,8 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `body` text, + `title` text DEFAULT NULL, + `body` text DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='ENGINE "InnoDB"' DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_change_engine.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_change_engine.result index e5ce4692aa3..3e270abe16d 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_change_engine.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_change_engine.result @@ -10,8 +10,8 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `body` text, + `title` text DEFAULT NULL, + `body` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `title_index` (`title`), FULLTEXT KEY `body_index` (`body`) @@ -28,8 +28,8 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `body` text, + `title` text DEFAULT NULL, + `body` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `title_index` (`title`), FULLTEXT KEY `body_index` (`body`) diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_comment_change_engine.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_comment_change_engine.result index 1106fcffca2..9d225f46f25 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_comment_change_engine.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_comment_change_engine.result @@ -11,7 +11,7 @@ Table Create Table memos CREATE TABLE `memos` ( `id` int(11) NOT NULL AUTO_INCREMENT, `title` varchar(64) DEFAULT NULL, - `content` text, + `content` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `content` (`content`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='engine "InnoDB"' @@ -24,7 +24,7 @@ Table Create Table memos CREATE TABLE `memos` ( `id` int(11) NOT NULL AUTO_INCREMENT, `title` varchar(64) DEFAULT NULL, - `content` text, + `content` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `content` (`content`) ) ENGINE=Mroonga AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='engine "MyISAM"' diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_drop_column.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_drop_column.result index 07c149a8fa8..c9fef8e4d8f 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_drop_column.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_drop_column.result @@ -8,8 +8,8 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `body` text, + `title` text DEFAULT NULL, + `body` text DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='ENGINE "InnoDB"' INSERT INTO diaries (title, body) VALUES ("survey", "will start groonga!"); @@ -21,7 +21,7 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, + `title` text DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='ENGINE "InnoDB"' SELECT * FROM diaries; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_fulltext.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_fulltext.result index cc64daac30a..5bf1bbf2124 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_fulltext.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_fulltext.result @@ -8,7 +8,7 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, + `title` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `title_index` (`title`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='ENGINE "InnoDB"' @@ -43,8 +43,8 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `body` text, + `title` text DEFAULT NULL, + `body` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `title_index` (`title`), FULLTEXT KEY `body_index` (`body`) diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_rename_table.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_rename_table.result index 08e526baa50..8d161b424d1 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_rename_table.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_rename_table.result @@ -10,8 +10,8 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `body` text, + `title` text DEFAULT NULL, + `body` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `title_index` (`title`), FULLTEXT KEY `body_index` (`body`) @@ -36,8 +36,8 @@ SHOW CREATE TABLE memos; Table Create Table memos CREATE TABLE `memos` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `body` text, + `title` text DEFAULT NULL, + `body` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `title_index` (`title`), FULLTEXT KEY `body_index` (`body`) diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_spatial.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_spatial.result index 0e2f4c3bcca..abb7769224c 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_spatial.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_spatial.result @@ -123,7 +123,7 @@ SHOW CREATE TABLE shops; Table Create Table shops CREATE TABLE `shops` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `name` text, + `name` text DEFAULT NULL, `location` geometry NOT NULL, PRIMARY KEY (`id`), SPATIAL KEY `location_index` (`location`) diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_parser_comment.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_parser_comment.result index 7ee07329f21..d382e937cea 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_parser_comment.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_parser_comment.result @@ -9,7 +9,7 @@ show create table diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `body` text, + `body` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `body_index` (`body`) COMMENT 'parser "TokenBigramSplitSymbolAlphaDigit"' ) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='engine "innodb"' diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_tokenizer_comment.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_tokenizer_comment.result index f6e15804f42..45cdffb8cd3 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_tokenizer_comment.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_tokenizer_comment.result @@ -9,7 +9,7 @@ show create table diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `body` text, + `body` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `body_index` (`body`) COMMENT 'tokenizer "TokenBigramSplitSymbolAlphaDigit"' ) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='engine "innodb"' diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_tokenizer_parameter.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_tokenizer_parameter.result index ddec8fdadbe..318be3f364a 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_tokenizer_parameter.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_tokenizer_parameter.result @@ -8,7 +8,7 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `body` text, + `body` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `body_index` (`body`) `TOKENIZER`='TokenBigramSplitSymbolAlphaDigit' ) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='ENGINE "InnoDB"' diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_leading_not.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_leading_not.result index 08c37695f5a..de8e47dcd82 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_leading_not.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_leading_not.result @@ -11,7 +11,7 @@ Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL, `title` varchar(255) DEFAULT NULL, - `content` text, + `content` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `content` (`content`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='ENGINE "InnoDB"' diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_multiple_match_against.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_multiple_match_against.result index b0bff284532..0659c7c59df 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_multiple_match_against.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_multiple_match_against.result @@ -12,7 +12,7 @@ Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL, `title` varchar(255) DEFAULT NULL, - `content` text, + `content` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `title` (`title`), FULLTEXT KEY `content` (`content`) diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_index_recreate.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_index_recreate.result index fd07ea67964..13b2bcb4ff1 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_index_recreate.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_index_recreate.result @@ -11,7 +11,7 @@ Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL, `title` varchar(255) DEFAULT NULL, - `content` text, + `content` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `title` (`title`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='ENGINE "InnoDB"' diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_insert_values.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_insert_values.result index 8e1b0845e85..11d40fc0589 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_insert_values.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_insert_values.result @@ -4,7 +4,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` text, + `c2` text DEFAULT NULL, PRIMARY KEY (`c1`), FULLTEXT KEY `ft` (`c2`) ) ENGINE=Mroonga DEFAULT CHARSET=latin1 COMMENT='engine "innodb"' diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_multiple_column_index_delete.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_multiple_column_index_delete.result index 64acf4aaeae..3c014b1b2b3 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_multiple_column_index_delete.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_multiple_column_index_delete.result @@ -13,7 +13,7 @@ Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL, `title` varchar(255) DEFAULT NULL, - `content` text, + `content` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `title` (`title`,`content`), FULLTEXT KEY `title_2` (`title`), diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_multiple_column_index_insert.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_multiple_column_index_insert.result index c1661d7fcbf..3b65bc1a2ba 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_multiple_column_index_insert.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_multiple_column_index_insert.result @@ -13,7 +13,7 @@ Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL, `title` varchar(255) DEFAULT NULL, - `content` text, + `content` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `title` (`title`,`content`), FULLTEXT KEY `title_2` (`title`), diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_multiple_column_index_recreate.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_multiple_column_index_recreate.result index 604aca172a5..cc0fb391628 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_multiple_column_index_recreate.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_multiple_column_index_recreate.result @@ -13,7 +13,7 @@ Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL, `title` varchar(255) DEFAULT NULL, - `content` text, + `content` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `title` (`title`,`content`), FULLTEXT KEY `title_2` (`title`), diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_multiple_column_index_update.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_multiple_column_index_update.result index 6f489bf37cc..863b95a3059 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_multiple_column_index_update.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_multiple_column_index_update.result @@ -13,7 +13,7 @@ Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL, `title` varchar(255) DEFAULT NULL, - `content` text, + `content` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `title` (`title`,`content`), FULLTEXT KEY `title_2` (`title`), diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_multiple_index.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_multiple_index.result index d9448ee82ba..9ccffb28be1 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_multiple_index.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_multiple_index.result @@ -10,8 +10,8 @@ show create table diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `body` text, + `title` text DEFAULT NULL, + `body` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `title_index` (`title`), FULLTEXT KEY `body_index` (`body`) diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_myisam.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_myisam.result index 860c8e548a8..ab3c321959e 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_myisam.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_myisam.result @@ -4,7 +4,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL, - `c2` text, + `c2` text DEFAULT NULL, PRIMARY KEY (`c1`), FULLTEXT KEY `ft` (`c2`) ) ENGINE=Mroonga DEFAULT CHARSET=latin1 COMMENT='engine "myisam"' diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_order_TODO_SPLIT_ME.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_order_TODO_SPLIT_ME.result index 74d7426ebc1..ceff90c477c 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_order_TODO_SPLIT_ME.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_order_TODO_SPLIT_ME.result @@ -12,8 +12,8 @@ SHOW CREATE TABLE ft; Table Create Table ft CREATE TABLE `ft` ( `a` int(11) NOT NULL, - `b` text, - `c` text, + `b` text DEFAULT NULL, + `c` text DEFAULT NULL, PRIMARY KEY (`a`), FULLTEXT KEY `ftx1` (`b`), FULLTEXT KEY `ftx2` (`c`) diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_order_transaction.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_order_transaction.result index 590abf0a989..1d8284e2370 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_order_transaction.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_order_transaction.result @@ -10,8 +10,8 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `body` text, + `title` text DEFAULT NULL, + `body` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `title_index` (`title`), FULLTEXT KEY `body_index` (`body`) diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/geometry_contains.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/geometry_contains.result index b3f5bee27d7..7f32fed3810 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/geometry_contains.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/geometry_contains.result @@ -9,7 +9,7 @@ show create table shops; Table Create Table shops CREATE TABLE `shops` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `name` text, + `name` text DEFAULT NULL, `location` geometry NOT NULL, PRIMARY KEY (`id`), SPATIAL KEY `location_index` (`location`) diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/geometry_delete.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/geometry_delete.result index 28b981f9c7b..92c70d223e9 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/geometry_delete.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/geometry_delete.result @@ -9,7 +9,7 @@ show create table shops; Table Create Table shops CREATE TABLE `shops` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `name` text, + `name` text DEFAULT NULL, `location` geometry NOT NULL, PRIMARY KEY (`id`), SPATIAL KEY `location_index` (`location`) diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/geometry_update.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/geometry_update.result index 20de4a32cfa..3594339c685 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/geometry_update.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/geometry_update.result @@ -9,7 +9,7 @@ show create table shops; Table Create Table shops CREATE TABLE `shops` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `name` text, + `name` text DEFAULT NULL, `location` geometry NOT NULL, PRIMARY KEY (`id`), SPATIAL KEY `location_index` (`location`) diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/insert_bulk.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/insert_bulk.result index be61419477f..c249b4995a0 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/insert_bulk.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/insert_bulk.result @@ -9,7 +9,7 @@ show create table diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL, - `content` text, + `content` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `content` (`content`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='engine "innodb"' diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/repair_table_no_files.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/repair_table_no_files.result index e330fa18c89..1eeaec1efd8 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/repair_table_no_files.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/repair_table_no_files.result @@ -10,8 +10,8 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `body` text, + `title` text DEFAULT NULL, + `body` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `body_index` (`body`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='engine "innodb"' diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/repair_table_no_index_file.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/repair_table_no_index_file.result index a5012384889..3813b320562 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/repair_table_no_index_file.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/repair_table_no_index_file.result @@ -10,8 +10,8 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `body` text, + `title` text DEFAULT NULL, + `body` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `body_index` (`body`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='engine "innodb"' diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/temporary_table.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/temporary_table.result index b01e85aa483..4e2ebf121e2 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/temporary_table.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/temporary_table.result @@ -7,7 +7,7 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TEMPORARY TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, + `title` text DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='ENGINE "InnoDB"' INSERT INTO diaries (title) VALUES ("clear day"); diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/transaction_rollback_delete_delete.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/transaction_rollback_delete_delete.result index 11cc1874257..8ea9ffb0e67 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/transaction_rollback_delete_delete.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/transaction_rollback_delete_delete.result @@ -10,8 +10,8 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `body` text, + `title` text DEFAULT NULL, + `body` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `title_index` (`title`), FULLTEXT KEY `body_index` (`body`) diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/transaction_rollback_delete_update.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/transaction_rollback_delete_update.result index 7dde8518db0..a06a57371be 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/transaction_rollback_delete_update.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/transaction_rollback_delete_update.result @@ -10,8 +10,8 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `body` text, + `title` text DEFAULT NULL, + `body` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `title_index` (`title`), FULLTEXT KEY `body_index` (`body`) diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/truncate.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/truncate.result index d41231ddd33..0285bb7f62e 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/truncate.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/truncate.result @@ -18,7 +18,7 @@ diaries CREATE TABLE `diaries` ( `month` int(10) unsigned DEFAULT NULL, `day` int(10) unsigned DEFAULT NULL, `title` varchar(255) DEFAULT NULL, - `content` text, + `content` text DEFAULT NULL, PRIMARY KEY (`id`), KEY `day` (`day`), FULLTEXT KEY `content` (`content`) diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/variable_dry_write_delete.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/variable_dry_write_delete.result index e451b2b99fe..674a6666081 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/variable_dry_write_delete.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/variable_dry_write_delete.result @@ -8,7 +8,7 @@ show create table diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `body` text, + `body` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `body_index` (`body`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='engine "innodb"' diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/variable_dry_write_insert.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/variable_dry_write_insert.result index f11398f3710..46777cd877d 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/variable_dry_write_insert.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/variable_dry_write_insert.result @@ -8,7 +8,7 @@ show create table diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `body` text, + `body` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `body_index` (`body`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='engine "innodb"' diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/variable_dry_write_update.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/variable_dry_write_update.result index 47a844c8e68..e9be95ab90e 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/variable_dry_write_update.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/variable_dry_write_update.result @@ -8,7 +8,7 @@ show create table diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `body` text, + `body` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `body_index` (`body`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='engine "innodb"' diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/variable_match_escalation_threshold_global.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/variable_match_escalation_threshold_global.result index d66c0c025e5..c988a101095 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/variable_match_escalation_threshold_global.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/variable_match_escalation_threshold_global.result @@ -9,8 +9,8 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `tags` text, + `title` text DEFAULT NULL, + `tags` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `tags_index` (`tags`) COMMENT 'parser "TokenDelimit"' ) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='ENGINE "InnoDB"' diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/variable_match_escalation_threshold_session.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/variable_match_escalation_threshold_session.result index 3d94ebc93ad..bedfb372e93 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/variable_match_escalation_threshold_session.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/variable_match_escalation_threshold_session.result @@ -9,8 +9,8 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `tags` text, + `title` text DEFAULT NULL, + `tags` text DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `tags_index` (`tags`) COMMENT 'parser "TokenDelimit"' ) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='ENGINE "InnoDB"' diff --git a/storage/mroonga/vendor/groonga/examples/dictionary/html/js/jquery-1.7.2.js b/storage/mroonga/vendor/groonga/examples/dictionary/html/js/jquery-1.7.2.js index 3774ff98613..75ce2617772 100644 --- a/storage/mroonga/vendor/groonga/examples/dictionary/html/js/jquery-1.7.2.js +++ b/storage/mroonga/vendor/groonga/examples/dictionary/html/js/jquery-1.7.2.js @@ -8249,7 +8249,7 @@ if ( jQuery.support.ajax ) { xml; // Firefox throws exceptions when accessing properties - // of an xhr when a network error occured + // of an xhr when a network error occurred // http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE) try { diff --git a/storage/mroonga/vendor/groonga/examples/dictionary/html/js/jquery-ui-1.8.18.custom.js b/storage/mroonga/vendor/groonga/examples/dictionary/html/js/jquery-ui-1.8.18.custom.js index d4444b2bd11..a212450c20a 100644 --- a/storage/mroonga/vendor/groonga/examples/dictionary/html/js/jquery-ui-1.8.18.custom.js +++ b/storage/mroonga/vendor/groonga/examples/dictionary/html/js/jquery-ui-1.8.18.custom.js @@ -743,7 +743,7 @@ $.widget("ui.mouse", { return this.mouseDelayMet; }, - // These are placeholder methods, to be overriden by extending plugin + // These are placeholder methods, to be overridden by extending plugin _mouseStart: function(event) {}, _mouseDrag: function(event) {}, _mouseStop: function(event) {}, diff --git a/storage/mroonga/vendor/groonga/lib/com.c b/storage/mroonga/vendor/groonga/lib/com.c index a16a446022c..5455d1f8e09 100644 --- a/storage/mroonga/vendor/groonga/lib/com.c +++ b/storage/mroonga/vendor/groonga/lib/com.c @@ -738,7 +738,7 @@ grn_com_send(grn_ctx *ctx, grn_com *cs, msg.msg_namelen = 0; msg.msg_iov = msg_iov; msg.msg_iovlen = 2; - msg_iov[0].iov_base = header; + msg_iov[0].iov_base = (char*) header; msg_iov[0].iov_len = sizeof(grn_com_header); msg_iov[1].iov_base = (char *)body; msg_iov[1].iov_len = size; diff --git a/storage/mroonga/vendor/groonga/lib/ctx.c b/storage/mroonga/vendor/groonga/lib/ctx.c index 92caba561eb..c4a485527c1 100644 --- a/storage/mroonga/vendor/groonga/lib/ctx.c +++ b/storage/mroonga/vendor/groonga/lib/ctx.c @@ -51,7 +51,8 @@ #define GRN_CTX_INITIALIZER(enc) \ { GRN_SUCCESS, 0, enc, 0, GRN_LOG_NOTICE,\ - GRN_CTX_FIN, 0, 0, 0, 0, {0}, NULL, NULL, NULL, NULL, NULL } + GRN_CTX_FIN, 0, 0, 0, 0, {0}, NULL, NULL, NULL, NULL, NULL, \ + {NULL, NULL,NULL, NULL,NULL, NULL,NULL, NULL,NULL, NULL,NULL, NULL,NULL, NULL,NULL, NULL}, ""} #define GRN_CTX_CLOSED(ctx) ((ctx)->stat == GRN_CTX_FIN) diff --git a/storage/mroonga/vendor/groonga/lib/db.c b/storage/mroonga/vendor/groonga/lib/db.c index e213812d926..05e4d73e5ed 100644 --- a/storage/mroonga/vendor/groonga/lib/db.c +++ b/storage/mroonga/vendor/groonga/lib/db.c @@ -4137,7 +4137,7 @@ grn_column_create(grn_ctx *ctx, grn_obj *table, { grn_db *s; uint32_t value_size; - grn_obj *db, *res = NULL; + grn_obj *db= NULL, *res = NULL; grn_id id = GRN_ID_NIL; grn_id range = GRN_ID_NIL; grn_id domain = GRN_ID_NIL; diff --git a/storage/mroonga/vendor/groonga/lib/ii.c b/storage/mroonga/vendor/groonga/lib/ii.c index 388e0566756..df6e4ba3a34 100644 --- a/storage/mroonga/vendor/groonga/lib/ii.c +++ b/storage/mroonga/vendor/groonga/lib/ii.c @@ -385,7 +385,7 @@ chunk_free(grn_ctx *ctx, grn_ii *ii, uint32_t offset, uint32_t dummy, uint32_t s } */ grn_io_win iw, iw_; - grn_ii_ginfo *ginfo; + grn_ii_ginfo *ginfo= 0; uint32_t seg, m, *gseg; seg = offset >> GRN_II_N_CHUNK_VARIATION; if (size > S_CHUNK) { diff --git a/storage/myisam/NEWS b/storage/myisam/NEWS index bb1f141610b..a564110bffb 100644 --- a/storage/myisam/NEWS +++ b/storage/myisam/NEWS @@ -62,5 +62,5 @@ New features compared to NISAM: Interface changes compared to NISAM: - mi_create() - - keyinfo->seg must be allocated explicitely. + - keyinfo->seg must be allocated explicitly. - One must put number of key segments in keyinfo diff --git a/storage/myisam/ft_boolean_search.c b/storage/myisam/ft_boolean_search.c index 3b403a41c4c..4480a67ebd7 100644 --- a/storage/myisam/ft_boolean_search.c +++ b/storage/myisam/ft_boolean_search.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -197,7 +197,8 @@ static int ftb_query_add_word(MYSQL_FTPARSER_PARAM *param, ftbw= (FTB_WORD *)alloc_root(&ftb_param->ftb->mem_root, sizeof(FTB_WORD) + (info->trunc ? HA_MAX_KEY_BUFF : - word_len * ftb_param->ftb->charset->mbmaxlen + + (word_len + 1) * + ftb_param->ftb->charset->mbmaxlen + HA_FT_WLEN + ftb_param->ftb->info->s->rec_reflength)); ftbw->len= word_len + 1; diff --git a/storage/myisam/ft_update.c b/storage/myisam/ft_update.c index 10a36650b0a..8f437476121 100644 --- a/storage/myisam/ft_update.c +++ b/storage/myisam/ft_update.c @@ -83,7 +83,7 @@ uint _mi_ft_segiterator(register FT_SEG_ITERATOR *ftsi) if (ftsi->seg->flag & HA_BLOB_PART) { ftsi->len=_mi_calc_blob_length(ftsi->seg->bit_start,ftsi->pos); - memcpy(&ftsi->pos, ftsi->pos+ftsi->seg->bit_start, sizeof(char*)); + memcpy((char**) &ftsi->pos, ftsi->pos+ftsi->seg->bit_start, sizeof(char*)); DBUG_RETURN(1); } ftsi->len=ftsi->seg->length; diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc index 812166ce1cc..9df1ec832a8 100644 --- a/storage/myisam/ha_myisam.cc +++ b/storage/myisam/ha_myisam.cc @@ -758,7 +758,8 @@ int ha_myisam::open(const char *name, int mode, uint test_if_locked) /* Set external_ref, mainly for temporary tables */ file->external_ref= (void*) table; // For mi_killed() - if (!table->s->tmp_table) /* No need to perform a check for tmp table */ + /* No need to perform a check for tmp table or if it's already checked */ + if (!table->s->tmp_table && file->s->reopen == 1) { if ((my_errno= table2myisam(table, &keyinfo, &recinfo, &recs))) { diff --git a/storage/myisam/mi_extra.c b/storage/myisam/mi_extra.c index a47c1987e38..3d6049c0172 100644 --- a/storage/myisam/mi_extra.c +++ b/storage/myisam/mi_extra.c @@ -264,6 +264,7 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg) _mi_mark_file_changed(info); /* Fall trough */ case HA_EXTRA_PREPARE_FOR_RENAME: + DBUG_ASSERT(!share->temporary); mysql_mutex_lock(&THR_LOCK_myisam); share->last_version= 0L; /* Impossible version */ mysql_mutex_lock(&share->intern_lock); diff --git a/storage/myisam/mi_unique.c b/storage/myisam/mi_unique.c index 5192d404939..dae453beaec 100644 --- a/storage/myisam/mi_unique.c +++ b/storage/myisam/mi_unique.c @@ -112,7 +112,7 @@ ha_checksum mi_unique_hash(MI_UNIQUEDEF *def, const uchar *record) else if (keyseg->flag & HA_BLOB_PART) { uint tmp_length=_mi_calc_blob_length(keyseg->bit_start,pos); - memcpy(&pos, pos+keyseg->bit_start, sizeof(char*)); + memcpy((char**) &pos, pos+keyseg->bit_start, sizeof(char*)); if (!length || length > tmp_length) length=tmp_length; /* The whole blob */ } @@ -207,8 +207,8 @@ int mi_unique_comp(MI_UNIQUEDEF *def, const uchar *a, const uchar *b, set_if_smaller(a_length, keyseg->length); set_if_smaller(b_length, keyseg->length); } - memcpy(&pos_a, pos_a+keyseg->bit_start, sizeof(char*)); - memcpy(&pos_b, pos_b+keyseg->bit_start, sizeof(char*)); + memcpy((char**) &pos_a, pos_a+keyseg->bit_start, sizeof(char*)); + memcpy((char**) &pos_b, pos_b+keyseg->bit_start, sizeof(char*)); } if (type == HA_KEYTYPE_TEXT || type == HA_KEYTYPE_VARTEXT1 || type == HA_KEYTYPE_VARTEXT2) diff --git a/storage/myisam/mysql-test/storage_engine/alter_table_online.rdiff b/storage/myisam/mysql-test/storage_engine/alter_table_online.rdiff index 3a7fef61d3b..5ae99e2035c 100644 --- a/storage/myisam/mysql-test/storage_engine/alter_table_online.rdiff +++ b/storage/myisam/mysql-test/storage_engine/alter_table_online.rdiff @@ -1,41 +1,5 @@ --- suite/storage_engine/alter_table_online.result 2013-11-08 20:01:16.000000000 +0400 +++ suite/storage_engine/alter_table_online.reject 2013-11-08 20:02:03.000000000 +0400 -@@ -2,8 +2,35 @@ - CREATE TABLE t1 (a , b , c ) ENGINE= ; - INSERT INTO t1 (a,b,c) VALUES (1,100,'a'),(2,200,'b'),(3,300,'c'); - ALTER ONLINE TABLE t1 MODIFY b DEFAULT 5; -+ERROR 0A000: LOCK=NONE/SHARED is not supported for this operation. Try LOCK=EXCLUSIVE. -+# ERROR: Statement ended with errno 1845, errname ER_ALTER_OPERATION_NOT_SUPPORTED (expected to succeed) -+# ------------ UNEXPECTED RESULT ------------ -+# The statement|command finished with ER_ALTER_OPERATION_NOT_SUPPORTED. -+# Functionality or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors. -+# You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. -+# Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. -+# Also, this problem may cause a chain effect (more errors of different kinds in the test). -+# ------------------------------------------- - ALTER ONLINE TABLE t1 CHANGE b new_name ; -+ERROR 0A000: LOCK=NONE/SHARED is not supported for this operation. Try LOCK=EXCLUSIVE. -+# ERROR: Statement ended with errno 1845, errname ER_ALTER_OPERATION_NOT_SUPPORTED (expected to succeed) -+# ------------ UNEXPECTED RESULT ------------ -+# The statement|command finished with ER_ALTER_OPERATION_NOT_SUPPORTED. -+# Functionality or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors. -+# You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. -+# Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. -+# Also, this problem may cause a chain effect (more errors of different kinds in the test). -+# ------------------------------------------- - ALTER ONLINE TABLE t1 COMMENT 'new comment'; -+ERROR 0A000: LOCK=NONE/SHARED is not supported for this operation. Try LOCK=EXCLUSIVE. -+# ERROR: Statement ended with errno 1845, errname ER_ALTER_OPERATION_NOT_SUPPORTED (expected to succeed) -+# ------------ UNEXPECTED RESULT ------------ -+# The statement|command finished with ER_ALTER_OPERATION_NOT_SUPPORTED. -+# Functionality or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors. -+# You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. -+# Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. -+# Also, this problem may cause a chain effect (more errors of different kinds in the test). -+# ------------------------------------------- - ALTER ONLINE TABLE t1 RENAME TO t2; - ERROR 0A000: LOCK=NONE/SHARED is not supported for this operation. Try LOCK=EXCLUSIVE. - DROP TABLE IF EXISTS t2; @@ -23,12 +50,30 @@ CREATE TABLE t1 (a , b , c ) ENGINE= ; INSERT INTO t1 (a,b,c) VALUES (1,100,'a'),(2,200,'b'),(3,300,'c'); diff --git a/storage/myisam/sort.c b/storage/myisam/sort.c index f490e5f0b44..d411272c273 100644 --- a/storage/myisam/sort.c +++ b/storage/myisam/sort.c @@ -191,8 +191,9 @@ int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages, while ((maxbuffer= (uint) (records/(keys-1)+1)) != maxbuffer_org); } - if ((sort_keys=(uchar **)my_malloc(keys*(sort_length+sizeof(char*))+ - HA_FT_MAXBYTELEN, MYF(0)))) + if ((sort_keys= ((uchar **) + my_malloc((size_t) (keys*(sort_length+sizeof(char*))+ + HA_FT_MAXBYTELEN), MYF(0))))) { if (my_init_dynamic_array(&buffpek, sizeof(BUFFPEK), maxbuffer, MY_MIN(maxbuffer/2, 1000), MYF(0))) @@ -344,192 +345,197 @@ static ha_rows find_all_keys(MI_SORT_PARAM *info, ha_rows keys, DBUG_RETURN((*maxbuffer)*(keys-1)+idx); } /* find_all_keys */ +static my_bool thr_find_all_keys_exec(MI_SORT_PARAM *sort_param) +{ + ulonglong memavl, old_memavl, sortbuff_size; + ha_keys UNINIT_VAR(keys), idx; + uint sort_length; + uint maxbuffer; + uchar **sort_keys= NULL; + int error= 0; + DBUG_ENTER("thr_find_all_keys"); + DBUG_PRINT("enter", ("master: %d", sort_param->master)); + + if (sort_param->sort_info->got_error) + DBUG_RETURN(TRUE); + + set_sort_param_read_write(sort_param); + + my_b_clear(&sort_param->tempfile); + my_b_clear(&sort_param->tempfile_for_exceptions); + bzero((char*) &sort_param->buffpek, sizeof(sort_param->buffpek)); + bzero((char*) &sort_param->unique, sizeof(sort_param->unique)); + + sortbuff_size= sort_param->sortbuff_size; + memavl= MY_MAX(sortbuff_size, MIN_SORT_BUFFER); + idx= (ha_keys) sort_param->sort_info->max_records; + sort_length= sort_param->key_length; + maxbuffer= 1; + + while (memavl >= MIN_SORT_BUFFER) + { + if ((my_off_t) (idx+1)*(sort_length+sizeof(char*)) <= + (my_off_t) memavl) + keys= idx+1; + else if ((sort_param->sort_info->param->testflag & + (T_FORCE_SORT_MEMORY | T_CREATE_MISSING_KEYS)) == + T_FORCE_SORT_MEMORY) + { + /* + Use all of the given sort buffer for key data. + Allocate 1000 buffers at a start for new data. More buffers + will be allocated when needed. + */ + keys= memavl / (sort_length+sizeof(char*)); + maxbuffer= (uint) MY_MIN((ulonglong) 1000, (idx / keys)+1); + } + else + { + uint maxbuffer_org; + do + { + maxbuffer_org= maxbuffer; + if (memavl < sizeof(BUFFPEK)*maxbuffer || + (keys=(memavl-sizeof(BUFFPEK)*maxbuffer)/ + (sort_length+sizeof(char*))) <= 1 || + keys < (uint) maxbuffer) + { + mi_check_print_error(sort_param->sort_info->param, + "myisam_sort_buffer_size is too small. Current myisam_sort_buffer_size: %llu rows: %llu sort_length: %u", + sortbuff_size, (ulonglong) idx, sort_length); + DBUG_RETURN(TRUE); + } + } + while ((maxbuffer= (uint) (idx/(keys-1)+1)) != maxbuffer_org); + } + if ((sort_keys= (uchar**) my_malloc((size_t)(keys * (sort_length + sizeof(char*)) + + ((sort_param->keyinfo->flag & HA_FULLTEXT) ? + HA_FT_MAXBYTELEN : 0)), MYF(0)))) + { + if (my_init_dynamic_array(&sort_param->buffpek, sizeof(BUFFPEK), + maxbuffer, MY_MIN(maxbuffer / 2, 1000), MYF(0))) + { + my_free(sort_keys); + sort_keys= NULL; /* Safety against double free on error. */ + } + else + break; + } + old_memavl= memavl; + if ((memavl= memavl / 4 * 3) < MIN_SORT_BUFFER && + old_memavl > MIN_SORT_BUFFER) + memavl= MIN_SORT_BUFFER; + } + if (memavl < MIN_SORT_BUFFER) + { + /* purecov: begin inspected */ + mi_check_print_error(sort_param->sort_info->param, + "myisam_sort_buffer_size is too small. Current myisam_sort_buffer_size: %llu rows: %llu sort_length: %u", + sortbuff_size, (ulonglong) idx, sort_length); + my_errno= ENOMEM; + goto err; + /* purecov: end inspected */ + } + + if (sort_param->sort_info->param->testflag & T_VERBOSE) + my_fprintf(stdout, + "Key %d - Allocating buffer for %llu keys\n", + sort_param->key + 1, (ulonglong) keys); + sort_param->sort_keys= sort_keys; + + idx= error= 0; + sort_keys[0]= (uchar*) (sort_keys+keys); + + DBUG_PRINT("info", ("reading keys")); + while (!(error= sort_param->sort_info->got_error) && + !(error= (*sort_param->key_read)(sort_param, sort_keys[idx]))) + { + if (sort_param->real_key_length > sort_param->key_length) + { + if (write_key(sort_param, sort_keys[idx], + &sort_param->tempfile_for_exceptions)) + goto err; + continue; + } + + if (++idx == keys) + { + if (sort_param->write_keys(sort_param, sort_keys, idx - 1, + (BUFFPEK*) alloc_dynamic(&sort_param->buffpek), + &sort_param->tempfile)) + goto err; + sort_keys[0]= (uchar*) (sort_keys+keys); + memcpy(sort_keys[0], sort_keys[idx - 1], (size_t) sort_param->key_length); + idx= 1; + } + sort_keys[idx]= sort_keys[idx - 1] + sort_param->key_length; + } + + if (error > 0) + goto err; + + if (sort_param->buffpek.elements) + { + if (sort_param->write_keys(sort_param, sort_keys, idx, + (BUFFPEK*) alloc_dynamic(&sort_param->buffpek), + &sort_param->tempfile)) + goto err; + sort_param->keys= (sort_param->buffpek.elements - 1) * (keys - 1) + idx; + } + else + sort_param->keys= idx; + + DBUG_RETURN(FALSE); + +err: + DBUG_PRINT("error", ("got some error")); + sort_param->sort_info->got_error= 1; /* no need to protect with a mutex */ + my_free(sort_keys); + sort_param->sort_keys= 0; + delete_dynamic(& sort_param->buffpek); + close_cached_file(&sort_param->tempfile); + close_cached_file(&sort_param->tempfile_for_exceptions); + + DBUG_RETURN(TRUE); +} + /* Search after all keys and place them in a temp. file */ pthread_handler_t thr_find_all_keys(void *arg) { MI_SORT_PARAM *sort_param= (MI_SORT_PARAM*) arg; - int error; - ulonglong memavl, old_memavl, sortbuff_size; - ha_keys UNINIT_VAR(keys), idx; - uint sort_length; - uint maxbuffer; - uchar **sort_keys=0; + my_bool error= FALSE; + /* If my_thread_init fails */ + if (my_thread_init() || thr_find_all_keys_exec(sort_param)) + error= TRUE; - error=1; + /* + Thread must clean up after itself. + */ + free_root(&sort_param->wordroot, MYF(0)); + /* + Detach from the share if the writer is involved. Avoid others to + be blocked. This includes a flush of the write buffer. This will + also indicate EOF to the readers. + That means that a writer always gets here first and readers - + only when they see EOF. But if a reader finishes prematurely + because of an error it may reach this earlier - don't allow it + to detach the writer thread. + */ + if (sort_param->master && sort_param->sort_info->info->rec_cache.share) + remove_io_thread(&sort_param->sort_info->info->rec_cache); - if (my_thread_init()) - goto err; + /* Readers detach from the share if any. Avoid others to be blocked. */ + if (sort_param->read_cache.share) + remove_io_thread(&sort_param->read_cache); - { /* Add extra block since DBUG_ENTER declare variables */ - DBUG_ENTER("thr_find_all_keys"); - DBUG_PRINT("enter", ("master: %d", sort_param->master)); - if (sort_param->sort_info->got_error) - goto err; + mysql_mutex_lock(&sort_param->sort_info->mutex); + if (error) + sort_param->sort_info->got_error= 1; - set_sort_param_read_write(sort_param); - - my_b_clear(&sort_param->tempfile); - my_b_clear(&sort_param->tempfile_for_exceptions); - bzero((char*) &sort_param->buffpek, sizeof(sort_param->buffpek)); - bzero((char*) &sort_param->unique, sizeof(sort_param->unique)); - sort_keys= (uchar **) NULL; - - sortbuff_size= sort_param->sortbuff_size; - memavl= MY_MAX(sortbuff_size, MIN_SORT_BUFFER); - idx= (ha_keys) sort_param->sort_info->max_records; - sort_length= sort_param->key_length; - maxbuffer= 1; - - while (memavl >= MIN_SORT_BUFFER) - { - if ((my_off_t) (idx+1)*(sort_length+sizeof(char*)) <= - (my_off_t) memavl) - keys= idx+1; - else if ((sort_param->sort_info->param->testflag & - (T_FORCE_SORT_MEMORY | T_CREATE_MISSING_KEYS)) == - T_FORCE_SORT_MEMORY) - { - /* - Use all of the given sort buffer for key data. - Allocate 1000 buffers at a start for new data. More buffers - will be allocated when needed. - */ - keys= memavl / (sort_length+sizeof(char*)); - maxbuffer= (uint) MY_MIN((ulonglong) 1000, (idx / keys)+1); - } - else - { - uint maxbuffer_org; - do - { - maxbuffer_org= maxbuffer; - if (memavl < sizeof(BUFFPEK)*maxbuffer || - (keys=(memavl-sizeof(BUFFPEK)*maxbuffer)/ - (sort_length+sizeof(char*))) <= 1 || - keys < (uint) maxbuffer) - { - mi_check_print_error(sort_param->sort_info->param, - "myisam_sort_buffer_size is too small. Current myisam_sort_buffer_size: %llu rows: %llu sort_length: %u", - sortbuff_size, (ulonglong) idx, sort_length); - goto err; - } - } - while ((maxbuffer= (uint) (idx/(keys-1)+1)) != maxbuffer_org); - } - if ((sort_keys= (uchar**) - my_malloc(keys*(sort_length+sizeof(char*))+ - ((sort_param->keyinfo->flag & HA_FULLTEXT) ? - HA_FT_MAXBYTELEN : 0), MYF(0)))) - { - if (my_init_dynamic_array(&sort_param->buffpek, sizeof(BUFFPEK), - maxbuffer, MY_MIN(maxbuffer/2, 1000), MYF(0))) - { - my_free(sort_keys); - sort_keys= (uchar **) NULL; /* for err: label */ - } - else - break; - } - old_memavl= memavl; - if ((memavl= memavl / 4 * 3) < MIN_SORT_BUFFER && - old_memavl > MIN_SORT_BUFFER) - memavl= MIN_SORT_BUFFER; - } - if (memavl < MIN_SORT_BUFFER) - { - /* purecov: begin inspected */ - mi_check_print_error(sort_param->sort_info->param, - "myisam_sort_buffer_size is too small. Current myisam_sort_buffer_size: %llu rows: %llu sort_length: %u", - sortbuff_size, (ulonglong) idx, sort_length); - my_errno= ENOMEM; - goto err; - /* purecov: end inspected */ - } - - if (sort_param->sort_info->param->testflag & T_VERBOSE) - my_fprintf(stdout, - "Key %d - Allocating buffer for %llu keys\n", - sort_param->key + 1, (ulonglong) keys); - sort_param->sort_keys= sort_keys; - - idx= error= 0; - sort_keys[0]= (uchar*) (sort_keys+keys); - - DBUG_PRINT("info", ("reading keys")); - while (!(error= sort_param->sort_info->got_error) && - !(error= (*sort_param->key_read)(sort_param, sort_keys[idx]))) - { - if (sort_param->real_key_length > sort_param->key_length) - { - if (write_key(sort_param, sort_keys[idx], - &sort_param->tempfile_for_exceptions)) - goto err; - continue; - } - - if (++idx == keys) - { - if (sort_param->write_keys(sort_param, sort_keys, idx - 1, - (BUFFPEK*) alloc_dynamic(&sort_param->buffpek), - &sort_param->tempfile)) - goto err; - sort_keys[0]= (uchar*) (sort_keys+keys); - memcpy(sort_keys[0], sort_keys[idx - 1], - (size_t) sort_param->key_length); - idx= 1; - } - sort_keys[idx]= sort_keys[idx - 1] + sort_param->key_length; - } - if (error > 0) - goto err; - if (sort_param->buffpek.elements) - { - if (sort_param->write_keys(sort_param, sort_keys, idx, - (BUFFPEK*) alloc_dynamic(&sort_param->buffpek), - &sort_param->tempfile)) - goto err; - sort_param->keys= (sort_param->buffpek.elements - 1) * (keys - 1) + idx; - } - else - sort_param->keys= idx; - - goto ok; - -err: - DBUG_PRINT("error", ("got some error")); - sort_param->sort_info->got_error= 1; /* no need to protect with a mutex */ - my_free(sort_keys); - sort_param->sort_keys= 0; - delete_dynamic(& sort_param->buffpek); - close_cached_file(&sort_param->tempfile); - close_cached_file(&sort_param->tempfile_for_exceptions); - -ok: - free_root(&sort_param->wordroot, MYF(0)); - /* - Detach from the share if the writer is involved. Avoid others to - be blocked. This includes a flush of the write buffer. This will - also indicate EOF to the readers. - That means that a writer always gets here first and readers - - only when they see EOF. But if a reader finishes prematurely - because of an error it may reach this earlier - don't allow it - to detach the writer thread. - */ - if (sort_param->master && sort_param->sort_info->info->rec_cache.share) - remove_io_thread(&sort_param->sort_info->info->rec_cache); - - /* Readers detach from the share if any. Avoid others to be blocked. */ - if (sort_param->read_cache.share) - remove_io_thread(&sort_param->read_cache); - - mysql_mutex_lock(&sort_param->sort_info->mutex); - if (!--sort_param->sort_info->threads_running) - mysql_cond_signal(&sort_param->sort_info->cond); - mysql_mutex_unlock(&sort_param->sort_info->mutex); - DBUG_PRINT("exit", ("======== ending thread ========")); - DBUG_LEAVE; - } + if (!--sort_param->sort_info->threads_running) + mysql_cond_signal(&sort_param->sort_info->cond); + mysql_mutex_unlock(&sort_param->sort_info->mutex); my_thread_end(); return NULL; } @@ -603,7 +609,7 @@ int thr_write_keys(MI_SORT_PARAM *sort_param) length=param->sort_buffer_length; while (length >= MIN_SORT_BUFFER) { - if ((mergebuf= my_malloc(length, MYF(0)))) + if ((mergebuf= my_malloc((size_t) length, MYF(0)))) break; length=length*3/4; } @@ -695,8 +701,8 @@ static int write_keys(MI_SORT_PARAM *info, register uchar **sort_keys, if (!buffpek) DBUG_RETURN(1); /* Out of memory */ - my_qsort2((uchar*) sort_keys,count,sizeof(uchar*),(qsort2_cmp) info->key_cmp, - info); + my_qsort2((uchar*) sort_keys,(size_t) count, sizeof(uchar*), + (qsort2_cmp) info->key_cmp, info); if (!my_b_inited(tempfile) && open_cached_file(tempfile, my_tmpdir(info->tmpdir), "ST", DISK_BUFFER_SIZE, info->sort_info->param->myf_rw)) @@ -741,8 +747,8 @@ static int write_keys_varlen(MI_SORT_PARAM *info, if (!buffpek) DBUG_RETURN(1); /* Out of memory */ - my_qsort2((uchar*) sort_keys,count,sizeof(uchar*),(qsort2_cmp) info->key_cmp, - info); + my_qsort2((uchar*) sort_keys, (size_t) count, sizeof(uchar*), + (qsort2_cmp) info->key_cmp, info); if (!my_b_inited(tempfile) && open_cached_file(tempfile, my_tmpdir(info->tmpdir), "ST", DISK_BUFFER_SIZE, info->sort_info->param->myf_rw)) @@ -865,10 +871,12 @@ static my_off_t read_to_buffer(IO_CACHE *fromfile, BUFFPEK *buffpek, register ha_keys count; my_off_t length; - if ((count= (ha_keys) MY_MIN((ha_rows) buffpek->max_keys,buffpek->count))) + if ((count= (ha_keys) MY_MIN((ha_rows) buffpek->max_keys, + (ha_rows) buffpek->count))) { if (my_b_pread(fromfile, (uchar*) buffpek->base, - (length= sort_length * count), buffpek->file_pos)) + (length= (my_off_t) (sort_length * count)), + buffpek->file_pos)) return(HA_OFFSET_ERROR); buffpek->key=buffpek->base; buffpek->file_pos+= length; /* New filepos */ @@ -933,7 +941,7 @@ static int write_merge_key(MI_SORT_PARAM *info __attribute__((unused)), IO_CACHE *to_file, uchar *key, uint sort_length, ha_keys count) { - return my_b_write(to_file, key, ((size_t) sort_length) * count); + return my_b_write(to_file, key, (size_t) (sort_length * count)); } /* @@ -993,7 +1001,7 @@ merge_buffers(MI_SORT_PARAM *info, ha_keys keys, IO_CACHE *from_file, if (to_file) { if (info->write_key(info,to_file,(uchar*) buffpek->key, - (uint) sort_length,1)) + sort_length, 1)) { error=1; goto err; /* purecov: inspected */ } @@ -1016,7 +1024,7 @@ merge_buffers(MI_SORT_PARAM *info, ha_keys keys, IO_CACHE *from_file, if (!(read_length= info->read_to_buffer(from_file,buffpek,sort_length))) { uchar *base= buffpek->base; - uint max_keys=buffpek->max_keys; + ha_keys max_keys=buffpek->max_keys; queue_remove_top(&queue); diff --git a/storage/myisammrg/ha_myisammrg.cc b/storage/myisammrg/ha_myisammrg.cc index 418e09547da..3d91aa67793 100644 --- a/storage/myisammrg/ha_myisammrg.cc +++ b/storage/myisammrg/ha_myisammrg.cc @@ -1,4 +1,5 @@ /* Copyright (c) 2000, 2011, Oracle and/or its affiliates + Copyright (c) 2009, 2016, MariaDB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/storage/oqgraph/CMakeLists.txt b/storage/oqgraph/CMakeLists.txt index 772a8f61bd5..613a44807c7 100644 --- a/storage/oqgraph/CMakeLists.txt +++ b/storage/oqgraph/CMakeLists.txt @@ -37,33 +37,36 @@ CHECK_CXX_SOURCE_COMPILES( int main() { return 0; } " OQGRAPH_OK) ENDIF() - -IF(OQGRAPH_OK) - ADD_DEFINITIONS(-DHAVE_OQGRAPH) - IF(MSVC) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc" PARENT_SCOPE) - # Fix problem with judy not finding inttypes.h on Windows: - ADD_DEFINITIONS(-DJU_WIN) - ELSE(MSVC) - # Fix lp bug 1221555 with -fpermissive, so that errors in gcc 4.7 become warnings for the time being - STRING(REPLACE "-fno-exceptions" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) - STRING(REPLACE "-fno-implicit-templates" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated -fno-strict-aliasing -fpermissive" PARENT_SCOPE) - ENDIF(MSVC) - - ADD_DEFINITIONS(-DBOOST_NO_RTTI=1 -DBOOST_NO_TYPEID=1 -DBOOST_DISABLE_ASSERTS=1) - MYSQL_ADD_PLUGIN(oqgraph ha_oqgraph.cc graphcore.cc graphcore-graph.cc - oqgraph_shim.cc oqgraph_thunk.cc oqgraph_judy.cc - STORAGE_ENGINE - MODULE_ONLY - RECOMPILE_FOR_EMBEDDED - COMPONENT oqgraph-engine - LINK_LIBRARIES ${Judy_LIBRARIES}) -ELSE(OQGRAPH_OK) - MESSAGE(STATUS "Requisites for OQGraph not met. OQGraph will not be compiled") -ENDIF(OQGRAPH_OK) ENDFUNCTION() IF(NOT DEFINED OQGRAPH_OK) CHECK_OQGRAPH() + IF (NOT OQGRAPH_OK) + MESSAGE(STATUS "Requisites for OQGraph not met. OQGraph will not be compiled") + ENDIF() ENDIF() + +IF(NOT OQGRAPH_OK) + RETURN() +ENDIF() + +ADD_DEFINITIONS(-DHAVE_OQGRAPH) +IF(MSVC) + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc") + # Fix problem with judy not finding inttypes.h on Windows: + ADD_DEFINITIONS(-DJU_WIN) +ELSE(MSVC) + # Fix lp bug 1221555 with -fpermissive, so that errors in gcc 4.7 become warnings for the time being + STRING(REPLACE "-fno-exceptions" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) + STRING(REPLACE "-fno-implicit-templates" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated -fno-strict-aliasing -fpermissive") +ENDIF(MSVC) + +ADD_DEFINITIONS(-DBOOST_NO_RTTI=1 -DBOOST_NO_TYPEID=1 -DBOOST_DISABLE_ASSERTS=1) +MYSQL_ADD_PLUGIN(oqgraph ha_oqgraph.cc graphcore.cc graphcore-graph.cc + oqgraph_shim.cc oqgraph_thunk.cc oqgraph_judy.cc + STORAGE_ENGINE + MODULE_ONLY + RECOMPILE_FOR_EMBEDDED + COMPONENT oqgraph-engine + LINK_LIBRARIES ${Judy_LIBRARIES}) diff --git a/storage/oqgraph/ha_oqgraph.cc b/storage/oqgraph/ha_oqgraph.cc index 78a0079a5ab..6e6377b7068 100644 --- a/storage/oqgraph/ha_oqgraph.cc +++ b/storage/oqgraph/ha_oqgraph.cc @@ -63,7 +63,7 @@ #ifdef VERBOSE_DEBUG #else #undef DBUG_PRINT -#define DBUG_PRINT(x ...) +#define DBUG_PRINT(x,y) #endif #ifdef RETAIN_INT_LATCH_COMPATIBILITY @@ -663,7 +663,7 @@ int ha_oqgraph::open(const char *name, int mode, uint test_if_locked) { fprint_error("Column '%s.%s' (origid) is not a not-null integer type", options->table_name, options->origid); - closefrm(edges, 0); + closefrm(edges); free_table_share(share); DBUG_RETURN(-1); } @@ -673,7 +673,7 @@ int ha_oqgraph::open(const char *name, int mode, uint test_if_locked) if (!origid) { fprint_error("Invalid OQGRAPH backing store ('%s.origid' attribute not set to a valid column of '%s')", p+1, options->table_name); - closefrm(edges, 0); + closefrm(edges); free_table_share(share); DBUG_RETURN(-1); } @@ -688,7 +688,7 @@ int ha_oqgraph::open(const char *name, int mode, uint test_if_locked) { fprint_error("Column '%s.%s' (destid) is not a not-null integer type or is a different type to origid attribute.", options->table_name, options->destid); - closefrm(edges, 0); + closefrm(edges); free_table_share(share); DBUG_RETURN(-1); } @@ -698,7 +698,7 @@ int ha_oqgraph::open(const char *name, int mode, uint test_if_locked) if (!destid) { fprint_error("Invalid OQGRAPH backing store ('%s.destid' attribute not set to a valid column of '%s')", p+1, options->table_name); - closefrm(edges, 0); + closefrm(edges); free_table_share(share); DBUG_RETURN(-1); } @@ -706,7 +706,7 @@ int ha_oqgraph::open(const char *name, int mode, uint test_if_locked) // Make sure origid column != destid column if (strcmp( origid->field_name, destid->field_name)==0) { fprint_error("Invalid OQGRAPH backing store ('%s.destid' attribute set to same column as origid attribute)", p+1, options->table_name); - closefrm(edges, 0); + closefrm(edges); free_table_share(share); DBUG_RETURN(-1); } @@ -720,7 +720,7 @@ int ha_oqgraph::open(const char *name, int mode, uint test_if_locked) { fprint_error("Column '%s.%s' (weight) is not a not-null real type", options->table_name, options->weight); - closefrm(edges, 0); + closefrm(edges); free_table_share(share); DBUG_RETURN(-1); } @@ -730,7 +730,7 @@ int ha_oqgraph::open(const char *name, int mode, uint test_if_locked) if (!weight && options->weight) { fprint_error("Invalid OQGRAPH backing store ('%s.weight' attribute not set to a valid column of '%s')", p+1, options->table_name); - closefrm(edges, 0); + closefrm(edges); free_table_share(share); DBUG_RETURN(-1); } @@ -738,7 +738,7 @@ int ha_oqgraph::open(const char *name, int mode, uint test_if_locked) if (!(graph_share = oqgraph::create(edges, origid, destid, weight))) { fprint_error("Unable to create graph instance."); - closefrm(edges, 0); + closefrm(edges); free_table_share(share); DBUG_RETURN(-1); } @@ -763,7 +763,7 @@ int ha_oqgraph::close(void) if (have_table_share) { if (edges->file) - closefrm(edges, 0); + closefrm(edges); free_table_share(share); have_table_share = false; } @@ -1136,6 +1136,10 @@ int ha_oqgraph::info(uint flag) int ha_oqgraph::extra(enum ha_extra_function operation) { + if (graph->get_thd() != ha_thd()) { + DBUG_PRINT( "oq-debug", ("rnd_pos g->table->in_use: 0x%lx <-- current_thd 0x%lx", (long) graph->get_thd(), (long) current_thd)); + graph->set_thd(current_thd); + } return edges->file->extra(operation); } diff --git a/storage/oqgraph/oqgraph_judy.cc b/storage/oqgraph/oqgraph_judy.cc index 020cab57ed2..44c7e28e268 100644 --- a/storage/oqgraph/oqgraph_judy.cc +++ b/storage/oqgraph/oqgraph_judy.cc @@ -23,6 +23,28 @@ */ #include "oqgraph_judy.h" + +/* + Currently the only active code that can return error is: + judy_bitset::reset()/J1U() + judy_bitset::setbit()/J1S() + + In most cases errors are either about wrong parameters passed to Judy + functions or internal structures corruption. These definitely deserve + abnormal process termination instead of exit() as it is done by original + JUDYERROR. + + TODO: there's one exception that should be handled properly though: OOM. +*/ +#include +#define JUDYERROR(CallerFile, CallerLine, JudyFunc, JudyErrno, JudyErrID) \ + { \ + (void) fprintf(stderr, "File '%s', line %d: %s(), " \ + "JU_ERRNO_* == %d, ID == %d\n", \ + CallerFile, CallerLine, \ + JudyFunc, JudyErrno, JudyErrID); \ + abort(); \ + } #include void open_query::judy_bitset::clear() diff --git a/storage/oqgraph/oqgraph_shim.h b/storage/oqgraph/oqgraph_shim.h index 6ea9d10631f..af240b88ebd 100644 --- a/storage/oqgraph/oqgraph_shim.h +++ b/storage/oqgraph/oqgraph_shim.h @@ -254,7 +254,7 @@ namespace boost typedef no_property type; }; -#if BOOST_VERSION >= 104601 +#if BOOST_VERSION < 106000 && BOOST_VERSION >= 104601 template <> struct graph_bundle_type { diff --git a/storage/perfschema/pfs_global.h b/storage/perfschema/pfs_global.h index f3326c5589f..7373f459599 100644 --- a/storage/perfschema/pfs_global.h +++ b/storage/perfschema/pfs_global.h @@ -31,7 +31,7 @@ extern bool pfs_initialized; extern size_t pfs_allocated_memory; #if defined(HAVE_POSIX_MEMALIGN) || defined(HAVE_MEMALIGN) || defined(HAVE_ALIGNED_MALLOC) -#define PFS_ALIGNEMENT 64 +#define PFS_ALIGNEMENT CPU_LEVEL1_DCACHE_LINESIZE #define PFS_ALIGNED MY_ALIGNED(PFS_ALIGNEMENT) #else /* diff --git a/storage/sequence/mysql-test/sequence/group_by.result b/storage/sequence/mysql-test/sequence/group_by.result index b3b56338aef..2941e85c1f4 100644 --- a/storage/sequence/mysql-test/sequence/group_by.result +++ b/storage/sequence/mysql-test/sequence/group_by.result @@ -66,6 +66,11 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY seq_1_to_15_step_2 index NULL PRIMARY 8 NULL # Using index 1 PRIMARY ALL NULL NULL NULL NULL # Using join buffer (flat, BNL join) 2 DERIVED NULL NULL NULL NULL NULL NULL # Storage engine handles GROUP BY +create view v1 as select count(*) from seq_1_to_15_step_2; +select * from v1; +count(*) +8 +drop view v1; # # The engine can't optimize the following queries # diff --git a/storage/sequence/mysql-test/sequence/group_by.test b/storage/sequence/mysql-test/sequence/group_by.test index b2e04037a8b..b3f4ab58771 100644 --- a/storage/sequence/mysql-test/sequence/group_by.test +++ b/storage/sequence/mysql-test/sequence/group_by.test @@ -30,6 +30,10 @@ select * from seq_1_to_15_step_2, (select count(*) from seq_1_to_15_step_2) as t --replace_column 9 # explain select * from seq_1_to_15_step_2, (select count(*) from seq_1_to_15_step_2) as t1; +create view v1 as select count(*) from seq_1_to_15_step_2; +select * from v1; +drop view v1; + --echo # --echo # The engine can't optimize the following queries --echo # diff --git a/storage/spider/hs_client/fatal.cpp b/storage/spider/hs_client/fatal.cpp index bec031153e4..260a2e75372 100644 --- a/storage/spider/hs_client/fatal.cpp +++ b/storage/spider/hs_client/fatal.cpp @@ -25,26 +25,6 @@ namespace dena { const int opt_syslog = LOG_ERR | LOG_PID | LOG_CONS; */ -void -fatal_exit(const String& message) -{ - fprintf(stderr, "FATAL_EXIT: %s\n", message.ptr()); -/* - syslog(opt_syslog, "FATAL_EXIT: %s", message.ptr()); -*/ - _exit(1); -} - -void -fatal_exit(const char *message) -{ - fprintf(stderr, "FATAL_EXIT: %s\n", message); -/* - syslog(opt_syslog, "FATAL_EXIT: %s", message); -*/ - _exit(1); -} - void fatal_abort(const String& message) { diff --git a/storage/spider/hs_client/fatal.hpp b/storage/spider/hs_client/fatal.hpp index a75c56bddad..e1190ae49c1 100644 --- a/storage/spider/hs_client/fatal.hpp +++ b/storage/spider/hs_client/fatal.hpp @@ -22,8 +22,6 @@ namespace dena { -void fatal_exit(const String& message); -void fatal_exit(const char *message); void fatal_abort(const String& message); void fatal_abort(const char *message); diff --git a/storage/spider/hs_client/socket.cpp b/storage/spider/hs_client/socket.cpp index 2082d1f024e..c61b39d140f 100644 --- a/storage/spider/hs_client/socket.cpp +++ b/storage/spider/hs_client/socket.cpp @@ -67,7 +67,7 @@ socket_args::set(const config& conf) message.append(node); message.q_append(":", sizeof(":") - 1); message.append(port); - fatal_exit(message); + fatal_abort(message); } } } diff --git a/storage/spider/spd_conn.cc b/storage/spider/spd_conn.cc index 681a3fb144c..5e00ae19ae8 100644 --- a/storage/spider/spd_conn.cc +++ b/storage/spider/spd_conn.cc @@ -2259,7 +2259,7 @@ void *spider_bg_conn_action( my_thread_init(); DBUG_ENTER("spider_bg_conn_action"); /* init start */ - if (!(thd = new THD())) + if (!(thd = new THD(next_thread_id()))) { pthread_mutex_lock(&conn->bg_conn_sync_mutex); pthread_cond_signal(&conn->bg_conn_sync_cond); @@ -2267,7 +2267,6 @@ void *spider_bg_conn_action( my_thread_end(); DBUG_RETURN(NULL); } - thd->thread_id = next_thread_id(); #ifdef HAVE_PSI_INTERFACE mysql_thread_set_psi_id(thd->thread_id); #endif @@ -2702,7 +2701,7 @@ void *spider_bg_sts_action( SPIDER_TRX *trx; int error_num = 0, roop_count; ha_spider spider; -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__SUNPRO_CC) int *need_mons; SPIDER_CONN **conns; uint *conn_link_idx; @@ -2729,7 +2728,7 @@ void *spider_bg_sts_action( my_thread_init(); DBUG_ENTER("spider_bg_sts_action"); /* init start */ -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__SUNPRO_CC) #if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET) if (!(need_mons = (int *) spider_bulk_malloc(spider_current_trx, 21, MYF(MY_WME), @@ -2766,19 +2765,18 @@ void *spider_bg_sts_action( } #endif pthread_mutex_lock(&share->sts_mutex); - if (!(thd = new THD())) + if (!(thd = new THD(next_thread_id()))) { share->bg_sts_thd_wait = FALSE; share->bg_sts_kill = FALSE; share->bg_sts_init = FALSE; pthread_mutex_unlock(&share->sts_mutex); my_thread_end(); -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__SUNPRO_CC) spider_free(NULL, need_mons, MYF(MY_WME)); #endif DBUG_RETURN(NULL); } - thd->thread_id = next_thread_id(); #ifdef HAVE_PSI_INTERFACE mysql_thread_set_psi_id(thd->thread_id); #endif @@ -2795,7 +2793,7 @@ void *spider_bg_sts_action( my_pthread_setspecific_ptr(THR_THD, NULL); #endif my_thread_end(); -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__SUNPRO_CC) spider_free(NULL, need_mons, MYF(MY_WME)); #endif DBUG_RETURN(NULL); @@ -2860,7 +2858,7 @@ void *spider_bg_sts_action( my_pthread_setspecific_ptr(THR_THD, NULL); #endif my_thread_end(); -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__SUNPRO_CC) spider_free(NULL, need_mons, MYF(MY_WME)); #endif DBUG_RETURN(NULL); @@ -2891,7 +2889,7 @@ void *spider_bg_sts_action( my_pthread_setspecific_ptr(THR_THD, NULL); #endif my_thread_end(); -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__SUNPRO_CC) spider_free(NULL, need_mons, MYF(MY_WME)); #endif DBUG_RETURN(NULL); @@ -3082,7 +3080,7 @@ void *spider_bg_crd_action( int error_num = 0, roop_count; ha_spider spider; TABLE table; -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__SUNPRO_CC) int *need_mons; SPIDER_CONN **conns; uint *conn_link_idx; @@ -3109,7 +3107,7 @@ void *spider_bg_crd_action( my_thread_init(); DBUG_ENTER("spider_bg_crd_action"); /* init start */ -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__SUNPRO_CC) #if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET) if (!(need_mons = (int *) spider_bulk_malloc(spider_current_trx, 22, MYF(MY_WME), @@ -3146,19 +3144,18 @@ void *spider_bg_crd_action( } #endif pthread_mutex_lock(&share->crd_mutex); - if (!(thd = new THD())) + if (!(thd = new THD(next_thread_id()))) { share->bg_crd_thd_wait = FALSE; share->bg_crd_kill = FALSE; share->bg_crd_init = FALSE; pthread_mutex_unlock(&share->crd_mutex); my_thread_end(); -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__SUNPRO_CC) spider_free(NULL, need_mons, MYF(MY_WME)); #endif DBUG_RETURN(NULL); } - thd->thread_id = next_thread_id(); #ifdef HAVE_PSI_INTERFACE mysql_thread_set_psi_id(thd->thread_id); #endif @@ -3175,7 +3172,7 @@ void *spider_bg_crd_action( my_pthread_setspecific_ptr(THR_THD, NULL); #endif my_thread_end(); -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__SUNPRO_CC) spider_free(NULL, need_mons, MYF(MY_WME)); #endif DBUG_RETURN(NULL); @@ -3244,7 +3241,7 @@ void *spider_bg_crd_action( my_pthread_setspecific_ptr(THR_THD, NULL); #endif my_thread_end(); -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__SUNPRO_CC) spider_free(NULL, need_mons, MYF(MY_WME)); #endif DBUG_RETURN(NULL); @@ -3275,7 +3272,7 @@ void *spider_bg_crd_action( my_pthread_setspecific_ptr(THR_THD, NULL); #endif my_thread_end(); -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__SUNPRO_CC) spider_free(NULL, need_mons, MYF(MY_WME)); #endif DBUG_RETURN(NULL); @@ -3409,7 +3406,7 @@ int spider_create_mon_threads( { char link_idx_str[SPIDER_SQL_INT_LEN]; int link_idx_str_length; -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__SUNPRO_CC) spider_string conv_name_str(share->table_name_length + SPIDER_SQL_INT_LEN + 1); conv_name_str.set_charset(system_charset_info); @@ -3636,7 +3633,7 @@ void *spider_bg_mon_action( DBUG_ENTER("spider_bg_mon_action"); /* init start */ pthread_mutex_lock(&share->bg_mon_mutexes[link_idx]); - if (!(thd = new THD())) + if (!(thd = new THD(next_thread_id()))) { share->bg_mon_kill = FALSE; share->bg_mon_init = FALSE; @@ -3645,7 +3642,6 @@ void *spider_bg_mon_action( my_thread_end(); DBUG_RETURN(NULL); } - thd->thread_id = next_thread_id(); #ifdef HAVE_PSI_INTERFACE mysql_thread_set_psi_id(thd->thread_id); #endif @@ -3738,7 +3734,7 @@ int spider_conn_first_link_idx( int roop_count, active_links = 0; longlong balance_total = 0, balance_val; double rand_val; -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__SUNPRO_CC) int *link_idxs, link_idx; long *balances; #else @@ -3746,7 +3742,7 @@ int spider_conn_first_link_idx( long balances[link_count]; #endif DBUG_ENTER("spider_conn_first_link_idx"); -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__SUNPRO_CC) if (!(link_idxs = (int *) spider_bulk_malloc(spider_current_trx, 24, MYF(MY_WME), &link_idxs, sizeof(int) * link_count, @@ -3772,7 +3768,7 @@ int spider_conn_first_link_idx( if (active_links == 0) { DBUG_PRINT("info",("spider all links are failed")); -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__SUNPRO_CC) spider_free(spider_current_trx, link_idxs, MYF(MY_WME)); #endif DBUG_RETURN(-1); @@ -3801,7 +3797,7 @@ int spider_conn_first_link_idx( } DBUG_PRINT("info",("spider first link_idx=%d", link_idxs[roop_count])); -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__SUNPRO_CC) link_idx = link_idxs[roop_count]; spider_free(spider_current_trx, link_idxs, MYF(MY_WME)); DBUG_RETURN(link_idx); diff --git a/storage/spider/spd_db_conn.cc b/storage/spider/spd_db_conn.cc index a65338c4910..1da25e17b50 100644 --- a/storage/spider/spd_db_conn.cc +++ b/storage/spider/spd_db_conn.cc @@ -9296,7 +9296,7 @@ int spider_db_udf_ping_table( { int init_sql_alloc_size = spider_param_init_sql_alloc_size(trx->thd, share->init_sql_alloc_size); -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__SUNPRO_CC) spider_string sql_str(init_sql_alloc_size); sql_str.set_charset(system_charset_info); spider_string where_str(init_sql_alloc_size); @@ -9519,7 +9519,7 @@ int spider_db_udf_ping_table_mon_next( SPIDER_SHARE *share = table_mon->share; int init_sql_alloc_size = spider_param_init_sql_alloc_size(thd, share->init_sql_alloc_size); -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__SUNPRO_CC) spider_string sql_str(init_sql_alloc_size); sql_str.set_charset(thd->variables.character_set_client); #else diff --git a/storage/spider/spd_direct_sql.cc b/storage/spider/spd_direct_sql.cc index c0eb7806bb0..ad7bd54c69f 100644 --- a/storage/spider/spd_direct_sql.cc +++ b/storage/spider/spd_direct_sql.cc @@ -1640,7 +1640,7 @@ long long spider_direct_sql_body( table_list.table_name = direct_sql->table_names[roop_count]; #endif if (!(direct_sql->tables[roop_count] = - find_temporary_table(thd, &table_list))) + thd->find_temporary_table(&table_list))) { #if MYSQL_VERSION_ID < 50500 #else diff --git a/storage/spider/spd_ping_table.cc b/storage/spider/spd_ping_table.cc index 41c5c240dd3..f59f7760359 100644 --- a/storage/spider/spd_ping_table.cc +++ b/storage/spider/spd_ping_table.cc @@ -241,7 +241,7 @@ void spider_release_ping_table_mon_list( DBUG_PRINT("info", ("spider link_idx=%d", link_idx)); link_idx_str_length = my_sprintf(link_idx_str, (link_idx_str, "%010d", link_idx)); -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__SUNPRO_CC) spider_string conv_name_str(conv_name_length + link_idx_str_length + 1); conv_name_str.set_charset(system_charset_info); #else @@ -1362,7 +1362,7 @@ int spider_ping_table_mon_from_table( link_idx_str_length = my_sprintf(link_idx_str, (link_idx_str, "%010d", link_idx)); -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__SUNPRO_CC) spider_string conv_name_str(conv_name_length + link_idx_str_length + 1); conv_name_str.set_charset(system_charset_info); *((char *)(conv_name_str.ptr() + conv_name_length + link_idx_str_length)) = diff --git a/storage/spider/spd_sys_table.cc b/storage/spider/spd_sys_table.cc index f126fdddf64..86ab5fdccf4 100644 --- a/storage/spider/spd_sys_table.cc +++ b/storage/spider/spd_sys_table.cc @@ -227,7 +227,8 @@ void spider_close_sys_table( close_performance_schema_table(thd, open_tables_backup); } else { table->file->ha_reset(); - closefrm(table, TRUE); + closefrm(table); + tdc_release_share(table->s); spider_free(spider_current_trx, table, MYF(0)); thd->restore_backup_open_tables_state(open_tables_backup); } diff --git a/storage/spider/spd_table.cc b/storage/spider/spd_table.cc index d981dc6002b..fe682ce0be4 100644 --- a/storage/spider/spd_table.cc +++ b/storage/spider/spd_table.cc @@ -3702,7 +3702,7 @@ int spider_create_conn_keys( #if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET) char *tmp_hs_r_name, *tmp_hs_w_name; #endif -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__SUNPRO_CC) uint *conn_keys_lengths; #if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET) uint *hs_r_conn_keys_lengths; @@ -3716,7 +3716,7 @@ int spider_create_conn_keys( #endif #endif DBUG_ENTER("spider_create_conn_keys"); -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__SUNPRO_CC) if (!(conn_keys_lengths = (uint *) spider_bulk_alloc_mem(spider_current_trx, 44, __func__, __FILE__, __LINE__, MYF(MY_WME), @@ -3805,7 +3805,7 @@ int spider_create_conn_keys( #endif NullS)) ) { -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__SUNPRO_CC) spider_free(spider_current_trx, conn_keys_lengths, MYF(MY_WME)); #endif DBUG_RETURN(HA_ERR_OUT_OF_MEM); @@ -3822,7 +3822,7 @@ int spider_create_conn_keys( sizeof(uint) * share->all_link_count); #endif -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__SUNPRO_CC) spider_free(spider_current_trx, conn_keys_lengths, MYF(MY_WME)); #endif @@ -4675,7 +4675,7 @@ SPIDER_SHARE *spider_get_share( share->link_count, SPIDER_LINK_STATUS_OK); if (search_link_idx == -1) { -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__SUNPRO_CC) char *db, *table_name; if (!(db = (char *) spider_bulk_malloc(spider_current_trx, 48, MYF(MY_WME), @@ -4701,7 +4701,7 @@ SPIDER_SHARE *spider_get_share( table_name[table_share->table_name.length] = '\0'; my_printf_error(ER_SPIDER_ALL_LINKS_FAILED_NUM, ER_SPIDER_ALL_LINKS_FAILED_STR, MYF(0), db, table_name); -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__SUNPRO_CC) spider_free(spider->trx, db, MYF(MY_WME)); #endif *error_num = ER_SPIDER_ALL_LINKS_FAILED_NUM; @@ -5099,7 +5099,7 @@ SPIDER_SHARE *spider_get_share( share->link_count, SPIDER_LINK_STATUS_OK); if (search_link_idx == -1) { -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__SUNPRO_CC) char *db, *table_name; if (!(db = (char *) spider_bulk_malloc(spider_current_trx, 50, MYF(MY_WME), @@ -5122,7 +5122,7 @@ SPIDER_SHARE *spider_get_share( table_name[table_share->table_name.length] = '\0'; my_printf_error(ER_SPIDER_ALL_LINKS_FAILED_NUM, ER_SPIDER_ALL_LINKS_FAILED_STR, MYF(0), db, table_name); -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__SUNPRO_CC) spider_free(spider->trx, db, MYF(MY_WME)); #endif *error_num = ER_SPIDER_ALL_LINKS_FAILED_NUM; diff --git a/storage/spider/spd_trx.cc b/storage/spider/spd_trx.cc index b376265c1e7..007e1fcba5d 100644 --- a/storage/spider/spd_trx.cc +++ b/storage/spider/spd_trx.cc @@ -3711,7 +3711,7 @@ int spider_check_trx_and_get_conn( { TABLE *table = spider->get_table(); TABLE_SHARE *table_share = table->s; -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__SUNPRO_CC) char *db, *table_name; if (!(db = (char *) spider_bulk_malloc(spider_current_trx, 57, MYF(MY_WME), @@ -3733,7 +3733,7 @@ int spider_check_trx_and_get_conn( table_name[table_share->table_name.length] = '\0'; my_printf_error(ER_SPIDER_ALL_LINKS_FAILED_NUM, ER_SPIDER_ALL_LINKS_FAILED_STR, MYF(0), db, table_name); -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__SUNPRO_CC) spider_free(trx, db, MYF(MY_WME)); #endif DBUG_RETURN(ER_SPIDER_ALL_LINKS_FAILED_NUM); @@ -3870,7 +3870,7 @@ int spider_check_trx_and_get_conn( { TABLE *table = spider->get_table(); TABLE_SHARE *table_share = table->s; -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__SUNPRO_CC) char *db, *table_name; if (!(db = (char *) spider_bulk_malloc(spider_current_trx, 57, MYF(MY_WME), @@ -3892,7 +3892,7 @@ int spider_check_trx_and_get_conn( table_name[table_share->table_name.length] = '\0'; my_printf_error(ER_SPIDER_LINK_MON_JUST_NG_NUM, ER_SPIDER_LINK_MON_JUST_NG_STR, MYF(0), db, table_name); -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__SUNPRO_CC) spider_free(trx, db, MYF(MY_WME)); #endif DBUG_RETURN(ER_SPIDER_LINK_MON_JUST_NG_NUM); @@ -4016,7 +4016,7 @@ int spider_check_trx_and_get_conn( { TABLE *table = spider->get_table(); TABLE_SHARE *table_share = table->s; -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__SUNPRO_CC) char *db, *table_name; if (!(db = (char *) spider_bulk_malloc(spider_current_trx, 57, MYF(MY_WME), @@ -4038,7 +4038,7 @@ int spider_check_trx_and_get_conn( table_name[table_share->table_name.length] = '\0'; my_printf_error(ER_SPIDER_LINK_MON_JUST_NG_NUM, ER_SPIDER_LINK_MON_JUST_NG_STR, MYF(0), db, table_name); -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__SUNPRO_CC) spider_free(trx, db, MYF(MY_WME)); #endif DBUG_RETURN(ER_SPIDER_LINK_MON_JUST_NG_NUM); @@ -4055,7 +4055,7 @@ THD *spider_create_tmp_thd() { THD *thd; DBUG_ENTER("spider_create_tmp_thd"); - if (!(thd = new THD)) + if (!(thd = new THD(0))) DBUG_RETURN(NULL); #if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 100000 thd->killed = NOT_KILLED; @@ -4066,7 +4066,6 @@ THD *spider_create_tmp_thd() thd->locked_tables = FALSE; #endif thd->proc_info = ""; - thd->thread_id = thd->variables.pseudo_thread_id = 0; thd->thread_stack = (char*) &thd; if (thd->store_globals()) DBUG_RETURN(NULL); diff --git a/storage/test_sql_discovery/mysql-test/sql_discovery/simple.result b/storage/test_sql_discovery/mysql-test/sql_discovery/simple.result index 94f3bd1ed87..d2f0b52c446 100644 --- a/storage/test_sql_discovery/mysql-test/sql_discovery/simple.result +++ b/storage/test_sql_discovery/mysql-test/sql_discovery/simple.result @@ -122,9 +122,9 @@ Handler_discover 15 show create table t1; Table Create Table t1 CREATE TABLE t1 ( - a int(11) NOT NULL DEFAULT '5', + a int(11) NOT NULL DEFAULT 5, b timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - c tinyblob, + c tinyblob DEFAULT NULL, d decimal(5,2) DEFAULT NULL, e varchar(30) CHARACTER SET ascii DEFAULT NULL, f geometry NOT NULL, diff --git a/storage/tokudb/CMakeLists.txt b/storage/tokudb/CMakeLists.txt index a64974d7330..f9754639bd9 100644 --- a/storage/tokudb/CMakeLists.txt +++ b/storage/tokudb/CMakeLists.txt @@ -1,4 +1,4 @@ -SET(TOKUDB_VERSION 5.6.26-74.0) +SET(TOKUDB_VERSION 5.6.30-76.3) # PerconaFT only supports x86-64 and cmake-2.8.9+ IF(CMAKE_VERSION VERSION_LESS "2.8.9") MESSAGE(STATUS "CMake 2.8.9 or higher is required by TokuDB") @@ -16,7 +16,12 @@ IF(NOT TOKUDB_OK) RETURN() ENDIF() -SET(TOKUDB_SOURCES ha_tokudb.cc) +SET(TOKUDB_SOURCES + ha_tokudb.cc + tokudb_background.cc + tokudb_information_schema.cc + tokudb_sysvars.cc + tokudb_thread.cc) MYSQL_ADD_PLUGIN(tokudb ${TOKUDB_SOURCES} STORAGE_ENGINE MODULE_ONLY) IF(NOT TARGET tokudb) @@ -27,7 +32,6 @@ IF(NOT LIBJEMALLOC) MESSAGE(WARNING "TokuDB is enabled, but jemalloc is not. This configuration is not supported") ENDIF() -MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-vla") MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-vla" DEBUG) ############################################ @@ -47,10 +51,16 @@ MARK_AS_ADVANCED(gcc_ar) MARK_AS_ADVANCED(gcc_ranlib) ############################################ +# pick language dialect +MY_CHECK_AND_SET_COMPILER_FLAG(-std=c++11) + SET(BUILD_TESTING OFF CACHE BOOL "") SET(USE_VALGRIND OFF CACHE BOOL "") SET(TOKU_DEBUG_PARANOID OFF CACHE BOOL "") +# Enable TokuDB's TOKUDB_DEBUG in debug builds +SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DTOKUDB_DEBUG") + IF(NOT DEFINED TOKUDB_VERSION) IF(DEFINED ENV{TOKUDB_VERSION}) SET(TOKUDB_VERSION $ENV{TOKUDB_VERSION}) @@ -73,10 +83,6 @@ IF(DEFINED TOKUDB_CHECK_JEMALLOC) ADD_DEFINITIONS("-DTOKUDB_CHECK_JEMALLOC=${TOKUDB_CHECK_JEMALLOC}") ENDIF() -## adds a compiler flag if the compiler supports it -include(CheckCCompilerFlag) -include(CheckCXXCompilerFlag) - MY_CHECK_AND_SET_COMPILER_FLAG(-Wno-missing-field-initializers) IF (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/PerconaFT/") diff --git a/storage/tokudb/PerconaFT/CMakeLists.txt b/storage/tokudb/PerconaFT/CMakeLists.txt index 6e3aaee139b..375ce0078a4 100644 --- a/storage/tokudb/PerconaFT/CMakeLists.txt +++ b/storage/tokudb/PerconaFT/CMakeLists.txt @@ -1,3 +1,6 @@ +if (CMAKE_PROJECT_NAME STREQUAL TokuDB) + cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR) +endif() set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules") project(TokuDB) diff --git a/storage/tokudb/PerconaFT/CTestCustom.cmake b/storage/tokudb/PerconaFT/CTestCustom.cmake.in similarity index 100% rename from storage/tokudb/PerconaFT/CTestCustom.cmake rename to storage/tokudb/PerconaFT/CTestCustom.cmake.in diff --git a/storage/tokudb/PerconaFT/README.md b/storage/tokudb/PerconaFT/README.md index 7e30a558bc7..d53caf00190 100644 --- a/storage/tokudb/PerconaFT/README.md +++ b/storage/tokudb/PerconaFT/README.md @@ -113,11 +113,11 @@ All source code and test contributions must be provided under a [BSD 2-Clause][b License ------- -PerconaFT is available under the GPL version 2, and AGPL version 3, with slight modifications. +PerconaFT is available under the GPL version 2, and AGPL version 3. See [COPYING.AGPLv3][agpllicense], [COPYING.GPLv2][gpllicense], and [PATENTS][patents]. -[agpllicense]: http://github.com/Perona/PerconaFT/blob/master/COPYING.AGPLv3 -[gpllicense]: http://github.com/Perona/PerconaFT/blob/master/COPYING.GPLv2 -[patents]: http://github.com/Perona/PerconaFT/blob/master/PATENTS +[agpllicense]: http://github.com/Percona/PerconaFT/blob/master/COPYING.AGPLv3 +[gpllicense]: http://github.com/Percona/PerconaFT/blob/master/COPYING.GPLv2 +[patents]: http://github.com/Percona/PerconaFT/blob/master/PATENTS diff --git a/storage/tokudb/PerconaFT/buildheader/make_tdb.cc b/storage/tokudb/PerconaFT/buildheader/make_tdb.cc index 958f00a8706..5c29209e19d 100644 --- a/storage/tokudb/PerconaFT/buildheader/make_tdb.cc +++ b/storage/tokudb/PerconaFT/buildheader/make_tdb.cc @@ -510,8 +510,9 @@ static void print_db_struct (void) { "int (*update_broadcast)(DB *, DB_TXN*, const DBT *extra, uint32_t flags)", "int (*get_fractal_tree_info64)(DB*,uint64_t*,uint64_t*,uint64_t*,uint64_t*)", "int (*iterate_fractal_tree_block_map)(DB*,int(*)(uint64_t,int64_t,int64_t,int64_t,int64_t,void*),void*)", - "const char *(*get_dname)(DB *db)", - "int (*get_last_key)(DB *db, YDB_CALLBACK_FUNCTION func, void* extra)", + "const char *(*get_dname)(DB *db)", + "int (*get_last_key)(DB *db, YDB_CALLBACK_FUNCTION func, void* extra)", + "int (*recount_rows)(DB* db, int (*progress_callback)(uint64_t count, uint64_t deleted, void* progress_extra), void* progress_extra)", NULL}; sort_and_dump_fields("db", true, extra); } diff --git a/storage/tokudb/PerconaFT/cmake_modules/TokuMergeLibs.cmake b/storage/tokudb/PerconaFT/cmake_modules/TokuMergeLibs.cmake index 15066906831..e1da095fc00 100644 --- a/storage/tokudb/PerconaFT/cmake_modules/TokuMergeLibs.cmake +++ b/storage/tokudb/PerconaFT/cmake_modules/TokuMergeLibs.cmake @@ -48,7 +48,8 @@ MACRO(TOKU_MERGE_STATIC_LIBS TARGET OUTPUT_NAME LIBS_TO_MERGE) ENDIF() ENDFOREACH() IF(OSLIBS) - #LIST(REMOVE_DUPLICATES OSLIBS) + # REMOVE_DUPLICATES destroys the order of the libs so disabled + # LIST(REMOVE_DUPLICATES OSLIBS) TARGET_LINK_LIBRARIES(${TARGET} LINK_PUBLIC ${OSLIBS}) ENDIF() diff --git a/storage/tokudb/PerconaFT/cmake_modules/TokuSetupCompiler.cmake b/storage/tokudb/PerconaFT/cmake_modules/TokuSetupCompiler.cmake index f25206d8861..77f6d8f67b7 100644 --- a/storage/tokudb/PerconaFT/cmake_modules/TokuSetupCompiler.cmake +++ b/storage/tokudb/PerconaFT/cmake_modules/TokuSetupCompiler.cmake @@ -24,12 +24,12 @@ endif () ## add TOKU_PTHREAD_DEBUG for debug builds if (CMAKE_VERSION VERSION_LESS 3.0) - set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DEBUG TOKU_PTHREAD_DEBUG=1) - set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DRD TOKU_PTHREAD_DEBUG=1) + set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DEBUG TOKU_PTHREAD_DEBUG=1 TOKU_DEBUG_TXN_SYNC=1) + set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DRD TOKU_PTHREAD_DEBUG=1 TOKU_DEBUG_TXN_SYNC=1) set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DRD _FORTIFY_SOURCE=2) else () set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS - $<$,$>:TOKU_PTHREAD_DEBUG=1> + $<$,$>:TOKU_PTHREAD_DEBUG=1 TOKU_DEBUG_TXN_SYNC=1> $<$:_FORTIFY_SOURCE=2> ) endif () @@ -65,8 +65,10 @@ set_cflags_if_supported( -Wno-error=missing-format-attribute -Wno-error=address-of-array-temporary -Wno-error=tautological-constant-out-of-range-compare + -Wno-error=maybe-uninitialized -Wno-ignored-attributes -Wno-error=extern-c-compat + -Wno-pointer-bool-conversion -fno-rtti -fno-exceptions ) @@ -74,8 +76,8 @@ set_cflags_if_supported( if (CMAKE_CXX_FLAGS MATCHES -fno-implicit-templates) # must append this because mysql sets -fno-implicit-templates and we need to override it - check_cxx_compiler_flag(-fimplicit-templates HAVE_CXX_-fimplicit-templates) - if (HAVE_CXX_-fimplicit-templates) + check_cxx_compiler_flag(-fimplicit-templates HAVE_CXX_IMPLICIT_TEMPLATES) + if (HAVE_CXX_IMPLICIT_TEMPLATES) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fimplicit-templates") endif () endif() @@ -119,13 +121,18 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL Clang) set(CMAKE_C_FLAGS_RELEASE "-g -O3 ${CMAKE_C_FLAGS_RELEASE} -UNDEBUG") set(CMAKE_CXX_FLAGS_RELEASE "-g -O3 ${CMAKE_CXX_FLAGS_RELEASE} -UNDEBUG") else () + if (APPLE) + set(FLTO_OPTS "-fwhole-program") + else () + set(FLTO_OPTS "-fuse-linker-plugin") + endif() # we overwrite this because the default passes -DNDEBUG and we don't want that - set(CMAKE_C_FLAGS_RELWITHDEBINFO "-flto -fuse-linker-plugin ${CMAKE_C_FLAGS_RELWITHDEBINFO} -g -O3 -UNDEBUG") - set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-flto -fuse-linker-plugin ${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -g -O3 -UNDEBUG") - set(CMAKE_C_FLAGS_RELEASE "-g -O3 -flto -fuse-linker-plugin ${CMAKE_C_FLAGS_RELEASE} -UNDEBUG") - set(CMAKE_CXX_FLAGS_RELEASE "-g -O3 -flto -fuse-linker-plugin ${CMAKE_CXX_FLAGS_RELEASE} -UNDEBUG") - set(CMAKE_EXE_LINKER_FLAGS "-g -fuse-linker-plugin ${CMAKE_EXE_LINKER_FLAGS}") - set(CMAKE_SHARED_LINKER_FLAGS "-g -fuse-linker-plugin ${CMAKE_SHARED_LINKER_FLAGS}") + set(CMAKE_C_FLAGS_RELWITHDEBINFO "-flto ${FLTO_OPTS} ${CMAKE_C_FLAGS_RELWITHDEBINFO} -g -O3 -UNDEBUG") + set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-flto ${FLTO_OPTS} ${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -g -O3 -UNDEBUG") + set(CMAKE_C_FLAGS_RELEASE "-g -O3 -flto ${FLTO_OPTS} ${CMAKE_C_FLAGS_RELEASE} -UNDEBUG") + set(CMAKE_CXX_FLAGS_RELEASE "-g -O3 -flto ${FLTO_OPTS} ${CMAKE_CXX_FLAGS_RELEASE} -UNDEBUG") + set(CMAKE_EXE_LINKER_FLAGS "-g ${FLTO_OPTS} ${CMAKE_EXE_LINKER_FLAGS}") + set(CMAKE_SHARED_LINKER_FLAGS "-g ${FLTO_OPTS} ${CMAKE_SHARED_LINKER_FLAGS}") endif () ## set warnings @@ -159,15 +166,6 @@ endif () set(CMAKE_C_FLAGS "-Wall -Werror ${CMAKE_C_FLAGS}") set(CMAKE_CXX_FLAGS "-Wall -Werror ${CMAKE_CXX_FLAGS}") -## need to set -stdlib=libc++ to get real c++11 support on darwin -if (APPLE) - if (CMAKE_GENERATOR STREQUAL Xcode) - set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++") - else () - add_definitions(-stdlib=libc++) - endif () -endif () - # pick language dialect set(CMAKE_C_FLAGS "-std=c99 ${CMAKE_C_FLAGS}") check_cxx_compiler_flag(-std=c++11 HAVE_STDCXX11) diff --git a/storage/tokudb/PerconaFT/ft/CMakeLists.txt b/storage/tokudb/PerconaFT/ft/CMakeLists.txt index 744b9c9a9e1..11091073ac2 100644 --- a/storage/tokudb/PerconaFT/ft/CMakeLists.txt +++ b/storage/tokudb/PerconaFT/ft/CMakeLists.txt @@ -36,6 +36,7 @@ set(FT_SOURCES ft-flusher ft-hot-flusher ft-ops + ft-recount-rows ft-status ft-test-helpers ft-verify diff --git a/storage/tokudb/PerconaFT/ft/bndata.cc b/storage/tokudb/PerconaFT/ft/bndata.cc index 4e2b4d090de..ecacb28acda 100644 --- a/storage/tokudb/PerconaFT/ft/bndata.cc +++ b/storage/tokudb/PerconaFT/ft/bndata.cc @@ -36,6 +36,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." +#include #include #include diff --git a/storage/tokudb/PerconaFT/ft/cachetable/cachetable.cc b/storage/tokudb/PerconaFT/ft/cachetable/cachetable.cc index 5bba977de1a..4495694e06f 100644 --- a/storage/tokudb/PerconaFT/ft/cachetable/cachetable.cc +++ b/storage/tokudb/PerconaFT/ft/cachetable/cachetable.cc @@ -36,6 +36,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." +#include #include #include #include diff --git a/storage/tokudb/PerconaFT/ft/cachetable/checkpoint.cc b/storage/tokudb/PerconaFT/ft/cachetable/checkpoint.cc index 3223ab0a4ce..4d54962fe9c 100644 --- a/storage/tokudb/PerconaFT/ft/cachetable/checkpoint.cc +++ b/storage/tokudb/PerconaFT/ft/cachetable/checkpoint.cc @@ -73,6 +73,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. * *****/ +#include #include #include "portability/toku_portability.h" diff --git a/storage/tokudb/PerconaFT/ft/cursor.cc b/storage/tokudb/PerconaFT/ft/cursor.cc index 8f598d0a0df..5402763f7a7 100644 --- a/storage/tokudb/PerconaFT/ft/cursor.cc +++ b/storage/tokudb/PerconaFT/ft/cursor.cc @@ -35,6 +35,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." +#include #include "ft/ft-internal.h" #include "ft/cursor.h" diff --git a/storage/tokudb/PerconaFT/ft/ft-cachetable-wrappers.cc b/storage/tokudb/PerconaFT/ft/ft-cachetable-wrappers.cc index ca5ffa6a186..3623847c6f8 100644 --- a/storage/tokudb/PerconaFT/ft/ft-cachetable-wrappers.cc +++ b/storage/tokudb/PerconaFT/ft/ft-cachetable-wrappers.cc @@ -36,6 +36,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." +#include #include "ft/serialize/block_table.h" #include "ft/ft-cachetable-wrappers.h" #include "ft/ft-flusher.h" diff --git a/storage/tokudb/PerconaFT/ft/ft-flusher.cc b/storage/tokudb/PerconaFT/ft/ft-flusher.cc index 530947fe868..6c682f3c215 100644 --- a/storage/tokudb/PerconaFT/ft/ft-flusher.cc +++ b/storage/tokudb/PerconaFT/ft/ft-flusher.cc @@ -36,6 +36,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." +#include #include "ft/ft.h" #include "ft/ft-cachetable-wrappers.h" #include "ft/ft-internal.h" @@ -496,7 +497,7 @@ handle_split_of_child( // We never set the rightmost blocknum to be the root. // Instead, we wait for the root to split and let promotion initialize the rightmost - // blocknum to be the first non-root leaf node on the right extreme to recieve an insert. + // blocknum to be the first non-root leaf node on the right extreme to receive an insert. BLOCKNUM rightmost_blocknum = toku_unsafe_fetch(&ft->rightmost_blocknum); invariant(ft->h->root_blocknum.b != rightmost_blocknum.b); if (childa->blocknum.b == rightmost_blocknum.b) { @@ -1572,6 +1573,7 @@ void toku_bnc_flush_to_child(FT ft, NONLEAF_CHILDINFO bnc, FTNODE child, TXNID p txn_gc_info *gc_info; STAT64INFO_S stats_delta; + int64_t logical_rows_delta = 0; size_t remaining_memsize = bnc->msg_buffer.buffer_size_in_use(); flush_msg_fn(FT t, FTNODE n, NONLEAF_CHILDINFO nl, txn_gc_info *g) : @@ -1599,8 +1601,8 @@ void toku_bnc_flush_to_child(FT ft, NONLEAF_CHILDINFO bnc, FTNODE child, TXNID p is_fresh, gc_info, flow_deltas, - &stats_delta - ); + &stats_delta, + &logical_rows_delta); remaining_memsize -= memsize_in_buffer; return 0; } @@ -1613,6 +1615,7 @@ void toku_bnc_flush_to_child(FT ft, NONLEAF_CHILDINFO bnc, FTNODE child, TXNID p if (flush_fn.stats_delta.numbytes || flush_fn.stats_delta.numrows) { toku_ft_update_stats(&ft->in_memory_stats, flush_fn.stats_delta); } + toku_ft_adjust_logical_row_count(ft, flush_fn.logical_rows_delta); if (do_garbage_collection) { size_t buffsize = bnc->msg_buffer.buffer_size_in_use(); // may be misleading if there's a broadcast message in there diff --git a/storage/tokudb/PerconaFT/ft/ft-hot-flusher.cc b/storage/tokudb/PerconaFT/ft/ft-hot-flusher.cc index 405bcd5b8f1..ffab8647541 100644 --- a/storage/tokudb/PerconaFT/ft/ft-hot-flusher.cc +++ b/storage/tokudb/PerconaFT/ft/ft-hot-flusher.cc @@ -36,6 +36,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." +#include #include "ft/ft.h" #include "ft/ft-cachetable-wrappers.h" #include "ft/ft-flusher.h" diff --git a/storage/tokudb/PerconaFT/ft/ft-internal.h b/storage/tokudb/PerconaFT/ft/ft-internal.h index 6bf7029245b..eec591d1744 100644 --- a/storage/tokudb/PerconaFT/ft/ft-internal.h +++ b/storage/tokudb/PerconaFT/ft/ft-internal.h @@ -143,6 +143,10 @@ struct ft_header { MSN msn_at_start_of_last_completed_optimize; STAT64INFO_S on_disk_stats; + + // This represents the balance of inserts - deletes and should be + // closer to a logical representation of the number of records in an index + uint64_t on_disk_logical_rows; }; typedef struct ft_header *FT_HEADER; @@ -176,6 +180,7 @@ struct ft { // protected by atomic builtins STAT64INFO_S in_memory_stats; + uint64_t in_memory_logical_rows; // transient, not serialized to disk. updated when we do write to // disk. tells us whether we can do partial eviction (we can't if diff --git a/storage/tokudb/PerconaFT/ft/ft-ops.cc b/storage/tokudb/PerconaFT/ft/ft-ops.cc index f5da82ee000..02fa8bda0e5 100644 --- a/storage/tokudb/PerconaFT/ft/ft-ops.cc +++ b/storage/tokudb/PerconaFT/ft/ft-ops.cc @@ -147,6 +147,7 @@ basement nodes, bulk fetch, and partial fetch: */ +#include #include "ft/cachetable/checkpoint.h" #include "ft/cursor.h" #include "ft/ft.h" @@ -1371,7 +1372,8 @@ static void inject_message_in_locked_node( ft_msg msg_with_msn(msg.kdbt(), msg.vdbt(), msg.type(), msg_msn, msg.xids()); paranoid_invariant(msg_with_msn.msn().msn > node->max_msn_applied_to_node_on_disk.msn); - STAT64INFO_S stats_delta = {0,0}; + STAT64INFO_S stats_delta = { 0,0 }; + int64_t logical_rows_delta = 0; toku_ftnode_put_msg( ft->cmp, ft->update_fun, @@ -1381,11 +1383,12 @@ static void inject_message_in_locked_node( true, gc_info, flow_deltas, - &stats_delta - ); + &stats_delta, + &logical_rows_delta); if (stats_delta.numbytes || stats_delta.numrows) { toku_ft_update_stats(&ft->in_memory_stats, stats_delta); } + toku_ft_adjust_logical_row_count(ft, logical_rows_delta); // // assumption is that toku_ftnode_put_msg will // mark the node as dirty. @@ -2169,6 +2172,7 @@ int toku_ft_insert_unique(FT_HANDLE ft_h, DBT *key, DBT *val, TOKUTXN txn, bool if (r == 0) { ft_txn_log_insert(ft_h->ft, key, val, txn, do_logging, FT_INSERT); + toku_ft_adjust_logical_row_count(ft_h->ft, 1); } return r; } @@ -2344,6 +2348,7 @@ void toku_ft_maybe_insert (FT_HANDLE ft_h, DBT *key, DBT *val, TOKUTXN txn, bool if (r != 0) { toku_ft_send_insert(ft_h, key, val, message_xids, type, &gc_info); } + toku_ft_adjust_logical_row_count(ft_h->ft, 1); } } @@ -2513,6 +2518,7 @@ void toku_ft_maybe_delete(FT_HANDLE ft_h, DBT *key, TOKUTXN txn, bool oplsn_vali oldest_referenced_xid_estimate, txn != nullptr ? !txn->for_recovery : false); toku_ft_send_delete(ft_h, key, message_xids, &gc_info); + toku_ft_adjust_logical_row_count(ft_h->ft, -1); } } diff --git a/storage/tokudb/PerconaFT/ft/ft-ops.h b/storage/tokudb/PerconaFT/ft/ft-ops.h index 7d0b165b70c..313a74628ea 100644 --- a/storage/tokudb/PerconaFT/ft/ft-ops.h +++ b/storage/tokudb/PerconaFT/ft/ft-ops.h @@ -207,6 +207,15 @@ extern int toku_ft_debug_mode; int toku_verify_ft (FT_HANDLE ft_h) __attribute__ ((warn_unused_result)); int toku_verify_ft_with_progress (FT_HANDLE ft_h, int (*progress_callback)(void *extra, float progress), void *extra, int verbose, int keep_going) __attribute__ ((warn_unused_result)); +int toku_ft_recount_rows( + FT_HANDLE ft, + int (*progress_callback)( + uint64_t count, + uint64_t deleted, + void* progress_extra), + void* progress_extra); + + DICTIONARY_ID toku_ft_get_dictionary_id(FT_HANDLE); enum ft_flags { diff --git a/storage/tokudb/PerconaFT/ft/ft-recount-rows.cc b/storage/tokudb/PerconaFT/ft/ft-recount-rows.cc new file mode 100644 index 00000000000..adac96f4882 --- /dev/null +++ b/storage/tokudb/PerconaFT/ft/ft-recount-rows.cc @@ -0,0 +1,115 @@ +/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ +// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4: +#ident "$Id$" +/*====== +This file is part of PerconaFT. + + +Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. + + PerconaFT is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License, version 2, + as published by the Free Software Foundation. + + PerconaFT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with PerconaFT. If not, see . + +---------------------------------------- + + PerconaFT is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License, version 3, + as published by the Free Software Foundation. + + PerconaFT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with PerconaFT. If not, see . +======= */ + +#ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." + +#include "ft/serialize/block_table.h" +#include "ft/ft.h" +#include "ft/ft-internal.h" +#include "ft/cursor.h" + +struct recount_rows_extra_t { + int (*_progress_callback)( + uint64_t count, + uint64_t deleted, + void* progress_extra); + void* _progress_extra; + uint64_t _keys; + bool _cancelled; +}; + +static int recount_rows_found( + uint32_t UU(keylen), + const void* key, + uint32_t UU(vallen), + const void* UU(val), + void* extra, + bool UU(lock_only)) { + + recount_rows_extra_t* rre = (recount_rows_extra_t*)extra; + + if (FT_LIKELY(key != nullptr)) { + rre->_keys++; + } + return rre->_cancelled + = rre->_progress_callback(rre->_keys, 0, rre->_progress_extra); +} +static bool recount_rows_interrupt(void* extra, uint64_t deleted_rows) { + recount_rows_extra_t* rre = (recount_rows_extra_t*)extra; + + return rre->_cancelled = + rre->_progress_callback(rre->_keys, deleted_rows, rre->_progress_extra); +} +int toku_ft_recount_rows( + FT_HANDLE ft, + int (*progress_callback)( + uint64_t count, + uint64_t deleted, + void* progress_extra), + void* progress_extra) { + + int ret = 0; + recount_rows_extra_t rre = { + progress_callback, + progress_extra, + 0, + false + }; + + ft_cursor c; + ret = toku_ft_cursor_create(ft, &c, nullptr, C_READ_ANY, false, false); + if (ret) return ret; + + toku_ft_cursor_set_check_interrupt_cb( + &c, + recount_rows_interrupt, + &rre); + + ret = toku_ft_cursor_first(&c, recount_rows_found, &rre); + while (FT_LIKELY(ret == 0)) { + ret = toku_ft_cursor_next(&c, recount_rows_found, &rre); + } + + toku_ft_cursor_destroy(&c); + + if (rre._cancelled == false) { + // update ft count + toku_unsafe_set(&ft->ft->in_memory_logical_rows, rre._keys); + ret = 0; + } + + return ret; +} diff --git a/storage/tokudb/PerconaFT/ft/ft-status.cc b/storage/tokudb/PerconaFT/ft/ft-status.cc index 982df1822c4..64acd4ec017 100644 --- a/storage/tokudb/PerconaFT/ft/ft-status.cc +++ b/storage/tokudb/PerconaFT/ft/ft-status.cc @@ -36,6 +36,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." +#include #include "ft/ft.h" #include "ft/ft-status.h" @@ -128,24 +129,24 @@ void CACHETABLE_STATUS_S::init() { CT_STATUS_INIT(CT_LONG_WAIT_PRESSURE_COUNT, CACHETABLE_LONG_WAIT_PRESSURE_COUNT, UINT64, "number of long waits on cache pressure"); CT_STATUS_INIT(CT_LONG_WAIT_PRESSURE_TIME, CACHETABLE_LONG_WAIT_PRESSURE_TIME, UINT64, "long time waiting on cache pressure"); - CT_STATUS_INIT(CT_POOL_CLIENT_NUM_THREADS, CACHETABLE_POOL_CLIENT_NUM_THREADS, UINT64, "number of threads in pool"); - CT_STATUS_INIT(CT_POOL_CLIENT_NUM_THREADS_ACTIVE, CACHETABLE_POOL_CLIENT_NUM_THREADS_ACTIVE, UINT64, "number of currently active threads in pool"); - CT_STATUS_INIT(CT_POOL_CLIENT_QUEUE_SIZE, CACHETABLE_POOL_CLIENT_QUEUE_SIZE, UINT64, "number of currently queued work items"); - CT_STATUS_INIT(CT_POOL_CLIENT_MAX_QUEUE_SIZE, CACHETABLE_POOL_CLIENT_MAX_QUEUE_SIZE, UINT64, "largest number of queued work items"); - CT_STATUS_INIT(CT_POOL_CLIENT_TOTAL_ITEMS_PROCESSED, CACHETABLE_POOL_CLIENT_TOTAL_ITEMS_PROCESSED, UINT64, "total number of work items processed"); - CT_STATUS_INIT(CT_POOL_CLIENT_TOTAL_EXECUTION_TIME, CACHETABLE_POOL_CLIENT_TOTAL_EXECUTION_TIME, UINT64, "total execution time of processing work items"); - CT_STATUS_INIT(CT_POOL_CACHETABLE_NUM_THREADS, CACHETABLE_POOL_CACHETABLE_NUM_THREADS, UINT64, "number of threads in pool"); - CT_STATUS_INIT(CT_POOL_CACHETABLE_NUM_THREADS_ACTIVE, CACHETABLE_POOL_CACHETABLE_NUM_THREADS_ACTIVE, UINT64, "number of currently active threads in pool"); - CT_STATUS_INIT(CT_POOL_CACHETABLE_QUEUE_SIZE, CACHETABLE_POOL_CACHETABLE_QUEUE_SIZE, UINT64, "number of currently queued work items"); - CT_STATUS_INIT(CT_POOL_CACHETABLE_MAX_QUEUE_SIZE, CACHETABLE_POOL_CACHETABLE_MAX_QUEUE_SIZE, UINT64, "largest number of queued work items"); - CT_STATUS_INIT(CT_POOL_CACHETABLE_TOTAL_ITEMS_PROCESSED, CACHETABLE_POOL_CACHETABLE_TOTAL_ITEMS_PROCESSED, UINT64, "total number of work items processed"); - CT_STATUS_INIT(CT_POOL_CACHETABLE_TOTAL_EXECUTION_TIME, CACHETABLE_POOL_CACHETABLE_TOTAL_EXECUTION_TIME, UINT64, "total execution time of processing work items"); - CT_STATUS_INIT(CT_POOL_CHECKPOINT_NUM_THREADS, CACHETABLE_POOL_CHECKPOINT_NUM_THREADS, UINT64, "number of threads in pool"); - CT_STATUS_INIT(CT_POOL_CHECKPOINT_NUM_THREADS_ACTIVE, CACHETABLE_POOL_CHECKPOINT_NUM_THREADS_ACTIVE, UINT64, "number of currently active threads in pool"); - CT_STATUS_INIT(CT_POOL_CHECKPOINT_QUEUE_SIZE, CACHETABLE_POOL_CHECKPOINT_QUEUE_SIZE, UINT64, "number of currently queued work items"); - CT_STATUS_INIT(CT_POOL_CHECKPOINT_MAX_QUEUE_SIZE, CACHETABLE_POOL_CHECKPOINT_MAX_QUEUE_SIZE, UINT64, "largest number of queued work items"); - CT_STATUS_INIT(CT_POOL_CHECKPOINT_TOTAL_ITEMS_PROCESSED, CACHETABLE_POOL_CHECKPOINT_TOTAL_ITEMS_PROCESSED, UINT64, "total number of work items processed"); - CT_STATUS_INIT(CT_POOL_CHECKPOINT_TOTAL_EXECUTION_TIME, CACHETABLE_POOL_CHECKPOINT_TOTAL_EXECUTION_TIME, UINT64, "total execution time of processing work items"); + CT_STATUS_INIT(CT_POOL_CLIENT_NUM_THREADS, CACHETABLE_POOL_CLIENT_NUM_THREADS, UINT64, "client pool: number of threads in pool"); + CT_STATUS_INIT(CT_POOL_CLIENT_NUM_THREADS_ACTIVE, CACHETABLE_POOL_CLIENT_NUM_THREADS_ACTIVE, UINT64, "client pool: number of currently active threads in pool"); + CT_STATUS_INIT(CT_POOL_CLIENT_QUEUE_SIZE, CACHETABLE_POOL_CLIENT_QUEUE_SIZE, UINT64, "client pool: number of currently queued work items"); + CT_STATUS_INIT(CT_POOL_CLIENT_MAX_QUEUE_SIZE, CACHETABLE_POOL_CLIENT_MAX_QUEUE_SIZE, UINT64, "client pool: largest number of queued work items"); + CT_STATUS_INIT(CT_POOL_CLIENT_TOTAL_ITEMS_PROCESSED, CACHETABLE_POOL_CLIENT_TOTAL_ITEMS_PROCESSED, UINT64, "client pool: total number of work items processed"); + CT_STATUS_INIT(CT_POOL_CLIENT_TOTAL_EXECUTION_TIME, CACHETABLE_POOL_CLIENT_TOTAL_EXECUTION_TIME, UINT64, "client pool: total execution time of processing work items"); + CT_STATUS_INIT(CT_POOL_CACHETABLE_NUM_THREADS, CACHETABLE_POOL_CACHETABLE_NUM_THREADS, UINT64, "cachetable pool: number of threads in pool"); + CT_STATUS_INIT(CT_POOL_CACHETABLE_NUM_THREADS_ACTIVE, CACHETABLE_POOL_CACHETABLE_NUM_THREADS_ACTIVE, UINT64, "cachetable pool: number of currently active threads in pool"); + CT_STATUS_INIT(CT_POOL_CACHETABLE_QUEUE_SIZE, CACHETABLE_POOL_CACHETABLE_QUEUE_SIZE, UINT64, "cachetable pool: number of currently queued work items"); + CT_STATUS_INIT(CT_POOL_CACHETABLE_MAX_QUEUE_SIZE, CACHETABLE_POOL_CACHETABLE_MAX_QUEUE_SIZE, UINT64, "cachetable pool: largest number of queued work items"); + CT_STATUS_INIT(CT_POOL_CACHETABLE_TOTAL_ITEMS_PROCESSED, CACHETABLE_POOL_CACHETABLE_TOTAL_ITEMS_PROCESSED, UINT64, "cachetable pool: total number of work items processed"); + CT_STATUS_INIT(CT_POOL_CACHETABLE_TOTAL_EXECUTION_TIME, CACHETABLE_POOL_CACHETABLE_TOTAL_EXECUTION_TIME, UINT64, "cachetable pool: total execution time of processing work items"); + CT_STATUS_INIT(CT_POOL_CHECKPOINT_NUM_THREADS, CACHETABLE_POOL_CHECKPOINT_NUM_THREADS, UINT64, "checkpoint pool: number of threads in pool"); + CT_STATUS_INIT(CT_POOL_CHECKPOINT_NUM_THREADS_ACTIVE, CACHETABLE_POOL_CHECKPOINT_NUM_THREADS_ACTIVE, UINT64, "checkpoint pool: number of currently active threads in pool"); + CT_STATUS_INIT(CT_POOL_CHECKPOINT_QUEUE_SIZE, CACHETABLE_POOL_CHECKPOINT_QUEUE_SIZE, UINT64, "checkpoint pool: number of currently queued work items"); + CT_STATUS_INIT(CT_POOL_CHECKPOINT_MAX_QUEUE_SIZE, CACHETABLE_POOL_CHECKPOINT_MAX_QUEUE_SIZE, UINT64, "checkpoint pool: largest number of queued work items"); + CT_STATUS_INIT(CT_POOL_CHECKPOINT_TOTAL_ITEMS_PROCESSED, CACHETABLE_POOL_CHECKPOINT_TOTAL_ITEMS_PROCESSED, UINT64, "checkpoint pool: total number of work items processed"); + CT_STATUS_INIT(CT_POOL_CHECKPOINT_TOTAL_EXECUTION_TIME, CACHETABLE_POOL_CHECKPOINT_TOTAL_EXECUTION_TIME, UINT64, "checkpoint pool: total execution time of processing work items"); m_initialized = true; #undef CT_STATUS_INIT diff --git a/storage/tokudb/PerconaFT/ft/ft-test-helpers.cc b/storage/tokudb/PerconaFT/ft/ft-test-helpers.cc index 7ca36c23780..7cd896a5bf4 100644 --- a/storage/tokudb/PerconaFT/ft/ft-test-helpers.cc +++ b/storage/tokudb/PerconaFT/ft/ft-test-helpers.cc @@ -36,6 +36,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." +#include #include "ft/ft.h" #include "ft/ft-cachetable-wrappers.h" #include "ft/ft-internal.h" @@ -172,21 +173,26 @@ int toku_testsetup_insert_to_leaf (FT_HANDLE ft_handle, BLOCKNUM blocknum, const assert(node->height==0); DBT kdbt, vdbt; - ft_msg msg(toku_fill_dbt(&kdbt, key, keylen), toku_fill_dbt(&vdbt, val, vallen), - FT_INSERT, next_dummymsn(), toku_xids_get_root_xids()); + ft_msg msg( + toku_fill_dbt(&kdbt, key, keylen), + toku_fill_dbt(&vdbt, val, vallen), + FT_INSERT, + next_dummymsn(), + toku_xids_get_root_xids()); static size_t zero_flow_deltas[] = { 0, 0 }; txn_gc_info gc_info(nullptr, TXNID_NONE, TXNID_NONE, true); - toku_ftnode_put_msg(ft_handle->ft->cmp, - ft_handle->ft->update_fun, - node, - -1, - msg, - true, - &gc_info, - zero_flow_deltas, - NULL - ); + toku_ftnode_put_msg( + ft_handle->ft->cmp, + ft_handle->ft->update_fun, + node, + -1, + msg, + true, + &gc_info, + zero_flow_deltas, + NULL, + NULL); toku_verify_or_set_counts(node); diff --git a/storage/tokudb/PerconaFT/ft/ft-verify.cc b/storage/tokudb/PerconaFT/ft/ft-verify.cc index a2835f730eb..7e3a64f441e 100644 --- a/storage/tokudb/PerconaFT/ft/ft-verify.cc +++ b/storage/tokudb/PerconaFT/ft/ft-verify.cc @@ -44,6 +44,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. * For each nonleaf node: All the messages have keys that are between the associated pivot keys ( left_pivot_key < message <= right_pivot_key) */ +#include #include "ft/serialize/block_table.h" #include "ft/ft.h" #include "ft/ft-cachetable-wrappers.h" diff --git a/storage/tokudb/PerconaFT/ft/ft.cc b/storage/tokudb/PerconaFT/ft/ft.cc index 2a0fb6f6800..c9a11182b74 100644 --- a/storage/tokudb/PerconaFT/ft/ft.cc +++ b/storage/tokudb/PerconaFT/ft/ft.cc @@ -36,6 +36,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." +#include #include "ft/serialize/block_table.h" #include "ft/ft.h" #include "ft/ft-cachetable-wrappers.h" @@ -198,6 +199,8 @@ static void ft_checkpoint (CACHEFILE cf, int fd, void *header_v) { ch->time_of_last_modification = now; ch->checkpoint_count++; ft_hack_highest_unused_msn_for_upgrade_for_checkpoint(ft); + ch->on_disk_logical_rows = + ft->h->on_disk_logical_rows = ft->in_memory_logical_rows; // write translation and header to disk (or at least to OS internal buffer) toku_serialize_ft_to(fd, ch, &ft->blocktable, ft->cf); @@ -383,7 +386,8 @@ ft_header_create(FT_OPTIONS options, BLOCKNUM root_blocknum, TXNID root_xid_that .count_of_optimize_in_progress = 0, .count_of_optimize_in_progress_read_from_disk = 0, .msn_at_start_of_last_completed_optimize = ZERO_MSN, - .on_disk_stats = ZEROSTATS + .on_disk_stats = ZEROSTATS, + .on_disk_logical_rows = 0 }; return (FT_HEADER) toku_xmemdup(&h, sizeof h); } @@ -802,7 +806,14 @@ toku_ft_stat64 (FT ft, struct ftstat64_s *s) { s->fsize = toku_cachefile_size(ft->cf); // just use the in memory stats from the header // prevent appearance of negative numbers for numrows, numbytes - int64_t n = ft->in_memory_stats.numrows; + // if the logical count was never properly re-counted on an upgrade, + // return the existing physical count instead. + int64_t n; + if (ft->in_memory_logical_rows == (uint64_t)-1) { + n = ft->in_memory_stats.numrows; + } else { + n = ft->in_memory_logical_rows; + } if (n < 0) { n = 0; } @@ -871,20 +882,38 @@ DESCRIPTOR toku_ft_get_cmp_descriptor(FT_HANDLE ft_handle) { return &ft_handle->ft->cmp_descriptor; } -void -toku_ft_update_stats(STAT64INFO headerstats, STAT64INFO_S delta) { +void toku_ft_update_stats(STAT64INFO headerstats, STAT64INFO_S delta) { (void) toku_sync_fetch_and_add(&(headerstats->numrows), delta.numrows); (void) toku_sync_fetch_and_add(&(headerstats->numbytes), delta.numbytes); } -void -toku_ft_decrease_stats(STAT64INFO headerstats, STAT64INFO_S delta) { +void toku_ft_decrease_stats(STAT64INFO headerstats, STAT64INFO_S delta) { (void) toku_sync_fetch_and_sub(&(headerstats->numrows), delta.numrows); (void) toku_sync_fetch_and_sub(&(headerstats->numbytes), delta.numbytes); } -void -toku_ft_remove_reference(FT ft, bool oplsn_valid, LSN oplsn, remove_ft_ref_callback remove_ref, void *extra) { +void toku_ft_adjust_logical_row_count(FT ft, int64_t delta) { + // In order to make sure that the correct count is returned from + // toku_ft_stat64, the ft->(in_memory|on_disk)_logical_rows _MUST_NOT_ be + // modified from anywhere else from here with the exceptions of + // serializing in a header, initializing a new header and analyzing + // an index for a logical_row count. + // The gist is that on an index upgrade, all logical_rows values + // in the ft header are set to -1 until an analyze can reset it to an + // accurate value. Until then, the physical count from in_memory_stats + // must be returned in toku_ft_stat64. + if (delta != 0 && ft->in_memory_logical_rows != (uint64_t)-1) { + toku_sync_fetch_and_add(&(ft->in_memory_logical_rows), delta); + } +} + +void toku_ft_remove_reference( + FT ft, + bool oplsn_valid, + LSN oplsn, + remove_ft_ref_callback remove_ref, + void *extra) { + toku_ft_grab_reflock(ft); if (toku_ft_has_one_reference_unlocked(ft)) { toku_ft_release_reflock(ft); diff --git a/storage/tokudb/PerconaFT/ft/ft.h b/storage/tokudb/PerconaFT/ft/ft.h index cc64bdfc6d3..d600e093bdc 100644 --- a/storage/tokudb/PerconaFT/ft/ft.h +++ b/storage/tokudb/PerconaFT/ft/ft.h @@ -127,13 +127,17 @@ DESCRIPTOR toku_ft_get_cmp_descriptor(FT_HANDLE ft_handle); typedef struct { // delta versions in basements could be negative + // These represent the physical leaf entries and do not account + // for pending deletes or other in-flight messages that have not been + // applied to a leaf entry. int64_t numrows; int64_t numbytes; } STAT64INFO_S, *STAT64INFO; -static const STAT64INFO_S ZEROSTATS = { .numrows = 0, .numbytes = 0}; +static const STAT64INFO_S ZEROSTATS = { .numrows = 0, .numbytes = 0 }; void toku_ft_update_stats(STAT64INFO headerstats, STAT64INFO_S delta); void toku_ft_decrease_stats(STAT64INFO headerstats, STAT64INFO_S delta); +void toku_ft_adjust_logical_row_count(FT ft, int64_t delta); typedef void (*remove_ft_ref_callback)(FT ft, void *extra); void toku_ft_remove_reference(FT ft, diff --git a/storage/tokudb/PerconaFT/ft/le-cursor.cc b/storage/tokudb/PerconaFT/ft/le-cursor.cc index 81d0d3694a4..b90d48dc5ba 100644 --- a/storage/tokudb/PerconaFT/ft/le-cursor.cc +++ b/storage/tokudb/PerconaFT/ft/le-cursor.cc @@ -36,6 +36,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." +#include #include "ft/ft.h" #include "ft/ft-internal.h" #include "ft/le-cursor.h" diff --git a/storage/tokudb/PerconaFT/ft/leafentry.cc b/storage/tokudb/PerconaFT/ft/leafentry.cc index 56ce0c9d945..fcb9a344e27 100644 --- a/storage/tokudb/PerconaFT/ft/leafentry.cc +++ b/storage/tokudb/PerconaFT/ft/leafentry.cc @@ -36,6 +36,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." +#include #include "serialize/wbuf.h" #include "leafentry.h" diff --git a/storage/tokudb/PerconaFT/ft/leafentry.h b/storage/tokudb/PerconaFT/ft/leafentry.h index 9cb81ef7cd6..7274a1480e2 100644 --- a/storage/tokudb/PerconaFT/ft/leafentry.h +++ b/storage/tokudb/PerconaFT/ft/leafentry.h @@ -180,43 +180,57 @@ uint64_t le_outermost_uncommitted_xid (LEAFENTRY le); // r|r!=0&&r!=TOKUDB_ACCEPT: Quit early, return r, because something unexpected went wrong (error case) typedef int(*LE_ITERATE_CALLBACK)(TXNID id, TOKUTXN context, bool is_provisional); -int le_iterate_val(LEAFENTRY le, LE_ITERATE_CALLBACK f, void** valpp, uint32_t *vallenp, TOKUTXN context); +int le_iterate_val( + LEAFENTRY le, + LE_ITERATE_CALLBACK f, + void** valpp, + uint32_t* vallenp, + TOKUTXN context); -void le_extract_val(LEAFENTRY le, - // should we return the entire leafentry as the val? - bool is_leaf_mode, enum cursor_read_type read_type, - TOKUTXN ttxn, uint32_t *vallen, void **val); +void le_extract_val( + LEAFENTRY le, + // should we return the entire leafentry as the val? + bool is_leaf_mode, + enum cursor_read_type read_type, + TOKUTXN ttxn, + uint32_t* vallen, + void** val); -size_t -leafentry_disksize_13(LEAFENTRY_13 le); +size_t leafentry_disksize_13(LEAFENTRY_13 le); -int -toku_le_upgrade_13_14(LEAFENTRY_13 old_leafentry, // NULL if there was no stored data. - void** keyp, - uint32_t* keylen, - size_t *new_leafentry_memorysize, - LEAFENTRY *new_leafentry_p); +int toku_le_upgrade_13_14( + // NULL if there was no stored data. + LEAFENTRY_13 old_leafentry, + void** keyp, + uint32_t* keylen, + size_t* new_leafentry_memorysize, + LEAFENTRY *new_leafentry_p); class bn_data; -void -toku_le_apply_msg(const ft_msg &msg, - LEAFENTRY old_leafentry, // NULL if there was no stored data. - bn_data* data_buffer, // bn_data storing leafentry, if NULL, means there is no bn_data - uint32_t idx, // index in data_buffer where leafentry is stored (and should be replaced - uint32_t old_keylen, - txn_gc_info *gc_info, - LEAFENTRY *new_leafentry_p, - int64_t * numbytes_delta_p); +int64_t toku_le_apply_msg( + const ft_msg &msg, + // NULL if there was no stored data. + LEAFENTRY old_leafentry, + // bn_data storing leafentry, if NULL, means there is no bn_data + bn_data* data_buffer, + // index in data_buffer where leafentry is stored (and should be replaced + uint32_t idx, + uint32_t old_keylen, + txn_gc_info* gc_info, + LEAFENTRY *new_leafentry_p, + int64_t* numbytes_delta_p); -bool toku_le_worth_running_garbage_collection(LEAFENTRY le, txn_gc_info *gc_info); +bool toku_le_worth_running_garbage_collection( + LEAFENTRY le, + txn_gc_info* gc_info); -void -toku_le_garbage_collect(LEAFENTRY old_leaf_entry, - bn_data* data_buffer, - uint32_t idx, - void* keyp, - uint32_t keylen, - txn_gc_info *gc_info, - LEAFENTRY *new_leaf_entry, - int64_t * numbytes_delta_p); +void toku_le_garbage_collect( + LEAFENTRY old_leaf_entry, + bn_data* data_buffer, + uint32_t idx, + void* keyp, + uint32_t keylen, + txn_gc_info* gc_info, + LEAFENTRY* new_leaf_entry, + int64_t* numbytes_delta_p); diff --git a/storage/tokudb/PerconaFT/ft/loader/dbufio.cc b/storage/tokudb/PerconaFT/ft/loader/dbufio.cc index 28d8d49ba9f..64722bd68f1 100644 --- a/storage/tokudb/PerconaFT/ft/loader/dbufio.cc +++ b/storage/tokudb/PerconaFT/ft/loader/dbufio.cc @@ -36,6 +36,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." +#include #include #include #include @@ -135,7 +136,7 @@ static ssize_t dbf_read_some_compressed(struct dbufio_file *dbf, char *buf, size ret = 0; goto exit; } - if (readcode < header_size) { + if (readcode < (ssize_t) header_size) { errno = TOKUDB_NO_DATA; ret = -1; goto exit; @@ -163,7 +164,7 @@ static ssize_t dbf_read_some_compressed(struct dbufio_file *dbf, char *buf, size ret = -1; goto exit; } - if (readcode < total_size) { + if (readcode < (ssize_t) total_size) { errno = TOKUDB_NO_DATA; ret = -1; goto exit; diff --git a/storage/tokudb/PerconaFT/ft/loader/loader.cc b/storage/tokudb/PerconaFT/ft/loader/loader.cc index 5ff0d69af46..3028aa3d524 100644 --- a/storage/tokudb/PerconaFT/ft/loader/loader.cc +++ b/storage/tokudb/PerconaFT/ft/loader/loader.cc @@ -36,6 +36,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." +#include #include #include @@ -2312,11 +2313,42 @@ static struct leaf_buf *start_leaf (struct dbout *out, const DESCRIPTOR UU(desc) return lbuf; } -static void finish_leafnode (struct dbout *out, struct leaf_buf *lbuf, int progress_allocation, FTLOADER bl, uint32_t target_basementnodesize, enum toku_compression_method target_compression_method); -static int write_nonleaves (FTLOADER bl, FIDX pivots_fidx, struct dbout *out, struct subtrees_info *sts, const DESCRIPTOR descriptor, uint32_t target_nodesize, uint32_t target_basementnodesize, enum toku_compression_method target_compression_method); -static void add_pair_to_leafnode (struct leaf_buf *lbuf, unsigned char *key, int keylen, unsigned char *val, int vallen, int this_leafentry_size, STAT64INFO stats_to_update); -static int write_translation_table (struct dbout *out, long long *off_of_translation_p); -static int write_header (struct dbout *out, long long translation_location_on_disk, long long translation_size_on_disk); +static void finish_leafnode( + struct dbout* out, + struct leaf_buf* lbuf, + int progress_allocation, + FTLOADER bl, + uint32_t target_basementnodesize, + enum toku_compression_method target_compression_method); + +static int write_nonleaves( + FTLOADER bl, + FIDX pivots_fidx, + struct dbout* out, + struct subtrees_info* sts, + const DESCRIPTOR descriptor, + uint32_t target_nodesize, + uint32_t target_basementnodesize, + enum toku_compression_method target_compression_method); + +static void add_pair_to_leafnode( + struct leaf_buf* lbuf, + unsigned char* key, + int keylen, + unsigned char* val, + int vallen, + int this_leafentry_size, + STAT64INFO stats_to_update, + int64_t* logical_rows_delta); + +static int write_translation_table( + struct dbout* out, + long long* off_of_translation_p); + +static int write_header( + struct dbout* out, + long long translation_location_on_disk, + long long translation_size_on_disk); static void drain_writer_q(QUEUE q) { void *item; @@ -2448,6 +2480,12 @@ static int toku_loader_write_ft_from_q (FTLOADER bl, DBT maxkey = make_dbt(0, 0); // keep track of the max key of the current node STAT64INFO_S deltas = ZEROSTATS; + // This is just a placeholder and not used in the loader, the real/accurate + // stats will come out of 'deltas' because this loader is not pushing + // messages down into the top of a fractal tree where the logical row count + // is done, it is directly creating leaf entries so it must also take on + // performing the logical row counting on its own + int64_t logical_rows_delta = 0; while (result == 0) { void *item; { @@ -2506,7 +2544,15 @@ static int toku_loader_write_ft_from_q (FTLOADER bl, lbuf = start_leaf(&out, descriptor, lblock, le_xid, target_nodesize); } - add_pair_to_leafnode(lbuf, (unsigned char *) key.data, key.size, (unsigned char *) val.data, val.size, this_leafentry_size, &deltas); + add_pair_to_leafnode( + lbuf, + (unsigned char*)key.data, + key.size, + (unsigned char*)val.data, + val.size, + this_leafentry_size, + &deltas, + &logical_rows_delta); n_rows_remaining--; update_maxkey(&maxkey, &key); // set the new maxkey to the current key @@ -2526,6 +2572,13 @@ static int toku_loader_write_ft_from_q (FTLOADER bl, toku_ft_update_stats(&ft.in_memory_stats, deltas); } + // As noted above, the loader directly creates a tree structure without + // going through the higher level ft API and tus bypasses the logical row + // counting performed at that level. So, we must manually update the logical + // row count with the info we have from the physical delta that comes out of + // add_pair_to_leafnode. + toku_ft_adjust_logical_row_count(&ft, deltas.numrows); + cleanup_maxkey(&maxkey); if (lbuf) { @@ -2878,7 +2931,16 @@ int toku_ft_loader_get_error(FTLOADER bl, int *error) { return 0; } -static void add_pair_to_leafnode (struct leaf_buf *lbuf, unsigned char *key, int keylen, unsigned char *val, int vallen, int this_leafentry_size, STAT64INFO stats_to_update) { +static void add_pair_to_leafnode( + struct leaf_buf* lbuf, + unsigned char* key, + int keylen, + unsigned char* val, + int vallen, + int this_leafentry_size, + STAT64INFO stats_to_update, + int64_t* logical_rows_delta) { + lbuf->nkeys++; lbuf->ndata++; lbuf->dsize += keylen + vallen; @@ -2890,11 +2952,25 @@ static void add_pair_to_leafnode (struct leaf_buf *lbuf, unsigned char *key, int FTNODE leafnode = lbuf->node; uint32_t idx = BLB_DATA(leafnode, 0)->num_klpairs(); DBT kdbt, vdbt; - ft_msg msg(toku_fill_dbt(&kdbt, key, keylen), toku_fill_dbt(&vdbt, val, vallen), FT_INSERT, ZERO_MSN, lbuf->xids); + ft_msg msg( + toku_fill_dbt(&kdbt, key, keylen), + toku_fill_dbt(&vdbt, val, vallen), + FT_INSERT, + ZERO_MSN, + lbuf->xids); uint64_t workdone = 0; // there's no mvcc garbage in a bulk-loaded FT, so there's no need to pass useful gc info txn_gc_info gc_info(nullptr, TXNID_NONE, TXNID_NONE, true); - toku_ft_bn_apply_msg_once(BLB(leafnode,0), msg, idx, keylen, NULL, &gc_info, &workdone, stats_to_update); + toku_ft_bn_apply_msg_once( + BLB(leafnode, 0), + msg, + idx, + keylen, + NULL, + &gc_info, + &workdone, + stats_to_update, + logical_rows_delta); } static int write_literal(struct dbout *out, void*data, size_t len) { @@ -2905,7 +2981,14 @@ static int write_literal(struct dbout *out, void*data, size_t len) { return result; } -static void finish_leafnode (struct dbout *out, struct leaf_buf *lbuf, int progress_allocation, FTLOADER bl, uint32_t target_basementnodesize, enum toku_compression_method target_compression_method) { +static void finish_leafnode( + struct dbout* out, + struct leaf_buf* lbuf, + int progress_allocation, + FTLOADER bl, + uint32_t target_basementnodesize, + enum toku_compression_method target_compression_method) { + int result = 0; // serialize leaf to buffer @@ -2913,7 +2996,16 @@ static void finish_leafnode (struct dbout *out, struct leaf_buf *lbuf, int progr size_t uncompressed_serialized_leaf_size = 0; char *serialized_leaf = NULL; FTNODE_DISK_DATA ndd = NULL; - result = toku_serialize_ftnode_to_memory(lbuf->node, &ndd, target_basementnodesize, target_compression_method, true, true, &serialized_leaf_size, &uncompressed_serialized_leaf_size, &serialized_leaf); + result = toku_serialize_ftnode_to_memory( + lbuf->node, + &ndd, + target_basementnodesize, + target_compression_method, + true, + true, + &serialized_leaf_size, + &uncompressed_serialized_leaf_size, + &serialized_leaf); // write it out if (result == 0) { @@ -2979,8 +3071,11 @@ static int write_translation_table (struct dbout *out, long long *off_of_transla return result; } -static int -write_header (struct dbout *out, long long translation_location_on_disk, long long translation_size_on_disk) { +static int write_header( + struct dbout* out, + long long translation_location_on_disk, + long long translation_size_on_disk) { + int result = 0; size_t size = toku_serialize_ft_size(out->ft->h); size_t alloced_size = roundup_to_multiple(512, size); @@ -2991,6 +3086,7 @@ write_header (struct dbout *out, long long translation_location_on_disk, long lo } else { wbuf_init(&wbuf, buf, size); out->ft->h->on_disk_stats = out->ft->in_memory_stats; + out->ft->h->on_disk_logical_rows = out->ft->in_memory_logical_rows; toku_serialize_ft_to_wbuf(&wbuf, out->ft->h, translation_location_on_disk, translation_size_on_disk); for (size_t i=size; i #include #include "toku_os.h" #include "ft-internal.h" diff --git a/storage/tokudb/PerconaFT/ft/logger/log_upgrade.cc b/storage/tokudb/PerconaFT/ft/logger/log_upgrade.cc index 6dca8c25378..3da9706359b 100644 --- a/storage/tokudb/PerconaFT/ft/logger/log_upgrade.cc +++ b/storage/tokudb/PerconaFT/ft/logger/log_upgrade.cc @@ -36,6 +36,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." +#include #include #include "log-internal.h" @@ -265,8 +266,9 @@ toku_maybe_upgrade_log(const char *env_dir, const char *log_dir, LSN * lsn_of_cl TXNID last_xid = TXNID_NONE; r = verify_clean_shutdown_of_log_version(log_dir, version_of_logs_on_disk, &last_lsn, &last_xid); if (r != 0) { - if (TOKU_LOG_VERSION_25 <= version_of_logs_on_disk && version_of_logs_on_disk <= TOKU_LOG_VERSION_27 - && TOKU_LOG_VERSION_28 == TOKU_LOG_VERSION) { + if (version_of_logs_on_disk >= TOKU_LOG_VERSION_25 && + version_of_logs_on_disk <= TOKU_LOG_VERSION_29 && + TOKU_LOG_VERSION_29 == TOKU_LOG_VERSION) { r = 0; // can do recovery on dirty shutdown } else { fprintf(stderr, "Cannot upgrade PerconaFT version %d database.", version_of_logs_on_disk); diff --git a/storage/tokudb/PerconaFT/ft/logger/logcursor.cc b/storage/tokudb/PerconaFT/ft/logger/logcursor.cc index f13419ae43e..910a608cef9 100644 --- a/storage/tokudb/PerconaFT/ft/logger/logcursor.cc +++ b/storage/tokudb/PerconaFT/ft/logger/logcursor.cc @@ -36,6 +36,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." +#include #include "log-internal.h" #include "logger/logcursor.h" #include diff --git a/storage/tokudb/PerconaFT/ft/logger/logfilemgr.cc b/storage/tokudb/PerconaFT/ft/logger/logfilemgr.cc index af8eb19d770..e9028f49daf 100644 --- a/storage/tokudb/PerconaFT/ft/logger/logfilemgr.cc +++ b/storage/tokudb/PerconaFT/ft/logger/logfilemgr.cc @@ -36,6 +36,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." +#include #include "logger/log-internal.h" #include "logger/logcursor.h" #include "logger/logfilemgr.h" diff --git a/storage/tokudb/PerconaFT/ft/logger/logger.cc b/storage/tokudb/PerconaFT/ft/logger/logger.cc index eacec9cb83f..d6d1673b5e3 100644 --- a/storage/tokudb/PerconaFT/ft/logger/logger.cc +++ b/storage/tokudb/PerconaFT/ft/logger/logger.cc @@ -36,6 +36,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." +#include #include #include #include diff --git a/storage/tokudb/PerconaFT/ft/logger/logger.h b/storage/tokudb/PerconaFT/ft/logger/logger.h index 1f15f59fb3f..d9595d71065 100644 --- a/storage/tokudb/PerconaFT/ft/logger/logger.h +++ b/storage/tokudb/PerconaFT/ft/logger/logger.h @@ -54,6 +54,7 @@ enum { TOKU_LOG_VERSION_26 = 26, // no change from 25 TOKU_LOG_VERSION_27 = 27, // no change from 26 TOKU_LOG_VERSION_28 = 28, // no change from 27 + TOKU_LOG_VERSION_29 = 29, // no change from 28 TOKU_LOG_VERSION = FT_LAYOUT_VERSION, TOKU_LOG_MIN_SUPPORTED_VERSION = FT_LAYOUT_MIN_SUPPORTED_VERSION, }; diff --git a/storage/tokudb/PerconaFT/ft/logger/recover.cc b/storage/tokudb/PerconaFT/ft/logger/recover.cc index 38f29773bd6..77eee8630a9 100644 --- a/storage/tokudb/PerconaFT/ft/logger/recover.cc +++ b/storage/tokudb/PerconaFT/ft/logger/recover.cc @@ -36,6 +36,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." +#include #include "ft/cachetable/cachetable.h" #include "ft/cachetable/checkpoint.h" #include "ft/ft.h" diff --git a/storage/tokudb/PerconaFT/ft/logger/recover.h b/storage/tokudb/PerconaFT/ft/logger/recover.h index 0d216c11a8b..bdd44d562cd 100644 --- a/storage/tokudb/PerconaFT/ft/logger/recover.h +++ b/storage/tokudb/PerconaFT/ft/logger/recover.h @@ -67,7 +67,7 @@ int tokuft_recover(DB_ENV *env, // Effect: Check the tokuft logs to determine whether or not we need to run recovery. // If the log is empty or if there is a clean shutdown at the end of the log, then we -// dont need to run recovery. +// don't need to run recovery. // Returns: true if we need recovery, otherwise false. int tokuft_needs_recovery(const char *logdir, bool ignore_empty_log); diff --git a/storage/tokudb/PerconaFT/ft/msg.cc b/storage/tokudb/PerconaFT/ft/msg.cc index f4f2c747734..b53b946b241 100644 --- a/storage/tokudb/PerconaFT/ft/msg.cc +++ b/storage/tokudb/PerconaFT/ft/msg.cc @@ -36,6 +36,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." +#include #include "portability/toku_portability.h" #include "ft/msg.h" diff --git a/storage/tokudb/PerconaFT/ft/node.cc b/storage/tokudb/PerconaFT/ft/node.cc index 44dbc73ba2b..928b046bce1 100644 --- a/storage/tokudb/PerconaFT/ft/node.cc +++ b/storage/tokudb/PerconaFT/ft/node.cc @@ -35,6 +35,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." +#include #include "ft/ft.h" #include "ft/ft-internal.h" #include "ft/serialize/ft_node-serialize.h" @@ -206,12 +207,20 @@ int msg_buffer_offset_msn_cmp(message_buffer &msg_buffer, const int32_t &ao, con } /** - * Given a message buffer and and offset, apply the message with toku_ft_bn_apply_msg, or discard it, + * Given a message buffer and and offset, apply the message with + * toku_ft_bn_apply_msg, or discard it, * based on its MSN and the MSN of the basement node. */ -static void -do_bn_apply_msg(FT_HANDLE ft_handle, BASEMENTNODE bn, message_buffer *msg_buffer, int32_t offset, - txn_gc_info *gc_info, uint64_t *workdone, STAT64INFO stats_to_update) { +static void do_bn_apply_msg( + FT_HANDLE ft_handle, + BASEMENTNODE bn, + message_buffer* msg_buffer, + int32_t offset, + txn_gc_info* gc_info, + uint64_t* workdone, + STAT64INFO stats_to_update, + int64_t* logical_rows_delta) { + DBT k, v; ft_msg msg = msg_buffer->get_message(offset, &k, &v); @@ -227,16 +236,17 @@ do_bn_apply_msg(FT_HANDLE ft_handle, BASEMENTNODE bn, message_buffer *msg_buffer msg, gc_info, workdone, - stats_to_update - ); + stats_to_update, + logical_rows_delta); } else { toku_ft_status_note_msn_discard(); } // We must always mark message as stale since it has been marked // (using omt::iterate_and_mark_range) - // It is possible to call do_bn_apply_msg even when it won't apply the message because - // the node containing it could have been evicted and brought back in. + // It is possible to call do_bn_apply_msg even when it won't apply the + // message because the node containing it could have been evicted and + // brought back in. msg_buffer->set_freshness(offset, false); } @@ -248,12 +258,29 @@ struct iterate_do_bn_apply_msg_extra { txn_gc_info *gc_info; uint64_t *workdone; STAT64INFO stats_to_update; + int64_t *logical_rows_delta; }; -int iterate_do_bn_apply_msg(const int32_t &offset, const uint32_t UU(idx), struct iterate_do_bn_apply_msg_extra *const e) __attribute__((nonnull(3))); -int iterate_do_bn_apply_msg(const int32_t &offset, const uint32_t UU(idx), struct iterate_do_bn_apply_msg_extra *const e) +int iterate_do_bn_apply_msg( + const int32_t &offset, + const uint32_t UU(idx), + struct iterate_do_bn_apply_msg_extra* const e) + __attribute__((nonnull(3))); + +int iterate_do_bn_apply_msg( + const int32_t &offset, + const uint32_t UU(idx), + struct iterate_do_bn_apply_msg_extra* const e) { - do_bn_apply_msg(e->t, e->bn, &e->bnc->msg_buffer, offset, e->gc_info, e->workdone, e->stats_to_update); + do_bn_apply_msg( + e->t, + e->bn, + &e->bnc->msg_buffer, + offset, + e->gc_info, + e->workdone, + e->stats_to_update, + e->logical_rows_delta); return 0; } @@ -354,17 +381,15 @@ find_bounds_within_message_tree( * or plus infinity respectively if they are NULL. Do not mark the node * as dirty (preserve previous state of 'dirty' bit). */ -static void -bnc_apply_messages_to_basement_node( +static void bnc_apply_messages_to_basement_node( FT_HANDLE t, // used for comparison function BASEMENTNODE bn, // where to apply messages FTNODE ancestor, // the ancestor node where we can find messages to apply int childnum, // which child buffer of ancestor contains messages we want const pivot_bounds &bounds, // contains pivot key bounds of this basement node - txn_gc_info *gc_info, - bool* msgs_applied - ) -{ + txn_gc_info* gc_info, + bool* msgs_applied) { + int r; NONLEAF_CHILDINFO bnc = BNC(ancestor, childnum); @@ -372,16 +397,29 @@ bnc_apply_messages_to_basement_node( // apply messages from this buffer STAT64INFO_S stats_delta = {0,0}; uint64_t workdone_this_ancestor = 0; + int64_t logical_rows_delta = 0; uint32_t stale_lbi, stale_ube; if (!bn->stale_ancestor_messages_applied) { - find_bounds_within_message_tree(t->ft->cmp, bnc->stale_message_tree, &bnc->msg_buffer, bounds, &stale_lbi, &stale_ube); + find_bounds_within_message_tree( + t->ft->cmp, + bnc->stale_message_tree, + &bnc->msg_buffer, + bounds, + &stale_lbi, + &stale_ube); } else { stale_lbi = 0; stale_ube = 0; } uint32_t fresh_lbi, fresh_ube; - find_bounds_within_message_tree(t->ft->cmp, bnc->fresh_message_tree, &bnc->msg_buffer, bounds, &fresh_lbi, &fresh_ube); + find_bounds_within_message_tree( + t->ft->cmp, + bnc->fresh_message_tree, + &bnc->msg_buffer, + bounds, + &fresh_lbi, + &fresh_ube); // We now know where all the messages we must apply are, so one of the // following 4 cases will do the application, depending on which of @@ -395,7 +433,9 @@ bnc_apply_messages_to_basement_node( // We have messages in multiple trees, so we grab all // the relevant messages' offsets and sort them by MSN, then apply // them in MSN order. - const int buffer_size = ((stale_ube - stale_lbi) + (fresh_ube - fresh_lbi) + bnc->broadcast_list.size()); + const int buffer_size = ((stale_ube - stale_lbi) + + (fresh_ube - fresh_lbi) + + bnc->broadcast_list.size()); toku::scoped_malloc offsets_buf(buffer_size * sizeof(int32_t)); int32_t *offsets = reinterpret_cast(offsets_buf.get()); struct store_msg_buffer_offset_extra sfo_extra = { .offsets = offsets, .i = 0 }; @@ -419,11 +459,27 @@ bnc_apply_messages_to_basement_node( // Apply the messages in MSN order. for (int i = 0; i < buffer_size; ++i) { *msgs_applied = true; - do_bn_apply_msg(t, bn, &bnc->msg_buffer, offsets[i], gc_info, &workdone_this_ancestor, &stats_delta); + do_bn_apply_msg( + t, + bn, + &bnc->msg_buffer, + offsets[i], + gc_info, + &workdone_this_ancestor, + &stats_delta, + &logical_rows_delta); } } else if (stale_lbi == stale_ube) { // No stale messages to apply, we just apply fresh messages, and mark them to be moved to stale later. - struct iterate_do_bn_apply_msg_extra iter_extra = { .t = t, .bn = bn, .bnc = bnc, .gc_info = gc_info, .workdone = &workdone_this_ancestor, .stats_to_update = &stats_delta }; + struct iterate_do_bn_apply_msg_extra iter_extra = { + .t = t, + .bn = bn, + .bnc = bnc, + .gc_info = gc_info, + .workdone = &workdone_this_ancestor, + .stats_to_update = &stats_delta, + .logical_rows_delta = &logical_rows_delta + }; if (fresh_ube - fresh_lbi > 0) *msgs_applied = true; r = bnc->fresh_message_tree.iterate_and_mark_range(fresh_lbi, fresh_ube, &iter_extra); assert_zero(r); @@ -432,7 +488,15 @@ bnc_apply_messages_to_basement_node( // No fresh messages to apply, we just apply stale messages. if (stale_ube - stale_lbi > 0) *msgs_applied = true; - struct iterate_do_bn_apply_msg_extra iter_extra = { .t = t, .bn = bn, .bnc = bnc, .gc_info = gc_info, .workdone = &workdone_this_ancestor, .stats_to_update = &stats_delta }; + struct iterate_do_bn_apply_msg_extra iter_extra = { + .t = t, + .bn = bn, + .bnc = bnc, + .gc_info = gc_info, + .workdone = &workdone_this_ancestor, + .stats_to_update = &stats_delta, + .logical_rows_delta = &logical_rows_delta + }; r = bnc->stale_message_tree.iterate_on_range(stale_lbi, stale_ube, &iter_extra); assert_zero(r); @@ -446,6 +510,7 @@ bnc_apply_messages_to_basement_node( if (stats_delta.numbytes || stats_delta.numrows) { toku_ft_update_stats(&t->ft->in_memory_stats, stats_delta); } + toku_ft_adjust_logical_row_count(t->ft, logical_rows_delta); } static void @@ -1073,7 +1138,8 @@ toku_ft_bn_apply_msg_once ( LEAFENTRY le, txn_gc_info *gc_info, uint64_t *workdone, - STAT64INFO stats_to_update + STAT64INFO stats_to_update, + int64_t *logical_rows_delta ) // Effect: Apply msg to leafentry (msn is ignored) // Calculate work done by message on leafentry and add it to caller's workdone counter. @@ -1082,26 +1148,34 @@ toku_ft_bn_apply_msg_once ( { size_t newsize=0, oldsize=0, workdone_this_le=0; LEAFENTRY new_le=0; - int64_t numbytes_delta = 0; // how many bytes of user data (not including overhead) were added or deleted from this row - int64_t numrows_delta = 0; // will be +1 or -1 or 0 (if row was added or deleted or not) + // how many bytes of user data (not including overhead) were added or + // deleted from this row + int64_t numbytes_delta = 0; + // will be +1 or -1 or 0 (if row was added or deleted or not) + int64_t numrows_delta = 0; + // will be +1, -1 or 0 if a message that was accounted for logically has + // changed in meaning such as an insert changed to an update or a delete + // changed to a noop + int64_t logical_rows_delta_le = 0; uint32_t key_storage_size = msg.kdbt()->size + sizeof(uint32_t); if (le) { oldsize = leafentry_memsize(le) + key_storage_size; } - // toku_le_apply_msg() may call bn_data::mempool_malloc_and_update_dmt() to allocate more space. - // That means le is guaranteed to not cause a sigsegv but it may point to a mempool that is - // no longer in use. We'll have to release the old mempool later. - toku_le_apply_msg( - msg, + // toku_le_apply_msg() may call bn_data::mempool_malloc_and_update_dmt() + // to allocate more space. That means le is guaranteed to not cause a + // sigsegv but it may point to a mempool that is no longer in use. + // We'll have to release the old mempool later. + logical_rows_delta_le = toku_le_apply_msg( + msg, le, &bn->data_buffer, idx, le_keylen, - gc_info, - &new_le, - &numbytes_delta - ); + gc_info, + &new_le, + &numbytes_delta); + // at this point, we cannot trust cmd->u.id.key to be valid. // The dmt may have realloced its mempool and freed the one containing key. @@ -1121,37 +1195,42 @@ toku_ft_bn_apply_msg_once ( numrows_delta = 1; } } - if (workdone) { // test programs may call with NULL + if (FT_LIKELY(workdone != NULL)) { // test programs may call with NULL *workdone += workdone_this_le; } + if (FT_LIKELY(logical_rows_delta != NULL)) { + *logical_rows_delta += logical_rows_delta_le; + } // now update stat64 statistics bn->stat64_delta.numrows += numrows_delta; bn->stat64_delta.numbytes += numbytes_delta; // the only reason stats_to_update may be null is for tests - if (stats_to_update) { + if (FT_LIKELY(stats_to_update != NULL)) { stats_to_update->numrows += numrows_delta; stats_to_update->numbytes += numbytes_delta; } - } static const uint32_t setval_tag = 0xee0ccb99; // this was gotten by doing "cat /dev/random|head -c4|od -x" to get a random number. We want to make sure that the user actually passes us the setval_extra_s that we passed in. struct setval_extra_s { uint32_t tag; bool did_set_val; - int setval_r; // any error code that setval_fun wants to return goes here. + // any error code that setval_fun wants to return goes here. + int setval_r; // need arguments for toku_ft_bn_apply_msg_once BASEMENTNODE bn; - MSN msn; // captured from original message, not currently used + // captured from original message, not currently used + MSN msn; XIDS xids; - const DBT *key; + const DBT* key; uint32_t idx; uint32_t le_keylen; LEAFENTRY le; - txn_gc_info *gc_info; - uint64_t * workdone; // set by toku_ft_bn_apply_msg_once() + txn_gc_info* gc_info; + uint64_t* workdone; // set by toku_ft_bn_apply_msg_once() STAT64INFO stats_to_update; + int64_t* logical_rows_delta; }; /* @@ -1170,29 +1249,45 @@ static void setval_fun (const DBT *new_val, void *svextra_v) { // can't leave scope until toku_ft_bn_apply_msg_once if // this is a delete DBT val; - ft_msg msg(svextra->key, - new_val ? new_val : toku_init_dbt(&val), - new_val ? FT_INSERT : FT_DELETE_ANY, - svextra->msn, svextra->xids); - toku_ft_bn_apply_msg_once(svextra->bn, msg, - svextra->idx, svextra->le_keylen, svextra->le, - svextra->gc_info, - svextra->workdone, svextra->stats_to_update); + ft_msg msg( + svextra->key, + new_val ? new_val : toku_init_dbt(&val), + new_val ? FT_INSERT : FT_DELETE_ANY, + svextra->msn, + svextra->xids); + toku_ft_bn_apply_msg_once( + svextra->bn, + msg, + svextra->idx, + svextra->le_keylen, + svextra->le, + svextra->gc_info, + svextra->workdone, + svextra->stats_to_update, + svextra->logical_rows_delta); svextra->setval_r = 0; } } -// We are already past the msn filter (in toku_ft_bn_apply_msg(), which calls do_update()), -// so capturing the msn in the setval_extra_s is not strictly required. The alternative -// would be to put a dummy msn in the messages created by setval_fun(), but preserving -// the original msn seems cleaner and it preserves accountability at a lower layer. -static int do_update(ft_update_func update_fun, const DESCRIPTOR_S *desc, BASEMENTNODE bn, const ft_msg &msg, uint32_t idx, - LEAFENTRY le, - void* keydata, - uint32_t keylen, - txn_gc_info *gc_info, - uint64_t * workdone, - STAT64INFO stats_to_update) { +// We are already past the msn filter (in toku_ft_bn_apply_msg(), which calls +// do_update()), so capturing the msn in the setval_extra_s is not strictly +// required. The alternative would be to put a dummy msn in the messages +// created by setval_fun(), but preserving the original msn seems cleaner and +// it preserves accountability at a lower layer. +static int do_update( + ft_update_func update_fun, + const DESCRIPTOR_S* desc, + BASEMENTNODE bn, + const ft_msg &msg, + uint32_t idx, + LEAFENTRY le, + void* keydata, + uint32_t keylen, + txn_gc_info* gc_info, + uint64_t* workdone, + STAT64INFO stats_to_update, + int64_t* logical_rows_delta) { + LEAFENTRY le_for_update; DBT key; const DBT *keyp; @@ -1232,39 +1327,52 @@ static int do_update(ft_update_func update_fun, const DESCRIPTOR_S *desc, BASEME } le_for_update = le; - struct setval_extra_s setval_extra = {setval_tag, false, 0, bn, msg.msn(), msg.xids(), - keyp, idx, keylen, le_for_update, gc_info, - workdone, stats_to_update}; - // call handlerton's ft->update_fun(), which passes setval_extra to setval_fun() + struct setval_extra_s setval_extra = { + setval_tag, + false, + 0, + bn, + msg.msn(), + msg.xids(), + keyp, + idx, + keylen, + le_for_update, + gc_info, + workdone, + stats_to_update, + logical_rows_delta + }; + // call handlerton's ft->update_fun(), which passes setval_extra + // to setval_fun() FAKE_DB(db, desc); int r = update_fun( &db, keyp, vdbtp, update_function_extra, - setval_fun, &setval_extra - ); + setval_fun, + &setval_extra); if (r == 0) { r = setval_extra.setval_r; } return r; } // Should be renamed as something like "apply_msg_to_basement()." -void -toku_ft_bn_apply_msg ( - const toku::comparator &cmp, +void toku_ft_bn_apply_msg( + const toku::comparator& cmp, ft_update_func update_fun, BASEMENTNODE bn, - const ft_msg &msg, - txn_gc_info *gc_info, - uint64_t *workdone, - STAT64INFO stats_to_update - ) + const ft_msg& msg, + txn_gc_info* gc_info, + uint64_t* workdone, + STAT64INFO stats_to_update, + int64_t* logical_rows_delta) { // Effect: // Put a msg into a leaf. -// Calculate work done by message on leafnode and add it to caller's workdone counter. +// Calculate work done by message on leafnode and add it to caller's +// workdone counter. // The leaf could end up "too big" or "too small". The caller must fix that up. -{ LEAFENTRY storeddata; void* key = NULL; uint32_t keylen = 0; @@ -1303,7 +1411,16 @@ toku_ft_bn_apply_msg ( } else { assert_zero(r); } - toku_ft_bn_apply_msg_once(bn, msg, idx, keylen, storeddata, gc_info, workdone, stats_to_update); + toku_ft_bn_apply_msg_once( + bn, + msg, + idx, + keylen, + storeddata, + gc_info, + workdone, + stats_to_update, + logical_rows_delta); // if the insertion point is within a window of the right edge of // the leaf then it is sequential @@ -1331,12 +1448,19 @@ toku_ft_bn_apply_msg ( &storeddata, &key, &keylen, - &idx - ); + &idx); if (r == DB_NOTFOUND) break; assert_zero(r); - toku_ft_bn_apply_msg_once(bn, msg, idx, keylen, storeddata, gc_info, workdone, stats_to_update); - + toku_ft_bn_apply_msg_once( + bn, + msg, + idx, + keylen, + storeddata, + gc_info, + workdone, + stats_to_update, + logical_rows_delta); break; } case FT_OPTIMIZE_FOR_UPGRADE: @@ -1352,13 +1476,27 @@ toku_ft_bn_apply_msg ( assert_zero(r); int deleted = 0; if (!le_is_clean(storeddata)) { //If already clean, nothing to do. - // message application code needs a key in order to determine how much - // work was done by this message. since this is a broadcast message, - // we have to create a new message whose key is the current le's key. + // message application code needs a key in order to determine + // how much work was done by this message. since this is a + // broadcast message, we have to create a new message whose + // key is the current le's key. DBT curr_keydbt; - ft_msg curr_msg(toku_fill_dbt(&curr_keydbt, curr_keyp, curr_keylen), - msg.vdbt(), msg.type(), msg.msn(), msg.xids()); - toku_ft_bn_apply_msg_once(bn, curr_msg, idx, curr_keylen, storeddata, gc_info, workdone, stats_to_update); + ft_msg curr_msg( + toku_fill_dbt(&curr_keydbt, curr_keyp, curr_keylen), + msg.vdbt(), + msg.type(), + msg.msn(), + msg.xids()); + toku_ft_bn_apply_msg_once( + bn, + curr_msg, + idx, + curr_keylen, + storeddata, + gc_info, + workdone, + stats_to_update, + logical_rows_delta); // at this point, we cannot trust msg.kdbt to be valid. uint32_t new_dmt_size = bn->data_buffer.num_klpairs(); if (new_dmt_size != num_klpairs) { @@ -1386,13 +1524,27 @@ toku_ft_bn_apply_msg ( assert_zero(r); int deleted = 0; if (le_has_xids(storeddata, msg.xids())) { - // message application code needs a key in order to determine how much - // work was done by this message. since this is a broadcast message, - // we have to create a new message whose key is the current le's key. + // message application code needs a key in order to determine + // how much work was done by this message. since this is a + // broadcast message, we have to create a new message whose key + // is the current le's key. DBT curr_keydbt; - ft_msg curr_msg(toku_fill_dbt(&curr_keydbt, curr_keyp, curr_keylen), - msg.vdbt(), msg.type(), msg.msn(), msg.xids()); - toku_ft_bn_apply_msg_once(bn, curr_msg, idx, curr_keylen, storeddata, gc_info, workdone, stats_to_update); + ft_msg curr_msg( + toku_fill_dbt(&curr_keydbt, curr_keyp, curr_keylen), + msg.vdbt(), + msg.type(), + msg.msn(), + msg.xids()); + toku_ft_bn_apply_msg_once( + bn, + curr_msg, + idx, + curr_keylen, + storeddata, + gc_info, + workdone, + stats_to_update, + logical_rows_delta); uint32_t new_dmt_size = bn->data_buffer.num_klpairs(); if (new_dmt_size != num_klpairs) { paranoid_invariant(new_dmt_size + 1 == num_klpairs); @@ -1424,9 +1576,33 @@ toku_ft_bn_apply_msg ( key = msg.kdbt()->data; keylen = msg.kdbt()->size; } - r = do_update(update_fun, cmp.get_descriptor(), bn, msg, idx, NULL, NULL, 0, gc_info, workdone, stats_to_update); + r = do_update( + update_fun, + cmp.get_descriptor(), + bn, + msg, + idx, + NULL, + NULL, + 0, + gc_info, + workdone, + stats_to_update, + logical_rows_delta); } else if (r==0) { - r = do_update(update_fun, cmp.get_descriptor(), bn, msg, idx, storeddata, key, keylen, gc_info, workdone, stats_to_update); + r = do_update( + update_fun, + cmp.get_descriptor(), + bn, + msg, + idx, + storeddata, + key, + keylen, + gc_info, + workdone, + stats_to_update, + logical_rows_delta); } // otherwise, a worse error, just return it break; } @@ -1434,6 +1610,12 @@ toku_ft_bn_apply_msg ( // apply to all leafentries. uint32_t idx = 0; uint32_t num_leafentries_before; + // This is used to avoid having the logical row count changed on apply + // of this message since it will return a negative number of the number + // of leaf entries visited and cause the ft header value to go to 0; + // This message will not change the number of rows, so just use the + // bogus value. + int64_t temp_logical_rows_delta = 0; while (idx < (num_leafentries_before = bn->data_buffer.num_klpairs())) { void* curr_key = nullptr; uint32_t curr_keylen = 0; @@ -1449,7 +1631,19 @@ toku_ft_bn_apply_msg ( // This is broken below. Have a compilation error checked // in as a reminder - r = do_update(update_fun, cmp.get_descriptor(), bn, msg, idx, storeddata, curr_key, curr_keylen, gc_info, workdone, stats_to_update); + r = do_update( + update_fun, + cmp.get_descriptor(), + bn, + msg, + idx, + storeddata, + curr_key, + curr_keylen, + gc_info, + workdone, + stats_to_update, + &temp_logical_rows_delta); assert_zero(r); if (num_leafentries_before == bn->data_buffer.num_klpairs()) { @@ -1810,24 +2004,22 @@ void toku_ftnode_leaf_run_gc(FT ft, FTNODE node) { } } -void -toku_ftnode_put_msg ( +void toku_ftnode_put_msg( const toku::comparator &cmp, ft_update_func update_fun, FTNODE node, int target_childnum, const ft_msg &msg, bool is_fresh, - txn_gc_info *gc_info, + txn_gc_info* gc_info, size_t flow_deltas[], - STAT64INFO stats_to_update - ) + STAT64INFO stats_to_update, + int64_t* logical_rows_delta) { // Effect: Push message into the subtree rooted at NODE. // If NODE is a leaf, then // put message into leaf, applying it to the leafentries // If NODE is a nonleaf, then push the message into the message buffer(s) of the relevent child(ren). // The node may become overfull. That's not our problem. -{ toku_ftnode_assert_fully_in_memory(node); // // see comments in toku_ft_leaf_apply_msg @@ -1836,26 +2028,40 @@ toku_ftnode_put_msg ( // and instead defer to these functions // if (node->height==0) { - toku_ft_leaf_apply_msg(cmp, update_fun, node, target_childnum, msg, gc_info, nullptr, stats_to_update); + toku_ft_leaf_apply_msg( + cmp, + update_fun, + node, + target_childnum, msg, + gc_info, + nullptr, + stats_to_update, + logical_rows_delta); } else { - ft_nonleaf_put_msg(cmp, node, target_childnum, msg, is_fresh, flow_deltas); + ft_nonleaf_put_msg( + cmp, + node, + target_childnum, + msg, + is_fresh, + flow_deltas); } } -// Effect: applies the message to the leaf if the appropriate basement node is in memory. -// This function is called during message injection and/or flushing, so the entire -// node MUST be in memory. +// Effect: applies the message to the leaf if the appropriate basement node is +// in memory. This function is called during message injection and/or +// flushing, so the entire node MUST be in memory. void toku_ft_leaf_apply_msg( - const toku::comparator &cmp, + const toku::comparator& cmp, ft_update_func update_fun, FTNODE node, int target_childnum, // which child to inject to, or -1 if unknown - const ft_msg &msg, - txn_gc_info *gc_info, - uint64_t *workdone, - STAT64INFO stats_to_update - ) -{ + const ft_msg& msg, + txn_gc_info* gc_info, + uint64_t* workdone, + STAT64INFO stats_to_update, + int64_t* logical_rows_delta) { + VERIFY_NODE(t, node); toku_ftnode_assert_fully_in_memory(node); @@ -1891,34 +2097,36 @@ void toku_ft_leaf_apply_msg( BASEMENTNODE bn = BLB(node, childnum); if (msg.msn().msn > bn->max_msn_applied.msn) { bn->max_msn_applied = msg.msn(); - toku_ft_bn_apply_msg(cmp, - update_fun, - bn, - msg, - gc_info, - workdone, - stats_to_update); + toku_ft_bn_apply_msg( + cmp, + update_fun, + bn, + msg, + gc_info, + workdone, + stats_to_update, + logical_rows_delta); } else { toku_ft_status_note_msn_discard(); } - } - else if (ft_msg_type_applies_all(msg.type())) { + } else if (ft_msg_type_applies_all(msg.type())) { for (int childnum=0; childnumn_children; childnum++) { if (msg.msn().msn > BLB(node, childnum)->max_msn_applied.msn) { BLB(node, childnum)->max_msn_applied = msg.msn(); - toku_ft_bn_apply_msg(cmp, - update_fun, - BLB(node, childnum), - msg, - gc_info, - workdone, - stats_to_update); + toku_ft_bn_apply_msg( + cmp, + update_fun, + BLB(node, childnum), + msg, + gc_info, + workdone, + stats_to_update, + logical_rows_delta); } else { toku_ft_status_note_msn_discard(); } } - } - else if (!ft_msg_type_does_nothing(msg.type())) { + } else if (!ft_msg_type_does_nothing(msg.type())) { invariant(ft_msg_type_does_nothing(msg.type())); } VERIFY_NODE(t, node); diff --git a/storage/tokudb/PerconaFT/ft/node.h b/storage/tokudb/PerconaFT/ft/node.h index 9d910491682..ad0298e81c5 100644 --- a/storage/tokudb/PerconaFT/ft/node.h +++ b/storage/tokudb/PerconaFT/ft/node.h @@ -382,25 +382,54 @@ enum reactivity toku_ftnode_get_leaf_reactivity(FTNODE node, uint32_t nodesize); * If k is equal to some pivot, then we return the next (to the right) * childnum. */ -int toku_ftnode_hot_next_child(FTNODE node, const DBT *k, const toku::comparator &cmp); +int toku_ftnode_hot_next_child( + FTNODE node, + const DBT* k, + const toku::comparator &cmp); -void toku_ftnode_put_msg(const toku::comparator &cmp, ft_update_func update_fun, - FTNODE node, int target_childnum, - const ft_msg &msg, bool is_fresh, txn_gc_info *gc_info, - size_t flow_deltas[], STAT64INFO stats_to_update); +void toku_ftnode_put_msg( + const toku::comparator& cmp, + ft_update_func update_fun, + FTNODE node, + int target_childnum, + const ft_msg& msg, + bool is_fresh, + txn_gc_info* gc_info, + size_t flow_deltas[], + STAT64INFO stats_to_update, + int64_t* logical_rows_delta); -void toku_ft_bn_apply_msg_once(BASEMENTNODE bn, const ft_msg &msg, uint32_t idx, - uint32_t le_keylen, LEAFENTRY le, txn_gc_info *gc_info, - uint64_t *workdonep, STAT64INFO stats_to_update); +void toku_ft_bn_apply_msg_once( + BASEMENTNODE bn, + const ft_msg& msg, + uint32_t idx, + uint32_t le_keylen, + LEAFENTRY le, + txn_gc_info* gc_info, + uint64_t* workdonep, + STAT64INFO stats_to_update, + int64_t* logical_rows_delta); -void toku_ft_bn_apply_msg(const toku::comparator &cmp, ft_update_func update_fun, - BASEMENTNODE bn, const ft_msg &msg, txn_gc_info *gc_info, - uint64_t *workdone, STAT64INFO stats_to_update); +void toku_ft_bn_apply_msg( + const toku::comparator& cmp, + ft_update_func update_fun, + BASEMENTNODE bn, + const ft_msg& msg, + txn_gc_info* gc_info, + uint64_t* workdone, + STAT64INFO stats_to_update, + int64_t* logical_rows_delta); -void toku_ft_leaf_apply_msg(const toku::comparator &cmp, ft_update_func update_fun, - FTNODE node, int target_childnum, - const ft_msg &msg, txn_gc_info *gc_info, - uint64_t *workdone, STAT64INFO stats_to_update); +void toku_ft_leaf_apply_msg( + const toku::comparator& cmp, + ft_update_func update_fun, + FTNODE node, + int target_childnum, + const ft_msg& msg, + txn_gc_info* gc_info, + uint64_t* workdone, + STAT64INFO stats_to_update, + int64_t* logical_rows_delta); // // Message management for orthopush diff --git a/storage/tokudb/PerconaFT/ft/pivotkeys.cc b/storage/tokudb/PerconaFT/ft/pivotkeys.cc index b4a26d03ee1..b941ac62a42 100644 --- a/storage/tokudb/PerconaFT/ft/pivotkeys.cc +++ b/storage/tokudb/PerconaFT/ft/pivotkeys.cc @@ -35,6 +35,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." +#include #include #include "portability/memory.h" diff --git a/storage/tokudb/PerconaFT/ft/serialize/block_table.cc b/storage/tokudb/PerconaFT/ft/serialize/block_table.cc index 7101ba9f58c..ec5a1140310 100644 --- a/storage/tokudb/PerconaFT/ft/serialize/block_table.cc +++ b/storage/tokudb/PerconaFT/ft/serialize/block_table.cc @@ -36,6 +36,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." +#include #include "portability/memory.h" #include "portability/toku_assert.h" #include "portability/toku_portability.h" diff --git a/storage/tokudb/PerconaFT/ft/serialize/compress.cc b/storage/tokudb/PerconaFT/ft/serialize/compress.cc index 1719b6b7cb5..113a8763510 100644 --- a/storage/tokudb/PerconaFT/ft/serialize/compress.cc +++ b/storage/tokudb/PerconaFT/ft/serialize/compress.cc @@ -36,6 +36,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." +#include #include #include @@ -97,7 +98,6 @@ void toku_compress (enum toku_compression_method a, static const int zlib_without_checksum_windowbits = -15; a = normalize_compression_method(a); - assert(sourceLen < (1LL << 32)); switch (a) { case TOKU_NO_COMPRESSION: dest[0] = TOKU_NO_COMPRESSION; @@ -171,8 +171,10 @@ void toku_compress (enum toku_compression_method a, return; } case TOKU_SNAPPY_METHOD: { - snappy::RawCompress((char*)source, sourceLen, (char*)dest + 1, destLen); - *destLen += 1; + size_t tmp_dest= *destLen; + snappy::RawCompress((char*)source, sourceLen, (char*)dest + 1, + &tmp_dest); + *destLen= tmp_dest + 1; dest[0] = TOKU_SNAPPY_METHOD; return; } diff --git a/storage/tokudb/PerconaFT/ft/serialize/ft-serialize.cc b/storage/tokudb/PerconaFT/ft/serialize/ft-serialize.cc index a7bc2949276..49d4368a3ab 100644 --- a/storage/tokudb/PerconaFT/ft/serialize/ft-serialize.cc +++ b/storage/tokudb/PerconaFT/ft/serialize/ft-serialize.cc @@ -323,6 +323,13 @@ int deserialize_ft_versioned(int fd, struct rbuf *rb, FT *ftp, uint32_t version) fanout = rbuf_int(rb); } + uint64_t on_disk_logical_rows; + on_disk_logical_rows = (uint64_t)-1; + if (ft->layout_version_read_from_disk >= FT_LAYOUT_VERSION_29) { + on_disk_logical_rows = rbuf_ulonglong(rb); + } + ft->in_memory_logical_rows = on_disk_logical_rows; + (void) rbuf_int(rb); //Read in checksum and ignore (already verified). if (rb->ndone != rb->size) { fprintf(stderr, "Header size did not match contents.\n"); @@ -357,7 +364,8 @@ int deserialize_ft_versioned(int fd, struct rbuf *rb, FT *ftp, uint32_t version) .count_of_optimize_in_progress = count_of_optimize_in_progress, .count_of_optimize_in_progress_read_from_disk = count_of_optimize_in_progress, .msn_at_start_of_last_completed_optimize = msn_at_start_of_last_completed_optimize, - .on_disk_stats = on_disk_stats + .on_disk_stats = on_disk_stats, + .on_disk_logical_rows = on_disk_logical_rows }; XMEMDUP(ft->h, &h); } @@ -408,6 +416,8 @@ serialize_ft_min_size (uint32_t version) { size_t size = 0; switch(version) { + case FT_LAYOUT_VERSION_29: + size += sizeof(uint64_t); // logrows in ft case FT_LAYOUT_VERSION_28: size += sizeof(uint32_t); // fanout in ft case FT_LAYOUT_VERSION_27: @@ -754,6 +764,7 @@ void toku_serialize_ft_to_wbuf ( wbuf_MSN(wbuf, h->highest_unused_msn_for_upgrade); wbuf_MSN(wbuf, h->max_msn_in_ft); wbuf_int(wbuf, h->fanout); + wbuf_ulonglong(wbuf, h->on_disk_logical_rows); uint32_t checksum = toku_x1764_finish(&wbuf->checksum); wbuf_int(wbuf, checksum); lazy_assert(wbuf->ndone == wbuf->size); diff --git a/storage/tokudb/PerconaFT/ft/serialize/ft_layout_version.h b/storage/tokudb/PerconaFT/ft/serialize/ft_layout_version.h index 72b6882bc06..9407a568337 100644 --- a/storage/tokudb/PerconaFT/ft/serialize/ft_layout_version.h +++ b/storage/tokudb/PerconaFT/ft/serialize/ft_layout_version.h @@ -68,6 +68,7 @@ enum ft_layout_version_e { FT_LAYOUT_VERSION_26 = 26, // Hojo: basements store key/vals separately on disk for fixed klpair length BNs FT_LAYOUT_VERSION_27 = 27, // serialize message trees with nonleaf buffers to avoid key, msn sort on deserialize FT_LAYOUT_VERSION_28 = 28, // Add fanout to ft_header + FT_LAYOUT_VERSION_29 = 29, // Add logrows to ft_header FT_NEXT_VERSION, // the version after the current version FT_LAYOUT_VERSION = FT_NEXT_VERSION-1, // A hack so I don't have to change this line. FT_LAYOUT_MIN_SUPPORTED_VERSION = FT_LAYOUT_VERSION_13, // Minimum version supported diff --git a/storage/tokudb/PerconaFT/ft/tests/CMakeLists.txt b/storage/tokudb/PerconaFT/ft/tests/CMakeLists.txt index 0098b6091be..270ec97660a 100644 --- a/storage/tokudb/PerconaFT/ft/tests/CMakeLists.txt +++ b/storage/tokudb/PerconaFT/ft/tests/CMakeLists.txt @@ -112,11 +112,13 @@ if(BUILD_TESTING OR BUILD_FT_TESTS) declare_custom_tests(test-upgrade-recovery-logs) file(GLOB upgrade_tests "${TOKUDB_DATA}/upgrade-recovery-logs-??-clean") + file(GLOB upgrade_tests "${CMAKE_CURRENT_SOURCE_DIR}/upgrade.data/upgrade-recovery-logs-??-clean") foreach(test ${upgrade_tests}) get_filename_component(test_basename "${test}" NAME) add_ft_test_aux(test-${test_basename} test-upgrade-recovery-logs ${test}) endforeach(test) file(GLOB upgrade_tests "${TOKUDB_DATA}/upgrade-recovery-logs-??-dirty") + file(GLOB upgrade_tests "${CMAKE_CURRENT_SOURCE_DIR}/upgrade.data/upgrade-recovery-logs-??-dirty") foreach(test ${upgrade_tests}) get_filename_component(test_basename "${test}" NAME) add_ft_test_aux(test-${test_basename} test-upgrade-recovery-logs ${test}) diff --git a/storage/tokudb/PerconaFT/ft/tests/make-tree.cc b/storage/tokudb/PerconaFT/ft/tests/make-tree.cc index 663bbf3beb2..761d672539b 100644 --- a/storage/tokudb/PerconaFT/ft/tests/make-tree.cc +++ b/storage/tokudb/PerconaFT/ft/tests/make-tree.cc @@ -74,11 +74,20 @@ append_leaf(FTNODE leafnode, void *key, size_t keylen, void *val, size_t vallen) // apply an insert to the leaf node txn_gc_info gc_info(nullptr, TXNID_NONE, TXNID_NONE, false); ft_msg msg(&thekey, &theval, FT_INSERT, msn, toku_xids_get_root_xids()); - toku_ft_bn_apply_msg_once(BLB(leafnode,0), msg, idx, keylen, NULL, &gc_info, NULL, NULL); + toku_ft_bn_apply_msg_once( + BLB(leafnode, 0), + msg, + idx, + keylen, + NULL, + &gc_info, + NULL, + NULL, + NULL); leafnode->max_msn_applied_to_node_on_disk = msn; - // dont forget to dirty the node + // don't forget to dirty the node leafnode->dirty = 1; } diff --git a/storage/tokudb/PerconaFT/ft/tests/msnfilter.cc b/storage/tokudb/PerconaFT/ft/tests/msnfilter.cc index 737c3556ad6..c37dcd089f8 100644 --- a/storage/tokudb/PerconaFT/ft/tests/msnfilter.cc +++ b/storage/tokudb/PerconaFT/ft/tests/msnfilter.cc @@ -82,49 +82,85 @@ append_leaf(FT_HANDLE ft, FTNODE leafnode, void *key, uint32_t keylen, void *val ft_msg msg(&thekey, &theval, FT_INSERT, msn, toku_xids_get_root_xids()); txn_gc_info gc_info(nullptr, TXNID_NONE, TXNID_NONE, false); - toku_ft_leaf_apply_msg(ft->ft->cmp, ft->ft->update_fun, leafnode, -1, msg, &gc_info, nullptr, nullptr); + toku_ft_leaf_apply_msg( + ft->ft->cmp, + ft->ft->update_fun, + leafnode, + -1, + msg, + &gc_info, + nullptr, + nullptr, + nullptr); { - int r = toku_ft_lookup(ft, &thekey, lookup_checkf, &pair); - assert(r==0); - assert(pair.call_count==1); + int r = toku_ft_lookup(ft, &thekey, lookup_checkf, &pair); + assert(r==0); + assert(pair.call_count==1); } ft_msg badmsg(&thekey, &badval, FT_INSERT, msn, toku_xids_get_root_xids()); - toku_ft_leaf_apply_msg(ft->ft->cmp, ft->ft->update_fun, leafnode, -1, badmsg, &gc_info, nullptr, nullptr); + toku_ft_leaf_apply_msg( + ft->ft->cmp, + ft->ft->update_fun, + leafnode, + -1, + badmsg, + &gc_info, + nullptr, + nullptr, + nullptr); // message should be rejected for duplicate msn, row should still have original val { - int r = toku_ft_lookup(ft, &thekey, lookup_checkf, &pair); - assert(r==0); - assert(pair.call_count==2); + int r = toku_ft_lookup(ft, &thekey, lookup_checkf, &pair); + assert(r==0); + assert(pair.call_count==2); } // now verify that message with proper msn gets through msn = next_dummymsn(); ft->ft->h->max_msn_in_ft = msn; ft_msg msg2(&thekey, &val2, FT_INSERT, msn, toku_xids_get_root_xids()); - toku_ft_leaf_apply_msg(ft->ft->cmp, ft->ft->update_fun, leafnode, -1, msg2, &gc_info, nullptr, nullptr); + toku_ft_leaf_apply_msg( + ft->ft->cmp, + ft->ft->update_fun, + leafnode, + -1, + msg2, + &gc_info, + nullptr, + nullptr, + nullptr); // message should be accepted, val should have new value { - int r = toku_ft_lookup(ft, &thekey, lookup_checkf, &pair2); - assert(r==0); - assert(pair2.call_count==1); + int r = toku_ft_lookup(ft, &thekey, lookup_checkf, &pair2); + assert(r==0); + assert(pair2.call_count==1); } // now verify that message with lesser (older) msn is rejected msn.msn = msn.msn - 10; ft_msg msg3(&thekey, &badval, FT_INSERT, msn, toku_xids_get_root_xids()); - toku_ft_leaf_apply_msg(ft->ft->cmp, ft->ft->update_fun, leafnode, -1, msg3, &gc_info, nullptr, nullptr); + toku_ft_leaf_apply_msg( + ft->ft->cmp, + ft->ft->update_fun, + leafnode, + -1, + msg3, + &gc_info, + nullptr, + nullptr, + nullptr); // message should be rejected, val should still have value in pair2 { - int r = toku_ft_lookup(ft, &thekey, lookup_checkf, &pair2); - assert(r==0); - assert(pair2.call_count==2); + int r = toku_ft_lookup(ft, &thekey, lookup_checkf, &pair2); + assert(r==0); + assert(pair2.call_count==2); } - // dont forget to dirty the node + // don't forget to dirty the node leafnode->dirty = 1; } diff --git a/storage/tokudb/PerconaFT/ft/tests/orthopush-flush.cc b/storage/tokudb/PerconaFT/ft/tests/orthopush-flush.cc index 055a38e5f6d..393fb88ac2e 100644 --- a/storage/tokudb/PerconaFT/ft/tests/orthopush-flush.cc +++ b/storage/tokudb/PerconaFT/ft/tests/orthopush-flush.cc @@ -137,8 +137,24 @@ insert_random_message_to_bn( *keyp = toku_xmemdup(keydbt->data, keydbt->size); ft_msg msg(keydbt, valdbt, FT_INSERT, msn, xids); int64_t numbytes; - toku_le_apply_msg(msg, NULL, NULL, 0, keydbt->size, &non_mvcc_gc_info, save, &numbytes); - toku_ft_bn_apply_msg(t->ft->cmp, t->ft->update_fun, blb, msg, &non_mvcc_gc_info, NULL, NULL); + toku_le_apply_msg( + msg, + NULL, + NULL, + 0, + keydbt->size, + &non_mvcc_gc_info, + save, + &numbytes); + toku_ft_bn_apply_msg( + t->ft->cmp, + t->ft->update_fun, + blb, + msg, + &non_mvcc_gc_info, + NULL, + NULL, + NULL); if (msn.msn > blb->max_msn_applied.msn) { blb->max_msn_applied = msn; } @@ -182,12 +198,36 @@ insert_same_message_to_bns( *keyp = toku_xmemdup(keydbt->data, keydbt->size); ft_msg msg(keydbt, valdbt, FT_INSERT, msn, xids); int64_t numbytes; - toku_le_apply_msg(msg, NULL, NULL, 0, keydbt->size, &non_mvcc_gc_info, save, &numbytes); - toku_ft_bn_apply_msg(t->ft->cmp, t->ft->update_fun, blb1, msg, &non_mvcc_gc_info, NULL, NULL); + toku_le_apply_msg( + msg, + NULL, + NULL, + 0, + keydbt->size, + &non_mvcc_gc_info, + save, + &numbytes); + toku_ft_bn_apply_msg( + t->ft->cmp, + t->ft->update_fun, + blb1, + msg, + &non_mvcc_gc_info, + NULL, + NULL, + NULL); if (msn.msn > blb1->max_msn_applied.msn) { blb1->max_msn_applied = msn; } - toku_ft_bn_apply_msg(t->ft->cmp, t->ft->update_fun, blb2, msg, &non_mvcc_gc_info, NULL, NULL); + toku_ft_bn_apply_msg( + t->ft->cmp, + t->ft->update_fun, + blb2, + msg, + &non_mvcc_gc_info, + NULL, + NULL, + NULL); if (msn.msn > blb2->max_msn_applied.msn) { blb2->max_msn_applied = msn; } @@ -619,7 +659,16 @@ flush_to_leaf(FT_HANDLE t, bool make_leaf_up_to_date, bool use_flush) { if (make_leaf_up_to_date) { for (i = 0; i < num_parent_messages; ++i) { if (!parent_messages_is_fresh[i]) { - toku_ft_leaf_apply_msg(t->ft->cmp, t->ft->update_fun, child, -1, *parent_messages[i], &non_mvcc_gc_info, NULL, NULL); + toku_ft_leaf_apply_msg( + t->ft->cmp, + t->ft->update_fun, + child, + -1, + *parent_messages[i], + &non_mvcc_gc_info, + NULL, + NULL, + NULL); } } for (i = 0; i < 8; ++i) { @@ -842,7 +891,16 @@ flush_to_leaf_with_keyrange(FT_HANDLE t, bool make_leaf_up_to_date) { for (i = 0; i < num_parent_messages; ++i) { if (dummy_cmp(parent_messages[i]->kdbt(), &childkeys[7]) <= 0 && !parent_messages_is_fresh[i]) { - toku_ft_leaf_apply_msg(t->ft->cmp, t->ft->update_fun, child, -1, *parent_messages[i], &non_mvcc_gc_info, NULL, NULL); + toku_ft_leaf_apply_msg( + t->ft->cmp, + t->ft->update_fun, + child, + -1, + *parent_messages[i], + &non_mvcc_gc_info, + NULL, + NULL, + NULL); } } for (i = 0; i < 8; ++i) { @@ -1045,8 +1103,26 @@ compare_apply_and_flush(FT_HANDLE t, bool make_leaf_up_to_date) { if (make_leaf_up_to_date) { for (i = 0; i < num_parent_messages; ++i) { if (!parent_messages_is_fresh[i]) { - toku_ft_leaf_apply_msg(t->ft->cmp, t->ft->update_fun, child1, -1, *parent_messages[i], &non_mvcc_gc_info, NULL, NULL); - toku_ft_leaf_apply_msg(t->ft->cmp, t->ft->update_fun, child2, -1, *parent_messages[i], &non_mvcc_gc_info, NULL, NULL); + toku_ft_leaf_apply_msg( + t->ft->cmp, + t->ft->update_fun, + child1, + -1, + *parent_messages[i], + &non_mvcc_gc_info, + NULL, + NULL, + NULL); + toku_ft_leaf_apply_msg( + t->ft->cmp, + t->ft->update_fun, + child2, + -1, + *parent_messages[i], + &non_mvcc_gc_info, + NULL, + NULL, + NULL); } } for (i = 0; i < 8; ++i) { diff --git a/storage/tokudb/PerconaFT/ft/tests/test-upgrade-recovery-logs.cc b/storage/tokudb/PerconaFT/ft/tests/test-upgrade-recovery-logs.cc index 8e006498d77..7691ffaac2b 100644 --- a/storage/tokudb/PerconaFT/ft/tests/test-upgrade-recovery-logs.cc +++ b/storage/tokudb/PerconaFT/ft/tests/test-upgrade-recovery-logs.cc @@ -81,7 +81,7 @@ static void run_recovery(const char *testdir) { bool upgrade_in_progress; r = toku_maybe_upgrade_log(testdir, testdir, &lsn_of_clean_shutdown, &upgrade_in_progress); if (strcmp(shutdown, "dirty") == 0 && log_version <= 24) { - CKERR2(r, TOKUDB_UPGRADE_FAILURE); // we dont support dirty upgrade from versions <= 24 + CKERR2(r, TOKUDB_UPGRADE_FAILURE); // we don't support dirty upgrade from versions <= 24 return; } else { CKERR(r); diff --git a/storage/tokudb/PerconaFT/ft/tests/upgrade.data/upgrade-recovery-logs-24-clean/log000000000000.tokulog24 b/storage/tokudb/PerconaFT/ft/tests/upgrade.data/upgrade-recovery-logs-24-clean/log000000000000.tokulog24 new file mode 100755 index 00000000000..9a56e83e627 Binary files /dev/null and b/storage/tokudb/PerconaFT/ft/tests/upgrade.data/upgrade-recovery-logs-24-clean/log000000000000.tokulog24 differ diff --git a/storage/tokudb/PerconaFT/ft/tests/upgrade.data/upgrade-recovery-logs-24-dirty/log000000000000.tokulog24 b/storage/tokudb/PerconaFT/ft/tests/upgrade.data/upgrade-recovery-logs-24-dirty/log000000000000.tokulog24 new file mode 100755 index 00000000000..c552cda6673 Binary files /dev/null and b/storage/tokudb/PerconaFT/ft/tests/upgrade.data/upgrade-recovery-logs-24-dirty/log000000000000.tokulog24 differ diff --git a/storage/tokudb/PerconaFT/ft/tests/upgrade.data/upgrade-recovery-logs-25-clean/log000000000000.tokulog25 b/storage/tokudb/PerconaFT/ft/tests/upgrade.data/upgrade-recovery-logs-25-clean/log000000000000.tokulog25 new file mode 100755 index 00000000000..26b8bcfbdcc Binary files /dev/null and b/storage/tokudb/PerconaFT/ft/tests/upgrade.data/upgrade-recovery-logs-25-clean/log000000000000.tokulog25 differ diff --git a/storage/tokudb/PerconaFT/ft/tests/upgrade.data/upgrade-recovery-logs-25-dirty/log000000000000.tokulog25 b/storage/tokudb/PerconaFT/ft/tests/upgrade.data/upgrade-recovery-logs-25-dirty/log000000000000.tokulog25 new file mode 100755 index 00000000000..04d3190c818 Binary files /dev/null and b/storage/tokudb/PerconaFT/ft/tests/upgrade.data/upgrade-recovery-logs-25-dirty/log000000000000.tokulog25 differ diff --git a/storage/tokudb/PerconaFT/ft/tests/upgrade.data/upgrade-recovery-logs-26-clean/log000000000000.tokulog26 b/storage/tokudb/PerconaFT/ft/tests/upgrade.data/upgrade-recovery-logs-26-clean/log000000000000.tokulog26 new file mode 100755 index 00000000000..02047325aa6 Binary files /dev/null and b/storage/tokudb/PerconaFT/ft/tests/upgrade.data/upgrade-recovery-logs-26-clean/log000000000000.tokulog26 differ diff --git a/storage/tokudb/PerconaFT/ft/tests/upgrade.data/upgrade-recovery-logs-26-dirty/log000000000000.tokulog26 b/storage/tokudb/PerconaFT/ft/tests/upgrade.data/upgrade-recovery-logs-26-dirty/log000000000000.tokulog26 new file mode 100755 index 00000000000..ce826b5608b Binary files /dev/null and b/storage/tokudb/PerconaFT/ft/tests/upgrade.data/upgrade-recovery-logs-26-dirty/log000000000000.tokulog26 differ diff --git a/storage/tokudb/PerconaFT/ft/tests/upgrade.data/upgrade-recovery-logs-27-clean/log000000000000.tokulog27 b/storage/tokudb/PerconaFT/ft/tests/upgrade.data/upgrade-recovery-logs-27-clean/log000000000000.tokulog27 new file mode 100755 index 00000000000..9849b977d73 Binary files /dev/null and b/storage/tokudb/PerconaFT/ft/tests/upgrade.data/upgrade-recovery-logs-27-clean/log000000000000.tokulog27 differ diff --git a/storage/tokudb/PerconaFT/ft/tests/upgrade.data/upgrade-recovery-logs-27-dirty/log000000000000.tokulog27 b/storage/tokudb/PerconaFT/ft/tests/upgrade.data/upgrade-recovery-logs-27-dirty/log000000000000.tokulog27 new file mode 100755 index 00000000000..8b658ea4c0a Binary files /dev/null and b/storage/tokudb/PerconaFT/ft/tests/upgrade.data/upgrade-recovery-logs-27-dirty/log000000000000.tokulog27 differ diff --git a/storage/tokudb/PerconaFT/ft/tests/upgrade.data/upgrade-recovery-logs-28-clean/log000000000000.tokulog28 b/storage/tokudb/PerconaFT/ft/tests/upgrade.data/upgrade-recovery-logs-28-clean/log000000000000.tokulog28 new file mode 100644 index 00000000000..11fecfb94b2 Binary files /dev/null and b/storage/tokudb/PerconaFT/ft/tests/upgrade.data/upgrade-recovery-logs-28-clean/log000000000000.tokulog28 differ diff --git a/storage/tokudb/PerconaFT/ft/tests/upgrade.data/upgrade-recovery-logs-28-dirty/log000000000000.tokulog28 b/storage/tokudb/PerconaFT/ft/tests/upgrade.data/upgrade-recovery-logs-28-dirty/log000000000000.tokulog28 new file mode 100644 index 00000000000..b7a9b03b583 Binary files /dev/null and b/storage/tokudb/PerconaFT/ft/tests/upgrade.data/upgrade-recovery-logs-28-dirty/log000000000000.tokulog28 differ diff --git a/storage/tokudb/PerconaFT/ft/tests/upgrade.data/upgrade-recovery-logs-29-clean/log000000000000.tokulog29 b/storage/tokudb/PerconaFT/ft/tests/upgrade.data/upgrade-recovery-logs-29-clean/log000000000000.tokulog29 new file mode 100644 index 00000000000..a1f306f4a96 Binary files /dev/null and b/storage/tokudb/PerconaFT/ft/tests/upgrade.data/upgrade-recovery-logs-29-clean/log000000000000.tokulog29 differ diff --git a/storage/tokudb/PerconaFT/ft/tests/upgrade.data/upgrade-recovery-logs-29-dirty/log000000000000.tokulog29 b/storage/tokudb/PerconaFT/ft/tests/upgrade.data/upgrade-recovery-logs-29-dirty/log000000000000.tokulog29 new file mode 100644 index 00000000000..b9e79eeb1c4 Binary files /dev/null and b/storage/tokudb/PerconaFT/ft/tests/upgrade.data/upgrade-recovery-logs-29-dirty/log000000000000.tokulog29 differ diff --git a/storage/tokudb/PerconaFT/ft/tests/verify-bad-msn.cc b/storage/tokudb/PerconaFT/ft/tests/verify-bad-msn.cc index 68fac0e6a9c..b10885c2e62 100644 --- a/storage/tokudb/PerconaFT/ft/tests/verify-bad-msn.cc +++ b/storage/tokudb/PerconaFT/ft/tests/verify-bad-msn.cc @@ -78,12 +78,21 @@ append_leaf(FTNODE leafnode, void *key, size_t keylen, void *val, size_t vallen) // apply an insert to the leaf node ft_msg msg(&thekey, &theval, FT_INSERT, msn, toku_xids_get_root_xids()); txn_gc_info gc_info(nullptr, TXNID_NONE, TXNID_NONE, false); - toku_ft_bn_apply_msg_once(BLB(leafnode, 0), msg, idx, keylen, NULL, &gc_info, NULL, NULL); + toku_ft_bn_apply_msg_once( + BLB(leafnode, 0), + msg, + idx, + keylen, + NULL, + &gc_info, + NULL, + NULL, + NULL); // Create bad tree (don't do following): // leafnode->max_msn_applied_to_node = msn; - // dont forget to dirty the node + // don't forget to dirty the node leafnode->dirty = 1; } diff --git a/storage/tokudb/PerconaFT/ft/tests/verify-bad-pivots.cc b/storage/tokudb/PerconaFT/ft/tests/verify-bad-pivots.cc index 49b2b8a6c21..c1d08ce41a6 100644 --- a/storage/tokudb/PerconaFT/ft/tests/verify-bad-pivots.cc +++ b/storage/tokudb/PerconaFT/ft/tests/verify-bad-pivots.cc @@ -65,9 +65,18 @@ append_leaf(FTNODE leafnode, void *key, size_t keylen, void *val, size_t vallen) MSN msn = next_dummymsn(); ft_msg msg(&thekey, &theval, FT_INSERT, msn, toku_xids_get_root_xids()); txn_gc_info gc_info(nullptr, TXNID_NONE, TXNID_NONE, false); - toku_ft_bn_apply_msg_once(BLB(leafnode, 0), msg, idx, keylen, NULL, &gc_info, NULL, NULL); + toku_ft_bn_apply_msg_once( + BLB(leafnode, 0), + msg, + idx, + keylen, + NULL, + &gc_info, + NULL, + NULL, + NULL); - // dont forget to dirty the node + // don't forget to dirty the node leafnode->dirty = 1; } diff --git a/storage/tokudb/PerconaFT/ft/tests/verify-dup-in-leaf.cc b/storage/tokudb/PerconaFT/ft/tests/verify-dup-in-leaf.cc index 72c4063f51f..22a29c0ff69 100644 --- a/storage/tokudb/PerconaFT/ft/tests/verify-dup-in-leaf.cc +++ b/storage/tokudb/PerconaFT/ft/tests/verify-dup-in-leaf.cc @@ -66,9 +66,18 @@ append_leaf(FTNODE leafnode, void *key, size_t keylen, void *val, size_t vallen) MSN msn = next_dummymsn(); ft_msg msg(&thekey, &theval, FT_INSERT, msn, toku_xids_get_root_xids()); txn_gc_info gc_info(nullptr, TXNID_NONE, TXNID_NONE, false); - toku_ft_bn_apply_msg_once(BLB(leafnode, 0), msg, idx, keylen, NULL, &gc_info, NULL, NULL); + toku_ft_bn_apply_msg_once( + BLB(leafnode, 0), + msg, + idx, + keylen, + NULL, + &gc_info, + NULL, + NULL, + NULL); - // dont forget to dirty the node + // don't forget to dirty the node leafnode->dirty = 1; } diff --git a/storage/tokudb/PerconaFT/ft/tests/verify-dup-pivots.cc b/storage/tokudb/PerconaFT/ft/tests/verify-dup-pivots.cc index f569f502dc8..80189dd9804 100644 --- a/storage/tokudb/PerconaFT/ft/tests/verify-dup-pivots.cc +++ b/storage/tokudb/PerconaFT/ft/tests/verify-dup-pivots.cc @@ -65,9 +65,18 @@ append_leaf(FTNODE leafnode, void *key, size_t keylen, void *val, size_t vallen) MSN msn = next_dummymsn(); ft_msg msg(&thekey, &theval, FT_INSERT, msn, toku_xids_get_root_xids()); txn_gc_info gc_info(nullptr, TXNID_NONE, TXNID_NONE, false); - toku_ft_bn_apply_msg_once(BLB(leafnode, 0), msg, idx, keylen, NULL, &gc_info, NULL, NULL); + toku_ft_bn_apply_msg_once( + BLB(leafnode, 0), + msg, + idx, + keylen, + NULL, + &gc_info, + NULL, + NULL, + NULL); - // dont forget to dirty the node + // don't forget to dirty the node leafnode->dirty = 1; } diff --git a/storage/tokudb/PerconaFT/ft/tests/verify-misrouted-msgs.cc b/storage/tokudb/PerconaFT/ft/tests/verify-misrouted-msgs.cc index 3a6db8ee4de..a84aac1f063 100644 --- a/storage/tokudb/PerconaFT/ft/tests/verify-misrouted-msgs.cc +++ b/storage/tokudb/PerconaFT/ft/tests/verify-misrouted-msgs.cc @@ -66,9 +66,18 @@ append_leaf(FTNODE leafnode, void *key, size_t keylen, void *val, size_t vallen) MSN msn = next_dummymsn(); ft_msg msg(&thekey, &theval, FT_INSERT, msn, toku_xids_get_root_xids()); txn_gc_info gc_info(nullptr, TXNID_NONE, TXNID_NONE, false); - toku_ft_bn_apply_msg_once(BLB(leafnode,0), msg, idx, keylen, NULL, &gc_info, NULL, NULL); + toku_ft_bn_apply_msg_once( + BLB(leafnode, 0), + msg, + idx, + keylen, + NULL, + &gc_info, + NULL, + NULL, + NULL); - // dont forget to dirty the node + // don't forget to dirty the node leafnode->dirty = 1; } diff --git a/storage/tokudb/PerconaFT/ft/tests/verify-unsorted-leaf.cc b/storage/tokudb/PerconaFT/ft/tests/verify-unsorted-leaf.cc index 4392887718f..ca413f52567 100644 --- a/storage/tokudb/PerconaFT/ft/tests/verify-unsorted-leaf.cc +++ b/storage/tokudb/PerconaFT/ft/tests/verify-unsorted-leaf.cc @@ -68,9 +68,18 @@ append_leaf(FTNODE leafnode, void *key, size_t keylen, void *val, size_t vallen) MSN msn = next_dummymsn(); ft_msg msg(&thekey, &theval, FT_INSERT, msn, toku_xids_get_root_xids()); txn_gc_info gc_info(nullptr, TXNID_NONE, TXNID_NONE, false); - toku_ft_bn_apply_msg_once(BLB(leafnode, 0), msg, idx, keylen, NULL, &gc_info, NULL, NULL); + toku_ft_bn_apply_msg_once( + BLB(leafnode, 0), + msg, + idx, + keylen, + NULL, + &gc_info, + NULL, + NULL, + NULL); - // dont forget to dirty the node + // don't forget to dirty the node leafnode->dirty = 1; } diff --git a/storage/tokudb/PerconaFT/ft/tests/verify-unsorted-pivots.cc b/storage/tokudb/PerconaFT/ft/tests/verify-unsorted-pivots.cc index e3167bd3dc1..6efa06913c2 100644 --- a/storage/tokudb/PerconaFT/ft/tests/verify-unsorted-pivots.cc +++ b/storage/tokudb/PerconaFT/ft/tests/verify-unsorted-pivots.cc @@ -65,9 +65,18 @@ append_leaf(FTNODE leafnode, void *key, size_t keylen, void *val, size_t vallen) MSN msn = next_dummymsn(); ft_msg msg(&thekey, &theval, FT_INSERT, msn, toku_xids_get_root_xids()); txn_gc_info gc_info(nullptr, TXNID_NONE, TXNID_NONE, false); - toku_ft_bn_apply_msg_once(BLB(leafnode, 0), msg, idx, keylen, NULL, &gc_info, NULL, NULL); + toku_ft_bn_apply_msg_once( + BLB(leafnode, 0), + msg, + idx, + keylen, + NULL, + &gc_info, + NULL, + NULL, + NULL); - // dont forget to dirty the node + // don't forget to dirty the node leafnode->dirty = 1; } diff --git a/storage/tokudb/PerconaFT/ft/txn/rollback-apply.cc b/storage/tokudb/PerconaFT/ft/txn/rollback-apply.cc index 6a8c0d45b45..df830afd0df 100644 --- a/storage/tokudb/PerconaFT/ft/txn/rollback-apply.cc +++ b/storage/tokudb/PerconaFT/ft/txn/rollback-apply.cc @@ -186,6 +186,7 @@ int toku_rollback_commit(TOKUTXN txn, LSN lsn) { // Append the list to the front of the parent. if (child_log->oldest_logentry) { // There are some entries, so link them in. + parent_log->dirty = true; child_log->oldest_logentry->prev = parent_log->newest_logentry; if (!parent_log->oldest_logentry) { parent_log->oldest_logentry = child_log->oldest_logentry; diff --git a/storage/tokudb/PerconaFT/ft/txn/txn.cc b/storage/tokudb/PerconaFT/ft/txn/txn.cc index cd0585dbf6c..dd03073a3ec 100644 --- a/storage/tokudb/PerconaFT/ft/txn/txn.cc +++ b/storage/tokudb/PerconaFT/ft/txn/txn.cc @@ -248,11 +248,24 @@ static txn_child_manager tcm; .xa_xid = {0, 0, 0, ""}, .progress_poll_fun = NULL, .progress_poll_fun_extra = NULL, - .txn_lock = ZERO_MUTEX_INITIALIZER, + + // You cannot initialize txn_lock a TOKU_MUTEX_INITIALIZER, because we + // will initialize it in the code below, and it cannot already + // be initialized at that point. Also, in general, you don't + // get to use PTHREAD_MUTEX_INITALIZER (which is what is inside + // TOKU_MUTEX_INITIALIZER) except in static variables, and this + // is initializing an auto variable. + // + // And we cannot simply avoid initializing these fields + // because, although it avoids -Wmissing-field-initializer + // errors under gcc, it gets other errors about non-trivial + // designated initializers not being supported. + + .txn_lock = ZERO_MUTEX_INITIALIZER, // Not TOKU_MUTEX_INITIALIZER .open_fts = open_fts, .roll_info = roll_info, - .state_lock = ZERO_MUTEX_INITIALIZER, - .state_cond = TOKU_COND_INITIALIZER, + .state_lock = ZERO_MUTEX_INITIALIZER, // Not TOKU_MUTEX_INITIALIZER + .state_cond = ZERO_COND_INITIALIZER, // Not TOKU_COND_INITIALIZER .state = TOKUTXN_LIVE, .num_pin = 0, .client_id = 0, diff --git a/storage/tokudb/PerconaFT/ft/txn/txn_manager.cc b/storage/tokudb/PerconaFT/ft/txn/txn_manager.cc index 551fd32b8d5..88eca36a261 100644 --- a/storage/tokudb/PerconaFT/ft/txn/txn_manager.cc +++ b/storage/tokudb/PerconaFT/ft/txn/txn_manager.cc @@ -45,7 +45,15 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #include "ft/txn/txn_manager.h" #include "ft/txn/rollback.h" #include "util/omt.h" +//this is only for testing +static void (* test_txn_sync_callback) (pthread_t, void *) = NULL; +static void * test_txn_sync_callback_extra = NULL; + +void set_test_txn_sync_callback(void (*cb) (pthread_t, void *), void *extra) { + test_txn_sync_callback = cb; + test_txn_sync_callback_extra = extra; +} bool garbage_collection_debug = false; static bool txn_records_snapshot(TXN_SNAPSHOT_TYPE snapshot_type, struct tokutxn *parent) { @@ -525,14 +533,19 @@ void toku_txn_manager_handle_snapshot_create_for_child_txn( XMALLOC(txn->live_root_txn_list); txn_manager_lock(txn_manager); txn_manager_create_snapshot_unlocked(txn_manager, txn); - txn_manager_unlock(txn_manager); } else { inherit_snapshot_from_parent(txn); } - if (copies_snapshot) { - setup_live_root_txn_list(&txn_manager->live_root_ids, txn->live_root_txn_list); - } + + toku_debug_txn_sync(pthread_self()); + + if (copies_snapshot) { + if(!records_snapshot) + txn_manager_lock(txn_manager); + setup_live_root_txn_list(&txn_manager->live_root_ids, txn->live_root_txn_list); + txn_manager_unlock(txn_manager); + } } void toku_txn_manager_handle_snapshot_destroy_for_child_txn( diff --git a/storage/tokudb/PerconaFT/ft/txn/txn_manager.h b/storage/tokudb/PerconaFT/ft/txn/txn_manager.h index 658c6f9aecd..7cdc52c4f43 100644 --- a/storage/tokudb/PerconaFT/ft/txn/txn_manager.h +++ b/storage/tokudb/PerconaFT/ft/txn/txn_manager.h @@ -43,6 +43,15 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #include "ft/txn/txn.h" +void set_test_txn_sync_callback(void (*) (pthread_t, void*), void*); +#define toku_test_txn_sync_callback(a) ((test_txn_sync_callback)? test_txn_sync_callback( a,test_txn_sync_callback_extra) : (void) 0) + +#if TOKU_DEBUG_TXN_SYNC +#define toku_debug_txn_sync(a) toku_test_txn_sync_callback(a) +#else +#define toku_debug_txn_sync(a) ((void) 0) +#endif + typedef struct txn_manager *TXN_MANAGER; struct referenced_xid_tuple { diff --git a/storage/tokudb/PerconaFT/ft/ule.cc b/storage/tokudb/PerconaFT/ft/ule.cc index 573c4488f70..ec73e148c90 100644 --- a/storage/tokudb/PerconaFT/ft/ule.cc +++ b/storage/tokudb/PerconaFT/ft/ule.cc @@ -47,6 +47,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. // See design documentation for nested transactions at // TokuWiki/Imp/TransactionsOverview. +#include #include "portability/toku_portability.h" #include "ft/ft-internal.h" @@ -73,12 +74,11 @@ void toku_le_get_status(LE_STATUS statp) { *statp = le_status; } -/////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// // Accessor functions used by outside world (e.g. indexer) // -ULEHANDLE -toku_ule_create(LEAFENTRY le) { +ULEHANDLE toku_ule_create(LEAFENTRY le) { ULE XMALLOC(ule_p); le_unpack(ule_p, le); return (ULEHANDLE) ule_p; @@ -89,7 +89,7 @@ void toku_ule_free(ULEHANDLE ule_p) { toku_free(ule_p); } -/////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// // // Question: Can any software outside this file modify or read a leafentry? // If so, is it worthwhile to put it all here? @@ -117,27 +117,43 @@ const UXR_S committed_delete = { // Local functions: -static void msg_init_empty_ule(ULE ule); -static void msg_modify_ule(ULE ule, const ft_msg &msg); -static void ule_init_empty_ule(ULE ule); +static inline void msg_init_empty_ule(ULE ule); +static int64_t msg_modify_ule(ULE ule, const ft_msg &msg); +static inline void ule_init_empty_ule(ULE ule); static void ule_do_implicit_promotions(ULE ule, XIDS xids); -static void ule_try_promote_provisional_outermost(ULE ule, TXNID oldest_possible_live_xid); +static void ule_try_promote_provisional_outermost( + ULE ule, + TXNID oldest_possible_live_xid); static void ule_promote_provisional_innermost_to_index(ULE ule, uint32_t index); static void ule_promote_provisional_innermost_to_committed(ULE ule); -static void ule_apply_insert(ULE ule, XIDS xids, uint32_t vallen, void * valp); -static void ule_apply_delete(ULE ule, XIDS xids); -static void ule_prepare_for_new_uxr(ULE ule, XIDS xids); -static void ule_apply_abort(ULE ule, XIDS xids); +static inline int64_t ule_apply_insert_no_overwrite( + ULE ule, + XIDS xids, + uint32_t vallen, + void* valp); +static inline int64_t ule_apply_insert( + ULE ule, + XIDS xids, + uint32_t vallen, + void* valp); +static inline int64_t ule_apply_delete(ULE ule, XIDS xids); +static inline void ule_prepare_for_new_uxr(ULE ule, XIDS xids); +static inline int64_t ule_apply_abort(ULE ule, XIDS xids); static void ule_apply_broadcast_commit_all (ULE ule); static void ule_apply_commit(ULE ule, XIDS xids); -static void ule_push_insert_uxr(ULE ule, bool is_committed, TXNID xid, uint32_t vallen, void * valp); -static void ule_push_delete_uxr(ULE ule, bool is_committed, TXNID xid); -static void ule_push_placeholder_uxr(ULE ule, TXNID xid); -static UXR ule_get_innermost_uxr(ULE ule); -static UXR ule_get_first_empty_uxr(ULE ule); -static void ule_remove_innermost_uxr(ULE ule); -static TXNID ule_get_innermost_xid(ULE ule); -static TXNID ule_get_xid(ULE ule, uint32_t index); +static inline void ule_push_insert_uxr( + ULE ule, + bool is_committed, + TXNID xid, + uint32_t vallen, + void* valp); +static inline void ule_push_delete_uxr(ULE ule, bool is_committed, TXNID xid); +static inline void ule_push_placeholder_uxr(ULE ule, TXNID xid); +static inline UXR ule_get_innermost_uxr(ULE ule); +static inline UXR ule_get_first_empty_uxr(ULE ule); +static inline void ule_remove_innermost_uxr(ULE ule); +static inline TXNID ule_get_innermost_xid(ULE ule); +static inline TXNID ule_get_xid(ULE ule, uint32_t index); static void ule_remove_innermost_placeholders(ULE ule); static void ule_add_placeholders(ULE ule, XIDS xids); static void ule_optimize(ULE ule, XIDS xids); @@ -153,6 +169,30 @@ static inline size_t uxr_unpack_type_and_length(UXR uxr, uint8_t *p); static inline size_t uxr_unpack_length_and_bit(UXR uxr, uint8_t *p); static inline size_t uxr_unpack_data(UXR uxr, uint8_t *p); +#if 0 +static void ule_print(ULE ule, const char* note) { + fprintf(stderr, "%s : ULE[0x%p]\n", note, ule); + fprintf(stderr, " num_puxrs[%u]\n", ule->num_puxrs); + fprintf(stderr, " num_cuxrs[%u]\n", ule->num_cuxrs); + fprintf(stderr, " innermost[%u]\n", ule->num_cuxrs + ule->num_puxrs - 1); + fprintf(stderr, " first_empty[%u]\n", ule->num_cuxrs + ule->num_puxrs); + + uint32_t num_uxrs = ule->num_cuxrs + ule->num_puxrs - 1; + for (uint32_t uxr_num = 0; uxr_num <= num_uxrs; uxr_num++) { + UXR uxr = &(ule->uxrs[uxr_num]); + fprintf(stderr, " uxr[%u]\n", uxr_num); + switch (uxr->type) { + case 0: fprintf(stderr, " type[NONE]\n"); break; + case 1: fprintf(stderr, " type[INSERT]\n"); break; + case 2: fprintf(stderr, " type[DELETE]\n"); break; + case 3: fprintf(stderr, " type[PLACEHOLDER]\n"); break; + default: fprintf(stderr, " type[WHAT??]\n"); break; + } + fprintf(stderr, " xid[%lu]\n", uxr->xid); + } +} +#endif + static void get_space_for_le( bn_data* data_buffer, uint32_t idx, @@ -162,21 +202,30 @@ static void get_space_for_le( uint32_t old_le_size, size_t size, LEAFENTRY* new_le_space, - void **const maybe_free - ) -{ + void** const maybe_free) { + if (data_buffer == nullptr) { CAST_FROM_VOIDP(*new_le_space, toku_xmalloc(size)); - } - else { + } else if (old_le_size > 0) { // this means we are overwriting something - if (old_le_size > 0) { - data_buffer->get_space_for_overwrite(idx, keyp, keylen, old_keylen, old_le_size, size, new_le_space, maybe_free); - } + data_buffer->get_space_for_overwrite( + idx, + keyp, + keylen, + old_keylen, + old_le_size, + size, + new_le_space, + maybe_free); + } else { // this means we are inserting something new - else { - data_buffer->get_space_for_insert(idx, keyp, keylen, size, new_le_space, maybe_free); - } + data_buffer->get_space_for_insert( + idx, + keyp, + keylen, + size, + new_le_space, + maybe_free); } } @@ -185,15 +234,13 @@ static void get_space_for_le( // Garbage collection related functions // -static TXNID -get_next_older_txnid(TXNID xc, const xid_omt_t &omt) { +static TXNID get_next_older_txnid(TXNID xc, const xid_omt_t &omt) { int r; TXNID xid; r = omt.find(xc, -1, &xid, nullptr); if (r==0) { invariant(xid < xc); //sanity check - } - else { + } else { invariant(r==DB_NOTFOUND); xid = TXNID_NONE; } @@ -201,17 +248,32 @@ get_next_older_txnid(TXNID xc, const xid_omt_t &omt) { } // -// This function returns true if live transaction TL1 is allowed to read a value committed by -// transaction xc, false otherwise. +// This function returns true if live transaction TL1 is allowed to read a +// value committed by transaction xc, false otherwise. // -static bool -xid_reads_committed_xid(TXNID tl1, TXNID xc, const xid_omt_t &snapshot_txnids, const rx_omt_t &referenced_xids) { +static bool xid_reads_committed_xid( + TXNID tl1, + TXNID xc, + const xid_omt_t& snapshot_txnids, + const rx_omt_t& referenced_xids) { + bool rval; - if (tl1 < xc) rval = false; //cannot read a newer txn - else { - TXNID x = toku_get_youngest_live_list_txnid_for(xc, snapshot_txnids, referenced_xids); - if (x == TXNID_NONE) rval = true; //Not in ANY live list, tl1 can read it. - else rval = tl1 > x; //Newer than the 'newest one that has it in live list' + if (tl1 < xc) { + rval = false; //cannot read a newer txn + } else { + TXNID x = + toku_get_youngest_live_list_txnid_for( + xc, + snapshot_txnids, + referenced_xids); + + if (x == TXNID_NONE) { + //Not in ANY live list, tl1 can read it. + rval = true; + } else { + //Newer than the 'newest one that has it in live list' + rval = tl1 > x; + } // we know tl1 > xc // we know x > xc // if tl1 == x, then we do not read, because tl1 is in xc's live list @@ -228,8 +290,7 @@ xid_reads_committed_xid(TXNID tl1, TXNID xc, const xid_omt_t &snapshot_txnids, c // than oldest_referenced_xid. All elements below this entry are garbage, // so we get rid of them. // -static void -ule_simple_garbage_collection(ULE ule, txn_gc_info *gc_info) { +static void ule_simple_garbage_collection(ULE ule, txn_gc_info *gc_info) { if (ule->num_cuxrs == 1) { return; } @@ -240,7 +301,8 @@ ule_simple_garbage_collection(ULE ule, txn_gc_info *gc_info) { // uxr with a txnid that is less than oldest_referenced_xid for (uint32_t i = 0; i < ule->num_cuxrs; i++) { curr_index = ule->num_cuxrs - i - 1; - if (ule->uxrs[curr_index].xid < gc_info->oldest_referenced_xid_for_simple_gc) { + if (ule->uxrs[curr_index].xid < + gc_info->oldest_referenced_xid_for_simple_gc) { break; } } @@ -250,12 +312,15 @@ ule_simple_garbage_collection(ULE ule, txn_gc_info *gc_info) { curr_index = ule->num_cuxrs - 1; } - // curr_index is now set to the youngest uxr older than oldest_referenced_xid - // so if it's not the bottom of the stack.. + // curr_index is now set to the youngest uxr older than + // oldest_referenced_xid so if it's not the bottom of the stack.. if (curr_index != 0) { // ..then we need to get rid of the entries below curr_index uint32_t num_entries = ule->num_cuxrs + ule->num_puxrs - curr_index; - memmove(&ule->uxrs[0], &ule->uxrs[curr_index], num_entries * sizeof(ule->uxrs[0])); + memmove( + &ule->uxrs[0], + &ule->uxrs[curr_index], + num_entries * sizeof(ule->uxrs[0])); ule->uxrs[0].xid = TXNID_NONE; // New 'bottom of stack' loses its TXNID ule->num_cuxrs -= curr_index; } @@ -264,8 +329,12 @@ ule_simple_garbage_collection(ULE ule, txn_gc_info *gc_info) { // TODO: Clean this up extern bool garbage_collection_debug; -static void -ule_garbage_collect(ULE ule, const xid_omt_t &snapshot_xids, const rx_omt_t &referenced_xids, const xid_omt_t &live_root_txns) { +static void ule_garbage_collect( + ULE ule, + const xid_omt_t& snapshot_xids, + const rx_omt_t& referenced_xids, + const xid_omt_t& live_root_txns) { + if (ule->num_cuxrs == 1) { return; } @@ -289,10 +358,12 @@ ule_garbage_collect(ULE ule, const xid_omt_t &snapshot_xids, const rx_omt_t &ref // If we find that the committed transaction is in the live list, // then xc is really in the process of being committed. It has not // been fully committed. As a result, our assumption that transactions - // newer than what is currently in these OMTs will read the top of the stack - // is not necessarily accurate. Transactions may read what is just below xc. - // As a result, we must mark what is just below xc as necessary and move on. - // This issue was found while testing flusher threads, and was fixed for #3979 + // newer than what is currently in these OMTs will read the top of the + // stack is not necessarily accurate. Transactions may read what is + // just below xc. + // As a result, we must mark what is just below xc as necessary and + // move on. This issue was found while testing flusher threads, and was + // fixed for #3979 // bool is_xc_live = toku_is_txn_in_live_root_txn_list(live_root_txns, xc); if (is_xc_live) { @@ -300,13 +371,19 @@ ule_garbage_collect(ULE ule, const xid_omt_t &snapshot_xids, const rx_omt_t &ref continue; } - tl1 = toku_get_youngest_live_list_txnid_for(xc, snapshot_xids, referenced_xids); + tl1 = + toku_get_youngest_live_list_txnid_for( + xc, + snapshot_xids, + referenced_xids); - // if tl1 == xc, that means xc should be live and show up in live_root_txns, which we check above. + // if tl1 == xc, that means xc should be live and show up in + // live_root_txns, which we check above. invariant(tl1 != xc); if (tl1 == TXNID_NONE) { - // set tl1 to youngest live transaction older than ule->uxrs[curr_committed_entry]->xid + // set tl1 to youngest live transaction older than + // ule->uxrs[curr_committed_entry]->xid tl1 = get_next_older_txnid(xc, snapshot_xids); if (tl1 == TXNID_NONE) { // remainder is garbage, we're done @@ -314,8 +391,13 @@ ule_garbage_collect(ULE ule, const xid_omt_t &snapshot_xids, const rx_omt_t &ref } } if (garbage_collection_debug) { - int r = snapshot_xids.find_zero(tl1, nullptr, nullptr); - invariant_zero(r); // make sure that the txn you are claiming is live is actually live + int r = + snapshot_xids.find_zero( + tl1, + nullptr, + nullptr); + // make sure that the txn you are claiming is live is actually live + invariant_zero(r); } // // tl1 should now be set @@ -323,7 +405,11 @@ ule_garbage_collect(ULE ule, const xid_omt_t &snapshot_xids, const rx_omt_t &ref curr_committed_entry--; while (curr_committed_entry > 0) { xc = ule->uxrs[curr_committed_entry].xid; - if (xid_reads_committed_xid(tl1, xc, snapshot_xids, referenced_xids)) { + if (xid_reads_committed_xid( + tl1, + xc, + snapshot_xids, + referenced_xids)) { break; } curr_committed_entry--; @@ -343,7 +429,10 @@ ule_garbage_collect(ULE ule, const xid_omt_t &snapshot_xids, const rx_omt_t &ref ule->uxrs[0].xid = TXNID_NONE; //New 'bottom of stack' loses its TXNID if (first_free != ule->num_cuxrs) { // Shift provisional values - memmove(&ule->uxrs[first_free], &ule->uxrs[ule->num_cuxrs], ule->num_puxrs * sizeof(ule->uxrs[0])); + memmove( + &ule->uxrs[first_free], + &ule->uxrs[ule->num_cuxrs], + ule->num_puxrs * sizeof(ule->uxrs[0])); } ule->num_cuxrs = saved; } @@ -367,29 +456,42 @@ enum { ULE_MIN_MEMSIZE_TO_FORCE_GC = 1024 * 1024 }; -///////////////////////////////////////////////////////////////////////////////// -// This is the big enchilada. (Bring Tums.) Note that this level of abstraction -// has no knowledge of the inner structure of either leafentry or msg. It makes -// calls into the next lower layer (msg_xxx) which handles messages. +//////////////////////////////////////////////////////////////////////////////// +// This is the big enchilada. (Bring Tums.) Note that this level of +// abstraction has no knowledge of the inner structure of either leafentry or +// msg. It makes calls into the next lower layer (msg_xxx) which handles +// messages. // // NOTE: This is the only function (at least in this body of code) that modifies // a leafentry. // NOTE: It is the responsibility of the caller to make sure that the key is set // in the FT_MSG, as it will be used to store the data in the data_buffer // -// Return 0 on success. -// If the leafentry is destroyed it sets *new_leafentry_p to NULL. -// Otehrwise the new_leafentry_p points at the new leaf entry. -// As of October 2011, this function always returns 0. -void -toku_le_apply_msg(const ft_msg &msg, - LEAFENTRY old_leafentry, // NULL if there was no stored data. - bn_data* data_buffer, // bn_data storing leafentry, if NULL, means there is no bn_data - uint32_t idx, // index in data_buffer where leafentry is stored (and should be replaced - uint32_t old_keylen, // length of the any key in data_buffer - txn_gc_info *gc_info, - LEAFENTRY *new_leafentry_p, - int64_t * numbytes_delta_p) { // change in total size of key and val, not including any overhead +// Returns -1, 0, or 1 that identifies the change in logical row count needed +// based on the results of the message application. For example, if a delete +// finds no logical leafentry or if an insert finds a duplicate and is +// converted to an update. +// +// old_leafentry - NULL if there was no stored data. +// data_buffer - bn_data storing leafentry, if NULL, means there is no bn_data +// idx - index in data_buffer where leafentry is stored +// (and should be replaced) +// old_keylen - length of the any key in data_buffer +// new_leafentry_p - If the leafentry is destroyed it sets *new_leafentry_p +// to NULL. Otherwise the new_leafentry_p points at the new +// leaf entry. +// numbytes_delta_p - change in total size of key and val, not including any +// overhead +int64_t toku_le_apply_msg( + const ft_msg& msg, + LEAFENTRY old_leafentry, + bn_data* data_buffer, + uint32_t idx, + uint32_t old_keylen, + txn_gc_info* gc_info, + LEAFENTRY* new_leafentry_p, + int64_t* numbytes_delta_p) { + invariant_notnull(gc_info); paranoid_invariant_notnull(new_leafentry_p); ULE_S ule; @@ -397,6 +499,7 @@ toku_le_apply_msg(const ft_msg &msg, int64_t newnumbytes = 0; uint64_t oldmemsize = 0; uint32_t keylen = msg.kdbt()->size; + int32_t rowcountdelta = 0; if (old_leafentry == NULL) { msg_init_empty_ule(&ule); @@ -405,49 +508,62 @@ toku_le_apply_msg(const ft_msg &msg, le_unpack(&ule, old_leafentry); // otherwise unpack leafentry oldnumbytes = ule_get_innermost_numbytes(&ule, keylen); } - msg_modify_ule(&ule, msg); // modify unpacked leafentry - // - we may be able to immediately promote the newly-apllied outermost provisonal uxr - // - either way, run simple gc first, and then full gc if there are still some committed uxrs. - ule_try_promote_provisional_outermost(&ule, gc_info->oldest_referenced_xid_for_implicit_promotion); + // modify unpacked leafentry + rowcountdelta = msg_modify_ule(&ule, msg); + + // - we may be able to immediately promote the newly-apllied outermost + // provisonal uxr + // - either way, run simple gc first, and then full gc if there are still + // some committed uxrs. + ule_try_promote_provisional_outermost( + &ule, + gc_info->oldest_referenced_xid_for_implicit_promotion); ule_simple_garbage_collection(&ule, gc_info); txn_manager_state *txn_state_for_gc = gc_info->txn_state_for_gc; size_t size_before_gc = 0; - if (ule.num_cuxrs > 1 && txn_state_for_gc != nullptr && // there is garbage to clean, and our caller gave us state.. - // ..and either the state is pre-initialized, or the committed stack is large enough - (txn_state_for_gc->initialized || ule.num_cuxrs >= ULE_MIN_STACK_SIZE_TO_FORCE_GC || - // ..or the ule's raw memsize is sufficiently large - (size_before_gc = ule_packed_memsize(&ule)) >= ULE_MIN_MEMSIZE_TO_FORCE_GC)) { - // ..then it's worth running gc, possibly initializing the txn manager state, if it isn't already + // there is garbage to clean, and our caller gave us state.. + // ..and either the state is pre-initialized, or the committed stack is + // large enough + // ..or the ule's raw memsize is sufficiently large + // ..then it's worth running gc, possibly initializing the txn manager + // state, if it isn't already + if (ule.num_cuxrs > 1 && txn_state_for_gc != nullptr && + (txn_state_for_gc->initialized || + ule.num_cuxrs >= ULE_MIN_STACK_SIZE_TO_FORCE_GC || + (size_before_gc = ule_packed_memsize(&ule)) >= + ULE_MIN_MEMSIZE_TO_FORCE_GC)) { if (!txn_state_for_gc->initialized) { txn_state_for_gc->init(); } - - size_before_gc = size_before_gc != 0 ? size_before_gc : // it's already been calculated above - ule_packed_memsize(&ule); - ule_garbage_collect(&ule, - txn_state_for_gc->snapshot_xids, - txn_state_for_gc->referenced_xids, - txn_state_for_gc->live_root_txns - ); + // it's already been calculated above + size_before_gc = + size_before_gc != 0 ? size_before_gc : ule_packed_memsize(&ule); + ule_garbage_collect( + &ule, + txn_state_for_gc->snapshot_xids, + txn_state_for_gc->referenced_xids, + txn_state_for_gc->live_root_txns); size_t size_after_gc = ule_packed_memsize(&ule); LE_STATUS_INC(LE_APPLY_GC_BYTES_IN, size_before_gc); LE_STATUS_INC(LE_APPLY_GC_BYTES_OUT, size_after_gc); } - void *maybe_free = nullptr; - int r = le_pack( - &ule, // create packed leafentry - data_buffer, - idx, - msg.kdbt()->data, // contract of this function is caller has this set, always - keylen, // contract of this function is caller has this set, always - old_keylen, - oldmemsize, - new_leafentry_p, - &maybe_free - ); + void* maybe_free = nullptr; + // create packed leafentry + // contract of this function is caller has keyp and keylen set, always + int r = + le_pack( + &ule, + data_buffer, + idx, + msg.kdbt()->data, + keylen, + old_keylen, + oldmemsize, + new_leafentry_p, + &maybe_free); invariant_zero(r); if (*new_leafentry_p) { newnumbytes = ule_get_innermost_numbytes(&ule, keylen); @@ -458,16 +574,22 @@ toku_le_apply_msg(const ft_msg &msg, if (maybe_free != nullptr) { toku_free(maybe_free); } + return rowcountdelta; } -bool toku_le_worth_running_garbage_collection(LEAFENTRY le, txn_gc_info *gc_info) { -// Effect: Quickly determines if it's worth trying to run garbage collection on a leafentry +bool toku_le_worth_running_garbage_collection( + LEAFENTRY le, + txn_gc_info* gc_info) { +// Effect: Quickly determines if it's worth trying to run garbage collection +// on a leafentry // Return: True if it makes sense to try garbage collection, false otherwise. // Rationale: Garbage collection is likely to clean up under two circumstances: -// 1.) There are multiple committed entries. Some may never be read by new txns. -// 2.) There is only one committed entry, but the outermost provisional entry -// is older than the oldest known referenced xid, so it must have commited. -// Therefor we can promote it to committed and get rid of the old commited entry. +// 1.) There are multiple committed entries. Some may never be read +// by new txns. +// 2.) There is only one committed entry, but the outermost +// provisional entry is older than the oldest known referenced +// xid, so it must have commited. Therefor we can promote it to +// committed and get rid of the old commited entry. if (le->type != LE_MVCC) { return false; } @@ -477,7 +599,8 @@ bool toku_le_worth_running_garbage_collection(LEAFENTRY le, txn_gc_info *gc_info paranoid_invariant(le->u.mvcc.num_cxrs == 1); } return le->u.mvcc.num_pxrs > 0 && - le_outermost_uncommitted_xid(le) < gc_info->oldest_referenced_xid_for_implicit_promotion; + le_outermost_uncommitted_xid(le) < + gc_info->oldest_referenced_xid_for_implicit_promotion; } // Garbage collect one leaf entry, using the given OMT's. @@ -498,16 +621,18 @@ bool toku_le_worth_running_garbage_collection(LEAFENTRY le, txn_gc_info *gc_info // -- referenced_xids : list of in memory active transactions. // NOTE: it is not a good idea to garbage collect a leaf // entry with only one committed value. -void -toku_le_garbage_collect(LEAFENTRY old_leaf_entry, - bn_data* data_buffer, - uint32_t idx, - void* keyp, - uint32_t keylen, - txn_gc_info *gc_info, - LEAFENTRY *new_leaf_entry, - int64_t * numbytes_delta_p) { - // We shouldn't want to run gc without having provided a snapshot of the txn system. +void toku_le_garbage_collect( + LEAFENTRY old_leaf_entry, + bn_data* data_buffer, + uint32_t idx, + void* keyp, + uint32_t keylen, + txn_gc_info* gc_info, + LEAFENTRY* new_leaf_entry, + int64_t* numbytes_delta_p) { + + // We shouldn't want to run gc without having provided a snapshot of the + // txn system. invariant_notnull(gc_info); invariant_notnull(gc_info->txn_state_for_gc); paranoid_invariant_notnull(new_leaf_entry); @@ -520,20 +645,24 @@ toku_le_garbage_collect(LEAFENTRY old_leaf_entry, oldnumbytes = ule_get_innermost_numbytes(&ule, keylen); uint32_t old_mem_size = leafentry_memsize(old_leaf_entry); - // Before running garbage collection, try to promote the outermost provisional - // entries to committed if its xid is older than the oldest possible live xid. + // Before running garbage collection, try to promote the outermost + // provisional entries to committed if its xid is older than the oldest + // possible live xid. // // The oldest known refeferenced xid is a lower bound on the oldest possible // live xid, so we use that. It's usually close enough to get rid of most // garbage in leafentries. - ule_try_promote_provisional_outermost(&ule, gc_info->oldest_referenced_xid_for_implicit_promotion); + ule_try_promote_provisional_outermost( + &ule, + gc_info->oldest_referenced_xid_for_implicit_promotion); // No need to run simple gc here if we're going straight for full gc. if (ule.num_cuxrs > 1) { size_t size_before_gc = ule_packed_memsize(&ule); - ule_garbage_collect(&ule, - gc_info->txn_state_for_gc->snapshot_xids, - gc_info->txn_state_for_gc->referenced_xids, - gc_info->txn_state_for_gc->live_root_txns); + ule_garbage_collect( + &ule, + gc_info->txn_state_for_gc->snapshot_xids, + gc_info->txn_state_for_gc->referenced_xids, + gc_info->txn_state_for_gc->live_root_txns); size_t size_after_gc = ule_packed_memsize(&ule); LE_STATUS_INC(LE_APPLY_GC_BYTES_IN, size_before_gc); @@ -541,17 +670,18 @@ toku_le_garbage_collect(LEAFENTRY old_leaf_entry, } void *maybe_free = nullptr; - int r = le_pack( - &ule, - data_buffer, - idx, - keyp, - keylen, - keylen, // old_keylen, same because the key isn't going to change for gc - old_mem_size, - new_leaf_entry, - &maybe_free - ); + // old_keylen, same because the key isn't going to change for gc + int r = + le_pack( + &ule, + data_buffer, + idx, + keyp, + keylen, + keylen, + old_mem_size, + new_leaf_entry, + &maybe_free); invariant_zero(r); if (*new_leaf_entry) { newnumbytes = ule_get_innermost_numbytes(&ule, keylen); @@ -564,49 +694,54 @@ toku_le_garbage_collect(LEAFENTRY old_leaf_entry, } } -///////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// // This layer of abstraction (msg_xxx) // knows the accessors of msg, but not of leafentry or unpacked leaf entry. // It makes calls into the lower layer (le_xxx) which handles leafentries. // Purpose is to init the ule with given key and no transaction records // -static void -msg_init_empty_ule(ULE ule) { +static inline void msg_init_empty_ule(ULE ule) { ule_init_empty_ule(ule); } // Purpose is to modify the unpacked leafentry in our private workspace. // -static void -msg_modify_ule(ULE ule, const ft_msg &msg) { +// Returns -1, 0, or 1 that identifies the change in logical row count needed +// based on the results of the message application. For example, if a delete +// finds no logical leafentry or if an insert finds a duplicate and is +// converted to an update. +static int64_t msg_modify_ule(ULE ule, const ft_msg &msg) { + int64_t retval = 0; XIDS xids = msg.xids(); invariant(toku_xids_get_num_xids(xids) < MAX_TRANSACTION_RECORDS); enum ft_msg_type type = msg.type(); - if (type != FT_OPTIMIZE && type != FT_OPTIMIZE_FOR_UPGRADE) { + if (FT_LIKELY(type != FT_OPTIMIZE && type != FT_OPTIMIZE_FOR_UPGRADE)) { ule_do_implicit_promotions(ule, xids); } switch (type) { - case FT_INSERT_NO_OVERWRITE: { - UXR old_innermost_uxr = ule_get_innermost_uxr(ule); - //If something exists, quit (no overwrite). - if (uxr_is_insert(old_innermost_uxr)) break; - //else it is just an insert, so - //fall through to FT_INSERT on purpose. - } - case FT_INSERT: { - uint32_t vallen = msg.vdbt()->size; - invariant(IS_VALID_LEN(vallen)); - void * valp = msg.vdbt()->data; - ule_apply_insert(ule, xids, vallen, valp); + case FT_INSERT_NO_OVERWRITE: + retval = + ule_apply_insert_no_overwrite( + ule, + xids, + msg.vdbt()->size, + msg.vdbt()->data); + break; + case FT_INSERT: + retval = + ule_apply_insert( + ule, + xids, + msg.vdbt()->size, + msg.vdbt()->data); break; - } case FT_DELETE_ANY: - ule_apply_delete(ule, xids); + retval = ule_apply_delete(ule, xids); break; case FT_ABORT_ANY: case FT_ABORT_BROADCAST_TXN: - ule_apply_abort(ule, xids); + retval = ule_apply_abort(ule, xids); break; case FT_COMMIT_BROADCAST_ALL: ule_apply_broadcast_commit_all(ule); @@ -621,34 +756,40 @@ msg_modify_ule(ULE ule, const ft_msg &msg) { break; case FT_UPDATE: case FT_UPDATE_BROADCAST_ALL: - assert(false); // These messages don't get this far. Instead they get translated (in setval_fun in do_update) into FT_INSERT messages. + // These messages don't get this far. Instead they get translated (in + // setval_fun in do_update) into FT_INSERT messages. + assert(false); break; default: - assert(false); /* illegal ft msg type */ + // illegal ft msg type + assert(false); break; } + return retval; } -void test_msg_modify_ule(ULE ule, const ft_msg &msg){ +void test_msg_modify_ule(ULE ule, const ft_msg &msg) { msg_modify_ule(ule,msg); } static void ule_optimize(ULE ule, XIDS xids) { if (ule->num_puxrs) { - TXNID uncommitted = ule->uxrs[ule->num_cuxrs].xid; // outermost uncommitted + // outermost uncommitted + TXNID uncommitted = ule->uxrs[ule->num_cuxrs].xid; TXNID oldest_living_xid = TXNID_NONE; uint32_t num_xids = toku_xids_get_num_xids(xids); if (num_xids > 0) { invariant(num_xids==1); oldest_living_xid = toku_xids_get_xid(xids, 0); } - if (oldest_living_xid == TXNID_NONE || uncommitted < oldest_living_xid) { + if (oldest_living_xid == TXNID_NONE || + uncommitted < oldest_living_xid) { ule_promote_provisional_innermost_to_committed(ule); } } } -///////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// // This layer of abstraction (le_xxx) understands the structure of the leafentry // and of the unpacked leafentry. It is the only layer that understands the // structure of leafentry. It has no knowledge of any other data structures. @@ -657,8 +798,7 @@ static void ule_optimize(ULE ule, XIDS xids) { // // required for every le_unpack that is done // -void -ule_cleanup(ULE ule) { +void ule_cleanup(ULE ule) { invariant(ule->uxrs); if (ule->uxrs != ule->uxrs_static) { toku_free(ule->uxrs); @@ -668,8 +808,7 @@ ule_cleanup(ULE ule) { // populate an unpacked leafentry using pointers into the given leafentry. // thus, the memory referenced by 'le' must live as long as the ULE. -void -le_unpack(ULE ule, LEAFENTRY le) { +void le_unpack(ULE ule, LEAFENTRY le) { uint8_t type = le->type; uint8_t *p; uint32_t i; @@ -694,9 +833,10 @@ le_unpack(ULE ule, LEAFENTRY le) { //Dynamic memory if (ule->num_cuxrs < MAX_TRANSACTION_RECORDS) { ule->uxrs = ule->uxrs_static; - } - else { - XMALLOC_N(ule->num_cuxrs + 1 + MAX_TRANSACTION_RECORDS, ule->uxrs); + } else { + XMALLOC_N( + ule->num_cuxrs + 1 + MAX_TRANSACTION_RECORDS, + ule->uxrs); } p = le->u.mvcc.xrs; @@ -717,9 +857,12 @@ le_unpack(ULE ule, LEAFENTRY le) { p += uxr_unpack_length_and_bit(innermost, p); } for (i = 0; i < ule->num_cuxrs; i++) { - p += uxr_unpack_length_and_bit(ule->uxrs + ule->num_cuxrs - 1 - i, p); + p += + uxr_unpack_length_and_bit( + ule->uxrs + ule->num_cuxrs - 1 - i, + p); } - + //unpack interesting values inner to outer if (ule->num_puxrs!=0) { UXR innermost = ule->uxrs + ule->num_cuxrs + ule->num_puxrs - 1; @@ -761,14 +904,12 @@ le_unpack(ULE ule, LEAFENTRY le) { #endif } -static inline size_t -uxr_pack_txnid(UXR uxr, uint8_t *p) { +static inline size_t uxr_pack_txnid(UXR uxr, uint8_t *p) { *(TXNID*)p = toku_htod64(uxr->xid); return sizeof(TXNID); } -static inline size_t -uxr_pack_type_and_length(UXR uxr, uint8_t *p) { +static inline size_t uxr_pack_type_and_length(UXR uxr, uint8_t *p) { size_t rval = 1; *p = uxr->type; if (uxr_is_insert(uxr)) { @@ -778,21 +919,18 @@ uxr_pack_type_and_length(UXR uxr, uint8_t *p) { return rval; } -static inline size_t -uxr_pack_length_and_bit(UXR uxr, uint8_t *p) { +static inline size_t uxr_pack_length_and_bit(UXR uxr, uint8_t *p) { uint32_t length_and_bit; if (uxr_is_insert(uxr)) { length_and_bit = INSERT_LENGTH(uxr->vallen); - } - else { + } else { length_and_bit = DELETE_LENGTH(uxr->vallen); } *(uint32_t*)p = toku_htod32(length_and_bit); return sizeof(uint32_t); } -static inline size_t -uxr_pack_data(UXR uxr, uint8_t *p) { +static inline size_t uxr_pack_data(UXR uxr, uint8_t *p) { if (uxr_is_insert(uxr)) { memcpy(p, uxr->valp, uxr->vallen); return uxr->vallen; @@ -800,14 +938,12 @@ uxr_pack_data(UXR uxr, uint8_t *p) { return 0; } -static inline size_t -uxr_unpack_txnid(UXR uxr, uint8_t *p) { +static inline size_t uxr_unpack_txnid(UXR uxr, uint8_t *p) { uxr->xid = toku_dtoh64(*(TXNID*)p); return sizeof(TXNID); } -static inline size_t -uxr_unpack_type_and_length(UXR uxr, uint8_t *p) { +static inline size_t uxr_unpack_type_and_length(UXR uxr, uint8_t *p) { size_t rval = 1; uxr->type = *p; if (uxr_is_insert(uxr)) { @@ -817,22 +953,19 @@ uxr_unpack_type_and_length(UXR uxr, uint8_t *p) { return rval; } -static inline size_t -uxr_unpack_length_and_bit(UXR uxr, uint8_t *p) { +static inline size_t uxr_unpack_length_and_bit(UXR uxr, uint8_t *p) { uint32_t length_and_bit = toku_dtoh32(*(uint32_t*)p); if (IS_INSERT(length_and_bit)) { uxr->type = XR_INSERT; uxr->vallen = GET_LENGTH(length_and_bit); - } - else { + } else { uxr->type = XR_DELETE; uxr->vallen = 0; } return sizeof(uint32_t); } -static inline size_t -uxr_unpack_data(UXR uxr, uint8_t *p) { +static inline size_t uxr_unpack_data(UXR uxr, uint8_t *p) { if (uxr_is_insert(uxr)) { uxr->valp = p; return uxr->vallen; @@ -841,8 +974,7 @@ uxr_unpack_data(UXR uxr, uint8_t *p) { } // executed too often to be worth making threadsafe -static inline void -update_le_status(ULE ule, size_t memsize) { +static inline void update_le_status(ULE ule, size_t memsize) { if (ule->num_cuxrs > LE_STATUS_VAL(LE_MAX_COMMITTED_XR)) LE_STATUS_VAL(LE_MAX_COMMITTED_XR) = ule->num_cuxrs; if (ule->num_puxrs > LE_STATUS_VAL(LE_MAX_PROVISIONAL_XR)) @@ -856,21 +988,22 @@ update_le_status(ULE ule, size_t memsize) { // Purpose is to return a newly allocated leaf entry in packed format, or // return null if leaf entry should be destroyed (if no transaction records // are for inserts). -// Transaction records in packed le are stored inner to outer (first xr is innermost), -// with some information extracted out of the transaction records into the header. +// Transaction records in packed le are stored inner to outer (first xr is +// innermost), with some information extracted out of the transaction records +// into the header. // Transaction records in ule are stored outer to inner (uxr[0] is outermost). -int -le_pack(ULE ule, // data to be packed into new leafentry - bn_data* data_buffer, - uint32_t idx, - void* keyp, - uint32_t keylen, - uint32_t old_keylen, - uint32_t old_le_size, - LEAFENTRY * const new_leafentry_p, // this is what this function creates - void **const maybe_free - ) -{ +// Takes 'ule' and creates 'new_leafentry_p +int le_pack( + ULE ule, + bn_data* data_buffer, + uint32_t idx, + void* keyp, + uint32_t keylen, + uint32_t old_keylen, + uint32_t old_le_size, + LEAFENTRY* const new_leafentry_p, + void** const maybe_free) { + invariant(ule->num_cuxrs > 0); invariant(ule->uxrs[0].xid == TXNID_NONE); int rval; @@ -888,7 +1021,8 @@ le_pack(ULE ule, // data to be packed into new leafentry } } if (data_buffer && old_le_size > 0) { - // must pass old_keylen and old_le_size, since that's what is actually stored in data_buffer + // must pass old_keylen and old_le_size, since that's what is + // actually stored in data_buffer data_buffer->delete_leafentry(idx, old_keylen, old_le_size); } *new_leafentry_p = NULL; @@ -898,14 +1032,24 @@ le_pack(ULE ule, // data to be packed into new leafentry found_insert: memsize = le_memsize_from_ule(ule); LEAFENTRY new_leafentry; - get_space_for_le(data_buffer, idx, keyp, keylen, old_keylen, old_le_size, memsize, &new_leafentry, maybe_free); + get_space_for_le( + data_buffer, + idx, + keyp, + keylen, + old_keylen, + old_le_size, + memsize, + &new_leafentry, + maybe_free); //p always points to first unused byte after leafentry we are packing uint8_t *p; invariant(ule->num_cuxrs>0); //Type specific data if (ule->num_cuxrs == 1 && ule->num_puxrs == 0) { - //Pack a 'clean leafentry' (no uncommitted transactions, only one committed value) + //Pack a 'clean leafentry' (no uncommitted transactions, only one + //committed value) new_leafentry->type = LE_CLEAN; uint32_t vallen = ule->uxrs[0].vallen; @@ -917,8 +1061,7 @@ found_insert: //Set p to after leafentry p = new_leafentry->u.clean.val + vallen; - } - else { + } else { uint32_t i; //Pack an 'mvcc leafentry' new_leafentry->type = LE_MVCC; @@ -969,7 +1112,9 @@ found_insert: p += uxr_pack_data(outermost, p); } //pack txnid, length, bit, data for non-outermost, non-innermost - for (i = ule->num_cuxrs + 1; i < ule->num_cuxrs + ule->num_puxrs - 1; i++) { + for (i = ule->num_cuxrs + 1; + i < ule->num_cuxrs + ule->num_puxrs - 1; + i++) { UXR uxr = ule->uxrs + i; p += uxr_pack_txnid(uxr, p); p += uxr_pack_type_and_length(uxr, p); @@ -1022,13 +1167,13 @@ cleanup: return rval; } -////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// // Following functions provide convenient access to a packed leafentry. //Requires: -// Leafentry that ule represents should not be destroyed (is not just all deletes) -size_t -le_memsize_from_ule (ULE ule) { +// Leafentry that ule represents should not be destroyed (is not just all +// deletes) +size_t le_memsize_from_ule (ULE ule) { invariant(ule->num_cuxrs); size_t rval; if (ule->num_cuxrs == 1 && ule->num_puxrs == 0) { @@ -1037,13 +1182,13 @@ le_memsize_from_ule (ULE ule) { rval = 1 //type +4 //vallen +committed->vallen; //actual val - } - else { + } else { rval = 1 //type +4 //num_cuxrs +1 //num_puxrs +4*(ule->num_cuxrs) //types+lengths for committed - +8*(ule->num_cuxrs + ule->num_puxrs - 1); //txnids (excluding superroot) + +8*(ule->num_cuxrs + ule->num_puxrs - 1); //txnids (excluding + //superroot) uint32_t i; //Count data from committed uxrs and innermost puxr for (i = 0; i < ule->num_cuxrs; i++) { @@ -1072,8 +1217,11 @@ le_memsize_from_ule (ULE ule) { } // TODO: rename -size_t -leafentry_rest_memsize(uint32_t num_puxrs, uint32_t num_cuxrs, uint8_t* start) { +size_t leafentry_rest_memsize( + uint32_t num_puxrs, + uint32_t num_cuxrs, + uint8_t* start) { + UXR_S uxr; size_t lengths = 0; uint8_t* p = start; @@ -1122,8 +1270,7 @@ leafentry_rest_memsize(uint32_t num_puxrs, uint32_t num_cuxrs, uint8_t* start) { return rval; } -size_t -leafentry_memsize (LEAFENTRY le) { +size_t leafentry_memsize (LEAFENTRY le) { size_t rval = 0; uint8_t type = le->type; @@ -1162,13 +1309,11 @@ leafentry_memsize (LEAFENTRY le) { return rval; } -size_t -leafentry_disksize (LEAFENTRY le) { +size_t leafentry_disksize (LEAFENTRY le) { return leafentry_memsize(le); } -bool -le_is_clean(LEAFENTRY le) { +bool le_is_clean(LEAFENTRY le) { uint8_t type = le->type; uint32_t rval; switch (type) { @@ -1228,13 +1373,14 @@ int le_latest_is_del(LEAFENTRY le) { // -// returns true if the outermost provisional transaction id on the leafentry's stack matches -// the outermost transaction id in xids -// It is used to determine if a broadcast commit/abort message (look in ft-ops.c) should be applied to this leafentry -// If the outermost transactions match, then the broadcast commit/abort should be applied +// returns true if the outermost provisional transaction id on the leafentry's +// stack matches the outermost transaction id in xids +// It is used to determine if a broadcast commit/abort message (look in ft-ops.c) +// should be applied to this leafentry +// If the outermost transactions match, then the broadcast commit/abort should +// be applied // -bool -le_has_xids(LEAFENTRY le, XIDS xids) { +bool le_has_xids(LEAFENTRY le, XIDS xids) { //Read num_uxrs uint32_t num_xids = toku_xids_get_num_xids(xids); invariant(num_xids > 0); //Disallow checking for having TXNID_NONE @@ -1245,8 +1391,7 @@ le_has_xids(LEAFENTRY le, XIDS xids) { return rval; } -void* -le_latest_val_and_len (LEAFENTRY le, uint32_t *len) { +void* le_latest_val_and_len (LEAFENTRY le, uint32_t *len) { uint8_t type = le->type; void *valp; @@ -1277,8 +1422,7 @@ le_latest_val_and_len (LEAFENTRY le, uint32_t *len) { if (uxr_is_insert(&uxr)) { *len = uxr.vallen; valp = p + (num_cuxrs - 1 + (num_puxrs!=0))*sizeof(uint32_t); - } - else { + } else { *len = 0; valp = NULL; } @@ -1295,8 +1439,7 @@ le_latest_val_and_len (LEAFENTRY le, uint32_t *len) { if (uxr_is_insert(uxr)) { slow_valp = uxr->valp; slow_len = uxr->vallen; - } - else { + } else { slow_valp = NULL; slow_len = 0; } @@ -1310,8 +1453,7 @@ le_latest_val_and_len (LEAFENTRY le, uint32_t *len) { } //DEBUG ONLY can be slow -void* -le_latest_val (LEAFENTRY le) { +void* le_latest_val (LEAFENTRY le) { ULE_S ule; le_unpack(&ule, le); UXR uxr = ule_get_innermost_uxr(&ule); @@ -1325,8 +1467,7 @@ le_latest_val (LEAFENTRY le) { } //needed to be fast for statistics. -uint32_t -le_latest_vallen (LEAFENTRY le) { +uint32_t le_latest_vallen (LEAFENTRY le) { uint32_t rval; uint8_t type = le->type; uint8_t *p; @@ -1354,8 +1495,7 @@ le_latest_vallen (LEAFENTRY le) { uxr_unpack_length_and_bit(&uxr, p); if (uxr_is_insert(&uxr)) { rval = uxr.vallen; - } - else { + } else { rval = 0; } break; @@ -1377,8 +1517,7 @@ le_latest_vallen (LEAFENTRY le) { return rval; } -uint64_t -le_outermost_uncommitted_xid (LEAFENTRY le) { +uint64_t le_outermost_uncommitted_xid (LEAFENTRY le) { uint64_t rval = TXNID_NONE; uint8_t type = le->type; @@ -1412,8 +1551,7 @@ le_outermost_uncommitted_xid (LEAFENTRY le) { //Optimization not required. This is a debug only function. //Print a leafentry out in human-readable format -int -print_klpair (FILE *outf, const void* keyp, uint32_t keylen, LEAFENTRY le) { +int print_klpair (FILE *outf, const void* keyp, uint32_t keylen, LEAFENTRY le) { ULE_S ule; le_unpack(&ule, le); uint32_t i; @@ -1444,23 +1582,21 @@ print_klpair (FILE *outf, const void* keyp, uint32_t keylen, LEAFENTRY le) { return 0; } -///////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// // This layer of abstraction (ule_xxx) knows the structure of the unpacked // leafentry and no other structure. // // ule constructor // Note that transaction 0 is explicit in the ule -static void -ule_init_empty_ule(ULE ule) { +static inline void ule_init_empty_ule(ULE ule) { ule->num_cuxrs = 1; ule->num_puxrs = 0; ule->uxrs = ule->uxrs_static; ule->uxrs[0] = committed_delete; } -static inline int32_t -min_i32(int32_t a, int32_t b) { +static inline int32_t min_i32(int32_t a, int32_t b) { int32_t rval = a < b ? a : b; return rval; } @@ -1470,8 +1606,8 @@ min_i32(int32_t a, int32_t b) { // // If the leafentry has already been promoted, there is nothing to do. // We have two transaction stacks (one from message, one from leaf entry). -// We want to implicitly promote transactions newer than (but not including) -// the innermost common ancestor (ICA) of the two stacks of transaction ids. We +// We want to implicitly promote transactions newer than (but not including) +// the innermost common ancestor (ICA) of the two stacks of transaction ids. We // know that this is the right thing to do because each transaction with an id // greater (later) than the ICA must have been either committed or aborted. // If it was aborted then we would have seen an abort message and removed the @@ -1483,8 +1619,7 @@ min_i32(int32_t a, int32_t b) { // record of ICA, keeping the transaction id of the ICA. // Outermost xid is zero for both ule and xids<> // -static void -ule_do_implicit_promotions(ULE ule, XIDS xids) { +static void ule_do_implicit_promotions(ULE ule, XIDS xids) { //Optimization for (most) common case. //No commits necessary if everything is already committed. if (ule->num_puxrs > 0) { @@ -1506,17 +1641,16 @@ ule_do_implicit_promotions(ULE ule, XIDS xids) { if (ica_index < ule->num_cuxrs) { invariant(ica_index == ule->num_cuxrs - 1); ule_promote_provisional_innermost_to_committed(ule); - } - else if (ica_index < ule->num_cuxrs + ule->num_puxrs - 1) { - //If ica is the innermost uxr in the leafentry, no commits are necessary. + } else if (ica_index < ule->num_cuxrs + ule->num_puxrs - 1) { + //If ica is the innermost uxr in the leafentry, no commits are + //necessary. ule_promote_provisional_innermost_to_index(ule, ica_index); } } } -static void -ule_promote_provisional_innermost_to_committed(ULE ule) { +static void ule_promote_provisional_innermost_to_committed(ULE ule) { //Must be something to promote. invariant(ule->num_puxrs); //Take value (or delete flag) from innermost. @@ -1532,8 +1666,7 @@ ule_promote_provisional_innermost_to_committed(ULE ule) { ule->num_puxrs = 0; //Discard all provisional uxrs. if (uxr_is_delete(old_innermost_uxr)) { ule_push_delete_uxr(ule, true, old_outermost_uncommitted_uxr->xid); - } - else { + } else { ule_push_insert_uxr(ule, true, old_outermost_uncommitted_uxr->xid, old_innermost_uxr->vallen, @@ -1541,11 +1674,13 @@ ule_promote_provisional_innermost_to_committed(ULE ule) { } } -static void -ule_try_promote_provisional_outermost(ULE ule, TXNID oldest_possible_live_xid) { +static void ule_try_promote_provisional_outermost( + ULE ule, + TXNID oldest_possible_live_xid) { // Effect: If there is a provisional record whose outermost xid is older than // the oldest known referenced_xid, promote it to committed. - if (ule->num_puxrs > 0 && ule_get_xid(ule, ule->num_cuxrs) < oldest_possible_live_xid) { + if (ule->num_puxrs > 0 && + ule_get_xid(ule, ule->num_cuxrs) < oldest_possible_live_xid) { ule_promote_provisional_innermost_to_committed(ule); } } @@ -1553,8 +1688,9 @@ ule_try_promote_provisional_outermost(ULE ule, TXNID oldest_possible_live_xid) { // Purpose is to promote the value (and type) of the innermost transaction // record to the uxr at the specified index (keeping the txnid of the uxr at // specified index.) -static void -ule_promote_provisional_innermost_to_index(ULE ule, uint32_t index) { +static void ule_promote_provisional_innermost_to_index( + ULE ule, + uint32_t index) { //Must not promote to committed portion of stack. invariant(index >= ule->num_cuxrs); //Must actually be promoting. @@ -1562,15 +1698,17 @@ ule_promote_provisional_innermost_to_index(ULE ule, uint32_t index) { UXR old_innermost_uxr = ule_get_innermost_uxr(ule); assert(!uxr_is_placeholder(old_innermost_uxr)); TXNID new_innermost_xid = ule->uxrs[index].xid; - ule->num_puxrs = index - ule->num_cuxrs; //Discard old uxr at index (and everything inner) + //Discard old uxr at index (and everything inner) + ule->num_puxrs = index - ule->num_cuxrs; if (uxr_is_delete(old_innermost_uxr)) { ule_push_delete_uxr(ule, false, new_innermost_xid); - } - else { - ule_push_insert_uxr(ule, false, - new_innermost_xid, - old_innermost_uxr->vallen, - old_innermost_uxr->valp); + } else { + ule_push_insert_uxr( + ule, + false, + new_innermost_xid, + old_innermost_uxr->vallen, + old_innermost_uxr->valp); } } @@ -1581,19 +1719,60 @@ ule_promote_provisional_innermost_to_index(ULE ule, uint32_t index) { // Purpose is to apply an insert message to this leafentry: -static void -ule_apply_insert(ULE ule, XIDS xids, uint32_t vallen, void * valp) { +static inline int64_t ule_apply_insert_no_overwrite( + ULE ule, + XIDS xids, + uint32_t vallen, + void* valp) { + + invariant(IS_VALID_LEN(vallen)); + int64_t retval = 0; + UXR old_innermost_uxr = ule_get_innermost_uxr(ule); + // If something exists, don't overwrite + if (uxr_is_insert(old_innermost_uxr)) { + retval = -1; + return retval; + } ule_prepare_for_new_uxr(ule, xids); - TXNID this_xid = toku_xids_get_innermost_xid(xids); // xid of transaction doing this insert + // xid of transaction doing this insert + TXNID this_xid = toku_xids_get_innermost_xid(xids); ule_push_insert_uxr(ule, this_xid == TXNID_NONE, this_xid, vallen, valp); + return retval; +} + +// Purpose is to apply an insert message to this leafentry: +static inline int64_t ule_apply_insert( + ULE ule, + XIDS xids, + uint32_t vallen, + void* valp) { + + invariant(IS_VALID_LEN(vallen)); + int64_t retval = 0; + UXR old_innermost_uxr = ule_get_innermost_uxr(ule); + // If something exists, overwrite + if (uxr_is_insert(old_innermost_uxr)) { + retval = -1; + } + ule_prepare_for_new_uxr(ule, xids); + // xid of transaction doing this insert + TXNID this_xid = toku_xids_get_innermost_xid(xids); + ule_push_insert_uxr(ule, this_xid == TXNID_NONE, this_xid, vallen, valp); + return retval; } // Purpose is to apply a delete message to this leafentry: -static void -ule_apply_delete(ULE ule, XIDS xids) { +static inline int64_t ule_apply_delete(ULE ule, XIDS xids) { + int64_t retval = 0; + UXR old_innermost_uxr = ule_get_innermost_uxr(ule); + if (FT_UNLIKELY(uxr_is_delete(old_innermost_uxr))) { + retval = 1; + } ule_prepare_for_new_uxr(ule, xids); - TXNID this_xid = toku_xids_get_innermost_xid(xids); // xid of transaction doing this delete + // xid of transaction doing this delete + TXNID this_xid = toku_xids_get_innermost_xid(xids); ule_push_delete_uxr(ule, this_xid == TXNID_NONE, this_xid); + return retval; } // First, discard anything done earlier by this transaction. @@ -1601,20 +1780,18 @@ ule_apply_delete(ULE ule, XIDS xids) { // outer transactions that are newer than then newest (innermost) transaction in // the leafentry. If so, record those outer transactions in the leafentry // with placeholders. -static void -ule_prepare_for_new_uxr(ULE ule, XIDS xids) { +static inline void ule_prepare_for_new_uxr(ULE ule, XIDS xids) { TXNID this_xid = toku_xids_get_innermost_xid(xids); //This is for LOADER_USE_PUTS or transactionless environment //where messages use XIDS of 0 if (this_xid == TXNID_NONE && ule_get_innermost_xid(ule) == TXNID_NONE) { ule_remove_innermost_uxr(ule); - } - // case where we are transactional and xids stack matches ule stack - else if (ule->num_puxrs > 0 && ule_get_innermost_xid(ule) == this_xid) { + } else if (ule->num_puxrs > 0 && ule_get_innermost_xid(ule) == this_xid) { + // case where we are transactional and xids stack matches ule stack ule_remove_innermost_uxr(ule); - } - // case where we are transactional and xids stack does not match ule stack - else { + } else { + // case where we are transactional and xids stack does not match ule + // stack ule_add_placeholders(ule, xids); } } @@ -1625,10 +1802,12 @@ ule_prepare_for_new_uxr(ULE ule, XIDS xids) { // then there is nothing to be done. // If this transaction did modify the leafentry, then undo whatever it did (by // removing the transaction record (uxr) and any placeholders underneath. -// Remember, the innermost uxr can only be an insert or a delete, not a placeholder. -static void -ule_apply_abort(ULE ule, XIDS xids) { - TXNID this_xid = toku_xids_get_innermost_xid(xids); // xid of transaction doing this abort +// Remember, the innermost uxr can only be an insert or a delete, not a +// placeholder. +static inline int64_t ule_apply_abort(ULE ule, XIDS xids) { + int64_t retval = 0; + // xid of transaction doing this abort + TXNID this_xid = toku_xids_get_innermost_xid(xids); invariant(this_xid!=TXNID_NONE); UXR innermost = ule_get_innermost_uxr(ule); // need to check for provisional entries in ule, otherwise @@ -1636,15 +1815,34 @@ ule_apply_abort(ULE ule, XIDS xids) { // in a bug where the most recently committed has same xid // as the XID's innermost if (ule->num_puxrs > 0 && innermost->xid == this_xid) { + // if this is a rollback of a delete of a new ule, return 0 + // (i.e. double delete) + if (uxr_is_delete(innermost)) { + if (ule->num_puxrs == 1 && ule->num_cuxrs == 1 && + uxr_is_delete(&(ule->uxrs[0]))) { + retval = 0; + } else { + retval = 1; + } + } else if (uxr_is_insert(innermost)) { + if (ule->num_puxrs == 1 && ule->num_cuxrs == 1 && + uxr_is_insert(&(ule->uxrs[0]))) { + retval = 0; + } else { + retval = -1; + } + } + // if this is a rollback of a insert of an exising ule, return 0 + // (i.e. double insert) invariant(ule->num_puxrs>0); ule_remove_innermost_uxr(ule); ule_remove_innermost_placeholders(ule); } invariant(ule->num_cuxrs > 0); + return retval; } -static void -ule_apply_broadcast_commit_all (ULE ule) { +static void ule_apply_broadcast_commit_all (ULE ule) { ule->uxrs[0] = ule->uxrs[ule->num_puxrs + ule->num_cuxrs - 1]; ule->uxrs[0].xid = TXNID_NONE; ule->num_puxrs = 0; @@ -1657,9 +1855,11 @@ ule_apply_broadcast_commit_all (ULE ule) { // then there is nothing to be done. // Also, if there are no uncommitted transaction records there is nothing to do. // If this transaction did modify the leafentry, then promote whatever it did. -// Remember, the innermost uxr can only be an insert or a delete, not a placeholder. +// Remember, the innermost uxr can only be an insert or a delete, not a +// placeholder. void ule_apply_commit(ULE ule, XIDS xids) { - TXNID this_xid = toku_xids_get_innermost_xid(xids); // xid of transaction committing + // xid of transaction committing + TXNID this_xid = toku_xids_get_innermost_xid(xids); invariant(this_xid!=TXNID_NONE); // need to check for provisional entries in ule, otherwise // there is nothing to abort, not checking this may result @@ -1668,16 +1868,19 @@ void ule_apply_commit(ULE ule, XIDS xids) { if (ule->num_puxrs > 0 && ule_get_innermost_xid(ule) == this_xid) { // 3 cases: //1- it's already a committed value (do nothing) (num_puxrs==0) - //2- it's provisional but root level (make a new committed value (num_puxrs==1) + //2- it's provisional but root level (make a new committed value + // (num_puxrs==1) //3- it's provisional and not root (promote); (num_puxrs>1) if (ule->num_puxrs == 1) { //new committed value ule_promote_provisional_innermost_to_committed(ule); - } - else if (ule->num_puxrs > 1) { - //ule->uxrs[ule->num_cuxrs+ule->num_puxrs-1] is the innermost (this transaction) + } else if (ule->num_puxrs > 1) { + //ule->uxrs[ule->num_cuxrs+ule->num_puxrs-1] is the innermost + // (this transaction) //ule->uxrs[ule->num_cuxrs+ule->num_puxrs-2] is the 2nd innermost //We want to promote the innermost uxr one level out. - ule_promote_provisional_innermost_to_index(ule, ule->num_cuxrs+ule->num_puxrs-2); + ule_promote_provisional_innermost_to_index( + ule, + ule->num_cuxrs+ule->num_puxrs-2); } } } @@ -1687,14 +1890,17 @@ void ule_apply_commit(ULE ule, XIDS xids) { // // Purpose is to record an insert for this transaction (and set type correctly). -static void -ule_push_insert_uxr(ULE ule, bool is_committed, TXNID xid, uint32_t vallen, void * valp) { - UXR uxr = ule_get_first_empty_uxr(ule); +static inline void ule_push_insert_uxr( + ULE ule, + bool is_committed, TXNID xid, + uint32_t vallen, + void* valp) { + + UXR uxr = ule_get_first_empty_uxr(ule); if (is_committed) { invariant(ule->num_puxrs==0); ule->num_cuxrs++; - } - else { + } else { ule->num_puxrs++; } uxr->xid = xid; @@ -1706,23 +1912,21 @@ ule_push_insert_uxr(ULE ule, bool is_committed, TXNID xid, uint32_t vallen, void // Purpose is to record a delete for this transaction. If this transaction // is the root transaction, then truly delete the leafentry by marking the // ule as empty. -static void -ule_push_delete_uxr(ULE ule, bool is_committed, TXNID xid) { +static inline void ule_push_delete_uxr(ULE ule, bool is_committed, TXNID xid) { UXR uxr = ule_get_first_empty_uxr(ule); if (is_committed) { invariant(ule->num_puxrs==0); ule->num_cuxrs++; - } - else { + } else { ule->num_puxrs++; } uxr->xid = xid; uxr->type = XR_DELETE; } -// Purpose is to push a placeholder on the top of the leafentry's transaction stack. -static void -ule_push_placeholder_uxr(ULE ule, TXNID xid) { +// Purpose is to push a placeholder on the top of the leafentry's transaction +// stack. +static inline void ule_push_placeholder_uxr(ULE ule, TXNID xid) { invariant(ule->num_cuxrs>0); UXR uxr = ule_get_first_empty_uxr(ule); uxr->xid = xid; @@ -1731,16 +1935,14 @@ ule_push_placeholder_uxr(ULE ule, TXNID xid) { } // Return innermost transaction record. -static UXR -ule_get_innermost_uxr(ULE ule) { +static inline UXR ule_get_innermost_uxr(ULE ule) { invariant(ule->num_cuxrs > 0); UXR rval = &(ule->uxrs[ule->num_cuxrs + ule->num_puxrs - 1]); return rval; } // Return first empty transaction record -static UXR -ule_get_first_empty_uxr(ULE ule) { +static inline UXR ule_get_first_empty_uxr(ULE ule) { invariant(ule->num_puxrs < MAX_TRANSACTION_RECORDS-1); UXR rval = &(ule->uxrs[ule->num_cuxrs+ule->num_puxrs]); return rval; @@ -1748,14 +1950,12 @@ ule_get_first_empty_uxr(ULE ule) { // Remove the innermost transaction (pop the leafentry's stack), undoing // whatever the innermost transaction did. -static void -ule_remove_innermost_uxr(ULE ule) { +static inline void ule_remove_innermost_uxr(ULE ule) { //It is possible to remove the committed delete at first insert. invariant(ule->num_cuxrs > 0); if (ule->num_puxrs) { ule->num_puxrs--; - } - else { + } else { //This is for LOADER_USE_PUTS or transactionless environment //where messages use XIDS of 0 invariant(ule->num_cuxrs == 1); @@ -1764,14 +1964,12 @@ ule_remove_innermost_uxr(ULE ule) { } } -static TXNID -ule_get_innermost_xid(ULE ule) { +static inline TXNID ule_get_innermost_xid(ULE ule) { TXNID rval = ule_get_xid(ule, ule->num_cuxrs + ule->num_puxrs - 1); return rval; } -static TXNID -ule_get_xid(ULE ule, uint32_t index) { +static inline TXNID ule_get_xid(ULE ule, uint32_t index) { invariant(index < ule->num_cuxrs + ule->num_puxrs); TXNID rval = ule->uxrs[index].xid; return rval; @@ -1781,8 +1979,7 @@ ule_get_xid(ULE ule, uint32_t index) { // innermost recorded transactions), if necessary. This function is idempotent. // It makes no logical sense for a placeholder to be the innermost recorded // transaction record, so placeholders at the top of the stack are not legal. -static void -ule_remove_innermost_placeholders(ULE ule) { +static void ule_remove_innermost_placeholders(ULE ule) { UXR uxr = ule_get_innermost_uxr(ule); while (uxr_is_placeholder(uxr)) { invariant(ule->num_puxrs>0); @@ -1796,8 +1993,7 @@ ule_remove_innermost_placeholders(ULE ule) { // Note, after placeholders are added, an insert or delete will be added. This // function temporarily leaves the transaction stack in an illegal state (having // placeholders on top). -static void -ule_add_placeholders(ULE ule, XIDS xids) { +static void ule_add_placeholders(ULE ule, XIDS xids) { //Placeholders can be placed on top of the committed uxr. invariant(ule->num_cuxrs > 0); @@ -1819,47 +2015,40 @@ ule_add_placeholders(ULE ule, XIDS xids) { } } -uint64_t -ule_num_uxrs(ULE ule) { +uint64_t ule_num_uxrs(ULE ule) { return ule->num_cuxrs + ule->num_puxrs; } -UXR -ule_get_uxr(ULE ule, uint64_t ith) { +UXR ule_get_uxr(ULE ule, uint64_t ith) { invariant(ith < ule_num_uxrs(ule)); return &ule->uxrs[ith]; } -uint32_t -ule_get_num_committed(ULE ule) { +uint32_t ule_get_num_committed(ULE ule) { return ule->num_cuxrs; } -uint32_t -ule_get_num_provisional(ULE ule) { +uint32_t ule_get_num_provisional(ULE ule) { return ule->num_puxrs; } -int -ule_is_committed(ULE ule, uint64_t ith) { +int ule_is_committed(ULE ule, uint64_t ith) { invariant(ith < ule_num_uxrs(ule)); return ith < ule->num_cuxrs; } -int -ule_is_provisional(ULE ule, uint64_t ith) { +int ule_is_provisional(ULE ule, uint64_t ith) { invariant(ith < ule_num_uxrs(ule)); return ith >= ule->num_cuxrs; } // return size of data for innermost uxr, the size of val -uint32_t -ule_get_innermost_numbytes(ULE ule, uint32_t keylen) { +uint32_t ule_get_innermost_numbytes(ULE ule, uint32_t keylen) { uint32_t rval; UXR uxr = ule_get_innermost_uxr(ule); - if (uxr_is_delete(uxr)) + if (uxr_is_delete(uxr)) { rval = 0; - else { + } else { rval = uxr_get_vallen(uxr) + keylen; } return rval; @@ -1870,68 +2059,65 @@ ule_get_innermost_numbytes(ULE ule, uint32_t keylen) { // This layer of abstraction (uxr_xxx) understands uxr and nothing else. // -static inline bool -uxr_type_is_insert(uint8_t type) { +static inline bool uxr_type_is_insert(uint8_t type) { bool rval = (bool)(type == XR_INSERT); return rval; } -bool -uxr_is_insert(UXR uxr) { +bool uxr_is_insert(UXR uxr) { return uxr_type_is_insert(uxr->type); } -static inline bool -uxr_type_is_delete(uint8_t type) { +static inline bool uxr_type_is_delete(uint8_t type) { bool rval = (bool)(type == XR_DELETE); return rval; } -bool -uxr_is_delete(UXR uxr) { +bool uxr_is_delete(UXR uxr) { return uxr_type_is_delete(uxr->type); } -static inline bool -uxr_type_is_placeholder(uint8_t type) { +static inline bool uxr_type_is_placeholder(uint8_t type) { bool rval = (bool)(type == XR_PLACEHOLDER); return rval; } -bool -uxr_is_placeholder(UXR uxr) { +bool uxr_is_placeholder(UXR uxr) { return uxr_type_is_placeholder(uxr->type); } -void * -uxr_get_val(UXR uxr) { +void* uxr_get_val(UXR uxr) { return uxr->valp; } -uint32_t -uxr_get_vallen(UXR uxr) { +uint32_t uxr_get_vallen(UXR uxr) { return uxr->vallen; } -TXNID -uxr_get_txnid(UXR uxr) { +TXNID uxr_get_txnid(UXR uxr) { return uxr->xid; } -static int -le_iterate_get_accepted_index(TXNID *xids, uint32_t *index, uint32_t num_xids, LE_ITERATE_CALLBACK f, TOKUTXN context, bool top_is_provisional) { +static int le_iterate_get_accepted_index( + TXNID* xids, + uint32_t* index, + uint32_t num_xids, + LE_ITERATE_CALLBACK f, + TOKUTXN context, + bool top_is_provisional) { + uint32_t i; int r = 0; - // if this for loop does not return anything, we return num_xids-1, which should map to T_0 + // if this for loop does not return anything, we return num_xids-1, which + // should map to T_0 for (i = 0; i < num_xids - 1; i++) { TXNID xid = toku_dtoh64(xids[i]); r = f(xid, context, (i == 0 && top_is_provisional)); if (r==TOKUDB_ACCEPT) { r = 0; break; //or goto something - } - else if (r!=0) { + } else if (r!=0) { break; } } @@ -1940,8 +2126,7 @@ le_iterate_get_accepted_index(TXNID *xids, uint32_t *index, uint32_t num_xids, L } #if ULE_DEBUG -static void -ule_verify_xids(ULE ule, uint32_t interesting, TXNID *xids) { +static void ule_verify_xids(ULE ule, uint32_t interesting, TXNID *xids) { int has_p = (ule->num_puxrs != 0); invariant(ule->num_cuxrs + has_p == interesting); uint32_t i; @@ -1953,21 +2138,29 @@ ule_verify_xids(ULE ule, uint32_t interesting, TXNID *xids) { #endif // -// Iterates over "possible" TXNIDs in a leafentry's stack, until one is accepted by 'f'. If the value -// associated with the accepted TXNID is not an insert, then set *is_emptyp to true, otherwise false +// Iterates over "possible" TXNIDs in a leafentry's stack, until one is +// accepted by 'f'. If the value associated with the accepted TXNID is not an +// insert, then set *is_emptyp to true, otherwise false // The "possible" TXNIDs are: -// if provisionals exist, then the first possible TXNID is the outermost provisional. -// The next possible TXNIDs are the committed TXNIDs, from most recently committed to T_0. -// If provisionals exist, and the outermost provisional is accepted by 'f', +// If provisionals exist, then the first possible TXNID is the outermost +// provisional. +// The next possible TXNIDs are the committed TXNIDs, from most recently +// committed to T_0. +// If provisionals exist, and the outermost provisional is accepted by 'f', // the associated value checked is the innermost provisional's value. // Parameters: // le - leafentry to iterate over -// f - callback function that checks if a TXNID in le is accepted, and its associated value should be examined. +// f - callback function that checks if a TXNID in le is accepted, and its +// associated value should be examined. // is_delp - output parameter that returns answer // context - parameter for f // -static int -le_iterate_is_del(LEAFENTRY le, LE_ITERATE_CALLBACK f, bool *is_delp, TOKUTXN context) { +static int le_iterate_is_del( + LEAFENTRY le, + LE_ITERATE_CALLBACK f, + bool* is_delp, + TOKUTXN context) { + #if ULE_DEBUG ULE_S ule; le_unpack(&ule, le); @@ -2002,8 +2195,17 @@ le_iterate_is_del(LEAFENTRY le, LE_ITERATE_CALLBACK f, bool *is_delp, TOKUTXN co #if ULE_DEBUG ule_verify_xids(&ule, num_interesting, xids); #endif - r = le_iterate_get_accepted_index(xids, &index, num_interesting, f, context, (num_puxrs != 0)); - if (r!=0) goto cleanup; + r = + le_iterate_get_accepted_index( + xids, + &index, + num_interesting, + f, + context, + (num_puxrs != 0)); + if (r != 0) { + goto cleanup; + } invariant(index < num_interesting); //Skip TXNIDs @@ -2017,7 +2219,9 @@ le_iterate_is_del(LEAFENTRY le, LE_ITERATE_CALLBACK f, bool *is_delp, TOKUTXN co #if ULE_DEBUG { uint32_t has_p = (ule.num_puxrs != 0); - uint32_t ule_index = (index==0) ? ule.num_cuxrs + ule.num_puxrs - 1 : ule.num_cuxrs - 1 + has_p - index; + uint32_t ule_index = (index==0) ? + ule.num_cuxrs + ule.num_puxrs - 1 : + ule.num_cuxrs - 1 + has_p - index; UXR uxr = ule.uxrs + ule_index; invariant(uxr_is_delete(uxr) == is_del); } @@ -2034,7 +2238,11 @@ cleanup: return r; } -static int le_iterate_read_committed_callback(TXNID txnid, TOKUTXN txn, bool is_provisional UU()) { +static int le_iterate_read_committed_callback( + TXNID txnid, + TOKUTXN txn, + bool is_provisional UU()) { + if (is_provisional) { return toku_txn_reads_txnid(txnid, txn, is_provisional); } @@ -2058,33 +2266,40 @@ int le_val_is_del(LEAFENTRY le, enum cursor_read_type read_type, TOKUTXN txn) { txn ); rval = is_del; - } - else if (read_type == C_READ_ANY) { + } else if (read_type == C_READ_ANY) { rval = le_latest_is_del(le); - } - else { + } else { invariant(false); } return rval; } // -// Iterates over "possible" TXNIDs in a leafentry's stack, until one is accepted by 'f'. Set -// valpp and vallenp to value and length associated with accepted TXNID +// Iterates over "possible" TXNIDs in a leafentry's stack, until one is accepted +// by 'f'. Set valpp and vallenp to value and length associated with accepted +// TXNID // The "possible" TXNIDs are: -// if provisionals exist, then the first possible TXNID is the outermost provisional. -// The next possible TXNIDs are the committed TXNIDs, from most recently committed to T_0. -// If provisionals exist, and the outermost provisional is accepted by 'f', +// If provisionals exist, then the first possible TXNID is the outermost +// provisional. +// The next possible TXNIDs are the committed TXNIDs, from most recently +// committed to T_0. +// If provisionals exist, and the outermost provisional is accepted by 'f', // the associated length value is the innermost provisional's length and value. // Parameters: // le - leafentry to iterate over -// f - callback function that checks if a TXNID in le is accepted, and its associated value should be examined. +// f - callback function that checks if a TXNID in le is accepted, and its +// associated value should be examined. // valpp - output parameter that returns pointer to value // vallenp - output parameter that returns length of value // context - parameter for f // -int -le_iterate_val(LEAFENTRY le, LE_ITERATE_CALLBACK f, void** valpp, uint32_t *vallenp, TOKUTXN context) { +int le_iterate_val( + LEAFENTRY le, + LE_ITERATE_CALLBACK f, + void** valpp, + uint32_t* vallenp, + TOKUTXN context) { + #if ULE_DEBUG ULE_S ule; le_unpack(&ule, le); @@ -2124,8 +2339,17 @@ le_iterate_val(LEAFENTRY le, LE_ITERATE_CALLBACK f, void** valpp, uint32_t *vall #if ULE_DEBUG ule_verify_xids(&ule, num_interesting, xids); #endif - r = le_iterate_get_accepted_index(xids, &index, num_interesting, f, context, (num_puxrs != 0)); - if (r!=0) goto cleanup; + r = + le_iterate_get_accepted_index( + xids, + &index, + num_interesting, + f, + context, + (num_puxrs != 0)); + if (r != 0) { + goto cleanup; + } invariant(index < num_interesting); //Skip TXNIDs @@ -2158,7 +2382,9 @@ le_iterate_val(LEAFENTRY le, LE_ITERATE_CALLBACK f, void** valpp, uint32_t *vall #if ULE_DEBUG { uint32_t has_p = (ule.num_puxrs != 0); - uint32_t ule_index = (index==0) ? ule.num_cuxrs + ule.num_puxrs - 1 : ule.num_cuxrs - 1 + has_p - index; + uint32_t ule_index = (index==0) ? + ule.num_cuxrs + ule.num_puxrs - 1 : + ule.num_cuxrs - 1 + has_p - index; UXR uxr = ule.uxrs + ule_index; invariant(uxr_is_insert(uxr)); invariant(uxr->vallen == vallen); @@ -2188,10 +2414,15 @@ cleanup: return r; } -void le_extract_val(LEAFENTRY le, - // should we return the entire leafentry as the val? - bool is_leaf_mode, enum cursor_read_type read_type, - TOKUTXN ttxn, uint32_t *vallen, void **val) { +void le_extract_val( + LEAFENTRY le, + // should we return the entire leafentry as the val? + bool is_leaf_mode, + enum cursor_read_type read_type, + TOKUTXN ttxn, + uint32_t* vallen, + void** val) { + if (is_leaf_mode) { *val = le; *vallen = leafentry_memsize(le); @@ -2199,18 +2430,11 @@ void le_extract_val(LEAFENTRY le, LE_ITERATE_CALLBACK f = (read_type == C_READ_SNAPSHOT) ? toku_txn_reads_txnid : le_iterate_read_committed_callback; - int r = le_iterate_val( - le, - f, - val, - vallen, - ttxn - ); + int r = le_iterate_val(le, f, val, vallen, ttxn); lazy_assert_zero(r); } else if (read_type == C_READ_ANY){ *val = le_latest_val_and_len(le, vallen); - } - else { + } else { assert(false); } } @@ -2244,9 +2468,9 @@ static_assert(18 == sizeof(leafentry_13), "wrong size"); static_assert(9 == __builtin_offsetof(leafentry_13, u), "wrong offset"); //Requires: -// Leafentry that ule represents should not be destroyed (is not just all deletes) -static size_t -le_memsize_from_ule_13 (ULE ule, LEAFENTRY_13 le) { +// Leafentry that ule represents should not be destroyed (is not just all +// deletes) +static size_t le_memsize_from_ule_13 (ULE ule, LEAFENTRY_13 le) { uint32_t num_uxrs = ule->num_cuxrs + ule->num_puxrs; assert(num_uxrs); size_t rval; @@ -2257,8 +2481,7 @@ le_memsize_from_ule_13 (ULE ule, LEAFENTRY_13 le) { +4 //vallen +le->keylen //actual key +ule->uxrs[0].vallen; //actual val - } - else { + } else { rval = 1 //num_uxrs +4 //keylen +le->keylen //actual key @@ -2276,16 +2499,20 @@ le_memsize_from_ule_13 (ULE ule, LEAFENTRY_13 le) { return rval; } -//This function is mostly copied from 4.1.1 (which is version 12, same as 13 except that only 13 is upgradable). -// Note, number of transaction records in version 13 has been replaced by separate counters in version 14 (MVCC), -// one counter for committed transaction records and one counter for provisional transaction records. When -// upgrading a version 13 le to version 14, the number of committed transaction records is always set to one (1) -// and the number of provisional transaction records is set to the original number of transaction records -// minus one. The bottom transaction record is assumed to be a committed value. (If there is no committed -// value then the bottom transaction record of version 13 is a committed delete.) -// This is the only change from the 4.1.1 code. The rest of the leafentry is read as is. -static void -le_unpack_13(ULE ule, LEAFENTRY_13 le) { +// This function is mostly copied from 4.1.1 (which is version 12, same as 13 +// except that only 13 is upgradable). +// Note, number of transaction records in version 13 has been replaced by +// separate counters in version 14 (MVCC), one counter for committed transaction +// records and one counter for provisional transaction records. When upgrading +// a version 13 le to version 14, the number of committed transaction records is +// always set to one (1) and the number of provisional transaction records is +// set to the original number of transaction records minus one. The bottom +// transaction record is assumed to be a committed value. (If there is no +// committed value then the bottom transaction record of version 13 is a +// committed delete.) +// This is the only change from the 4.1.1 code. The rest of the leafentry is +// read as is. +static void le_unpack_13(ULE ule, LEAFENTRY_13 le) { //Read num_uxrs uint8_t num_xrs = le->num_xrs; assert(num_xrs > 0); @@ -2302,15 +2529,15 @@ le_unpack_13(ULE ule, LEAFENTRY_13 le) { uint8_t *p; if (num_xrs == 1) { //Unpack a 'committed leafentry' (No uncommitted transactions exist) - ule->uxrs[0].type = XR_INSERT; //Must be or the leafentry would not exist + //Must be or the leafentry would not exist + ule->uxrs[0].type = XR_INSERT; ule->uxrs[0].vallen = vallen_of_innermost_insert; ule->uxrs[0].valp = &le->u.comm.key_val[keylen]; ule->uxrs[0].xid = 0; //Required. //Set p to immediately after leafentry p = &le->u.comm.key_val[keylen + vallen_of_innermost_insert]; - } - else { + } else { //Unpack a 'provisional leafentry' (Uncommitted transactions exist) //Read in type. @@ -2337,8 +2564,7 @@ le_unpack_13(ULE ule, LEAFENTRY_13 le) { //Not innermost, so load the type. uxr->type = *p; p += 1; - } - else { + } else { //Innermost, load the type previously read from header uxr->type = innermost_type; } @@ -2349,12 +2575,11 @@ le_unpack_13(ULE ule, LEAFENTRY_13 le) { //Not committed nor outermost uncommitted, so load the xid. uxr->xid = toku_dtoh64(*(TXNID*)p); p += 8; - } - else if (i == 1) { - //Outermost uncommitted, load the xid previously read from header + } else if (i == 1) { + //Outermost uncommitted, load the xid previously read from + //header uxr->xid = xid_outermost_uncommitted; - } - else { + } else { // i == 0, committed entry uxr->xid = 0; } @@ -2367,9 +2592,9 @@ le_unpack_13(ULE ule, LEAFENTRY_13 le) { uxr->valp = p; p += uxr->vallen; - } - else { - //Innermost insert, load the vallen/valp previously read from header + } else { + //Innermost insert, load the vallen/valp previously read + //from header uxr->vallen = vallen_of_innermost_insert; uxr->valp = valp_of_innermost_insert; found_innermost_insert = true; @@ -2384,8 +2609,7 @@ le_unpack_13(ULE ule, LEAFENTRY_13 le) { #endif } -size_t -leafentry_disksize_13(LEAFENTRY_13 le) { +size_t leafentry_disksize_13(LEAFENTRY_13 le) { ULE_S ule; le_unpack_13(&ule, le); size_t memsize = le_memsize_from_ule_13(&ule, le); @@ -2393,13 +2617,13 @@ leafentry_disksize_13(LEAFENTRY_13 le) { return memsize; } -int -toku_le_upgrade_13_14(LEAFENTRY_13 old_leafentry, - void** keyp, - uint32_t* keylen, - size_t *new_leafentry_memorysize, - LEAFENTRY *new_leafentry_p - ) { +int toku_le_upgrade_13_14( + LEAFENTRY_13 old_leafentry, + void** keyp, + uint32_t* keylen, + size_t* new_leafentry_memorysize, + LEAFENTRY* new_leafentry_p) { + ULE_S ule; int rval; invariant(old_leafentry); @@ -2408,23 +2632,23 @@ toku_le_upgrade_13_14(LEAFENTRY_13 old_leafentry, *keylen = old_leafentry->keylen; if (old_leafentry->num_xrs == 1) { *keyp = old_leafentry->u.comm.key_val; - } - else { + } else { *keyp = old_leafentry->u.prov.key_val_xrs; } // We used to pass NULL for omt and mempool, so that we would use // malloc instead of a mempool. However after supporting upgrade, // we need to use mempools and the OMT. - rval = le_pack(&ule, // create packed leafentry - nullptr, - 0, //only matters if we are passing in a bn_data - nullptr, //only matters if we are passing in a bn_data - 0, //only matters if we are passing in a bn_data - 0, //only matters if we are passing in a bn_data - 0, //only matters if we are passing in a bn_data - new_leafentry_p, - nullptr //only matters if we are passing in a bn_data - ); + rval = + le_pack( + &ule, // create packed leafentry + nullptr, + 0, //only matters if we are passing in a bn_data + nullptr, //only matters if we are passing in a bn_data + 0, //only matters if we are passing in a bn_data + 0, //only matters if we are passing in a bn_data + 0, //only matters if we are passing in a bn_data + new_leafentry_p, + nullptr); //only matters if we are passing in a bn_data ule_cleanup(&ule); *new_leafentry_memorysize = leafentry_memsize(*new_leafentry_p); return rval; diff --git a/storage/tokudb/PerconaFT/ftcxx/tests/CMakeLists.txt b/storage/tokudb/PerconaFT/ftcxx/tests/CMakeLists.txt index 8cea16c914d..6f9146ce5b2 100644 --- a/storage/tokudb/PerconaFT/ftcxx/tests/CMakeLists.txt +++ b/storage/tokudb/PerconaFT/ftcxx/tests/CMakeLists.txt @@ -2,6 +2,8 @@ include_directories(..) include_directories(../../src) include_directories(../../src/tests) +find_library(JEMALLOC_STATIC_LIBRARY libjemalloc.a) + if (BUILD_TESTING) ## reference implementation with simple size-doubling buffer without ## jemalloc size tricks @@ -24,15 +26,15 @@ if (BUILD_TESTING) cursor_test ) set(_testname ${impl}_${test}) - if (with_jemalloc) + if (with_jemalloc AND JEMALLOC_STATIC_LIBRARY) set(_testname ${_testname}_j) endif () add_executable(${_testname} ${test}) - if (with_jemalloc) + if (with_jemalloc AND JEMALLOC_STATIC_LIBRARY) if (APPLE) - target_link_libraries(${_testname} -Wl,-force_load jemalloc) + target_link_libraries(${_testname} -Wl,-force_load ${JEMALLOC_STATIC_LIBRARY}) else () - target_link_libraries(${_testname} -Wl,--whole-archive jemalloc -Wl,--no-whole-archive) + target_link_libraries(${_testname} -Wl,--whole-archive ${JEMALLOC_STATIC_LIBRARY} -Wl,--no-whole-archive) endif () endif () target_link_libraries(${_testname} ${impl}) diff --git a/storage/tokudb/PerconaFT/portability/toku_portability.h b/storage/tokudb/PerconaFT/portability/toku_portability.h index 921d3a309f6..459567552b1 100644 --- a/storage/tokudb/PerconaFT/portability/toku_portability.h +++ b/storage/tokudb/PerconaFT/portability/toku_portability.h @@ -178,6 +178,8 @@ extern void *realloc(void*, size_t) __THROW __attribute__((__deprecat # endif #if !defined(__APPLE__) // Darwin headers use these types, we should not poison them +#undef TRUE +#undef FALSE # pragma GCC poison u_int8_t # pragma GCC poison u_int16_t # pragma GCC poison u_int32_t diff --git a/storage/tokudb/PerconaFT/portability/toku_pthread.h b/storage/tokudb/PerconaFT/portability/toku_pthread.h index 25cf48dfd8c..84c27736201 100644 --- a/storage/tokudb/PerconaFT/portability/toku_pthread.h +++ b/storage/tokudb/PerconaFT/portability/toku_pthread.h @@ -72,15 +72,18 @@ typedef struct toku_mutex_aligned { toku_mutex_t aligned_mutex __attribute__((__aligned__(64))); } toku_mutex_aligned_t; -// Different OSes implement mutexes as different amounts of nested structs. -// C++ will fill out all missing values with zeroes if you provide at least one zero, but it needs the right amount of nesting. -#if defined(__FreeBSD__) -# define ZERO_MUTEX_INITIALIZER {0} -#elif defined(__APPLE__) -# define ZERO_MUTEX_INITIALIZER {{0}} -#else // __linux__, at least -# define ZERO_MUTEX_INITIALIZER {{{0}}} -#endif +// Initializing with {} will fill in a struct with all zeros. +// But you may also need a pragma to suppress the warnings, as follows +// +// #pragma GCC diagnostic push +// #pragma GCC diagnostic ignored "-Wmissing-field-initializers" +// toku_mutex_t foo = ZERO_MUTEX_INITIALIZER; +// #pragma GCC diagnostic pop +// +// In general it will be a lot of busy work to make this codebase compile +// cleanly with -Wmissing-field-initializers + +# define ZERO_MUTEX_INITIALIZER {} #if TOKU_PTHREAD_DEBUG # define TOKU_MUTEX_INITIALIZER { .pmutex = PTHREAD_MUTEX_INITIALIZER, .owner = 0, .locked = false, .valid = true } @@ -223,15 +226,9 @@ typedef struct toku_cond { pthread_cond_t pcond; } toku_cond_t; -// Different OSes implement mutexes as different amounts of nested structs. -// C++ will fill out all missing values with zeroes if you provide at least one zero, but it needs the right amount of nesting. -#if defined(__FreeBSD__) -# define ZERO_COND_INITIALIZER {0} -#elif defined(__APPLE__) -# define ZERO_COND_INITIALIZER {{0}} -#else // __linux__, at least -# define ZERO_COND_INITIALIZER {{{0}}} -#endif +// Same considerations as for ZERO_MUTEX_INITIALIZER apply +#define ZERO_COND_INITIALIZER {} + #define TOKU_COND_INITIALIZER {PTHREAD_COND_INITIALIZER} static inline void diff --git a/storage/tokudb/PerconaFT/portability/toku_time.h b/storage/tokudb/PerconaFT/portability/toku_time.h index c476b64a212..11a3f3aa2b9 100644 --- a/storage/tokudb/PerconaFT/portability/toku_time.h +++ b/storage/tokudb/PerconaFT/portability/toku_time.h @@ -108,3 +108,13 @@ static inline uint64_t toku_current_time_microsec(void) { gettimeofday(&t, NULL); return t.tv_sec * (1UL * 1000 * 1000) + t.tv_usec; } + +// sleep microseconds +static inline void toku_sleep_microsec(uint64_t ms) { + struct timeval t; + + t.tv_sec = ms / 1000000; + t.tv_usec = ms % 1000000; + + select(0, NULL, NULL, NULL, &t); +} diff --git a/storage/tokudb/PerconaFT/scripts/run.stress-tests.py b/storage/tokudb/PerconaFT/scripts/run.stress-tests.py index a8df83a3b55..e983fe8ccd9 100644 --- a/storage/tokudb/PerconaFT/scripts/run.stress-tests.py +++ b/storage/tokudb/PerconaFT/scripts/run.stress-tests.py @@ -521,14 +521,16 @@ Test output: })) def send_mail(toaddrs, subject, body): - m = MIMEText(body) - fromaddr = 'tim@tokutek.com' - m['From'] = fromaddr - m['To'] = ', '.join(toaddrs) - m['Subject'] = subject - s = SMTP('192.168.1.114') - s.sendmail(fromaddr, toaddrs, str(m)) - s.quit() + # m = MIMEText(body) + # fromaddr = 'dev-private@percona.com' + # m['From'] = fromaddr + # m['To'] = ', '.join(toaddrs) + # m['Subject'] = subject + # s = SMTP('192.168.1.114') + # s.sendmail(fromaddr, toaddrs, str(m)) + # s.quit() + info(subject); + info(body); def update(tokudb): info('Updating from git.') @@ -554,12 +556,12 @@ def rebuild(tokudb, builddir, tokudb_data, cc, cxx, tests): env=newenv, cwd=builddir) if r != 0: - send_mail(['leif@tokutek.com'], 'Stress tests on %s failed to build.' % gethostname(), '') + send_mail(['dev-private@percona.com'], 'Stress tests on %s failed to build.' % gethostname(), '') error('Building the tests failed.') sys.exit(r) r = call(['make', '-j8'], cwd=builddir) if r != 0: - send_mail(['leif@tokutek.com'], 'Stress tests on %s failed to build.' % gethostname(), '') + send_mail(['dev-private@percona.com'], 'Stress tests on %s failed to build.' % gethostname(), '') error('Building the tests failed.') sys.exit(r) @@ -671,7 +673,7 @@ def main(opts): sys.exit(0) except Exception, e: exception('Unhandled exception caught in main.') - send_mail(['leif@tokutek.com'], 'Stress tests caught unhandled exception in main, on %s' % gethostname(), format_exc()) + send_mail(['dev-private@percona.com'], 'Stress tests caught unhandled exception in main, on %s' % gethostname(), format_exc()) raise e if __name__ == '__main__': @@ -786,7 +788,7 @@ if __name__ == '__main__': if not opts.send_emails: opts.email = None elif len(opts.email) == 0: - opts.email.append('tokueng@tokutek.com') + opts.email.append('dev-private@percona.com') if opts.debug: logging.basicConfig(level=logging.DEBUG) diff --git a/storage/tokudb/PerconaFT/src/export.map b/storage/tokudb/PerconaFT/src/export.map index 3f2c7569ea4..fc2be5f41a5 100644 --- a/storage/tokudb/PerconaFT/src/export.map +++ b/storage/tokudb/PerconaFT/src/export.map @@ -82,6 +82,7 @@ toku_test_db_redirect_dictionary; toku_test_get_latest_lsn; toku_test_get_checkpointing_user_data_status; + toku_set_test_txn_sync_callback; toku_indexer_set_test_only_flags; toku_increase_last_xid; diff --git a/storage/tokudb/PerconaFT/src/indexer-undo-do.cc b/storage/tokudb/PerconaFT/src/indexer-undo-do.cc index b93429407eb..8d0b080b9fe 100644 --- a/storage/tokudb/PerconaFT/src/indexer-undo-do.cc +++ b/storage/tokudb/PerconaFT/src/indexer-undo-do.cc @@ -313,7 +313,7 @@ indexer_undo_do_provisional(DB_INDEXER *indexer, DB *hotdb, struct ule_prov_info break; if (outermost_xid_state != TOKUTXN_LIVE && xrindex > num_committed) { - // if the outermost is not live, then the inner state must be retired. thats the way that the txn API works. + // If the outermost is not live, then the inner state must be retired. That's the way that the txn API works. assert(this_xid_state == TOKUTXN_RETIRED); } diff --git a/storage/tokudb/PerconaFT/src/tests/CMakeLists.txt b/storage/tokudb/PerconaFT/src/tests/CMakeLists.txt index 70977a9dfda..47f6aa44a75 100644 --- a/storage/tokudb/PerconaFT/src/tests/CMakeLists.txt +++ b/storage/tokudb/PerconaFT/src/tests/CMakeLists.txt @@ -53,7 +53,7 @@ if(BUILD_TESTING OR BUILD_SRC_TESTS) target_link_libraries(test-5138.tdb ${LIBTOKUDB}_static z ${LIBTOKUPORTABILITY}_static ${CMAKE_THREAD_LIBS_INIT} ${EXTRA_SYSTEM_LIBS}) add_space_separated_property(TARGET test-5138.tdb COMPILE_FLAGS -fvisibility=hidden) add_ydb_test(test-5138.tdb) - + add_ydb_test(rollback-inconsistency.tdb) foreach(bin ${tdb_bins}) get_filename_component(base ${bin} NAME_WE) diff --git a/storage/tokudb/PerconaFT/src/tests/loader-dup-test.cc b/storage/tokudb/PerconaFT/src/tests/loader-dup-test.cc index 3f2f8d7455a..aaf77c503cc 100644 --- a/storage/tokudb/PerconaFT/src/tests/loader-dup-test.cc +++ b/storage/tokudb/PerconaFT/src/tests/loader-dup-test.cc @@ -51,7 +51,7 @@ int DISALLOW_PUTS=0; int COMPRESS=0; enum {MAGIC=311}; -bool dup_row_at_end = false; // false: duplicate at the begining. true: duplicate at the end. The duplicated row is row 0. +bool dup_row_at_end = false; // false: duplicate at the beginning. true: duplicate at the end. The duplicated row is row 0. int dup_row_id = 0; // 0 means to use row 1 if inserting at the end, row NUM_ROWS if inserting at the beginning. Otherwise insert the row specified here. // diff --git a/storage/tokudb/PerconaFT/src/tests/rollback-inconsistency.cc b/storage/tokudb/PerconaFT/src/tests/rollback-inconsistency.cc new file mode 100644 index 00000000000..f8099c7a639 --- /dev/null +++ b/storage/tokudb/PerconaFT/src/tests/rollback-inconsistency.cc @@ -0,0 +1,161 @@ +/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ +// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4: +#ident "$Id$" +/*====== +This file is part of PerconaFT. + + +Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. + + PerconaFT is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License, version 2, + as published by the Free Software Foundation. + + PerconaFT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with PerconaFT. If not, see . + +---------------------------------------- + + PerconaFT is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License, version 3, + as published by the Free Software Foundation. + + PerconaFT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with PerconaFT. If not, see . +======= */ + +#ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." + +#include "test.h" + +// insert enough rows with a child txn and then force an eviction to verify the rollback +// log node is in valid state. +// the test fails without the fix (and of course passes with it). +// The test basically simulates the test script of George's. + + +static void +populate_table(int start, int end, DB_TXN * parent, DB_ENV * env, DB * db) { + DB_TXN *txn = NULL; + int r = env->txn_begin(env, parent, &txn, 0); assert_zero(r); + for (int i = start; i < end; i++) { + int k = htonl(i); + char kk[4]; + char str[220]; + memset(kk, 0, sizeof kk); + memcpy(kk, &k, sizeof k); + memset(str,'a', sizeof str); + DBT key = { .data = kk, .size = sizeof kk }; + DBT val = { .data = str, .size = sizeof str }; + r = db->put(db, txn, &key, &val, 0); + assert_zero(r); + } + r = txn->commit(txn, 0); + assert_zero(r); +} + +static void +populate_and_test(DB_ENV *env, DB *db) { + int r; + DB_TXN *parent = NULL; + r = env->txn_begin(env, NULL, &parent, 0); assert_zero(r); + + populate_table(0, 128, parent, env, db); + + //we know the eviction is going to happen here and the log node of parent txn is going to be evicted + //due to the extremely low cachesize. + populate_table(128, 256, parent, env, db); + + //again eviction due to the memory pressure. 256 rows is the point when that rollback log spills out. The spilled node + //will be written back but will not be dirtied by including rollback nodes from child txn(in which case the bug is bypassed). + populate_table(256, 512, parent, env, db); + + r = parent->abort(parent); assert_zero(r); + + //try to search anything in the lost range + int k = htonl(200); + char kk[4]; + memset(kk, 0, sizeof kk); + memcpy(kk, &k, sizeof k); + DBT key = { .data = kk, .size = sizeof kk }; + DBT val; + r = db->get(db, NULL, &key, &val, 0); + assert(r==DB_NOTFOUND); + +} + +static void +run_test(void) { + int r; + DB_ENV *env = NULL; + r = db_env_create(&env, 0); + assert_zero(r); + env->set_errfile(env, stderr); + + //setting up the cachetable size 64k + uint32_t cachesize = 64*1024; + r = env->set_cachesize(env, 0, cachesize, 1); + assert_zero(r); + + //setting up the log write block size to 4k so the rollback log nodes spill in accordance with the node size + r = env->set_lg_bsize(env, 4096); + assert_zero(r); + + r = env->open(env, TOKU_TEST_FILENAME, DB_INIT_MPOOL|DB_CREATE|DB_THREAD |DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_TXN|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); + assert_zero(r); + + DB *db = NULL; + r = db_create(&db, env, 0); + assert_zero(r); + + r = db->set_pagesize(db, 4096); + assert_zero(r); + + r = db->set_readpagesize(db, 1024); + assert_zero(r); + + r = db->open(db, NULL, "test.tdb", NULL, DB_BTREE, DB_AUTO_COMMIT+DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); + assert_zero(r); + + populate_and_test(env, db); + + r = db->close(db, 0); assert_zero(r); + + r = env->close(env, 0); assert_zero(r); +} + +int +test_main(int argc, char * const argv[]) { + int r; + + // parse_args(argc, argv); + for (int i = 1; i < argc; i++) { + char * const arg = argv[i]; + if (strcmp(arg, "-v") == 0) { + verbose++; + continue; + } + if (strcmp(arg, "-q") == 0) { + verbose = 0; + continue; + } + } + + toku_os_recursive_delete(TOKU_TEST_FILENAME); + r = toku_os_mkdir(TOKU_TEST_FILENAME, S_IRWXU+S_IRWXG+S_IRWXO); assert_zero(r); + + run_test(); + + return 0; +} + diff --git a/storage/tokudb/PerconaFT/src/tests/stat64-root-changes.cc b/storage/tokudb/PerconaFT/src/tests/stat64-root-changes.cc index 0c70b0669ad..a2b48e443cd 100644 --- a/storage/tokudb/PerconaFT/src/tests/stat64-root-changes.cc +++ b/storage/tokudb/PerconaFT/src/tests/stat64-root-changes.cc @@ -166,7 +166,7 @@ run_test (void) { DB_BTREE_STAT64 s; r = db->stat64(db, NULL, &s); CKERR(r); - assert(s.bt_nkeys == 1 && s.bt_dsize == sizeof key + sizeof val); + assert(s.bt_nkeys == 0); r = db->close(db, 0); CKERR(r); @@ -176,7 +176,7 @@ run_test (void) { r = txn->commit(txn, 0); CKERR(r); r = db->stat64(db, NULL, &s); CKERR(r); - assert(s.bt_nkeys == 1 && s.bt_dsize == sizeof key + sizeof val); + assert(s.bt_nkeys == 0); } // verify update callback overwrites the row diff --git a/storage/tokudb/PerconaFT/src/tests/test_db_rowcount.cc b/storage/tokudb/PerconaFT/src/tests/test_db_rowcount.cc new file mode 100644 index 00000000000..c440bdc59e7 --- /dev/null +++ b/storage/tokudb/PerconaFT/src/tests/test_db_rowcount.cc @@ -0,0 +1,523 @@ +/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ +// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4: +#ident "$Id$" +/*====== +This file is part of PerconaFT. + + +Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. + + PerconaFT is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License, version 2, + as published by the Free Software Foundation. + + PerconaFT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with PerconaFT. If not, see . + +---------------------------------------- + + PerconaFT is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License, version 3, + as published by the Free Software Foundation. + + PerconaFT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with PerconaFT. If not, see . +======= */ + +#ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." + +#include "test.h" +#include + +#include +#include + +// Tests that the logical row counts are correct and not subject to variance +// due to normal insert/delete messages within the tree with the few exceptions +// of 1) rollback messages not yet applied; 2) inserts messages turned to +// updates on apply; and 3) missing leafentries on delete messages on apply. + +static DB_TXN* const null_txn = 0; +static const uint64_t num_records = 4*1024; + +#define CHECK_NUM_ROWS(_expected, _stats) assert(_stats.bt_ndata == _expected) + +static DB* create_db(const char* fname, DB_ENV* env) { + int r; + DB* db; + + r = db_create(&db, env, 0); + assert(r == 0); + db->set_errfile(db, stderr); + + r = db->set_pagesize(db, 8192); + assert(r == 0); + + r = db->set_readpagesize(db, 1024); + assert(r == 0); + + r = db->set_fanout(db, 4); + assert(r == 0); + + r = db->set_compression_method(db, TOKU_NO_COMPRESSION); + assert(r == 0); + + r = db->open(db, null_txn, fname, "main", DB_BTREE, DB_CREATE, + 0666); + assert(r == 0); + + return db; +} +static void add_records(DB* db, DB_TXN* txn, uint64_t start_id, uint64_t num) { + int r; + for (uint64_t i = 0, j=start_id; i < num; i++,j++) { + char key[100], val[256]; + DBT k,v; + snprintf(key, 100, "%08" PRIu64, j); + snprintf(val, 256, "%*s", 200, key); + r = + db->put( + db, + txn, + dbt_init(&k, key, 1+strlen(key)), + dbt_init(&v, val, 1+strlen(val)), + 0); + assert(r == 0); + } +} +static void delete_records( + DB* db, + DB_TXN* txn, + uint64_t start_id, + uint64_t num) { + + int r; + for (uint64_t i = 0, j=start_id; i < num; i++,j++) { + char key[100]; + DBT k; + snprintf(key, 100, "%08" PRIu64, j); + r = + db->del( + db, + txn, + dbt_init(&k, key, 1+strlen(key)), + 0); + assert(r == 0); + } +} +static void full_optimize(DB* db) { + int r; + uint64_t loops_run = 0; + + r = db->optimize(db); + assert(r == 0); + + r = db->hot_optimize(db, NULL, NULL, NULL, NULL, &loops_run); + assert(r == 0); +} +static void test_insert_commit(DB_ENV* env) { + int r; + DB* db; + DB_TXN* txn; + DB_BTREE_STAT64 stats; + + db = create_db(__FUNCTION__, env); + + r = env->txn_begin(env, null_txn, &txn, 0); + assert(r == 0); + + add_records(db, txn, 0, num_records); + + r = db->stat64(db, null_txn, &stats); + assert(r == 0); + + CHECK_NUM_ROWS(num_records, stats); + if (verbose) + printf("%s : before commit %" PRIu64 " rows\n", __FUNCTION__, stats.bt_ndata); + + r = txn->commit(txn, 0); + assert(r == 0); + + r = db->stat64(db, null_txn, &stats); + assert(r == 0); + + CHECK_NUM_ROWS(num_records, stats); + if (verbose) + printf("%s : after commit %" PRIu64 " rows\n", __FUNCTION__, stats.bt_ndata); + + db->close(db, 0); +} +static void test_insert_delete_commit(DB_ENV* env) { + int r; + DB* db; + DB_TXN* txn; + DB_BTREE_STAT64 stats; + + db = create_db(__FUNCTION__, env); + + r = env->txn_begin(env, null_txn, &txn, 0); + assert(r == 0); + + add_records(db, txn, 0, num_records); + + r = db->stat64(db, null_txn, &stats); + assert(r == 0); + + CHECK_NUM_ROWS(num_records, stats); + if (verbose) + printf("%s : before delete %" PRIu64 " rows\n", __FUNCTION__, stats.bt_ndata); + + delete_records(db, txn, 0, num_records); + + r = db->stat64(db, null_txn, &stats); + assert(r == 0); + + CHECK_NUM_ROWS(0, stats); + if (verbose) + printf("%s : after delete %" PRIu64 " rows\n", __FUNCTION__, stats.bt_ndata); + + r = txn->commit(txn, 0); + assert(r == 0); + + r = db->stat64(db, null_txn, &stats); + assert(r == 0); + + CHECK_NUM_ROWS(0, stats); + if (verbose) + printf("%s : after commit %" PRIu64 " rows\n", __FUNCTION__, stats.bt_ndata); + + db->close(db, 0); +} +static void test_insert_commit_delete_commit(DB_ENV* env) { + int r; + DB* db; + DB_TXN* txn; + DB_BTREE_STAT64 stats; + + db = create_db(__FUNCTION__, env); + + r = env->txn_begin(env, null_txn, &txn, 0); + assert(r == 0); + + add_records(db, txn, 0, num_records); + + r = db->stat64(db, null_txn, &stats); + assert(r == 0); + + CHECK_NUM_ROWS(num_records, stats); + if (verbose) + printf( + "%s : before insert commit %" PRIu64 " rows\n", + __FUNCTION__, + stats.bt_ndata); + + r = txn->commit(txn, 0); + assert(r == 0); + + r = db->stat64(db, null_txn, &stats); + assert(r == 0); + + CHECK_NUM_ROWS(num_records, stats); + if (verbose) + printf( + "%s : after insert commit %" PRIu64 " rows\n", + __FUNCTION__, + stats.bt_ndata); + + r = env->txn_begin(env, null_txn, &txn, 0); + assert(r == 0); + + delete_records(db, txn, 0, num_records); + + r = db->stat64(db, null_txn, &stats); + assert(r == 0); + + CHECK_NUM_ROWS(0, stats); + if (verbose) + printf("%s : after delete %" PRIu64 " rows\n", __FUNCTION__, stats.bt_ndata); + + r = txn->commit(txn, 0); + assert(r == 0); + + r = db->stat64(db, null_txn, &stats); + assert(r == 0); + + CHECK_NUM_ROWS(0, stats); + if (verbose) + printf( + "%s : after delete commit %" PRIu64 " rows\n", + __FUNCTION__, + stats.bt_ndata); + + db->close(db, 0); +} +static void test_insert_rollback(DB_ENV* env) { + int r; + DB* db; + DB_TXN* txn; + DB_BTREE_STAT64 stats; + + db = create_db(__FUNCTION__, env); + + r = env->txn_begin(env, null_txn, &txn, 0); + assert(r == 0); + + add_records(db, txn, 0, num_records); + + r = db->stat64(db, null_txn, &stats); + assert(r == 0); + + CHECK_NUM_ROWS(num_records, stats); + if (verbose) + printf("%s : before rollback %" PRIu64 " rows\n", __FUNCTION__, stats.bt_ndata); + + r = txn->abort(txn); + assert(r == 0); + + r = db->stat64(db, null_txn, &stats); + assert(r == 0); + + // CAN NOT TEST stats HERE AS THEY ARE SOMEWHAT NON_DETERMINISTIC UNTIL + // optimize + hot_optimize HAVE BEEN RUN DUE TO THE FACT THAT ROLLBACK + // MESSAGES ARE "IN-FLIGHT" IN THE TREE AND MUST BE APPLIED IN ORDER TO + // CORRECT THE RUNNING LOGICAL COUNT + if (verbose) + printf("%s : after rollback %" PRIu64 " rows\n", __FUNCTION__, stats.bt_ndata); + + full_optimize(db); + + r = db->stat64(db, null_txn, &stats); + assert(r == 0); + + CHECK_NUM_ROWS(0, stats); + if (verbose) + printf( + "%s : after rollback optimize %" PRIu64 " rows\n", + __FUNCTION__, + stats.bt_ndata); + + db->close(db, 0); +} +static void test_insert_delete_rollback(DB_ENV* env) { + int r; + DB* db; + DB_TXN* txn; + DB_BTREE_STAT64 stats; + + db = create_db(__FUNCTION__, env); + + r = env->txn_begin(env, null_txn, &txn, 0); + assert(r == 0); + + add_records(db, txn, 0, num_records); + + r = db->stat64(db, null_txn, &stats); + assert(r == 0); + + CHECK_NUM_ROWS(num_records, stats); + if (verbose) + printf("%s : before delete %" PRIu64 " rows\n", __FUNCTION__, stats.bt_ndata); + + delete_records(db, txn, 0, num_records); + + r = db->stat64(db, null_txn, &stats); + assert(r == 0); + + CHECK_NUM_ROWS(0, stats); + if (verbose) + printf("%s : after delete %" PRIu64 " rows\n", __FUNCTION__, stats.bt_ndata); + + r = txn->abort(txn); + assert(r == 0); + + r = db->stat64(db, null_txn, &stats); + assert(r == 0); + + CHECK_NUM_ROWS(0, stats); + if (verbose) + printf("%s : after commit %" PRIu64 " rows\n", __FUNCTION__, stats.bt_ndata); + + db->close(db, 0); +} +static void test_insert_commit_delete_rollback(DB_ENV* env) { + int r; + DB* db; + DB_TXN* txn; + DB_BTREE_STAT64 stats; + + db = create_db(__FUNCTION__, env); + + r = env->txn_begin(env, null_txn, &txn, 0); + assert(r == 0); + + add_records(db, txn, 0, num_records); + + r = db->stat64(db, null_txn, &stats); + assert(r == 0); + + CHECK_NUM_ROWS(num_records, stats); + if (verbose) + printf( + "%s : before insert commit %" PRIu64 " rows\n", + __FUNCTION__, + stats.bt_ndata); + + r = txn->commit(txn, 0); + assert(r == 0); + + r = db->stat64(db, null_txn, &stats); + assert(r == 0); + + CHECK_NUM_ROWS(num_records, stats); + if (verbose) + printf( + "%s : after insert commit %" PRIu64 " rows\n", + __FUNCTION__, + stats.bt_ndata); + + r = env->txn_begin(env, null_txn, &txn, 0); + assert(r == 0); + + delete_records(db, txn, 0, num_records); + + r = db->stat64(db, null_txn, &stats); + assert(r == 0); + + CHECK_NUM_ROWS(0, stats); + if (verbose) + printf("%s : after delete %" PRIu64 " rows\n", __FUNCTION__, stats.bt_ndata); + + r = txn->abort(txn); + assert(r == 0); + + r = db->stat64(db, null_txn, &stats); + assert(r == 0); + + // CAN NOT TEST stats HERE AS THEY ARE SOMEWHAT NON_DETERMINISTIC UNTIL + // optimize + hot_optimize HAVE BEEN RUN DUE TO THE FACT THAT ROLLBACK + // MESSAGES ARE "IN-FLIGHT" IN THE TREE AND MUST BE APPLIED IN ORDER TO + // CORRECT THE RUNNING LOGICAL COUNT + if (verbose) + printf( + "%s : after delete rollback %" PRIu64 " rows\n", + __FUNCTION__, + stats.bt_ndata); + + full_optimize(db); + + r = db->stat64(db, null_txn, &stats); + assert(r == 0); + + CHECK_NUM_ROWS(num_records, stats); + if (verbose) + printf( + "%s : after delete rollback optimize %" PRIu64 " rows\n", + __FUNCTION__, + stats.bt_ndata); + + db->close(db, 0); +} + +static int test_recount_insert_commit_progress( + uint64_t count, + uint64_t deleted, + void*) { + + if (verbose) + printf( + "%s : count[%" PRIu64 "] deleted[%" PRIu64 "]\n", + __FUNCTION__, + count, + deleted); + return 0; +} +static int test_recount_cancel_progress(uint64_t, uint64_t, void*) { + return 1; +} + +static void test_recount_insert_commit(DB_ENV* env) { + int r; + DB* db; + DB_TXN* txn; + DB_BTREE_STAT64 stats; + + db = create_db(__FUNCTION__, env); + + r = env->txn_begin(env, null_txn, &txn, 0); + assert(r == 0); + + add_records(db, txn, 0, num_records); + + r = db->stat64(db, null_txn, &stats); + assert(r == 0); + + CHECK_NUM_ROWS(num_records, stats); + if (verbose) + printf( + "%s : before commit %" PRIu64 " rows\n", + __FUNCTION__, + stats.bt_ndata); + + r = txn->commit(txn, 0); + assert(r == 0); + + r = db->stat64(db, null_txn, &stats); + assert(r == 0); + + CHECK_NUM_ROWS(num_records, stats); + if (verbose) + printf("%s : after commit %" PRIu64 " rows\n", __FUNCTION__, stats.bt_ndata); + + // test that recount counted correct # of rows + r = db->recount_rows(db, test_recount_insert_commit_progress, NULL); + assert(r == 0); + CHECK_NUM_ROWS(num_records, stats); + + // test that recount callback cancel returns + r = db->recount_rows(db, test_recount_cancel_progress, NULL); + assert(r == 1); + CHECK_NUM_ROWS(num_records, stats); + + db->close(db, 0); +} +int test_main(int UU(argc), char UU(*const argv[])) { + int r; + DB_ENV* env; + + toku_os_recursive_delete(TOKU_TEST_FILENAME); + toku_os_mkdir(TOKU_TEST_FILENAME, S_IRWXU + S_IRWXG + S_IRWXO); + + r = db_env_create(&env, 0); + assert(r == 0); + + r = + env->open( + env, + TOKU_TEST_FILENAME, + DB_INIT_MPOOL + DB_INIT_LOG + DB_INIT_TXN + DB_PRIVATE + DB_CREATE, + S_IRWXU + S_IRWXG + S_IRWXO); + assert(r == 0); + + test_insert_commit(env); + test_insert_delete_commit(env); + test_insert_commit_delete_commit(env); + test_insert_rollback(env); + test_insert_delete_rollback(env); + test_insert_commit_delete_rollback(env); + test_recount_insert_commit(env); + + r = env->close(env, 0); + assert(r == 0); + + return 0; +} diff --git a/storage/tokudb/PerconaFT/src/tests/txn_manager_handle_snapshot_atomicity.cc b/storage/tokudb/PerconaFT/src/tests/txn_manager_handle_snapshot_atomicity.cc new file mode 100644 index 00000000000..30cc16d73a7 --- /dev/null +++ b/storage/tokudb/PerconaFT/src/tests/txn_manager_handle_snapshot_atomicity.cc @@ -0,0 +1,217 @@ +/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ +// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4: +#ident "$Id$" +/*====== +This file is part of PerconaFT. + + +Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. + + PerconaFT is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License, version 2, + as published by the Free Software Foundation. + + PerconaFT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with PerconaFT. If not, see . + +---------------------------------------- + + PerconaFT is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License, version 3, + as published by the Free Software Foundation. + + PerconaFT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with PerconaFT. If not, see . +======= */ + +#ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." + +//In response to the read-commit crash bug in the sysbench, this test is created to test +//the atomicity of the txn manager when handling the child txn snapshot. +//The test is supposed to fail before the read-commit-fix. + +#include "test.h" +#include "toku_pthread.h" +#include "ydb.h" +struct test_sync { + int state; + toku_mutex_t lock; + toku_cond_t cv; +}; + +static void test_sync_init(struct test_sync *UU(sync)) { +#if TOKU_DEBUG_TXN_SYNC + sync->state = 0; + toku_mutex_init(&sync->lock, NULL); + toku_cond_init(&sync->cv, NULL); +#endif +} + +static void test_sync_destroy(struct test_sync *UU(sync)) { +#if TOKU_DEBUG_TXN_SYNC + toku_mutex_destroy(&sync->lock); + toku_cond_destroy(&sync->cv); +#endif +} + +static void test_sync_sleep(struct test_sync *UU(sync), int UU(new_state)) { +#if TOKU_DEBUG_TXN_SYNC + toku_mutex_lock(&sync->lock); + while (sync->state != new_state) { + toku_cond_wait(&sync->cv, &sync->lock); + } + toku_mutex_unlock(&sync->lock); +#endif +} + +static void test_sync_next_state(struct test_sync *UU(sync)) { +#if TOKU_DEBUG_TXN_SYNC + toku_mutex_lock(&sync->lock); + sync->state++; + toku_cond_broadcast(&sync->cv); + toku_mutex_unlock(&sync->lock); +#endif +} + + +struct start_txn_arg { + DB_ENV *env; + DB *db; + DB_TXN * parent; +}; + +static struct test_sync sync_s; + +static void test_callback(pthread_t self_tid, void * extra) { + pthread_t **p = (pthread_t **) extra; + pthread_t tid_1 = *p[0]; + pthread_t tid_2 = *p[1]; + assert(pthread_equal(self_tid, tid_2)); + printf("%s: the thread[%" PRIu64 "] is going to wait...\n", __func__, reinterpret_cast(tid_1)); + test_sync_next_state(&sync_s); + sleep(3); + //test_sync_sleep(&sync_s,3); + //using test_sync_sleep/test_sync_next_state pair can sync threads better, however + //after the fix, this might cause a deadlock. just simply use sleep to do a proof- + //of-concept test. + printf("%s: the thread[%" PRIu64 "] is resuming...\n", __func__, reinterpret_cast(tid_1)); + return; +} + +static void * start_txn2(void * extra) { + struct start_txn_arg * args = (struct start_txn_arg *) extra; + DB_ENV * env = args -> env; + DB * db = args->db; + DB_TXN * parent = args->parent; + test_sync_sleep(&sync_s, 1); + printf("start %s [thread %" PRIu64 "]\n", __func__, reinterpret_cast(pthread_self())); + DB_TXN *txn; + int r = env->txn_begin(env, parent, &txn, DB_READ_COMMITTED); + assert(r == 0); + //do some random things... + DBT key, data; + dbt_init(&key, "hello", 6); + dbt_init(&data, "world", 6); + db->put(db, txn, &key, &data, 0); + db->get(db, txn, &key, &data, 0); + + r = txn->commit(txn, 0); + assert(r == 0); + printf("%s done[thread %" PRIu64 "]\n", __func__, reinterpret_cast(pthread_self())); + return extra; +} + +static void * start_txn1(void * extra) { + struct start_txn_arg * args = (struct start_txn_arg *) extra; + DB_ENV * env = args -> env; + DB * db = args->db; + printf("start %s: [thread %" PRIu64 "]\n", __func__, reinterpret_cast(pthread_self())); + DB_TXN *txn; + int r = env->txn_begin(env, NULL, &txn, DB_READ_COMMITTED); + assert(r == 0); + printf("%s: txn began by [thread %" PRIu64 "], will wait\n", __func__, reinterpret_cast(pthread_self())); + test_sync_next_state(&sync_s); + test_sync_sleep(&sync_s,2); + printf("%s: [thread %" PRIu64 "] resumed\n", __func__, reinterpret_cast(pthread_self())); + //do some random things... + DBT key, data; + dbt_init(&key, "hello", 6); + dbt_init(&data, "world", 6); + db->put(db, txn, &key, &data, 0); + db->get(db, txn, &key, &data, 0); + r = txn->commit(txn, 0); + assert(r == 0); + printf("%s: done[thread %" PRIu64 "]\n", __func__, reinterpret_cast(pthread_self())); + //test_sync_next_state(&sync_s); + return extra; +} + +int test_main (int UU(argc), char * const UU(argv[])) { + int r; + toku_os_recursive_delete(TOKU_TEST_FILENAME); + r = toku_os_mkdir(TOKU_TEST_FILENAME, S_IRWXU+S_IRWXG+S_IRWXO); + assert(r == 0); + + DB_ENV *env; + r = db_env_create(&env, 0); + assert(r == 0); + + r = env->open(env, TOKU_TEST_FILENAME, DB_INIT_MPOOL|DB_CREATE|DB_THREAD |DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_TXN|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); + assert(r == 0); + + DB *db = NULL; + r = db_create(&db, env, 0); + assert(r == 0); + + r = db->open(db, NULL, "testit", NULL, DB_BTREE, DB_AUTO_COMMIT+DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); + assert(r == 0); + + DB_TXN * parent = NULL; + r = env->txn_begin(env, 0, &parent, DB_READ_COMMITTED); + assert(r == 0); + + ZERO_STRUCT(sync_s); + test_sync_init(&sync_s); + + pthread_t tid_1 = 0; + pthread_t tid_2 = 0; + pthread_t* callback_extra[2] = {&tid_1, &tid_2}; + toku_set_test_txn_sync_callback(test_callback, callback_extra); + + struct start_txn_arg args = {env, db, parent}; + + r = pthread_create(&tid_1, NULL, start_txn1, &args); + assert(r==0); + + r= pthread_create(&tid_2, NULL, start_txn2, &args); + assert(r==0); + + void * ret; + r = pthread_join(tid_1, &ret); + assert(r == 0); + r = pthread_join(tid_2, &ret); + assert(r == 0); + + r = parent->commit(parent, 0); + assert(r ==0); + + test_sync_destroy(&sync_s); + r = db->close(db, 0); + assert(r == 0); + + r = env->close(env, 0); + assert(r == 0); + + return 0; +} + diff --git a/storage/tokudb/PerconaFT/src/ydb.cc b/storage/tokudb/PerconaFT/src/ydb.cc index 88c6c86f214..1b977599c0c 100644 --- a/storage/tokudb/PerconaFT/src/ydb.cc +++ b/storage/tokudb/PerconaFT/src/ydb.cc @@ -39,6 +39,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. extern const char *toku_patent_string; const char *toku_copyright_string = "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved."; +#include #include #include #include @@ -3148,6 +3149,10 @@ toku_test_get_latest_lsn(DB_ENV *env) { return rval.lsn; } +void toku_set_test_txn_sync_callback(void (* cb) (pthread_t, void *), void * extra) { + set_test_txn_sync_callback(cb, extra); +} + int toku_test_get_checkpointing_user_data_status (void) { return toku_cachetable_get_checkpointing_user_data_status(); diff --git a/storage/tokudb/PerconaFT/src/ydb.h b/storage/tokudb/PerconaFT/src/ydb.h index 9d4e94c6f30..facbfdc9252 100644 --- a/storage/tokudb/PerconaFT/src/ydb.h +++ b/storage/tokudb/PerconaFT/src/ydb.h @@ -58,3 +58,6 @@ extern "C" uint64_t toku_test_get_latest_lsn(DB_ENV *env) __attribute__((__visib // test-only function extern "C" int toku_test_get_checkpointing_user_data_status(void) __attribute__((__visibility__("default"))); + +// test-only function +extern "C" void toku_set_test_txn_sync_callback(void (* ) (pthread_t, void *), void * extra) __attribute__((__visibility__("default"))); diff --git a/storage/tokudb/PerconaFT/src/ydb_db.cc b/storage/tokudb/PerconaFT/src/ydb_db.cc index 25b24467684..10e44e18b39 100644 --- a/storage/tokudb/PerconaFT/src/ydb_db.cc +++ b/storage/tokudb/PerconaFT/src/ydb_db.cc @@ -36,6 +36,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." +#include #include #include @@ -1015,6 +1016,25 @@ toku_db_verify_with_progress(DB *db, int (*progress_callback)(void *extra, float return r; } + +static int +toku_db_recount_rows(DB* db, int (*progress_callback)(uint64_t count, + uint64_t deleted, + void* progress_extra), + void* progress_extra) { + + HANDLE_PANICKED_DB(db); + int r = 0; + r = + toku_ft_recount_rows( + db->i->ft_handle, + progress_callback, + progress_extra); + + return r; +} + + int toku_setup_db_internal (DB **dbp, DB_ENV *env, uint32_t flags, FT_HANDLE ft_handle, bool is_open) { if (flags || env == NULL) return EINVAL; @@ -1098,6 +1118,7 @@ toku_db_create(DB ** db, DB_ENV * env, uint32_t flags) { USDB(dbt_pos_infty); USDB(dbt_neg_infty); USDB(get_fragmentation); + USDB(recount_rows); #undef USDB result->get_indexer = db_get_indexer; result->del = autotxn_db_del; diff --git a/storage/tokudb/PerconaFT/src/ydb_env_func.cc b/storage/tokudb/PerconaFT/src/ydb_env_func.cc index 13c56fec6bf..cd5388106ac 100644 --- a/storage/tokudb/PerconaFT/src/ydb_env_func.cc +++ b/storage/tokudb/PerconaFT/src/ydb_env_func.cc @@ -36,6 +36,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." +#include #include #include diff --git a/storage/tokudb/PerconaFT/third_party/xz-4.999.9beta/configure b/storage/tokudb/PerconaFT/third_party/xz-4.999.9beta/configure index 9dc3178ba75..2d3e2062f0d 100755 --- a/storage/tokudb/PerconaFT/third_party/xz-4.999.9beta/configure +++ b/storage/tokudb/PerconaFT/third_party/xz-4.999.9beta/configure @@ -19985,7 +19985,7 @@ fi # Set additional flags for static/dynamic linking. The idea is that every # program (not library) being built will use either STATIC_{CPPFLAGS,LDFLAGS} # or DYNAMIC_{CPPFLAGS,LDFLAGS} depending on which type of linkage is -# preferred. These preferences get overriden by use of --disable-static, +# preferred. These preferences get overridden by use of --disable-static, # --disable-shared, or --enable-dynamic. # # This is quite messy, because we want to use LZMA_API_STATIC when linking diff --git a/storage/tokudb/PerconaFT/third_party/xz-4.999.9beta/configure.ac b/storage/tokudb/PerconaFT/third_party/xz-4.999.9beta/configure.ac index d125a6936da..148f174169e 100644 --- a/storage/tokudb/PerconaFT/third_party/xz-4.999.9beta/configure.ac +++ b/storage/tokudb/PerconaFT/third_party/xz-4.999.9beta/configure.ac @@ -642,7 +642,7 @@ AC_SUBST([AM_CFLAGS]) # Set additional flags for static/dynamic linking. The idea is that every # program (not library) being built will use either STATIC_{CPPFLAGS,LDFLAGS} # or DYNAMIC_{CPPFLAGS,LDFLAGS} depending on which type of linkage is -# preferred. These preferences get overriden by use of --disable-static, +# preferred. These preferences get overridden by use of --disable-static, # --disable-shared, or --enable-dynamic. # # This is quite messy, because we want to use LZMA_API_STATIC when linking diff --git a/storage/tokudb/PerconaFT/third_party/xz-4.999.9beta/doc/man/txt/xz.txt b/storage/tokudb/PerconaFT/third_party/xz-4.999.9beta/doc/man/txt/xz.txt index e3dacde4a11..e9b0ee5e810 100644 --- a/storage/tokudb/PerconaFT/third_party/xz-4.999.9beta/doc/man/txt/xz.txt +++ b/storage/tokudb/PerconaFT/third_party/xz-4.999.9beta/doc/man/txt/xz.txt @@ -112,7 +112,7 @@ DESCRIPTION The absolute value of the active memory usage limit can be seen near the bottom of the output of --long-help. The default limit can be - overriden with --memory=limit. + overridden with --memory=limit. OPTIONS Integer suffixes and special values diff --git a/storage/tokudb/PerconaFT/third_party/xz-4.999.9beta/src/xz/main.c b/storage/tokudb/PerconaFT/third_party/xz-4.999.9beta/src/xz/main.c index 17fe0aa85b9..40f48645220 100644 --- a/storage/tokudb/PerconaFT/third_party/xz-4.999.9beta/src/xz/main.c +++ b/storage/tokudb/PerconaFT/third_party/xz-4.999.9beta/src/xz/main.c @@ -212,7 +212,7 @@ main(int argc, char **argv) // do other message handling related initializations. message_init(argv[0]); - // Set hardware-dependent default values. These can be overriden + // Set hardware-dependent default values. These can be overridden // on the command line, thus this must be done before parse_args(). hardware_init(); diff --git a/storage/tokudb/PerconaFT/third_party/xz-4.999.9beta/src/xz/xz.1 b/storage/tokudb/PerconaFT/third_party/xz-4.999.9beta/src/xz/xz.1 index 2fef75f43a5..ad3d8463141 100644 --- a/storage/tokudb/PerconaFT/third_party/xz-4.999.9beta/src/xz/xz.1 +++ b/storage/tokudb/PerconaFT/third_party/xz-4.999.9beta/src/xz/xz.1 @@ -222,7 +222,7 @@ data has already been decompressed. The absolute value of the active memory usage limit can be seen near the bottom of the output of .BR \-\-long\-help . -The default limit can be overriden with +The default limit can be overridden with \fB\-\-memory=\fIlimit\fR. .SH OPTIONS .SS "Integer suffixes and special values" diff --git a/storage/tokudb/ha_tokudb.cc b/storage/tokudb/ha_tokudb.cc index 2e3542e6eb4..79d85a9b77c 100644 --- a/storage/tokudb/ha_tokudb.cc +++ b/storage/tokudb/ha_tokudb.cc @@ -23,60 +23,31 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." -#ifdef USE_PRAGMA_IMPLEMENTATION -#pragma implementation // gcc: Class implementation -#endif - -#include -extern "C" { -#include "stdint.h" -#define __STDC_FORMAT_MACROS -#include "inttypes.h" -#if defined(_WIN32) -#include "misc.h" -#endif -} - -#define MYSQL_SERVER 1 -#include "mysql_version.h" -#include "sql_table.h" -#include "handler.h" -#include "table.h" -#include "log.h" -#include "sql_class.h" -#include "sql_show.h" -#include "discover.h" - -#if (50600 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50699) || (50700 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50799) -#include -#endif - -#include "db.h" -#include "toku_os.h" -#include "hatoku_defines.h" +#include "hatoku_hton.h" #include "hatoku_cmp.h" - -static inline uint get_key_parts(const KEY *key); - -#undef PACKAGE -#undef VERSION -#undef HAVE_DTRACE -#undef _DTRACE_VERSION - -/* We define DTRACE after mysql_priv.h in case it disabled dtrace in the main server */ -#ifdef HAVE_DTRACE -#define _DTRACE_VERSION 1 -#else -#endif - #include "tokudb_buffer.h" #include "tokudb_status.h" #include "tokudb_card.h" #include "ha_tokudb.h" -#include "hatoku_hton.h" -#include -static const char *ha_tokudb_exts[] = { + +#if TOKU_INCLUDE_EXTENDED_KEYS +static inline uint get_ext_key_parts(const KEY *key) { +#if (50609 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50699) || \ + (50700 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50799) + return key->actual_key_parts; +#elif defined(MARIADB_BASE_VERSION) + return key->ext_key_parts; +#else +#error +#endif +} +#endif + +HASH TOKUDB_SHARE::_open_tables; +tokudb::thread::mutex_t TOKUDB_SHARE::_open_tables_mutex; + +static const char* ha_tokudb_exts[] = { ha_tokudb_ext, NullS }; @@ -84,10 +55,15 @@ static const char *ha_tokudb_exts[] = { // // This offset is calculated starting from AFTER the NULL bytes // -static inline uint32_t get_fixed_field_size(KEY_AND_COL_INFO* kc_info, TABLE_SHARE* table_share, uint keynr) { +static inline uint32_t get_fixed_field_size( + KEY_AND_COL_INFO* kc_info, + TABLE_SHARE* table_share, + uint keynr) { + uint offset = 0; for (uint i = 0; i < table_share->fields; i++) { - if (is_fixed_field(kc_info, i) && !bitmap_is_set(&kc_info->key_filters[keynr],i)) { + if (is_fixed_field(kc_info, i) && + !bitmap_is_set(&kc_info->key_filters[keynr], i)) { offset += kc_info->field_lengths[i]; } } @@ -95,10 +71,15 @@ static inline uint32_t get_fixed_field_size(KEY_AND_COL_INFO* kc_info, TABLE_SHA } -static inline uint32_t get_len_of_offsets(KEY_AND_COL_INFO* kc_info, TABLE_SHARE* table_share, uint keynr) { +static inline uint32_t get_len_of_offsets( + KEY_AND_COL_INFO* kc_info, + TABLE_SHARE* table_share, + uint keynr) { + uint len = 0; for (uint i = 0; i < table_share->fields; i++) { - if (is_variable_field(kc_info, i) && !bitmap_is_set(&kc_info->key_filters[keynr],i)) { + if (is_variable_field(kc_info, i) && + !bitmap_is_set(&kc_info->key_filters[keynr], i)) { len += kc_info->num_offset_bytes; } } @@ -106,32 +87,36 @@ static inline uint32_t get_len_of_offsets(KEY_AND_COL_INFO* kc_info, TABLE_SHARE } -static int allocate_key_and_col_info ( TABLE_SHARE* table_share, KEY_AND_COL_INFO* kc_info) { +static int allocate_key_and_col_info( + TABLE_SHARE* table_share, + KEY_AND_COL_INFO* kc_info) { + int error; // // initialize all of the bitmaps // for (uint i = 0; i < MAX_KEY + 1; i++) { - error = bitmap_init( - &kc_info->key_filters[i], - NULL, - table_share->fields, - false - ); + error = + bitmap_init( + &kc_info->key_filters[i], + NULL, + table_share->fields, + false); if (error) { goto exit; } } - + // // create the field lengths // - kc_info->multi_ptr = tokudb_my_multi_malloc(MYF(MY_WME+MY_ZEROFILL), - &kc_info->field_types, (uint)(table_share->fields * sizeof (uint8_t)), - &kc_info->field_lengths, (uint)(table_share->fields * sizeof (uint16_t)), - &kc_info->length_bytes, (uint)(table_share->fields * sizeof (uint8_t)), - &kc_info->blob_fields, (uint)(table_share->fields * sizeof (uint32_t)), - NullS); + kc_info->multi_ptr = tokudb::memory::multi_malloc( + MYF(MY_WME+MY_ZEROFILL), + &kc_info->field_types, (uint)(table_share->fields * sizeof (uint8_t)), + &kc_info->field_lengths, (uint)(table_share->fields * sizeof (uint16_t)), + &kc_info->length_bytes, (uint)(table_share->fields * sizeof (uint8_t)), + &kc_info->blob_fields, (uint)(table_share->fields * sizeof (uint32_t)), + NullS); if (kc_info->multi_ptr == NULL) { error = ENOMEM; goto exit; @@ -141,7 +126,7 @@ exit: for (uint i = 0; MAX_KEY + 1; i++) { bitmap_free(&kc_info->key_filters[i]); } - tokudb_my_free(kc_info->multi_ptr); + tokudb::memory::free(kc_info->multi_ptr); } return error; } @@ -150,136 +135,306 @@ static void free_key_and_col_info (KEY_AND_COL_INFO* kc_info) { for (uint i = 0; i < MAX_KEY+1; i++) { bitmap_free(&kc_info->key_filters[i]); } - + for (uint i = 0; i < MAX_KEY+1; i++) { - tokudb_my_free(kc_info->cp_info[i]); + tokudb::memory::free(kc_info->cp_info[i]); kc_info->cp_info[i] = NULL; // 3144 } - tokudb_my_free(kc_info->multi_ptr); + tokudb::memory::free(kc_info->multi_ptr); kc_info->field_types = NULL; kc_info->field_lengths = NULL; kc_info->length_bytes = NULL; kc_info->blob_fields = NULL; } -void TOKUDB_SHARE::init(void) { - use_count = 0; - thr_lock_init(&lock); - tokudb_pthread_mutex_init(&mutex, MY_MUTEX_INIT_FAST); - my_rwlock_init(&num_DBs_lock, 0); - tokudb_pthread_cond_init(&m_openclose_cond, NULL); - m_state = CLOSED; -} -void TOKUDB_SHARE::destroy(void) { - assert(m_state == CLOSED); - thr_lock_delete(&lock); - tokudb_pthread_mutex_destroy(&mutex); - rwlock_destroy(&num_DBs_lock); - tokudb_pthread_cond_destroy(&m_openclose_cond); - tokudb_my_free(rec_per_key); - rec_per_key = NULL; -} +uchar* TOKUDB_SHARE::hash_get_key( + TOKUDB_SHARE* share, + size_t* length, + TOKUDB_UNUSED(my_bool not_used)) { -// MUST have tokudb_mutex locked on input -static TOKUDB_SHARE *get_share(const char *table_name, TABLE_SHARE* table_share) { - TOKUDB_SHARE *share = NULL; + *length = share->_full_table_name.length(); + return (uchar *) share->_full_table_name.c_ptr(); +} +void TOKUDB_SHARE::hash_free_element(TOKUDB_SHARE* share) { + share->destroy(); + delete share; +} +void TOKUDB_SHARE::static_init() { + my_hash_init( + &_open_tables, + table_alias_charset, + 32, + 0, + 0, + (my_hash_get_key)hash_get_key, + (my_hash_free_key)hash_free_element, 0); +} +void TOKUDB_SHARE::static_destroy() { + my_hash_free(&_open_tables); +} +const char* TOKUDB_SHARE::get_state_string(share_state_t state) { + static const char* state_string[] = { + "CLOSED", + "OPENED", + "ERROR" + }; + assert_always(state == CLOSED || state == OPENED || state == ERROR); + return state_string[state]; +} +void* TOKUDB_SHARE::operator new(size_t sz) { + return tokudb::memory::malloc(sz, MYF(MY_WME|MY_ZEROFILL|MY_FAE)); +} +void TOKUDB_SHARE::operator delete(void* p) { + tokudb::memory::free(p); +} +TOKUDB_SHARE::TOKUDB_SHARE() : + _num_DBs_lock(), + _mutex() { +} +void TOKUDB_SHARE::init(const char* table_name) { + _use_count = 0; + thr_lock_init(&_thr_lock); + _state = CLOSED; + _row_delta_activity = 0; + _allow_auto_analysis = true; + + _full_table_name.append(table_name); + + String tmp_dictionary_name; + tokudb_split_dname( + table_name, + _database_name, + _table_name, + tmp_dictionary_name); + + TOKUDB_SHARE_DBUG_ENTER("file[%s]:state[%s]:use_count[%d]", + _full_table_name.ptr(), + get_state_string(_state), + _use_count); + TOKUDB_SHARE_DBUG_VOID_RETURN(); +} +void TOKUDB_SHARE::destroy() { + TOKUDB_SHARE_DBUG_ENTER("file[%s]:state[%s]:use_count[%d]", + _full_table_name.ptr(), + get_state_string(_state), + _use_count); + + assert_always(_use_count == 0); + assert_always( + _state == TOKUDB_SHARE::CLOSED || _state == TOKUDB_SHARE::ERROR); + thr_lock_delete(&_thr_lock); + TOKUDB_SHARE_DBUG_VOID_RETURN(); +} +TOKUDB_SHARE* TOKUDB_SHARE::get_share( + const char* table_name, + TABLE_SHARE* table_share, + THR_LOCK_DATA* data, + bool create_new) { + + _open_tables_mutex.lock(); int error = 0; uint length = (uint) strlen(table_name); - if (!(share = (TOKUDB_SHARE *) my_hash_search(&tokudb_open_tables, (uchar *) table_name, length))) { - char *tmp_name; + TOKUDB_SHARE* share = + (TOKUDB_SHARE*)my_hash_search( + &_open_tables, + (uchar*)table_name, + length); + TOKUDB_TRACE_FOR_FLAGS( + TOKUDB_DEBUG_SHARE, + "existing share[%s] %s:share[%p]", + table_name, + share == NULL ? "not found" : "found", + share); + + if (!share) { + if (create_new == false) + goto exit; // create share and fill it with all zeroes // hence, all pointers are initialized to NULL - share = (TOKUDB_SHARE *) tokudb_my_multi_malloc(MYF(MY_WME | MY_ZEROFILL), - &share, sizeof(*share), - &tmp_name, length + 1, - NullS - ); - assert(share); + share = new TOKUDB_SHARE; + assert_always(share); - share->init(); + share->init(table_name); - share->table_name_length = length; - share->table_name = tmp_name; - strmov(share->table_name, table_name); - - error = my_hash_insert(&tokudb_open_tables, (uchar *) share); + error = my_hash_insert(&_open_tables, (uchar*)share); if (error) { free_key_and_col_info(&share->kc_info); + share->destroy(); + tokudb::memory::free((uchar*)share); + share = NULL; goto exit; } } + share->addref(); + + if (data) + thr_lock_data_init(&(share->_thr_lock), data, NULL); + exit: - if (error) { - share->destroy(); - tokudb_my_free((uchar *) share); - share = NULL; - } + _open_tables_mutex.unlock(); return share; } +void TOKUDB_SHARE::drop_share(TOKUDB_SHARE* share) { + TOKUDB_TRACE_FOR_FLAGS( + TOKUDB_DEBUG_SHARE, + "share[%p]:file[%s]:state[%s]:use_count[%d]", + share, + share->_full_table_name.ptr(), + get_state_string(share->_state), + share->_use_count); + + _open_tables_mutex.lock(); + my_hash_delete(&_open_tables, (uchar*)share); + _open_tables_mutex.unlock(); +} +TOKUDB_SHARE::share_state_t TOKUDB_SHARE::addref() { + TOKUDB_SHARE_TRACE_FOR_FLAGS((TOKUDB_DEBUG_ENTER & TOKUDB_DEBUG_SHARE), + "file[%s]:state[%s]:use_count[%d]", + _full_table_name.ptr(), + get_state_string(_state), + _use_count); + + lock(); + _use_count++; + + return _state; +} +int TOKUDB_SHARE::release() { + TOKUDB_SHARE_DBUG_ENTER("file[%s]:state[%s]:use_count[%d]", + _full_table_name.ptr(), + get_state_string(_state), + _use_count); -static int free_share(TOKUDB_SHARE * share) { int error, result = 0; - tokudb_pthread_mutex_lock(&share->mutex); - DBUG_PRINT("info", ("share->use_count %u", share->use_count)); - if (!--share->use_count) { - share->m_state = TOKUDB_SHARE::CLOSING; - tokudb_pthread_mutex_unlock(&share->mutex); - - // - // number of open DB's may not be equal to number of keys we have because add_index - // may have added some. So, we loop through entire array and close any non-NULL value - // It is imperative that we reset a DB to NULL once we are done with it. - // - for (uint i = 0; i < sizeof(share->key_file)/sizeof(share->key_file[0]); i++) { - if (share->key_file[i]) { - if (tokudb_debug & TOKUDB_DEBUG_OPEN) { - TOKUDB_TRACE("dbclose:%p", share->key_file[i]); - } - error = share->key_file[i]->close(share->key_file[i], 0); - assert(error == 0); + _mutex.lock(); + assert_always(_use_count != 0); + _use_count--; + if (_use_count == 0 && _state == TOKUDB_SHARE::OPENED) { + // number of open DB's may not be equal to number of keys we have + // because add_index may have added some. So, we loop through entire + // array and close any non-NULL value. It is imperative that we reset + // a DB to NULL once we are done with it. + for (uint i = 0; i < sizeof(key_file)/sizeof(key_file[0]); i++) { + if (key_file[i]) { + TOKUDB_TRACE_FOR_FLAGS( + TOKUDB_DEBUG_OPEN, + "dbclose:%p", + key_file[i]); + error = key_file[i]->close(key_file[i], 0); + assert_always(error == 0); if (error) { result = error; } - if (share->key_file[i] == share->file) - share->file = NULL; - share->key_file[i] = NULL; + if (key_file[i] == file) + file = NULL; + key_file[i] = NULL; } } - error = tokudb::close_status(&share->status_block); - assert(error == 0); + error = tokudb::metadata::close(&status_block); + assert_always(error == 0); - free_key_and_col_info(&share->kc_info); + free_key_and_col_info(&kc_info); - tokudb_pthread_mutex_lock(&tokudb_mutex); - tokudb_pthread_mutex_lock(&share->mutex); - share->m_state = TOKUDB_SHARE::CLOSED; - if (share->use_count > 0) { - tokudb_pthread_cond_broadcast(&share->m_openclose_cond); - tokudb_pthread_mutex_unlock(&share->mutex); - tokudb_pthread_mutex_unlock(&tokudb_mutex); - } else { - - my_hash_delete(&tokudb_open_tables, (uchar *) share); - - tokudb_pthread_mutex_unlock(&share->mutex); - tokudb_pthread_mutex_unlock(&tokudb_mutex); - - share->destroy(); - tokudb_my_free((uchar *) share); + if (_rec_per_key) { + tokudb::memory::free(_rec_per_key); + _rec_per_key = NULL; + _rec_per_keys = 0; } - } else { - tokudb_pthread_mutex_unlock(&share->mutex); + + for (uint i = 0; i < _keys; i++) { + tokudb::memory::free(_key_descriptors[i]._name); + } + tokudb::memory::free(_key_descriptors); + _keys = _max_key_parts = 0; _key_descriptors = NULL; + + _state = TOKUDB_SHARE::CLOSED; } + _mutex.unlock(); - return result; + TOKUDB_SHARE_DBUG_RETURN(result); } +void TOKUDB_SHARE::update_row_count( + THD* thd, + uint64_t added, + uint64_t deleted, + uint64_t updated) { + uint64_t delta = added + deleted + updated; + lock(); + if (deleted > added && _rows < (deleted - added)) { + _rows = 0; + } else { + _rows += added - deleted; + } + _row_delta_activity += delta; + if (_row_delta_activity == (uint64_t)~0) + _row_delta_activity = 1; + + ulonglong auto_threshold = tokudb::sysvars::auto_analyze(thd); + if (delta && auto_threshold > 0 && _allow_auto_analysis) { + ulonglong pct_of_rows_changed_to_trigger; + pct_of_rows_changed_to_trigger = ((_rows * auto_threshold) / 100); + if (_row_delta_activity >= pct_of_rows_changed_to_trigger) { + char msg[200]; + snprintf( + msg, + sizeof(msg), + "TokuDB: Auto %s background analysis for %s, delta_activity " + "%llu is greater than %llu percent of %llu rows.", + tokudb::sysvars::analyze_in_background(thd) > 0 ? + "scheduling" : "running", + full_table_name(), + _row_delta_activity, + auto_threshold, + (ulonglong)(_rows)); + + // analyze_standard will unlock _mutex regardless of success/failure + int ret = analyze_standard(thd, NULL); + if (ret == 0) { + sql_print_information("%s - succeeded.", msg); + } else { + sql_print_information( + "%s - failed, likely a job already running.", + msg); + } + } + } + unlock(); +} +void TOKUDB_SHARE::set_cardinality_counts_in_table(TABLE* table) { + lock(); + uint32_t next_key_part = 0; + for (uint32_t i = 0; i < table->s->keys; i++) { + KEY* key = &table->key_info[i]; + bool is_unique_key = + (i == table->s->primary_key) || (key->flags & HA_NOSAME); + + for (uint32_t j = 0; j < get_ext_key_parts(key); j++) { + if (j >= key->user_defined_key_parts) { + // MySQL 'hidden' keys, really needs deeper investigation + // into MySQL hidden keys vs TokuDB hidden keys + key->rec_per_key[j] = 1; + continue; + } + + assert_always(next_key_part < _rec_per_keys); + ulong val = _rec_per_key[next_key_part++]; + val = (val * tokudb::sysvars::cardinality_scale_percent) / 100; + if (val == 0 || _rows == 0 || + (is_unique_key && j == get_ext_key_parts(key) - 1)) { + val = 1; + } + key->rec_per_key[j] = val; + } + } + unlock(); +} #define HANDLE_INVALID_CURSOR() \ if (cursor == NULL) { \ @@ -288,7 +443,6 @@ static int free_share(TOKUDB_SHARE * share) { } const char *ha_tokudb::table_type() const { - extern const char *tokudb_hton_name; return tokudb_hton_name; } @@ -296,7 +450,7 @@ const char *ha_tokudb::index_type(uint inx) { return "BTREE"; } -/* +/* * returns NULL terminated file extension string */ const char **ha_tokudb::bas_ext() const { @@ -315,46 +469,23 @@ static inline bool is_replace_into(THD* thd) { return thd->lex->duplicates == DUP_REPLACE; } -static inline bool do_ignore_flag_optimization(THD* thd, TABLE* table, bool opt_eligible) { +static inline bool do_ignore_flag_optimization( + THD* thd, + TABLE* table, + bool opt_eligible) { + bool do_opt = false; - if (opt_eligible) { - if (is_replace_into(thd) || is_insert_ignore(thd)) { - uint pk_insert_mode = get_pk_insert_mode(thd); - if ((!table->triggers && pk_insert_mode < 2) || pk_insert_mode == 0) { - if (mysql_bin_log.is_open() && thd->variables.binlog_format != BINLOG_FORMAT_STMT) { - do_opt = false; - } else { - do_opt = true; - } - } - } + if (opt_eligible && + (is_replace_into(thd) || is_insert_ignore(thd)) && + tokudb::sysvars::pk_insert_mode(thd) == 1 && + !table->triggers && + !(mysql_bin_log.is_open() && + thd->variables.binlog_format != BINLOG_FORMAT_STMT)) { + do_opt = true; } return do_opt; } -static inline uint get_key_parts(const KEY *key) { -#if (50609 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50699) || \ - (50700 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50799) || \ - (100009 <= MYSQL_VERSION_ID) - return key->user_defined_key_parts; -#else - return key->key_parts; -#endif -} - -#if TOKU_INCLUDE_EXTENDED_KEYS -static inline uint get_ext_key_parts(const KEY *key) { -#if (50609 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50699) || \ - (50700 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50799) - return key->actual_key_parts; -#elif defined(MARIADB_BASE_VERSION) - return key->ext_key_parts; -#else -#error -#endif -} -#endif - ulonglong ha_tokudb::table_flags() const { return int_table_flags | HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE; } @@ -365,11 +496,9 @@ ulonglong ha_tokudb::table_flags() const { // ulong ha_tokudb::index_flags(uint idx, uint part, bool all_parts) const { TOKUDB_HANDLER_DBUG_ENTER(""); - assert(table_share); - ulong flags = (HA_READ_NEXT | HA_READ_PREV | HA_READ_ORDER | HA_KEYREAD_ONLY | HA_READ_RANGE); -#if defined(MARIADB_BASE_VERSION) || (50600 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50699) - flags |= HA_DO_INDEX_COND_PUSHDOWN; -#endif + assert_always(table_share); + ulong flags = (HA_READ_NEXT | HA_READ_PREV | HA_READ_ORDER | + HA_KEYREAD_ONLY | HA_READ_RANGE | HA_DO_INDEX_COND_PUSHDOWN); if (key_is_clustering(&table_share->key_info[idx])) { flags |= HA_CLUSTERED_INDEX; } @@ -434,13 +563,13 @@ static int loader_poll_fun(void *extra, float progress) { static void loader_ai_err_fun(DB *db, int i, int err, DBT *key, DBT *val, void *error_extra) { LOADER_CONTEXT context = (LOADER_CONTEXT)error_extra; - assert(context->ha); + assert_always(context->ha); context->ha->set_loader_error(err); } static void loader_dup_fun(DB *db, int i, int err, DBT *key, DBT *val, void *error_extra) { LOADER_CONTEXT context = (LOADER_CONTEXT)error_extra; - assert(context->ha); + assert_always(context->ha); context->ha->set_loader_error(err); if (err == DB_KEYEXIST) { context->ha->set_dup_value_for_pk(key); @@ -620,8 +749,7 @@ static ulonglong retrieve_auto_increment(uint16 type, uint32 offset,const uchar break; default: - DBUG_ASSERT(0); - unsigned_autoinc = 0; + assert_unreachable(); } if (signed_autoinc < 0) { @@ -632,21 +760,6 @@ static ulonglong retrieve_auto_increment(uint16 type, uint32 offset,const uchar unsigned_autoinc : (ulonglong) signed_autoinc; } -static inline bool -is_null_field( TABLE* table, Field* field, const uchar* record) { - uint null_offset; - bool ret_val; - if (!field->real_maybe_null()) { - ret_val = false; - goto exitpt; - } - null_offset = get_null_offset(table,field); - ret_val = (record[null_offset] & field->null_bit) ? true: false; - -exitpt: - return ret_val; -} - static inline ulong field_offset(Field* field, TABLE* table) { return((ulong) (field->ptr - table->record[0])); } @@ -692,29 +805,36 @@ static int filter_key_part_compare (const void* left, const void* right) { // if key, table have proper info set. I had to verify by checking // in the debugger. // -void set_key_filter(MY_BITMAP* key_filter, KEY* key, TABLE* table, bool get_offset_from_keypart) { +void set_key_filter( + MY_BITMAP* key_filter, + KEY* key, + TABLE* table, + bool get_offset_from_keypart) { + FILTER_KEY_PART_INFO parts[MAX_REF_PARTS]; uint curr_skip_index = 0; - for (uint i = 0; i < get_key_parts(key); i++) { + for (uint i = 0; i < key->user_defined_key_parts; i++) { // // horrendous hack due to bugs in mysql, basically // we cannot always reliably get the offset from the same source // - parts[i].offset = get_offset_from_keypart ? key->key_part[i].offset : field_offset(key->key_part[i].field, table); + parts[i].offset = + get_offset_from_keypart ? + key->key_part[i].offset : + field_offset(key->key_part[i].field, table); parts[i].part_index = i; } qsort( parts, // start of array - get_key_parts(key), //num elements + key->user_defined_key_parts, //num elements sizeof(*parts), //size of each element - filter_key_part_compare - ); + filter_key_part_compare); for (uint i = 0; i < table->s->fields; i++) { Field* field = table->field[i]; uint curr_field_offset = field_offset(field, table); - if (curr_skip_index < get_key_parts(key)) { + if (curr_skip_index < key->user_defined_key_parts) { uint curr_skip_offset = 0; curr_skip_offset = parts[curr_skip_index].offset; if (curr_skip_offset == curr_field_offset) { @@ -830,7 +950,7 @@ static inline uchar* write_var_field( int2store(to_tokudb_offset_ptr,offset); break; default: - assert(false); + assert_unreachable(); break; } return to_tokudb_data + data_length; @@ -850,8 +970,7 @@ static inline uint32_t get_var_data_length( data_length = uint2korr(from_mysql); break; default: - assert(false); - break; + assert_unreachable(); } return data_length; } @@ -894,8 +1013,7 @@ static inline void unpack_var_field( int2store(to_mysql, from_tokudb_data_len); break; default: - assert(false); - break; + assert_unreachable(); } // // store the data @@ -928,7 +1046,7 @@ static uchar* pack_toku_field_blob( length = uint4korr(from_mysql); break; default: - assert(false); + assert_unreachable(); } if (length > 0) { @@ -940,7 +1058,9 @@ static uchar* pack_toku_field_blob( static int create_tokudb_trx_data_instance(tokudb_trx_data** out_trx) { int error; - tokudb_trx_data* trx = (tokudb_trx_data *) tokudb_my_malloc(sizeof(*trx), MYF(MY_ZEROFILL)); + tokudb_trx_data* trx = (tokudb_trx_data *) tokudb::memory::malloc( + sizeof(*trx), + MYF(MY_ZEROFILL)); if (!trx) { error = ENOMEM; goto cleanup; @@ -1011,32 +1131,27 @@ static inline int tokudb_generate_row( void* old_ptr = dest_key->data; void* new_ptr = NULL; new_ptr = realloc(old_ptr, max_key_len); - assert(new_ptr); + assert_always(new_ptr); dest_key->data = new_ptr; dest_key->ulen = max_key_len; } buff = (uchar *)dest_key->data; - assert(buff != NULL && max_key_len > 0); - } - else { - assert(false); + assert_always(buff != NULL && max_key_len > 0); + } else { + assert_unreachable(); } - dest_key->size = pack_key_from_desc( - buff, - row_desc, - desc_size, - src_key, - src_val - ); - assert(dest_key->ulen >= dest_key->size); - if (tokudb_debug & TOKUDB_DEBUG_CHECK_KEY && !max_key_len) { + dest_key->size = pack_key_from_desc(buff, row_desc, desc_size, src_key, + src_val); + assert_always(dest_key->ulen >= dest_key->size); + if (TOKUDB_UNLIKELY(TOKUDB_DEBUG_FLAGS(TOKUDB_DEBUG_CHECK_KEY)) && + !max_key_len) { max_key_len = max_key_size_from_desc(row_desc, desc_size); max_key_len += src_key->size; } if (max_key_len) { - assert(max_key_len >= dest_key->size); + assert_always(max_key_len >= dest_key->size); } row_desc += desc_size; @@ -1045,8 +1160,7 @@ static inline int tokudb_generate_row( if (dest_val != NULL) { if (!is_key_clustering(row_desc, desc_size) || src_val->size == 0) { dest_val->size = 0; - } - else { + } else { uchar* buff = NULL; if (dest_val->flags == 0) { dest_val->ulen = 0; @@ -1059,23 +1173,21 @@ static inline int tokudb_generate_row( void* old_ptr = dest_val->data; void* new_ptr = NULL; new_ptr = realloc(old_ptr, src_val->size); - assert(new_ptr); + assert_always(new_ptr); dest_val->data = new_ptr; dest_val->ulen = src_val->size; } buff = (uchar *)dest_val->data; - assert(buff != NULL); - } - else { - assert(false); + assert_always(buff != NULL); + } else { + assert_unreachable(); } dest_val->size = pack_clustering_val_from_desc( buff, row_desc, desc_size, - src_val - ); - assert(dest_val->ulen >= dest_val->size); + src_val); + assert_always(dest_val->ulen >= dest_val->size); } } error = 0; @@ -1143,6 +1255,7 @@ ha_tokudb::ha_tokudb(handlerton * hton, TABLE_SHARE * table_arg):handler(hton, t read_key = false; added_rows = 0; deleted_rows = 0; + updated_rows = 0; last_dup_key = UINT_MAX; using_ignore = false; using_ignore_no_key = false; @@ -1224,41 +1337,42 @@ bool ha_tokudb::has_auto_increment_flag(uint* index) { static int open_status_dictionary(DB** ptr, const char* name, DB_TXN* txn) { int error; char* newname = NULL; - newname = (char *)tokudb_my_malloc( - get_max_dict_name_path_length(name), - MYF(MY_WME)); + size_t newname_len = get_max_dict_name_path_length(name); + newname = (char*)tokudb::memory::malloc(newname_len, MYF(MY_WME)); if (newname == NULL) { error = ENOMEM; goto cleanup; } - make_name(newname, name, "status"); - if (tokudb_debug & TOKUDB_DEBUG_OPEN) { - TOKUDB_TRACE("open:%s", newname); - } + make_name(newname, newname_len, name, "status"); + TOKUDB_TRACE_FOR_FLAGS(TOKUDB_DEBUG_OPEN, "open:%s", newname); - error = tokudb::open_status(db_env, ptr, newname, txn); + error = tokudb::metadata::open(db_env, ptr, newname, txn); cleanup: - tokudb_my_free(newname); + tokudb::memory::free(newname); return error; } -int ha_tokudb::open_main_dictionary(const char* name, bool is_read_only, DB_TXN* txn) { +int ha_tokudb::open_main_dictionary( + const char* name, + bool is_read_only, + DB_TXN* txn) { + int error; char* newname = NULL; + size_t newname_len = 0; uint open_flags = (is_read_only ? DB_RDONLY : 0) | DB_THREAD; - assert(share->file == NULL); - assert(share->key_file[primary_key] == NULL); - - newname = (char *)tokudb_my_malloc( - get_max_dict_name_path_length(name), - MYF(MY_WME|MY_ZEROFILL) - ); + assert_always(share->file == NULL); + assert_always(share->key_file[primary_key] == NULL); + newname_len = get_max_dict_name_path_length(name); + newname = (char*)tokudb::memory::malloc( + newname_len, + MYF(MY_WME|MY_ZEROFILL)); if (newname == NULL) { error = ENOMEM; goto exit; } - make_name(newname, name, "main"); + make_name(newname, newname_len, name, "main"); error = db_create(&share->file, db_env, 0); if (error) { @@ -1266,14 +1380,24 @@ int ha_tokudb::open_main_dictionary(const char* name, bool is_read_only, DB_TXN* } share->key_file[primary_key] = share->file; - error = share->file->open(share->file, txn, newname, NULL, DB_BTREE, open_flags, 0); + error = + share->file->open( + share->file, + txn, + newname, + NULL, + DB_BTREE, + open_flags, + 0); if (error) { goto exit; } - - if (tokudb_debug & TOKUDB_DEBUG_OPEN) { - TOKUDB_HANDLER_TRACE("open:%s:file=%p", newname, share->file); - } + + TOKUDB_HANDLER_TRACE_FOR_FLAGS( + TOKUDB_DEBUG_OPEN, + "open:%s:file=%p", + newname, + share->file); error = 0; exit: @@ -1283,34 +1407,42 @@ exit: share->file, 0 ); - assert(r==0); + assert_always(r==0); share->file = NULL; share->key_file[primary_key] = NULL; } } - tokudb_my_free(newname); + tokudb::memory::free(newname); return error; } // -// Open a secondary table, the key will be a secondary index, the data will be a primary key +// Open a secondary table, the key will be a secondary index, the data will +// be a primary key // -int ha_tokudb::open_secondary_dictionary(DB** ptr, KEY* key_info, const char* name, bool is_read_only, DB_TXN* txn) { +int ha_tokudb::open_secondary_dictionary( + DB** ptr, + KEY* key_info, + const char* name, + bool is_read_only, + DB_TXN* txn) { + int error = ENOSYS; char dict_name[MAX_DICT_NAME_LEN]; uint open_flags = (is_read_only ? DB_RDONLY : 0) | DB_THREAD; char* newname = NULL; - uint newname_len = 0; - + size_t newname_len = 0; + sprintf(dict_name, "key-%s", key_info->name); newname_len = get_max_dict_name_path_length(name); - newname = (char *)tokudb_my_malloc(newname_len, MYF(MY_WME|MY_ZEROFILL)); + newname = + (char*)tokudb::memory::malloc(newname_len, MYF(MY_WME|MY_ZEROFILL)); if (newname == NULL) { error = ENOMEM; goto cleanup; } - make_name(newname, name, dict_name); + make_name(newname, newname_len, name, dict_name); if ((error = db_create(ptr, db_env, 0))) { @@ -1319,22 +1451,25 @@ int ha_tokudb::open_secondary_dictionary(DB** ptr, KEY* key_info, const char* na } - if ((error = (*ptr)->open(*ptr, txn, newname, NULL, DB_BTREE, open_flags, 0))) { + error = (*ptr)->open(*ptr, txn, newname, NULL, DB_BTREE, open_flags, 0); + if (error) { my_errno = error; goto cleanup; } - if (tokudb_debug & TOKUDB_DEBUG_OPEN) { - TOKUDB_HANDLER_TRACE("open:%s:file=%p", newname, *ptr); - } + TOKUDB_HANDLER_TRACE_FOR_FLAGS( + TOKUDB_DEBUG_OPEN, + "open:%s:file=%p", + newname, + *ptr); cleanup: if (error) { if (*ptr) { int r = (*ptr)->close(*ptr, 0); - assert(r==0); + assert_always(r==0); *ptr = NULL; } } - tokudb_my_free(newname); + tokudb::memory::free(newname); return error; } @@ -1343,11 +1478,10 @@ static int initialize_col_pack_info(KEY_AND_COL_INFO* kc_info, TABLE_SHARE* tabl // // set up the cp_info // - assert(kc_info->cp_info[keynr] == NULL); - kc_info->cp_info[keynr] = (COL_PACK_INFO *)tokudb_my_malloc( - table_share->fields*sizeof(COL_PACK_INFO), - MYF(MY_WME | MY_ZEROFILL) - ); + assert_always(kc_info->cp_info[keynr] == NULL); + kc_info->cp_info[keynr] = (COL_PACK_INFO*)tokudb::memory::malloc( + table_share->fields * sizeof(COL_PACK_INFO), + MYF(MY_WME | MY_ZEROFILL)); if (kc_info->cp_info[keynr] == NULL) { error = ENOMEM; goto exit; @@ -1396,12 +1530,18 @@ exit: // reset the kc_info state at keynr static void reset_key_and_col_info(KEY_AND_COL_INFO *kc_info, uint keynr) { bitmap_clear_all(&kc_info->key_filters[keynr]); - tokudb_my_free(kc_info->cp_info[keynr]); + tokudb::memory::free(kc_info->cp_info[keynr]); kc_info->cp_info[keynr] = NULL; kc_info->mcp_info[keynr] = (MULTI_COL_PACK_INFO) { 0, 0 }; } -static int initialize_key_and_col_info(TABLE_SHARE* table_share, TABLE* table, KEY_AND_COL_INFO* kc_info, uint hidden_primary_key, uint primary_key) { +static int initialize_key_and_col_info( + TABLE_SHARE* table_share, + TABLE* table, + KEY_AND_COL_INFO* kc_info, + uint hidden_primary_key, + uint primary_key) { + int error = 0; uint32_t curr_blob_field_index = 0; uint32_t max_var_bytes = 0; @@ -1420,7 +1560,7 @@ static int initialize_key_and_col_info(TABLE_SHARE* table_share, TABLE* table, K case toku_type_fixbinary: case toku_type_fixstring: pack_length = field->pack_length(); - assert(pack_length < 1<<16); + assert_always(pack_length < 1<<16); kc_info->field_types[i] = KEY_AND_COL_INFO::TOKUDB_FIXED_FIELD; kc_info->field_lengths[i] = (uint16_t)pack_length; kc_info->length_bytes[i] = 0; @@ -1436,11 +1576,12 @@ static int initialize_key_and_col_info(TABLE_SHARE* table_share, TABLE* table, K case toku_type_varbinary: kc_info->field_types[i] = KEY_AND_COL_INFO::TOKUDB_VARIABLE_FIELD; kc_info->field_lengths[i] = 0; - kc_info->length_bytes[i] = (uchar)((Field_varstring *)field)->length_bytes; + kc_info->length_bytes[i] = + (uchar)((Field_varstring*)field)->length_bytes; max_var_bytes += field->field_length; break; default: - assert(false); + assert_unreachable(); } } kc_info->num_blobs = curr_blob_field_index; @@ -1452,54 +1593,54 @@ static int initialize_key_and_col_info(TABLE_SHARE* table_share, TABLE* table, K // if (max_var_bytes < 256) { kc_info->num_offset_bytes = 1; - } - else { + } else { kc_info->num_offset_bytes = 2; } - for (uint i = 0; i < table_share->keys + tokudb_test(hidden_primary_key); i++) { + for (uint i = 0; + i < table_share->keys + tokudb_test(hidden_primary_key); + i++) { // // do the cluster/primary key filtering calculations // - if (! (i==primary_key && hidden_primary_key) ){ - if ( i == primary_key ) { + if (!(i==primary_key && hidden_primary_key)) { + if (i == primary_key) { set_key_filter( &kc_info->key_filters[primary_key], &table_share->key_info[primary_key], table, - true - ); - } - else { + true); + } else { set_key_filter( &kc_info->key_filters[i], &table_share->key_info[i], table, - true - ); + true); if (!hidden_primary_key) { set_key_filter( &kc_info->key_filters[i], &table_share->key_info[primary_key], table, - true - ); + true); } } } if (i == primary_key || key_is_clustering(&table_share->key_info[i])) { - error = initialize_col_pack_info(kc_info,table_share,i); + error = initialize_col_pack_info(kc_info, table_share, i); if (error) { goto exit; } } - } exit: return error; } -bool ha_tokudb::can_replace_into_be_fast(TABLE_SHARE* table_share, KEY_AND_COL_INFO* kc_info, uint pk) { +bool ha_tokudb::can_replace_into_be_fast( + TABLE_SHARE* table_share, + KEY_AND_COL_INFO* kc_info, + uint pk) { + uint curr_num_DBs = table_share->keys + tokudb_test(hidden_primary_key); bool ret_val; if (curr_num_DBs == 1) { @@ -1510,7 +1651,7 @@ bool ha_tokudb::can_replace_into_be_fast(TABLE_SHARE* table_share, KEY_AND_COL_I for (uint curr_index = 0; curr_index < table_share->keys; curr_index++) { if (curr_index == pk) continue; KEY* curr_key_info = &table_share->key_info[curr_index]; - for (uint i = 0; i < get_key_parts(curr_key_info); i++) { + for (uint i = 0; i < curr_key_info->user_defined_key_parts; i++) { uint16 curr_field_index = curr_key_info->key_part[i].field->field_index; if (!bitmap_is_set(&kc_info->key_filters[curr_index],curr_field_index)) { ret_val = false; @@ -1544,8 +1685,6 @@ int ha_tokudb::initialize_share(const char* name, int mode) { if (error) { goto exit; } } - DBUG_PRINT("info", ("share->use_count %u", share->use_count)); - share->m_initialize_count++; error = get_status(txn); if (error) { @@ -1574,43 +1713,64 @@ int ha_tokudb::initialize_share(const char* name, int mode) { goto exit; #endif - error = initialize_key_and_col_info( - table_share, - table, - &share->kc_info, - hidden_primary_key, - primary_key - ); - if (error) { goto exit; } - - error = open_main_dictionary(name, mode == O_RDONLY, txn); + error = + initialize_key_and_col_info( + table_share, + table, + &share->kc_info, + hidden_primary_key, + primary_key); if (error) { goto exit; } + error = open_main_dictionary(name, mode == O_RDONLY, txn); + if (error) { + goto exit; + } + share->has_unique_keys = false; + share->_keys = table_share->keys; + share->_max_key_parts = table_share->key_parts; + share->_key_descriptors = + (TOKUDB_SHARE::key_descriptor_t*)tokudb::memory::malloc( + sizeof(TOKUDB_SHARE::key_descriptor_t) * share->_keys, + MYF(MY_ZEROFILL)); + /* Open other keys; These are part of the share structure */ for (uint i = 0; i < table_share->keys; i++) { + share->_key_descriptors[i]._parts = + table_share->key_info[i].user_defined_key_parts; + if (i == primary_key) { + share->_key_descriptors[i]._is_unique = true; + share->_key_descriptors[i]._name = tokudb::memory::strdup("primary", 0); + } else { + share->_key_descriptors[i]._is_unique = false; + share->_key_descriptors[i]._name = + tokudb::memory::strdup(table_share->key_info[i].name, 0); + } + if (table_share->key_info[i].flags & HA_NOSAME) { + share->_key_descriptors[i]._is_unique = true; share->has_unique_keys = true; } if (i != primary_key) { - error = open_secondary_dictionary( - &share->key_file[i], - &table_share->key_info[i], - name, - mode == O_RDONLY, - txn - ); + error = + open_secondary_dictionary( + &share->key_file[i], + &table_share->key_info[i], + name, + mode == O_RDONLY, + txn); if (error) { goto exit; } } } - share->replace_into_fast = can_replace_into_be_fast( - table_share, - &share->kc_info, - primary_key - ); - + share->replace_into_fast = + can_replace_into_be_fast( + table_share, + &share->kc_info, + primary_key); + share->pk_has_string = false; if (!hidden_primary_key) { // @@ -1618,8 +1778,9 @@ int ha_tokudb::initialize_share(const char* name, int mode) { // the "infinity byte" in keys, and for placing the DBT size in the first four bytes // ref_length = sizeof(uint32_t) + sizeof(uchar); - KEY_PART_INFO *key_part = table->key_info[primary_key].key_part; - KEY_PART_INFO *end = key_part + get_key_parts(&table->key_info[primary_key]); + KEY_PART_INFO* key_part = table->key_info[primary_key].key_part; + KEY_PART_INFO* end = + key_part + table->key_info[primary_key].user_defined_key_parts; for (; key_part != end; key_part++) { ref_length += key_part->field->max_packed_col_length(key_part->length); TOKU_TYPE toku_type = mysql_to_toku_type(key_part->field); @@ -1640,9 +1801,8 @@ int ha_tokudb::initialize_share(const char* name, int mode) { // estimate_num_rows should not fail under normal conditions // if (error == 0) { - share->rows = num_rows; - } - else { + share->set_row_count(num_rows, true); + } else { goto exit; } // @@ -1655,8 +1815,7 @@ int ha_tokudb::initialize_share(const char* name, int mode) { if (may_table_be_empty(txn)) { share->try_table_lock = true; - } - else { + } else { share->try_table_lock = false; } @@ -1665,12 +1824,22 @@ int ha_tokudb::initialize_share(const char* name, int mode) { init_hidden_prim_key_info(txn); // initialize cardinality info from the status dictionary - share->n_rec_per_key = tokudb::compute_total_key_parts(table_share); - share->rec_per_key = (uint64_t *) tokudb_my_realloc(share->rec_per_key, share->n_rec_per_key * sizeof (uint64_t), MYF(MY_FAE + MY_ALLOW_ZERO_PTR)); - error = tokudb::get_card_from_status(share->status_block, txn, share->n_rec_per_key, share->rec_per_key); - if (error) { - for (uint i = 0; i < share->n_rec_per_key; i++) - share->rec_per_key[i] = 0; + { + uint32_t rec_per_keys = tokudb::compute_total_key_parts(table_share); + uint64_t* rec_per_key = + (uint64_t*)tokudb::memory::malloc( + rec_per_keys * sizeof(uint64_t), + MYF(MY_FAE)); + error = + tokudb::get_card_from_status( + share->status_block, + txn, + rec_per_keys, + rec_per_key); + if (error) { + memset(rec_per_key, 0, sizeof(ulonglong) * rec_per_keys); + } + share->init_cardinality_counts(rec_per_keys, rec_per_key); } error = 0; @@ -1720,7 +1889,8 @@ int ha_tokudb::open(const char *name, int mode, uint test_if_locked) { // the "+ 1" is for the first byte that states +/- infinity // multiply everything by 2 to account for clustered keys having a key and primary key together max_key_length = 2*(table_share->max_key_length + MAX_REF_PARTS * 3 + sizeof(uchar)); - alloc_ptr = tokudb_my_multi_malloc(MYF(MY_WME), + alloc_ptr = tokudb::memory::multi_malloc( + MYF(MY_WME), &key_buff, max_key_length, &key_buff2, max_key_length, &key_buff3, max_key_length, @@ -1730,82 +1900,82 @@ int ha_tokudb::open(const char *name, int mode, uint test_if_locked) { &primary_key_buff, (hidden_primary_key ? 0 : max_key_length), &fixed_cols_for_query, table_share->fields*sizeof(uint32_t), &var_cols_for_query, table_share->fields*sizeof(uint32_t), - NullS - ); + NullS); if (alloc_ptr == NULL) { ret_val = 1; goto exit; } - size_range_query_buff = get_tokudb_read_buf_size(thd); - range_query_buff = (uchar *)tokudb_my_malloc(size_range_query_buff, MYF(MY_WME)); + size_range_query_buff = tokudb::sysvars::read_buf_size(thd); + range_query_buff = + (uchar*)tokudb::memory::malloc(size_range_query_buff, MYF(MY_WME)); if (range_query_buff == NULL) { ret_val = 1; goto exit; } - alloced_rec_buff_length = table_share->rec_buff_length + table_share->fields; - rec_buff = (uchar *) tokudb_my_malloc(alloced_rec_buff_length, MYF(MY_WME)); + alloced_rec_buff_length = table_share->rec_buff_length + + table_share->fields; + rec_buff = (uchar *) tokudb::memory::malloc( + alloced_rec_buff_length, + MYF(MY_WME)); if (rec_buff == NULL) { ret_val = 1; goto exit; } alloced_update_rec_buff_length = alloced_rec_buff_length; - rec_update_buff = (uchar *) tokudb_my_malloc(alloced_update_rec_buff_length, MYF(MY_WME)); + rec_update_buff = (uchar*)tokudb::memory::malloc( + alloced_update_rec_buff_length, + MYF(MY_WME)); if (rec_update_buff == NULL) { ret_val = 1; goto exit; } // lookup or create share - tokudb_pthread_mutex_lock(&tokudb_mutex); - share = get_share(name, table_share); - assert(share); + share = TOKUDB_SHARE::get_share(name, table_share, &lock, true); + assert_always(share); - thr_lock_data_init(&share->lock, &lock, NULL); - - tokudb_pthread_mutex_lock(&share->mutex); - tokudb_pthread_mutex_unlock(&tokudb_mutex); - share->use_count++; - while (share->m_state == TOKUDB_SHARE::OPENING || share->m_state == TOKUDB_SHARE::CLOSING) { - tokudb_pthread_cond_wait(&share->m_openclose_cond, &share->mutex); - } - if (share->m_state == TOKUDB_SHARE::CLOSED) { - share->m_state = TOKUDB_SHARE::OPENING; - tokudb_pthread_mutex_unlock(&share->mutex); + if (share->state() != TOKUDB_SHARE::OPENED) { + // means we're responsible for the transition to OPENED, ERROR or CLOSED ret_val = allocate_key_and_col_info(table_share, &share->kc_info); if (ret_val == 0) { ret_val = initialize_share(name, mode); } - tokudb_pthread_mutex_lock(&share->mutex); if (ret_val == 0) { - share->m_state = TOKUDB_SHARE::OPENED; + share->set_state(TOKUDB_SHARE::OPENED); } else { - share->m_state = TOKUDB_SHARE::ERROR; - share->m_error = ret_val; + free_key_and_col_info(&share->kc_info); + share->set_state(TOKUDB_SHARE::ERROR); } - tokudb_pthread_cond_broadcast(&share->m_openclose_cond); - } - if (share->m_state == TOKUDB_SHARE::ERROR) { - ret_val = share->m_error; - tokudb_pthread_mutex_unlock(&share->mutex); - free_share(share); - goto exit; + share->unlock(); } else { - assert(share->m_state == TOKUDB_SHARE::OPENED); - tokudb_pthread_mutex_unlock(&share->mutex); + // got an already OPENED instance + share->unlock(); } - ref_length = share->ref_length; // If second open - - if (tokudb_debug & TOKUDB_DEBUG_OPEN) { - TOKUDB_HANDLER_TRACE("tokudbopen:%p:share=%p:file=%p:table=%p:table->s=%p:%d", - this, share, share->file, table, table->s, share->use_count); + if (share->state() == TOKUDB_SHARE::ERROR) { + share->release(); + goto exit; } + assert_always(share->state() == TOKUDB_SHARE::OPENED); + + ref_length = share->ref_length; // If second open + + TOKUDB_HANDLER_TRACE_FOR_FLAGS( + TOKUDB_DEBUG_OPEN, + "tokudbopen:%p:share=%p:file=%p:table=%p:table->s=%p:%d", + this, + share, + share->file, + table, + table->s, + share->use_count()); + key_read = false; stats.block_size = 1<<20; // QQQ Tokudb DB block size @@ -1813,13 +1983,13 @@ int ha_tokudb::open(const char *name, int mode, uint test_if_locked) { exit: if (ret_val) { - tokudb_my_free(range_query_buff); + tokudb::memory::free(range_query_buff); range_query_buff = NULL; - tokudb_my_free(alloc_ptr); + tokudb::memory::free(alloc_ptr); alloc_ptr = NULL; - tokudb_my_free(rec_buff); + tokudb::memory::free(rec_buff); rec_buff = NULL; - tokudb_my_free(rec_update_buff); + tokudb::memory::free(rec_update_buff); rec_update_buff = NULL; if (error) { @@ -1982,7 +2152,7 @@ int ha_tokudb::write_frm_data(DB* db, DB_TXN* txn, const char* frm_name) { error = 0; cleanup: - tokudb_my_free(frm_data); + tokudb::memory::free(frm_data); TOKUDB_HANDLER_DBUG_RETURN(error); } @@ -1993,8 +2163,8 @@ int ha_tokudb::remove_frm_data(DB *db, DB_TXN *txn) { static int smart_dbt_callback_verify_frm (DBT const *key, DBT const *row, void *context) { DBT* stored_frm = (DBT *)context; stored_frm->size = row->size; - stored_frm->data = (uchar *)tokudb_my_malloc(row->size, MYF(MY_WME)); - assert(stored_frm->data); + stored_frm->data = (uchar *)tokudb::memory::malloc(row->size, MYF(MY_WME)); + assert_always(stored_frm->data); memcpy(stored_frm->data, row->data, row->size); return 0; } @@ -2046,8 +2216,8 @@ int ha_tokudb::verify_frm_data(const char* frm_name, DB_TXN* txn) { error = 0; cleanup: - tokudb_my_free(mysql_frm_data); - tokudb_my_free(stored_frm.data); + tokudb::memory::free(mysql_frm_data); + tokudb::memory::free(stored_frm.data); TOKUDB_HANDLER_DBUG_RETURN(error); } @@ -2083,7 +2253,7 @@ int ha_tokudb::write_auto_inc_create(DB* db, ulonglong val, DB_TXN* txn){ // // Closes a handle to a table. // -int ha_tokudb::close(void) { +int ha_tokudb::close() { TOKUDB_HANDLER_DBUG_ENTER(""); int r = __close(); TOKUDB_HANDLER_DBUG_RETURN(r); @@ -2091,13 +2261,12 @@ int ha_tokudb::close(void) { int ha_tokudb::__close() { TOKUDB_HANDLER_DBUG_ENTER(""); - if (tokudb_debug & TOKUDB_DEBUG_OPEN) - TOKUDB_HANDLER_TRACE("close:%p", this); - tokudb_my_free(rec_buff); - tokudb_my_free(rec_update_buff); - tokudb_my_free(blob_buff); - tokudb_my_free(alloc_ptr); - tokudb_my_free(range_query_buff); + TOKUDB_HANDLER_TRACE_FOR_FLAGS(TOKUDB_DEBUG_OPEN, "close:%p", this); + tokudb::memory::free(rec_buff); + tokudb::memory::free(rec_update_buff); + tokudb::memory::free(blob_buff); + tokudb::memory::free(alloc_ptr); + tokudb::memory::free(range_query_buff); for (uint32_t i = 0; i < sizeof(mult_key_dbt_array)/sizeof(mult_key_dbt_array[0]); i++) { toku_dbt_array_destroy(&mult_key_dbt_array[i]); } @@ -2108,7 +2277,7 @@ int ha_tokudb::__close() { rec_update_buff = NULL; alloc_ptr = NULL; ha_tokudb::reset(); - int retval = free_share(share); + int retval = share->release(); TOKUDB_HANDLER_DBUG_RETURN(retval); } @@ -2120,8 +2289,11 @@ int ha_tokudb::__close() { // bool ha_tokudb::fix_rec_buff_for_blob(ulong length) { if (!rec_buff || (length > alloced_rec_buff_length)) { - uchar *newptr; - if (!(newptr = (uchar *) tokudb_my_realloc((void *) rec_buff, length, MYF(MY_ALLOW_ZERO_PTR)))) + uchar* newptr = (uchar*)tokudb::memory::realloc( + (void*)rec_buff, + length, + MYF(MY_ALLOW_ZERO_PTR)); + if (!newptr) return 1; rec_buff = newptr; alloced_rec_buff_length = length; @@ -2137,8 +2309,11 @@ bool ha_tokudb::fix_rec_buff_for_blob(ulong length) { // bool ha_tokudb::fix_rec_update_buff_for_blob(ulong length) { if (!rec_update_buff || (length > alloced_update_rec_buff_length)) { - uchar *newptr; - if (!(newptr = (uchar *) tokudb_my_realloc((void *) rec_update_buff, length, MYF(MY_ALLOW_ZERO_PTR)))) + uchar* newptr = (uchar*)tokudb::memory::realloc( + (void*)rec_update_buff, + length, + MYF(MY_ALLOW_ZERO_PTR)); + if (!newptr) return 1; rec_update_buff= newptr; alloced_update_rec_buff_length = length; @@ -2273,9 +2448,11 @@ int ha_tokudb::unpack_blobs( // // assert that num_bytes > 0 iff share->num_blobs > 0 // - assert( !((share->kc_info.num_blobs == 0) && (num_bytes > 0)) ); + assert_always( !((share->kc_info.num_blobs == 0) && (num_bytes > 0)) ); if (num_bytes > num_blob_bytes) { - ptr = (uchar *)tokudb_my_realloc((void *)blob_buff, num_bytes, MYF(MY_ALLOW_ZERO_PTR)); + ptr = (uchar*)tokudb::memory::realloc( + (void*)blob_buff, num_bytes, + MYF(MY_ALLOW_ZERO_PTR)); if (ptr == NULL) { error = ENOMEM; goto exit; @@ -2390,8 +2567,7 @@ int ha_tokudb::unpack_row( data_end_offset = uint2korr(var_field_offset_ptr); break; default: - assert(false); - break; + assert_unreachable(); } unpack_var_field( record + field_offset(field, table), @@ -2488,13 +2664,13 @@ exit: } uint32_t ha_tokudb::place_key_into_mysql_buff( - KEY* key_info, - uchar * record, - uchar* data - ) -{ - KEY_PART_INFO *key_part = key_info->key_part, *end = key_part + get_key_parts(key_info); - uchar *pos = data; + KEY* key_info, + uchar* record, + uchar* data) { + + KEY_PART_INFO* key_part = key_info->key_part; + KEY_PART_INFO* end = key_part + key_info->user_defined_key_parts; + uchar* pos = data; for (; key_part != end; key_part++) { if (key_part->field->null_bit) { @@ -2513,7 +2689,7 @@ uint32_t ha_tokudb::place_key_into_mysql_buff( // // HOPEFULLY TEMPORARY // - assert(table->s->db_low_byte_first); + assert_always(table->s->db_low_byte_first); #endif pos = unpack_toku_key_field( record + field_offset(key_part->field, table), @@ -2554,15 +2730,14 @@ void ha_tokudb::unpack_key(uchar * record, DBT const *key, uint index) { } uint32_t ha_tokudb::place_key_into_dbt_buff( - KEY* key_info, - uchar * buff, - const uchar * record, - bool* has_null, - int key_length - ) -{ - KEY_PART_INFO *key_part = key_info->key_part; - KEY_PART_INFO *end = key_part + get_key_parts(key_info); + KEY* key_info, + uchar* buff, + const uchar* record, + bool* has_null, + int key_length) { + + KEY_PART_INFO* key_part = key_info->key_part; + KEY_PART_INFO* end = key_part + key_info->user_defined_key_parts; uchar* curr_buff = buff; *has_null = false; for (; key_part != end && key_length > 0; key_part++) { @@ -2585,7 +2760,7 @@ uint32_t ha_tokudb::place_key_into_dbt_buff( // // HOPEFULLY TEMPORARY // - assert(table->s->db_low_byte_first); + assert_always(table->s->db_low_byte_first); #endif // // accessing field_offset(key_part->field) instead off key_part->offset @@ -2742,25 +2917,29 @@ DBT* ha_tokudb::create_dbt_key_for_lookup( // Returns: // the parameter key // -DBT *ha_tokudb::pack_key( - DBT * key, - uint keynr, - uchar * buff, - const uchar * key_ptr, - uint key_length, - int8_t inf_byte - ) -{ - TOKUDB_HANDLER_DBUG_ENTER("key %p %u:%2.2x inf=%d", key_ptr, key_length, key_length > 0 ? key_ptr[0] : 0, inf_byte); +DBT* ha_tokudb::pack_key( + DBT* key, + uint keynr, + uchar* buff, + const uchar* key_ptr, + uint key_length, + int8_t inf_byte) { + + TOKUDB_HANDLER_DBUG_ENTER( + "key %p %u:%2.2x inf=%d", + key_ptr, + key_length, + key_length > 0 ? key_ptr[0] : 0, + inf_byte); #if TOKU_INCLUDE_EXTENDED_KEYS if (keynr != primary_key && !tokudb_test(hidden_primary_key)) { DBUG_RETURN(pack_ext_key(key, keynr, buff, key_ptr, key_length, inf_byte)); } #endif - KEY *key_info = &table->key_info[keynr]; - KEY_PART_INFO *key_part = key_info->key_part; - KEY_PART_INFO *end = key_part + get_key_parts(key_info); - my_bitmap_map *old_map = dbug_tmp_use_all_columns(table, table->write_set); + KEY* key_info = &table->key_info[keynr]; + KEY_PART_INFO* key_part = key_info->key_part; + KEY_PART_INFO* end = key_part + key_info->user_defined_key_parts; + my_bitmap_map* old_map = dbug_tmp_use_all_columns(table, table->write_set); memset((void *) key, 0, sizeof(*key)); key->data = buff; @@ -2782,7 +2961,7 @@ DBT *ha_tokudb::pack_key( offset = 1; // Data is at key_ptr+1 } #if !defined(MARIADB_BASE_VERSION) - assert(table->s->db_low_byte_first); + assert_always(table->s->db_low_byte_first); #endif buff = pack_key_toku_key_field( buff, @@ -2802,31 +2981,30 @@ DBT *ha_tokudb::pack_key( } #if TOKU_INCLUDE_EXTENDED_KEYS -DBT *ha_tokudb::pack_ext_key( - DBT * key, - uint keynr, - uchar * buff, - const uchar * key_ptr, - uint key_length, - int8_t inf_byte - ) -{ +DBT* ha_tokudb::pack_ext_key( + DBT* key, + uint keynr, + uchar* buff, + const uchar* key_ptr, + uint key_length, + int8_t inf_byte) { + TOKUDB_HANDLER_DBUG_ENTER(""); // build a list of PK parts that are in the SK. we will use this list to build the // extended key if necessary. - KEY *pk_key_info = &table->key_info[primary_key]; - uint pk_parts = get_key_parts(pk_key_info); + KEY* pk_key_info = &table->key_info[primary_key]; + uint pk_parts = pk_key_info->user_defined_key_parts; uint pk_next = 0; struct { const uchar *key_ptr; KEY_PART_INFO *key_part; } pk_info[pk_parts]; - KEY *key_info = &table->key_info[keynr]; - KEY_PART_INFO *key_part = key_info->key_part; - KEY_PART_INFO *end = key_part + get_key_parts(key_info); - my_bitmap_map *old_map = dbug_tmp_use_all_columns(table, table->write_set); + KEY* key_info = &table->key_info[keynr]; + KEY_PART_INFO* key_part = key_info->key_part; + KEY_PART_INFO* end = key_part + key_info->user_defined_key_parts; + my_bitmap_map* old_map = dbug_tmp_use_all_columns(table, table->write_set); memset((void *) key, 0, sizeof(*key)); key->data = buff; @@ -2838,7 +3016,7 @@ DBT *ha_tokudb::pack_ext_key( for (; key_part != end && (int) key_length > 0; key_part++) { // if the SK part is part of the PK, then append it to the list. if (key_part->field->part_of_key.is_set(primary_key)) { - assert(pk_next < pk_parts); + assert_always(pk_next < pk_parts); pk_info[pk_next].key_ptr = key_ptr; pk_info[pk_next].key_part = key_part; pk_next++; @@ -2855,7 +3033,7 @@ DBT *ha_tokudb::pack_ext_key( offset = 1; // Data is at key_ptr+1 } #if !defined(MARIADB_BASE_VERSION) - assert(table->s->db_low_byte_first); + assert_always(table->s->db_low_byte_first); #endif buff = pack_key_toku_key_field( buff, @@ -2869,22 +3047,33 @@ DBT *ha_tokudb::pack_ext_key( } if (key_length > 0) { - assert(key_part == end); + assert_always(key_part == end); end = key_info->key_part + get_ext_key_parts(key_info); // pack PK in order of PK key parts - for (uint pk_index = 0; key_part != end && (int) key_length > 0 && pk_index < pk_parts; pk_index++) { + for (uint pk_index = 0; + key_part != end && (int) key_length > 0 && pk_index < pk_parts; + pk_index++) { uint i; for (i = 0; i < pk_next; i++) { - if (pk_info[i].key_part->fieldnr == pk_key_info->key_part[pk_index].fieldnr) + if (pk_info[i].key_part->fieldnr == + pk_key_info->key_part[pk_index].fieldnr) break; } if (i < pk_next) { const uchar *this_key_ptr = pk_info[i].key_ptr; KEY_PART_INFO *this_key_part = pk_info[i].key_part; - buff = pack_key_toku_key_field(buff, (uchar *) this_key_ptr, this_key_part->field, this_key_part->length); + buff = pack_key_toku_key_field( + buff, + (uchar*)this_key_ptr, + this_key_part->field, + this_key_part->length); } else { - buff = pack_key_toku_key_field(buff, (uchar *) key_ptr, key_part->field, key_part->length); + buff = pack_key_toku_key_field( + buff, + (uchar*)key_ptr, + key_part->field, + key_part->length); key_ptr += key_part->store_length; key_length -= key_part->store_length; key_part++; @@ -2907,18 +3096,22 @@ void ha_tokudb::init_hidden_prim_key_info(DB_TXN *txn) { if (!(share->status & STATUS_PRIMARY_KEY_INIT)) { int error = 0; DBC* c = NULL; - error = share->key_file[primary_key]->cursor(share->key_file[primary_key], txn, &c, 0); - assert(error == 0); + error = share->key_file[primary_key]->cursor( + share->key_file[primary_key], + txn, + &c, + 0); + assert_always(error == 0); DBT key,val; memset(&key, 0, sizeof(key)); memset(&val, 0, sizeof(val)); error = c->c_get(c, &key, &val, DB_LAST); if (error == 0) { - assert(key.size == TOKUDB_HIDDEN_PRIMARY_KEY_LENGTH); + assert_always(key.size == TOKUDB_HIDDEN_PRIMARY_KEY_LENGTH); share->auto_ident = hpk_char_to_num((uchar *)key.data); } error = c->c_close(c); - assert(error == 0); + assert_always(error == 0); share->status |= STATUS_PRIMARY_KEY_INIT; } TOKUDB_HANDLER_DBUG_VOID_RETURN; @@ -2939,11 +3132,11 @@ int ha_tokudb::get_status(DB_TXN* txn) { // open status.tokudb // if (!share->status_block) { - error = open_status_dictionary( - &share->status_block, - share->table_name, - txn - ); + error = + open_status_dictionary( + &share->status_block, + share->full_table_name(), + txn); if (error) { goto cleanup; } @@ -2958,7 +3151,7 @@ int ha_tokudb::get_status(DB_TXN* txn) { key.size = sizeof(curr_key); value.flags = DB_DBT_USERMEM; - assert(share->status_block); + assert_always(share->status_block); // // get version // @@ -3048,7 +3241,7 @@ cleanup: */ ha_rows ha_tokudb::estimate_rows_upper_bound() { TOKUDB_HANDLER_DBUG_ENTER(""); - DBUG_RETURN(share->rows + HA_TOKUDB_EXTRA_ROWS); + DBUG_RETURN(share->row_count() + HA_TOKUDB_EXTRA_ROWS); } // @@ -3112,8 +3305,8 @@ bool ha_tokudb::may_table_be_empty(DB_TXN *txn) { DBC* tmp_cursor = NULL; DB_TXN* tmp_txn = NULL; - const int empty_scan = THDVAR(ha_thd(), empty_scan); - if (empty_scan == TOKUDB_EMPTY_SCAN_DISABLED) + const int empty_scan = tokudb::sysvars::empty_scan(ha_thd()); + if (empty_scan == tokudb::sysvars::TOKUDB_EMPTY_SCAN_DISABLED) goto cleanup; if (txn == NULL) { @@ -3128,7 +3321,7 @@ bool ha_tokudb::may_table_be_empty(DB_TXN *txn) { if (error) goto cleanup; tmp_cursor->c_set_check_interrupt_callback(tmp_cursor, tokudb_killed_thd_callback, ha_thd()); - if (empty_scan == TOKUDB_EMPTY_SCAN_LR) + if (empty_scan == tokudb::sysvars::TOKUDB_EMPTY_SCAN_LR) error = tmp_cursor->c_getf_next(tmp_cursor, 0, smart_dbt_do_nothing, NULL); else error = tmp_cursor->c_getf_prev(tmp_cursor, 0, smart_dbt_do_nothing, NULL); @@ -3142,7 +3335,7 @@ bool ha_tokudb::may_table_be_empty(DB_TXN *txn) { cleanup: if (tmp_cursor) { int r = tmp_cursor->c_close(tmp_cursor); - assert(r == 0); + assert_always(r == 0); tmp_cursor = NULL; } if (tmp_txn) { @@ -3165,23 +3358,24 @@ void ha_tokudb::start_bulk_insert(ha_rows rows) { ai_metadata_update_required = false; abort_loader = false; - rw_rdlock(&share->num_DBs_lock); + share->_num_DBs_lock.lock_read(); uint curr_num_DBs = table->s->keys + tokudb_test(hidden_primary_key); num_DBs_locked_in_bulk = true; lock_count = 0; if ((rows == 0 || rows > 1) && share->try_table_lock) { - if (get_prelock_empty(thd) && may_table_be_empty(transaction) && transaction != NULL) { + if (tokudb::sysvars::prelock_empty(thd) && + may_table_be_empty(transaction) && + transaction != NULL) { if (using_ignore || is_insert_ignore(thd) || thd->lex->duplicates != DUP_ERROR || table->s->next_number_key_offset) { acquire_table_lock(transaction, lock_write); - } - else { + } else { mult_dbt_flags[primary_key] = 0; if (!thd_test_options(thd, OPTION_RELAXED_UNIQUE_CHECKS) && !hidden_primary_key) { mult_put_flags[primary_key] = DB_NOOVERWRITE; } - uint32_t loader_flags = (get_load_save_space(thd)) ? + uint32_t loader_flags = (tokudb::sysvars::load_save_space(thd)) ? LOADER_COMPRESS_INTERMEDIATES : 0; int error = db_env->create_loader( @@ -3196,7 +3390,7 @@ void ha_tokudb::start_bulk_insert(ha_rows rows) { loader_flags ); if (error) { - assert(loader == NULL); + assert_always(loader == NULL); goto exit_try_table_lock; } @@ -3204,18 +3398,18 @@ void ha_tokudb::start_bulk_insert(ha_rows rows) { lc.ha = this; error = loader->set_poll_function(loader, loader_poll_fun, &lc); - assert(!error); + assert_always(!error); error = loader->set_error_callback(loader, loader_dup_fun, &lc); - assert(!error); + assert_always(!error); trx->stmt_progress.using_loader = true; } } exit_try_table_lock: - tokudb_pthread_mutex_lock(&share->mutex); + share->lock(); share->try_table_lock = false; - tokudb_pthread_mutex_unlock(&share->mutex); + share->unlock(); } TOKUDB_HANDLER_DBUG_VOID_RETURN; } @@ -3232,9 +3426,9 @@ int ha_tokudb::end_bulk_insert(bool abort) { tokudb_trx_data* trx = (tokudb_trx_data *) thd_get_ha_data(thd, tokudb_hton); bool using_loader = (loader != NULL); if (ai_metadata_update_required) { - tokudb_pthread_mutex_lock(&share->mutex); + share->lock(); error = update_max_auto_inc(share->status_block, share->last_auto_increment); - tokudb_pthread_mutex_unlock(&share->mutex); + share->unlock(); if (error) { goto cleanup; } } delay_updating_ai_metadata = false; @@ -3285,7 +3479,7 @@ int ha_tokudb::end_bulk_insert(bool abort) { cleanup: if (num_DBs_locked_in_bulk) { - rw_unlock(&share->num_DBs_lock); + share->_num_DBs_lock.unlock(); } num_DBs_locked_in_bulk = false; lock_count = 0; @@ -3380,10 +3574,10 @@ int ha_tokudb::is_index_unique(bool* is_unique, DB_TXN* txn, DB* db, KEY* key_in cnt++; if ((cnt % 10000) == 0) { sprintf( - status_msg, - "Verifying index uniqueness: Checked %llu of %llu rows in key-%s.", - (long long unsigned) cnt, - share->rows, + status_msg, + "Verifying index uniqueness: Checked %llu of %llu rows in key-%s.", + (long long unsigned) cnt, + share->row_count(), key_info->name); thd_proc_info(thd, status_msg); if (thd_killed(thd)) { @@ -3467,7 +3661,7 @@ int ha_tokudb::is_val_unique(bool* is_unique, uchar* record, KEY* key_info, uint cleanup: if (tmp_cursor) { int r = tmp_cursor->c_close(tmp_cursor); - assert(r==0); + assert_always(r==0); tmp_cursor = NULL; } return error; @@ -3475,21 +3669,25 @@ cleanup: static void maybe_do_unique_checks_delay(THD *thd) { if (thd->slave_thread) { - uint64_t delay_ms = THDVAR(thd, rpl_unique_checks_delay); + uint64_t delay_ms = tokudb::sysvars::rpl_unique_checks_delay(thd); if (delay_ms) usleep(delay_ms * 1000); } } static bool need_read_only(THD *thd) { - return opt_readonly || !THDVAR(thd, rpl_check_readonly); -} + return opt_readonly || !tokudb::sysvars::rpl_check_readonly(thd); +} static bool do_unique_checks(THD *thd, bool do_rpl_event) { - if (do_rpl_event && thd->slave_thread && need_read_only(thd) && !THDVAR(thd, rpl_unique_checks)) + if (do_rpl_event && + thd->slave_thread && + need_read_only(thd) && + !tokudb::sysvars::rpl_unique_checks(thd)) { return false; - else + } else { return !thd_test_options(thd, OPTION_RELAXED_UNIQUE_CHECKS); + } } int ha_tokudb::do_uniqueness_checks(uchar* record, DB_TXN* txn, THD* thd) { @@ -3552,10 +3750,10 @@ void ha_tokudb::test_row_packing(uchar* record, DBT* pk_key, DBT* pk_val) { // //use for testing the packing of keys // - tmp_pk_key_data = (uchar *)tokudb_my_malloc(pk_key->size, MYF(MY_WME)); - assert(tmp_pk_key_data); - tmp_pk_val_data = (uchar *)tokudb_my_malloc(pk_val->size, MYF(MY_WME)); - assert(tmp_pk_val_data); + tmp_pk_key_data = (uchar*)tokudb::memory::malloc(pk_key->size, MYF(MY_WME)); + assert_always(tmp_pk_key_data); + tmp_pk_val_data = (uchar*)tokudb::memory::malloc(pk_val->size, MYF(MY_WME)); + assert_always(tmp_pk_val_data); memcpy(tmp_pk_key_data, pk_key->data, pk_key->size); memcpy(tmp_pk_val_data, pk_val->data, pk_val->size); tmp_pk_key.data = tmp_pk_key_data; @@ -3588,19 +3786,21 @@ void ha_tokudb::test_row_packing(uchar* record, DBT* pk_key, DBT* pk_val) { &tmp_pk_key, &tmp_pk_val ); - assert(tmp_num_bytes == key.size); + assert_always(tmp_num_bytes == key.size); cmp = memcmp(key_buff3,key_buff2,tmp_num_bytes); - assert(cmp == 0); + assert_always(cmp == 0); // // test key packing of clustering keys // if (key_is_clustering(&table->key_info[keynr])) { error = pack_row(&row, (const uchar *) record, keynr); - assert(error == 0); + assert_always(error == 0); uchar* tmp_buff = NULL; - tmp_buff = (uchar *)tokudb_my_malloc(alloced_rec_buff_length,MYF(MY_WME)); - assert(tmp_buff); + tmp_buff = (uchar*)tokudb::memory::malloc( + alloced_rec_buff_length, + MYF(MY_WME)); + assert_always(tmp_buff); row_desc = (uchar *)share->key_file[keynr]->descriptor->dbt.data; row_desc += (*(uint32_t *)row_desc); row_desc += (*(uint32_t *)row_desc); @@ -3612,10 +3812,10 @@ void ha_tokudb::test_row_packing(uchar* record, DBT* pk_key, DBT* pk_val) { desc_size, &tmp_pk_val ); - assert(tmp_num_bytes == row.size); + assert_always(tmp_num_bytes == row.size); cmp = memcmp(tmp_buff,rec_buff,tmp_num_bytes); - assert(cmp == 0); - tokudb_my_free(tmp_buff); + assert_always(cmp == 0); + tokudb::memory::free(tmp_buff); } } @@ -3623,12 +3823,12 @@ void ha_tokudb::test_row_packing(uchar* record, DBT* pk_key, DBT* pk_val) { // copy stuff back out // error = pack_row(pk_val, (const uchar *) record, primary_key); - assert(pk_val->size == tmp_pk_val.size); + assert_always(pk_val->size == tmp_pk_val.size); cmp = memcmp(pk_val->data, tmp_pk_val_data, pk_val->size); - assert( cmp == 0); + assert_always( cmp == 0); - tokudb_my_free(tmp_pk_key_data); - tokudb_my_free(tmp_pk_val_data); + tokudb::memory::free(tmp_pk_key_data); + tokudb::memory::free(tmp_pk_val_data); } // set the put flags for the main dictionary @@ -3675,7 +3875,7 @@ void ha_tokudb::set_main_dict_put_flags(THD* thd, bool opt_eligible, uint32_t* p int ha_tokudb::insert_row_to_main_dictionary(uchar* record, DBT* pk_key, DBT* pk_val, DB_TXN* txn) { int error = 0; uint curr_num_DBs = table->s->keys + tokudb_test(hidden_primary_key); - assert(curr_num_DBs == 1); + assert_always(curr_num_DBs == 1); uint32_t put_flags = mult_put_flags[primary_key]; THD *thd = ha_thd(); @@ -3807,33 +4007,36 @@ int ha_tokudb::write_row(uchar * record) { // of the auto inc field. // if (share->has_auto_inc && record == table->record[0]) { - tokudb_pthread_mutex_lock(&share->mutex); + share->lock(); ulonglong curr_auto_inc = retrieve_auto_increment( - table->field[share->ai_field_index]->key_type(), field_offset(table->field[share->ai_field_index], table), record); + table->field[share->ai_field_index]->key_type(), + field_offset(table->field[share->ai_field_index], table), + record); if (curr_auto_inc > share->last_auto_increment) { share->last_auto_increment = curr_auto_inc; if (delay_updating_ai_metadata) { ai_metadata_update_required = true; - } - else { - update_max_auto_inc(share->status_block, share->last_auto_increment); + } else { + update_max_auto_inc( + share->status_block, + share->last_auto_increment); } } - tokudb_pthread_mutex_unlock(&share->mutex); + share->unlock(); } // // grab reader lock on numDBs_lock // if (!num_DBs_locked_in_bulk) { - rw_rdlock(&share->num_DBs_lock); + share->_num_DBs_lock.lock_read(); num_DBs_locked = true; } else { lock_count++; if (lock_count >= 2000) { - rw_unlock(&share->num_DBs_lock); - rw_rdlock(&share->num_DBs_lock); + share->_num_DBs_lock.unlock(); + share->_num_DBs_lock.lock_read(); lock_count = 0; } } @@ -3863,10 +4066,8 @@ int ha_tokudb::write_row(uchar * record) { } } txn = create_sub_trans ? sub_trans : transaction; - if (tokudb_debug & TOKUDB_DEBUG_TXN) { - TOKUDB_HANDLER_TRACE("txn %p", txn); - } - if (tokudb_debug & TOKUDB_DEBUG_CHECK_KEY) { + TOKUDB_HANDLER_TRACE_FOR_FLAGS(TOKUDB_DEBUG_TXN, "txn %p", txn); + if (TOKUDB_UNLIKELY(TOKUDB_DEBUG_FLAGS(TOKUDB_DEBUG_CHECK_KEY))) { test_row_packing(record,&prim_key,&row); } if (loader) { @@ -3875,8 +4076,7 @@ int ha_tokudb::write_row(uchar * record) { abort_loader = true; goto cleanup; } - } - else { + } else { error = do_uniqueness_checks(record, txn, thd); if (error) { // for #4633 @@ -3889,8 +4089,7 @@ int ha_tokudb::write_row(uchar * record) { // was found and this is a duplicate key, // so we set last_dup_key last_dup_key = primary_key; - } - else if (r != DB_NOTFOUND) { + } else if (r != DB_NOTFOUND) { // if some other error is returned, return that to the user. error = r; } @@ -3900,8 +4099,7 @@ int ha_tokudb::write_row(uchar * record) { if (curr_num_DBs == 1) { error = insert_row_to_main_dictionary(record,&prim_key, &row, txn); if (error) { goto cleanup; } - } - else { + } else { error = insert_rows_to_dictionaries_mult(&prim_key, &row, txn, thd); if (error) { goto cleanup; } } @@ -3919,7 +4117,7 @@ int ha_tokudb::write_row(uchar * record) { } cleanup: if (num_DBs_locked) { - rw_unlock(&share->num_DBs_lock); + share->_num_DBs_lock.unlock(); } if (error == DB_KEYEXIST) { error = HA_ERR_FOUND_DUPP_KEY; @@ -3989,7 +4187,7 @@ int ha_tokudb::update_row(const uchar * old_row, uchar * new_row) { // of the auto inc field. // if (share->has_auto_inc && new_row == table->record[0]) { - tokudb_pthread_mutex_lock(&share->mutex); + share->lock(); ulonglong curr_auto_inc = retrieve_auto_increment( table->field[share->ai_field_index]->key_type(), field_offset(table->field[share->ai_field_index], table), @@ -4001,7 +4199,7 @@ int ha_tokudb::update_row(const uchar * old_row, uchar * new_row) { share->last_auto_increment = curr_auto_inc; } } - tokudb_pthread_mutex_unlock(&share->mutex); + share->unlock(); } // @@ -4009,7 +4207,7 @@ int ha_tokudb::update_row(const uchar * old_row, uchar * new_row) { // bool num_DBs_locked = false; if (!num_DBs_locked_in_bulk) { - rw_rdlock(&share->num_DBs_lock); + share->_num_DBs_lock.lock_read(); num_DBs_locked = true; } curr_num_DBs = share->num_DBs; @@ -4100,6 +4298,7 @@ int ha_tokudb::update_row(const uchar * old_row, uchar * new_row) { last_dup_key = primary_key; } else if (!error) { + updated_rows++; trx->stmt_progress.updated++; track_progress(thd); } @@ -4107,7 +4306,7 @@ int ha_tokudb::update_row(const uchar * old_row, uchar * new_row) { cleanup: if (num_DBs_locked) { - rw_unlock(&share->num_DBs_lock); + share->_num_DBs_lock.unlock(); } if (error == DB_KEYEXIST) { error = HA_ERR_FOUND_DUPP_KEY; @@ -4150,7 +4349,7 @@ int ha_tokudb::delete_row(const uchar * record) { // bool num_DBs_locked = false; if (!num_DBs_locked_in_bulk) { - rw_rdlock(&share->num_DBs_lock); + share->_num_DBs_lock.lock_read(); num_DBs_locked = true; } curr_num_DBs = share->num_DBs; @@ -4166,33 +4365,36 @@ int ha_tokudb::delete_row(const uchar * record) { goto cleanup; } - if (tokudb_debug & TOKUDB_DEBUG_TXN) { - TOKUDB_HANDLER_TRACE("all %p stmt %p sub_sp_level %p transaction %p", trx->all, trx->stmt, trx->sub_sp_level, transaction); - } + TOKUDB_HANDLER_TRACE_FOR_FLAGS( + TOKUDB_DEBUG_TXN, + "all %p stmt %p sub_sp_level %p transaction %p", + trx->all, + trx->stmt, + trx->sub_sp_level, + transaction); - error = db_env->del_multiple( - db_env, - share->key_file[primary_key], - transaction, - &prim_key, - &row, - curr_num_DBs, - share->key_file, - mult_key_dbt_array, - mult_del_flags - ); + error = + db_env->del_multiple( + db_env, + share->key_file[primary_key], + transaction, + &prim_key, + &row, + curr_num_DBs, + share->key_file, + mult_key_dbt_array, + mult_del_flags); if (error) { DBUG_PRINT("error", ("Got error %d", error)); - } - else { + } else { deleted_rows++; trx->stmt_progress.deleted++; track_progress(thd); } cleanup: if (num_DBs_locked) { - rw_unlock(&share->num_DBs_lock); + share->_num_DBs_lock.unlock(); } TOKUDB_HANDLER_DBUG_RETURN(error); } @@ -4287,11 +4489,16 @@ cleanup: TOKUDB_HANDLER_DBUG_RETURN(error); } -static bool index_key_is_null(TABLE *table, uint keynr, const uchar *key, uint key_len) { +static bool index_key_is_null( + TABLE* table, + uint keynr, + const uchar* key, + uint key_len) { + bool key_can_be_null = false; - KEY *key_info = &table->key_info[keynr]; - KEY_PART_INFO *key_part = key_info->key_part; - KEY_PART_INFO *end = key_part + get_key_parts(key_info); + KEY* key_info = &table->key_info[keynr]; + KEY_PART_INFO* key_part = key_info->key_part; + KEY_PART_INFO* end = key_part + key_info->user_defined_key_parts; for (; key_part != end; key_part++) { if (key_part->null_bit) { key_can_be_null = true; @@ -4309,7 +4516,7 @@ static bool tokudb_do_bulk_fetch(THD *thd) { case SQLCOM_INSERT_SELECT: case SQLCOM_REPLACE_SELECT: case SQLCOM_DELETE: - return THDVAR(thd, bulk_fetch) != 0; + return tokudb::sysvars::bulk_fetch(thd) != 0; default: return false; } @@ -4361,7 +4568,7 @@ cleanup: // if (cursor) { int r = cursor->c_close(cursor); - assert(r==0); + assert_always(r==0); cursor = NULL; remove_from_trx_handler_list(); } @@ -4404,7 +4611,7 @@ int ha_tokudb::index_init(uint keynr, bool sorted) { if (cursor) { DBUG_PRINT("note", ("Closing active cursor")); int r = cursor->c_close(cursor); - assert(r==0); + assert_always(r==0); remove_from_trx_handler_list(); } active_index = keynr; @@ -4430,10 +4637,12 @@ int ha_tokudb::index_init(uint keynr, bool sorted) { if (use_write_locks) { cursor_flags |= DB_RMW; } - if (get_disable_prefetching(thd)) { + if (tokudb::sysvars::disable_prefetching(thd)) { cursor_flags |= DBC_DISABLE_PREFETCHING; } - if ((error = share->key_file[keynr]->cursor(share->key_file[keynr], transaction, &cursor, cursor_flags))) { + if ((error = share->key_file[keynr]->cursor(share->key_file[keynr], + transaction, &cursor, + cursor_flags))) { if (error == TOKUDB_MVCC_DICTIONARY_TOO_NEW) { error = HA_ERR_TABLE_DEF_CHANGED; my_error(ER_TABLE_DEF_CHANGED, MYF(0)); @@ -4478,7 +4687,7 @@ int ha_tokudb::index_end() { if (cursor) { DBUG_PRINT("enter", ("table: '%s'", table_share->table_name.str)); int r = cursor->c_close(cursor); - assert(r==0); + assert_always(r==0); cursor = NULL; remove_from_trx_handler_list(); last_cursor_error = 0; @@ -4546,7 +4755,7 @@ void ha_tokudb::extract_hidden_primary_key(uint keynr, DBT const *found_key) { int ha_tokudb::read_row_callback (uchar * buf, uint keynr, DBT const *row, DBT const *found_key) { - assert(keynr == primary_key); + assert_always(keynr == primary_key); return unpack_row(buf, row,found_key, keynr); } @@ -4672,7 +4881,7 @@ int ha_tokudb::read_full_row(uchar * buf) { // HA_ERR_END_OF_FILE if not found // error otherwise // -int ha_tokudb::index_next_same(uchar * buf, const uchar * key, uint keylen) { +int ha_tokudb::index_next_same(uchar* buf, const uchar* key, uint keylen) { TOKUDB_HANDLER_DBUG_ENTER(""); ha_statistic_increment(&SSV::ha_read_next_count); @@ -4690,8 +4899,16 @@ int ha_tokudb::index_next_same(uchar * buf, const uchar * key, uint keylen) { // // now do the comparison // - create_dbt_key_from_table(&found_key,tokudb_active_index,key_buff3,buf,&has_null); - cmp = tokudb_prefix_cmp_dbt_key(share->key_file[tokudb_active_index], &curr_key, &found_key); + create_dbt_key_from_table( + &found_key, + tokudb_active_index, + key_buff3,buf, + &has_null); + cmp = + tokudb_prefix_cmp_dbt_key( + share->key_file[tokudb_active_index], + &curr_key, + &found_key); if (cmp) { error = HA_ERR_END_OF_FILE; } @@ -4703,7 +4920,7 @@ cleanup: // -// According to InnoDB handlerton: Positions an index cursor to the index +// According to InnoDB handlerton: Positions an index cursor to the index // specified in keynr. Fetches the row if any // Parameters: // [out] buf - buffer for the returned row @@ -4719,10 +4936,20 @@ cleanup: // TODO: investigate this for correctness // error otherwise // -int ha_tokudb::index_read(uchar * buf, const uchar * key, uint key_len, enum ha_rkey_function find_flag) { - TOKUDB_HANDLER_DBUG_ENTER("key %p %u:%2.2x find=%u", key, key_len, key ? key[0] : 0, find_flag); +int ha_tokudb::index_read( + uchar* buf, + const uchar* key, + uint key_len, + enum ha_rkey_function find_flag) { + + TOKUDB_HANDLER_DBUG_ENTER( + "key %p %u:%2.2x find=%u", + key, + key_len, + key ? key[0] : 0, + find_flag); invalidate_bulk_fetch(); - if (tokudb_debug & TOKUDB_DEBUG_INDEX_KEY) { + if (TOKUDB_UNLIKELY(TOKUDB_DEBUG_FLAGS(TOKUDB_DEBUG_INDEX_KEY))) { TOKUDB_DBUG_DUMP("mysql key=", key, key_len); } DBT row; @@ -4730,14 +4957,17 @@ int ha_tokudb::index_read(uchar * buf, const uchar * key, uint key_len, enum ha_ int error = 0; uint32_t flags = 0; THD* thd = ha_thd(); - tokudb_trx_data* trx = (tokudb_trx_data *) thd_get_ha_data(thd, tokudb_hton);; + tokudb_trx_data* trx = (tokudb_trx_data*)thd_get_ha_data(thd, tokudb_hton); struct smart_dbt_info info; struct index_read_info ir_info; HANDLE_INVALID_CURSOR(); - // if we locked a non-null key range and we now have a null key, then remove the bounds from the cursor - if (range_lock_grabbed && !range_lock_grabbed_null && index_key_is_null(table, tokudb_active_index, key, key_len)) { + // if we locked a non-null key range and we now have a null key, then + // remove the bounds from the cursor + if (range_lock_grabbed && + !range_lock_grabbed_null && + index_key_is_null(table, tokudb_active_index, key, key_len)) { range_lock_grabbed = range_lock_grabbed_null = false; cursor->c_remove_restriction(cursor); } @@ -4758,7 +4988,7 @@ int ha_tokudb::index_read(uchar * buf, const uchar * key, uint key_len, enum ha_ pack_key(&lookup_key, tokudb_active_index, key_buff3, key, key_len, COL_NEG_INF); DBT lookup_bound; pack_key(&lookup_bound, tokudb_active_index, key_buff4, key, key_len, COL_POS_INF); - if (tokudb_debug & TOKUDB_DEBUG_INDEX_KEY) { + if (TOKUDB_UNLIKELY(TOKUDB_DEBUG_FLAGS(TOKUDB_DEBUG_INDEX_KEY))) { TOKUDB_DBUG_DUMP("tokudb key=", lookup_key.data, lookup_key.size); } ir_info.orig_key = &lookup_key; @@ -4815,8 +5045,8 @@ int ha_tokudb::index_read(uchar * buf, const uchar * key, uint key_len, enum ha_ if (!error && !key_read && tokudb_active_index != primary_key && !key_is_clustering(&table->key_info[tokudb_active_index])) { error = read_full_row(buf); } - - if (error && (tokudb_debug & TOKUDB_DEBUG_ERROR)) { + + if (TOKUDB_UNLIKELY(error && TOKUDB_DEBUG_FLAGS(TOKUDB_DEBUG_ERROR))) { TOKUDB_HANDLER_TRACE("error:%d:%d", error, find_flag); } trx->stmt_progress.queried++; @@ -4845,7 +5075,7 @@ int ha_tokudb::read_data_from_range_query_buff(uchar* buf, bool need_val, bool d // if this is a covering index, this is all we need if (do_key_read) { - assert(!need_val); + assert_always(!need_val); extract_hidden_primary_key(tokudb_active_index, &curr_key); read_key_only(buf, tokudb_active_index, &curr_key); error = 0; @@ -4937,17 +5167,27 @@ exit: return error; } -static int -smart_dbt_bf_callback(DBT const *key, DBT const *row, void *context) { +static int smart_dbt_bf_callback( + DBT const* key, + DBT const* row, + void* context) { SMART_DBT_BF_INFO info = (SMART_DBT_BF_INFO)context; - return info->ha->fill_range_query_buf(info->need_val, key, row, info->direction, info->thd, info->buf, info->key_to_compare); + return + info->ha->fill_range_query_buf( + info->need_val, + key, + row, + info->direction, + info->thd, + info->buf, + info->key_to_compare); } -#if defined(MARIADB_BASE_VERSION) || (50600 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50699) -enum icp_result ha_tokudb::toku_handler_index_cond_check(Item* pushed_idx_cond) -{ +enum icp_result ha_tokudb::toku_handler_index_cond_check( + Item* pushed_idx_cond) { + enum icp_result res; - if (end_range ) { + if (end_range) { int cmp; #ifdef MARIADB_BASE_VERSION cmp = compare_key2(end_range); @@ -4957,37 +5197,36 @@ enum icp_result ha_tokudb::toku_handler_index_cond_check(Item* pushed_idx_cond) if (cmp > 0) { return ICP_OUT_OF_RANGE; } - } + } res = pushed_idx_cond->val_int() ? ICP_MATCH : ICP_NO_MATCH; return res; } -#endif // fill in the range query buf for bulk fetch int ha_tokudb::fill_range_query_buf( bool need_val, - DBT const *key, - DBT const *row, + DBT const* key, + DBT const* row, int direction, THD* thd, uchar* buf, - DBT* key_to_compare - ) { + DBT* key_to_compare) { + int error; // // first put the value into range_query_buf // - uint32_t size_remaining = size_range_query_buff - bytes_used_in_range_query_buff; + uint32_t size_remaining = + size_range_query_buff - bytes_used_in_range_query_buff; uint32_t size_needed; - uint32_t user_defined_size = get_tokudb_read_buf_size(thd); + uint32_t user_defined_size = tokudb::sysvars::read_buf_size(thd); uchar* curr_pos = NULL; if (key_to_compare) { int cmp = tokudb_prefix_cmp_dbt_key( share->key_file[tokudb_active_index], key_to_compare, - key - ); + key); if (cmp) { icp_went_out_of_range = true; error = 0; @@ -4995,26 +5234,38 @@ int ha_tokudb::fill_range_query_buf( } } -#if defined(MARIADB_BASE_VERSION) || (50600 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50699) // if we have an index condition pushed down, we check it - if (toku_pushed_idx_cond && (tokudb_active_index == toku_pushed_idx_cond_keyno)) { + if (toku_pushed_idx_cond && + (tokudb_active_index == toku_pushed_idx_cond_keyno)) { unpack_key(buf, key, tokudb_active_index); - enum icp_result result = toku_handler_index_cond_check(toku_pushed_idx_cond); + enum icp_result result = + toku_handler_index_cond_check(toku_pushed_idx_cond); + // If we have reason to stop, we set icp_went_out_of_range and get out - if (result == ICP_OUT_OF_RANGE || thd_killed(thd)) { - icp_went_out_of_range = true; - error = 0; - goto cleanup; - } // otherwise, if we simply see that the current key is no match, // we tell the cursor to continue and don't store // the key locally - else if (result == ICP_NO_MATCH) { + if (result == ICP_OUT_OF_RANGE || thd_killed(thd)) { + icp_went_out_of_range = true; + error = 0; + DEBUG_SYNC(ha_thd(), "tokudb_icp_asc_scan_out_of_range"); + goto cleanup; + } else if (result == ICP_NO_MATCH) { + // if we are performing a DESC ICP scan and have no end_range + // to compare to stop using ICP filtering as there isn't much more + // that we can do without going through contortions with remembering + // and comparing key parts. + if (!end_range && + direction < 0) { + + cancel_pushed_idx_cond(); + DEBUG_SYNC(ha_thd(), "tokudb_icp_desc_scan_invalidate"); + } + error = TOKUDB_CURSOR_CONTINUE; goto cleanup; } } -#endif // at this point, if ICP is on, we have verified that the key is one // we are interested in, so we proceed with placing the data @@ -5023,57 +5274,63 @@ int ha_tokudb::fill_range_query_buf( if (need_val) { if (unpack_entire_row) { size_needed = 2*sizeof(uint32_t) + key->size + row->size; - } - else { + } else { // this is an upper bound - size_needed = sizeof(uint32_t) + // size of key length - key->size + row->size + //key and row - num_var_cols_for_query*(sizeof(uint32_t)) + //lengths of varchars stored - sizeof(uint32_t); //length of blobs + size_needed = + // size of key length + sizeof(uint32_t) + + // key and row + key->size + row->size + + // lengths of varchars stored + num_var_cols_for_query * (sizeof(uint32_t)) + + // length of blobs + sizeof(uint32_t); } - } - else { + } else { size_needed = sizeof(uint32_t) + key->size; } if (size_remaining < size_needed) { - range_query_buff = (uchar *)tokudb_my_realloc( - (void *)range_query_buff, - bytes_used_in_range_query_buff+size_needed, - MYF(MY_WME) - ); + range_query_buff = + static_cast(tokudb::memory::realloc( + static_cast(range_query_buff), + bytes_used_in_range_query_buff + size_needed, + MYF(MY_WME))); if (range_query_buff == NULL) { error = ENOMEM; invalidate_bulk_fetch(); goto cleanup; } - size_range_query_buff = bytes_used_in_range_query_buff+size_needed; + size_range_query_buff = bytes_used_in_range_query_buff + size_needed; } // // now we know we have the size, let's fill the buffer, starting with the key // curr_pos = range_query_buff + bytes_used_in_range_query_buff; - *(uint32_t *)curr_pos = key->size; + *reinterpret_cast(curr_pos) = key->size; curr_pos += sizeof(uint32_t); memcpy(curr_pos, key->data, key->size); curr_pos += key->size; if (need_val) { if (unpack_entire_row) { - *(uint32_t *)curr_pos = row->size; + *reinterpret_cast(curr_pos) = row->size; curr_pos += sizeof(uint32_t); memcpy(curr_pos, row->data, row->size); curr_pos += row->size; - } - else { + } else { // need to unpack just the data we care about - const uchar* fixed_field_ptr = (const uchar *) row->data; + const uchar* fixed_field_ptr = static_cast(row->data); fixed_field_ptr += table_share->null_bytes; const uchar* var_field_offset_ptr = NULL; const uchar* var_field_data_ptr = NULL; - var_field_offset_ptr = fixed_field_ptr + share->kc_info.mcp_info[tokudb_active_index].fixed_field_size; - var_field_data_ptr = var_field_offset_ptr + share->kc_info.mcp_info[tokudb_active_index].len_of_offsets; + var_field_offset_ptr = + fixed_field_ptr + + share->kc_info.mcp_info[tokudb_active_index].fixed_field_size; + var_field_data_ptr = + var_field_offset_ptr + + share->kc_info.mcp_info[tokudb_active_index].len_of_offsets; // first the null bytes memcpy(curr_pos, row->data, table_share->null_bytes); @@ -5087,8 +5344,7 @@ int ha_tokudb::fill_range_query_buf( memcpy( curr_pos, fixed_field_ptr + share->kc_info.cp_info[tokudb_active_index][field_index].col_pack_val, - share->kc_info.field_lengths[field_index] - ); + share->kc_info.field_lengths[field_index]); curr_pos += share->kc_info.field_lengths[field_index]; } @@ -5097,7 +5353,8 @@ int ha_tokudb::fill_range_query_buf( // for (uint32_t i = 0; i < num_var_cols_for_query; i++) { uint field_index = var_cols_for_query[i]; - uint32_t var_field_index = share->kc_info.cp_info[tokudb_active_index][field_index].col_pack_val; + uint32_t var_field_index = + share->kc_info.cp_info[tokudb_active_index][field_index].col_pack_val; uint32_t data_start_offset; uint32_t field_len; @@ -5106,11 +5363,13 @@ int ha_tokudb::fill_range_query_buf( &data_start_offset, var_field_index, var_field_offset_ptr, - share->kc_info.num_offset_bytes - ); + share->kc_info.num_offset_bytes); memcpy(curr_pos, &field_len, sizeof(field_len)); curr_pos += sizeof(field_len); - memcpy(curr_pos, var_field_data_ptr + data_start_offset, field_len); + memcpy( + curr_pos, + var_field_data_ptr + data_start_offset, + field_len); curr_pos += field_len; } @@ -5124,9 +5383,12 @@ int ha_tokudb::fill_range_query_buf( &blob_offset, share->kc_info.mcp_info[tokudb_active_index].len_of_offsets, var_field_data_ptr, - share->kc_info.num_offset_bytes - ); - data_size = row->size - blob_offset - (uint32_t)(var_field_data_ptr - (const uchar *)row->data); + share->kc_info.num_offset_bytes); + data_size = + row->size - + blob_offset - + static_cast((var_field_data_ptr - + static_cast(row->data))); memcpy(curr_pos, &data_size, sizeof(data_size)); curr_pos += sizeof(data_size); memcpy(curr_pos, var_field_data_ptr + blob_offset, data_size); @@ -5136,7 +5398,7 @@ int ha_tokudb::fill_range_query_buf( } bytes_used_in_range_query_buff = curr_pos - range_query_buff; - assert(bytes_used_in_range_query_buff <= size_range_query_buff); + assert_always(bytes_used_in_range_query_buff <= size_range_query_buff); // // now determine if we should continue with the bulk fetch @@ -5153,14 +5415,16 @@ int ha_tokudb::fill_range_query_buf( // row fetch upper bound. if (bulk_fetch_iteration < HA_TOKU_BULK_FETCH_ITERATION_MAX) { uint64_t row_fetch_upper_bound = 1LLU << bulk_fetch_iteration; - assert(row_fetch_upper_bound > 0); + assert_always(row_fetch_upper_bound > 0); if (rows_fetched_using_bulk_fetch >= row_fetch_upper_bound) { error = 0; goto cleanup; } } - if (bytes_used_in_range_query_buff + table_share->rec_buff_length > user_defined_size) { + if (bytes_used_in_range_query_buff + + table_share->rec_buff_length > + user_defined_size) { error = 0; goto cleanup; } @@ -5178,11 +5442,9 @@ int ha_tokudb::fill_range_query_buf( int cmp = tokudb_cmp_dbt_key( share->key_file[tokudb_active_index], key, - &right_range - ); + &right_range); error = (cmp > 0) ? 0 : TOKUDB_CURSOR_CONTINUE; - } - else { + } else { // compare what we got to the left endpoint of prelocked range // because we are searching keys in descending order if (prelocked_left_range_size == 0) { @@ -5196,15 +5458,19 @@ int ha_tokudb::fill_range_query_buf( int cmp = tokudb_cmp_dbt_key( share->key_file[tokudb_active_index], key, - &left_range - ); + &left_range); error = (cmp < 0) ? 0 : TOKUDB_CURSOR_CONTINUE; } cleanup: return error; } -int ha_tokudb::get_next(uchar* buf, int direction, DBT* key_to_compare, bool do_key_read) { +int ha_tokudb::get_next( + uchar* buf, + int direction, + DBT* key_to_compare, + bool do_key_read) { + int error = 0; HANDLE_INVALID_CURSOR(); @@ -5221,17 +5487,18 @@ int ha_tokudb::get_next(uchar* buf, int direction, DBT* key_to_compare, bool do_ // we need to read the val of what we retrieve if // we do NOT have a covering index AND we are using a clustering secondary // key - bool need_val = (do_key_read == 0) && - (tokudb_active_index == primary_key || key_is_clustering(&table->key_info[tokudb_active_index])); + bool need_val = + (do_key_read == 0) && + (tokudb_active_index == primary_key || + key_is_clustering(&table->key_info[tokudb_active_index])); - if ((bytes_used_in_range_query_buff - curr_range_query_buff_offset) > 0) { + if ((bytes_used_in_range_query_buff - + curr_range_query_buff_offset) > 0) { error = read_data_from_range_query_buff(buf, need_val, do_key_read); - } - else if (icp_went_out_of_range) { + } else if (icp_went_out_of_range) { icp_went_out_of_range = false; error = HA_ERR_END_OF_FILE; - } - else { + } else { invalidate_bulk_fetch(); if (doing_bulk_fetch) { struct smart_dbt_bf_info bf_info; @@ -5252,16 +5519,28 @@ int ha_tokudb::get_next(uchar* buf, int direction, DBT* key_to_compare, bool do_ // this while loop. icp_out_of_range will be set if we hit a row that // the index condition states is out of our range. When that hits, // we know all the data in the buffer is the last data we will retrieve - while (bytes_used_in_range_query_buff == 0 && !icp_went_out_of_range && error == 0) { + while (bytes_used_in_range_query_buff == 0 && + !icp_went_out_of_range && error == 0) { if (direction > 0) { - error = cursor->c_getf_next(cursor, flags, smart_dbt_bf_callback, &bf_info); + error = + cursor->c_getf_next( + cursor, + flags, + smart_dbt_bf_callback, + &bf_info); } else { - error = cursor->c_getf_prev(cursor, flags, smart_dbt_bf_callback, &bf_info); + error = + cursor->c_getf_prev( + cursor, + flags, + smart_dbt_bf_callback, + &bf_info); } } // if there is no data set and we went out of range, // then there is nothing to return - if (bytes_used_in_range_query_buff == 0 && icp_went_out_of_range) { + if (bytes_used_in_range_query_buff == 0 && + icp_went_out_of_range) { icp_went_out_of_range = false; error = HA_ERR_END_OF_FILE; } @@ -5269,26 +5548,46 @@ int ha_tokudb::get_next(uchar* buf, int direction, DBT* key_to_compare, bool do_ bulk_fetch_iteration++; } - error = handle_cursor_error(error, HA_ERR_END_OF_FILE,tokudb_active_index); - if (error) { goto cleanup; } + error = + handle_cursor_error( + error, + HA_ERR_END_OF_FILE, + tokudb_active_index); + if (error) { + goto cleanup; + } // // now that range_query_buff is filled, read an element // - error = read_data_from_range_query_buff(buf, need_val, do_key_read); - } - else { + error = + read_data_from_range_query_buff(buf, need_val, do_key_read); + } else { struct smart_dbt_info info; info.ha = this; info.buf = buf; info.keynr = tokudb_active_index; if (direction > 0) { - error = cursor->c_getf_next(cursor, flags, SMART_DBT_CALLBACK(do_key_read), &info); + error = + cursor->c_getf_next( + cursor, + flags, + SMART_DBT_CALLBACK(do_key_read), + &info); } else { - error = cursor->c_getf_prev(cursor, flags, SMART_DBT_CALLBACK(do_key_read), &info); + error = + cursor->c_getf_prev( + cursor, + flags, + SMART_DBT_CALLBACK(do_key_read), + &info); } - error = handle_cursor_error(error, HA_ERR_END_OF_FILE, tokudb_active_index); + error = + handle_cursor_error( + error, + HA_ERR_END_OF_FILE, + tokudb_active_index); } } } @@ -5301,13 +5600,17 @@ int ha_tokudb::get_next(uchar* buf, int direction, DBT* key_to_compare, bool do_ // read the full row by doing a point query into the // main table. // - if (!error && !do_key_read && (tokudb_active_index != primary_key) && !key_is_clustering(&table->key_info[tokudb_active_index])) { + if (!error && + !do_key_read && + (tokudb_active_index != primary_key) && + !key_is_clustering(&table->key_info[tokudb_active_index])) { error = read_full_row(buf); } if (!error) { THD *thd = ha_thd(); - tokudb_trx_data* trx = (tokudb_trx_data *) thd_get_ha_data(thd, tokudb_hton); + tokudb_trx_data* trx = + static_cast(thd_get_ha_data(thd, tokudb_hton)); trx->stmt_progress.queried++; track_progress(thd); if (thd_killed(thd)) @@ -5509,40 +5812,69 @@ int ha_tokudb::rnd_next(uchar * buf) { void ha_tokudb::track_progress(THD* thd) { tokudb_trx_data* trx = (tokudb_trx_data *) thd_get_ha_data(thd, tokudb_hton); if (trx) { - ulonglong num_written = trx->stmt_progress.inserted + trx->stmt_progress.updated + trx->stmt_progress.deleted; + ulonglong num_written = trx->stmt_progress.inserted + + trx->stmt_progress.updated + + trx->stmt_progress.deleted; bool update_status = - (trx->stmt_progress.queried && tokudb_read_status_frequency && (trx->stmt_progress.queried % tokudb_read_status_frequency) == 0) || - (num_written && tokudb_write_status_frequency && (num_written % tokudb_write_status_frequency) == 0); + (trx->stmt_progress.queried && + tokudb::sysvars::read_status_frequency && + (trx->stmt_progress.queried % + tokudb::sysvars::read_status_frequency) == 0) || + (num_written && tokudb::sysvars::write_status_frequency && + (num_written % tokudb::sysvars::write_status_frequency) == 0); if (update_status) { char *next_status = write_status_msg; bool first = true; int r; if (trx->stmt_progress.queried) { - r = sprintf(next_status, "Queried about %llu row%s", trx->stmt_progress.queried, trx->stmt_progress.queried == 1 ? "" : "s"); - assert(r >= 0); + r = sprintf( + next_status, + "Queried about %llu row%s", + trx->stmt_progress.queried, + trx->stmt_progress.queried == 1 ? "" : "s"); + assert_always(r >= 0); next_status += r; first = false; } if (trx->stmt_progress.inserted) { if (trx->stmt_progress.using_loader) { - r = sprintf(next_status, "%sFetched about %llu row%s, loading data still remains", first ? "" : ", ", trx->stmt_progress.inserted, trx->stmt_progress.inserted == 1 ? "" : "s"); + r = sprintf( + next_status, + "%sFetched about %llu row%s, loading data still remains", + first ? "" : ", ", + trx->stmt_progress.inserted, + trx->stmt_progress.inserted == 1 ? "" : "s"); + } else { + r = sprintf( + next_status, + "%sInserted about %llu row%s", + first ? "" : ", ", + trx->stmt_progress.inserted, + trx->stmt_progress.inserted == 1 ? "" : "s"); } - else { - r = sprintf(next_status, "%sInserted about %llu row%s", first ? "" : ", ", trx->stmt_progress.inserted, trx->stmt_progress.inserted == 1 ? "" : "s"); - } - assert(r >= 0); + assert_always(r >= 0); next_status += r; first = false; } if (trx->stmt_progress.updated) { - r = sprintf(next_status, "%sUpdated about %llu row%s", first ? "" : ", ", trx->stmt_progress.updated, trx->stmt_progress.updated == 1 ? "" : "s"); - assert(r >= 0); + r = sprintf( + next_status, + "%sUpdated about %llu row%s", + first ? "" : ", ", + trx->stmt_progress.updated, + trx->stmt_progress.updated == 1 ? "" : "s"); + assert_always(r >= 0); next_status += r; first = false; } if (trx->stmt_progress.deleted) { - r = sprintf(next_status, "%sDeleted about %llu row%s", first ? "" : ", ", trx->stmt_progress.deleted, trx->stmt_progress.deleted == 1 ? "" : "s"); - assert(r >= 0); + r = sprintf( + next_status, + "%sDeleted about %llu row%s", + first ? "" : ", ", + trx->stmt_progress.deleted, + trx->stmt_progress.deleted == 1 ? "" : "s"); + assert_always(r >= 0); next_status += r; first = false; } @@ -5583,7 +5915,7 @@ int ha_tokudb::rnd_pos(uchar * buf, uchar * pos) { // test rpl slave by inducing a delay before the point query THD *thd = ha_thd(); if (thd->slave_thread && (in_rpl_delete_rows || in_rpl_update_rows)) { - uint64_t delay_ms = THDVAR(thd, rpl_lookup_rows_delay); + uint64_t delay_ms = tokudb::sysvars::rpl_lookup_rows_delay(thd); if (delay_ms) usleep(delay_ms * 1000); } @@ -5664,7 +5996,7 @@ int ha_tokudb::prelock_range(const key_range *start_key, const key_range *end_ke // if (cursor) { int r = cursor->c_close(cursor); - assert(r==0); + assert_always(r==0); cursor = NULL; remove_from_trx_handler_list(); } @@ -5783,8 +6115,7 @@ int ha_tokudb::info(uint flag) { #endif DB_TXN* txn = NULL; if (flag & HA_STATUS_VARIABLE) { - // Just to get optimizations right - stats.records = share->rows + share->rows_from_locked_table; + stats.records = share->row_count() + share->rows_from_locked_table; stats.deleted = 0; if (!(flag & HA_STATUS_NO_LOCK)) { uint64_t num_rows = 0; @@ -5792,27 +6123,32 @@ int ha_tokudb::info(uint flag) { memset(&frag_info, 0, sizeof frag_info); error = txn_begin(db_env, NULL, &txn, DB_READ_UNCOMMITTED, ha_thd()); - if (error) { goto cleanup; } + if (error) { + goto cleanup; + } // we should always have a primary key - assert(share->file != NULL); + assert_always(share->file != NULL); error = estimate_num_rows(share->file,&num_rows, txn); if (error == 0) { - share->rows = num_rows; + share->set_row_count(num_rows, false); stats.records = num_rows; - } - else { + } else { goto cleanup; } error = share->file->get_fragmentation(share->file, &frag_info); - if (error) { goto cleanup; } + if (error) { + goto cleanup; + } stats.delete_length = frag_info.unused_bytes; DB_BTREE_STAT64 dict_stats; error = share->file->stat64(share->file, txn, &dict_stats); - if (error) { goto cleanup; } - + if (error) { + goto cleanup; + } + stats.create_time = dict_stats.bt_create_time_sec; stats.update_time = dict_stats.bt_modify_time_sec; stats.check_time = dict_stats.bt_verify_time_sec; @@ -5822,18 +6158,24 @@ int ha_tokudb::info(uint flag) { // in this case, we have a hidden primary key, do not // want to report space taken up by the hidden primary key to the user // - uint64_t hpk_space = TOKUDB_HIDDEN_PRIMARY_KEY_LENGTH*dict_stats.bt_ndata; - stats.data_file_length = (hpk_space > stats.data_file_length) ? 0 : stats.data_file_length - hpk_space; - } - else { + uint64_t hpk_space = + TOKUDB_HIDDEN_PRIMARY_KEY_LENGTH * dict_stats.bt_ndata; + stats.data_file_length = + (hpk_space > stats.data_file_length) ? + 0 : stats.data_file_length - hpk_space; + } else { // // one infinity byte per key needs to be subtracted // uint64_t inf_byte_space = dict_stats.bt_ndata; - stats.data_file_length = (inf_byte_space > stats.data_file_length) ? 0 : stats.data_file_length - inf_byte_space; + stats.data_file_length = + (inf_byte_space > stats.data_file_length) ? + 0 : stats.data_file_length - inf_byte_space; } - stats.mean_rec_length = stats.records ? (ulong)(stats.data_file_length/stats.records) : 0; + stats.mean_rec_length = + stats.records ? + (ulong)(stats.data_file_length/stats.records) : 0; stats.index_file_length = 0; // curr_num_DBs is the number of keys we have, according // to the mysql layer. if drop index is running concurrently @@ -5852,37 +6194,58 @@ int ha_tokudb::info(uint flag) { if (i == primary_key || share->key_file[i] == NULL) { continue; } - error = share->key_file[i]->stat64( - share->key_file[i], - txn, - &dict_stats - ); - if (error) { goto cleanup; } + error = + share->key_file[i]->stat64( + share->key_file[i], + txn, + &dict_stats); + if (error) { + goto cleanup; + } stats.index_file_length += dict_stats.bt_dsize; - error = share->file->get_fragmentation( - share->file, - &frag_info - ); - if (error) { goto cleanup; } + error = + share->file->get_fragmentation( + share->file, + &frag_info); + if (error) { + goto cleanup; + } stats.delete_length += frag_info.unused_bytes; } } + + /* + The following comment and logic has been taken from InnoDB and + an old hack was removed that forced to always set stats.records > 0 + --- + The MySQL optimizer seems to assume in a left join that n_rows + is an accurate estimate if it is zero. Of course, it is not, + since we do not have any locks on the rows yet at this phase. + Since SHOW TABLE STATUS seems to call this function with the + HA_STATUS_TIME flag set, while the left join optimizer does not + set that flag, we add one to a zero value if the flag is not + set. That way SHOW TABLE STATUS will show the best estimate, + while the optimizer never sees the table empty. */ + if (stats.records == 0 && !(flag & HA_STATUS_TIME)) { + stats.records++; + } } if ((flag & HA_STATUS_CONST)) { - stats.max_data_file_length= 9223372036854775807ULL; - tokudb::set_card_in_key_info(table, share->n_rec_per_key, share->rec_per_key); + stats.max_data_file_length = 9223372036854775807ULL; + share->set_cardinality_counts_in_table(table); } /* Don't return key if we got an error for the internal primary key */ if (flag & HA_STATUS_ERRKEY && last_dup_key < table_share->keys) { errkey = last_dup_key; - } + } - if (flag & HA_STATUS_AUTO && table->found_next_number_field) { - THD *thd= table->in_use; - struct system_variables *variables= &thd->variables; - stats.auto_increment_value = share->last_auto_increment + variables->auto_increment_increment; + if (flag & HA_STATUS_AUTO && table->found_next_number_field) { + THD* thd = table->in_use; + struct system_variables* variables = &thd->variables; + stats.auto_increment_value = + share->last_auto_increment + variables->auto_increment_increment; } error = 0; cleanup: @@ -5929,7 +6292,7 @@ int ha_tokudb::extra(enum ha_extra_function operation) { TOKUDB_HANDLER_DBUG_RETURN(0); } -int ha_tokudb::reset(void) { +int ha_tokudb::reset() { TOKUDB_HANDLER_DBUG_ENTER(""); key_read = false; using_ignore = false; @@ -5953,14 +6316,13 @@ int ha_tokudb::acquire_table_lock (DB_TXN* trans, TABLE_LOCK_TYPE lt) { TOKUDB_HANDLER_DBUG_ENTER("%p %s", trans, lt == lock_read ? "r" : "w"); int error = ENOSYS; if (!num_DBs_locked_in_bulk) { - rw_rdlock(&share->num_DBs_lock); + share->_num_DBs_lock.lock_read(); } uint curr_num_DBs = share->num_DBs; if (lt == lock_read) { error = 0; goto cleanup; - } - else if (lt == lock_write) { + } else if (lt == lock_write) { for (uint i = 0; i < curr_num_DBs; i++) { DB* db = share->key_file[i]; error = db->pre_acquire_table_lock(db, trans); @@ -5968,11 +6330,9 @@ int ha_tokudb::acquire_table_lock (DB_TXN* trans, TABLE_LOCK_TYPE lt) { TOKUDB_HANDLER_TRACE("%d db=%p trans=%p", i, db, trans); if (error) break; } - if (tokudb_debug & TOKUDB_DEBUG_LOCK) - TOKUDB_HANDLER_TRACE("error=%d", error); + TOKUDB_HANDLER_TRACE_FOR_FLAGS(TOKUDB_DEBUG_LOCK, "error=%d", error); if (error) goto cleanup; - } - else { + } else { error = ENOSYS; goto cleanup; } @@ -5980,7 +6340,7 @@ int ha_tokudb::acquire_table_lock (DB_TXN* trans, TABLE_LOCK_TYPE lt) { error = 0; cleanup: if (!num_DBs_locked_in_bulk) { - rw_unlock(&share->num_DBs_lock); + share->_num_DBs_lock.unlock(); } TOKUDB_HANDLER_DBUG_RETURN(error); } @@ -6011,17 +6371,19 @@ int ha_tokudb::create_txn(THD* thd, tokudb_trx_data* trx) { if ((error = txn_begin(db_env, NULL, &trx->all, txn_begin_flags, thd))) { goto cleanup; } - if (tokudb_debug & TOKUDB_DEBUG_TXN) { - TOKUDB_HANDLER_TRACE("created master %p", trx->all); - } + TOKUDB_HANDLER_TRACE_FOR_FLAGS( + TOKUDB_DEBUG_TXN, + "created master %p", + trx->all); trx->sp_level = trx->all; trans_register_ha(thd, true, tokudb_hton); } DBUG_PRINT("trans", ("starting transaction stmt")); if (trx->stmt) { - if (tokudb_debug & TOKUDB_DEBUG_TXN) { - TOKUDB_HANDLER_TRACE("warning:stmt=%p", trx->stmt); - } + TOKUDB_HANDLER_TRACE_FOR_FLAGS( + TOKUDB_DEBUG_TXN, + "warning:stmt=%p", + trx->stmt); } uint32_t txn_begin_flags; if (trx->all == NULL) { @@ -6036,21 +6398,25 @@ int ha_tokudb::create_txn(THD* thd, tokudb_trx_data* trx) { if (txn_begin_flags == 0 && is_autocommit && thd_sql_command(thd) == SQLCOM_SELECT) { txn_begin_flags = DB_TXN_SNAPSHOT; } - if (is_autocommit && thd_sql_command(thd) == SQLCOM_SELECT && !thd->in_sub_stmt && lock.type <= TL_READ_NO_INSERT && !thd->lex->uses_stored_routines()) { + if (is_autocommit && thd_sql_command(thd) == SQLCOM_SELECT && + !thd->in_sub_stmt && lock.type <= TL_READ_NO_INSERT && + !thd->lex->uses_stored_routines()) { txn_begin_flags |= DB_TXN_READ_ONLY; } - } - else { + } else { txn_begin_flags = DB_INHERIT_ISOLATION; } - if ((error = txn_begin(db_env, trx->sp_level, &trx->stmt, txn_begin_flags, thd))) { + error = txn_begin(db_env, trx->sp_level, &trx->stmt, txn_begin_flags, thd); + if (error) { /* We leave the possible master transaction open */ goto cleanup; } trx->sub_sp_level = trx->stmt; - if (tokudb_debug & TOKUDB_DEBUG_TXN) { - TOKUDB_HANDLER_TRACE("created stmt %p sp_level %p", trx->sp_level, trx->stmt); - } + TOKUDB_HANDLER_TRACE_FOR_FLAGS( + TOKUDB_DEBUG_TXN, + "created stmt %p sp_level %p", + trx->sp_level, + trx->stmt); reset_stmt_progress(&trx->stmt_progress); trans_register_ha(thd, false, tokudb_hton); cleanup: @@ -6081,26 +6447,40 @@ static const char *lock_type_str(int lock_type) { // error otherwise // int ha_tokudb::external_lock(THD * thd, int lock_type) { - TOKUDB_HANDLER_DBUG_ENTER("cmd %d lock %d %s %s", thd_sql_command(thd), lock_type, lock_type_str(lock_type), share->table_name); - if (!(tokudb_debug & TOKUDB_DEBUG_ENTER) && (tokudb_debug & TOKUDB_DEBUG_LOCK)) { - TOKUDB_HANDLER_TRACE("cmd %d lock %d %s %s", thd_sql_command(thd), lock_type, lock_type_str(lock_type), share->table_name); - } - if (tokudb_debug & TOKUDB_DEBUG_LOCK) { - TOKUDB_HANDLER_TRACE("q %s", thd->query()); + TOKUDB_HANDLER_DBUG_ENTER( + "cmd %d lock %d %s %s", + thd_sql_command(thd), + lock_type, + lock_type_str(lock_type), + share->full_table_name()); + if (TOKUDB_UNLIKELY(!TOKUDB_DEBUG_FLAGS(TOKUDB_DEBUG_ENTER) && + TOKUDB_DEBUG_FLAGS(TOKUDB_DEBUG_LOCK))) { + TOKUDB_HANDLER_TRACE( + "cmd %d lock %d %s %s", + thd_sql_command(thd), + lock_type, + lock_type_str(lock_type), + share->full_table_name()); } + TOKUDB_HANDLER_TRACE_FOR_FLAGS(TOKUDB_DEBUG_LOCK, "q %s", thd->query()); int error = 0; - tokudb_trx_data *trx = (tokudb_trx_data *) thd_get_ha_data(thd, tokudb_hton); + tokudb_trx_data* trx = (tokudb_trx_data*)thd_get_ha_data(thd, tokudb_hton); if (!trx) { error = create_tokudb_trx_data_instance(&trx); if (error) { goto cleanup; } thd_set_ha_data(thd, tokudb_hton, trx); } - if (tokudb_debug & TOKUDB_DEBUG_TXN) { - TOKUDB_HANDLER_TRACE("trx %p %p %p %p %u %u", trx->all, trx->stmt, trx->sp_level, trx->sub_sp_level, - trx->tokudb_lock_count, trx->create_lock_count); - } + TOKUDB_HANDLER_TRACE_FOR_FLAGS( + TOKUDB_DEBUG_TXN, + "trx %p %p %p %p %u %u", + trx->all, + trx->stmt, + trx->sp_level, + trx->sub_sp_level, + trx->tokudb_lock_count, + trx->create_lock_count); if (trx->all == NULL) { trx->sp_level = NULL; @@ -6120,19 +6500,11 @@ int ha_tokudb::external_lock(THD * thd, int lock_type) { } transaction = trx->sub_sp_level; trx->tokudb_lock_count++; - } - else { - tokudb_pthread_mutex_lock(&share->mutex); - // hate dealing with comparison of signed vs unsigned, so doing this - if (deleted_rows > added_rows && share->rows < (deleted_rows - added_rows)) { - share->rows = 0; - } - else { - share->rows += (added_rows - deleted_rows); - } - tokudb_pthread_mutex_unlock(&share->mutex); + } else { + share->update_row_count(thd, added_rows, deleted_rows, updated_rows); added_rows = 0; deleted_rows = 0; + updated_rows = 0; share->rows_from_locked_table = 0; if (trx->tokudb_lock_count > 0) { if (--trx->tokudb_lock_count <= trx->create_lock_count) { @@ -6154,8 +6526,7 @@ int ha_tokudb::external_lock(THD * thd, int lock_type) { } } cleanup: - if (tokudb_debug & TOKUDB_DEBUG_LOCK) - TOKUDB_HANDLER_TRACE("error=%d", error); + TOKUDB_HANDLER_TRACE_FOR_FLAGS(TOKUDB_DEBUG_LOCK, "error=%d", error); TOKUDB_HANDLER_DBUG_RETURN(error); } @@ -6164,24 +6535,32 @@ cleanup: TABLE LOCK is done. Under LOCK TABLES, each used tables will force a call to start_stmt. */ -int ha_tokudb::start_stmt(THD * thd, thr_lock_type lock_type) { - TOKUDB_HANDLER_DBUG_ENTER("cmd %d lock %d %s", thd_sql_command(thd), lock_type, share->table_name); - if (tokudb_debug & TOKUDB_DEBUG_LOCK) { - TOKUDB_HANDLER_TRACE("q %s", thd->query()); - } +int ha_tokudb::start_stmt(THD* thd, thr_lock_type lock_type) { + TOKUDB_HANDLER_DBUG_ENTER( + "cmd %d lock %d %s", + thd_sql_command(thd), + lock_type, + share->full_table_name()); + + TOKUDB_HANDLER_TRACE_FOR_FLAGS(TOKUDB_DEBUG_LOCK, "q %s", thd->query()); int error = 0; - tokudb_trx_data *trx = (tokudb_trx_data *) thd_get_ha_data(thd, tokudb_hton); + tokudb_trx_data* trx = (tokudb_trx_data*)thd_get_ha_data(thd, tokudb_hton); if (!trx) { error = create_tokudb_trx_data_instance(&trx); if (error) { goto cleanup; } thd_set_ha_data(thd, tokudb_hton, trx); } - if (tokudb_debug & TOKUDB_DEBUG_TXN) { - TOKUDB_HANDLER_TRACE("trx %p %p %p %p %u %u", trx->all, trx->stmt, trx->sp_level, trx->sub_sp_level, - trx->tokudb_lock_count, trx->create_lock_count); - } + TOKUDB_HANDLER_TRACE_FOR_FLAGS( + TOKUDB_DEBUG_TXN, + "trx %p %p %p %p %u %u", + trx->all, + trx->stmt, + trx->sp_level, + trx->sub_sp_level, + trx->tokudb_lock_count, + trx->create_lock_count); /* note that trx->stmt may have been already initialized as start_stmt() @@ -6194,11 +6573,11 @@ int ha_tokudb::start_stmt(THD * thd, thr_lock_type lock_type) { goto cleanup; } trx->create_lock_count = trx->tokudb_lock_count; - } - else { - if (tokudb_debug & TOKUDB_DEBUG_TXN) { - TOKUDB_HANDLER_TRACE("trx->stmt %p already existed", trx->stmt); - } + } else { + TOKUDB_HANDLER_TRACE_FOR_FLAGS( + TOKUDB_DEBUG_TXN, + "trx->stmt %p already existed", + trx->stmt); } if (added_rows > deleted_rows) { share->rows_from_locked_table = added_rows - deleted_rows; @@ -6272,27 +6651,40 @@ uint32_t ha_tokudb::get_cursor_isolation_flags(enum thr_lock_type lock_type, THD time). In the future we will probably try to remove this. */ -THR_LOCK_DATA **ha_tokudb::store_lock(THD * thd, THR_LOCK_DATA ** to, enum thr_lock_type lock_type) { - TOKUDB_HANDLER_DBUG_ENTER("lock_type=%d cmd=%d", lock_type, thd_sql_command(thd)); - if (tokudb_debug & TOKUDB_DEBUG_LOCK) { - TOKUDB_HANDLER_TRACE("lock_type=%d cmd=%d", lock_type, thd_sql_command(thd)); - } +THR_LOCK_DATA* *ha_tokudb::store_lock( + THD* thd, + THR_LOCK_DATA** to, + enum thr_lock_type lock_type) { + + TOKUDB_HANDLER_DBUG_ENTER( + "lock_type=%d cmd=%d", + lock_type, + thd_sql_command(thd)); + TOKUDB_HANDLER_TRACE_FOR_FLAGS( + TOKUDB_DEBUG_LOCK, + "lock_type=%d cmd=%d", + lock_type, + thd_sql_command(thd)); if (lock_type != TL_IGNORE && lock.type == TL_UNLOCK) { enum_sql_command sql_command = (enum_sql_command) thd_sql_command(thd); if (!thd->in_lock_tables) { - if (sql_command == SQLCOM_CREATE_INDEX && get_create_index_online(thd)) { + if (sql_command == SQLCOM_CREATE_INDEX && + tokudb::sysvars::create_index_online(thd)) { // hot indexing - rw_rdlock(&share->num_DBs_lock); + share->_num_DBs_lock.lock_read(); if (share->num_DBs == (table->s->keys + tokudb_test(hidden_primary_key))) { lock_type = TL_WRITE_ALLOW_WRITE; } - rw_unlock(&share->num_DBs_lock); - } else if ((lock_type >= TL_WRITE_CONCURRENT_INSERT && lock_type <= TL_WRITE) && - sql_command != SQLCOM_TRUNCATE && !thd_tablespace_op(thd)) { + share->_num_DBs_lock.unlock(); + } else if ((lock_type >= TL_WRITE_CONCURRENT_INSERT && + lock_type <= TL_WRITE) && + sql_command != SQLCOM_TRUNCATE && + !thd_tablespace_op(thd)) { // allow concurrent writes lock_type = TL_WRITE_ALLOW_WRITE; - } else if (sql_command == SQLCOM_OPTIMIZE && lock_type == TL_READ_NO_INSERT) { + } else if (sql_command == SQLCOM_OPTIMIZE && + lock_type == TL_READ_NO_INSERT) { // hot optimize table lock_type = TL_READ; } @@ -6300,88 +6692,130 @@ THR_LOCK_DATA **ha_tokudb::store_lock(THD * thd, THR_LOCK_DATA ** to, enum thr_l lock.type = lock_type; } *to++ = &lock; - if (tokudb_debug & TOKUDB_DEBUG_LOCK) - TOKUDB_HANDLER_TRACE("lock_type=%d", lock_type); - DBUG_RETURN(to); + TOKUDB_HANDLER_TRACE_FOR_FLAGS( + TOKUDB_DEBUG_LOCK, + "lock_type=%d", + lock_type); + TOKUDB_HANDLER_DBUG_RETURN_PTR(to); } -static toku_compression_method get_compression_method(DB *file) { +static toku_compression_method get_compression_method(DB* file) { enum toku_compression_method method; int r = file->get_compression_method(file, &method); - assert(r == 0); + assert_always(r == 0); return method; } #if TOKU_INCLUDE_ROW_TYPE_COMPRESSION -enum row_type ha_tokudb::get_row_type(void) const { +enum row_type ha_tokudb::get_row_type() const { toku_compression_method compression_method = get_compression_method(share->file); return toku_compression_method_to_row_type(compression_method); } #endif static int create_sub_table( - const char *table_name, - DBT* row_descriptor, - DB_TXN* txn, - uint32_t block_size, + const char* table_name, + DBT* row_descriptor, + DB_TXN* txn, + uint32_t block_size, uint32_t read_block_size, toku_compression_method compression_method, bool is_hot_index, - uint32_t fanout - ) -{ + uint32_t fanout) { + TOKUDB_DBUG_ENTER(""); int error; DB *file = NULL; uint32_t create_flags; - - + + error = db_create(&file, db_env, 0); if (error) { DBUG_PRINT("error", ("Got error: %d when creating table", error)); my_errno = error; goto exit; } - + if (block_size != 0) { error = file->set_pagesize(file, block_size); if (error != 0) { - DBUG_PRINT("error", ("Got error: %d when setting block size %u for table '%s'", error, block_size, table_name)); + DBUG_PRINT( + "error", + ("Got error: %d when setting block size %u for table '%s'", + error, + block_size, + table_name)); goto exit; } } if (read_block_size != 0) { error = file->set_readpagesize(file, read_block_size); if (error != 0) { - DBUG_PRINT("error", ("Got error: %d when setting read block size %u for table '%s'", error, read_block_size, table_name)); + DBUG_PRINT( + "error", + ("Got error: %d when setting read block size %u for table '%s'", + error, + read_block_size, + table_name)); goto exit; } } if (fanout != 0) { error = file->set_fanout(file, fanout); if (error != 0) { - DBUG_PRINT("error", ("Got error: %d when setting fanout %u for table '%s'", - error, fanout, table_name)); + DBUG_PRINT( + "error", + ("Got error: %d when setting fanout %u for table '%s'", + error, + fanout, + table_name)); goto exit; } } error = file->set_compression_method(file, compression_method); if (error != 0) { - DBUG_PRINT("error", ("Got error: %d when setting compression type %u for table '%s'", error, compression_method, table_name)); + DBUG_PRINT( + "error", + ("Got error: %d when setting compression type %u for table '%s'", + error, + compression_method, + table_name)); goto exit; } - create_flags = DB_THREAD | DB_CREATE | DB_EXCL | (is_hot_index ? DB_IS_HOT_INDEX : 0); - error = file->open(file, txn, table_name, NULL, DB_BTREE, create_flags, my_umask); + create_flags = + DB_THREAD | DB_CREATE | DB_EXCL | (is_hot_index ? DB_IS_HOT_INDEX : 0); + error = + file->open( + file, + txn, + table_name, + NULL, + DB_BTREE, + create_flags, + my_umask); if (error) { - DBUG_PRINT("error", ("Got error: %d when opening table '%s'", error, table_name)); + DBUG_PRINT( + "error", + ("Got error: %d when opening table '%s'", error, table_name)); goto exit; } - error = file->change_descriptor(file, txn, row_descriptor, (is_hot_index ? DB_IS_HOT_INDEX | DB_UPDATE_CMP_DESCRIPTOR : DB_UPDATE_CMP_DESCRIPTOR)); + error = + file->change_descriptor( + file, + txn, + row_descriptor, + (is_hot_index ? DB_IS_HOT_INDEX | + DB_UPDATE_CMP_DESCRIPTOR : + DB_UPDATE_CMP_DESCRIPTOR)); if (error) { - DBUG_PRINT("error", ("Got error: %d when setting row descriptor for table '%s'", error, table_name)); + DBUG_PRINT( + "error", + ("Got error: %d when setting row descriptor for table '%s'", + error, + table_name)); goto exit; } @@ -6389,7 +6823,7 @@ static int create_sub_table( exit: if (file) { int r = file->close(file, 0); - assert(r==0); + assert_always(r==0); } TOKUDB_DBUG_RETURN(error); } @@ -6407,7 +6841,8 @@ void ha_tokudb::update_create_info(HA_CREATE_INFO* create_info) { // show create table asks us to update this create_info, this makes it // so we'll always show what compression type we're using create_info->row_type = get_row_type(); - if (create_info->row_type == ROW_TYPE_TOKU_ZLIB && THDVAR(ha_thd(), hide_default_row_format) != 0) { + if (create_info->row_type == ROW_TYPE_TOKU_ZLIB && + tokudb::sysvars::hide_default_row_format(ha_thd()) != 0) { create_info->row_type = ROW_TYPE_DEFAULT; } } @@ -6471,27 +6906,43 @@ int ha_tokudb::write_key_name_to_status(DB* status_block, char* key_name, DB_TXN } // -// some tracing moved out of ha_tokudb::create, because ::create was getting cluttered +// some tracing moved out of ha_tokudb::create, because ::create was +// getting cluttered // void ha_tokudb::trace_create_table_info(const char *name, TABLE * form) { uint i; // // tracing information about what type of table we are creating // - if (tokudb_debug & TOKUDB_DEBUG_OPEN) { + if (TOKUDB_UNLIKELY(TOKUDB_DEBUG_FLAGS(TOKUDB_DEBUG_OPEN))) { for (i = 0; i < form->s->fields; i++) { Field *field = form->s->field[i]; - TOKUDB_HANDLER_TRACE("field:%d:%s:type=%d:flags=%x", i, field->field_name, field->type(), field->flags); + TOKUDB_HANDLER_TRACE( + "field:%d:%s:type=%d:flags=%x", + i, + field->field_name, + field->type(), + field->flags); } for (i = 0; i < form->s->keys; i++) { KEY *key = &form->s->key_info[i]; - TOKUDB_HANDLER_TRACE("key:%d:%s:%d", i, key->name, get_key_parts(key)); + TOKUDB_HANDLER_TRACE( + "key:%d:%s:%d", + i, + key->name, + key->user_defined_key_parts); uint p; - for (p = 0; p < get_key_parts(key); p++) { - KEY_PART_INFO *key_part = &key->key_part[p]; - Field *field = key_part->field; - TOKUDB_HANDLER_TRACE("key:%d:%d:length=%d:%s:type=%d:flags=%x", - i, p, key_part->length, field->field_name, field->type(), field->flags); + for (p = 0; p < key->user_defined_key_parts; p++) { + KEY_PART_INFO* key_part = &key->key_part[p]; + Field* field = key_part->field; + TOKUDB_HANDLER_TRACE( + "key:%d:%d:length=%d:%s:type=%d:flags=%x", + i, + p, + key_part->length, + field->field_name, + field->type(), + field->flags); } } } @@ -6499,9 +6950,12 @@ void ha_tokudb::trace_create_table_info(const char *name, TABLE * form) { static uint32_t get_max_desc_size(KEY_AND_COL_INFO* kc_info, TABLE* form) { uint32_t max_row_desc_buff_size; - max_row_desc_buff_size = 2*(form->s->fields * 6)+10; // upper bound of key comparison descriptor - max_row_desc_buff_size += get_max_secondary_key_pack_desc_size(kc_info); // upper bound for sec. key part - max_row_desc_buff_size += get_max_clustering_val_pack_desc_size(form->s); // upper bound for clustering val part + // upper bound of key comparison descriptor + max_row_desc_buff_size = 2*(form->s->fields * 6)+10; + // upper bound for sec. key part + max_row_desc_buff_size += get_max_secondary_key_pack_desc_size(kc_info); + // upper bound for clustering val part + max_row_desc_buff_size += get_max_clustering_val_pack_desc_size(form->s); return max_row_desc_buff_size; } @@ -6513,9 +6967,8 @@ static uint32_t create_secondary_key_descriptor( TABLE* form, uint primary_key, uint32_t keynr, - KEY_AND_COL_INFO* kc_info - ) -{ + KEY_AND_COL_INFO* kc_info) { + uchar* ptr = NULL; ptr = buf; @@ -6554,23 +7007,25 @@ static uint32_t create_secondary_key_descriptor( // creates dictionary for secondary index, with key description key_info, all using txn // int ha_tokudb::create_secondary_dictionary( - const char* name, TABLE* form, - KEY* key_info, - DB_TXN* txn, - KEY_AND_COL_INFO* kc_info, + const char* name, + TABLE* form, + KEY* key_info, + DB_TXN* txn, + KEY_AND_COL_INFO* kc_info, uint32_t keynr, bool is_hot_index, - toku_compression_method compression_method - ) -{ + toku_compression_method compression_method) { + int error; DBT row_descriptor; uchar* row_desc_buff = NULL; char* newname = NULL; + size_t newname_len = 0; KEY* prim_key = NULL; char dict_name[MAX_DICT_NAME_LEN]; uint32_t max_row_desc_buff_size; - uint hpk= (form->s->primary_key >= MAX_KEY) ? TOKUDB_HIDDEN_PRIMARY_KEY_LENGTH : 0; + uint hpk= (form->s->primary_key >= MAX_KEY) ? + TOKUDB_HIDDEN_PRIMARY_KEY_LENGTH : 0; uint32_t block_size; uint32_t read_block_size; uint32_t fanout; @@ -6580,14 +7035,23 @@ int ha_tokudb::create_secondary_dictionary( max_row_desc_buff_size = get_max_desc_size(kc_info,form); - row_desc_buff = (uchar *)tokudb_my_malloc(max_row_desc_buff_size, MYF(MY_WME)); - if (row_desc_buff == NULL){ error = ENOMEM; goto cleanup;} + row_desc_buff = (uchar*)tokudb::memory::malloc( + max_row_desc_buff_size, + MYF(MY_WME)); + if (row_desc_buff == NULL) { + error = ENOMEM; + goto cleanup; + } - newname = (char *)tokudb_my_malloc(get_max_dict_name_path_length(name),MYF(MY_WME)); - if (newname == NULL){ error = ENOMEM; goto cleanup;} + newname_len = get_max_dict_name_path_length(name); + newname = (char*)tokudb::memory::malloc(newname_len, MYF(MY_WME)); + if (newname == NULL) { + error = ENOMEM; + goto cleanup; + } sprintf(dict_name, "key-%s", key_info->name); - make_name(newname, name, dict_name); + make_name(newname, newname_len, name, dict_name); prim_key = (hpk) ? NULL : &form->s->key_info[primary_key]; @@ -6606,20 +7070,25 @@ int ha_tokudb::create_secondary_dictionary( form, primary_key, keynr, - kc_info - ); - assert(row_descriptor.size <= max_row_desc_buff_size); + kc_info); + assert_always(row_descriptor.size <= max_row_desc_buff_size); - block_size = get_tokudb_block_size(thd); - read_block_size = get_tokudb_read_block_size(thd); - fanout = get_tokudb_fanout(thd); + block_size = tokudb::sysvars::block_size(thd); + read_block_size = tokudb::sysvars::read_block_size(thd); + fanout = tokudb::sysvars::fanout(thd); - error = create_sub_table(newname, &row_descriptor, txn, block_size, - read_block_size, compression_method, is_hot_index, - fanout); + error = create_sub_table( + newname, + &row_descriptor, + txn, + block_size, + read_block_size, + compression_method, + is_hot_index, + fanout); cleanup: - tokudb_my_free(newname); - tokudb_my_free(row_desc_buff); + tokudb::memory::free(newname); + tokudb::memory::free(row_desc_buff); return error; } @@ -6630,21 +7099,17 @@ static uint32_t create_main_key_descriptor( uint hpk, uint primary_key, TABLE* form, - KEY_AND_COL_INFO* kc_info - ) -{ + KEY_AND_COL_INFO* kc_info) { + uchar* ptr = buf; ptr += create_toku_key_descriptor( ptr, hpk, prim_key, false, - NULL - ); + NULL); - ptr += create_toku_main_key_pack_descriptor( - ptr - ); + ptr += create_toku_main_key_pack_descriptor(ptr); ptr += create_toku_clustering_val_pack_descriptor( ptr, @@ -6652,8 +7117,7 @@ static uint32_t create_main_key_descriptor( form->s, kc_info, primary_key, - false - ); + false); return ptr - buf; } @@ -6661,14 +7125,21 @@ static uint32_t create_main_key_descriptor( // create and close the main dictionarr with name of "name" using table form, all within // transaction txn. // -int ha_tokudb::create_main_dictionary(const char* name, TABLE* form, DB_TXN* txn, KEY_AND_COL_INFO* kc_info, toku_compression_method compression_method) { +int ha_tokudb::create_main_dictionary( + const char* name, + TABLE* form, + DB_TXN* txn, + KEY_AND_COL_INFO* kc_info, + toku_compression_method compression_method) { + int error; DBT row_descriptor; uchar* row_desc_buff = NULL; char* newname = NULL; + size_t newname_len = 0; KEY* prim_key = NULL; uint32_t max_row_desc_buff_size; - uint hpk= (form->s->primary_key >= MAX_KEY) ? TOKUDB_HIDDEN_PRIMARY_KEY_LENGTH : 0; + uint hpk = (form->s->primary_key >= MAX_KEY) ? TOKUDB_HIDDEN_PRIMARY_KEY_LENGTH : 0; uint32_t block_size; uint32_t read_block_size; uint32_t fanout; @@ -6677,13 +7148,22 @@ int ha_tokudb::create_main_dictionary(const char* name, TABLE* form, DB_TXN* txn memset(&row_descriptor, 0, sizeof(row_descriptor)); max_row_desc_buff_size = get_max_desc_size(kc_info, form); - row_desc_buff = (uchar *)tokudb_my_malloc(max_row_desc_buff_size, MYF(MY_WME)); - if (row_desc_buff == NULL){ error = ENOMEM; goto cleanup;} + row_desc_buff = (uchar*)tokudb::memory::malloc( + max_row_desc_buff_size, + MYF(MY_WME)); + if (row_desc_buff == NULL) { + error = ENOMEM; + goto cleanup; + } - newname = (char *)tokudb_my_malloc(get_max_dict_name_path_length(name),MYF(MY_WME)); - if (newname == NULL){ error = ENOMEM; goto cleanup;} + newname_len = get_max_dict_name_path_length(name); + newname = (char*)tokudb::memory::malloc(newname_len, MYF(MY_WME)); + if (newname == NULL) { + error = ENOMEM; + goto cleanup; + } - make_name(newname, name, "main"); + make_name(newname, newname_len, name, "main"); prim_key = (hpk) ? NULL : &form->s->key_info[primary_key]; @@ -6700,21 +7180,26 @@ int ha_tokudb::create_main_dictionary(const char* name, TABLE* form, DB_TXN* txn hpk, primary_key, form, - kc_info - ); - assert(row_descriptor.size <= max_row_desc_buff_size); + kc_info); + assert_always(row_descriptor.size <= max_row_desc_buff_size); - block_size = get_tokudb_block_size(thd); - read_block_size = get_tokudb_read_block_size(thd); - fanout = get_tokudb_fanout(thd); + block_size = tokudb::sysvars::block_size(thd); + read_block_size = tokudb::sysvars::read_block_size(thd); + fanout = tokudb::sysvars::fanout(thd); /* Create the main table that will hold the real rows */ - error = create_sub_table(newname, &row_descriptor, txn, block_size, - read_block_size, compression_method, false, - fanout); + error = create_sub_table( + newname, + &row_descriptor, + txn, + block_size, + read_block_size, + compression_method, + false, + fanout); cleanup: - tokudb_my_free(newname); - tokudb_my_free(row_desc_buff); + tokudb::memory::free(newname); + tokudb::memory::free(row_desc_buff); return error; } @@ -6728,7 +7213,11 @@ cleanup: // 0 on success // error otherwise // -int ha_tokudb::create(const char *name, TABLE * form, HA_CREATE_INFO * create_info) { +int ha_tokudb::create( + const char* name, + TABLE* form, + HA_CREATE_INFO* create_info) { + TOKUDB_HANDLER_DBUG_ENTER("%s", name); int error; @@ -6738,6 +7227,7 @@ int ha_tokudb::create(const char *name, TABLE * form, HA_CREATE_INFO * create_in DB_TXN* txn = NULL; bool do_commit = false; char* newname = NULL; + size_t newname_len = 0; KEY_AND_COL_INFO kc_info; tokudb_trx_data *trx = NULL; THD* thd = ha_thd(); @@ -6753,15 +7243,18 @@ int ha_tokudb::create(const char *name, TABLE * form, HA_CREATE_INFO * create_in #endif #if TOKU_INCLUDE_OPTION_STRUCTS - const srv_row_format_t row_format = (srv_row_format_t) form->s->option_struct->row_format; + const tokudb::sysvars::row_format_t row_format = + (tokudb::sysvars::row_format_t)form->s->option_struct->row_format; #else - const srv_row_format_t row_format = (create_info->used_fields & HA_CREATE_USED_ROW_FORMAT) + const tokudb::sysvars::row_format_t row_format = + (create_info->used_fields & HA_CREATE_USED_ROW_FORMAT) ? row_type_to_row_format(create_info->row_type) - : get_row_format(thd); + : tokudb::sysvars::row_format(thd); #endif - const toku_compression_method compression_method = row_format_to_toku_compression_method(row_format); + const toku_compression_method compression_method = + row_format_to_toku_compression_method(row_format); - bool create_from_engine= (create_info->table_options & HA_OPTION_CREATE_FROM_ENGINE); + bool create_from_engine = (create_info->table_options & HA_OPTION_CREATE_FROM_ENGINE); if (create_from_engine) { // table already exists, nothing to do error = 0; @@ -6786,17 +7279,23 @@ int ha_tokudb::create(const char *name, TABLE * form, HA_CREATE_INFO * create_in } } - newname = (char *)tokudb_my_malloc(get_max_dict_name_path_length(name),MYF(MY_WME)); - if (newname == NULL){ error = ENOMEM; goto cleanup;} + newname_len = get_max_dict_name_path_length(name); + newname = (char*)tokudb::memory::malloc(newname_len, MYF(MY_WME)); + if (newname == NULL) { + error = ENOMEM; + goto cleanup; + } trx = (tokudb_trx_data *) thd_get_ha_data(ha_thd(), tokudb_hton); - if (trx && trx->sub_sp_level && thd_sql_command(thd) == SQLCOM_CREATE_TABLE) { + if (trx && trx->sub_sp_level && + thd_sql_command(thd) == SQLCOM_CREATE_TABLE) { txn = trx->sub_sp_level; - } - else { + } else { do_commit = true; error = txn_begin(db_env, 0, &txn, 0, thd); - if (error) { goto cleanup; } + if (error) { + goto cleanup; + } } primary_key = form->s->primary_key; @@ -6809,45 +7308,76 @@ int ha_tokudb::create(const char *name, TABLE * form, HA_CREATE_INFO * create_in trace_create_table_info(name,form); /* Create status.tokudb and save relevant metadata */ - make_name(newname, name, "status"); + make_name(newname, newname_len, name, "status"); - error = tokudb::create_status(db_env, &status_block, newname, txn); + error = tokudb::metadata::create(db_env, &status_block, newname, txn); if (error) { goto cleanup; } version = HA_TOKU_VERSION; - error = write_to_status(status_block, hatoku_new_version,&version,sizeof(version), txn); - if (error) { goto cleanup; } + error = write_to_status( + status_block, + hatoku_new_version, + &version, + sizeof(version), + txn); + if (error) { + goto cleanup; + } capabilities = HA_TOKU_CAP; - error = write_to_status(status_block, hatoku_capabilities,&capabilities,sizeof(capabilities), txn); - if (error) { goto cleanup; } + error = write_to_status( + status_block, + hatoku_capabilities, + &capabilities, + sizeof(capabilities), + txn); + if (error) { + goto cleanup; + } - error = write_auto_inc_create(status_block, create_info->auto_increment_value, txn); - if (error) { goto cleanup; } + error = write_auto_inc_create( + status_block, + create_info->auto_increment_value, + txn); + if (error) { + goto cleanup; + } #if WITH_PARTITION_STORAGE_ENGINE if (TOKU_PARTITION_WRITE_FRM_DATA || form->part_info == NULL) { error = write_frm_data(status_block, txn, form->s->path.str); - if (error) { goto cleanup; } + if (error) { + goto cleanup; + } } #else error = write_frm_data(status_block, txn, form->s->path.str); - if (error) { goto cleanup; } + if (error) { + goto cleanup; + } #endif error = allocate_key_and_col_info(form->s, &kc_info); - if (error) { goto cleanup; } + if (error) { + goto cleanup; + } error = initialize_key_and_col_info( - form->s, + form->s, form, &kc_info, hidden_primary_key, - primary_key - ); - if (error) { goto cleanup; } + primary_key); + if (error) { + goto cleanup; + } - error = create_main_dictionary(name, form, txn, &kc_info, compression_method); + error = create_main_dictionary( + name, + form, + txn, + &kc_info, + compression_method); if (error) { goto cleanup; } @@ -6855,32 +7385,44 @@ int ha_tokudb::create(const char *name, TABLE * form, HA_CREATE_INFO * create_in for (uint i = 0; i < form->s->keys; i++) { if (i != primary_key) { - error = create_secondary_dictionary(name, form, &form->key_info[i], txn, &kc_info, i, false, compression_method); + error = create_secondary_dictionary( + name, + form, + &form->key_info[i], + txn, + &kc_info, + i, + false, + compression_method); if (error) { goto cleanup; } - error = write_key_name_to_status(status_block, form->s->key_info[i].name, txn); - if (error) { goto cleanup; } + error = write_key_name_to_status( + status_block, + form->s->key_info[i].name, + txn); + if (error) { + goto cleanup; + } } } error = 0; cleanup: if (status_block != NULL) { - int r = tokudb::close_status(&status_block); - assert(r==0); + int r = tokudb::metadata::close(&status_block); + assert_always(r==0); } free_key_and_col_info(&kc_info); if (do_commit && txn) { if (error) { abort_txn(txn); - } - else { + } else { commit_txn(txn,0); } } - tokudb_my_free(newname); + tokudb::memory::free(newname); TOKUDB_HANDLER_DBUG_RETURN(error); } @@ -6903,27 +7445,36 @@ int ha_tokudb::discard_or_import_tablespace(my_bool discard) { // is_key specifies if it is a secondary index (and hence a "key-" needs to be prepended) or // if it is not a secondary index // -int ha_tokudb::delete_or_rename_dictionary( const char* from_name, const char* to_name, const char* secondary_name, bool is_key, DB_TXN* txn, bool is_delete) { +int ha_tokudb::delete_or_rename_dictionary( + const char* from_name, + const char* to_name, + const char* secondary_name, + bool is_key, + DB_TXN* txn, + bool is_delete) { + int error; char dict_name[MAX_DICT_NAME_LEN]; char* new_from_name = NULL; + size_t new_from_name_len = 0; char* new_to_name = NULL; - assert(txn); + size_t new_to_name_len = 0; + assert_always(txn); - new_from_name = (char *)tokudb_my_malloc( - get_max_dict_name_path_length(from_name), - MYF(MY_WME) - ); + new_from_name_len = get_max_dict_name_path_length(from_name); + new_from_name = (char*)tokudb::memory::malloc( + new_from_name_len, + MYF(MY_WME)); if (new_from_name == NULL) { error = ENOMEM; goto cleanup; } if (!is_delete) { - assert(to_name); - new_to_name = (char *)tokudb_my_malloc( - get_max_dict_name_path_length(to_name), - MYF(MY_WME) - ); + assert_always(to_name); + new_to_name_len = get_max_dict_name_path_length(to_name); + new_to_name = (char*)tokudb::memory::malloc( + new_to_name_len, + MYF(MY_WME)); if (new_to_name == NULL) { error = ENOMEM; goto cleanup; @@ -6932,32 +7483,37 @@ int ha_tokudb::delete_or_rename_dictionary( const char* from_name, const char* t if (is_key) { sprintf(dict_name, "key-%s", secondary_name); - make_name(new_from_name, from_name, dict_name); - } - else { - make_name(new_from_name, from_name, secondary_name); + make_name(new_from_name, new_from_name_len, from_name, dict_name); + } else { + make_name(new_from_name, new_from_name_len, from_name, secondary_name); } if (!is_delete) { if (is_key) { sprintf(dict_name, "key-%s", secondary_name); - make_name(new_to_name, to_name, dict_name); - } - else { - make_name(new_to_name, to_name, secondary_name); + make_name(new_to_name, new_to_name_len, to_name, dict_name); + } else { + make_name(new_to_name, new_to_name_len, to_name, secondary_name); } } if (is_delete) { error = db_env->dbremove(db_env, txn, new_from_name, NULL, 0); + } else { + error = db_env->dbrename( + db_env, + txn, + new_from_name, + NULL, + new_to_name, + 0); } - else { - error = db_env->dbrename(db_env, txn, new_from_name, NULL, new_to_name, 0); + if (error) { + goto cleanup; } - if (error) { goto cleanup; } cleanup: - tokudb_my_free(new_from_name); - tokudb_my_free(new_to_name); + tokudb::memory::free(new_from_name); + tokudb::memory::free(new_to_name); return error; } @@ -7023,12 +7579,12 @@ int ha_tokudb::delete_or_rename_table (const char* from_name, const char* to_nam if (error) { goto cleanup; } error = status_cursor->c_close(status_cursor); - assert(error==0); + assert_always(error==0); status_cursor = NULL; if (error) { goto cleanup; } error = status_db->close(status_db, 0); - assert(error == 0); + assert_always(error == 0); status_db = NULL; // @@ -7041,11 +7597,11 @@ int ha_tokudb::delete_or_rename_table (const char* from_name, const char* to_nam cleanup: if (status_cursor) { int r = status_cursor->c_close(status_cursor); - assert(r==0); + assert_always(r==0); } if (status_db) { int r = status_db->close(status_db, 0); - assert(r==0); + assert_always(r==0); } if (txn) { if (error) { @@ -7069,12 +7625,25 @@ cleanup: // int ha_tokudb::delete_table(const char *name) { TOKUDB_HANDLER_DBUG_ENTER("%s", name); + TOKUDB_SHARE* share = TOKUDB_SHARE::get_share(name, NULL, NULL, false); + if (share) { + share->unlock(); + share->release(); + // this should be enough to handle locking as the higher level MDL + // on this table should prevent any new analyze tasks. + share->cancel_background_jobs(); + TOKUDB_SHARE::drop_share(share); + } + int error; error = delete_or_rename_table(name, NULL, true); - if (error == DB_LOCK_NOTGRANTED && ((tokudb_debug & TOKUDB_DEBUG_HIDE_DDL_LOCK_ERRORS) == 0)) { - sql_print_error("Could not delete table %s because \ -another transaction has accessed the table. \ -To drop the table, make sure no transactions touch the table.", name); + if (TOKUDB_LIKELY(TOKUDB_DEBUG_FLAGS(TOKUDB_DEBUG_HIDE_DDL_LOCK_ERRORS) == 0) && + error == DB_LOCK_NOTGRANTED) { + sql_print_error( + "Could not delete table %s because another transaction has " + "accessed the table. To drop the table, make sure no " + "transactions touch the table.", + name); } TOKUDB_HANDLER_DBUG_RETURN(error); } @@ -7091,12 +7660,25 @@ To drop the table, make sure no transactions touch the table.", name); // int ha_tokudb::rename_table(const char *from, const char *to) { TOKUDB_HANDLER_DBUG_ENTER("%s %s", from, to); + TOKUDB_SHARE* share = TOKUDB_SHARE::get_share(from, NULL, NULL, false); + if (share) { + share->unlock(); + share->release(); + // this should be enough to handle locking as the higher level MDL + // on this table should prevent any new analyze tasks. + share->cancel_background_jobs(); + TOKUDB_SHARE::drop_share(share); + } int error; error = delete_or_rename_table(from, to, false); - if (error == DB_LOCK_NOTGRANTED && ((tokudb_debug & TOKUDB_DEBUG_HIDE_DDL_LOCK_ERRORS) == 0)) { - sql_print_error("Could not rename table from %s to %s because \ -another transaction has accessed the table. \ -To rename the table, make sure no transactions touch the table.", from, to); + if (TOKUDB_LIKELY(TOKUDB_DEBUG_FLAGS(TOKUDB_DEBUG_HIDE_DDL_LOCK_ERRORS) == 0) && + error == DB_LOCK_NOTGRANTED) { + sql_print_error( + "Could not rename table from %s to %s because another transaction " + "has accessed the table. To rename the table, make sure no " + "transactions touch the table.", + from, + to); } TOKUDB_HANDLER_DBUG_RETURN(error); } @@ -7111,9 +7693,11 @@ To rename the table, make sure no transactions touch the table.", from, to); double ha_tokudb::scan_time() { TOKUDB_HANDLER_DBUG_ENTER(""); double ret_val = (double)stats.records / 3; - if (tokudb_debug & TOKUDB_DEBUG_RETURN) { - TOKUDB_HANDLER_TRACE("return %" PRIu64 " %f", (uint64_t) stats.records, ret_val); - } + TOKUDB_HANDLER_TRACE_FOR_FLAGS( + TOKUDB_DEBUG_RETURN, + "return %" PRIu64 " %f", + (uint64_t)stats.records, + ret_val); DBUG_RETURN(ret_val); } @@ -7137,10 +7721,7 @@ double ha_tokudb::keyread_time(uint index, uint ranges, ha_rows rows) (table->key_info[index].key_length + ref_length) + 1); ret_val = (rows + keys_per_block - 1)/ keys_per_block; - if (tokudb_debug & TOKUDB_DEBUG_RETURN) { - TOKUDB_HANDLER_TRACE("return %f", ret_val); - } - DBUG_RETURN(ret_val); + TOKUDB_HANDLER_DBUG_RETURN_DOUBLE(ret_val); } // @@ -7202,19 +7783,13 @@ double ha_tokudb::read_time( ret_val = is_clustering ? ret_val + 0.00001 : ret_val; cleanup: - if (tokudb_debug & TOKUDB_DEBUG_RETURN) { - TOKUDB_HANDLER_TRACE("return %f", ret_val); - } - DBUG_RETURN(ret_val); + TOKUDB_HANDLER_DBUG_RETURN_DOUBLE(ret_val); } double ha_tokudb::index_only_read_time(uint keynr, double records) { TOKUDB_HANDLER_DBUG_ENTER("%u %f", keynr, records); double ret_val = keyread_time(keynr, 1, (ha_rows)records); - if (tokudb_debug & TOKUDB_DEBUG_RETURN) { - TOKUDB_HANDLER_TRACE("return %f", ret_val); - } - DBUG_RETURN(ret_val); + TOKUDB_HANDLER_DBUG_RETURN_DOUBLE(ret_val); } // @@ -7287,9 +7862,11 @@ ha_rows ha_tokudb::records_in_range(uint keynr, key_range* start_key, key_range* ret_val = (ha_rows) (rows <= 1 ? 1 : rows); cleanup: - if (tokudb_debug & TOKUDB_DEBUG_RETURN) { - TOKUDB_HANDLER_TRACE("return %" PRIu64 " %" PRIu64, (uint64_t) ret_val, rows); - } + TOKUDB_HANDLER_TRACE_FOR_FLAGS( + TOKUDB_DEBUG_RETURN, + "return %" PRIu64 " %" PRIu64, + (uint64_t)ret_val, + rows); DBUG_RETURN(ret_val); } @@ -7345,12 +7922,19 @@ void ha_tokudb::init_auto_increment() { commit_txn(txn, 0); } - if (tokudb_debug & TOKUDB_DEBUG_AUTO_INCREMENT) { - TOKUDB_HANDLER_TRACE("init auto increment:%lld", share->last_auto_increment); - } + TOKUDB_HANDLER_TRACE_FOR_FLAGS( + TOKUDB_DEBUG_AUTO_INCREMENT, + "init auto increment:%lld", + share->last_auto_increment); } -void ha_tokudb::get_auto_increment(ulonglong offset, ulonglong increment, ulonglong nb_desired_values, ulonglong * first_value, ulonglong * nb_reserved_values) { +void ha_tokudb::get_auto_increment( + ulonglong offset, + ulonglong increment, + ulonglong nb_desired_values, + ulonglong* first_value, + ulonglong* nb_reserved_values) { + TOKUDB_HANDLER_DBUG_ENTER(""); ulonglong nr; bool over; @@ -7361,14 +7945,13 @@ void ha_tokudb::get_auto_increment(ulonglong offset, ulonglong increment, ulongl DBUG_VOID_RETURN; } - tokudb_pthread_mutex_lock(&share->mutex); + share->lock(); if (share->auto_inc_create_value > share->last_auto_increment) { nr = share->auto_inc_create_value; over = false; share->last_auto_increment = share->auto_inc_create_value; - } - else { + } else { nr = share->last_auto_increment + increment; over = nr < share->last_auto_increment; if (over) @@ -7378,19 +7961,23 @@ void ha_tokudb::get_auto_increment(ulonglong offset, ulonglong increment, ulongl share->last_auto_increment = nr + (nb_desired_values - 1)*increment; if (delay_updating_ai_metadata) { ai_metadata_update_required = true; - } - else { - update_max_auto_inc(share->status_block, share->last_auto_increment); + } else { + update_max_auto_inc( + share->status_block, + share->last_auto_increment); } } - - if (tokudb_debug & TOKUDB_DEBUG_AUTO_INCREMENT) { - TOKUDB_HANDLER_TRACE("get_auto_increment(%lld,%lld,%lld):got:%lld:%lld", - offset, increment, nb_desired_values, nr, nb_desired_values); - } + TOKUDB_HANDLER_TRACE_FOR_FLAGS( + TOKUDB_DEBUG_AUTO_INCREMENT, + "get_auto_increment(%lld,%lld,%lld): got:%lld:%lld", + offset, + increment, + nb_desired_values, + nr, + nb_desired_values); *first_value = nr; *nb_reserved_values = nb_desired_values; - tokudb_pthread_mutex_unlock(&share->mutex); + share->unlock(); TOKUDB_HANDLER_DBUG_VOID_RETURN; } @@ -7419,16 +8006,15 @@ bool ha_tokudb::is_auto_inc_singleton(){ // 0 on success, error otherwise // int ha_tokudb::tokudb_add_index( - TABLE *table_arg, - KEY *key_info, - uint num_of_keys, - DB_TXN* txn, + TABLE* table_arg, + KEY* key_info, + uint num_of_keys, + DB_TXN* txn, bool* inc_num_DBs, - bool* modified_DBs - ) -{ + bool* modified_DBs) { + TOKUDB_HANDLER_DBUG_ENTER(""); - assert(txn); + assert_always(txn); int error; uint curr_index = 0; @@ -7438,7 +8024,7 @@ int ha_tokudb::tokudb_add_index( THD* thd = ha_thd(); DB_LOADER* loader = NULL; DB_INDEXER* indexer = NULL; - bool loader_save_space = get_load_save_space(thd); + bool loader_save_space = tokudb::sysvars::load_save_space(thd); bool use_hot_index = (lock.type == TL_WRITE_ALLOW_WRITE); uint32_t loader_flags = loader_save_space ? LOADER_COMPRESS_INTERMEDIATES : 0; uint32_t indexer_flags = 0; @@ -7468,14 +8054,17 @@ int ha_tokudb::tokudb_add_index( // // get the row type to use for the indexes we're adding // - toku_compression_method compression_method = get_compression_method(share->file); + toku_compression_method compression_method = + get_compression_method(share->file); // // status message to be shown in "show process list" // const char *orig_proc_info = tokudb_thd_get_proc_info(thd); - char status_msg[MAX_ALIAS_NAME + 200]; //buffer of 200 should be a good upper bound. - ulonglong num_processed = 0; //variable that stores number of elements inserted thus far + // buffer of 200 should be a good upper bound. + char status_msg[MAX_ALIAS_NAME + 200]; + // variable that stores number of elements inserted thus far + ulonglong num_processed = 0; thd_proc_info(thd, "Adding indexes"); // @@ -7500,13 +8089,15 @@ int ha_tokudb::tokudb_add_index( } } - rw_wrlock(&share->num_DBs_lock); + share->_num_DBs_lock.lock_write(); rw_lock_taken = true; // // open all the DB files and set the appropriate variables in share // they go to the end of share->key_file // - creating_hot_index = use_hot_index && num_of_keys == 1 && (key_info[0].flags & HA_NOSAME) == 0; + creating_hot_index = + use_hot_index && num_of_keys == 1 && + (key_info[0].flags & HA_NOSAME) == 0; if (use_hot_index && (share->num_DBs > curr_num_DBs)) { // // already have hot index in progress, get out @@ -7522,35 +8113,47 @@ int ha_tokudb::tokudb_add_index( &share->kc_info.key_filters[curr_index], &key_info[i], table_arg, - false - ); + false); if (!hidden_primary_key) { set_key_filter( &share->kc_info.key_filters[curr_index], &table_arg->key_info[primary_key], table_arg, - false - ); + false); } - error = initialize_col_pack_info(&share->kc_info,table_arg->s,curr_index); + error = initialize_col_pack_info( + &share->kc_info, + table_arg->s, + curr_index); if (error) { goto cleanup; } } - error = create_secondary_dictionary(share->table_name, table_arg, &key_info[i], txn, &share->kc_info, curr_index, creating_hot_index, compression_method); - if (error) { goto cleanup; } + error = create_secondary_dictionary( + share->full_table_name(), + table_arg, + &key_info[i], + txn, + &share->kc_info, + curr_index, + creating_hot_index, + compression_method); + if (error) { + goto cleanup; + } error = open_secondary_dictionary( - &share->key_file[curr_index], + &share->key_file[curr_index], &key_info[i], - share->table_name, + share->full_table_name(), false, - txn - ); - if (error) { goto cleanup; } + txn); + if (error) { + goto cleanup; + } } if (creating_hot_index) { @@ -7564,17 +8167,22 @@ int ha_tokudb::tokudb_add_index( num_of_keys, &share->key_file[curr_num_DBs], mult_db_flags, - indexer_flags - ); - if (error) { goto cleanup; } + indexer_flags); + if (error) { + goto cleanup; + } error = indexer->set_poll_function(indexer, ai_poll_fun, &lc); - if (error) { goto cleanup; } + if (error) { + goto cleanup; + } error = indexer->set_error_callback(indexer, loader_ai_err_fun, &lc); - if (error) { goto cleanup; } + if (error) { + goto cleanup; + } - rw_unlock(&share->num_DBs_lock); + share->_num_DBs_lock.unlock(); rw_lock_taken = false; #ifdef HA_TOKUDB_HAS_THD_PROGRESS @@ -7585,17 +8193,20 @@ int ha_tokudb::tokudb_add_index( error = indexer->build(indexer); - if (error) { goto cleanup; } + if (error) { + goto cleanup; + } - rw_wrlock(&share->num_DBs_lock); + share->_num_DBs_lock.lock_write(); error = indexer->close(indexer); - rw_unlock(&share->num_DBs_lock); - if (error) { goto cleanup; } + share->_num_DBs_lock.unlock(); + if (error) { + goto cleanup; + } indexer = NULL; - } - else { + } else { DBUG_ASSERT(table->mdl_ticket->get_type() >= MDL_SHARED_NO_WRITE); - rw_unlock(&share->num_DBs_lock); + share->_num_DBs_lock.unlock(); rw_lock_taken = false; prelocked_right_range_size = 0; prelocked_left_range_size = 0; @@ -7608,27 +8219,37 @@ int ha_tokudb::tokudb_add_index( bf_info.key_to_compare = NULL; error = db_env->create_loader( - db_env, - txn, - &loader, + db_env, + txn, + &loader, NULL, // no src_db needed - num_of_keys, - &share->key_file[curr_num_DBs], + num_of_keys, + &share->key_file[curr_num_DBs], mult_put_flags, mult_dbt_flags, - loader_flags - ); - if (error) { goto cleanup; } + loader_flags); + if (error) { + goto cleanup; + } error = loader->set_poll_function(loader, loader_poll_fun, &lc); - if (error) { goto cleanup; } + if (error) { + goto cleanup; + } error = loader->set_error_callback(loader, loader_ai_err_fun, &lc); - if (error) { goto cleanup; } + if (error) { + goto cleanup; + } // // scan primary table, create each secondary key, add to each DB // - if ((error = share->file->cursor(share->file, txn, &tmp_cursor, DB_SERIALIZABLE))) { + error = share->file->cursor( + share->file, + txn, + &tmp_cursor, + DB_SERIALIZABLE); + if (error) { tmp_cursor = NULL; // Safety goto cleanup; } @@ -7643,16 +8264,21 @@ int ha_tokudb::tokudb_add_index( share->file->dbt_neg_infty(), share->file->dbt_pos_infty(), true, - 0 - ); - if (error) { goto cleanup; } + 0); + if (error) { + goto cleanup; + } // set the bulk fetch iteration to its max so that adding an // index fills the bulk fetch buffer every time. we do not // want it to grow exponentially fast. rows_fetched_using_bulk_fetch = 0; bulk_fetch_iteration = HA_TOKU_BULK_FETCH_ITERATION_MAX; - cursor_ret_val = tmp_cursor->c_getf_next(tmp_cursor, DB_PRELOCKED,smart_dbt_bf_callback, &bf_info); + cursor_ret_val = tmp_cursor->c_getf_next( + tmp_cursor, + DB_PRELOCKED, + smart_dbt_bf_callback, + &bf_info); #ifdef HA_TOKUDB_HAS_THD_PROGRESS // initialize a two phase progress report. @@ -7660,21 +8286,30 @@ int ha_tokudb::tokudb_add_index( thd_progress_init(thd, 2); #endif - while (cursor_ret_val != DB_NOTFOUND || ((bytes_used_in_range_query_buff - curr_range_query_buff_offset) > 0)) { - if ((bytes_used_in_range_query_buff - curr_range_query_buff_offset) == 0) { + while (cursor_ret_val != DB_NOTFOUND || + ((bytes_used_in_range_query_buff - + curr_range_query_buff_offset) > 0)) { + if ((bytes_used_in_range_query_buff - + curr_range_query_buff_offset) == 0) { invalidate_bulk_fetch(); // reset the buffers - cursor_ret_val = tmp_cursor->c_getf_next(tmp_cursor, DB_PRELOCKED, smart_dbt_bf_callback, &bf_info); + cursor_ret_val = tmp_cursor->c_getf_next( + tmp_cursor, + DB_PRELOCKED, + smart_dbt_bf_callback, + &bf_info); if (cursor_ret_val != DB_NOTFOUND && cursor_ret_val != 0) { error = cursor_ret_val; goto cleanup; } } - // do this check in case the the c_getf_next did not put anything into the buffer because - // there was no more data - if ((bytes_used_in_range_query_buff - curr_range_query_buff_offset) == 0) { + // do this check in case the the c_getf_next did not put anything + // into the buffer because there was no more data + if ((bytes_used_in_range_query_buff - + curr_range_query_buff_offset) == 0) { break; } - // at this point, we know the range query buffer has at least one key/val pair + // at this point, we know the range query buffer has at least one + // key/val pair uchar* curr_pos = range_query_buff+curr_range_query_buff_offset; uint32_t key_size = *(uint32_t *)curr_pos; @@ -7694,17 +8329,26 @@ int ha_tokudb::tokudb_add_index( curr_range_query_buff_offset = curr_pos - range_query_buff; error = loader->put(loader, &curr_pk_key, &curr_pk_val); - if (error) { goto cleanup; } + if (error) { + goto cleanup; + } num_processed++; if ((num_processed % 1000) == 0) { - sprintf(status_msg, "Adding indexes: Fetched %llu of about %llu rows, loading of data still remains.", - num_processed, (long long unsigned) share->rows); + sprintf( + status_msg, + "Adding indexes: Fetched %llu of about %llu rows, loading " + "of data still remains.", + num_processed, + (long long unsigned)share->row_count()); thd_proc_info(thd, status_msg); #ifdef HA_TOKUDB_HAS_THD_PROGRESS - thd_progress_report(thd, num_processed, (long long unsigned) share->rows); + thd_progress_report( + thd, + num_processed, + (long long unsigned)share->row_count()); #endif if (thd_killed(thd)) { @@ -7714,7 +8358,7 @@ int ha_tokudb::tokudb_add_index( } } error = tmp_cursor->c_close(tmp_cursor); - assert(error==0); + assert_always(error==0); tmp_cursor = NULL; #ifdef HA_TOKUDB_HAS_THD_PROGRESS @@ -7732,9 +8376,14 @@ int ha_tokudb::tokudb_add_index( for (uint i = 0; i < num_of_keys; i++, curr_index++) { if (key_info[i].flags & HA_NOSAME) { bool is_unique; - error = is_index_unique(&is_unique, txn, share->key_file[curr_index], &key_info[i], - creating_hot_index ? 0 : DB_PRELOCKED_WRITE); - if (error) goto cleanup; + error = is_index_unique( + &is_unique, + txn, + share->key_file[curr_index], + &key_info[i], + creating_hot_index ? 0 : DB_PRELOCKED_WRITE); + if (error) + goto cleanup; if (!is_unique) { error = HA_ERR_FOUND_DUPP_KEY; last_dup_key = i; @@ -7743,22 +8392,20 @@ int ha_tokudb::tokudb_add_index( } } + share->lock(); // // We have an accurate row count, might as well update share->rows // if(!creating_hot_index) { - tokudb_pthread_mutex_lock(&share->mutex); - share->rows = num_processed; - tokudb_pthread_mutex_unlock(&share->mutex); + share->set_row_count(num_processed, true); } // // now write stuff to status.tokudb // - tokudb_pthread_mutex_lock(&share->mutex); for (uint i = 0; i < num_of_keys; i++) { write_key_name_to_status(share->status_block, key_info[i].name, txn); } - tokudb_pthread_mutex_unlock(&share->mutex); + share->unlock(); error = 0; cleanup: @@ -7766,12 +8413,12 @@ cleanup: thd_progress_end(thd); #endif if (rw_lock_taken) { - rw_unlock(&share->num_DBs_lock); + share->_num_DBs_lock.unlock(); rw_lock_taken = false; } if (tmp_cursor) { int r = tmp_cursor->c_close(tmp_cursor); - assert(r==0); + assert_always(r==0); tmp_cursor = NULL; } if (loader != NULL) { @@ -7782,14 +8429,17 @@ cleanup: if (indexer != NULL) { sprintf(status_msg, "aborting creation of indexes."); thd_proc_info(thd, status_msg); - rw_wrlock(&share->num_DBs_lock); + share->_num_DBs_lock.lock_write(); indexer->abort(indexer); - rw_unlock(&share->num_DBs_lock); + share->_num_DBs_lock.unlock(); } - if (error == DB_LOCK_NOTGRANTED && ((tokudb_debug & TOKUDB_DEBUG_HIDE_DDL_LOCK_ERRORS) == 0)) { - sql_print_error("Could not add indexes to table %s because \ -another transaction has accessed the table. \ -To add indexes, make sure no transactions touch the table.", share->table_name); + if (TOKUDB_LIKELY(TOKUDB_DEBUG_FLAGS(TOKUDB_DEBUG_HIDE_DDL_LOCK_ERRORS) == 0) && + error == DB_LOCK_NOTGRANTED) { + sql_print_error( + "Could not add indexes to table %s because another transaction has " + "accessed the table. To add indexes, make sure no transactions " + "touch the table.", + share->full_table_name()); } thd_proc_info(thd, orig_proc_info); TOKUDB_HANDLER_DBUG_RETURN(error ? error : loader_error); @@ -7799,7 +8449,12 @@ To add indexes, make sure no transactions touch the table.", share->table_name); // Internal function called by ha_tokudb::add_index and ha_tokudb::alter_table_phase2 // Closes added indexes in case of error in error path of add_index and alter_table_phase2 // -void ha_tokudb::restore_add_index(TABLE* table_arg, uint num_of_keys, bool incremented_numDBs, bool modified_DBs) { +void ha_tokudb::restore_add_index( + TABLE* table_arg, + uint num_of_keys, + bool incremented_numDBs, + bool modified_DBs) { + uint curr_num_DBs = table_arg->s->keys + tokudb_test(hidden_primary_key); uint curr_index = 0; @@ -7808,7 +8463,7 @@ void ha_tokudb::restore_add_index(TABLE* table_arg, uint num_of_keys, bool incre // so that there is not a window // if (incremented_numDBs) { - rw_wrlock(&share->num_DBs_lock); + share->_num_DBs_lock.lock_write(); share->num_DBs--; } if (modified_DBs) { @@ -7821,15 +8476,14 @@ void ha_tokudb::restore_add_index(TABLE* table_arg, uint num_of_keys, bool incre if (share->key_file[curr_index]) { int r = share->key_file[curr_index]->close( share->key_file[curr_index], - 0 - ); - assert(r==0); + 0); + assert_always(r==0); share->key_file[curr_index] = NULL; } } } if (incremented_numDBs) { - rw_unlock(&share->num_DBs_lock); + share->_num_DBs_lock.unlock(); } } @@ -7837,14 +8491,22 @@ void ha_tokudb::restore_add_index(TABLE* table_arg, uint num_of_keys, bool incre // Internal function called by ha_tokudb::prepare_drop_index and ha_tokudb::alter_table_phase2 // With a transaction, drops dictionaries associated with indexes in key_num // -int ha_tokudb::drop_indexes(TABLE *table_arg, uint *key_num, uint num_of_keys, KEY *key_info, DB_TXN* txn) { +int ha_tokudb::drop_indexes( + TABLE* table_arg, + uint* key_num, + uint num_of_keys, + KEY* key_info, + DB_TXN* txn) { + TOKUDB_HANDLER_DBUG_ENTER(""); - assert(txn); + assert_always(txn); int error = 0; for (uint i = 0; i < num_of_keys; i++) { uint curr_index = key_num[i]; - error = share->key_file[curr_index]->pre_acquire_fileops_lock(share->key_file[curr_index],txn); + error = share->key_file[curr_index]->pre_acquire_fileops_lock( + share->key_file[curr_index], + txn); if (error != 0) { goto cleanup; } @@ -7852,30 +8514,51 @@ int ha_tokudb::drop_indexes(TABLE *table_arg, uint *key_num, uint num_of_keys, K for (uint i = 0; i < num_of_keys; i++) { uint curr_index = key_num[i]; int r = share->key_file[curr_index]->close(share->key_file[curr_index],0); - assert(r==0); + assert_always(r==0); share->key_file[curr_index] = NULL; - error = remove_key_name_from_status(share->status_block, key_info[curr_index].name, txn); - if (error) { goto cleanup; } + error = remove_key_name_from_status( + share->status_block, + key_info[curr_index].name, + txn); + if (error) { + goto cleanup; + } - error = delete_or_rename_dictionary(share->table_name, NULL, key_info[curr_index].name, true, txn, true); - if (error) { goto cleanup; } + error = delete_or_rename_dictionary( + share->full_table_name(), + NULL, + key_info[curr_index].name, + true, + txn, + true); + if (error) { + goto cleanup; + } } cleanup: - if (error == DB_LOCK_NOTGRANTED && ((tokudb_debug & TOKUDB_DEBUG_HIDE_DDL_LOCK_ERRORS) == 0)) { - sql_print_error("Could not drop indexes from table %s because \ -another transaction has accessed the table. \ -To drop indexes, make sure no transactions touch the table.", share->table_name); + if (TOKUDB_LIKELY(TOKUDB_DEBUG_FLAGS(TOKUDB_DEBUG_HIDE_DDL_LOCK_ERRORS) == 0) && + error == DB_LOCK_NOTGRANTED) { + sql_print_error( + "Could not drop indexes from table %s because another transaction " + "has accessed the table. To drop indexes, make sure no " + "transactions touch the table.", + share->full_table_name()); } TOKUDB_HANDLER_DBUG_RETURN(error); } // -// Internal function called by ha_tokudb::prepare_drop_index and ha_tokudb::alter_table_phase2 -// Restores dropped indexes in case of error in error path of prepare_drop_index and alter_table_phase2 +// Internal function called by ha_tokudb::prepare_drop_index and +// ha_tokudb::alter_table_phase2 +// Restores dropped indexes in case of error in error path of +// prepare_drop_index and alter_table_phase2 // -void ha_tokudb::restore_drop_indexes(TABLE *table_arg, uint *key_num, uint num_of_keys) { +void ha_tokudb::restore_drop_indexes( + TABLE* table_arg, + uint* key_num, + uint num_of_keys) { // // reopen closed dictionaries @@ -7885,13 +8568,12 @@ void ha_tokudb::restore_drop_indexes(TABLE *table_arg, uint *key_num, uint num_o uint curr_index = key_num[i]; if (share->key_file[curr_index] == NULL) { r = open_secondary_dictionary( - &share->key_file[curr_index], + &share->key_file[curr_index], &table_share->key_info[curr_index], - share->table_name, - false, // - NULL - ); - assert(!r); + share->full_table_name(), + false, + NULL); + assert_always(!r); } } } @@ -7937,56 +8619,65 @@ void ha_tokudb::print_error(int error, myf errflag) { // does so by deleting and then recreating the dictionary in the context // of a transaction // -int ha_tokudb::truncate_dictionary( uint keynr, DB_TXN* txn ) { +int ha_tokudb::truncate_dictionary(uint keynr, DB_TXN* txn) { int error; bool is_pk = (keynr == primary_key); - toku_compression_method compression_method = get_compression_method(share->key_file[keynr]); + toku_compression_method compression_method = + get_compression_method(share->key_file[keynr]); error = share->key_file[keynr]->close(share->key_file[keynr], 0); - assert(error == 0); + assert_always(error == 0); share->key_file[keynr] = NULL; - if (is_pk) { share->file = NULL; } + if (is_pk) { + share->file = NULL; + } if (is_pk) { error = delete_or_rename_dictionary( - share->table_name, + share->full_table_name(), NULL, - "main", + "main", false, //is_key txn, - true // is a delete - ); - if (error) { goto cleanup; } - } - else { + true); // is a delete + if (error) { + goto cleanup; + } + } else { error = delete_or_rename_dictionary( - share->table_name, + share->full_table_name(), NULL, - table_share->key_info[keynr].name, + table_share->key_info[keynr].name, true, //is_key txn, - true // is a delete - ); - if (error) { goto cleanup; } + true); // is a delete + if (error) { + goto cleanup; + } } if (is_pk) { - error = create_main_dictionary(share->table_name, table, txn, &share->kc_info, compression_method); - } - else { + error = create_main_dictionary( + share->full_table_name(), + table, + txn, + &share->kc_info, + compression_method); + } else { error = create_secondary_dictionary( - share->table_name, - table, - &table_share->key_info[keynr], + share->full_table_name(), + table, + &table_share->key_info[keynr], txn, &share->kc_info, keynr, false, - compression_method - ); + compression_method); + } + if (error) { + goto cleanup; } - if (error) { goto cleanup; } cleanup: return error; @@ -8025,40 +8716,51 @@ int ha_tokudb::delete_all_rows_internal() { uint curr_num_DBs = 0; DB_TXN* txn = NULL; + // this should be enough to handle locking as the higher level MDL + // on this table should prevent any new analyze tasks. + share->cancel_background_jobs(); + error = txn_begin(db_env, 0, &txn, 0, ha_thd()); - if (error) { goto cleanup; } + if (error) { + goto cleanup; + } curr_num_DBs = table->s->keys + tokudb_test(hidden_primary_key); for (uint i = 0; i < curr_num_DBs; i++) { error = share->key_file[i]->pre_acquire_fileops_lock( - share->key_file[i], - txn - ); - if (error) { goto cleanup; } + share->key_file[i], + txn); + if (error) { + goto cleanup; + } error = share->key_file[i]->pre_acquire_table_lock( - share->key_file[i], - txn - ); - if (error) { goto cleanup; } + share->key_file[i], + txn); + if (error) { + goto cleanup; + } } for (uint i = 0; i < curr_num_DBs; i++) { error = truncate_dictionary(i, txn); - if (error) { goto cleanup; } + if (error) { + goto cleanup; + } } + DEBUG_SYNC(ha_thd(), "tokudb_after_truncate_all_dictionarys"); + // zap the row count if (error == 0) { - share->rows = 0; - // update auto increment - share->last_auto_increment = 0; - // calling write_to_status directly because we need to use txn - write_to_status( - share->status_block, + share->set_row_count(0, false); + // update auto increment + share->last_auto_increment = 0; + // calling write_to_status directly because we need to use txn + write_to_status( + share->status_block, hatoku_max_ai, - &share->last_auto_increment, - sizeof(share->last_auto_increment), - txn - ); + &share->last_auto_increment, + sizeof(share->last_auto_increment), + txn); } share->try_table_lock = true; @@ -8066,16 +8768,19 @@ cleanup: if (txn) { if (error) { abort_txn(txn); - } - else { + } else { commit_txn(txn,0); } } - if (error == DB_LOCK_NOTGRANTED && ((tokudb_debug & TOKUDB_DEBUG_HIDE_DDL_LOCK_ERRORS) == 0)) { - sql_print_error("Could not truncate table %s because another transaction has accessed the \ - table. To truncate the table, make sure no transactions touch the table.", - share->table_name); + if (TOKUDB_LIKELY(TOKUDB_DEBUG_FLAGS( + TOKUDB_DEBUG_HIDE_DDL_LOCK_ERRORS) == 0) && + error == DB_LOCK_NOTGRANTED) { + sql_print_error( + "Could not truncate table %s because another transaction has " + "accessed the table. To truncate the table, make sure no " + "transactions touch the table.", + share->full_table_name()); } // // regardless of errors, need to reopen the DB's @@ -8085,21 +8790,18 @@ cleanup: if (share->key_file[i] == NULL) { if (i != primary_key) { r = open_secondary_dictionary( - &share->key_file[i], - &table_share->key_info[i], - share->table_name, - false, // - NULL - ); - assert(!r); - } - else { + &share->key_file[i], + &table_share->key_info[i], + share->full_table_name(), + false, + NULL); + assert_always(!r); + } else { r = open_main_dictionary( - share->table_name, - false, - NULL - ); - assert(!r); + share->full_table_name(), + false, + NULL); + assert_always(!r); } } } @@ -8111,7 +8813,7 @@ void ha_tokudb::set_loader_error(int err) { } void ha_tokudb::set_dup_value_for_pk(DBT* key) { - assert(!hidden_primary_key); + assert_always(!hidden_primary_key); unpack_key(table->record[0],key,primary_key); last_dup_key = primary_key; } @@ -8144,21 +8846,28 @@ Item* ha_tokudb::idx_cond_push(uint keyno_arg, Item* idx_cond_arg) { return idx_cond_arg; } +void ha_tokudb::cancel_pushed_idx_cond() { + invalidate_icp(); + handler::cancel_pushed_idx_cond(); +} + void ha_tokudb::cleanup_txn(DB_TXN *txn) { if (transaction == txn && cursor) { int r = cursor->c_close(cursor); - assert(r == 0); + assert_always(r == 0); cursor = NULL; } } void ha_tokudb::add_to_trx_handler_list() { - tokudb_trx_data *trx = (tokudb_trx_data *) thd_get_ha_data(ha_thd(), tokudb_hton); + tokudb_trx_data* trx = + (tokudb_trx_data*)thd_get_ha_data(ha_thd(), tokudb_hton); trx->handlers = list_add(trx->handlers, &trx_handler_list); } void ha_tokudb::remove_from_trx_handler_list() { - tokudb_trx_data *trx = (tokudb_trx_data *) thd_get_ha_data(ha_thd(), tokudb_hton); + tokudb_trx_data* trx = + (tokudb_trx_data*)thd_get_ha_data(ha_thd(), tokudb_hton); trx->handlers = list_delete(trx->handlers, &trx_handler_list); } @@ -8190,7 +8899,7 @@ bool ha_tokudb::rpl_lookup_rows() { if (!in_rpl_delete_rows && !in_rpl_update_rows) return true; else - return THDVAR(ha_thd(), rpl_lookup_rows); + return tokudb::sysvars::rpl_lookup_rows(ha_thd()); } // table admin diff --git a/storage/tokudb/ha_tokudb.h b/storage/tokudb/ha_tokudb.h index 5b387924b1e..3d7a3a7fa05 100644 --- a/storage/tokudb/ha_tokudb.h +++ b/storage/tokudb/ha_tokudb.h @@ -23,11 +23,12 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." -#if !defined(HA_TOKUDB_H) -#define HA_TOKUDB_H +#ifndef _HA_TOKUDB_H +#define _HA_TOKUDB_H -#include +#include "hatoku_hton.h" #include "hatoku_cmp.h" +#include "tokudb_background.h" #define HA_TOKU_ORIG_VERSION 4 #define HA_TOKU_VERSION 4 @@ -45,84 +46,384 @@ typedef struct loader_context { } *LOADER_CONTEXT; // -// This object stores table information that is to be shared +// This class stores table information that is to be shared // among all ha_tokudb objects. -// There is one instance per table, shared among threads. +// There is one instance per table, shared among handlers. // Some of the variables here are the DB* pointers to indexes, // and auto increment information. // +// When the last user releases it's reference on the share, +// it closes all of its database handles and releases all info +// The share instance stays around though so some data can be transiently +// kept across open-close-open-close cycles. These data will be explicitly +// noted below. +// class TOKUDB_SHARE { public: - void init(void); - void destroy(void); + enum share_state_t { + CLOSED = 0, + OPENED = 1, + ERROR = 2 + }; + + // one time, start up init + static void static_init(); + + // one time, shutdown destroy + static void static_destroy(); + + // retuns a locked, properly reference counted share + // callers must check to ensure share is in correct state for callers use + // and unlock the share. + // if create_new is set, a new "CLOSED" share will be created if one + // doesn't exist, otherwise will return NULL if an existing is not found. + static TOKUDB_SHARE* get_share( + const char* table_name, + TABLE_SHARE* table_share, + THR_LOCK_DATA* data, + bool create_new); + + // removes a share entirely from the pool, call to rename/deleta a table + // caller must hold ddl_mutex on this share and the share MUST have + // exactly 0 _use_count + static void drop_share(TOKUDB_SHARE* share); + + // returns state string for logging/reporting + static const char* get_state_string(share_state_t state); + + void* operator new(size_t sz); + void operator delete(void* p); + + TOKUDB_SHARE(); + + // increases the ref count and waits for any currently executing state + // transition to complete + // returns current state and leaves share locked + // callers must check to ensure share is in correct state for callers use + // and unlock the share. + share_state_t addref(); + + // decreases the ref count and potentially closes the share + // caller must not have ownership of mutex, will lock and release + int release(); + + // returns the current use count + // no locking requirements + inline int use_count() const; + + // locks the share + inline void lock() const; + + // unlocks the share + inline void unlock() const; + + // returns the current state of the share + // no locking requirements + inline share_state_t state() const; + + // sets the state of the share + // caller must hold mutex on this share + inline void set_state(share_state_t state); + + // returns the full MySQL table name of the table ex: + // ./database/table + // no locking requirements + inline const char* full_table_name() const; + + // returns the strlen of the full table name + // no locking requirements + inline uint full_table_name_length() const; + + // returns the parsed database name this table resides in + // no locking requirements + inline const char* database_name() const; + + // returns the strlen of the database name + // no locking requirements + inline uint database_name_length() const; + + // returns the parsed table name of this table + // no locking requirements + inline const char* table_name() const; + + // returns the strlen of the the table name + // no locking requirements + inline uint table_name_length() const; + + // sets the estimated number of rows in the table + // should be called only during share initialization and info call + // caller must hold mutex on this share unless specified by 'locked' + inline void set_row_count(uint64_t rows, bool locked); + + // updates tracked row count and ongoing table change delta tracking + // called from any ha_tokudb operation that inserts/modifies/deletes rows + // may spawn background analysis if enabled, allowed and threshold hit + // caller must not have ownership of mutex, will lock and release + void update_row_count( + THD* thd, + uint64_t added, + uint64_t deleted, + uint64_t updated); + + // returns the current row count estimate + // no locking requirements + inline ha_rows row_count() const; + + // initializes cardinality statistics, takes ownership of incoming buffer + // caller must hold mutex on this share + inline void init_cardinality_counts( + uint32_t rec_per_keys, + uint64_t* rec_per_key); + + // update the cardinality statistics. number of records must match + // caller must hold mutex on this share + inline void update_cardinality_counts( + uint32_t rec_per_keys, + const uint64_t* rec_per_key); + + // disallow any auto analysis from taking place + // caller must hold mutex on this share + inline void disallow_auto_analysis(); + + // allow any auto analysis to take place + // pass in true for 'reset_deltas' to reset delta counting to 0 + // caller must hold mutex on this share + inline void allow_auto_analysis(bool reset_deltas); + + // cancels all background jobs for this share + // no locking requirements + inline void cancel_background_jobs() const; + + // copies cardinality statistics into TABLE counter set + // caller must not have ownership of mutex, will lock and release + void set_cardinality_counts_in_table(TABLE* table); + + // performs table analysis on underlying indices and produces estimated + // cardinality statistics. + // on success updates cardinality counts in status database and this share + // MUST pass a valid THD to access session variables. + // MAY pass txn. If txn is passed, assumes an explicit user scheduled + // ANALYZE and not an auto ANALYZE resulting from delta threshold + // uses session variables: + // tokudb_analyze_in_background, tokudb_analyze_throttle, + // tokudb_analyze_time, and tokudb_analyze_delete_fraction + // caller must hold mutex on this share + int analyze_standard(THD* thd, DB_TXN* txn); + + // performs table scan and updates the internal FT logical row count value + // on success also updates share row count estimate. + // MUST pass a valid THD to access session variables. + // MAY pass txn. If txn is passed, assumes an explicit user scheduled + // uses session variables: + // tokudb_analyze_in_background, and tokudb_analyze_throttle + // caller must not have ownership of mutex, will lock and release + int analyze_recount_rows(THD* thd, DB_TXN* txn); public: - char *table_name; - uint table_name_length, use_count; - pthread_mutex_t mutex; - THR_LOCK lock; - + //********************************* + // Destroyed and recreated on open-close-open ulonglong auto_ident; ulonglong last_auto_increment, auto_inc_create_value; - // - // estimate on number of rows in table - // - ha_rows rows; - // + // estimate on number of rows added in the process of a locked tables // this is so we can better estimate row count during a lock table - // ha_rows rows_from_locked_table; - DB *status_block; - // + DB* status_block; + // DB that is indexed on the primary key - // - DB *file; - // + DB* file; + // array of all DB's that make up table, includes DB that // is indexed on the primary key, add 1 in case primary // key is hidden - // - DB *key_file[MAX_KEY +1]; - rw_lock_t key_file_lock; + DB* key_file[MAX_KEY + 1]; uint status, version, capabilities; uint ref_length; - // + // whether table has an auto increment column - // bool has_auto_inc; - // + // index of auto increment column in table->field, if auto_inc exists - // uint ai_field_index; - // + // whether the primary key has a string - // bool pk_has_string; KEY_AND_COL_INFO kc_info; - - // + + // key info copied from TABLE_SHARE, used by background jobs that have no + // access to a handler instance + uint _keys; + uint _max_key_parts; + struct key_descriptor_t { + uint _parts; + bool _is_unique; + char* _name; + }; + key_descriptor_t* _key_descriptors; + // we want the following optimization for bulk loads, if the table is empty, // attempt to grab a table lock. emptiness check can be expensive, // so we try it once for a table. After that, we keep this variable around - // to tell us to not try it again. - // - bool try_table_lock; + // to tell us to not try it again. + bool try_table_lock; bool has_unique_keys; bool replace_into_fast; - rw_lock_t num_DBs_lock; + tokudb::thread::rwlock_t _num_DBs_lock; uint32_t num_DBs; - pthread_cond_t m_openclose_cond; - enum { CLOSED, OPENING, OPENED, CLOSING, ERROR } m_state; - int m_error; - int m_initialize_count; +private: + static HASH _open_tables; + static tokudb::thread::mutex_t _open_tables_mutex; - uint n_rec_per_key; - uint64_t *rec_per_key; + static uchar* hash_get_key( + TOKUDB_SHARE* share, + size_t* length, + TOKUDB_UNUSED(my_bool not_used)); + + static void hash_free_element(TOKUDB_SHARE* share); + + //********************************* + // Spans open-close-open + mutable tokudb::thread::mutex_t _mutex; + mutable tokudb::thread::mutex_t _ddl_mutex; + uint _use_count; + + share_state_t _state; + + ulonglong _row_delta_activity; + bool _allow_auto_analysis; + + String _full_table_name; + String _database_name; + String _table_name; + + //********************************* + // Destroyed and recreated on open-close-open + THR_LOCK _thr_lock; + + // estimate on number of rows in table + ha_rows _rows; + + // cardinality counts + uint32_t _rec_per_keys; + uint64_t* _rec_per_key; + + void init(const char* table_name); + void destroy(); }; +inline int TOKUDB_SHARE::use_count() const { + return _use_count; +} +inline void TOKUDB_SHARE::lock() const { + TOKUDB_SHARE_DBUG_ENTER("file[%s]:state[%s]:use_count[%d]", + _full_table_name.ptr(), + get_state_string(_state), + _use_count); + _mutex.lock(); + TOKUDB_SHARE_DBUG_VOID_RETURN(); +} +inline void TOKUDB_SHARE::unlock() const { + TOKUDB_SHARE_DBUG_ENTER("file[%s]:state[%s]:use_count[%d]", + _full_table_name.ptr(), + get_state_string(_state), + _use_count); + _mutex.unlock(); + TOKUDB_SHARE_DBUG_VOID_RETURN(); +} +inline TOKUDB_SHARE::share_state_t TOKUDB_SHARE::state() const { + return _state; +} +inline void TOKUDB_SHARE::set_state(TOKUDB_SHARE::share_state_t state) { + TOKUDB_SHARE_DBUG_ENTER("file[%s]:state[%s]:use_count[%d]:new_state[%s]", + _full_table_name.ptr(), + get_state_string(_state), + _use_count, + get_state_string(state)); + + assert_debug(_mutex.is_owned_by_me()); + _state = state; + TOKUDB_SHARE_DBUG_VOID_RETURN(); +} +inline const char* TOKUDB_SHARE::full_table_name() const { + return _full_table_name.ptr(); +} +inline uint TOKUDB_SHARE::full_table_name_length() const { + return _full_table_name.length(); +} +inline const char* TOKUDB_SHARE::database_name() const { + return _database_name.ptr(); +} +inline uint TOKUDB_SHARE::database_name_length() const { + return _database_name.length(); +} +inline const char* TOKUDB_SHARE::table_name() const { + return _table_name.ptr(); +} +inline uint TOKUDB_SHARE::table_name_length() const { + return _table_name.length(); +} +inline void TOKUDB_SHARE::set_row_count(uint64_t rows, bool locked) { + TOKUDB_SHARE_DBUG_ENTER("file[%s]:state[%s]:use_count[%d]:rows[%" PRIu64 "]:locked[%d]", + _full_table_name.ptr(), + get_state_string(_state), + _use_count, + rows, + locked); + + if (!locked) { + lock(); + } else { + assert_debug(_mutex.is_owned_by_me()); + } + if (_rows && rows == 0) + _row_delta_activity = 0; + + _rows = rows; + if (!locked) { + unlock(); + } + TOKUDB_SHARE_DBUG_VOID_RETURN(); +} +inline ha_rows TOKUDB_SHARE::row_count() const { + return _rows; +} +inline void TOKUDB_SHARE::init_cardinality_counts( + uint32_t rec_per_keys, + uint64_t* rec_per_key) { + + assert_debug(_mutex.is_owned_by_me()); + // can not change number of keys live + assert_always(_rec_per_key == NULL && _rec_per_keys == 0); + _rec_per_keys = rec_per_keys; + _rec_per_key = rec_per_key; +} +inline void TOKUDB_SHARE::update_cardinality_counts( + uint32_t rec_per_keys, + const uint64_t* rec_per_key) { + + assert_debug(_mutex.is_owned_by_me()); + // can not change number of keys live + assert_always(rec_per_keys == _rec_per_keys); + assert_always(rec_per_key != NULL); + memcpy(_rec_per_key, rec_per_key, _rec_per_keys * sizeof(uint64_t)); +} +inline void TOKUDB_SHARE::disallow_auto_analysis() { + assert_debug(_mutex.is_owned_by_me()); + _allow_auto_analysis = false; +} +inline void TOKUDB_SHARE::allow_auto_analysis(bool reset_deltas) { + assert_debug(_mutex.is_owned_by_me()); + _allow_auto_analysis = true; + if (reset_deltas) + _row_delta_activity = 0; +} +inline void TOKUDB_SHARE::cancel_background_jobs() const { + tokudb::background::_job_manager->cancel_job(full_table_name()); +} + + typedef struct st_filter_key_part_info { uint offset; @@ -278,6 +579,7 @@ private: // ulonglong added_rows; ulonglong deleted_rows; + ulonglong updated_rows; uint last_dup_key; @@ -438,7 +740,7 @@ public: // Returns a bit mask of capabilities of storage engine. Capabilities // defined in sql/handler.h // - ulonglong table_flags(void) const; + ulonglong table_flags() const; ulong index_flags(uint inx, uint part, bool all_parts) const; @@ -482,7 +784,7 @@ public: double index_only_read_time(uint keynr, double records); int open(const char *name, int mode, uint test_if_locked); - int close(void); + int close(); void update_create_info(HA_CREATE_INFO* create_info); int create(const char *name, TABLE * form, HA_CREATE_INFO * create_info); int delete_table(const char *name); @@ -528,7 +830,7 @@ public: void position(const uchar * record); int info(uint); int extra(enum ha_extra_function operation); - int reset(void); + int reset(); int external_lock(THD * thd, int lock_type); int start_stmt(THD * thd, thr_lock_type lock_type); @@ -540,12 +842,17 @@ public: int get_status(DB_TXN* trans); void init_hidden_prim_key_info(DB_TXN *txn); inline void get_auto_primary_key(uchar * to) { - tokudb_pthread_mutex_lock(&share->mutex); + share->lock(); share->auto_ident++; hpk_num_to_char(to, share->auto_ident); - tokudb_pthread_mutex_unlock(&share->mutex); + share->unlock(); } - virtual void get_auto_increment(ulonglong offset, ulonglong increment, ulonglong nb_desired_values, ulonglong * first_value, ulonglong * nb_reserved_values); + virtual void get_auto_increment( + ulonglong offset, + ulonglong increment, + ulonglong nb_desired_values, + ulonglong* first_value, + ulonglong* nb_reserved_values); bool is_optimize_blocking(); bool is_auto_inc_singleton(); void print_error(int error, myf errflag); @@ -555,9 +862,6 @@ public: bool primary_key_is_clustered() { return true; } - bool supports_clustered_keys() { - return true; - } int cmp_ref(const uchar * ref1, const uchar * ref2); bool check_if_incompatible_data(HA_CREATE_INFO * info, uint table_changes); @@ -599,15 +903,8 @@ public: #endif - // ICP introduced in MariaDB 5.5 Item* idx_cond_push(uint keyno, class Item* idx_cond); - -#ifdef MARIADB_BASE_VERSION - void cancel_pushed_idx_cond() - { - invalidate_icp(); - } -#endif + void cancel_pushed_idx_cond(); #if TOKU_INCLUDE_ALTER_56 public: @@ -693,13 +990,13 @@ public: int fill_range_query_buf( bool need_val, - DBT const *key, - DBT const *row, + DBT const* key, + DBT const* row, int direction, THD* thd, uchar* buf, - DBT* key_to_compare - ); + DBT* key_to_compare); + #if TOKU_INCLUDE_ROW_TYPE_COMPRESSION enum row_type get_row_type() const; #endif @@ -709,9 +1006,7 @@ private: int get_next(uchar* buf, int direction, DBT* key_to_compare, bool do_key_read); int read_data_from_range_query_buff(uchar* buf, bool need_val, bool do_key_read); // for ICP, only in MariaDB and MySQL 5.6 -#if defined(MARIADB_BASE_VERSION) || (50600 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50699) enum icp_result toku_handler_index_cond_check(Item* pushed_idx_cond); -#endif void invalidate_bulk_fetch(); void invalidate_icp(); int delete_all_rows_internal(); @@ -758,25 +1053,5 @@ private: bool in_rpl_update_rows; }; -#if TOKU_INCLUDE_OPTION_STRUCTS -struct ha_table_option_struct { - uint row_format; -}; - -struct ha_index_option_struct { - bool clustering; -}; - -static inline bool key_is_clustering(const KEY *key) { - return (key->flags & HA_CLUSTERING) || (key->option_struct && key->option_struct->clustering); -} - -#else - -static inline bool key_is_clustering(const KEY *key) { - return key->flags & HA_CLUSTERING; -} -#endif - -#endif +#endif // _HA_TOKUDB_H diff --git a/storage/tokudb/ha_tokudb_admin.cc b/storage/tokudb/ha_tokudb_admin.cc index 996ce49d85f..db3d6c112d4 100644 --- a/storage/tokudb/ha_tokudb_admin.cc +++ b/storage/tokudb/ha_tokudb_admin.cc @@ -23,132 +23,801 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." +#include "tokudb_sysvars.h" #include "toku_time.h" -struct analyze_progress_extra { - THD *thd; - TOKUDB_SHARE *share; - TABLE_SHARE *table_share; - uint key_i; - const char *key_name; - time_t t_start; - char *write_status_msg; +namespace tokudb { +namespace analyze { + +class recount_rows_t : public tokudb::background::job_manager_t::job_t { +public: + void* operator new(size_t sz); + void operator delete(void* p); + + recount_rows_t( + bool user_schedued, + THD* thd, + TOKUDB_SHARE* share, + DB_TXN* txn); + + virtual ~recount_rows_t(); + + virtual const char* key(); + + virtual void status( + char* database, + char* table, + char* type, + char* params, + char* status); + +protected: + virtual void on_run(); + + virtual void on_destroy(); + +private: + // to be provided by the initiator of recount rows + THD* _thd; + TOKUDB_SHARE* _share; + DB_TXN* _txn; + ulonglong _throttle; + + // for recount rows status reporting + int _result; + ulonglong _recount_start; // in microseconds + ulonglong _total_elapsed_time; // in microseconds + + bool _local_txn; + ulonglong _rows; + ulonglong _deleted_rows; + ulonglong _ticks; + + static int analyze_recount_rows_progress( + uint64_t count, + uint64_t deleted, + void* extra); + int analyze_recount_rows_progress(uint64_t count, uint64_t deleted); + void get_analyze_status(char*); }; -static int analyze_progress(void *v_extra, uint64_t rows) { - struct analyze_progress_extra *extra = (struct analyze_progress_extra *) v_extra; - THD *thd = extra->thd; - if (thd_killed(thd)) - return ER_ABORTING_CONNECTION; +void* recount_rows_t::operator new(size_t sz) { + return tokudb::memory::malloc(sz, MYF(MY_WME|MY_ZEROFILL|MY_FAE)); +} +void recount_rows_t::operator delete(void* p) { + tokudb::memory::free(p); +} +recount_rows_t::recount_rows_t( + bool user_scheduled, + THD* thd, + TOKUDB_SHARE* share, + DB_TXN* txn) : + tokudb::background::job_manager_t::job_t(user_scheduled), + _share(share), + _result(HA_ADMIN_OK), + _recount_start(0), + _total_elapsed_time(0), + _local_txn(false), + _rows(0), + _deleted_rows(0), + _ticks(0) { - time_t t_now = time(0); - time_t t_limit = THDVAR(thd, analyze_time); - time_t t_start = extra->t_start; - if (t_limit > 0 && t_now - t_start > t_limit) - return ETIME; - float progress_rows = 0.0; - TOKUDB_SHARE *share = extra->share; - if (share->rows > 0) - progress_rows = (float) rows / (float) share->rows; - float progress_time = 0.0; - if (t_limit > 0) - progress_time = (float) (t_now - t_start) / (float) t_limit; - char *write_status_msg = extra->write_status_msg; - TABLE_SHARE *table_share = extra->table_share; - sprintf(write_status_msg, "%.*s.%.*s.%s %u of %u %.lf%% rows %.lf%% time", - (int) table_share->db.length, table_share->db.str, - (int) table_share->table_name.length, table_share->table_name.str, - extra->key_name, extra->key_i, table_share->keys, progress_rows * 100.0, progress_time * 100.0); - thd_proc_info(thd, write_status_msg); + assert_debug(thd != NULL); + assert_debug(share != NULL); + + if (tokudb::sysvars::analyze_in_background(thd)) { + _thd = NULL; + _txn = NULL; + } else { + _thd = thd; + _txn = txn; + } + + _throttle = tokudb::sysvars::analyze_throttle(thd); +} +recount_rows_t::~recount_rows_t() { +} +void recount_rows_t::on_run() { + _recount_start = tokudb::time::microsec(); + _total_elapsed_time = 0; + + if (_txn == NULL) { + _result = db_env->txn_begin(db_env, NULL, &_txn, DB_READ_UNCOMMITTED); + + if (_result != 0) { + _txn = NULL; + _result = HA_ADMIN_FAILED; + goto error; + } + _local_txn = true; + } else { + _local_txn = false; + } + + _result = + _share->file->recount_rows( + _share->file, + analyze_recount_rows_progress, + this); + + if (_result != 0) { + if (_local_txn) { + _txn->abort(_txn); + _txn = NULL; + } + _result = HA_ADMIN_FAILED; + goto error; + } + + DB_BTREE_STAT64 dict_stats; + _result = _share->file->stat64(_share->file, _txn, &dict_stats); + if (_result == 0) { + _share->set_row_count(dict_stats.bt_ndata, false); + } + if (_result != 0) + _result = HA_ADMIN_FAILED; + + if (_local_txn) { + if (_result == HA_ADMIN_OK) { + _txn->commit(_txn, 0); + } else { + _txn->abort(_txn); + } + _txn = NULL; + } + + sql_print_information( + "tokudb analyze recount rows %d counted %lld", + _result, + _share->row_count()); +error: + return; +} +void recount_rows_t::on_destroy() { + _share->release(); +} +const char* recount_rows_t::key() { + return _share->full_table_name(); +} +void recount_rows_t::status( + char* database, + char* table, + char* type, + char* params, + char* status) { + + strcpy(database, _share->database_name()); + strcpy(table, _share->table_name()); + strcpy(type, "TOKUDB_ANALYZE_MODE_RECOUNT_ROWS"); + sprintf(params, "TOKUDB_ANALYZE_THROTTLE=%llu;", _throttle); + get_analyze_status(status); +} +int recount_rows_t::analyze_recount_rows_progress( + uint64_t count, + uint64_t deleted, + void* extra) { + + recount_rows_t* context = (recount_rows_t*)extra; + return context->analyze_recount_rows_progress(count, deleted); +} +int recount_rows_t::analyze_recount_rows_progress( + uint64_t count, + uint64_t deleted) { + + _rows = count; + _deleted_rows += deleted; + deleted > 0 ? _ticks += deleted : _ticks++; + + if (_ticks > 1000) { + _ticks = 0; + uint64_t now = tokudb::time::microsec(); + _total_elapsed_time = now - _recount_start; + if ((_thd && thd_killed(_thd)) || cancelled()) { + // client killed + return ER_ABORTING_CONNECTION; + } + + // report + if (_thd) { + char status[256]; + get_analyze_status(status); + thd_proc_info(_thd, status); + } + + // throttle + // given the throttle value, lets calculate the maximum number of rows + // we should have seen so far in a .1 sec resolution + if (_throttle > 0) { + uint64_t estimated_rows = _total_elapsed_time / 100000; + estimated_rows = estimated_rows * (_throttle / 10); + if (_rows + _deleted_rows > estimated_rows) { + // sleep for 1/10 of a second + tokudb::time::sleep_microsec(100000); + } + } + } return 0; } +void recount_rows_t::get_analyze_status(char* msg) { + sprintf( + msg, + "recount_rows %s.%s counted %llu rows and %llu deleted in %llu " + "seconds.", + _share->database_name(), + _share->table_name(), + _rows, + _deleted_rows, + _total_elapsed_time / tokudb::time::MICROSECONDS); +} + + +class standard_t : public tokudb::background::job_manager_t::job_t { +public: + void* operator new(size_t sz); + void operator delete(void* p); + + standard_t(bool user_scheduled, THD* thd, TOKUDB_SHARE* share, DB_TXN* txn); + + virtual ~standard_t(); + + virtual const char* key(void); + + virtual void status( + char* database, + char* table, + char* type, + char* params, + char* status); + +protected: + virtual void on_run(); + + virtual void on_destroy(); + +private: + // to be provided by initiator of analyze + THD* _thd; + TOKUDB_SHARE* _share; + DB_TXN* _txn; + ulonglong _throttle; // in microseconds + ulonglong _time_limit; // in microseconds + double _delete_fraction; + + // for analyze status reporting, may also use other state + int _result; + ulonglong _analyze_start; // in microseconds + ulonglong _total_elapsed_time; // in microseconds + + // for analyze internal use, pretty much these are per-key/index + ulonglong _current_key; + bool _local_txn; + ulonglong _half_time; + ulonglong _half_rows; + ulonglong _rows; + ulonglong _deleted_rows; + ulonglong _ticks; + ulonglong _analyze_key_start; // in microseconds + ulonglong _key_elapsed_time; // in microseconds + uint _scan_direction; + + static bool analyze_standard_cursor_callback( + void* extra, + uint64_t deleted_rows); + bool analyze_standard_cursor_callback(uint64_t deleted_rows); + + void get_analyze_status(char*); + int analyze_key_progress(); + int analyze_key(uint64_t* rec_per_key_part); +}; + +void* standard_t::operator new(size_t sz) { + return tokudb::memory::malloc(sz, MYF(MY_WME|MY_ZEROFILL|MY_FAE)); +} +void standard_t::operator delete(void* p) { + tokudb::memory::free(p); +} +standard_t::standard_t( + bool user_scheduled, + THD* thd, + TOKUDB_SHARE* share, + DB_TXN* txn) : + tokudb::background::job_manager_t::job_t(user_scheduled), + _share(share), + _result(HA_ADMIN_OK), + _analyze_start(0), + _total_elapsed_time(0), + _current_key(0), + _local_txn(false), + _half_time(0), + _half_rows(0), + _rows(0), + _deleted_rows(0), + _ticks(0), + _analyze_key_start(0), + _key_elapsed_time(0), + _scan_direction(0) { + + assert_debug(thd != NULL); + assert_debug(share != NULL); + + if (tokudb::sysvars::analyze_in_background(thd)) { + _thd = NULL; + _txn = NULL; + } else { + _thd = thd; + _txn = txn; + } + _throttle = tokudb::sysvars::analyze_throttle(thd); + _time_limit = + tokudb::sysvars::analyze_time(thd) * tokudb::time::MICROSECONDS; + _delete_fraction = tokudb::sysvars::analyze_delete_fraction(thd); +} +standard_t::~standard_t() { +} +void standard_t::on_run() { + DB_BTREE_STAT64 stat64; + uint64_t rec_per_key_part[_share->_max_key_parts]; + uint64_t total_key_parts = 0; + _analyze_start = tokudb::time::microsec(); + _half_time = _time_limit > 0 ? _time_limit/2 : 0; + + if (_txn == NULL) { + _result = db_env->txn_begin(db_env, NULL, &_txn, DB_READ_UNCOMMITTED); + + if (_result != 0) { + _txn = NULL; + _result = HA_ADMIN_FAILED; + goto error; + } + _local_txn = true; + } else { + _local_txn = false; + } + + assert_always(_share->key_file[0] != NULL); + _result = _share->key_file[0]->stat64(_share->key_file[0], _txn, &stat64); + if (_result != 0) { + _result = HA_ADMIN_FAILED; + goto cleanup; + } + _half_rows = stat64.bt_ndata / 2; + + for (ulonglong current_key = 0; + _result == HA_ADMIN_OK && current_key < _share->_keys; + current_key++) { + + _current_key = current_key; + _rows = _deleted_rows = _ticks = 0; + _result = analyze_key(&rec_per_key_part[total_key_parts]); + + if ((_result != 0 && _result != ETIME) || + (_result != 0 && _rows == 0 && _deleted_rows > 0)) { + _result = HA_ADMIN_FAILED; + } + if (_thd && (_result == HA_ADMIN_FAILED || + (double)_deleted_rows > + _delete_fraction * (_rows + _deleted_rows))) { + + char name[256]; int namelen; + namelen = + snprintf( + name, + sizeof(name), + "%s.%s.%s", + _share->database_name(), + _share->table_name(), + _share->_key_descriptors[_current_key]._name); + _thd->protocol->prepare_for_resend(); + _thd->protocol->store(name, namelen, system_charset_info); + _thd->protocol->store("analyze", 7, system_charset_info); + _thd->protocol->store("info", 4, system_charset_info); + char rowmsg[256]; + int rowmsglen; + rowmsglen = + snprintf( + rowmsg, + sizeof(rowmsg), + "rows processed %llu rows deleted %llu", + _rows, + _deleted_rows); + _thd->protocol->store(rowmsg, rowmsglen, system_charset_info); + _thd->protocol->write(); + + sql_print_information( + "tokudb analyze on %.*s %.*s", + namelen, + name, + rowmsglen, + rowmsg); + } + + total_key_parts += _share->_key_descriptors[_current_key]._parts; + } + if (_result == HA_ADMIN_OK) { + int error = + tokudb::set_card_in_status( + _share->status_block, + _txn, + total_key_parts, + rec_per_key_part); + if (error) + _result = HA_ADMIN_FAILED; + + _share->lock(); + _share->update_cardinality_counts(total_key_parts, rec_per_key_part); + _share->allow_auto_analysis(true); + _share->unlock(); + } + +cleanup: + if (_local_txn) { + if (_result == HA_ADMIN_OK) { + _txn->commit(_txn, 0); + } else { + _txn->abort(_txn); + } + _txn = NULL; + } + +error: + return; + +} +void standard_t::on_destroy() { + _share->lock(); + _share->allow_auto_analysis(false); + _share->unlock(); + _share->release(); +} +const char* standard_t::key() { + return _share->full_table_name(); +} +void standard_t::status( + char* database, + char* table, + char* type, + char* params, + char* status) { + + strcpy(database, _share->database_name()); + strcpy(table, _share->table_name()); + strcpy(type, "TOKUDB_ANALYZE_MODE_STANDARD"); + sprintf( + params, + "TOKUDB_ANALYZE_DELETE_FRACTION=%f; " + "TOKUDB_ANALYZE_TIME=%llu; TOKUDB_ANALYZE_THROTTLE=%llu;", + _delete_fraction, + _time_limit / tokudb::time::MICROSECONDS, + _throttle); + get_analyze_status(status); +} +bool standard_t::analyze_standard_cursor_callback( + void* extra, + uint64_t deleted_rows) { + standard_t* context = (standard_t*)extra; + return context->analyze_standard_cursor_callback(deleted_rows); +} +bool standard_t::analyze_standard_cursor_callback(uint64_t deleted_rows) { + _deleted_rows += deleted_rows; + _ticks += deleted_rows; + return analyze_key_progress() != 0; +} +void standard_t::get_analyze_status(char* msg) { + static const char* scan_direction_str[] = { + "not scanning", + "scanning forward", + "scanning backward", + "scan unknown" + }; + + const char* scan_direction = NULL; + switch (_scan_direction) { + case 0: scan_direction = scan_direction_str[0]; break; + case DB_NEXT: scan_direction = scan_direction_str[1]; break; + case DB_PREV: scan_direction = scan_direction_str[2]; break; + default: scan_direction = scan_direction_str[3]; break; + } + + float progress_rows = 0.0; + if (_share->row_count() > 0) + progress_rows = (float) _rows / (float) _share->row_count(); + float progress_time = 0.0; + if (_time_limit > 0) + progress_time = (float) _key_elapsed_time / (float) _time_limit; + sprintf( + msg, + "analyze table standard %s.%s.%s %llu of %u %.lf%% rows %.lf%% time, " + "%s", + _share->database_name(), + _share->table_name(), + _share->_key_descriptors[_current_key]._name, + _current_key, + _share->_keys, + progress_rows * 100.0, + progress_time * 100.0, + scan_direction); +} +int standard_t::analyze_key_progress(void) { + if (_ticks > 1000) { + _ticks = 0; + uint64_t now = tokudb::time::microsec(); + _total_elapsed_time = now - _analyze_start; + _key_elapsed_time = now - _analyze_key_start; + if ((_thd && thd_killed(_thd)) || cancelled()) { + // client killed + return ER_ABORTING_CONNECTION; + } else if(_time_limit > 0 && + (uint64_t)_key_elapsed_time > _time_limit) { + // time limit reached + return ETIME; + } + + // report + if (_thd) { + char status[256]; + get_analyze_status(status); + thd_proc_info(_thd, status); + } + + // throttle + // given the throttle value, lets calculate the maximum number of rows + // we should have seen so far in a .1 sec resolution + if (_throttle > 0) { + uint64_t estimated_rows = _key_elapsed_time / 100000; + estimated_rows = estimated_rows * (_throttle / 10); + if (_rows + _deleted_rows > estimated_rows) { + // sleep for 1/10 of a second + tokudb::time::sleep_microsec(100000); + } + } + } + return 0; +} +int standard_t::analyze_key(uint64_t* rec_per_key_part) { + int error = 0; + DB* db = _share->key_file[_current_key]; + assert_always(db != NULL); + uint64_t num_key_parts = _share->_key_descriptors[_current_key]._parts; + uint64_t unique_rows[num_key_parts]; + bool is_unique = _share->_key_descriptors[_current_key]._is_unique; + DBC* cursor = NULL; + int close_error = 0; + DBT key, prev_key; + bool copy_key = false; + + _analyze_key_start = tokudb::time::microsec(); + _key_elapsed_time = 0; + _scan_direction = DB_NEXT; + + if (is_unique && num_key_parts == 1) { + // don't compute for unique keys with a single part. we already know + // the answer. + _rows = unique_rows[0] = 1; + goto done; + } + + for (uint64_t i = 0; i < num_key_parts; i++) + unique_rows[i] = 1; + + // stop looking when the entire dictionary was analyzed, or a + // cap on execution time was reached, or the analyze was killed. + while (1) { + if (cursor == NULL) { + error = db->cursor(db, _txn, &cursor, 0); + if (error != 0) + goto done; + + cursor->c_set_check_interrupt_callback( + cursor, + analyze_standard_cursor_callback, + this); + + memset(&key, 0, sizeof(DBT)); + memset(&prev_key, 0, sizeof(DBT)); + copy_key = true; + } + + error = cursor->c_get(cursor, &key, 0, _scan_direction); + if (error != 0) { + if (error == DB_NOTFOUND || error == TOKUDB_INTERRUPTED) + error = 0; // not an error + break; + } else if (cancelled()) { + error = ER_ABORTING_CONNECTION; + break; + } + + _rows++; + _ticks++; + + // if copy_key is false at this pont, we have some value sitting in + // prev_key that we can compare to + // if the comparison reveals a unique key, we must set copy_key to true + // so the code following can copy he current key into prev_key for the + // next iteration + if (copy_key == false) { + // compare this key with the previous key. ignore + // appended PK for SK's. + // TODO if a prefix is different, then all larger keys + // that include the prefix are also different. + // TODO if we are comparing the entire primary key or + // the entire unique secondary key, then the cardinality + // must be 1, so we can avoid computing it. + for (uint64_t i = 0; i < num_key_parts; i++) { + int cmp = tokudb_cmp_dbt_key_parts(db, &prev_key, &key, i+1); + if (cmp != 0) { + unique_rows[i]++; + copy_key = true; + } + } + } + + // prev_key = key or prev_key is NULL + if (copy_key) { + prev_key.data = + tokudb::memory::realloc( + prev_key.data, + key.size, + MYF(MY_WME|MY_ZEROFILL|MY_FAE)); + assert_always(prev_key.data); + prev_key.size = key.size; + memcpy(prev_key.data, key.data, prev_key.size); + copy_key = false; + } + + error = analyze_key_progress(); + if (error == ETIME) { + error = 0; + break; + } else if (error) { + break; + } + + // if we have a time limit, are scanning forward and have exceed the + // _half_time and not passed the _half_rows number of the rows in the + // index: clean up the keys, close the cursor and reverse direction. + if (TOKUDB_UNLIKELY(_half_time > 0 && + _scan_direction == DB_NEXT && + _key_elapsed_time >= _half_time && + _rows < _half_rows)) { + + tokudb::memory::free(prev_key.data); prev_key.data = NULL; + close_error = cursor->c_close(cursor); + assert_always(close_error == 0); + cursor = NULL; + _scan_direction = DB_PREV; + } + } + // cleanup + if (prev_key.data) tokudb::memory::free(prev_key.data); + if (cursor) close_error = cursor->c_close(cursor); + assert_always(close_error == 0); + +done: + // return cardinality + for (uint64_t i = 0; i < num_key_parts; i++) { + rec_per_key_part[i] = _rows / unique_rows[i]; + } + return error; +} + +} // namespace analyze +} // namespace tokudb + int ha_tokudb::analyze(THD *thd, HA_CHECK_OPT *check_opt) { - TOKUDB_HANDLER_DBUG_ENTER("%s", share->table_name); - const char *orig_proc_info = tokudb_thd_get_proc_info(thd); - uint64_t rec_per_key[table_share->key_parts]; + TOKUDB_HANDLER_DBUG_ENTER("%s", share->table_name()); int result = HA_ADMIN_OK; + tokudb::sysvars::analyze_mode_t mode = tokudb::sysvars::analyze_mode(thd); - // stub out analyze if optimize is remapped to alter recreate + analyze - if (thd_sql_command(thd) != SQLCOM_ANALYZE && thd_sql_command(thd) != SQLCOM_ALTER_TABLE) { - TOKUDB_HANDLER_DBUG_RETURN(result); + switch (mode) { + case tokudb::sysvars::TOKUDB_ANALYZE_RECOUNT_ROWS: + result = share->analyze_recount_rows(thd, transaction); + break; + case tokudb::sysvars::TOKUDB_ANALYZE_STANDARD: + share->lock(); + result = share->analyze_standard(thd, transaction); + share->unlock(); + break; + case tokudb::sysvars::TOKUDB_ANALYZE_CANCEL: + share->cancel_background_jobs(); + break; + default: + break; // no-op } - - DB_TXN *txn = transaction; - if (!txn) { - result = HA_ADMIN_FAILED; - } - uint total_key_parts = 0; - if (result == HA_ADMIN_OK) { - // compute cardinality for each key - for (uint i = 0; result == HA_ADMIN_OK && i < table_share->keys; i++) { - KEY *key_info = &table_share->key_info[i]; - uint64_t num_key_parts = get_key_parts(key_info); - const char *key_name = i == primary_key ? "primary" : key_info->name; - struct analyze_progress_extra analyze_progress_extra = { - thd, share, table_share, i, key_name, time(0), write_status_msg - }; - bool is_unique = false; - if (i == primary_key || (key_info->flags & HA_NOSAME)) - is_unique = true; - uint64_t rows = 0; - uint64_t deleted_rows = 0; - int error = tokudb::analyze_card(share->key_file[i], txn, is_unique, num_key_parts, &rec_per_key[total_key_parts], - tokudb_cmp_dbt_key_parts, analyze_progress, &analyze_progress_extra, - &rows, &deleted_rows); - sql_print_information("tokudb analyze %d %" PRIu64 " %" PRIu64, error, rows, deleted_rows); - if (error != 0 && error != ETIME) { - result = HA_ADMIN_FAILED; - } - if (error != 0 && rows == 0 && deleted_rows > 0) { - result = HA_ADMIN_FAILED; - } - double f = THDVAR(thd, analyze_delete_fraction); - if (result == HA_ADMIN_FAILED || (double) deleted_rows > f * (rows + deleted_rows)) { - char name[256]; int namelen; - namelen = snprintf(name, sizeof name, "%.*s.%.*s.%s", - (int) table_share->db.length, table_share->db.str, - (int) table_share->table_name.length, table_share->table_name.str, - key_name); - thd->protocol->prepare_for_resend(); - thd->protocol->store(name, namelen, system_charset_info); - thd->protocol->store("analyze", 7, system_charset_info); - thd->protocol->store("info", 4, system_charset_info); - char rowmsg[256]; int rowmsglen; - rowmsglen = snprintf(rowmsg, sizeof rowmsg, "rows processed %" PRIu64 " rows deleted %" PRIu64, rows, deleted_rows); - thd->protocol->store(rowmsg, rowmsglen, system_charset_info); - thd->protocol->write(); - - sql_print_information("tokudb analyze on %.*s %.*s", - namelen, name, rowmsglen, rowmsg); - } - if (tokudb_debug & TOKUDB_DEBUG_ANALYZE) { - char name[256]; int namelen; - namelen = snprintf(name, sizeof name, "%.*s.%.*s.%s", - (int) table_share->db.length, table_share->db.str, - (int) table_share->table_name.length, table_share->table_name.str, - key_name); - TOKUDB_HANDLER_TRACE("%.*s rows %" PRIu64 " deleted %" PRIu64, - namelen, name, rows, deleted_rows); - for (uint j = 0; j < num_key_parts; j++) - TOKUDB_HANDLER_TRACE("%lu", rec_per_key[total_key_parts+j]); - } - total_key_parts += num_key_parts; - } - } - if (result == HA_ADMIN_OK) { - int error = tokudb::set_card_in_status(share->status_block, txn, total_key_parts, rec_per_key); - if (error) - result = HA_ADMIN_FAILED; - } - thd_proc_info(thd, orig_proc_info); TOKUDB_HANDLER_DBUG_RETURN(result); } +int TOKUDB_SHARE::analyze_recount_rows(THD* thd,DB_TXN* txn) { + TOKUDB_HANDLER_DBUG_ENTER("%s", table_name()); + + assert_always(thd != NULL); + + const char *orig_proc_info = tokudb_thd_get_proc_info(thd); + int result = HA_ADMIN_OK; + + tokudb::analyze::recount_rows_t* job + = new tokudb::analyze::recount_rows_t(true, thd, this, txn); + assert_always(job != NULL); + + // job->destroy will drop the ref + addref(); + unlock(); + + bool ret = tokudb::background::_job_manager-> + run_job(job, tokudb::sysvars::analyze_in_background(thd)); + + if (!ret) { + job->destroy(); + delete job; + result = HA_ADMIN_FAILED; + } + + thd_proc_info(thd, orig_proc_info); + + TOKUDB_HANDLER_DBUG_RETURN(result); +} + +// on entry, if txn is !NULL, it is a user session invoking ANALYZE directly +// and no lock will be held on 'this', else if txn is NULL it is an auto and +// 'this' will be locked. +int TOKUDB_SHARE::analyze_standard(THD* thd, DB_TXN* txn) { + TOKUDB_HANDLER_DBUG_ENTER("%s", table_name()); + + assert_always(thd != NULL); + assert_debug(_mutex.is_owned_by_me() == true); + + int result = HA_ADMIN_OK; + + // stub out analyze if optimize is remapped to alter recreate + analyze + // when not auto analyze or if this is an alter + if ((txn && + thd_sql_command(thd) != SQLCOM_ANALYZE && + thd_sql_command(thd) != SQLCOM_ALTER_TABLE) || + thd_sql_command(thd) == SQLCOM_ALTER_TABLE) { + TOKUDB_HANDLER_DBUG_RETURN(result); + } + + const char *orig_proc_info = tokudb_thd_get_proc_info(thd); + + tokudb::analyze::standard_t* job + = new tokudb::analyze::standard_t(txn == NULL ? false : true, thd, + this, txn); + assert_always(job != NULL); + + // akin to calling addref, but we know, right here, right now, everything + // in the share is set up, files open, etc... + // job->destroy will drop the ref + _use_count++; + + // don't want any autos kicking off while we are analyzing + disallow_auto_analysis(); + + unlock(); + + bool ret = + tokudb::background::_job_manager->run_job( + job, + tokudb::sysvars::analyze_in_background(thd)); + + if (!ret) { + job->destroy(); + delete job; + result = HA_ADMIN_FAILED; + } + + lock(); + + thd_proc_info(thd, orig_proc_info); + + TOKUDB_HANDLER_DBUG_RETURN(result); +} + + typedef struct hot_optimize_context { - THD *thd; + THD* thd; char* write_status_msg; - ha_tokudb *ha; + ha_tokudb* ha; uint progress_stage; uint current_table; uint num_tables; @@ -160,11 +829,18 @@ typedef struct hot_optimize_context { static int hot_optimize_progress_fun(void *extra, float progress) { HOT_OPTIMIZE_CONTEXT context = (HOT_OPTIMIZE_CONTEXT)extra; if (thd_killed(context->thd)) { - sprintf(context->write_status_msg, "The process has been killed, aborting hot optimize."); + sprintf( + context->write_status_msg, + "The process has been killed, aborting hot optimize."); return ER_ABORTING_CONNECTION; } float percentage = progress * 100; - sprintf(context->write_status_msg, "Optimization of index %u of %u about %.lf%% done", context->current_table + 1, context->num_tables, percentage); + sprintf( + context->write_status_msg, + "Optimization of index %u of %u about %.lf%% done", + context->current_table + 1, + context->num_tables, + percentage); thd_proc_info(context->thd, context->write_status_msg); #ifdef HA_TOKUDB_HAS_THD_PROGRESS if (context->progress_stage < context->current_table) { @@ -193,10 +869,10 @@ static int hot_optimize_progress_fun(void *extra, float progress) { } // flatten all DB's in this table, to do so, peform hot optimize on each db -int ha_tokudb::do_optimize(THD *thd) { - TOKUDB_HANDLER_DBUG_ENTER("%s", share->table_name); +int ha_tokudb::do_optimize(THD* thd) { + TOKUDB_HANDLER_DBUG_ENTER("%s", share->table_name()); int error = 0; - const char *orig_proc_info = tokudb_thd_get_proc_info(thd); + const char* orig_proc_info = tokudb_thd_get_proc_info(thd); uint curr_num_DBs = table->s->keys + tokudb_test(hidden_primary_key); #ifdef HA_TOKUDB_HAS_THD_PROGRESS @@ -207,16 +883,22 @@ int ha_tokudb::do_optimize(THD *thd) { // for each DB, run optimize and hot_optimize for (uint i = 0; i < curr_num_DBs; i++) { - // only optimize the index if it matches the optimize_index_name session variable - const char *optimize_index_name = THDVAR(thd, optimize_index_name); + // only optimize the index if it matches the optimize_index_name + // session variable + const char* optimize_index_name = + tokudb::sysvars::optimize_index_name(thd); if (optimize_index_name) { - const char *this_index_name = i >= table_share->keys ? "primary" : table_share->key_info[i].name; + const char* this_index_name = + i >= table_share->keys ? + "primary" : + table_share->key_info[i].name; if (strcasecmp(optimize_index_name, this_index_name) != 0) { continue; } } DB* db = share->key_file[i]; + assert_always(db != NULL); error = db->optimize(db); if (error) { goto cleanup; @@ -229,11 +911,18 @@ int ha_tokudb::do_optimize(THD *thd) { hc.ha = this; hc.current_table = i; hc.num_tables = curr_num_DBs; - hc.progress_limit = THDVAR(thd, optimize_index_fraction); + hc.progress_limit = tokudb::sysvars::optimize_index_fraction(thd); hc.progress_last_time = toku_current_time_microsec(); - hc.throttle = THDVAR(thd, optimize_throttle); + hc.throttle = tokudb::sysvars::optimize_throttle(thd); uint64_t loops_run; - error = db->hot_optimize(db, NULL, NULL, hot_optimize_progress_fun, &hc, &loops_run); + error = + db->hot_optimize( + db, + NULL, + NULL, + hot_optimize_progress_fun, + &hc, + &loops_run); if (error) { goto cleanup; } @@ -248,8 +937,8 @@ cleanup: TOKUDB_HANDLER_DBUG_RETURN(error); } -int ha_tokudb::optimize(THD *thd, HA_CHECK_OPT *check_opt) { - TOKUDB_HANDLER_DBUG_ENTER("%s", share->table_name); +int ha_tokudb::optimize(THD* thd, HA_CHECK_OPT* check_opt) { + TOKUDB_HANDLER_DBUG_ENTER("%s", share->table_name()); int error; #if TOKU_OPTIMIZE_WITH_RECREATE error = HA_ADMIN_TRY_ALTER; @@ -260,23 +949,30 @@ int ha_tokudb::optimize(THD *thd, HA_CHECK_OPT *check_opt) { } struct check_context { - THD *thd; + THD* thd; }; -static int ha_tokudb_check_progress(void *extra, float progress) { - struct check_context *context = (struct check_context *) extra; +static int ha_tokudb_check_progress(void* extra, float progress) { + struct check_context* context = (struct check_context*)extra; int result = 0; if (thd_killed(context->thd)) result = ER_ABORTING_CONNECTION; return result; } -static void ha_tokudb_check_info(THD *thd, TABLE *table, const char *msg) { +static void ha_tokudb_check_info(THD* thd, TABLE* table, const char* msg) { if (thd->vio_ok()) { - char tablename[table->s->db.length + 1 + table->s->table_name.length + 1]; - snprintf(tablename, sizeof tablename, "%.*s.%.*s", - (int) table->s->db.length, table->s->db.str, - (int) table->s->table_name.length, table->s->table_name.str); + char tablename[ + table->s->db.length + 1 + + table->s->table_name.length + 1]; + snprintf( + tablename, + sizeof(tablename), + "%.*s.%.*s", + (int)table->s->db.length, + table->s->db.str, + (int)table->s->table_name.length, + table->s->table_name.str); thd->protocol->prepare_for_resend(); thd->protocol->store(tablename, strlen(tablename), system_charset_info); thd->protocol->store("check", 5, system_charset_info); @@ -286,9 +982,9 @@ static void ha_tokudb_check_info(THD *thd, TABLE *table, const char *msg) { } } -int ha_tokudb::check(THD *thd, HA_CHECK_OPT *check_opt) { - TOKUDB_HANDLER_DBUG_ENTER("%s", share->table_name); - const char *orig_proc_info = tokudb_thd_get_proc_info(thd); +int ha_tokudb::check(THD* thd, HA_CHECK_OPT* check_opt) { + TOKUDB_HANDLER_DBUG_ENTER("%s", share->table_name()); + const char* orig_proc_info = tokudb_thd_get_proc_info(thd); int result = HA_ADMIN_OK; int r; @@ -305,38 +1001,73 @@ int ha_tokudb::check(THD *thd, HA_CHECK_OPT *check_opt) { result = HA_ADMIN_INTERNAL_ERROR; if (result == HA_ADMIN_OK) { uint32_t num_DBs = table_share->keys + tokudb_test(hidden_primary_key); - snprintf(write_status_msg, sizeof write_status_msg, "%s primary=%d num=%d", share->table_name, primary_key, num_DBs); - if (tokudb_debug & TOKUDB_DEBUG_CHECK) { + snprintf( + write_status_msg, + sizeof(write_status_msg), + "%s primary=%d num=%d", + share->table_name(), + primary_key, + num_DBs); + if (TOKUDB_UNLIKELY(TOKUDB_DEBUG_FLAGS(TOKUDB_DEBUG_CHECK))) { ha_tokudb_check_info(thd, table, write_status_msg); time_t now = time(0); char timebuf[32]; - TOKUDB_HANDLER_TRACE("%.24s %s", ctime_r(&now, timebuf), write_status_msg); + TOKUDB_HANDLER_TRACE( + "%.24s %s", + ctime_r(&now, timebuf), + write_status_msg); } for (uint i = 0; i < num_DBs; i++) { - DB *db = share->key_file[i]; - const char *kname = i == primary_key ? "primary" : table_share->key_info[i].name; - snprintf(write_status_msg, sizeof write_status_msg, "%s key=%s %u", share->table_name, kname, i); + DB* db = share->key_file[i]; + assert_always(db != NULL); + const char* kname = + i == primary_key ? "primary" : table_share->key_info[i].name; + snprintf( + write_status_msg, + sizeof(write_status_msg), + "%s key=%s %u", + share->table_name(), + kname, + i); thd_proc_info(thd, write_status_msg); - if (tokudb_debug & TOKUDB_DEBUG_CHECK) { + if (TOKUDB_UNLIKELY(TOKUDB_DEBUG_FLAGS(TOKUDB_DEBUG_CHECK))) { ha_tokudb_check_info(thd, table, write_status_msg); time_t now = time(0); char timebuf[32]; - TOKUDB_HANDLER_TRACE("%.24s %s", ctime_r(&now, timebuf), write_status_msg); + TOKUDB_HANDLER_TRACE( + "%.24s %s", + ctime_r(&now, timebuf), + write_status_msg); } struct check_context check_context = { thd }; - r = db->verify_with_progress(db, ha_tokudb_check_progress, &check_context, (tokudb_debug & TOKUDB_DEBUG_CHECK) != 0, keep_going); + r = db->verify_with_progress( + db, + ha_tokudb_check_progress, + &check_context, + (tokudb::sysvars::debug & TOKUDB_DEBUG_CHECK) != 0, + keep_going); if (r != 0) { char msg[32 + strlen(kname)]; sprintf(msg, "Corrupt %s", kname); ha_tokudb_check_info(thd, table, msg); } - snprintf(write_status_msg, sizeof write_status_msg, "%s key=%s %u result=%d", share->table_name, kname, i, r); + snprintf( + write_status_msg, + sizeof(write_status_msg), + "%s key=%s %u result=%d", + share->full_table_name(), + kname, + i, + r); thd_proc_info(thd, write_status_msg); - if (tokudb_debug & TOKUDB_DEBUG_CHECK) { + if (TOKUDB_UNLIKELY(TOKUDB_DEBUG_FLAGS(TOKUDB_DEBUG_CHECK))) { ha_tokudb_check_info(thd, table, write_status_msg); time_t now = time(0); char timebuf[32]; - TOKUDB_HANDLER_TRACE("%.24s %s", ctime_r(&now, timebuf), write_status_msg); + TOKUDB_HANDLER_TRACE( + "%.24s %s", + ctime_r(&now, timebuf), + write_status_msg); } if (result == HA_ADMIN_OK && r != 0) { result = HA_ADMIN_CORRUPT; diff --git a/storage/tokudb/ha_tokudb_alter_56.cc b/storage/tokudb/ha_tokudb_alter_56.cc index 9cf1affe0c5..00a4602b554 100644 --- a/storage/tokudb/ha_tokudb_alter_56.cc +++ b/storage/tokudb/ha_tokudb_alter_56.cc @@ -67,7 +67,7 @@ public: } public: ulong handler_flags; - DB_TXN *alter_txn; + DB_TXN* alter_txn; bool add_index_changed; bool incremented_num_DBs, modified_DBs; bool drop_index_changed; @@ -79,81 +79,110 @@ public: bool expand_blob_update_needed; bool optimize_needed; Dynamic_array changed_fields; - KEY_AND_COL_INFO *table_kc_info; - KEY_AND_COL_INFO *altered_table_kc_info; + KEY_AND_COL_INFO* table_kc_info; + KEY_AND_COL_INFO* altered_table_kc_info; KEY_AND_COL_INFO altered_table_kc_info_base; }; // Debug function to print out an alter table operation -void ha_tokudb::print_alter_info(TABLE *altered_table, Alter_inplace_info *ha_alter_info) { - printf("***are keys of two tables same? %d\n", tables_have_same_keys(table, altered_table, false, false)); +void ha_tokudb::print_alter_info( + TABLE* altered_table, + Alter_inplace_info* ha_alter_info) { + + TOKUDB_TRACE( + "***are keys of two tables same? %d", + tables_have_same_keys(table, altered_table, false, false)); if (ha_alter_info->handler_flags) { - printf("***alter flags set ***\n"); + TOKUDB_TRACE("***alter flags set ***"); for (int i = 0; i < 32; i++) { if (ha_alter_info->handler_flags & (1 << i)) - printf("%d\n", i); + TOKUDB_TRACE("%d", i); } } - // everyone calculates data by doing some default_values - record[0], but I do not see why - // that is necessary - printf("******\n"); - printf("***orig table***\n"); + // everyone calculates data by doing some default_values - record[0], but + // I do not see why that is necessary + TOKUDB_TRACE("******"); + TOKUDB_TRACE("***orig table***"); for (uint i = 0; i < table->s->fields; i++) { // // make sure to use table->field, and NOT table->s->field // Field* curr_field = table->field[i]; uint null_offset = get_null_offset(table, curr_field); - printf( - "name: %s, types: %u %u, nullable: %d, null_offset: %d, is_null_field: %d, is_null %d, pack_length %u\n", - curr_field->field_name, - curr_field->real_type(), mysql_to_toku_type(curr_field), - curr_field->null_bit, - null_offset, - curr_field->real_maybe_null(), - curr_field->real_maybe_null() ? table->s->default_values[null_offset] & curr_field->null_bit : 0xffffffff, - curr_field->pack_length() - ); + TOKUDB_TRACE( + "name: %s, types: %u %u, nullable: %d, null_offset: %d, is_null_field: " + "%d, is_null %d, pack_length %u", + curr_field->field_name, + curr_field->real_type(), + mysql_to_toku_type(curr_field), + curr_field->null_bit, + null_offset, + curr_field->real_maybe_null(), + curr_field->real_maybe_null() ? + table->s->default_values[null_offset] & curr_field->null_bit : + 0xffffffff, + curr_field->pack_length()); } - printf("******\n"); - printf("***altered table***\n"); + TOKUDB_TRACE("******"); + TOKUDB_TRACE("***altered table***"); for (uint i = 0; i < altered_table->s->fields; i++) { Field* curr_field = altered_table->field[i]; uint null_offset = get_null_offset(altered_table, curr_field); - printf( - "name: %s, types: %u %u, nullable: %d, null_offset: %d, is_null_field: %d, is_null %d, pack_length %u\n", - curr_field->field_name, - curr_field->real_type(), mysql_to_toku_type(curr_field), - curr_field->null_bit, - null_offset, - curr_field->real_maybe_null(), - curr_field->real_maybe_null() ? altered_table->s->default_values[null_offset] & curr_field->null_bit : 0xffffffff, - curr_field->pack_length() - ); + TOKUDB_TRACE( + "name: %s, types: %u %u, nullable: %d, null_offset: %d, " + "is_null_field: %d, is_null %d, pack_length %u", + curr_field->field_name, + curr_field->real_type(), + mysql_to_toku_type(curr_field), + curr_field->null_bit, + null_offset, + curr_field->real_maybe_null(), + curr_field->real_maybe_null() ? + altered_table->s->default_values[null_offset] & + curr_field->null_bit : 0xffffffff, + curr_field->pack_length()); } - printf("******\n"); + TOKUDB_TRACE("******"); } -// Given two tables with equal number of fields, find all of the fields with different types -// and return the indexes of the different fields in the changed_fields array. This function ignores field -// name differences. -static int find_changed_fields(TABLE *table_a, TABLE *table_b, Dynamic_array &changed_fields) { +// Given two tables with equal number of fields, find all of the fields with +// different types and return the indexes of the different fields in the +// changed_fields array. This function ignores field name differences. +static int find_changed_fields( + TABLE* table_a, + TABLE* table_b, + Dynamic_array& changed_fields) { + for (uint i = 0; i < table_a->s->fields; i++) { - Field *field_a = table_a->field[i]; - Field *field_b = table_b->field[i]; + Field* field_a = table_a->field[i]; + Field* field_b = table_b->field[i]; if (!fields_are_same_type(field_a, field_b)) changed_fields.append(i); } return changed_fields.elements(); } -static bool change_length_is_supported(TABLE *table, TABLE *altered_table, Alter_inplace_info *ha_alter_info, tokudb_alter_ctx *ctx); +static bool change_length_is_supported( + TABLE* table, + TABLE* altered_table, + Alter_inplace_info* ha_alter_info, + tokudb_alter_ctx* ctx); -static bool change_type_is_supported(TABLE *table, TABLE *altered_table, Alter_inplace_info *ha_alter_info, tokudb_alter_ctx *ctx); +static bool change_type_is_supported( + TABLE* table, + TABLE* altered_table, + Alter_inplace_info* ha_alter_info, + tokudb_alter_ctx* ctx); + +// The ha_alter_info->handler_flags can not be trusted. +// This function maps the bogus handler flags to something we like. +static ulong fix_handler_flags( + THD* thd, + TABLE* table, + TABLE* altered_table, + Alter_inplace_info* ha_alter_info) { -// The ha_alter_info->handler_flags can not be trusted. This function maps the bogus handler flags to something we like. -static ulong fix_handler_flags(THD *thd, TABLE *table, TABLE *altered_table, Alter_inplace_info *ha_alter_info) { ulong handler_flags = ha_alter_info->handler_flags; #if 100000 <= MYSQL_VERSION_ID @@ -162,23 +191,33 @@ static ulong fix_handler_flags(THD *thd, TABLE *table, TABLE *altered_table, Alt #endif // workaround for fill_alter_inplace_info bug (#5193) - // the function erroneously sets the ADD_INDEX and DROP_INDEX flags for a column addition that does not - // change the keys. the following code turns the ADD_INDEX and DROP_INDEX flags so that we can do hot - // column addition later. - if (handler_flags & (Alter_inplace_info::ADD_COLUMN + Alter_inplace_info::DROP_COLUMN)) { - if (handler_flags & (Alter_inplace_info::ADD_INDEX + Alter_inplace_info::DROP_INDEX)) { - if (tables_have_same_keys(table, altered_table, THDVAR(thd, alter_print_error) != 0, false)) { - handler_flags &= ~(Alter_inplace_info::ADD_INDEX + Alter_inplace_info::DROP_INDEX); + // the function erroneously sets the ADD_INDEX and DROP_INDEX flags for a + // column addition that does not change the keys. + // the following code turns the ADD_INDEX and DROP_INDEX flags so that + // we can do hot column addition later. + if (handler_flags & + (Alter_inplace_info::ADD_COLUMN + Alter_inplace_info::DROP_COLUMN)) { + if (handler_flags & + (Alter_inplace_info::ADD_INDEX + Alter_inplace_info::DROP_INDEX)) { + if (tables_have_same_keys( + table, + altered_table, + tokudb::sysvars::alter_print_error(thd) != 0, false)) { + handler_flags &= + ~(Alter_inplace_info::ADD_INDEX + + Alter_inplace_info::DROP_INDEX); } } } - // always allow rename table + any other operation, so turn off the rename flag + // always allow rename table + any other operation, so turn off the + // rename flag if (handler_flags & Alter_inplace_info::TOKU_ALTER_RENAME) { handler_flags &= ~Alter_inplace_info::TOKU_ALTER_RENAME; } - // ALTER_COLUMN_TYPE may be set when no columns have been changed, so turn off the flag + // ALTER_COLUMN_TYPE may be set when no columns have been changed, + // so turn off the flag if (handler_flags & Alter_inplace_info::ALTER_COLUMN_TYPE) { if (all_fields_are_same_type(table, altered_table)) { handler_flags &= ~Alter_inplace_info::ALTER_COLUMN_TYPE; @@ -191,9 +230,10 @@ static ulong fix_handler_flags(THD *thd, TABLE *table, TABLE *altered_table, Alt // Require that there is no intersection of add and drop names. static bool is_disjoint_add_drop(Alter_inplace_info *ha_alter_info) { for (uint d = 0; d < ha_alter_info->index_drop_count; d++) { - KEY *drop_key = ha_alter_info->index_drop_buffer[d]; + KEY* drop_key = ha_alter_info->index_drop_buffer[d]; for (uint a = 0; a < ha_alter_info->index_add_count; a++) { - KEY *add_key = &ha_alter_info->key_info_buffer[ha_alter_info->index_add_buffer[a]]; + KEY* add_key = + &ha_alter_info->key_info_buffer[ha_alter_info->index_add_buffer[a]]; if (strcmp(drop_key->name, add_key->name) == 0) { return false; } @@ -202,196 +242,294 @@ static bool is_disjoint_add_drop(Alter_inplace_info *ha_alter_info) { return true; } -// Return true if some bit in mask is set and no bit in ~mask is set, otherwise return false. +// Return true if some bit in mask is set and no bit in ~mask is set, +// otherwise return false. static bool only_flags(ulong bits, ulong mask) { return (bits & mask) != 0 && (bits & ~mask) == 0; } -// Check if an alter table operation on this table and described by the alter table parameters is supported inplace -// and if so, what type of locking is needed to execute it. -// return values: +// Check if an alter table operation on this table and described by the alter +// table parameters is supported inplace and if so, what type of locking is +// needed to execute it. return values: + +// HA_ALTER_INPLACE_NOT_SUPPORTED: alter operation is not supported as an +// inplace operation, a table copy is required -// HA_ALTER_INPLACE_NOT_SUPPORTED: alter operation is not supported as an inplace operation, a table copy is required // HA_ALTER_ERROR: the alter table operation should fail // HA_ALTER_INPLACE_EXCLUSIVE_LOCK: prepare and alter runs with MDL X -// HA_ALTER_INPLACE_SHARED_LOCK_AFTER_PREPARE: prepare runs with MDL X, alter runs with MDL SNW -// HA_ALTER_INPLACE_SHARED_LOCK: prepare and alter methods called with MDL SNW, concurrent reads, no writes +// HA_ALTER_INPLACE_SHARED_LOCK_AFTER_PREPARE: prepare runs with MDL X, +// alter runs with MDL SNW + +// HA_ALTER_INPLACE_SHARED_LOCK: prepare and alter methods called with MDL SNW, +// concurrent reads, no writes + +// HA_ALTER_INPLACE_NO_LOCK_AFTER_PREPARE: prepare runs with MDL X, +// alter runs with MDL SW + +// HA_ALTER_INPLACE_NO_LOCK: prepare and alter methods called with MDL SW, +// concurrent reads, writes. +// must set WRITE_ALLOW_WRITE lock type in the external lock method to avoid +// deadlocks with the MDL lock and the table lock +enum_alter_inplace_result ha_tokudb::check_if_supported_inplace_alter( + TABLE* altered_table, + Alter_inplace_info* ha_alter_info) { -// HA_ALTER_INPLACE_NO_LOCK_AFTER_PREPARE: prepare runs with MDL X, alter runs with MDL SW -// HA_ALTER_INPLACE_NO_LOCK: prepare and alter methods called with MDL SW, concurrent reads, writes. -// must set WRITE_ALLOW_WRITE lock type in the external lock method to avoid deadlocks -// with the MDL lock and the table lock -enum_alter_inplace_result ha_tokudb::check_if_supported_inplace_alter(TABLE *altered_table, Alter_inplace_info *ha_alter_info) { TOKUDB_HANDLER_DBUG_ENTER(""); - if (tokudb_debug & TOKUDB_DEBUG_ALTER_TABLE) { + if (TOKUDB_UNLIKELY(TOKUDB_DEBUG_FLAGS(TOKUDB_DEBUG_ALTER_TABLE))) { print_alter_info(altered_table, ha_alter_info); } - enum_alter_inplace_result result = HA_ALTER_INPLACE_NOT_SUPPORTED; // default is NOT inplace - THD *thd = ha_thd(); + // default is NOT inplace + enum_alter_inplace_result result = HA_ALTER_INPLACE_NOT_SUPPORTED; + THD* thd = ha_thd(); // setup context - tokudb_alter_ctx *ctx = new tokudb_alter_ctx; + tokudb_alter_ctx* ctx = new tokudb_alter_ctx; ha_alter_info->handler_ctx = ctx; - ctx->handler_flags = fix_handler_flags(thd, table, altered_table, ha_alter_info); + ctx->handler_flags = + fix_handler_flags(thd, table, altered_table, ha_alter_info); ctx->table_kc_info = &share->kc_info; ctx->altered_table_kc_info = &ctx->altered_table_kc_info_base; memset(ctx->altered_table_kc_info, 0, sizeof (KEY_AND_COL_INFO)); - if (get_disable_hot_alter(thd)) { + if (tokudb::sysvars::disable_hot_alter(thd)) { ; // do nothing - } else - // add or drop index - if (only_flags(ctx->handler_flags, Alter_inplace_info::DROP_INDEX + Alter_inplace_info::DROP_UNIQUE_INDEX + - Alter_inplace_info::ADD_INDEX + Alter_inplace_info::ADD_UNIQUE_INDEX)) { + } else if (only_flags( + ctx->handler_flags, + Alter_inplace_info::DROP_INDEX + + Alter_inplace_info::DROP_UNIQUE_INDEX + + Alter_inplace_info::ADD_INDEX + + Alter_inplace_info::ADD_UNIQUE_INDEX)) { + // add or drop index if (table->s->null_bytes == altered_table->s->null_bytes && - (ha_alter_info->index_add_count > 0 || ha_alter_info->index_drop_count > 0) && - !tables_have_same_keys(table, altered_table, THDVAR(thd, alter_print_error) != 0, false) && + (ha_alter_info->index_add_count > 0 || + ha_alter_info->index_drop_count > 0) && + !tables_have_same_keys( + table, + altered_table, + tokudb::sysvars::alter_print_error(thd) != 0, false) && is_disjoint_add_drop(ha_alter_info)) { - if (ctx->handler_flags & (Alter_inplace_info::DROP_INDEX + Alter_inplace_info::DROP_UNIQUE_INDEX)) { - // the fractal tree can not handle dropping an index concurrent with querying with the index. + if (ctx->handler_flags & + (Alter_inplace_info::DROP_INDEX + + Alter_inplace_info::DROP_UNIQUE_INDEX)) { + // the fractal tree can not handle dropping an index concurrent + // with querying with the index. // we grab an exclusive MDL for the drop index. result = HA_ALTER_INPLACE_EXCLUSIVE_LOCK; } else { result = HA_ALTER_INPLACE_SHARED_LOCK_AFTER_PREPARE; - // someday, allow multiple hot indexes via alter table add key. don't forget to change the store_lock function. - // for now, hot indexing is only supported via session variable with the create index sql command - if (ha_alter_info->index_add_count == 1 && ha_alter_info->index_drop_count == 0 && // only one add or drop - ctx->handler_flags == Alter_inplace_info::ADD_INDEX && // must be add index not add unique index - thd_sql_command(thd) == SQLCOM_CREATE_INDEX && // must be a create index command - get_create_index_online(thd)) { // must be enabled - // external_lock set WRITE_ALLOW_WRITE which allows writes concurrent with the index creation + // someday, allow multiple hot indexes via alter table add key. + // don't forget to change the store_lock function. + // for now, hot indexing is only supported via session variable + // with the create index sql command + if (ha_alter_info->index_add_count == 1 && + // only one add or drop + ha_alter_info->index_drop_count == 0 && + // must be add index not add unique index + ctx->handler_flags == Alter_inplace_info::ADD_INDEX && + // must be a create index command + thd_sql_command(thd) == SQLCOM_CREATE_INDEX && + // must be enabled + tokudb::sysvars::create_index_online(thd)) { + // external_lock set WRITE_ALLOW_WRITE which allows writes + // concurrent with the index creation result = HA_ALTER_INPLACE_NO_LOCK_AFTER_PREPARE; } } } - } else - // column default - if (only_flags(ctx->handler_flags, Alter_inplace_info::ALTER_COLUMN_DEFAULT)) { + } else if (only_flags( + ctx->handler_flags, + Alter_inplace_info::ALTER_COLUMN_DEFAULT)) { + // column default if (table->s->null_bytes == altered_table->s->null_bytes) result = HA_ALTER_INPLACE_EXCLUSIVE_LOCK; - } else - // column rename - if (ctx->handler_flags & Alter_inplace_info::ALTER_COLUMN_NAME && - only_flags(ctx->handler_flags, Alter_inplace_info::ALTER_COLUMN_NAME + Alter_inplace_info::ALTER_COLUMN_DEFAULT)) { - // we have identified a possible column rename, + } else if (ctx->handler_flags & Alter_inplace_info::ALTER_COLUMN_NAME && + only_flags( + ctx->handler_flags, + Alter_inplace_info::ALTER_COLUMN_NAME + + Alter_inplace_info::ALTER_COLUMN_DEFAULT)) { + // column rename + // we have identified a possible column rename, // but let's do some more checks - + // we will only allow an hcr if there are no changes // in column positions (ALTER_COLUMN_ORDER is not set) - + // now need to verify that one and only one column // has changed only its name. If we find anything to // the contrary, we don't allow it, also check indexes if (table->s->null_bytes == altered_table->s->null_bytes) { - bool cr_supported = column_rename_supported(table, altered_table, (ctx->handler_flags & Alter_inplace_info::ALTER_COLUMN_ORDER) != 0); + bool cr_supported = + column_rename_supported( + table, + altered_table, + (ctx->handler_flags & + Alter_inplace_info::ALTER_COLUMN_ORDER) != 0); if (cr_supported) result = HA_ALTER_INPLACE_EXCLUSIVE_LOCK; } - } else - // add column - if (ctx->handler_flags & Alter_inplace_info::ADD_COLUMN && - only_flags(ctx->handler_flags, Alter_inplace_info::ADD_COLUMN + Alter_inplace_info::ALTER_COLUMN_ORDER) && - setup_kc_info(altered_table, ctx->altered_table_kc_info) == 0) { + } else if (ctx->handler_flags & Alter_inplace_info::ADD_COLUMN && + only_flags( + ctx->handler_flags, + Alter_inplace_info::ADD_COLUMN + + Alter_inplace_info::ALTER_COLUMN_ORDER) && + setup_kc_info(altered_table, ctx->altered_table_kc_info) == 0) { + // add column uint32_t added_columns[altered_table->s->fields]; uint32_t num_added_columns = 0; - int r = find_changed_columns(added_columns, &num_added_columns, table, altered_table); + int r = + find_changed_columns( + added_columns, + &num_added_columns, + table, + altered_table); if (r == 0) { - if (tokudb_debug & TOKUDB_DEBUG_ALTER_TABLE) { + if (TOKUDB_UNLIKELY(TOKUDB_DEBUG_FLAGS(TOKUDB_DEBUG_ALTER_TABLE))) { for (uint32_t i = 0; i < num_added_columns; i++) { uint32_t curr_added_index = added_columns[i]; - Field* curr_added_field = altered_table->field[curr_added_index]; - printf("Added column: index %d, name %s\n", curr_added_index, curr_added_field->field_name); + Field* curr_added_field = + altered_table->field[curr_added_index]; + TOKUDB_TRACE( + "Added column: index %d, name %s", + curr_added_index, + curr_added_field->field_name); } } result = HA_ALTER_INPLACE_EXCLUSIVE_LOCK; } - } else - // drop column - if (ctx->handler_flags & Alter_inplace_info::DROP_COLUMN && - only_flags(ctx->handler_flags, Alter_inplace_info::DROP_COLUMN + Alter_inplace_info::ALTER_COLUMN_ORDER) && - setup_kc_info(altered_table, ctx->altered_table_kc_info) == 0) { + } else if (ctx->handler_flags & Alter_inplace_info::DROP_COLUMN && + only_flags( + ctx->handler_flags, + Alter_inplace_info::DROP_COLUMN + + Alter_inplace_info::ALTER_COLUMN_ORDER) && + setup_kc_info(altered_table, ctx->altered_table_kc_info) == 0) { + // drop column uint32_t dropped_columns[table->s->fields]; uint32_t num_dropped_columns = 0; - int r = find_changed_columns(dropped_columns, &num_dropped_columns, altered_table, table); + int r = + find_changed_columns( + dropped_columns, + &num_dropped_columns, + altered_table, + table); if (r == 0) { - if (tokudb_debug & TOKUDB_DEBUG_ALTER_TABLE) { + if (TOKUDB_UNLIKELY(TOKUDB_DEBUG_FLAGS(TOKUDB_DEBUG_ALTER_TABLE))) { for (uint32_t i = 0; i < num_dropped_columns; i++) { uint32_t curr_dropped_index = dropped_columns[i]; Field* curr_dropped_field = table->field[curr_dropped_index]; - printf("Dropped column: index %d, name %s\n", curr_dropped_index, curr_dropped_field->field_name); + TOKUDB_TRACE( + "Dropped column: index %d, name %s", + curr_dropped_index, + curr_dropped_field->field_name); } } result = HA_ALTER_INPLACE_EXCLUSIVE_LOCK; } - } else - // change column length - if ((ctx->handler_flags & Alter_inplace_info::ALTER_COLUMN_EQUAL_PACK_LENGTH) && - only_flags(ctx->handler_flags, Alter_inplace_info::ALTER_COLUMN_EQUAL_PACK_LENGTH + Alter_inplace_info::ALTER_COLUMN_DEFAULT) && - table->s->fields == altered_table->s->fields && - find_changed_fields(table, altered_table, ctx->changed_fields) > 0 && - setup_kc_info(altered_table, ctx->altered_table_kc_info) == 0) { + } else if ((ctx->handler_flags & + Alter_inplace_info::ALTER_COLUMN_EQUAL_PACK_LENGTH) && + only_flags( + ctx->handler_flags, + Alter_inplace_info::ALTER_COLUMN_EQUAL_PACK_LENGTH + + Alter_inplace_info::ALTER_COLUMN_DEFAULT) && + table->s->fields == altered_table->s->fields && + find_changed_fields( + table, + altered_table, + ctx->changed_fields) > 0 && + setup_kc_info(altered_table, ctx->altered_table_kc_info) == 0) { - if (change_length_is_supported(table, altered_table, ha_alter_info, ctx)) { + // change column length + if (change_length_is_supported( + table, + altered_table, + ha_alter_info, ctx)) { result = HA_ALTER_INPLACE_EXCLUSIVE_LOCK; } - } else - // change column type - if ((ctx->handler_flags & Alter_inplace_info::ALTER_COLUMN_TYPE) && - only_flags(ctx->handler_flags, Alter_inplace_info::ALTER_COLUMN_TYPE + Alter_inplace_info::ALTER_COLUMN_DEFAULT) && - table->s->fields == altered_table->s->fields && - find_changed_fields(table, altered_table, ctx->changed_fields) > 0 && - setup_kc_info(altered_table, ctx->altered_table_kc_info) == 0) { - - if (change_type_is_supported(table, altered_table, ha_alter_info, ctx)) { + } else if ((ctx->handler_flags & Alter_inplace_info::ALTER_COLUMN_TYPE) && + only_flags( + ctx->handler_flags, + Alter_inplace_info::ALTER_COLUMN_TYPE + + Alter_inplace_info::ALTER_COLUMN_DEFAULT) && + table->s->fields == altered_table->s->fields && + find_changed_fields( + table, + altered_table, + ctx->changed_fields) > 0 && + setup_kc_info(altered_table, ctx->altered_table_kc_info) == 0) { + + // change column type + if (change_type_is_supported( + table, + altered_table, + ha_alter_info, ctx)) { result = HA_ALTER_INPLACE_EXCLUSIVE_LOCK; } - } else - if (only_flags(ctx->handler_flags, Alter_inplace_info::CHANGE_CREATE_OPTION)) { - HA_CREATE_INFO *create_info = ha_alter_info->create_info; + } else if (only_flags( + ctx->handler_flags, + Alter_inplace_info::CHANGE_CREATE_OPTION)) { + + HA_CREATE_INFO* create_info = ha_alter_info->create_info; #if TOKU_INCLUDE_OPTION_STRUCTS // set the USED_ROW_FORMAT flag for use later in this file for changes in the table's // compression - if (create_info->option_struct->row_format != table_share->option_struct->row_format) + if (create_info->option_struct->row_format != + table_share->option_struct->row_format) create_info->used_fields |= HA_CREATE_USED_ROW_FORMAT; #endif // alter auto_increment if (only_flags(create_info->used_fields, HA_CREATE_USED_AUTO)) { // do a sanity check that the table is what we think it is - if (tables_have_same_keys_and_columns(table, altered_table, THDVAR(thd, alter_print_error) != 0)) { + if (tables_have_same_keys_and_columns( + table, + altered_table, + tokudb::sysvars::alter_print_error(thd) != 0)) { result = HA_ALTER_INPLACE_EXCLUSIVE_LOCK; } - } - // alter row_format - else if (only_flags(create_info->used_fields, HA_CREATE_USED_ROW_FORMAT)) { + } else if (only_flags( + create_info->used_fields, + HA_CREATE_USED_ROW_FORMAT)) { + // alter row_format // do a sanity check that the table is what we think it is - if (tables_have_same_keys_and_columns(table, altered_table, THDVAR(thd, alter_print_error) != 0)) { + if (tables_have_same_keys_and_columns( + table, + altered_table, + tokudb::sysvars::alter_print_error(thd) != 0)) { result = HA_ALTER_INPLACE_EXCLUSIVE_LOCK; } } - } + } #if TOKU_OPTIMIZE_WITH_RECREATE - else if (only_flags(ctx->handler_flags, Alter_inplace_info::RECREATE_TABLE + Alter_inplace_info::ALTER_COLUMN_DEFAULT)) { + else if (only_flags( + ctx->handler_flags, + Alter_inplace_info::RECREATE_TABLE + + Alter_inplace_info::ALTER_COLUMN_DEFAULT)) { ctx->optimize_needed = true; result = HA_ALTER_INPLACE_NO_LOCK_AFTER_PREPARE; } #endif - if (result != HA_ALTER_INPLACE_NOT_SUPPORTED && table->s->null_bytes != altered_table->s->null_bytes && - (tokudb_debug & TOKUDB_DEBUG_ALTER_TABLE)) { + if (TOKUDB_UNLIKELY(TOKUDB_DEBUG_FLAGS(TOKUDB_DEBUG_ALTER_TABLE)) && + result != HA_ALTER_INPLACE_NOT_SUPPORTED && + table->s->null_bytes != altered_table->s->null_bytes) { + TOKUDB_HANDLER_TRACE("q %s", thd->query()); - TOKUDB_HANDLER_TRACE("null bytes %u -> %u", table->s->null_bytes, altered_table->s->null_bytes); + TOKUDB_HANDLER_TRACE( + "null bytes %u -> %u", + table->s->null_bytes, + altered_table->s->null_bytes); } - // turn a not supported result into an error if the slow alter table (copy) is disabled - if (result == HA_ALTER_INPLACE_NOT_SUPPORTED && get_disable_slow_alter(thd)) { + // turn a not supported result into an error if the slow alter table + // (copy) is disabled + if (result == HA_ALTER_INPLACE_NOT_SUPPORTED && + tokudb::sysvars::disable_slow_alter(thd)) { print_error(HA_ERR_UNSUPPORTED, MYF(0)); result = HA_ALTER_ERROR; } @@ -400,46 +538,77 @@ enum_alter_inplace_result ha_tokudb::check_if_supported_inplace_alter(TABLE *alt } // Prepare for the alter operations -bool ha_tokudb::prepare_inplace_alter_table(TABLE *altered_table, Alter_inplace_info *ha_alter_info) { +bool ha_tokudb::prepare_inplace_alter_table( + TABLE* altered_table, + Alter_inplace_info* ha_alter_info) { + TOKUDB_HANDLER_DBUG_ENTER(""); - tokudb_alter_ctx *ctx = static_cast(ha_alter_info->handler_ctx); - assert(transaction); // transaction must exist after table is locked + tokudb_alter_ctx* ctx = + static_cast(ha_alter_info->handler_ctx); + assert_always(transaction); // transaction must exist after table is locked ctx->alter_txn = transaction; bool result = false; // success DBUG_RETURN(result); } // Execute the alter operations. -bool ha_tokudb::inplace_alter_table(TABLE *altered_table, Alter_inplace_info *ha_alter_info) { +bool ha_tokudb::inplace_alter_table( + TABLE* altered_table, + Alter_inplace_info* ha_alter_info) { + TOKUDB_HANDLER_DBUG_ENTER(""); int error = 0; - tokudb_alter_ctx *ctx = static_cast(ha_alter_info->handler_ctx); - HA_CREATE_INFO *create_info = ha_alter_info->create_info; + tokudb_alter_ctx* ctx = + static_cast(ha_alter_info->handler_ctx); + HA_CREATE_INFO* create_info = ha_alter_info->create_info; - if (error == 0 && (ctx->handler_flags & (Alter_inplace_info::DROP_INDEX + Alter_inplace_info::DROP_UNIQUE_INDEX))) { + // this should be enough to handle locking as the higher level MDL + // on this table should prevent any new analyze tasks. + share->cancel_background_jobs(); + + if (error == 0 && + (ctx->handler_flags & + (Alter_inplace_info::DROP_INDEX + + Alter_inplace_info::DROP_UNIQUE_INDEX))) { error = alter_table_drop_index(altered_table, ha_alter_info); } - if (error == 0 && (ctx->handler_flags & (Alter_inplace_info::ADD_INDEX + Alter_inplace_info::ADD_UNIQUE_INDEX))) { + if (error == 0 && + (ctx->handler_flags & + (Alter_inplace_info::ADD_INDEX + + Alter_inplace_info::ADD_UNIQUE_INDEX))) { error = alter_table_add_index(altered_table, ha_alter_info); } - if (error == 0 && (ctx->handler_flags & (Alter_inplace_info::ADD_COLUMN + Alter_inplace_info::DROP_COLUMN))) { + if (error == 0 && + (ctx->handler_flags & + (Alter_inplace_info::ADD_COLUMN + + Alter_inplace_info::DROP_COLUMN))) { error = alter_table_add_or_drop_column(altered_table, ha_alter_info); } - if (error == 0 && (ctx->handler_flags & Alter_inplace_info::CHANGE_CREATE_OPTION) && (create_info->used_fields & HA_CREATE_USED_AUTO)) { - error = write_auto_inc_create(share->status_block, create_info->auto_increment_value, ctx->alter_txn); + if (error == 0 && + (ctx->handler_flags & Alter_inplace_info::CHANGE_CREATE_OPTION) && + (create_info->used_fields & HA_CREATE_USED_AUTO)) { + error = write_auto_inc_create( + share->status_block, + create_info->auto_increment_value, + ctx->alter_txn); } - if (error == 0 && (ctx->handler_flags & Alter_inplace_info::CHANGE_CREATE_OPTION) && (create_info->used_fields & HA_CREATE_USED_ROW_FORMAT)) { + if (error == 0 && + (ctx->handler_flags & Alter_inplace_info::CHANGE_CREATE_OPTION) && + (create_info->used_fields & HA_CREATE_USED_ROW_FORMAT)) { // Get the current compression DB *db = share->key_file[0]; error = db->get_compression_method(db, &ctx->orig_compression_method); - assert(error == 0); + assert_always(error == 0); // Set the new compression #if TOKU_INCLUDE_OPTION_STRUCTS - toku_compression_method method = row_format_to_toku_compression_method((srv_row_format_t) create_info->option_struct->row_format); + toku_compression_method method = + row_format_to_toku_compression_method( + (tokudb::sysvars::row_format_t)create_info->option_struct->row_format); #else - toku_compression_method method = row_type_to_toku_compression_method(create_info->row_type); + toku_compression_method method = + row_type_to_toku_compression_method(create_info->row_type); #endif uint32_t curr_num_DBs = table->s->keys + tokudb_test(hidden_primary_key); for (uint32_t i = 0; i < curr_num_DBs; i++) { @@ -457,13 +626,19 @@ bool ha_tokudb::inplace_alter_table(TABLE *altered_table, Alter_inplace_info *ha error = alter_table_expand_columns(altered_table, ha_alter_info); if (error == 0 && ctx->expand_varchar_update_needed) - error = alter_table_expand_varchar_offsets(altered_table, ha_alter_info); + error = alter_table_expand_varchar_offsets( + altered_table, + ha_alter_info); if (error == 0 && ctx->expand_blob_update_needed) error = alter_table_expand_blobs(altered_table, ha_alter_info); if (error == 0 && ctx->reset_card) { - error = tokudb::alter_card(share->status_block, ctx->alter_txn, table->s, altered_table->s); + error = tokudb::alter_card( + share->status_block, + ctx->alter_txn, + table->s, + altered_table->s); } if (error == 0 && ctx->optimize_needed) { error = do_optimize(ha_thd()); @@ -472,11 +647,15 @@ bool ha_tokudb::inplace_alter_table(TABLE *altered_table, Alter_inplace_info *ha #if (50600 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50699) || \ (50700 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50799) #if WITH_PARTITION_STORAGE_ENGINE - if (error == 0 && (TOKU_PARTITION_WRITE_FRM_DATA || altered_table->part_info == NULL)) { + if (error == 0 && + (TOKU_PARTITION_WRITE_FRM_DATA || altered_table->part_info == NULL)) { #else if (error == 0) { #endif - error = write_frm_data(share->status_block, ctx->alter_txn, altered_table->s->path.str); + error = write_frm_data( + share->status_block, + ctx->alter_txn, + altered_table->s->path.str); } #endif @@ -489,20 +668,34 @@ bool ha_tokudb::inplace_alter_table(TABLE *altered_table, Alter_inplace_info *ha DBUG_RETURN(result); } -int ha_tokudb::alter_table_add_index(TABLE *altered_table, Alter_inplace_info *ha_alter_info) { +int ha_tokudb::alter_table_add_index( + TABLE* altered_table, + Alter_inplace_info* ha_alter_info) { // sort keys in add index order - KEY *key_info = (KEY*) tokudb_my_malloc(sizeof (KEY) * ha_alter_info->index_add_count, MYF(MY_WME)); + KEY* key_info = (KEY*)tokudb::memory::malloc( + sizeof(KEY) * ha_alter_info->index_add_count, + MYF(MY_WME)); for (uint i = 0; i < ha_alter_info->index_add_count; i++) { KEY *key = &key_info[i]; *key = ha_alter_info->key_info_buffer[ha_alter_info->index_add_buffer[i]]; - for (KEY_PART_INFO *key_part= key->key_part; key_part < key->key_part + get_key_parts(key); key_part++) + for (KEY_PART_INFO* key_part = key->key_part; + key_part < key->key_part + key->user_defined_key_parts; + key_part++) { key_part->field = table->field[key_part->fieldnr]; + } } - tokudb_alter_ctx *ctx = static_cast(ha_alter_info->handler_ctx); + tokudb_alter_ctx* ctx = + static_cast(ha_alter_info->handler_ctx); ctx->add_index_changed = true; - int error = tokudb_add_index(table, key_info, ha_alter_info->index_add_count, ctx->alter_txn, &ctx->incremented_num_DBs, &ctx->modified_DBs); + int error = tokudb_add_index( + table, + key_info, + ha_alter_info->index_add_count, + ctx->alter_txn, + &ctx->incremented_num_DBs, + &ctx->modified_DBs); if (error == HA_ERR_FOUND_DUPP_KEY) { // hack for now, in case of duplicate key error, // because at the moment we cannot display the right key @@ -511,7 +704,7 @@ int ha_tokudb::alter_table_add_index(TABLE *altered_table, Alter_inplace_info *h last_dup_key = MAX_KEY; } - tokudb_my_free(key_info); + tokudb::memory::free(key_info); if (error == 0) ctx->reset_card = true; @@ -519,7 +712,11 @@ int ha_tokudb::alter_table_add_index(TABLE *altered_table, Alter_inplace_info *h return error; } -static bool find_index_of_key(const char *key_name, TABLE *table, uint *index_offset_ptr) { +static bool find_index_of_key( + const char* key_name, + TABLE* table, + uint* index_offset_ptr) { + for (uint i = 0; i < table->s->keys; i++) { if (strcmp(key_name, table->key_info[i].name) == 0) { *index_offset_ptr = i; @@ -529,7 +726,12 @@ static bool find_index_of_key(const char *key_name, TABLE *table, uint *index_of return false; } -static bool find_index_of_key(const char *key_name, KEY *key_info, uint key_count, uint *index_offset_ptr) { +static bool find_index_of_key( + const char* key_name, + KEY* key_info, + uint key_count, + uint* index_offset_ptr) { + for (uint i = 0; i < key_count; i++) { if (strcmp(key_name, key_info[i].name) == 0) { *index_offset_ptr = i; @@ -539,26 +741,42 @@ static bool find_index_of_key(const char *key_name, KEY *key_info, uint key_coun return false; } -int ha_tokudb::alter_table_drop_index(TABLE *altered_table, Alter_inplace_info *ha_alter_info) { +int ha_tokudb::alter_table_drop_index( + TABLE* altered_table, + Alter_inplace_info* ha_alter_info) { + KEY *key_info = table->key_info; // translate key names to indexes into the key_info array uint index_drop_offsets[ha_alter_info->index_drop_count]; for (uint i = 0; i < ha_alter_info->index_drop_count; i++) { bool found; - found = find_index_of_key(ha_alter_info->index_drop_buffer[i]->name, table, &index_drop_offsets[i]); + found = find_index_of_key( + ha_alter_info->index_drop_buffer[i]->name, + table, + &index_drop_offsets[i]); if (!found) { // undo of add key in partition engine - found = find_index_of_key(ha_alter_info->index_drop_buffer[i]->name, ha_alter_info->key_info_buffer, ha_alter_info->key_count, &index_drop_offsets[i]); - assert(found); + found = find_index_of_key( + ha_alter_info->index_drop_buffer[i]->name, + ha_alter_info->key_info_buffer, + ha_alter_info->key_count, + &index_drop_offsets[i]); + assert_always(found); key_info = ha_alter_info->key_info_buffer; } } // drop indexes - tokudb_alter_ctx *ctx = static_cast(ha_alter_info->handler_ctx); + tokudb_alter_ctx* ctx = + static_cast(ha_alter_info->handler_ctx); ctx->drop_index_changed = true; - int error = drop_indexes(table, index_drop_offsets, ha_alter_info->index_drop_count, key_info, ctx->alter_txn); + int error = drop_indexes( + table, + index_drop_offsets, + ha_alter_info->index_drop_count, + key_info, + ctx->alter_txn); if (error == 0) ctx->reset_card = true; @@ -566,93 +784,122 @@ int ha_tokudb::alter_table_drop_index(TABLE *altered_table, Alter_inplace_info * return error; } -int ha_tokudb::alter_table_add_or_drop_column(TABLE *altered_table, Alter_inplace_info *ha_alter_info) { - tokudb_alter_ctx *ctx = static_cast(ha_alter_info->handler_ctx); +int ha_tokudb::alter_table_add_or_drop_column( + TABLE* altered_table, + Alter_inplace_info* ha_alter_info) { + + tokudb_alter_ctx* ctx = + static_cast(ha_alter_info->handler_ctx); int error; uchar *column_extra = NULL; uint32_t max_column_extra_size; uint32_t num_column_extra; uint32_t num_columns = 0; uint32_t curr_num_DBs = table->s->keys + tokudb_test(hidden_primary_key); - - uint32_t columns[table->s->fields + altered_table->s->fields]; // set size such that we know it is big enough for both cases + // set size such that we know it is big enough for both cases + uint32_t columns[table->s->fields + altered_table->s->fields]; memset(columns, 0, sizeof(columns)); // generate the array of columns if (ha_alter_info->handler_flags & Alter_inplace_info::DROP_COLUMN) { find_changed_columns( - columns, - &num_columns, - altered_table, - table - ); - } else - if (ha_alter_info->handler_flags & Alter_inplace_info::ADD_COLUMN) { + columns, + &num_columns, + altered_table, + table); + } else if (ha_alter_info->handler_flags & Alter_inplace_info::ADD_COLUMN) { find_changed_columns( - columns, - &num_columns, - table, - altered_table - ); - } else - assert(0); + columns, + &num_columns, + table, + altered_table); + } else { + assert_unreachable(); + } max_column_extra_size = - STATIC_ROW_MUTATOR_SIZE + //max static row_mutator - 4 + num_columns*(1+1+4+1+1+4) + altered_table->s->reclength + // max dynamic row_mutator - (4 + share->kc_info.num_blobs) + // max static blob size - (num_columns*(1+4+1+4)); // max dynamic blob size - column_extra = (uchar *)tokudb_my_malloc(max_column_extra_size, MYF(MY_WME)); - if (column_extra == NULL) { error = ENOMEM; goto cleanup; } + // max static row_mutator + STATIC_ROW_MUTATOR_SIZE + + // max dynamic row_mutator + 4 + num_columns*(1+1+4+1+1+4) + altered_table->s->reclength + + // max static blob size + (4 + share->kc_info.num_blobs) + + // max dynamic blob size + (num_columns*(1+4+1+4)); + column_extra = (uchar*)tokudb::memory::malloc( + max_column_extra_size, + MYF(MY_WME)); + if (column_extra == NULL) { + error = ENOMEM; + goto cleanup; + } for (uint32_t i = 0; i < curr_num_DBs; i++) { // change to a new descriptor DBT row_descriptor; memset(&row_descriptor, 0, sizeof row_descriptor); - error = new_row_descriptor(table, altered_table, ha_alter_info, i, &row_descriptor); + error = new_row_descriptor( + table, + altered_table, + ha_alter_info, + i, + &row_descriptor); if (error) goto cleanup; - error = share->key_file[i]->change_descriptor(share->key_file[i], ctx->alter_txn, &row_descriptor, 0); - tokudb_my_free(row_descriptor.data); + error = share->key_file[i]->change_descriptor( + share->key_file[i], + ctx->alter_txn, + &row_descriptor, + 0); + tokudb::memory::free(row_descriptor.data); if (error) goto cleanup; if (i == primary_key || key_is_clustering(&table_share->key_info[i])) { num_column_extra = fill_row_mutator( - column_extra, - columns, - num_columns, - altered_table, - ctx->altered_table_kc_info, - i, - (ha_alter_info->handler_flags & Alter_inplace_info::ADD_COLUMN) != 0 // true if adding columns, otherwise is a drop - ); + column_extra, + columns, + num_columns, + altered_table, + ctx->altered_table_kc_info, + i, + // true if adding columns, otherwise is a drop + (ha_alter_info->handler_flags & + Alter_inplace_info::ADD_COLUMN) != 0); DBT column_dbt; memset(&column_dbt, 0, sizeof column_dbt); column_dbt.data = column_extra; column_dbt.size = num_column_extra; DBUG_ASSERT(num_column_extra <= max_column_extra_size); error = share->key_file[i]->update_broadcast( - share->key_file[i], - ctx->alter_txn, - &column_dbt, - DB_IS_RESETTING_OP - ); - if (error) { goto cleanup; } + share->key_file[i], + ctx->alter_txn, + &column_dbt, + DB_IS_RESETTING_OP); + if (error) { + goto cleanup; + } } } error = 0; cleanup: - tokudb_my_free(column_extra); + tokudb::memory::free(column_extra); return error; } // Commit or abort the alter operations. -// If commit then write the new frm data to the status using the alter transaction. -// If abort then abort the alter transaction and try to rollback the non-transactional changes. -bool ha_tokudb::commit_inplace_alter_table(TABLE *altered_table, Alter_inplace_info *ha_alter_info, bool commit) { +// If commit then write the new frm data to the status using the alter +// transaction. +// If abort then abort the alter transaction and try to rollback the +// non-transactional changes. +bool ha_tokudb::commit_inplace_alter_table( + TABLE* altered_table, + Alter_inplace_info* ha_alter_info, + bool commit) { + TOKUDB_HANDLER_DBUG_ENTER(""); - tokudb_alter_ctx *ctx = static_cast(ha_alter_info->handler_ctx); + tokudb_alter_ctx* ctx = + static_cast(ha_alter_info->handler_ctx); bool result = false; // success THD *thd = ha_thd(); @@ -671,7 +918,10 @@ bool ha_tokudb::commit_inplace_alter_table(TABLE *altered_table, Alter_inplace_i #else if (true) { #endif - int error = write_frm_data(share->status_block, ctx->alter_txn, altered_table->s->path.str); + int error = write_frm_data( + share->status_block, + ctx->alter_txn, + altered_table->s->path.str); if (error) { commit = false; result = true; @@ -683,42 +933,55 @@ bool ha_tokudb::commit_inplace_alter_table(TABLE *altered_table, Alter_inplace_i if (!commit) { if (table->mdl_ticket->get_type() != MDL_EXCLUSIVE && - (ctx->add_index_changed || ctx->drop_index_changed || ctx->compression_changed)) { + (ctx->add_index_changed || ctx->drop_index_changed || + ctx->compression_changed)) { // get exclusive lock no matter what #if defined(MARIADB_BASE_VERSION) killed_state saved_killed_state = thd->killed; thd->killed = NOT_KILLED; - for (volatile uint i = 0; wait_while_table_is_used(thd, table, HA_EXTRA_NOT_USED); i++) { + for (volatile uint i = 0; + wait_while_table_is_used(thd, table, HA_EXTRA_NOT_USED); + i++) { if (thd->killed != NOT_KILLED) thd->killed = NOT_KILLED; sleep(1); } - assert(table->mdl_ticket->get_type() == MDL_EXCLUSIVE); + assert_always(table->mdl_ticket->get_type() == MDL_EXCLUSIVE); if (thd->killed == NOT_KILLED) thd->killed = saved_killed_state; #else THD::killed_state saved_killed_state = thd->killed; thd->killed = THD::NOT_KILLED; - // MySQL does not handle HA_EXTRA_NOT_USED so we use HA_EXTRA_PREPARE_FOR_RENAME since it is passed through + // MySQL does not handle HA_EXTRA_NOT_USED so we use + // HA_EXTRA_PREPARE_FOR_RENAME since it is passed through // the partition storage engine and is treated as a NOP by tokudb - for (volatile uint i = 0; wait_while_table_is_used(thd, table, HA_EXTRA_PREPARE_FOR_RENAME); i++) { + for (volatile uint i = 0; + wait_while_table_is_used( + thd, + table, + HA_EXTRA_PREPARE_FOR_RENAME); + i++) { if (thd->killed != THD::NOT_KILLED) thd->killed = THD::NOT_KILLED; sleep(1); } - assert(table->mdl_ticket->get_type() == MDL_EXCLUSIVE); + assert_always(table->mdl_ticket->get_type() == MDL_EXCLUSIVE); if (thd->killed == THD::NOT_KILLED) thd->killed = saved_killed_state; #endif } - // abort the alter transaction NOW so that any alters are rolled back. this allows the following restores to work. - tokudb_trx_data *trx = (tokudb_trx_data *) thd_get_ha_data(thd, tokudb_hton); - assert(ctx->alter_txn == trx->stmt); - assert(trx->tokudb_lock_count > 0); - // for partitioned tables, we use a single transaction to do all of the partition changes. the tokudb_lock_count - // is a reference count for each of the handlers to the same transaction. obviously, we want to only abort once. + // abort the alter transaction NOW so that any alters are rolled back. + // this allows the following restores to work. + tokudb_trx_data* trx = + (tokudb_trx_data*)thd_get_ha_data(thd, tokudb_hton); + assert_always(ctx->alter_txn == trx->stmt); + assert_always(trx->tokudb_lock_count > 0); + // for partitioned tables, we use a single transaction to do all of the + // partition changes. the tokudb_lock_count is a reference count for + // each of the handlers to the same transaction. obviously, we want + // to only abort once. if (trx->tokudb_lock_count > 0) { if (--trx->tokudb_lock_count <= trx->create_lock_count) { trx->create_lock_count = 0; @@ -731,82 +994,125 @@ bool ha_tokudb::commit_inplace_alter_table(TABLE *altered_table, Alter_inplace_i } if (ctx->add_index_changed) { - restore_add_index(table, ha_alter_info->index_add_count, ctx->incremented_num_DBs, ctx->modified_DBs); + restore_add_index( + table, + ha_alter_info->index_add_count, + ctx->incremented_num_DBs, + ctx->modified_DBs); } if (ctx->drop_index_changed) { // translate key names to indexes into the key_info array uint index_drop_offsets[ha_alter_info->index_drop_count]; for (uint i = 0; i < ha_alter_info->index_drop_count; i++) { - bool found = find_index_of_key(ha_alter_info->index_drop_buffer[i]->name, table, &index_drop_offsets[i]); - assert(found); + bool found = find_index_of_key( + ha_alter_info->index_drop_buffer[i]->name, + table, + &index_drop_offsets[i]); + assert_always(found); } - restore_drop_indexes(table, index_drop_offsets, ha_alter_info->index_drop_count); + restore_drop_indexes( + table, + index_drop_offsets, + ha_alter_info->index_drop_count); } if (ctx->compression_changed) { - uint32_t curr_num_DBs = table->s->keys + tokudb_test(hidden_primary_key); + uint32_t curr_num_DBs = + table->s->keys + tokudb_test(hidden_primary_key); for (uint32_t i = 0; i < curr_num_DBs; i++) { DB *db = share->key_file[i]; - int error = db->change_compression_method(db, ctx->orig_compression_method); - assert(error == 0); + int error = db->change_compression_method( + db, + ctx->orig_compression_method); + assert_always(error == 0); } } } - DBUG_RETURN(result); } // Setup the altered table's key and col info. -int ha_tokudb::setup_kc_info(TABLE *altered_table, KEY_AND_COL_INFO *altered_kc_info) { +int ha_tokudb::setup_kc_info( + TABLE* altered_table, + KEY_AND_COL_INFO* altered_kc_info) { + int error = allocate_key_and_col_info(altered_table->s, altered_kc_info); if (error == 0) - error = initialize_key_and_col_info(altered_table->s, altered_table, altered_kc_info, hidden_primary_key, primary_key); + error = initialize_key_and_col_info( + altered_table->s, + altered_table, + altered_kc_info, + hidden_primary_key, + primary_key); return error; } // Expand the variable length fields offsets from 1 to 2 bytes. -int ha_tokudb::alter_table_expand_varchar_offsets(TABLE *altered_table, Alter_inplace_info *ha_alter_info) { +int ha_tokudb::alter_table_expand_varchar_offsets( + TABLE* altered_table, + Alter_inplace_info* ha_alter_info) { + int error = 0; - tokudb_alter_ctx *ctx = static_cast(ha_alter_info->handler_ctx); + tokudb_alter_ctx* ctx = + static_cast(ha_alter_info->handler_ctx); uint32_t curr_num_DBs = table->s->keys + tokudb_test(hidden_primary_key); for (uint32_t i = 0; i < curr_num_DBs; i++) { // change to a new descriptor DBT row_descriptor; memset(&row_descriptor, 0, sizeof row_descriptor); - error = new_row_descriptor(table, altered_table, ha_alter_info, i, &row_descriptor); + error = new_row_descriptor( + table, + altered_table, + ha_alter_info, + i, + &row_descriptor); if (error) break; - error = share->key_file[i]->change_descriptor(share->key_file[i], ctx->alter_txn, &row_descriptor, 0); - tokudb_my_free(row_descriptor.data); + error = share->key_file[i]->change_descriptor( + share->key_file[i], + ctx->alter_txn, + &row_descriptor, + 0); + tokudb::memory::free(row_descriptor.data); if (error) break; - // for all trees that have values, make an update variable offsets message and broadcast it into the tree + // for all trees that have values, make an update variable offsets + // message and broadcast it into the tree if (i == primary_key || key_is_clustering(&table_share->key_info[i])) { - uint32_t offset_start = table_share->null_bytes + share->kc_info.mcp_info[i].fixed_field_size; - uint32_t offset_end = offset_start + share->kc_info.mcp_info[i].len_of_offsets; + uint32_t offset_start = + table_share->null_bytes + + share->kc_info.mcp_info[i].fixed_field_size; + uint32_t offset_end = + offset_start + + share->kc_info.mcp_info[i].len_of_offsets; uint32_t number_of_offsets = offset_end - offset_start; // make the expand variable offsets message DBT expand; memset(&expand, 0, sizeof expand); - expand.size = sizeof (uchar) + sizeof offset_start + sizeof offset_end; - expand.data = tokudb_my_malloc(expand.size, MYF(MY_WME)); + expand.size = + sizeof(uchar) + sizeof(offset_start) + sizeof(offset_end); + expand.data = tokudb::memory::malloc(expand.size, MYF(MY_WME)); if (!expand.data) { error = ENOMEM; break; } - uchar *expand_ptr = (uchar *)expand.data; + uchar* expand_ptr = (uchar*)expand.data; expand_ptr[0] = UPDATE_OP_EXPAND_VARIABLE_OFFSETS; - expand_ptr += sizeof (uchar); + expand_ptr += sizeof(uchar); - memcpy(expand_ptr, &number_of_offsets, sizeof number_of_offsets); - expand_ptr += sizeof number_of_offsets; + memcpy(expand_ptr, &number_of_offsets, sizeof(number_of_offsets)); + expand_ptr += sizeof(number_of_offsets); - memcpy(expand_ptr, &offset_start, sizeof offset_start); - expand_ptr += sizeof offset_start; + memcpy(expand_ptr, &offset_start, sizeof(offset_start)); + expand_ptr += sizeof(offset_start); // and broadcast it into the tree - error = share->key_file[i]->update_broadcast(share->key_file[i], ctx->alter_txn, &expand, DB_IS_RESETTING_OP); - tokudb_my_free(expand.data); + error = share->key_file[i]->update_broadcast( + share->key_file[i], + ctx->alter_txn, + &expand, + DB_IS_RESETTING_OP); + tokudb::memory::free(expand.data); if (error) break; } @@ -817,7 +1123,7 @@ int ha_tokudb::alter_table_expand_varchar_offsets(TABLE *altered_table, Alter_in // Return true if a field is part of a key static bool field_in_key(KEY *key, Field *field) { - for (uint i = 0; i < get_key_parts(key); i++) { + for (uint i = 0; i < key->user_defined_key_parts; i++) { KEY_PART_INFO *key_part = &key->key_part[i]; if (strcmp(key_part->field->field_name, field->field_name) == 0) return true; @@ -834,30 +1140,49 @@ static bool field_in_key_of_table(TABLE *table, Field *field) { return false; } -// Return true if all changed varchar/varbinary field lengths can be changed inplace, otherwise return false -static bool change_varchar_length_is_supported(Field *old_field, Field *new_field, TABLE *table, TABLE *altered_table, Alter_inplace_info *ha_alter_info, tokudb_alter_ctx *ctx) { +// Return true if all changed varchar/varbinary field lengths can be changed +// inplace, otherwise return false +static bool change_varchar_length_is_supported( + Field* old_field, + Field* new_field, + TABLE* table, + TABLE* altered_table, + Alter_inplace_info* ha_alter_info, + tokudb_alter_ctx* ctx) { + if (old_field->real_type() != MYSQL_TYPE_VARCHAR || new_field->real_type() != MYSQL_TYPE_VARCHAR || old_field->binary() != new_field->binary() || old_field->charset()->number != new_field->charset()->number || old_field->field_length > new_field->field_length) return false; - if (ctx->table_kc_info->num_offset_bytes > ctx->altered_table_kc_info->num_offset_bytes) + if (ctx->table_kc_info->num_offset_bytes > + ctx->altered_table_kc_info->num_offset_bytes) return false; // shrink is not supported - if (ctx->table_kc_info->num_offset_bytes < ctx->altered_table_kc_info->num_offset_bytes) - ctx->expand_varchar_update_needed = true; // sum of varchar lengths changed from 1 to 2 + if (ctx->table_kc_info->num_offset_bytes < + ctx->altered_table_kc_info->num_offset_bytes) + // sum of varchar lengths changed from 1 to 2 + ctx->expand_varchar_update_needed = true; return true; } -// Return true if all changed field lengths can be changed inplace, otherwise return false -static bool change_length_is_supported(TABLE *table, TABLE *altered_table, Alter_inplace_info *ha_alter_info, tokudb_alter_ctx *ctx) { +// Return true if all changed field lengths can be changed inplace, otherwise +// return false +static bool change_length_is_supported( + TABLE* table, + TABLE* altered_table, + Alter_inplace_info* ha_alter_info, + tokudb_alter_ctx* ctx) { + if (table->s->fields != altered_table->s->fields) return false; if (table->s->null_bytes != altered_table->s->null_bytes) return false; if (ctx->changed_fields.elements() > 1) return false; // only support one field change - for (DYNAMIC_ARRAY_ELEMENTS_TYPE ai = 0; ai < ctx->changed_fields.elements(); ai++) { + for (DYNAMIC_ARRAY_ELEMENTS_TYPE ai = 0; + ai < ctx->changed_fields.elements(); + ai++) { uint i = ctx->changed_fields.at(ai); Field *old_field = table->field[i]; Field *new_field = altered_table->field[i]; @@ -865,9 +1190,16 @@ static bool change_length_is_supported(TABLE *table, TABLE *altered_table, Alter return false; // no type conversions if (old_field->real_type() != MYSQL_TYPE_VARCHAR) return false; // only varchar - if (field_in_key_of_table(table, old_field) || field_in_key_of_table(altered_table, new_field)) + if (field_in_key_of_table(table, old_field) || + field_in_key_of_table(altered_table, new_field)) return false; // not in any key - if (!change_varchar_length_is_supported(old_field, new_field, table, altered_table, ha_alter_info, ctx)) + if (!change_varchar_length_is_supported( + old_field, + new_field, + table, + altered_table, + ha_alter_info, + ctx)) return false; } @@ -886,13 +1218,23 @@ static bool is_sorted(Dynamic_array &a) { return r; } -int ha_tokudb::alter_table_expand_columns(TABLE *altered_table, Alter_inplace_info *ha_alter_info) { +int ha_tokudb::alter_table_expand_columns( + TABLE* altered_table, + Alter_inplace_info* ha_alter_info) { + int error = 0; - tokudb_alter_ctx *ctx = static_cast(ha_alter_info->handler_ctx); - assert(is_sorted(ctx->changed_fields)); // since we build the changed_fields array in field order, it must be sorted - for (DYNAMIC_ARRAY_ELEMENTS_TYPE ai = 0; error == 0 && ai < ctx->changed_fields.elements(); ai++) { + tokudb_alter_ctx* ctx = + static_cast(ha_alter_info->handler_ctx); + // since we build the changed_fields array in field order, it must be sorted + assert_always(is_sorted(ctx->changed_fields)); + for (DYNAMIC_ARRAY_ELEMENTS_TYPE ai = 0; + error == 0 && ai < ctx->changed_fields.elements(); + ai++) { uint expand_field_num = ctx->changed_fields.at(ai); - error = alter_table_expand_one_column(altered_table, ha_alter_info, expand_field_num); + error = alter_table_expand_one_column( + altered_table, + ha_alter_info, + expand_field_num); } return error; @@ -903,10 +1245,15 @@ static bool is_unsigned(Field *f) { return (f->flags & UNSIGNED_FLAG) != 0; } -// Return the starting offset in the value for a particular index (selected by idx) of a -// particular field (selected by expand_field_num) +// Return the starting offset in the value for a particular index (selected by +// idx) of a particular field (selected by expand_field_num) // TODO: replace this? -static uint32_t alter_table_field_offset(uint32_t null_bytes, KEY_AND_COL_INFO *kc_info, int idx, int expand_field_num) { +static uint32_t alter_table_field_offset( + uint32_t null_bytes, + KEY_AND_COL_INFO* kc_info, + int idx, + int expand_field_num) { + uint32_t offset = null_bytes; for (int i = 0; i < expand_field_num; i++) { if (bitmap_is_set(&kc_info->key_filters[idx], i)) // skip key fields @@ -917,21 +1264,26 @@ static uint32_t alter_table_field_offset(uint32_t null_bytes, KEY_AND_COL_INFO * } // Send an expand message into all clustered indexes including the primary -int ha_tokudb::alter_table_expand_one_column(TABLE *altered_table, Alter_inplace_info *ha_alter_info, int expand_field_num) { +int ha_tokudb::alter_table_expand_one_column( + TABLE* altered_table, + Alter_inplace_info* ha_alter_info, + int expand_field_num) { + int error = 0; - tokudb_alter_ctx *ctx = static_cast(ha_alter_info->handler_ctx); + tokudb_alter_ctx* ctx = + static_cast(ha_alter_info->handler_ctx); Field *old_field = table->field[expand_field_num]; TOKU_TYPE old_field_type = mysql_to_toku_type(old_field); Field *new_field = altered_table->field[expand_field_num]; TOKU_TYPE new_field_type = mysql_to_toku_type(new_field); - assert(old_field_type == new_field_type); + assert_always(old_field_type == new_field_type); uchar operation; uchar pad_char; switch (old_field_type) { case toku_type_int: - assert(is_unsigned(old_field) == is_unsigned(new_field)); + assert_always(is_unsigned(old_field) == is_unsigned(new_field)); if (is_unsigned(old_field)) operation = UPDATE_OP_EXPAND_UINT; else @@ -947,38 +1299,61 @@ int ha_tokudb::alter_table_expand_one_column(TABLE *altered_table, Alter_inplace pad_char = 0; break; default: - assert(0); + assert_unreachable(); } uint32_t curr_num_DBs = table->s->keys + tokudb_test(hidden_primary_key); for (uint32_t i = 0; i < curr_num_DBs; i++) { // change to a new descriptor DBT row_descriptor; memset(&row_descriptor, 0, sizeof row_descriptor); - error = new_row_descriptor(table, altered_table, ha_alter_info, i, &row_descriptor); + error = new_row_descriptor( + table, + altered_table, + ha_alter_info, + i, + &row_descriptor); if (error) break; - error = share->key_file[i]->change_descriptor(share->key_file[i], ctx->alter_txn, &row_descriptor, 0); - tokudb_my_free(row_descriptor.data); + error = share->key_file[i]->change_descriptor( + share->key_file[i], + ctx->alter_txn, + &row_descriptor, + 0); + tokudb::memory::free(row_descriptor.data); if (error) break; - // for all trees that have values, make an expand update message and broadcast it into the tree + // for all trees that have values, make an expand update message and + // broadcast it into the tree if (i == primary_key || key_is_clustering(&table_share->key_info[i])) { - uint32_t old_offset = alter_table_field_offset(table_share->null_bytes, ctx->table_kc_info, i, expand_field_num); - uint32_t new_offset = alter_table_field_offset(table_share->null_bytes, ctx->altered_table_kc_info, i, expand_field_num); - assert(old_offset <= new_offset); + uint32_t old_offset = alter_table_field_offset( + table_share->null_bytes, + ctx->table_kc_info, + i, + expand_field_num); + uint32_t new_offset = alter_table_field_offset( + table_share->null_bytes, + ctx->altered_table_kc_info, + i, + expand_field_num); + assert_always(old_offset <= new_offset); - uint32_t old_length = ctx->table_kc_info->field_lengths[expand_field_num]; - assert(old_length == old_field->pack_length()); + uint32_t old_length = + ctx->table_kc_info->field_lengths[expand_field_num]; + assert_always(old_length == old_field->pack_length()); - uint32_t new_length = ctx->altered_table_kc_info->field_lengths[expand_field_num]; - assert(new_length == new_field->pack_length()); + uint32_t new_length = + ctx->altered_table_kc_info->field_lengths[expand_field_num]; + assert_always(new_length == new_field->pack_length()); - DBT expand; memset(&expand, 0, sizeof expand); - expand.size = sizeof operation + sizeof new_offset + sizeof old_length + sizeof new_length; - if (operation == UPDATE_OP_EXPAND_CHAR || operation == UPDATE_OP_EXPAND_BINARY) - expand.size += sizeof pad_char; - expand.data = tokudb_my_malloc(expand.size, MYF(MY_WME)); + DBT expand; memset(&expand, 0, sizeof(expand)); + expand.size = + sizeof(operation) + sizeof(new_offset) + + sizeof(old_length) + sizeof(new_length); + if (operation == UPDATE_OP_EXPAND_CHAR || + operation == UPDATE_OP_EXPAND_BINARY) + expand.size += sizeof(pad_char); + expand.data = tokudb::memory::malloc(expand.size, MYF(MY_WME)); if (!expand.data) { error = ENOMEM; break; @@ -987,27 +1362,34 @@ int ha_tokudb::alter_table_expand_one_column(TABLE *altered_table, Alter_inplace expand_ptr[0] = operation; expand_ptr += sizeof operation; - // for the first altered field, old_offset == new_offset. for the subsequent altered fields, the new_offset - // should be used as it includes the length changes from the previous altered fields. - memcpy(expand_ptr, &new_offset, sizeof new_offset); - expand_ptr += sizeof new_offset; + // for the first altered field, old_offset == new_offset. + // for the subsequent altered fields, the new_offset + // should be used as it includes the length changes from the + // previous altered fields. + memcpy(expand_ptr, &new_offset, sizeof(new_offset)); + expand_ptr += sizeof(new_offset); - memcpy(expand_ptr, &old_length, sizeof old_length); - expand_ptr += sizeof old_length; + memcpy(expand_ptr, &old_length, sizeof(old_length)); + expand_ptr += sizeof(old_length); - memcpy(expand_ptr, &new_length, sizeof new_length); - expand_ptr += sizeof new_length; + memcpy(expand_ptr, &new_length, sizeof(new_length)); + expand_ptr += sizeof(new_length); - if (operation == UPDATE_OP_EXPAND_CHAR || operation == UPDATE_OP_EXPAND_BINARY) { - memcpy(expand_ptr, &pad_char, sizeof pad_char); - expand_ptr += sizeof pad_char; + if (operation == UPDATE_OP_EXPAND_CHAR || + operation == UPDATE_OP_EXPAND_BINARY) { + memcpy(expand_ptr, &pad_char, sizeof(pad_char)); + expand_ptr += sizeof(pad_char); } - assert(expand_ptr == (uchar *)expand.data + expand.size); + assert_always(expand_ptr == (uchar*)expand.data + expand.size); // and broadcast it into the tree - error = share->key_file[i]->update_broadcast(share->key_file[i], ctx->alter_txn, &expand, DB_IS_RESETTING_OP); - tokudb_my_free(expand.data); + error = share->key_file[i]->update_broadcast( + share->key_file[i], + ctx->alter_txn, + &expand, + DB_IS_RESETTING_OP); + tokudb::memory::free(expand.data); if (error) break; } @@ -1016,52 +1398,85 @@ int ha_tokudb::alter_table_expand_one_column(TABLE *altered_table, Alter_inplace return error; } -static void marshall_blob_lengths(tokudb::buffer &b, uint32_t n, TABLE *table, KEY_AND_COL_INFO *kc_info) { +static void marshall_blob_lengths( + tokudb::buffer& b, + uint32_t n, + TABLE* table, + KEY_AND_COL_INFO* kc_info) { + for (uint i = 0; i < n; i++) { uint blob_field_index = kc_info->blob_fields[i]; - assert(blob_field_index < table->s->fields); - uint8_t blob_field_length = table->s->field[blob_field_index]->row_pack_length(); + assert_always(blob_field_index < table->s->fields); + uint8_t blob_field_length = + table->s->field[blob_field_index]->row_pack_length(); b.append(&blob_field_length, sizeof blob_field_length); } } -int ha_tokudb::alter_table_expand_blobs(TABLE *altered_table, Alter_inplace_info *ha_alter_info) { +int ha_tokudb::alter_table_expand_blobs( + TABLE* altered_table, + Alter_inplace_info* ha_alter_info) { + int error = 0; - tokudb_alter_ctx *ctx = static_cast(ha_alter_info->handler_ctx); + tokudb_alter_ctx* ctx = + static_cast(ha_alter_info->handler_ctx); uint32_t curr_num_DBs = table->s->keys + tokudb_test(hidden_primary_key); for (uint32_t i = 0; i < curr_num_DBs; i++) { // change to a new descriptor DBT row_descriptor; memset(&row_descriptor, 0, sizeof row_descriptor); - error = new_row_descriptor(table, altered_table, ha_alter_info, i, &row_descriptor); + error = new_row_descriptor( + table, + altered_table, + ha_alter_info, + i, + &row_descriptor); if (error) break; - error = share->key_file[i]->change_descriptor(share->key_file[i], ctx->alter_txn, &row_descriptor, 0); - tokudb_my_free(row_descriptor.data); + error = share->key_file[i]->change_descriptor( + share->key_file[i], + ctx->alter_txn, + &row_descriptor, + 0); + tokudb::memory::free(row_descriptor.data); if (error) break; - // for all trees that have values, make an update blobs message and broadcast it into the tree + // for all trees that have values, make an update blobs message and + // broadcast it into the tree if (i == primary_key || key_is_clustering(&table_share->key_info[i])) { tokudb::buffer b; uint8_t op = UPDATE_OP_EXPAND_BLOB; b.append(&op, sizeof op); - b.append_ui(table->s->null_bytes + ctx->table_kc_info->mcp_info[i].fixed_field_size); - uint32_t var_offset_bytes = ctx->table_kc_info->mcp_info[i].len_of_offsets; + b.append_ui( + table->s->null_bytes + + ctx->table_kc_info->mcp_info[i].fixed_field_size); + uint32_t var_offset_bytes = + ctx->table_kc_info->mcp_info[i].len_of_offsets; b.append_ui(var_offset_bytes); - b.append_ui(var_offset_bytes == 0 ? 0 : ctx->table_kc_info->num_offset_bytes); + b.append_ui( + var_offset_bytes == 0 ? 0 : + ctx->table_kc_info->num_offset_bytes); // add blobs info uint32_t num_blobs = ctx->table_kc_info->num_blobs; b.append_ui(num_blobs); marshall_blob_lengths(b, num_blobs, table, ctx->table_kc_info); - marshall_blob_lengths(b, num_blobs, altered_table, ctx->altered_table_kc_info); + marshall_blob_lengths( + b, + num_blobs, + altered_table, + ctx->altered_table_kc_info); // and broadcast it into the tree DBT expand; memset(&expand, 0, sizeof expand); expand.data = b.data(); expand.size = b.size(); - error = share->key_file[i]->update_broadcast(share->key_file[i], ctx->alter_txn, &expand, DB_IS_RESETTING_OP); + error = share->key_file[i]->update_broadcast( + share->key_file[i], + ctx->alter_txn, + &expand, + DB_IS_RESETTING_OP); if (error) break; } @@ -1071,7 +1486,13 @@ int ha_tokudb::alter_table_expand_blobs(TABLE *altered_table, Alter_inplace_info } // Return true if two fixed length fields can be changed inplace -static bool change_fixed_length_is_supported(TABLE *table, TABLE *altered_table, Field *old_field, Field *new_field, tokudb_alter_ctx *ctx) { +static bool change_fixed_length_is_supported( + TABLE* table, + TABLE* altered_table, + Field* old_field, + Field* new_field, + tokudb_alter_ctx* ctx) { + // no change in size is supported if (old_field->pack_length() == new_field->pack_length()) return true; @@ -1082,9 +1503,16 @@ static bool change_fixed_length_is_supported(TABLE *table, TABLE *altered_table, return true; } -static bool change_blob_length_is_supported(TABLE *table, TABLE *altered_table, Field *old_field, Field *new_field, tokudb_alter_ctx *ctx) { +static bool change_blob_length_is_supported( + TABLE* table, + TABLE* altered_table, + Field* old_field, + Field* new_field, + tokudb_alter_ctx* ctx) { + // blob -> longer or equal length blob - if (old_field->binary() && new_field->binary() && old_field->pack_length() <= new_field->pack_length()) { + if (old_field->binary() && new_field->binary() && + old_field->pack_length() <= new_field->pack_length()) { ctx->expand_blob_update_needed = true; return true; } @@ -1113,13 +1541,26 @@ static bool is_int_type(enum_field_types t) { } // Return true if two field types can be changed inplace -static bool change_field_type_is_supported(Field *old_field, Field *new_field, TABLE *table, TABLE *altered_table, Alter_inplace_info *ha_alter_info, tokudb_alter_ctx *ctx) { +static bool change_field_type_is_supported( + Field* old_field, + Field* new_field, + TABLE* table, + TABLE* altered_table, + Alter_inplace_info* ha_alter_info, + tokudb_alter_ctx* ctx) { + enum_field_types old_type = old_field->real_type(); enum_field_types new_type = new_field->real_type(); if (is_int_type(old_type)) { // int and unsigned int expansion - if (is_int_type(new_type) && is_unsigned(old_field) == is_unsigned(new_field)) - return change_fixed_length_is_supported(table, altered_table, old_field, new_field, ctx); + if (is_int_type(new_type) && + is_unsigned(old_field) == is_unsigned(new_field)) + return change_fixed_length_is_supported( + table, + altered_table, + old_field, + new_field, + ctx); else return false; } else if (old_type == MYSQL_TYPE_STRING) { @@ -1127,67 +1568,112 @@ static bool change_field_type_is_supported(Field *old_field, Field *new_field, T if (new_type == MYSQL_TYPE_STRING && old_field->binary() == new_field->binary() && old_field->charset()->number == new_field->charset()->number) - return change_fixed_length_is_supported(table, altered_table, old_field, new_field, ctx); + return change_fixed_length_is_supported( + table, + altered_table, + old_field, + new_field, + ctx); else return false; } else if (old_type == MYSQL_TYPE_VARCHAR) { - // varchar(X) -> varchar(Y) and varbinary(X) -> varbinary(Y) expansion where X < 256 <= Y - // the ALTER_COLUMN_TYPE handler flag is set for these cases - return change_varchar_length_is_supported(old_field, new_field, table, altered_table, ha_alter_info, ctx); + // varchar(X) -> varchar(Y) and varbinary(X) -> varbinary(Y) expansion + // where X < 256 <= Y the ALTER_COLUMN_TYPE handler flag is set for + // these cases + return change_varchar_length_is_supported( + old_field, + new_field, + table, + altered_table, + ha_alter_info, + ctx); } else if (old_type == MYSQL_TYPE_BLOB && new_type == MYSQL_TYPE_BLOB) { - return change_blob_length_is_supported(table, altered_table, old_field, new_field, ctx); + return change_blob_length_is_supported( + table, + altered_table, + old_field, + new_field, + ctx); } else return false; } // Return true if all changed field types can be changed inplace -static bool change_type_is_supported(TABLE *table, TABLE *altered_table, Alter_inplace_info *ha_alter_info, tokudb_alter_ctx *ctx) { +static bool change_type_is_supported( + TABLE* table, + TABLE* altered_table, + Alter_inplace_info* ha_alter_info, + tokudb_alter_ctx* ctx) { + if (table->s->null_bytes != altered_table->s->null_bytes) return false; if (table->s->fields != altered_table->s->fields) return false; if (ctx->changed_fields.elements() > 1) return false; // only support one field change - for (DYNAMIC_ARRAY_ELEMENTS_TYPE ai = 0; ai < ctx->changed_fields.elements(); ai++) { + for (DYNAMIC_ARRAY_ELEMENTS_TYPE ai = 0; + ai < ctx->changed_fields.elements(); + ai++) { uint i = ctx->changed_fields.at(ai); Field *old_field = table->field[i]; Field *new_field = altered_table->field[i]; - if (field_in_key_of_table(table, old_field) || field_in_key_of_table(altered_table, new_field)) + if (field_in_key_of_table(table, old_field) || + field_in_key_of_table(altered_table, new_field)) return false; - if (!change_field_type_is_supported(old_field, new_field, table, altered_table, ha_alter_info, ctx)) + if (!change_field_type_is_supported( + old_field, + new_field, + table, + altered_table, + ha_alter_info, + ctx)) return false; } return true; } -// Allocate and initialize a new descriptor for a dictionary in the altered table identified with idx. +// Allocate and initialize a new descriptor for a dictionary in the altered +// table identified with idx. // Return the new descriptor in the row_descriptor DBT. // Return non-zero on error. -int ha_tokudb::new_row_descriptor(TABLE *table, TABLE *altered_table, Alter_inplace_info *ha_alter_info, uint32_t idx, DBT *row_descriptor) { +int ha_tokudb::new_row_descriptor( + TABLE* table, + TABLE* altered_table, + Alter_inplace_info* ha_alter_info, + uint32_t idx, + DBT* row_descriptor) { + int error = 0; - tokudb_alter_ctx *ctx = static_cast(ha_alter_info->handler_ctx); - row_descriptor->size = get_max_desc_size(ctx->altered_table_kc_info, altered_table); - row_descriptor->data = (uchar *) tokudb_my_malloc(row_descriptor->size, MYF(MY_WME)); + tokudb_alter_ctx* ctx = + static_cast(ha_alter_info->handler_ctx); + row_descriptor->size = + get_max_desc_size(ctx->altered_table_kc_info, altered_table); + row_descriptor->data = + (uchar*)tokudb::memory::malloc(row_descriptor->size, MYF(MY_WME)); if (row_descriptor->data == NULL) { error = ENOMEM; } else { - KEY* prim_key = hidden_primary_key ? NULL : &altered_table->s->key_info[primary_key]; + KEY* prim_key = + hidden_primary_key ? NULL : + &altered_table->s->key_info[primary_key]; if (idx == primary_key) { - row_descriptor->size = create_main_key_descriptor((uchar *)row_descriptor->data, - prim_key, - hidden_primary_key, - primary_key, - altered_table, - ctx->altered_table_kc_info); + row_descriptor->size = create_main_key_descriptor( + (uchar*)row_descriptor->data, + prim_key, + hidden_primary_key, + primary_key, + altered_table, + ctx->altered_table_kc_info); } else { - row_descriptor->size = create_secondary_key_descriptor((uchar *)row_descriptor->data, - &altered_table->key_info[idx], - prim_key, - hidden_primary_key, - altered_table, - primary_key, - idx, - ctx->altered_table_kc_info); + row_descriptor->size = create_secondary_key_descriptor( + (uchar*)row_descriptor->data, + &altered_table->key_info[idx], + prim_key, + hidden_primary_key, + altered_table, + primary_key, + idx, + ctx->altered_table_kc_info); } error = 0; } diff --git a/storage/tokudb/ha_tokudb_alter_common.cc b/storage/tokudb/ha_tokudb_alter_common.cc index b2c2a2b0252..d41a676de1f 100644 --- a/storage/tokudb/ha_tokudb_alter_common.cc +++ b/storage/tokudb/ha_tokudb_alter_common.cc @@ -26,8 +26,18 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #if !defined(TOKUDB_ALTER_COMMON) #define TOKUDB_ALTER_COMMON -static bool tables_have_same_keys(TABLE* table, TABLE* altered_table, bool print_error, bool check_field_index) __attribute__((unused)); -static bool tables_have_same_keys(TABLE* table, TABLE* altered_table, bool print_error, bool check_field_index) { +TOKUDB_UNUSED(static bool tables_have_same_keys( + TABLE* table, + TABLE* altered_table, + bool print_error, + bool check_field_index)); + +static bool tables_have_same_keys( + TABLE* table, + TABLE* altered_table, + bool print_error, + bool check_field_index) { + bool retval; if (table->s->keys != altered_table->s->keys) { if (print_error) { @@ -39,10 +49,9 @@ static bool tables_have_same_keys(TABLE* table, TABLE* altered_table, bool print if (table->s->primary_key != altered_table->s->primary_key) { if (print_error) { sql_print_error( - "Tables have different primary keys, %d %d", + "Tables have different primary keys, %d %d", table->s->primary_key, - altered_table->s->primary_key - ); + altered_table->s->primary_key); } retval = false; goto cleanup; @@ -53,44 +62,43 @@ static bool tables_have_same_keys(TABLE* table, TABLE* altered_table, bool print if (strcmp(curr_orig_key->name, curr_altered_key->name)) { if (print_error) { sql_print_error( - "key %d has different name, %s %s", - i, + "key %d has different name, %s %s", + i, curr_orig_key->name, - curr_altered_key->name - ); + curr_altered_key->name); } retval = false; goto cleanup; } - if (key_is_clustering(curr_orig_key) != key_is_clustering(curr_altered_key)) { + if (key_is_clustering(curr_orig_key) != + key_is_clustering(curr_altered_key)) { if (print_error) { sql_print_error( "keys disagree on if they are clustering, %d, %d", - get_key_parts(curr_orig_key), - get_key_parts(curr_altered_key) - ); + curr_orig_key->user_defined_key_parts, + curr_altered_key->user_defined_key_parts); } retval = false; goto cleanup; } - if (((curr_orig_key->flags & HA_NOSAME) == 0) != ((curr_altered_key->flags & HA_NOSAME) == 0)) { + if (((curr_orig_key->flags & HA_NOSAME) == 0) != + ((curr_altered_key->flags & HA_NOSAME) == 0)) { if (print_error) { sql_print_error( "keys disagree on if they are unique, %d, %d", - get_key_parts(curr_orig_key), - get_key_parts(curr_altered_key) - ); + curr_orig_key->user_defined_key_parts, + curr_altered_key->user_defined_key_parts); } retval = false; goto cleanup; } - if (get_key_parts(curr_orig_key) != get_key_parts(curr_altered_key)) { + if (curr_orig_key->user_defined_key_parts != + curr_altered_key->user_defined_key_parts) { if (print_error) { sql_print_error( "keys have different number of parts, %d, %d", - get_key_parts(curr_orig_key), - get_key_parts(curr_altered_key) - ); + curr_orig_key->user_defined_key_parts, + curr_altered_key->user_defined_key_parts); } retval = false; goto cleanup; @@ -98,7 +106,7 @@ static bool tables_have_same_keys(TABLE* table, TABLE* altered_table, bool print // // now verify that each field in the key is the same // - for (uint32_t j = 0; j < get_key_parts(curr_orig_key); j++) { + for (uint32_t j = 0; j < curr_orig_key->user_defined_key_parts; j++) { KEY_PART_INFO* curr_orig_part = &curr_orig_key->key_part[j]; KEY_PART_INFO* curr_altered_part = &curr_altered_key->key_part[j]; Field* curr_orig_field = curr_orig_part->field; @@ -106,10 +114,9 @@ static bool tables_have_same_keys(TABLE* table, TABLE* altered_table, bool print if (curr_orig_part->length != curr_altered_part->length) { if (print_error) { sql_print_error( - "Key %s has different length at index %d", - curr_orig_key->name, - j - ); + "Key %s has different length at index %d", + curr_orig_key->name, + j); } retval = false; goto cleanup; @@ -123,10 +130,9 @@ static bool tables_have_same_keys(TABLE* table, TABLE* altered_table, bool print if (!are_fields_same) { if (print_error) { sql_print_error( - "Key %s has different field at index %d", - curr_orig_key->name, - j - ); + "Key %s has different field at index %d", + curr_orig_key->name, + j); } retval = false; goto cleanup; @@ -143,7 +149,8 @@ cleanup: // to evaluate whether a field is NULL or not. This value is a power of 2, from // 2^0 to 2^7. We return the position of the bit within the byte, which is // lg null_bit -static inline uint32_t get_null_bit_position(uint32_t null_bit) __attribute__((unused)); +TOKUDB_UNUSED(static inline uint32_t get_null_bit_position( + uint32_t null_bit)); static inline uint32_t get_null_bit_position(uint32_t null_bit) { uint32_t retval = 0; switch(null_bit) { @@ -170,23 +177,28 @@ static inline uint32_t get_null_bit_position(uint32_t null_bit) { break; case (128): retval = 7; - break; + break; default: - assert(false); + assert_unreachable(); } return retval; } // returns the index of the null bit of field. -static inline uint32_t get_overall_null_bit_position(TABLE* table, Field* field) __attribute__((unused)); -static inline uint32_t get_overall_null_bit_position(TABLE* table, Field* field) { +TOKUDB_UNUSED(static inline uint32_t get_overall_null_bit_position( + TABLE* table, + Field* field)); +static inline uint32_t get_overall_null_bit_position( + TABLE* table, + Field* field) { + uint32_t offset = get_null_offset(table, field); uint32_t null_bit = field->null_bit; return offset*8 + get_null_bit_position(null_bit); } // not static since 51 uses this and 56 does not -static bool are_null_bits_in_order(TABLE* table) __attribute__((unused)); +TOKUDB_UNUSED(static bool are_null_bits_in_order(TABLE* table)); static bool are_null_bits_in_order(TABLE* table) { uint32_t curr_null_pos = 0; bool first = true; @@ -195,10 +207,8 @@ static bool are_null_bits_in_order(TABLE* table) { Field* curr_field = table->field[i]; bool nullable = (curr_field->null_bit != 0); if (nullable) { - uint32_t pos = get_overall_null_bit_position( - table, - curr_field - ); + uint32_t pos = + get_overall_null_bit_position(table, curr_field); if (!first && pos != curr_null_pos+1){ retval = false; break; @@ -210,34 +220,38 @@ static bool are_null_bits_in_order(TABLE* table) { return retval; } -static uint32_t get_first_null_bit_pos(TABLE* table) __attribute__((unused)); +TOKUDB_UNUSED(static uint32_t get_first_null_bit_pos(TABLE* table)); static uint32_t get_first_null_bit_pos(TABLE* table) { uint32_t table_pos = 0; for (uint i = 0; i < table->s->fields; i++) { Field* curr_field = table->field[i]; bool nullable = (curr_field->null_bit != 0); if (nullable) { - table_pos = get_overall_null_bit_position( - table, - curr_field - ); + table_pos = + get_overall_null_bit_position(table, curr_field); break; } } return table_pos; } -static bool is_column_default_null(TABLE* src_table, uint32_t field_index) __attribute__((unused)); -static bool is_column_default_null(TABLE* src_table, uint32_t field_index) { +TOKUDB_UNUSED(static bool is_column_default_null( + TABLE* src_table, + uint32_t field_index)); +static bool is_column_default_null( + TABLE* src_table, + uint32_t field_index) { + Field* curr_field = src_table->field[field_index]; bool is_null_default = false; bool nullable = curr_field->null_bit != 0; if (nullable) { - uint32_t null_bit_position = get_overall_null_bit_position(src_table, curr_field); - is_null_default = is_overall_null_position_set( - src_table->s->default_values, - null_bit_position - ); + uint32_t null_bit_position = + get_overall_null_bit_position(src_table, curr_field); + is_null_default = + is_overall_null_position_set( + src_table->s->default_values, + null_bit_position); } return is_null_default; } @@ -248,9 +262,8 @@ static uint32_t fill_static_row_mutator( TABLE* altered_table, KEY_AND_COL_INFO* orig_kc_info, KEY_AND_COL_INFO* altered_kc_info, - uint32_t keynr - ) -{ + uint32_t keynr) { + // // start packing extra // @@ -258,25 +271,28 @@ static uint32_t fill_static_row_mutator( // says what the operation is pos[0] = UP_COL_ADD_OR_DROP; pos++; - + // // null byte information // memcpy(pos, &orig_table->s->null_bytes, sizeof(orig_table->s->null_bytes)); pos += sizeof(orig_table->s->null_bytes); - memcpy(pos, &altered_table->s->null_bytes, sizeof(orig_table->s->null_bytes)); + memcpy( + pos, + &altered_table->s->null_bytes, + sizeof(orig_table->s->null_bytes)); pos += sizeof(altered_table->s->null_bytes); - + // // num_offset_bytes // - assert(orig_kc_info->num_offset_bytes <= 2); + assert_always(orig_kc_info->num_offset_bytes <= 2); pos[0] = orig_kc_info->num_offset_bytes; pos++; - assert(altered_kc_info->num_offset_bytes <= 2); + assert_always(altered_kc_info->num_offset_bytes <= 2); pos[0] = altered_kc_info->num_offset_bytes; pos++; - + // // size of fixed fields // @@ -286,7 +302,7 @@ static uint32_t fill_static_row_mutator( fixed_field_size = altered_kc_info->mcp_info[keynr].fixed_field_size; memcpy(pos, &fixed_field_size, sizeof(fixed_field_size)); pos += sizeof(fixed_field_size); - + // // length of offsets // @@ -304,7 +320,7 @@ static uint32_t fill_static_row_mutator( memcpy(pos, &altered_start_null_pos, sizeof(altered_start_null_pos)); pos += sizeof(altered_start_null_pos); - assert((pos-buf) == STATIC_ROW_MUTATOR_SIZE); + assert_always((pos-buf) == STATIC_ROW_MUTATOR_SIZE); return pos - buf; } @@ -316,9 +332,8 @@ static uint32_t fill_dynamic_row_mutator( KEY_AND_COL_INFO* src_kc_info, uint32_t keynr, bool is_add, - bool* out_has_blobs - ) -{ + bool* out_has_blobs) { + uchar* pos = buf; bool has_blobs = false; uint32_t cols = num_columns; @@ -327,7 +342,7 @@ static uint32_t fill_dynamic_row_mutator( for (uint32_t i = 0; i < num_columns; i++) { uint32_t curr_index = columns[i]; Field* curr_field = src_table->field[curr_index]; - + pos[0] = is_add ? COL_ADD : COL_DROP; pos++; // @@ -338,22 +353,22 @@ static uint32_t fill_dynamic_row_mutator( if (!nullable) { pos[0] = 0; pos++; - } - else { + } else { pos[0] = 1; pos++; // write position of null byte that is to be removed - uint32_t null_bit_position = get_overall_null_bit_position(src_table, curr_field); + uint32_t null_bit_position = + get_overall_null_bit_position(src_table, curr_field); memcpy(pos, &null_bit_position, sizeof(null_bit_position)); pos += sizeof(null_bit_position); // // if adding a column, write the value of the default null_bit // if (is_add) { - is_null_default = is_overall_null_position_set( - src_table->s->default_values, - null_bit_position - ); + is_null_default = + is_overall_null_position_set( + src_table->s->default_values, + null_bit_position); pos[0] = is_null_default ? 1 : 0; pos++; } @@ -364,7 +379,8 @@ static uint32_t fill_dynamic_row_mutator( pos[0] = COL_FIXED; pos++; //store the offset - uint32_t fixed_field_offset = src_kc_info->cp_info[keynr][curr_index].col_pack_val; + uint32_t fixed_field_offset = + src_kc_info->cp_info[keynr][curr_index].col_pack_val; memcpy(pos, &fixed_field_offset, sizeof(fixed_field_offset)); pos += sizeof(fixed_field_offset); //store the number of bytes @@ -374,38 +390,35 @@ static uint32_t fill_dynamic_row_mutator( if (is_add && !is_null_default) { uint curr_field_offset = field_offset(curr_field, src_table); memcpy( - pos, - src_table->s->default_values + curr_field_offset, - num_bytes - ); + pos, + src_table->s->default_values + curr_field_offset, + num_bytes); pos += num_bytes; } - } - else if (is_variable_field(src_kc_info, curr_index)) { + } else if (is_variable_field(src_kc_info, curr_index)) { pos[0] = COL_VAR; pos++; //store the index of the variable column - uint32_t var_field_index = src_kc_info->cp_info[keynr][curr_index].col_pack_val; + uint32_t var_field_index = + src_kc_info->cp_info[keynr][curr_index].col_pack_val; memcpy(pos, &var_field_index, sizeof(var_field_index)); pos += sizeof(var_field_index); if (is_add && !is_null_default) { uint curr_field_offset = field_offset(curr_field, src_table); uint32_t len_bytes = src_kc_info->length_bytes[curr_index]; - uint32_t data_length = get_var_data_length( - src_table->s->default_values + curr_field_offset, - len_bytes - ); + uint32_t data_length = + get_var_data_length( + src_table->s->default_values + curr_field_offset, + len_bytes); memcpy(pos, &data_length, sizeof(data_length)); pos += sizeof(data_length); memcpy( pos, src_table->s->default_values + curr_field_offset + len_bytes, - data_length - ); + data_length); pos += data_length; } - } - else { + } else { pos[0] = COL_BLOB; pos++; has_blobs = true; @@ -418,9 +431,8 @@ static uint32_t fill_dynamic_row_mutator( static uint32_t fill_static_blob_row_mutator( uchar* buf, TABLE* src_table, - KEY_AND_COL_INFO* src_kc_info - ) -{ + KEY_AND_COL_INFO* src_kc_info) { + uchar* pos = buf; // copy number of blobs memcpy(pos, &src_kc_info->num_blobs, sizeof(src_kc_info->num_blobs)); @@ -430,11 +442,11 @@ static uint32_t fill_static_blob_row_mutator( uint32_t curr_field_index = src_kc_info->blob_fields[i]; Field* field = src_table->field[curr_field_index]; uint32_t len_bytes = field->row_pack_length(); - assert(len_bytes <= 4); + assert_always(len_bytes <= 4); pos[0] = len_bytes; pos++; } - + return pos-buf; } @@ -444,9 +456,8 @@ static uint32_t fill_dynamic_blob_row_mutator( uint32_t num_columns, TABLE* src_table, KEY_AND_COL_INFO* src_kc_info, - bool is_add - ) -{ + bool is_add) { + uchar* pos = buf; for (uint32_t i = 0; i < num_columns; i++) { uint32_t curr_field_index = columns[i]; @@ -461,19 +472,19 @@ static uint32_t fill_dynamic_blob_row_mutator( } } // assert we found blob in list - assert(blob_index < src_kc_info->num_blobs); + assert_always(blob_index < src_kc_info->num_blobs); pos[0] = is_add ? COL_ADD : COL_DROP; pos++; memcpy(pos, &blob_index, sizeof(blob_index)); pos += sizeof(blob_index); if (is_add) { uint32_t len_bytes = curr_field->row_pack_length(); - assert(len_bytes <= 4); + assert_always(len_bytes <= 4); pos[0] = len_bytes; pos++; - // create a zero length blob field that can be directly copied in - // for now, in MySQL, we can only have blob fields + // create a zero length blob field that can be directly copied + // in for now, in MySQL, we can only have blob fields // that have no default value memset(pos, 0, len_bytes); pos += len_bytes; @@ -487,93 +498,86 @@ static uint32_t fill_dynamic_blob_row_mutator( // TODO: namely, when do we get stuff from share->kc_info and when we get // TODO: it from altered_kc_info, and when is keynr associated with the right thing uint32_t ha_tokudb::fill_row_mutator( - uchar* buf, - uint32_t* columns, + uchar* buf, + uint32_t* columns, uint32_t num_columns, TABLE* altered_table, KEY_AND_COL_INFO* altered_kc_info, uint32_t keynr, - bool is_add - ) -{ - if (tokudb_debug & TOKUDB_DEBUG_ALTER_TABLE) { - printf("*****some info:*************\n"); - printf( - "old things: num_null_bytes %d, num_offset_bytes %d, fixed_field_size %d, fixed_field_size %d\n", + bool is_add) { + + if (TOKUDB_UNLIKELY(TOKUDB_DEBUG_FLAGS(TOKUDB_DEBUG_ALTER_TABLE))) { + TOKUDB_HANDLER_TRACE("*****some info:*************"); + TOKUDB_HANDLER_TRACE( + "old things: num_null_bytes %d, num_offset_bytes %d, " + "fixed_field_size %d, fixed_field_size %d", table->s->null_bytes, share->kc_info.num_offset_bytes, share->kc_info.mcp_info[keynr].fixed_field_size, - share->kc_info.mcp_info[keynr].len_of_offsets - ); - printf( - "new things: num_null_bytes %d, num_offset_bytes %d, fixed_field_size %d, fixed_field_size %d\n", + share->kc_info.mcp_info[keynr].len_of_offsets); + TOKUDB_HANDLER_TRACE( + "new things: num_null_bytes %d, num_offset_bytes %d, " + "fixed_field_size %d, fixed_field_size %d", altered_table->s->null_bytes, altered_kc_info->num_offset_bytes, altered_kc_info->mcp_info[keynr].fixed_field_size, - altered_kc_info->mcp_info[keynr].len_of_offsets - ); - printf("****************************\n"); + altered_kc_info->mcp_info[keynr].len_of_offsets); + TOKUDB_HANDLER_TRACE("****************************"); } uchar* pos = buf; bool has_blobs = false; - pos += fill_static_row_mutator( - pos, - table, - altered_table, - &share->kc_info, - altered_kc_info, - keynr - ); - - if (is_add) { - pos += fill_dynamic_row_mutator( + pos += + fill_static_row_mutator( pos, - columns, - num_columns, + table, altered_table, - altered_kc_info, - keynr, - is_add, - &has_blobs - ); - } - else { - pos += fill_dynamic_row_mutator( - pos, - columns, - num_columns, - table, &share->kc_info, - keynr, - is_add, - &has_blobs - ); - } - if (has_blobs) { - pos += fill_static_blob_row_mutator( - pos, - table, - &share->kc_info - ); - if (is_add) { - pos += fill_dynamic_blob_row_mutator( + altered_kc_info, + keynr); + + if (is_add) { + pos += + fill_dynamic_row_mutator( pos, columns, num_columns, altered_table, altered_kc_info, - is_add - ); - } - else { - pos += fill_dynamic_blob_row_mutator( + keynr, + is_add, + &has_blobs); + } else { + pos += + fill_dynamic_row_mutator( pos, columns, num_columns, table, &share->kc_info, - is_add - ); + keynr, + is_add, + &has_blobs); + } + if (has_blobs) { + pos += fill_static_blob_row_mutator(pos, table, &share->kc_info); + if (is_add) { + pos += + fill_dynamic_blob_row_mutator( + pos, + columns, + num_columns, + altered_table, + altered_kc_info, + is_add); + } else { + pos += + fill_dynamic_blob_row_mutator( + pos, + columns, + num_columns, + table, + &share->kc_info, + is_add); } } return pos-buf; @@ -583,16 +587,23 @@ static bool all_fields_are_same_type(TABLE *table_a, TABLE *table_b) { if (table_a->s->fields != table_b->s->fields) return false; for (uint i = 0; i < table_a->s->fields; i++) { - Field *field_a = table_a->field[i]; - Field *field_b = table_b->field[i]; + Field* field_a = table_a->field[i]; + Field* field_b = table_b->field[i]; if (!fields_are_same_type(field_a, field_b)) return false; } return true; } -static bool column_rename_supported(TABLE* orig_table, TABLE* new_table, bool alter_column_order) __attribute__((unused)); -static bool column_rename_supported(TABLE* orig_table, TABLE* new_table, bool alter_column_order) { +TOKUDB_UNUSED(static bool column_rename_supported( + TABLE* orig_table, + TABLE* new_table, + bool alter_column_order)); +static bool column_rename_supported( + TABLE* orig_table, + TABLE* new_table, + bool alter_column_order) { + bool retval = false; bool keys_same_for_cr; uint num_fields_with_different_names = 0; @@ -622,20 +633,20 @@ static bool column_rename_supported(TABLE* orig_table, TABLE* new_table, bool al retval = false; goto cleanup; } - assert(field_with_different_name < orig_table->s->fields); + assert_always(field_with_different_name < orig_table->s->fields); // // at this point, we have verified that the two tables have - // the same field types and with ONLY one field with a different name. + // the same field types and with ONLY one field with a different name. // We have also identified the field with the different name // // Now we need to check the indexes // - keys_same_for_cr = tables_have_same_keys( - orig_table, - new_table, - false, - true - ); + keys_same_for_cr = + tables_have_same_keys( + orig_table, + new_table, + false, + true); if (!keys_same_for_cr) { retval = false; goto cleanup; @@ -645,12 +656,21 @@ cleanup: return retval; } -static int find_changed_columns(uint32_t* changed_columns, uint32_t* num_changed_columns, TABLE* smaller_table, TABLE* bigger_table) __attribute__((unused)); -static int find_changed_columns(uint32_t* changed_columns, uint32_t* num_changed_columns, TABLE* smaller_table, TABLE* bigger_table) { +TOKUDB_UNUSED(static int find_changed_columns( + uint32_t* changed_columns, + uint32_t* num_changed_columns, + TABLE* smaller_table, + TABLE* bigger_table)); +static int find_changed_columns( + uint32_t* changed_columns, + uint32_t* num_changed_columns, + TABLE* smaller_table, + TABLE* bigger_table) { + int retval; uint curr_new_col_index = 0; uint32_t curr_num_changed_columns=0; - assert(bigger_table->s->fields > smaller_table->s->fields); + assert_always(bigger_table->s->fields > smaller_table->s->fields); for (uint i = 0; i < smaller_table->s->fields; i++, curr_new_col_index++) { if (curr_new_col_index >= bigger_table->s->fields) { sql_print_error("error in determining changed columns"); @@ -670,15 +690,15 @@ static int find_changed_columns(uint32_t* changed_columns, uint32_t* num_changed goto cleanup; } } - // at this point, curr_field_in_orig and curr_field_in_new should be the same, let's verify - // make sure the two fields that have the same name are ok + // at this point, curr_field_in_orig and curr_field_in_new should be + // the same, let's verify make sure the two fields that have the same + // name are ok if (!are_two_fields_same(curr_field_in_orig, curr_field_in_new)) { sql_print_error( - "Two fields that were supposedly the same are not: \ - %s in original, %s in new", + "Two fields that were supposedly the same are not: %s in " + "original, %s in new", curr_field_in_orig->field_name, - curr_field_in_new->field_name - ); + curr_field_in_new->field_name); retval = 1; goto cleanup; } @@ -693,17 +713,23 @@ cleanup: return retval; } -static bool tables_have_same_keys_and_columns(TABLE* first_table, TABLE* second_table, bool print_error) __attribute__((unused)); -static bool tables_have_same_keys_and_columns(TABLE* first_table, TABLE* second_table, bool print_error) { +TOKUDB_UNUSED(static bool tables_have_same_keys_and_columns( + TABLE* first_table, + TABLE* second_table, + bool print_error)); +static bool tables_have_same_keys_and_columns( + TABLE* first_table, + TABLE* second_table, + bool print_error) { + bool retval; if (first_table->s->null_bytes != second_table->s->null_bytes) { retval = false; if (print_error) { sql_print_error( - "tables have different number of null bytes, %d, %d", - first_table->s->null_bytes, - second_table->s->null_bytes - ); + "tables have different number of null bytes, %d, %d", + first_table->s->null_bytes, + second_table->s->null_bytes); } goto exit; } @@ -711,10 +737,9 @@ static bool tables_have_same_keys_and_columns(TABLE* first_table, TABLE* second_ retval = false; if (print_error) { sql_print_error( - "tables have different number of fields, %d, %d", - first_table->s->fields, - second_table->s->fields - ); + "tables have different number of fields, %d, %d", + first_table->s->fields, + second_table->s->fields); } goto exit; } @@ -724,9 +749,8 @@ static bool tables_have_same_keys_and_columns(TABLE* first_table, TABLE* second_ if (!are_two_fields_same(a,b)) { retval = false; sql_print_error( - "tables have different fields at position %d", - i - ); + "tables have different fields at position %d", + i); goto exit; } } @@ -741,21 +765,29 @@ exit: } #if TOKU_INCLUDE_WRITE_FRM_DATA -// write the new frm data to the status dictionary using the alter table transaction -int ha_tokudb::write_frm_data(const uchar *frm_data, size_t frm_len) { +// write the new frm data to the status dictionary using the alter table +// transaction +int ha_tokudb::write_frm_data(const uchar* frm_data, size_t frm_len) { TOKUDB_DBUG_ENTER("write_frm_data"); int error = 0; if (TOKU_PARTITION_WRITE_FRM_DATA || table->part_info == NULL) { // write frmdata to status - THD *thd = ha_thd(); - tokudb_trx_data *trx = (tokudb_trx_data *) thd_get_ha_data(thd, tokudb_hton); - assert(trx); - DB_TXN *txn = trx->stmt; // use alter table transaction - assert(txn); - error = write_to_status(share->status_block, hatoku_frm_data, (void *)frm_data, (uint)frm_len, txn); + THD* thd = ha_thd(); + tokudb_trx_data* trx = + (tokudb_trx_data*)thd_get_ha_data(thd, tokudb_hton); + assert_always(trx); + DB_TXN* txn = trx->stmt; // use alter table transaction + assert_always(txn); + error = + write_to_status( + share->status_block, + hatoku_frm_data, + (void*)frm_data, + (uint)frm_len, + txn); } - + TOKUDB_DBUG_RETURN(error); } #endif diff --git a/storage/tokudb/ha_tokudb_update.cc b/storage/tokudb/ha_tokudb_update.cc index 1e2d6c0cdbf..23de81f3d8a 100644 --- a/storage/tokudb/ha_tokudb_update.cc +++ b/storage/tokudb/ha_tokudb_update.cc @@ -53,14 +53,19 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. // Replace field_offset // Debug function to dump an Item -static void dump_item(Item *item) { +static void dump_item(Item* item) { fprintf(stderr, "%u", item->type()); switch (item->type()) { case Item::FUNC_ITEM: { - Item_func *func = static_cast(item); + Item_func* func = static_cast(item); uint n = func->argument_count(); - Item **arguments = func->arguments(); - fprintf(stderr, ":func=%u,%s,%u(", func->functype(), func->func_name(), n); + Item** arguments = func->arguments(); + fprintf( + stderr, + ":func=%u,%s,%u(", + func->functype(), + func->func_name(), + n); for (uint i = 0; i < n ; i++) { dump_item(arguments[i]); if (i < n-1) @@ -70,25 +75,30 @@ static void dump_item(Item *item) { break; } case Item::INT_ITEM: { - Item_int *int_item = static_cast(item); + Item_int* int_item = static_cast(item); fprintf(stderr, ":int=%lld", int_item->val_int()); break; } case Item::STRING_ITEM: { - Item_string *str_item = static_cast(item); + Item_string* str_item = static_cast(item); fprintf(stderr, ":str=%s", str_item->val_str(NULL)->c_ptr()); break; } case Item::FIELD_ITEM: { - Item_field *field_item = static_cast(item); - fprintf(stderr, ":field=%s.%s.%s", field_item->db_name, field_item->table_name, field_item->field_name); + Item_field* field_item = static_cast(item); + fprintf( + stderr, + ":field=%s.%s.%s", + field_item->db_name, + field_item->table_name, + field_item->field_name); break; } case Item::COND_ITEM: { - Item_cond *cond_item = static_cast(item); + Item_cond* cond_item = static_cast(item); fprintf(stderr, ":cond=%s(\n", cond_item->func_name()); List_iterator li(*cond_item->argument_list()); - Item *list_item; + Item* list_item; while ((list_item = li++)) { dump_item(list_item); fprintf(stderr, "\n"); @@ -97,7 +107,7 @@ static void dump_item(Item *item) { break; } case Item::INSERT_VALUE_ITEM: { - Item_insert_value *value_item = static_cast(item); + Item_insert_value* value_item = static_cast(item); fprintf(stderr, ":insert_value"); dump_item(value_item->arg); break; @@ -109,10 +119,10 @@ static void dump_item(Item *item) { } // Debug function to dump an Item list -static void dump_item_list(const char *h, List &l) { +static void dump_item_list(const char* h, List &l) { fprintf(stderr, "%s elements=%u\n", h, l.elements); List_iterator li(l); - Item *item; + Item* item; while ((item = li++) != NULL) { dump_item(item); fprintf(stderr, "\n"); @@ -120,10 +130,10 @@ static void dump_item_list(const char *h, List &l) { } // Find a Field by its Item name -static Field *find_field_by_name(TABLE *table, Item *item) { +static Field* find_field_by_name(TABLE* table, Item* item) { if (item->type() != Item::FIELD_ITEM) return NULL; - Item_field *field_item = static_cast(item); + Item_field* field_item = static_cast(item); #if 0 if (strcmp(table->s->db.str, field_item->db_name) != 0 || strcmp(table->s->table_name.str, field_item->table_name) != 0) @@ -146,7 +156,12 @@ static Field *find_field_by_name(TABLE *table, Item *item) { // Return the starting offset in the value for a particular index (selected by idx) of a // particular field (selected by expand_field_num). // This only works for fixed length fields -static uint32_t fixed_field_offset(uint32_t null_bytes, KEY_AND_COL_INFO *kc_info, uint idx, uint expand_field_num) { +static uint32_t fixed_field_offset( + uint32_t null_bytes, + KEY_AND_COL_INFO* kc_info, + uint idx, + uint expand_field_num) { + uint32_t offset = null_bytes; for (uint i = 0; i < expand_field_num; i++) { if (bitmap_is_set(&kc_info->key_filters[idx], i)) @@ -156,8 +171,13 @@ static uint32_t fixed_field_offset(uint32_t null_bytes, KEY_AND_COL_INFO *kc_inf return offset; } -static uint32_t var_field_index(TABLE *table, KEY_AND_COL_INFO *kc_info, uint idx, uint field_num) { - assert(field_num < table->s->fields); +static uint32_t var_field_index( + TABLE* table, + KEY_AND_COL_INFO* kc_info, + uint idx, + uint field_num) { + + assert_always(field_num < table->s->fields); uint v_index = 0; for (uint i = 0; i < table->s->fields; i++) { if (bitmap_is_set(&kc_info->key_filters[idx], i)) @@ -171,26 +191,37 @@ static uint32_t var_field_index(TABLE *table, KEY_AND_COL_INFO *kc_info, uint id return v_index; } -static uint32_t blob_field_index(TABLE *table, KEY_AND_COL_INFO *kc_info, uint idx, uint field_num) { - assert(field_num < table->s->fields); +static uint32_t blob_field_index( + TABLE* table, + KEY_AND_COL_INFO* kc_info, + uint idx, + uint field_num) { + + assert_always(field_num < table->s->fields); uint b_index; for (b_index = 0; b_index < kc_info->num_blobs; b_index++) { if (kc_info->blob_fields[b_index] == field_num) break; } - assert(b_index < kc_info->num_blobs); + assert_always(b_index < kc_info->num_blobs); return b_index; } // Determine if an update operation can be offloaded to the storage engine. -// The update operation consists of a list of update expressions (fields[i] = values[i]), and a list -// of where conditions (conds). The function returns 0 if the update is handled in the storage engine. +// The update operation consists of a list of update expressions +// (fields[i] = values[i]), and a list of where conditions (conds). +// The function returns 0 if the update is handled in the storage engine. // Otherwise, an error is returned. -int ha_tokudb::fast_update(THD *thd, List &update_fields, List &update_values, Item *conds) { +int ha_tokudb::fast_update( + THD* thd, + List& update_fields, + List& update_values, + Item* conds) { + TOKUDB_HANDLER_DBUG_ENTER(""); int error = 0; - if (tokudb_debug & TOKUDB_DEBUG_UPSERT) { + if (TOKUDB_UNLIKELY(TOKUDB_DEBUG_FLAGS(TOKUDB_DEBUG_UPSERT))) { dump_item_list("fields", update_fields); dump_item_list("values", update_values); if (conds) { @@ -198,7 +229,8 @@ int ha_tokudb::fast_update(THD *thd, List &update_fields, List &upda } } - if (update_fields.elements < 1 || update_fields.elements != update_values.elements) { + if (update_fields.elements < 1 || + update_fields.elements != update_values.elements) { error = ENOTSUP; // something is fishy with the parameters goto return_error; } @@ -208,14 +240,18 @@ int ha_tokudb::fast_update(THD *thd, List &update_fields, List &upda goto check_error; } - error = send_update_message(update_fields, update_values, conds, transaction); + error = send_update_message( + update_fields, + update_values, + conds, + transaction); if (error != 0) { goto check_error; } check_error: if (error != 0) { - if (THDVAR(thd, disable_slow_update) != 0) + if (tokudb::sysvars::disable_slow_update(thd) != 0) error = HA_ERR_UNSUPPORTED; if (error != ENOTSUP) print_error(error, MYF(0)); @@ -225,18 +261,20 @@ return_error: TOKUDB_HANDLER_DBUG_RETURN(error); } -// Return true if an expression is a simple int expression or a simple function of +- int expression. -static bool check_int_result(Item *item) { +// Return true if an expression is a simple int expression or a simple function +// of +- int expression. +static bool check_int_result(Item* item) { Item::Type t = item->type(); if (t == Item::INT_ITEM) { return true; } else if (t == Item::FUNC_ITEM) { - Item_func *item_func = static_cast(item); - if (strcmp(item_func->func_name(), "+") != 0 && strcmp(item_func->func_name(), "-") != 0) + Item_func* item_func = static_cast(item); + if (strcmp(item_func->func_name(), "+") != 0 && + strcmp(item_func->func_name(), "-") != 0) return false; if (item_func->argument_count() != 1) return false; - Item **arguments = item_func->arguments(); + Item** arguments = item_func->arguments(); if (arguments[0]->type() != Item::INT_ITEM) return false; return true; @@ -245,36 +283,43 @@ static bool check_int_result(Item *item) { } // check that an item is an insert value item with the same field name -static bool check_insert_value(Item *item, const char *field_name) { +static bool check_insert_value(Item* item, const char* field_name) { if (item->type() != Item::INSERT_VALUE_ITEM) return false; - Item_insert_value *value_item = static_cast(item); + Item_insert_value* value_item = static_cast(item); if (value_item->arg->type() != Item::FIELD_ITEM) return false; - Item_field *arg = static_cast(value_item->arg); + Item_field* arg = static_cast(value_item->arg); if (strcmp(field_name, arg->field_name) != 0) return false; return true; } // Return true if an expression looks like field_name op constant. -static bool check_x_op_constant(const char *field_name, Item *item, const char *op, Item **item_constant, bool allow_insert_value) { +static bool check_x_op_constant( + const char* field_name, + Item* item, + const char* op, + Item** item_constant, + bool allow_insert_value) { + if (item->type() != Item::FUNC_ITEM) return false; - Item_func *item_func = static_cast(item); + Item_func* item_func = static_cast(item); if (strcmp(item_func->func_name(), op) != 0) return false; - Item **arguments = item_func->arguments(); + Item** arguments = item_func->arguments(); uint n = item_func->argument_count(); if (n != 2) return false; if (arguments[0]->type() != Item::FIELD_ITEM) return false; - Item_field *arg0 = static_cast(arguments[0]); + Item_field* arg0 = static_cast(arguments[0]); if (strcmp(field_name, arg0->field_name) != 0) return false; if (!check_int_result(arguments[1])) - if (!(allow_insert_value && check_insert_value(arguments[1], field_name))) + if (!(allow_insert_value && + check_insert_value(arguments[1], field_name))) return false; *item_constant = arguments[1]; return true; @@ -282,33 +327,35 @@ static bool check_x_op_constant(const char *field_name, Item *item, const char * // Return true if an expression looks like field_name = constant static bool check_x_equal_0(const char *field_name, Item *item) { - Item *item_constant; + Item* item_constant; if (!check_x_op_constant(field_name, item, "=", &item_constant, false)) return false; - if (item_constant->type() != Item::INT_ITEM || item_constant->val_int() != 0) + if (item_constant->type() != Item::INT_ITEM || + item_constant->val_int() != 0) return false; return true; } // Return true if an expression looks like fieldname - 1 -static bool check_x_minus_1(const char *field_name, Item *item) { - Item *item_constant; +static bool check_x_minus_1(const char* field_name, Item* item) { + Item* item_constant; if (!check_x_op_constant(field_name, item, "-", &item_constant, false)) return false; - if (item_constant->type() != Item::INT_ITEM || item_constant->val_int() != 1) + if (item_constant->type() != Item::INT_ITEM || + item_constant->val_int() != 1) return false; return true; } // Return true if an expression looks like if(fieldname=0, 0, fieldname-1) and // the field named by fieldname is an unsigned int. -static bool check_decr_floor_expression(Field *lhs_field, Item *item) { +static bool check_decr_floor_expression(Field* lhs_field, Item* item) { if (item->type() != Item::FUNC_ITEM) return false; - Item_func *item_func = static_cast(item); + Item_func* item_func = static_cast(item); if (strcmp(item_func->func_name(), "if") != 0) return false; - Item **arguments = item_func->arguments(); + Item** arguments = item_func->arguments(); uint n = item_func->argument_count(); if (n != 3) return false; @@ -324,8 +371,13 @@ static bool check_decr_floor_expression(Field *lhs_field, Item *item) { } // Check if lhs = rhs expression is simple. Return true if it is. -static bool check_update_expression(Item *lhs_item, Item *rhs_item, TABLE *table, bool allow_insert_value) { - Field *lhs_field = find_field_by_name(table, lhs_item); +static bool check_update_expression( + Item* lhs_item, + Item* rhs_item, + TABLE* table, + bool allow_insert_value) { + + Field* lhs_field = find_field_by_name(table, lhs_item); if (lhs_field == NULL) return false; if (!lhs_field->part_of_key.is_clear_all()) @@ -340,16 +392,26 @@ static bool check_update_expression(Item *lhs_item, Item *rhs_item, TABLE *table case MYSQL_TYPE_LONGLONG: if (check_int_result(rhs_item)) return true; - Item *item_constant; - if (check_x_op_constant(lhs_field->field_name, rhs_item, "+", &item_constant, allow_insert_value)) + Item* item_constant; + if (check_x_op_constant( + lhs_field->field_name, + rhs_item, + "+", + &item_constant, + allow_insert_value)) return true; - if (check_x_op_constant(lhs_field->field_name, rhs_item, "-", &item_constant, allow_insert_value)) + if (check_x_op_constant( + lhs_field->field_name, + rhs_item, + "-", + &item_constant, + allow_insert_value)) return true; if (check_decr_floor_expression(lhs_field, rhs_item)) return true; break; case MYSQL_TYPE_STRING: - if (rhs_type == Item::INT_ITEM || rhs_type == Item::STRING_ITEM) + if (rhs_type == Item::INT_ITEM || rhs_type == Item::STRING_ITEM) return true; break; case MYSQL_TYPE_VARCHAR: @@ -364,26 +426,35 @@ static bool check_update_expression(Item *lhs_item, Item *rhs_item, TABLE *table } // Check that all update expressions are simple. Return true if they are. -static bool check_all_update_expressions(List &fields, List &values, TABLE *table, bool allow_insert_value) { +static bool check_all_update_expressions( + List& fields, + List& values, + TABLE* table, + bool allow_insert_value) { + List_iterator lhs_i(fields); List_iterator rhs_i(values); while (1) { - Item *lhs_item = lhs_i++; + Item* lhs_item = lhs_i++; if (lhs_item == NULL) break; - Item *rhs_item = rhs_i++; - assert(rhs_item != NULL); - if (!check_update_expression(lhs_item, rhs_item, table, allow_insert_value)) + Item* rhs_item = rhs_i++; + assert_always(rhs_item != NULL); + if (!check_update_expression( + lhs_item, + rhs_item, + table, + allow_insert_value)) return false; } return true; } -static bool full_field_in_key(TABLE *table, Field *field) { - assert(table->s->primary_key < table->s->keys); - KEY *key = &table->s->key_info[table->s->primary_key]; - for (uint i = 0; i < get_key_parts(key); i++) { - KEY_PART_INFO *key_part = &key->key_part[i]; +static bool full_field_in_key(TABLE* table, Field* field) { + assert_always(table->s->primary_key < table->s->keys); + KEY* key = &table->s->key_info[table->s->primary_key]; + for (uint i = 0; i < key->user_defined_key_parts; i++) { + KEY_PART_INFO* key_part = &key->key_part[i]; if (strcmp(field->field_name, key_part->field->field_name) == 0) { return key_part->length == field->field_length; } @@ -391,19 +462,24 @@ static bool full_field_in_key(TABLE *table, Field *field) { return false; } -// Check that an expression looks like fieldname = constant, fieldname is part of the -// primary key, and the named field is an int, char or varchar type. Return true if it does. -static bool check_pk_field_equal_constant(Item *item, TABLE *table, MY_BITMAP *pk_fields) { +// Check that an expression looks like fieldname = constant, fieldname is part +// of the primary key, and the named field is an int, char or varchar type. +// Return true if it does. +static bool check_pk_field_equal_constant( + Item* item, + TABLE* table, + MY_BITMAP* pk_fields) { + if (item->type() != Item::FUNC_ITEM) return false; - Item_func *func = static_cast(item); + Item_func* func = static_cast(item); if (strcmp(func->func_name(), "=") != 0) return false; uint n = func->argument_count(); if (n != 2) return false; - Item **arguments = func->arguments(); - Field *field = find_field_by_name(table, arguments[0]); + Item** arguments = func->arguments(); + Field* field = find_field_by_name(table, arguments[0]); if (field == NULL) return false; if (!bitmap_test_and_clear(pk_fields, field->field_index)) @@ -414,19 +490,21 @@ static bool check_pk_field_equal_constant(Item *item, TABLE *table, MY_BITMAP *p case MYSQL_TYPE_INT24: case MYSQL_TYPE_LONG: case MYSQL_TYPE_LONGLONG: - return arguments[1]->type() == Item::INT_ITEM || arguments[1]->type() == Item::STRING_ITEM; + return arguments[1]->type() == Item::INT_ITEM || + arguments[1]->type() == Item::STRING_ITEM; case MYSQL_TYPE_STRING: case MYSQL_TYPE_VARCHAR: return full_field_in_key(table, field) && - (arguments[1]->type() == Item::INT_ITEM || arguments[1]->type() == Item::STRING_ITEM); + (arguments[1]->type() == Item::INT_ITEM || + arguments[1]->type() == Item::STRING_ITEM); default: return false; } } -// Check that the where condition covers all of the primary key components with fieldname = constant -// expressions. Return true if it does. -static bool check_point_update(Item *conds, TABLE *table) { +// Check that the where condition covers all of the primary key components +// with fieldname = constant expressions. Return true if it does. +static bool check_point_update(Item* conds, TABLE* table) { bool result = false; if (conds == NULL) @@ -435,13 +513,13 @@ static bool check_point_update(Item *conds, TABLE *table) { if (table->s->primary_key >= table->s->keys) return false; // no primary key defined - // use a bitmap of the primary key fields to keep track of those fields that are covered - // by the where conditions + // use a bitmap of the primary key fields to keep track of those fields + // that are covered by the where conditions MY_BITMAP pk_fields; if (bitmap_init(&pk_fields, NULL, table->s->fields, FALSE)) // 1 -> failure return false; KEY *key = &table->s->key_info[table->s->primary_key]; - for (uint i = 0; i < get_key_parts(key); i++) + for (uint i = 0; i < key->user_defined_key_parts; i++) bitmap_set_bit(&pk_fields, key->key_part[i].field->field_index); switch (conds->type()) { @@ -449,14 +527,17 @@ static bool check_point_update(Item *conds, TABLE *table) { result = check_pk_field_equal_constant(conds, table, &pk_fields); break; case Item::COND_ITEM: { - Item_cond *cond_item = static_cast(conds); + Item_cond* cond_item = static_cast(conds); if (strcmp(cond_item->func_name(), "and") != 0) break; List_iterator li(*cond_item->argument_list()); - Item *list_item; + Item* list_item; result = true; while (result == true && (list_item = li++)) { - result = check_pk_field_equal_constant(list_item, table, &pk_fields); + result = check_pk_field_equal_constant( + list_item, + table, + &pk_fields); } break; } @@ -474,13 +555,14 @@ static bool check_point_update(Item *conds, TABLE *table) { // Precompute this when the table is opened. static bool clustering_keys_exist(TABLE *table) { for (uint keynr = 0; keynr < table->s->keys; keynr++) { - if (keynr != table->s->primary_key && key_is_clustering(&table->s->key_info[keynr])) + if (keynr != table->s->primary_key && + key_is_clustering(&table->s->key_info[keynr])) return true; } return false; } -static bool is_strict_mode(THD *thd) { +static bool is_strict_mode(THD* thd) { #if 50600 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50699 return thd->is_strict_mode(); #else @@ -488,8 +570,14 @@ static bool is_strict_mode(THD *thd) { #endif } -// Check if an update operation can be handled by this storage engine. Return true if it can. -bool ha_tokudb::check_fast_update(THD *thd, List &fields, List &values, Item *conds) { +// Check if an update operation can be handled by this storage engine. +// Return true if it can. +bool ha_tokudb::check_fast_update( + THD* thd, + List& fields, + List& values, + Item* conds) { + if (!transaction) return false; @@ -503,10 +591,12 @@ bool ha_tokudb::check_fast_update(THD *thd, List &fields, List &valu // no binlog if (mysql_bin_log.is_open() && - !(thd->variables.binlog_format == BINLOG_FORMAT_STMT || thd->variables.binlog_format == BINLOG_FORMAT_MIXED)) + !(thd->variables.binlog_format == BINLOG_FORMAT_STMT || + thd->variables.binlog_format == BINLOG_FORMAT_MIXED)) return false; - // no clustering keys (need to broadcast an increment into the clustering keys since we are selecting with the primary key) + // no clustering keys (need to broadcast an increment into the clustering + // keys since we are selecting with the primary key) if (clustering_keys_exist(table)) return false; @@ -519,22 +609,34 @@ bool ha_tokudb::check_fast_update(THD *thd, List &fields, List &valu return true; } -static void marshall_varchar_descriptor(tokudb::buffer &b, TABLE *table, KEY_AND_COL_INFO *kc_info, uint key_num) { +static void marshall_varchar_descriptor( + tokudb::buffer& b, + TABLE* table, + KEY_AND_COL_INFO* kc_info, + uint key_num) { + b.append_ui('v'); - b.append_ui(table->s->null_bytes + kc_info->mcp_info[key_num].fixed_field_size); + b.append_ui( + table->s->null_bytes + kc_info->mcp_info[key_num].fixed_field_size); uint32_t var_offset_bytes = kc_info->mcp_info[key_num].len_of_offsets; b.append_ui(var_offset_bytes); - b.append_ui(var_offset_bytes == 0 ? 0 : kc_info->num_offset_bytes); + b.append_ui( + var_offset_bytes == 0 ? 0 : kc_info->num_offset_bytes); } -static void marshall_blobs_descriptor(tokudb::buffer &b, TABLE *table, KEY_AND_COL_INFO *kc_info) { +static void marshall_blobs_descriptor( + tokudb::buffer& b, + TABLE* table, + KEY_AND_COL_INFO* kc_info) { + b.append_ui('b'); uint32_t n = kc_info->num_blobs; b.append_ui(n); for (uint i = 0; i < n; i++) { uint blob_field_index = kc_info->blob_fields[i]; - assert(blob_field_index < table->s->fields); - uint8_t blob_field_length = table->s->field[blob_field_index]->row_pack_length(); + assert_always(blob_field_index < table->s->fields); + uint8_t blob_field_length = + table->s->field[blob_field_index]->row_pack_length(); b.append(&blob_field_length, sizeof blob_field_length); } } @@ -542,30 +644,37 @@ static void marshall_blobs_descriptor(tokudb::buffer &b, TABLE *table, KEY_AND_C static inline uint32_t get_null_bit_position(uint32_t null_bit); // evaluate the int value of an item -static longlong item_val_int(Item *item) { +static longlong item_val_int(Item* item) { Item::Type t = item->type(); if (t == Item::INSERT_VALUE_ITEM) { - Item_insert_value *value_item = static_cast(item); + Item_insert_value* value_item = static_cast(item); return value_item->arg->val_int(); } else return item->val_int(); } // Marshall update operations to a buffer. -static void marshall_update(tokudb::buffer &b, Item *lhs_item, Item *rhs_item, TABLE *table, TOKUDB_SHARE *share) { +static void marshall_update( + tokudb::buffer& b, + Item* lhs_item, + Item* rhs_item, + TABLE* table, + TOKUDB_SHARE* share) { + // figure out the update operation type (again) - Field *lhs_field = find_field_by_name(table, lhs_item); - assert(lhs_field); // we found it before, so this should work + Field* lhs_field = find_field_by_name(table, lhs_item); + assert_always(lhs_field); // we found it before, so this should work // compute the update info uint32_t field_type; uint32_t field_null_num = 0; if (lhs_field->real_maybe_null()) { uint32_t field_num = lhs_field->field_index; - field_null_num = ((field_num/8)*8 + get_null_bit_position(lhs_field->null_bit)) + 1; + field_null_num = + ((field_num/8)*8 + get_null_bit_position(lhs_field->null_bit)) + 1; } uint32_t offset; - void *v_ptr = NULL; + void* v_ptr = NULL; uint32_t v_length; uint32_t update_operation; longlong v_ll; @@ -577,9 +686,14 @@ static void marshall_update(tokudb::buffer &b, Item *lhs_item, Item *rhs_item, T case MYSQL_TYPE_INT24: case MYSQL_TYPE_LONG: case MYSQL_TYPE_LONGLONG: { - Field_num *lhs_num = static_cast(lhs_field); + Field_num* lhs_num = static_cast(lhs_field); field_type = lhs_num->unsigned_flag ? UPDATE_TYPE_UINT : UPDATE_TYPE_INT; - offset = fixed_field_offset(table->s->null_bytes, &share->kc_info, table->s->primary_key, lhs_field->field_index); + offset = + fixed_field_offset( + table->s->null_bytes, + &share->kc_info, + table->s->primary_key, + lhs_field->field_index); switch (rhs_item->type()) { case Item::INT_ITEM: { update_operation = '='; @@ -589,10 +703,12 @@ static void marshall_update(tokudb::buffer &b, Item *lhs_item, Item *rhs_item, T break; } case Item::FUNC_ITEM: { - Item_func *rhs_func = static_cast(rhs_item); - Item **arguments = rhs_func->arguments(); + Item_func* rhs_func = static_cast(rhs_item); + Item** arguments = rhs_func->arguments(); + // we only support one if function for now, and it is a + // decrement with floor. if (strcmp(rhs_func->func_name(), "if") == 0) { - update_operation = '-'; // we only support one if function for now, and it is a decrement with floor. + update_operation = '-'; v_ll = 1; } else if (rhs_func->argument_count() == 1) { update_operation = '='; @@ -606,14 +722,20 @@ static void marshall_update(tokudb::buffer &b, Item *lhs_item, Item *rhs_item, T break; } default: - assert(0); + assert_unreachable(); } break; } case MYSQL_TYPE_STRING: { update_operation = '='; - field_type = lhs_field->binary() ? UPDATE_TYPE_BINARY : UPDATE_TYPE_CHAR; - offset = fixed_field_offset(table->s->null_bytes, &share->kc_info, table->s->primary_key, lhs_field->field_index); + field_type = + lhs_field->binary() ? UPDATE_TYPE_BINARY : UPDATE_TYPE_CHAR; + offset = + fixed_field_offset( + table->s->null_bytes, + &share->kc_info, + table->s->primary_key, + lhs_field->field_index); v_str = *rhs_item->val_str(&v_str); v_length = v_str.length(); if (v_length >= lhs_field->pack_length()) { @@ -621,7 +743,8 @@ static void marshall_update(tokudb::buffer &b, Item *lhs_item, Item *rhs_item, T v_str.length(v_length); // truncate } else { v_length = lhs_field->pack_length(); - uchar pad_char = lhs_field->binary() ? 0 : lhs_field->charset()->pad_char; + uchar pad_char = + lhs_field->binary() ? 0 : lhs_field->charset()->pad_char; v_str.fill(lhs_field->pack_length(), pad_char); // pad } v_ptr = v_str.c_ptr(); @@ -629,8 +752,14 @@ static void marshall_update(tokudb::buffer &b, Item *lhs_item, Item *rhs_item, T } case MYSQL_TYPE_VARCHAR: { update_operation = '='; - field_type = lhs_field->binary() ? UPDATE_TYPE_VARBINARY : UPDATE_TYPE_VARCHAR; - offset = var_field_index(table, &share->kc_info, table->s->primary_key, lhs_field->field_index); + field_type = + lhs_field->binary() ? UPDATE_TYPE_VARBINARY : UPDATE_TYPE_VARCHAR; + offset = + var_field_index( + table, + &share->kc_info, + table->s->primary_key, + lhs_field->field_index); v_str = *rhs_item->val_str(&v_str); v_length = v_str.length(); if (v_length >= lhs_field->row_pack_length()) { @@ -643,7 +772,12 @@ static void marshall_update(tokudb::buffer &b, Item *lhs_item, Item *rhs_item, T case MYSQL_TYPE_BLOB: { update_operation = '='; field_type = lhs_field->binary() ? UPDATE_TYPE_BLOB : UPDATE_TYPE_TEXT; - offset = blob_field_index(table, &share->kc_info, table->s->primary_key, lhs_field->field_index); + offset = + blob_field_index( + table, + &share->kc_info, + table->s->primary_key, + lhs_field->field_index); v_str = *rhs_item->val_str(&v_str); v_length = v_str.length(); if (v_length >= lhs_field->max_data_length()) { @@ -654,7 +788,7 @@ static void marshall_update(tokudb::buffer &b, Item *lhs_item, Item *rhs_item, T break; } default: - assert(0); + assert_unreachable(); } // marshall the update fields into the buffer @@ -667,14 +801,14 @@ static void marshall_update(tokudb::buffer &b, Item *lhs_item, Item *rhs_item, T } // Save an item's value into the appropriate field. Return 0 if successful. -static int save_in_field(Item *item, TABLE *table) { - assert(item->type() == Item::FUNC_ITEM); +static int save_in_field(Item* item, TABLE* table) { + assert_always(item->type() == Item::FUNC_ITEM); Item_func *func = static_cast(item); - assert(strcmp(func->func_name(), "=") == 0); + assert_always(strcmp(func->func_name(), "=") == 0); uint n = func->argument_count(); - assert(n == 2); + assert_always(n == 2); Item **arguments = func->arguments(); - assert(arguments[0]->type() == Item::FIELD_ITEM); + assert_always(arguments[0]->type() == Item::FIELD_ITEM); Item_field *field_item = static_cast(arguments[0]); my_bitmap_map *old_map = dbug_tmp_use_all_columns(table, table->write_set); int error = arguments[1]->save_in_field(field_item->field, 0); @@ -682,7 +816,11 @@ static int save_in_field(Item *item, TABLE *table) { return error; } -static void count_update_types(Field *lhs_field, uint *num_varchars, uint *num_blobs) { +static void count_update_types( + Field* lhs_field, + uint* num_varchars, + uint* num_blobs) { + switch (lhs_field->type()) { case MYSQL_TYPE_VARCHAR: *num_varchars += 1; @@ -695,8 +833,14 @@ static void count_update_types(Field *lhs_field, uint *num_varchars, uint *num_b } } -// Generate an update message for an update operation and send it into the primary tree. Return 0 if successful. -int ha_tokudb::send_update_message(List &update_fields, List &update_values, Item *conds, DB_TXN *txn) { +// Generate an update message for an update operation and send it into the +// primary tree. Return 0 if successful. +int ha_tokudb::send_update_message( + List& update_fields, + List& update_values, + Item* conds, + DB_TXN* txn) { + int error; // Save the primary key from the where conditions @@ -704,26 +848,32 @@ int ha_tokudb::send_update_message(List &update_fields, List &update if (t == Item::FUNC_ITEM) { error = save_in_field(conds, table); } else if (t == Item::COND_ITEM) { - Item_cond *cond_item = static_cast(conds); + Item_cond* cond_item = static_cast(conds); List_iterator li(*cond_item->argument_list()); - Item *list_item; + Item* list_item; error = 0; while (error == 0 && (list_item = li++)) { error = save_in_field(list_item, table); } - } else - assert(0); + } else { + assert_unreachable(); + } if (error) return error; // put the primary key into key_buff and wrap it with key_dbt DBT key_dbt; bool has_null; - create_dbt_key_from_table(&key_dbt, primary_key, key_buff, table->record[0], &has_null); - + create_dbt_key_from_table( + &key_dbt, + primary_key, + key_buff, + table->record[0], + &has_null); + // construct the update message tokudb::buffer update_message; - + uint8_t op = UPDATE_OP_UPDATE_2; update_message.append(&op, sizeof op); @@ -731,12 +881,12 @@ int ha_tokudb::send_update_message(List &update_fields, List &update uint num_varchars = 0, num_blobs = 0; if (1) { List_iterator lhs_i(update_fields); - Item *lhs_item; + Item* lhs_item; while ((lhs_item = lhs_i++)) { if (lhs_item == NULL) break; - Field *lhs_field = find_field_by_name(table, lhs_item); - assert(lhs_field); // we found it before, so this should work + Field* lhs_field = find_field_by_name(table, lhs_item); + assert_always(lhs_field); // we found it before, so this should work count_update_types(lhs_field, &num_varchars, &num_blobs); } if (num_varchars > 0 || num_blobs > 0) @@ -747,56 +897,75 @@ int ha_tokudb::send_update_message(List &update_fields, List &update // append the updates update_message.append_ui(num_updates); - + if (num_varchars > 0 || num_blobs > 0) - marshall_varchar_descriptor(update_message, table, &share->kc_info, table->s->primary_key); + marshall_varchar_descriptor( + update_message, + table, + &share->kc_info, + table->s->primary_key); if (num_blobs > 0) marshall_blobs_descriptor(update_message, table, &share->kc_info); List_iterator lhs_i(update_fields); List_iterator rhs_i(update_values); while (error == 0) { - Item *lhs_item = lhs_i++; + Item* lhs_item = lhs_i++; if (lhs_item == NULL) break; - Item *rhs_item = rhs_i++; - assert(rhs_item != NULL); + Item* rhs_item = rhs_i++; + assert_always(rhs_item != NULL); marshall_update(update_message, lhs_item, rhs_item, table, share); } - rw_rdlock(&share->num_DBs_lock); + share->_num_DBs_lock.lock_read(); - if (share->num_DBs > table->s->keys + tokudb_test(hidden_primary_key)) { // hot index in progress + // hot index in progress + if (share->num_DBs > table->s->keys + tokudb_test(hidden_primary_key)) { error = ENOTSUP; // run on the slow path } else { - // send the update message + // send the update message DBT update_dbt; memset(&update_dbt, 0, sizeof update_dbt); update_dbt.data = update_message.data(); update_dbt.size = update_message.size(); - error = share->key_file[primary_key]->update(share->key_file[primary_key], txn, &key_dbt, &update_dbt, 0); + error = + share->key_file[primary_key]->update( + share->key_file[primary_key], + txn, + &key_dbt, + &update_dbt, + 0); } - rw_unlock(&share->num_DBs_lock); - + share->_num_DBs_lock.unlock(); + return error; } // Determine if an upsert operation can be offloaded to the storage engine. -// An upsert consists of a row and a list of update expressions (update_fields[i] = update_values[i]). -// The function returns 0 if the upsert is handled in the storage engine. Otherwise, an error code is returned. -int ha_tokudb::upsert(THD *thd, List &update_fields, List &update_values) { +// An upsert consists of a row and a list of update expressions +// (update_fields[i] = update_values[i]). +// The function returns 0 if the upsert is handled in the storage engine. +// Otherwise, an error code is returned. +int ha_tokudb::upsert( + THD* thd, + List& update_fields, + List& update_values) { + TOKUDB_HANDLER_DBUG_ENTER(""); int error = 0; - if (tokudb_debug & TOKUDB_DEBUG_UPSERT) { + if (TOKUDB_UNLIKELY(TOKUDB_DEBUG_FLAGS(TOKUDB_DEBUG_UPSERT))) { fprintf(stderr, "upsert\n"); dump_item_list("update_fields", update_fields); dump_item_list("update_values", update_values); } - if (update_fields.elements < 1 || update_fields.elements != update_values.elements) { - error = ENOTSUP; // not an upsert or something is fishy with the parameters + // not an upsert or something is fishy with the parameters + if (update_fields.elements < 1 || + update_fields.elements != update_values.elements) { + error = ENOTSUP; goto return_error; } @@ -812,7 +981,7 @@ int ha_tokudb::upsert(THD *thd, List &update_fields, List &update_va check_error: if (error != 0) { - if (THDVAR(thd, disable_slow_upsert) != 0) + if (tokudb::sysvars::disable_slow_upsert(thd) != 0) error = HA_ERR_UNSUPPORTED; if (error != ENOTSUP) print_error(error, MYF(0)); @@ -822,8 +991,13 @@ return_error: TOKUDB_HANDLER_DBUG_RETURN(error); } -// Check if an upsert can be handled by this storage engine. Return trus if it can. -bool ha_tokudb::check_upsert(THD *thd, List &update_fields, List &update_values) { +// Check if an upsert can be handled by this storage engine. +// Return true if it can. +bool ha_tokudb::check_upsert( + THD* thd, + List& update_fields, + List& update_values) { + if (!transaction) return false; @@ -845,23 +1019,38 @@ bool ha_tokudb::check_upsert(THD *thd, List &update_fields, List &up // no binlog if (mysql_bin_log.is_open() && - !(thd->variables.binlog_format == BINLOG_FORMAT_STMT || thd->variables.binlog_format == BINLOG_FORMAT_MIXED)) + !(thd->variables.binlog_format == BINLOG_FORMAT_STMT || + thd->variables.binlog_format == BINLOG_FORMAT_MIXED)) return false; - if (!check_all_update_expressions(update_fields, update_values, table, true)) + if (!check_all_update_expressions( + update_fields, + update_values, + table, + true)) return false; return true; } -// Generate an upsert message and send it into the primary tree. Return 0 if successful. -int ha_tokudb::send_upsert_message(THD *thd, List &update_fields, List &update_values, DB_TXN *txn) { +// Generate an upsert message and send it into the primary tree. +// Return 0 if successful. +int ha_tokudb::send_upsert_message( + THD* thd, + List& update_fields, + List& update_values, + DB_TXN* txn) { int error = 0; // generate primary key DBT key_dbt; bool has_null; - create_dbt_key_from_table(&key_dbt, primary_key, primary_key_buff, table->record[0], &has_null); + create_dbt_key_from_table( + &key_dbt, + primary_key, + primary_key_buff, + table->record[0], + &has_null); // generate packed row DBT row; @@ -883,12 +1072,12 @@ int ha_tokudb::send_upsert_message(THD *thd, List &update_fields, List lhs_i(update_fields); - Item *lhs_item; + Item* lhs_item; while ((lhs_item = lhs_i++)) { if (lhs_item == NULL) break; - Field *lhs_field = find_field_by_name(table, lhs_item); - assert(lhs_field); // we found it before, so this should work + Field* lhs_field = find_field_by_name(table, lhs_item); + assert_always(lhs_field); // we found it before, so this should work count_update_types(lhs_field, &num_varchars, &num_blobs); } if (num_varchars > 0 || num_blobs > 0) @@ -901,35 +1090,44 @@ int ha_tokudb::send_upsert_message(THD *thd, List &update_fields, List(num_updates); if (num_varchars > 0 || num_blobs > 0) - marshall_varchar_descriptor(update_message, table, &share->kc_info, table->s->primary_key); + marshall_varchar_descriptor( + update_message, + table, &share->kc_info, + table->s->primary_key); if (num_blobs > 0) marshall_blobs_descriptor(update_message, table, &share->kc_info); List_iterator lhs_i(update_fields); List_iterator rhs_i(update_values); while (1) { - Item *lhs_item = lhs_i++; + Item* lhs_item = lhs_i++; if (lhs_item == NULL) break; - Item *rhs_item = rhs_i++; - if (rhs_item == NULL) - assert(0); // can not happen + Item* rhs_item = rhs_i++; + assert_always(rhs_item != NULL); marshall_update(update_message, lhs_item, rhs_item, table, share); } - rw_rdlock(&share->num_DBs_lock); + share->_num_DBs_lock.lock_read(); - if (share->num_DBs > table->s->keys + tokudb_test(hidden_primary_key)) { // hot index in progress + // hot index in progress + if (share->num_DBs > table->s->keys + tokudb_test(hidden_primary_key)) { error = ENOTSUP; // run on the slow path } else { // send the upsert message DBT update_dbt; memset(&update_dbt, 0, sizeof update_dbt); update_dbt.data = update_message.data(); update_dbt.size = update_message.size(); - error = share->key_file[primary_key]->update(share->key_file[primary_key], txn, &key_dbt, &update_dbt, 0); + error = + share->key_file[primary_key]->update( + share->key_file[primary_key], + txn, + &key_dbt, + &update_dbt, + 0); } - rw_unlock(&share->num_DBs_lock); + share->_num_DBs_lock.unlock(); return error; } diff --git a/storage/tokudb/hatoku_cmp.cc b/storage/tokudb/hatoku_cmp.cc index 606a771eb30..cb02e4ff13a 100644 --- a/storage/tokudb/hatoku_cmp.cc +++ b/storage/tokudb/hatoku_cmp.cc @@ -104,8 +104,7 @@ static void get_var_field_info( data_end_offset = uint2korr(var_field_offset_ptr + 2*var_field_index); break; default: - assert(false); - break; + assert_unreachable(); } if (var_field_index) { @@ -117,8 +116,7 @@ static void get_var_field_info( data_start_offset = uint2korr(var_field_offset_ptr + 2*(var_field_index-1)); break; default: - assert(false); - break; + assert_unreachable(); } } else { @@ -126,7 +124,7 @@ static void get_var_field_info( } *start_offset = data_start_offset; - assert(data_end_offset >= data_start_offset); + assert_always(data_end_offset >= data_start_offset); *field_len = data_end_offset - data_start_offset; } @@ -153,8 +151,7 @@ static void get_blob_field_info( data_end_offset = uint2korr(var_field_data_ptr - 2); break; default: - assert(false); - break; + assert_unreachable(); } } else { @@ -245,7 +242,7 @@ static TOKU_TYPE mysql_to_toku_type (Field* field) { case MYSQL_TYPE_DECIMAL: case MYSQL_TYPE_VAR_STRING: case MYSQL_TYPE_NULL: - assert(false); + assert_unreachable(); } exit: return ret_val; @@ -312,7 +309,7 @@ static inline uchar* pack_toku_int (uchar* to_tokudb, uchar* from_mysql, uint32_ memcpy(to_tokudb, from_mysql, 8); break; default: - assert(false); + assert_unreachable(); } return to_tokudb+num_bytes; } @@ -338,7 +335,7 @@ static inline uchar* unpack_toku_int(uchar* to_mysql, uchar* from_tokudb, uint32 memcpy(to_mysql, from_tokudb, 8); break; default: - assert(false); + assert_unreachable(); } return from_tokudb+num_bytes; } @@ -390,7 +387,7 @@ static inline int cmp_toku_int (uchar* a_buf, uchar* b_buf, bool is_unsigned, ui ret_val = 0; goto exit; default: - assert(false); + assert_unreachable(); } } // @@ -438,13 +435,13 @@ static inline int cmp_toku_int (uchar* a_buf, uchar* b_buf, bool is_unsigned, ui ret_val = 0; goto exit; default: - assert(false); + assert_unreachable(); } } // // if this is hit, indicates bug in writing of this function // - assert(false); + assert_unreachable(); exit: return ret_val; } @@ -653,7 +650,7 @@ static inline uchar* unpack_toku_varbinary( int4store(to_mysql, length); break; default: - assert(false); + assert_unreachable(); } // // copy the binary data @@ -779,7 +776,7 @@ static inline uchar* unpack_toku_blob( int4store(to_mysql, length); break; default: - assert(false); + assert_unreachable(); } // // copy the binary data @@ -956,7 +953,9 @@ static inline int tokudb_compare_two_hidden_keys( const void* saved_key_data, const uint32_t saved_key_size ) { - assert( (new_key_size >= TOKUDB_HIDDEN_PRIMARY_KEY_LENGTH) && (saved_key_size >= TOKUDB_HIDDEN_PRIMARY_KEY_LENGTH) ); + assert_always( + (new_key_size >= TOKUDB_HIDDEN_PRIMARY_KEY_LENGTH) && + (saved_key_size >= TOKUDB_HIDDEN_PRIMARY_KEY_LENGTH)); ulonglong a = hpk_char_to_num((uchar *) new_key_data); ulonglong b = hpk_char_to_num((uchar *) saved_key_data); return a < b ? -1 : (a > b ? 1 : 0); @@ -996,8 +995,7 @@ static uint32_t skip_field_in_descriptor(uchar* row_desc) { row_desc_pos += sizeof(uint32_t); break; default: - assert(false); - break; + assert_unreachable(); } return (uint32_t)(row_desc_pos - row_desc); } @@ -1011,7 +1009,7 @@ static int create_toku_key_descriptor_for_key(KEY* key, uchar* buf) { uchar* pos = buf; uint32_t num_bytes_in_field = 0; uint32_t charset_num = 0; - for (uint i = 0; i < get_key_parts(key); i++){ + for (uint i = 0; i < key->user_defined_key_parts; i++) { Field* field = key->key_part[i].field; // // The first byte states if there is a null byte @@ -1025,7 +1023,7 @@ static int create_toku_key_descriptor_for_key(KEY* key, uchar* buf) { // The second byte for each field is the type // TOKU_TYPE type = mysql_to_toku_type(field); - assert (type < 256); + assert_always((int)type < 256); *pos = (uchar)(type & 255); pos++; @@ -1040,7 +1038,7 @@ static int create_toku_key_descriptor_for_key(KEY* key, uchar* buf) { // case (toku_type_int): num_bytes_in_field = field->pack_length(); - assert (num_bytes_in_field < 256); + assert_always (num_bytes_in_field < 256); *pos = (uchar)(num_bytes_in_field & 255); pos++; *pos = (field->flags & UNSIGNED_FLAG) ? 1 : 0; @@ -1058,7 +1056,7 @@ static int create_toku_key_descriptor_for_key(KEY* key, uchar* buf) { case (toku_type_fixbinary): num_bytes_in_field = field->pack_length(); set_if_smaller(num_bytes_in_field, key->key_part[i].length); - assert(num_bytes_in_field < 256); + assert_always(num_bytes_in_field < 256); pos[0] = (uchar)(num_bytes_in_field & 255); pos++; break; @@ -1086,8 +1084,7 @@ static int create_toku_key_descriptor_for_key(KEY* key, uchar* buf) { pos += 4; break; default: - assert(false); - + assert_unreachable(); } } return pos - buf; @@ -1276,8 +1273,7 @@ static inline int compare_toku_field( *read_string = true; break; default: - assert(false); - break; + assert_unreachable(); } *row_desc_bytes_read = row_desc_pos - row_desc; @@ -1300,7 +1296,7 @@ static uchar* pack_toku_key_field( TOKU_TYPE toku_type = mysql_to_toku_type(field); switch(toku_type) { case (toku_type_int): - assert(key_part_length == field->pack_length()); + assert_always(key_part_length == field->pack_length()); new_pos = pack_toku_int( to_tokudb, from_mysql, @@ -1308,13 +1304,13 @@ static uchar* pack_toku_key_field( ); goto exit; case (toku_type_double): - assert(field->pack_length() == sizeof(double)); - assert(key_part_length == sizeof(double)); + assert_always(field->pack_length() == sizeof(double)); + assert_always(key_part_length == sizeof(double)); new_pos = pack_toku_double(to_tokudb, from_mysql); goto exit; case (toku_type_float): - assert(field->pack_length() == sizeof(float)); - assert(key_part_length == sizeof(float)); + assert_always(field->pack_length() == sizeof(float)); + assert_always(key_part_length == sizeof(float)); new_pos = pack_toku_float(to_tokudb, from_mysql); goto exit; case (toku_type_fixbinary): @@ -1367,9 +1363,9 @@ static uchar* pack_toku_key_field( ); goto exit; default: - assert(false); + assert_unreachable(); } - assert(false); + assert_unreachable(); exit: return new_pos; } @@ -1418,10 +1414,10 @@ static uchar* pack_key_toku_key_field( ); goto exit; default: - assert(false); + assert_unreachable(); } - assert(false); + assert_unreachable(); exit: return new_pos; } @@ -1431,16 +1427,15 @@ uchar* unpack_toku_key_field( uchar* to_mysql, uchar* from_tokudb, Field* field, - uint32_t key_part_length - ) -{ + uint32_t key_part_length) { + uchar* new_pos = NULL; uint32_t num_bytes = 0; uint32_t num_bytes_copied; TOKU_TYPE toku_type = mysql_to_toku_type(field); switch(toku_type) { case (toku_type_int): - assert(key_part_length == field->pack_length()); + assert_always(key_part_length == field->pack_length()); new_pos = unpack_toku_int( to_mysql, from_tokudb, @@ -1448,13 +1443,13 @@ uchar* unpack_toku_key_field( ); goto exit; case (toku_type_double): - assert(field->pack_length() == sizeof(double)); - assert(key_part_length == sizeof(double)); + assert_always(field->pack_length() == sizeof(double)); + assert_always(key_part_length == sizeof(double)); new_pos = unpack_toku_double(to_mysql, from_tokudb); goto exit; case (toku_type_float): - assert(field->pack_length() == sizeof(float)); - assert(key_part_length == sizeof(float)); + assert_always(field->pack_length() == sizeof(float)); + assert_always(key_part_length == sizeof(float)); new_pos = unpack_toku_float(to_mysql, from_tokudb); goto exit; case (toku_type_fixbinary): @@ -1463,8 +1458,7 @@ uchar* unpack_toku_key_field( new_pos = unpack_toku_binary( to_mysql, from_tokudb, - num_bytes - ); + num_bytes); goto exit; case (toku_type_fixstring): num_bytes = field->pack_length(); @@ -1472,11 +1466,15 @@ uchar* unpack_toku_key_field( to_mysql, from_tokudb, get_length_bytes_from_max(key_part_length), - 0 - ); - num_bytes_copied = new_pos - (from_tokudb + get_length_bytes_from_max(key_part_length)); - assert(num_bytes_copied <= num_bytes); - memset(to_mysql+num_bytes_copied, field->charset()->pad_char, num_bytes - num_bytes_copied); + 0); + num_bytes_copied = + new_pos - + (from_tokudb + get_length_bytes_from_max(key_part_length)); + assert_always(num_bytes_copied <= num_bytes); + memset( + to_mysql + num_bytes_copied, + field->charset()->pad_char, + num_bytes - num_bytes_copied); goto exit; case (toku_type_varbinary): case (toku_type_varstring): @@ -1484,21 +1482,20 @@ uchar* unpack_toku_key_field( to_mysql, from_tokudb, get_length_bytes_from_max(key_part_length), - ((Field_varstring *)field)->length_bytes - ); + ((Field_varstring*)field)->length_bytes); goto exit; case (toku_type_blob): new_pos = unpack_toku_blob( to_mysql, from_tokudb, get_length_bytes_from_max(key_part_length), - ((Field_blob *)field)->row_pack_length() //only calling this because packlength is returned - ); + //only calling this because packlength is returned + ((Field_blob *)field)->row_pack_length()); goto exit; default: - assert(false); + assert_unreachable(); } - assert(false); + assert_unreachable(); exit: return new_pos; } @@ -1512,9 +1509,8 @@ static int tokudb_compare_two_keys( const void* row_desc, const uint32_t row_desc_size, bool cmp_prefix, - bool* read_string - ) -{ + bool* read_string) { + int ret_val = 0; int8_t new_key_inf_val = COL_NEG_INF; int8_t saved_key_inf_val = COL_NEG_INF; @@ -1537,11 +1533,9 @@ static int tokudb_compare_two_keys( } row_desc_ptr++; - while ( (uint32_t)(new_key_ptr - (uchar *)new_key_data) < new_key_size && - (uint32_t)(saved_key_ptr - (uchar *)saved_key_data) < saved_key_size && - (uint32_t)(row_desc_ptr - (uchar *)row_desc) < row_desc_size - ) - { + while ((uint32_t)(new_key_ptr - (uchar*)new_key_data) < new_key_size && + (uint32_t)(saved_key_ptr - (uchar*)saved_key_data) < saved_key_size && + (uint32_t)(row_desc_ptr - (uchar*)row_desc) < row_desc_size) { uint32_t new_key_field_length; uint32_t saved_key_field_length; uint32_t row_desc_field_length; @@ -1582,8 +1576,7 @@ static int tokudb_compare_two_keys( &new_key_field_length, &saved_key_field_length, &row_desc_field_length, - read_string - ); + read_string); new_key_ptr += new_key_field_length; saved_key_ptr += saved_key_field_length; row_desc_ptr += row_desc_field_length; @@ -1591,35 +1584,30 @@ static int tokudb_compare_two_keys( goto exit; } - assert((uint32_t)(new_key_ptr - (uchar *)new_key_data) <= new_key_size); - assert((uint32_t)(saved_key_ptr - (uchar *)saved_key_data) <= saved_key_size); - assert((uint32_t)(row_desc_ptr - (uchar *)row_desc) <= row_desc_size); + assert_always( + (uint32_t)(new_key_ptr - (uchar*)new_key_data) <= new_key_size); + assert_always( + (uint32_t)(saved_key_ptr - (uchar*)saved_key_data) <= saved_key_size); + assert_always( + (uint32_t)(row_desc_ptr - (uchar*)row_desc) <= row_desc_size); } - new_key_bytes_left = new_key_size - ((uint32_t)(new_key_ptr - (uchar *)new_key_data)); - saved_key_bytes_left = saved_key_size - ((uint32_t)(saved_key_ptr - (uchar *)saved_key_data)); + new_key_bytes_left = + new_key_size - ((uint32_t)(new_key_ptr - (uchar*)new_key_data)); + saved_key_bytes_left = + saved_key_size - ((uint32_t)(saved_key_ptr - (uchar*)saved_key_data)); if (cmp_prefix) { ret_val = 0; - } - // - // in this case, read both keys to completion, now read infinity byte - // - else if (new_key_bytes_left== 0 && saved_key_bytes_left== 0) { + } else if (new_key_bytes_left== 0 && saved_key_bytes_left== 0) { + // in this case, read both keys to completion, now read infinity byte ret_val = new_key_inf_val - saved_key_inf_val; - } - // - // at this point, one SHOULD be 0 - // - else if (new_key_bytes_left == 0 && saved_key_bytes_left > 0) { + } else if (new_key_bytes_left == 0 && saved_key_bytes_left > 0) { + // at this point, one SHOULD be 0 ret_val = (new_key_inf_val == COL_POS_INF ) ? 1 : -1; - } - else if (new_key_bytes_left > 0 && saved_key_bytes_left == 0) { + } else if (new_key_bytes_left > 0 && saved_key_bytes_left == 0) { ret_val = (saved_key_inf_val == COL_POS_INF ) ? -1 : 1; - } - // - // this should never happen, perhaps we should assert(false) - // - else { - assert(false); + } else { + // this should never happen, perhaps we should assert(false) + assert_unreachable(); ret_val = new_key_bytes_left - saved_key_bytes_left; } exit: @@ -1764,9 +1752,9 @@ static int tokudb_compare_two_key_parts( goto exit; } - assert((uint32_t)(new_key_ptr - (uchar *)new_key_data) <= new_key_size); - assert((uint32_t)(saved_key_ptr - (uchar *)saved_key_data) <= saved_key_size); - assert((uint32_t)(row_desc_ptr - (uchar *)row_desc) <= row_desc_size); + assert_always((uint32_t)(new_key_ptr - (uchar *)new_key_data) <= new_key_size); + assert_always((uint32_t)(saved_key_ptr - (uchar *)saved_key_data) <= saved_key_size); + assert_always((uint32_t)(row_desc_ptr - (uchar *)row_desc) <= row_desc_size); } ret_val = 0; @@ -1775,7 +1763,7 @@ exit: } static int tokudb_cmp_dbt_key_parts(DB *file, const DBT *keya, const DBT *keyb, uint max_parts) { - assert(file->cmp_descriptor->dbt.size); + assert_always(file->cmp_descriptor->dbt.size); return tokudb_compare_two_key_parts( keya->data, keya->size, @@ -1846,7 +1834,7 @@ static uint32_t pack_desc_pk_info(uchar* buf, KEY_AND_COL_INFO* kc_info, TABLE_S case (toku_type_float): pos[0] = COL_FIX_FIELD; pos++; - assert(kc_info->field_lengths[field_index] < 256); + assert_always(kc_info->field_lengths[field_index] < 256); pos[0] = kc_info->field_lengths[field_index]; pos++; break; @@ -1855,7 +1843,7 @@ static uint32_t pack_desc_pk_info(uchar* buf, KEY_AND_COL_INFO* kc_info, TABLE_S pos++; field_length = field->pack_length(); set_if_smaller(key_part_length, field_length); - assert(key_part_length < 256); + assert_always(key_part_length < 256); pos[0] = (uchar)key_part_length; pos++; break; @@ -1870,7 +1858,7 @@ static uint32_t pack_desc_pk_info(uchar* buf, KEY_AND_COL_INFO* kc_info, TABLE_S pos++; break; default: - assert(false); + assert_unreachable(); } return pos - buf; @@ -1892,7 +1880,7 @@ static uint32_t pack_desc_pk_offset_info( bool is_constant_offset = true; uint32_t offset = 0; - for (uint i = 0; i < get_key_parts(prim_key); i++) { + for (uint i = 0; i < prim_key->user_defined_key_parts; i++) { KEY_PART_INFO curr = prim_key->key_part[i]; uint16 curr_field_index = curr.field->field_index; @@ -1907,7 +1895,7 @@ static uint32_t pack_desc_pk_offset_info( } offset += pk_info[2*i + 1]; } - assert(found_col_in_pk); + assert_always(found_col_in_pk); if (is_constant_offset) { pos[0] = COL_FIX_PK_OFFSET; pos++; @@ -1965,10 +1953,10 @@ static uint32_t pack_desc_offset_info(uchar* buf, KEY_AND_COL_INFO* kc_info, uin break; } } - assert(found_index); + assert_always(found_index); break; default: - assert(false); + assert_unreachable(); } return pos - buf; @@ -2003,7 +1991,7 @@ static uint32_t pack_desc_key_length_info(uchar* buf, KEY_AND_COL_INFO* kc_info, pos += sizeof(key_part_length); break; default: - assert(false); + assert_unreachable(); } return pos - buf; @@ -2040,7 +2028,7 @@ static uint32_t pack_desc_char_info(uchar* buf, KEY_AND_COL_INFO* kc_info, TABLE pos += 4; break; default: - assert(false); + assert_unreachable(); } return pos - buf; @@ -2150,7 +2138,7 @@ static uint32_t create_toku_clustering_val_pack_descriptor ( bool col_filtered = bitmap_is_set(&kc_info->key_filters[keynr],i); bool col_filtered_in_pk = bitmap_is_set(&kc_info->key_filters[pk_index],i); if (col_filtered_in_pk) { - assert(col_filtered); + assert_always(col_filtered); } } @@ -2320,7 +2308,7 @@ static uint32_t pack_clustering_val_from_desc( memcpy(&end, desc_pos, sizeof(end)); desc_pos += sizeof(end); - assert (start <= end); + assert_always (start <= end); if (curr == CK_FIX_RANGE) { length = end - start; @@ -2366,24 +2354,21 @@ static uint32_t pack_clustering_val_from_desc( offset_diffs = (end_data_offset + end_data_size) - (uint32_t)(var_dest_data_ptr - orig_var_dest_data_ptr); for (uint32_t i = start; i <= end; i++) { if ( num_offset_bytes == 1 ) { - assert(offset_diffs < 256); + assert_always(offset_diffs < 256); var_dest_offset_ptr[0] = var_src_offset_ptr[i] - (uchar)offset_diffs; var_dest_offset_ptr++; - } - else if ( num_offset_bytes == 2 ) { + } else if ( num_offset_bytes == 2 ) { uint32_t tmp = uint2korr(var_src_offset_ptr + 2*i); uint32_t new_offset = tmp - offset_diffs; - assert(new_offset < 1<<16); + assert_always(new_offset < 1<<16); int2store(var_dest_offset_ptr,new_offset); var_dest_offset_ptr += 2; - } - else { - assert(false); + } else { + assert_unreachable(); } } - } - else { - assert(false); + } else { + assert_unreachable(); } } // @@ -2517,8 +2502,8 @@ static uint32_t create_toku_secondary_key_pack_descriptor ( // // store number of parts // - assert(get_key_parts(prim_key) < 128); - pos[0] = 2 * get_key_parts(prim_key); + assert_always(prim_key->user_defined_key_parts < 128); + pos[0] = 2 * prim_key->user_defined_key_parts; pos++; // // for each part, store if it is a fixed field or var field @@ -2528,7 +2513,7 @@ static uint32_t create_toku_secondary_key_pack_descriptor ( // pk_info = pos; uchar* tmp = pos; - for (uint i = 0; i < get_key_parts(prim_key); i++) { + for (uint i = 0; i < prim_key->user_defined_key_parts; i++) { tmp += pack_desc_pk_info( tmp, kc_info, @@ -2539,18 +2524,18 @@ static uint32_t create_toku_secondary_key_pack_descriptor ( // // asserting that we moved forward as much as we think we have // - assert(tmp - pos == (2 * get_key_parts(prim_key))); + assert_always(tmp - pos == (2 * prim_key->user_defined_key_parts)); pos = tmp; } - for (uint i = 0; i < get_key_parts(key_info); i++) { + for (uint i = 0; i < key_info->user_defined_key_parts; i++) { KEY_PART_INFO curr_kpi = key_info->key_part[i]; uint16 field_index = curr_kpi.field->field_index; Field* field = table_share->field[field_index]; bool is_col_in_pk = false; if (bitmap_is_set(&kc_info->key_filters[pk_index],field_index)) { - assert(!has_hpk && prim_key != NULL); + assert_always(!has_hpk && prim_key != NULL); is_col_in_pk = true; } else { @@ -2565,7 +2550,7 @@ static uint32_t create_toku_secondary_key_pack_descriptor ( // assert that columns in pk do not have a null bit // because in MySQL, pk columns cannot be null // - assert(!field->null_bit); + assert_always(!field->null_bit); } if (field->null_bit) { @@ -2667,7 +2652,7 @@ static uint32_t max_key_size_from_desc( // skip byte that states if main dictionary bool is_main_dictionary = desc_pos[0]; desc_pos++; - assert(!is_main_dictionary); + assert_always(!is_main_dictionary); // skip hpk byte desc_pos++; @@ -2730,7 +2715,7 @@ static uint32_t max_key_size_from_desc( desc_pos += sizeof(charset_num); } else { - assert(has_charset == COL_HAS_NO_CHARSET); + assert_always(has_charset == COL_HAS_NO_CHARSET); } } return max_size; @@ -2741,9 +2726,8 @@ static uint32_t pack_key_from_desc( void* row_desc, uint32_t row_desc_size, const DBT* pk_key, - const DBT* pk_val - ) -{ + const DBT* pk_val) { + MULTI_COL_PACK_INFO mcp_info; uint32_t num_null_bytes; uint32_t num_blobs; @@ -2761,7 +2745,7 @@ static uint32_t pack_key_from_desc( bool is_main_dictionary = desc_pos[0]; desc_pos++; - assert(!is_main_dictionary); + assert_always(!is_main_dictionary); // // get the constant info out of descriptor @@ -2809,7 +2793,7 @@ static uint32_t pack_key_from_desc( fixed_field_ptr = null_bytes_ptr + num_null_bytes; var_field_offset_ptr = fixed_field_ptr + mcp_info.fixed_field_size; var_field_data_ptr = var_field_offset_ptr + mcp_info.len_of_offsets; - while ( (uint32_t)(desc_pos - (uchar *)row_desc) < row_desc_size) { + while ((uint32_t)(desc_pos - (uchar*)row_desc) < row_desc_size) { uchar col_fix_val; uchar has_charset; uint32_t col_pack_val = 0; @@ -2833,8 +2817,7 @@ static uint32_t pack_key_from_desc( packed_key_pos++; desc_pos += skip_key_in_desc(desc_pos); continue; - } - else { + } else { packed_key_pos[0] = NONNULL_COL_VAL; packed_key_pos++; } @@ -2858,42 +2841,46 @@ static uint32_t pack_key_from_desc( if (has_charset == COL_HAS_CHARSET) { memcpy(&charset_num, desc_pos, sizeof(charset_num)); desc_pos += sizeof(charset_num); - } - else { - assert(has_charset == COL_HAS_NO_CHARSET); + } else { + assert_always(has_charset == COL_HAS_NO_CHARSET); } // // case where column is in pk val // - if (col_fix_val == COL_FIX_FIELD || col_fix_val == COL_VAR_FIELD || col_fix_val == COL_BLOB_FIELD) { - if (col_fix_val == COL_FIX_FIELD && has_charset == COL_HAS_NO_CHARSET) { - memcpy(packed_key_pos, &fixed_field_ptr[col_pack_val], key_length); + if (col_fix_val == COL_FIX_FIELD || + col_fix_val == COL_VAR_FIELD || + col_fix_val == COL_BLOB_FIELD) { + if (col_fix_val == COL_FIX_FIELD && + has_charset == COL_HAS_NO_CHARSET) { + memcpy( + packed_key_pos, + &fixed_field_ptr[col_pack_val], + key_length); packed_key_pos += key_length; - } - else if (col_fix_val == COL_VAR_FIELD && has_charset == COL_HAS_NO_CHARSET) { + } else if (col_fix_val == COL_VAR_FIELD && + has_charset == COL_HAS_NO_CHARSET) { uint32_t data_start_offset = 0; uint32_t data_size = 0; get_var_field_info( - &data_size, - &data_start_offset, - col_pack_val, - var_field_offset_ptr, - num_offset_bytes - ); + &data_size, + &data_start_offset, + col_pack_val, + var_field_offset_ptr, + num_offset_bytes); // // length of this field in this row is data_size // data is located beginning at var_field_data_ptr + data_start_offset // packed_key_pos = pack_toku_varbinary_from_desc( - packed_key_pos, - var_field_data_ptr + data_start_offset, - key_length, //number of bytes to use to encode the length in to_tokudb - data_size //length of field - ); - } - else { + packed_key_pos, + var_field_data_ptr + data_start_offset, + //number of bytes to use to encode the length in to_tokudb + key_length, + //length of field + data_size); + } else { const uchar* data_start = NULL; uint32_t data_start_offset = 0; uint32_t data_size = 0; @@ -2902,76 +2889,59 @@ static uint32_t pack_key_from_desc( data_start_offset = col_pack_val; data_size = key_length; data_start = fixed_field_ptr + data_start_offset; - } - else if (col_fix_val == COL_VAR_FIELD){ + } else if (col_fix_val == COL_VAR_FIELD){ get_var_field_info( - &data_size, - &data_start_offset, - col_pack_val, - var_field_offset_ptr, - num_offset_bytes - ); + &data_size, + &data_start_offset, + col_pack_val, + var_field_offset_ptr, + num_offset_bytes); data_start = var_field_data_ptr + data_start_offset; - } - else if (col_fix_val == COL_BLOB_FIELD) { + } else if (col_fix_val == COL_BLOB_FIELD) { uint32_t blob_index = col_pack_val; uint32_t blob_offset; const uchar* blob_ptr = NULL; uint32_t field_len; uint32_t field_len_bytes = blob_lengths[blob_index]; get_blob_field_info( - &blob_offset, + &blob_offset, mcp_info.len_of_offsets, - var_field_data_ptr, - num_offset_bytes - ); + var_field_data_ptr, + num_offset_bytes); blob_ptr = var_field_data_ptr + blob_offset; - assert(num_blobs > 0); - // - // skip over other blobs to get to the one we want to make a key out of - // + assert_always(num_blobs > 0); + + // skip over other blobs to get to the one we want to + // make a key out of for (uint32_t i = 0; i < blob_index; i++) { blob_ptr = unpack_toku_field_blob( NULL, blob_ptr, blob_lengths[i], - true - ); + true); } - // - // at this point, blob_ptr is pointing to the blob we want to make a key from - // + // at this point, blob_ptr is pointing to the blob we + // want to make a key from field_len = get_blob_field_len(blob_ptr, field_len_bytes); - // // now we set the variables to make the key - // data_start = blob_ptr + field_len_bytes; data_size = field_len; - - - } - else { - assert(false); + } else { + assert_unreachable(); } - packed_key_pos = pack_toku_varstring_from_desc( - packed_key_pos, + packed_key_pos = pack_toku_varstring_from_desc(packed_key_pos, data_start, key_length, data_size, - charset_num - ); + charset_num); } - } - // - // case where column is in pk key - // - else { + } else { + // case where column is in pk key if (col_fix_val == COL_FIX_PK_OFFSET) { memcpy(packed_key_pos, &pk_data_ptr[col_pack_val], key_length); packed_key_pos += key_length; - } - else if (col_fix_val == COL_VAR_PK_OFFSET) { + } else if (col_fix_val == COL_VAR_PK_OFFSET) { uchar* tmp_pk_data_ptr = pk_data_ptr; uint32_t index_in_pk = col_pack_val; // @@ -2980,25 +2950,21 @@ static uint32_t pack_key_from_desc( for (uint32_t i = 0; i < index_in_pk; i++) { if (pk_info[2*i] == COL_FIX_FIELD) { tmp_pk_data_ptr += pk_info[2*i + 1]; - } - else if (pk_info[2*i] == COL_VAR_FIELD) { + } else if (pk_info[2*i] == COL_VAR_FIELD) { uint32_t len_bytes = pk_info[2*i + 1]; uint32_t len; if (len_bytes == 1) { len = tmp_pk_data_ptr[0]; tmp_pk_data_ptr++; - } - else if (len_bytes == 2) { + } else if (len_bytes == 2) { len = uint2korr(tmp_pk_data_ptr); tmp_pk_data_ptr += 2; - } - else { - assert(false); + } else { + assert_unreachable(); } tmp_pk_data_ptr += len; - } - else { - assert(false); + } else { + assert_unreachable(); } } // @@ -3008,21 +2974,18 @@ static uint32_t pack_key_from_desc( if (is_fix_field == COL_FIX_FIELD) { memcpy(packed_key_pos, tmp_pk_data_ptr, key_length); packed_key_pos += key_length; - } - else if (is_fix_field == COL_VAR_FIELD) { + } else if (is_fix_field == COL_VAR_FIELD) { const uchar* data_start = NULL; uint32_t data_size = 0; uint32_t len_bytes = pk_info[2*index_in_pk + 1]; if (len_bytes == 1) { data_size = tmp_pk_data_ptr[0]; tmp_pk_data_ptr++; - } - else if (len_bytes == 2) { + } else if (len_bytes == 2) { data_size = uint2korr(tmp_pk_data_ptr); tmp_pk_data_ptr += 2; - } - else { - assert(false); + } else { + assert_unreachable(); } data_start = tmp_pk_data_ptr; @@ -3032,32 +2995,26 @@ static uint32_t pack_key_from_desc( data_start, key_length, data_size, - charset_num - ); - } - else if (has_charset == COL_HAS_NO_CHARSET) { + charset_num); + } else if (has_charset == COL_HAS_NO_CHARSET) { packed_key_pos = pack_toku_varbinary_from_desc( - packed_key_pos, - data_start, + packed_key_pos, + data_start, key_length, - data_size //length of field - ); - } - else { - assert(false); + data_size); + } else { + assert_unreachable(); } + } else { + assert_unreachable(); } - else { - assert(false); - } - } - else { - assert(false); + } else { + assert_unreachable(); } } } - assert( (uint32_t)(desc_pos - (uchar *)row_desc) == row_desc_size); + assert_always( (uint32_t)(desc_pos - (uchar *)row_desc) == row_desc_size); // // now append the primary key to the end of the key @@ -3065,13 +3022,12 @@ static uint32_t pack_key_from_desc( if (hpk) { memcpy(packed_key_pos, pk_key->data, pk_key->size); packed_key_pos += pk_key->size; - } - else { + } else { memcpy(packed_key_pos, (uchar *)pk_key->data + 1, pk_key->size - 1); packed_key_pos += (pk_key->size - 1); } - return (uint32_t)(packed_key_pos - buf); // + return (uint32_t)(packed_key_pos - buf); } static bool fields_have_same_name(Field* a, Field* b) { @@ -3248,7 +3204,7 @@ static bool fields_are_same_type(Field* a, Field* b) { case MYSQL_TYPE_DECIMAL: case MYSQL_TYPE_VAR_STRING: case MYSQL_TYPE_NULL: - assert(false); + assert_unreachable(); } cleanup: diff --git a/storage/tokudb/hatoku_cmp.h b/storage/tokudb/hatoku_cmp.h index 9a5358fc9af..34b3cfbe1f8 100644 --- a/storage/tokudb/hatoku_cmp.h +++ b/storage/tokudb/hatoku_cmp.h @@ -26,9 +26,9 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #ifndef _HATOKU_CMP #define _HATOKU_CMP -#include "stdint.h" +#include "hatoku_defines.h" +#include "tokudb_debug.h" -#include // // A MySQL row is encoded in TokuDB, as follows: @@ -180,7 +180,7 @@ static inline uint32_t get_blob_field_len(const uchar* from_tokudb, uint32_t len length = uint4korr(from_tokudb); break; default: - assert(false); + assert_unreachable(); } return length; } diff --git a/storage/tokudb/hatoku_defines.h b/storage/tokudb/hatoku_defines.h index 83bf0f699c6..44ad3184f63 100644 --- a/storage/tokudb/hatoku_defines.h +++ b/storage/tokudb/hatoku_defines.h @@ -23,8 +23,47 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." -#ifndef _TOKUDB_CONFIG_H -#define _TOKUDB_CONFIG_H +#ifndef _HATOKU_DEFINES_H +#define _HATOKU_DEFINES_H + +#include +#define MYSQL_SERVER 1 +#include "mysql_version.h" +#include "sql_table.h" +#include "handler.h" +#include "table.h" +#include "log.h" +#include "sql_class.h" +#include "sql_show.h" +#include "discover.h" +//#include +#include "debug_sync.h" + +#undef PACKAGE +#undef VERSION +#undef HAVE_DTRACE +#undef _DTRACE_VERSION + +/* We define DTRACE after mysql_priv.h in case it disabled dtrace in the main server */ +#ifdef HAVE_DTRACE +#define _DTRACE_VERSION 1 +#else +#endif + +#include + +#include +#include +#define __STDC_FORMAT_MACROS +#include +#if defined(_WIN32) +#include "misc.h" +#endif + +#include "db.h" +#include "toku_os.h" +#include "toku_time.h" +#include "partitioned_counter.h" #ifdef USE_PRAGMA_INTERFACE #pragma interface /* gcc class implementation */ @@ -163,326 +202,51 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. /* Bits for share->status */ #define STATUS_PRIMARY_KEY_INIT 0x1 -#endif // _TOKUDB_CONFIG_H - -#ifndef _TOKUDB_DEBUG_H -#define _TOKUDB_DEBUG_H - -#define TOKU_INCLUDE_BACKTRACE 0 -#if TOKU_INCLUDE_BACKTRACE -static void tokudb_backtrace(void); -#endif - -extern ulong tokudb_debug; - -// tokudb debug tracing -#define TOKUDB_DEBUG_INIT 1 -#define TOKUDB_DEBUG_OPEN 2 -#define TOKUDB_DEBUG_ENTER 4 -#define TOKUDB_DEBUG_RETURN 8 -#define TOKUDB_DEBUG_ERROR 16 -#define TOKUDB_DEBUG_TXN 32 -#define TOKUDB_DEBUG_AUTO_INCREMENT 64 -#define TOKUDB_DEBUG_INDEX_KEY 128 -#define TOKUDB_DEBUG_LOCK 256 -#define TOKUDB_DEBUG_CHECK_KEY 1024 -#define TOKUDB_DEBUG_HIDE_DDL_LOCK_ERRORS 2048 -#define TOKUDB_DEBUG_ALTER_TABLE 4096 -#define TOKUDB_DEBUG_UPSERT 8192 -#define TOKUDB_DEBUG_CHECK (1<<14) -#define TOKUDB_DEBUG_ANALYZE (1<<15) - -#define TOKUDB_TRACE(f, ...) { \ - fprintf(stderr, "%u %s:%u %s " f "\n", my_tid(), __FILE__, __LINE__, __FUNCTION__, ##__VA_ARGS__); \ -} - -static inline unsigned int my_tid() { - return (unsigned int)toku_os_gettid(); -} - -#define TOKUDB_DBUG_ENTER(f, ...) { \ - if (tokudb_debug & TOKUDB_DEBUG_ENTER) { \ - TOKUDB_TRACE(f, ##__VA_ARGS__); \ - } \ -} \ - DBUG_ENTER(__FUNCTION__); - -#define TOKUDB_DBUG_RETURN(r) { \ - int rr = (r); \ - if ((tokudb_debug & TOKUDB_DEBUG_RETURN) || (rr != 0 && (tokudb_debug & TOKUDB_DEBUG_ERROR))) { \ - TOKUDB_TRACE("return %d", rr); \ - } \ - DBUG_RETURN(rr); \ -} - -#define TOKUDB_HANDLER_TRACE(f, ...) \ - fprintf(stderr, "%u %p %s:%u ha_tokudb::%s " f "\n", my_tid(), this, __FILE__, __LINE__, __FUNCTION__, ##__VA_ARGS__); - -#define TOKUDB_HANDLER_DBUG_ENTER(f, ...) { \ - if (tokudb_debug & TOKUDB_DEBUG_ENTER) { \ - TOKUDB_HANDLER_TRACE(f, ##__VA_ARGS__); \ - } \ -} \ - DBUG_ENTER(__FUNCTION__); - -#define TOKUDB_HANDLER_DBUG_RETURN(r) { \ - int rr = (r); \ - if ((tokudb_debug & TOKUDB_DEBUG_RETURN) || (rr != 0 && (tokudb_debug & TOKUDB_DEBUG_ERROR))) { \ - TOKUDB_HANDLER_TRACE("return %d", rr); \ - } \ - DBUG_RETURN(rr); \ -} - -#define TOKUDB_HANDLER_DBUG_VOID_RETURN { \ - if (tokudb_debug & TOKUDB_DEBUG_RETURN) { \ - TOKUDB_HANDLER_TRACE("return"); \ - } \ - DBUG_VOID_RETURN; \ -} - -#define TOKUDB_DBUG_DUMP(s, p, len) \ -{ \ - TOKUDB_TRACE("%s", s); \ - uint i; \ - for (i=0; ideleted = 0; - val->inserted = 0; - val->updated = 0; - val->queried = 0; -} - -static inline int get_name_length(const char *name) { - int n = 0; - const char *newname = name; - n += strlen(newname); - n += strlen(ha_tokudb_ext); - return n; -} - -// -// returns maximum length of path to a dictionary -// -static inline int get_max_dict_name_path_length(const char *tablename) { - int n = 0; - n += get_name_length(tablename); - n += 1; //for the '-' - n += MAX_DICT_NAME_LEN; - return n; -} - -static inline void make_name(char *newname, const char *tablename, const char *dictname) { - const char *newtablename = tablename; - char *nn = newname; - assert(tablename); - assert(dictname); - nn += sprintf(nn, "%s", newtablename); - nn += sprintf(nn, "-%s", dictname); -} - -static inline int txn_begin(DB_ENV *env, DB_TXN *parent, DB_TXN **txn, uint32_t flags, THD *thd) { - *txn = NULL; - int r = env->txn_begin(env, parent, txn, flags); - if (r == 0 && thd) { - DB_TXN *this_txn = *txn; - this_txn->set_client_id(this_txn, thd_get_thread_id(thd)); - } - if ((tokudb_debug & TOKUDB_DEBUG_TXN)) { - TOKUDB_TRACE("begin txn %p %p %u r=%d", parent, *txn, flags, r); - } - return r; -} - -static inline void commit_txn(DB_TXN* txn, uint32_t flags) { - if (tokudb_debug & TOKUDB_DEBUG_TXN) - TOKUDB_TRACE("commit txn %p", txn); - int r = txn->commit(txn, flags); - if (r != 0) { - sql_print_error("tried committing transaction %p and got error code %d", txn, r); - } - assert(r == 0); -} - -static inline void abort_txn(DB_TXN* txn) { - if (tokudb_debug & TOKUDB_DEBUG_TXN) - TOKUDB_TRACE("abort txn %p", txn); - int r = txn->abort(txn); - if (r != 0) { - sql_print_error("tried aborting transaction %p and got error code %d", txn, r); - } - assert(r == 0); -} - -#endif // _TOKUDB_TXN_H - -#ifndef _TOKUDB_PORTABILITY_H -#define _TOKUDB_PORTABILITY_H - -static inline void *tokudb_my_malloc(size_t s, myf flags) { -#if 50700 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50799 - return my_malloc(0, s, flags); +#if defined(TOKUDB_VERSION_MAJOR) && defined(TOKUDB_VERSION_MINOR) +#define TOKUDB_PLUGIN_VERSION ((TOKUDB_VERSION_MAJOR << 8) + TOKUDB_VERSION_MINOR) #else - return my_malloc(s, flags); +#define TOKUDB_PLUGIN_VERSION 0 #endif -} -static inline void *tokudb_my_realloc(void *p, size_t s, myf flags) { - if (s == 0) - return p; -#if 50700 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50799 - return my_realloc(0, p, s, flags); +// Branch prediction macros. +// If supported by the compiler, will hint in instruction caching for likely +// branching. Should only be used where there is a very good idea of the correct +// branch heuristics as determined by profiling. Mostly copied from InnoDB. +// Use: +// "if (TOKUDB_LIKELY(x))" where the chances of "x" evaluating true are higher +// "if (TOKUDB_UNLIKELY(x))" where the chances of "x" evaluating false are higher +#if defined(__GNUC__) && (__GNUC__ > 2) && ! defined(__INTEL_COMPILER) + +// Tell the compiler that 'expr' probably evaluates to 'constant'. +#define TOKUDB_EXPECT(expr,constant) __builtin_expect(expr, constant) + #else - return my_realloc(p, s, flags | MY_ALLOW_ZERO_PTR); -#endif -} -static inline void tokudb_my_free(void *ptr) { - if (ptr) - my_free(ptr); -} +#error "No TokuDB branch prediction operations in use!" +#define TOKUDB_EXPECT(expr,constant) (expr) -static inline char *tokudb_my_strdup(const char *p, myf flags) { -#if 50700 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50799 - return my_strdup(0, p, flags); -#else - return my_strdup(p, flags); -#endif -} +#endif // defined(__GNUC__) && (__GNUC__ > 2) && ! defined(__INTEL_COMPILER) -static inline void* tokudb_my_multi_malloc(myf myFlags, ...) { - va_list args; - char **ptr,*start,*res; - size_t tot_length,length; +// Tell the compiler that cond is likely to hold +#define TOKUDB_LIKELY(cond) TOKUDB_EXPECT(cond, 1) - va_start(args,myFlags); - tot_length=0; - while ((ptr=va_arg(args, char **))) { - length=va_arg(args,uint); - tot_length+=ALIGN_SIZE(length); - } - va_end(args); - - if (!(start=(char *) tokudb_my_malloc(tot_length,myFlags))) { - return 0; - } - - va_start(args,myFlags); - res=start; - while ((ptr=va_arg(args, char **))) { - *ptr=res; - length=va_arg(args,uint); - res+=ALIGN_SIZE(length); - } - va_end(args); - return start; -} - -static inline void tokudb_pthread_mutex_init(pthread_mutex_t *mutex, const pthread_mutexattr_t *attr) { - int r = pthread_mutex_init(mutex, attr); - assert(r == 0); -} - -static inline void tokudb_pthread_mutex_destroy(pthread_mutex_t *mutex) { - int r = pthread_mutex_destroy(mutex); - assert(r == 0); -} - -static inline void tokudb_pthread_mutex_lock(pthread_mutex_t *mutex) { - int r = pthread_mutex_lock(mutex); - assert(r == 0); -} - -static inline void tokudb_pthread_mutex_unlock(pthread_mutex_t *mutex) { - int r = pthread_mutex_unlock(mutex); - assert(r == 0); -} - -static inline void tokudb_pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr) { - int r = pthread_cond_init(cond, attr); - assert(r == 0); -} - -static inline void tokudb_pthread_cond_destroy(pthread_cond_t *cond) { - int r = pthread_cond_destroy(cond); - assert(r == 0); -} - -static inline void tokudb_pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex) { - int r = pthread_cond_wait(cond, mutex); - assert(r == 0); -} - -static inline void tokudb_pthread_cond_broadcast(pthread_cond_t *cond) { - int r = pthread_cond_broadcast(cond); - assert(r == 0); -} +// Tell the compiler that cond is unlikely to hold +#define TOKUDB_UNLIKELY(cond) TOKUDB_EXPECT(cond, 0) +// Tell the compiler that the function/argument is unused +#define TOKUDB_UNUSED(_uu) _uu __attribute__((unused)) // mysql 5.6.15 removed the test macro, so we define our own #define tokudb_test(e) ((e) ? 1 : 0) -static const char *tokudb_thd_get_proc_info(THD *thd) { +inline const char* tokudb_thd_get_proc_info(const THD *thd) { return thd->proc_info; } // uint3korr reads 4 bytes and valgrind reports an error, so we use this function instead -static uint tokudb_uint3korr(const uchar *a) { +inline uint tokudb_uint3korr(const uchar *a) { uchar b[4] = {}; memcpy(b, a, 3); return uint3korr(b); } -#endif // _TOKUDB_PORTABILITY_H +#endif // _HATOKU_DEFINES_H diff --git a/storage/tokudb/hatoku_hton.cc b/storage/tokudb/hatoku_hton.cc index d97986f162b..e62836c5ed4 100644 --- a/storage/tokudb/hatoku_hton.cc +++ b/storage/tokudb/hatoku_hton.cc @@ -24,35 +24,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." -#define MYSQL_SERVER 1 -#include "hatoku_defines.h" -#include -#include - -#include "stdint.h" -#if defined(_WIN32) -#include "misc.h" -#endif -#define __STDC_FORMAT_MACROS -#include -#include "toku_os.h" -#include "toku_time.h" -#include "partitioned_counter.h" - -/* We define DTRACE after mysql_priv.h in case it disabled dtrace in the main server */ -#ifdef HAVE_DTRACE -#define _DTRACE_VERSION 1 -#else -#endif - -#include #include "hatoku_hton.h" -#include "ha_tokudb.h" - -#undef PACKAGE -#undef VERSION -#undef HAVE_DTRACE -#undef _DTRACE_VERSION #define TOKU_METADB_NAME "tokudb_meta" @@ -62,75 +34,96 @@ typedef struct savepoint_info { bool in_sub_stmt; } *SP_INFO, SP_INFO_T; -#if TOKU_INCLUDE_OPTION_STRUCTS -ha_create_table_option tokudb_table_options[] = { - HA_TOPTION_SYSVAR("compression", row_format, row_format), - HA_TOPTION_END -}; +static handler* tokudb_create_handler( + handlerton* hton, + TABLE_SHARE* table, + MEM_ROOT* mem_root); -ha_create_table_option tokudb_index_options[] = { - HA_IOPTION_BOOL("clustering", clustering, 0), - HA_IOPTION_END -}; -#endif - -static uchar *tokudb_get_key(TOKUDB_SHARE * share, size_t * length, my_bool not_used __attribute__ ((unused))) { - *length = share->table_name_length; - return (uchar *) share->table_name; -} - -static handler *tokudb_create_handler(handlerton * hton, TABLE_SHARE * table, MEM_ROOT * mem_root); - - -static void tokudb_print_error(const DB_ENV * db_env, const char *db_errpfx, const char *buffer); +static void tokudb_print_error( + const DB_ENV* db_env, + const char* db_errpfx, + const char* buffer); static void tokudb_cleanup_log_files(void); -static int tokudb_end(handlerton * hton, ha_panic_function type); -static bool tokudb_flush_logs(handlerton * hton); -static bool tokudb_show_status(handlerton * hton, THD * thd, stat_print_fn * print, enum ha_stat_type); +static int tokudb_end(handlerton* hton, ha_panic_function type); +static bool tokudb_flush_logs(handlerton* hton); +static bool tokudb_show_status( + handlerton* hton, + THD* thd, + stat_print_fn* print, + enum ha_stat_type); #if TOKU_INCLUDE_HANDLERTON_HANDLE_FATAL_SIGNAL -static void tokudb_handle_fatal_signal(handlerton *hton, THD *thd, int sig); +static void tokudb_handle_fatal_signal(handlerton* hton, THD* thd, int sig); #endif -static int tokudb_close_connection(handlerton * hton, THD * thd); -static int tokudb_commit(handlerton * hton, THD * thd, bool all); -static int tokudb_rollback(handlerton * hton, THD * thd, bool all); +static int tokudb_close_connection(handlerton* hton, THD* thd); +static int tokudb_commit(handlerton* hton, THD* thd, bool all); +static int tokudb_rollback(handlerton* hton, THD* thd, bool all); #if TOKU_INCLUDE_XA static int tokudb_xa_prepare(handlerton* hton, THD* thd, bool all); -static int tokudb_xa_recover(handlerton* hton, XID* xid_list, uint len); +static int tokudb_xa_recover(handlerton* hton, XID* xid_list, uint len); static int tokudb_commit_by_xid(handlerton* hton, XID* xid); -static int tokudb_rollback_by_xid(handlerton* hton, XID* xid); +static int tokudb_rollback_by_xid(handlerton* hton, XID* xid); #endif -static int tokudb_rollback_to_savepoint(handlerton * hton, THD * thd, void *savepoint); -static int tokudb_savepoint(handlerton * hton, THD * thd, void *savepoint); -static int tokudb_release_savepoint(handlerton * hton, THD * thd, void *savepoint); +static int tokudb_rollback_to_savepoint( + handlerton* hton, + THD* thd, + void* savepoint); +static int tokudb_savepoint(handlerton* hton, THD* thd, void* savepoint); +static int tokudb_release_savepoint( + handlerton* hton, + THD* thd, + void* savepoint); #if 100000 <= MYSQL_VERSION_ID static int tokudb_discover_table(handlerton *hton, THD* thd, TABLE_SHARE *ts); -static int tokudb_discover_table_existence(handlerton *hton, const char *db, const char *name); +static int tokudb_discover_table_existence( + handlerton* hton, + const char* db, + const char* name); #endif -static int tokudb_discover(handlerton *hton, THD* thd, const char *db, const char *name, uchar **frmblob, size_t *frmlen); -static int tokudb_discover2(handlerton *hton, THD* thd, const char *db, const char *name, bool translate_name, uchar **frmblob, size_t *frmlen); -static int tokudb_discover3(handlerton *hton, THD* thd, const char *db, const char *name, char *path, uchar **frmblob, size_t *frmlen); -handlerton *tokudb_hton; +static int tokudb_discover( + handlerton* hton, + THD* thd, + const char* db, + const char* name, + uchar** frmblob, + size_t* frmlen); +static int tokudb_discover2( + handlerton* hton, + THD* thd, + const char* db, + const char* name, + bool translate_name, + uchar** frmblob, + size_t* frmlen); +static int tokudb_discover3( + handlerton* hton, + THD* thd, + const char* db, + const char* name, + char* path, + uchar** frmblob, + size_t* frmlen); +handlerton* tokudb_hton; -const char *ha_tokudb_ext = ".tokudb"; -char *tokudb_data_dir; -ulong tokudb_debug; -DB_ENV *db_env; -HASH tokudb_open_tables; -pthread_mutex_t tokudb_mutex; +const char* ha_tokudb_ext = ".tokudb"; +DB_ENV* db_env; #if TOKU_THDVAR_MEMALLOC_BUG -static pthread_mutex_t tokudb_map_mutex; +static tokudb::thread::mutex_t tokudb_map_mutex; static TREE tokudb_map; struct tokudb_map_pair { - THD *thd; + THD* thd; char *last_lock_timeout; }; #if 50500 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50599 static int tokudb_map_pair_cmp(void *custom_arg, const void *a, const void *b) { #else -static int tokudb_map_pair_cmp(const void *custom_arg, const void *a, const void *b) { +static int tokudb_map_pair_cmp( + const void* custom_arg, + const void* a, + const void* b) { #endif + const struct tokudb_map_pair *a_key = (const struct tokudb_map_pair *) a; const struct tokudb_map_pair *b_key = (const struct tokudb_map_pair *) b; if (a_key->thd < b_key->thd) @@ -142,30 +135,41 @@ static int tokudb_map_pair_cmp(const void *custom_arg, const void *a, const void }; #endif -#if TOKU_INCLUDE_HANDLERTON_HANDLE_FATAL_SIGNAL -static my_bool tokudb_gdb_on_fatal; -static char *tokudb_gdb_path; -#endif - static PARTITIONED_COUNTER tokudb_primary_key_bytes_inserted; void toku_hton_update_primary_key_bytes_inserted(uint64_t row_size) { increment_partitioned_counter(tokudb_primary_key_bytes_inserted, row_size); } -static void tokudb_lock_timeout_callback(DB *db, uint64_t requesting_txnid, const DBT *left_key, const DBT *right_key, uint64_t blocking_txnid); -static ulong tokudb_cleaner_period; -static ulong tokudb_cleaner_iterations; +static void tokudb_lock_timeout_callback( + DB* db, + uint64_t requesting_txnid, + const DBT* left_key, + const DBT* right_key, + uint64_t blocking_txnid); #define ASSERT_MSGLEN 1024 -void toku_hton_assert_fail(const char* expr_as_string, const char * fun, const char * file, int line, int caller_errno) { +void toku_hton_assert_fail( + const char* expr_as_string, + const char* fun, + const char* file, + int line, + int caller_errno) { + char msg[ASSERT_MSGLEN]; if (db_env) { snprintf(msg, ASSERT_MSGLEN, "Handlerton: %s ", expr_as_string); db_env->crash(db_env, msg, fun, file, line,caller_errno); - } - else { - snprintf(msg, ASSERT_MSGLEN, "Handlerton assertion failed, no env, %s, %d, %s, %s (errno=%d)\n", file, line, fun, expr_as_string, caller_errno); + } else { + snprintf( + msg, + ASSERT_MSGLEN, + "Handlerton assertion failed, no env, %s, %d, %s, %s (errno=%d)\n", + file, + line, + fun, + expr_as_string, + caller_errno); perror(msg); fflush(stderr); } @@ -184,36 +188,11 @@ static uint32_t tokudb_env_flags = 0; // static uint32_t tokudb_lock_type = DB_LOCK_DEFAULT; // static ulong tokudb_log_buffer_size = 0; // static ulong tokudb_log_file_size = 0; -static my_bool tokudb_directio = FALSE; -static my_bool tokudb_compress_buffers_before_eviction = TRUE; -static my_bool tokudb_checkpoint_on_flush_logs = FALSE; -static ulonglong tokudb_cache_size = 0; -static uint32_t tokudb_client_pool_threads = 0; -static uint32_t tokudb_cachetable_pool_threads = 0; -static uint32_t tokudb_checkpoint_pool_threads = 0; -static ulonglong tokudb_max_lock_memory = 0; -static my_bool tokudb_enable_partial_eviction = TRUE; -static char *tokudb_home; -static char *tokudb_tmp_dir; -static char *tokudb_log_dir; +static char* tokudb_home; // static long tokudb_lock_scan_time = 0; // static ulong tokudb_region_size = 0; // static ulong tokudb_cache_parts = 1; -const char *tokudb_hton_name = "TokuDB"; -static uint32_t tokudb_checkpointing_period; -static uint32_t tokudb_fsync_log_period; -uint32_t tokudb_write_status_frequency; -uint32_t tokudb_read_status_frequency; - -#ifdef TOKUDB_VERSION -#define tokudb_stringify_2(x) #x -#define tokudb_stringify(x) tokudb_stringify_2(x) -#define TOKUDB_VERSION_STR tokudb_stringify(TOKUDB_VERSION) -#else -#define TOKUDB_VERSION_STR NULL -#endif -char *tokudb_version = (char *) TOKUDB_VERSION_STR; -static int tokudb_fs_reserve_percent; // file system reserve as a percentage of total disk space +const char* tokudb_hton_name = "TokuDB"; #if defined(_WIN32) extern "C" { @@ -226,18 +205,8 @@ extern "C" { // Since we don't have static initializers for the opaque rwlock type, // use constructor and destructor functions to create and destroy // the lock before and after main(), respectively. -static int tokudb_hton_initialized; -static rw_lock_t tokudb_hton_initialized_lock; - -static void create_tokudb_hton_intialized_lock(void) __attribute__((constructor)); -static void create_tokudb_hton_intialized_lock(void) { - my_rwlock_init(&tokudb_hton_initialized_lock, 0); -} - -static void destroy_tokudb_hton_initialized_lock(void) __attribute__((destructor)); -static void destroy_tokudb_hton_initialized_lock(void) { - rwlock_destroy(&tokudb_hton_initialized_lock); -} +int tokudb_hton_initialized; +tokudb::thread::rwlock_t tokudb_hton_initialized_lock; static SHOW_VAR *toku_global_status_variables = NULL; static uint64_t toku_global_status_max_rows; @@ -266,7 +235,10 @@ static void handle_ydb_error(int error) { sql_print_error("************************************************************"); break; case TOKUDB_UPGRADE_FAILURE: - sql_print_error("%s upgrade failed. A clean shutdown of the previous version is required.", tokudb_hton_name); + sql_print_error( + "%s upgrade failed. A clean shutdown of the previous version is " + "required.", + tokudb_hton_name); break; default: sql_print_error("%s unknown error %d", tokudb_hton_name, error); @@ -289,41 +261,51 @@ static int tokudb_init_func(void *p) { int r; // 3938: lock the handlerton's initialized status flag for writing - r = rw_wrlock(&tokudb_hton_initialized_lock); - assert(r == 0); + tokudb_hton_initialized_lock.lock_write(); db_env = NULL; tokudb_hton = (handlerton *) p; #if TOKUDB_CHECK_JEMALLOC - if (tokudb_check_jemalloc) { - typedef int (*mallctl_type)(const char *, void *, size_t *, void *, size_t); + if (tokudb::sysvars::check_jemalloc) { + typedef int (*mallctl_type)( + const char*, + void*, + size_t*, + void*, + size_t); mallctl_type mallctl_func; mallctl_func= (mallctl_type)dlsym(RTLD_DEFAULT, "mallctl"); if (!mallctl_func) { - sql_print_error("%s is not initialized because jemalloc is not loaded", tokudb_hton_name); + sql_print_error( + "%s is not initialized because jemalloc is not loaded", + tokudb_hton_name); goto error; } char *ver; - size_t len= sizeof(ver); + size_t len = sizeof(ver); mallctl_func("version", &ver, &len, NULL, 0); /* jemalloc 2.2.5 crashes mysql-test */ if (strcmp(ver, "2.3.") < 0) { - sql_print_error("%s is not initialized because jemalloc is older than 2.3.0", tokudb_hton_name); + sql_print_error( + "%s is not initialized because jemalloc is older than 2.3.0", + tokudb_hton_name); goto error; } - } #endif r = tokudb_set_product_name(); if (r) { - sql_print_error("%s can not set product name error %d", tokudb_hton_name, r); + sql_print_error( + "%s can not set product name error %d", + tokudb_hton_name, + r); goto error; } - tokudb_pthread_mutex_init(&tokudb_mutex, MY_MUTEX_INIT_FAST); - (void) my_hash_init(&tokudb_open_tables, table_alias_charset, 32, 0, 0, (my_hash_get_key) tokudb_get_key, 0, 0); + TOKUDB_SHARE::static_init(); + tokudb::background::initialize(); tokudb_hton->state = SHOW_OPTION_YES; // tokudb_hton->flags= HTON_CAN_RECREATE; // QQQ this came from skeleton @@ -383,8 +365,8 @@ static int tokudb_init_func(void *p) { #endif #if TOKU_INCLUDE_OPTION_STRUCTS - tokudb_hton->table_options = tokudb_table_options; - tokudb_hton->index_options = tokudb_index_options; + tokudb_hton->table_options = tokudb::sysvars::tokudb_table_options; + tokudb_hton->index_options = tokudb::sysvars::tokudb_index_options; #endif if (!tokudb_home) @@ -400,8 +382,11 @@ static int tokudb_init_func(void *p) { DBUG_PRINT("info", ("tokudb_env_flags: 0x%x\n", tokudb_env_flags)); r = db_env->set_flags(db_env, tokudb_env_flags, 1); if (r) { // QQQ - if (tokudb_debug & TOKUDB_DEBUG_INIT) - TOKUDB_TRACE("WARNING: flags=%x r=%d", tokudb_env_flags, r); + TOKUDB_TRACE_FOR_FLAGS( + TOKUDB_DEBUG_INIT, + "WARNING: flags=%x r=%d", + tokudb_env_flags, + r); // goto error; } @@ -409,6 +394,16 @@ static int tokudb_init_func(void *p) { db_env->set_errcall(db_env, tokudb_print_error); db_env->set_errpfx(db_env, tokudb_hton_name); + // Handle deprecated options + if (tokudb::sysvars::pk_insert_mode(NULL) != 1) { + TOKUDB_TRACE("Using tokudb_pk_insert_mode is deprecated and the " + "parameter may be removed in future releases. " + "tokudb_pk_insert_mode=0 is now forbidden. " + "See documentation and release notes for details"); + if (tokudb::sysvars::pk_insert_mode(NULL) < 1) + tokudb::sysvars::set_pk_insert_mode(NULL, 1); + } + // // set default comparison functions // @@ -419,8 +414,8 @@ static int tokudb_init_func(void *p) { } { - char *tmp_dir = tokudb_tmp_dir; - char *data_dir = tokudb_data_dir; + char* tmp_dir = tokudb::sysvars::tmp_dir; + char* data_dir = tokudb::sysvars::data_dir; if (data_dir == 0) { data_dir = mysql_data_home; } @@ -433,36 +428,48 @@ static int tokudb_init_func(void *p) { db_env->set_tmp_dir(db_env, tmp_dir); } - if (tokudb_log_dir) { - DBUG_PRINT("info", ("tokudb_log_dir: %s\n", tokudb_log_dir)); - db_env->set_lg_dir(db_env, tokudb_log_dir); + if (tokudb::sysvars::log_dir) { + DBUG_PRINT("info", ("tokudb_log_dir: %s\n", tokudb::sysvars::log_dir)); + db_env->set_lg_dir(db_env, tokudb::sysvars::log_dir); } - // config the cache table size to min(1/2 of physical memory, 1/8 of the process address space) - if (tokudb_cache_size == 0) { + // config the cache table size to min(1/2 of physical memory, 1/8 of the + // process address space) + if (tokudb::sysvars::cache_size == 0) { uint64_t physmem, maxdata; physmem = toku_os_get_phys_memory_size(); - tokudb_cache_size = physmem / 2; + tokudb::sysvars::cache_size = physmem / 2; r = toku_os_get_max_process_data_size(&maxdata); if (r == 0) { - if (tokudb_cache_size > maxdata / 8) - tokudb_cache_size = maxdata / 8; + if (tokudb::sysvars::cache_size > maxdata / 8) + tokudb::sysvars::cache_size = maxdata / 8; } } - if (tokudb_cache_size) { - DBUG_PRINT("info", ("tokudb_cache_size: %lld\n", tokudb_cache_size)); - r = db_env->set_cachesize(db_env, (uint32_t)(tokudb_cache_size >> 30), (uint32_t)(tokudb_cache_size % (1024L * 1024L * 1024L)), 1); + if (tokudb::sysvars::cache_size) { + DBUG_PRINT( + "info", + ("tokudb_cache_size: %lld\n", tokudb::sysvars::cache_size)); + r = db_env->set_cachesize( + db_env, + (uint32_t)(tokudb::sysvars::cache_size >> 30), + (uint32_t)(tokudb::sysvars::cache_size % + (1024L * 1024L * 1024L)), 1); if (r) { DBUG_PRINT("info", ("set_cachesize %d\n", r)); goto error; } } - if (tokudb_max_lock_memory == 0) { - tokudb_max_lock_memory = tokudb_cache_size/8; + if (tokudb::sysvars::max_lock_memory == 0) { + tokudb::sysvars::max_lock_memory = tokudb::sysvars::cache_size/8; } - if (tokudb_max_lock_memory) { - DBUG_PRINT("info", ("tokudb_max_lock_memory: %lld\n", tokudb_max_lock_memory)); - r = db_env->set_lk_max_memory(db_env, tokudb_max_lock_memory); + if (tokudb::sysvars::max_lock_memory) { + DBUG_PRINT( + "info", + ("tokudb_max_lock_memory: %lld\n", + tokudb::sysvars::max_lock_memory)); + r = db_env->set_lk_max_memory( + db_env, + tokudb::sysvars::max_lock_memory); if (r) { DBUG_PRINT("info", ("set_lk_max_memory %d\n", r)); goto error; @@ -471,51 +478,73 @@ static int tokudb_init_func(void *p) { uint32_t gbytes, bytes; int parts; r = db_env->get_cachesize(db_env, &gbytes, &bytes, &parts); - if (tokudb_debug & TOKUDB_DEBUG_INIT) - TOKUDB_TRACE("tokudb_cache_size=%lld r=%d", ((unsigned long long) gbytes << 30) + bytes, r); + TOKUDB_TRACE_FOR_FLAGS( + TOKUDB_DEBUG_INIT, + "tokudb_cache_size=%lld r=%d", + ((unsigned long long) gbytes << 30) + bytes, + r); - r = db_env->set_client_pool_threads(db_env, tokudb_client_pool_threads); + r = db_env->set_client_pool_threads( + db_env, + tokudb::sysvars::client_pool_threads); if (r) { DBUG_PRINT("info", ("set_client_pool_threads %d\n", r)); goto error; } - r = db_env->set_cachetable_pool_threads(db_env, tokudb_cachetable_pool_threads); + r = db_env->set_cachetable_pool_threads( + db_env, + tokudb::sysvars::cachetable_pool_threads); if (r) { DBUG_PRINT("info", ("set_cachetable_pool_threads %d\n", r)); goto error; } - r = db_env->set_checkpoint_pool_threads(db_env, tokudb_checkpoint_pool_threads); + r = db_env->set_checkpoint_pool_threads( + db_env, + tokudb::sysvars::checkpoint_pool_threads); if (r) { DBUG_PRINT("info", ("set_checkpoint_pool_threads %d\n", r)); goto error; } if (db_env->set_redzone) { - r = db_env->set_redzone(db_env, tokudb_fs_reserve_percent); - if (tokudb_debug & TOKUDB_DEBUG_INIT) - TOKUDB_TRACE("set_redzone r=%d", r); + r = db_env->set_redzone(db_env, tokudb::sysvars::fs_reserve_percent); + TOKUDB_TRACE_FOR_FLAGS(TOKUDB_DEBUG_INIT, "set_redzone r=%d", r); } + TOKUDB_TRACE_FOR_FLAGS( + TOKUDB_DEBUG_INIT, + "env open:flags=%x", + tokudb_init_flags); - if (tokudb_debug & TOKUDB_DEBUG_INIT) - TOKUDB_TRACE("env open:flags=%x", tokudb_init_flags); + r = db_env->set_generate_row_callback_for_put(db_env, generate_row_for_put); + assert_always(r == 0); + + r = db_env->set_generate_row_callback_for_del(db_env, generate_row_for_del); + assert_always(r == 0); - r = db_env->set_generate_row_callback_for_put(db_env,generate_row_for_put); - assert(r == 0); - r = db_env->set_generate_row_callback_for_del(db_env,generate_row_for_del); - assert(r == 0); db_env->set_update(db_env, tokudb_update_fun); - db_env_set_direct_io(tokudb_directio == TRUE); - db_env_set_compress_buffers_before_eviction(tokudb_compress_buffers_before_eviction == TRUE); - db_env->change_fsync_log_period(db_env, tokudb_fsync_log_period); + + db_env_set_direct_io(tokudb::sysvars::directio == TRUE); + + db_env_set_compress_buffers_before_eviction( + tokudb::sysvars::compress_buffers_before_eviction == TRUE); + + db_env->change_fsync_log_period(db_env, tokudb::sysvars::fsync_log_period); + db_env->set_lock_timeout_callback(db_env, tokudb_lock_timeout_callback); - db_env->set_loader_memory_size(db_env, tokudb_get_loader_memory_size_callback); - r = db_env->open(db_env, tokudb_home, tokudb_init_flags, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH); + db_env->set_loader_memory_size( + db_env, + tokudb_get_loader_memory_size_callback); - if (tokudb_debug & TOKUDB_DEBUG_INIT) - TOKUDB_TRACE("env opened:return=%d", r); + r = db_env->open( + db_env, + tokudb_home, + tokudb_init_flags, + S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH); + + TOKUDB_TRACE_FOR_FLAGS(TOKUDB_DEBUG_INIT, "env opened:return=%d", r); if (r) { DBUG_PRINT("info", ("env->open %d", r)); @@ -523,72 +552,106 @@ static int tokudb_init_func(void *p) { goto error; } - r = db_env->checkpointing_set_period(db_env, tokudb_checkpointing_period); - assert(r == 0); - r = db_env->cleaner_set_period(db_env, tokudb_cleaner_period); - assert(r == 0); - r = db_env->cleaner_set_iterations(db_env, tokudb_cleaner_iterations); - assert(r == 0); + r = db_env->checkpointing_set_period( + db_env, + tokudb::sysvars::checkpointing_period); + assert_always(r == 0); - r = db_env->set_lock_timeout(db_env, DEFAULT_TOKUDB_LOCK_TIMEOUT, tokudb_get_lock_wait_time_callback); - assert(r == 0); + r = db_env->cleaner_set_period(db_env, tokudb::sysvars::cleaner_period); + assert_always(r == 0); - r = db_env->evictor_set_enable_partial_eviction(db_env, - tokudb_enable_partial_eviction); - assert(r == 0); + r = db_env->cleaner_set_iterations( + db_env, + tokudb::sysvars::cleaner_iterations); + assert_always(r == 0); - db_env->set_killed_callback(db_env, DEFAULT_TOKUDB_KILLED_TIME, tokudb_get_killed_time_callback, tokudb_killed_callback); + r = db_env->set_lock_timeout( + db_env, + DEFAULT_TOKUDB_LOCK_TIMEOUT, + tokudb_get_lock_wait_time_callback); + assert_always(r == 0); - r = db_env->get_engine_status_num_rows (db_env, &toku_global_status_max_rows); - assert(r == 0); + r = db_env->evictor_set_enable_partial_eviction( + db_env, + tokudb::sysvars::enable_partial_eviction); + assert_always(r == 0); + + db_env->set_killed_callback( + db_env, + DEFAULT_TOKUDB_KILLED_TIME, + tokudb_get_killed_time_callback, + tokudb_killed_callback); + + r = db_env->get_engine_status_num_rows( + db_env, + &toku_global_status_max_rows); + assert_always(r == 0); { - const myf mem_flags = MY_FAE|MY_WME|MY_ZEROFILL|MY_ALLOW_ZERO_PTR|MY_FREE_ON_ERROR; - toku_global_status_variables = (SHOW_VAR*)tokudb_my_malloc(sizeof(*toku_global_status_variables)*toku_global_status_max_rows, mem_flags); - toku_global_status_rows = (TOKU_ENGINE_STATUS_ROW_S*)tokudb_my_malloc(sizeof(*toku_global_status_rows)*toku_global_status_max_rows, mem_flags); + const myf mem_flags = + MY_FAE|MY_WME|MY_ZEROFILL|MY_ALLOW_ZERO_PTR|MY_FREE_ON_ERROR; + toku_global_status_variables = + (SHOW_VAR*)tokudb::memory::malloc( + sizeof(*toku_global_status_variables) * + toku_global_status_max_rows, + mem_flags); + toku_global_status_rows = + (TOKU_ENGINE_STATUS_ROW_S*)tokudb::memory::malloc( + sizeof(*toku_global_status_rows)* + toku_global_status_max_rows, + mem_flags); } tokudb_primary_key_bytes_inserted = create_partitioned_counter(); #if TOKU_THDVAR_MEMALLOC_BUG - tokudb_pthread_mutex_init(&tokudb_map_mutex, MY_MUTEX_INIT_FAST); init_tree(&tokudb_map, 0, 0, 0, tokudb_map_pair_cmp, true, NULL, NULL); #endif + if (tokudb::sysvars::strip_frm_data) { + r = tokudb::metadata::strip_frm_data(db_env); + if (r) { + DBUG_PRINT("info", ("env->open %d", r)); + handle_ydb_error(r); + goto error; + } + } + //3938: succeeded, set the init status flag and unlock tokudb_hton_initialized = 1; - rw_unlock(&tokudb_hton_initialized_lock); + tokudb_hton_initialized_lock.unlock(); DBUG_RETURN(false); error: if (db_env) { int rr= db_env->close(db_env, 0); - assert(rr==0); + assert_always(rr==0); db_env = 0; } // 3938: failed to initialized, drop the flag and lock tokudb_hton_initialized = 0; - rw_unlock(&tokudb_hton_initialized_lock); + tokudb_hton_initialized_lock.unlock(); DBUG_RETURN(true); } -static int tokudb_done_func(void *p) { +static int tokudb_done_func(void* p) { TOKUDB_DBUG_ENTER(""); - tokudb_my_free(toku_global_status_variables); + tokudb::memory::free(toku_global_status_variables); toku_global_status_variables = NULL; - tokudb_my_free(toku_global_status_rows); + tokudb::memory::free(toku_global_status_rows); toku_global_status_rows = NULL; - my_hash_free(&tokudb_open_tables); - tokudb_pthread_mutex_destroy(&tokudb_mutex); TOKUDB_DBUG_RETURN(0); } -static handler *tokudb_create_handler(handlerton * hton, TABLE_SHARE * table, MEM_ROOT * mem_root) { +static handler* tokudb_create_handler( + handlerton* hton, + TABLE_SHARE* table, + MEM_ROOT* mem_root) { return new(mem_root) ha_tokudb(hton, table); } -int tokudb_end(handlerton * hton, ha_panic_function type) { +int tokudb_end(handlerton* hton, ha_panic_function type) { TOKUDB_DBUG_ENTER(""); int error = 0; @@ -596,41 +659,59 @@ int tokudb_end(handlerton * hton, ha_panic_function type) { // initialized. grab a writer lock for the duration of the // call, so we can drop the flag and destroy the mutexes // in isolation. - rw_wrlock(&tokudb_hton_initialized_lock); - assert(tokudb_hton_initialized); + tokudb_hton_initialized_lock.lock_write(); + assert_always(tokudb_hton_initialized); + + tokudb::background::destroy(); + TOKUDB_SHARE::static_destroy(); if (db_env) { if (tokudb_init_flags & DB_INIT_LOG) tokudb_cleanup_log_files(); - long total_prepared = 0; // count the total number of prepared txn's that we discard + + // count the total number of prepared txn's that we discard + long total_prepared = 0; #if TOKU_INCLUDE_XA + TOKUDB_TRACE_FOR_FLAGS(TOKUDB_DEBUG_XA, "begin XA cleanup"); while (1) { // get xid's const long n_xid = 1; TOKU_XA_XID xids[n_xid]; long n_prepared = 0; - error = db_env->txn_xa_recover(db_env, xids, n_xid, &n_prepared, total_prepared == 0 ? DB_FIRST : DB_NEXT); - assert(error == 0); + error = db_env->txn_xa_recover( + db_env, + xids, + n_xid, + &n_prepared, + total_prepared == 0 ? DB_FIRST : DB_NEXT); + assert_always(error == 0); if (n_prepared == 0) break; // discard xid's for (long i = 0; i < n_xid; i++) { DB_TXN *txn = NULL; error = db_env->get_txn_from_xid(db_env, &xids[i], &txn); - assert(error == 0); + assert_always(error == 0); error = txn->discard(txn, 0); - assert(error == 0); + assert_always(error == 0); } total_prepared += n_prepared; } + TOKUDB_TRACE_FOR_FLAGS(TOKUDB_DEBUG_XA, "end XA cleanup"); #endif - error = db_env->close(db_env, total_prepared > 0 ? TOKUFT_DIRTY_SHUTDOWN : 0); + error = db_env->close( + db_env, + total_prepared > 0 ? TOKUFT_DIRTY_SHUTDOWN : 0); #if TOKU_INCLUDE_XA if (error != 0 && total_prepared > 0) { - sql_print_error("%s: %ld prepared txns still live, please shutdown, error %d", tokudb_hton_name, total_prepared, error); + sql_print_error( + "%s: %ld prepared txns still live, please shutdown, error %d", + tokudb_hton_name, + total_prepared, + error); } else #endif - assert(error == 0); + assert_always(error == 0); db_env = NULL; } @@ -640,33 +721,34 @@ int tokudb_end(handlerton * hton, ha_panic_function type) { } #if TOKU_THDVAR_MEMALLOC_BUG - tokudb_pthread_mutex_destroy(&tokudb_map_mutex); delete_tree(&tokudb_map); #endif // 3938: drop the initialized flag and unlock tokudb_hton_initialized = 0; - rw_unlock(&tokudb_hton_initialized_lock); + tokudb_hton_initialized_lock.unlock(); TOKUDB_DBUG_RETURN(error); } -static int tokudb_close_connection(handlerton * hton, THD * thd) { +static int tokudb_close_connection(handlerton* hton, THD* thd) { int error = 0; - tokudb_trx_data* trx = (tokudb_trx_data *) thd_get_ha_data(thd, tokudb_hton); + tokudb_trx_data* trx = (tokudb_trx_data*)thd_get_ha_data(thd, tokudb_hton); if (trx && trx->checkpoint_lock_taken) { error = db_env->checkpointing_resume(db_env); } - tokudb_my_free(trx); + tokudb::memory::free(trx); #if TOKU_THDVAR_MEMALLOC_BUG - tokudb_pthread_mutex_lock(&tokudb_map_mutex); + tokudb_map_mutex.lock(); struct tokudb_map_pair key = { thd, NULL }; - struct tokudb_map_pair *found_key = (struct tokudb_map_pair *) tree_search(&tokudb_map, &key, NULL); + struct tokudb_map_pair* found_key = + (struct tokudb_map_pair*) tree_search(&tokudb_map, &key, NULL); + if (found_key) { - tokudb_my_free(found_key->last_lock_timeout); - tree_delete(&tokudb_map, found_key, sizeof *found_key, NULL); + tokudb::memory::free(found_key->last_lock_timeout); + tree_delete(&tokudb_map, found_key, sizeof(*found_key), NULL); } - tokudb_pthread_mutex_unlock(&tokudb_map_mutex); + tokudb_map_mutex.unlock(); #endif return error; } @@ -676,7 +758,7 @@ bool tokudb_flush_logs(handlerton * hton) { int error; bool result = 0; - if (tokudb_checkpoint_on_flush_logs) { + if (tokudb::sysvars::checkpoint_on_flush_logs) { // // take the checkpoint // @@ -689,7 +771,7 @@ bool tokudb_flush_logs(handlerton * hton) { } else { error = db_env->log_flush(db_env, NULL); - assert(error == 0); + assert_always(error == 0); } result = 0; @@ -705,14 +787,14 @@ typedef struct txn_progress_info { static void txn_progress_func(TOKU_TXN_PROGRESS progress, void* extra) { TXN_PROGRESS_INFO progress_info = (TXN_PROGRESS_INFO)extra; - int r = sprintf(progress_info->status, - "%sprocessing %s of transaction, %" PRId64 " out of %" PRId64, - progress->stalled_on_checkpoint ? "Writing committed changes to disk, " : "", - progress->is_commit ? "commit" : "abort", - progress->entries_processed, - progress->entries_total - ); - assert(r >= 0); + int r = sprintf( + progress_info->status, + "%sprocessing %s of transaction, %" PRId64 " out of %" PRId64, + progress->stalled_on_checkpoint ? "Writing committed changes to disk, " : "", + progress->is_commit ? "commit" : "abort", + progress->entries_processed, + progress->entries_total); + assert_always(r >= 0); thd_proc_info(progress_info->thd, progress_info->status); } @@ -722,9 +804,13 @@ static void commit_txn_with_progress(DB_TXN* txn, uint32_t flags, THD* thd) { info.thd = thd; int r = txn->commit_with_progress(txn, flags, txn_progress_func, &info); if (r != 0) { - sql_print_error("%s: tried committing transaction %p and got error code %d", tokudb_hton_name, txn, r); + sql_print_error( + "%s: tried committing transaction %p and got error code %d", + tokudb_hton_name, + txn, + r); } - assert(r == 0); + assert_always(r == 0); thd_proc_info(thd, orig_proc_info); } @@ -734,9 +820,13 @@ static void abort_txn_with_progress(DB_TXN* txn, THD* thd) { info.thd = thd; int r = txn->abort_with_progress(txn, txn_progress_func, &info); if (r != 0) { - sql_print_error("%s: tried aborting transaction %p and got error code %d", tokudb_hton_name, txn, r); + sql_print_error( + "%s: tried aborting transaction %p and got error code %d", + tokudb_hton_name, + txn, + r); } - assert(r == 0); + assert_always(r == 0); thd_proc_info(thd, orig_proc_info); } @@ -750,11 +840,12 @@ static void tokudb_cleanup_handlers(tokudb_trx_data *trx, DB_TXN *txn) { } #if MYSQL_VERSION_ID >= 50600 -extern "C" enum durability_properties thd_get_durability_property(const MYSQL_THD thd); +extern "C" enum durability_properties thd_get_durability_property( + const MYSQL_THD thd); #endif // Determine if an fsync is used when a transaction is committed. -static bool tokudb_sync_on_commit(THD *thd, tokudb_trx_data *trx, DB_TXN *txn) { +static bool tokudb_sync_on_commit(THD* thd, tokudb_trx_data* trx, DB_TXN* txn) { #if MYSQL_VERSION_ID >= 50600 // Check the client durability property which is set during 2PC if (thd_get_durability_property(thd) == HA_IGNORE_DURABILITY) @@ -765,9 +856,9 @@ static bool tokudb_sync_on_commit(THD *thd, tokudb_trx_data *trx, DB_TXN *txn) { if (txn->is_prepared(txn) && mysql_bin_log.is_open()) return false; #endif - if (tokudb_fsync_log_period > 0) + if (tokudb::sysvars::fsync_log_period > 0) return false; - return THDVAR(thd, commit_sync) != 0; + return tokudb::sysvars::commit_sync(thd) != 0; } static int tokudb_commit(handlerton * hton, THD * thd, bool all) { @@ -777,10 +868,14 @@ static int tokudb_commit(handlerton * hton, THD * thd, bool all) { DB_TXN **txn = all ? &trx->all : &trx->stmt; DB_TXN *this_txn = *txn; if (this_txn) { - uint32_t syncflag = tokudb_sync_on_commit(thd, trx, this_txn) ? 0 : DB_TXN_NOSYNC; - if (tokudb_debug & TOKUDB_DEBUG_TXN) { - TOKUDB_TRACE("commit trx %u txn %p syncflag %u", all, this_txn, syncflag); - } + uint32_t syncflag = + tokudb_sync_on_commit(thd, trx, this_txn) ? 0 : DB_TXN_NOSYNC; + TOKUDB_TRACE_FOR_FLAGS( + TOKUDB_DEBUG_TXN, + "commit trx %u txn %p syncflag %u", + all, + this_txn, + syncflag); // test hook to induce a crash on a debug build DBUG_EXECUTE_IF("tokudb_crash_commit_before", DBUG_SUICIDE();); tokudb_cleanup_handlers(trx, this_txn); @@ -792,9 +887,8 @@ static int tokudb_commit(handlerton * hton, THD * thd, bool all) { if (this_txn == trx->sp_level || trx->all == NULL) { trx->sp_level = NULL; } - } - else if (tokudb_debug & TOKUDB_DEBUG_TXN) { - TOKUDB_TRACE("nothing to commit %d", all); + } else { + TOKUDB_TRACE_FOR_FLAGS(TOKUDB_DEBUG_TXN, "nothing to commit %d", all); } reset_stmt_progress(&trx->stmt_progress); TOKUDB_DBUG_RETURN(0); @@ -807,9 +901,11 @@ static int tokudb_rollback(handlerton * hton, THD * thd, bool all) { DB_TXN **txn = all ? &trx->all : &trx->stmt; DB_TXN *this_txn = *txn; if (this_txn) { - if (tokudb_debug & TOKUDB_DEBUG_TXN) { - TOKUDB_TRACE("rollback %u txn %p", all, this_txn); - } + TOKUDB_TRACE_FOR_FLAGS( + TOKUDB_DEBUG_TXN, + "rollback %u txn %p", + all, + this_txn); tokudb_cleanup_handlers(trx, this_txn); abort_txn_with_progress(this_txn, thd); *txn = NULL; @@ -817,11 +913,8 @@ static int tokudb_rollback(handlerton * hton, THD * thd, bool all) { if (this_txn == trx->sp_level || trx->all == NULL) { trx->sp_level = NULL; } - } - else { - if (tokudb_debug & TOKUDB_DEBUG_TXN) { - TOKUDB_TRACE("abort0"); - } + } else { + TOKUDB_TRACE_FOR_FLAGS(TOKUDB_DEBUG_TXN, "abort0"); } reset_stmt_progress(&trx->stmt_progress); TOKUDB_DBUG_RETURN(0); @@ -829,19 +922,25 @@ static int tokudb_rollback(handlerton * hton, THD * thd, bool all) { #if TOKU_INCLUDE_XA static bool tokudb_sync_on_prepare(void) { + TOKUDB_TRACE_FOR_FLAGS(TOKUDB_DEBUG_XA, "enter"); // skip sync of log if fsync log period > 0 - if (tokudb_fsync_log_period > 0) + if (tokudb::sysvars::fsync_log_period > 0) { + TOKUDB_TRACE_FOR_FLAGS(TOKUDB_DEBUG_XA, "exit"); return false; - else + } else { + TOKUDB_TRACE_FOR_FLAGS(TOKUDB_DEBUG_XA, "exit"); return true; + } } static int tokudb_xa_prepare(handlerton* hton, THD* thd, bool all) { TOKUDB_DBUG_ENTER(""); + TOKUDB_TRACE_FOR_FLAGS(TOKUDB_DEBUG_XA, "enter"); int r = 0; // if tokudb_support_xa is disable, just return - if (!THDVAR(thd, support_xa)) { + if (!tokudb::sysvars::support_xa(thd)) { + TOKUDB_TRACE_FOR_FLAGS(TOKUDB_DEBUG_XA, "exit %d", r); TOKUDB_DBUG_RETURN(r); } @@ -850,9 +949,11 @@ static int tokudb_xa_prepare(handlerton* hton, THD* thd, bool all) { DB_TXN* txn = all ? trx->all : trx->stmt; if (txn) { uint32_t syncflag = tokudb_sync_on_prepare() ? 0 : DB_TXN_NOSYNC; - if (tokudb_debug & TOKUDB_DEBUG_TXN) { - TOKUDB_TRACE("doing txn prepare:%d:%p", all, txn); - } + TOKUDB_TRACE_FOR_FLAGS( + TOKUDB_DEBUG_XA, + "doing txn prepare:%d:%p", + all, + txn); // a TOKU_XA_XID is identical to a MYSQL_XID TOKU_XA_XID thd_xid; thd_get_xid(thd, (MYSQL_XID*) &thd_xid); @@ -861,17 +962,19 @@ static int tokudb_xa_prepare(handlerton* hton, THD* thd, bool all) { r = txn->xa_prepare(txn, &thd_xid, syncflag); // test hook to induce a crash on a debug build DBUG_EXECUTE_IF("tokudb_crash_prepare_after", DBUG_SUICIDE();); - } - else if (tokudb_debug & TOKUDB_DEBUG_TXN) { - TOKUDB_TRACE("nothing to prepare %d", all); + } else { + TOKUDB_TRACE_FOR_FLAGS(TOKUDB_DEBUG_XA, "nothing to prepare %d", all); } + TOKUDB_TRACE_FOR_FLAGS(TOKUDB_DEBUG_XA, "exit %d", r); TOKUDB_DBUG_RETURN(r); } static int tokudb_xa_recover(handlerton* hton, XID* xid_list, uint len) { TOKUDB_DBUG_ENTER(""); + TOKUDB_TRACE_FOR_FLAGS(TOKUDB_DEBUG_XA, "enter"); int r = 0; if (len == 0 || xid_list == NULL) { + TOKUDB_TRACE_FOR_FLAGS(TOKUDB_DEBUG_XA, "exit %d", 0); TOKUDB_DBUG_RETURN(0); } long num_returned = 0; @@ -880,14 +983,15 @@ static int tokudb_xa_recover(handlerton* hton, XID* xid_list, uint len) { (TOKU_XA_XID*)xid_list, len, &num_returned, - DB_NEXT - ); - assert(r == 0); + DB_NEXT); + assert_always(r == 0); + TOKUDB_TRACE_FOR_FLAGS(TOKUDB_DEBUG_XA, "exit %ld", num_returned); TOKUDB_DBUG_RETURN((int)num_returned); } static int tokudb_commit_by_xid(handlerton* hton, XID* xid) { TOKUDB_DBUG_ENTER(""); + TOKUDB_TRACE_FOR_FLAGS(TOKUDB_DEBUG_XA, "enter"); int r = 0; DB_TXN* txn = NULL; TOKU_XA_XID* toku_xid = (TOKU_XA_XID*)xid; @@ -900,11 +1004,13 @@ static int tokudb_commit_by_xid(handlerton* hton, XID* xid) { r = 0; cleanup: + TOKUDB_TRACE_FOR_FLAGS(TOKUDB_DEBUG_XA, "exit %d", r); TOKUDB_DBUG_RETURN(r); } static int tokudb_rollback_by_xid(handlerton* hton, XID* xid) { TOKUDB_DBUG_ENTER(""); + TOKUDB_TRACE_FOR_FLAGS(TOKUDB_DEBUG_XA, "enter"); int r = 0; DB_TXN* txn = NULL; TOKU_XA_XID* toku_xid = (TOKU_XA_XID*)xid; @@ -917,6 +1023,7 @@ static int tokudb_rollback_by_xid(handlerton* hton, XID* xid) { r = 0; cleanup: + TOKUDB_TRACE_FOR_FLAGS(TOKUDB_DEBUG_XA, "exit %d", r); TOKUDB_DBUG_RETURN(r); } @@ -928,43 +1035,55 @@ static int tokudb_savepoint(handlerton * hton, THD * thd, void *savepoint) { SP_INFO save_info = (SP_INFO)savepoint; tokudb_trx_data *trx = (tokudb_trx_data *) thd_get_ha_data(thd, hton); if (thd->in_sub_stmt) { - assert(trx->stmt); - error = txn_begin(db_env, trx->sub_sp_level, &(save_info->txn), DB_INHERIT_ISOLATION, thd); + assert_always(trx->stmt); + error = txn_begin( + db_env, + trx->sub_sp_level, + &(save_info->txn), + DB_INHERIT_ISOLATION, + thd); if (error) { goto cleanup; } trx->sub_sp_level = save_info->txn; save_info->in_sub_stmt = true; - } - else { - error = txn_begin(db_env, trx->sp_level, &(save_info->txn), DB_INHERIT_ISOLATION, thd); + } else { + error = txn_begin( + db_env, + trx->sp_level, + &(save_info->txn), + DB_INHERIT_ISOLATION, + thd); if (error) { goto cleanup; } trx->sp_level = save_info->txn; save_info->in_sub_stmt = false; } - if (tokudb_debug & TOKUDB_DEBUG_TXN) { - TOKUDB_TRACE("begin txn %p", save_info->txn); - } + TOKUDB_TRACE_FOR_FLAGS(TOKUDB_DEBUG_TXN, "begin txn %p", save_info->txn); save_info->trx = trx; error = 0; cleanup: TOKUDB_DBUG_RETURN(error); } -static int tokudb_rollback_to_savepoint(handlerton * hton, THD * thd, void *savepoint) { +static int tokudb_rollback_to_savepoint( + handlerton* hton, + THD* thd, + void* savepoint) { + TOKUDB_DBUG_ENTER("%p", savepoint); int error; SP_INFO save_info = (SP_INFO)savepoint; DB_TXN* parent = NULL; DB_TXN* txn_to_rollback = save_info->txn; - tokudb_trx_data *trx = (tokudb_trx_data *) thd_get_ha_data(thd, hton); + tokudb_trx_data* trx = (tokudb_trx_data*)thd_get_ha_data(thd, hton); parent = txn_to_rollback->parent; - if (tokudb_debug & TOKUDB_DEBUG_TXN) { - TOKUDB_TRACE("rollback txn %p", txn_to_rollback); - } + TOKUDB_TRACE_FOR_FLAGS( + TOKUDB_DEBUG_TXN, + "rollback txn %p", + txn_to_rollback); if (!(error = txn_to_rollback->abort(txn_to_rollback))) { if (save_info->in_sub_stmt) { trx->sub_sp_level = parent; @@ -977,7 +1096,11 @@ static int tokudb_rollback_to_savepoint(handlerton * hton, THD * thd, void *save TOKUDB_DBUG_RETURN(error); } -static int tokudb_release_savepoint(handlerton * hton, THD * thd, void *savepoint) { +static int tokudb_release_savepoint( + handlerton* hton, + THD* thd, + void* savepoint) { + TOKUDB_DBUG_ENTER("%p", savepoint); int error = 0; SP_INFO save_info = (SP_INFO)savepoint; @@ -986,9 +1109,7 @@ static int tokudb_release_savepoint(handlerton * hton, THD * thd, void *savepoin tokudb_trx_data *trx = (tokudb_trx_data *) thd_get_ha_data(thd, hton); parent = txn_to_commit->parent; - if (tokudb_debug & TOKUDB_DEBUG_TXN) { - TOKUDB_TRACE("commit txn %p", txn_to_commit); - } + TOKUDB_TRACE_FOR_FLAGS(TOKUDB_DEBUG_TXN, "commit txn %p", txn_to_commit); DB_TXN *child = txn_to_commit->get_child(txn_to_commit); if (child == NULL && !(error = txn_to_commit->commit(txn_to_commit, 0))) { if (save_info->in_sub_stmt) { @@ -1006,8 +1127,14 @@ static int tokudb_release_savepoint(handlerton * hton, THD * thd, void *savepoin static int tokudb_discover_table(handlerton *hton, THD* thd, TABLE_SHARE *ts) { uchar *frmblob = 0; size_t frmlen; - int res= tokudb_discover3(hton, thd, ts->db.str, ts->table_name.str, - ts->normalized_path.str, &frmblob, &frmlen); + int res= tokudb_discover3( + hton, + thd, + ts->db.str, + ts->table_name.str, + ts->normalized_path.str, + &frmblob, + &frmlen); if (!res) res= ts->init_from_binary_frm_image(thd, true, frmblob, frmlen); @@ -1016,7 +1143,11 @@ static int tokudb_discover_table(handlerton *hton, THD* thd, TABLE_SHARE *ts) { return res == ENOENT ? HA_ERR_NO_SUCH_TABLE : res; } -static int tokudb_discover_table_existence(handlerton *hton, const char *db, const char *name) { +static int tokudb_discover_table_existence( + handlerton* hton, + const char* db, + const char* name) { + uchar *frmblob = 0; size_t frmlen; int res= tokudb_discover(hton, current_thd, db, name, &frmblob, &frmlen); @@ -1025,19 +1156,46 @@ static int tokudb_discover_table_existence(handlerton *hton, const char *db, con } #endif -static int tokudb_discover(handlerton *hton, THD* thd, const char *db, const char *name, uchar **frmblob, size_t *frmlen) { +static int tokudb_discover( + handlerton* hton, + THD* thd, + const char* db, + const char* name, + uchar** frmblob, + size_t* frmlen) { + return tokudb_discover2(hton, thd, db, name, true, frmblob, frmlen); } -static int tokudb_discover2(handlerton *hton, THD* thd, const char *db, const char *name, bool translate_name, - uchar **frmblob, size_t *frmlen) { +static int tokudb_discover2( + handlerton* hton, + THD* thd, + const char* db, + const char* name, + bool translate_name, + uchar** frmblob, + size_t*frmlen) { + char path[FN_REFLEN + 1]; - build_table_filename(path, sizeof(path) - 1, db, name, "", translate_name ? 0 : FN_IS_TMP); + build_table_filename( + path, + sizeof(path) - 1, + db, + name, + "", + translate_name ? 0 : FN_IS_TMP); return tokudb_discover3(hton, thd, db, name, path, frmblob, frmlen); } -static int tokudb_discover3(handlerton *hton, THD* thd, const char *db, const char *name, char *path, - uchar **frmblob, size_t *frmlen) { +static int tokudb_discover3( + handlerton* hton, + THD* thd, + const char* db, + const char* name, + char* path, + uchar** frmblob, + size_t* frmlen) { + TOKUDB_DBUG_ENTER("%s %s %s", db, name, path); int error; DB* status_db = NULL; @@ -1048,8 +1206,10 @@ static int tokudb_discover3(handlerton *hton, THD* thd, const char *db, const ch bool do_commit = false; #if 100000 <= MYSQL_VERSION_ID - tokudb_trx_data *trx = (tokudb_trx_data *) thd_get_ha_data(thd, tokudb_hton); - if (thd_sql_command(thd) == SQLCOM_CREATE_TABLE && trx && trx->sub_sp_level) { + tokudb_trx_data* trx = (tokudb_trx_data*)thd_get_ha_data(thd, tokudb_hton); + if (thd_sql_command(thd) == SQLCOM_CREATE_TABLE && + trx && + trx->sub_sp_level) { do_commit = false; txn = trx->sub_sp_level; } else { @@ -1075,8 +1235,7 @@ static int tokudb_discover3(handlerton *hton, THD* thd, const char *db, const ch 0, &key, smart_dbt_callback_verify_frm, - &value - ); + &value); if (error) { goto cleanup; } @@ -1092,19 +1251,23 @@ cleanup: if (do_commit && txn) { commit_txn(txn, 0); } - TOKUDB_DBUG_RETURN(error); + TOKUDB_DBUG_RETURN(error); } -#define STATPRINT(legend, val) if (legend != NULL && val != NULL) stat_print(thd, \ - tokudb_hton_name, \ - strlen(tokudb_hton_name), \ - legend, \ - strlen(legend), \ - val, \ - strlen(val)) +#define STATPRINT(legend, val) if (legend != NULL && val != NULL) \ + stat_print(thd, \ + tokudb_hton_name, \ + strlen(tokudb_hton_name), \ + legend, \ + strlen(legend), \ + val, \ + strlen(val)) -extern sys_var *intern_find_sys_var(const char *str, uint length, bool no_error); +extern sys_var* intern_find_sys_var( + const char* str, + uint length, + bool no_error); static bool tokudb_show_engine_status(THD * thd, stat_print_fn * stat_print) { TOKUDB_DBUG_ENTER(""); @@ -1120,14 +1283,29 @@ static bool tokudb_show_engine_status(THD * thd, stat_print_fn * stat_print) { #if MYSQL_VERSION_ID < 50500 { - sys_var * version = intern_find_sys_var("version", 0, false); - snprintf(buf, bufsiz, "%s", version->value_ptr(thd, (enum_var_type)0, (LEX_STRING*)NULL)); + sys_var* version = intern_find_sys_var("version", 0, false); + snprintf( + buf, + bufsiz, + "%s", + version->value_ptr(thd, + (enum_var_type)0, + (LEX_STRING*)NULL)); STATPRINT("Version", buf); } #endif error = db_env->get_engine_status_num_rows (db_env, &max_rows); TOKU_ENGINE_STATUS_ROW_S mystat[max_rows]; - error = db_env->get_engine_status (db_env, mystat, max_rows, &num_rows, &redzone_state, &panic, panic_string, panic_string_len, TOKU_ENGINE_STATUS); + error = db_env->get_engine_status( + db_env, + mystat, + max_rows, + &num_rows, + &redzone_state, + &panic, + panic_string, + panic_string_len, + TOKU_ENGINE_STATUS); if (strlen(panic_string)) { STATPRINT("Environment panic string", panic_string); @@ -1139,20 +1317,35 @@ static bool tokudb_show_engine_status(THD * thd, stat_print_fn * stat_print) { } if(redzone_state == FS_BLOCKED) { - STATPRINT("*** URGENT WARNING ***", "FILE SYSTEM IS COMPLETELY FULL"); + STATPRINT( + "*** URGENT WARNING ***", "FILE SYSTEM IS COMPLETELY FULL"); snprintf(buf, bufsiz, "FILE SYSTEM IS COMPLETELY FULL"); - } - else if (redzone_state == FS_GREEN) { - snprintf(buf, bufsiz, "more than %d percent of total file system space", 2*tokudb_fs_reserve_percent); - } - else if (redzone_state == FS_YELLOW) { - snprintf(buf, bufsiz, "*** WARNING *** FILE SYSTEM IS GETTING FULL (less than %d percent free)", 2*tokudb_fs_reserve_percent); - } - else if (redzone_state == FS_RED){ - snprintf(buf, bufsiz, "*** WARNING *** FILE SYSTEM IS GETTING VERY FULL (less than %d percent free): INSERTS ARE PROHIBITED", tokudb_fs_reserve_percent); - } - else { - snprintf(buf, bufsiz, "information unavailable, unknown redzone state %d", redzone_state); + } else if (redzone_state == FS_GREEN) { + snprintf( + buf, + bufsiz, + "more than %d percent of total file system space", + 2 * tokudb::sysvars::fs_reserve_percent); + } else if (redzone_state == FS_YELLOW) { + snprintf( + buf, + bufsiz, + "*** WARNING *** FILE SYSTEM IS GETTING FULL (less than %d " + "percent free)", + 2 * tokudb::sysvars::fs_reserve_percent); + } else if (redzone_state == FS_RED){ + snprintf( + buf, + bufsiz, + "*** WARNING *** FILE SYSTEM IS GETTING VERY FULL (less than " + "%d percent free): INSERTS ARE PROHIBITED", + tokudb::sysvars::fs_reserve_percent); + } else { + snprintf( + buf, + bufsiz, + "information unavailable, unknown redzone state %d", + redzone_state); } STATPRINT ("disk free space", buf); @@ -1179,7 +1372,8 @@ static bool tokudb_show_engine_status(THD * thd, stat_print_fn * stat_print) { break; } case PARCOUNT: { - uint64_t v = read_partitioned_counter(mystat[row].value.parcount); + uint64_t v = read_partitioned_counter( + mystat[row].value.parcount); snprintf(buf, bufsiz, "%" PRIu64, v); break; } @@ -1187,12 +1381,17 @@ static bool tokudb_show_engine_status(THD * thd, stat_print_fn * stat_print) { snprintf(buf, bufsiz, "%.6f", mystat[row].value.dnum); break; default: - snprintf(buf, bufsiz, "UNKNOWN STATUS TYPE: %d", mystat[row].type); - break; + snprintf( + buf, + bufsiz, + "UNKNOWN STATUS TYPE: %d", + mystat[row].type); + break; } STATPRINT(mystat[row].legend, buf); } - uint64_t bytes_inserted = read_partitioned_counter(tokudb_primary_key_bytes_inserted); + uint64_t bytes_inserted = read_partitioned_counter( + tokudb_primary_key_bytes_inserted); snprintf(buf, bufsiz, "%" PRIu64, bytes_inserted); STATPRINT("handlerton: primary key bytes inserted", buf); } @@ -1200,16 +1399,16 @@ static bool tokudb_show_engine_status(THD * thd, stat_print_fn * stat_print) { TOKUDB_DBUG_RETURN(error); } -static void tokudb_checkpoint_lock(THD * thd) { +void tokudb_checkpoint_lock(THD * thd) { int error; const char *old_proc_info; - tokudb_trx_data* trx = (tokudb_trx_data *) thd_get_ha_data(thd, tokudb_hton); + tokudb_trx_data* trx = (tokudb_trx_data*)thd_get_ha_data(thd, tokudb_hton); if (!trx) { error = create_tokudb_trx_data_instance(&trx); // // can only fail due to memory allocation, so ok to assert // - assert(!error); + assert_always(!error); thd_set_ha_data(thd, tokudb_hton, trx); } @@ -1223,7 +1422,7 @@ static void tokudb_checkpoint_lock(THD * thd) { old_proc_info = tokudb_thd_get_proc_info(thd); thd_proc_info(thd, "Trying to grab checkpointing lock."); error = db_env->checkpointing_postpone(db_env); - assert(!error); + assert_always(!error); thd_proc_info(thd, old_proc_info); trx->checkpoint_lock_taken = true; @@ -1231,10 +1430,10 @@ cleanup: return; } -static void tokudb_checkpoint_unlock(THD * thd) { +void tokudb_checkpoint_unlock(THD * thd) { int error; const char *old_proc_info; - tokudb_trx_data* trx = (tokudb_trx_data *) thd_get_ha_data(thd, tokudb_hton); + tokudb_trx_data* trx = (tokudb_trx_data*)thd_get_ha_data(thd, tokudb_hton); if (!trx) { error = 0; goto cleanup; @@ -1249,7 +1448,7 @@ static void tokudb_checkpoint_unlock(THD * thd) { old_proc_info = tokudb_thd_get_proc_info(thd); thd_proc_info(thd, "Trying to release checkpointing lock."); error = db_env->checkpointing_resume(db_env); - assert(!error); + assert_always(!error); thd_proc_info(thd, old_proc_info); trx->checkpoint_lock_taken = false; @@ -1258,7 +1457,12 @@ cleanup: return; } -static bool tokudb_show_status(handlerton * hton, THD * thd, stat_print_fn * stat_print, enum ha_stat_type stat_type) { +static bool tokudb_show_status( + handlerton* hton, + THD* thd, + stat_print_fn* stat_print, + enum ha_stat_type stat_type) { + switch (stat_type) { case HA_ENGINE_STATUS: return tokudb_show_engine_status(thd, stat_print); @@ -1270,14 +1474,21 @@ static bool tokudb_show_status(handlerton * hton, THD * thd, stat_print_fn * sta } #if TOKU_INCLUDE_HANDLERTON_HANDLE_FATAL_SIGNAL -static void tokudb_handle_fatal_signal(handlerton *hton __attribute__ ((__unused__)), THD *thd __attribute__ ((__unused__)), int sig) { +static void tokudb_handle_fatal_signal( + TOKUDB_UNUSED(handlerton* hton), + TOKUDB_UNUSD(THD* thd), + int sig) { + if (tokudb_gdb_on_fatal) { db_env_try_gdb_stack_trace(tokudb_gdb_path); } } #endif -static void tokudb_print_error(const DB_ENV * db_env, const char *db_errpfx, const char *buffer) { +static void tokudb_print_error( + const DB_ENV* db_env, + const char* db_errpfx, + const char* buffer) { sql_print_error("%s: %s", db_errpfx, buffer); } @@ -1299,7 +1510,7 @@ static void tokudb_cleanup_log_files(void) { char **np; for (np = names; *np; ++np) { #if 1 - if (tokudb_debug) + if (TOKUDB_UNLIKELY(tokudb::sysvars::debug)) TOKUDB_TRACE("cleanup:%s", *np); #else my_delete(*np, MYF(MY_WME)); @@ -1312,246 +1523,13 @@ static void tokudb_cleanup_log_files(void) { DBUG_VOID_RETURN; } -// options flags -// PLUGIN_VAR_THDLOCAL Variable is per-connection -// PLUGIN_VAR_READONLY Server variable is read only -// PLUGIN_VAR_NOSYSVAR Not a server variable -// PLUGIN_VAR_NOCMDOPT Not a command line option -// PLUGIN_VAR_NOCMDARG No argument for cmd line -// PLUGIN_VAR_RQCMDARG Argument required for cmd line -// PLUGIN_VAR_OPCMDARG Argument optional for cmd line -// PLUGIN_VAR_MEMALLOC String needs memory allocated - - -// system variables -static void tokudb_cleaner_period_update(THD* thd, - struct st_mysql_sys_var* sys_var, - void* var, const void * save) { - ulong * cleaner_period = (ulong *) var; - *cleaner_period = *(const ulonglong *) save; - int r = db_env->cleaner_set_period(db_env, *cleaner_period); - assert(r == 0); -} - -#define DEFAULT_CLEANER_PERIOD 1 - -static MYSQL_SYSVAR_ULONG(cleaner_period, tokudb_cleaner_period, - 0, "TokuDB cleaner_period", - NULL, tokudb_cleaner_period_update, DEFAULT_CLEANER_PERIOD, - 0, ~0UL, 0); - -static void tokudb_cleaner_iterations_update(THD* thd, - struct st_mysql_sys_var* sys_var, - void* var, const void* save) { - ulong * cleaner_iterations = (ulong *) var; - *cleaner_iterations = *(const ulonglong *) save; - int r = db_env->cleaner_set_iterations(db_env, *cleaner_iterations); - assert(r == 0); -} - -#define DEFAULT_CLEANER_ITERATIONS 5 - -static MYSQL_SYSVAR_ULONG(cleaner_iterations, tokudb_cleaner_iterations, - 0, "TokuDB cleaner_iterations", - NULL, tokudb_cleaner_iterations_update, DEFAULT_CLEANER_ITERATIONS, - 0, ~0UL, 0); - -static void tokudb_checkpointing_period_update(THD* thd, - struct st_mysql_sys_var* sys_var, - void* var, const void* save) { - uint * checkpointing_period = (uint *) var; - *checkpointing_period = *(const ulonglong *) save; - int r = db_env->checkpointing_set_period(db_env, *checkpointing_period); - assert(r == 0); -} - -static MYSQL_SYSVAR_UINT(checkpointing_period, tokudb_checkpointing_period, - 0, "TokuDB Checkpointing period", - NULL, tokudb_checkpointing_period_update, 60, - 0, ~0U, 0); - -static MYSQL_SYSVAR_BOOL(directio, tokudb_directio, - PLUGIN_VAR_READONLY, "TokuDB Enable Direct I/O ", - NULL, NULL, FALSE); - -static MYSQL_SYSVAR_BOOL(compress_buffers_before_eviction, - tokudb_compress_buffers_before_eviction, - PLUGIN_VAR_READONLY, - "TokuDB Enable buffer compression before partial eviction", - NULL, NULL, TRUE); - -static MYSQL_SYSVAR_BOOL(checkpoint_on_flush_logs, tokudb_checkpoint_on_flush_logs, - 0, "TokuDB Checkpoint on Flush Logs ", - NULL, NULL, FALSE); - -static MYSQL_SYSVAR_ULONGLONG(cache_size, tokudb_cache_size, - PLUGIN_VAR_READONLY, "TokuDB cache table size", - NULL, NULL, 0, - 0, ~0ULL, 0); - -static MYSQL_SYSVAR_ULONGLONG(max_lock_memory, tokudb_max_lock_memory, - PLUGIN_VAR_READONLY, "TokuDB max memory for locks", - NULL, NULL, 0, - 0, ~0ULL, 0); - -static MYSQL_SYSVAR_UINT(client_pool_threads, tokudb_client_pool_threads, - PLUGIN_VAR_READONLY, "TokuDB client ops thread pool size", NULL, NULL, 0, - 0, 1024, 0); - -static MYSQL_SYSVAR_UINT(cachetable_pool_threads, tokudb_cachetable_pool_threads, - PLUGIN_VAR_READONLY, "TokuDB cachetable ops thread pool size", NULL, NULL, 0, - 0, 1024, 0); - -static MYSQL_SYSVAR_UINT(checkpoint_pool_threads, tokudb_checkpoint_pool_threads, - PLUGIN_VAR_READONLY, "TokuDB checkpoint ops thread pool size", NULL, NULL, 0, - 0, 1024, 0); - -static void tokudb_enable_partial_eviction_update(THD* thd, - struct st_mysql_sys_var* sys_var, - void* var, const void* save) { - my_bool * enable_partial_eviction = (my_bool *) var; - *enable_partial_eviction = *(const my_bool *) save; - int r = db_env->evictor_set_enable_partial_eviction(db_env, *enable_partial_eviction); - assert(r == 0); -} - -static MYSQL_SYSVAR_BOOL(enable_partial_eviction, tokudb_enable_partial_eviction, - 0, "TokuDB enable partial node eviction", - NULL, tokudb_enable_partial_eviction_update, TRUE); - -static MYSQL_SYSVAR_ULONG(debug, tokudb_debug, - 0, "TokuDB Debug", - NULL, NULL, 0, - 0, ~0UL, 0); - -static MYSQL_SYSVAR_STR(log_dir, tokudb_log_dir, - PLUGIN_VAR_READONLY, "TokuDB Log Directory", - NULL, NULL, NULL); - -static MYSQL_SYSVAR_STR(data_dir, tokudb_data_dir, - PLUGIN_VAR_READONLY, "TokuDB Data Directory", - NULL, NULL, NULL); - -static MYSQL_SYSVAR_STR(version, tokudb_version, - PLUGIN_VAR_READONLY, "TokuDB Version", - NULL, NULL, NULL); - -static MYSQL_SYSVAR_UINT(write_status_frequency, tokudb_write_status_frequency, - 0, "TokuDB frequency that show processlist updates status of writes", - NULL, NULL, 1000, - 0, ~0U, 0); - -static MYSQL_SYSVAR_UINT(read_status_frequency, tokudb_read_status_frequency, - 0, "TokuDB frequency that show processlist updates status of reads", - NULL, NULL, 10000, - 0, ~0U, 0); - -static MYSQL_SYSVAR_INT(fs_reserve_percent, tokudb_fs_reserve_percent, - PLUGIN_VAR_READONLY, "TokuDB file system space reserve (percent free required)", - NULL, NULL, 5, - 0, 100, 0); - -static MYSQL_SYSVAR_STR(tmp_dir, tokudb_tmp_dir, - PLUGIN_VAR_READONLY, "Tokudb Tmp Dir", - NULL, NULL, NULL); - -#if TOKU_INCLUDE_HANDLERTON_HANDLE_FATAL_SIGNAL -static MYSQL_SYSVAR_STR(gdb_path, tokudb_gdb_path, - PLUGIN_VAR_READONLY|PLUGIN_VAR_RQCMDARG, "TokuDB path to gdb for extra debug info on fatal signal", - NULL, NULL, "/usr/bin/gdb"); - -static MYSQL_SYSVAR_BOOL(gdb_on_fatal, tokudb_gdb_on_fatal, - 0, "TokuDB enable gdb debug info on fatal signal", - NULL, NULL, true); -#endif - -static void tokudb_fsync_log_period_update(THD* thd, - struct st_mysql_sys_var* sys_var, - void* var, const void* save) { - uint32 *period = (uint32 *) var; - *period = *(const ulonglong *) save; - db_env->change_fsync_log_period(db_env, *period); -} - -static MYSQL_SYSVAR_UINT(fsync_log_period, tokudb_fsync_log_period, - 0, "TokuDB fsync log period", - NULL, tokudb_fsync_log_period_update, 0, - 0, ~0U, 0); - -static struct st_mysql_sys_var *tokudb_system_variables[] = { - MYSQL_SYSVAR(cache_size), - MYSQL_SYSVAR(client_pool_threads), - MYSQL_SYSVAR(cachetable_pool_threads), - MYSQL_SYSVAR(checkpoint_pool_threads), - MYSQL_SYSVAR(max_lock_memory), - MYSQL_SYSVAR(enable_partial_eviction), - MYSQL_SYSVAR(data_dir), - MYSQL_SYSVAR(log_dir), - MYSQL_SYSVAR(debug), - MYSQL_SYSVAR(commit_sync), - MYSQL_SYSVAR(lock_timeout), - MYSQL_SYSVAR(cleaner_period), - MYSQL_SYSVAR(cleaner_iterations), - MYSQL_SYSVAR(pk_insert_mode), - MYSQL_SYSVAR(load_save_space), - MYSQL_SYSVAR(disable_slow_alter), - MYSQL_SYSVAR(disable_hot_alter), - MYSQL_SYSVAR(alter_print_error), - MYSQL_SYSVAR(create_index_online), - MYSQL_SYSVAR(disable_prefetching), - MYSQL_SYSVAR(version), - MYSQL_SYSVAR(checkpointing_period), - MYSQL_SYSVAR(prelock_empty), - MYSQL_SYSVAR(checkpoint_lock), - MYSQL_SYSVAR(write_status_frequency), - MYSQL_SYSVAR(read_status_frequency), - MYSQL_SYSVAR(fs_reserve_percent), - MYSQL_SYSVAR(tmp_dir), - MYSQL_SYSVAR(block_size), - MYSQL_SYSVAR(read_block_size), - MYSQL_SYSVAR(read_buf_size), - MYSQL_SYSVAR(fanout), - MYSQL_SYSVAR(row_format), - MYSQL_SYSVAR(directio), - MYSQL_SYSVAR(compress_buffers_before_eviction), - MYSQL_SYSVAR(checkpoint_on_flush_logs), -#if TOKU_INCLUDE_UPSERT - MYSQL_SYSVAR(disable_slow_update), - MYSQL_SYSVAR(disable_slow_upsert), -#endif - MYSQL_SYSVAR(analyze_time), - MYSQL_SYSVAR(analyze_delete_fraction), - MYSQL_SYSVAR(fsync_log_period), -#if TOKU_INCLUDE_HANDLERTON_HANDLE_FATAL_SIGNAL - MYSQL_SYSVAR(gdb_path), - MYSQL_SYSVAR(gdb_on_fatal), -#endif - MYSQL_SYSVAR(last_lock_timeout), - MYSQL_SYSVAR(lock_timeout_debug), - MYSQL_SYSVAR(loader_memory_size), - MYSQL_SYSVAR(hide_default_row_format), - MYSQL_SYSVAR(killed_time), - MYSQL_SYSVAR(empty_scan), -#if TOKUDB_CHECK_JEMALLOC - MYSQL_SYSVAR(check_jemalloc), -#endif - MYSQL_SYSVAR(bulk_fetch), -#if TOKU_INCLUDE_XA - MYSQL_SYSVAR(support_xa), -#endif - MYSQL_SYSVAR(rpl_unique_checks), - MYSQL_SYSVAR(rpl_unique_checks_delay), - MYSQL_SYSVAR(rpl_lookup_rows), - MYSQL_SYSVAR(rpl_lookup_rows_delay), - MYSQL_SYSVAR(rpl_check_readonly), - MYSQL_SYSVAR(optimize_index_name), - MYSQL_SYSVAR(optimize_index_fraction), - MYSQL_SYSVAR(optimize_throttle), - NULL -}; - // Split ./database/table-dictionary into database, table and dictionary strings -static void tokudb_split_dname(const char *dname, String &database_name, String &table_name, String &dictionary_name) { +void tokudb_split_dname( + const char* dname, + String& database_name, + String& table_name, + String& dictionary_name) { + const char *splitter = strchr(dname, '/'); if (splitter) { const char *database_ptr = splitter+1; @@ -1564,482 +1542,18 @@ static void tokudb_split_dname(const char *dname, String &database_name, String table_name.append(table_ptr, dictionary_ptr - table_ptr); dictionary_ptr += 1; dictionary_name.append(dictionary_ptr); + } else { + table_name.append(table_ptr); } - } - } -} - -struct st_mysql_storage_engine tokudb_storage_engine = { MYSQL_HANDLERTON_INTERFACE_VERSION }; - -static struct st_mysql_information_schema tokudb_file_map_information_schema = { MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION }; - -static ST_FIELD_INFO tokudb_file_map_field_info[] = { - {"dictionary_name", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, - {"internal_file_name", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, - {"table_schema", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, - {"table_name", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, - {"table_dictionary_name", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, - {NULL, 0, MYSQL_TYPE_NULL, 0, 0, NULL, SKIP_OPEN_TABLE} -}; - -static int tokudb_file_map(TABLE *table, THD *thd) { - int error; - DB_TXN* txn = NULL; - DBC* tmp_cursor = NULL; - DBT curr_key; - DBT curr_val; - memset(&curr_key, 0, sizeof curr_key); - memset(&curr_val, 0, sizeof curr_val); - error = txn_begin(db_env, 0, &txn, DB_READ_UNCOMMITTED, thd); - if (error) { - goto cleanup; - } - error = db_env->get_cursor_for_directory(db_env, txn, &tmp_cursor); - if (error) { - goto cleanup; - } - while (error == 0) { - error = tmp_cursor->c_get(tmp_cursor, &curr_key, &curr_val, DB_NEXT); - if (!error) { - // We store the NULL terminator in the directory so it's included in the size. - // See #5789 - // Recalculate and check just to be safe. - const char *dname = (const char *) curr_key.data; - size_t dname_len = strlen(dname); - assert(dname_len == curr_key.size - 1); - table->field[0]->store(dname, dname_len, system_charset_info); - - const char *iname = (const char *) curr_val.data; - size_t iname_len = strlen(iname); - assert(iname_len == curr_val.size - 1); - table->field[1]->store(iname, iname_len, system_charset_info); - - // split the dname - String database_name, table_name, dictionary_name; - tokudb_split_dname(dname, database_name, table_name, dictionary_name); - table->field[2]->store(database_name.c_ptr(), database_name.length(), system_charset_info); - table->field[3]->store(table_name.c_ptr(), table_name.length(), system_charset_info); - table->field[4]->store(dictionary_name.c_ptr(), dictionary_name.length(), system_charset_info); - - error = schema_table_store_record(thd, table); - } - if (!error && thd_killed(thd)) - error = ER_QUERY_INTERRUPTED; - } - if (error == DB_NOTFOUND) { - error = 0; - } -cleanup: - if (tmp_cursor) { - int r = tmp_cursor->c_close(tmp_cursor); - assert(r == 0); - } - if (txn) { - commit_txn(txn, 0); - } - return error; -} - -#if MYSQL_VERSION_ID >= 50600 -static int tokudb_file_map_fill_table(THD *thd, TABLE_LIST *tables, Item *cond) { -#else -static int tokudb_file_map_fill_table(THD *thd, TABLE_LIST *tables, COND *cond) { -#endif - TOKUDB_DBUG_ENTER(""); - int error; - TABLE *table = tables->table; - - rw_rdlock(&tokudb_hton_initialized_lock); - - if (!tokudb_hton_initialized) { - error = ER_PLUGIN_IS_NOT_LOADED; - my_error(error, MYF(0), tokudb_hton_name); - } else { - error = tokudb_file_map(table, thd); - if (error) - my_error(ER_GET_ERRNO, MYF(0), error, tokudb_hton_name); - } - - rw_unlock(&tokudb_hton_initialized_lock); - TOKUDB_DBUG_RETURN(error); -} - -static int tokudb_file_map_init(void *p) { - ST_SCHEMA_TABLE *schema = (ST_SCHEMA_TABLE *) p; - schema->fields_info = tokudb_file_map_field_info; - schema->fill_table = tokudb_file_map_fill_table; - return 0; -} - -static int tokudb_file_map_done(void *p) { - return 0; -} - -static struct st_mysql_information_schema tokudb_fractal_tree_info_information_schema = { MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION }; - -static ST_FIELD_INFO tokudb_fractal_tree_info_field_info[] = { - {"dictionary_name", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, - {"internal_file_name", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, - {"bt_num_blocks_allocated", 0, MYSQL_TYPE_LONGLONG, 0, 0, NULL, SKIP_OPEN_TABLE }, - {"bt_num_blocks_in_use", 0, MYSQL_TYPE_LONGLONG, 0, 0, NULL, SKIP_OPEN_TABLE }, - {"bt_size_allocated", 0, MYSQL_TYPE_LONGLONG, 0, 0, NULL, SKIP_OPEN_TABLE }, - {"bt_size_in_use", 0, MYSQL_TYPE_LONGLONG, 0, 0, NULL, SKIP_OPEN_TABLE }, - {"table_schema", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, - {"table_name", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, - {"table_dictionary_name", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, - {NULL, 0, MYSQL_TYPE_NULL, 0, 0, NULL, SKIP_OPEN_TABLE} -}; - -static int tokudb_report_fractal_tree_info_for_db(const DBT *dname, const DBT *iname, TABLE *table, THD *thd) { - int error; - uint64_t bt_num_blocks_allocated; - uint64_t bt_num_blocks_in_use; - uint64_t bt_size_allocated; - uint64_t bt_size_in_use; - - DB *db = NULL; - error = db_create(&db, db_env, 0); - if (error) { - goto exit; - } - error = db->open(db, NULL, (char *)dname->data, NULL, DB_BTREE, 0, 0666); - if (error) { - goto exit; - } - error = db->get_fractal_tree_info64(db, - &bt_num_blocks_allocated, &bt_num_blocks_in_use, - &bt_size_allocated, &bt_size_in_use); - if (error) { - goto exit; - } - - // We store the NULL terminator in the directory so it's included in the size. - // See #5789 - // Recalculate and check just to be safe. - { - size_t dname_len = strlen((const char *)dname->data); - assert(dname_len == dname->size - 1); - table->field[0]->store((char *)dname->data, dname_len, system_charset_info); - size_t iname_len = strlen((const char *)iname->data); - assert(iname_len == iname->size - 1); - table->field[1]->store((char *)iname->data, iname_len, system_charset_info); - } - table->field[2]->store(bt_num_blocks_allocated, false); - table->field[3]->store(bt_num_blocks_in_use, false); - table->field[4]->store(bt_size_allocated, false); - table->field[5]->store(bt_size_in_use, false); - - // split the dname - { - String database_name, table_name, dictionary_name; - tokudb_split_dname((const char *)dname->data, database_name, table_name, dictionary_name); - table->field[6]->store(database_name.c_ptr(), database_name.length(), system_charset_info); - table->field[7]->store(table_name.c_ptr(), table_name.length(), system_charset_info); - table->field[8]->store(dictionary_name.c_ptr(), dictionary_name.length(), system_charset_info); - } - error = schema_table_store_record(thd, table); - -exit: - if (db) { - int close_error = db->close(db, 0); - if (error == 0) - error = close_error; - } - return error; -} - -static int tokudb_fractal_tree_info(TABLE *table, THD *thd) { - int error; - DB_TXN* txn = NULL; - DBC* tmp_cursor = NULL; - DBT curr_key; - DBT curr_val; - memset(&curr_key, 0, sizeof curr_key); - memset(&curr_val, 0, sizeof curr_val); - error = txn_begin(db_env, 0, &txn, DB_READ_UNCOMMITTED, thd); - if (error) { - goto cleanup; - } - error = db_env->get_cursor_for_directory(db_env, txn, &tmp_cursor); - if (error) { - goto cleanup; - } - while (error == 0) { - error = tmp_cursor->c_get(tmp_cursor, &curr_key, &curr_val, DB_NEXT); - if (!error) { - error = tokudb_report_fractal_tree_info_for_db(&curr_key, &curr_val, table, thd); - if (error) - error = 0; // ignore read uncommitted errors - } - if (!error && thd_killed(thd)) - error = ER_QUERY_INTERRUPTED; - } - if (error == DB_NOTFOUND) { - error = 0; - } -cleanup: - if (tmp_cursor) { - int r = tmp_cursor->c_close(tmp_cursor); - assert(r == 0); - } - if (txn) { - commit_txn(txn, 0); - } - return error; -} - -#if MYSQL_VERSION_ID >= 50600 -static int tokudb_fractal_tree_info_fill_table(THD *thd, TABLE_LIST *tables, Item *cond) { -#else -static int tokudb_fractal_tree_info_fill_table(THD *thd, TABLE_LIST *tables, COND *cond) { -#endif - TOKUDB_DBUG_ENTER(""); - int error; - TABLE *table = tables->table; - - // 3938: Get a read lock on the status flag, since we must - // read it before safely proceeding - rw_rdlock(&tokudb_hton_initialized_lock); - - if (!tokudb_hton_initialized) { - error = ER_PLUGIN_IS_NOT_LOADED; - my_error(error, MYF(0), tokudb_hton_name); - } else { - error = tokudb_fractal_tree_info(table, thd); - if (error) - my_error(ER_GET_ERRNO, MYF(0), error, tokudb_hton_name); - } - - //3938: unlock the status flag lock - rw_unlock(&tokudb_hton_initialized_lock); - TOKUDB_DBUG_RETURN(error); -} - -static int tokudb_fractal_tree_info_init(void *p) { - ST_SCHEMA_TABLE *schema = (ST_SCHEMA_TABLE *) p; - schema->fields_info = tokudb_fractal_tree_info_field_info; - schema->fill_table = tokudb_fractal_tree_info_fill_table; - return 0; -} - -static int tokudb_fractal_tree_info_done(void *p) { - return 0; -} - -static struct st_mysql_information_schema tokudb_fractal_tree_block_map_information_schema = { MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION }; - -static ST_FIELD_INFO tokudb_fractal_tree_block_map_field_info[] = { - {"dictionary_name", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, - {"internal_file_name", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, - {"checkpoint_count", 0, MYSQL_TYPE_LONGLONG, 0, 0, NULL, SKIP_OPEN_TABLE }, - {"blocknum", 0, MYSQL_TYPE_LONGLONG, 0, 0, NULL, SKIP_OPEN_TABLE }, - {"offset", 0, MYSQL_TYPE_LONGLONG, 0, MY_I_S_MAYBE_NULL, NULL, SKIP_OPEN_TABLE }, - {"size", 0, MYSQL_TYPE_LONGLONG, 0, MY_I_S_MAYBE_NULL, NULL, SKIP_OPEN_TABLE }, - {"table_schema", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, - {"table_name", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, - {"table_dictionary_name", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, - {NULL, 0, MYSQL_TYPE_NULL, 0, 0, NULL, SKIP_OPEN_TABLE} -}; - -struct tokudb_report_fractal_tree_block_map_iterator_extra { - int64_t num_rows; - int64_t i; - uint64_t *checkpoint_counts; - int64_t *blocknums; - int64_t *diskoffs; - int64_t *sizes; -}; - -// This iterator is called while holding the blocktable lock. We should be as quick as possible. -// We don't want to do one call to get the number of rows, release the blocktable lock, and then do another call to get all the rows because the number of rows may change if we don't hold the lock. -// As a compromise, we'll do some mallocs inside the lock on the first call, but everything else should be fast. -static int tokudb_report_fractal_tree_block_map_iterator(uint64_t checkpoint_count, - int64_t num_rows, - int64_t blocknum, - int64_t diskoff, - int64_t size, - void *iter_extra) { - struct tokudb_report_fractal_tree_block_map_iterator_extra *e = static_cast(iter_extra); - - assert(num_rows > 0); - if (e->num_rows == 0) { - e->checkpoint_counts = (uint64_t *) tokudb_my_malloc(num_rows * (sizeof *e->checkpoint_counts), MYF(MY_WME|MY_ZEROFILL|MY_FAE)); - e->blocknums = (int64_t *) tokudb_my_malloc(num_rows * (sizeof *e->blocknums), MYF(MY_WME|MY_ZEROFILL|MY_FAE)); - e->diskoffs = (int64_t *) tokudb_my_malloc(num_rows * (sizeof *e->diskoffs), MYF(MY_WME|MY_ZEROFILL|MY_FAE)); - e->sizes = (int64_t *) tokudb_my_malloc(num_rows * (sizeof *e->sizes), MYF(MY_WME|MY_ZEROFILL|MY_FAE)); - e->num_rows = num_rows; - } - - e->checkpoint_counts[e->i] = checkpoint_count; - e->blocknums[e->i] = blocknum; - e->diskoffs[e->i] = diskoff; - e->sizes[e->i] = size; - ++(e->i); - - return 0; -} - -static int tokudb_report_fractal_tree_block_map_for_db(const DBT *dname, const DBT *iname, TABLE *table, THD *thd) { - int error; - DB *db; - struct tokudb_report_fractal_tree_block_map_iterator_extra e = {}; // avoid struct initializers so that we can compile with older gcc versions - - error = db_create(&db, db_env, 0); - if (error) { - goto exit; - } - error = db->open(db, NULL, (char *)dname->data, NULL, DB_BTREE, 0, 0666); - if (error) { - goto exit; - } - error = db->iterate_fractal_tree_block_map(db, tokudb_report_fractal_tree_block_map_iterator, &e); - { - int close_error = db->close(db, 0); - if (!error) { - error = close_error; - } - } - if (error) { - goto exit; - } - - // If not, we should have gotten an error and skipped this section of code - assert(e.i == e.num_rows); - for (int64_t i = 0; error == 0 && i < e.num_rows; ++i) { - // We store the NULL terminator in the directory so it's included in the size. - // See #5789 - // Recalculate and check just to be safe. - size_t dname_len = strlen((const char *)dname->data); - assert(dname_len == dname->size - 1); - table->field[0]->store((char *)dname->data, dname_len, system_charset_info); - - size_t iname_len = strlen((const char *)iname->data); - assert(iname_len == iname->size - 1); - table->field[1]->store((char *)iname->data, iname_len, system_charset_info); - - table->field[2]->store(e.checkpoint_counts[i], false); - table->field[3]->store(e.blocknums[i], false); - static const int64_t freelist_null = -1; - static const int64_t diskoff_unused = -2; - if (e.diskoffs[i] == diskoff_unused || e.diskoffs[i] == freelist_null) { - table->field[4]->set_null(); } else { - table->field[4]->set_notnull(); - table->field[4]->store(e.diskoffs[i], false); + database_name.append(database_ptr); } - static const int64_t size_is_free = -1; - if (e.sizes[i] == size_is_free) { - table->field[5]->set_null(); - } else { - table->field[5]->set_notnull(); - table->field[5]->store(e.sizes[i], false); - } - - // split the dname - String database_name, table_name, dictionary_name; - tokudb_split_dname((const char *)dname->data, database_name, table_name,dictionary_name); - table->field[6]->store(database_name.c_ptr(), database_name.length(), system_charset_info); - table->field[7]->store(table_name.c_ptr(), table_name.length(), system_charset_info); - table->field[8]->store(dictionary_name.c_ptr(), dictionary_name.length(), system_charset_info); - - error = schema_table_store_record(thd, table); } - -exit: - if (e.checkpoint_counts != NULL) { - tokudb_my_free(e.checkpoint_counts); - e.checkpoint_counts = NULL; - } - if (e.blocknums != NULL) { - tokudb_my_free(e.blocknums); - e.blocknums = NULL; - } - if (e.diskoffs != NULL) { - tokudb_my_free(e.diskoffs); - e.diskoffs = NULL; - } - if (e.sizes != NULL) { - tokudb_my_free(e.sizes); - e.sizes = NULL; - } - return error; } -static int tokudb_fractal_tree_block_map(TABLE *table, THD *thd) { - int error; - DB_TXN* txn = NULL; - DBC* tmp_cursor = NULL; - DBT curr_key; - DBT curr_val; - memset(&curr_key, 0, sizeof curr_key); - memset(&curr_val, 0, sizeof curr_val); - error = txn_begin(db_env, 0, &txn, DB_READ_UNCOMMITTED, thd); - if (error) { - goto cleanup; - } - error = db_env->get_cursor_for_directory(db_env, txn, &tmp_cursor); - if (error) { - goto cleanup; - } - while (error == 0) { - error = tmp_cursor->c_get(tmp_cursor, &curr_key, &curr_val, DB_NEXT); - if (!error) { - error = tokudb_report_fractal_tree_block_map_for_db(&curr_key, &curr_val, table, thd); - } - if (!error && thd_killed(thd)) - error = ER_QUERY_INTERRUPTED; - } - if (error == DB_NOTFOUND) { - error = 0; - } -cleanup: - if (tmp_cursor) { - int r = tmp_cursor->c_close(tmp_cursor); - assert(r == 0); - } - if (txn) { - commit_txn(txn, 0); - } - return error; -} - -#if MYSQL_VERSION_ID >= 50600 -static int tokudb_fractal_tree_block_map_fill_table(THD *thd, TABLE_LIST *tables, Item *cond) { -#else -static int tokudb_fractal_tree_block_map_fill_table(THD *thd, TABLE_LIST *tables, COND *cond) { -#endif - TOKUDB_DBUG_ENTER(""); - int error; - TABLE *table = tables->table; - - // 3938: Get a read lock on the status flag, since we must - // read it before safely proceeding - rw_rdlock(&tokudb_hton_initialized_lock); - - if (!tokudb_hton_initialized) { - error = ER_PLUGIN_IS_NOT_LOADED; - my_error(error, MYF(0), tokudb_hton_name); - } else { - error = tokudb_fractal_tree_block_map(table, thd); - if (error) - my_error(ER_GET_ERRNO, MYF(0), error, tokudb_hton_name); - } - - //3938: unlock the status flag lock - rw_unlock(&tokudb_hton_initialized_lock); - TOKUDB_DBUG_RETURN(error); -} - -static int tokudb_fractal_tree_block_map_init(void *p) { - ST_SCHEMA_TABLE *schema = (ST_SCHEMA_TABLE *) p; - schema->fields_info = tokudb_fractal_tree_block_map_field_info; - schema->fill_table = tokudb_fractal_tree_block_map_fill_table; - return 0; -} - -static int tokudb_fractal_tree_block_map_done(void *p) { - return 0; -} +struct st_mysql_storage_engine tokudb_storage_engine = { + MYSQL_HANDLERTON_INTERFACE_VERSION +}; #if TOKU_INCLUDE_LOCK_TIMEOUT_QUERY_STRING struct tokudb_search_txn_extra { @@ -2048,10 +1562,16 @@ struct tokudb_search_txn_extra { uint64_t match_client_id; }; -static int tokudb_search_txn_callback(DB_TXN *txn, iterate_row_locks_callback iterate_locks, void *locks_extra, void *extra) { +static int tokudb_search_txn_callback( + DB_TXN* txn, + iterate_row_locks_callback iterate_locks, + void* locks_extra, + void* extra) { + uint64_t txn_id = txn->id64(txn); uint64_t client_id = txn->get_client_id(txn); - struct tokudb_search_txn_extra *e = reinterpret_cast(extra); + struct tokudb_search_txn_extra* e = + reinterpret_cast(extra); if (e->match_txn_id == txn_id) { e->match_found = true; e->match_client_id = client_id; @@ -2060,9 +1580,17 @@ static int tokudb_search_txn_callback(DB_TXN *txn, iterate_row_locks_callback it return 0; } -static bool tokudb_txn_id_to_client_id(THD *thd, uint64_t blocking_txnid, uint64_t *blocking_client_id) { - struct tokudb_search_txn_extra e = { false, blocking_txnid, 0}; - (void) db_env->iterate_live_transactions(db_env, tokudb_search_txn_callback, &e); +static bool tokudb_txn_id_to_client_id( + THD* thd, + uint64_t blocking_txnid, + uint64_t* blocking_client_id) { + + struct tokudb_search_txn_extra e = { + false, + blocking_txnid, + 0 + }; + db_env->iterate_live_transactions(db_env, tokudb_search_txn_callback, &e); if (e.match_found) { *blocking_client_id = e.match_client_id; } @@ -2070,14 +1598,20 @@ static bool tokudb_txn_id_to_client_id(THD *thd, uint64_t blocking_txnid, uint64 } #endif -static void tokudb_pretty_key(const DB *db, const DBT *key, const char *default_key, String *out) { +static void tokudb_pretty_key( + const DB* db, + const DBT* key, + const char* default_key, + String* out) { + if (key->data == NULL) { out->append(default_key); } else { bool do_hexdump = true; if (do_hexdump) { // hexdump the key - const unsigned char *data = reinterpret_cast(key->data); + const unsigned char* data = + reinterpret_cast(key->data); for (size_t i = 0; i < key->size; i++) { char str[3]; snprintf(str, sizeof str, "%2.2x", data[i]); @@ -2087,15 +1621,15 @@ static void tokudb_pretty_key(const DB *db, const DBT *key, const char *default_ } } -static void tokudb_pretty_left_key(const DB *db, const DBT *key, String *out) { +void tokudb_pretty_left_key(const DB* db, const DBT* key, String* out) { tokudb_pretty_key(db, key, "-infinity", out); } -static void tokudb_pretty_right_key(const DB *db, const DBT *key, String *out) { +void tokudb_pretty_right_key(const DB* db, const DBT* key, String* out) { tokudb_pretty_key(db, key, "+infinity", out); } -static const char *tokudb_get_index_name(DB *db) { +const char* tokudb_get_index_name(DB* db) { if (db != NULL) { return db->get_dname(db); } else { @@ -2104,17 +1638,24 @@ static const char *tokudb_get_index_name(DB *db) { } static int tokudb_equal_key(const DBT *left_key, const DBT *right_key) { - if (left_key->data == NULL || right_key->data == NULL || left_key->size != right_key->size) + if (left_key->data == NULL || right_key->data == NULL || + left_key->size != right_key->size) return 0; else return memcmp(left_key->data, right_key->data, left_key->size) == 0; } -static void tokudb_lock_timeout_callback(DB *db, uint64_t requesting_txnid, const DBT *left_key, const DBT *right_key, uint64_t blocking_txnid) { - THD *thd = current_thd; +static void tokudb_lock_timeout_callback( + DB* db, + uint64_t requesting_txnid, + const DBT* left_key, + const DBT* right_key, + uint64_t blocking_txnid) { + + THD* thd = current_thd; if (!thd) return; - ulong lock_timeout_debug = THDVAR(thd, lock_timeout_debug); + ulong lock_timeout_debug = tokudb::sysvars::lock_timeout_debug(thd); if (lock_timeout_debug != 0) { // generate a JSON document with the lock timeout info String log_str; @@ -2123,7 +1664,9 @@ static void tokudb_lock_timeout_callback(DB *db, uint64_t requesting_txnid, cons log_str.append("\"mysql_thread_id\":"); log_str.append_ulonglong(mysql_thread_id); log_str.append(", \"dbname\":"); - log_str.append("\""); log_str.append(tokudb_get_index_name(db)); log_str.append("\""); + log_str.append("\""); + log_str.append(tokudb_get_index_name(db)); + log_str.append("\""); log_str.append(", \"requesting_txnid\":"); log_str.append_ulonglong(requesting_txnid); log_str.append(", \"blocking_txnid\":"); @@ -2132,44 +1675,71 @@ static void tokudb_lock_timeout_callback(DB *db, uint64_t requesting_txnid, cons String key_str; tokudb_pretty_key(db, left_key, "?", &key_str); log_str.append(", \"key\":"); - log_str.append("\""); log_str.append(key_str); log_str.append("\""); + log_str.append("\""); + log_str.append(key_str); + log_str.append("\""); } else { String left_str; tokudb_pretty_left_key(db, left_key, &left_str); log_str.append(", \"key_left\":"); - log_str.append("\""); log_str.append(left_str); log_str.append("\""); + log_str.append("\""); + log_str.append(left_str); + log_str.append("\""); String right_str; tokudb_pretty_right_key(db, right_key, &right_str); log_str.append(", \"key_right\":"); - log_str.append("\""); log_str.append(right_str); log_str.append("\""); + log_str.append("\""); + log_str.append(right_str); + log_str.append("\""); } log_str.append("}"); // set last_lock_timeout if (lock_timeout_debug & 1) { - char *old_lock_timeout = THDVAR(thd, last_lock_timeout); - char *new_lock_timeout = tokudb_my_strdup(log_str.c_ptr(), MY_FAE); - THDVAR(thd, last_lock_timeout) = new_lock_timeout; - tokudb_my_free(old_lock_timeout); + char* old_lock_timeout = tokudb::sysvars::last_lock_timeout(thd); + char* new_lock_timeout = + tokudb::memory::strdup(log_str.c_ptr(), MY_FAE); + tokudb::sysvars::set_last_lock_timeout(thd, new_lock_timeout); #if TOKU_THDVAR_MEMALLOC_BUG - tokudb_pthread_mutex_lock(&tokudb_map_mutex); + tokudb_map_mutex.lock(); struct tokudb_map_pair old_key = { thd, old_lock_timeout }; tree_delete(&tokudb_map, &old_key, sizeof old_key, NULL); struct tokudb_map_pair new_key = { thd, new_lock_timeout }; tree_insert(&tokudb_map, &new_key, sizeof new_key, NULL); - tokudb_pthread_mutex_unlock(&tokudb_map_mutex); + tokudb_map_mutex.unlock(); #endif + tokudb::memory::free(old_lock_timeout); } // dump to stderr if (lock_timeout_debug & 2) { - sql_print_error("%s: lock timeout %s", tokudb_hton_name, log_str.c_ptr()); + sql_print_error( + "%s: lock timeout %s", + tokudb_hton_name, + log_str.c_ptr()); LEX_STRING *qs = thd_query_string(thd); - sql_print_error("%s: requesting_thread_id:%" PRIu64 " q:%.*s", tokudb_hton_name, mysql_thread_id, (int) qs->length, qs->str); + sql_print_error( + "%s: requesting_thread_id:%" PRIu64 " q:%.*s", + tokudb_hton_name, + mysql_thread_id, + (int)qs->length, + qs->str); #if TOKU_INCLUDE_LOCK_TIMEOUT_QUERY_STRING uint64_t blocking_thread_id = 0; - if (tokudb_txn_id_to_client_id(thd, blocking_txnid, &blocking_thread_id)) { + if (tokudb_txn_id_to_client_id( + thd, + blocking_txnid, + &blocking_thread_id)) { + String blocking_qs; - if (get_thread_query_string(blocking_thread_id, blocking_qs) == 0) { - sql_print_error("%s: blocking_thread_id:%" PRIu64 " q:%.*s", tokudb_hton_name, blocking_thread_id, blocking_qs.length(), blocking_qs.c_ptr()); + if (get_thread_query_string( + blocking_thread_id, + blocking_qs) == 0) { + + sql_print_error( + "%s: blocking_thread_id:%" PRIu64 " q:%.*s", + tokudb_hton_name, + blocking_thread_id, + blocking_qs.length(), + blocking_qs.c_ptr()); } } #endif @@ -2177,254 +1747,9 @@ static void tokudb_lock_timeout_callback(DB *db, uint64_t requesting_txnid, cons } } -static struct st_mysql_information_schema tokudb_trx_information_schema = { MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION }; - -static ST_FIELD_INFO tokudb_trx_field_info[] = { - {"trx_id", 0, MYSQL_TYPE_LONGLONG, 0, 0, NULL, SKIP_OPEN_TABLE }, - {"trx_mysql_thread_id", 0, MYSQL_TYPE_LONGLONG, 0, 0, NULL, SKIP_OPEN_TABLE }, - {"trx_time", 0, MYSQL_TYPE_LONGLONG, 0, 0, NULL, SKIP_OPEN_TABLE }, - {NULL, 0, MYSQL_TYPE_NULL, 0, 0, NULL, SKIP_OPEN_TABLE} -}; - -struct tokudb_trx_extra { - THD *thd; - TABLE *table; -}; - -static int tokudb_trx_callback(DB_TXN *txn, iterate_row_locks_callback iterate_locks, void *locks_extra, void *extra) { - uint64_t txn_id = txn->id64(txn); - uint64_t client_id = txn->get_client_id(txn); - uint64_t start_time = txn->get_start_time(txn); - struct tokudb_trx_extra *e = reinterpret_cast(extra); - THD *thd = e->thd; - TABLE *table = e->table; - table->field[0]->store(txn_id, false); - table->field[1]->store(client_id, false); - uint64_t tnow = (uint64_t) time(NULL); - table->field[2]->store(tnow >= start_time ? tnow - start_time : 0, false); - int error = schema_table_store_record(thd, table); - if (!error && thd_killed(thd)) - error = ER_QUERY_INTERRUPTED; - return error; -} - -#if MYSQL_VERSION_ID >= 50600 -static int tokudb_trx_fill_table(THD *thd, TABLE_LIST *tables, Item *cond) { -#else -static int tokudb_trx_fill_table(THD *thd, TABLE_LIST *tables, COND *cond) { -#endif - TOKUDB_DBUG_ENTER(""); - int error; - - rw_rdlock(&tokudb_hton_initialized_lock); - - if (!tokudb_hton_initialized) { - error = ER_PLUGIN_IS_NOT_LOADED; - my_error(error, MYF(0), tokudb_hton_name); - } else { - struct tokudb_trx_extra e = { thd, tables->table }; - error = db_env->iterate_live_transactions(db_env, tokudb_trx_callback, &e); - if (error) - my_error(ER_GET_ERRNO, MYF(0), error, tokudb_hton_name); - } - - rw_unlock(&tokudb_hton_initialized_lock); - TOKUDB_DBUG_RETURN(error); -} - -static int tokudb_trx_init(void *p) { - ST_SCHEMA_TABLE *schema = (ST_SCHEMA_TABLE *) p; - schema->fields_info = tokudb_trx_field_info; - schema->fill_table = tokudb_trx_fill_table; - return 0; -} - -static int tokudb_trx_done(void *p) { - return 0; -} - -static struct st_mysql_information_schema tokudb_lock_waits_information_schema = { MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION }; - -static ST_FIELD_INFO tokudb_lock_waits_field_info[] = { - {"requesting_trx_id", 0, MYSQL_TYPE_LONGLONG, 0, 0, NULL, SKIP_OPEN_TABLE }, - {"blocking_trx_id", 0, MYSQL_TYPE_LONGLONG, 0, 0, NULL, SKIP_OPEN_TABLE }, - {"lock_waits_dname", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, - {"lock_waits_key_left", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, - {"lock_waits_key_right", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, - {"lock_waits_start_time", 0, MYSQL_TYPE_LONGLONG, 0, 0, NULL, SKIP_OPEN_TABLE }, - {"lock_waits_table_schema", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, - {"lock_waits_table_name", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, - {"lock_waits_table_dictionary_name", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, - {NULL, 0, MYSQL_TYPE_NULL, 0, 0, NULL, SKIP_OPEN_TABLE} -}; - -struct tokudb_lock_waits_extra { - THD *thd; - TABLE *table; -}; - -static int tokudb_lock_waits_callback(DB *db, uint64_t requesting_txnid, const DBT *left_key, const DBT *right_key, - uint64_t blocking_txnid, uint64_t start_time, void *extra) { - struct tokudb_lock_waits_extra *e = reinterpret_cast(extra); - THD *thd = e->thd; - TABLE *table = e->table; - table->field[0]->store(requesting_txnid, false); - table->field[1]->store(blocking_txnid, false); - const char *dname = tokudb_get_index_name(db); - size_t dname_length = strlen(dname); - table->field[2]->store(dname, dname_length, system_charset_info); - String left_str; - tokudb_pretty_left_key(db, left_key, &left_str); - table->field[3]->store(left_str.ptr(), left_str.length(), system_charset_info); - String right_str; - tokudb_pretty_right_key(db, right_key, &right_str); - table->field[4]->store(right_str.ptr(), right_str.length(), system_charset_info); - table->field[5]->store(start_time, false); - - String database_name, table_name, dictionary_name; - tokudb_split_dname(dname, database_name, table_name, dictionary_name); - table->field[6]->store(database_name.c_ptr(), database_name.length(), system_charset_info); - table->field[7]->store(table_name.c_ptr(), table_name.length(), system_charset_info); - table->field[8]->store(dictionary_name.c_ptr(), dictionary_name.length(), system_charset_info); - - int error = schema_table_store_record(thd, table); - - if (!error && thd_killed(thd)) - error = ER_QUERY_INTERRUPTED; - - return error; -} - -#if MYSQL_VERSION_ID >= 50600 -static int tokudb_lock_waits_fill_table(THD *thd, TABLE_LIST *tables, Item *cond) { -#else -static int tokudb_lock_waits_fill_table(THD *thd, TABLE_LIST *tables, COND *cond) { -#endif - TOKUDB_DBUG_ENTER(""); - int error; - - rw_rdlock(&tokudb_hton_initialized_lock); - - if (!tokudb_hton_initialized) { - error = ER_PLUGIN_IS_NOT_LOADED; - my_error(error, MYF(0), tokudb_hton_name); - } else { - struct tokudb_lock_waits_extra e = { thd, tables->table }; - error = db_env->iterate_pending_lock_requests(db_env, tokudb_lock_waits_callback, &e); - if (error) - my_error(ER_GET_ERRNO, MYF(0), error, tokudb_hton_name); - } - - rw_unlock(&tokudb_hton_initialized_lock); - TOKUDB_DBUG_RETURN(error); -} - -static int tokudb_lock_waits_init(void *p) { - ST_SCHEMA_TABLE *schema = (ST_SCHEMA_TABLE *) p; - schema->fields_info = tokudb_lock_waits_field_info; - schema->fill_table = tokudb_lock_waits_fill_table; - return 0; -} - -static int tokudb_lock_waits_done(void *p) { - return 0; -} - -static struct st_mysql_information_schema tokudb_locks_information_schema = { MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION }; - -static ST_FIELD_INFO tokudb_locks_field_info[] = { - {"locks_trx_id", 0, MYSQL_TYPE_LONGLONG, 0, 0, NULL, SKIP_OPEN_TABLE }, - {"locks_mysql_thread_id", 0, MYSQL_TYPE_LONGLONG, 0, 0, NULL, SKIP_OPEN_TABLE }, - {"locks_dname", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, - {"locks_key_left", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, - {"locks_key_right", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, - {"locks_table_schema", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, - {"locks_table_name", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, - {"locks_table_dictionary_name", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, - {NULL, 0, MYSQL_TYPE_NULL, 0, 0, NULL, SKIP_OPEN_TABLE} -}; - -struct tokudb_locks_extra { - THD *thd; - TABLE *table; -}; - -static int tokudb_locks_callback(DB_TXN *txn, iterate_row_locks_callback iterate_locks, void *locks_extra, void *extra) { - uint64_t txn_id = txn->id64(txn); - uint64_t client_id = txn->get_client_id(txn); - struct tokudb_locks_extra *e = reinterpret_cast(extra); - THD *thd = e->thd; - TABLE *table = e->table; - int error = 0; - DB *db; - DBT left_key, right_key; - while (error == 0 && iterate_locks(&db, &left_key, &right_key, locks_extra) == 0) { - table->field[0]->store(txn_id, false); - table->field[1]->store(client_id, false); - - const char *dname = tokudb_get_index_name(db); - size_t dname_length = strlen(dname); - table->field[2]->store(dname, dname_length, system_charset_info); - - String left_str; - tokudb_pretty_left_key(db, &left_key, &left_str); - table->field[3]->store(left_str.ptr(), left_str.length(), system_charset_info); - - String right_str; - tokudb_pretty_right_key(db, &right_key, &right_str); - table->field[4]->store(right_str.ptr(), right_str.length(), system_charset_info); - - String database_name, table_name, dictionary_name; - tokudb_split_dname(dname, database_name, table_name, dictionary_name); - table->field[5]->store(database_name.c_ptr(), database_name.length(), system_charset_info); - table->field[6]->store(table_name.c_ptr(), table_name.length(), system_charset_info); - table->field[7]->store(dictionary_name.c_ptr(), dictionary_name.length(), system_charset_info); - - error = schema_table_store_record(thd, table); - - if (!error && thd_killed(thd)) - error = ER_QUERY_INTERRUPTED; - } - return error; -} - -#if MYSQL_VERSION_ID >= 50600 -static int tokudb_locks_fill_table(THD *thd, TABLE_LIST *tables, Item *cond) { -#else -static int tokudb_locks_fill_table(THD *thd, TABLE_LIST *tables, COND *cond) { -#endif - TOKUDB_DBUG_ENTER(""); - int error; - - rw_rdlock(&tokudb_hton_initialized_lock); - - if (!tokudb_hton_initialized) { - error = ER_PLUGIN_IS_NOT_LOADED; - my_error(error, MYF(0), tokudb_hton_name); - } else { - struct tokudb_locks_extra e = { thd, tables->table }; - error = db_env->iterate_live_transactions(db_env, tokudb_locks_callback, &e); - if (error) - my_error(ER_GET_ERRNO, MYF(0), error, tokudb_hton_name); - } - - rw_unlock(&tokudb_hton_initialized_lock); - TOKUDB_DBUG_RETURN(error); -} - -static int tokudb_locks_init(void *p) { - ST_SCHEMA_TABLE *schema = (ST_SCHEMA_TABLE *) p; - schema->fields_info = tokudb_locks_field_info; - schema->fill_table = tokudb_locks_fill_table; - return 0; -} - -static int tokudb_locks_done(void *p) { - return 0; -} - // Retrieves variables for information_schema.global_status. -// Names (columnname) are automatically converted to upper case, and prefixed with "TOKUDB_" +// Names (columnname) are automatically converted to upper case, +// and prefixed with "TOKUDB_" static int show_tokudb_vars(THD *thd, SHOW_VAR *var, char *buff) { TOKUDB_DBUG_ENTER(""); @@ -2435,13 +1760,23 @@ static int show_tokudb_vars(THD *thd, SHOW_VAR *var, char *buff) { fs_redzone_state redzone_state; uint64_t num_rows; - error = db_env->get_engine_status (db_env, toku_global_status_rows, toku_global_status_max_rows, &num_rows, &redzone_state, &panic, panic_string, panic_string_len, TOKU_GLOBAL_STATUS); + error = db_env->get_engine_status( + db_env, + toku_global_status_rows, + toku_global_status_max_rows, + &num_rows, + &redzone_state, + &panic, + panic_string, + panic_string_len, + TOKU_GLOBAL_STATUS); //TODO: Maybe do something with the panic output? if (error == 0) { - assert(num_rows <= toku_global_status_max_rows); + assert_always(num_rows <= toku_global_status_max_rows); //TODO: Maybe enable some of the items here: (copied from engine status - //TODO: (optionally) add redzone state, panic, panic string, etc. Right now it's being ignored. + //TODO: (optionally) add redzone state, panic, panic string, etc. + //Right now it's being ignored. for (uint64_t row = 0; row < num_rows; row++) { SHOW_VAR &status_var = toku_global_status_variables[row]; @@ -2463,7 +1798,11 @@ static int show_tokudb_vars(THD *thd, SHOW_VAR *var, char *buff) { time_t t = status_row.value.num; char tbuf[26]; // Reuse the memory in status_row. (It belongs to us). - snprintf(status_row.value.datebuf, sizeof(status_row.value.datebuf), "%.24s", ctime_r(&t, tbuf)); + snprintf( + status_row.value.datebuf, + sizeof(status_row.value.datebuf), + "%.24s", + ctime_r(&t, tbuf)); status_var.value = (char*)&status_row.value.datebuf[0]; break; } @@ -2489,7 +1828,11 @@ static int show_tokudb_vars(THD *thd, SHOW_VAR *var, char *buff) { status_var.type = SHOW_CHAR; // Reuse the memory in status_row.datebuf. (It belongs to us). // UNKNOWN TYPE: %d fits in 26 bytes (sizeof datebuf) for any integer. - snprintf(status_row.value.datebuf, sizeof(status_row.value.datebuf), "UNKNOWN TYPE: %d", status_row.type); + snprintf( + status_row.value.datebuf, + sizeof(status_row.value.datebuf), + "UNKNOWN TYPE: %d", + status_row.type); status_var.value = (char*)&status_row.value.datebuf[0]; break; } @@ -2521,157 +1864,38 @@ static void tokudb_backtrace(void) { } #endif -#if defined(TOKUDB_VERSION_MAJOR) && defined(TOKUDB_VERSION_MINOR) -#define TOKUDB_PLUGIN_VERSION ((TOKUDB_VERSION_MAJOR << 8) + TOKUDB_VERSION_MINOR) -#else -#define TOKUDB_PLUGIN_VERSION 0 -#endif - #ifdef MARIA_PLUGIN_INTERFACE_VERSION maria_declare_plugin(tokudb) #else mysql_declare_plugin(tokudb) #endif -{ - MYSQL_STORAGE_ENGINE_PLUGIN, - &tokudb_storage_engine, - tokudb_hton_name, - "Percona", - "Percona TokuDB Storage Engine with Fractal Tree(tm) Technology", - PLUGIN_LICENSE_GPL, - tokudb_init_func, /* plugin init */ - tokudb_done_func, /* plugin deinit */ - TOKUDB_PLUGIN_VERSION, - toku_global_status_variables_export, /* status variables */ - tokudb_system_variables, /* system variables */ + { + MYSQL_STORAGE_ENGINE_PLUGIN, + &tokudb_storage_engine, + tokudb_hton_name, + "Percona", + "Percona TokuDB Storage Engine with Fractal Tree(tm) Technology", + PLUGIN_LICENSE_GPL, + tokudb_init_func, /* plugin init */ + tokudb_done_func, /* plugin deinit */ + TOKUDB_PLUGIN_VERSION, + toku_global_status_variables_export, /* status variables */ + tokudb::sysvars::system_variables, /* system variables */ #ifdef MARIA_PLUGIN_INTERFACE_VERSION - tokudb_version, - MariaDB_PLUGIN_MATURITY_STABLE /* maturity */ + tokudb::sysvars::version, + MariaDB_PLUGIN_MATURITY_STABLE /* maturity */ #else - NULL, /* config options */ - 0, /* flags */ + NULL, /* config options */ + 0, /* flags */ #endif -}, -{ - MYSQL_INFORMATION_SCHEMA_PLUGIN, - &tokudb_trx_information_schema, - "TokuDB_trx", - "Percona", - "Percona TokuDB Storage Engine with Fractal Tree(tm) Technology", - PLUGIN_LICENSE_GPL, - tokudb_trx_init, /* plugin init */ - tokudb_trx_done, /* plugin deinit */ - TOKUDB_PLUGIN_VERSION, - NULL, /* status variables */ - NULL, /* system variables */ -#ifdef MARIA_PLUGIN_INTERFACE_VERSION - tokudb_version, - MariaDB_PLUGIN_MATURITY_STABLE /* maturity */ -#else - NULL, /* config options */ - 0, /* flags */ -#endif -}, -{ - MYSQL_INFORMATION_SCHEMA_PLUGIN, - &tokudb_lock_waits_information_schema, - "TokuDB_lock_waits", - "Percona", - "Percona TokuDB Storage Engine with Fractal Tree(tm) Technology", - PLUGIN_LICENSE_GPL, - tokudb_lock_waits_init, /* plugin init */ - tokudb_lock_waits_done, /* plugin deinit */ - TOKUDB_PLUGIN_VERSION, - NULL, /* status variables */ - NULL, /* system variables */ -#ifdef MARIA_PLUGIN_INTERFACE_VERSION - tokudb_version, - MariaDB_PLUGIN_MATURITY_STABLE /* maturity */ -#else - NULL, /* config options */ - 0, /* flags */ -#endif -}, -{ - MYSQL_INFORMATION_SCHEMA_PLUGIN, - &tokudb_locks_information_schema, - "TokuDB_locks", - "Percona", - "Percona TokuDB Storage Engine with Fractal Tree(tm) Technology", - PLUGIN_LICENSE_GPL, - tokudb_locks_init, /* plugin init */ - tokudb_locks_done, /* plugin deinit */ - TOKUDB_PLUGIN_VERSION, - NULL, /* status variables */ - NULL, /* system variables */ -#ifdef MARIA_PLUGIN_INTERFACE_VERSION - tokudb_version, - MariaDB_PLUGIN_MATURITY_STABLE /* maturity */ -#else - NULL, /* config options */ - 0, /* flags */ -#endif -}, -{ - MYSQL_INFORMATION_SCHEMA_PLUGIN, - &tokudb_file_map_information_schema, - "TokuDB_file_map", - "Percona", - "Percona TokuDB Storage Engine with Fractal Tree(tm) Technology", - PLUGIN_LICENSE_GPL, - tokudb_file_map_init, /* plugin init */ - tokudb_file_map_done, /* plugin deinit */ - TOKUDB_PLUGIN_VERSION, - NULL, /* status variables */ - NULL, /* system variables */ -#ifdef MARIA_PLUGIN_INTERFACE_VERSION - tokudb_version, - MariaDB_PLUGIN_MATURITY_STABLE /* maturity */ -#else - NULL, /* config options */ - 0, /* flags */ -#endif -}, -{ - MYSQL_INFORMATION_SCHEMA_PLUGIN, - &tokudb_fractal_tree_info_information_schema, - "TokuDB_fractal_tree_info", - "Percona", - "Percona TokuDB Storage Engine with Fractal Tree(tm) Technology", - PLUGIN_LICENSE_GPL, - tokudb_fractal_tree_info_init, /* plugin init */ - tokudb_fractal_tree_info_done, /* plugin deinit */ - TOKUDB_PLUGIN_VERSION, - NULL, /* status variables */ - NULL, /* system variables */ -#ifdef MARIA_PLUGIN_INTERFACE_VERSION - tokudb_version, - MariaDB_PLUGIN_MATURITY_STABLE /* maturity */ -#else - NULL, /* config options */ - 0, /* flags */ -#endif -}, -{ - MYSQL_INFORMATION_SCHEMA_PLUGIN, - &tokudb_fractal_tree_block_map_information_schema, - "TokuDB_fractal_tree_block_map", - "Percona", - "Percona TokuDB Storage Engine with Fractal Tree(tm) Technology", - PLUGIN_LICENSE_GPL, - tokudb_fractal_tree_block_map_init, /* plugin init */ - tokudb_fractal_tree_block_map_done, /* plugin deinit */ - TOKUDB_PLUGIN_VERSION, - NULL, /* status variables */ - NULL, /* system variables */ -#ifdef MARIA_PLUGIN_INTERFACE_VERSION - tokudb_version, - MariaDB_PLUGIN_MATURITY_STABLE /* maturity */ -#else - NULL, /* config options */ - 0, /* flags */ -#endif -} + }, + tokudb::information_schema::trx, + tokudb::information_schema::lock_waits, + tokudb::information_schema::locks, + tokudb::information_schema::file_map, + tokudb::information_schema::fractal_tree_info, + tokudb::information_schema::fractal_tree_block_map, + tokudb::information_schema::background_job_status #ifdef MARIA_PLUGIN_INTERFACE_VERSION maria_declare_plugin_end; #else diff --git a/storage/tokudb/hatoku_hton.h b/storage/tokudb/hatoku_hton.h index 2237047ef75..ade7be128a5 100644 --- a/storage/tokudb/hatoku_hton.h +++ b/storage/tokudb/hatoku_hton.h @@ -26,434 +26,177 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #ifndef _HATOKU_HTON_H #define _HATOKU_HTON_H -#include "db.h" +#include "hatoku_defines.h" +#include "tokudb_debug.h" +#include "tokudb_information_schema.h" +#include "tokudb_memory.h" +#include "tokudb_thread.h" +#include "tokudb_time.h" +#include "tokudb_txn.h" +#include "tokudb_sysvars.h" -extern handlerton *tokudb_hton; +extern handlerton* tokudb_hton; -extern DB_ENV *db_env; +extern DB_ENV* db_env; -enum srv_row_format_enum { - SRV_ROW_FORMAT_UNCOMPRESSED = 0, - SRV_ROW_FORMAT_ZLIB = 1, - SRV_ROW_FORMAT_SNAPPY = 2, - SRV_ROW_FORMAT_QUICKLZ = 3, - SRV_ROW_FORMAT_LZMA = 4, - SRV_ROW_FORMAT_FAST = 5, - SRV_ROW_FORMAT_SMALL = 6, - SRV_ROW_FORMAT_DEFAULT = 7 -}; -typedef enum srv_row_format_enum srv_row_format_t; +inline tokudb::sysvars::row_format_t toku_compression_method_to_row_format( + toku_compression_method method) { -static inline srv_row_format_t toku_compression_method_to_row_format(toku_compression_method method) { switch (method) { case TOKU_NO_COMPRESSION: - return SRV_ROW_FORMAT_UNCOMPRESSED; + return tokudb::sysvars::SRV_ROW_FORMAT_UNCOMPRESSED; case TOKU_ZLIB_WITHOUT_CHECKSUM_METHOD: case TOKU_ZLIB_METHOD: - return SRV_ROW_FORMAT_ZLIB; + return tokudb::sysvars::SRV_ROW_FORMAT_ZLIB; case TOKU_SNAPPY_METHOD: - return SRV_ROW_FORMAT_SNAPPY; + return tokudb::sysvars::SRV_ROW_FORMAT_SNAPPY; case TOKU_QUICKLZ_METHOD: - return SRV_ROW_FORMAT_QUICKLZ; + return tokudb::sysvars::SRV_ROW_FORMAT_QUICKLZ; case TOKU_LZMA_METHOD: - return SRV_ROW_FORMAT_LZMA; + return tokudb::sysvars::SRV_ROW_FORMAT_LZMA; case TOKU_DEFAULT_COMPRESSION_METHOD: - return SRV_ROW_FORMAT_DEFAULT; + return tokudb::sysvars::SRV_ROW_FORMAT_DEFAULT; case TOKU_FAST_COMPRESSION_METHOD: - return SRV_ROW_FORMAT_FAST; + return tokudb::sysvars::SRV_ROW_FORMAT_FAST; case TOKU_SMALL_COMPRESSION_METHOD: - return SRV_ROW_FORMAT_SMALL; + return tokudb::sysvars::SRV_ROW_FORMAT_SMALL; default: - assert(0); + assert_unreachable(); } } -static inline toku_compression_method row_format_to_toku_compression_method(srv_row_format_t row_format) { +inline toku_compression_method row_format_to_toku_compression_method( + tokudb::sysvars::row_format_t row_format) { + switch (row_format) { - case SRV_ROW_FORMAT_UNCOMPRESSED: + case tokudb::sysvars::SRV_ROW_FORMAT_UNCOMPRESSED: return TOKU_NO_COMPRESSION; - case SRV_ROW_FORMAT_QUICKLZ: - case SRV_ROW_FORMAT_FAST: + case tokudb::sysvars::SRV_ROW_FORMAT_QUICKLZ: + case tokudb::sysvars::SRV_ROW_FORMAT_FAST: return TOKU_QUICKLZ_METHOD; - case SRV_ROW_FORMAT_SNAPPY: + case tokudb::sysvars::SRV_ROW_FORMAT_SNAPPY: return TOKU_SNAPPY_METHOD; - case SRV_ROW_FORMAT_ZLIB: - case SRV_ROW_FORMAT_DEFAULT: + case tokudb::sysvars::SRV_ROW_FORMAT_ZLIB: + case tokudb::sysvars::SRV_ROW_FORMAT_DEFAULT: return TOKU_ZLIB_WITHOUT_CHECKSUM_METHOD; - case SRV_ROW_FORMAT_LZMA: - case SRV_ROW_FORMAT_SMALL: + case tokudb::sysvars::SRV_ROW_FORMAT_LZMA: + case tokudb::sysvars::SRV_ROW_FORMAT_SMALL: return TOKU_LZMA_METHOD; default: - assert(0); + assert_unreachable(); } } -// thread variables - -static MYSQL_THDVAR_BOOL(commit_sync, - PLUGIN_VAR_THDLOCAL, - "sync on txn commit", - /* check */ NULL, - /* update */ NULL, - /* default*/ true -); - -static MYSQL_THDVAR_UINT(pk_insert_mode, - 0, - "set the primary key insert mode", - NULL, - NULL, - 1, // default - 0, // min? - 2, // max - 1 // blocksize -); - -static uint get_pk_insert_mode(THD* thd) { - return THDVAR(thd, pk_insert_mode); -} - -static MYSQL_THDVAR_BOOL(load_save_space, - 0, - "compress intermediate bulk loader files to save space", - NULL, - NULL, - true -); - -static bool get_load_save_space(THD* thd) { - return (THDVAR(thd, load_save_space) != 0); -} - -static MYSQL_THDVAR_BOOL(disable_slow_alter, - 0, - "if on, alter tables that require copy are disabled", - NULL, - NULL, - false -); - -static bool get_disable_slow_alter(THD* thd) { - return (THDVAR(thd, disable_slow_alter) != 0); -} - -static MYSQL_THDVAR_BOOL(disable_hot_alter, - 0, - "if on, hot alter table is disabled", - NULL, - NULL, - false -); - -static bool get_disable_hot_alter(THD* thd) { - return THDVAR(thd, disable_hot_alter) != 0; -} - -static MYSQL_THDVAR_BOOL(create_index_online, - 0, - "if on, create index done online", - NULL, - NULL, - true -); - -static bool get_create_index_online(THD* thd) { - return (THDVAR(thd, create_index_online) != 0); -} - -static MYSQL_THDVAR_BOOL(alter_print_error, - 0, - "Print errors for alter table operations", - NULL, - NULL, - false -); - -static MYSQL_THDVAR_BOOL(disable_prefetching, - 0, - "if on, prefetching disabled", - NULL, - NULL, - false -); - -static bool get_disable_prefetching(THD* thd) { - return (THDVAR(thd, disable_prefetching) != 0); -} - -static MYSQL_THDVAR_BOOL(prelock_empty, - 0, - "Tokudb Prelock Empty Table", - NULL, - NULL, - true -); - -static bool get_prelock_empty(THD* thd) { - return (THDVAR(thd, prelock_empty) != 0); -} - -static MYSQL_THDVAR_UINT(block_size, - 0, - "fractal tree block size", - NULL, - NULL, - 4<<20, // default - 4096, // min - ~0U, // max - 1 // blocksize??? -); - -static uint get_tokudb_block_size(THD* thd) { - return THDVAR(thd, block_size); -} - -static MYSQL_THDVAR_UINT(read_block_size, - 0, - "fractal tree read block size", - NULL, - NULL, - 64*1024, // default - 4096, // min - ~0U, // max - 1 // blocksize??? -); - -static uint get_tokudb_read_block_size(THD* thd) { - return THDVAR(thd, read_block_size); -} - -static MYSQL_THDVAR_UINT(read_buf_size, - 0, - "fractal tree read block size", //TODO: Is this a typo? - NULL, - NULL, - 128*1024, // default - 0, // min - 1*1024*1024, // max - 1 // blocksize??? -); - -static uint get_tokudb_read_buf_size(THD* thd) { - return THDVAR(thd, read_buf_size); -} - -#if TOKU_INCLUDE_UPSERT -static MYSQL_THDVAR_BOOL(disable_slow_update, - PLUGIN_VAR_THDLOCAL, - "disable slow update", - NULL, // check - NULL, // update - false // default -); - -static MYSQL_THDVAR_BOOL(disable_slow_upsert, - PLUGIN_VAR_THDLOCAL, - "disable slow upsert", - NULL, // check - NULL, // update - false // default -); +inline enum row_type row_format_to_row_type( + tokudb::sysvars::row_format_t row_format) { +#if TOKU_INCLUDE_ROW_TYPE_COMPRESSION + switch (row_format) { + case tokudb::sysvars::SRV_ROW_FORMAT_UNCOMPRESSED: + return ROW_TYPE_TOKU_UNCOMPRESSED; + case tokudb::sysvars::SRV_ROW_FORMAT_ZLIB: + return ROW_TYPE_TOKU_ZLIB; + case tokudb::sysvars::SRV_ROW_FORMAT_SNAPPY: + return ROW_TYPE_TOKU_SNAPPY; + case tokudb::sysvars::SRV_ROW_FORMAT_QUICKLZ: + return ROW_TYPE_TOKU_QUICKLZ; + case tokudb::sysvars::SRV_ROW_FORMAT_LZMA: + return ROW_TYPE_TOKU_LZMA; + case tokudb::sysvars::SRV_ROW_FORMAT_SMALL: + return ROW_TYPE_TOKU_SMALL; + case tokudb::sysvars::SRV_ROW_FORMAT_FAST: + return ROW_TYPE_TOKU_FAST; + case tokudb::sysvars::SRV_ROW_FORMAT_DEFAULT: + return ROW_TYPE_DEFAULT; + } #endif - -static MYSQL_THDVAR_UINT(fanout, - 0, - "fractal tree fanout", - NULL, - NULL, - 16, // default - 2, // min - 16*1024, // max - 1 // blocksize??? -); - -static uint get_tokudb_fanout(THD* thd) { - return THDVAR(thd, fanout); + return ROW_TYPE_DEFAULT; } -static MYSQL_THDVAR_UINT(analyze_time, 0, "analyze time (seconds)", NULL /*check*/, NULL /*update*/, 5 /*default*/, 0 /*min*/, ~0U /*max*/, 1 /*blocksize*/); - -static MYSQL_THDVAR_DOUBLE(analyze_delete_fraction, 0, "fraction of rows allowed to be deleted", NULL /*check*/, NULL /*update*/, 1.0 /*def*/, 0 /*min*/, 1.0 /*max*/, 1); - -static void tokudb_checkpoint_lock(THD * thd); -static void tokudb_checkpoint_unlock(THD * thd); - -static void tokudb_checkpoint_lock_update( - THD* thd, - struct st_mysql_sys_var* var, - void* var_ptr, - const void* save) -{ - my_bool* val = (my_bool *) var_ptr; - *val= *(my_bool *) save ? true : false; - if (*val) { - tokudb_checkpoint_lock(thd); +inline tokudb::sysvars::row_format_t row_type_to_row_format( + enum row_type type) { +#if TOKU_INCLUDE_ROW_TYPE_COMPRESSION + switch (type) { + case ROW_TYPE_TOKU_UNCOMPRESSED: + return tokudb::sysvars::SRV_ROW_FORMAT_UNCOMPRESSED; + case ROW_TYPE_TOKU_ZLIB: + return tokudb::sysvars::SRV_ROW_FORMAT_ZLIB; + case ROW_TYPE_TOKU_SNAPPY: + return tokudb::sysvars::SRV_ROW_FORMAT_SNAPPY; + case ROW_TYPE_TOKU_QUICKLZ: + return tokudb::sysvars::SRV_ROW_FORMAT_QUICKLZ; + case ROW_TYPE_TOKU_LZMA: + return tokudb::sysvars::SRV_ROW_FORMAT_LZMA; + case ROW_TYPE_TOKU_SMALL: + return tokudb::sysvars::SRV_ROW_FORMAT_SMALL; + case ROW_TYPE_TOKU_FAST: + return tokudb::sysvars::SRV_ROW_FORMAT_FAST; + case ROW_TYPE_DEFAULT: + return tokudb::sysvars::SRV_ROW_FORMAT_DEFAULT; + default: + return tokudb::sysvars::SRV_ROW_FORMAT_DEFAULT; } - else { - tokudb_checkpoint_unlock(thd); - } -} - -static MYSQL_THDVAR_BOOL(checkpoint_lock, - 0, - "Tokudb Checkpoint Lock", - NULL, - tokudb_checkpoint_lock_update, - false -); - -static const char *tokudb_row_format_names[] = { - "tokudb_uncompressed", - "tokudb_zlib", - "tokudb_snappy", - "tokudb_quicklz", - "tokudb_lzma", - "tokudb_fast", - "tokudb_small", - "tokudb_default", - NullS -}; - -static TYPELIB tokudb_row_format_typelib = { - array_elements(tokudb_row_format_names) - 1, - "tokudb_row_format_typelib", - tokudb_row_format_names, - NULL -}; - -static MYSQL_THDVAR_ENUM(row_format, PLUGIN_VAR_OPCMDARG, - "Specifies the compression method for a table during this session. " - "Possible values are TOKUDB_UNCOMPRESSED, TOKUDB_ZLIB, TOKUDB_SNAPPY, " - "TOKUDB_QUICKLZ, TOKUDB_LZMA, TOKUDB_FAST, TOKUDB_SMALL and TOKUDB_DEFAULT", - NULL, NULL, SRV_ROW_FORMAT_ZLIB, &tokudb_row_format_typelib); - -static inline srv_row_format_t get_row_format(THD *thd) { - return (srv_row_format_t) THDVAR(thd, row_format); +#endif + return tokudb::sysvars::SRV_ROW_FORMAT_DEFAULT; } -static MYSQL_THDVAR_UINT(lock_timeout_debug, 0, "TokuDB lock timeout debug", NULL /*check*/, NULL /*update*/, 1 /*default*/, 0 /*min*/, ~0U /*max*/, 1); +inline enum row_type toku_compression_method_to_row_type( + toku_compression_method method) { -static MYSQL_THDVAR_STR(last_lock_timeout, PLUGIN_VAR_MEMALLOC, "last TokuDB lock timeout", NULL /*check*/, NULL /*update*/, NULL /*default*/); + return row_format_to_row_type( + toku_compression_method_to_row_format(method)); +} -static MYSQL_THDVAR_BOOL(hide_default_row_format, 0, "hide the default row format", NULL /*check*/, NULL /*update*/, true); +inline toku_compression_method row_type_to_toku_compression_method( + enum row_type type) { -static const uint64_t DEFAULT_TOKUDB_LOCK_TIMEOUT = 4000; /*milliseconds*/ + return row_format_to_toku_compression_method(row_type_to_row_format(type)); +} -static MYSQL_THDVAR_ULONGLONG(lock_timeout, 0, "TokuDB lock timeout", NULL, NULL, DEFAULT_TOKUDB_LOCK_TIMEOUT, 0 /*min*/, ~0ULL /*max*/, 1 /*blocksize*/); +void tokudb_checkpoint_lock(THD * thd); +void tokudb_checkpoint_unlock(THD * thd); -static uint64_t tokudb_get_lock_wait_time_callback(uint64_t default_wait_time) { +inline uint64_t tokudb_get_lock_wait_time_callback(uint64_t default_wait_time) { THD *thd = current_thd; - uint64_t wait_time = THDVAR(thd, lock_timeout); - return wait_time; + return tokudb::sysvars::lock_timeout(thd); } -static MYSQL_THDVAR_ULONGLONG(loader_memory_size, - 0, - "TokuDB loader memory size", - NULL, - NULL, - 100*1000*1000, /*default*/ - 0, /*min*/ - ~0ULL, /*max*/ - 1 /*blocksize*/ -); - -static uint64_t tokudb_get_loader_memory_size_callback(void) { +inline uint64_t tokudb_get_loader_memory_size_callback(void) { THD *thd = current_thd; - uint64_t memory_size = THDVAR(thd, loader_memory_size); - return memory_size; + return tokudb::sysvars::loader_memory_size(thd); } -static const uint64_t DEFAULT_TOKUDB_KILLED_TIME = 4000; - -static MYSQL_THDVAR_ULONGLONG(killed_time, 0, "TokuDB killed time", NULL, NULL, DEFAULT_TOKUDB_KILLED_TIME, 0 /*min*/, ~0ULL /*max*/, 1 /*blocksize*/); - -static uint64_t tokudb_get_killed_time_callback(uint64_t default_killed_time) { +inline uint64_t tokudb_get_killed_time_callback(uint64_t default_killed_time) { THD *thd = current_thd; - uint64_t killed_time = THDVAR(thd, killed_time); - return killed_time; + return tokudb::sysvars::killed_time(thd); } -static int tokudb_killed_callback(void) { +inline int tokudb_killed_callback(void) { THD *thd = current_thd; return thd_killed(thd); } -static bool tokudb_killed_thd_callback(void *extra, uint64_t deleted_rows) { +inline bool tokudb_killed_thd_callback(void *extra, uint64_t deleted_rows) { THD *thd = static_cast(extra); return thd_killed(thd) != 0; } -enum { - TOKUDB_EMPTY_SCAN_DISABLED = 0, - TOKUDB_EMPTY_SCAN_LR = 1, - TOKUDB_EMPTY_SCAN_RL = 2, -}; - -static const char *tokudb_empty_scan_names[] = { - "disabled", - "lr", - "rl", - NullS -}; - -static TYPELIB tokudb_empty_scan_typelib = { - array_elements(tokudb_empty_scan_names) - 1, - "tokudb_empty_scan_typelib", - tokudb_empty_scan_names, - NULL -}; - -static MYSQL_THDVAR_ENUM(empty_scan, PLUGIN_VAR_OPCMDARG, - "TokuDB algorithm to check if the table is empty when opened. ", - NULL, NULL, TOKUDB_EMPTY_SCAN_RL, &tokudb_empty_scan_typelib -); - -#if TOKUDB_CHECK_JEMALLOC -static uint tokudb_check_jemalloc; -static MYSQL_SYSVAR_UINT(check_jemalloc, tokudb_check_jemalloc, 0, "Check if jemalloc is linked", - NULL, NULL, 1, 0, 1, 0); -#endif - -static MYSQL_THDVAR_BOOL(bulk_fetch, PLUGIN_VAR_THDLOCAL, "enable bulk fetch", - NULL /*check*/, NULL /*update*/, true /*default*/); - -#if TOKU_INCLUDE_XA -static MYSQL_THDVAR_BOOL(support_xa, - PLUGIN_VAR_OPCMDARG, - "Enable TokuDB support for the XA two-phase commit", - NULL, // check - NULL, // update - true // default -); -#endif - -static MYSQL_THDVAR_BOOL(rpl_unique_checks, PLUGIN_VAR_THDLOCAL, "enable unique checks on replication slave", - NULL /*check*/, NULL /*update*/, true /*default*/); - -static MYSQL_THDVAR_ULONGLONG(rpl_unique_checks_delay, PLUGIN_VAR_THDLOCAL, "time in milliseconds to add to unique checks test on replication slave", - NULL, NULL, 0 /*default*/, 0 /*min*/, ~0ULL /*max*/, 1 /*blocksize*/); - -static MYSQL_THDVAR_BOOL(rpl_lookup_rows, PLUGIN_VAR_THDLOCAL, "lookup a row on rpl slave", - NULL /*check*/, NULL /*update*/, true /*default*/); - -static MYSQL_THDVAR_ULONGLONG(rpl_lookup_rows_delay, PLUGIN_VAR_THDLOCAL, "time in milliseconds to add to lookups on replication slave", - NULL, NULL, 0 /*default*/, 0 /*min*/, ~0ULL /*max*/, 1 /*blocksize*/); - -static MYSQL_THDVAR_BOOL(rpl_check_readonly, PLUGIN_VAR_THDLOCAL, "check if the slave is read only", - NULL /*check*/, NULL /*update*/, true /*default*/); - -static MYSQL_THDVAR_STR(optimize_index_name, PLUGIN_VAR_THDLOCAL + PLUGIN_VAR_MEMALLOC, "optimize index name (default all indexes)", NULL /*check*/, NULL /*update*/, NULL /*default*/); - -static MYSQL_THDVAR_DOUBLE(optimize_index_fraction, 0, "optimize index fraction (default 1.0 all)", NULL /*check*/, NULL /*update*/, 1.0 /*def*/, 0 /*min*/, 1.0 /*max*/, 1); - -static MYSQL_THDVAR_ULONGLONG(optimize_throttle, 0, "optimize throttle (default no throttle)", NULL /*check*/, NULL /*update*/, 0 /*def*/, 0 /*min*/, ~0ULL /*max*/, 1); extern HASH tokudb_open_tables; -extern pthread_mutex_t tokudb_mutex; -extern uint32_t tokudb_write_status_frequency; -extern uint32_t tokudb_read_status_frequency; +extern tokudb::thread::mutex_t tokudb_mutex; +extern const char* tokudb_hton_name; +extern int tokudb_hton_initialized; +extern tokudb::thread::rwlock_t tokudb_hton_initialized_lock; void toku_hton_update_primary_key_bytes_inserted(uint64_t row_size); +void tokudb_split_dname( + const char* dname, + String& database_name, + String& table_name, + String& dictionary_name); + +void tokudb_pretty_left_key(const DB* db, const DBT* key, String* out); +void tokudb_pretty_right_key(const DB* db, const DBT* key, String* out); +const char *tokudb_get_index_name(DB* db); + #endif //#ifdef _HATOKU_HTON diff --git a/storage/tokudb/mysql-test/rpl/disabled.def b/storage/tokudb/mysql-test/rpl/disabled.def index 25c44654676..4c1a9a3e785 100644 --- a/storage/tokudb/mysql-test/rpl/disabled.def +++ b/storage/tokudb/mysql-test/rpl/disabled.def @@ -13,4 +13,3 @@ rpl_tokudb_write_unique_uc1: unreliable, uses timestamp differences rpl_tokudb_read_only_ff: unreliable, uses timestamp differences rpl_tokudb_read_only_tf: unreliable, uses timestamp differences rpl_tokudb_read_only_tt: unreliable, uses timestamp differences -rpl_row_sp002_tokudb : tokudb does not support foreign keys diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_extra_col_master_tokudb.result b/storage/tokudb/mysql-test/rpl/r/rpl_extra_col_master_tokudb.result index b5d9ecbedae..58291bc7fd1 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_extra_col_master_tokudb.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_extra_col_master_tokudb.result @@ -101,13 +101,11 @@ f5 DOUBLE DEFAULT '2.00', f6 ENUM('a', 'b', 'c') default 'a', f7 DECIMAL(17,9) default '1000.00', f8 MEDIUMBLOB, -f9 NUMERIC(6,4) default '2000.00', +f9 NUMERIC(6,2) default '2000.00', f10 VARCHAR(1024), f11 BINARY(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0', f12 SET('a', 'b', 'c') default 'b') ENGINE=TokuDB; -Warnings: -Warning 1264 Out of range value for column 'f9' at row 1 CREATE TABLE t3 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), /* extra */ @@ -124,13 +122,11 @@ CREATE TABLE t4 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), f5 DOUBLE DEFAULT '2.00', f6 DECIMAL(17,9) default '1000.00', f7 MEDIUMBLOB, -f8 NUMERIC(6,4) default '2000.00', +f8 NUMERIC(6,2) default '2000.00', f9 VARCHAR(1024), f10 BINARY(20) not null default '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0', f11 CHAR(255)) ENGINE=TokuDB; -Warnings: -Warning 1264 Out of range value for column 'f8' at row 1 CREATE TABLE t31 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), /* extra */ @@ -191,9 +187,6 @@ INSERT into t2 values (2, 2, 2, 'second', (3, 3, 3, 'third', 3.0, 'b', 3000.0003, 'f8: medium size blob', 3000, 'f10: some var char', '01234567', 'c'); -Warnings: -Warning 1264 Out of range value for column 'f9' at row 1 -Warning 1264 Out of range value for column 'f9' at row 2 INSERT into t3 set f1=1, f2=1, f3=1, f4='first', f10='f10: some var char'; INSERT into t4 set f1=1, f2=1, f3=1, f4='first', f7='f7: medium size blob', f10='f10: binary data'; @@ -643,7 +636,7 @@ c1 c3 hex(c4) c5 c6 ************ connection slave; include/wait_for_slave_sql_error.inc [errno=1091] -Last_SQL_Error = 'Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7'' +Last_SQL_Error = 'Error 'Can't DROP COLUMN `c7`; check that it exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7'' STOP SLAVE; RESET SLAVE; diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_extra_col_slave_tokudb.result b/storage/tokudb/mysql-test/rpl/r/rpl_extra_col_slave_tokudb.result index 5061c1dcdbf..db89e478b90 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_extra_col_slave_tokudb.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_extra_col_slave_tokudb.result @@ -657,8 +657,8 @@ Table Create Table t16 CREATE TABLE `t16` ( `c1` int(11) NOT NULL, `c2` decimal(8,2) DEFAULT NULL, - `c3` text, - `c4` blob, + `c3` text DEFAULT NULL, + `c4` blob DEFAULT NULL, `c5` char(5) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 @@ -671,10 +671,10 @@ Table Create Table t16 CREATE TABLE `t16` ( `c1` int(11) NOT NULL, `c2` decimal(8,2) DEFAULT NULL, - `c3` text, - `c4` blob, + `c3` text DEFAULT NULL, + `c4` blob DEFAULT NULL, `c5` char(5) DEFAULT NULL, - `c6` int(11) DEFAULT '1', + `c6` int(11) DEFAULT 1, `c7` timestamp NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`c1`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_delete_pk.result b/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_delete_pk.result index c9b6ea8f1a9..a85d2155725 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_delete_pk.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_delete_pk.result @@ -3,6 +3,13 @@ include/master-slave.inc connection master; drop table if exists t; connection slave; +show variables like 'tokudb_rpl_%'; +Variable_name Value +tokudb_rpl_check_readonly ON +tokudb_rpl_lookup_rows OFF +tokudb_rpl_lookup_rows_delay 10000 +tokudb_rpl_unique_checks OFF +tokudb_rpl_unique_checks_delay 10000 connection master; create table t (a bigint not null, primary key(a)) engine=tokudb; insert into t values (1); diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_update_pk_uc0_lookup0.result b/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_update_pk_uc0_lookup0.result index 8ae4e9401a5..d055e4341c7 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_update_pk_uc0_lookup0.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_update_pk_uc0_lookup0.result @@ -3,6 +3,13 @@ include/master-slave.inc connection master; drop table if exists t; connection slave; +show variables like 'tokudb_rpl_%'; +Variable_name Value +tokudb_rpl_check_readonly ON +tokudb_rpl_lookup_rows OFF +tokudb_rpl_lookup_rows_delay 10000 +tokudb_rpl_unique_checks OFF +tokudb_rpl_unique_checks_delay 10000 connection master; create table t (a bigint not null, b bigint not null, primary key(a)) engine=tokudb; insert into t values (1,0); diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_write_pk.result b/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_write_pk.result index 2636ec21095..f39d2400afd 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_write_pk.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_write_pk.result @@ -3,6 +3,10 @@ include/master-slave.inc connection master; drop table if exists t; connection slave; +show variables like 'tokudb_rpl_unique_checks%'; +Variable_name Value +tokudb_rpl_unique_checks OFF +tokudb_rpl_unique_checks_delay 5000 connection master; create table t (a bigint not null, primary key(a)) engine=tokudb; select unix_timestamp() into @tstart; diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_bug28430.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_bug28430.result index 7bde36ad5e3..e5a196f894b 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_bug28430.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_bug28430.result @@ -110,7 +110,7 @@ Create Table CREATE TABLE `byrange_tbl` ( `id` mediumint(9) NOT NULL AUTO_INCREMENT, `dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `user` char(255) DEFAULT NULL, - `uuidf` longblob, + `uuidf` longblob DEFAULT NULL, `fkid` mediumint(9) DEFAULT NULL, `filler` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_delete_pk.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_delete_pk.result index c77cbbc71c9..6fab29177d7 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_delete_pk.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_delete_pk.result @@ -4,6 +4,13 @@ Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. [connection master] drop table if exists t; +show variables like 'tokudb_rpl_%'; +Variable_name Value +tokudb_rpl_check_readonly ON +tokudb_rpl_lookup_rows OFF +tokudb_rpl_lookup_rows_delay 10000 +tokudb_rpl_unique_checks OFF +tokudb_rpl_unique_checks_delay 10000 create table t (a bigint not null, primary key(a)) engine=tokudb; insert into t values (1); insert into t values (2),(3); diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_delete_pk_lookup1.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_delete_pk_lookup1.result index e178b8ad137..f8efd5e04ee 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_delete_pk_lookup1.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_delete_pk_lookup1.result @@ -4,6 +4,13 @@ Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. [connection master] drop table if exists t; +show variables like 'tokudb_rpl_%'; +Variable_name Value +tokudb_rpl_check_readonly ON +tokudb_rpl_lookup_rows ON +tokudb_rpl_lookup_rows_delay 10000 +tokudb_rpl_unique_checks ON +tokudb_rpl_unique_checks_delay 0 create table t (a bigint not null, primary key(a)) engine=tokudb; insert into t values (1); insert into t values (2),(3); diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_mixed_dml.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_mixed_dml.result index 75e2e61a363..1208b0612ff 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_mixed_dml.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_mixed_dml.result @@ -1,3 +1,6 @@ +SET SESSION tokudb_pk_insert_mode = 2; +Warnings: +Warning 131 Using tokudb_pk_insert_mode is deprecated and the parameter may be removed in future releases. include/master-slave.inc [connection master] connection master; diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_read_only_ff.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_read_only_ff.result index 5926cdda565..76a5e31b969 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_read_only_ff.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_read_only_ff.result @@ -4,6 +4,13 @@ Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. [connection master] drop table if exists t; +show variables like 'tokudb_rpl%'; +Variable_name Value +tokudb_rpl_check_readonly OFF +tokudb_rpl_lookup_rows ON +tokudb_rpl_lookup_rows_delay 0 +tokudb_rpl_unique_checks OFF +tokudb_rpl_unique_checks_delay 5000 create table t (a bigint not null, primary key(a)) engine=tokudb; select unix_timestamp() into @tstart; insert into t values (1); diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_read_only_ft.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_read_only_ft.result index dc6200117fd..593f177569f 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_read_only_ft.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_read_only_ft.result @@ -3,6 +3,13 @@ include/master-slave.inc connection master; drop table if exists t; connection slave; +show variables like 'tokudb_rpl%'; +Variable_name Value +tokudb_rpl_check_readonly ON +tokudb_rpl_lookup_rows ON +tokudb_rpl_lookup_rows_delay 0 +tokudb_rpl_unique_checks OFF +tokudb_rpl_unique_checks_delay 5000 connection master; create table t (a bigint not null, primary key(a)) engine=tokudb; select unix_timestamp() into @tstart; diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_read_only_tf.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_read_only_tf.result index 5926cdda565..76a5e31b969 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_read_only_tf.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_read_only_tf.result @@ -4,6 +4,13 @@ Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. [connection master] drop table if exists t; +show variables like 'tokudb_rpl%'; +Variable_name Value +tokudb_rpl_check_readonly OFF +tokudb_rpl_lookup_rows ON +tokudb_rpl_lookup_rows_delay 0 +tokudb_rpl_unique_checks OFF +tokudb_rpl_unique_checks_delay 5000 create table t (a bigint not null, primary key(a)) engine=tokudb; select unix_timestamp() into @tstart; insert into t values (1); diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_read_only_tt.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_read_only_tt.result index 5926cdda565..0cba2a1cddb 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_read_only_tt.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_read_only_tt.result @@ -4,6 +4,13 @@ Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. [connection master] drop table if exists t; +show variables like 'tokudb_rpl%'; +Variable_name Value +tokudb_rpl_check_readonly ON +tokudb_rpl_lookup_rows ON +tokudb_rpl_lookup_rows_delay 0 +tokudb_rpl_unique_checks OFF +tokudb_rpl_unique_checks_delay 5000 create table t (a bigint not null, primary key(a)) engine=tokudb; select unix_timestamp() into @tstart; insert into t values (1); diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_pk_uc0_lookup0.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_pk_uc0_lookup0.result index 162655f9896..50f43ebe5bf 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_pk_uc0_lookup0.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_pk_uc0_lookup0.result @@ -4,6 +4,13 @@ Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. [connection master] drop table if exists t; +show variables like 'tokudb_rpl_%'; +Variable_name Value +tokudb_rpl_check_readonly ON +tokudb_rpl_lookup_rows OFF +tokudb_rpl_lookup_rows_delay 10000 +tokudb_rpl_unique_checks OFF +tokudb_rpl_unique_checks_delay 10000 create table t (a bigint not null, b bigint not null, primary key(a)) engine=tokudb; insert into t values (1,0); insert into t values (2,0),(3,0); diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_pk_uc0_lookup1.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_pk_uc0_lookup1.result index 3c909718426..9e7f932a3c9 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_pk_uc0_lookup1.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_pk_uc0_lookup1.result @@ -4,6 +4,13 @@ Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. [connection master] drop table if exists t; +show variables like 'tokudb_rpl_%'; +Variable_name Value +tokudb_rpl_check_readonly ON +tokudb_rpl_lookup_rows ON +tokudb_rpl_lookup_rows_delay 10000 +tokudb_rpl_unique_checks OFF +tokudb_rpl_unique_checks_delay 10000 create table t (a bigint not null, b bigint not null, primary key(a)) engine=tokudb; insert into t values (1,0); insert into t values (2,0),(3,0); diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_pk_uc1_lookup0.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_pk_uc1_lookup0.result index 3c909718426..348734b206d 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_pk_uc1_lookup0.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_pk_uc1_lookup0.result @@ -4,6 +4,13 @@ Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. [connection master] drop table if exists t; +show variables like 'tokudb_rpl_%'; +Variable_name Value +tokudb_rpl_check_readonly ON +tokudb_rpl_lookup_rows OFF +tokudb_rpl_lookup_rows_delay 10000 +tokudb_rpl_unique_checks ON +tokudb_rpl_unique_checks_delay 10000 create table t (a bigint not null, b bigint not null, primary key(a)) engine=tokudb; insert into t values (1,0); insert into t values (2,0),(3,0); diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_pk_uc1_lookup1.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_pk_uc1_lookup1.result index 3c909718426..bfd640e52e9 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_pk_uc1_lookup1.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_pk_uc1_lookup1.result @@ -4,6 +4,13 @@ Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. [connection master] drop table if exists t; +show variables like 'tokudb_rpl_%'; +Variable_name Value +tokudb_rpl_check_readonly ON +tokudb_rpl_lookup_rows ON +tokudb_rpl_lookup_rows_delay 10000 +tokudb_rpl_unique_checks ON +tokudb_rpl_unique_checks_delay 10000 create table t (a bigint not null, b bigint not null, primary key(a)) engine=tokudb; insert into t values (1,0); insert into t values (2,0),(3,0); diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_unique_uc0_lookup0.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_unique_uc0_lookup0.result index 941010071ae..faf969f851a 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_unique_uc0_lookup0.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_unique_uc0_lookup0.result @@ -4,6 +4,13 @@ Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. [connection master] drop table if exists t; +show variables like 'tokudb_rpl_%'; +Variable_name Value +tokudb_rpl_check_readonly ON +tokudb_rpl_lookup_rows OFF +tokudb_rpl_lookup_rows_delay 10000 +tokudb_rpl_unique_checks OFF +tokudb_rpl_unique_checks_delay 10000 create table t (a bigint not null, b bigint not null, c bigint not null, primary key(a), unique key(c)) engine=tokudb; insert into t values (1,0,-1); insert into t values (2,0,-2),(3,0,-3); diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_unique_uc0_lookup1.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_unique_uc0_lookup1.result index 6a0b1126710..9ac87512f80 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_unique_uc0_lookup1.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_unique_uc0_lookup1.result @@ -4,6 +4,13 @@ Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. [connection master] drop table if exists t; +show variables like 'tokudb_rpl_%'; +Variable_name Value +tokudb_rpl_check_readonly ON +tokudb_rpl_lookup_rows ON +tokudb_rpl_lookup_rows_delay 10000 +tokudb_rpl_unique_checks OFF +tokudb_rpl_unique_checks_delay 10000 create table t (a bigint not null, b bigint not null, c bigint not null, primary key(a), unique key(c)) engine=tokudb; insert into t values (1,0,-1); insert into t values (2,0,-2),(3,0,-3); diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_write_pk.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_write_pk.result index 5926cdda565..ea1b84f8138 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_write_pk.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_write_pk.result @@ -4,6 +4,10 @@ Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. [connection master] drop table if exists t; +show variables like 'tokudb_rpl_unique_checks%'; +Variable_name Value +tokudb_rpl_unique_checks OFF +tokudb_rpl_unique_checks_delay 5000 create table t (a bigint not null, primary key(a)) engine=tokudb; select unix_timestamp() into @tstart; insert into t values (1); diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_write_pk_uc1.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_write_pk_uc1.result index 0b5ac77481f..c846ec81612 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_write_pk_uc1.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_write_pk_uc1.result @@ -4,6 +4,10 @@ Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. [connection master] drop table if exists t; +show variables like 'tokudb_rpl_unique_checks%'; +Variable_name Value +tokudb_rpl_unique_checks ON +tokudb_rpl_unique_checks_delay 10000 create table t (a bigint not null, primary key(a)) engine=tokudb; select unix_timestamp() into @tstart; insert into t values (1); diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_write_unique.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_write_unique.result index 60ffc0d0530..808303387d5 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_write_unique.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_write_unique.result @@ -4,6 +4,10 @@ Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. [connection master] drop table if exists t; +show variables like 'tokudb_rpl_unique_checks%'; +Variable_name Value +tokudb_rpl_unique_checks OFF +tokudb_rpl_unique_checks_delay 5000 create table t (a bigint not null, b bigint not null, primary key(a), unique key(b)) engine=tokudb; select unix_timestamp() into @tstart; insert into t values (1,2); diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_write_unique_uc1.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_write_unique_uc1.result index 2f2cf58032e..a40548cec62 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_write_unique_uc1.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_write_unique_uc1.result @@ -4,6 +4,10 @@ Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. [connection master] drop table if exists t; +show variables like 'tokudb_rpl_unique_checks%'; +Variable_name Value +tokudb_rpl_unique_checks ON +tokudb_rpl_unique_checks_delay 5000 create table t (a bigint not null, b bigint not null, primary key(a), unique key(b)) engine=tokudb; select unix_timestamp() into @tstart; insert into t values (1,2); diff --git a/storage/tokudb/mysql-test/rpl/t/disabled.def b/storage/tokudb/mysql-test/rpl/t/disabled.def new file mode 100644 index 00000000000..30bc9fea7c5 --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/t/disabled.def @@ -0,0 +1 @@ +rpl_row_sp002_tokudb : tokudb does not support foreign keys diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb.test b/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb.test index efb60fac2ba..23d2d6cdf51 100644 --- a/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb.test +++ b/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb.test @@ -1,3 +1,4 @@ +--source include/have_tokudb.inc #Want to skip this test from daily Valgrind execution --source include/no_valgrind_without_big.inc # diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_delete_pk-slave.opt b/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_delete_pk-slave.opt index 98240735800..0aa48174807 100644 --- a/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_delete_pk-slave.opt +++ b/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_delete_pk-slave.opt @@ -1,6 +1,5 @@ --read-only=ON ---tokudb-rpl-unique-checks-delay=10000 ---tokudb-rpl-unique-checks=OFF ---tokudb-rpl-lookup-rows-delay=10000 ---tokudb-rpl-lookup-rows=OFF - +--loose-tokudb-rpl-unique-checks-delay=10000 +--loose-tokudb-rpl-unique-checks=OFF +--loose-tokudb-rpl-lookup-rows-delay=10000 +--loose-tokudb-rpl-lookup-rows=OFF diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_delete_pk.test b/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_delete_pk.test index fb42f40bb62..bedeb9513be 100644 --- a/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_delete_pk.test +++ b/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_delete_pk.test @@ -14,7 +14,7 @@ enable_warnings; connection slave; # show variables like 'read_only'; -# show variables like 'tokudb_rpl_%'; +show variables like 'tokudb_rpl_%'; # insert some rows connection master; diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_update_pk_uc0_lookup0-slave.opt b/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_update_pk_uc0_lookup0-slave.opt index 8d0e95decb2..0aa48174807 100644 --- a/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_update_pk_uc0_lookup0-slave.opt +++ b/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_update_pk_uc0_lookup0-slave.opt @@ -1,5 +1,5 @@ --read-only=ON ---tokudb-rpl-unique-checks-delay=10000 ---tokudb-rpl-unique-checks=OFF ---tokudb-rpl-lookup-rows-delay=10000 ---tokudb-rpl-lookup-rows=OFF +--loose-tokudb-rpl-unique-checks-delay=10000 +--loose-tokudb-rpl-unique-checks=OFF +--loose-tokudb-rpl-lookup-rows-delay=10000 +--loose-tokudb-rpl-lookup-rows=OFF diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_update_pk_uc0_lookup0.test b/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_update_pk_uc0_lookup0.test index 62e123d5a04..d6ccf2487ae 100644 --- a/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_update_pk_uc0_lookup0.test +++ b/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_update_pk_uc0_lookup0.test @@ -13,7 +13,7 @@ enable_warnings; connection slave; # show variables like 'read_only'; -# show variables like 'tokudb_rpl_%'; +show variables like 'tokudb_rpl_%'; # insert some rows connection master; diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_write_pk-slave.opt b/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_write_pk-slave.opt index c11308c89bf..7f49776e4e8 100644 --- a/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_write_pk-slave.opt +++ b/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_write_pk-slave.opt @@ -1,3 +1,3 @@ --read-only=ON ---tokudb-rpl-unique-checks-delay=5000 ---tokudb-rpl-unique-checks=OFF +--loose-tokudb-rpl-unique-checks-delay=5000 +--loose-tokudb-rpl-unique-checks=OFF diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_write_pk.test b/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_write_pk.test index bd27ceb2c2b..db96ac321c0 100644 --- a/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_write_pk.test +++ b/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_write_pk.test @@ -14,7 +14,7 @@ enable_warnings; connection slave; # show variables like 'read_only'; -# show variables like 'tokudb_rpl_unique_checks%'; +show variables like 'tokudb_rpl_unique_checks%'; # insert some rows connection master; diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_delete_pk-slave.opt b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_delete_pk-slave.opt index dc139282dc4..93a2685e847 100644 --- a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_delete_pk-slave.opt +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_delete_pk-slave.opt @@ -1 +1 @@ ---read-only=ON --tokudb-rpl-unique-checks-delay=10000 --tokudb-rpl-unique-checks=OFF --tokudb-rpl-lookup-rows-delay=10000 --tokudb-rpl-lookup-rows=OFF +--read-only=ON --loose-tokudb-rpl-unique-checks-delay=10000 --loose-tokudb-rpl-unique-checks=OFF --loose-tokudb-rpl-lookup-rows-delay=10000 --loose-tokudb-rpl-lookup-rows=OFF diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_delete_pk.test b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_delete_pk.test index fb42f40bb62..bedeb9513be 100644 --- a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_delete_pk.test +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_delete_pk.test @@ -14,7 +14,7 @@ enable_warnings; connection slave; # show variables like 'read_only'; -# show variables like 'tokudb_rpl_%'; +show variables like 'tokudb_rpl_%'; # insert some rows connection master; diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_delete_pk_lookup1-slave.opt b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_delete_pk_lookup1-slave.opt index 4675b07763d..9a2fec628f9 100644 --- a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_delete_pk_lookup1-slave.opt +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_delete_pk_lookup1-slave.opt @@ -1 +1 @@ ---read-only=ON --tokudb-rpl-unique-checks-delay=0 --tokudb-rpl-unique-checks=ON --tokudb-rpl-lookup-rows-delay=10000 --tokudb-rpl-lookup-rows=ON +--read-only=ON --loose-tokudb-rpl-unique-checks-delay=0 --loose-tokudb-rpl-unique-checks=ON --loose-tokudb-rpl-lookup-rows-delay=10000 --loose-tokudb-rpl-lookup-rows=ON diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_delete_pk_lookup1.test b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_delete_pk_lookup1.test index bf5edbd2c1b..9e9aaede416 100644 --- a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_delete_pk_lookup1.test +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_delete_pk_lookup1.test @@ -15,7 +15,7 @@ enable_warnings; connection slave; # show variables like 'read_only'; -# show variables like 'tokudb_rpl_%'; +show variables like 'tokudb_rpl_%'; # insert some rows connection master; diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_mixed_dml-master.opt b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_mixed_dml-master.opt deleted file mode 100644 index fd3de58d816..00000000000 --- a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_mixed_dml-master.opt +++ /dev/null @@ -1,2 +0,0 @@ ---tokudb_pk_insert_mode=2 - diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_mixed_dml.test b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_mixed_dml.test index c27625abd7f..6147d321784 100644 --- a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_mixed_dml.test +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_mixed_dml.test @@ -6,4 +6,7 @@ --source include/have_binlog_format_mixed.inc --source include/have_tokudb.inc let $engine_type=TokuDB; + +SET SESSION tokudb_pk_insert_mode = 2; + --source suite/rpl/include/rpl_mixed_dml.inc diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_read_only_ff-slave.opt b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_read_only_ff-slave.opt index b9eb687d8d5..0240c9d6ae4 100644 --- a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_read_only_ff-slave.opt +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_read_only_ff-slave.opt @@ -1 +1 @@ ---read-only=OFF --tokudb-rpl-check-readonly=OFF --tokudb-rpl-unique-checks-delay=5000 --tokudb-rpl-unique-checks=OFF +--read-only=OFF --loose-tokudb-rpl-check-readonly=OFF --loose-tokudb-rpl-unique-checks-delay=5000 --loose-tokudb-rpl-unique-checks=OFF diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_read_only_ff.test b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_read_only_ff.test index c77e4b49605..7b3e8f0c0d3 100644 --- a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_read_only_ff.test +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_read_only_ff.test @@ -14,7 +14,7 @@ enable_warnings; connection slave; # show variables like 'read_only'; -# show variables like 'tokudb_rpl_unique_checks%'; +show variables like 'tokudb_rpl%'; # insert some rows connection master; diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_read_only_ft-slave.opt b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_read_only_ft-slave.opt index 8283875e8a7..e1ee193d4c1 100644 --- a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_read_only_ft-slave.opt +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_read_only_ft-slave.opt @@ -1 +1 @@ ---read-only=OFF --tokudb-rpl-check-readonly=ON --tokudb-rpl-unique-checks-delay=5000 --tokudb-rpl-unique-checks=OFF +--read-only=OFF --loose-tokudb-rpl-check-readonly=ON --loose-tokudb-rpl-unique-checks-delay=5000 --loose-tokudb-rpl-unique-checks=OFF diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_read_only_ft.test b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_read_only_ft.test index c77e4b49605..7b3e8f0c0d3 100644 --- a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_read_only_ft.test +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_read_only_ft.test @@ -14,7 +14,7 @@ enable_warnings; connection slave; # show variables like 'read_only'; -# show variables like 'tokudb_rpl_unique_checks%'; +show variables like 'tokudb_rpl%'; # insert some rows connection master; diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_read_only_tf-slave.opt b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_read_only_tf-slave.opt index 21e57d27c17..e60afd0380a 100644 --- a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_read_only_tf-slave.opt +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_read_only_tf-slave.opt @@ -1 +1 @@ ---read-only=ON --tokudb-rpl-check-readonly=OFF --tokudb-rpl-unique-checks-delay=5000 --tokudb-rpl-unique-checks=OFF +--read-only=ON --loose-tokudb-rpl-check-readonly=OFF --loose-tokudb-rpl-unique-checks-delay=5000 --loose-tokudb-rpl-unique-checks=OFF diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_read_only_tf.test b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_read_only_tf.test index c77e4b49605..7b3e8f0c0d3 100644 --- a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_read_only_tf.test +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_read_only_tf.test @@ -14,7 +14,7 @@ enable_warnings; connection slave; # show variables like 'read_only'; -# show variables like 'tokudb_rpl_unique_checks%'; +show variables like 'tokudb_rpl%'; # insert some rows connection master; diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_read_only_tt-slave.opt b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_read_only_tt-slave.opt index fd77ee0da9c..f6658646e65 100644 --- a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_read_only_tt-slave.opt +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_read_only_tt-slave.opt @@ -1 +1 @@ ---read-only=ON --tokudb-rpl-check-readonly=ON --tokudb-rpl-unique-checks-delay=5000 --tokudb-rpl-unique-checks=OFF +--read-only=ON --loose-tokudb-rpl-check-readonly=ON --loose-tokudb-rpl-unique-checks-delay=5000 --loose-tokudb-rpl-unique-checks=OFF diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_read_only_tt.test b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_read_only_tt.test index c77e4b49605..7b3e8f0c0d3 100644 --- a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_read_only_tt.test +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_read_only_tt.test @@ -14,7 +14,7 @@ enable_warnings; connection slave; # show variables like 'read_only'; -# show variables like 'tokudb_rpl_unique_checks%'; +show variables like 'tokudb_rpl%'; # insert some rows connection master; diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc0_lookup0-slave.opt b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc0_lookup0-slave.opt index dc139282dc4..93a2685e847 100644 --- a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc0_lookup0-slave.opt +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc0_lookup0-slave.opt @@ -1 +1 @@ ---read-only=ON --tokudb-rpl-unique-checks-delay=10000 --tokudb-rpl-unique-checks=OFF --tokudb-rpl-lookup-rows-delay=10000 --tokudb-rpl-lookup-rows=OFF +--read-only=ON --loose-tokudb-rpl-unique-checks-delay=10000 --loose-tokudb-rpl-unique-checks=OFF --loose-tokudb-rpl-lookup-rows-delay=10000 --loose-tokudb-rpl-lookup-rows=OFF diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc0_lookup0.test b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc0_lookup0.test index 998987349c7..6dd9b660eed 100644 --- a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc0_lookup0.test +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc0_lookup0.test @@ -13,7 +13,7 @@ enable_warnings; connection slave; # show variables like 'read_only'; -# show variables like 'tokudb_rpl_%'; +show variables like 'tokudb_rpl_%'; # insert some rows connection master; diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc0_lookup1-slave.opt b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc0_lookup1-slave.opt index d546dd00669..a4ca1104425 100644 --- a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc0_lookup1-slave.opt +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc0_lookup1-slave.opt @@ -1 +1 @@ ---read-only=ON --tokudb-rpl-unique-checks-delay=10000 --tokudb-rpl-unique-checks=OFF --tokudb-rpl-lookup-rows-delay=10000 --tokudb-rpl-lookup-rows=ON +--read-only=ON --loose-tokudb-rpl-unique-checks-delay=10000 --loose-tokudb-rpl-unique-checks=OFF --loose-tokudb-rpl-lookup-rows-delay=10000 --loose-tokudb-rpl-lookup-rows=ON diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc0_lookup1.test b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc0_lookup1.test index 998987349c7..6dd9b660eed 100644 --- a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc0_lookup1.test +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc0_lookup1.test @@ -13,7 +13,7 @@ enable_warnings; connection slave; # show variables like 'read_only'; -# show variables like 'tokudb_rpl_%'; +show variables like 'tokudb_rpl_%'; # insert some rows connection master; diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc1_lookup0-slave.opt b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc1_lookup0-slave.opt index 5cfe5f83a91..4b1d21daf5f 100644 --- a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc1_lookup0-slave.opt +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc1_lookup0-slave.opt @@ -1 +1 @@ ---read-only=ON --tokudb-rpl-unique-checks-delay=10000 --tokudb-rpl-unique-checks=ON --tokudb-rpl-lookup-rows-delay=10000 --tokudb-rpl-lookup-rows=OFF +--read-only=ON --loose-tokudb-rpl-unique-checks-delay=10000 --loose-tokudb-rpl-unique-checks=ON --loose-tokudb-rpl-lookup-rows-delay=10000 --loose-tokudb-rpl-lookup-rows=OFF diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc1_lookup0.test b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc1_lookup0.test index 998987349c7..6dd9b660eed 100644 --- a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc1_lookup0.test +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc1_lookup0.test @@ -13,7 +13,7 @@ enable_warnings; connection slave; # show variables like 'read_only'; -# show variables like 'tokudb_rpl_%'; +show variables like 'tokudb_rpl_%'; # insert some rows connection master; diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc1_lookup1-slave.opt b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc1_lookup1-slave.opt index 7cd575c52bb..239e19ac040 100644 --- a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc1_lookup1-slave.opt +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc1_lookup1-slave.opt @@ -1 +1 @@ ---read-only=ON --tokudb-rpl-unique-checks-delay=10000 --tokudb-rpl-unique-checks=ON --tokudb-rpl-lookup-rows-delay=10000 --tokudb-rpl-lookup-rows=ON +--read-only=ON --loose-tokudb-rpl-unique-checks-delay=10000 --loose-tokudb-rpl-unique-checks=ON --loose-tokudb-rpl-lookup-rows-delay=10000 --loose-tokudb-rpl-lookup-rows=ON diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc1_lookup1.test b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc1_lookup1.test index 998987349c7..6dd9b660eed 100644 --- a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc1_lookup1.test +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_pk_uc1_lookup1.test @@ -13,7 +13,7 @@ enable_warnings; connection slave; # show variables like 'read_only'; -# show variables like 'tokudb_rpl_%'; +show variables like 'tokudb_rpl_%'; # insert some rows connection master; diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_unique_uc0_lookup0-slave.opt b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_unique_uc0_lookup0-slave.opt index dc139282dc4..93a2685e847 100644 --- a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_unique_uc0_lookup0-slave.opt +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_unique_uc0_lookup0-slave.opt @@ -1 +1 @@ ---read-only=ON --tokudb-rpl-unique-checks-delay=10000 --tokudb-rpl-unique-checks=OFF --tokudb-rpl-lookup-rows-delay=10000 --tokudb-rpl-lookup-rows=OFF +--read-only=ON --loose-tokudb-rpl-unique-checks-delay=10000 --loose-tokudb-rpl-unique-checks=OFF --loose-tokudb-rpl-lookup-rows-delay=10000 --loose-tokudb-rpl-lookup-rows=OFF diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_unique_uc0_lookup0.test b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_unique_uc0_lookup0.test index 11401ac0ce0..93fef3699d9 100644 --- a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_unique_uc0_lookup0.test +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_unique_uc0_lookup0.test @@ -13,7 +13,7 @@ enable_warnings; connection slave; # show variables like 'read_only'; -# show variables like 'tokudb_rpl_%'; +show variables like 'tokudb_rpl_%'; # insert some rows connection master; diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_unique_uc0_lookup1-slave.opt b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_unique_uc0_lookup1-slave.opt index d546dd00669..a4ca1104425 100644 --- a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_unique_uc0_lookup1-slave.opt +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_unique_uc0_lookup1-slave.opt @@ -1 +1 @@ ---read-only=ON --tokudb-rpl-unique-checks-delay=10000 --tokudb-rpl-unique-checks=OFF --tokudb-rpl-lookup-rows-delay=10000 --tokudb-rpl-lookup-rows=ON +--read-only=ON --loose-tokudb-rpl-unique-checks-delay=10000 --loose-tokudb-rpl-unique-checks=OFF --loose-tokudb-rpl-lookup-rows-delay=10000 --loose-tokudb-rpl-lookup-rows=ON diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_unique_uc0_lookup1.test b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_unique_uc0_lookup1.test index ea77447bc75..c8976db8ccd 100644 --- a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_unique_uc0_lookup1.test +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_update_unique_uc0_lookup1.test @@ -13,7 +13,7 @@ enable_warnings; connection slave; # show variables like 'read_only'; -# show variables like 'tokudb_rpl_%'; +show variables like 'tokudb_rpl_%'; # insert some rows connection master; diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_pk-slave.opt b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_pk-slave.opt index 9baf0d65ecf..19b40f86454 100644 --- a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_pk-slave.opt +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_pk-slave.opt @@ -1 +1 @@ ---read-only=ON --tokudb-rpl-unique-checks-delay=5000 --tokudb-rpl-unique-checks=OFF +--read-only=ON --loose-tokudb-rpl-unique-checks-delay=5000 --loose-tokudb-rpl-unique-checks=OFF diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_pk.test b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_pk.test index c77e4b49605..0ed12b34e1f 100644 --- a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_pk.test +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_pk.test @@ -14,7 +14,7 @@ enable_warnings; connection slave; # show variables like 'read_only'; -# show variables like 'tokudb_rpl_unique_checks%'; +show variables like 'tokudb_rpl_unique_checks%'; # insert some rows connection master; diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_pk_uc1-slave.opt b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_pk_uc1-slave.opt index b1df0b6daf0..646a9991753 100644 --- a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_pk_uc1-slave.opt +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_pk_uc1-slave.opt @@ -1 +1 @@ ---read-only=ON --tokudb-rpl-unique-checks-delay=10000 --tokudb-rpl-unique-checks=ON +--read-only=ON --loose-tokudb-rpl-unique-checks-delay=10000 --loose-tokudb-rpl-unique-checks=ON diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_pk_uc1.test b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_pk_uc1.test index c77e4b49605..0ed12b34e1f 100644 --- a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_pk_uc1.test +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_pk_uc1.test @@ -14,7 +14,7 @@ enable_warnings; connection slave; # show variables like 'read_only'; -# show variables like 'tokudb_rpl_unique_checks%'; +show variables like 'tokudb_rpl_unique_checks%'; # insert some rows connection master; diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_unique-slave.opt b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_unique-slave.opt index 9baf0d65ecf..19b40f86454 100644 --- a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_unique-slave.opt +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_unique-slave.opt @@ -1 +1 @@ ---read-only=ON --tokudb-rpl-unique-checks-delay=5000 --tokudb-rpl-unique-checks=OFF +--read-only=ON --loose-tokudb-rpl-unique-checks-delay=5000 --loose-tokudb-rpl-unique-checks=OFF diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_unique.test b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_unique.test index cf6a26b423d..fc4c9597dac 100644 --- a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_unique.test +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_unique.test @@ -14,7 +14,7 @@ enable_warnings; connection slave; # show variables like 'read_only'; -# show variables like 'tokudb_rpl_unique_checks%'; +show variables like 'tokudb_rpl_unique_checks%'; # insert some rows connection master; diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_unique_uc1-slave.opt b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_unique_uc1-slave.opt index 0518efd3da5..9139a370e57 100644 --- a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_unique_uc1-slave.opt +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_unique_uc1-slave.opt @@ -1 +1 @@ ---read-only=ON --tokudb-rpl-unique-checks-delay=5000 --tokudb-rpl-unique-checks=ON +--read-only=ON --loose-tokudb-rpl-unique-checks-delay=5000 --loose-tokudb-rpl-unique-checks=ON diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_unique_uc1.test b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_unique_uc1.test index cf6a26b423d..fc4c9597dac 100644 --- a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_unique_uc1.test +++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_write_unique_uc1.test @@ -14,7 +14,7 @@ enable_warnings; connection slave; # show variables like 'read_only'; -# show variables like 'tokudb_rpl_unique_checks%'; +show variables like 'tokudb_rpl_unique_checks%'; # insert some rows connection master; diff --git a/storage/tokudb/mysql-test/rpl/t/suite.opt b/storage/tokudb/mysql-test/rpl/t/suite.opt new file mode 100644 index 00000000000..23511b05020 --- /dev/null +++ b/storage/tokudb/mysql-test/rpl/t/suite.opt @@ -0,0 +1 @@ +$TOKUDB_OPT $TOKUDB_LOAD_ADD --loose-tokudb-check-jemalloc=0 diff --git a/storage/tokudb/mysql-test/tokudb/disabled.def b/storage/tokudb/mysql-test/tokudb/disabled.def index 5b7afa1753e..c98a8aa622a 100644 --- a/storage/tokudb/mysql-test/tokudb/disabled.def +++ b/storage/tokudb/mysql-test/tokudb/disabled.def @@ -26,9 +26,5 @@ type_temporal_fractional: type_temporal_upgrade: type_timestamp_explicit: cluster_key_part: engine options on partitioned tables -#i_s_tokudb_lock_waits_released: unstable, race conditions -#i_s_tokudb_locks_released: unstable, race conditions -mvcc-19: tokutek -mvcc-20: tokutek -mvcc-27: tokutek -storage_engine_default: tokudb is not the default storage engine +i_s_tokudb_lock_waits_released: unstable, race conditions +i_s_tokudb_locks_released: unstable, race conditions diff --git a/storage/tokudb/mysql-test/tokudb/include/cluster_key.inc b/storage/tokudb/mysql-test/tokudb/include/cluster_key.inc new file mode 100644 index 00000000000..d637b46e8fc --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb/include/cluster_key.inc @@ -0,0 +1,138 @@ +# test for TokuDB clustering keys. +# test assumes that a table 't1' exists with the following columns: +# a int, b int, c int, d int +insert into t1 values (1,10,100,1000),(2,20,200,2000),(3,30,300,3000),(4,40,400,4000),(5,50,500,5000),(6,60,600,6000),(7,70,700,7000),(8,80,800,8000),(9,90,900,9000); + + +#normal queries + +# ignore rows column +--replace_column 9 NULL; +explain select * from t1 where a > 5; +select * from t1 where a > 5; + +# ignore rows column +--replace_column 9 NULL; +explain select * from t1 where b > 30; +select * from t1 where b > 30; + +# ignore rows column +--replace_column 9 NULL; +explain select * from t1 where c > 750; +select * from t1 where c > 750; + +#covering indexes + +# ignore rows column +--replace_column 9 NULL; +explain select a from t1 where a > 8; +select a from t1 where a > 8; + +# ignore rows column +--replace_column 9 NULL; +explain select a,b from t1 where b > 30; +select a,b from t1 where b > 30; + +# ignore rows column +--replace_column 9 NULL; +explain select a,b from t1 where c > 750; +select a,c from t1 where c > 750; + + +alter table t1 add index bdca(b,d,c,a) clustering=yes; +insert into t1 values (10,10,10,10); +alter table t1 drop index bdca; + +alter table t1 drop primary key; +# ignore rows column +--replace_column 9 NULL; +explain select * from t1 where a > 5; +select * from t1 where a > 5; + +# ignore rows column +--replace_column 9 NULL; +explain select * from t1 where b > 30; +select * from t1 where b > 30; + +# ignore rows column +--replace_column 9 NULL; +explain select * from t1 where c > 750; +select * from t1 where c > 750; + +#covering indexes + +# ignore rows column +--replace_column 9 NULL; +explain select b from t1 where b > 30; +select b from t1 where b > 30; + +# ignore rows column +--replace_column 9 NULL; +explain select b from t1 where c > 750; +select c from t1 where c > 750; + +alter table t1 add e varchar(20); + +alter table t1 add primary key (a,b,c); + +# ignore rows column +--replace_column 9 NULL; +explain select * from t1 where a > 5; +select * from t1 where a > 5; + +# ignore rows column +--replace_column 9 NULL; +explain select * from t1 where b > 30; +select * from t1 where b > 30; + +# ignore rows column +--replace_column 9 NULL; +explain select * from t1 where c > 750; +select * from t1 where c > 750; + +#covering indexes + +# ignore rows column +--replace_column 9 NULL; +explain select a from t1 where a > 8; +select a from t1 where a > 8; + +# ignore rows column +--replace_column 9 NULL; +explain select a,b from t1 where b > 30; +select a,b from t1 where b > 30; + +# ignore rows column +--replace_column 9 NULL; +explain select a,b from t1 where c > 750; +select a,c from t1 where c > 750; + + +alter table t1 drop primary key; +# ignore rows column +--replace_column 9 NULL; +explain select * from t1 where a > 5; +select * from t1 where a > 5; + +# ignore rows column +--replace_column 9 NULL; +explain select * from t1 where b > 30; +select * from t1 where b > 30; + +# ignore rows column +--replace_column 9 NULL; +explain select * from t1 where c > 750; +select * from t1 where c > 750; + +#covering indexes +# ignore rows column +--replace_column 9 NULL; +explain select b from t1 where b > 30; +select b from t1 where b > 30; + +# ignore rows column +--replace_column 9 NULL; +explain select b from t1 where c > 750; +select c from t1 where c > 750; + + diff --git a/storage/tokudb/mysql-test/tokudb/r/background_job_manager.result b/storage/tokudb/mysql-test/tokudb/r/background_job_manager.result new file mode 100644 index 00000000000..9d813eca8e9 --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb/r/background_job_manager.result @@ -0,0 +1,122 @@ +set @orig_auto_analyze = @@session.tokudb_auto_analyze; +set @orig_in_background = @@session.tokudb_analyze_in_background; +set @orig_mode = @@session.tokudb_analyze_mode; +set @orig_throttle = @@session.tokudb_analyze_throttle; +set @orig_time = @@session.tokudb_analyze_time; +set @orig_scale_percent = @@global.tokudb_cardinality_scale_percent; +set @orig_default_storage_engine = @@session.default_storage_engine; +set @orig_pause_background_job_manager = @@global.tokudb_debug_pause_background_job_manager; +set session default_storage_engine='tokudb'; +set session tokudb_auto_analyze=1; +set session tokudb_analyze_in_background=1; +set session tokudb_analyze_mode=tokudb_analyze_standard; +set session tokudb_analyze_throttle=0; +set session tokudb_analyze_time=0; +set global tokudb_cardinality_scale_percent=DEFAULT; +set global tokudb_debug_pause_background_job_manager=TRUE; +show create table information_schema.tokudb_background_job_status; +Table Create Table +TokuDB_background_job_status CREATE TEMPORARY TABLE `TokuDB_background_job_status` ( + `id` bigint(0) NOT NULL DEFAULT 0, + `database_name` varchar(256) NOT NULL DEFAULT '', + `table_name` varchar(256) NOT NULL DEFAULT '', + `job_type` varchar(256) NOT NULL DEFAULT '', + `job_params` varchar(256) NOT NULL DEFAULT '', + `scheduler` varchar(32) NOT NULL DEFAULT '', + `scheduled_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `started_time` datetime DEFAULT NULL, + `status` varchar(256) DEFAULT NULL +) ENGINE=MEMORY DEFAULT CHARSET=utf8 +create table t1 (a int not null auto_increment, b int, c int, primary key(a), key kb(b), key kc(c), key kabc(a,b,c), key kab(a,b), key kbc(b,c)); +insert into t1(b,c) values(0,0), (1,1), (2,2), (3,3); +select database_name, table_name, job_type, job_params, scheduler from information_schema.tokudb_background_job_status; +database_name table_name job_type job_params scheduler +test t1 TOKUDB_ANALYZE_MODE_STANDARD TOKUDB_ANALYZE_DELETE_FRACTION=1.000000; TOKUDB_ANALYZE_TIME=0; TOKUDB_ANALYZE_THROTTLE=0; AUTO +create table t2 like t1; +create table t3 like t1; +create table t4 like t1; +analyze table t1; +Table Op Msg_type Msg_text +test.t1 analyze status Operation failed +analyze table t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +analyze table t3; +Table Op Msg_type Msg_text +test.t3 analyze status OK +analyze table t4; +Table Op Msg_type Msg_text +test.t4 analyze status OK +select database_name, table_name, job_type, job_params, scheduler from information_schema.tokudb_background_job_status; +database_name table_name job_type job_params scheduler +test t1 TOKUDB_ANALYZE_MODE_STANDARD TOKUDB_ANALYZE_DELETE_FRACTION=1.000000; TOKUDB_ANALYZE_TIME=0; TOKUDB_ANALYZE_THROTTLE=0; AUTO +test t2 TOKUDB_ANALYZE_MODE_STANDARD TOKUDB_ANALYZE_DELETE_FRACTION=1.000000; TOKUDB_ANALYZE_TIME=0; TOKUDB_ANALYZE_THROTTLE=0; USER +test t3 TOKUDB_ANALYZE_MODE_STANDARD TOKUDB_ANALYZE_DELETE_FRACTION=1.000000; TOKUDB_ANALYZE_TIME=0; TOKUDB_ANALYZE_THROTTLE=0; USER +test t4 TOKUDB_ANALYZE_MODE_STANDARD TOKUDB_ANALYZE_DELETE_FRACTION=1.000000; TOKUDB_ANALYZE_TIME=0; TOKUDB_ANALYZE_THROTTLE=0; USER +set global tokudb_debug_pause_background_job_manager=FALSE; +set global tokudb_debug_pause_background_job_manager=TRUE; +analyze table t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +analyze table t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +analyze table t3; +Table Op Msg_type Msg_text +test.t3 analyze status OK +analyze table t4; +Table Op Msg_type Msg_text +test.t4 analyze status OK +select database_name, table_name, job_type, job_params, scheduler from information_schema.tokudb_background_job_status; +database_name table_name job_type job_params scheduler +test t1 TOKUDB_ANALYZE_MODE_STANDARD TOKUDB_ANALYZE_DELETE_FRACTION=1.000000; TOKUDB_ANALYZE_TIME=0; TOKUDB_ANALYZE_THROTTLE=0; USER +test t2 TOKUDB_ANALYZE_MODE_STANDARD TOKUDB_ANALYZE_DELETE_FRACTION=1.000000; TOKUDB_ANALYZE_TIME=0; TOKUDB_ANALYZE_THROTTLE=0; USER +test t3 TOKUDB_ANALYZE_MODE_STANDARD TOKUDB_ANALYZE_DELETE_FRACTION=1.000000; TOKUDB_ANALYZE_TIME=0; TOKUDB_ANALYZE_THROTTLE=0; USER +test t4 TOKUDB_ANALYZE_MODE_STANDARD TOKUDB_ANALYZE_DELETE_FRACTION=1.000000; TOKUDB_ANALYZE_TIME=0; TOKUDB_ANALYZE_THROTTLE=0; USER +alter table t1 add column d int; +select database_name, table_name, job_type, job_params, scheduler from information_schema.tokudb_background_job_status; +database_name table_name job_type job_params scheduler +test t2 TOKUDB_ANALYZE_MODE_STANDARD TOKUDB_ANALYZE_DELETE_FRACTION=1.000000; TOKUDB_ANALYZE_TIME=0; TOKUDB_ANALYZE_THROTTLE=0; USER +test t3 TOKUDB_ANALYZE_MODE_STANDARD TOKUDB_ANALYZE_DELETE_FRACTION=1.000000; TOKUDB_ANALYZE_TIME=0; TOKUDB_ANALYZE_THROTTLE=0; USER +test t4 TOKUDB_ANALYZE_MODE_STANDARD TOKUDB_ANALYZE_DELETE_FRACTION=1.000000; TOKUDB_ANALYZE_TIME=0; TOKUDB_ANALYZE_THROTTLE=0; USER +set session tokudb_analyze_mode=tokudb_analyze_cancel; +analyze table t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +select database_name, table_name, job_type, job_params, scheduler from information_schema.tokudb_background_job_status; +database_name table_name job_type job_params scheduler +test t3 TOKUDB_ANALYZE_MODE_STANDARD TOKUDB_ANALYZE_DELETE_FRACTION=1.000000; TOKUDB_ANALYZE_TIME=0; TOKUDB_ANALYZE_THROTTLE=0; USER +test t4 TOKUDB_ANALYZE_MODE_STANDARD TOKUDB_ANALYZE_DELETE_FRACTION=1.000000; TOKUDB_ANALYZE_TIME=0; TOKUDB_ANALYZE_THROTTLE=0; USER +set session tokudb_analyze_mode=tokudb_analyze_recount_rows; +analyze table t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +select database_name, table_name, job_type, job_params, scheduler from information_schema.tokudb_background_job_status; +database_name table_name job_type job_params scheduler +test t3 TOKUDB_ANALYZE_MODE_STANDARD TOKUDB_ANALYZE_DELETE_FRACTION=1.000000; TOKUDB_ANALYZE_TIME=0; TOKUDB_ANALYZE_THROTTLE=0; USER +test t4 TOKUDB_ANALYZE_MODE_STANDARD TOKUDB_ANALYZE_DELETE_FRACTION=1.000000; TOKUDB_ANALYZE_TIME=0; TOKUDB_ANALYZE_THROTTLE=0; USER +test t1 TOKUDB_ANALYZE_MODE_RECOUNT_ROWS TOKUDB_ANALYZE_THROTTLE=0; USER +set session tokudb_analyze_mode=tokudb_analyze_standard; +set session tokudb_analyze_in_background=0; +analyze table t3; +Table Op Msg_type Msg_text +test.t3 analyze status OK +select database_name, table_name, job_type, job_params, scheduler from information_schema.tokudb_background_job_status; +database_name table_name job_type job_params scheduler +test t4 TOKUDB_ANALYZE_MODE_STANDARD TOKUDB_ANALYZE_DELETE_FRACTION=1.000000; TOKUDB_ANALYZE_TIME=0; TOKUDB_ANALYZE_THROTTLE=0; USER +test t1 TOKUDB_ANALYZE_MODE_RECOUNT_ROWS TOKUDB_ANALYZE_THROTTLE=0; USER +drop table t1; +drop table t2; +drop table t3; +drop table t4; +select database_name, table_name, job_type, job_params, scheduler from information_schema.tokudb_background_job_status; +database_name table_name job_type job_params scheduler +set global tokudb_debug_pause_background_job_manager=FALSE; +set session tokudb_auto_analyze = @orig_auto_analyze; +set session tokudb_analyze_in_background = @orig_in_background; +set session tokudb_analyze_mode = @orig_mode; +set session tokudb_analyze_throttle = @orig_throttle; +set session tokudb_analyze_time = @orig_time; +set global tokudb_cardinality_scale_percent = @orig_scale_percent; +set session default_storage_engine = @orig_default_storage_engine; +set global tokudb_debug_pause_background_job_manager = @orig_pause_background_job_manager; diff --git a/storage/tokudb/mysql-test/tokudb/r/card_add_drop.result b/storage/tokudb/mysql-test/tokudb/r/card_add_drop.result index 431f0200a7a..71a39eb1f3e 100644 --- a/storage/tokudb/mysql-test/tokudb/r/card_add_drop.result +++ b/storage/tokudb/mysql-test/tokudb/r/card_add_drop.result @@ -4,35 +4,35 @@ create table tt (a int, b int, c int, d int, key(a), key(b), key(c)); insert into tt values (0,0,0,0),(1,0,0,0),(2,0,1,0),(3,0,1,0); show indexes from tt; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment -tt 1 a 1 a A NULL NULL NULL YES BTREE -tt 1 b 1 b A NULL NULL NULL YES BTREE -tt 1 c 1 c A NULL NULL NULL YES BTREE +tt 1 a 1 a A 4 NULL NULL YES BTREE +tt 1 b 1 b A 4 NULL NULL YES BTREE +tt 1 c 1 c A 4 NULL NULL YES BTREE analyze table tt; Table Op Msg_type Msg_text test.tt analyze status OK show indexes from tt; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment tt 1 a 1 a A 4 NULL NULL YES BTREE -tt 1 b 1 b A 1 NULL NULL YES BTREE -tt 1 c 1 c A 2 NULL NULL YES BTREE +tt 1 b 1 b A 2 NULL NULL YES BTREE +tt 1 c 1 c A 4 NULL NULL YES BTREE alter table tt drop key b, add key (d); show indexes from tt; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment tt 1 a 1 a A 4 NULL NULL YES BTREE -tt 1 c 1 c A 2 NULL NULL YES BTREE -tt 1 d 1 d A NULL NULL NULL YES BTREE +tt 1 c 1 c A 4 NULL NULL YES BTREE +tt 1 d 1 d A 4 NULL NULL YES BTREE analyze table tt; Table Op Msg_type Msg_text test.tt analyze status OK show indexes from tt; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment tt 1 a 1 a A 4 NULL NULL YES BTREE -tt 1 c 1 c A 2 NULL NULL YES BTREE -tt 1 d 1 d A 1 NULL NULL YES BTREE +tt 1 c 1 c A 4 NULL NULL YES BTREE +tt 1 d 1 d A 2 NULL NULL YES BTREE flush tables; show indexes from tt; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment tt 1 a 1 a A 4 NULL NULL YES BTREE -tt 1 c 1 c A 2 NULL NULL YES BTREE -tt 1 d 1 d A 1 NULL NULL YES BTREE +tt 1 c 1 c A 4 NULL NULL YES BTREE +tt 1 d 1 d A 2 NULL NULL YES BTREE drop table tt; diff --git a/storage/tokudb/mysql-test/tokudb/r/card_add_index.result b/storage/tokudb/mysql-test/tokudb/r/card_add_index.result index f5ba5b58bed..9a929b19a80 100644 --- a/storage/tokudb/mysql-test/tokudb/r/card_add_index.result +++ b/storage/tokudb/mysql-test/tokudb/r/card_add_index.result @@ -15,32 +15,32 @@ alter table tt add key (b); show indexes from tt; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment tt 0 PRIMARY 1 a A 4 NULL NULL BTREE -tt 1 b 1 b A NULL NULL NULL YES BTREE +tt 1 b 1 b A 4 NULL NULL YES BTREE analyze table tt; Table Op Msg_type Msg_text test.tt analyze status OK show indexes from tt; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment tt 0 PRIMARY 1 a A 4 NULL NULL BTREE -tt 1 b 1 b A 1 NULL NULL YES BTREE +tt 1 b 1 b A 2 NULL NULL YES BTREE alter table tt add key (c); show indexes from tt; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment tt 0 PRIMARY 1 a A 4 NULL NULL BTREE -tt 1 b 1 b A 1 NULL NULL YES BTREE -tt 1 c 1 c A NULL NULL NULL YES BTREE +tt 1 b 1 b A 2 NULL NULL YES BTREE +tt 1 c 1 c A 4 NULL NULL YES BTREE analyze table tt; Table Op Msg_type Msg_text test.tt analyze status OK show indexes from tt; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment tt 0 PRIMARY 1 a A 4 NULL NULL BTREE -tt 1 b 1 b A 1 NULL NULL YES BTREE -tt 1 c 1 c A 2 NULL NULL YES BTREE +tt 1 b 1 b A 2 NULL NULL YES BTREE +tt 1 c 1 c A 4 NULL NULL YES BTREE flush tables; show indexes from tt; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment tt 0 PRIMARY 1 a A 4 NULL NULL BTREE -tt 1 b 1 b A 1 NULL NULL YES BTREE -tt 1 c 1 c A 2 NULL NULL YES BTREE +tt 1 b 1 b A 2 NULL NULL YES BTREE +tt 1 c 1 c A 4 NULL NULL YES BTREE drop table tt; diff --git a/storage/tokudb/mysql-test/tokudb/r/card_auto_analyze_lots.result b/storage/tokudb/mysql-test/tokudb/r/card_auto_analyze_lots.result new file mode 100644 index 00000000000..662ffbade25 --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb/r/card_auto_analyze_lots.result @@ -0,0 +1,805 @@ +SHOW INDEX FROM ar_200; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_200 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_200 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_199; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_199 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_199 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_198; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_198 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_198 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_197; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_197 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_197 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_196; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_196 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_196 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_195; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_195 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_195 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_194; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_194 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_194 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_193; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_193 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_193 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_192; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_192 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_192 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_191; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_191 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_191 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_190; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_190 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_190 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_189; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_189 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_189 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_188; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_188 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_188 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_187; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_187 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_187 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_186; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_186 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_186 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_185; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_185 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_185 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_184; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_184 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_184 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_183; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_183 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_183 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_182; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_182 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_182 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_181; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_181 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_181 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_180; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_180 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_180 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_179; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_179 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_179 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_178; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_178 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_178 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_177; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_177 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_177 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_176; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_176 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_176 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_175; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_175 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_175 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_174; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_174 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_174 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_173; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_173 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_173 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_172; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_172 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_172 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_171; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_171 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_171 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_170; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_170 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_170 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_169; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_169 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_169 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_168; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_168 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_168 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_167; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_167 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_167 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_166; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_166 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_166 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_165; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_165 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_165 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_164; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_164 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_164 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_163; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_163 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_163 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_162; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_162 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_162 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_161; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_161 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_161 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_160; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_160 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_160 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_159; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_159 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_159 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_158; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_158 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_158 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_157; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_157 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_157 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_156; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_156 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_156 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_155; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_155 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_155 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_154; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_154 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_154 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_153; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_153 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_153 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_152; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_152 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_152 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_151; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_151 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_151 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_150; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_150 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_150 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_149; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_149 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_149 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_148; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_148 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_148 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_147; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_147 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_147 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_146; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_146 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_146 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_145; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_145 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_145 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_144; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_144 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_144 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_143; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_143 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_143 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_142; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_142 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_142 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_141; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_141 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_141 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_140; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_140 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_140 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_139; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_139 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_139 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_138; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_138 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_138 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_137; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_137 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_137 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_136; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_136 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_136 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_135; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_135 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_135 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_134; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_134 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_134 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_133; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_133 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_133 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_132; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_132 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_132 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_131; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_131 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_131 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_130; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_130 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_130 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_129; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_129 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_129 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_128; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_128 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_128 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_127; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_127 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_127 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_126; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_126 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_126 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_125; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_125 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_125 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_124; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_124 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_124 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_123; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_123 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_123 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_122; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_122 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_122 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_121; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_121 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_121 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_120; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_120 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_120 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_119; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_119 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_119 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_118; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_118 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_118 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_117; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_117 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_117 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_116; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_116 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_116 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_115; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_115 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_115 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_114; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_114 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_114 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_113; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_113 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_113 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_112; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_112 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_112 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_111; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_111 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_111 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_110; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_110 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_110 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_109; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_109 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_109 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_108; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_108 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_108 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_107; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_107 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_107 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_106; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_106 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_106 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_105; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_105 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_105 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_104; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_104 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_104 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_103; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_103 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_103 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_102; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_102 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_102 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_101; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_101 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_101 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_100; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_100 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_100 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_99; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_99 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_99 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_98; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_98 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_98 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_97; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_97 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_97 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_96; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_96 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_96 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_95; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_95 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_95 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_94; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_94 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_94 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_93; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_93 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_93 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_92; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_92 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_92 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_91; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_91 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_91 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_90; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_90 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_90 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_89; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_89 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_89 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_88; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_88 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_88 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_87; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_87 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_87 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_86; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_86 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_86 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_85; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_85 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_85 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_84; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_84 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_84 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_83; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_83 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_83 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_82; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_82 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_82 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_81; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_81 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_81 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_80; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_80 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_80 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_79; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_79 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_79 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_78; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_78 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_78 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_77; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_77 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_77 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_76; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_76 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_76 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_75; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_75 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_75 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_74; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_74 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_74 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_73; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_73 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_73 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_72; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_72 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_72 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_71; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_71 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_71 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_70; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_70 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_70 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_69; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_69 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_69 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_68; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_68 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_68 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_67; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_67 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_67 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_66; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_66 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_66 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_65; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_65 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_65 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_64; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_64 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_64 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_63; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_63 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_63 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_62; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_62 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_62 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_61; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_61 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_61 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_60; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_60 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_60 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_59; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_59 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_59 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_58; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_58 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_58 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_57; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_57 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_57 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_56; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_56 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_56 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_55; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_55 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_55 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_54; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_54 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_54 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_53; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_53 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_53 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_52; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_52 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_52 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_51; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_51 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_51 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_50; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_50 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_50 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_49; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_49 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_49 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_48; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_48 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_48 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_47; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_47 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_47 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_46; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_46 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_46 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_45; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_45 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_45 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_44; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_44 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_44 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_43; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_43 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_43 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_42; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_42 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_42 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_41; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_41 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_41 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_40; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_40 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_40 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_39; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_39 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_39 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_38; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_38 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_38 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_37; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_37 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_37 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_36; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_36 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_36 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_35; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_35 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_35 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_34; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_34 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_34 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_33; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_33 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_33 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_32; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_32 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_32 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_31; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_31 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_31 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_30; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_30 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_30 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_29; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_29 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_29 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_28; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_28 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_28 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_27; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_27 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_27 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_26; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_26 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_26 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_25; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_25 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_25 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_24; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_24 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_24 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_23; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_23 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_23 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_22; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_22 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_22 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_21; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_21 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_21 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_20; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_20 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_20 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_19; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_19 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_19 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_18; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_18 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_18 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_17; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_17 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_17 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_16; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_16 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_16 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_15; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_15 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_15 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_14; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_14 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_14 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_13; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_13 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_13 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_12; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_12 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_12 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_11; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_11 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_11 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_10; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_10 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_10 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_9; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_9 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_9 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_8; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_8 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_8 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_7; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_7 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_7 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_6; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_6 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_6 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_5; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_5 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_5 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_4; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_4 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_4 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_3; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_3 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_3 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_2; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_2 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_2 1 bkey 1 b A 1 NULL NULL YES BTREE +SHOW INDEX FROM ar_1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +ar_1 0 PRIMARY 1 a A 1 NULL NULL BTREE +ar_1 1 bkey 1 b A 1 NULL NULL YES BTREE +SET SESSION tokudb_auto_analyze = @orig_auto_analyze; +SET SESSION tokudb_analyze_in_background = @orig_in_background; +SET SESSION tokudb_analyze_mode = @orig_mode; +SET SESSION tokudb_analyze_throttle = @orig_throttle; +SET SESSION tokudb_analyze_time = @orig_time; diff --git a/storage/tokudb/mysql-test/tokudb/r/card_drop_index.result b/storage/tokudb/mysql-test/tokudb/r/card_drop_index.result index 9fc8fb6a6b8..2cfdfe11296 100644 --- a/storage/tokudb/mysql-test/tokudb/r/card_drop_index.result +++ b/storage/tokudb/mysql-test/tokudb/r/card_drop_index.result @@ -5,21 +5,21 @@ insert into tt values (1,0,0),(2,0,0),(3,0,1),(4,0,1); show indexes from tt; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment tt 0 PRIMARY 1 a A 4 NULL NULL BTREE -tt 1 b 1 b A NULL NULL NULL YES BTREE -tt 1 c 1 c A NULL NULL NULL YES BTREE +tt 1 b 1 b A 4 NULL NULL YES BTREE +tt 1 c 1 c A 4 NULL NULL YES BTREE analyze table tt; Table Op Msg_type Msg_text test.tt analyze status OK show indexes from tt; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment tt 0 PRIMARY 1 a A 4 NULL NULL BTREE -tt 1 b 1 b A 1 NULL NULL YES BTREE -tt 1 c 1 c A 2 NULL NULL YES BTREE +tt 1 b 1 b A 2 NULL NULL YES BTREE +tt 1 c 1 c A 4 NULL NULL YES BTREE alter table tt drop key b; show indexes from tt; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment tt 0 PRIMARY 1 a A 4 NULL NULL BTREE -tt 1 c 1 c A 2 NULL NULL YES BTREE +tt 1 c 1 c A 4 NULL NULL YES BTREE alter table tt drop key c; show indexes from tt; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment diff --git a/storage/tokudb/mysql-test/tokudb/r/card_drop_index_2.result b/storage/tokudb/mysql-test/tokudb/r/card_drop_index_2.result index 4103a37a6ed..ed28d2a3226 100644 --- a/storage/tokudb/mysql-test/tokudb/r/card_drop_index_2.result +++ b/storage/tokudb/mysql-test/tokudb/r/card_drop_index_2.result @@ -132,21 +132,21 @@ count(*) show indexes from tt; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment tt 0 PRIMARY 1 a A 500 NULL NULL BTREE -tt 1 b 1 b A NULL NULL NULL YES BTREE -tt 1 c 1 c A NULL NULL NULL YES BTREE +tt 1 b 1 b A 500 NULL NULL YES BTREE +tt 1 c 1 c A 500 NULL NULL YES BTREE analyze table tt; Table Op Msg_type Msg_text test.tt analyze status OK show indexes from tt; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment tt 0 PRIMARY 1 a A 500 NULL NULL BTREE -tt 1 b 1 b A 125 NULL NULL YES BTREE -tt 1 c 1 c A 1 NULL NULL YES BTREE +tt 1 b 1 b A 250 NULL NULL YES BTREE +tt 1 c 1 c A 2 NULL NULL YES BTREE alter table tt drop key b; show indexes from tt; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment tt 0 PRIMARY 1 a A 500 NULL NULL BTREE -tt 1 c 1 c A 1 NULL NULL YES BTREE +tt 1 c 1 c A 2 NULL NULL YES BTREE alter table tt drop key c; show indexes from tt; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment diff --git a/storage/tokudb/mysql-test/tokudb/r/card_drop_pk.result b/storage/tokudb/mysql-test/tokudb/r/card_drop_pk.result index bdbd9a3f097..2369d88c274 100644 --- a/storage/tokudb/mysql-test/tokudb/r/card_drop_pk.result +++ b/storage/tokudb/mysql-test/tokudb/r/card_drop_pk.result @@ -5,24 +5,24 @@ insert into tt values (1,0,0),(2,0,0),(3,0,1),(4,0,1); show indexes from tt; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment tt 0 PRIMARY 1 a A 4 NULL NULL BTREE -tt 1 b 1 b A NULL NULL NULL YES BTREE -tt 1 c 1 c A NULL NULL NULL YES BTREE +tt 1 b 1 b A 4 NULL NULL YES BTREE +tt 1 c 1 c A 4 NULL NULL YES BTREE analyze table tt; Table Op Msg_type Msg_text test.tt analyze status OK show indexes from tt; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment tt 0 PRIMARY 1 a A 4 NULL NULL BTREE -tt 1 b 1 b A 1 NULL NULL YES BTREE -tt 1 c 1 c A 2 NULL NULL YES BTREE +tt 1 b 1 b A 2 NULL NULL YES BTREE +tt 1 c 1 c A 4 NULL NULL YES BTREE alter table tt drop primary key; show indexes from tt; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment -tt 1 b 1 b A NULL NULL NULL YES BTREE -tt 1 c 1 c A NULL NULL NULL YES BTREE +tt 1 b 1 b A 4 NULL NULL YES BTREE +tt 1 c 1 c A 4 NULL NULL YES BTREE flush tables; show indexes from tt; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment -tt 1 b 1 b A NULL NULL NULL YES BTREE -tt 1 c 1 c A NULL NULL NULL YES BTREE +tt 1 b 1 b A 4 NULL NULL YES BTREE +tt 1 c 1 c A 4 NULL NULL YES BTREE drop table tt; diff --git a/storage/tokudb/mysql-test/tokudb/r/card_pk_2.result b/storage/tokudb/mysql-test/tokudb/r/card_pk_2.result index dd850df9a89..3c1b652db15 100644 --- a/storage/tokudb/mysql-test/tokudb/r/card_pk_2.result +++ b/storage/tokudb/mysql-test/tokudb/r/card_pk_2.result @@ -4,18 +4,18 @@ create table tt (a int, b int, primary key(a,b)); insert into tt values (0,0),(0,1),(1,0),(1,1); show indexes from tt; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment -tt 0 PRIMARY 1 a A NULL NULL NULL BTREE +tt 0 PRIMARY 1 a A 4 NULL NULL BTREE tt 0 PRIMARY 2 b A 4 NULL NULL BTREE analyze table tt; Table Op Msg_type Msg_text test.tt analyze status OK show indexes from tt; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment -tt 0 PRIMARY 1 a A 2 NULL NULL BTREE +tt 0 PRIMARY 1 a A 4 NULL NULL BTREE tt 0 PRIMARY 2 b A 4 NULL NULL BTREE flush tables; show indexes from tt; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment -tt 0 PRIMARY 1 a A 2 NULL NULL BTREE +tt 0 PRIMARY 1 a A 4 NULL NULL BTREE tt 0 PRIMARY 2 b A 4 NULL NULL BTREE drop table tt; diff --git a/storage/tokudb/mysql-test/tokudb/r/card_pk_sk.result b/storage/tokudb/mysql-test/tokudb/r/card_pk_sk.result index 5458f19de32..02c8d1f8218 100644 --- a/storage/tokudb/mysql-test/tokudb/r/card_pk_sk.result +++ b/storage/tokudb/mysql-test/tokudb/r/card_pk_sk.result @@ -1004,7 +1004,7 @@ insert into tt values (4*999,4*999+1),(4*999+1,4*999+2),(4*999+2,4*999+3),(4*999 show indexes from tt; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment tt 0 PRIMARY 1 a A 4000 NULL NULL BTREE -tt 1 b 1 b A NULL NULL NULL YES BTREE +tt 1 b 1 b A 4000 NULL NULL YES BTREE analyze table tt; Table Op Msg_type Msg_text test.tt analyze status OK @@ -2022,17 +2022,17 @@ insert into tt values (4*999,0),(4*999+1,0),(4*999+2,0),(4*999+3,0); show indexes from tt; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment tt 0 PRIMARY 1 a A 4000 NULL NULL BTREE -tt 1 b 1 b A NULL NULL NULL YES BTREE +tt 1 b 1 b A 4000 NULL NULL YES BTREE analyze table tt; Table Op Msg_type Msg_text test.tt analyze status OK show indexes from tt; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment tt 0 PRIMARY 1 a A 4000 NULL NULL BTREE -tt 1 b 1 b A 1 NULL NULL YES BTREE +tt 1 b 1 b A 2 NULL NULL YES BTREE flush tables; show indexes from tt; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment tt 0 PRIMARY 1 a A 4000 NULL NULL BTREE -tt 1 b 1 b A 1 NULL NULL YES BTREE +tt 1 b 1 b A 2 NULL NULL YES BTREE drop table tt; diff --git a/storage/tokudb/mysql-test/tokudb/r/card_scale_percent.result b/storage/tokudb/mysql-test/tokudb/r/card_scale_percent.result new file mode 100644 index 00000000000..cfd7e38179c --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb/r/card_scale_percent.result @@ -0,0 +1,42 @@ +set global tokudb_cardinality_scale_percent = 10; +analyze table tt; +Table Op Msg_type Msg_text +test.tt analyze status OK +show indexes from tt; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +tt 0 PRIMARY 1 a A 4000 NULL NULL BTREE +tt 1 b 1 b A 4000 NULL NULL YES BTREE +tt 1 c 1 c A 4000 NULL NULL YES BTREE +tt 1 d 1 d A 4000 NULL NULL YES BTREE +set global tokudb_cardinality_scale_percent = 50; +analyze table tt; +Table Op Msg_type Msg_text +test.tt analyze status OK +show indexes from tt; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +tt 0 PRIMARY 1 a A 4000 NULL NULL BTREE +tt 1 b 1 b A 4000 NULL NULL YES BTREE +tt 1 c 1 c A 4000 NULL NULL YES BTREE +tt 1 d 1 d A 2000 NULL NULL YES BTREE +set global tokudb_cardinality_scale_percent = 100; +analyze table tt; +Table Op Msg_type Msg_text +test.tt analyze status OK +show indexes from tt; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +tt 0 PRIMARY 1 a A 4000 NULL NULL BTREE +tt 1 b 1 b A 4000 NULL NULL YES BTREE +tt 1 c 1 c A 2000 NULL NULL YES BTREE +tt 1 d 1 d A 1000 NULL NULL YES BTREE +set global tokudb_cardinality_scale_percent = 200; +Warnings: +Warning 1292 Truncated incorrect tokudb_cardinality_scale_percent value: '200' +analyze table tt; +Table Op Msg_type Msg_text +test.tt analyze status OK +show indexes from tt; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +tt 0 PRIMARY 1 a A 4000 NULL NULL BTREE +tt 1 b 1 b A 4000 NULL NULL YES BTREE +tt 1 c 1 c A 2000 NULL NULL YES BTREE +tt 1 d 1 d A 1000 NULL NULL YES BTREE diff --git a/storage/tokudb/mysql-test/tokudb/r/card_sk.result b/storage/tokudb/mysql-test/tokudb/r/card_sk.result index 1846b4e82bc..310fc863a9b 100644 --- a/storage/tokudb/mysql-test/tokudb/r/card_sk.result +++ b/storage/tokudb/mysql-test/tokudb/r/card_sk.result @@ -5,15 +5,15 @@ insert into tt values (1,0),(2,1),(3,2),(4,3); insert into tt values (5,0),(6,1),(7,2),(8,3); show indexes from tt; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment -tt 1 b 1 b A NULL NULL NULL YES BTREE +tt 1 b 1 b A 8 NULL NULL YES BTREE analyze table tt; Table Op Msg_type Msg_text test.tt analyze status OK show indexes from tt; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment -tt 1 b 1 b A 4 NULL NULL YES BTREE +tt 1 b 1 b A 8 NULL NULL YES BTREE flush tables; show indexes from tt; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment -tt 1 b 1 b A 4 NULL NULL YES BTREE +tt 1 b 1 b A 8 NULL NULL YES BTREE drop table tt; diff --git a/storage/tokudb/mysql-test/tokudb/r/card_sk_2.result b/storage/tokudb/mysql-test/tokudb/r/card_sk_2.result index c087bad3b18..8ff57b63e5d 100644 --- a/storage/tokudb/mysql-test/tokudb/r/card_sk_2.result +++ b/storage/tokudb/mysql-test/tokudb/r/card_sk_2.result @@ -4,18 +4,18 @@ create table tt (a int, b int, key(a,b)); insert into tt values (0,0),(0,1),(1,0),(1,1); show indexes from tt; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment -tt 1 a 1 a A NULL NULL NULL YES BTREE -tt 1 a 2 b A NULL NULL NULL YES BTREE +tt 1 a 1 a A 4 NULL NULL YES BTREE +tt 1 a 2 b A 4 NULL NULL YES BTREE analyze table tt; Table Op Msg_type Msg_text test.tt analyze status OK show indexes from tt; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment -tt 1 a 1 a A 2 NULL NULL YES BTREE +tt 1 a 1 a A 4 NULL NULL YES BTREE tt 1 a 2 b A 4 NULL NULL YES BTREE flush tables; show indexes from tt; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment -tt 1 a 1 a A 2 NULL NULL YES BTREE +tt 1 a 1 a A 4 NULL NULL YES BTREE tt 1 a 2 b A 4 NULL NULL YES BTREE drop table tt; diff --git a/storage/tokudb/mysql-test/tokudb/r/change_column_int_default.result b/storage/tokudb/mysql-test/tokudb/r/change_column_int_default.result index 558d153711c..b119f1a0b61 100644 --- a/storage/tokudb/mysql-test/tokudb/r/change_column_int_default.result +++ b/storage/tokudb/mysql-test/tokudb/r/change_column_int_default.result @@ -6,31 +6,31 @@ ALTER TABLE t CHANGE COLUMN a a TINYINT DEFAULT 100; SHOW CREATE TABLE t; Table Create Table t CREATE TABLE `t` ( - `a` tinyint(4) DEFAULT '100' + `a` tinyint(4) DEFAULT 100 ) ENGINE=TokuDB DEFAULT CHARSET=latin1 ALTER TABLE t CHANGE COLUMN a a SMALLINT DEFAULT 200; SHOW CREATE TABLE t; Table Create Table t CREATE TABLE `t` ( - `a` smallint(6) DEFAULT '200' + `a` smallint(6) DEFAULT 200 ) ENGINE=TokuDB DEFAULT CHARSET=latin1 ALTER TABLE t CHANGE COLUMN a a MEDIUMINT DEFAULT 300; SHOW CREATE TABLE t; Table Create Table t CREATE TABLE `t` ( - `a` mediumint(9) DEFAULT '300' + `a` mediumint(9) DEFAULT 300 ) ENGINE=TokuDB DEFAULT CHARSET=latin1 ALTER TABLE t CHANGE COLUMN a a INT DEFAULT 400; SHOW CREATE TABLE t; Table Create Table t CREATE TABLE `t` ( - `a` int(11) DEFAULT '400' + `a` int(11) DEFAULT 400 ) ENGINE=TokuDB DEFAULT CHARSET=latin1 ALTER TABLE t CHANGE COLUMN a a BIGINT DEFAULT 500; SHOW CREATE TABLE t; Table Create Table t CREATE TABLE `t` ( - `a` bigint(20) DEFAULT '500' + `a` bigint(20) DEFAULT 500 ) ENGINE=TokuDB DEFAULT CHARSET=latin1 DROP TABLE t; CREATE TABLE t (a TINYINT NOT NULL DEFAULT 1); @@ -38,31 +38,31 @@ ALTER TABLE t CHANGE COLUMN a a TINYINT NOT NULL DEFAULT 100; SHOW CREATE TABLE t; Table Create Table t CREATE TABLE `t` ( - `a` tinyint(4) NOT NULL DEFAULT '100' + `a` tinyint(4) NOT NULL DEFAULT 100 ) ENGINE=TokuDB DEFAULT CHARSET=latin1 ALTER TABLE t CHANGE COLUMN a a SMALLINT NOT NULL DEFAULT 200; SHOW CREATE TABLE t; Table Create Table t CREATE TABLE `t` ( - `a` smallint(6) NOT NULL DEFAULT '200' + `a` smallint(6) NOT NULL DEFAULT 200 ) ENGINE=TokuDB DEFAULT CHARSET=latin1 ALTER TABLE t CHANGE COLUMN a a MEDIUMINT NOT NULL DEFAULT 300; SHOW CREATE TABLE t; Table Create Table t CREATE TABLE `t` ( - `a` mediumint(9) NOT NULL DEFAULT '300' + `a` mediumint(9) NOT NULL DEFAULT 300 ) ENGINE=TokuDB DEFAULT CHARSET=latin1 ALTER TABLE t CHANGE COLUMN a a INT NOT NULL DEFAULT 400; SHOW CREATE TABLE t; Table Create Table t CREATE TABLE `t` ( - `a` int(11) NOT NULL DEFAULT '400' + `a` int(11) NOT NULL DEFAULT 400 ) ENGINE=TokuDB DEFAULT CHARSET=latin1 ALTER TABLE t CHANGE COLUMN a a BIGINT NOT NULL DEFAULT 500; SHOW CREATE TABLE t; Table Create Table t CREATE TABLE `t` ( - `a` bigint(20) NOT NULL DEFAULT '500' + `a` bigint(20) NOT NULL DEFAULT 500 ) ENGINE=TokuDB DEFAULT CHARSET=latin1 DROP TABLE t; CREATE TABLE t (a TINYINT UNSIGNED DEFAULT 1); @@ -70,31 +70,31 @@ ALTER TABLE t CHANGE COLUMN a a TINYINT UNSIGNED DEFAULT 100; SHOW CREATE TABLE t; Table Create Table t CREATE TABLE `t` ( - `a` tinyint(3) unsigned DEFAULT '100' + `a` tinyint(3) unsigned DEFAULT 100 ) ENGINE=TokuDB DEFAULT CHARSET=latin1 ALTER TABLE t CHANGE COLUMN a a SMALLINT UNSIGNED DEFAULT 200; SHOW CREATE TABLE t; Table Create Table t CREATE TABLE `t` ( - `a` smallint(5) unsigned DEFAULT '200' + `a` smallint(5) unsigned DEFAULT 200 ) ENGINE=TokuDB DEFAULT CHARSET=latin1 ALTER TABLE t CHANGE COLUMN a a MEDIUMINT UNSIGNED DEFAULT 300; SHOW CREATE TABLE t; Table Create Table t CREATE TABLE `t` ( - `a` mediumint(8) unsigned DEFAULT '300' + `a` mediumint(8) unsigned DEFAULT 300 ) ENGINE=TokuDB DEFAULT CHARSET=latin1 ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED DEFAULT 400; SHOW CREATE TABLE t; Table Create Table t CREATE TABLE `t` ( - `a` int(10) unsigned DEFAULT '400' + `a` int(10) unsigned DEFAULT 400 ) ENGINE=TokuDB DEFAULT CHARSET=latin1 ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED DEFAULT 500; SHOW CREATE TABLE t; Table Create Table t CREATE TABLE `t` ( - `a` bigint(20) unsigned DEFAULT '500' + `a` bigint(20) unsigned DEFAULT 500 ) ENGINE=TokuDB DEFAULT CHARSET=latin1 DROP TABLE t; CREATE TABLE t (a TINYINT UNSIGNED NOT NULL DEFAULT 1); @@ -102,30 +102,30 @@ ALTER TABLE t CHANGE COLUMN a a TINYINT UNSIGNED NOT NULL DEFAULT 100; SHOW CREATE TABLE t; Table Create Table t CREATE TABLE `t` ( - `a` tinyint(3) unsigned NOT NULL DEFAULT '100' + `a` tinyint(3) unsigned NOT NULL DEFAULT 100 ) ENGINE=TokuDB DEFAULT CHARSET=latin1 ALTER TABLE t CHANGE COLUMN a a SMALLINT UNSIGNED NOT NULL DEFAULT 200; SHOW CREATE TABLE t; Table Create Table t CREATE TABLE `t` ( - `a` smallint(5) unsigned NOT NULL DEFAULT '200' + `a` smallint(5) unsigned NOT NULL DEFAULT 200 ) ENGINE=TokuDB DEFAULT CHARSET=latin1 ALTER TABLE t CHANGE COLUMN a a MEDIUMINT UNSIGNED NOT NULL DEFAULT 300; SHOW CREATE TABLE t; Table Create Table t CREATE TABLE `t` ( - `a` mediumint(8) unsigned NOT NULL DEFAULT '300' + `a` mediumint(8) unsigned NOT NULL DEFAULT 300 ) ENGINE=TokuDB DEFAULT CHARSET=latin1 ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED NOT NULL DEFAULT 400; SHOW CREATE TABLE t; Table Create Table t CREATE TABLE `t` ( - `a` int(10) unsigned NOT NULL DEFAULT '400' + `a` int(10) unsigned NOT NULL DEFAULT 400 ) ENGINE=TokuDB DEFAULT CHARSET=latin1 ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED NOT NULL DEFAULT 500; SHOW CREATE TABLE t; Table Create Table t CREATE TABLE `t` ( - `a` bigint(20) unsigned NOT NULL DEFAULT '500' + `a` bigint(20) unsigned NOT NULL DEFAULT 500 ) ENGINE=TokuDB DEFAULT CHARSET=latin1 DROP TABLE t; diff --git a/storage/tokudb/mysql-test/tokudb/r/cluster_2968-0.result b/storage/tokudb/mysql-test/tokudb/r/cluster_2968-0.result index 1e0935543dc..9e524df3276 100644 --- a/storage/tokudb/mysql-test/tokudb/r/cluster_2968-0.result +++ b/storage/tokudb/mysql-test/tokudb/r/cluster_2968-0.result @@ -1042,5 +1042,5 @@ t CREATE TABLE `t` ( explain select straight_join * from s,t where s.b = t.b; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE s index b b 5 NULL 1000 Using where; Using index -1 SIMPLE t ref b b 5 test.s.b 11 Using index +1 SIMPLE t ref b b 5 test.s.b 1 Using index drop table s,t; diff --git a/storage/tokudb/mysql-test/tokudb/r/cluster_2968-1.result b/storage/tokudb/mysql-test/tokudb/r/cluster_2968-1.result index 9337718ce35..1aeb40d182a 100644 --- a/storage/tokudb/mysql-test/tokudb/r/cluster_2968-1.result +++ b/storage/tokudb/mysql-test/tokudb/r/cluster_2968-1.result @@ -1042,7 +1042,7 @@ t CREATE TABLE `t` ( explain select straight_join * from s,t where s.b = t.b; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE s ALL b NULL NULL NULL 1000 Using where -1 SIMPLE t ref b b 5 test.s.b 11 +1 SIMPLE t ref b b 5 test.s.b 1 alter table s add key(b) clustering=yes; Warnings: Note 1831 Duplicate index 'b_2' defined on the table 'test.s'. This is deprecated and will be disallowed in a future release. @@ -1092,7 +1092,7 @@ t CREATE TABLE `t` ( explain select straight_join * from s,t where s.b = t.b; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE s index b_2 b_2 5 NULL 1000 Using where; Using index -1 SIMPLE t ref b_2 b_2 5 test.s.b 11 Using index +1 SIMPLE t ref b_2 b_2 5 test.s.b 1 Using index alter table s add key(b); Warnings: Note 1831 Duplicate index 'b' defined on the table 'test.s'. This is deprecated and will be disallowed in a future release. diff --git a/storage/tokudb/mysql-test/tokudb/r/cluster_2968-2.result b/storage/tokudb/mysql-test/tokudb/r/cluster_2968-2.result index 710509b2acf..9fdb28404c7 100644 --- a/storage/tokudb/mysql-test/tokudb/r/cluster_2968-2.result +++ b/storage/tokudb/mysql-test/tokudb/r/cluster_2968-2.result @@ -1042,7 +1042,7 @@ t CREATE TABLE `t` ( explain select straight_join s.a,t.a from s,t where s.b = t.b; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE s ALL b NULL NULL NULL 1000 Using where -1 SIMPLE t ref b b 5 test.s.b 11 +1 SIMPLE t ref b b 5 test.s.b 1 alter table s add key(b,a); alter table t add key(b,a); show create table s; @@ -1066,7 +1066,7 @@ t CREATE TABLE `t` ( explain select straight_join s.a,t.a from s,t where s.b = t.b; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE s index b,b_2 b_2 10 NULL 1000 Using where; Using index -1 SIMPLE t ref b,b_2 b_2 5 test.s.b 11 Using index +1 SIMPLE t ref b,b_2 b_2 5 test.s.b 1 Using index alter table s add key(b) clustering=yes; Warnings: Note 1831 Duplicate index 'b_3' defined on the table 'test.s'. This is deprecated and will be disallowed in a future release. @@ -1096,7 +1096,7 @@ t CREATE TABLE `t` ( explain select straight_join s.a,t.a from s,t where s.b = t.b; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE s index b,b_2,b_3 b_2 10 NULL 1000 Using where; Using index -1 SIMPLE t ref b,b_2,b_3 b_3 5 test.s.b 1 Using index +1 SIMPLE t ref b,b_2,b_3 b_2 5 test.s.b 1 Using index alter table s drop key b_2; alter table t drop key b_2; show create table s; diff --git a/storage/tokudb/mysql-test/tokudb/r/cluster_2968-3.result b/storage/tokudb/mysql-test/tokudb/r/cluster_2968-3.result index 660d63c54c8..eec0e67ef30 100644 --- a/storage/tokudb/mysql-test/tokudb/r/cluster_2968-3.result +++ b/storage/tokudb/mysql-test/tokudb/r/cluster_2968-3.result @@ -1062,8 +1062,8 @@ u CREATE TABLE `u` ( explain select straight_join * from s,t,u where s.b = t.b and s.c = u.c; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE s ALL b NULL NULL NULL 1000 Using where -1 SIMPLE t ref b b 5 test.s.b 11 -1 SIMPLE u ref c c 5 test.s.c 11 +1 SIMPLE t ref b b 5 test.s.b 1 +1 SIMPLE u ref c c 5 test.s.c 1 alter table s add key (b) clustering=yes; Warnings: Note 1831 Duplicate index 'b_2' defined on the table 'test.s'. This is deprecated and will be disallowed in a future release. diff --git a/storage/tokudb/mysql-test/tokudb/r/cluster_filter_unpack_varchar.result b/storage/tokudb/mysql-test/tokudb/r/cluster_filter_unpack_varchar.result index d3273437f77..9faf04b6a10 100644 --- a/storage/tokudb/mysql-test/tokudb/r/cluster_filter_unpack_varchar.result +++ b/storage/tokudb/mysql-test/tokudb/r/cluster_filter_unpack_varchar.result @@ -182,14 +182,14 @@ a b c d e f 3 30 200 2000 20000 200000 explain select * from t1 where b > "0"; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index b b NULL NULL NULL; Using where; Using index +1 SIMPLE t1 # b b NULL NULL NULL; Using where; Using index select * from t1 where b > "0"; a b c d e f 2 20 100 1000 10000 100000 3 30 200 2000 20000 200000 explain select * from t1 where d > "0"; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index d d NULL NULL NULL; Using where; Using index +1 SIMPLE t1 # d d NULL NULL NULL; Using where; Using index select * from t1 where d > "0"; a b c d e f 2 20 100 1000 10000 100000 diff --git a/storage/tokudb/mysql-test/tokudb/r/cluster_key.result b/storage/tokudb/mysql-test/tokudb/r/cluster_key.result index 74298d69114..fab288047be 100644 --- a/storage/tokudb/mysql-test/tokudb/r/cluster_key.result +++ b/storage/tokudb/mysql-test/tokudb/r/cluster_key.result @@ -1,6 +1,6 @@ SET DEFAULT_STORAGE_ENGINE='tokudb'; DROP TABLE IF EXISTS t1; -create table t1(a int, b int, c int, d int, primary key(a), key(b) clustering=yes, key (c))engine=tokudb; +create table t1(a int, b int, c int, d int, primary key(a,b,c), key(b) clustering=yes, key (c))engine=tokudb; insert into t1 values (1,10,100,1000),(2,20,200,2000),(3,30,300,3000),(4,40,400,4000),(5,50,500,5000),(6,60,600,6000),(7,70,700,7000),(8,80,800,8000),(9,90,900,9000); explain select * from t1 where a > 5; id select_type table type possible_keys key key_len ref rows Extra @@ -13,7 +13,7 @@ a b c d 9 90 900 9000 explain select * from t1 where b > 30; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range b b 5 NULL NULL; Using where; Using index +1 SIMPLE t1 range b b 4 NULL NULL; Using where; Using index select * from t1 where b > 30; a b c d 4 40 400 4000 @@ -24,7 +24,7 @@ a b c d 9 90 900 9000 explain select * from t1 where c > 750; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range c c 5 NULL NULL; Using where +1 SIMPLE t1 range c c 4 NULL NULL; Using where select * from t1 where c > 750; a b c d 8 80 800 8000 @@ -37,7 +37,7 @@ a 9 explain select a,b from t1 where b > 30; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range b b 5 NULL NULL; Using where; Using index +1 SIMPLE t1 index b c 4 NULL NULL; Using where; Using index select a,b from t1 where b > 30; a b 4 40 @@ -48,7 +48,7 @@ a b 9 90 explain select a,b from t1 where c > 750; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range c c 5 NULL NULL; Using where +1 SIMPLE t1 index c c 4 NULL NULL; Using where; Using index select a,c from t1 where c > 750; a c 8 800 @@ -69,7 +69,7 @@ a b c d 10 10 10 10 explain select * from t1 where b > 30; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range b b 5 NULL NULL; Using where; Using index +1 SIMPLE t1 range b b 4 NULL NULL; Using where; Using index select * from t1 where b > 30; a b c d 4 40 400 4000 @@ -80,14 +80,14 @@ a b c d 9 90 900 9000 explain select * from t1 where c > 750; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range c c 5 NULL NULL; Using where +1 SIMPLE t1 range c c 4 NULL NULL; Using where select * from t1 where c > 750; a b c d 8 80 800 8000 9 90 900 9000 explain select b from t1 where b > 30; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range b b 5 NULL NULL; Using where; Using index +1 SIMPLE t1 range b b 4 NULL NULL; Using where; Using index select b from t1 where b > 30; b 40 @@ -98,13 +98,13 @@ b 90 explain select b from t1 where c > 750; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range c c 5 NULL NULL; Using where +1 SIMPLE t1 range c c 4 NULL NULL; Using where select c from t1 where c > 750; c 800 900 alter table t1 add e varchar(20); -alter table t1 add primary key (a); +alter table t1 add primary key (a,b,c); explain select * from t1 where a > 5; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL NULL; Using where @@ -117,7 +117,7 @@ a b c d e 10 10 10 10 NULL explain select * from t1 where b > 30; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range b b 5 NULL NULL; Using where; Using index +1 SIMPLE t1 range b b 4 NULL NULL; Using where; Using index select * from t1 where b > 30; a b c d e 4 40 400 4000 NULL @@ -128,7 +128,7 @@ a b c d e 9 90 900 9000 NULL explain select * from t1 where c > 750; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range c c 5 NULL NULL; Using where +1 SIMPLE t1 range c c 4 NULL NULL; Using where select * from t1 where c > 750; a b c d e 8 80 800 8000 NULL @@ -142,7 +142,7 @@ a 10 explain select a,b from t1 where b > 30; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range b b 5 NULL NULL; Using where; Using index +1 SIMPLE t1 index b c 4 NULL NULL; Using where; Using index select a,b from t1 where b > 30; a b 4 40 @@ -153,7 +153,7 @@ a b 9 90 explain select a,b from t1 where c > 750; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range c c 5 NULL NULL; Using where +1 SIMPLE t1 index c c 4 NULL NULL; Using where; Using index select a,c from t1 where c > 750; a c 8 800 @@ -171,7 +171,7 @@ a b c d e 10 10 10 10 NULL explain select * from t1 where b > 30; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range b b 5 NULL NULL; Using where; Using index +1 SIMPLE t1 range b b 4 NULL NULL; Using where; Using index select * from t1 where b > 30; a b c d e 4 40 400 4000 NULL @@ -182,14 +182,14 @@ a b c d e 9 90 900 9000 NULL explain select * from t1 where c > 750; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range c c 5 NULL NULL; Using where +1 SIMPLE t1 range c c 4 NULL NULL; Using where select * from t1 where c > 750; a b c d e 8 80 800 8000 NULL 9 90 900 9000 NULL explain select b from t1 where b > 30; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range b b 5 NULL NULL; Using where; Using index +1 SIMPLE t1 range b b 4 NULL NULL; Using where; Using index select b from t1 where b > 30; b 40 @@ -200,7 +200,7 @@ b 90 explain select b from t1 where c > 750; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range c c 5 NULL NULL; Using where +1 SIMPLE t1 range c c 4 NULL NULL; Using where select c from t1 where c > 750; c 800 diff --git a/storage/tokudb/mysql-test/tokudb/r/cluster_key_part.result b/storage/tokudb/mysql-test/tokudb/r/cluster_key_part.result index cd8fc340314..6df54cac05a 100644 --- a/storage/tokudb/mysql-test/tokudb/r/cluster_key_part.result +++ b/storage/tokudb/mysql-test/tokudb/r/cluster_key_part.result @@ -1,11 +1,22 @@ set default_storage_engine='tokudb'; -drop table if exists t; -create table t ( -x int not null, -y int not null, -primary key(x)) -partition by hash(x) partitions 2; -show create table t; +DROP TABLE IF EXISTS t; +CREATE TABLE t (a INT NOT NULL AUTO_INCREMENT, b INT, PRIMARY KEY(a), CLUSTERING KEY b(b)) ENGINE=TokuDB +PARTITION BY RANGE(a) (PARTITION p0 VALUES LESS THAN (100) ENGINE = TokuDB, PARTITION p2 VALUES LESS THAN MAXVALUE ENGINE = TokuDB); +SHOW CREATE TABLE t; +Table Create Table +t CREATE TABLE `t` ( + `a` int(11) NOT NULL AUTO_INCREMENT, + `b` int(11) DEFAULT NULL, + PRIMARY KEY (`a`), + CLUSTERING KEY `b` (`b`) +) ENGINE=TokuDB DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY RANGE (a) +(PARTITION p0 VALUES LESS THAN (100) ENGINE = TokuDB, + PARTITION p2 VALUES LESS THAN MAXVALUE ENGINE = TokuDB) */ +DROP TABLE t; +CREATE TABLE t (x INT NOT NULL, y INT NOT NULL, PRIMARY KEY(x)) +PARTITION BY HASH(x) PARTITIONS 2; +SHOW CREATE TABLE t; Table Create Table t CREATE TABLE `t` ( `x` int(11) NOT NULL, @@ -14,8 +25,8 @@ t CREATE TABLE `t` ( ) ENGINE=TokuDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (x) PARTITIONS 2 */ -alter table t add clustering key(y); -show create table t; +ALTER TABLE t ADD CLUSTERING KEY(y); +SHOW CREATE TABLE t; Table Create Table t CREATE TABLE `t` ( `x` int(11) NOT NULL, @@ -25,4 +36,625 @@ t CREATE TABLE `t` ( ) ENGINE=TokuDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (x) PARTITIONS 2 */ -drop table t; +DROP TABLE t; +CREATE TABLE t1(a INT, b INT, c INT, d INT, PRIMARY KEY(a,b,c), CLUSTERING KEY(b), KEY (c)) ENGINE=TOKUDB +PARTITION BY RANGE(a) (PARTITION p0 VALUES LESS THAN (5) ENGINE = TOKUDB, PARTITION p2 VALUES LESS THAN MAXVALUE ENGINE = TOKUDB); +insert into t1 values (1,10,100,1000),(2,20,200,2000),(3,30,300,3000),(4,40,400,4000),(5,50,500,5000),(6,60,600,6000),(7,70,700,7000),(8,80,800,8000),(9,90,900,9000); +explain select * from t1 where a > 5; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL NULL; Using where +select * from t1 where a > 5; +a b c d +6 60 600 6000 +7 70 700 7000 +8 80 800 8000 +9 90 900 9000 +explain select * from t1 where b > 30; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range b b 4 NULL NULL; Using where +select * from t1 where b > 30; +a b c d +4 40 400 4000 +5 50 500 5000 +6 60 600 6000 +7 70 700 7000 +8 80 800 8000 +9 90 900 9000 +explain select * from t1 where c > 750; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range c c 4 NULL NULL; Using where +select * from t1 where c > 750; +a b c d +8 80 800 8000 +9 90 900 9000 +explain select a from t1 where a > 8; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL NULL; Using where; Using index +select a from t1 where a > 8; +a +9 +explain select a,b from t1 where b > 30; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range b b 4 NULL NULL; Using where; Using index +select a,b from t1 where b > 30; +a b +4 40 +5 50 +6 60 +7 70 +8 80 +9 90 +explain select a,b from t1 where c > 750; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index c b 4 NULL NULL; Using where; Using index +select a,c from t1 where c > 750; +a c +8 800 +9 900 +alter table t1 add clustering index bdca(b,d,c,a); +insert into t1 values (10,10,10,10); +alter table t1 drop index bdca; +alter table t1 drop primary key; +explain select * from t1 where a > 5; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL NULL; Using where +select * from t1 where a > 5; +a b c d +6 60 600 6000 +7 70 700 7000 +8 80 800 8000 +9 90 900 9000 +10 10 10 10 +explain select * from t1 where b > 30; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range b b 4 NULL NULL; Using where +select * from t1 where b > 30; +a b c d +4 40 400 4000 +5 50 500 5000 +6 60 600 6000 +7 70 700 7000 +8 80 800 8000 +9 90 900 9000 +explain select * from t1 where c > 750; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range c c 4 NULL NULL; Using where +select * from t1 where c > 750; +a b c d +8 80 800 8000 +9 90 900 9000 +explain select b from t1 where b > 30; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range b b 4 NULL NULL; Using where; Using index +select b from t1 where b > 30; +b +40 +50 +60 +70 +80 +90 +explain select b from t1 where c > 750; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range c c 4 NULL NULL; Using where +select c from t1 where c > 750; +c +800 +900 +alter table t1 add e varchar(20); +alter table t1 add primary key (a,b,c); +explain select * from t1 where a > 5; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL NULL; Using where +select * from t1 where a > 5; +a b c d e +6 60 600 6000 NULL +7 70 700 7000 NULL +8 80 800 8000 NULL +9 90 900 9000 NULL +10 10 10 10 NULL +explain select * from t1 where b > 30; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range b b 4 NULL NULL; Using where +select * from t1 where b > 30; +a b c d e +4 40 400 4000 NULL +5 50 500 5000 NULL +6 60 600 6000 NULL +7 70 700 7000 NULL +8 80 800 8000 NULL +9 90 900 9000 NULL +explain select * from t1 where c > 750; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range c c 4 NULL NULL; Using where +select * from t1 where c > 750; +a b c d e +8 80 800 8000 NULL +9 90 900 9000 NULL +explain select a from t1 where a > 8; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL NULL; Using where; Using index +select a from t1 where a > 8; +a +9 +10 +explain select a,b from t1 where b > 30; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range b b 4 NULL NULL; Using where; Using index +select a,b from t1 where b > 30; +a b +4 40 +5 50 +6 60 +7 70 +8 80 +9 90 +explain select a,b from t1 where c > 750; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range c c 4 NULL NULL; Using where; Using index +select a,c from t1 where c > 750; +a c +8 800 +9 900 +alter table t1 drop primary key; +explain select * from t1 where a > 5; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL NULL; Using where +select * from t1 where a > 5; +a b c d e +6 60 600 6000 NULL +7 70 700 7000 NULL +8 80 800 8000 NULL +9 90 900 9000 NULL +10 10 10 10 NULL +explain select * from t1 where b > 30; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range b b 4 NULL NULL; Using where +select * from t1 where b > 30; +a b c d e +4 40 400 4000 NULL +5 50 500 5000 NULL +6 60 600 6000 NULL +7 70 700 7000 NULL +8 80 800 8000 NULL +9 90 900 9000 NULL +explain select * from t1 where c > 750; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range c c 4 NULL NULL; Using where +select * from t1 where c > 750; +a b c d e +8 80 800 8000 NULL +9 90 900 9000 NULL +explain select b from t1 where b > 30; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range b b 4 NULL NULL; Using where; Using index +select b from t1 where b > 30; +b +40 +50 +60 +70 +80 +90 +explain select b from t1 where c > 750; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range c c 4 NULL NULL; Using where +select c from t1 where c > 750; +c +800 +900 +DROP TABLE t1; +CREATE TABLE t1(a INT, b INT, c INT, d INT, PRIMARY KEY(a,b,c), CLUSTERING KEY(b), KEY (c)) ENGINE=TOKUDB +PARTITION BY RANGE(b) (PARTITION p0 VALUES LESS THAN (50) ENGINE = TOKUDB, PARTITION p2 VALUES LESS THAN MAXVALUE ENGINE = TOKUDB); +insert into t1 values (1,10,100,1000),(2,20,200,2000),(3,30,300,3000),(4,40,400,4000),(5,50,500,5000),(6,60,600,6000),(7,70,700,7000),(8,80,800,8000),(9,90,900,9000); +explain select * from t1 where a > 5; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL NULL; Using where +select * from t1 where a > 5; +a b c d +6 60 600 6000 +7 70 700 7000 +8 80 800 8000 +9 90 900 9000 +explain select * from t1 where b > 30; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range b b 4 NULL NULL; Using where +select * from t1 where b > 30; +a b c d +4 40 400 4000 +5 50 500 5000 +6 60 600 6000 +7 70 700 7000 +8 80 800 8000 +9 90 900 9000 +explain select * from t1 where c > 750; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range c c 4 NULL NULL; Using where +select * from t1 where c > 750; +a b c d +8 80 800 8000 +9 90 900 9000 +explain select a from t1 where a > 8; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL NULL; Using where; Using index +select a from t1 where a > 8; +a +9 +explain select a,b from t1 where b > 30; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range b b 4 NULL NULL; Using where; Using index +select a,b from t1 where b > 30; +a b +4 40 +5 50 +6 60 +7 70 +8 80 +9 90 +explain select a,b from t1 where c > 750; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index c b 4 NULL NULL; Using where; Using index +select a,c from t1 where c > 750; +a c +8 800 +9 900 +alter table t1 add clustering index bdca(b,d,c,a); +insert into t1 values (10,10,10,10); +alter table t1 drop index bdca; +alter table t1 drop primary key; +explain select * from t1 where a > 5; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL NULL; Using where +select * from t1 where a > 5; +a b c d +10 10 10 10 +6 60 600 6000 +7 70 700 7000 +8 80 800 8000 +9 90 900 9000 +explain select * from t1 where b > 30; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range b b 4 NULL NULL; Using where +select * from t1 where b > 30; +a b c d +4 40 400 4000 +5 50 500 5000 +6 60 600 6000 +7 70 700 7000 +8 80 800 8000 +9 90 900 9000 +explain select * from t1 where c > 750; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range c c 4 NULL NULL; Using where +select * from t1 where c > 750; +a b c d +8 80 800 8000 +9 90 900 9000 +explain select b from t1 where b > 30; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range b b 4 NULL NULL; Using where; Using index +select b from t1 where b > 30; +b +40 +50 +60 +70 +80 +90 +explain select b from t1 where c > 750; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range c c 4 NULL NULL; Using where +select c from t1 where c > 750; +c +800 +900 +alter table t1 add e varchar(20); +alter table t1 add primary key (a,b,c); +explain select * from t1 where a > 5; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL NULL; Using where +select * from t1 where a > 5; +a b c d e +10 10 10 10 NULL +6 60 600 6000 NULL +7 70 700 7000 NULL +8 80 800 8000 NULL +9 90 900 9000 NULL +explain select * from t1 where b > 30; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range b b 4 NULL NULL; Using where +select * from t1 where b > 30; +a b c d e +4 40 400 4000 NULL +5 50 500 5000 NULL +6 60 600 6000 NULL +7 70 700 7000 NULL +8 80 800 8000 NULL +9 90 900 9000 NULL +explain select * from t1 where c > 750; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range c c 4 NULL NULL; Using where +select * from t1 where c > 750; +a b c d e +8 80 800 8000 NULL +9 90 900 9000 NULL +explain select a from t1 where a > 8; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL NULL; Using where; Using index +select a from t1 where a > 8; +a +10 +9 +explain select a,b from t1 where b > 30; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range b b 4 NULL NULL; Using where; Using index +select a,b from t1 where b > 30; +a b +4 40 +5 50 +6 60 +7 70 +8 80 +9 90 +explain select a,b from t1 where c > 750; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index c b 4 NULL NULL; Using where; Using index +select a,c from t1 where c > 750; +a c +8 800 +9 900 +alter table t1 drop primary key; +explain select * from t1 where a > 5; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL NULL; Using where +select * from t1 where a > 5; +a b c d e +10 10 10 10 NULL +6 60 600 6000 NULL +7 70 700 7000 NULL +8 80 800 8000 NULL +9 90 900 9000 NULL +explain select * from t1 where b > 30; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range b b 4 NULL NULL; Using where +select * from t1 where b > 30; +a b c d e +4 40 400 4000 NULL +5 50 500 5000 NULL +6 60 600 6000 NULL +7 70 700 7000 NULL +8 80 800 8000 NULL +9 90 900 9000 NULL +explain select * from t1 where c > 750; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range c c 4 NULL NULL; Using where +select * from t1 where c > 750; +a b c d e +8 80 800 8000 NULL +9 90 900 9000 NULL +explain select b from t1 where b > 30; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range b b 4 NULL NULL; Using where; Using index +select b from t1 where b > 30; +b +40 +50 +60 +70 +80 +90 +explain select b from t1 where c > 750; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range c c 4 NULL NULL; Using where +select c from t1 where c > 750; +c +800 +900 +DROP TABLE t1; +CREATE TABLE t1(a INT, b INT, c INT, d INT, PRIMARY KEY(a,b,c), CLUSTERING KEY(b), KEY (c)) ENGINE=TOKUDB +PARTITION BY RANGE(c) (PARTITION p0 VALUES LESS THAN (500) ENGINE = TOKUDB, PARTITION p2 VALUES LESS THAN MAXVALUE ENGINE = TOKUDB); +insert into t1 values (1,10,100,1000),(2,20,200,2000),(3,30,300,3000),(4,40,400,4000),(5,50,500,5000),(6,60,600,6000),(7,70,700,7000),(8,80,800,8000),(9,90,900,9000); +explain select * from t1 where a > 5; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL NULL; Using where +select * from t1 where a > 5; +a b c d +6 60 600 6000 +7 70 700 7000 +8 80 800 8000 +9 90 900 9000 +explain select * from t1 where b > 30; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range b b 4 NULL NULL; Using where +select * from t1 where b > 30; +a b c d +4 40 400 4000 +5 50 500 5000 +6 60 600 6000 +7 70 700 7000 +8 80 800 8000 +9 90 900 9000 +explain select * from t1 where c > 750; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range c c 4 NULL NULL; Using where +select * from t1 where c > 750; +a b c d +8 80 800 8000 +9 90 900 9000 +explain select a from t1 where a > 8; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL NULL; Using where; Using index +select a from t1 where a > 8; +a +9 +explain select a,b from t1 where b > 30; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range b b 4 NULL NULL; Using where; Using index +select a,b from t1 where b > 30; +a b +4 40 +5 50 +6 60 +7 70 +8 80 +9 90 +explain select a,b from t1 where c > 750; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index c b 4 NULL NULL; Using where; Using index +select a,c from t1 where c > 750; +a c +8 800 +9 900 +alter table t1 add clustering index bdca(b,d,c,a); +insert into t1 values (10,10,10,10); +alter table t1 drop index bdca; +alter table t1 drop primary key; +explain select * from t1 where a > 5; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL NULL; Using where +select * from t1 where a > 5; +a b c d +10 10 10 10 +6 60 600 6000 +7 70 700 7000 +8 80 800 8000 +9 90 900 9000 +explain select * from t1 where b > 30; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range b b 4 NULL NULL; Using where +select * from t1 where b > 30; +a b c d +4 40 400 4000 +5 50 500 5000 +6 60 600 6000 +7 70 700 7000 +8 80 800 8000 +9 90 900 9000 +explain select * from t1 where c > 750; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range c c 4 NULL NULL; Using where +select * from t1 where c > 750; +a b c d +8 80 800 8000 +9 90 900 9000 +explain select b from t1 where b > 30; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range b b 4 NULL NULL; Using where; Using index +select b from t1 where b > 30; +b +40 +50 +60 +70 +80 +90 +explain select b from t1 where c > 750; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range c c 4 NULL NULL; Using where +select c from t1 where c > 750; +c +800 +900 +alter table t1 add e varchar(20); +alter table t1 add primary key (a,b,c); +explain select * from t1 where a > 5; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL NULL; Using where +select * from t1 where a > 5; +a b c d e +10 10 10 10 NULL +6 60 600 6000 NULL +7 70 700 7000 NULL +8 80 800 8000 NULL +9 90 900 9000 NULL +explain select * from t1 where b > 30; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range b b 4 NULL NULL; Using where +select * from t1 where b > 30; +a b c d e +4 40 400 4000 NULL +5 50 500 5000 NULL +6 60 600 6000 NULL +7 70 700 7000 NULL +8 80 800 8000 NULL +9 90 900 9000 NULL +explain select * from t1 where c > 750; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range c c 4 NULL NULL; Using where +select * from t1 where c > 750; +a b c d e +8 80 800 8000 NULL +9 90 900 9000 NULL +explain select a from t1 where a > 8; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL NULL; Using where; Using index +select a from t1 where a > 8; +a +10 +9 +explain select a,b from t1 where b > 30; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range b b 4 NULL NULL; Using where; Using index +select a,b from t1 where b > 30; +a b +4 40 +5 50 +6 60 +7 70 +8 80 +9 90 +explain select a,b from t1 where c > 750; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index c b 4 NULL NULL; Using where; Using index +select a,c from t1 where c > 750; +a c +8 800 +9 900 +alter table t1 drop primary key; +explain select * from t1 where a > 5; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL NULL; Using where +select * from t1 where a > 5; +a b c d e +10 10 10 10 NULL +6 60 600 6000 NULL +7 70 700 7000 NULL +8 80 800 8000 NULL +9 90 900 9000 NULL +explain select * from t1 where b > 30; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range b b 4 NULL NULL; Using where +select * from t1 where b > 30; +a b c d e +4 40 400 4000 NULL +5 50 500 5000 NULL +6 60 600 6000 NULL +7 70 700 7000 NULL +8 80 800 8000 NULL +9 90 900 9000 NULL +explain select * from t1 where c > 750; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range c c 4 NULL NULL; Using where +select * from t1 where c > 750; +a b c d e +8 80 800 8000 NULL +9 90 900 9000 NULL +explain select b from t1 where b > 30; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range b b 4 NULL NULL; Using where; Using index +select b from t1 where b > 30; +b +40 +50 +60 +70 +80 +90 +explain select b from t1 where c > 750; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range c c 4 NULL NULL; Using where +select c from t1 where c > 750; +c +800 +900 +DROP TABLE t1; diff --git a/storage/tokudb/mysql-test/tokudb/r/ext_key_1_innodb.result b/storage/tokudb/mysql-test/tokudb/r/ext_key_1_innodb.result index 152e7f31d08..912c45db54f 100644 --- a/storage/tokudb/mysql-test/tokudb/r/ext_key_1_innodb.result +++ b/storage/tokudb/mysql-test/tokudb/r/ext_key_1_innodb.result @@ -1,7 +1,7 @@ drop table if exists t; select @@optimizer_switch; @@optimizer_switch -index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on +index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=off create table t (id int not null, x int not null, y int not null, primary key(id), key(x)) engine=innodb; insert into t values (0,0,0),(1,1,1),(2,2,2),(3,2,3),(4,2,4); explain select x,id from t force index (x) where x=0 and id=0; diff --git a/storage/tokudb/mysql-test/tokudb/r/ext_key_1_tokudb.result b/storage/tokudb/mysql-test/tokudb/r/ext_key_1_tokudb.result index 429fb82aaab..bbaa51c2e6f 100644 --- a/storage/tokudb/mysql-test/tokudb/r/ext_key_1_tokudb.result +++ b/storage/tokudb/mysql-test/tokudb/r/ext_key_1_tokudb.result @@ -1,7 +1,7 @@ drop table if exists t; select @@optimizer_switch; @@optimizer_switch -index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on +index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=off create table t (id int not null, x int not null, y int not null, primary key(id), key(x)) engine=tokudb; insert into t values (0,0,0),(1,1,1),(2,2,2),(3,2,3),(4,2,4); explain select x,id from t force index (x) where x=0 and id=0; diff --git a/storage/tokudb/mysql-test/tokudb/r/ext_key_2_innodb.result b/storage/tokudb/mysql-test/tokudb/r/ext_key_2_innodb.result index a8953d1233f..01705af6b57 100644 --- a/storage/tokudb/mysql-test/tokudb/r/ext_key_2_innodb.result +++ b/storage/tokudb/mysql-test/tokudb/r/ext_key_2_innodb.result @@ -1,7 +1,7 @@ drop table if exists t; select @@optimizer_switch; @@optimizer_switch -index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on +index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=off create table t (a int not null, b int not null, c int not null, d int not null, primary key(a,b), key(c,a)) engine=innodb; insert into t values (0,0,0,0),(0,1,0,1); explain select c,a,b from t where c=0 and a=0 and b=1; diff --git a/storage/tokudb/mysql-test/tokudb/r/ext_key_2_tokudb.result b/storage/tokudb/mysql-test/tokudb/r/ext_key_2_tokudb.result index fd0ed8b367d..a45a2f7b04f 100644 --- a/storage/tokudb/mysql-test/tokudb/r/ext_key_2_tokudb.result +++ b/storage/tokudb/mysql-test/tokudb/r/ext_key_2_tokudb.result @@ -1,7 +1,7 @@ drop table if exists t; select @@optimizer_switch; @@optimizer_switch -index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on +index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=off create table t (a int not null, b int not null, c int not null, d int not null, primary key(a,b), key(c,a)) engine=tokudb; insert into t values (0,0,0,0),(0,1,0,1); explain select c,a,b from t where c=0 and a=0 and b=1; diff --git a/storage/tokudb/mysql-test/tokudb/r/i_s_tokudb_lock_waits_released.result b/storage/tokudb/mysql-test/tokudb/r/i_s_tokudb_lock_waits_released.result index 190581eddae..6f9592ddc1f 100644 --- a/storage/tokudb/mysql-test/tokudb/r/i_s_tokudb_lock_waits_released.result +++ b/storage/tokudb/mysql-test/tokudb/r/i_s_tokudb_lock_waits_released.result @@ -10,8 +10,10 @@ select * from information_schema.tokudb_lock_waits; requesting_trx_id blocking_trx_id lock_waits_dname lock_waits_key_left lock_waits_key_right lock_waits_start_time lock_waits_table_schema lock_waits_table_name lock_waits_table_dictionary_name set autocommit=0; set tokudb_prelock_empty=OFF; +set tokudb_lock_timeout=600000; insert into t values (1); set autocommit=0; +set tokudb_lock_timeout=600000; insert into t values (1); select * from information_schema.tokudb_locks; locks_trx_id locks_mysql_thread_id locks_dname locks_key_left locks_key_right locks_table_schema locks_table_name locks_table_dictionary_name @@ -38,9 +40,11 @@ locks_trx_id locks_mysql_thread_id locks_dname locks_key_left locks_key_right lo select * from information_schema.tokudb_lock_waits; requesting_trx_id blocking_trx_id lock_waits_dname lock_waits_key_left lock_waits_key_right lock_waits_start_time lock_waits_table_schema lock_waits_table_name lock_waits_table_dictionary_name set autocommit=0; +set tokudb_lock_timeout=600000; set tokudb_prelock_empty=OFF; replace into t values (1); set autocommit=0; +set tokudb_lock_timeout=600000; replace into t values (1); select * from information_schema.tokudb_locks; locks_trx_id locks_mysql_thread_id locks_dname locks_key_left locks_key_right locks_table_schema locks_table_name locks_table_dictionary_name diff --git a/storage/tokudb/mysql-test/tokudb/r/i_s_tokudb_lock_waits_timeout.result b/storage/tokudb/mysql-test/tokudb/r/i_s_tokudb_lock_waits_timeout.result index 379cdf90990..cc8b5f2f43f 100644 --- a/storage/tokudb/mysql-test/tokudb/r/i_s_tokudb_lock_waits_timeout.result +++ b/storage/tokudb/mysql-test/tokudb/r/i_s_tokudb_lock_waits_timeout.result @@ -14,7 +14,9 @@ set tokudb_prelock_empty=OFF; insert into t values (1); connect conn_b,localhost,root,,; set autocommit=0; -insert into t values (1); +set tokudb_prelock_empty=OFF; +set tokudb_lock_timeout=60000; +replace into t values (1); connection default; select * from information_schema.tokudb_locks; locks_trx_id locks_mysql_thread_id locks_dname locks_key_left locks_key_right locks_table_schema locks_table_name locks_table_dictionary_name diff --git a/storage/tokudb/mysql-test/tokudb/r/i_s_tokudb_locks.result b/storage/tokudb/mysql-test/tokudb/r/i_s_tokudb_locks.result index 83949d632c3..edb488c69b3 100644 --- a/storage/tokudb/mysql-test/tokudb/r/i_s_tokudb_locks.result +++ b/storage/tokudb/mysql-test/tokudb/r/i_s_tokudb_locks.result @@ -3,8 +3,8 @@ set tokudb_prelock_empty=false; drop table if exists t; create table t (id int primary key); set autocommit=0; -select * from information_schema.tokudb_locks; -locks_trx_id locks_mysql_thread_id locks_dname locks_key_left locks_key_right locks_table_schema locks_table_name locks_table_dictionary_name +select locks_dname,locks_key_left,locks_key_right,locks_table_schema,locks_table_name,locks_table_dictionary_name from information_schema.tokudb_locks where locks_table_schema='test' and locks_table_name='t' and locks_table_dictionary_name='main' order by locks_key_left, locks_key_right; +locks_dname locks_key_left locks_key_right locks_table_schema locks_table_name locks_table_dictionary_name insert into t values (1); insert into t values (3); insert into t values (5); @@ -14,20 +14,20 @@ insert into t values (2); insert into t values (4); insert into t values (6); connection default; -select * from information_schema.tokudb_locks order by locks_trx_id,locks_key_left; -locks_trx_id locks_mysql_thread_id locks_dname locks_key_left locks_key_right locks_table_schema locks_table_name locks_table_dictionary_name -TRX_ID MYSQL_ID ./test/t-main 0001000000 0001000000 test t main -TRX_ID MYSQL_ID ./test/t-main 0003000000 0003000000 test t main -TRX_ID MYSQL_ID ./test/t-main 0005000000 0005000000 test t main -TRX_ID MYSQL_ID ./test/t-main 0002000000 0002000000 test t main -TRX_ID MYSQL_ID ./test/t-main 0004000000 0004000000 test t main -TRX_ID MYSQL_ID ./test/t-main 0006000000 0006000000 test t main +select locks_dname,locks_key_left,locks_key_right,locks_table_schema,locks_table_name,locks_table_dictionary_name from information_schema.tokudb_locks where locks_table_schema='test' and locks_table_name='t' and locks_table_dictionary_name='main' order by locks_key_left, locks_key_right; +locks_dname locks_key_left locks_key_right locks_table_schema locks_table_name locks_table_dictionary_name +./test/t-main 0001000000 0001000000 test t main +./test/t-main 0002000000 0002000000 test t main +./test/t-main 0003000000 0003000000 test t main +./test/t-main 0004000000 0004000000 test t main +./test/t-main 0005000000 0005000000 test t main +./test/t-main 0006000000 0006000000 test t main connection conn_a; commit; connection default; commit; -select * from information_schema.tokudb_locks; -locks_trx_id locks_mysql_thread_id locks_dname locks_key_left locks_key_right locks_table_schema locks_table_name locks_table_dictionary_name +select locks_dname,locks_key_left,locks_key_right,locks_table_schema,locks_table_name,locks_table_dictionary_name from information_schema.tokudb_locks where locks_table_schema='test' and locks_table_name='t' and locks_table_dictionary_name='main' order by locks_key_left, locks_key_right; +locks_dname locks_key_left locks_key_right locks_table_schema locks_table_name locks_table_dictionary_name commit; disconnect conn_a; drop table t; diff --git a/storage/tokudb/mysql-test/tokudb/r/i_s_tokudb_locks_released.result b/storage/tokudb/mysql-test/tokudb/r/i_s_tokudb_locks_released.result index 0a5862e9322..aa58437fc69 100644 --- a/storage/tokudb/mysql-test/tokudb/r/i_s_tokudb_locks_released.result +++ b/storage/tokudb/mysql-test/tokudb/r/i_s_tokudb_locks_released.result @@ -9,6 +9,8 @@ set autocommit=0; set tokudb_prelock_empty=OFF; insert into t values (1); set autocommit=0; +set tokudb_prelock_empty=OFF; +set tokudb_lock_timeout=600000; insert into t values (1); select * from information_schema.tokudb_locks; locks_trx_id locks_mysql_thread_id locks_dname locks_key_left locks_key_right locks_table_schema locks_table_name locks_table_dictionary_name diff --git a/storage/tokudb/mysql-test/tokudb/r/i_s_tokudb_trx.result b/storage/tokudb/mysql-test/tokudb/r/i_s_tokudb_trx.result index 8dc79147cfc..21baa9510c8 100644 --- a/storage/tokudb/mysql-test/tokudb/r/i_s_tokudb_trx.result +++ b/storage/tokudb/mysql-test/tokudb/r/i_s_tokudb_trx.result @@ -1,28 +1,31 @@ set default_storage_engine='tokudb'; set tokudb_prelock_empty=false; drop table if exists t; -select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx; +select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx where trx_mysql_thread_id in(connection_id()); trx_id trx_mysql_thread_id set autocommit=0; create table t (id int primary key); insert into t values (1); -select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx; -trx_id trx_mysql_thread_id -TXN_ID_DEFAULT CLIENT_ID_DEFAULT +select count(trx_mysql_thread_id) from information_schema.tokudb_trx where trx_mysql_thread_id in(connection_id()); +count(trx_mysql_thread_id) +1 commit; -select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx; +select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx where trx_mysql_thread_id in(connection_id()); trx_id trx_mysql_thread_id connect conn_a,localhost,root,,; set autocommit=0; insert into t values (2); +select count(trx_mysql_thread_id) from information_schema.tokudb_trx where trx_mysql_thread_id in(connection_id()); +count(trx_mysql_thread_id) +1 connection default; -select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx; -trx_id trx_mysql_thread_id -TXN_ID_A CLIENT_ID_A +select count(trx_mysql_thread_id) from information_schema.tokudb_trx where trx_mysql_thread_id in(connection_id()); +count(trx_mysql_thread_id) +0 connection conn_a; commit; connection default; -select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx; +select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx where trx_mysql_thread_id in(connection_id()); trx_id trx_mysql_thread_id disconnect conn_a; drop table t; diff --git a/storage/tokudb/mysql-test/tokudb/r/replace-ignore.result b/storage/tokudb/mysql-test/tokudb/r/replace-ignore.result index 247c23f9788..e6f19fc2ead 100644 --- a/storage/tokudb/mysql-test/tokudb/r/replace-ignore.result +++ b/storage/tokudb/mysql-test/tokudb/r/replace-ignore.result @@ -185,7 +185,7 @@ a b c 8 8 80 explain select * from t where c = -1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t ref c c 5 const 1 Using where; Using index +1 SIMPLE t ref c c 5 const 1 Using index select * from t where c = -1; a b c insert ignore t values (15, 15, -1); @@ -211,7 +211,7 @@ a b c 15 15 150 explain select * from t where c = -1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t ref c c 5 const 1 Using where; Using index +1 SIMPLE t ref c c 5 const 1 Using index select * from t where c = -1; a b c drop table t; @@ -399,7 +399,7 @@ select * from t where c = 80; a b c explain select * from t where c = -1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t ref c c 5 const 1 Using where; Using index +1 SIMPLE t ref c c 5 const 1 Using index select * from t where c = -1; a b c 8 8 -1 @@ -423,7 +423,7 @@ select * from t where c = 150; a b c explain select * from t where c = -1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t ref c c 5 const 2 Using where; Using index +1 SIMPLE t ref c c 5 const 2 Using index select * from t where c = -1; a b c 8 8 -1 diff --git a/storage/tokudb/mysql-test/tokudb/r/rows-32m-rand-insert.result b/storage/tokudb/mysql-test/tokudb/r/rows-32m-rand-insert.result index b287c70469e..894de50f863 100644 --- a/storage/tokudb/mysql-test/tokudb/r/rows-32m-rand-insert.result +++ b/storage/tokudb/mysql-test/tokudb/r/rows-32m-rand-insert.result @@ -3,6 +3,7 @@ drop table if exists t; create table t (id int not null primary key, v longblob not null); select @@max_allowed_packet into @my_max_allowed_packet; set global max_allowed_packet=100000000; +connect conn1,localhost,root,,; insert ignore into t (id,v) values (floor(rand()*1000),repeat('a',(32*1024*1024-4)*rand())); insert ignore into t (id,v) values (floor(rand()*1000),repeat('a',(32*1024*1024-4)*rand())); insert ignore into t (id,v) values (floor(rand()*1000),repeat('a',(32*1024*1024-4)*rand())); @@ -1003,6 +1004,8 @@ insert ignore into t (id,v) values (floor(rand()*1000),repeat('a',(32*1024*1024- insert ignore into t (id,v) values (floor(rand()*1000),repeat('a',(32*1024*1024-4)*rand())); insert ignore into t (id,v) values (floor(rand()*1000),repeat('a',(32*1024*1024-4)*rand())); insert ignore into t (id,v) values (floor(rand()*1000),repeat('a',(32*1024*1024-4)*rand())); +connection default; +disconnect conn1; set global max_allowed_packet=@my_max_allowed_packet; check table t; Table Op Msg_type Msg_text diff --git a/storage/tokudb/mysql-test/tokudb/r/rows-32m-seq-insert.result b/storage/tokudb/mysql-test/tokudb/r/rows-32m-seq-insert.result index a242cac98c2..ddd5b908231 100644 --- a/storage/tokudb/mysql-test/tokudb/r/rows-32m-seq-insert.result +++ b/storage/tokudb/mysql-test/tokudb/r/rows-32m-seq-insert.result @@ -3,6 +3,7 @@ drop table if exists t; create table t (id int not null auto_increment primary key, v longblob not null); select @@max_allowed_packet into @my_max_allowed_packet; set global max_allowed_packet=100000000; +connect conn1,localhost,root,,; insert into t (v) values (repeat('a',(32*1024*1024-4)*rand())); insert into t (v) values (repeat('a',(32*1024*1024-4)*rand())); insert into t (v) values (repeat('a',(32*1024*1024-4)*rand())); @@ -1003,6 +1004,8 @@ insert into t (v) values (repeat('a',(32*1024*1024-4)*rand())); insert into t (v) values (repeat('a',(32*1024*1024-4)*rand())); insert into t (v) values (repeat('a',(32*1024*1024-4)*rand())); insert into t (v) values (repeat('a',(32*1024*1024-4)*rand())); +connection default; +disconnect conn1; set global max_allowed_packet=@my_max_allowed_packet; check table t; Table Op Msg_type Msg_text diff --git a/storage/tokudb/mysql-test/tokudb/r/type_bit.result b/storage/tokudb/mysql-test/tokudb/r/type_bit.result index a5587de9e54..c147c203d43 100644 --- a/storage/tokudb/mysql-test/tokudb/r/type_bit.result +++ b/storage/tokudb/mysql-test/tokudb/r/type_bit.result @@ -675,7 +675,7 @@ INSERT INTO t1(a) VALUES (65535),(65525),(65535),(65535),(65535),(65535),(65535),(65535),(65535),(65535); EXPLAIN SELECT 1 FROM t1 GROUP BY a; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range NULL a 3 NULL 6 Using index for group-by +1 SIMPLE t1 index NULL a 3 NULL 10 Using index SELECT 1 FROM t1 GROUP BY a; 1 1 diff --git a/storage/tokudb/mysql-test/tokudb/r/type_blob.result b/storage/tokudb/mysql-test/tokudb/r/type_blob.result index b48524db7f8..1350bc03045 100644 --- a/storage/tokudb/mysql-test/tokudb/r/type_blob.result +++ b/storage/tokudb/mysql-test/tokudb/r/type_blob.result @@ -24,8 +24,8 @@ create table t3 (a long, b long byte); show create TABLE t3; Table Create Table t3 CREATE TABLE `t3` ( - `a` mediumtext, - `b` mediumblob + `a` mediumtext DEFAULT NULL, + `b` mediumblob DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 show create TABLE t4; Table Create Table @@ -38,9 +38,9 @@ ERROR 42000: Column length too big for column 'a' (max = 255); use BLOB or TEXT CREATE TABLE t2 (a char(256)); ERROR 42000: Column length too big for column 'a' (max = 255); use BLOB or TEXT instead CREATE TABLE t1 (a varchar(70000) default "hello"); -ERROR 42000: Column length too big for column 'a' (max = 65535); use BLOB or TEXT instead +Warnings: +Note 1246 Converting column 'a' from VARCHAR to TEXT CREATE TABLE t2 (a blob default "hello"); -ERROR 42000: BLOB/TEXT column 'a' can't have a default value drop table if exists t1,t2; create table t1 (nr int(5) not null auto_increment,b blob,str char(10), primary key (nr)); insert into t1 values (null,"a","A"); @@ -363,7 +363,7 @@ create table t1 (a text, key (a(2100))); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` text, + `a` text DEFAULT NULL, KEY `a` (`a`(2100)) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 drop table t1; @@ -502,11 +502,7 @@ foobar boggle fish 10 drop table t1; create table t1 (id integer auto_increment unique,imagem LONGBLOB not null default ''); -Warnings: -Warning 1101 BLOB/TEXT column 'imagem' can't have a default value insert into t1 (id) values (1); -Warnings: -Warning 1364 Field 'imagem' doesn't have a default value select charset(load_file('../../std_data/words.dat')), collation(load_file('../../std_data/words.dat')), @@ -776,21 +772,19 @@ NULL 620000000000 drop table t1; create table t1 (a text default ''); -Warnings: -Warning 1101 BLOB/TEXT column 'a' can't have a default value show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` text + `a` text DEFAULT '' ) ENGINE=ENGINE DEFAULT CHARSET=latin1 insert into t1 values (default); select * from t1; a -NULL + drop table t1; set @@sql_mode='TRADITIONAL'; create table t1 (a text default ''); -ERROR 42000: BLOB/TEXT column 'a' can't have a default value +drop table t1; set @@sql_mode=''; CREATE TABLE t (c TEXT CHARSET ASCII); INSERT INTO t (c) VALUES (REPEAT('1',65537)); @@ -861,7 +855,7 @@ ERROR 42000: Column length too big for column 'a' (max = 255); use BLOB or TEXT CREATE TABLE b15776 (a char(4294967295)); ERROR 42000: Column length too big for column 'a' (max = 255); use BLOB or TEXT instead CREATE TABLE b15776 (a char(4294967296)); -ERROR 42000: Display width out of range for 'a' (max = 4294967295) +ERROR 42000: Column length too big for column 'a' (max = 255); use BLOB or TEXT instead CREATE TABLE b15776 (a year(4294967295)); Warnings: Note 1287 'YEAR(4294967295)' is deprecated and will be removed in a future release. Please use YEAR(4) instead @@ -870,8 +864,6 @@ SELECT * FROM b15776; a 2042 DROP TABLE b15776; -CREATE TABLE b15776 (a year(4294967296)); -ERROR 42000: Display width out of range for 'a' (max = 4294967295) CREATE TABLE b15776 (a year(0)); Warnings: Note 1287 'YEAR(0)' is deprecated and will be removed in a future release. Please use YEAR(4) instead @@ -879,11 +871,9 @@ DROP TABLE b15776; CREATE TABLE b15776 (a year(-2)); ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '-2))' at line 1 CREATE TABLE b15776 (a int(999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999)); -ERROR 42000: Display width out of range for 'a' (max = 4294967295) +ERROR 42000: Display width out of range for 'a' (max = 255) CREATE TABLE b15776 (a char(999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999)); -ERROR 42000: Display width out of range for 'a' (max = 4294967295) -CREATE TABLE b15776 (a year(999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999)); -ERROR 42000: Display width out of range for 'a' (max = 4294967295) +ERROR 42000: Column length too big for column 'a' (max = 255); use BLOB or TEXT instead CREATE TABLE b15776 select cast(null as char(4294967295)); show columns from b15776; Field Type Null Key Default Extra diff --git a/storage/tokudb/mysql-test/tokudb/r/type_decimal.result b/storage/tokudb/mysql-test/tokudb/r/type_decimal.result index e307fc21891..9c57bd68aac 100644 --- a/storage/tokudb/mysql-test/tokudb/r/type_decimal.result +++ b/storage/tokudb/mysql-test/tokudb/r/type_decimal.result @@ -222,7 +222,6 @@ drop table t1; create table t1 (a decimal(10,2) unsigned); insert into t1 values ("0.0"),("-0.0"),("+0.0"),("01.0"),("+01.0"),("-01.0"); Warnings: -Warning 1264 Out of range value for column 'a' at row 2 Warning 1264 Out of range value for column 'a' at row 6 insert into t1 values ("-.1"),("+.1"),(".1"); Warnings: @@ -281,7 +280,6 @@ drop table t1; create table t1 (a decimal(10,2) zerofill); insert into t1 values ("0.0"),("-0.0"),("+0.0"),("01.0"),("+01.0"),("-01.0"); Warnings: -Warning 1264 Out of range value for column 'a' at row 2 Warning 1264 Out of range value for column 'a' at row 6 insert into t1 values ("-.1"),("+.1"),(".1"); Warnings: @@ -814,10 +812,10 @@ c1 drop table t1; SELECT 1 % .123456789123456789123456789123456789123456789123456789123456789123456789123456789 AS '%'; % -0.012345687012345687012345687012 +0.01234568701234568701234568701234568701 SELECT MOD(1, .123456789123456789123456789123456789123456789123456789123456789123456789123456789) AS 'MOD()'; MOD() -0.012345687012345687012345687012 +0.01234568701234568701234568701234568701 create table t1 (f1 decimal(6,6),f2 decimal(6,6) zerofill); insert into t1 values (-0.123456,0.123456); select group_concat(f1),group_concat(f2) from t1; @@ -848,8 +846,8 @@ c 123456 SELECT ROUND( a, 100 ) AS c FROM t1 ORDER BY c; c -123456.000000000000000000000000000000 -123456.000000000000000000000000000000 +123456.00000000000000000000000000000000000000 +123456.00000000000000000000000000000000000000 CREATE TABLE t2( a NUMERIC, b INT ); INSERT INTO t2 VALUES (123456, 100); SELECT TRUNCATE( a, b ) AS c FROM t2 ORDER BY c; @@ -870,8 +868,8 @@ c 123456 SELECT ROUND( a, 100 ) AS c FROM t3 ORDER BY c; c -123456.000000000000000000000000000000 -123456.000000000000000000000000000000 +123456.00000000000000000000000000000000000000 +123456.00000000000000000000000000000000000000 CREATE TABLE t4( a DECIMAL, b INT ); INSERT INTO t4 VALUES (123456, 40), (123456, 40); SELECT TRUNCATE( a, b ) AS c FROM t4 ORDER BY c; @@ -884,8 +882,8 @@ c 123456 SELECT ROUND( a, 100 ) AS c FROM t4 ORDER BY c; c -123456.000000000000000000000000000000 -123456.000000000000000000000000000000 +123456.00000000000000000000000000000000000000 +123456.00000000000000000000000000000000000000 delete from t1; INSERT INTO t1 VALUES (1234567890, 20), (999.99, 5); Warnings: diff --git a/storage/tokudb/mysql-test/tokudb/r/type_enum.result b/storage/tokudb/mysql-test/tokudb/r/type_enum.result index 3a1654ef287..a1e61df126b 100644 --- a/storage/tokudb/mysql-test/tokudb/r/type_enum.result +++ b/storage/tokudb/mysql-test/tokudb/r/type_enum.result @@ -1670,7 +1670,7 @@ b ENUM('value',' show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT '1', + `a` int(11) DEFAULT 1, `b` enum('value','öäü_value','ÊÃÕ') NOT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 show columns from t1; diff --git a/storage/tokudb/mysql-test/tokudb/r/type_newdecimal.result b/storage/tokudb/mysql-test/tokudb/r/type_newdecimal.result index 7d5b555488e..9d8e09b32e2 100644 --- a/storage/tokudb/mysql-test/tokudb/r/type_newdecimal.result +++ b/storage/tokudb/mysql-test/tokudb/r/type_newdecimal.result @@ -177,7 +177,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `round(15.4,-1)` decimal(3,0) NOT NULL, `truncate(-5678.123451,-3)` decimal(4,0) NOT NULL, - `abs(-1.1)` decimal(3,1) NOT NULL, + `abs(-1.1)` decimal(2,1) NOT NULL, `-(-1.1)` decimal(2,1) NOT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 drop table t1; @@ -701,10 +701,10 @@ select .7777777777777777777777777777777777777 * 1000000000000000000; .7777777777777777777777777777777777777 * 1000000000000000000 -777777777777777777.777777777777777777700000000000 +777777777777777777.7777777777777777777000000000000000000 select .7777777777777777777777777777777777777 - 0.1; .7777777777777777777777777777777777777 - 0.1 -0.677777777777777777777777777778 +0.6777777777777777777777777777777777777 select .343434343434343434 + .343434343434343434; .343434343434343434 + .343434343434343434 0.686868686868686868 @@ -759,12 +759,12 @@ round(99999999999999999.999,3) select round(-99999999999999999.999,3); round(-99999999999999999.999,3) -99999999999999999.999 -select truncate(99999999999999999999999999999999999999,31); -truncate(99999999999999999999999999999999999999,31) -99999999999999999999999999999999999999.000000000000000000000000000000 -select truncate(99.999999999999999999999999999999999999,31); -truncate(99.999999999999999999999999999999999999,31) -99.999999999999999999999999999999 +select truncate(99999999999999999999999999999999999999,49); +truncate(99999999999999999999999999999999999999,49) +99999999999999999999999999999999999999.000000000000000000000000000000000000 +select truncate(99.999999999999999999999999999999999999,49); +truncate(99.999999999999999999999999999999999999,49) +99.99999999999999999999999999999999999900 select truncate(99999999999999999999999999999999999999,-31); truncate(99999999999999999999999999999999999999,-31) 99999990000000000000000000000000000000 @@ -890,7 +890,7 @@ create table t1 (col1 int, col2 decimal(30,25), col3 numeric(30,25)); insert into t1 values (1,0.0123456789012345678912345,0.0123456789012345678912345); select col2/9999999999 from t1 where col1=1; col2/9999999999 -0.000000000001234567890246913578 +0.00000000000123456789024691357814814136 select 9999999999/col2 from t1 where col1=1; 9999999999/col2 810000007209.000065537105051 @@ -925,10 +925,12 @@ select cast(ln(14000) as decimal(2,3)) c1; ERROR 42000: For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column ''). create table t1 (sl decimal(70,30)); ERROR 42000: Too big precision 70 specified for 'sl'. Maximum is 65. -create table t1 (sl decimal(32,31)); -ERROR 42000: Too big scale 31 specified for 'sl'. Maximum is 30. -create table t1 (sl decimal(0,38)); -ERROR 42000: Too big scale 38 specified for 'sl'. Maximum is 30. +create table t1 (sl decimal(32,39)); +ERROR 42000: Too big scale 39 specified for 'sl'. Maximum is 38. +create table t1 (sl decimal(67,38)); +ERROR 42000: Too big precision 67 specified for 'sl'. Maximum is 65. +create table t1 (sl decimal(0,50)); +ERROR 42000: Too big scale 50 specified for 'sl'. Maximum is 38. create table t1 (sl decimal(0,30)); ERROR 42000: For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column 'sl'). create table t1 (sl decimal(5, 5)); @@ -938,11 +940,11 @@ t1 CREATE TABLE `t1` ( `sl` decimal(5,5) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 drop table t1; -create table t1 (sl decimal(65, 30)); +create table t1 (sl decimal(65, 38)); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `sl` decimal(65,30) DEFAULT NULL + `sl` decimal(65,38) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 drop table t1; create table t1 ( @@ -974,8 +976,8 @@ f1 decimal (0,0) zerofill not null default 0); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `f0` decimal(30,30) unsigned zerofill NOT NULL DEFAULT '0.000000000000000000000000000000', - `f1` decimal(10,0) unsigned zerofill NOT NULL DEFAULT '0000000000' + `f0` decimal(30,30) unsigned zerofill NOT NULL DEFAULT 0.000000000000000000000000000000, + `f1` decimal(10,0) unsigned zerofill NOT NULL DEFAULT 0000000000 ) ENGINE=ENGINE DEFAULT CHARSET=latin1 drop table t1; drop procedure if exists wg2; @@ -1482,11 +1484,11 @@ CAST(1 AS decimal(65,10)) 1.0000000000 SELECT CAST(1 AS decimal(66,10)); ERROR 42000: Too big precision 66 specified for '1'. Maximum is 65. -SELECT CAST(1 AS decimal(65,30)); -CAST(1 AS decimal(65,30)) -1.000000000000000000000000000000 -SELECT CAST(1 AS decimal(65,31)); -ERROR 42000: Too big scale 31 specified for '1'. Maximum is 30. +SELECT CAST(1 AS decimal(65,38)); +CAST(1 AS decimal(65,38)) +1.00000000000000000000000000000000000000 +SELECT CAST(1 AS decimal(65,39)); +ERROR 42000: Too big scale 39 specified for '1'. Maximum is 38. CREATE TABLE t1 (a int DEFAULT NULL, b int DEFAULT NULL); INSERT INTO t1 VALUES (3,30), (1,10), (2,10); SELECT a+CAST(1 AS decimal(65,30)) AS aa, SUM(b) FROM t1 GROUP BY aa; @@ -1494,8 +1496,8 @@ aa SUM(b) 2.000000000000000000000000000000 10 3.000000000000000000000000000000 10 4.000000000000000000000000000000 30 -SELECT a+CAST(1 AS decimal(65,31)) AS aa, SUM(b) FROM t1 GROUP BY aa; -ERROR 42000: Too big scale 31 specified for '1'. Maximum is 30. +SELECT a+CAST(1 AS decimal(65,49)) AS aa, SUM(b) FROM t1 GROUP BY aa; +ERROR 42000: Too big scale 49 specified for '1'. Maximum is 38. DROP TABLE t1; CREATE TABLE t1 (a int DEFAULT NULL, b int DEFAULT NULL); INSERT INTO t1 VALUES (3,30), (1,10), (2,10); @@ -1505,31 +1507,31 @@ SELECT 1 FROM t1 GROUP BY @b := @a, @b; 1 1 DROP TABLE t1; -CREATE TABLE t1 SELECT 0.123456789012345678901234567890123456 AS f1; +CREATE TABLE t1 SELECT 0.1234567890123456789012345678901234567890123456789 AS f1; Warnings: Note 1265 Data truncated for column 'f1' at row 1 DESC t1; Field Type Null Key Default Extra -f1 decimal(31,30) NO NULL +f1 decimal(39,38) NO NULL SELECT f1 FROM t1; f1 -0.123456789012345678901234567890 +0.12345678901234567890123456789012345679 DROP TABLE t1; CREATE TABLE t1 SELECT 123451234512345123451234512345123451234512345.678906789067890678906789067890678906789067890 AS f1; Warnings: Warning 1264 Out of range value for column 'f1' at row 1 DESC t1; Field Type Null Key Default Extra -f1 decimal(65,30) NO NULL +f1 decimal(65,36) NO NULL SELECT f1 FROM t1; f1 -99999999999999999999999999999999999.999999999999999999999999999999 +99999999999999999999999999999.999999999999999999999999999999999999 DROP TABLE t1; select (1.20396873 * 0.89550000 * 0.68000000 * 1.08721696 * 0.99500000 * 1.01500000 * 1.01500000 * 0.99500000); (1.20396873 * 0.89550000 * 0.68000000 * 1.08721696 * 0.99500000 * 1.01500000 * 1.01500000 * 0.99500000) -0.812988073953673124592306939480 +0.81298807395367312459230693948000000000 create table t1 as select 5.05 / 0.014; Warnings: Note 1265 Data truncated for column '5.05 / 0.014' at row 1 @@ -1624,30 +1626,30 @@ Warnings: Note 1265 Data truncated for column 'my_col' at row 1 DESCRIBE t1; Field Type Null Key Default Extra -my_col decimal(30,30) NO NULL +my_col decimal(38,38) NO NULL SELECT my_col FROM t1; my_col -0.123456789123456789123456789123 +0.12345678912345678912345678912345678912 DROP TABLE t1; CREATE TABLE t1 SELECT 1 + .123456789123456789123456789123456789123456789123456789123456789123456789123456789 AS my_col; Warnings: Note 1265 Data truncated for column 'my_col' at row 1 DESCRIBE t1; Field Type Null Key Default Extra -my_col decimal(65,30) NO NULL +my_col decimal(65,38) NO NULL SELECT my_col FROM t1; my_col -1.123456789123456789123456789123 +1.12345678912345678912345678912345678912 DROP TABLE t1; CREATE TABLE t1 SELECT 1 * .123456789123456789123456789123456789123456789123456789123456789123456789123456789 AS my_col; Warnings: Note 1265 Data truncated for column 'my_col' at row 1 DESCRIBE t1; Field Type Null Key Default Extra -my_col decimal(65,30) NO NULL +my_col decimal(65,38) NO NULL SELECT my_col FROM t1; my_col -0.123456789123456789123456789123 +0.12345678912345678912345678912345678912 DROP TABLE t1; CREATE TABLE t1 SELECT 1 / .123456789123456789123456789123456789123456789123456789123456789123456789123456789 AS my_col; Warnings: @@ -1664,10 +1666,10 @@ Warnings: Note 1265 Data truncated for column 'my_col' at row 1 DESCRIBE t1; Field Type Null Key Default Extra -my_col decimal(65,30) YES NULL +my_col decimal(65,38) YES NULL SELECT my_col FROM t1; my_col -0.012345687012345687012345687012 +0.01234568701234568701234568701234568701 DROP TABLE t1; # # Bug#45261: Crash, stored procedure + decimal @@ -1728,30 +1730,30 @@ Warnings: Warning 1264 Out of range value for column 'c1' at row 1 DESC t1; Field Type Null Key Default Extra -c1 decimal(65,30) NO NULL +c1 decimal(65,36) NO NULL SELECT * FROM t1; c1 -99999999999999999999999999999999999.999999999999999999999999999999 +99999999999999999999999999999.999999999999999999999999999999999999 DROP TABLE t1; CREATE TABLE t1 SELECT /* 1 */ 1.10000000000000000000000000000000000000000000000000000000000000000000000000000001 /* 80 */ AS c1; DESC t1; Field Type Null Key Default Extra -c1 decimal(31,30) NO NULL +c1 decimal(39,38) NO NULL SELECT * FROM t1; c1 -1.100000000000000000000000000000 +1.10000000000000000000000000000000000000 DROP TABLE t1; CREATE TABLE t1 SELECT /* 1 */ 1.100000000000000000000000000000000000000000000000000000000000000000000000000000001 /* 81 */ AS c1; DESC t1; Field Type Null Key Default Extra -c1 decimal(31,30) NO NULL +c1 decimal(39,38) NO NULL SELECT * FROM t1; c1 -1.100000000000000000000000000000 +1.10000000000000000000000000000000000000 DROP TABLE t1; CREATE TABLE t1 SELECT .100000000000000000000000000000000000000000000000000000000000000000000000000000001 /* 81 */ @@ -1760,10 +1762,10 @@ Warnings: Note 1265 Data truncated for column 'c1' at row 1 DESC t1; Field Type Null Key Default Extra -c1 decimal(30,30) NO NULL +c1 decimal(38,38) NO NULL SELECT * FROM t1; c1 -0.100000000000000000000000000000 +0.10000000000000000000000000000000000000 DROP TABLE t1; CREATE TABLE t1 SELECT /* 45 */ 123456789012345678901234567890123456789012345.123456789012345678901234567890123456789012345 /* 45 */ @@ -1772,10 +1774,10 @@ Warnings: Warning 1264 Out of range value for column 'c1' at row 1 DESC t1; Field Type Null Key Default Extra -c1 decimal(65,30) NO NULL +c1 decimal(65,36) NO NULL SELECT * FROM t1; c1 -99999999999999999999999999999999999.999999999999999999999999999999 +99999999999999999999999999999.999999999999999999999999999999999999 DROP TABLE t1; CREATE TABLE t1 SELECT /* 65 */ 12345678901234567890123456789012345678901234567890123456789012345.1 /* 1 */ @@ -1808,20 +1810,18 @@ Warnings: Note 1265 Data truncated for column 'c1' at row 1 DESC t1; Field Type Null Key Default Extra -c1 decimal(30,30) NO NULL +c1 decimal(38,38) NO NULL SELECT * FROM t1; c1 -0.123456789012345678901234567890 +0.12345678901234567890123456789012345679 DROP TABLE t1; CREATE TABLE t1 AS SELECT 123.1234567890123456789012345678901 /* 31 */ AS c1; -Warnings: -Note 1265 Data truncated for column 'c1' at row 1 DESC t1; Field Type Null Key Default Extra -c1 decimal(33,30) NO NULL +c1 decimal(34,31) NO NULL SELECT * FROM t1; c1 -123.123456789012345678901234567890 +123.1234567890123456789012345678901 DROP TABLE t1; CREATE TABLE t1 SELECT 1.1 + CAST(1 AS DECIMAL(65,30)) AS c1; DESC t1; @@ -1837,22 +1837,20 @@ DROP TABLE t1; CREATE TABLE t1 (a DECIMAL(30,30)); INSERT INTO t1 VALUES (0.1),(0.2),(0.3); CREATE TABLE t2 SELECT MIN(a + 0.0000000000000000000000000000001) AS c1 FROM t1; -Warnings: -Note 1265 Data truncated for column 'c1' at row 4 DESC t2; Field Type Null Key Default Extra -c1 decimal(33,30) YES NULL +c1 decimal(33,31) YES NULL DROP TABLE t1,t2; CREATE TABLE t1 (a DECIMAL(30,30)); INSERT INTO t1 VALUES (0.1),(0.2),(0.3); -CREATE TABLE t2 SELECT IFNULL(a + 0.0000000000000000000000000000001, NULL) AS c1 FROM t1; +CREATE TABLE t2 SELECT IFNULL(a + 0.00000000000000000000000000000000000000000000000001, NULL) AS c1 FROM t1; Warnings: Note 1265 Data truncated for column 'c1' at row 1 Note 1265 Data truncated for column 'c1' at row 2 Note 1265 Data truncated for column 'c1' at row 3 DESC t2; Field Type Null Key Default Extra -c1 decimal(33,30) YES NULL +c1 decimal(52,38) YES NULL DROP TABLE t1,t2; CREATE TABLE t1 (a DECIMAL(30,30)); INSERT INTO t1 VALUES (0.1),(0.2),(0.3); @@ -1861,7 +1859,7 @@ Warnings: Note 1265 Data truncated for column 'c1' at row 1 DESC t2; Field Type Null Key Default Extra -c1 decimal(65,30) YES NULL +c1 decimal(65,38) YES NULL DROP TABLE t1,t2; # # Test that variables get maximum precision. @@ -1870,10 +1868,10 @@ SET @decimal= 1.1; CREATE TABLE t1 SELECT @decimal AS c1; DESC t1; Field Type Null Key Default Extra -c1 decimal(65,30) YES NULL +c1 decimal(65,38) YES NULL SELECT * FROM t1; c1 -1.100000000000000000000000000000 +1.10000000000000000000000000000000000000 DROP TABLE t1; # # Bug #45261 : Crash, stored procedure + decimal diff --git a/storage/tokudb/mysql-test/tokudb/r/type_ranges.result b/storage/tokudb/mysql-test/tokudb/r/type_ranges.result index dd9451fd101..23dc139d410 100644 --- a/storage/tokudb/mysql-test/tokudb/r/type_ranges.result +++ b/storage/tokudb/mysql-test/tokudb/r/type_ranges.result @@ -39,9 +39,6 @@ KEY (ulong), KEY (ulonglong,ulong), KEY (options,flags) ); -Warnings: -Warning 1101 BLOB/TEXT column 'mediumblob_col' can't have a default value -Warning 1101 BLOB/TEXT column 'longblob_col' can't have a default value show full fields from t1; Field Type Collation Null Key Default Extra Privileges Comment auto int(5) unsigned NULL NO PRI NULL auto_increment # @@ -64,8 +61,8 @@ time_field time NULL YES NULL # date_time datetime NULL YES NULL # blob_col blob NULL YES NULL # tinyblob_col tinyblob NULL YES NULL # -mediumblob_col mediumblob NULL NO NULL # -longblob_col longblob NULL NO NULL # +mediumblob_col mediumblob NULL NO '' # +longblob_col longblob NULL NO '' # options enum('one','two','tree') latin1_swedish_ci NO MUL NULL # flags set('one','two','tree') latin1_swedish_ci NO # show keys from t1; @@ -130,9 +127,6 @@ Warning 1264 Out of range value for column 'ushort' at row 1 Warning 1264 Out of range value for column 'umedium' at row 1 Warning 1265 Data truncated for column 'options' at row 1 insert into t1 (tiny) values (1); -Warnings: -Warning 1364 Field 'mediumblob_col' doesn't have a default value -Warning 1364 Field 'longblob_col' doesn't have a default value select auto,string,tiny,short,medium,long_int,longlong,real_float,real_double,utiny,ushort,umedium,ulong,ulonglong,mod(floor(time_stamp/1000000),1000000)-mod(curdate(),1000000),date_field,time_field,date_time,blob_col,tinyblob_col,mediumblob_col,longblob_col from t1; auto string tiny short medium long_int longlong real_float real_double utiny ushort umedium ulong ulonglong mod(floor(time_stamp/1000000),1000000)-mod(curdate(),1000000) date_field time_field date_time blob_col tinyblob_col mediumblob_col longblob_col 10 1 1 1 1 1 1 1.0 1.0000 1 00001 1 1 1 0 0000-00-00 00:00:00 0000-00-00 00:00:00 1 1 1 1 @@ -239,7 +233,7 @@ time_field time NULL YES NULL # date_time datetime NULL YES NULL # new_blob_col varchar(20) latin1_swedish_ci YES NULL # tinyblob_col tinyblob NULL YES NULL # -mediumblob_col mediumblob NULL NO NULL # +mediumblob_col mediumblob NULL NO '' # options enum('one','two','tree') latin1_swedish_ci NO MUL NULL # flags set('one','two','tree') latin1_swedish_ci NO # new_field char(10) latin1_swedish_ci NO new # @@ -265,7 +259,7 @@ time_field time NULL YES NULL # date_time datetime NULL YES NULL # new_blob_col varchar(20) latin1_swedish_ci YES NULL # tinyblob_col tinyblob NULL YES NULL # -mediumblob_col mediumblob NULL NO NULL # +mediumblob_col mediumblob NULL NO '' # options enum('one','two','tree') latin1_swedish_ci NO NULL # flags set('one','two','tree') latin1_swedish_ci NO # new_field char(10) latin1_swedish_ci NO new # diff --git a/storage/tokudb/mysql-test/tokudb/r/type_varchar.result b/storage/tokudb/mysql-test/tokudb/r/type_varchar.result index 8a8dde74a3b..bf98e12ce16 100644 --- a/storage/tokudb/mysql-test/tokudb/r/type_varchar.result +++ b/storage/tokudb/mysql-test/tokudb/r/type_varchar.result @@ -8,7 +8,7 @@ t1 CREATE TABLE `t1` ( `v` varchar(30) DEFAULT NULL, `c` char(3) DEFAULT NULL, `e` enum('abc','def','ghi') DEFAULT NULL, - `t` text + `t` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 show create table vchar; Table Create Table @@ -16,7 +16,7 @@ vchar CREATE TABLE `vchar` ( `v` varchar(30) DEFAULT NULL, `c` char(3) DEFAULT NULL, `e` enum('abc','def','ghi') DEFAULT NULL, - `t` text + `t` text DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 insert into t1 values ('abc', 'de', 'ghi', 'jkl'); insert into t1 values ('abc ', 'de ', 'ghi', 'jkl '); @@ -41,7 +41,7 @@ vchar CREATE TABLE `vchar` ( `v` varchar(30) DEFAULT NULL, `c` char(3) DEFAULT NULL, `e` enum('abc','def','ghi') DEFAULT NULL, - `t` text, + `t` text DEFAULT NULL, `i` int(11) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 select length(v),length(c),length(e),length(t) from vchar; @@ -412,7 +412,7 @@ alter table t1 modify f1 tinytext; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `f1` tinytext, + `f1` tinytext DEFAULT NULL, KEY `index1` (`f1`(10)) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 drop table t1; diff --git a/storage/tokudb/mysql-test/tokudb/t/background_job_manager.opt b/storage/tokudb/mysql-test/tokudb/t/background_job_manager.opt new file mode 100644 index 00000000000..3cc9ea3009e --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb/t/background_job_manager.opt @@ -0,0 +1 @@ +--tokudb-background-job-status diff --git a/storage/tokudb/mysql-test/tokudb/t/background_job_manager.test b/storage/tokudb/mysql-test/tokudb/t/background_job_manager.test new file mode 100644 index 00000000000..933814442e0 --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb/t/background_job_manager.test @@ -0,0 +1,139 @@ +# This is a comprehensive test for the background job manager and +# the information_schema.tokudb_background_job_status table +# +# This test validates that analyze table in various modes operate as expected +# for both foreground and background jobs. +# +# This test is NOT intended to test the actual results of an analysis. +# +# This test makes use of a global, debug only tokudb variable +# tokudb_debug_pause_background_job_manager in order to control the bjm and +# prevent it from acting on any queued jobs. +# This variable was necessary since the debug_sync facility requires any thread +# that is syncing to have a valid THD associated with it, which a background +# thread would not have. This variable is compiled out of release builds. + +-- source include/have_tokudb.inc +-- source include/have_debug.inc + +-- enable_query_log + +set @orig_auto_analyze = @@session.tokudb_auto_analyze; +set @orig_in_background = @@session.tokudb_analyze_in_background; +set @orig_mode = @@session.tokudb_analyze_mode; +set @orig_throttle = @@session.tokudb_analyze_throttle; +set @orig_time = @@session.tokudb_analyze_time; +set @orig_scale_percent = @@global.tokudb_cardinality_scale_percent; +set @orig_default_storage_engine = @@session.default_storage_engine; +set @orig_pause_background_job_manager = @@global.tokudb_debug_pause_background_job_manager; + +# first, lets set up to auto analyze in the background with about any activity +set session default_storage_engine='tokudb'; +set session tokudb_auto_analyze=1; +set session tokudb_analyze_in_background=1; +set session tokudb_analyze_mode=tokudb_analyze_standard; +set session tokudb_analyze_throttle=0; +set session tokudb_analyze_time=0; +set global tokudb_cardinality_scale_percent=DEFAULT; + +# in debug build, we can prevent the background job manager from running, +# let's do it so we can see that there was an analyze scheduled on the first +# insert +set global tokudb_debug_pause_background_job_manager=TRUE; + +# let's see what the i_s table is laid out like +show create table information_schema.tokudb_background_job_status; + +create table t1 (a int not null auto_increment, b int, c int, primary key(a), key kb(b), key kc(c), key kabc(a,b,c), key kab(a,b), key kbc(b,c)); + +insert into t1(b,c) values(0,0), (1,1), (2,2), (3,3); + +# insert above should have triggered an analyze, but since the bjm is paused, +# we will see it sitting in the queue +select database_name, table_name, job_type, job_params, scheduler from information_schema.tokudb_background_job_status; + +# some more tables +create table t2 like t1; +create table t3 like t1; +create table t4 like t1; + +# manually analyze, the t1 should be rejected because there is already a job +# pending. t2, t3 and t4 should get queued. +analyze table t1; +analyze table t2; +analyze table t3; +analyze table t4; + +select database_name, table_name, job_type, job_params, scheduler from information_schema.tokudb_background_job_status; + +# let the bjm go to clear the jobs +set global tokudb_debug_pause_background_job_manager=FALSE; + +# wait for the bjm queue to empty +-- disable_query_log +let $wait_condition=select count(*)=0 from information_schema.tokudb_background_job_status; +-- source include/wait_condition.inc +-- enable_query_log + +# pause the bjm again +set global tokudb_debug_pause_background_job_manager=TRUE; + +# add some new jobs +analyze table t1; +analyze table t2; +analyze table t3; +analyze table t4; + +select database_name, table_name, job_type, job_params, scheduler from information_schema.tokudb_background_job_status; + +# alter a table, should kill the job for t1 +alter table t1 add column d int; + +select database_name, table_name, job_type, job_params, scheduler from information_schema.tokudb_background_job_status; + +# try an explicit cancel on t2 +set session tokudb_analyze_mode=tokudb_analyze_cancel; +analyze table t2; + +select database_name, table_name, job_type, job_params, scheduler from information_schema.tokudb_background_job_status; + +# try a recount on t1, should reschedule a new job +set session tokudb_analyze_mode=tokudb_analyze_recount_rows; +analyze table t1; + +select database_name, table_name, job_type, job_params, scheduler from information_schema.tokudb_background_job_status; + +# do a foreground analysis that clashes with a background job, it should +# kill the background job for t3 and perform the analysis immediately +set session tokudb_analyze_mode=tokudb_analyze_standard; +set session tokudb_analyze_in_background=0; +analyze table t3; + +select database_name, table_name, job_type, job_params, scheduler from information_schema.tokudb_background_job_status; + +# drop the tables, should kill the remaining jobs for t1, and t4 +drop table t1; +drop table t2; +drop table t3; +drop table t4; + +select database_name, table_name, job_type, job_params, scheduler from information_schema.tokudb_background_job_status; + +# let the bjm go +set global tokudb_debug_pause_background_job_manager=FALSE; + +#cleanup +-- disable_query_log +let $wait_condition=select count(*)=0 from information_schema.tokudb_background_job_status; +-- source include/wait_condition.inc + +set session tokudb_auto_analyze = @orig_auto_analyze; +set session tokudb_analyze_in_background = @orig_in_background; +set session tokudb_analyze_mode = @orig_mode; +set session tokudb_analyze_throttle = @orig_throttle; +set session tokudb_analyze_time = @orig_time; +set global tokudb_cardinality_scale_percent = @orig_scale_percent; +set session default_storage_engine = @orig_default_storage_engine; +set global tokudb_debug_pause_background_job_manager = @orig_pause_background_job_manager; + +-- enable_query_log diff --git a/storage/tokudb/mysql-test/tokudb/t/card_auto_analyze_lots.test b/storage/tokudb/mysql-test/tokudb/t/card_auto_analyze_lots.test new file mode 100644 index 00000000000..ec74a4a28bc --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb/t/card_auto_analyze_lots.test @@ -0,0 +1,82 @@ +# Test the auto analyze on lots of tables +-- source include/have_tokudb.inc + +-- disable_query_log +let $max = 200; + +SET @orig_auto_analyze = @@session.tokudb_auto_analyze; +SET @orig_in_background = @@session.tokudb_analyze_in_background; +SET @orig_mode = @@session.tokudb_analyze_mode; +SET @orig_throttle = @@session.tokudb_analyze_throttle; +SET @orig_time = @@session.tokudb_analyze_time; + +SET SESSION tokudb_auto_analyze = 1; +SET SESSION tokudb_analyze_in_background = 0; +SET SESSION tokudb_analyze_mode = TOKUDB_ANALYZE_STANDARD; +SET SESSION tokudb_analyze_throttle = 0; +SET SESSION tokudb_analyze_time = 0; + +let $i = $max; +while ($i > 0) { + eval CREATE TABLE ar_$i (a INT, b INT, PRIMARY KEY (a), KEY bkey (b)) ENGINE=TOKUDB; + dec $i; +} + +# check that the one row insertion triggered auto analyze within the calling +# client context, the cardinality should go from NULL to 1 +let $i = $max; +while ($i > 0) { + eval INSERT INTO ar_$i VALUES (0, 0); + dec $i; +} +-- enable_query_log +let $i = $max; +while ($i > 0) { + eval SHOW INDEX FROM ar_$i; + dec $i; +} + + +-- disable_query_log +# check that lots of background analysis get scheduled and run +# cleanly and serially in the background +SET SESSION tokudb_auto_analyze = 1; +SET SESSION tokudb_analyze_in_background = 1; +SET SESSION tokudb_analyze_mode = TOKUDB_ANALYZE_STANDARD; +SET SESSION tokudb_analyze_throttle = 0; +SET SESSION tokudb_analyze_time = 0; + +let $i = $max; +while ($i > 0) { + eval INSERT INTO ar_$i VALUES (1, 1), (2, 1), (3, 2), (4, 2); + dec $i; +} + +let $i = $max; +while ($i > 0) { + eval INSERT INTO ar_$i VALUES (5, 3), (6, 3), (7, 4), (8, 4); + dec $i; +} + +# would be too long to wait for stats to become up to date here and +# checking is quite non-deterministic, InnoDB test does same thing + +# dropping tables should cancel any running background jobs +let $i = $max; +while ($i > 0) { + eval DROP TABLE ar_$i; + dec $i; +} + +# wait for the bjm queue to empty +-- disable_query_log +let $wait_condition=select count(*)=0 from information_schema.tokudb_background_job_status; +-- source include/wait_condition.inc + +SET SESSION tokudb_auto_analyze = @orig_auto_analyze; +SET SESSION tokudb_analyze_in_background = @orig_in_background; +SET SESSION tokudb_analyze_mode = @orig_mode; +SET SESSION tokudb_analyze_throttle = @orig_throttle; +SET SESSION tokudb_analyze_time = @orig_time; + +-- enable_query_log diff --git a/storage/tokudb/mysql-test/tokudb/t/card_scale_percent.test b/storage/tokudb/mysql-test/tokudb/t/card_scale_percent.test new file mode 100644 index 00000000000..47f1eb37989 --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb/t/card_scale_percent.test @@ -0,0 +1,56 @@ +-- source include/have_tokudb.inc + +-- disable_query_log + +set @orig_throttle = @@session.tokudb_analyze_throttle; +set @orig_time = @@session.tokudb_analyze_time; +set @orig_scale_percent = @@global.tokudb_cardinality_scale_percent; + +create table tt (a int, b int, c int, d int, primary key(a), key(b), key(c), key(d)) engine=tokudb; +let $i=0; +while ($i < 1000) { + eval insert into tt values ($i, $i, $i, $i); + inc $i; +} +while ($i < 2000) { + eval insert into tt values ($i, $i, $i, 0); + inc $i; +} +while ($i < 3000) { + eval insert into tt values ($i, $i, 0, 0); + inc $i; +} +while ($i < 4000) { + eval insert into tt values ($i, 0, 0, 0); + inc $i; +} + +set session tokudb_analyze_time=0; +set session tokudb_analyze_throttle=0; + +-- enable_query_log + +set global tokudb_cardinality_scale_percent = 10; +analyze table tt; +show indexes from tt; + +set global tokudb_cardinality_scale_percent = 50; +analyze table tt; +show indexes from tt; + +set global tokudb_cardinality_scale_percent = 100; +analyze table tt; +show indexes from tt; + +set global tokudb_cardinality_scale_percent = 200; +analyze table tt; +show indexes from tt; + +-- disable_query_log + +drop table tt; +set session tokudb_analyze_throttle = @orig_throttle; +set session tokudb_analyze_time = @orig_time; +set global tokudb_cardinality_scale_percent = @orig_scale_percent; + +-- enable_query_log diff --git a/storage/tokudb/mysql-test/tokudb/t/cluster_filter_unpack_varchar.test b/storage/tokudb/mysql-test/tokudb/t/cluster_filter_unpack_varchar.test index 3a30919a8ff..f3e494e0dd4 100644 --- a/storage/tokudb/mysql-test/tokudb/t/cluster_filter_unpack_varchar.test +++ b/storage/tokudb/mysql-test/tokudb/t/cluster_filter_unpack_varchar.test @@ -82,11 +82,11 @@ alter table t1 add key d(d,a) clustering=yes, add key b(b) clustering=yes; explain select * from t1 where c > "0"; select * from t1 where c > "0"; ---replace_column 7 NULL 9 NULL; +--replace_column 4 # 7 NULL 9 NULL; explain select * from t1 where b > "0"; select * from t1 where b > "0"; ---replace_column 7 NULL 9 NULL; +--replace_column 4 # 7 NULL 9 NULL; explain select * from t1 where d > "0"; select * from t1 where d > "0"; diff --git a/storage/tokudb/mysql-test/tokudb/t/cluster_key.test b/storage/tokudb/mysql-test/tokudb/t/cluster_key.test index 9280324b8cc..d491784577e 100644 --- a/storage/tokudb/mysql-test/tokudb/t/cluster_key.test +++ b/storage/tokudb/mysql-test/tokudb/t/cluster_key.test @@ -5,140 +5,8 @@ SET DEFAULT_STORAGE_ENGINE='tokudb'; DROP TABLE IF EXISTS t1; --enable_warnings -create table t1(a int, b int, c int, d int, primary key(a), key(b) clustering=yes, key (c))engine=tokudb; +create table t1(a int, b int, c int, d int, primary key(a,b,c), key(b) clustering=yes, key (c))engine=tokudb; -insert into t1 values (1,10,100,1000),(2,20,200,2000),(3,30,300,3000),(4,40,400,4000),(5,50,500,5000),(6,60,600,6000),(7,70,700,7000),(8,80,800,8000),(9,90,900,9000); - - -#normal queries - -# ignore rows column ---replace_column 9 NULL; -explain select * from t1 where a > 5; -select * from t1 where a > 5; - -# ignore rows column ---replace_column 9 NULL; -explain select * from t1 where b > 30; -select * from t1 where b > 30; - -# ignore rows column ---replace_column 9 NULL; -explain select * from t1 where c > 750; -select * from t1 where c > 750; - -#covering indexes - -# ignore rows column ---replace_column 9 NULL; -explain select a from t1 where a > 8; -select a from t1 where a > 8; - -# ignore rows column ---replace_column 9 NULL; -explain select a,b from t1 where b > 30; -select a,b from t1 where b > 30; - -# ignore rows column ---replace_column 9 NULL; -explain select a,b from t1 where c > 750; -select a,c from t1 where c > 750; - - -alter table t1 add index bdca(b,d,c,a) clustering=yes; -insert into t1 values (10,10,10,10); -alter table t1 drop index bdca; - -alter table t1 drop primary key; -# ignore rows column ---replace_column 9 NULL; -explain select * from t1 where a > 5; -select * from t1 where a > 5; - -# ignore rows column ---replace_column 9 NULL; -explain select * from t1 where b > 30; -select * from t1 where b > 30; - -# ignore rows column ---replace_column 9 NULL; -explain select * from t1 where c > 750; -select * from t1 where c > 750; - -#covering indexes - -# ignore rows column ---replace_column 9 NULL; -explain select b from t1 where b > 30; -select b from t1 where b > 30; - -# ignore rows column ---replace_column 9 NULL; -explain select b from t1 where c > 750; -select c from t1 where c > 750; - -alter table t1 add e varchar(20); - -alter table t1 add primary key (a); - -# ignore rows column ---replace_column 9 NULL; -explain select * from t1 where a > 5; -select * from t1 where a > 5; - -# ignore rows column ---replace_column 9 NULL; -explain select * from t1 where b > 30; -select * from t1 where b > 30; - -# ignore rows column ---replace_column 9 NULL; -explain select * from t1 where c > 750; -select * from t1 where c > 750; - -#covering indexes - -# ignore rows column ---replace_column 9 NULL; -explain select a from t1 where a > 8; -select a from t1 where a > 8; - -# ignore rows column ---replace_column 9 NULL; -explain select a,b from t1 where b > 30; -select a,b from t1 where b > 30; - -# ignore rows column ---replace_column 9 NULL; -explain select a,b from t1 where c > 750; -select a,c from t1 where c > 750; - - -alter table t1 drop primary key; -# ignore rows column ---replace_column 9 NULL; -explain select * from t1 where a > 5; -select * from t1 where a > 5; - -# ignore rows column ---replace_column 9 NULL; -explain select * from t1 where b > 30; -select * from t1 where b > 30; - -# ignore rows column ---replace_column 9 NULL; -explain select * from t1 where c > 750; -select * from t1 where c > 750; - -#covering indexes -# ignore rows column ---replace_column 9 NULL; -explain select b from t1 where b > 30; -select b from t1 where b > 30; - -# ignore rows column ---replace_column 9 NULL; -explain select b from t1 where c > 750; -select c from t1 where c > 750; +--source ../include/cluster_key.inc drop table t1; diff --git a/storage/tokudb/mysql-test/tokudb/t/cluster_key_part.test b/storage/tokudb/mysql-test/tokudb/t/cluster_key_part.test index 8da7aa1078f..310866d14bc 100644 --- a/storage/tokudb/mysql-test/tokudb/t/cluster_key_part.test +++ b/storage/tokudb/mysql-test/tokudb/t/cluster_key_part.test @@ -5,19 +5,47 @@ source include/have_partition.inc; set default_storage_engine='tokudb'; disable_warnings; -drop table if exists t; +DROP TABLE IF EXISTS t; enable_warnings; -create table t ( - x int not null, - y int not null, - primary key(x)) -partition by hash(x) partitions 2; +CREATE TABLE t (a INT NOT NULL AUTO_INCREMENT, b INT, PRIMARY KEY(a), KEY b(b) CLUSTERING=YES) ENGINE=TokuDB +PARTITION BY RANGE(a) (PARTITION p0 VALUES LESS THAN (100) ENGINE = TokuDB, PARTITION p2 VALUES LESS THAN MAXVALUE ENGINE = TokuDB); -show create table t; +SHOW CREATE TABLE t; -alter table t add key(y) clustering=yes; +DROP TABLE t; -show create table t; -drop table t; + +CREATE TABLE t (x INT NOT NULL, y INT NOT NULL, PRIMARY KEY(x)) +PARTITION BY HASH(x) PARTITIONS 2; + +SHOW CREATE TABLE t; + +ALTER TABLE t ADD KEY(y) CLUSTERING=YES; + +SHOW CREATE TABLE t; + +DROP TABLE t; + + +CREATE TABLE t1(a INT, b INT, c INT, d INT, PRIMARY KEY(a,b,c), KEY(b) CLUSTERING=YES, KEY (c)) ENGINE=TOKUDB +PARTITION BY RANGE(a) (PARTITION p0 VALUES LESS THAN (5) ENGINE = TOKUDB, PARTITION p2 VALUES LESS THAN MAXVALUE ENGINE = TOKUDB); + +--source ../include/cluster_key.inc + +DROP TABLE t1; + +CREATE TABLE t1(a INT, b INT, c INT, d INT, PRIMARY KEY(a,b,c), KEY(b) CLUSTERING=YES, KEY (c)) ENGINE=TOKUDB +PARTITION BY RANGE(b) (PARTITION p0 VALUES LESS THAN (50) ENGINE = TOKUDB, PARTITION p2 VALUES LESS THAN MAXVALUE ENGINE = TOKUDB); + +--source ../include/cluster_key.inc + +DROP TABLE t1; + +CREATE TABLE t1(a INT, b INT, c INT, d INT, PRIMARY KEY(a,b,c), KEY(b) CLUSTERING=YES, KEY (c)) ENGINE=TOKUDB +PARTITION BY RANGE(c) (PARTITION p0 VALUES LESS THAN (500) ENGINE = TOKUDB, PARTITION p2 VALUES LESS THAN MAXVALUE ENGINE = TOKUDB); + +--source ../include/cluster_key.inc + +DROP TABLE t1; diff --git a/storage/tokudb/mysql-test/tokudb/t/disabled.def b/storage/tokudb/mysql-test/tokudb/t/disabled.def new file mode 100644 index 00000000000..f7413a0edc5 --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb/t/disabled.def @@ -0,0 +1,28 @@ +mvcc-19: tokutek +mvcc-20: tokutek +mvcc-27: tokutek +storage_engine_default: tokudb is not the default storage engine +fast_update_binlog_mixed : https://tokutek.atlassian.net/browse/DB-871 +fast_update_binlog_row : https://tokutek.atlassian.net/browse/DB-871 +fast_update_binlog_statement : https://tokutek.atlassian.net/browse/DB-871 +fast_update_blobs_fixed_varchar : https://tokutek.atlassian.net/browse/DB-871 +fast_update_blobs : https://tokutek.atlassian.net/browse/DB-871 +fast_update_blobs_with_varchar : https://tokutek.atlassian.net/browse/DB-871 +fast_update_char : https://tokutek.atlassian.net/browse/DB-871 +fast_update_deadlock : https://tokutek.atlassian.net/browse/DB-871 +fast_update_decr_floor : https://tokutek.atlassian.net/browse/DB-871 +fast_update_disable_slow_update : https://tokutek.atlassian.net/browse/DB-871 +fast_update_error : https://tokutek.atlassian.net/browse/DB-871 +fast_update_int_bounds : https://tokutek.atlassian.net/browse/DB-871 +fast_update_int : https://tokutek.atlassian.net/browse/DB-871 +fast_update_key : https://tokutek.atlassian.net/browse/DB-871 +fast_update_sqlmode : https://tokutek.atlassian.net/browse/DB-871 +fast_update_uint_bounds : https://tokutek.atlassian.net/browse/DB-871 +fast_update_varchar : https://tokutek.atlassian.net/browse/DB-871 +fast_upsert_bin_pad : https://tokutek.atlassian.net/browse/DB-871 +fast_upsert_char : https://tokutek.atlassian.net/browse/DB-871 +fast_upsert_deadlock : https://tokutek.atlassian.net/browse/DB-871 +fast_upsert_int : https://tokutek.atlassian.net/browse/DB-871 +fast_upsert_key : https://tokutek.atlassian.net/browse/DB-871 +fast_upsert_sqlmode : https://tokutek.atlassian.net/browse/DB-871 +fast_upsert_values : https://tokutek.atlassian.net/browse/DB-871 diff --git a/storage/tokudb/mysql-test/tokudb/t/i_s_tokudb_lock_waits_released.test b/storage/tokudb/mysql-test/tokudb/t/i_s_tokudb_lock_waits_released.test index 3fd6ddb88fe..012c0af63b5 100644 --- a/storage/tokudb/mysql-test/tokudb/t/i_s_tokudb_lock_waits_released.test +++ b/storage/tokudb/mysql-test/tokudb/t/i_s_tokudb_lock_waits_released.test @@ -25,10 +25,12 @@ select * from information_schema.tokudb_lock_waits; connect (conn_a,localhost,root,,); set autocommit=0; set tokudb_prelock_empty=OFF; # disable the bulk loader +set tokudb_lock_timeout=600000; # set lock wait timeout to 10 minutes insert into t values (1); connect (conn_b,localhost,root,,); set autocommit=0; +set tokudb_lock_timeout=600000; # set lock wait timeout to 10 minutes send insert into t values (1); # should find the presence of a lock on 1st transaction @@ -74,11 +76,13 @@ select * from information_schema.tokudb_lock_waits; connect (conn_a,localhost,root,,); set autocommit=0; +set tokudb_lock_timeout=600000; # set lock wait timeout to 10 minutes set tokudb_prelock_empty=OFF; # disable the bulk loader replace into t values (1); connect (conn_b,localhost,root,,); set autocommit=0; +set tokudb_lock_timeout=600000; # set lock wait timeout to 10 minutes send replace into t values (1); # should find the presence of a lock on 1st transaction diff --git a/storage/tokudb/mysql-test/tokudb/t/i_s_tokudb_lock_waits_timeout.test b/storage/tokudb/mysql-test/tokudb/t/i_s_tokudb_lock_waits_timeout.test index 06923d4ca58..42fb548814f 100644 --- a/storage/tokudb/mysql-test/tokudb/t/i_s_tokudb_lock_waits_timeout.test +++ b/storage/tokudb/mysql-test/tokudb/t/i_s_tokudb_lock_waits_timeout.test @@ -21,11 +21,14 @@ insert into t values (1); connect (conn_b,localhost,root,,); set autocommit=0; -send insert into t values (1); +set tokudb_prelock_empty=OFF; +set tokudb_lock_timeout=60000; # set lock wait timeout to 1 minute + +send replace into t values (1); # should find the presence of a lock on 1st transaction connection default; -let $wait_condition= select count(*)=1 from information_schema.processlist where info='insert into t values (1)' and state='update'; +let $wait_condition= select count(*)=1 from information_schema.processlist where info='replace into t values (1)' and state='update'; source include/wait_condition.inc; real_sleep 1; # delay a little to shorten the update -> write row -> lock wait race @@ -41,7 +44,9 @@ replace_column 1 TRX_ID 2 MYSQL_ID; select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx; connection conn_a; -sleep 5; # sleep longer than the lock timer to force a lock timeout on txn_b +real_sleep 45; # sleep till we get close to timeout since wait_condidion will timeout @ 30 seconds +let $wait_condition= select count(*)=0 from information_schema.processlist where info='replace into t values (1)' and state='update'; +source include/wait_condition.inc; commit; # verify that the lock on the 1st transaction is released and replaced by the lock for the 2nd transaction diff --git a/storage/tokudb/mysql-test/tokudb/t/i_s_tokudb_locks.test b/storage/tokudb/mysql-test/tokudb/t/i_s_tokudb_locks.test index e5a67559b1a..8f205ad7f45 100644 --- a/storage/tokudb/mysql-test/tokudb/t/i_s_tokudb_locks.test +++ b/storage/tokudb/mysql-test/tokudb/t/i_s_tokudb_locks.test @@ -12,7 +12,7 @@ set autocommit=0; let $default_id=`select connection_id()`; # should be empty -select * from information_schema.tokudb_locks; +select locks_dname,locks_key_left,locks_key_right,locks_table_schema,locks_table_name,locks_table_dictionary_name from information_schema.tokudb_locks where locks_table_schema='test' and locks_table_name='t' and locks_table_dictionary_name='main' order by locks_key_left, locks_key_right; insert into t values (1); insert into t values (3); @@ -28,8 +28,7 @@ insert into t values (6); # should find 3 locks for 2 transactions connection default; -replace_column 1 TRX_ID 2 MYSQL_ID; -eval select * from information_schema.tokudb_locks order by locks_trx_id,locks_key_left; +eval select locks_dname,locks_key_left,locks_key_right,locks_table_schema,locks_table_name,locks_table_dictionary_name from information_schema.tokudb_locks where locks_table_schema='test' and locks_table_name='t' and locks_table_dictionary_name='main' order by locks_key_left, locks_key_right; connection conn_a; commit; @@ -37,9 +36,9 @@ connection default; commit; # should be empty -select * from information_schema.tokudb_locks; +select locks_dname,locks_key_left,locks_key_right,locks_table_schema,locks_table_name,locks_table_dictionary_name from information_schema.tokudb_locks where locks_table_schema='test' and locks_table_name='t' and locks_table_dictionary_name='main' order by locks_key_left, locks_key_right; commit; disconnect conn_a; -drop table t; \ No newline at end of file +drop table t; diff --git a/storage/tokudb/mysql-test/tokudb/t/i_s_tokudb_locks_released.test b/storage/tokudb/mysql-test/tokudb/t/i_s_tokudb_locks_released.test index 19f413e79f9..bbb0533e784 100644 --- a/storage/tokudb/mysql-test/tokudb/t/i_s_tokudb_locks_released.test +++ b/storage/tokudb/mysql-test/tokudb/t/i_s_tokudb_locks_released.test @@ -27,6 +27,8 @@ insert into t values (1); connect (conn_b,localhost,root,,); set autocommit=0; +set tokudb_prelock_empty=OFF; +set tokudb_lock_timeout=600000; # set lock wait timeout to 10 minutes send insert into t values (1); diff --git a/storage/tokudb/mysql-test/tokudb/t/i_s_tokudb_trx.test b/storage/tokudb/mysql-test/tokudb/t/i_s_tokudb_trx.test index d3c2636ba54..517280391c4 100644 --- a/storage/tokudb/mysql-test/tokudb/t/i_s_tokudb_trx.test +++ b/storage/tokudb/mysql-test/tokudb/t/i_s_tokudb_trx.test @@ -8,35 +8,32 @@ drop table if exists t; enable_warnings; # should be empty -select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx; +select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx where trx_mysql_thread_id in(connection_id()); # should have my txn -let $default_id=`select connection_id()`; set autocommit=0; create table t (id int primary key); insert into t values (1); -replace_column 1 TXN_ID_DEFAULT 2 CLIENT_ID_DEFAULT; -eval select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx; +select count(trx_mysql_thread_id) from information_schema.tokudb_trx where trx_mysql_thread_id in(connection_id()); # should be empty commit; -select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx; +select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx where trx_mysql_thread_id in(connection_id()); connect(conn_a,localhost,root,,); -let a_id=`select connection_id()`; set autocommit=0; insert into t values (2); +select count(trx_mysql_thread_id) from information_schema.tokudb_trx where trx_mysql_thread_id in(connection_id()); connection default; -replace_column 1 TXN_ID_A 2 CLIENT_ID_A; -eval select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx; +select count(trx_mysql_thread_id) from information_schema.tokudb_trx where trx_mysql_thread_id in(connection_id()); connection conn_a; commit; connection default; # should be empty -select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx; +select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx where trx_mysql_thread_id in(connection_id()); disconnect conn_a; -drop table t; \ No newline at end of file +drop table t; diff --git a/storage/tokudb/mysql-test/tokudb/t/suite.opt b/storage/tokudb/mysql-test/tokudb/t/suite.opt new file mode 100644 index 00000000000..23511b05020 --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb/t/suite.opt @@ -0,0 +1 @@ +$TOKUDB_OPT $TOKUDB_LOAD_ADD --loose-tokudb-check-jemalloc=0 diff --git a/storage/tokudb/mysql-test/tokudb/t/type_blob.test b/storage/tokudb/mysql-test/tokudb/t/type_blob.test index 4ea452ab732..6a429c46a55 100644 --- a/storage/tokudb/mysql-test/tokudb/t/type_blob.test +++ b/storage/tokudb/mysql-test/tokudb/t/type_blob.test @@ -37,9 +37,7 @@ drop table t1,t2,t3,t4; CREATE TABLE t1 (a char(257) default "hello"); --error 1074 CREATE TABLE t2 (a char(256)); ---error 1074 CREATE TABLE t1 (a varchar(70000) default "hello"); ---error 1101 CREATE TABLE t2 (a blob default "hello"); # Safety to be able to continue with other tests if above fails @@ -439,8 +437,8 @@ insert into t1 values (default); select * from t1; drop table t1; set @@sql_mode='TRADITIONAL'; ---error ER_BLOB_CANT_HAVE_DEFAULT create table t1 (a text default ''); +drop table t1; set @@sql_mode=''; # @@ -522,7 +520,7 @@ CREATE TABLE b15776 (a char(2147483648)); --error ER_TOO_BIG_FIELDLENGTH CREATE TABLE b15776 (a char(4294967295)); # Even BLOB won't hold ---error ER_TOO_BIG_DISPLAYWIDTH +--error ER_TOO_BIG_FIELDLENGTH CREATE TABLE b15776 (a char(4294967296)); @@ -534,8 +532,6 @@ CREATE TABLE b15776 (a year(4294967295)); INSERT INTO b15776 VALUES (42); SELECT * FROM b15776; DROP TABLE b15776; ---error ER_TOO_BIG_DISPLAYWIDTH -CREATE TABLE b15776 (a year(4294967296)); CREATE TABLE b15776 (a year(0)); # 0 is special case, means default size DROP TABLE b15776; --error ER_PARSE_ERROR @@ -543,13 +539,11 @@ CREATE TABLE b15776 (a year(-2)); # We've already tested the case, but this should visually show that -# widths that are too large to be interpreted cause DISPLAYWIDTH errors. +# widths that are too large to be interpreted cause errors. --error ER_TOO_BIG_DISPLAYWIDTH CREATE TABLE b15776 (a int(999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999)); ---error ER_TOO_BIG_DISPLAYWIDTH +--error ER_TOO_BIG_FIELDLENGTH CREATE TABLE b15776 (a char(999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999)); ---error ER_TOO_BIG_DISPLAYWIDTH -CREATE TABLE b15776 (a year(999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999)); ## Do not select, too much memory needed. CREATE TABLE b15776 select cast(null as char(4294967295)); diff --git a/storage/tokudb/mysql-test/tokudb/t/type_newdecimal.test b/storage/tokudb/mysql-test/tokudb/t/type_newdecimal.test index 6047993e1ad..17916288e85 100644 --- a/storage/tokudb/mysql-test/tokudb/t/type_newdecimal.test +++ b/storage/tokudb/mysql-test/tokudb/t/type_newdecimal.test @@ -611,14 +611,14 @@ select round(99999999999999999.999,3); select round(-99999999999999999.999,3); #-- should return -100000000000000000.000 # -select truncate(99999999999999999999999999999999999999,31); +select truncate(99999999999999999999999999999999999999,49); #-- should return 99999999999999999999999999999999999999.000 # -select truncate(99.999999999999999999999999999999999999,31); +select truncate(99.999999999999999999999999999999999999,49); #-- should return 99.9999999999999999999999999999999 # select truncate(99999999999999999999999999999999999999,-31); -# should return 90000000000000000000000000000000 +# should return 99999990000000000000000000000000000000 # #-- 6. Set functions (AVG, SUM, COUNT) should work. # @@ -965,9 +965,11 @@ select cast(ln(14000) as decimal(2,3)) c1; --error 1426 create table t1 (sl decimal(70,30)); --error 1425 -create table t1 (sl decimal(32,31)); +create table t1 (sl decimal(32,39)); +--error 1426 +create table t1 (sl decimal(67,38)); --error 1425 -create table t1 (sl decimal(0,38)); +create table t1 (sl decimal(0,50)); --error 1427 create table t1 (sl decimal(0,30)); create table t1 (sl decimal(5, 5)); @@ -975,7 +977,7 @@ replace_regex /ENGINE=[a-zA-Z]*/ENGINE=ENGINE/; show create table t1; drop table t1; # Test limits -create table t1 (sl decimal(65, 30)); +create table t1 (sl decimal(65, 38)); replace_regex /ENGINE=[a-zA-Z]*/ENGINE=ENGINE/; show create table t1; drop table t1; @@ -1190,15 +1192,15 @@ SELECT CAST(1 AS decimal(65,10)); --error ER_TOO_BIG_PRECISION SELECT CAST(1 AS decimal(66,10)); -SELECT CAST(1 AS decimal(65,30)); +SELECT CAST(1 AS decimal(65,38)); --error ER_TOO_BIG_SCALE -SELECT CAST(1 AS decimal(65,31)); +SELECT CAST(1 AS decimal(65,39)); CREATE TABLE t1 (a int DEFAULT NULL, b int DEFAULT NULL); INSERT INTO t1 VALUES (3,30), (1,10), (2,10); SELECT a+CAST(1 AS decimal(65,30)) AS aa, SUM(b) FROM t1 GROUP BY aa; --error ER_TOO_BIG_SCALE -SELECT a+CAST(1 AS decimal(65,31)) AS aa, SUM(b) FROM t1 GROUP BY aa; +SELECT a+CAST(1 AS decimal(65,49)) AS aa, SUM(b) FROM t1 GROUP BY aa; DROP TABLE t1; @@ -1223,7 +1225,7 @@ DROP TABLE t1; # maxmimum precision of 30 places after the decimal point. Show that # temp field creation beyond that works and throws a truncation warning. # DECIMAL(37,36) should be adjusted to DECIMAL(31,30). -CREATE TABLE t1 SELECT 0.123456789012345678901234567890123456 AS f1; +CREATE TABLE t1 SELECT 0.1234567890123456789012345678901234567890123456789 AS f1; DESC t1; SELECT f1 FROM t1; DROP TABLE t1; @@ -1432,7 +1434,7 @@ DROP TABLE t1,t2; CREATE TABLE t1 (a DECIMAL(30,30)); INSERT INTO t1 VALUES (0.1),(0.2),(0.3); -CREATE TABLE t2 SELECT IFNULL(a + 0.0000000000000000000000000000001, NULL) AS c1 FROM t1; +CREATE TABLE t2 SELECT IFNULL(a + 0.00000000000000000000000000000000000000000000000001, NULL) AS c1 FROM t1; DESC t2; DROP TABLE t1,t2; diff --git a/storage/tokudb/mysql-test/tokudb_add_index/t/suite.opt b/storage/tokudb/mysql-test/tokudb_add_index/t/suite.opt new file mode 100644 index 00000000000..23511b05020 --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_add_index/t/suite.opt @@ -0,0 +1 @@ +$TOKUDB_OPT $TOKUDB_LOAD_ADD --loose-tokudb-check-jemalloc=0 diff --git a/storage/tokudb/mysql-test/tokudb_alter_table/disabled.def b/storage/tokudb/mysql-test/tokudb_alter_table/disabled.def deleted file mode 100644 index 828c5ee216b..00000000000 --- a/storage/tokudb/mysql-test/tokudb_alter_table/disabled.def +++ /dev/null @@ -1,6 +0,0 @@ -# alter table -hcad_tmp_tables: tmp tables bypass hot alter, we run hcad_tmp_tables_56 instead -hcad_with_locks: how this could work, if alter needs an exclusive mdl lock? - -frm_discover_partition: No partition discovery in MariaDB 5.5 - diff --git a/storage/tokudb/mysql-test/tokudb_alter_table/r/alter_column_default.result b/storage/tokudb/mysql-test/tokudb_alter_table/r/alter_column_default.result index 2c1390ad2a4..4c63047444d 100644 --- a/storage/tokudb/mysql-test/tokudb_alter_table/r/alter_column_default.result +++ b/storage/tokudb/mysql-test/tokudb_alter_table/r/alter_column_default.result @@ -5,14 +5,14 @@ CREATE TABLE foo (a INT NOT NULL DEFAULT 0, b INT DEFAULT NULL); SHOW CREATE TABLE foo; Table Create Table foo CREATE TABLE `foo` ( - `a` int(11) NOT NULL DEFAULT '0', + `a` int(11) NOT NULL DEFAULT 0, `b` int(11) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 ALTER TABLE foo ALTER COLUMN a SET DEFAULT 100; SHOW CREATE TABLE foo; Table Create Table foo CREATE TABLE `foo` ( - `a` int(11) NOT NULL DEFAULT '100', + `a` int(11) NOT NULL DEFAULT 100, `b` int(11) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 ALTER TABLE foo ALTER COLUMN a DROP DEFAULT; @@ -27,7 +27,7 @@ SHOW CREATE TABLE foo; Table Create Table foo CREATE TABLE `foo` ( `a` int(11) NOT NULL, - `b` int(11) DEFAULT '42' + `b` int(11) DEFAULT 42 ) ENGINE=TokuDB DEFAULT CHARSET=latin1 ALTER TABLE foo ALTER COLUMN b DROP DEFAULT; SHOW CREATE TABLE foo; diff --git a/storage/tokudb/mysql-test/tokudb_alter_table/r/hcr.result b/storage/tokudb/mysql-test/tokudb_alter_table/r/hcr.result index f4fc1b67bb6..f850e28081e 100644 --- a/storage/tokudb/mysql-test/tokudb_alter_table/r/hcr.result +++ b/storage/tokudb/mysql-test/tokudb_alter_table/r/hcr.result @@ -31,7 +31,7 @@ Table Create Table foo CREATE TABLE `foo` ( `a` int(11) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` blob, + `c` blob DEFAULT NULL, KEY `b` (`b`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 select * from foo; diff --git a/storage/tokudb/mysql-test/tokudb_alter_table/r/hcr3.result b/storage/tokudb/mysql-test/tokudb_alter_table/r/hcr3.result index 4c700489b7f..b7aefaa4b8d 100644 --- a/storage/tokudb/mysql-test/tokudb_alter_table/r/hcr3.result +++ b/storage/tokudb/mysql-test/tokudb_alter_table/r/hcr3.result @@ -14,7 +14,7 @@ foo CREATE TABLE `foo` ( `b` bigint(20) DEFAULT NULL, `c` char(10) DEFAULT NULL, `d` varchar(10) DEFAULT NULL, - `e` text, + `e` text DEFAULT NULL, PRIMARY KEY (`aa`), KEY `b` (`b`), KEY `d` (`d`) `clustering`=yes @@ -36,7 +36,7 @@ foo CREATE TABLE `foo` ( `bb` bigint(20) DEFAULT NULL, `c` char(10) DEFAULT NULL, `d` varchar(10) DEFAULT NULL, - `e` text, + `e` text DEFAULT NULL, PRIMARY KEY (`aa`), KEY `b` (`bb`), KEY `d` (`d`) `clustering`=yes @@ -55,7 +55,7 @@ foo CREATE TABLE `foo` ( `bb` bigint(20) DEFAULT NULL, `c` char(10) DEFAULT NULL, `dd` varchar(10) DEFAULT NULL, - `e` text, + `e` text DEFAULT NULL, PRIMARY KEY (`aa`), KEY `b` (`bb`), KEY `d` (`dd`) `clustering`=yes diff --git a/storage/tokudb/mysql-test/tokudb_alter_table/t/disabled.def b/storage/tokudb/mysql-test/tokudb_alter_table/t/disabled.def new file mode 100644 index 00000000000..3ea96dac116 --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_alter_table/t/disabled.def @@ -0,0 +1,8 @@ +# alter table +hcad_tmp_tables: tmp tables bypass hot alter, we run hcad_tmp_tables_56 instead +hcad_with_locks: cant alter table concurrent with reading a table in 5.5 + +# virtual columns +virtual_columns: no virtual columns in MySQL 5.5 + +frm_discover_partition: needs the tokutek patch for frm discovery for partitioned tables diff --git a/storage/tokudb/mysql-test/tokudb_alter_table/t/suite.opt b/storage/tokudb/mysql-test/tokudb_alter_table/t/suite.opt new file mode 100644 index 00000000000..23511b05020 --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_alter_table/t/suite.opt @@ -0,0 +1 @@ +$TOKUDB_OPT $TOKUDB_LOAD_ADD --loose-tokudb-check-jemalloc=0 diff --git a/storage/tokudb/mysql-test/tokudb_backup/r/tokudb_backup_exclude.result b/storage/tokudb/mysql-test/tokudb_backup/r/tokudb_backup_exclude.result new file mode 100644 index 00000000000..0bec62e54f6 --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_backup/r/tokudb_backup_exclude.result @@ -0,0 +1,31 @@ +create table t1(a INT, b INT, c INT, KEY(a), KEY(b), KEY(c)) engine='tokudb'; +create table t1a(a INT, b INT, c INT, KEY(a), KEY(b), KEY(c)) engine='tokudb'; +create table t1b(a INT, b INT, c INT, KEY(a), KEY(b), KEY(c)) engine='tokudb'; +create table t1c(a INT, b INT, c INT, KEY(a), KEY(b), KEY(c)) engine='tokudb'; +select @@session.tokudb_backup_last_error; +@@session.tokudb_backup_last_error +0 +select @@session.tokudb_backup_last_error_string; +@@session.tokudb_backup_last_error_string +NULL +20 +set session tokudb_backup_exclude='(t1a|t1c)+'; +select @@session.tokudb_backup_last_error; +@@session.tokudb_backup_last_error +0 +select @@session.tokudb_backup_last_error_string; +@@session.tokudb_backup_last_error_string +NULL +10 +set session tokudb_backup_exclude='t1[abc]+'; +select @@session.tokudb_backup_last_error; +@@session.tokudb_backup_last_error +0 +select @@session.tokudb_backup_last_error_string; +@@session.tokudb_backup_last_error_string +NULL +5 +drop table t1; +drop table t1a; +drop table t1b; +drop table t1c; diff --git a/storage/tokudb/mysql-test/tokudb_backup/r/tokudb_backup_set_last_error.result b/storage/tokudb/mysql-test/tokudb_backup/r/tokudb_backup_set_last_error.result new file mode 100644 index 00000000000..e1baf8418ad --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_backup/r/tokudb_backup_set_last_error.result @@ -0,0 +1,20 @@ +create table t1(a INT, b INT, c INT, KEY(a), KEY(b), KEY(c)) engine='tokudb'; +set session tokudb_backup_dir='/aint/no/way/this/exists/here'; +ERROR 42000: Variable 'tokudb_backup_dir' can't be set to the value of '/aint/no/way/this/exists/here' +select @@session.tokudb_backup_last_error; +@@session.tokudb_backup_last_error +2 +select @@session.tokudb_backup_last_error_string; +@@session.tokudb_backup_last_error_string +Could not get real path for /aint/no/way/this/exists/here +set session tokudb_backup_last_error_string='this should not crash the server'; +select @@session.tokudb_backup_last_error_string; +@@session.tokudb_backup_last_error_string +this should not crash the server +set session tokudb_backup_dir='/aint/no/way/this/exists/here'; +ERROR 42000: Variable 'tokudb_backup_dir' can't be set to the value of '/aint/no/way/this/exists/here' +select @@session.tokudb_backup_last_error_string; +@@session.tokudb_backup_last_error_string +Could not get real path for /aint/no/way/this/exists/here +set session tokudb_backup_last_error_string = @old_backup_last_error_string; +drop table t1; diff --git a/storage/tokudb/mysql-test/tokudb_backup/t/suite.opt b/storage/tokudb/mysql-test/tokudb_backup/t/suite.opt new file mode 100644 index 00000000000..e52bd6327e0 --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_backup/t/suite.opt @@ -0,0 +1 @@ +$TOKUDB_OPT $TOKUDB_LOAD_ADD $TOKUDB_BACKUP_OPT $TOKUDB_BACKUP_LOAD_ADD --loose-tokudb-check-jemalloc=0 diff --git a/storage/tokudb/mysql-test/tokudb_backup/t/tokudb_backup_exclude.test b/storage/tokudb/mysql-test/tokudb_backup/t/tokudb_backup_exclude.test new file mode 100644 index 00000000000..a0ff5152f66 --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_backup/t/tokudb_backup_exclude.test @@ -0,0 +1,69 @@ +# This test is to specifically test the TokuDB backup excluse functionality. +# This is _not_ an illustration of how to exclude tables from a TokuDB backup, +# if you exclude TokuDB database files in this way, you will have a useless +# backup. +source include/have_tokudb_backup.inc; + +disable_query_log; + +set @old_backup_exclude = @@session.tokudb_backup_exclude; + +enable_query_log; + +# This should create 20 files prefixed with '_test_t1' +create table t1(a INT, b INT, c INT, KEY(a), KEY(b), KEY(c)) engine='tokudb'; +create table t1a(a INT, b INT, c INT, KEY(a), KEY(b), KEY(c)) engine='tokudb'; +create table t1b(a INT, b INT, c INT, KEY(a), KEY(b), KEY(c)) engine='tokudb'; +create table t1c(a INT, b INT, c INT, KEY(a), KEY(b), KEY(c)) engine='tokudb'; + +# This should not filter any files +disable_query_log; +--exec mkdir $MYSQLTEST_VARDIR/tmp/backup +--eval set session tokudb_backup_dir='$MYSQLTEST_VARDIR/tmp/backup' +enable_query_log; + +select @@session.tokudb_backup_last_error; +select @@session.tokudb_backup_last_error_string; + +# 20 files should be in the backup set +--exec ls $MYSQLTEST_VARDIR/tmp/backup/mysql_data_dir | grep -c _test_t1 + +--exec rm -rf $MYSQLTEST_VARDIR/tmp/backup + + +# This should filter all files for the t1a and t1c tables +set session tokudb_backup_exclude='(t1a|t1c)+'; + +disable_query_log; +--exec mkdir $MYSQLTEST_VARDIR/tmp/backup +--eval set session tokudb_backup_dir='$MYSQLTEST_VARDIR/tmp/backup' +enable_query_log; + +select @@session.tokudb_backup_last_error; +select @@session.tokudb_backup_last_error_string; + +# 10 files should be in the backup set +--exec ls $MYSQLTEST_VARDIR/tmp/backup/mysql_data_dir | grep -c _test_t1 + +--exec rm -rf $MYSQLTEST_VARDIR/tmp/backup + +# This should filter all files for the t1a, t1b, and t1c tables +set session tokudb_backup_exclude='t1[abc]+'; + +disable_query_log; +--exec mkdir $MYSQLTEST_VARDIR/tmp/backup +--eval set session tokudb_backup_dir='$MYSQLTEST_VARDIR/tmp/backup' +enable_query_log; + +select @@session.tokudb_backup_last_error; +select @@session.tokudb_backup_last_error_string; + +# 5 files should be in the backup set +--exec ls $MYSQLTEST_VARDIR/tmp/backup/mysql_data_dir | grep -c _test_t1 + +--exec rm -rf $MYSQLTEST_VARDIR/tmp/backup + +drop table t1; +drop table t1a; +drop table t1b; +drop table t1c; diff --git a/storage/tokudb/mysql-test/tokudb_backup/t/tokudb_backup_set_last_error.test b/storage/tokudb/mysql-test/tokudb_backup/t/tokudb_backup_set_last_error.test new file mode 100644 index 00000000000..18fc8cc5efb --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_backup/t/tokudb_backup_set_last_error.test @@ -0,0 +1,32 @@ +# This test validates that the plugin will not crash if a user sets +# tokudb_backup_last_error_string after performing a backup. +source include/have_tokudb_backup.inc; + +disable_query_log; + +set @old_backup_last_error_string = @@session.tokudb_backup_last_error_string; + +enable_query_log; + +create table t1(a INT, b INT, c INT, KEY(a), KEY(b), KEY(c)) engine='tokudb'; + +# this should fail and set the error string since the dummy directory +# doesn't exist +--error ER_WRONG_VALUE_FOR_VAR +--eval set session tokudb_backup_dir='/aint/no/way/this/exists/here' + +select @@session.tokudb_backup_last_error; +select @@session.tokudb_backup_last_error_string; + +set session tokudb_backup_last_error_string='this should not crash the server'; +select @@session.tokudb_backup_last_error_string; + +# this should fail again and set the error string since the dummy directory +# doesn't exist +--error ER_WRONG_VALUE_FOR_VAR +--eval set session tokudb_backup_dir='/aint/no/way/this/exists/here' +select @@session.tokudb_backup_last_error_string; + +set session tokudb_backup_last_error_string = @old_backup_last_error_string; + +drop table t1; diff --git a/storage/tokudb/mysql-test/tokudb_bugs/disabled.def b/storage/tokudb/mysql-test/tokudb_bugs/disabled.def index 068cbb413e0..d0d1a47e006 100644 --- a/storage/tokudb/mysql-test/tokudb_bugs/disabled.def +++ b/storage/tokudb/mysql-test/tokudb_bugs/disabled.def @@ -1,14 +1,2 @@ -memcache_dirty : #4609 memcache patch from facebook not ported to mysql 5.5 -4472 : #4521 MDL for alter table in 5.5 prohibits this test from having any chance of working - -tokudb_drop_part_table_668: no tokudb test data in mariadb tree -tokudb_drop_simple_table_668: no tokudb test data in mariadb tree 5585: times out, too many huge insert...selects -fileops-3: how this could work, if alter needs an exclusive mdl lock? -6053: tokudb is not the default storage engine - -checkpoint_lock_2: test can not work when the checkpoint_safe_lock is a fair rwlock - -# this test was added in 7.5.4 and fails in 10.0 -# but running this very test in 7.5.3 fails in exactly the same manner -db768: never worked. tokutek was informed, 2015-01-14 +db233: different execution path in mariadb, debug_sync point is not hit diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/5585.result b/storage/tokudb/mysql-test/tokudb_bugs/r/5585.result index 608afa00370..1008764148b 100644 --- a/storage/tokudb/mysql-test/tokudb_bugs/r/5585.result +++ b/storage/tokudb/mysql-test/tokudb_bugs/r/5585.result @@ -10,12 +10,6 @@ insert into t1 select t1.file_id+40, t1.file_number+40 from t1; insert into t1 select t1.file_id+100, t1.file_number+100 from t1; insert into t1 select t1.file_id+200, t1.file_number+200 from t1; insert into t1 select t1.file_id+400, t1.file_number+400 from t1; -insert into t1 select t1.file_id+1000, t1.file_number+1000 from t1; -insert into t1 select t1.file_id+10000, t1.file_number+10000 from t1; -insert into t1 select t1.file_id+100000, t1.file_number+100000 from t1; -insert into t1 select t1.file_id+1000000, t1.file_number+1000000 from t1; -insert into t1 select t1.file_id+10000000, t1.file_number+10000000 from t1; -insert into t1 select t1.file_id+100000000, t1.file_number+100000000 from t1; create table t2 ( file_id bigint unsigned not null, country char(2) not null, diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/db233.result b/storage/tokudb/mysql-test/tokudb_bugs/r/db233.result new file mode 100644 index 00000000000..e5808f52e69 --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_bugs/r/db233.result @@ -0,0 +1,37 @@ +SET SESSION tokudb_auto_analyze = 0; +SET SESSION tokudb_analyze_in_background = 0; +CREATE TABLE t1( +`id` int(10) unsigned NOT NULL, +`k` int(10) unsigned NOT NULL DEFAULT '0', +`c` char(120) NOT NULL DEFAULT '', +`pad` char(60) NOT NULL DEFAULT '', +KEY `xid` (`id`), +KEY `k` (`k`) +) ENGINE=TokuDB DEFAULT CHARSET=latin1; +INSERT INTO t1 VALUES(1, 1, '1', '1'), (2, 2, '2', '2'), (3, 3, '3', '3'), (4, 4, '4', '4'), +(5, 5, '5', '5'), (6, 6, '6', '6'), (6, 6, '6', '6'), (7, 7, '7', '7'), +(8, 8, '8', '8'), (9, 9, '9', '9'), (10, 10, '10', '10'), (11, 11, '11', '11'); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +set DEBUG_SYNC = 'tokudb_icp_desc_scan_invalidate SIGNAL hit1 WAIT_FOR done1'; +SELECT c FROM t1 WHERE id BETWEEN 5 AND 8 ORDER BY id DESC; +set DEBUG_SYNC = 'now WAIT_FOR hit1'; +set DEBUG_SYNC = 'now SIGNAL done1'; +c +8 +7 +6 +6 +5 +set DEBUG_SYNC = 'tokudb_icp_asc_scan_out_of_range SIGNAL hit2 WAIT_FOR done2'; +SELECT c FROM t1 WHERE id BETWEEN 5 AND 8 ORDER BY id ASC; +set DEBUG_SYNC = 'now WAIT_FOR hit2'; +set DEBUG_SYNC = 'now SIGNAL done2'; +c +5 +6 +6 +7 +8 +drop table t1; diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/db397_delete_trigger.result b/storage/tokudb/mysql-test/tokudb_bugs/r/db397_delete_trigger.result index da82fa445e8..c8565fb4b2b 100644 --- a/storage/tokudb/mysql-test/tokudb_bugs/r/db397_delete_trigger.result +++ b/storage/tokudb/mysql-test/tokudb_bugs/r/db397_delete_trigger.result @@ -25,11 +25,11 @@ select col1,action from t1_audit; col1 action 0 DUMMY 1 BEFORE DEL -select locks_dname,locks_key_left,locks_key_right from information_schema.tokudb_locks; +select locks_dname,locks_key_left,locks_key_right from information_schema.tokudb_locks order by locks_dname,locks_key_left,locks_key_right; locks_dname locks_key_left locks_key_right -./test/t1_audit-main 0200000000000000 0200000000000000 -./test/t1-main ff01000000 0101000000 ./test/t1-main 0001000000 0001000000 +./test/t1-main ff01000000 0101000000 +./test/t1_audit-main 0200000000000000 0200000000000000 commit; drop trigger t1_trigger; create trigger t1_trigger after delete on t1 @@ -46,11 +46,11 @@ col1 action 0 DUMMY 1 BEFORE DEL 2 AFTER DELE -select locks_dname,locks_key_left,locks_key_right from information_schema.tokudb_locks; +select locks_dname,locks_key_left,locks_key_right from information_schema.tokudb_locks order by locks_dname,locks_key_left,locks_key_right; locks_dname locks_key_left locks_key_right -./test/t1_audit-main 0300000000000000 0300000000000000 -./test/t1-main ff02000000 0102000000 ./test/t1-main 0002000000 0002000000 +./test/t1-main ff02000000 0102000000 +./test/t1_audit-main 0300000000000000 0300000000000000 commit; drop trigger t1_trigger; drop table t1; diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/db397_insert_trigger.result b/storage/tokudb/mysql-test/tokudb_bugs/r/db397_insert_trigger.result index 41765a6fcd3..aef99a9adcd 100644 --- a/storage/tokudb/mysql-test/tokudb_bugs/r/db397_insert_trigger.result +++ b/storage/tokudb/mysql-test/tokudb_bugs/r/db397_insert_trigger.result @@ -25,10 +25,10 @@ select col1,action from t1_audit; col1 action 0 DUMMY 1 BEFORE INSERT -select locks_dname,locks_key_left,locks_key_right from information_schema.tokudb_locks; +select locks_dname,locks_key_left,locks_key_right from information_schema.tokudb_locks order by locks_dname,locks_key_left,locks_key_right; locks_dname locks_key_left locks_key_right -./test/t1_audit-main 0200000000000000 0200000000000000 ./test/t1-main 0001000000 0001000000 +./test/t1_audit-main 0200000000000000 0200000000000000 commit; drop trigger t1_trigger; create trigger t1_trigger after insert on t1 @@ -46,10 +46,10 @@ col1 action 0 DUMMY 1 BEFORE INSERT 2 AFTER INSERT -select locks_dname,locks_key_left,locks_key_right from information_schema.tokudb_locks; +select locks_dname,locks_key_left,locks_key_right from information_schema.tokudb_locks order by locks_dname,locks_key_left,locks_key_right; locks_dname locks_key_left locks_key_right -./test/t1_audit-main 0300000000000000 0300000000000000 ./test/t1-main 0002000000 0002000000 +./test/t1_audit-main 0300000000000000 0300000000000000 commit; drop trigger t1_trigger; drop table t1; diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/db397_update_trigger.result b/storage/tokudb/mysql-test/tokudb_bugs/r/db397_update_trigger.result index c197430ad25..d9b944d3849 100644 --- a/storage/tokudb/mysql-test/tokudb_bugs/r/db397_update_trigger.result +++ b/storage/tokudb/mysql-test/tokudb_bugs/r/db397_update_trigger.result @@ -25,11 +25,11 @@ select col1,action from t1_audit; col1 action 0 DUMMY 1 BEFORE UPDATE -select locks_dname,locks_key_left,locks_key_right from information_schema.tokudb_locks; +select locks_dname,locks_key_left,locks_key_right from information_schema.tokudb_locks order by locks_dname,locks_key_left,locks_key_right; locks_dname locks_key_left locks_key_right -./test/t1_audit-main 0200000000000000 0200000000000000 -./test/t1-main ff01000000 0101000000 ./test/t1-main 0001000000 0001000000 +./test/t1-main ff01000000 0101000000 +./test/t1_audit-main 0200000000000000 0200000000000000 commit; drop trigger t1_trigger; create trigger t1_trigger after update on t1 @@ -48,11 +48,11 @@ col1 action 0 DUMMY 1 BEFORE UPDATE 2 AFTER UPDATE -select locks_dname,locks_key_left,locks_key_right from information_schema.tokudb_locks; +select locks_dname,locks_key_left,locks_key_right from information_schema.tokudb_locks order by locks_dname,locks_key_left,locks_key_right; locks_dname locks_key_left locks_key_right -./test/t1_audit-main 0300000000000000 0300000000000000 -./test/t1-main ff02000000 0102000000 ./test/t1-main 0002000000 0002000000 +./test/t1-main ff02000000 0102000000 +./test/t1_audit-main 0300000000000000 0300000000000000 commit; drop trigger t1_trigger; drop table t1, t1_audit; diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/db739_replace.result b/storage/tokudb/mysql-test/tokudb_bugs/r/db739_replace.result index 2bf141add9a..58a4ed6708a 100644 --- a/storage/tokudb/mysql-test/tokudb_bugs/r/db739_replace.result +++ b/storage/tokudb/mysql-test/tokudb_bugs/r/db739_replace.result @@ -100010,5 +100010,7 @@ insert into t (id,a) values (999,98); insert into t (id,a) values (999,99); delete from t where id=404; set tokudb_pk_insert_mode=2; +Warnings: +Warning 131 Using tokudb_pk_insert_mode is deprecated and the parameter may be removed in future releases. replace into t values (404,0,0,0); drop table t; diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/db756_card_part_hash.result b/storage/tokudb/mysql-test/tokudb_bugs/r/db756_card_part_hash.result index 3ed5758bd15..70bc86e1abc 100644 --- a/storage/tokudb/mysql-test/tokudb_bugs/r/db756_card_part_hash.result +++ b/storage/tokudb/mysql-test/tokudb_bugs/r/db756_card_part_hash.result @@ -3,19 +3,19 @@ drop table if exists t; create table t (id int, x int, primary key (id), key (x)) partition by hash(id) partitions 2; show indexes from t; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment -t 0 PRIMARY 1 id A 0 NULL NULL BTREE -t 1 x 1 x A NULL NULL NULL YES BTREE +t 0 PRIMARY 1 id A 2 NULL NULL BTREE +t 1 x 1 x A 2 NULL NULL YES BTREE insert into t values (1,1),(3,1),(5,1); insert into t values (2,1),(4,1),(6,1); show indexes from t; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment t 0 PRIMARY 1 id A 6 NULL NULL BTREE -t 1 x 1 x A NULL NULL NULL YES BTREE +t 1 x 1 x A 6 NULL NULL YES BTREE analyze table t; Table Op Msg_type Msg_text test.t analyze status OK show indexes from t; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment t 0 PRIMARY 1 id A 6 NULL NULL BTREE -t 1 x 1 x A 2 NULL NULL YES BTREE +t 1 x 1 x A 6 NULL NULL YES BTREE drop table t; diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/db756_card_part_hash_1.result b/storage/tokudb/mysql-test/tokudb_bugs/r/db756_card_part_hash_1.result index 776342ce90e..b6d9fd7da85 100644 --- a/storage/tokudb/mysql-test/tokudb_bugs/r/db756_card_part_hash_1.result +++ b/storage/tokudb/mysql-test/tokudb_bugs/r/db756_card_part_hash_1.result @@ -3,18 +3,18 @@ drop table if exists t; create table t (id int, x int, primary key (id), key (x)) partition by hash(id) partitions 2; show indexes from t; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment -t 0 PRIMARY 1 id A 0 NULL NULL BTREE -t 1 x 1 x A NULL NULL NULL YES BTREE +t 0 PRIMARY 1 id A 2 NULL NULL BTREE +t 1 x 1 x A 2 NULL NULL YES BTREE insert into t values (1,1),(3,1),(5,1); show indexes from t; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment -t 0 PRIMARY 1 id A 3 NULL NULL BTREE -t 1 x 1 x A NULL NULL NULL YES BTREE +t 0 PRIMARY 1 id A 4 NULL NULL BTREE +t 1 x 1 x A 4 NULL NULL YES BTREE analyze table t; Table Op Msg_type Msg_text test.t analyze status OK show indexes from t; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment -t 0 PRIMARY 1 id A 3 NULL NULL BTREE -t 1 x 1 x A 1 NULL NULL YES BTREE +t 0 PRIMARY 1 id A 4 NULL NULL BTREE +t 1 x 1 x A 4 NULL NULL YES BTREE drop table t; diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/db756_card_part_hash_1_pick.result b/storage/tokudb/mysql-test/tokudb_bugs/r/db756_card_part_hash_1_pick.result index 480978a545b..5ba5da21789 100644 --- a/storage/tokudb/mysql-test/tokudb_bugs/r/db756_card_part_hash_1_pick.result +++ b/storage/tokudb/mysql-test/tokudb_bugs/r/db756_card_part_hash_1_pick.result @@ -3,19 +3,19 @@ drop table if exists t; create table t (id int, x int, primary key (id), key (x)) partition by hash(id) partitions 2; show indexes from t; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment -t 0 PRIMARY 1 id A 0 NULL NULL BTREE -t 1 x 1 x A NULL NULL NULL YES BTREE +t 0 PRIMARY 1 id A 2 NULL NULL BTREE +t 1 x 1 x A 2 NULL NULL YES BTREE insert into t values (1,1),(3,2),(5,3); insert into t values (2,1),(4,1),(6,1),(8,1); show indexes from t; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment t 0 PRIMARY 1 id A 7 NULL NULL BTREE -t 1 x 1 x A NULL NULL NULL YES BTREE +t 1 x 1 x A 7 NULL NULL YES BTREE analyze table t; Table Op Msg_type Msg_text test.t analyze status OK show indexes from t; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment t 0 PRIMARY 1 id A 7 NULL NULL BTREE -t 1 x 1 x A 1 NULL NULL YES BTREE +t 1 x 1 x A 3 NULL NULL YES BTREE drop table t; diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/db756_card_part_hash_2.result b/storage/tokudb/mysql-test/tokudb_bugs/r/db756_card_part_hash_2.result index ec2a37b02d4..6d345d98c95 100644 --- a/storage/tokudb/mysql-test/tokudb_bugs/r/db756_card_part_hash_2.result +++ b/storage/tokudb/mysql-test/tokudb_bugs/r/db756_card_part_hash_2.result @@ -3,18 +3,18 @@ drop table if exists t; create table t (id int, x int, primary key (id), key (x)) partition by hash(id) partitions 2; show indexes from t; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment -t 0 PRIMARY 1 id A 0 NULL NULL BTREE -t 1 x 1 x A NULL NULL NULL YES BTREE +t 0 PRIMARY 1 id A 2 NULL NULL BTREE +t 1 x 1 x A 2 NULL NULL YES BTREE insert into t values (2,1),(4,1),(6,1); show indexes from t; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment -t 0 PRIMARY 1 id A 3 NULL NULL BTREE -t 1 x 1 x A NULL NULL NULL YES BTREE +t 0 PRIMARY 1 id A 4 NULL NULL BTREE +t 1 x 1 x A 4 NULL NULL YES BTREE analyze table t; Table Op Msg_type Msg_text test.t analyze status OK show indexes from t; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment -t 0 PRIMARY 1 id A 3 NULL NULL BTREE -t 1 x 1 x A 1 NULL NULL YES BTREE +t 0 PRIMARY 1 id A 4 NULL NULL BTREE +t 1 x 1 x A 4 NULL NULL YES BTREE drop table t; diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/db756_card_part_hash_2_pick.result b/storage/tokudb/mysql-test/tokudb_bugs/r/db756_card_part_hash_2_pick.result index c1160ae27a0..06639c311cf 100644 --- a/storage/tokudb/mysql-test/tokudb_bugs/r/db756_card_part_hash_2_pick.result +++ b/storage/tokudb/mysql-test/tokudb_bugs/r/db756_card_part_hash_2_pick.result @@ -3,14 +3,14 @@ drop table if exists t; create table t (id int, x int, primary key (id), key (x)) partition by hash(id) partitions 2; show indexes from t; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment -t 0 PRIMARY 1 id A 0 NULL NULL BTREE -t 1 x 1 x A NULL NULL NULL YES BTREE +t 0 PRIMARY 1 id A 2 NULL NULL BTREE +t 1 x 1 x A 2 NULL NULL YES BTREE insert into t values (1,1),(3,2),(5,3),(7,4); insert into t values (2,1),(4,1),(6,1); show indexes from t; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment t 0 PRIMARY 1 id A 7 NULL NULL BTREE -t 1 x 1 x A NULL NULL NULL YES BTREE +t 1 x 1 x A 7 NULL NULL YES BTREE analyze table t; Table Op Msg_type Msg_text test.t analyze status OK diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/db757_part_alter_analyze.result b/storage/tokudb/mysql-test/tokudb_bugs/r/db757_part_alter_analyze.result index 21ce7704928..62337802688 100644 --- a/storage/tokudb/mysql-test/tokudb_bugs/r/db757_part_alter_analyze.result +++ b/storage/tokudb/mysql-test/tokudb_bugs/r/db757_part_alter_analyze.result @@ -6,30 +6,30 @@ partition by range(id) insert into t values (1,1,1),(2,1,2),(3,1,3),(4,1,4); show indexes from t; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment -t 0 PRIMARY 1 id A 4 NULL NULL BTREE -t 1 x 1 x A NULL NULL NULL YES BTREE -t 1 y 1 y A NULL NULL NULL YES BTREE +t 0 PRIMARY 1 id A 5 NULL NULL BTREE +t 1 x 1 x A 5 NULL NULL YES BTREE +t 1 y 1 y A 5 NULL NULL YES BTREE alter table t analyze partition p0; Table Op Msg_type Msg_text test.t analyze status OK show indexes from t; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment -t 0 PRIMARY 1 id A 4 NULL NULL BTREE -t 1 x 1 x A 1 NULL NULL YES BTREE -t 1 y 1 y A 4 NULL NULL YES BTREE +t 0 PRIMARY 1 id A 5 NULL NULL BTREE +t 1 x 1 x A 5 NULL NULL YES BTREE +t 1 y 1 y A 5 NULL NULL YES BTREE alter table t analyze partition p1; Table Op Msg_type Msg_text test.t analyze status OK show indexes from t; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment -t 0 PRIMARY 1 id A 4 NULL NULL BTREE -t 1 x 1 x A 1 NULL NULL YES BTREE -t 1 y 1 y A 4 NULL NULL YES BTREE +t 0 PRIMARY 1 id A 5 NULL NULL BTREE +t 1 x 1 x A 5 NULL NULL YES BTREE +t 1 y 1 y A 5 NULL NULL YES BTREE insert into t values (100,1,1),(200,2,1),(300,3,1),(400,4,1),(500,5,1); show indexes from t; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment t 0 PRIMARY 1 id A 9 NULL NULL BTREE -t 1 x 1 x A 2 NULL NULL YES BTREE +t 1 x 1 x A 9 NULL NULL YES BTREE t 1 y 1 y A 9 NULL NULL YES BTREE alter table t analyze partition p0; Table Op Msg_type Msg_text @@ -37,8 +37,8 @@ test.t analyze status OK show indexes from t; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment t 0 PRIMARY 1 id A 9 NULL NULL BTREE -t 1 x 1 x A NULL NULL NULL YES BTREE -t 1 y 1 y A NULL NULL NULL YES BTREE +t 1 x 1 x A 9 NULL NULL YES BTREE +t 1 y 1 y A 9 NULL NULL YES BTREE alter table t analyze partition p1; Table Op Msg_type Msg_text test.t analyze status OK @@ -46,5 +46,5 @@ show indexes from t; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment t 0 PRIMARY 1 id A 9 NULL NULL BTREE t 1 x 1 x A 9 NULL NULL YES BTREE -t 1 y 1 y A 1 NULL NULL YES BTREE +t 1 y 1 y A 9 NULL NULL YES BTREE drop table t; diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/db917.result b/storage/tokudb/mysql-test/tokudb_bugs/r/db917.result new file mode 100644 index 00000000000..9c29033429e --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_bugs/r/db917.result @@ -0,0 +1,14 @@ +drop table if exists t1; +set @orig_table_open_cache = @@global.table_open_cache; +create table t1(a int) engine = tokudb partition by key(a) partitions 2 (partition p0 engine = tokudb, partition p1 engine = tokudb); +lock tables t1 read; +set @@global.table_open_cache = 1; +begin; +insert into t1 values(1),(1); +select * from t1 where c like _ucs2 0x039C0025 collate ucs2_unicode_ci; +ERROR 42S22: Unknown column 'c' in 'where clause' +create table t1(c1 binary (1), c2 varbinary(1)); +ERROR 42S01: Table 't1' already exists +unlock tables; +drop table t1; +set @@global.table_open_cache = @orig_table_open_cache; diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/db938.result b/storage/tokudb/mysql-test/tokudb_bugs/r/db938.result new file mode 100644 index 00000000000..b64c240b1ea --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_bugs/r/db938.result @@ -0,0 +1,40 @@ +set @orig_auto_analyze = @@session.tokudb_auto_analyze; +set @orig_in_background = @@session.tokudb_analyze_in_background; +set @orig_mode = @@session.tokudb_analyze_mode; +set @orig_throttle = @@session.tokudb_analyze_throttle; +set @orig_time = @@session.tokudb_analyze_time; +set @orig_scale_percent = @@global.tokudb_cardinality_scale_percent; +set @orig_default_storage_engine = @@session.default_storage_engine; +set @orig_pause_background_job_manager = @@global.tokudb_debug_pause_background_job_manager; +set session default_storage_engine = 'tokudb'; +set session tokudb_auto_analyze = 1; +set session tokudb_analyze_in_background = 1; +set session tokudb_analyze_mode = tokudb_analyze_standard; +set session tokudb_analyze_throttle = 0; +set session tokudb_analyze_time = 0; +set global tokudb_cardinality_scale_percent = DEFAULT; +set global tokudb_debug_pause_background_job_manager = TRUE; +create table t1 (a int not null auto_increment, b int, c int, primary key(a), key kb(b), key kc(c), key kabc(a,b,c), key kab(a,b), key kbc(b,c)); +insert into t1(b,c) values(0,0), (1,1), (2,2), (3,3); +select database_name, table_name, job_type, job_params, scheduler from information_schema.tokudb_background_job_status; +database_name table_name job_type job_params scheduler +test t1 TOKUDB_ANALYZE_MODE_STANDARD TOKUDB_ANALYZE_DELETE_FRACTION=1.000000; TOKUDB_ANALYZE_TIME=0; TOKUDB_ANALYZE_THROTTLE=0; AUTO +connect conn1, localhost, root; +set DEBUG_SYNC = 'tokudb_after_truncate_all_dictionarys SIGNAL closed WAIT_FOR done'; +TRUNCATE TABLE t1; +connection default; +set global tokudb_debug_pause_background_job_manager = FALSE; +set DEBUG_SYNC = 'now SIGNAL done'; +connection conn1; +connection default; +disconnect conn1; +drop table t1; +set session tokudb_auto_analyze = @orig_auto_analyze; +set session tokudb_analyze_in_background = @orig_in_background; +set session tokudb_analyze_mode = @orig_mode; +set session tokudb_analyze_throttle = @orig_throttle; +set session tokudb_analyze_time = @orig_time; +set global tokudb_cardinality_scale_percent = @orig_scale_percent; +set session default_storage_engine = @orig_default_storage_engine; +set global tokudb_debug_pause_background_job_manager = @orig_pause_background_job_manager; +set DEBUG_SYNC='reset'; diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/db945.result b/storage/tokudb/mysql-test/tokudb_bugs/r/db945.result new file mode 100644 index 00000000000..6b3c239d602 --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_bugs/r/db945.result @@ -0,0 +1,15 @@ +set default_storage_engine='tokudb'; +drop table if exists t1; +set session tokudb_auto_analyze = 1; +set session tokudb_analyze_in_background = true; +set session tokudb_analyze_mode = TOKUDB_ANALYZE_STANDARD; +set session tokudb_analyze_throttle = 0; +set session tokudb_analyze_time = 0; +create table t1(a int, b text(1), c text(1), filler text(1), primary key(a, b(1)), unique key (a, c(1))); +lock tables t1 write, t1 as a read, t1 as b read; +insert into t1(a) values(1); +Warnings: +Warning 1364 Field 'b' doesn't have a default value +alter table t1 drop key a; +unlock tables; +drop table t1; diff --git a/storage/tokudb/mysql-test/tokudb_bugs/t/5585-master.opt b/storage/tokudb/mysql-test/tokudb_bugs/t/5585-master.opt index 017432e797d..acad193fd76 100644 --- a/storage/tokudb/mysql-test/tokudb_bugs/t/5585-master.opt +++ b/storage/tokudb/mysql-test/tokudb_bugs/t/5585-master.opt @@ -1 +1 @@ ---tokudb-cache-size=1000000000 --innodb-buffer-pool-size=1000000000 +--loose-tokudb-cache-size=1000000000 --innodb-buffer-pool-size=1000000000 diff --git a/storage/tokudb/mysql-test/tokudb_bugs/t/5585.test b/storage/tokudb/mysql-test/tokudb_bugs/t/5585.test index bf0df681e7a..2489748dfa1 100644 --- a/storage/tokudb/mysql-test/tokudb_bugs/t/5585.test +++ b/storage/tokudb/mysql-test/tokudb_bugs/t/5585.test @@ -1,5 +1,6 @@ --source include/have_innodb.inc --source include/have_tokudb.inc +--source include/big_test.inc --disable_warnings drop table if exists t1, t2; @@ -18,12 +19,6 @@ insert into t1 select t1.file_id+40, t1.file_number+40 from t1; insert into t1 select t1.file_id+100, t1.file_number+100 from t1; insert into t1 select t1.file_id+200, t1.file_number+200 from t1; insert into t1 select t1.file_id+400, t1.file_number+400 from t1; -insert into t1 select t1.file_id+1000, t1.file_number+1000 from t1; -insert into t1 select t1.file_id+10000, t1.file_number+10000 from t1; -insert into t1 select t1.file_id+100000, t1.file_number+100000 from t1; -insert into t1 select t1.file_id+1000000, t1.file_number+1000000 from t1; -insert into t1 select t1.file_id+10000000, t1.file_number+10000000 from t1; -insert into t1 select t1.file_id+100000000, t1.file_number+100000000 from t1; create table t2 ( file_id bigint unsigned not null, @@ -64,4 +59,4 @@ select t1.file_id, (select hits from t2 where t2.file_id = t1.file_id and t2.insert_ts = date(date_sub(now(),interval 1 day))) as d from t1; -drop table if exists t1, t2; \ No newline at end of file +drop table if exists t1, t2; diff --git a/storage/tokudb/mysql-test/tokudb_bugs/t/db233.test b/storage/tokudb/mysql-test/tokudb_bugs/t/db233.test new file mode 100644 index 00000000000..8e4c3b73c09 --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_bugs/t/db233.test @@ -0,0 +1,70 @@ +# This test for DB-233 tests that icp descending range scans stop properly once +# it fails to find a key match instead of continuing to scan all the way to the +# beginning of the index. + +-- source include/have_tokudb.inc +-- source include/have_debug.inc +-- source include/have_debug_sync.inc + +-- enable_query_log + +SET SESSION tokudb_auto_analyze = 0; +SET SESSION tokudb_analyze_in_background = 0; + +CREATE TABLE t1( + `id` int(10) unsigned NOT NULL, + `k` int(10) unsigned NOT NULL DEFAULT '0', + `c` char(120) NOT NULL DEFAULT '', + `pad` char(60) NOT NULL DEFAULT '', + KEY `xid` (`id`), + KEY `k` (`k`) +) ENGINE=TokuDB DEFAULT CHARSET=latin1; + +INSERT INTO t1 VALUES(1, 1, '1', '1'), (2, 2, '2', '2'), (3, 3, '3', '3'), (4, 4, '4', '4'), +(5, 5, '5', '5'), (6, 6, '6', '6'), (6, 6, '6', '6'), (7, 7, '7', '7'), +(8, 8, '8', '8'), (9, 9, '9', '9'), (10, 10, '10', '10'), (11, 11, '11', '11'); + +ANALYZE TABLE t1; + +# lets flip to another connection +connect(conn1, localhost, root); + +# set up the DEBUG_SYNC point +set DEBUG_SYNC = 'tokudb_icp_desc_scan_invalidate SIGNAL hit1 WAIT_FOR done1'; + +# send the query +send SELECT c FROM t1 WHERE id BETWEEN 5 AND 8 ORDER BY id DESC; + +# back to default connection +connection default; + +# wait for the ICP reverse scan to invalidate +set DEBUG_SYNC = 'now WAIT_FOR hit1'; + +# lets release and clean up +set DEBUG_SYNC = 'now SIGNAL done1'; + +connection conn1; +reap; + +# set up the DEBUG_SYNC point again, but for the out of range +set DEBUG_SYNC = 'tokudb_icp_asc_scan_out_of_range SIGNAL hit2 WAIT_FOR done2'; + +# send the query +send SELECT c FROM t1 WHERE id BETWEEN 5 AND 8 ORDER BY id ASC; + +# back to default connection +connection default; + +# wait for the ICP reverse scan to invalidate +set DEBUG_SYNC = 'now WAIT_FOR hit2'; + +# lets release and clean up +set DEBUG_SYNC = 'now SIGNAL done2'; + +connection conn1; +reap; + +connection default; +disconnect conn1; +drop table t1; diff --git a/storage/tokudb/mysql-test/tokudb_bugs/t/db397_delete_trigger.test b/storage/tokudb/mysql-test/tokudb_bugs/t/db397_delete_trigger.test index 00751ed2346..79043664607 100644 --- a/storage/tokudb/mysql-test/tokudb_bugs/t/db397_delete_trigger.test +++ b/storage/tokudb/mysql-test/tokudb_bugs/t/db397_delete_trigger.test @@ -28,7 +28,7 @@ start transaction; delete from t1 where col1 = 1; select col1,col2 from t1; select col1,action from t1_audit; -select locks_dname,locks_key_left,locks_key_right from information_schema.tokudb_locks; +select locks_dname,locks_key_left,locks_key_right from information_schema.tokudb_locks order by locks_dname,locks_key_left,locks_key_right; # note the locks on t1 and t1_audit commit; drop trigger t1_trigger; @@ -41,10 +41,10 @@ start transaction; delete from t1 where col1 = 2; select col1,col2 from t1; select col1,action from t1_audit; -select locks_dname,locks_key_left,locks_key_right from information_schema.tokudb_locks; +select locks_dname,locks_key_left,locks_key_right from information_schema.tokudb_locks order by locks_dname,locks_key_left,locks_key_right; # note the locks on t1 and t1_audit commit; drop trigger t1_trigger; drop table t1; -drop table t1_audit; \ No newline at end of file +drop table t1_audit; diff --git a/storage/tokudb/mysql-test/tokudb_bugs/t/db397_insert_trigger.test b/storage/tokudb/mysql-test/tokudb_bugs/t/db397_insert_trigger.test index f32496e524d..ffe2face9f2 100644 --- a/storage/tokudb/mysql-test/tokudb_bugs/t/db397_insert_trigger.test +++ b/storage/tokudb/mysql-test/tokudb_bugs/t/db397_insert_trigger.test @@ -27,7 +27,7 @@ start transaction; insert into t1 (col1, col2) values (1,1); select col1,col2 from t1; select col1,action from t1_audit; -select locks_dname,locks_key_left,locks_key_right from information_schema.tokudb_locks; +select locks_dname,locks_key_left,locks_key_right from information_schema.tokudb_locks order by locks_dname,locks_key_left,locks_key_right; # note the locks on t1 and t1_audit commit; drop trigger t1_trigger; @@ -39,10 +39,10 @@ start transaction; insert into t1 (col1, col2) values (2,2); select col1,col2 from t1; select col1,action from t1_audit; -select locks_dname,locks_key_left,locks_key_right from information_schema.tokudb_locks; +select locks_dname,locks_key_left,locks_key_right from information_schema.tokudb_locks order by locks_dname,locks_key_left,locks_key_right; # note the locks on t1 and t1_audit commit; drop trigger t1_trigger; drop table t1; -drop table t1_audit; \ No newline at end of file +drop table t1_audit; diff --git a/storage/tokudb/mysql-test/tokudb_bugs/t/db397_update_trigger.test b/storage/tokudb/mysql-test/tokudb_bugs/t/db397_update_trigger.test index f1407e6488a..063a88cb4ab 100644 --- a/storage/tokudb/mysql-test/tokudb_bugs/t/db397_update_trigger.test +++ b/storage/tokudb/mysql-test/tokudb_bugs/t/db397_update_trigger.test @@ -29,7 +29,7 @@ start transaction; update t1 set col2=1000 where col1 = 1; select col1,col2 from t1; select col1,action from t1_audit; -select locks_dname,locks_key_left,locks_key_right from information_schema.tokudb_locks; +select locks_dname,locks_key_left,locks_key_right from information_schema.tokudb_locks order by locks_dname,locks_key_left,locks_key_right; # check locks on t1 and t1_audit commit; drop trigger t1_trigger; @@ -43,7 +43,7 @@ start transaction; update t1 set col2=1001 where col1 = 2; select col1,col2 from t1; select col1,action from t1_audit; -select locks_dname,locks_key_left,locks_key_right from information_schema.tokudb_locks; +select locks_dname,locks_key_left,locks_key_right from information_schema.tokudb_locks order by locks_dname,locks_key_left,locks_key_right; # check locks on t1 and t1_audit commit; drop trigger t1_trigger; diff --git a/storage/tokudb/mysql-test/tokudb_bugs/t/db917.test b/storage/tokudb/mysql-test/tokudb_bugs/t/db917.test new file mode 100644 index 00000000000..ae94d7b30de --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_bugs/t/db917.test @@ -0,0 +1,23 @@ +# test DB-917 +# test that table/share open lock timeout does not crash the server on subsequent access +source include/have_partition.inc; +source include/have_tokudb.inc; +disable_warnings; +drop table if exists t1; +enable_warnings; +set @orig_table_open_cache = @@global.table_open_cache; +create table t1(a int) engine = tokudb partition by key(a) partitions 2 (partition p0 engine = tokudb, partition p1 engine = tokudb); +lock tables t1 read; +set @@global.table_open_cache = 1; +begin; +insert into t1 values(1),(1); +# when the bug is present, this results in a lock wait timeout +--error ER_BAD_FIELD_ERROR +select * from t1 where c like _ucs2 0x039C0025 collate ucs2_unicode_ci; +# when the bug exists, this results in the assertion +# kc_info->cp_info[keynr] == NULL in tokudb/ha_tokudb.cc initialize_col_pack_info +--error ER_TABLE_EXISTS_ERROR +create table t1(c1 binary (1), c2 varbinary(1)); +unlock tables; +drop table t1; +set @@global.table_open_cache = @orig_table_open_cache; diff --git a/storage/tokudb/mysql-test/tokudb_bugs/t/db938.test b/storage/tokudb/mysql-test/tokudb_bugs/t/db938.test new file mode 100644 index 00000000000..f56f93d1492 --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_bugs/t/db938.test @@ -0,0 +1,77 @@ +# This test for DB-938 tests a race condition where a scheduled background job +# (analyze) ends up operating on a set of DB* key_file[] in TOKUDB_SHARE that +# were set to NULL during a TRUNCATE TABLE operation. + +-- source include/have_tokudb.inc +-- source include/have_debug.inc +-- source include/have_debug_sync.inc + +-- enable_query_log + +set @orig_auto_analyze = @@session.tokudb_auto_analyze; +set @orig_in_background = @@session.tokudb_analyze_in_background; +set @orig_mode = @@session.tokudb_analyze_mode; +set @orig_throttle = @@session.tokudb_analyze_throttle; +set @orig_time = @@session.tokudb_analyze_time; +set @orig_scale_percent = @@global.tokudb_cardinality_scale_percent; +set @orig_default_storage_engine = @@session.default_storage_engine; +set @orig_pause_background_job_manager = @@global.tokudb_debug_pause_background_job_manager; + +# first, lets set up to auto analyze in the background with about any activity +set session default_storage_engine = 'tokudb'; +set session tokudb_auto_analyze = 1; +set session tokudb_analyze_in_background = 1; +set session tokudb_analyze_mode = tokudb_analyze_standard; +set session tokudb_analyze_throttle = 0; +set session tokudb_analyze_time = 0; +set global tokudb_cardinality_scale_percent = DEFAULT; + +# in debug build, we can prevent the background job manager from running, +# let's do it to hold a job from running until we get the TRUNCATE TABLE +# in action +set global tokudb_debug_pause_background_job_manager = TRUE; + +create table t1 (a int not null auto_increment, b int, c int, primary key(a), key kb(b), key kc(c), key kabc(a,b,c), key kab(a,b), key kbc(b,c)); + +insert into t1(b,c) values(0,0), (1,1), (2,2), (3,3); + +# insert above should have triggered an analyze, but since the bjm is paused, +# we will see it sitting in the queue +select database_name, table_name, job_type, job_params, scheduler from information_schema.tokudb_background_job_status; + +# lets flip to another connection +connect(conn1, localhost, root); + +# set up the DEBUG_SYNC point +set DEBUG_SYNC = 'tokudb_after_truncate_all_dictionarys SIGNAL closed WAIT_FOR done'; + +# send the truncat table +send TRUNCATE TABLE t1; + +# back to default connection +connection default; + +# release the bjm +set global tokudb_debug_pause_background_job_manager = FALSE; + +# if the bug is present, the bjm should crash here within 1/4 of a second +sleep 5; + +# lets release and clean up +set DEBUG_SYNC = 'now SIGNAL done'; + +connection conn1; +reap; +connection default; +disconnect conn1; +drop table t1; + +set session tokudb_auto_analyze = @orig_auto_analyze; +set session tokudb_analyze_in_background = @orig_in_background; +set session tokudb_analyze_mode = @orig_mode; +set session tokudb_analyze_throttle = @orig_throttle; +set session tokudb_analyze_time = @orig_time; +set global tokudb_cardinality_scale_percent = @orig_scale_percent; +set session default_storage_engine = @orig_default_storage_engine; +set global tokudb_debug_pause_background_job_manager = @orig_pause_background_job_manager; +set DEBUG_SYNC='reset'; diff --git a/storage/tokudb/mysql-test/tokudb_bugs/t/db945.test b/storage/tokudb/mysql-test/tokudb_bugs/t/db945.test new file mode 100644 index 00000000000..27b0d284484 --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_bugs/t/db945.test @@ -0,0 +1,24 @@ +source include/have_tokudb.inc; +set default_storage_engine='tokudb'; +disable_warnings; +drop table if exists t1; +enable_warnings; + +set session tokudb_auto_analyze = 1; +set session tokudb_analyze_in_background = true; +set session tokudb_analyze_mode = TOKUDB_ANALYZE_STANDARD; +set session tokudb_analyze_throttle = 0; +set session tokudb_analyze_time = 0; + +create table t1(a int, b text(1), c text(1), filler text(1), primary key(a, b(1)), unique key (a, c(1))); +lock tables t1 write, t1 as a read, t1 as b read; +insert into t1(a) values(1); +alter table t1 drop key a; +unlock tables; + +# wait for the bjm queue to empty +-- disable_query_log +let $wait_condition=select count(*)=0 from information_schema.tokudb_background_job_status; +-- source include/wait_condition.inc + +drop table t1; diff --git a/storage/tokudb/mysql-test/tokudb_bugs/t/disabled.def b/storage/tokudb/mysql-test/tokudb_bugs/t/disabled.def new file mode 100644 index 00000000000..8c755dde8f5 --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_bugs/t/disabled.def @@ -0,0 +1,16 @@ +2952: tokutek not_5_5 +4472 : #4521 MDL for alter table in 5.5 prohibits this test from having any chance of working +fileops-2: tokutek not_5_5 +fileops-3: tokutek not_5_5 +fileops-4: tokutek not_5_5 +memcache_dirty: tokutek FB port +xa-2: tokutek not_5_5 +tokudb_drop_part_table_668: upgrade from tokudb 6.6.8 +tokudb_drop_simple_table_668: upgrade from tokudb 6.6.8 +checkpoint_lock_2: test can not work when the checkpoint_safe_lock is a fair rwlock +6053: tokudb is not the default storage engine +1883: tokutek's auto inc singleton patch missing +3083: no patch to find_shortest_key to prefer PK over CK +db768 : https://tokutek.atlassian.net/browse/DB-768 +dict_leak_3518 : https://tokutek.atlassian.net/browse/DB-635 +1872 : https://tokutek.atlassian.net/browse/DB-750 diff --git a/storage/tokudb/mysql-test/tokudb_bugs/t/suite.opt b/storage/tokudb/mysql-test/tokudb_bugs/t/suite.opt new file mode 100644 index 00000000000..23511b05020 --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_bugs/t/suite.opt @@ -0,0 +1 @@ +$TOKUDB_OPT $TOKUDB_LOAD_ADD --loose-tokudb-check-jemalloc=0 diff --git a/storage/tokudb/mysql-test/tokudb_bugs/t/xa-3.test b/storage/tokudb/mysql-test/tokudb_bugs/t/xa-3.test index 828cf03d2fd..e19291991b6 100644 --- a/storage/tokudb/mysql-test/tokudb_bugs/t/xa-3.test +++ b/storage/tokudb/mysql-test/tokudb_bugs/t/xa-3.test @@ -1,6 +1,12 @@ -- source include/have_innodb.inc -- source include/have_tokudb.inc -- source include/have_debug.inc +# Valgrind would report memory leaks on the intentional crashes +-- source include/not_valgrind.inc +# Embedded server does not support crashing +-- source include/not_embedded.inc +# Avoid CrashReporter popup on Mac +-- source include/not_crashrep.inc --disable_warnings drop table if exists t1, t2; diff --git a/storage/tokudb/mysql-test/tokudb_bugs/t/xa-4.test b/storage/tokudb/mysql-test/tokudb_bugs/t/xa-4.test index 1642cb7ca1b..f1f96711b89 100644 --- a/storage/tokudb/mysql-test/tokudb_bugs/t/xa-4.test +++ b/storage/tokudb/mysql-test/tokudb_bugs/t/xa-4.test @@ -1,6 +1,12 @@ -- source include/have_innodb.inc -- source include/have_tokudb.inc -- source include/have_debug.inc +# Valgrind would report memory leaks on the intentional crashes +-- source include/not_valgrind.inc +# Embedded server does not support crashing +-- source include/not_embedded.inc +# Avoid CrashReporter popup on Mac +-- source include/not_crashrep.inc --disable_warnings drop table if exists t1, t2; diff --git a/storage/tokudb/mysql-test/tokudb_bugs/t/xa-6.test b/storage/tokudb/mysql-test/tokudb_bugs/t/xa-6.test index 312c2d15cd2..c6c11f633e1 100644 --- a/storage/tokudb/mysql-test/tokudb_bugs/t/xa-6.test +++ b/storage/tokudb/mysql-test/tokudb_bugs/t/xa-6.test @@ -1,5 +1,11 @@ --source include/have_tokudb.inc --source include/have_debug.inc +# Valgrind would report memory leaks on the intentional crashes +-- source include/not_valgrind.inc +# Embedded server does not support crashing +-- source include/not_embedded.inc +# Avoid CrashReporter popup on Mac +-- source include/not_crashrep.inc --disable_warnings drop table if exists t1; diff --git a/storage/tokudb/mysql-test/tokudb_mariadb/r/alter.result b/storage/tokudb/mysql-test/tokudb_mariadb/r/alter.result index 600e34dfffd..95364221920 100644 --- a/storage/tokudb/mysql-test/tokudb_mariadb/r/alter.result +++ b/storage/tokudb/mysql-test/tokudb_mariadb/r/alter.result @@ -8,7 +8,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `i` int(11) DEFAULT NULL, - `j` int(11) DEFAULT '0' + `j` int(11) DEFAULT 0 ) ENGINE=TokuDB DEFAULT CHARSET=latin1 alter table t1 modify i int default '1'; select * from t1; @@ -17,8 +17,8 @@ i j show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `i` int(11) DEFAULT '1', - `j` int(11) DEFAULT '0' + `i` int(11) DEFAULT 1, + `j` int(11) DEFAULT 0 ) ENGINE=TokuDB DEFAULT CHARSET=latin1 alter table t1 modify j int default '2', rename t2; select * from t1; @@ -29,7 +29,7 @@ i j show create table t2; Table Create Table t2 CREATE TABLE `t2` ( - `i` int(11) DEFAULT '1', - `j` int(11) DEFAULT '2' + `i` int(11) DEFAULT 1, + `j` int(11) DEFAULT 2 ) ENGINE=TokuDB DEFAULT CHARSET=latin1 drop table t2; diff --git a/storage/tokudb/mysql-test/tokudb_mariadb/r/clustering.result b/storage/tokudb/mysql-test/tokudb_mariadb/r/clustering.result index 86f6fd4cdc2..28c758ff628 100644 --- a/storage/tokudb/mysql-test/tokudb_mariadb/r/clustering.result +++ b/storage/tokudb/mysql-test/tokudb_mariadb/r/clustering.result @@ -4,7 +4,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` text, + `c` text DEFAULT NULL, KEY `a` (`a`) `clustering`=yes, KEY `b` (`b`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 diff --git a/storage/tokudb/mysql-test/tokudb_mariadb/r/mdev5426.result b/storage/tokudb/mysql-test/tokudb_mariadb/r/mdev5426.result index 0a492ca2f2a..38114567d71 100644 --- a/storage/tokudb/mysql-test/tokudb_mariadb/r/mdev5426.result +++ b/storage/tokudb/mysql-test/tokudb_mariadb/r/mdev5426.result @@ -1,7 +1,7 @@ CREATE TABLE t1 (i INT) ENGINE=TokuDB; EXPLAIN INSERT INTO t1 SELECT * FROM t1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 0 Using temporary +1 SIMPLE t1 ALL NULL NULL NULL NULL 1 Using temporary connect con1,localhost,root,,test; INSERT INTO t1 SELECT * FROM t1; connection default; diff --git a/storage/tokudb/mysql-test/tokudb_mariadb/r/mrr.result b/storage/tokudb/mysql-test/tokudb_mariadb/r/mrr.result index 02ede175ce1..50e5b1940b0 100644 --- a/storage/tokudb/mysql-test/tokudb_mariadb/r/mrr.result +++ b/storage/tokudb/mysql-test/tokudb_mariadb/r/mrr.result @@ -34,7 +34,7 @@ SELECT t3.task_id, t3.field FROM t3,t2 WHERE t3.task_id=t2.task_id AND t2.type NOT IN (8,11); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 index PRIMARY,ymtasks_type ymtasks_type 2 NULL 2 Using where; Using index -1 SIMPLE t3 ref ymtasksoptions_task ymtasksoptions_task 4 test.t2.task_id 7 +1 SIMPLE t3 ref ymtasksoptions_task ymtasksoptions_task 4 test.t2.task_id 1 SELECT t3.task_id, t3.field FROM t3,t2 WHERE t3.task_id=t2.task_id AND t2.type NOT IN (8,11); task_id field @@ -85,7 +85,7 @@ SELECT t3.task_id, t3.field FROM t3,t2 WHERE t3.task_id=t2.task_id AND t2.type NOT IN (8,11); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 index PRIMARY,ymtasks_type ymtasks_type 2 NULL 2 Using where; Using index -1 SIMPLE t3 ref ymtasksoptions_task ymtasksoptions_task 4 test.t2.task_id 7 Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan +1 SIMPLE t3 ref ymtasksoptions_task ymtasksoptions_task 4 test.t2.task_id 1 Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan SELECT t3.task_id, t3.field FROM t3,t2 WHERE t3.task_id=t2.task_id AND t2.type NOT IN (8,11); task_id field diff --git a/storage/tokudb/mysql-test/tokudb_parts/disabled.def b/storage/tokudb/mysql-test/tokudb_parts/disabled.def index 582ca590166..3252a463176 100644 --- a/storage/tokudb/mysql-test/tokudb_parts/disabled.def +++ b/storage/tokudb/mysql-test/tokudb_parts/disabled.def @@ -1,6 +1,3 @@ -partition_basic_symlink_tokudb : tokudb_file_per_table is not supported -partition_reorganize_tokudb : tokudb_file_per_table is not supported - partition_max_parts_hash_tokudb: 5.6 test not merged yet partition_max_parts_inv_tokudb: 5.6 test not merged yet partition_max_parts_key_tokudb: 5.6 test not merged yet diff --git a/storage/tokudb/mysql-test/tokudb_parts/r/partition_alter3_tokudb.result b/storage/tokudb/mysql-test/tokudb_parts/r/partition_alter3_tokudb.result index b596e84d630..e8129e75f3e 100644 --- a/storage/tokudb/mysql-test/tokudb_parts/r/partition_alter3_tokudb.result +++ b/storage/tokudb/mysql-test/tokudb_parts/r/partition_alter3_tokudb.result @@ -392,8 +392,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -414,8 +414,8 @@ ALTER TABLE t1 PARTITION BY KEY(f_int1); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -439,8 +439,8 @@ ALTER TABLE t1 ADD PARTITION (PARTITION part1, PARTITION part7); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -462,8 +462,8 @@ ALTER TABLE t1 ADD PARTITION (PARTITION part2); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -486,8 +486,8 @@ ALTER TABLE t1 ADD PARTITION PARTITIONS 4; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -521,8 +521,8 @@ ALTER TABLE t1 COALESCE PARTITION 1; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -547,8 +547,8 @@ ALTER TABLE t1 COALESCE PARTITION 1; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -572,8 +572,8 @@ ALTER TABLE t1 COALESCE PARTITION 1; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -596,8 +596,8 @@ ALTER TABLE t1 COALESCE PARTITION 1; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -619,8 +619,8 @@ ALTER TABLE t1 COALESCE PARTITION 1; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -641,8 +641,8 @@ ALTER TABLE t1 COALESCE PARTITION 1; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -662,8 +662,8 @@ ALTER TABLE t1 COALESCE PARTITION 1; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -686,8 +686,8 @@ ALTER TABLE t1 REMOVE PARTITIONING; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL diff --git a/storage/tokudb/mysql-test/tokudb_parts/r/partition_alter4_tokudb.result b/storage/tokudb/mysql-test/tokudb_parts/r/partition_alter4_tokudb.result index 40d167b57ea..8412c7b37b0 100644 --- a/storage/tokudb/mysql-test/tokudb_parts/r/partition_alter4_tokudb.result +++ b/storage/tokudb/mysql-test/tokudb_parts/r/partition_alter4_tokudb.result @@ -7560,7 +7560,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10; Table Op Msg_type Msg_text -test.t1 analyze error Error in list of partitions to test.t1 +test.t1 analyze Error Error in list of partitions to test.t1 +test.t1 analyze status Operation failed INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -8019,7 +8020,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10; Table Op Msg_type Msg_text -test.t1 analyze error Error in list of partitions to test.t1 +test.t1 analyze Error Error in list of partitions to test.t1 +test.t1 analyze status Operation failed INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -8489,7 +8491,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10; Table Op Msg_type Msg_text -test.t1 analyze error Error in list of partitions to test.t1 +test.t1 analyze Error Error in list of partitions to test.t1 +test.t1 analyze status Operation failed INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -8960,7 +8963,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10; Table Op Msg_type Msg_text -test.t1 analyze error Error in list of partitions to test.t1 +test.t1 analyze Error Error in list of partitions to test.t1 +test.t1 analyze status Operation failed INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -9425,7 +9429,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10; Table Op Msg_type Msg_text -test.t1 analyze error Error in list of partitions to test.t1 +test.t1 analyze Error Error in list of partitions to test.t1 +test.t1 analyze status Operation failed INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -9896,7 +9901,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10; Table Op Msg_type Msg_text -test.t1 analyze error Error in list of partitions to test.t1 +test.t1 analyze Error Error in list of partitions to test.t1 +test.t1 analyze status Operation failed INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -10372,7 +10378,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10; Table Op Msg_type Msg_text -test.t1 analyze error Error in list of partitions to test.t1 +test.t1 analyze Error Error in list of partitions to test.t1 +test.t1 analyze status Operation failed INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -10846,7 +10853,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10; Table Op Msg_type Msg_text -test.t1 analyze error Error in list of partitions to test.t1 +test.t1 analyze Error Error in list of partitions to test.t1 +test.t1 analyze status Operation failed INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -11310,7 +11318,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1; Table Op Msg_type Msg_text -test.t1 analyze error Error in list of partitions to test.t1 +test.t1 analyze Error Error in list of partitions to test.t1 +test.t1 analyze status Operation failed INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -11769,7 +11778,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1; Table Op Msg_type Msg_text -test.t1 analyze error Error in list of partitions to test.t1 +test.t1 analyze Error Error in list of partitions to test.t1 +test.t1 analyze status Operation failed INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -12239,7 +12249,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1; Table Op Msg_type Msg_text -test.t1 analyze error Error in list of partitions to test.t1 +test.t1 analyze Error Error in list of partitions to test.t1 +test.t1 analyze status Operation failed INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -12710,7 +12721,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1; Table Op Msg_type Msg_text -test.t1 analyze error Error in list of partitions to test.t1 +test.t1 analyze Error Error in list of partitions to test.t1 +test.t1 analyze status Operation failed INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -13175,7 +13187,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1; Table Op Msg_type Msg_text -test.t1 analyze error Error in list of partitions to test.t1 +test.t1 analyze Error Error in list of partitions to test.t1 +test.t1 analyze status Operation failed INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -13646,7 +13659,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1; Table Op Msg_type Msg_text -test.t1 analyze error Error in list of partitions to test.t1 +test.t1 analyze Error Error in list of partitions to test.t1 +test.t1 analyze status Operation failed INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -14122,7 +14136,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1; Table Op Msg_type Msg_text -test.t1 analyze error Error in list of partitions to test.t1 +test.t1 analyze Error Error in list of partitions to test.t1 +test.t1 analyze status Operation failed INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -14596,7 +14611,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1; Table Op Msg_type Msg_text -test.t1 analyze error Error in list of partitions to test.t1 +test.t1 analyze Error Error in list of partitions to test.t1 +test.t1 analyze status Operation failed INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -26313,7 +26329,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10; Table Op Msg_type Msg_text -test.t1 check error Error in list of partitions to test.t1 +test.t1 check Error Error in list of partitions to test.t1 +test.t1 check status Operation failed INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -26772,7 +26789,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10; Table Op Msg_type Msg_text -test.t1 check error Error in list of partitions to test.t1 +test.t1 check Error Error in list of partitions to test.t1 +test.t1 check status Operation failed INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -27242,7 +27260,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10; Table Op Msg_type Msg_text -test.t1 check error Error in list of partitions to test.t1 +test.t1 check Error Error in list of partitions to test.t1 +test.t1 check status Operation failed INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -27713,7 +27732,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10; Table Op Msg_type Msg_text -test.t1 check error Error in list of partitions to test.t1 +test.t1 check Error Error in list of partitions to test.t1 +test.t1 check status Operation failed INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -28178,7 +28198,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10; Table Op Msg_type Msg_text -test.t1 check error Error in list of partitions to test.t1 +test.t1 check Error Error in list of partitions to test.t1 +test.t1 check status Operation failed INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -28649,7 +28670,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10; Table Op Msg_type Msg_text -test.t1 check error Error in list of partitions to test.t1 +test.t1 check Error Error in list of partitions to test.t1 +test.t1 check status Operation failed INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -29125,7 +29147,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10; Table Op Msg_type Msg_text -test.t1 check error Error in list of partitions to test.t1 +test.t1 check Error Error in list of partitions to test.t1 +test.t1 check status Operation failed INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -29599,7 +29622,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10; Table Op Msg_type Msg_text -test.t1 check error Error in list of partitions to test.t1 +test.t1 check Error Error in list of partitions to test.t1 +test.t1 check status Operation failed INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -30063,7 +30087,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1; Table Op Msg_type Msg_text -test.t1 check error Error in list of partitions to test.t1 +test.t1 check Error Error in list of partitions to test.t1 +test.t1 check status Operation failed INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -30522,7 +30547,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1; Table Op Msg_type Msg_text -test.t1 check error Error in list of partitions to test.t1 +test.t1 check Error Error in list of partitions to test.t1 +test.t1 check status Operation failed INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -30992,7 +31018,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1; Table Op Msg_type Msg_text -test.t1 check error Error in list of partitions to test.t1 +test.t1 check Error Error in list of partitions to test.t1 +test.t1 check status Operation failed INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -31463,7 +31490,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1; Table Op Msg_type Msg_text -test.t1 check error Error in list of partitions to test.t1 +test.t1 check Error Error in list of partitions to test.t1 +test.t1 check status Operation failed INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -31928,7 +31956,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1; Table Op Msg_type Msg_text -test.t1 check error Error in list of partitions to test.t1 +test.t1 check Error Error in list of partitions to test.t1 +test.t1 check status Operation failed INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -32399,7 +32428,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1; Table Op Msg_type Msg_text -test.t1 check error Error in list of partitions to test.t1 +test.t1 check Error Error in list of partitions to test.t1 +test.t1 check status Operation failed INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -32875,7 +32905,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1; Table Op Msg_type Msg_text -test.t1 check error Error in list of partitions to test.t1 +test.t1 check Error Error in list of partitions to test.t1 +test.t1 check status Operation failed INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -33349,7 +33380,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1; Table Op Msg_type Msg_text -test.t1 check error Error in list of partitions to test.t1 +test.t1 check Error Error in list of partitions to test.t1 +test.t1 check status Operation failed INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -45082,7 +45114,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10; Table Op Msg_type Msg_text -test.t1 optimize error Error in list of partitions to test.t1 +test.t1 optimize Error Error in list of partitions to test.t1 +test.t1 optimize status Operation failed INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -45541,7 +45574,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10; Table Op Msg_type Msg_text -test.t1 optimize error Error in list of partitions to test.t1 +test.t1 optimize Error Error in list of partitions to test.t1 +test.t1 optimize status Operation failed INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -46011,7 +46045,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10; Table Op Msg_type Msg_text -test.t1 optimize error Error in list of partitions to test.t1 +test.t1 optimize Error Error in list of partitions to test.t1 +test.t1 optimize status Operation failed INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -46482,7 +46517,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10; Table Op Msg_type Msg_text -test.t1 optimize error Error in list of partitions to test.t1 +test.t1 optimize Error Error in list of partitions to test.t1 +test.t1 optimize status Operation failed INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -46947,7 +46983,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10; Table Op Msg_type Msg_text -test.t1 optimize error Error in list of partitions to test.t1 +test.t1 optimize Error Error in list of partitions to test.t1 +test.t1 optimize status Operation failed INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -47418,7 +47455,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10; Table Op Msg_type Msg_text -test.t1 optimize error Error in list of partitions to test.t1 +test.t1 optimize Error Error in list of partitions to test.t1 +test.t1 optimize status Operation failed INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -47894,7 +47932,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10; Table Op Msg_type Msg_text -test.t1 optimize error Error in list of partitions to test.t1 +test.t1 optimize Error Error in list of partitions to test.t1 +test.t1 optimize status Operation failed INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -48368,7 +48407,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10; Table Op Msg_type Msg_text -test.t1 optimize error Error in list of partitions to test.t1 +test.t1 optimize Error Error in list of partitions to test.t1 +test.t1 optimize status Operation failed INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -48832,7 +48872,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1; Table Op Msg_type Msg_text -test.t1 optimize error Error in list of partitions to test.t1 +test.t1 optimize Error Error in list of partitions to test.t1 +test.t1 optimize status Operation failed INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -49291,7 +49332,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1; Table Op Msg_type Msg_text -test.t1 optimize error Error in list of partitions to test.t1 +test.t1 optimize Error Error in list of partitions to test.t1 +test.t1 optimize status Operation failed INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -49761,7 +49803,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1; Table Op Msg_type Msg_text -test.t1 optimize error Error in list of partitions to test.t1 +test.t1 optimize Error Error in list of partitions to test.t1 +test.t1 optimize status Operation failed INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -50232,7 +50275,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1; Table Op Msg_type Msg_text -test.t1 optimize error Error in list of partitions to test.t1 +test.t1 optimize Error Error in list of partitions to test.t1 +test.t1 optimize status Operation failed INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -50697,7 +50741,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1; Table Op Msg_type Msg_text -test.t1 optimize error Error in list of partitions to test.t1 +test.t1 optimize Error Error in list of partitions to test.t1 +test.t1 optimize status Operation failed INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -51168,7 +51213,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1; Table Op Msg_type Msg_text -test.t1 optimize error Error in list of partitions to test.t1 +test.t1 optimize Error Error in list of partitions to test.t1 +test.t1 optimize status Operation failed INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -51644,7 +51690,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1; Table Op Msg_type Msg_text -test.t1 optimize error Error in list of partitions to test.t1 +test.t1 optimize Error Error in list of partitions to test.t1 +test.t1 optimize status Operation failed INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -52118,7 +52165,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1; Table Op Msg_type Msg_text -test.t1 optimize error Error in list of partitions to test.t1 +test.t1 optimize Error Error in list of partitions to test.t1 +test.t1 optimize status Operation failed INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -75368,7 +75416,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10; Table Op Msg_type Msg_text -test.t1 repair error Error in list of partitions to test.t1 +test.t1 repair Error Error in list of partitions to test.t1 +test.t1 repair status Operation failed INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -75827,7 +75876,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10; Table Op Msg_type Msg_text -test.t1 repair error Error in list of partitions to test.t1 +test.t1 repair Error Error in list of partitions to test.t1 +test.t1 repair status Operation failed INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -76297,7 +76347,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10; Table Op Msg_type Msg_text -test.t1 repair error Error in list of partitions to test.t1 +test.t1 repair Error Error in list of partitions to test.t1 +test.t1 repair status Operation failed INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -76768,7 +76819,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10; Table Op Msg_type Msg_text -test.t1 repair error Error in list of partitions to test.t1 +test.t1 repair Error Error in list of partitions to test.t1 +test.t1 repair status Operation failed INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -77233,7 +77285,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10; Table Op Msg_type Msg_text -test.t1 repair error Error in list of partitions to test.t1 +test.t1 repair Error Error in list of partitions to test.t1 +test.t1 repair status Operation failed INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -77704,7 +77757,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10; Table Op Msg_type Msg_text -test.t1 repair error Error in list of partitions to test.t1 +test.t1 repair Error Error in list of partitions to test.t1 +test.t1 repair status Operation failed INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -78180,7 +78234,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10; Table Op Msg_type Msg_text -test.t1 repair error Error in list of partitions to test.t1 +test.t1 repair Error Error in list of partitions to test.t1 +test.t1 repair status Operation failed INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -78654,7 +78709,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10; Table Op Msg_type Msg_text -test.t1 repair error Error in list of partitions to test.t1 +test.t1 repair Error Error in list of partitions to test.t1 +test.t1 repair status Operation failed INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -79118,7 +79174,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1; Table Op Msg_type Msg_text -test.t1 repair error Error in list of partitions to test.t1 +test.t1 repair Error Error in list of partitions to test.t1 +test.t1 repair status Operation failed INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -79577,7 +79634,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1; Table Op Msg_type Msg_text -test.t1 repair error Error in list of partitions to test.t1 +test.t1 repair Error Error in list of partitions to test.t1 +test.t1 repair status Operation failed INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -80047,7 +80105,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1; Table Op Msg_type Msg_text -test.t1 repair error Error in list of partitions to test.t1 +test.t1 repair Error Error in list of partitions to test.t1 +test.t1 repair status Operation failed INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -80518,7 +80577,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1; Table Op Msg_type Msg_text -test.t1 repair error Error in list of partitions to test.t1 +test.t1 repair Error Error in list of partitions to test.t1 +test.t1 repair status Operation failed INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -80983,7 +81043,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1; Table Op Msg_type Msg_text -test.t1 repair error Error in list of partitions to test.t1 +test.t1 repair Error Error in list of partitions to test.t1 +test.t1 repair status Operation failed INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -81454,7 +81515,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1; Table Op Msg_type Msg_text -test.t1 repair error Error in list of partitions to test.t1 +test.t1 repair Error Error in list of partitions to test.t1 +test.t1 repair status Operation failed INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -81930,7 +81992,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1; Table Op Msg_type Msg_text -test.t1 repair error Error in list of partitions to test.t1 +test.t1 repair Error Error in list of partitions to test.t1 +test.t1 repair status Operation failed INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -82404,7 +82467,8 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1; Table Op Msg_type Msg_text -test.t1 repair error Error in list of partitions to test.t1 +test.t1 repair Error Error in list of partitions to test.t1 +test.t1 repair status Operation failed INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; diff --git a/storage/tokudb/mysql-test/tokudb_parts/r/partition_auto_increment_tokudb.result b/storage/tokudb/mysql-test/tokudb_parts/r/partition_auto_increment_tokudb.result index e6ea7f95cc9..242ed55ac68 100644 --- a/storage/tokudb/mysql-test/tokudb_parts/r/partition_auto_increment_tokudb.result +++ b/storage/tokudb/mysql-test/tokudb_parts/r/partition_auto_increment_tokudb.result @@ -1,3 +1,6 @@ +SET @tokudb_prelock_empty_saved = @@GLOBAL.tokudb_prelock_empty; +SET GLOBAL tokudb_prelock_empty = 0; +SET SESSION tokudb_prelock_empty = 0; DROP TABLE IF EXISTS t1; # test without partitioning for reference CREATE TABLE t1 ( @@ -1113,3 +1116,4 @@ a 0 DROP TABLE t1; ############################################################################## +SET GLOBAL tokudb_prelock_empty = @tokudb_prelock_empty_saved; diff --git a/storage/tokudb/mysql-test/tokudb_parts/r/partition_engine_tokudb.result b/storage/tokudb/mysql-test/tokudb_parts/r/partition_engine_tokudb.result index 7df4c93cd85..8837049119a 100644 --- a/storage/tokudb/mysql-test/tokudb_parts/r/partition_engine_tokudb.result +++ b/storage/tokudb/mysql-test/tokudb_parts/r/partition_engine_tokudb.result @@ -62,8 +62,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -519,8 +519,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -978,8 +978,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -1503,8 +1503,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -2004,8 +2004,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -2466,8 +2466,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -2928,8 +2928,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -3387,8 +3387,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -3852,8 +3852,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -4310,8 +4310,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -4764,8 +4764,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL diff --git a/storage/tokudb/mysql-test/tokudb_parts/r/partition_syntax_tokudb.result b/storage/tokudb/mysql-test/tokudb_parts/r/partition_syntax_tokudb.result index 340bbf07f35..13b8a133628 100644 --- a/storage/tokudb/mysql-test/tokudb_parts/r/partition_syntax_tokudb.result +++ b/storage/tokudb/mysql-test/tokudb_parts/r/partition_syntax_tokudb.result @@ -652,8 +652,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -679,8 +679,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -713,8 +713,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -735,8 +735,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -820,8 +820,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -856,8 +856,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -881,8 +881,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -906,8 +906,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -931,8 +931,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -1675,8 +1675,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL @@ -1704,8 +1704,8 @@ create_command SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT '0', - `f_int2` int(11) DEFAULT '0', + `f_int1` int(11) DEFAULT 0, + `f_int2` int(11) DEFAULT 0, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL diff --git a/storage/tokudb/mysql-test/tokudb_parts/t/disabled.def b/storage/tokudb/mysql-test/tokudb_parts/t/disabled.def new file mode 100644 index 00000000000..90e599cd035 --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_parts/t/disabled.def @@ -0,0 +1,2 @@ +partition_basic_symlink_tokudb : tokudb_file_per_table is not supported +partition_reorganize_tokudb : tokudb_file_per_table is not supported diff --git a/storage/tokudb/mysql-test/tokudb_parts/t/partition_auto_increment_tokudb-master.opt b/storage/tokudb/mysql-test/tokudb_parts/t/partition_auto_increment_tokudb-master.opt deleted file mode 100644 index 857da664d10..00000000000 --- a/storage/tokudb/mysql-test/tokudb_parts/t/partition_auto_increment_tokudb-master.opt +++ /dev/null @@ -1 +0,0 @@ ---tokudb-prelock-empty=0 diff --git a/storage/tokudb/mysql-test/tokudb_parts/t/partition_auto_increment_tokudb.test b/storage/tokudb/mysql-test/tokudb_parts/t/partition_auto_increment_tokudb.test index a13ddf65d4b..ceec2fda9ee 100644 --- a/storage/tokudb/mysql-test/tokudb_parts/t/partition_auto_increment_tokudb.test +++ b/storage/tokudb/mysql-test/tokudb_parts/t/partition_auto_increment_tokudb.test @@ -29,7 +29,12 @@ let $engine= 'TokuDB'; --source include/have_tokudb.inc +SET @tokudb_prelock_empty_saved = @@GLOBAL.tokudb_prelock_empty; +SET GLOBAL tokudb_prelock_empty = 0; +SET SESSION tokudb_prelock_empty = 0; + #------------------------------------------------------------------------------# # Execute the tests to be applied to all storage engines --source suite/parts/inc/partition_auto_increment.inc +SET GLOBAL tokudb_prelock_empty = @tokudb_prelock_empty_saved; diff --git a/storage/tokudb/mysql-test/tokudb_parts/t/suite.opt b/storage/tokudb/mysql-test/tokudb_parts/t/suite.opt new file mode 100644 index 00000000000..23511b05020 --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_parts/t/suite.opt @@ -0,0 +1 @@ +$TOKUDB_OPT $TOKUDB_LOAD_ADD --loose-tokudb-check-jemalloc=0 diff --git a/storage/tokudb/mysql-test/tokudb_rpl/r/rpl_rfr_disable_on_expl_pk_absence.result b/storage/tokudb/mysql-test/tokudb_rpl/r/rpl_rfr_disable_on_expl_pk_absence.result new file mode 100644 index 00000000000..981a833aea5 --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_rpl/r/rpl_rfr_disable_on_expl_pk_absence.result @@ -0,0 +1,47 @@ +include/master-slave.inc +Warnings: +Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. +Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. +[connection master] +call mtr.add_suppression("read free replication is disabled for tokudb table"); +CREATE TABLE t (a int(11), b char(20)) ENGINE = TokuDB; +INSERT INTO t (a, b) VALUES (1, 'a'), (2, 'b'), (3, 'c'), (4, 'd'), (5, 'e'); +SELECT * FROM t; +a b +1 a +2 b +3 c +4 d +5 e +UPDATE t SET a = a + 10 WHERE b = 'b'; +SELECT * FROM t; +a b +1 a +12 b +3 c +4 d +5 e +SELECT * FROM t; +a b +1 a +12 b +3 c +4 d +5 e +UPDATE t SET a = a + 10 WHERE b = 'b'; +SELECT * FROM t; +a b +1 a +22 b +3 c +4 d +5 e +SELECT * FROM t; +a b +1 a +22 b +3 c +4 d +5 e +DROP TABLE t; +include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/tokudb_rpl/t/rpl_rfr_disable_on_expl_pk_absence-slave.opt b/storage/tokudb/mysql-test/tokudb_rpl/t/rpl_rfr_disable_on_expl_pk_absence-slave.opt new file mode 100644 index 00000000000..fb12af6c5bd --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_rpl/t/rpl_rfr_disable_on_expl_pk_absence-slave.opt @@ -0,0 +1 @@ +--read-only=true --tokudb-rpl-unique-checks=false --tokudb-rpl-lookup-rows=false diff --git a/storage/tokudb/mysql-test/tokudb_rpl/t/rpl_rfr_disable_on_expl_pk_absence.test b/storage/tokudb/mysql-test/tokudb_rpl/t/rpl_rfr_disable_on_expl_pk_absence.test new file mode 100644 index 00000000000..67e77c1511c --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_rpl/t/rpl_rfr_disable_on_expl_pk_absence.test @@ -0,0 +1,48 @@ +# Test case for bug#1536663 +# +# When read-free-replication is enabled for tokudb and there is no explicit +# pk for replicated table there can be dublicated records in the table on +# update operation. +# +# Consider this update operation: +# UPDATE t SET a = a + 10 WHERE b = 'b'; +# The master does rows lookup and updates the rows which values correspond to +# the condition. The update events are written to binary log with +# rows values from the master. As rows lookup is forbidden for slave +# the new rows are added instead of updating corresponding rows. +# +# Without the fix there will be several rows with b = 'b' in the table on slave +# instead of one updated row. +# + +--source include/have_tokudb.inc +--source include/have_binlog_format_row.inc +--source include/master-slave.inc + +call mtr.add_suppression("read free replication is disabled for tokudb table"); + +--connection master +CREATE TABLE t (a int(11), b char(20)) ENGINE = TokuDB; +INSERT INTO t (a, b) VALUES (1, 'a'), (2, 'b'), (3, 'c'), (4, 'd'), (5, 'e'); + +--sync_slave_with_master +--sorted_result +SELECT * FROM t; + +--let $i = 2 +--while($i) { + --dec $i + --connection master + UPDATE t SET a = a + 10 WHERE b = 'b'; + --sorted_result + SELECT * FROM t; + --sync_slave_with_master + --sorted_result + SELECT * FROM t; +} + +--connection master +DROP TABLE t; +--sync_slave_with_master + +--source include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/tokudb_sys_vars/r/tokudb_analyze_delete_fraction.result b/storage/tokudb/mysql-test/tokudb_sys_vars/r/tokudb_analyze_delete_fraction.result new file mode 100644 index 00000000000..41918883dd6 --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_sys_vars/r/tokudb_analyze_delete_fraction.result @@ -0,0 +1,73 @@ +SET @orig_global = @@global.tokudb_analyze_delete_fraction; +SELECT @orig_global; +@orig_global +1 +SET @orig_session = @@session.tokudb_analyze_delete_fraction; +SELECT @orig_session; +@orig_session +1 +SET GLOBAL tokudb_analyze_delete_fraction = .5; +SELECT @@global.tokudb_analyze_delete_fraction; +@@global.tokudb_analyze_delete_fraction +0.500000 +SET GLOBAL tokudb_analyze_delete_fraction = 0; +SELECT @@global.tokudb_analyze_delete_fraction; +@@global.tokudb_analyze_delete_fraction +0.000000 +SET GLOBAL tokudb_analyze_delete_fraction = DEFAULT; +SELECT @@global.tokudb_analyze_delete_fraction; +@@global.tokudb_analyze_delete_fraction +1.000000 +SET GLOBAL tokudb_analyze_delete_fraction = 'foobar'; +ERROR 42000: Incorrect argument type to variable 'tokudb_analyze_delete_fraction' +SELECT @@global.tokudb_analyze_delete_fraction; +@@global.tokudb_analyze_delete_fraction +1.000000 +SET GLOBAL tokudb_analyze_delete_fraction = 3.75; +Warnings: +Warning 1292 Truncated incorrect tokudb_analyze_delete_fraction value: '3.75' +SELECT @@global.tokudb_analyze_delete_fraction; +@@global.tokudb_analyze_delete_fraction +1.000000 +SET SESSION tokudb_analyze_delete_fraction = .5; +SELECT @@session.tokudb_analyze_delete_fraction; +@@session.tokudb_analyze_delete_fraction +0.500000 +SET SESSION tokudb_analyze_delete_fraction = 0; +SELECT @@session.tokudb_analyze_delete_fraction; +@@session.tokudb_analyze_delete_fraction +0.000000 +SET SESSION tokudb_analyze_delete_fraction = DEFAULT; +SELECT @@session.tokudb_analyze_delete_fraction; +@@session.tokudb_analyze_delete_fraction +1.000000 +SET SESSION tokudb_analyze_delete_fraction = 'foobar'; +ERROR 42000: Incorrect argument type to variable 'tokudb_analyze_delete_fraction' +SELECT @@session.tokudb_analyze_delete_fraction; +@@session.tokudb_analyze_delete_fraction +1.000000 +SET SESSION tokudb_analyze_delete_fraction = 3.75; +Warnings: +Warning 1292 Truncated incorrect tokudb_analyze_delete_fraction value: '3.75' +SELECT @@session.tokudb_analyze_delete_fraction; +@@session.tokudb_analyze_delete_fraction +1.000000 +SET GLOBAL tokudb_analyze_delete_fraction = .2; +SET SESSION tokudb_analyze_delete_fraction = .3; +SELECT @@global.tokudb_analyze_delete_fraction; +@@global.tokudb_analyze_delete_fraction +0.200000 +SELECT @@session.tokudb_analyze_delete_fraction; +@@session.tokudb_analyze_delete_fraction +0.300000 +SHOW VARIABLES LIKE 'tokudb_analyze_delete_fraction'; +Variable_name Value +tokudb_analyze_delete_fraction 0.300000 +SET SESSION tokudb_analyze_delete_fraction = @orig_session; +SELECT @@session.tokudb_analyze_delete_fraction; +@@session.tokudb_analyze_delete_fraction +1.000000 +SET GLOBAL tokudb_analyze_delete_fraction = @orig_global; +SELECT @@global.tokudb_analyze_delete_fraction; +@@global.tokudb_analyze_delete_fraction +1.000000 diff --git a/storage/tokudb/mysql-test/tokudb_sys_vars/r/tokudb_analyze_in_background_basic.result b/storage/tokudb/mysql-test/tokudb_sys_vars/r/tokudb_analyze_in_background_basic.result new file mode 100644 index 00000000000..53e96810eda --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_sys_vars/r/tokudb_analyze_in_background_basic.result @@ -0,0 +1,99 @@ +SET @orig_global = @@global.tokudb_analyze_in_background; +SELECT @orig_global; +@orig_global +0 +SET @orig_session = @@session.tokudb_analyze_in_background; +SELECT @orig_session; +@orig_session +0 +SET GLOBAL tokudb_analyze_in_background = 0; +SELECT @@global.tokudb_analyze_in_background; +@@global.tokudb_analyze_in_background +0 +SET GLOBAL tokudb_analyze_in_background = 1; +SELECT @@global.tokudb_analyze_in_background; +@@global.tokudb_analyze_in_background +1 +SET GLOBAL tokudb_analyze_in_background = DEFAULT; +SELECT @@global.tokudb_analyze_in_background; +@@global.tokudb_analyze_in_background +0 +SET GLOBAL tokudb_analyze_in_background = -6; +SELECT @@global.tokudb_analyze_in_background; +@@global.tokudb_analyze_in_background +1 +SET GLOBAL tokudb_analyze_in_background = 1.6; +ERROR 42000: Incorrect argument type to variable 'tokudb_analyze_in_background' +SELECT @@global.tokudb_analyze_in_background; +@@global.tokudb_analyze_in_background +1 +SET GLOBAL tokudb_analyze_in_background = "T"; +ERROR 42000: Variable 'tokudb_analyze_in_background' can't be set to the value of 'T' +SELECT @@global.tokudb_analyze_in_background; +@@global.tokudb_analyze_in_background +1 +SET GLOBAL tokudb_analyze_in_background = "Y"; +ERROR 42000: Variable 'tokudb_analyze_in_background' can't be set to the value of 'Y' +SELECT @@global.tokudb_analyze_in_background; +@@global.tokudb_analyze_in_background +1 +SET GLOBAL tokudb_analyze_in_background = 'foobar'; +ERROR 42000: Variable 'tokudb_analyze_in_background' can't be set to the value of 'foobar' +SELECT @@global.tokudb_analyze_in_background; +@@global.tokudb_analyze_in_background +1 +SET SESSION tokudb_analyze_in_background = 0; +SELECT @@session.tokudb_analyze_in_background; +@@session.tokudb_analyze_in_background +0 +SET SESSION tokudb_analyze_in_background = 1; +SELECT @@session.tokudb_analyze_in_background; +@@session.tokudb_analyze_in_background +1 +SET SESSION tokudb_analyze_in_background = DEFAULT; +SELECT @@session.tokudb_analyze_in_background; +@@session.tokudb_analyze_in_background +1 +SET SESSION tokudb_analyze_in_background = -6; +SELECT @@session.tokudb_analyze_in_background; +@@session.tokudb_analyze_in_background +1 +SET SESSION tokudb_analyze_in_background = 1.6; +ERROR 42000: Incorrect argument type to variable 'tokudb_analyze_in_background' +SELECT @@session.tokudb_analyze_in_background; +@@session.tokudb_analyze_in_background +1 +SET SESSION tokudb_analyze_in_background = "T"; +ERROR 42000: Variable 'tokudb_analyze_in_background' can't be set to the value of 'T' +SELECT @@session.tokudb_analyze_in_background; +@@session.tokudb_analyze_in_background +1 +SET SESSION tokudb_analyze_in_background = "Y"; +ERROR 42000: Variable 'tokudb_analyze_in_background' can't be set to the value of 'Y' +SELECT @@session.tokudb_analyze_in_background; +@@session.tokudb_analyze_in_background +1 +SET SESSION tokudb_analyze_in_background = 'foobar'; +ERROR 42000: Variable 'tokudb_analyze_in_background' can't be set to the value of 'foobar' +SELECT @@session.tokudb_analyze_in_background; +@@session.tokudb_analyze_in_background +1 +SET GLOBAL tokudb_analyze_in_background = 0; +SET SESSION tokudb_analyze_in_background = 1; +SELECT @@global.tokudb_analyze_in_background; +@@global.tokudb_analyze_in_background +0 +SELECT @@session.tokudb_analyze_in_background; +@@session.tokudb_analyze_in_background +1 +SHOW VARIABLES LIKE 'tokudb_analyze_in_background'; +Variable_name Value +tokudb_analyze_in_background ON +SET SESSION tokudb_analyze_in_background = @orig_session; +SELECT @@session.tokudb_analyze_in_background; +@@session.tokudb_analyze_in_background +0 +SET GLOBAL tokudb_analyze_in_background = @orig_global; +SELECT @@global.tokudb_analyze_in_background; +@@global.tokudb_analyze_in_background +0 diff --git a/storage/tokudb/mysql-test/tokudb_sys_vars/r/tokudb_analyze_mode_basic.result b/storage/tokudb/mysql-test/tokudb_sys_vars/r/tokudb_analyze_mode_basic.result new file mode 100644 index 00000000000..e2a3059a5aa --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_sys_vars/r/tokudb_analyze_mode_basic.result @@ -0,0 +1,89 @@ +SET @orig_global = @@global.tokudb_analyze_mode; +SELECT @orig_global; +@orig_global +TOKUDB_ANALYZE_STANDARD +SET @orig_session = @@session.tokudb_analyze_mode; +SELECT @orig_session; +@orig_session +TOKUDB_ANALYZE_STANDARD +SET GLOBAL tokudb_analyze_mode = 'tokudb_analyze_standard'; +SELECT @@global.tokudb_analyze_mode; +@@global.tokudb_analyze_mode +TOKUDB_ANALYZE_STANDARD +SET GLOBAL tokudb_analyze_mode = 'tokudb_analyze_recount_rows'; +SELECT @@global.tokudb_analyze_mode; +@@global.tokudb_analyze_mode +TOKUDB_ANALYZE_RECOUNT_ROWS +SET GLOBAL tokudb_analyze_mode = 'tokudb_analyze_cancel'; +SELECT @@global.tokudb_analyze_mode; +@@global.tokudb_analyze_mode +TOKUDB_ANALYZE_CANCEL +SET GLOBAL tokudb_analyze_mode = DEFAULT; +SELECT @@global.tokudb_analyze_mode; +@@global.tokudb_analyze_mode +TOKUDB_ANALYZE_STANDARD +SET GLOBAL tokudb_analyze_mode = ''; +ERROR 42000: Variable 'tokudb_analyze_mode' can't be set to the value of '' +SELECT @@global.tokudb_analyze_mode; +@@global.tokudb_analyze_mode +TOKUDB_ANALYZE_STANDARD +SET GLOBAL tokudb_analyze_mode = 'foobar'; +ERROR 42000: Variable 'tokudb_analyze_mode' can't be set to the value of 'foobar' +SELECT @@global.tokudb_analyze_mode; +@@global.tokudb_analyze_mode +TOKUDB_ANALYZE_STANDARD +SET GLOBAL tokudb_analyze_mode = 123; +ERROR 42000: Variable 'tokudb_analyze_mode' can't be set to the value of '123' +SELECT @@global.tokudb_analyze_mode; +@@global.tokudb_analyze_mode +TOKUDB_ANALYZE_STANDARD +SET SESSION tokudb_analyze_mode = 'tokudb_analyze_standard'; +SELECT @@session.tokudb_analyze_mode; +@@session.tokudb_analyze_mode +TOKUDB_ANALYZE_STANDARD +SET SESSION tokudb_analyze_mode = 'tokudb_analyze_recount_rows'; +SELECT @@session.tokudb_analyze_mode; +@@session.tokudb_analyze_mode +TOKUDB_ANALYZE_RECOUNT_ROWS +SET SESSION tokudb_analyze_mode = 'tokudb_analyze_cancel'; +SELECT @@session.tokudb_analyze_mode; +@@session.tokudb_analyze_mode +TOKUDB_ANALYZE_CANCEL +SET SESSION tokudb_analyze_mode = DEFAULT; +SELECT @@session.tokudb_analyze_mode; +@@session.tokudb_analyze_mode +TOKUDB_ANALYZE_STANDARD +SET SESSION tokudb_analyze_mode = ''; +ERROR 42000: Variable 'tokudb_analyze_mode' can't be set to the value of '' +SELECT @@session.tokudb_analyze_mode; +@@session.tokudb_analyze_mode +TOKUDB_ANALYZE_STANDARD +SET SESSION tokudb_analyze_mode = 'foobar'; +ERROR 42000: Variable 'tokudb_analyze_mode' can't be set to the value of 'foobar' +SELECT @@session.tokudb_analyze_mode; +@@session.tokudb_analyze_mode +TOKUDB_ANALYZE_STANDARD +SET SESSION tokudb_analyze_mode = 123; +ERROR 42000: Variable 'tokudb_analyze_mode' can't be set to the value of '123' +SELECT @@session.tokudb_analyze_mode; +@@session.tokudb_analyze_mode +TOKUDB_ANALYZE_STANDARD +SET GLOBAL tokudb_analyze_mode = 'tokudb_analyze_standard'; +SET SESSION tokudb_analyze_mode = 'tokudb_analyze_recount_rows'; +SELECT @@global.tokudb_analyze_mode; +@@global.tokudb_analyze_mode +TOKUDB_ANALYZE_STANDARD +SELECT @@session.tokudb_analyze_mode; +@@session.tokudb_analyze_mode +TOKUDB_ANALYZE_RECOUNT_ROWS +SHOW VARIABLES LIKE 'tokudb_analyze_mode'; +Variable_name Value +tokudb_analyze_mode TOKUDB_ANALYZE_RECOUNT_ROWS +SET SESSION tokudb_analyze_mode = @orig_session; +SELECT @@session.tokudb_analyze_mode; +@@session.tokudb_analyze_mode +TOKUDB_ANALYZE_STANDARD +SET GLOBAL tokudb_analyze_mode = @orig_global; +SELECT @@global.tokudb_analyze_mode; +@@global.tokudb_analyze_mode +TOKUDB_ANALYZE_STANDARD diff --git a/storage/tokudb/mysql-test/tokudb_sys_vars/r/tokudb_analyze_throttle_basic.result b/storage/tokudb/mysql-test/tokudb_sys_vars/r/tokudb_analyze_throttle_basic.result new file mode 100644 index 00000000000..34317c7cb7b --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_sys_vars/r/tokudb_analyze_throttle_basic.result @@ -0,0 +1,61 @@ +SET @orig_global = @@global.tokudb_analyze_throttle; +SELECT @orig_global; +@orig_global +0 +SET @orig_session = @@session.tokudb_analyze_throttle; +SELECT @orig_session; +@orig_session +0 +SET GLOBAL tokudb_analyze_throttle = 10; +SELECT @@global.tokudb_analyze_throttle; +@@global.tokudb_analyze_throttle +10 +SET GLOBAL tokudb_analyze_throttle = 0; +SELECT @@global.tokudb_analyze_throttle; +@@global.tokudb_analyze_throttle +0 +SET GLOBAL tokudb_analyze_throttle = DEFAULT; +SELECT @@global.tokudb_analyze_throttle; +@@global.tokudb_analyze_throttle +0 +SET GLOBAL tokudb_analyze_throttle = 'foobar'; +ERROR 42000: Incorrect argument type to variable 'tokudb_analyze_throttle' +SELECT @@global.tokudb_analyze_throttle; +@@global.tokudb_analyze_throttle +0 +SET SESSION tokudb_analyze_throttle = 10; +SELECT @@session.tokudb_analyze_throttle; +@@session.tokudb_analyze_throttle +10 +SET SESSION tokudb_analyze_throttle = 0; +SELECT @@session.tokudb_analyze_throttle; +@@session.tokudb_analyze_throttle +0 +SET SESSION tokudb_analyze_throttle = DEFAULT; +SELECT @@session.tokudb_analyze_throttle; +@@session.tokudb_analyze_throttle +0 +SET SESSION tokudb_analyze_throttle = 'foobar'; +ERROR 42000: Incorrect argument type to variable 'tokudb_analyze_throttle' +SELECT @@session.tokudb_analyze_throttle; +@@session.tokudb_analyze_throttle +0 +SET GLOBAL tokudb_analyze_throttle = 12; +SET SESSION tokudb_analyze_throttle = 13; +SELECT @@global.tokudb_analyze_throttle; +@@global.tokudb_analyze_throttle +12 +SELECT @@session.tokudb_analyze_throttle; +@@session.tokudb_analyze_throttle +13 +SHOW VARIABLES LIKE 'tokudb_analyze_throttle'; +Variable_name Value +tokudb_analyze_throttle 13 +SET SESSION tokudb_analyze_throttle = @orig_session; +SELECT @@session.tokudb_analyze_throttle; +@@session.tokudb_analyze_throttle +0 +SET GLOBAL tokudb_analyze_throttle = @orig_global; +SELECT @@global.tokudb_analyze_throttle; +@@global.tokudb_analyze_throttle +0 diff --git a/storage/tokudb/mysql-test/tokudb_sys_vars/r/tokudb_analyze_time_basic.result b/storage/tokudb/mysql-test/tokudb_sys_vars/r/tokudb_analyze_time_basic.result new file mode 100644 index 00000000000..2eac1fcc3a1 --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_sys_vars/r/tokudb_analyze_time_basic.result @@ -0,0 +1,61 @@ +SET @orig_global = @@global.tokudb_analyze_time; +SELECT @orig_global; +@orig_global +5 +SET @orig_session = @@session.tokudb_analyze_time; +SELECT @orig_session; +@orig_session +5 +SET GLOBAL tokudb_analyze_time = 10; +SELECT @@global.tokudb_analyze_time; +@@global.tokudb_analyze_time +10 +SET GLOBAL tokudb_analyze_time = 0; +SELECT @@global.tokudb_analyze_time; +@@global.tokudb_analyze_time +0 +SET GLOBAL tokudb_analyze_time = DEFAULT; +SELECT @@global.tokudb_analyze_time; +@@global.tokudb_analyze_time +5 +SET GLOBAL tokudb_analyze_time = 'foobar'; +ERROR 42000: Incorrect argument type to variable 'tokudb_analyze_time' +SELECT @@global.tokudb_analyze_time; +@@global.tokudb_analyze_time +5 +SET SESSION tokudb_analyze_time = 10; +SELECT @@session.tokudb_analyze_time; +@@session.tokudb_analyze_time +10 +SET SESSION tokudb_analyze_time = 0; +SELECT @@session.tokudb_analyze_time; +@@session.tokudb_analyze_time +0 +SET SESSION tokudb_analyze_time = DEFAULT; +SELECT @@session.tokudb_analyze_time; +@@session.tokudb_analyze_time +5 +SET SESSION tokudb_analyze_time = 'foobar'; +ERROR 42000: Incorrect argument type to variable 'tokudb_analyze_time' +SELECT @@session.tokudb_analyze_time; +@@session.tokudb_analyze_time +5 +SET GLOBAL tokudb_analyze_time = 12; +SET SESSION tokudb_analyze_time = 13; +SELECT @@global.tokudb_analyze_time; +@@global.tokudb_analyze_time +12 +SELECT @@session.tokudb_analyze_time; +@@session.tokudb_analyze_time +13 +SHOW VARIABLES LIKE 'tokudb_analyze_time'; +Variable_name Value +tokudb_analyze_time 13 +SET SESSION tokudb_analyze_time = @orig_session; +SELECT @@session.tokudb_analyze_time; +@@session.tokudb_analyze_time +5 +SET GLOBAL tokudb_analyze_time = @orig_global; +SELECT @@global.tokudb_analyze_time; +@@global.tokudb_analyze_time +5 diff --git a/storage/tokudb/mysql-test/tokudb_sys_vars/r/tokudb_auto_analyze.result b/storage/tokudb/mysql-test/tokudb_sys_vars/r/tokudb_auto_analyze.result new file mode 100644 index 00000000000..5e22bc489cb --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_sys_vars/r/tokudb_auto_analyze.result @@ -0,0 +1,61 @@ +SET @orig_global = @@global.tokudb_auto_analyze; +SELECT @orig_global; +@orig_global +0 +SET @orig_session = @@session.tokudb_auto_analyze; +SELECT @orig_session; +@orig_session +0 +SET GLOBAL tokudb_auto_analyze = 10; +SELECT @@global.tokudb_auto_analyze; +@@global.tokudb_auto_analyze +10 +SET GLOBAL tokudb_auto_analyze = 0; +SELECT @@global.tokudb_auto_analyze; +@@global.tokudb_auto_analyze +0 +SET GLOBAL tokudb_auto_analyze = DEFAULT; +SELECT @@global.tokudb_auto_analyze; +@@global.tokudb_auto_analyze +0 +SET GLOBAL tokudb_auto_analyze = 'foobar'; +ERROR 42000: Incorrect argument type to variable 'tokudb_auto_analyze' +SELECT @@global.tokudb_auto_analyze; +@@global.tokudb_auto_analyze +0 +SET SESSION tokudb_auto_analyze = 10; +SELECT @@session.tokudb_auto_analyze; +@@session.tokudb_auto_analyze +10 +SET SESSION tokudb_auto_analyze = 0; +SELECT @@session.tokudb_auto_analyze; +@@session.tokudb_auto_analyze +0 +SET SESSION tokudb_auto_analyze = DEFAULT; +SELECT @@session.tokudb_auto_analyze; +@@session.tokudb_auto_analyze +0 +SET SESSION tokudb_auto_analyze = 'foobar'; +ERROR 42000: Incorrect argument type to variable 'tokudb_auto_analyze' +SELECT @@session.tokudb_auto_analyze; +@@session.tokudb_auto_analyze +0 +SET GLOBAL tokudb_auto_analyze = 12; +SET SESSION tokudb_auto_analyze = 13; +SELECT @@global.tokudb_auto_analyze; +@@global.tokudb_auto_analyze +12 +SELECT @@session.tokudb_auto_analyze; +@@session.tokudb_auto_analyze +13 +SHOW VARIABLES LIKE 'tokudb_auto_analyze'; +Variable_name Value +tokudb_auto_analyze 13 +SET SESSION tokudb_auto_analyze = @orig_session; +SELECT @@session.tokudb_auto_analyze; +@@session.tokudb_auto_analyze +0 +SET GLOBAL tokudb_auto_analyze = @orig_global; +SELECT @@global.tokudb_auto_analyze; +@@global.tokudb_auto_analyze +0 diff --git a/storage/tokudb/mysql-test/tokudb_sys_vars/r/tokudb_cardinality_scale_percent_basic.result b/storage/tokudb/mysql-test/tokudb_sys_vars/r/tokudb_cardinality_scale_percent_basic.result new file mode 100644 index 00000000000..cac5d8b0dc7 --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_sys_vars/r/tokudb_cardinality_scale_percent_basic.result @@ -0,0 +1,36 @@ +SET @orig_global = @@global.tokudb_cardinality_scale_percent; +SELECT @orig_global; +@orig_global +50 +SET GLOBAL tokudb_cardinality_scale_percent = 10; +SELECT @@global.tokudb_cardinality_scale_percent; +@@global.tokudb_cardinality_scale_percent +10 +SET GLOBAL tokudb_cardinality_scale_percent = 0; +SELECT @@global.tokudb_cardinality_scale_percent; +@@global.tokudb_cardinality_scale_percent +0 +SET GLOBAL tokudb_cardinality_scale_percent = DEFAULT; +SELECT @@global.tokudb_cardinality_scale_percent; +@@global.tokudb_cardinality_scale_percent +50 +SET GLOBAL tokudb_cardinality_scale_percent = 'foobar'; +ERROR 42000: Incorrect argument type to variable 'tokudb_cardinality_scale_percent' +SELECT @@global.tokudb_cardinality_scale_percent; +@@global.tokudb_cardinality_scale_percent +50 +SET GLOBAL tokudb_cardinality_scale_percent = 12; +SET SESSION tokudb_cardinality_scale_percent = 13; +ERROR HY000: Variable 'tokudb_cardinality_scale_percent' is a GLOBAL variable and should be set with SET GLOBAL +SELECT @@global.tokudb_cardinality_scale_percent; +@@global.tokudb_cardinality_scale_percent +12 +SELECT @@session.tokudb_cardinality_scale_percent; +ERROR HY000: Variable 'tokudb_cardinality_scale_percent' is a GLOBAL variable +SHOW VARIABLES LIKE 'tokudb_cardinality_scale_percent'; +Variable_name Value +tokudb_cardinality_scale_percent 12 +SET GLOBAL tokudb_cardinality_scale_percent = @orig_global; +SELECT @@global.tokudb_cardinality_scale_percent; +@@global.tokudb_cardinality_scale_percent +50 diff --git a/storage/tokudb/mysql-test/tokudb_sys_vars/r/tokudb_pk_insert_mode_basic.result b/storage/tokudb/mysql-test/tokudb_sys_vars/r/tokudb_pk_insert_mode_basic.result new file mode 100644 index 00000000000..268c4032626 --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_sys_vars/r/tokudb_pk_insert_mode_basic.result @@ -0,0 +1,85 @@ +SET @orig_global = @@global.tokudb_pk_insert_mode; +SELECT @orig_global; +@orig_global +1 +SET @orig_session = @@session.tokudb_pk_insert_mode; +SELECT @orig_session; +@orig_session +1 +SET GLOBAL tokudb_pk_insert_mode = 10; +Warnings: +Warning 1292 Truncated incorrect tokudb_pk_insert_mode value: '10' +Warning 131 Using tokudb_pk_insert_mode is deprecated and the parameter may be removed in future releases. +SELECT @@global.tokudb_pk_insert_mode; +@@global.tokudb_pk_insert_mode +2 +SET GLOBAL tokudb_pk_insert_mode = 0; +Warnings: +Warning 131 Using tokudb_pk_insert_mode=0 is deprecated and the parameter may be removed in future releases. Only tokudb_pk_insert_mode=1|2 is allowed.Resettig the value to 1. +SELECT @@global.tokudb_pk_insert_mode; +@@global.tokudb_pk_insert_mode +1 +SET GLOBAL tokudb_pk_insert_mode = DEFAULT; +Warnings: +Warning 131 Using tokudb_pk_insert_mode is deprecated and the parameter may be removed in future releases. +SELECT @@global.tokudb_pk_insert_mode; +@@global.tokudb_pk_insert_mode +1 +SET GLOBAL tokudb_pk_insert_mode = 'foobar'; +ERROR 42000: Incorrect argument type to variable 'tokudb_pk_insert_mode' +SELECT @@global.tokudb_pk_insert_mode; +@@global.tokudb_pk_insert_mode +1 +SET SESSION tokudb_pk_insert_mode = 10; +Warnings: +Warning 1292 Truncated incorrect tokudb_pk_insert_mode value: '10' +Warning 131 Using tokudb_pk_insert_mode is deprecated and the parameter may be removed in future releases. +SELECT @@session.tokudb_pk_insert_mode; +@@session.tokudb_pk_insert_mode +2 +SET SESSION tokudb_pk_insert_mode = 0; +Warnings: +Warning 131 Using tokudb_pk_insert_mode=0 is deprecated and the parameter may be removed in future releases. Only tokudb_pk_insert_mode=1|2 is allowed.Resettig the value to 1. +SELECT @@session.tokudb_pk_insert_mode; +@@session.tokudb_pk_insert_mode +1 +SET SESSION tokudb_pk_insert_mode = DEFAULT; +Warnings: +Warning 131 Using tokudb_pk_insert_mode is deprecated and the parameter may be removed in future releases. +SELECT @@session.tokudb_pk_insert_mode; +@@session.tokudb_pk_insert_mode +1 +SET SESSION tokudb_pk_insert_mode = 'foobar'; +ERROR 42000: Incorrect argument type to variable 'tokudb_pk_insert_mode' +SELECT @@session.tokudb_pk_insert_mode; +@@session.tokudb_pk_insert_mode +1 +SET GLOBAL tokudb_pk_insert_mode = 12; +Warnings: +Warning 1292 Truncated incorrect tokudb_pk_insert_mode value: '12' +Warning 131 Using tokudb_pk_insert_mode is deprecated and the parameter may be removed in future releases. +SET SESSION tokudb_pk_insert_mode = 13; +Warnings: +Warning 1292 Truncated incorrect tokudb_pk_insert_mode value: '13' +Warning 131 Using tokudb_pk_insert_mode is deprecated and the parameter may be removed in future releases. +SELECT @@global.tokudb_pk_insert_mode; +@@global.tokudb_pk_insert_mode +2 +SELECT @@session.tokudb_pk_insert_mode; +@@session.tokudb_pk_insert_mode +2 +SHOW VARIABLES LIKE 'tokudb_pk_insert_mode'; +Variable_name Value +tokudb_pk_insert_mode 2 +SET SESSION tokudb_pk_insert_mode = @orig_session; +Warnings: +Warning 131 Using tokudb_pk_insert_mode is deprecated and the parameter may be removed in future releases. +SELECT @@session.tokudb_pk_insert_mode; +@@session.tokudb_pk_insert_mode +1 +SET GLOBAL tokudb_pk_insert_mode = @orig_global; +Warnings: +Warning 131 Using tokudb_pk_insert_mode is deprecated and the parameter may be removed in future releases. +SELECT @@global.tokudb_pk_insert_mode; +@@global.tokudb_pk_insert_mode +1 diff --git a/storage/tokudb/mysql-test/tokudb_sys_vars/t/suite.opt b/storage/tokudb/mysql-test/tokudb_sys_vars/t/suite.opt new file mode 100644 index 00000000000..23511b05020 --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_sys_vars/t/suite.opt @@ -0,0 +1 @@ +$TOKUDB_OPT $TOKUDB_LOAD_ADD --loose-tokudb-check-jemalloc=0 diff --git a/storage/tokudb/mysql-test/tokudb_sys_vars/t/tokudb_analyze_delete_fraction.test b/storage/tokudb/mysql-test/tokudb_sys_vars/t/tokudb_analyze_delete_fraction.test new file mode 100644 index 00000000000..d5bd382740f --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_sys_vars/t/tokudb_analyze_delete_fraction.test @@ -0,0 +1,56 @@ +--source include/have_tokudb.inc + +# Check the default value +SET @orig_global = @@global.tokudb_analyze_delete_fraction; +SELECT @orig_global; + +SET @orig_session = @@session.tokudb_analyze_delete_fraction; +SELECT @orig_session; + +# Test global +SET GLOBAL tokudb_analyze_delete_fraction = .5; +SELECT @@global.tokudb_analyze_delete_fraction; + +SET GLOBAL tokudb_analyze_delete_fraction = 0; +SELECT @@global.tokudb_analyze_delete_fraction; + +SET GLOBAL tokudb_analyze_delete_fraction = DEFAULT; +SELECT @@global.tokudb_analyze_delete_fraction; + +-- error ER_WRONG_TYPE_FOR_VAR +SET GLOBAL tokudb_analyze_delete_fraction = 'foobar'; +SELECT @@global.tokudb_analyze_delete_fraction; + +SET GLOBAL tokudb_analyze_delete_fraction = 3.75; +SELECT @@global.tokudb_analyze_delete_fraction; + +# Test session +SET SESSION tokudb_analyze_delete_fraction = .5; +SELECT @@session.tokudb_analyze_delete_fraction; + +SET SESSION tokudb_analyze_delete_fraction = 0; +SELECT @@session.tokudb_analyze_delete_fraction; + +SET SESSION tokudb_analyze_delete_fraction = DEFAULT; +SELECT @@session.tokudb_analyze_delete_fraction; + +-- error ER_WRONG_TYPE_FOR_VAR +SET SESSION tokudb_analyze_delete_fraction = 'foobar'; +SELECT @@session.tokudb_analyze_delete_fraction; + +SET SESSION tokudb_analyze_delete_fraction = 3.75; +SELECT @@session.tokudb_analyze_delete_fraction; + +# both +SET GLOBAL tokudb_analyze_delete_fraction = .2; +SET SESSION tokudb_analyze_delete_fraction = .3; +SELECT @@global.tokudb_analyze_delete_fraction; +SELECT @@session.tokudb_analyze_delete_fraction; +SHOW VARIABLES LIKE 'tokudb_analyze_delete_fraction'; + +# Clean up +SET SESSION tokudb_analyze_delete_fraction = @orig_session; +SELECT @@session.tokudb_analyze_delete_fraction; + +SET GLOBAL tokudb_analyze_delete_fraction = @orig_global; +SELECT @@global.tokudb_analyze_delete_fraction; diff --git a/storage/tokudb/mysql-test/tokudb_sys_vars/t/tokudb_analyze_in_background_basic.test b/storage/tokudb/mysql-test/tokudb_sys_vars/t/tokudb_analyze_in_background_basic.test new file mode 100644 index 00000000000..dfb2a0e416d --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_sys_vars/t/tokudb_analyze_in_background_basic.test @@ -0,0 +1,80 @@ +--source include/have_tokudb.inc + +# Check the default value +SET @orig_global = @@global.tokudb_analyze_in_background; +SELECT @orig_global; + +SET @orig_session = @@session.tokudb_analyze_in_background; +SELECT @orig_session; + +# Test global +SET GLOBAL tokudb_analyze_in_background = 0; +SELECT @@global.tokudb_analyze_in_background; + +SET GLOBAL tokudb_analyze_in_background = 1; +SELECT @@global.tokudb_analyze_in_background; + +SET GLOBAL tokudb_analyze_in_background = DEFAULT; +SELECT @@global.tokudb_analyze_in_background; + +SET GLOBAL tokudb_analyze_in_background = -6; +SELECT @@global.tokudb_analyze_in_background; + +-- error ER_WRONG_TYPE_FOR_VAR +SET GLOBAL tokudb_analyze_in_background = 1.6; +SELECT @@global.tokudb_analyze_in_background; + +-- error ER_WRONG_VALUE_FOR_VAR +SET GLOBAL tokudb_analyze_in_background = "T"; +SELECT @@global.tokudb_analyze_in_background; + +-- error ER_WRONG_VALUE_FOR_VAR +SET GLOBAL tokudb_analyze_in_background = "Y"; +SELECT @@global.tokudb_analyze_in_background; + +-- error ER_WRONG_VALUE_FOR_VAR +SET GLOBAL tokudb_analyze_in_background = 'foobar'; +SELECT @@global.tokudb_analyze_in_background; + +# Test session +SET SESSION tokudb_analyze_in_background = 0; +SELECT @@session.tokudb_analyze_in_background; + +SET SESSION tokudb_analyze_in_background = 1; +SELECT @@session.tokudb_analyze_in_background; + +SET SESSION tokudb_analyze_in_background = DEFAULT; +SELECT @@session.tokudb_analyze_in_background; + +SET SESSION tokudb_analyze_in_background = -6; +SELECT @@session.tokudb_analyze_in_background; + +-- error ER_WRONG_TYPE_FOR_VAR +SET SESSION tokudb_analyze_in_background = 1.6; +SELECT @@session.tokudb_analyze_in_background; + +-- error ER_WRONG_VALUE_FOR_VAR +SET SESSION tokudb_analyze_in_background = "T"; +SELECT @@session.tokudb_analyze_in_background; + +-- error ER_WRONG_VALUE_FOR_VAR +SET SESSION tokudb_analyze_in_background = "Y"; +SELECT @@session.tokudb_analyze_in_background; + +-- error ER_WRONG_VALUE_FOR_VAR +SET SESSION tokudb_analyze_in_background = 'foobar'; +SELECT @@session.tokudb_analyze_in_background; + +# both +SET GLOBAL tokudb_analyze_in_background = 0; +SET SESSION tokudb_analyze_in_background = 1; +SELECT @@global.tokudb_analyze_in_background; +SELECT @@session.tokudb_analyze_in_background; +SHOW VARIABLES LIKE 'tokudb_analyze_in_background'; + +# Clean up +SET SESSION tokudb_analyze_in_background = @orig_session; +SELECT @@session.tokudb_analyze_in_background; + +SET GLOBAL tokudb_analyze_in_background = @orig_global; +SELECT @@global.tokudb_analyze_in_background; diff --git a/storage/tokudb/mysql-test/tokudb_sys_vars/t/tokudb_analyze_mode_basic.test b/storage/tokudb/mysql-test/tokudb_sys_vars/t/tokudb_analyze_mode_basic.test new file mode 100644 index 00000000000..69def75bd3d --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_sys_vars/t/tokudb_analyze_mode_basic.test @@ -0,0 +1,72 @@ +--source include/have_tokudb.inc + +# Check the default value +SET @orig_global = @@global.tokudb_analyze_mode; +SELECT @orig_global; + +SET @orig_session = @@session.tokudb_analyze_mode; +SELECT @orig_session; + +# Test global +SET GLOBAL tokudb_analyze_mode = 'tokudb_analyze_standard'; +SELECT @@global.tokudb_analyze_mode; + +SET GLOBAL tokudb_analyze_mode = 'tokudb_analyze_recount_rows'; +SELECT @@global.tokudb_analyze_mode; + +SET GLOBAL tokudb_analyze_mode = 'tokudb_analyze_cancel'; +SELECT @@global.tokudb_analyze_mode; + +SET GLOBAL tokudb_analyze_mode = DEFAULT; +SELECT @@global.tokudb_analyze_mode; + +-- error ER_WRONG_VALUE_FOR_VAR +SET GLOBAL tokudb_analyze_mode = ''; +SELECT @@global.tokudb_analyze_mode; + +-- error ER_WRONG_VALUE_FOR_VAR +SET GLOBAL tokudb_analyze_mode = 'foobar'; +SELECT @@global.tokudb_analyze_mode; + +-- error ER_WRONG_VALUE_FOR_VAR +SET GLOBAL tokudb_analyze_mode = 123; +SELECT @@global.tokudb_analyze_mode; + +# Test session +SET SESSION tokudb_analyze_mode = 'tokudb_analyze_standard'; +SELECT @@session.tokudb_analyze_mode; + +SET SESSION tokudb_analyze_mode = 'tokudb_analyze_recount_rows'; +SELECT @@session.tokudb_analyze_mode; + +SET SESSION tokudb_analyze_mode = 'tokudb_analyze_cancel'; +SELECT @@session.tokudb_analyze_mode; + +SET SESSION tokudb_analyze_mode = DEFAULT; +SELECT @@session.tokudb_analyze_mode; + +-- error ER_WRONG_VALUE_FOR_VAR +SET SESSION tokudb_analyze_mode = ''; +SELECT @@session.tokudb_analyze_mode; + +-- error ER_WRONG_VALUE_FOR_VAR +SET SESSION tokudb_analyze_mode = 'foobar'; +SELECT @@session.tokudb_analyze_mode; + +-- error ER_WRONG_VALUE_FOR_VAR +SET SESSION tokudb_analyze_mode = 123; +SELECT @@session.tokudb_analyze_mode; + +# both +SET GLOBAL tokudb_analyze_mode = 'tokudb_analyze_standard'; +SET SESSION tokudb_analyze_mode = 'tokudb_analyze_recount_rows'; +SELECT @@global.tokudb_analyze_mode; +SELECT @@session.tokudb_analyze_mode; +SHOW VARIABLES LIKE 'tokudb_analyze_mode'; + +# Clean up +SET SESSION tokudb_analyze_mode = @orig_session; +SELECT @@session.tokudb_analyze_mode; + +SET GLOBAL tokudb_analyze_mode = @orig_global; +SELECT @@global.tokudb_analyze_mode; diff --git a/storage/tokudb/mysql-test/tokudb_sys_vars/t/tokudb_analyze_throttle_basic.test b/storage/tokudb/mysql-test/tokudb_sys_vars/t/tokudb_analyze_throttle_basic.test new file mode 100644 index 00000000000..a3660b0626a --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_sys_vars/t/tokudb_analyze_throttle_basic.test @@ -0,0 +1,50 @@ +--source include/have_tokudb.inc + +# Check the default value +SET @orig_global = @@global.tokudb_analyze_throttle; +SELECT @orig_global; + +SET @orig_session = @@session.tokudb_analyze_throttle; +SELECT @orig_session; + +# Test global +SET GLOBAL tokudb_analyze_throttle = 10; +SELECT @@global.tokudb_analyze_throttle; + +SET GLOBAL tokudb_analyze_throttle = 0; +SELECT @@global.tokudb_analyze_throttle; + +SET GLOBAL tokudb_analyze_throttle = DEFAULT; +SELECT @@global.tokudb_analyze_throttle; + +-- error ER_WRONG_TYPE_FOR_VAR +SET GLOBAL tokudb_analyze_throttle = 'foobar'; +SELECT @@global.tokudb_analyze_throttle; + +# Test session +SET SESSION tokudb_analyze_throttle = 10; +SELECT @@session.tokudb_analyze_throttle; + +SET SESSION tokudb_analyze_throttle = 0; +SELECT @@session.tokudb_analyze_throttle; + +SET SESSION tokudb_analyze_throttle = DEFAULT; +SELECT @@session.tokudb_analyze_throttle; + +-- error ER_WRONG_TYPE_FOR_VAR +SET SESSION tokudb_analyze_throttle = 'foobar'; +SELECT @@session.tokudb_analyze_throttle; + +# both +SET GLOBAL tokudb_analyze_throttle = 12; +SET SESSION tokudb_analyze_throttle = 13; +SELECT @@global.tokudb_analyze_throttle; +SELECT @@session.tokudb_analyze_throttle; +SHOW VARIABLES LIKE 'tokudb_analyze_throttle'; + +# Clean up +SET SESSION tokudb_analyze_throttle = @orig_session; +SELECT @@session.tokudb_analyze_throttle; + +SET GLOBAL tokudb_analyze_throttle = @orig_global; +SELECT @@global.tokudb_analyze_throttle; diff --git a/storage/tokudb/mysql-test/tokudb_sys_vars/t/tokudb_analyze_time_basic.test b/storage/tokudb/mysql-test/tokudb_sys_vars/t/tokudb_analyze_time_basic.test new file mode 100644 index 00000000000..3098934ee8c --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_sys_vars/t/tokudb_analyze_time_basic.test @@ -0,0 +1,50 @@ +--source include/have_tokudb.inc + +# Check the default value +SET @orig_global = @@global.tokudb_analyze_time; +SELECT @orig_global; + +SET @orig_session = @@session.tokudb_analyze_time; +SELECT @orig_session; + +# Test global +SET GLOBAL tokudb_analyze_time = 10; +SELECT @@global.tokudb_analyze_time; + +SET GLOBAL tokudb_analyze_time = 0; +SELECT @@global.tokudb_analyze_time; + +SET GLOBAL tokudb_analyze_time = DEFAULT; +SELECT @@global.tokudb_analyze_time; + +-- error ER_WRONG_TYPE_FOR_VAR +SET GLOBAL tokudb_analyze_time = 'foobar'; +SELECT @@global.tokudb_analyze_time; + +# Test session +SET SESSION tokudb_analyze_time = 10; +SELECT @@session.tokudb_analyze_time; + +SET SESSION tokudb_analyze_time = 0; +SELECT @@session.tokudb_analyze_time; + +SET SESSION tokudb_analyze_time = DEFAULT; +SELECT @@session.tokudb_analyze_time; + +-- error ER_WRONG_TYPE_FOR_VAR +SET SESSION tokudb_analyze_time = 'foobar'; +SELECT @@session.tokudb_analyze_time; + +# both +SET GLOBAL tokudb_analyze_time = 12; +SET SESSION tokudb_analyze_time = 13; +SELECT @@global.tokudb_analyze_time; +SELECT @@session.tokudb_analyze_time; +SHOW VARIABLES LIKE 'tokudb_analyze_time'; + +# Clean up +SET SESSION tokudb_analyze_time = @orig_session; +SELECT @@session.tokudb_analyze_time; + +SET GLOBAL tokudb_analyze_time = @orig_global; +SELECT @@global.tokudb_analyze_time; diff --git a/storage/tokudb/mysql-test/tokudb_sys_vars/t/tokudb_auto_analyze.test b/storage/tokudb/mysql-test/tokudb_sys_vars/t/tokudb_auto_analyze.test new file mode 100644 index 00000000000..d9998508ae1 --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_sys_vars/t/tokudb_auto_analyze.test @@ -0,0 +1,50 @@ +--source include/have_tokudb.inc + +# Check the default value +SET @orig_global = @@global.tokudb_auto_analyze; +SELECT @orig_global; + +SET @orig_session = @@session.tokudb_auto_analyze; +SELECT @orig_session; + +# Test global +SET GLOBAL tokudb_auto_analyze = 10; +SELECT @@global.tokudb_auto_analyze; + +SET GLOBAL tokudb_auto_analyze = 0; +SELECT @@global.tokudb_auto_analyze; + +SET GLOBAL tokudb_auto_analyze = DEFAULT; +SELECT @@global.tokudb_auto_analyze; + +-- error ER_WRONG_TYPE_FOR_VAR +SET GLOBAL tokudb_auto_analyze = 'foobar'; +SELECT @@global.tokudb_auto_analyze; + +# Test session +SET SESSION tokudb_auto_analyze = 10; +SELECT @@session.tokudb_auto_analyze; + +SET SESSION tokudb_auto_analyze = 0; +SELECT @@session.tokudb_auto_analyze; + +SET SESSION tokudb_auto_analyze = DEFAULT; +SELECT @@session.tokudb_auto_analyze; + +-- error ER_WRONG_TYPE_FOR_VAR +SET SESSION tokudb_auto_analyze = 'foobar'; +SELECT @@session.tokudb_auto_analyze; + +# both +SET GLOBAL tokudb_auto_analyze = 12; +SET SESSION tokudb_auto_analyze = 13; +SELECT @@global.tokudb_auto_analyze; +SELECT @@session.tokudb_auto_analyze; +SHOW VARIABLES LIKE 'tokudb_auto_analyze'; + +# Clean up +SET SESSION tokudb_auto_analyze = @orig_session; +SELECT @@session.tokudb_auto_analyze; + +SET GLOBAL tokudb_auto_analyze = @orig_global; +SELECT @@global.tokudb_auto_analyze; diff --git a/storage/tokudb/mysql-test/tokudb_sys_vars/t/tokudb_cardinality_scale_percent_basic.test b/storage/tokudb/mysql-test/tokudb_sys_vars/t/tokudb_cardinality_scale_percent_basic.test new file mode 100644 index 00000000000..83063f04248 --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_sys_vars/t/tokudb_cardinality_scale_percent_basic.test @@ -0,0 +1,32 @@ +--source include/have_tokudb.inc + +# Check the default value +SET @orig_global = @@global.tokudb_cardinality_scale_percent; +SELECT @orig_global; + +# Test global +SET GLOBAL tokudb_cardinality_scale_percent = 10; +SELECT @@global.tokudb_cardinality_scale_percent; + +SET GLOBAL tokudb_cardinality_scale_percent = 0; +SELECT @@global.tokudb_cardinality_scale_percent; + +SET GLOBAL tokudb_cardinality_scale_percent = DEFAULT; +SELECT @@global.tokudb_cardinality_scale_percent; + +-- error ER_WRONG_TYPE_FOR_VAR +SET GLOBAL tokudb_cardinality_scale_percent = 'foobar'; +SELECT @@global.tokudb_cardinality_scale_percent; + +# both +SET GLOBAL tokudb_cardinality_scale_percent = 12; +-- error ER_GLOBAL_VARIABLE +SET SESSION tokudb_cardinality_scale_percent = 13; +SELECT @@global.tokudb_cardinality_scale_percent; +-- error ER_INCORRECT_GLOBAL_LOCAL_VAR +SELECT @@session.tokudb_cardinality_scale_percent; +SHOW VARIABLES LIKE 'tokudb_cardinality_scale_percent'; + +# Clean up +SET GLOBAL tokudb_cardinality_scale_percent = @orig_global; +SELECT @@global.tokudb_cardinality_scale_percent; diff --git a/storage/tokudb/mysql-test/tokudb_sys_vars/t/tokudb_pk_insert_mode_basic.test b/storage/tokudb/mysql-test/tokudb_sys_vars/t/tokudb_pk_insert_mode_basic.test new file mode 100644 index 00000000000..1669c7842a9 --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_sys_vars/t/tokudb_pk_insert_mode_basic.test @@ -0,0 +1,51 @@ +--source include/have_tokudb.inc +--enable_warnings + +# Check the default value +SET @orig_global = @@global.tokudb_pk_insert_mode; +SELECT @orig_global; + +SET @orig_session = @@session.tokudb_pk_insert_mode; +SELECT @orig_session; + +# Test global +SET GLOBAL tokudb_pk_insert_mode = 10; +SELECT @@global.tokudb_pk_insert_mode; + +SET GLOBAL tokudb_pk_insert_mode = 0; +SELECT @@global.tokudb_pk_insert_mode; + +SET GLOBAL tokudb_pk_insert_mode = DEFAULT; +SELECT @@global.tokudb_pk_insert_mode; + +-- error ER_WRONG_TYPE_FOR_VAR +SET GLOBAL tokudb_pk_insert_mode = 'foobar'; +SELECT @@global.tokudb_pk_insert_mode; + +# Test session +SET SESSION tokudb_pk_insert_mode = 10; +SELECT @@session.tokudb_pk_insert_mode; + +SET SESSION tokudb_pk_insert_mode = 0; +SELECT @@session.tokudb_pk_insert_mode; + +SET SESSION tokudb_pk_insert_mode = DEFAULT; +SELECT @@session.tokudb_pk_insert_mode; + +-- error ER_WRONG_TYPE_FOR_VAR +SET SESSION tokudb_pk_insert_mode = 'foobar'; +SELECT @@session.tokudb_pk_insert_mode; + +# both +SET GLOBAL tokudb_pk_insert_mode = 12; +SET SESSION tokudb_pk_insert_mode = 13; +SELECT @@global.tokudb_pk_insert_mode; +SELECT @@session.tokudb_pk_insert_mode; +SHOW VARIABLES LIKE 'tokudb_pk_insert_mode'; + +# Clean up +SET SESSION tokudb_pk_insert_mode = @orig_session; +SELECT @@session.tokudb_pk_insert_mode; + +SET GLOBAL tokudb_pk_insert_mode = @orig_global; +SELECT @@global.tokudb_pk_insert_mode; diff --git a/storage/tokudb/tokudb_background.cc b/storage/tokudb/tokudb_background.cc new file mode 100644 index 00000000000..d8ef54a5972 --- /dev/null +++ b/storage/tokudb/tokudb_background.cc @@ -0,0 +1,253 @@ +/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ +// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4: +/* -*- mode: C; c-basic-offset: 4 -*- */ +#ident "$Id$" +/*====== +This file is part of TokuDB + + +Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. + + TokuDBis is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License, version 2, + as published by the Free Software Foundation. + + TokuDB is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with TokuDB. If not, see . + +======= */ + +#ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." + +#include "tokudb_background.h" +#include "tokudb_sysvars.h" + +namespace tokudb { +namespace background { + + +std::atomic job_manager_t::job_t::_next_id(1); + +job_manager_t::job_t::job_t(bool user_scheduled) : + _running(false), + _cancelled(false), + _id(_next_id++), + _user_scheduled(user_scheduled), + _scheduled_time(::time(0)), + _started_time(0) { +} +job_manager_t::job_t::~job_t() { +} +void* job_manager_t::operator new(size_t sz) { + return tokudb::memory::malloc(sz, MYF(MY_WME|MY_ZEROFILL|MY_FAE)); +} +void job_manager_t::operator delete(void* p) { + tokudb::memory::free(p); +} +job_manager_t::job_manager_t() : + _sem(0, 65535), + _shutdown(false) { +} +job_manager_t::~job_manager_t() { +} +void job_manager_t::initialize() { + int r = _thread.start(thread_func, this); + assert_always(r == 0); +} +void job_manager_t::destroy() { + assert_always(!_shutdown); + assert_always(_foreground_jobs.size() == 0); + _shutdown = true; + _sem.set_interrupt(); + + while (_background_jobs.size()) { + _mutex.lock(); + job_t* job = _background_jobs.front(); + cancel(job); + _background_jobs.pop_front(); + delete job; + _mutex.unlock(); + } + + void* result; + int r = _thread.join(&result); + assert_always(r == 0); +} +bool job_manager_t::run_job(job_t* newjob, bool background) { + bool ret = false; + const char* jobkey = newjob->key(); + + _mutex.lock(); + assert_always(!_shutdown); + + for (jobs_t::iterator it = _background_jobs.begin(); + it != _background_jobs.end(); + it++) { + job_t* job = *it; + if (!job->cancelled() && strcmp(job->key(), jobkey) == 0) { + // if this is a foreground job being run and + // there is an existing background job of the same type + // and it is not running yet, we can cancel the background job + // and just run this one in the foreground, might have different + // params, but that is up to the user to figure out. + if (!background && !job->running()) { + job->cancel(); + } else { + // can't schedule or run another job on the same key + goto cleanup; + } + } + } + for (jobs_t::iterator it = _foreground_jobs.begin(); + it != _foreground_jobs.end(); + it++) { + job_t* job = *it; + if (strcmp(job->key(), jobkey) == 0) { + // can't schedule or run another job on the same key + // as an existing foreground job + goto cleanup; + } + } + + if (background) { + _background_jobs.push_back(newjob); + _sem.signal(); + ret = true; + } else { + _foreground_jobs.push_back(newjob); + + run(newjob); + + for (jobs_t::iterator it = _foreground_jobs.begin(); + it != _foreground_jobs.end(); + it++) { + job_t* job = *it; + if (job == newjob) { + _foreground_jobs.erase(it); + delete job; + break; + } + } + ret = true; + } + +cleanup: + _mutex.unlock(); + return ret; +} +bool job_manager_t::cancel_job(const char* key) { + bool ret = false; + _mutex.lock(); + + for (jobs_t::iterator it = _background_jobs.begin(); + it != _background_jobs.end(); it++) { + job_t* job = *it; + + if (!job->cancelled() && + strcmp(job->key(), key) == 0) { + + cancel(job); + + ret = true; + } + } + + _mutex.unlock(); + return ret; +} +void job_manager_t::iterate_jobs(pfn_iterate_t callback, void* extra) const { + + char database[256], table[256], type[256], params[256], status[256]; + + _mutex.lock(); + + for (jobs_t::const_iterator it = _background_jobs.begin(); + it != _background_jobs.end(); + it++) { + job_t* job = *it; + if (!job->cancelled()) { + database[0] = table[0] = type[0] = params[0] = status[0] = '\0'; + job->status(database, table, type, params, status); + callback( + job->id(), + database, + table, + type, + params, + status, + job->user_scheduled(), + job->scheduled_time(), + job->started_time(), + extra); + } + } + + _mutex.unlock(); +} +void* job_manager_t::thread_func(void* v) { + return ((tokudb::background::job_manager_t*)v)->real_thread_func(); +} +void* job_manager_t::real_thread_func() { + while (_shutdown == false) { + tokudb::thread::semaphore_t::E_WAIT res = _sem.wait(); + if (res == tokudb::thread::semaphore_t::E_INTERRUPTED || _shutdown) { + break; + } else if (res == tokudb::thread::semaphore_t::E_SIGNALLED) { +#if TOKUDB_DEBUG + if (TOKUDB_UNLIKELY( + tokudb::sysvars::debug_pause_background_job_manager)) { + _sem.signal(); + tokudb::time::sleep_microsec(250000); + continue; + } +#endif // TOKUDB_DEBUG + + _mutex.lock(); + assert_debug(_background_jobs.size() > 0); + job_t* job = _background_jobs.front(); + run(job); + _background_jobs.pop_front(); + _mutex.unlock(); + delete job; + } + } + return NULL; +} +void job_manager_t::run(job_t* job) { + assert_debug(_mutex.is_owned_by_me()); + if (!job->cancelled()) { + _mutex.unlock(); + // do job + job->run(); + // done job + _mutex.lock(); + } + if (!job->cancelled()) { + job->destroy(); + } +} +void job_manager_t::cancel(job_t* job) { + assert_debug(_mutex.is_owned_by_me()); + job->cancel(); +} +job_manager_t* _job_manager = NULL; + +bool initialize() { + assert_always(_job_manager == NULL); + _job_manager = new job_manager_t; + _job_manager->initialize(); + return true; +} +bool destroy() { + _job_manager->destroy(); + delete _job_manager; + _job_manager = NULL; + return true; +} +} // namespace background +} // namespace tokudb diff --git a/storage/tokudb/tokudb_background.h b/storage/tokudb/tokudb_background.h new file mode 100644 index 00000000000..3786701fd0f --- /dev/null +++ b/storage/tokudb/tokudb_background.h @@ -0,0 +1,212 @@ +/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ +// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4: +#ident "$Id$" +/*====== +This file is part of TokuDB + + +Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. + + TokuDBis is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License, version 2, + as published by the Free Software Foundation. + + TokuDB is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with TokuDB. If not, see . + +======= */ + +#ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." + +#ifndef _TOKUDB_BACKGROUND_H +#define _TOKUDB_BACKGROUND_H + +#include "hatoku_hton.h" +#include +#include + +namespace tokudb { +namespace background { + +class job_manager_t { +public: + class job_t { + public: + // NO default constructor + job_t() = delete; + + job_t(bool user_scheduled); + + virtual ~job_t(); + + // method that runs the job + inline void run(); + + // method that tells the job to cancel ASAP + inline void cancel(); + + // method that tells the job to clean up/free resources on cancel + // or completion + inline void destroy(); + + // method that returns a 'key' string for finding a specific job + // (or jobs) usually used to find jobs to cancel + virtual const char* key() = 0; + + // method to get info for information schema, 255 chars per buffer + virtual void status( + char* database, + char* table, + char* type, + char* params, + char* status) = 0; + + inline bool running() const; + + inline bool cancelled() const; + + inline uint64_t id() const; + + inline bool user_scheduled() const; + + inline time_t scheduled_time() const; + + inline time_t started_time() const; + + protected: + // derived classed implement this to actually run their job + virtual void on_run() {}; + + // derived classes implement this to cancel their job + virtual void on_cancel() {}; + + // derived classes implement this to clean up/free resources + virtual void on_destroy() {}; + + private: + static std::atomic _next_id; + std::atomic _running; + std::atomic _cancelled; + uint64_t _id; + bool _user_scheduled; + time_t _scheduled_time; + time_t _started_time; + }; + + // pfn for iterate callback + typedef void (*pfn_iterate_t)( + uint64_t, + const char*, + const char*, + const char*, + const char*, + const char*, + bool, + time_t, + time_t, + void*); + +public: + void* operator new(size_t sz); + void operator delete(void* p); + + job_manager_t(); + + ~job_manager_t(); + + // creates/initializes a singleton bjm + void initialize(); + + // destroys a bjm singleton + // cancels all jobs abd frees all resources + void destroy(); + + // schedules or runs a job depending on the 'background' value + // job specifics all depend on the implementation od 'job' + // background jobs will be executed in a FIFO fashion + // two jobs with the same key can not run concurrently + // if a foreground job is attempted, any currently scheduled or running + // background jobs will be cancelled first + // if another foreground job is already running, a new foreground job with + // the same key will be rejected + bool run_job(job_t* newjob, bool background); + + // cancels any background job with a matching key + bool cancel_job(const char* key); + + // iterates currently pending and running background jobs, calling + // 'callback' with the 'extra' data provided and the original 'extra' + // data passed when the job was scheduled + void iterate_jobs(pfn_iterate_t callback, void* extra) const; + +private: + static void* thread_func(void* v); + + void* real_thread_func(); + + // _mutex MUST be held on entry, will release and reaquire on exit + void run(job_t* job); + + // _mutex MUST be held on entry + void cancel(job_t* job); +private: + typedef std::list jobs_t; + + mutable tokudb::thread::mutex_t _mutex; + mutable tokudb::thread::semaphore_t _sem; + mutable tokudb::thread::thread_t _thread; + jobs_t _background_jobs; + jobs_t _foreground_jobs; + std::atomic _shutdown; +}; + +extern job_manager_t* _job_manager; + +bool initialize(); +bool destroy(); + +inline void job_manager_t::job_t::run() { + if (!_cancelled) { + _running = true; + _started_time = ::time(0); + on_run(); + _running = false; + } +} +inline void job_manager_t::job_t::cancel() { + _cancelled = true; + if (_running) + on_cancel(); + while (_running) tokudb::time::sleep_microsec(500000); + destroy(); +} +void job_manager_t::job_t::destroy() { + on_destroy(); +} +inline bool job_manager_t::job_t::running() const { + return _running; +} +inline bool job_manager_t::job_t::cancelled() const { + return _cancelled; +} +inline uint64_t job_manager_t::job_t::id() const { + return _id; +} +inline bool job_manager_t::job_t::user_scheduled() const { + return _user_scheduled; +} +inline time_t job_manager_t::job_t::scheduled_time() const { + return _scheduled_time; +} +inline time_t job_manager_t::job_t::started_time() const { + return _started_time; +} +} // namespace background +} // namespace tokudb + +#endif // _TOKUDB_BACKGROUND_H diff --git a/storage/tokudb/tokudb_buffer.h b/storage/tokudb/tokudb_buffer.h index 1604ea61e2d..022f1b49643 100644 --- a/storage/tokudb/tokudb_buffer.h +++ b/storage/tokudb/tokudb_buffer.h @@ -23,38 +23,54 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." -#if !defined(_TOKUDB_BUFFER_H) +#ifndef _TOKUDB_BUFFER_H #define _TOKUDB_BUFFER_H +#include "hatoku_defines.h" +#include "tokudb_debug.h" +#include "tokudb_thread.h" #include "tokudb_vlq.h" namespace tokudb { -// A Buffer manages a contiguous chunk of memory and supports appending new data to the end of the buffer, and -// consuming chunks from the beginning of the buffer. The buffer will reallocate memory when appending -// new data to a full buffer. +// A Buffer manages a contiguous chunk of memory and supports appending new +// data to the end of the buffer, and consuming chunks from the beginning of +// the buffer. The buffer will reallocate memory when appending new data to +// a full buffer. class buffer { public: - buffer(void *the_data, size_t s, size_t l) : m_data(the_data), m_size(s), m_limit(l), m_is_static(true) { + inline buffer( + void* the_data, + size_t s, + size_t l) : + m_data(the_data), + m_size(s), + m_limit(l), + m_is_static(true) { } - buffer() : m_data(NULL), m_size(0), m_limit(0), m_is_static(false) { + inline buffer() : + m_data(NULL), + m_size(0), + m_limit(0), + m_is_static(false) { } virtual ~buffer() { if (!m_is_static) free(m_data); } - // Return a pointer to the end of the buffer suitable for appending a fixed number of bytes. - void *append_ptr(size_t s) { + // Return a pointer to the end of the buffer suitable for appending a + // fixed number of bytes. + void* append_ptr(size_t s) { maybe_realloc(s); - void *p = (char *) m_data + m_size; + void* p = (char*)m_data + m_size; m_size += s; return p; } // Append bytes to the buffer - void append(void *p, size_t s) { + void append(void* p, size_t s) { memcpy(append_ptr(s), p, s); } @@ -68,63 +84,70 @@ public: return s; } - // Return a pointer to the next location in the buffer where bytes are consumed from. - void *consume_ptr(size_t s) { + // Return a pointer to the next location in the buffer where bytes are + // consumed from. + void* consume_ptr(size_t s) { if (m_size + s > m_limit) return NULL; - void *p = (char *) m_data + m_size; + void* p = (char*)m_data + m_size; m_size += s; return p; } // Consume bytes from the buffer. - void consume(void *p, size_t s) { + void consume(void* p, size_t s) { memcpy(p, consume_ptr(s), s); } // Consume an unsigned int from the buffer. - // Returns 0 if the unsigned int could not be decoded, probably because the buffer is too short. - // Otherwise return the number of bytes consumed, and stuffs the decoded number in *p. - template size_t consume_ui(T *p) { - size_t s = tokudb::vlq_decode_ui(p, (char *) m_data + m_size, m_limit - m_size); + // Returns 0 if the unsigned int could not be decoded, probably because + // the buffer is too short. + // Otherwise return the number of bytes consumed, and stuffs the decoded + // number in *p. + template size_t consume_ui(T* p) { + size_t s = tokudb::vlq_decode_ui( + p, + (char*)m_data + m_size, + m_limit - m_size); m_size += s; return s; } // Write p_length bytes at an offset in the buffer - void write(void *p, size_t p_length, size_t offset) { - assert(offset + p_length <= m_size); - memcpy((char *)m_data + offset, p, p_length); + void write(void* p, size_t p_length, size_t offset) { + assert_always(offset + p_length <= m_size); + memcpy((char*)m_data + offset, p, p_length); } // Read p_length bytes at an offset in the buffer - void read(void *p, size_t p_length, size_t offset) { - assert(offset + p_length <= m_size); - memcpy(p, (char *)m_data + offset, p_length); + void read(void* p, size_t p_length, size_t offset) { + assert_always(offset + p_length <= m_size); + memcpy(p, (char*)m_data + offset, p_length); } - // Replace a field in the buffer with new data. If the new data size is different, then readjust the - // size of the buffer and move things around. - void replace(size_t offset, size_t old_s, void *new_p, size_t new_s) { - assert(offset + old_s <= m_size); + // Replace a field in the buffer with new data. If the new data size is + // different, then readjust the size of the buffer and move things around. + void replace(size_t offset, size_t old_s, void* new_p, size_t new_s) { + assert_always(offset + old_s <= m_size); if (new_s > old_s) maybe_realloc(new_s - old_s); - char *data_offset = (char *) m_data + offset; + char* data_offset = (char*)m_data + offset; if (new_s != old_s) { size_t n = m_size - (offset + old_s); - assert(offset + new_s + n <= m_limit && offset + old_s + n <= m_limit); + assert_always( + offset + new_s + n <= m_limit && offset + old_s + n <= m_limit); memmove(data_offset + new_s, data_offset + old_s, n); if (new_s > old_s) m_size += new_s - old_s; else m_size -= old_s - new_s; - assert(m_size <= m_limit); + assert_always(m_size <= m_limit); } memcpy(data_offset, new_p, new_s); } // Return a pointer to the data in the buffer - void *data() const { + void* data() const { return m_data; } @@ -145,15 +168,15 @@ private: size_t new_limit = m_limit * 2; if (new_limit < m_size + s) new_limit = m_size + s; - assert(!m_is_static); + assert_always(!m_is_static); void *new_data = realloc(m_data, new_limit); - assert(new_data != NULL); + assert_always(new_data != NULL); m_data = new_data; m_limit = new_limit; } } private: - void *m_data; + void* m_data; size_t m_size; size_t m_limit; bool m_is_static; diff --git a/storage/tokudb/tokudb_card.h b/storage/tokudb/tokudb_card.h index 04eac731aeb..f649c2d887f 100644 --- a/storage/tokudb/tokudb_card.h +++ b/storage/tokudb/tokudb_card.h @@ -27,48 +27,54 @@ namespace tokudb { uint compute_total_key_parts(TABLE_SHARE *table_share) { uint total_key_parts = 0; for (uint i = 0; i < table_share->keys; i++) { - total_key_parts += get_key_parts(&table_share->key_info[i]); + total_key_parts += table_share->key_info[i].user_defined_key_parts; } return total_key_parts; } - // Set the key_info cardinality counters for the table. - void set_card_in_key_info(TABLE *table, uint rec_per_keys, uint64_t rec_per_key[]) { - uint next_key_part = 0; - for (uint i = 0; i < table->s->keys; i++) { - bool is_unique_key = (i == table->s->primary_key) || (table->key_info[i].flags & HA_NOSAME); - uint num_key_parts = get_key_parts(&table->key_info[i]); - for (uint j = 0; j < num_key_parts; j++) { - assert(next_key_part < rec_per_keys); - ulong val = rec_per_key[next_key_part++]; - if (is_unique_key && j == num_key_parts-1) - val = 1; - table->key_info[i].rec_per_key[j] = val; - } - } - } - // Put the cardinality counters into the status dictionary. - int set_card_in_status(DB *status_db, DB_TXN *txn, uint rec_per_keys, uint64_t rec_per_key[]) { + int set_card_in_status( + DB* status_db, + DB_TXN* txn, + uint rec_per_keys, + const uint64_t rec_per_key[]) { + // encode cardinality into the buffer tokudb::buffer b; size_t s; s = b.append_ui(rec_per_keys); - assert(s > 0); + assert_always(s > 0); for (uint i = 0; i < rec_per_keys; i++) { s = b.append_ui(rec_per_key[i]); - assert(s > 0); + assert_always(s > 0); } // write cardinality to status - int error = write_to_status(status_db, hatoku_cardinality, b.data(), b.size(), txn); + int error = + tokudb::metadata::write( + status_db, + hatoku_cardinality, + b.data(), + b.size(), + txn); return error; } // Get the cardinality counters from the status dictionary. - int get_card_from_status(DB *status_db, DB_TXN *txn, uint rec_per_keys, uint64_t rec_per_key[]) { + int get_card_from_status( + DB* status_db, + DB_TXN* txn, + uint rec_per_keys, + uint64_t rec_per_key[]) { + // read cardinality from status - void *buf = 0; size_t buf_size = 0; - int error = get_status_realloc(status_db, txn, hatoku_cardinality, &buf, &buf_size); + void* buf = 0; size_t buf_size = 0; + int error = + tokudb::metadata::read_realloc( + status_db, + txn, + hatoku_cardinality, + &buf, + &buf_size); if (error == 0) { // decode cardinality from the buffer tokudb::buffer b(buf, 0, buf_size); @@ -93,12 +99,17 @@ namespace tokudb { } // Delete the cardinality counters from the status dictionary. - int delete_card_from_status(DB *status_db, DB_TXN *txn) { - int error = remove_from_status(status_db, hatoku_cardinality, txn); + int delete_card_from_status(DB* status_db, DB_TXN* txn) { + int error = + tokudb::metadata::remove(status_db, hatoku_cardinality, txn); return error; } - bool find_index_of_key(const char *key_name, TABLE_SHARE *table_share, uint *index_offset_ptr) { + bool find_index_of_key( + const char* key_name, + TABLE_SHARE* table_share, + uint* index_offset_ptr) { + for (uint i = 0; i < table_share->keys; i++) { if (strcmp(key_name, table_share->key_info[i].name) == 0) { *index_offset_ptr = i; @@ -113,16 +124,30 @@ namespace tokudb { dest[i] = src[i]; } - // Altered table cardinality = select cardinality data from current table cardinality for keys that exist + // Altered table cardinality = select cardinality data from current table + // cardinality for keys that exist // in the altered table and the current table. - int alter_card(DB *status_db, DB_TXN *txn, TABLE_SHARE *table_share, TABLE_SHARE *altered_table_share) { + int alter_card( + DB* status_db, + DB_TXN *txn, + TABLE_SHARE* table_share, + TABLE_SHARE* altered_table_share) { + int error; // read existing cardinality data from status - uint table_total_key_parts = tokudb::compute_total_key_parts(table_share); + uint table_total_key_parts = + tokudb::compute_total_key_parts(table_share); + uint64_t rec_per_key[table_total_key_parts]; - error = get_card_from_status(status_db, txn, table_total_key_parts, rec_per_key); + error = + get_card_from_status( + status_db, + txn, + table_total_key_parts, + rec_per_key); // set altered records per key to unknown - uint altered_table_total_key_parts = tokudb::compute_total_key_parts(altered_table_share); + uint altered_table_total_key_parts = + tokudb::compute_total_key_parts(altered_table_share); uint64_t altered_rec_per_key[altered_table_total_key_parts]; for (uint i = 0; i < altered_table_total_key_parts; i++) altered_rec_per_key[i] = 0; @@ -131,121 +156,37 @@ namespace tokudb { uint orig_key_parts = 0; for (uint i = 0; i < table_share->keys; i++) { orig_key_offset[i] = orig_key_parts; - orig_key_parts += get_key_parts(&table_share->key_info[i]); + orig_key_parts += table_share->key_info[i].user_defined_key_parts; } // if orig card data exists, then use it to compute new card data if (error == 0) { uint next_key_parts = 0; for (uint i = 0; error == 0 && i < altered_table_share->keys; i++) { - uint ith_key_parts = get_key_parts(&altered_table_share->key_info[i]); + uint ith_key_parts = + altered_table_share->key_info[i].user_defined_key_parts; uint orig_key_index; - if (find_index_of_key(altered_table_share->key_info[i].name, table_share, &orig_key_index)) { - copy_card(&altered_rec_per_key[next_key_parts], &rec_per_key[orig_key_offset[orig_key_index]], ith_key_parts); + if (find_index_of_key( + altered_table_share->key_info[i].name, + table_share, + &orig_key_index)) { + copy_card( + &altered_rec_per_key[next_key_parts], + &rec_per_key[orig_key_offset[orig_key_index]], + ith_key_parts); } next_key_parts += ith_key_parts; } } - if (error == 0) - error = set_card_in_status(status_db, txn, altered_table_total_key_parts, altered_rec_per_key); - else - error = delete_card_from_status(status_db, txn); - return error; - } - - struct analyze_card_cursor_callback_extra { - int (*analyze_progress)(void *extra, uint64_t rows); - void *analyze_extra; - uint64_t *rows; - uint64_t *deleted_rows; - }; - - bool analyze_card_cursor_callback(void *extra, uint64_t deleted_rows) { - analyze_card_cursor_callback_extra *a_extra = static_cast(extra); - *a_extra->deleted_rows += deleted_rows; - int r = a_extra->analyze_progress(a_extra->analyze_extra, *a_extra->rows); - sql_print_information("tokudb analyze_card_cursor_callback %u %" PRIu64 " %" PRIu64, r, *a_extra->deleted_rows, deleted_rows); - return r != 0; - } - - // Compute records per key for all key parts of the ith key of the table. - // For each key part, put records per key part in *rec_per_key_part[key_part_index]. - // Returns 0 if success, otherwise an error number. - // TODO statistical dives into the FT - int analyze_card(DB *db, DB_TXN *txn, bool is_unique, uint64_t num_key_parts, uint64_t *rec_per_key_part, - int (*key_compare)(DB *, const DBT *, const DBT *, uint), - int (*analyze_progress)(void *extra, uint64_t rows), void *progress_extra, - uint64_t *return_rows, uint64_t *return_deleted_rows) { - int error = 0; - uint64_t rows = 0; - uint64_t deleted_rows = 0; - uint64_t unique_rows[num_key_parts]; - if (is_unique && num_key_parts == 1) { - // dont compute for unique keys with a single part. we already know the answer. - rows = unique_rows[0] = 1; + if (error == 0) { + error = + set_card_in_status( + status_db, + txn, + altered_table_total_key_parts, + altered_rec_per_key); } else { - DBC *cursor = NULL; - error = db->cursor(db, txn, &cursor, 0); - if (error == 0) { - analyze_card_cursor_callback_extra e = { analyze_progress, progress_extra, &rows, &deleted_rows }; - cursor->c_set_check_interrupt_callback(cursor, analyze_card_cursor_callback, &e); - for (uint64_t i = 0; i < num_key_parts; i++) - unique_rows[i] = 1; - // stop looking when the entire dictionary was analyzed, or a cap on execution time was reached, or the analyze was killed. - DBT key = {}; key.flags = DB_DBT_REALLOC; - DBT prev_key = {}; prev_key.flags = DB_DBT_REALLOC; - while (1) { - error = cursor->c_get(cursor, &key, 0, DB_NEXT); - if (error != 0) { - if (error == DB_NOTFOUND || error == TOKUDB_INTERRUPTED) - error = 0; // not an error - break; - } - rows++; - // first row is a unique row, otherwise compare with the previous key - bool copy_key = false; - if (rows == 1) { - copy_key = true; - } else { - // compare this key with the previous key. ignore appended PK for SK's. - // TODO if a prefix is different, then all larger keys that include the prefix are also different. - // TODO if we are comparing the entire primary key or the entire unique secondary key, then the cardinality must be 1, - // so we can avoid computing it. - for (uint64_t i = 0; i < num_key_parts; i++) { - int cmp = key_compare(db, &prev_key, &key, i+1); - if (cmp != 0) { - unique_rows[i]++; - copy_key = true; - } - } - } - // prev_key = key - if (copy_key) { - prev_key.data = realloc(prev_key.data, key.size); - assert(prev_key.data); - prev_key.size = key.size; - memcpy(prev_key.data, key.data, prev_key.size); - } - // check for limit - if (analyze_progress && (rows % 1000) == 0) { - error = analyze_progress(progress_extra, rows); - if (error) - break; - } - } - // cleanup - free(key.data); - free(prev_key.data); - int close_error = cursor->c_close(cursor); - assert(close_error == 0); - } + error = delete_card_from_status(status_db, txn); } - // return cardinality - if (return_rows) - *return_rows = rows; - if (return_deleted_rows) - *return_deleted_rows = deleted_rows; - for (uint64_t i = 0; i < num_key_parts; i++) - rec_per_key_part[i] = rows / unique_rows[i]; return error; } } diff --git a/storage/tokudb/tokudb_debug.h b/storage/tokudb/tokudb_debug.h new file mode 100644 index 00000000000..46bd65c605a --- /dev/null +++ b/storage/tokudb/tokudb_debug.h @@ -0,0 +1,227 @@ +/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ +// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4: +/* -*- mode: C; c-basic-offset: 4 -*- */ +#ident "$Id$" +/*====== +This file is part of TokuDB + + +Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. + + TokuDBis is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License, version 2, + as published by the Free Software Foundation. + + TokuDB is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with TokuDB. If not, see . + +======= */ + +#ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." + +#ifndef _TOKUDB_DEBUG_H +#define _TOKUDB_DEBUG_H + +#include "hatoku_defines.h" + +#define TOKU_INCLUDE_BACKTRACE 0 +#if TOKU_INCLUDE_BACKTRACE +static void tokudb_backtrace(void); +#endif + +// tokudb debug tracing for tokudb_debug declared in tokudb_sysvars.h/.cc +#define TOKUDB_DEBUG_INIT (1<<0) +#define TOKUDB_DEBUG_OPEN (1<<1) +#define TOKUDB_DEBUG_ENTER (1<<2) +#define TOKUDB_DEBUG_RETURN (1<<3) +#define TOKUDB_DEBUG_ERROR (1<<4) +#define TOKUDB_DEBUG_TXN (1<<5) +#define TOKUDB_DEBUG_AUTO_INCREMENT (1<<6) +#define TOKUDB_DEBUG_INDEX_KEY (1<<7) +#define TOKUDB_DEBUG_LOCK (1<<8) +#define TOKUDB_DEBUG_CHECK_KEY (1<<9) +#define TOKUDB_DEBUG_HIDE_DDL_LOCK_ERRORS (1<<10) +#define TOKUDB_DEBUG_ALTER_TABLE (1<<11) +#define TOKUDB_DEBUG_UPSERT (1<<12) +#define TOKUDB_DEBUG_CHECK (1<<13) +#define TOKUDB_DEBUG_ANALYZE (1<<14) +#define TOKUDB_DEBUG_XA (1<<15) +#define TOKUDB_DEBUG_SHARE (1<<16) + +#define TOKUDB_TRACE(_fmt, ...) { \ + fprintf(stderr, "%u %s:%u %s " _fmt "\n", tokudb::thread::my_tid(), \ + __FILE__, __LINE__, __FUNCTION__, ##__VA_ARGS__); \ +} + +#define TOKUDB_DEBUG_FLAGS(_flags) \ + (tokudb::sysvars::debug & _flags) + +#define TOKUDB_TRACE_FOR_FLAGS(_flags, _fmt, ...) { \ + if (TOKUDB_UNLIKELY(TOKUDB_DEBUG_FLAGS(_flags))) { \ + TOKUDB_TRACE(_fmt, ##__VA_ARGS__); \ + } \ +} + +#define TOKUDB_DBUG_ENTER(_fmt, ...) { \ + if (TOKUDB_UNLIKELY(tokudb::sysvars::debug & TOKUDB_DEBUG_ENTER)) { \ + TOKUDB_TRACE(_fmt, ##__VA_ARGS__); \ + } \ +} \ + DBUG_ENTER(__FUNCTION__); + +#define TOKUDB_DBUG_RETURN(r) { \ + int rr = (r); \ + if (TOKUDB_UNLIKELY((tokudb::sysvars::debug & TOKUDB_DEBUG_RETURN) || \ + (rr != 0 && (tokudb::sysvars::debug & TOKUDB_DEBUG_ERROR)))) { \ + TOKUDB_TRACE("return %d", rr); \ + } \ + DBUG_RETURN(rr); \ +} + +#define TOKUDB_HANDLER_TRACE(_fmt, ...) \ + fprintf(stderr, "%u %p %s:%u ha_tokudb::%s " _fmt "\n", \ + tokudb::thread::my_tid(), this, __FILE__, __LINE__, \ + __FUNCTION__, ##__VA_ARGS__); + +#define TOKUDB_HANDLER_TRACE_FOR_FLAGS(_flags, _fmt, ...) { \ + if (TOKUDB_UNLIKELY(TOKUDB_DEBUG_FLAGS(_flags))) { \ + TOKUDB_HANDLER_TRACE(_fmt, ##__VA_ARGS__); \ + } \ +} + + +#define TOKUDB_HANDLER_DBUG_ENTER(_fmt, ...) { \ + if (TOKUDB_UNLIKELY(tokudb::sysvars::debug & TOKUDB_DEBUG_ENTER)) { \ + TOKUDB_HANDLER_TRACE(_fmt, ##__VA_ARGS__); \ + } \ +} \ + DBUG_ENTER(__FUNCTION__); + +#define TOKUDB_HANDLER_DBUG_RETURN(r) { \ + int rr = (r); \ + if (TOKUDB_UNLIKELY((tokudb::sysvars::debug & TOKUDB_DEBUG_RETURN) || \ + (rr != 0 && (tokudb::sysvars::debug & TOKUDB_DEBUG_ERROR)))) { \ + TOKUDB_HANDLER_TRACE("return %d", rr); \ + } \ + DBUG_RETURN(rr); \ +} + +#define TOKUDB_HANDLER_DBUG_RETURN_DOUBLE(r) { \ + double rr = (r); \ + if (TOKUDB_UNLIKELY(tokudb::sysvars::debug & TOKUDB_DEBUG_RETURN)) { \ + TOKUDB_HANDLER_TRACE("return %f", rr); \ + } \ + DBUG_RETURN(rr); \ +} + +#define TOKUDB_HANDLER_DBUG_RETURN_PTR(r) { \ + if (TOKUDB_UNLIKELY(tokudb::sysvars::debug & TOKUDB_DEBUG_RETURN)) { \ + TOKUDB_HANDLER_TRACE("return 0x%p", r); \ + } \ + DBUG_RETURN(r); \ +} + +#define TOKUDB_HANDLER_DBUG_VOID_RETURN { \ + if (TOKUDB_UNLIKELY(tokudb::sysvars::debug & TOKUDB_DEBUG_RETURN)) { \ + TOKUDB_HANDLER_TRACE("return"); \ + } \ + DBUG_VOID_RETURN; \ +} + +#define TOKUDB_SHARE_TRACE(_fmt, ...) \ + fprintf(stderr, "%u %p %s:%u TOUDB_SHARE::%s " _fmt "\n", \ + tokudb::thread::my_tid(), this, __FILE__, __LINE__, \ + __FUNCTION__, ##__VA_ARGS__); + +#define TOKUDB_SHARE_TRACE_FOR_FLAGS(_flags, _fmt, ...) { \ + if (TOKUDB_UNLIKELY(TOKUDB_DEBUG_FLAGS(_flags))) { \ + TOKUDB_SHARE_TRACE(_fmt, ##__VA_ARGS__); \ + } \ +} + +#define TOKUDB_SHARE_DBUG_ENTER(_fmt, ...) { \ + if (TOKUDB_UNLIKELY((tokudb::sysvars::debug & TOKUDB_DEBUG_ENTER) || \ + (tokudb::sysvars::debug & TOKUDB_DEBUG_SHARE))) { \ + TOKUDB_SHARE_TRACE(_fmt, ##__VA_ARGS__); \ + } \ +} \ + DBUG_ENTER(__FUNCTION__); + +#define TOKUDB_SHARE_DBUG_RETURN(r) { \ + int rr = (r); \ + if (TOKUDB_UNLIKELY((tokudb::sysvars::debug & TOKUDB_DEBUG_RETURN) || \ + (tokudb::sysvars::debug & TOKUDB_DEBUG_SHARE) || \ + (rr != 0 && (tokudb::sysvars::debug & TOKUDB_DEBUG_ERROR)))) { \ + TOKUDB_SHARE_TRACE("return %d", rr); \ + } \ + DBUG_RETURN(rr); \ +} + +#define TOKUDB_SHARE_DBUG_RETURN_DOUBLE(r) { \ + double rr = (r); \ + if (TOKUDB_UNLIKELY((tokudb::sysvars::debug & TOKUDB_DEBUG_RETURN) || \ + (tokudb::sysvars::debug & TOKUDB_DEBUG_SHARE))) { \ + TOKUDB_SHARE_TRACE("return %f", rr); \ + } \ + DBUG_RETURN(rr); \ +} + +#define TOKUDB_SHARE_DBUG_RETURN_PTR(r) { \ + if (TOKUDB_UNLIKELY((tokudb::sysvars::debug & TOKUDB_DEBUG_RETURN) || \ + (tokudb::sysvars::debug & TOKUDB_DEBUG_SHARE))) { \ + TOKUDB_SHARE_TRACE("return 0x%p", r); \ + } \ + DBUG_RETURN(r); \ +} + +#define TOKUDB_SHARE_DBUG_VOID_RETURN() { \ + if (TOKUDB_UNLIKELY((tokudb::sysvars::debug & TOKUDB_DEBUG_RETURN) || \ + (tokudb::sysvars::debug & TOKUDB_DEBUG_SHARE))) { \ + TOKUDB_SHARE_TRACE("return"); \ + } \ + DBUG_VOID_RETURN; \ +} + + +#define TOKUDB_DBUG_DUMP(s, p, len) \ +{ \ + TOKUDB_TRACE("%s", s); \ + uint i; \ + for (i=0; i. + +======= */ + +#ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." + +#include "hatoku_hton.h" +#include "tokudb_information_schema.h" +#include "sql_time.h" +#include "tokudb_background.h" + + +namespace tokudb { +namespace information_schema { + +static void field_store_time_t(Field* field, time_t time) { + MYSQL_TIME my_time; + struct tm tm_time; + + if (time) { + localtime_r(&time, &tm_time); + localtime_to_TIME(&my_time, &tm_time); + my_time.time_type = MYSQL_TIMESTAMP_DATETIME; +#ifdef MARIA_PLUGIN_INTERFACE_VERSION + field->store_time(&my_time); +#else + field->store_time(&my_time, MYSQL_TIMESTAMP_DATETIME); +#endif + field->set_notnull(); + } else { + field->set_null(); + } +} + +st_mysql_information_schema trx_information_schema = { + MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION +}; + +ST_FIELD_INFO trx_field_info[] = { + {"trx_id", 0, MYSQL_TYPE_LONGLONG, 0, 0, NULL, SKIP_OPEN_TABLE }, + {"trx_mysql_thread_id", 0, MYSQL_TYPE_LONGLONG, 0, 0, NULL, SKIP_OPEN_TABLE }, + {"trx_time", 0, MYSQL_TYPE_LONGLONG, 0, 0, NULL, SKIP_OPEN_TABLE }, + {NULL, 0, MYSQL_TYPE_NULL, 0, 0, NULL, SKIP_OPEN_TABLE} +}; + +struct trx_extra_t { + THD *thd; + TABLE *table; +}; + +int trx_callback( + DB_TXN* txn, + iterate_row_locks_callback iterate_locks, + void* locks_extra, + void *extra) { + + uint64_t txn_id = txn->id64(txn); + uint64_t client_id = txn->get_client_id(txn); + uint64_t start_time = txn->get_start_time(txn); + trx_extra_t* e = reinterpret_cast(extra); + THD* thd = e->thd; + TABLE* table = e->table; + table->field[0]->store(txn_id, false); + table->field[1]->store(client_id, false); + uint64_t tnow = (uint64_t) ::time(NULL); + table->field[2]->store(tnow >= start_time ? tnow - start_time : 0, false); + int error = schema_table_store_record(thd, table); + if (!error && thd_killed(thd)) + error = ER_QUERY_INTERRUPTED; + return error; +} + +#if MYSQL_VERSION_ID >= 50600 +int trx_fill_table(THD* thd, TABLE_LIST* tables, Item* cond) { +#else +int trx_fill_table(THD* thd, TABLE_LIST* tables, COND* cond) { +#endif + TOKUDB_DBUG_ENTER(""); + int error; + + tokudb_hton_initialized_lock.lock_read(); + + if (!tokudb_hton_initialized) { + error = ER_PLUGIN_IS_NOT_LOADED; + my_error(error, MYF(0), tokudb_hton_name); + } else { + trx_extra_t e = { thd, tables->table }; + error = db_env->iterate_live_transactions(db_env, trx_callback, &e); + if (error) + my_error(ER_GET_ERRNO, MYF(0), error, tokudb_hton_name); + } + + tokudb_hton_initialized_lock.unlock(); + TOKUDB_DBUG_RETURN(error); +} + +int trx_init(void* p) { + ST_SCHEMA_TABLE *schema = (ST_SCHEMA_TABLE*) p; + schema->fields_info = trx_field_info; + schema->fill_table = trx_fill_table; + return 0; +} + +int trx_done(void* p) { + return 0; +} + +st_mysql_plugin trx = { + MYSQL_INFORMATION_SCHEMA_PLUGIN, + &trx_information_schema, + "TokuDB_trx", + "Percona", + "Percona TokuDB Storage Engine with Fractal Tree(tm) Technology", + PLUGIN_LICENSE_GPL, + trx_init, /* plugin init */ + trx_done, /* plugin deinit */ + TOKUDB_PLUGIN_VERSION, + NULL, /* status variables */ + NULL, /* system variables */ +#ifdef MARIA_PLUGIN_INTERFACE_VERSION + tokudb::sysvars::version, + MariaDB_PLUGIN_MATURITY_STABLE /* maturity */ +#else + NULL, /* config options */ + 0, /* flags */ +#endif +}; + + + +st_mysql_information_schema lock_waits_information_schema = { + MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION +}; + +ST_FIELD_INFO lock_waits_field_info[] = { + {"requesting_trx_id", 0, MYSQL_TYPE_LONGLONG, 0, 0, NULL, SKIP_OPEN_TABLE }, + {"blocking_trx_id", 0, MYSQL_TYPE_LONGLONG, 0, 0, NULL, SKIP_OPEN_TABLE }, + {"lock_waits_dname", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, + {"lock_waits_key_left", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, + {"lock_waits_key_right", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, + {"lock_waits_start_time", 0, MYSQL_TYPE_LONGLONG, 0, 0, NULL, SKIP_OPEN_TABLE }, + {"lock_waits_table_schema", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, + {"lock_waits_table_name", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, + {"lock_waits_table_dictionary_name", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, + {NULL, 0, MYSQL_TYPE_NULL, 0, 0, NULL, SKIP_OPEN_TABLE} +}; + +struct lock_waits_extra_t { + THD* thd; + TABLE* table; +}; + +int lock_waits_callback( + DB* db, + uint64_t requesting_txnid, + const DBT* left_key, + const DBT* right_key, + uint64_t blocking_txnid, + uint64_t start_time, + void *extra) { + + lock_waits_extra_t* e = + reinterpret_cast(extra); + THD* thd = e->thd; + TABLE* table = e->table; + table->field[0]->store(requesting_txnid, false); + table->field[1]->store(blocking_txnid, false); + const char* dname = tokudb_get_index_name(db); + size_t dname_length = strlen(dname); + table->field[2]->store(dname, dname_length, system_charset_info); + String left_str; + tokudb_pretty_left_key(db, left_key, &left_str); + table->field[3]->store( + left_str.ptr(), + left_str.length(), + system_charset_info); + String right_str; + tokudb_pretty_right_key(db, right_key, &right_str); + table->field[4]->store( + right_str.ptr(), + right_str.length(), + system_charset_info); + table->field[5]->store(start_time, false); + + String database_name, table_name, dictionary_name; + tokudb_split_dname(dname, database_name, table_name, dictionary_name); + table->field[6]->store( + database_name.c_ptr(), + database_name.length(), + system_charset_info); + table->field[7]->store( + table_name.c_ptr(), + table_name.length(), + system_charset_info); + table->field[8]->store( + dictionary_name.c_ptr(), + dictionary_name.length(), + system_charset_info); + + int error = schema_table_store_record(thd, table); + + if (!error && thd_killed(thd)) + error = ER_QUERY_INTERRUPTED; + + return error; +} + +#if MYSQL_VERSION_ID >= 50600 +int lock_waits_fill_table(THD* thd, TABLE_LIST* tables, Item* cond) { +#else +int lock_waits_fill_table(THD* thd, TABLE_LIST* tables, COND* cond) { +#endif + TOKUDB_DBUG_ENTER(""); + int error; + + tokudb_hton_initialized_lock.lock_read(); + + if (!tokudb_hton_initialized) { + error = ER_PLUGIN_IS_NOT_LOADED; + my_error(error, MYF(0), tokudb_hton_name); + } else { + lock_waits_extra_t e = { thd, tables->table }; + error = db_env->iterate_pending_lock_requests( + db_env, + lock_waits_callback, + &e); + if (error) + my_error(ER_GET_ERRNO, MYF(0), error, tokudb_hton_name); + } + + tokudb_hton_initialized_lock.unlock(); + TOKUDB_DBUG_RETURN(error); +} + +int lock_waits_init(void* p) { + ST_SCHEMA_TABLE* schema = (ST_SCHEMA_TABLE*)p; + schema->fields_info = lock_waits_field_info; + schema->fill_table = lock_waits_fill_table; + return 0; +} + +int lock_waits_done(void *p) { + return 0; +} + +st_mysql_plugin lock_waits = { + MYSQL_INFORMATION_SCHEMA_PLUGIN, + &lock_waits_information_schema, + "TokuDB_lock_waits", + "Percona", + "Percona TokuDB Storage Engine with Fractal Tree(tm) Technology", + PLUGIN_LICENSE_GPL, + lock_waits_init, /* plugin init */ + lock_waits_done, /* plugin deinit */ + TOKUDB_PLUGIN_VERSION, + NULL, /* status variables */ + NULL, /* system variables */ +#ifdef MARIA_PLUGIN_INTERFACE_VERSION + tokudb::sysvars::version, + MariaDB_PLUGIN_MATURITY_STABLE /* maturity */ +#else + NULL, /* config options */ + 0, /* flags */ +#endif +}; + + + +st_mysql_information_schema locks_information_schema = { + MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION +}; + + ST_FIELD_INFO locks_field_info[] = { + {"locks_trx_id", 0, MYSQL_TYPE_LONGLONG, 0, 0, NULL, SKIP_OPEN_TABLE }, + {"locks_mysql_thread_id", 0, MYSQL_TYPE_LONGLONG, 0, 0, NULL, SKIP_OPEN_TABLE }, + {"locks_dname", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, + {"locks_key_left", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, + {"locks_key_right", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, + {"locks_table_schema", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, + {"locks_table_name", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, + {"locks_table_dictionary_name", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, + {NULL, 0, MYSQL_TYPE_NULL, 0, 0, NULL, SKIP_OPEN_TABLE} +}; + +struct locks_extra_t { + THD* thd; + TABLE* table; +}; + +int locks_callback( + DB_TXN* txn, + iterate_row_locks_callback iterate_locks, + void* locks_extra, + void* extra) { + + uint64_t txn_id = txn->id64(txn); + uint64_t client_id = txn->get_client_id(txn); + locks_extra_t* e = reinterpret_cast(extra); + THD* thd = e->thd; + TABLE* table = e->table; + int error = 0; + DB* db; + DBT left_key, right_key; + while (error == 0 && + iterate_locks(&db, &left_key, &right_key, locks_extra) == 0) { + table->field[0]->store(txn_id, false); + table->field[1]->store(client_id, false); + + const char* dname = tokudb_get_index_name(db); + size_t dname_length = strlen(dname); + table->field[2]->store(dname, dname_length, system_charset_info); + + String left_str; + tokudb_pretty_left_key(db, &left_key, &left_str); + table->field[3]->store( + left_str.ptr(), + left_str.length(), + system_charset_info); + + String right_str; + tokudb_pretty_right_key(db, &right_key, &right_str); + table->field[4]->store( + right_str.ptr(), + right_str.length(), + system_charset_info); + + String database_name, table_name, dictionary_name; + tokudb_split_dname(dname, database_name, table_name, dictionary_name); + table->field[5]->store( + database_name.c_ptr(), + database_name.length(), + system_charset_info); + table->field[6]->store( + table_name.c_ptr(), + table_name.length(), + system_charset_info); + table->field[7]->store( + dictionary_name.c_ptr(), + dictionary_name.length(), + system_charset_info); + + error = schema_table_store_record(thd, table); + + if (!error && thd_killed(thd)) + error = ER_QUERY_INTERRUPTED; + } + return error; +} + +#if MYSQL_VERSION_ID >= 50600 +int locks_fill_table(THD* thd, TABLE_LIST* tables, Item* cond) { +#else +int locks_fill_table(THD* thd, TABLE_LIST* tables, COND* cond) { +#endif + TOKUDB_DBUG_ENTER(""); + int error; + + tokudb_hton_initialized_lock.lock_read(); + + if (!tokudb_hton_initialized) { + error = ER_PLUGIN_IS_NOT_LOADED; + my_error(error, MYF(0), tokudb_hton_name); + } else { + locks_extra_t e = { thd, tables->table }; + error = db_env->iterate_live_transactions(db_env, locks_callback, &e); + if (error) + my_error(ER_GET_ERRNO, MYF(0), error, tokudb_hton_name); + } + + tokudb_hton_initialized_lock.unlock(); + TOKUDB_DBUG_RETURN(error); +} + +int locks_init(void* p) { + ST_SCHEMA_TABLE* schema = (ST_SCHEMA_TABLE*)p; + schema->fields_info = locks_field_info; + schema->fill_table = locks_fill_table; + return 0; +} + +int locks_done(void* p) { + return 0; +} + +st_mysql_plugin locks = { + MYSQL_INFORMATION_SCHEMA_PLUGIN, + &locks_information_schema, + "TokuDB_locks", + "Percona", + "Percona TokuDB Storage Engine with Fractal Tree(tm) Technology", + PLUGIN_LICENSE_GPL, + locks_init, /* plugin init */ + locks_done, /* plugin deinit */ + TOKUDB_PLUGIN_VERSION, + NULL, /* status variables */ + NULL, /* system variables */ +#ifdef MARIA_PLUGIN_INTERFACE_VERSION + tokudb::sysvars::version, + MariaDB_PLUGIN_MATURITY_STABLE /* maturity */ +#else + NULL, /* config options */ + 0, /* flags */ +#endif +}; + + + +st_mysql_information_schema file_map_information_schema = { + MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION +}; + +ST_FIELD_INFO file_map_field_info[] = { + {"dictionary_name", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, + {"internal_file_name", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, + {"table_schema", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, + {"table_name", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, + {"table_dictionary_name", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, + {NULL, 0, MYSQL_TYPE_NULL, 0, 0, NULL, SKIP_OPEN_TABLE} +}; + +int report_file_map(TABLE* table, THD* thd) { + int error; + DB_TXN* txn = NULL; + DBC* tmp_cursor = NULL; + DBT curr_key; + DBT curr_val; + memset(&curr_key, 0, sizeof curr_key); + memset(&curr_val, 0, sizeof curr_val); + error = txn_begin(db_env, 0, &txn, DB_READ_UNCOMMITTED, thd); + if (error) { + goto cleanup; + } + error = db_env->get_cursor_for_directory(db_env, txn, &tmp_cursor); + if (error) { + goto cleanup; + } + while (error == 0) { + error = tmp_cursor->c_get(tmp_cursor, &curr_key, &curr_val, DB_NEXT); + if (!error) { + // We store the NULL terminator in the directory so it's included + // in the size. + // See #5789 + // Recalculate and check just to be safe. + const char *dname = (const char *) curr_key.data; + size_t dname_len = strlen(dname); + assert(dname_len == curr_key.size - 1); + table->field[0]->store(dname, dname_len, system_charset_info); + + const char *iname = (const char *) curr_val.data; + size_t iname_len = strlen(iname); + assert(iname_len == curr_val.size - 1); + table->field[1]->store(iname, iname_len, system_charset_info); + + // split the dname + String database_name, table_name, dictionary_name; + tokudb_split_dname( + dname, + database_name, + table_name, + dictionary_name); + table->field[2]->store( + database_name.c_ptr(), + database_name.length(), + system_charset_info); + table->field[3]->store( + table_name.c_ptr(), + table_name.length(), + system_charset_info); + table->field[4]->store( + dictionary_name.c_ptr(), + dictionary_name.length(), + system_charset_info); + + error = schema_table_store_record(thd, table); + } + if (!error && thd_killed(thd)) + error = ER_QUERY_INTERRUPTED; + } + if (error == DB_NOTFOUND) { + error = 0; + } +cleanup: + if (tmp_cursor) { + int r = tmp_cursor->c_close(tmp_cursor); + assert(r == 0); + } + if (txn) { + commit_txn(txn, 0); + } + return error; +} + +#if MYSQL_VERSION_ID >= 50600 +int file_map_fill_table(THD* thd, TABLE_LIST* tables, Item* cond) { +#else +int file_map_fill_table(THD* thd, TABLE_LIST* tables, COND* cond) { +#endif + TOKUDB_DBUG_ENTER(""); + int error; + TABLE* table = tables->table; + + tokudb_hton_initialized_lock.lock_read(); + + if (!tokudb_hton_initialized) { + error = ER_PLUGIN_IS_NOT_LOADED; + my_error(error, MYF(0), tokudb_hton_name); + } else { + error = report_file_map(table, thd); + if (error) + my_error(ER_GET_ERRNO, MYF(0), error, tokudb_hton_name); + } + + tokudb_hton_initialized_lock.unlock(); + TOKUDB_DBUG_RETURN(error); +} + +int file_map_init(void* p) { + ST_SCHEMA_TABLE* schema = (ST_SCHEMA_TABLE*)p; + schema->fields_info = file_map_field_info; + schema->fill_table = file_map_fill_table; + return 0; +} + +int file_map_done(void* p) { + return 0; +} + +st_mysql_plugin file_map = { + MYSQL_INFORMATION_SCHEMA_PLUGIN, + &file_map_information_schema, + "TokuDB_file_map", + "Percona", + "Percona TokuDB Storage Engine with Fractal Tree(tm) Technology", + PLUGIN_LICENSE_GPL, + file_map_init, /* plugin init */ + file_map_done, /* plugin deinit */ + TOKUDB_PLUGIN_VERSION, + NULL, /* status variables */ + NULL, /* system variables */ +#ifdef MARIA_PLUGIN_INTERFACE_VERSION + tokudb::sysvars::version, + MariaDB_PLUGIN_MATURITY_STABLE /* maturity */ +#else + NULL, /* config options */ + 0, /* flags */ +#endif +}; + + + +st_mysql_information_schema fractal_tree_info_information_schema = { + MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION +}; + +ST_FIELD_INFO fractal_tree_info_field_info[] = { + {"dictionary_name", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, + {"internal_file_name", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, + {"bt_num_blocks_allocated", 0, MYSQL_TYPE_LONGLONG, 0, 0, NULL, SKIP_OPEN_TABLE }, + {"bt_num_blocks_in_use", 0, MYSQL_TYPE_LONGLONG, 0, 0, NULL, SKIP_OPEN_TABLE }, + {"bt_size_allocated", 0, MYSQL_TYPE_LONGLONG, 0, 0, NULL, SKIP_OPEN_TABLE }, + {"bt_size_in_use", 0, MYSQL_TYPE_LONGLONG, 0, 0, NULL, SKIP_OPEN_TABLE }, + {"table_schema", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, + {"table_name", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, + {"table_dictionary_name", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, + {NULL, 0, MYSQL_TYPE_NULL, 0, 0, NULL, SKIP_OPEN_TABLE} +}; + +int report_fractal_tree_info_for_db( + const DBT* dname, + const DBT* iname, + TABLE* table, + THD* thd) { + + int error; + uint64_t bt_num_blocks_allocated; + uint64_t bt_num_blocks_in_use; + uint64_t bt_size_allocated; + uint64_t bt_size_in_use; + + DB *db = NULL; + error = db_create(&db, db_env, 0); + if (error) { + goto exit; + } + error = db->open(db, NULL, (char *)dname->data, NULL, DB_BTREE, 0, 0666); + if (error) { + goto exit; + } + error = db->get_fractal_tree_info64( + db, + &bt_num_blocks_allocated, + &bt_num_blocks_in_use, + &bt_size_allocated, + &bt_size_in_use); + if (error) { + goto exit; + } + + // We store the NULL terminator in the directory so it's included in the + // size. + // See #5789 + // Recalculate and check just to be safe. + { + size_t dname_len = strlen((const char*)dname->data); + assert(dname_len == dname->size - 1); + table->field[0]->store( + (char*)dname->data, + dname_len, + system_charset_info); + size_t iname_len = strlen((const char*)iname->data); + assert(iname_len == iname->size - 1); + table->field[1]->store( + (char*)iname->data, + iname_len, + system_charset_info); + } + table->field[2]->store(bt_num_blocks_allocated, false); + table->field[3]->store(bt_num_blocks_in_use, false); + table->field[4]->store(bt_size_allocated, false); + table->field[5]->store(bt_size_in_use, false); + + // split the dname + { + String database_name, table_name, dictionary_name; + tokudb_split_dname( + (const char*)dname->data, + database_name, + table_name, + dictionary_name); + table->field[6]->store( + database_name.c_ptr(), + database_name.length(), + system_charset_info); + table->field[7]->store( + table_name.c_ptr(), + table_name.length(), + system_charset_info); + table->field[8]->store( + dictionary_name.c_ptr(), + dictionary_name.length(), + system_charset_info); + } + error = schema_table_store_record(thd, table); + +exit: + if (db) { + int close_error = db->close(db, 0); + if (error == 0) + error = close_error; + } + return error; +} + +int report_fractal_tree_info(TABLE* table, THD* thd) { + int error; + DB_TXN* txn = NULL; + DBC* tmp_cursor = NULL; + DBT curr_key; + DBT curr_val; + memset(&curr_key, 0, sizeof curr_key); + memset(&curr_val, 0, sizeof curr_val); + error = txn_begin(db_env, 0, &txn, DB_READ_UNCOMMITTED, thd); + if (error) { + goto cleanup; + } + error = db_env->get_cursor_for_directory(db_env, txn, &tmp_cursor); + if (error) { + goto cleanup; + } + while (error == 0) { + error = tmp_cursor->c_get(tmp_cursor, &curr_key, &curr_val, DB_NEXT); + if (!error) { + error = report_fractal_tree_info_for_db( + &curr_key, + &curr_val, + table, + thd); + if (error) + error = 0; // ignore read uncommitted errors + } + if (!error && thd_killed(thd)) + error = ER_QUERY_INTERRUPTED; + } + if (error == DB_NOTFOUND) { + error = 0; + } +cleanup: + if (tmp_cursor) { + int r = tmp_cursor->c_close(tmp_cursor); + assert(r == 0); + } + if (txn) { + commit_txn(txn, 0); + } + return error; +} + +#if MYSQL_VERSION_ID >= 50600 +int fractal_tree_info_fill_table(THD* thd, TABLE_LIST* tables, Item* cond) { +#else +int fractal_tree_info_fill_table(THD* thd, TABLE_LIST* tables, COND* cond) { +#endif + TOKUDB_DBUG_ENTER(""); + int error; + TABLE* table = tables->table; + + // 3938: Get a read lock on the status flag, since we must + // read it before safely proceeding + tokudb_hton_initialized_lock.lock_read(); + + if (!tokudb_hton_initialized) { + error = ER_PLUGIN_IS_NOT_LOADED; + my_error(error, MYF(0), tokudb_hton_name); + } else { + error = report_fractal_tree_info(table, thd); + if (error) + my_error(ER_GET_ERRNO, MYF(0), error, tokudb_hton_name); + } + + //3938: unlock the status flag lock + tokudb_hton_initialized_lock.unlock(); + TOKUDB_DBUG_RETURN(error); +} + +int fractal_tree_info_init(void* p) { + ST_SCHEMA_TABLE* schema = (ST_SCHEMA_TABLE*)p; + schema->fields_info = fractal_tree_info_field_info; + schema->fill_table = fractal_tree_info_fill_table; + return 0; +} + +int fractal_tree_info_done(void* p) { + return 0; +} + +st_mysql_plugin fractal_tree_info = { + MYSQL_INFORMATION_SCHEMA_PLUGIN, + &fractal_tree_info_information_schema, + "TokuDB_fractal_tree_info", + "Percona", + "Percona TokuDB Storage Engine with Fractal Tree(tm) Technology", + PLUGIN_LICENSE_GPL, + fractal_tree_info_init, /* plugin init */ + fractal_tree_info_done, /* plugin deinit */ + TOKUDB_PLUGIN_VERSION, + NULL, /* status variables */ + NULL, /* system variables */ +#ifdef MARIA_PLUGIN_INTERFACE_VERSION + tokudb::sysvars::version, + MariaDB_PLUGIN_MATURITY_STABLE /* maturity */ +#else + NULL, /* config options */ + 0, /* flags */ +#endif +}; + + + +st_mysql_information_schema fractal_tree_block_map_information_schema = { + MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION +}; + +ST_FIELD_INFO fractal_tree_block_map_field_info[] = { + {"dictionary_name", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, + {"internal_file_name", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, + {"checkpoint_count", 0, MYSQL_TYPE_LONGLONG, 0, 0, NULL, SKIP_OPEN_TABLE }, + {"blocknum", 0, MYSQL_TYPE_LONGLONG, 0, 0, NULL, SKIP_OPEN_TABLE }, + {"offset", 0, MYSQL_TYPE_LONGLONG, 0, MY_I_S_MAYBE_NULL, NULL, SKIP_OPEN_TABLE }, + {"size", 0, MYSQL_TYPE_LONGLONG, 0, MY_I_S_MAYBE_NULL, NULL, SKIP_OPEN_TABLE }, + {"table_schema", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, + {"table_name", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, + {"table_dictionary_name", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, + {NULL, 0, MYSQL_TYPE_NULL, 0, 0, NULL, SKIP_OPEN_TABLE} +}; + +struct report_fractal_tree_block_map_iterator_extra_t { + int64_t num_rows; + int64_t i; + uint64_t* checkpoint_counts; + int64_t* blocknums; + int64_t* diskoffs; + int64_t* sizes; +}; + +// This iterator is called while holding the blocktable lock. +// We should be as quick as possible. +// We don't want to do one call to get the number of rows, release the +// blocktable lock, and then do another call to get all the rows because +// the number of rows may change if we don't hold the lock. +// As a compromise, we'll do some mallocs inside the lock on the first call, +// but everything else should be fast. +int report_fractal_tree_block_map_iterator( + uint64_t checkpoint_count, + int64_t num_rows, + int64_t blocknum, + int64_t diskoff, + int64_t size, + void* iter_extra) { + + struct report_fractal_tree_block_map_iterator_extra_t* e = + static_cast(iter_extra); + + assert(num_rows > 0); + if (e->num_rows == 0) { + e->checkpoint_counts = + (uint64_t*)tokudb::memory::malloc( + num_rows * (sizeof *e->checkpoint_counts), + MYF(MY_WME|MY_ZEROFILL|MY_FAE)); + e->blocknums = + (int64_t*)tokudb::memory::malloc( + num_rows * (sizeof *e->blocknums), + MYF(MY_WME|MY_ZEROFILL|MY_FAE)); + e->diskoffs = + (int64_t*)tokudb::memory::malloc( + num_rows * (sizeof *e->diskoffs), + MYF(MY_WME|MY_ZEROFILL|MY_FAE)); + e->sizes = + (int64_t*)tokudb::memory::malloc( + num_rows * (sizeof *e->sizes), + MYF(MY_WME|MY_ZEROFILL|MY_FAE)); + e->num_rows = num_rows; + } + + e->checkpoint_counts[e->i] = checkpoint_count; + e->blocknums[e->i] = blocknum; + e->diskoffs[e->i] = diskoff; + e->sizes[e->i] = size; + ++(e->i); + + return 0; +} + +int report_fractal_tree_block_map_for_db( + const DBT* dname, + const DBT* iname, + TABLE* table, + THD* thd) { + + int error; + DB* db; + // avoid struct initializers so that we can compile with older gcc versions + report_fractal_tree_block_map_iterator_extra_t e = {}; + + error = db_create(&db, db_env, 0); + if (error) { + goto exit; + } + error = db->open(db, NULL, (char *)dname->data, NULL, DB_BTREE, 0, 0666); + if (error) { + goto exit; + } + error = db->iterate_fractal_tree_block_map( + db, + report_fractal_tree_block_map_iterator, + &e); + { + int close_error = db->close(db, 0); + if (!error) { + error = close_error; + } + } + if (error) { + goto exit; + } + + // If not, we should have gotten an error and skipped this section of code + assert(e.i == e.num_rows); + for (int64_t i = 0; error == 0 && i < e.num_rows; ++i) { + // We store the NULL terminator in the directory so it's included in the size. + // See #5789 + // Recalculate and check just to be safe. + size_t dname_len = strlen((const char*)dname->data); + assert(dname_len == dname->size - 1); + table->field[0]->store( + (char*)dname->data, + dname_len, + system_charset_info); + + size_t iname_len = strlen((const char*)iname->data); + assert(iname_len == iname->size - 1); + table->field[1]->store( + (char*)iname->data, + iname_len, + system_charset_info); + + table->field[2]->store(e.checkpoint_counts[i], false); + table->field[3]->store(e.blocknums[i], false); + static const int64_t freelist_null = -1; + static const int64_t diskoff_unused = -2; + if (e.diskoffs[i] == diskoff_unused || e.diskoffs[i] == freelist_null) { + table->field[4]->set_null(); + } else { + table->field[4]->set_notnull(); + table->field[4]->store(e.diskoffs[i], false); + } + static const int64_t size_is_free = -1; + if (e.sizes[i] == size_is_free) { + table->field[5]->set_null(); + } else { + table->field[5]->set_notnull(); + table->field[5]->store(e.sizes[i], false); + } + + // split the dname + String database_name, table_name, dictionary_name; + tokudb_split_dname( + (const char*)dname->data, + database_name, + table_name, + dictionary_name); + table->field[6]->store( + database_name.c_ptr(), + database_name.length(), + system_charset_info); + table->field[7]->store( + table_name.c_ptr(), + table_name.length(), + system_charset_info); + table->field[8]->store( + dictionary_name.c_ptr(), + dictionary_name.length(), + system_charset_info); + + error = schema_table_store_record(thd, table); + } + +exit: + if (e.checkpoint_counts != NULL) { + tokudb::memory::free(e.checkpoint_counts); + e.checkpoint_counts = NULL; + } + if (e.blocknums != NULL) { + tokudb::memory::free(e.blocknums); + e.blocknums = NULL; + } + if (e.diskoffs != NULL) { + tokudb::memory::free(e.diskoffs); + e.diskoffs = NULL; + } + if (e.sizes != NULL) { + tokudb::memory::free(e.sizes); + e.sizes = NULL; + } + return error; +} + +int report_fractal_tree_block_map(TABLE* table, THD* thd) { + int error; + DB_TXN* txn = NULL; + DBC* tmp_cursor = NULL; + DBT curr_key; + DBT curr_val; + memset(&curr_key, 0, sizeof curr_key); + memset(&curr_val, 0, sizeof curr_val); + error = txn_begin(db_env, 0, &txn, DB_READ_UNCOMMITTED, thd); + if (error) { + goto cleanup; + } + error = db_env->get_cursor_for_directory(db_env, txn, &tmp_cursor); + if (error) { + goto cleanup; + } + while (error == 0) { + error = tmp_cursor->c_get(tmp_cursor, &curr_key, &curr_val, DB_NEXT); + if (!error) { + error = report_fractal_tree_block_map_for_db( + &curr_key, + &curr_val, + table, + thd); + } + if (!error && thd_killed(thd)) + error = ER_QUERY_INTERRUPTED; + } + if (error == DB_NOTFOUND) { + error = 0; + } +cleanup: + if (tmp_cursor) { + int r = tmp_cursor->c_close(tmp_cursor); + assert(r == 0); + } + if (txn) { + commit_txn(txn, 0); + } + return error; +} + +#if MYSQL_VERSION_ID >= 50600 +int fractal_tree_block_map_fill_table( + THD* thd, + TABLE_LIST* tables, + Item* cond) { +#else +int fractal_tree_block_map_fill_table( + THD* thd, + TABLE_LIST* tables, + COND* cond) { +#endif + TOKUDB_DBUG_ENTER(""); + int error; + TABLE* table = tables->table; + + // 3938: Get a read lock on the status flag, since we must + // read it before safely proceeding + tokudb_hton_initialized_lock.lock_read(); + + if (!tokudb_hton_initialized) { + error = ER_PLUGIN_IS_NOT_LOADED; + my_error(error, MYF(0), tokudb_hton_name); + } else { + error = report_fractal_tree_block_map(table, thd); + if (error) + my_error(ER_GET_ERRNO, MYF(0), error, tokudb_hton_name); + } + + //3938: unlock the status flag lock + tokudb_hton_initialized_lock.unlock(); + TOKUDB_DBUG_RETURN(error); +} + +int fractal_tree_block_map_init(void* p) { + ST_SCHEMA_TABLE* schema = (ST_SCHEMA_TABLE*)p; + schema->fields_info = fractal_tree_block_map_field_info; + schema->fill_table = fractal_tree_block_map_fill_table; + return 0; +} + +int fractal_tree_block_map_done(void *p) { + return 0; +} + +st_mysql_plugin fractal_tree_block_map = { + MYSQL_INFORMATION_SCHEMA_PLUGIN, + &fractal_tree_block_map_information_schema, + "TokuDB_fractal_tree_block_map", + "Percona", + "Percona TokuDB Storage Engine with Fractal Tree(tm) Technology", + PLUGIN_LICENSE_GPL, + fractal_tree_block_map_init, /* plugin init */ + fractal_tree_block_map_done, /* plugin deinit */ + TOKUDB_PLUGIN_VERSION, + NULL, /* status variables */ + NULL, /* system variables */ +#ifdef MARIA_PLUGIN_INTERFACE_VERSION + tokudb::sysvars::version, + MariaDB_PLUGIN_MATURITY_STABLE /* maturity */ +#else + NULL, /* config options */ + 0, /* flags */ +#endif +}; + + +st_mysql_information_schema background_job_status_information_schema = { + MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION +}; + +ST_FIELD_INFO background_job_status_field_info[] = { + {"id", 0, MYSQL_TYPE_LONGLONG, 0, 0, NULL, SKIP_OPEN_TABLE }, + {"database_name", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, + {"table_name", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, + {"job_type", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, + {"job_params", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, + {"scheduler", 32, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, + {"scheduled_time", 0, MYSQL_TYPE_DATETIME, 0, 0, NULL, SKIP_OPEN_TABLE }, + {"started_time", 0, MYSQL_TYPE_DATETIME, 0, MY_I_S_MAYBE_NULL, NULL, SKIP_OPEN_TABLE }, + {"status", 256, MYSQL_TYPE_STRING, 0, MY_I_S_MAYBE_NULL, SKIP_OPEN_TABLE }, + {NULL, 0, MYSQL_TYPE_NULL, 0, 0, NULL, SKIP_OPEN_TABLE} +}; + +struct background_job_status_extra { + THD* thd; + TABLE* table; +}; + +void background_job_status_callback( + uint64_t id, + const char* database_name, + const char* table_name, + const char* type, + const char* params, + const char* status, + bool user_scheduled, + time_t scheduled_time, + time_t started_time, + void* extra) { + + background_job_status_extra* e = + reinterpret_cast(extra); + + THD* thd = e->thd; + TABLE* table = e->table; + + table->field[0]->store(id, false); + table->field[1]->store( + database_name, + strlen(database_name), + system_charset_info); + table->field[2]->store(table_name, strlen(table_name), system_charset_info); + table->field[3]->store(type, strlen(type), system_charset_info); + table->field[4]->store(params, strlen(params), system_charset_info); + if (user_scheduled) + table->field[5]->store("USER", strlen("USER"), system_charset_info); + else + table->field[5]->store("AUTO", strlen("AUTO"), system_charset_info); + + field_store_time_t(table->field[6], scheduled_time); + field_store_time_t(table->field[7], started_time); + if (status[0] != '\0') { + table->field[8]->store(status, strlen(status), system_charset_info); + table->field[8]->set_notnull(); + } else { + table->field[8]->store(NULL, 0, system_charset_info); + table->field[8]->set_null(); + } + + schema_table_store_record(thd, table); +} + +int report_background_job_status(TABLE *table, THD *thd) { + int error = 0; + background_job_status_extra extra = { + thd, + table + }; + tokudb::background::_job_manager->iterate_jobs( + background_job_status_callback, + &extra); + return error; +} + +#if MYSQL_VERSION_ID >= 50600 +int background_job_status_fill_table(THD *thd, TABLE_LIST *tables, Item *cond) { +#else +int background_job_status_fill_table(THD *thd, TABLE_LIST *tables, COND *cond) { +#endif + TOKUDB_DBUG_ENTER(""); + int error; + TABLE* table = tables->table; + + tokudb_hton_initialized_lock.lock_read(); + + if (!tokudb_hton_initialized) { + error = ER_PLUGIN_IS_NOT_LOADED; + my_error(error, MYF(0), tokudb_hton_name); + } else { + error = report_background_job_status(table, thd); + if (error) + my_error(ER_GET_ERRNO, MYF(0), error, tokudb_hton_name); + } + + tokudb_hton_initialized_lock.unlock(); + TOKUDB_DBUG_RETURN(error); +} + +int background_job_status_init(void* p) { + ST_SCHEMA_TABLE* schema = (ST_SCHEMA_TABLE*)p; + schema->fields_info = background_job_status_field_info; + schema->fill_table = background_job_status_fill_table; + return 0; +} + +int background_job_status_done(void* p) { + return 0; +} + +st_mysql_plugin background_job_status = { + MYSQL_INFORMATION_SCHEMA_PLUGIN, + &background_job_status_information_schema, + "TokuDB_background_job_status", + "Percona", + "Percona TokuDB Storage Engine with Fractal Tree(tm) Technology", + PLUGIN_LICENSE_GPL, + background_job_status_init, /* plugin init */ + background_job_status_done, /* plugin deinit */ + TOKUDB_PLUGIN_VERSION, + NULL, /* status variables */ + NULL, /* system variables */ +#ifdef MARIA_PLUGIN_INTERFACE_VERSION + tokudb::sysvars::version, + MariaDB_PLUGIN_MATURITY_STABLE /* maturity */ +#else + NULL, /* config options */ + 0, /* flags */ +#endif +}; + +} // namespace information_schema +} // namespace tokudb diff --git a/storage/tokudb/tokudb_information_schema.h b/storage/tokudb/tokudb_information_schema.h new file mode 100644 index 00000000000..b80e3f074ec --- /dev/null +++ b/storage/tokudb/tokudb_information_schema.h @@ -0,0 +1,50 @@ +/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ +// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4: +/* -*- mode: C; c-basic-offset: 4 -*- */ +#ident "$Id$" +/*====== +This file is part of TokuDB + + +Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. + + TokuDBis is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License, version 2, + as published by the Free Software Foundation. + + TokuDB is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with TokuDB. If not, see . + +======= */ + +#ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." + +#ifndef _TOKUDB_INFORMATION_SCHEMA_H +#define _TOKUDB_INFORMATION_SCHEMA_H + +#include "hatoku_defines.h" + +namespace tokudb { +namespace information_schema { + +#ifdef MARIA_PLUGIN_INTERFACE_VERSION +#define st_mysql_plugin st_maria_plugin +#endif + +extern st_mysql_plugin trx; +extern st_mysql_plugin lock_waits; +extern st_mysql_plugin locks; +extern st_mysql_plugin file_map; +extern st_mysql_plugin fractal_tree_info; +extern st_mysql_plugin fractal_tree_block_map; +extern st_mysql_plugin background_job_status; + +} // namespace information_schema +} // namespace tokudb + +#endif // _TOKUDB_INFORMATION_SCHEMA_H diff --git a/storage/tokudb/tokudb_math.h b/storage/tokudb/tokudb_math.h index c49af2a6a21..0338bf3871e 100644 --- a/storage/tokudb/tokudb_math.h +++ b/storage/tokudb/tokudb_math.h @@ -32,30 +32,34 @@ namespace tokudb { // Overflow detection adapted from "Hackers Delight", Henry S. Warren // Return a bit mask for bits 0 .. length_bits-1 -static uint64_t uint_mask(uint length_bits) __attribute__((unused)); +TOKUDB_UNUSED(static uint64_t uint_mask(uint length_bits)); static uint64_t uint_mask(uint length_bits) { return length_bits == 64 ? ~0ULL : (1ULL< x; // check for overflow return s; } // Return the highest int with a given number of bits -static int64_t int_high_endpoint(uint length_bits) __attribute__((unused)); +TOKUDB_UNUSED(static int64_t int_high_endpoint(uint length_bits)); static int64_t int_high_endpoint(uint length_bits) { return (1ULL<<(length_bits-1))-1; } // Return the lowest int with a given number of bits -static int64_t int_low_endpoint(uint length_bits) __attribute__((unused)); +TOKUDB_UNUSED(static int64_t int_low_endpoint(uint length_bits)); static int64_t int_low_endpoint(uint length_bits) { int64_t mask = uint_mask(length_bits); return (1ULL<<(length_bits-1)) | ~mask; } // Sign extend to 64 bits an int with a given number of bits -static int64_t int_sign_extend(int64_t n, uint length_bits) __attribute__((unused)); +TOKUDB_UNUSED(static int64_t int_sign_extend(int64_t n, uint length_bits)); static int64_t int_sign_extend(int64_t n, uint length_bits) { if (n & (1ULL<<(length_bits-1))) n |= ~uint_mask(length_bits); @@ -99,7 +107,11 @@ static int64_t int_sign_extend(int64_t n, uint length_bits) { // depending on the sign bit. // Sign extend to 64 bits. // Return the sum and the overflow. -static int64_t int_add(int64_t x, int64_t y, uint length_bits, bool *over) __attribute__((unused)); +TOKUDB_UNUSED(static int64_t int_add( + int64_t x, + int64_t y, + uint length_bits, + bool* over)); static int64_t int_add(int64_t x, int64_t y, uint length_bits, bool *over) { int64_t mask = uint_mask(length_bits); int64_t n = (x + y) & mask; @@ -114,7 +126,11 @@ static int64_t int_add(int64_t x, int64_t y, uint length_bits, bool *over) { // depending on the sign bit. // Sign extend to 64 bits. // Return the sum and the overflow. -static int64_t int_sub(int64_t x, int64_t y, uint length_bits, bool *over) __attribute__((unused)); +TOKUDB_UNUSED(static int64_t int_sub( + int64_t x, + int64_t y, + uint length_bits, + bool* over)); static int64_t int_sub(int64_t x, int64_t y, uint length_bits, bool *over) { int64_t mask = uint_mask(length_bits); int64_t n = (x - y) & mask; diff --git a/storage/tokudb/tokudb_memory.h b/storage/tokudb/tokudb_memory.h new file mode 100644 index 00000000000..2687c1cda8e --- /dev/null +++ b/storage/tokudb/tokudb_memory.h @@ -0,0 +1,102 @@ +/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ +// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4: +/* -*- mode: C; c-basic-offset: 4 -*- */ +#ident "$Id$" +/*====== +This file is part of TokuDB + + +Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. + + TokuDBis is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License, version 2, + as published by the Free Software Foundation. + + TokuDB is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with TokuDB. If not, see . + +======= */ + +#ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." + +#ifndef _TOKUDB_MEMORY_H +#define _TOKUDB_MEMORY_H + +#include "hatoku_defines.h" + +namespace tokudb { +namespace memory { + +void* malloc(size_t s, myf flags); +void* realloc(void* p, size_t s, myf flags); +void free(void* ptr); +char* strdup(const char* p, myf flags); +void* multi_malloc(myf myFlags, ...); + + +inline void* malloc(size_t s, myf flags) { +#if 50700 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50799 + return ::my_malloc(0, s, flags); +#else + return ::my_malloc(s, flags); +#endif +} +inline void* realloc(void* p, size_t s, myf flags) { + if (s == 0) + return p; +#if 50700 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50799 + return ::my_realloc(0, p, s, flags); +#else + return ::my_realloc(p, s, flags | MY_ALLOW_ZERO_PTR); +#endif +} +inline void free(void* ptr) { + if (ptr) + ::my_free(ptr); +} +inline char* strdup(const char* p, myf flags) { +#if 50700 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50799 + return ::my_strdup(0, p, flags); +#else + return ::my_strdup(p, flags); +#endif +} +inline void* multi_malloc(myf myFlags, ...) { + va_list args; + char** ptr; + char* start; + char* res; + size_t tot_length,length; + + va_start(args,myFlags); + tot_length = 0; + while ((ptr = va_arg(args, char**))) { + length = va_arg(args, uint); + tot_length += ALIGN_SIZE(length); + } + va_end(args); + + if (!(start = (char*)malloc(tot_length, myFlags))) { + return 0; + } + + va_start(args, myFlags); + res = start; + while ((ptr = va_arg(args, char**))) { + *ptr = res; + length = va_arg(args,uint); + res += ALIGN_SIZE(length); + } + va_end(args); + return start; +} + +} // namespace thread +} // namespace tokudb + +#endif // _TOKUDB_MEMORY_H diff --git a/storage/tokudb/tokudb_status.h b/storage/tokudb/tokudb_status.h index 4600e04596f..5cca54e52c9 100644 --- a/storage/tokudb/tokudb_status.h +++ b/storage/tokudb/tokudb_status.h @@ -43,118 +43,374 @@ typedef ulonglong HA_METADATA_KEY; #define status_dict_pagesize 1024 namespace tokudb { +namespace metadata { - // get the value for a given key in the status dictionary. copy the value to the supplied buffer. - // returns 0 if successful. - int get_status(DB *status_db, DB_TXN *txn, HA_METADATA_KEY k, void *p, size_t s, size_t *sp) { - DBT key = {}; key.data = &k; key.size = sizeof k; - DBT val = {}; val.data = p; val.ulen = (uint32_t) s; val.flags = DB_DBT_USERMEM; - int error = status_db->get(status_db, txn, &key, &val, 0); - if (error == 0) { - *sp = val.size; - } - return error; - } - - // get the value for a given key in the status dictionary. put the value in a realloced buffer. - // returns 0 if successful. - int get_status_realloc(DB *status_db, DB_TXN *txn, HA_METADATA_KEY k, void **pp, size_t *sp) { - DBT key = {}; key.data = &k; key.size = sizeof k; - DBT val = {}; val.data = *pp; val.size = (uint32_t) *sp; val.flags = DB_DBT_REALLOC; - int error = status_db->get(status_db, txn, &key, &val, 0); - if (error == 0) { - *pp = val.data; - *sp = val.size; - } - return error; - } - - // write a key value pair into the status dictionary, overwriting the previous value if any. - // auto create a txn if necessary. - // returns 0 if successful. - int write_metadata(DB *status_db, void *key_data, uint key_size, void* val_data, uint val_size, DB_TXN *txn) { - DBT key = {}; key.data = key_data; key.size = key_size; - DBT value = {}; value.data = val_data; value.size = val_size; - int error = status_db->put(status_db, txn, &key, &value, 0); - return error; - } - - // write a key value pair into the status dictionary, overwriting the previous value if any. - // the key must be a HA_METADATA_KEY. - // returns 0 if successful. - int write_to_status(DB *status_db, HA_METADATA_KEY curr_key_data, void *val, size_t val_size, DB_TXN *txn) { - return write_metadata(status_db, &curr_key_data, sizeof curr_key_data, val, val_size, txn); - } - - // remove a key from the status dictionary. - // auto create a txn if necessary. - // returns 0 if successful. - int remove_metadata(DB *status_db, void *key_data, uint key_size, DB_TXN *txn) { - DBT key = {}; key.data = key_data; key.size = key_size; - int error = status_db->del(status_db, txn, &key, DB_DELETE_ANY); - return error; - } - - // remove a key from the status dictionary. - // the key must be a HA_METADATA_KEY - // returns 0 if successful. - int remove_from_status(DB *status_db, HA_METADATA_KEY curr_key_data, DB_TXN *txn) { - return remove_metadata(status_db, &curr_key_data, sizeof curr_key_data, txn); - } - - int close_status(DB **status_db_ptr) { - int error = 0; - DB *status_db = *status_db_ptr; - if (status_db) { - error = status_db->close(status_db, 0); - if (error == 0) - *status_db_ptr = NULL; - } - return error; - } - - int create_status(DB_ENV *env, DB **status_db_ptr, const char *name, DB_TXN *txn) { - int error; - DB *status_db = NULL; - - error = db_create(&status_db, env, 0); - if (error == 0) { - error = status_db->set_pagesize(status_db, status_dict_pagesize); - } - if (error == 0) { - error = status_db->open(status_db, txn, name, NULL, DB_BTREE, DB_CREATE | DB_EXCL, 0); - } - if (error == 0) { - *status_db_ptr = status_db; - } else { - int r = close_status(&status_db); - assert(r == 0); - } - return error; - } - - int open_status(DB_ENV *env, DB **status_db_ptr, const char *name, DB_TXN *txn) { - int error = 0; - DB *status_db = NULL; - error = db_create(&status_db, env, 0); - if (error == 0) { - error = status_db->open(status_db, txn, name, NULL, DB_BTREE, DB_THREAD, 0); - } - if (error == 0) { - uint32_t pagesize = 0; - error = status_db->get_pagesize(status_db, &pagesize); - if (error == 0 && pagesize > status_dict_pagesize) { - error = status_db->change_pagesize(status_db, status_dict_pagesize); - } - } - if (error == 0) { - *status_db_ptr = status_db; - } else { - int r = close_status(&status_db); - assert(r == 0); - } - return error; +// get the value for a given key in the status dictionary. +// copy the value to the supplied buffer. +// returns 0 if successful. +int read( + DB* status_db, + DB_TXN* txn, + HA_METADATA_KEY k, + void* p, + size_t s, + size_t* sp) { + + DBT key = {}; + key.data = &k; + key.size = sizeof(k); + DBT val = {}; + val.data = p; + val.ulen = (uint32_t)s; + val.flags = DB_DBT_USERMEM; + int error = status_db->get(status_db, txn, &key, &val, 0); + if (error == 0) { + *sp = val.size; } + return error; } +// get the value for a given key in the status dictionary. +// put the value in a realloced buffer. +// returns 0 if successful. +int read_realloc( + DB* status_db, + DB_TXN* txn, + HA_METADATA_KEY k, + void** pp, + size_t* sp) { + + DBT key = {}; + key.data = &k; + key.size = sizeof(k); + DBT val = {}; + val.data = *pp; + val.size = (uint32_t)*sp; + val.flags = DB_DBT_REALLOC; + int error = status_db->get(status_db, txn, &key, &val, 0); + if (error == 0) { + *pp = val.data; + *sp = val.size; + } + return error; +} + +// write a key value pair into the status dictionary, +// overwriting the previous value if any. +// auto create a txn if necessary. +// returns 0 if successful. +int write_low( + DB* status_db, + void* key_data, + uint key_size, + void* val_data, + uint val_size, + DB_TXN *txn) { + + DBT key = {}; + key.data = key_data; + key.size = key_size; + DBT value = {}; + value.data = val_data; + value.size = val_size; + int error = status_db->put(status_db, txn, &key, &value, 0); + return error; +} + +// write a key value pair into the status dictionary, +// overwriting the previous value if any. +// the key must be a HA_METADATA_KEY. +// returns 0 if successful. +int write( + DB* status_db, + HA_METADATA_KEY curr_key_data, + void* val, + size_t val_size, + DB_TXN* txn) { + + return + tokudb::metadata::write_low( + status_db, + &curr_key_data, + sizeof(curr_key_data), + val, + val_size, + txn); +} + +// remove a key from the status dictionary. +// auto create a txn if necessary. +// returns 0 if successful. +int remove_low( + DB* status_db, + void* key_data, + uint key_size, + DB_TXN* txn) { + + DBT key = {}; + key.data = key_data; + key.size = key_size; + int error = status_db->del(status_db, txn, &key, DB_DELETE_ANY); + return error; +} + +// remove a key from the status dictionary. +// the key must be a HA_METADATA_KEY +// returns 0 if successful. +int remove( + DB* status_db, + HA_METADATA_KEY curr_key_data, + DB_TXN* txn) { + return + tokudb::metadata::remove_low( + status_db, + &curr_key_data, + sizeof(curr_key_data), + txn); +} + +int close(DB** status_db_ptr) { + int error = 0; + DB* status_db = *status_db_ptr; + if (status_db) { + error = status_db->close(status_db, 0); + if (error == 0) + *status_db_ptr = NULL; + } + return error; +} + +int create( + DB_ENV* env, + DB** status_db_ptr, + const char* name, + DB_TXN* txn) { + + int error; + DB *status_db = NULL; + + error = db_create(&status_db, env, 0); + if (error == 0) { + error = status_db->set_pagesize(status_db, status_dict_pagesize); + } + if (error == 0) { + error = + status_db->open( + status_db, + txn, + name, + NULL, + DB_BTREE, DB_CREATE | DB_EXCL, + 0); + } + if (error == 0) { + *status_db_ptr = status_db; + } else { + int r = tokudb::metadata::close(&status_db); + assert_always(r == 0); + } + return error; +} + +int open( + DB_ENV* env, + DB** status_db_ptr, + const char* name, + DB_TXN* txn) { + + int error = 0; + DB* status_db = NULL; + error = db_create(&status_db, env, 0); + if (error == 0) { + error = + status_db->open( + status_db, + txn, + name, + NULL, + DB_BTREE, + DB_THREAD, + 0); + } + if (error == 0) { + uint32_t pagesize = 0; + error = status_db->get_pagesize(status_db, &pagesize); + if (error == 0 && pagesize > status_dict_pagesize) { + error = + status_db->change_pagesize(status_db, status_dict_pagesize); + } + } + if (error == 0) { + *status_db_ptr = status_db; + } else { + int r = tokudb::metadata::close(&status_db); + assert_always(r == 0); + } + return error; +} + +int strip_frm_data(DB_ENV* env) { + int r; + DB_TXN* txn = NULL; + + fprintf(stderr, "TokuDB strip_frm_data : Beginning stripping process.\n"); + + r = db_env->txn_begin(env, NULL, &txn, 0); + assert_always(r == 0); + + DBC* c = NULL; + r = env->get_cursor_for_directory(env, txn, &c); + assert_always(r == 0); + + DBT key = { }; + key.flags = DB_DBT_REALLOC; + + DBT val = { }; + val.flags = DB_DBT_REALLOC; + while (1) { + r = c->c_get(c, &key, &val, DB_NEXT); + if (r == DB_NOTFOUND) + break; + const char* dname = (const char*) key.data; + const char* iname = (const char*) val.data; + assert_always(r == 0); + + if (strstr(iname, "_status_")) { + fprintf( + stderr, + "TokuDB strip_frm_data : stripping from dname=%s iname=%s\n", + dname, + iname); + + DB* status_db; + r = tokudb::metadata::open(db_env, &status_db, dname, txn); + if (r != 0) { + fprintf( + stderr, + "TokuDB strip_frm_data : unable to open status file %s, " + "error = %d\n", + dname, + r); + continue; + } + + // GOL : this is a godawful hack. The inventors of this did not + // think it would be a good idea to use some kind of magic + // identifier k/v pair so that you can in fact tell a proper status + // file from any other file that might have the string _status_ in + // it. Out in ha_tokudb::create, when the status file is initially + // created, it is immediately populated with: + // uint hatoku_new_version=HA_TOKU_VERSION=4 and + // uint hatoku_capabilities=HA_TOKU_CAP=0 + // Since I can't count on the fact that these values are/were + // _always_ 4 and 0, I can count on the fact that they _must_ be + // there and the _must_ be sizeof(uint). That will at least give us + // a much better idea that these are in fact status files. + void* p = NULL; + size_t sz; + r = + tokudb::metadata::read_realloc( + status_db, + txn, + hatoku_new_version, + &p, + &sz); + if (r != 0) { + fprintf( + stderr, + "TokuDB strip_frm_data : does not look like a real TokuDB " + "status file, new_verion is missing, leaving alone %s \n", + dname); + + r = tokudb::metadata::close(&status_db); + assert_always(r == 0); + continue; + } else if (sz != sizeof(uint)) { + fprintf( + stderr, + "TokuDB strip_frm_data : does not look like a real TokuDB " + "status file, new_verion is the wrong size, " + "leaving alone %s \n", + dname); + + tokudb::memory::free(p); + r = tokudb::metadata::close(&status_db); + assert_always(r == 0); + continue; + } + tokudb::memory::free(p); + p = NULL; + + r = + tokudb::metadata::read_realloc( + status_db, + txn, + hatoku_capabilities, + &p, + &sz); + if (r != 0) { + fprintf( + stderr, + "TokuDB strip_frm_data : does not look like a real TokuDB " + "status file, capabilities is missing, leaving alone %s \n", + dname); + + r = tokudb::metadata::close(&status_db); + assert_always(r == 0); + continue; + } else if (sz != sizeof(uint)) { + fprintf( + stderr, + "TokuDB strip_frm_data : does not look like a real TokuDB " + "status file, capabilities is the wrong size, " + "leaving alone %s \n", + dname); + + tokudb::memory::free(p); + r = tokudb::metadata::close(&status_db); + assert_always(r == 0); + continue; + } + tokudb::memory::free(p); + + // OK, st this point, it is probably a status file, not 100% but + // it looks like it :( + r = tokudb::metadata::remove(status_db, hatoku_frm_data, txn); + if (r != 0) { + fprintf( + stderr, + "TokuDB strip_frm_data : unable to find/strip frm data " + "from status file %s, error = %d\n", + dname, + r); + } + + r = tokudb::metadata::close(&status_db); + assert_always(r == 0); + } + } + tokudb::memory::free(key.data); + tokudb::memory::free(val.data); + + fprintf( + stderr, + "TokuDB strip_frm_data : Stripping process complete, beginning " + "commit, this may take some time.\n"); + + r = c->c_close(c); + assert_always(r == 0); + + r = txn->commit(txn, 0); + assert_always(r == 0); + + fprintf( + stderr, + "TokuDB strip_frm_data : Commit complete, resuming server init " + "process."); + + return 0; +} + +} // namespace metadata +} // namespace tokudb #endif diff --git a/storage/tokudb/tokudb_sysvars.cc b/storage/tokudb/tokudb_sysvars.cc new file mode 100644 index 00000000000..3ec7a0e1f05 --- /dev/null +++ b/storage/tokudb/tokudb_sysvars.cc @@ -0,0 +1,1149 @@ +/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ +// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4: +/* -*- mode: C; c-basic-offset: 4 -*- */ +#ident "$Id$" +/*====== +This file is part of TokuDB + + +Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. + + TokuDBis is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License, version 2, + as published by the Free Software Foundation. + + TokuDB is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with TokuDB. If not, see . + +======= */ + +#ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." + +#include "hatoku_hton.h" + +namespace tokudb { +namespace sysvars { + +//****************************************************************************** +// global variables +//****************************************************************************** +#ifdef TOKUDB_VERSION +#define tokudb_stringify_2(x) #x +#define tokudb_stringify(x) tokudb_stringify_2(x) +#define TOKUDB_VERSION_STR tokudb_stringify(TOKUDB_VERSION) +#else +#define TOKUDB_VERSION_STR NULL +#endif + +ulonglong cache_size = 0; +uint cachetable_pool_threads = 0; +int cardinality_scale_percent = 0; +my_bool checkpoint_on_flush_logs = FALSE; +uint checkpoint_pool_threads = 0; +uint checkpointing_period = 0; +ulong cleaner_iterations = 0; +ulong cleaner_period = 0; +uint client_pool_threads = 0; +my_bool compress_buffers_before_eviction = TRUE; +char* data_dir = NULL; +ulong debug = 0; +#if TOKUDB_DEBUG +// used to control background job manager +my_bool debug_pause_background_job_manager = FALSE; +#endif +my_bool directio = FALSE; +my_bool enable_partial_eviction = TRUE; +int fs_reserve_percent = 0; +uint fsync_log_period = 0; +char* log_dir = NULL; +ulonglong max_lock_memory = 0; +uint read_status_frequency = 0; +my_bool strip_frm_data = FALSE; +char* tmp_dir = NULL; +uint write_status_frequency = 0; +char* version = (char*) TOKUDB_VERSION_STR; + +// file system reserve as a percentage of total disk space +#if TOKU_INCLUDE_HANDLERTON_HANDLE_FATAL_SIGNAL +char* gdb_path = NULL; +my_bool gdb_on_fatal = FALSE; +#endif + +#if TOKUDB_CHECK_JEMALLOC +uint check_jemalloc = 0; +#endif + +static MYSQL_SYSVAR_ULONGLONG( + cache_size, + cache_size, + PLUGIN_VAR_READONLY, + "cache table size", + NULL, + NULL, + 0, + 0, + ~0ULL, + 0); + +static MYSQL_SYSVAR_UINT( + cachetable_pool_threads, + cachetable_pool_threads, + PLUGIN_VAR_READONLY, + "cachetable ops thread pool size", + NULL, + NULL, + 0, + 0, + 1024, + 0); + +static MYSQL_SYSVAR_INT( + cardinality_scale_percent, + cardinality_scale_percent, + 0, + "index cardinality scale percentage", + NULL, + NULL, + 50, + 0, + 100, + 0); + +static MYSQL_SYSVAR_BOOL( + checkpoint_on_flush_logs, + checkpoint_on_flush_logs, + 0, + "checkpoint on flush logs", + NULL, + NULL, + FALSE); + +static MYSQL_SYSVAR_UINT( + checkpoint_pool_threads, + checkpoint_pool_threads, + PLUGIN_VAR_READONLY, + "checkpoint ops thread pool size", + NULL, + NULL, + 0, + 0, + 1024, + 0); + +static void checkpointing_period_update( + THD* thd, + st_mysql_sys_var* sys_var, + void* var, + const void* save) { + + uint* cp = (uint*)var; + *cp = *(const uint*)save; + int r = db_env->checkpointing_set_period(db_env, *cp); + assert(r == 0); +} + +static MYSQL_SYSVAR_UINT( + checkpointing_period, + checkpointing_period, + 0, + "checkpointing period", + NULL, + checkpointing_period_update, + 60, + 0, + ~0U, + 0); + +static void cleaner_iterations_update( + THD* thd, + st_mysql_sys_var* sys_var, + void* var, + const void* save) { + + ulong* ci = (ulong*)var; + *ci = *(const ulong*)save; + int r = db_env->cleaner_set_iterations(db_env, *ci); + assert(r == 0); +} + +static MYSQL_SYSVAR_ULONG( + cleaner_iterations, + cleaner_iterations, + 0, + "cleaner_iterations", + NULL, + cleaner_iterations_update, + DEFAULT_TOKUDB_CLEANER_ITERATIONS, + 0, + ~0UL, + 0); + +static void cleaner_period_update( + THD* thd, + st_mysql_sys_var* sys_var, + void* var, + const void * save) { + + ulong* cp = (ulong*)var; + *cp = *(const ulong*)save; + int r = db_env->cleaner_set_period(db_env, *cp); + assert(r == 0); +} + +static MYSQL_SYSVAR_ULONG( + cleaner_period, + cleaner_period, + 0, + "cleaner_period", + NULL, + cleaner_period_update, + DEFAULT_TOKUDB_CLEANER_PERIOD, + 0, + ~0UL, + 0); + +static MYSQL_SYSVAR_UINT( + client_pool_threads, + client_pool_threads, + PLUGIN_VAR_READONLY, + "client ops thread pool size", + NULL, + NULL, + 0, + 0, + 1024, + 0); + +static MYSQL_SYSVAR_BOOL( + compress_buffers_before_eviction, + compress_buffers_before_eviction, + PLUGIN_VAR_READONLY, + "enable in-memory buffer compression before partial eviction", + NULL, + NULL, + TRUE); + +static MYSQL_SYSVAR_STR( + data_dir, + data_dir, + PLUGIN_VAR_READONLY, + "data directory", + NULL, + NULL, + NULL); + +static MYSQL_SYSVAR_ULONG( + debug, + debug, + 0, + "plugin debug mask", + NULL, + NULL, + 0, + 0, + ~0UL, + 0); + +#if TOKUDB_DEBUG +static MYSQL_SYSVAR_BOOL( + debug_pause_background_job_manager, + debug_pause_background_job_manager, + 0, + "debug : pause the background job manager", + NULL, + NULL, + FALSE); +#endif // TOKUDB_DEBUG + +static MYSQL_SYSVAR_BOOL( + directio, + directio, + PLUGIN_VAR_READONLY, "enable direct i/o ", + NULL, + NULL, + FALSE); + +static void enable_partial_eviction_update( + THD* thd, + st_mysql_sys_var* sys_var, + void* var, + const void* save) { + + my_bool* epe = (my_bool*)var; + *epe = *(const my_bool*)save; + int r = db_env->evictor_set_enable_partial_eviction(db_env, *epe); + assert(r == 0); +} + +static MYSQL_SYSVAR_BOOL( + enable_partial_eviction, + enable_partial_eviction, + 0, + "enable partial node eviction", + NULL, + enable_partial_eviction_update, + TRUE); + +static MYSQL_SYSVAR_INT( + fs_reserve_percent, + fs_reserve_percent, + PLUGIN_VAR_READONLY, + "file system space reserve (percent free required)", + NULL, + NULL, + 5, + 0, + 100, + 0); + +static void fsync_log_period_update( + THD* thd, + st_mysql_sys_var* sys_var, + void* var, + const void* save) { + + uint* flp = (uint*)var; + *flp = *(const uint*)save; + db_env->change_fsync_log_period(db_env, *flp); +} + +static MYSQL_SYSVAR_UINT( + fsync_log_period, + fsync_log_period, + 0, + "fsync log period", + NULL, + fsync_log_period_update, + 0, + 0, + ~0U, + 0); + +static MYSQL_SYSVAR_STR( + log_dir, + log_dir, + PLUGIN_VAR_READONLY, + "log directory", + NULL, + NULL, + NULL); + +static MYSQL_SYSVAR_ULONGLONG( + max_lock_memory, + max_lock_memory, + PLUGIN_VAR_READONLY, + "max memory for locks", + NULL, + NULL, + 0, + 0, + ~0ULL, + 0); + +static MYSQL_SYSVAR_UINT( + read_status_frequency, + read_status_frequency, + 0, + "frequency that show processlist updates status of reads", + NULL, + NULL, + 10000, + 0, + ~0U, + 0); + +static MYSQL_SYSVAR_BOOL( + strip_frm_data, + strip_frm_data, + PLUGIN_VAR_READONLY, + "strip .frm data from metadata file(s)", + NULL, + NULL, + FALSE); + +static MYSQL_SYSVAR_STR( + tmp_dir, + tmp_dir, + PLUGIN_VAR_READONLY, + "directory to use for temporary files", + NULL, + NULL, + NULL); + +static MYSQL_SYSVAR_STR( + version, + version, + PLUGIN_VAR_READONLY, + "plugin version", + NULL, + NULL, + NULL); + +static MYSQL_SYSVAR_UINT( + write_status_frequency, + write_status_frequency, + 0, + "frequency that show processlist updates status of writes", + NULL, + NULL, + 1000, + 0, + ~0U, + 0); + +#if TOKU_INCLUDE_HANDLERTON_HANDLE_FATAL_SIGNAL +static MYSQL_SYSVAR_STR( + gdb_path, + gdb_path, + PLUGIN_VAR_READONLY|PLUGIN_VAR_RQCMDARG, + "path to gdb for extra debug info on fatal signal", + NULL, + NULL, + "/usr/bin/gdb"); + +static MYSQL_SYSVAR_BOOL( + gdb_on_fatal, + gdb_on_fatal, + 0, + "enable gdb debug info on fatal signal", + NULL, + NULL, + true); +#endif + +#if TOKUDB_CHECK_JEMALLOC +static MYSQL_SYSVAR_UINT( + check_jemalloc, + check_jemalloc, + 0, + "check if jemalloc is linked", + NULL, + NULL, + 1, + 0, + 1, + 0); +#endif + + +//****************************************************************************** +// session variables +//****************************************************************************** +static MYSQL_THDVAR_BOOL( + alter_print_error, + 0, + "print errors for alter table operations", + NULL, + NULL, + false); + +static MYSQL_THDVAR_DOUBLE( + analyze_delete_fraction, + 0, + "fraction of rows allowed to be deleted", + NULL, + NULL, + 1.0, + 0, + 1.0, + 1); + +static MYSQL_THDVAR_BOOL( + analyze_in_background, + 0, + "dispatch ANALYZE TABLE to background job.", + NULL, + NULL, + false); + +const char* srv_analyze_mode_names[] = { + "TOKUDB_ANALYZE_STANDARD", + "TOKUDB_ANALYZE_RECOUNT_ROWS", + "TOKUDB_ANALYZE_CANCEL", + NullS +}; + +static TYPELIB tokudb_analyze_mode_typelib = { + array_elements(srv_analyze_mode_names) - 1, + "tokudb_analyze_mode_typelib", + srv_analyze_mode_names, + NULL +}; + +static MYSQL_THDVAR_ENUM(analyze_mode, + PLUGIN_VAR_RQCMDARG, + "Controls the function of ANALYZE TABLE. Possible values are: " + "TOKUDB_ANALYZE_STANDARD perform standard table analysis (default); " + "TOKUDB_ANALYZE_RECOUNT_ROWS perform logical recount of table rows;" + "TOKUDB_ANALYZE_CANCEL terminate and cancel all scheduled background jobs " + "for a table", + NULL, + NULL, + TOKUDB_ANALYZE_STANDARD, + &tokudb_analyze_mode_typelib); + +static MYSQL_THDVAR_ULONGLONG( + analyze_throttle, + 0, + "analyze throttle (keys)", + NULL, + NULL, + 0, + 0, + ~0U, + 1); + +static MYSQL_THDVAR_UINT( + analyze_time, + 0, + "analyze time (seconds)", + NULL, + NULL, + 5, + 0, + ~0U, + 1); + +static MYSQL_THDVAR_ULONGLONG( + auto_analyze, + 0, + "auto analyze threshold (percent)", + NULL, + NULL, + 0, + 0, + ~0U, + 1); + +static MYSQL_THDVAR_UINT( + block_size, + 0, + "fractal tree block size", + NULL, + NULL, + 4<<20, + 4096, + ~0U, + 1); + +static MYSQL_THDVAR_BOOL( + bulk_fetch, + PLUGIN_VAR_THDLOCAL, + "enable bulk fetch", + NULL, + NULL, + true); + +static void checkpoint_lock_update( + THD* thd, + st_mysql_sys_var* var, + void* var_ptr, + const void* save) { + + my_bool* val = (my_bool*)var_ptr; + *val= *(my_bool*)save ? true : false; + if (*val) { + tokudb_checkpoint_lock(thd); + } else { + tokudb_checkpoint_unlock(thd); + } +} + +static MYSQL_THDVAR_BOOL( + checkpoint_lock, + 0, + "checkpoint lock", + NULL, + checkpoint_lock_update, + false); + +static MYSQL_THDVAR_BOOL( + commit_sync, + PLUGIN_VAR_THDLOCAL, + "sync on txn commit", + NULL, + NULL, + true); + +static MYSQL_THDVAR_BOOL( + create_index_online, + 0, + "if on, create index done online", + NULL, + NULL, + true); + +static MYSQL_THDVAR_BOOL( + disable_hot_alter, + 0, + "if on, hot alter table is disabled", + NULL, + NULL, + false); + +static MYSQL_THDVAR_BOOL( + disable_prefetching, + 0, + "if on, prefetching disabled", + NULL, + NULL, + false); + +static MYSQL_THDVAR_BOOL( + disable_slow_alter, + 0, + "if on, alter tables that require copy are disabled", + NULL, + NULL, + false); + +static const char *tokudb_empty_scan_names[] = { + "disabled", + "lr", + "rl", + NullS +}; + +static TYPELIB tokudb_empty_scan_typelib = { + array_elements(tokudb_empty_scan_names) - 1, + "tokudb_empty_scan_typelib", + tokudb_empty_scan_names, + NULL +}; + +static MYSQL_THDVAR_ENUM( + empty_scan, + PLUGIN_VAR_OPCMDARG, + "algorithm to check if the table is empty when opened", + NULL, + NULL, + TOKUDB_EMPTY_SCAN_RL, + &tokudb_empty_scan_typelib); + +static MYSQL_THDVAR_UINT( + fanout, + 0, + "fractal tree fanout", + NULL, + NULL, + 16, + 2, + 16*1024, + 1); + +static MYSQL_THDVAR_BOOL( + hide_default_row_format, + 0, + "hide the default row format", + NULL, + NULL, + true); + +static MYSQL_THDVAR_ULONGLONG( + killed_time, + 0, + "killed time", + NULL, + NULL, + DEFAULT_TOKUDB_KILLED_TIME, + 0, + ~0ULL, + 1); + +static MYSQL_THDVAR_STR( + last_lock_timeout, + PLUGIN_VAR_MEMALLOC, + "last lock timeout", + NULL, + NULL, + NULL); + +static MYSQL_THDVAR_BOOL( + load_save_space, + 0, + "compress intermediate bulk loader files to save space", + NULL, + NULL, + true); + +static MYSQL_THDVAR_ULONGLONG( + loader_memory_size, + 0, + "loader memory size", + NULL, + NULL, + 100*1000*1000, + 0, + ~0ULL, + 1); + +static MYSQL_THDVAR_ULONGLONG( + lock_timeout, + 0, + "lock timeout", + NULL, + NULL, + DEFAULT_TOKUDB_LOCK_TIMEOUT, + 0, + ~0ULL, + 1); + +static MYSQL_THDVAR_UINT( + lock_timeout_debug, + 0, + "lock timeout debug", + NULL, + NULL, + 1, + 0, + ~0U, + 1); + +static MYSQL_THDVAR_DOUBLE( + optimize_index_fraction, + 0, + "optimize index fraction (default 1.0 all)", + NULL, + NULL, + 1.0, + 0, + 1.0, + 1); + +static MYSQL_THDVAR_STR( + optimize_index_name, + PLUGIN_VAR_THDLOCAL + PLUGIN_VAR_MEMALLOC, + "optimize index name (default all indexes)", + NULL, + NULL, + NULL); + +static MYSQL_THDVAR_ULONGLONG( + optimize_throttle, + 0, + "optimize throttle (default no throttle)", + NULL, + NULL, + 0, + 0, + ~0ULL, + 1); + +static const char* deprecated_tokudb_pk_insert_mode = + "Using tokudb_pk_insert_mode is deprecated and the " + "parameter may be removed in future releases."; +static const char* deprecated_tokudb_pk_insert_mode_zero = + "Using tokudb_pk_insert_mode=0 is deprecated and the " + "parameter may be removed in future releases. " + "Only tokudb_pk_insert_mode=1|2 is allowed." + "Resettig the value to 1."; + +static void pk_insert_mode_update( + THD* thd, + st_mysql_sys_var* var, + void* var_ptr, + const void* save) { + const uint* new_pk_insert_mode = static_cast(save); + uint* pk_insert_mode = static_cast(var_ptr); + if (*new_pk_insert_mode == 0) { + push_warning( + thd, + Sql_condition::WARN_LEVEL_WARN, + HA_ERR_WRONG_COMMAND, + deprecated_tokudb_pk_insert_mode_zero); + *pk_insert_mode = 1; + } else { + push_warning( + thd, + Sql_condition::WARN_LEVEL_WARN, + HA_ERR_WRONG_COMMAND, + deprecated_tokudb_pk_insert_mode); + *pk_insert_mode = *new_pk_insert_mode; + } +} + +static MYSQL_THDVAR_UINT( + pk_insert_mode, + 0, + "set the primary key insert mode", + NULL, + pk_insert_mode_update, + 1, + 0, + 2, + 1); + +static MYSQL_THDVAR_BOOL( + prelock_empty, + 0, + "prelock empty table", + NULL, + NULL, + true); + +static MYSQL_THDVAR_UINT( + read_block_size, + 0, + "fractal tree read block size", + NULL, + NULL, + 64*1024, + 4096, + ~0U, + 1); + +static MYSQL_THDVAR_UINT( + read_buf_size, + 0, + "range query read buffer size", + NULL, + NULL, + 128*1024, + 0, + 1*1024*1024, + 1); + +static const char *tokudb_row_format_names[] = { + "tokudb_uncompressed", + "tokudb_zlib", + "tokudb_snappy", + "tokudb_quicklz", + "tokudb_lzma", + "tokudb_fast", + "tokudb_small", + "tokudb_default", + NullS +}; + +static TYPELIB tokudb_row_format_typelib = { + array_elements(tokudb_row_format_names) - 1, + "tokudb_row_format_typelib", + tokudb_row_format_names, + NULL +}; + +static MYSQL_THDVAR_ENUM( + row_format, + PLUGIN_VAR_OPCMDARG, + "Specifies the compression method for a table created during this session. " + "Possible values are TOKUDB_UNCOMPRESSED, TOKUDB_ZLIB, TOKUDB_SNAPPY, " + "TOKUDB_QUICKLZ, TOKUDB_LZMA, TOKUDB_FAST, TOKUDB_SMALL and TOKUDB_DEFAULT", + NULL, + NULL, + SRV_ROW_FORMAT_ZLIB, + &tokudb_row_format_typelib); + +static MYSQL_THDVAR_BOOL( + rpl_check_readonly, + PLUGIN_VAR_THDLOCAL, + "check if the slave is read only", + NULL, + NULL, + true); + +static MYSQL_THDVAR_BOOL( + rpl_lookup_rows, + PLUGIN_VAR_THDLOCAL, + "lookup a row on rpl slave", + NULL, + NULL, + true); + +static MYSQL_THDVAR_ULONGLONG( + rpl_lookup_rows_delay, + PLUGIN_VAR_THDLOCAL, + "time in milliseconds to add to lookups on replication slave", + NULL, + NULL, + 0, + 0, + ~0ULL, + 1); + +static MYSQL_THDVAR_BOOL( + rpl_unique_checks, + PLUGIN_VAR_THDLOCAL, + "enable unique checks on replication slave", + NULL, + NULL, + true); + +static MYSQL_THDVAR_ULONGLONG( + rpl_unique_checks_delay, + PLUGIN_VAR_THDLOCAL, + "time in milliseconds to add to unique checks test on replication slave", + NULL, + NULL, + 0, + 0, + ~0ULL, + 1); + +#if TOKU_INCLUDE_UPSERT +static MYSQL_THDVAR_BOOL( + disable_slow_update, + PLUGIN_VAR_THDLOCAL, + "disable slow update", + NULL, + NULL, + false); + +static MYSQL_THDVAR_BOOL( + disable_slow_upsert, + PLUGIN_VAR_THDLOCAL, + "disable slow upsert", + NULL, + NULL, + false); +#endif + +#if TOKU_INCLUDE_XA +static MYSQL_THDVAR_BOOL( + support_xa, + PLUGIN_VAR_OPCMDARG, + "Enable TokuDB support for the XA two-phase commit", + NULL, + NULL, + true); +#endif + + + +//****************************************************************************** +// all system variables +//****************************************************************************** +st_mysql_sys_var* system_variables[] = { + // global vars + MYSQL_SYSVAR(cache_size), + MYSQL_SYSVAR(checkpoint_on_flush_logs), + MYSQL_SYSVAR(cachetable_pool_threads), + MYSQL_SYSVAR(cardinality_scale_percent), + MYSQL_SYSVAR(checkpoint_pool_threads), + MYSQL_SYSVAR(checkpointing_period), + MYSQL_SYSVAR(cleaner_iterations), + MYSQL_SYSVAR(cleaner_period), + MYSQL_SYSVAR(client_pool_threads), + MYSQL_SYSVAR(compress_buffers_before_eviction), + MYSQL_SYSVAR(data_dir), + MYSQL_SYSVAR(debug), + MYSQL_SYSVAR(directio), + MYSQL_SYSVAR(enable_partial_eviction), + MYSQL_SYSVAR(fs_reserve_percent), + MYSQL_SYSVAR(fsync_log_period), + MYSQL_SYSVAR(log_dir), + MYSQL_SYSVAR(max_lock_memory), + MYSQL_SYSVAR(read_status_frequency), + MYSQL_SYSVAR(strip_frm_data), + MYSQL_SYSVAR(tmp_dir), + MYSQL_SYSVAR(version), + MYSQL_SYSVAR(write_status_frequency), + +#if TOKU_INCLUDE_HANDLERTON_HANDLE_FATAL_SIGNAL + MYSQL_SYSVAR(gdb_path), + MYSQL_SYSVAR(gdb_on_fatal), +#endif + +#if TOKUDB_CHECK_JEMALLOC + MYSQL_SYSVAR(check_jemalloc), +#endif + + // session vars + MYSQL_SYSVAR(alter_print_error), + MYSQL_SYSVAR(analyze_delete_fraction), + MYSQL_SYSVAR(analyze_in_background), + MYSQL_SYSVAR(analyze_mode), + MYSQL_SYSVAR(analyze_throttle), + MYSQL_SYSVAR(analyze_time), + MYSQL_SYSVAR(auto_analyze), + MYSQL_SYSVAR(block_size), + MYSQL_SYSVAR(bulk_fetch), + MYSQL_SYSVAR(checkpoint_lock), + MYSQL_SYSVAR(commit_sync), + MYSQL_SYSVAR(create_index_online), + MYSQL_SYSVAR(disable_hot_alter), + MYSQL_SYSVAR(disable_prefetching), + MYSQL_SYSVAR(disable_slow_alter), + MYSQL_SYSVAR(empty_scan), + MYSQL_SYSVAR(fanout), + MYSQL_SYSVAR(hide_default_row_format), + MYSQL_SYSVAR(killed_time), + MYSQL_SYSVAR(last_lock_timeout), + MYSQL_SYSVAR(load_save_space), + MYSQL_SYSVAR(loader_memory_size), + MYSQL_SYSVAR(lock_timeout), + MYSQL_SYSVAR(lock_timeout_debug), + MYSQL_SYSVAR(optimize_index_fraction), + MYSQL_SYSVAR(optimize_index_name), + MYSQL_SYSVAR(optimize_throttle), + MYSQL_SYSVAR(pk_insert_mode), + MYSQL_SYSVAR(prelock_empty), + MYSQL_SYSVAR(read_block_size), + MYSQL_SYSVAR(read_buf_size), + MYSQL_SYSVAR(row_format), + MYSQL_SYSVAR(rpl_check_readonly), + MYSQL_SYSVAR(rpl_lookup_rows), + MYSQL_SYSVAR(rpl_lookup_rows_delay), + MYSQL_SYSVAR(rpl_unique_checks), + MYSQL_SYSVAR(rpl_unique_checks_delay), + +#if TOKU_INCLUDE_UPSERT + MYSQL_SYSVAR(disable_slow_update), + MYSQL_SYSVAR(disable_slow_upsert), +#endif + +#if TOKU_INCLUDE_XA + MYSQL_SYSVAR(support_xa), +#endif + +#if TOKUDB_DEBUG + MYSQL_SYSVAR(debug_pause_background_job_manager), +#endif // TOKUDB_DEBUG + + NULL +}; + +my_bool alter_print_error(THD* thd) { + return (THDVAR(thd, alter_print_error) != 0); +} +double analyze_delete_fraction(THD* thd) { + return THDVAR(thd, analyze_delete_fraction); +} +my_bool analyze_in_background(THD* thd) { + return (THDVAR(thd, analyze_in_background) != 0); +} +analyze_mode_t analyze_mode(THD* thd) { + return (analyze_mode_t ) THDVAR(thd, analyze_mode); +} +ulonglong analyze_throttle(THD* thd) { + return THDVAR(thd, analyze_throttle); +} +ulonglong analyze_time(THD* thd) { + return THDVAR(thd, analyze_time); +} +ulonglong auto_analyze(THD* thd) { + return THDVAR(thd, auto_analyze); +} +my_bool bulk_fetch(THD* thd) { + return (THDVAR(thd, bulk_fetch) != 0); +} +uint block_size(THD* thd) { + return THDVAR(thd, block_size); +} +my_bool commit_sync(THD* thd) { + return (THDVAR(thd, commit_sync) != 0); +} +my_bool create_index_online(THD* thd) { + return (THDVAR(thd, create_index_online) != 0); +} +my_bool disable_hot_alter(THD* thd) { + return (THDVAR(thd, disable_hot_alter) != 0); +} +my_bool disable_prefetching(THD* thd) { + return (THDVAR(thd, disable_prefetching) != 0); +} +my_bool disable_slow_alter(THD* thd) { + return (THDVAR(thd, disable_slow_alter) != 0); +} +#if TOKU_INCLUDE_UPSERT +my_bool disable_slow_update(THD* thd) { + return (THDVAR(thd, disable_slow_update) != 0); +} +my_bool disable_slow_upsert(THD* thd) { + return (THDVAR(thd, disable_slow_upsert) != 0); +} +#endif +empty_scan_mode_t empty_scan(THD* thd) { + return (empty_scan_mode_t)THDVAR(thd, empty_scan); +} +uint fanout(THD* thd) { + return THDVAR(thd, fanout); +} +my_bool hide_default_row_format(THD* thd) { + return (THDVAR(thd, hide_default_row_format) != 0); +} +ulonglong killed_time(THD* thd) { + return THDVAR(thd, killed_time); +} +char* last_lock_timeout(THD* thd) { + return THDVAR(thd, last_lock_timeout); +} +void set_last_lock_timeout(THD* thd, char* last) { + THDVAR(thd, last_lock_timeout) = last; +} +my_bool load_save_space(THD* thd) { + return (THDVAR(thd, load_save_space) != 0); +} +ulonglong loader_memory_size(THD* thd) { + return THDVAR(thd, loader_memory_size); +} +ulonglong lock_timeout(THD* thd) { + return THDVAR(thd, lock_timeout); +} +uint lock_timeout_debug(THD* thd) { + return THDVAR(thd, lock_timeout_debug); +} +double optimize_index_fraction(THD* thd) { + return THDVAR(thd, optimize_index_fraction); +} +const char* optimize_index_name(THD* thd) { + return THDVAR(thd, optimize_index_name); +} +ulonglong optimize_throttle(THD* thd) { + return THDVAR(thd, optimize_throttle); +} +uint pk_insert_mode(THD* thd) { + return THDVAR(thd, pk_insert_mode); +} +void set_pk_insert_mode(THD* thd, uint mode) { + THDVAR(thd, pk_insert_mode) = mode; +} +my_bool prelock_empty(THD* thd) { + return (THDVAR(thd, prelock_empty) != 0); +} +uint read_block_size(THD* thd) { + return THDVAR(thd, read_block_size); +} +uint read_buf_size(THD* thd) { + return THDVAR(thd, read_buf_size); +} +row_format_t row_format(THD *thd) { + return (row_format_t) THDVAR(thd, row_format); +} +my_bool rpl_check_readonly(THD* thd) { + return (THDVAR(thd, rpl_check_readonly) != 0); +} +my_bool rpl_lookup_rows(THD* thd) { + return (THDVAR(thd, rpl_lookup_rows) != 0); +} +ulonglong rpl_lookup_rows_delay(THD* thd) { + return THDVAR(thd, rpl_lookup_rows_delay); +} +my_bool rpl_unique_checks(THD* thd) { + return (THDVAR(thd, rpl_unique_checks) != 0); +} +ulonglong rpl_unique_checks_delay(THD* thd) { + return THDVAR(thd, rpl_unique_checks_delay); +} +my_bool support_xa(THD* thd) { + return (THDVAR(thd, support_xa) != 0); +} + +#if TOKU_INCLUDE_OPTION_STRUCTS +ha_create_table_option tokudb_table_options[] = { + HA_TOPTION_SYSVAR("compression", row_format, row_format), + HA_TOPTION_END +}; + +ha_create_table_option tokudb_index_options[] = { + HA_IOPTION_BOOL("clustering", clustering, 0), + HA_IOPTION_END +}; +#endif + +} // namespace sysvars +} // namespace tokudb diff --git a/storage/tokudb/tokudb_sysvars.h b/storage/tokudb/tokudb_sysvars.h new file mode 100644 index 00000000000..b67cf8aa0e2 --- /dev/null +++ b/storage/tokudb/tokudb_sysvars.h @@ -0,0 +1,173 @@ +/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ +// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4: +#ident "$Id$" +/*====== +This file is part of TokuDB + + +Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. + + TokuDBis is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License, version 2, + as published by the Free Software Foundation. + + TokuDB is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with TokuDB. If not, see . + +======= */ + +#ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." + +#ifndef _TOKUDB_SYSVARS_H +#define _TOKUDB_SYSVARS_H + +#if TOKU_INCLUDE_OPTION_STRUCTS +struct ha_table_option_struct { + uint row_format; +}; + +struct ha_index_option_struct { + bool clustering; +}; + +static inline bool key_is_clustering(const KEY *key) { + return (key->flags & HA_CLUSTERING) || (key->option_struct && key->option_struct->clustering); +} + +#else + +static inline bool key_is_clustering(const KEY *key) { + return key->flags & HA_CLUSTERING; +} +#endif + +namespace tokudb { +namespace sysvars { + +enum analyze_mode_t { + TOKUDB_ANALYZE_STANDARD = 0, + TOKUDB_ANALYZE_RECOUNT_ROWS = 1, + TOKUDB_ANALYZE_CANCEL = 2 +}; + +enum empty_scan_mode_t { + TOKUDB_EMPTY_SCAN_DISABLED = 0, + TOKUDB_EMPTY_SCAN_LR = 1, + TOKUDB_EMPTY_SCAN_RL = 2, +}; + +enum row_format_t { + SRV_ROW_FORMAT_UNCOMPRESSED = 0, + SRV_ROW_FORMAT_ZLIB = 1, + SRV_ROW_FORMAT_SNAPPY = 2, + SRV_ROW_FORMAT_QUICKLZ = 3, + SRV_ROW_FORMAT_LZMA = 4, + SRV_ROW_FORMAT_FAST = 5, + SRV_ROW_FORMAT_SMALL = 6, + SRV_ROW_FORMAT_DEFAULT = 7 +}; + +#define DEFAULT_TOKUDB_CLEANER_ITERATIONS 5 +#define DEFAULT_TOKUDB_CLEANER_PERIOD 1 +#define DEFAULT_TOKUDB_KILLED_TIME 4000 // milliseconds +#define DEFAULT_TOKUDB_LOCK_TIMEOUT 4000 // milliseconds + + +// globals +extern ulonglong cache_size; +extern uint cachetable_pool_threads; +extern int cardinality_scale_percent; +extern my_bool checkpoint_on_flush_logs; +extern uint checkpoint_pool_threads; +extern uint checkpointing_period; +extern ulong cleaner_iterations; +extern ulong cleaner_period; +extern uint client_pool_threads; +extern my_bool compress_buffers_before_eviction; +extern char* data_dir; +extern ulong debug; +extern my_bool directio; +extern my_bool enable_partial_eviction; +extern int fs_reserve_percent; +extern uint fsync_log_period; +extern char* log_dir; +extern ulonglong max_lock_memory; +extern uint read_status_frequency; +extern my_bool strip_frm_data; +extern char* tmp_dir; +extern uint write_status_frequency; +extern char* version; + +#if TOKU_INCLUDE_HANDLERTON_HANDLE_FATAL_SIGNAL +extern char* gdb_path; +extern my_bool gdb_on_fatal; +#endif + +#if TOKUDB_CHECK_JEMALLOC +extern uint check_jemalloc; +#endif + +#if TOKUDB_DEBUG +// used to control background job manager +extern my_bool debug_pause_background_job_manager; +#endif // TOKUDB_DEBUG + +// session/thread +my_bool alter_print_error(THD* thd); +double analyze_delete_fraction(THD* thd); +my_bool analyze_in_background(THD* thd); +analyze_mode_t analyze_mode(THD* thd); +ulonglong analyze_throttle(THD* thd); +ulonglong analyze_time(THD* thd); +ulonglong auto_analyze(THD* thd); +uint block_size(THD* thd); +my_bool bulk_fetch(THD* thd); +my_bool commit_sync(THD* thd); +my_bool create_index_online(THD* thd); +my_bool disable_hot_alter(THD* thd); +my_bool disable_prefetching(THD* thd); +my_bool disable_slow_alter(THD* thd); +my_bool disable_slow_update(THD* thd); +my_bool disable_slow_upsert(THD* thd); +empty_scan_mode_t empty_scan(THD* thd); +uint fanout(THD* thd); +my_bool hide_default_row_format(THD* thd); +ulonglong killed_time(THD* thd); +my_bool load_save_space(THD* thd); +char* last_lock_timeout(THD* thd); +void set_last_lock_timeout(THD* thd, char* last); +ulonglong loader_memory_size(THD* thd); +ulonglong lock_timeout(THD* thd); +uint lock_timeout_debug(THD* thd); +double optimize_index_fraction(THD* thd); +const char* optimize_index_name(THD* thd); +ulonglong optimize_throttle(THD* thd); +uint pk_insert_mode(THD* thd); +void set_pk_insert_mode(THD* thd, uint mode); +my_bool prelock_empty(THD* thd); +uint read_block_size(THD* thd); +uint read_buf_size(THD* thd); +row_format_t row_format(THD *thd); +my_bool rpl_check_readonly(THD* thd); +my_bool rpl_lookup_rows(THD* thd); +ulonglong rpl_lookup_rows_delay(THD* thd); +my_bool rpl_unique_checks(THD* thd); +ulonglong rpl_unique_checks_delay(THD* thd); +my_bool support_xa(THD* thd); + +extern st_mysql_sys_var* system_variables[]; + +#if TOKU_INCLUDE_OPTION_STRUCTS +extern ha_create_table_option tokudb_table_options[]; +extern ha_create_table_option tokudb_index_options[]; +#endif + +} // namespace sysvars +} // namespace tokudb + +#endif // _TOKUDB_SYSVARS_H diff --git a/storage/tokudb/tokudb_thread.cc b/storage/tokudb/tokudb_thread.cc new file mode 100644 index 00000000000..f27e803a065 --- /dev/null +++ b/storage/tokudb/tokudb_thread.cc @@ -0,0 +1,35 @@ +/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ +// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4: +/* -*- mode: C; c-basic-offset: 4 -*- */ +#ident "$Id$" +/*====== +This file is part of TokuDB + + +Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. + + TokuDBis is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License, version 2, + as published by the Free Software Foundation. + + TokuDB is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with TokuDB. If not, see . + +======= */ + +#ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." + +#include "tokudb_thread.h" + +namespace tokudb { +namespace thread { + +pthread_t mutex_t::_null_owner = 0; + +} // namespace thread +} // namespace tokudb diff --git a/storage/tokudb/tokudb_thread.h b/storage/tokudb/tokudb_thread.h new file mode 100644 index 00000000000..dcb1fd6ec63 --- /dev/null +++ b/storage/tokudb/tokudb_thread.h @@ -0,0 +1,597 @@ +/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ +// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4: +/* -*- mode: C; c-basic-offset: 4 -*- */ +#ident "$Id$" +/*====== +This file is part of TokuDB + + +Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. + + TokuDBis is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License, version 2, + as published by the Free Software Foundation. + + TokuDB is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with TokuDB. If not, see . + +======= */ + +#ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." + +#ifndef _TOKUDB_SYNC_H +#define _TOKUDB_SYNC_H + +#include "hatoku_defines.h" +#include "tokudb_debug.h" +#include "tokudb_time.h" + +namespace tokudb { +namespace thread { + +#if (defined(__MACH__) || defined(__APPLE__)) && _POSIX_TIMERS <= 0 + +#define _x_min(a, b) ((a) < (b) ? (a) : (b)) + +#define timed_lock_define(timed_func_name, lock_type_name, lock_func_name) \ +inline int timed_func_name(lock_type_name *mutex, \ + const struct timespec *abs_timeout) { \ + int pthread_rc; \ + struct timespec remaining, slept, ts; \ + static const int sleep_step = 1000000; \ + \ + remaining = *abs_timeout; \ + while ((pthread_rc = lock_func_name(mutex)) == EBUSY) { \ + ts.tv_sec = 0; \ + ts.tv_nsec = (remaining.tv_sec > 0 ? \ + sleep_step : \ + _x_min(remaining.tv_nsec,sleep_step)); \ + nanosleep(&ts, &slept); \ + ts.tv_nsec -= slept.tv_nsec; \ + if (ts.tv_nsec <= remaining.tv_nsec) { \ + remaining.tv_nsec -= ts.tv_nsec; \ + } else { \ + remaining.tv_sec--; \ + remaining.tv_nsec = \ + (sleep_step - (ts.tv_nsec - remaining.tv_nsec)); \ + } \ + if (remaining.tv_sec < 0 || \ + (!remaining.tv_sec && remaining.tv_nsec <= 0)) { \ + return ETIMEDOUT; \ + } \ + } \ + \ + return pthread_rc; \ +} + +timed_lock_define(pthread_mutex_timedlock, + pthread_mutex_t, + pthread_mutex_trylock); + +timed_lock_define(pthread_rwlock_timedrdlock, + pthread_rwlock_t, + pthread_rwlock_tryrdlock); + +timed_lock_define(pthread_rwlock_timedwrlock, + pthread_rwlock_t, + pthread_rwlock_trywrlock); + +#endif //(defined(__MACH__) || defined(__APPLE__)) && _POSIX_TIMERS <= 0 + +uint my_tid(void); + +// Your basic mutex +class mutex_t { +public: + mutex_t(void); + ~mutex_t(void); + + void lock(void); + int lock(ulonglong microseconds); + void unlock(void); +#ifdef TOKUDB_DEBUG + bool is_owned_by_me(void) const; +#endif +private: + static pthread_t _null_owner; + pthread_mutex_t _mutex; +#ifdef TOKUDB_DEBUG + uint _owners; + pthread_t _owner; +#endif +}; + +// Simple read write lock +class rwlock_t { +public: + rwlock_t(void); + ~rwlock_t(void); + + void lock_read(void); + int lock_read(ulonglong microseconds); + void lock_write(void); + int lock_write(ulonglong microseconds); + void unlock(void); + +private: + rwlock_t(const rwlock_t&); + rwlock_t& operator=(const rwlock_t&); + + pthread_rwlock_t _rwlock; +}; + +// Simple event signal/wait class +class event_t { +public: + // create_signalled - create the event in a signalled state + // manual_reset - create an event that must be manually reset + // after signaling + event_t( + bool create_signalled = false, + bool manual_reset = false); + ~event_t(void); + + // wait for the event to become signalled + void wait(void); + int wait(ulonglong microseconds); + + // signal the event + void signal(void); + + // pulse the event (signal and free exactly one waiter) + void pulse(void); + + // is the event currently signalled + bool signalled(void); + + // unsignal/clear the event + void reset(void); + +private: + event_t(const event_t&); + event_t& operator=(const event_t&); + + pthread_mutex_t _mutex; + pthread_cond_t _cond; + bool _signalled; + bool _pulsed; + bool _manual_reset; +}; + +// Semaphore signal/wait class +class semaphore_t { +public: + // initial_count - the initial signal count of the semaphore + // max_count - the maximum signal count for the semaphore. + semaphore_t(int initial_count, int max_count); + ~semaphore_t(void); + + enum E_WAIT { + E_SIGNALLED = 0, + E_INTERRUPTED = 1, + E_TIMEDOUT = 2 + }; + + // wait for the semaphore to become signalled + E_WAIT wait(void); + E_WAIT wait(ulonglong microseconds); + + // signal the semaphore to increase the count + // return true if signalled, false if ignored due to count + bool signal(void); + + // what is the semaphore signal count + int signalled(void); + + // unsignal a signalled semaphore + void reset(void); + + // set to interrupt any waiters, as long as is set, + // waiters will return immediately with E_INTERRUPTED. + // the semaphore signal count and tracking will continue + // accepting signals and leave the signalled state intact + void set_interrupt(void); + void clear_interrupt(void); + +private: + semaphore_t(const semaphore_t&); + semaphore_t& operator=(const semaphore_t&); + + pthread_mutex_t _mutex; + pthread_cond_t _cond; + bool _interrupted; + int _signalled; + int _initial_count; + int _max_count; +}; + +// Thread class +class thread_t { +public: + thread_t(void); + ~thread_t(void); + + int start(void* (*pfn)(void*), void* arg); + int join(void** value_ptr); + int detach(void); + +private: + pthread_t _thread; +}; + + +inline uint my_tid(void) { + return (uint)toku_os_gettid(); +} + + +inline mutex_t::mutex_t(void) { + #ifdef TOKUDB_DEBUG + _owners = 0; + _owner = _null_owner; + #endif + int r = pthread_mutex_init(&_mutex, MY_MUTEX_INIT_FAST); + assert_debug(r == 0); +} +inline mutex_t::~mutex_t(void) { + #ifdef TOKUDB_DEBUG + assert_debug(_owners == 0); + #endif + int r = pthread_mutex_destroy(&_mutex); + assert_debug(r == 0); +} +inline void mutex_t::lock(void) { + assert_debug(is_owned_by_me() == false); + int r = pthread_mutex_lock(&_mutex); + assert_debug(r == 0); + #ifdef TOKUDB_DEBUG + _owners++; + _owner = pthread_self(); + #endif +} +inline int mutex_t::lock(ulonglong microseconds) { + assert_debug(is_owned_by_me() == false); + timespec waittime = time::offset_timespec(microseconds); + int r = pthread_mutex_timedlock(&_mutex, &waittime); + #ifdef TOKUDB_DEBUG + if (r == 0) { + _owners++; + _owner = pthread_self(); + } + #endif + assert_debug(r == 0 || r == ETIMEDOUT); + return r; +} +inline void mutex_t::unlock(void) { + #ifdef TOKUDB_DEBUG + assert_debug(_owners > 0); + assert_debug(is_owned_by_me()); + _owners--; + _owner = _null_owner; + #endif + int r = pthread_mutex_unlock(&_mutex); + assert_debug(r == 0); +} +#ifdef TOKUDB_DEBUG +inline bool mutex_t::is_owned_by_me(void) const { + return pthread_equal(pthread_self(), _owner) != 0 ? true : false; +} +#endif + + +inline rwlock_t::rwlock_t(void) { + int r = pthread_rwlock_init(&_rwlock, NULL); + assert_debug(r == 0); +} +inline rwlock_t::~rwlock_t(void) { + int r = pthread_rwlock_destroy(&_rwlock); + assert_debug(r == 0); +} +inline void rwlock_t::lock_read(void) { + int r; + while ((r = pthread_rwlock_rdlock(&_rwlock)) != 0) { + if (r == EBUSY || r == EAGAIN) { + time::sleep_microsec(1000); + continue; + } + break; + } + assert_debug(r == 0); +} +inline int rwlock_t::lock_read(ulonglong microseconds) { + int r; + timespec waittime = time::offset_timespec(microseconds); + while ((r = pthread_rwlock_timedrdlock(&_rwlock, &waittime)) != 0) { + if (r == EBUSY || r == EAGAIN) { + time::sleep_microsec(1000); + continue; + } else if (r == ETIMEDOUT) { + return ETIMEDOUT; + } + break; + } + assert_debug(r == 0); + return r; +} +inline void rwlock_t::lock_write(void) { + int r; + while ((r = pthread_rwlock_wrlock(&_rwlock)) != 0) { + if (r == EBUSY || r == EAGAIN) { + time::sleep_microsec(1000); + continue; + } + break; + } + assert_debug(r == 0); +} +inline int rwlock_t::lock_write(ulonglong microseconds) { + int r; + timespec waittime = time::offset_timespec(microseconds); + while ((r = pthread_rwlock_timedwrlock(&_rwlock, &waittime)) != 0) { + if (r == EBUSY || r == EAGAIN) { + time::sleep_microsec(1000); + continue; + } else if (r == ETIMEDOUT) { + return ETIMEDOUT; + } + break; + } + assert_debug(r == 0); + return r; +} +inline void rwlock_t::unlock(void) { + int r = pthread_rwlock_unlock(&_rwlock); + assert_debug(r == 0); +} +inline rwlock_t::rwlock_t(const rwlock_t&) { +} +inline rwlock_t& rwlock_t::operator=(const rwlock_t&) { + return *this; +} + + +inline event_t::event_t(bool create_signalled, bool manual_reset) : + _manual_reset(manual_reset) { + + int r = pthread_mutex_init(&_mutex, NULL); + assert_debug(r == 0); + r = pthread_cond_init(&_cond, NULL); + assert_debug(r == 0); + if (create_signalled) { + _signalled = true; + } else { + _signalled = false; + } + _pulsed = false; +} +inline event_t::~event_t(void) { + int r = pthread_mutex_destroy(&_mutex); + assert_debug(r == 0); + r = pthread_cond_destroy(&_cond); + assert_debug(r == 0); +} +inline void event_t::wait(void) { + int r = pthread_mutex_lock(&_mutex); + assert_debug(r == 0); + while (_signalled == false && _pulsed == false) { + r = pthread_cond_wait(&_cond, &_mutex); + assert_debug(r == 0); + } + if (_manual_reset == false) + _signalled = false; + if (_pulsed) + _pulsed = false; + r = pthread_mutex_unlock(&_mutex); + assert_debug(r == 0); + return; +} +inline int event_t::wait(ulonglong microseconds) { + timespec waittime = time::offset_timespec(microseconds); + int r = pthread_mutex_timedlock(&_mutex, &waittime); + if (r == ETIMEDOUT) return ETIMEDOUT; + assert_debug(r == 0); + while (_signalled == false && _pulsed == false) { + r = pthread_cond_timedwait(&_cond, &_mutex, &waittime); + if (r == ETIMEDOUT) { + r = pthread_mutex_unlock(&_mutex); + assert_debug(r == 0); + return ETIMEDOUT; + } + assert_debug(r == 0); + } + if (_manual_reset == false) + _signalled = false; + if (_pulsed) + _pulsed = false; + r = pthread_mutex_unlock(&_mutex); + assert_debug(r == 0); + return 0; +} +inline void event_t::signal(void) { + int r = pthread_mutex_lock(&_mutex); + assert_debug(r == 0); + _signalled = true; + if (_manual_reset) { + r = pthread_cond_broadcast(&_cond); + assert_debug(r == 0); + } else { + r = pthread_cond_signal(&_cond); + assert_debug(r == 0); + } + r = pthread_mutex_unlock(&_mutex); + assert_debug(r == 0); +} +inline void event_t::pulse(void) { + int r = pthread_mutex_lock(&_mutex); + assert_debug(r == 0); + _pulsed = true; + r = pthread_cond_signal(&_cond); + assert_debug(r == 0); + r = pthread_mutex_unlock(&_mutex); + assert_debug(r == 0); +} +inline bool event_t::signalled(void) { + bool ret = false; + int r = pthread_mutex_lock(&_mutex); + assert_debug(r == 0); + ret = _signalled; + r = pthread_mutex_unlock(&_mutex); + assert_debug(r == 0); + return ret; +} +inline void event_t::reset(void) { + int r = pthread_mutex_lock(&_mutex); + assert_debug(r == 0); + _signalled = false; + _pulsed = false; + r = pthread_mutex_unlock(&_mutex); + assert_debug(r == 0); + return; +} +inline event_t::event_t(const event_t&) { +} +inline event_t& event_t::operator=(const event_t&) { + return *this; +} + + +inline semaphore_t::semaphore_t( + int initial_count, + int max_count) : + _interrupted(false), + _initial_count(initial_count), + _max_count(max_count) { + + int r = pthread_mutex_init(&_mutex, NULL); + assert_debug(r == 0); + r = pthread_cond_init(&_cond, NULL); + assert_debug(r == 0); + _signalled = _initial_count; +} +inline semaphore_t::~semaphore_t(void) { + int r = pthread_mutex_destroy(&_mutex); + assert_debug(r == 0); + r = pthread_cond_destroy(&_cond); + assert_debug(r == 0); +} +inline semaphore_t::E_WAIT semaphore_t::wait(void) { + E_WAIT ret; + int r = pthread_mutex_lock(&_mutex); + assert_debug(r == 0); + while (_signalled == 0 && _interrupted == false) { + r = pthread_cond_wait(&_cond, &_mutex); + assert_debug(r == 0); + } + if (_interrupted) { + ret = E_INTERRUPTED; + } else { + _signalled--; + ret = E_SIGNALLED; + } + r = pthread_mutex_unlock(&_mutex); + assert_debug(r == 0); + return ret; +} +inline semaphore_t::E_WAIT semaphore_t::wait(ulonglong microseconds) { + E_WAIT ret; + timespec waittime = time::offset_timespec(microseconds); + int r = pthread_mutex_timedlock(&_mutex, &waittime); + if (r == ETIMEDOUT) return E_TIMEDOUT; + assert_debug(r == 0); + while (_signalled == 0 && _interrupted == false) { + r = pthread_cond_timedwait(&_cond, &_mutex, &waittime); + if (r == ETIMEDOUT) { + r = pthread_mutex_unlock(&_mutex); + assert_debug(r == 0); + return E_TIMEDOUT; + } + assert_debug(r == 0); + } + if (_interrupted) { + ret = E_INTERRUPTED; + } else { + _signalled--; + ret = E_SIGNALLED; + } + r = pthread_mutex_unlock(&_mutex); + assert_debug(r == 0); + return ret; +} +inline bool semaphore_t::signal(void) { + bool ret = false; + int r = pthread_mutex_lock(&_mutex); + assert_debug(r == 0); + if (_signalled < _max_count) { + _signalled++; + ret = true; + } + r = pthread_cond_signal(&_cond); + assert_debug(r == 0); + r = pthread_mutex_unlock(&_mutex); + assert_debug(r == 0); + return ret; +} +inline int semaphore_t::signalled(void) { + int ret = 0; + int r = pthread_mutex_lock(&_mutex); + assert_debug(r == 0); + ret = _signalled; + r = pthread_mutex_unlock(&_mutex); + assert_debug(r == 0); + return ret; +} +inline void semaphore_t::reset(void) { + int r = pthread_mutex_lock(&_mutex); + assert_debug(r == 0); + _signalled = 0; + r = pthread_mutex_unlock(&_mutex); + assert_debug(r == 0); + return; +} +inline void semaphore_t::set_interrupt(void) { + int r = pthread_mutex_lock(&_mutex); + assert_debug(r == 0); + _interrupted = true; + r = pthread_cond_broadcast(&_cond); + assert_debug(r == 0); + r = pthread_mutex_unlock(&_mutex); + assert_debug(r == 0); +} +inline void semaphore_t::clear_interrupt(void) { + int r = pthread_mutex_lock(&_mutex); + assert_debug(r == 0); + _interrupted = false; + r = pthread_mutex_unlock(&_mutex); + assert_debug(r == 0); +} +inline semaphore_t::semaphore_t(const semaphore_t&) { +} +inline semaphore_t& semaphore_t::operator=(const semaphore_t&) { + return *this; +} + + +inline thread_t::thread_t(void) : _thread(0) { +} +inline thread_t::~thread_t(void) { +} +inline int thread_t::start(void*(*pfn)(void*), void* arg) { + return pthread_create(&_thread, NULL, pfn, arg); +} +inline int thread_t::join(void** value_ptr) { + return pthread_join(_thread, value_ptr); +} +inline int thread_t::detach(void) { + return pthread_detach(_thread); +} + +} // namespace thread +} // namespace tokudb + + +#endif // _TOKUDB_SYNC_H diff --git a/storage/tokudb/tokudb_time.h b/storage/tokudb/tokudb_time.h new file mode 100644 index 00000000000..12baa0de24d --- /dev/null +++ b/storage/tokudb/tokudb_time.h @@ -0,0 +1,73 @@ +/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ +// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4: +/* -*- mode: C; c-basic-offset: 4 -*- */ +#ident "$Id$" +/*====== +This file is part of TokuDB + + +Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. + + TokuDBis is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License, version 2, + as published by the Free Software Foundation. + + TokuDB is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with TokuDB. If not, see . + +======= */ + +#ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." + +#ifndef _TOKUDB_TIME_H +#define _TOKUDB_TIME_H + +#include "hatoku_defines.h" + +namespace tokudb { +namespace time { + +static const ulonglong MILLISECONDS = 1000; +static const ulonglong MICROSECONDS = 1000000; +static const ulonglong NANOSECONDS = 1000000000; + +// gets curent time of day in microseconds +ulonglong microsec(void); + +// gets a timespec in the future based on the current time and an offset forward +timespec offset_timespec(ulonglong offset); + +// sleep microseconds +void sleep_microsec(ulong tm); + + + +inline ulonglong microsec(void) { + timeval t; + gettimeofday(&t, NULL); + return t.tv_sec * (1UL * 1000 * 1000) + t.tv_usec; +} +inline timespec offset_timespec(ulonglong offset) { + timespec ret; + ulonglong tm = offset + microsec(); + ret.tv_sec = tm / MICROSECONDS; + ret.tv_nsec = (tm % MICROSECONDS) * 1000; + return ret; +} +inline void sleep_microsec(ulong tm) { + timeval t; + t.tv_sec = tm / MICROSECONDS; + t.tv_usec = tm % MICROSECONDS; + + select(0, NULL, NULL, NULL, &t); +} + +} // namespace time +} // namespace tokudb + +#endif // _TOKUDB_TIME_H diff --git a/storage/tokudb/tokudb_txn.h b/storage/tokudb/tokudb_txn.h new file mode 100644 index 00000000000..67bf591d088 --- /dev/null +++ b/storage/tokudb/tokudb_txn.h @@ -0,0 +1,155 @@ +/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ +// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4: +/* -*- mode: C; c-basic-offset: 4 -*- */ +#ident "$Id$" +/*====== +This file is part of TokuDB + + +Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. + + TokuDBis is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License, version 2, + as published by the Free Software Foundation. + + TokuDB is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with TokuDB. If not, see . + +======= */ + +#ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." + +#ifndef _TOKUDB_TXN_H +#define _TOKUDB_TXN_H + +#include "hatoku_defines.h" +#include "tokudb_debug.h" +#include "tokudb_sysvars.h" + +typedef enum { + hatoku_iso_not_set = 0, + hatoku_iso_read_uncommitted, + hatoku_iso_read_committed, + hatoku_iso_repeatable_read, + hatoku_iso_serializable +} HA_TOKU_ISO_LEVEL; + +typedef struct st_tokudb_stmt_progress { + ulonglong inserted; + ulonglong updated; + ulonglong deleted; + ulonglong queried; + bool using_loader; +} tokudb_stmt_progress; + +typedef struct st_tokudb_trx_data { + DB_TXN* all; + DB_TXN* stmt; + DB_TXN* sp_level; + DB_TXN* sub_sp_level; + uint tokudb_lock_count; + uint create_lock_count; + tokudb_stmt_progress stmt_progress; + bool checkpoint_lock_taken; + LIST* handlers; +} tokudb_trx_data; + +extern char* tokudb_data_dir; +extern const char* ha_tokudb_ext; + +inline void reset_stmt_progress(tokudb_stmt_progress* val) { + val->deleted = 0; + val->inserted = 0; + val->updated = 0; + val->queried = 0; +} + +inline int get_name_length(const char* name) { + int n = 0; + const char* newname = name; + n += strlen(newname); + n += strlen(ha_tokudb_ext); + return n; +} + +// +// returns maximum length of path to a dictionary +// +inline int get_max_dict_name_path_length(const char* tablename) { + int n = 0; + n += get_name_length(tablename); + n += 1; //for the '-' + n += MAX_DICT_NAME_LEN; + return n; +} + +inline void make_name( + char* newname, + size_t newname_len, + const char* tablename, + const char* dictname) { + + assert_always(tablename); + assert_always(dictname); + size_t real_size = snprintf( + newname, + newname_len, + "%s-%s", + tablename, + dictname); + assert_always(real_size < newname_len); +} + +inline int txn_begin( + DB_ENV* env, + DB_TXN* parent, + DB_TXN** txn, + uint32_t flags, + THD* thd) { + + *txn = NULL; + int r = env->txn_begin(env, parent, txn, flags); + if (r == 0 && thd) { + DB_TXN* this_txn = *txn; + this_txn->set_client_id(this_txn, thd_get_thread_id(thd)); + } + TOKUDB_TRACE_FOR_FLAGS( + TOKUDB_DEBUG_TXN, + "begin txn %p %p %u r=%d", + parent, + *txn, + flags, + r); + return r; +} + +inline void commit_txn(DB_TXN* txn, uint32_t flags) { + TOKUDB_TRACE_FOR_FLAGS(TOKUDB_DEBUG_TXN, "commit txn %p", txn); + int r = txn->commit(txn, flags); + if (r != 0) { + sql_print_error( + "tried committing transaction %p and got error code %d", + txn, + r); + } + assert_always(r == 0); +} + +inline void abort_txn(DB_TXN* txn) { + TOKUDB_TRACE_FOR_FLAGS(TOKUDB_DEBUG_TXN, "abort txn %p", txn); + int r = txn->abort(txn); + if (r != 0) { + sql_print_error( + "tried aborting transaction %p and got error code %d", + txn, + r); + } + assert_always(r == 0); +} + +#endif // _TOKUDB_TXN_H diff --git a/storage/tokudb/tokudb_update_fun.cc b/storage/tokudb/tokudb_update_fun.cc index 4647c91880b..05149d17317 100644 --- a/storage/tokudb/tokudb_update_fun.cc +++ b/storage/tokudb/tokudb_update_fun.cc @@ -105,7 +105,8 @@ enum { // at most, 4 0's // So, upperbound is num_blobs(1+4+1+4) = num_columns*10 -// The expand varchar offsets message is used to expand the size of an offset from 1 to 2 bytes. Not VLQ coded. +// The expand varchar offsets message is used to expand the size of an offset +// from 1 to 2 bytes. Not VLQ coded. // uint8 operation = UPDATE_OP_EXPAND_VARIABLE_OFFSETS // uint32 number of offsets // uint32 starting offset of the variable length field offsets @@ -132,8 +133,8 @@ enum { // uint8 old lengths[N] // uint8 new lengths[N] -// Update and Upsert version 1 messages. Not VLQ coded. Not used anymore, but may be in the -// fractal tree from a previous build. +// Update and Upsert version 1 messages. Not VLQ coded. Not used anymore, but +// may be in the fractal tree from a previous build. // // Field descriptor: // Operations: @@ -143,8 +144,10 @@ enum { // x = x - k // field type 4 see field types above // unused 4 unused -// field null num 4 bit 31 is 1 if the field is nullible and the remaining bits contain the null bit number -// field offset 4 for fixed fields, this is the offset from begining of the row of the field +// field null num 4 bit 31 is 1 if the field is nullible and the +// remaining bits contain the null bit number +// field offset 4 for fixed fields, this is the offset from +// begining of the row of the field // value: // value length 4 == N, length of the value // value N value to add or subtract @@ -234,7 +237,11 @@ static inline bool is_overall_null_position_set(uchar* data, uint32_t pos) { // // sets the bit at index pos in data to 1 if is_null, 0 otherwise // -static inline void set_overall_null_position(uchar* data, uint32_t pos, bool is_null) { +static inline void set_overall_null_position( + uchar* data, + uint32_t pos, + bool is_null) { + uint32_t offset = pos/8; uchar remainder = pos%8; uchar null_bit = 1<size + extra->size + new_len_of_offsets + new_fixed_field_size; - new_val_data = (uchar *)tokudb_my_malloc( - max_num_bytes, - MYF(MY_FAE) - ); - if (new_val_data == NULL) { goto cleanup; } + max_num_bytes = + old_val->size + extra->size + new_len_of_offsets + new_fixed_field_size; + new_val_data = (uchar *)tokudb::memory::malloc( + max_num_bytes, + MYF(MY_FAE)); + if (new_val_data == NULL) { + error = ENOMEM; + goto cleanup; + } old_fixed_field_ptr = (uchar *) old_val->data; old_fixed_field_ptr += old_num_null_bytes; @@ -465,7 +486,7 @@ static int tokudb_hcad_update_fun( bool is_null_default = false; extra_pos++; - assert(op_type == COL_DROP || op_type == COL_ADD); + assert_always(op_type == COL_DROP || op_type == COL_ADD); bool nullable = (extra_pos[0] != 0); extra_pos++; if (nullable) { @@ -474,11 +495,10 @@ static int tokudb_hcad_update_fun( extra_pos += sizeof(uint32_t); uint32_t num_bits; if (op_type == COL_DROP) { - assert(curr_old_null_pos <= null_bit_position); + assert_always(curr_old_null_pos <= null_bit_position); num_bits = null_bit_position - curr_old_null_pos; - } - else { - assert(curr_new_null_pos <= null_bit_position); + } else { + assert_always(curr_new_null_pos <= null_bit_position); num_bits = null_bit_position - curr_new_null_pos; } copy_null_bits( @@ -486,22 +506,19 @@ static int tokudb_hcad_update_fun( curr_new_null_pos, num_bits, old_null_bytes, - new_null_bytes - ); + new_null_bytes); // update the positions curr_new_null_pos += num_bits; curr_old_null_pos += num_bits; if (op_type == COL_DROP) { curr_old_null_pos++; // account for dropped column - } - else { + } else { is_null_default = (extra_pos[0] != 0); extra_pos++; set_overall_null_position( new_null_bytes, null_bit_position, - is_null_default - ); + is_null_default); curr_new_null_pos++; //account for added column } } @@ -518,47 +535,44 @@ static int tokudb_hcad_update_fun( if (op_type == COL_DROP) { num_bytes_to_copy = col_offset - curr_old_fixed_offset; - } - else { + } else { num_bytes_to_copy = col_offset - curr_new_fixed_offset; } memcpy( new_fixed_field_ptr + curr_new_fixed_offset, - old_fixed_field_ptr + curr_old_fixed_offset, - num_bytes_to_copy - ); + old_fixed_field_ptr + curr_old_fixed_offset, + num_bytes_to_copy); curr_old_fixed_offset += num_bytes_to_copy; curr_new_fixed_offset += num_bytes_to_copy; if (op_type == COL_DROP) { - // move old_fixed_offset val to skip OVER column that is being dropped + // move old_fixed_offset val to skip OVER column that is + // being dropped curr_old_fixed_offset += col_size; - } - else { + } else { if (is_null_default) { // copy zeroes - memset(new_fixed_field_ptr + curr_new_fixed_offset, 0, col_size); - } - else { + memset( + new_fixed_field_ptr + curr_new_fixed_offset, + 0, + col_size); + } else { // copy data from extra_pos into new row memcpy( new_fixed_field_ptr + curr_new_fixed_offset, extra_pos, - col_size - ); + col_size); extra_pos += col_size; } curr_new_fixed_offset += col_size; } - } - else if (col_type == COL_VAR) { + } else if (col_type == COL_VAR) { uint32_t var_col_index; memcpy(&var_col_index, extra_pos, sizeof(uint32_t)); extra_pos += sizeof(uint32_t); if (op_type == COL_DROP) { num_var_fields_to_copy = var_col_index - curr_old_num_var_field; - } - else { + } else { num_var_fields_to_copy = var_col_index - curr_new_num_var_field; } copy_var_fields( @@ -568,20 +582,21 @@ static int tokudb_hcad_update_fun( old_num_offset_bytes, curr_new_var_field_data_ptr, curr_new_var_field_offset_ptr, - new_var_field_data_ptr, // pointer to beginning of var fields in new row - old_var_field_data_ptr, // pointer to beginning of var fields in old row - new_num_offset_bytes, // number of offset bytes used in new row + // pointer to beginning of var fields in new row + new_var_field_data_ptr, + // pointer to beginning of var fields in old row + old_var_field_data_ptr, + // number of offset bytes used in new row + new_num_offset_bytes, &num_data_bytes_written, - &num_offset_bytes_written - ); + &num_offset_bytes_written); curr_new_var_field_data_ptr += num_data_bytes_written; curr_new_var_field_offset_ptr += num_offset_bytes_written; curr_new_num_var_field += num_var_fields_to_copy; curr_old_num_var_field += num_var_fields_to_copy; if (op_type == COL_DROP) { curr_old_num_var_field++; // skip over dropped field - } - else { + } else { if (is_null_default) { curr_new_var_field_data_ptr = write_var_field( curr_new_var_field_offset_ptr, @@ -589,11 +604,9 @@ static int tokudb_hcad_update_fun( new_var_field_data_ptr, NULL, //copying no data 0, //copying 0 bytes - new_num_offset_bytes - ); + new_num_offset_bytes); curr_new_var_field_offset_ptr += new_num_offset_bytes; - } - else { + } else { uint32_t data_length; memcpy(&data_length, extra_pos, sizeof(data_length)); extra_pos += sizeof(data_length); @@ -603,20 +616,17 @@ static int tokudb_hcad_update_fun( new_var_field_data_ptr, extra_pos, //copying data from mutator data_length, //copying data_length bytes - new_num_offset_bytes - ); + new_num_offset_bytes); extra_pos += data_length; curr_new_var_field_offset_ptr += new_num_offset_bytes; } curr_new_num_var_field++; //account for added column } - } - else if (col_type == COL_BLOB) { + } else if (col_type == COL_BLOB) { // handle blob data later continue; - } - else { - assert(false); + } else { + assert_unreachable(); } } // finish copying the null stuff @@ -629,19 +639,17 @@ static int tokudb_hcad_update_fun( curr_new_null_pos, overall_null_bits_left, old_null_bytes, - new_null_bytes - ); + new_null_bytes); // finish copying fixed field stuff num_bytes_left = old_fixed_field_size - curr_old_fixed_offset; memcpy( new_fixed_field_ptr + curr_new_fixed_offset, old_fixed_field_ptr + curr_old_fixed_offset, - num_bytes_left - ); + num_bytes_left); curr_old_fixed_offset += num_bytes_left; curr_new_fixed_offset += num_bytes_left; // sanity check - assert(curr_new_fixed_offset == new_fixed_field_size); + assert_always(curr_new_fixed_offset == new_fixed_field_size); // finish copying var field stuff num_var_fields_to_copy = old_num_var_fields - curr_old_num_var_field; @@ -652,33 +660,34 @@ static int tokudb_hcad_update_fun( old_num_offset_bytes, curr_new_var_field_data_ptr, curr_new_var_field_offset_ptr, - new_var_field_data_ptr, // pointer to beginning of var fields in new row - old_var_field_data_ptr, // pointer to beginning of var fields in old row - new_num_offset_bytes, // number of offset bytes used in new row + // pointer to beginning of var fields in new row + new_var_field_data_ptr, + // pointer to beginning of var fields in old row + old_var_field_data_ptr, + // number of offset bytes used in new row + new_num_offset_bytes, &num_data_bytes_written, - &num_offset_bytes_written - ); + &num_offset_bytes_written); curr_new_var_field_offset_ptr += num_offset_bytes_written; curr_new_var_field_data_ptr += num_data_bytes_written; // sanity check - assert(curr_new_var_field_offset_ptr == new_var_field_data_ptr); + assert_always(curr_new_var_field_offset_ptr == new_var_field_data_ptr); // start handling blobs get_blob_field_info( &start_blob_offset, old_len_of_offsets, old_var_field_data_ptr, - old_num_offset_bytes - ); + old_num_offset_bytes); start_blob_ptr = old_var_field_data_ptr + start_blob_offset; - // if nothing else in extra, then there are no blobs to add or drop, so can copy blobs straight + // if nothing else in extra, then there are no blobs to add or drop, so + // can copy blobs straight if ((extra_pos - extra_pos_start) == extra->size) { num_blob_bytes = old_val->size - (start_blob_ptr - old_null_bytes); memcpy(curr_new_var_field_data_ptr, start_blob_ptr, num_blob_bytes); curr_new_var_field_data_ptr += num_blob_bytes; - } - // else, there is blob information to process - else { + } else { + // else, there is blob information to process uchar* len_bytes = NULL; uint32_t curr_old_blob = 0; uint32_t curr_new_blob = 0; @@ -696,11 +705,10 @@ static int tokudb_hcad_update_fun( uint32_t blob_index; memcpy(&blob_index, extra_pos, sizeof(blob_index)); extra_pos += sizeof(blob_index); - assert (op_type == COL_DROP || op_type == COL_ADD); + assert_always (op_type == COL_DROP || op_type == COL_ADD); if (op_type == COL_DROP) { num_blobs_to_copy = blob_index - curr_old_blob; - } - else { + } else { num_blobs_to_copy = blob_index - curr_new_blob; } for (uint32_t i = 0; i < num_blobs_to_copy; i++) { @@ -708,8 +716,7 @@ static int tokudb_hcad_update_fun( curr_new_var_field_data_ptr, curr_old_blob_ptr, len_bytes[curr_old_blob + i], - false - ); + false); curr_old_blob_ptr += num_bytes_written; curr_new_var_field_data_ptr += num_bytes_written; } @@ -721,12 +728,10 @@ static int tokudb_hcad_update_fun( NULL, curr_old_blob_ptr, len_bytes[curr_old_blob], - true - ); + true); curr_old_blob++; curr_old_blob_ptr += num_bytes; - } - else { + } else { // copy new data uint32_t new_len_bytes = extra_pos[0]; extra_pos++; @@ -734,8 +739,7 @@ static int tokudb_hcad_update_fun( curr_new_var_field_data_ptr, extra_pos, new_len_bytes, - false - ); + false); curr_new_blob++; curr_new_var_field_data_ptr += num_bytes; extra_pos += num_bytes; @@ -751,27 +755,27 @@ static int tokudb_hcad_update_fun( error = 0; cleanup: - tokudb_my_free(new_val_data); + tokudb::memory::free(new_val_data); return error; } -// Expand the variable offset array in the old row given the update mesage in the extra. +// Expand the variable offset array in the old row given the update mesage +// in the extra. static int tokudb_expand_variable_offsets( DB* db, - const DBT *key, - const DBT *old_val, - const DBT *extra, - void (*set_val)(const DBT *new_val, void *set_extra), - void *set_extra - ) -{ + const DBT* key, + const DBT* old_val, + const DBT* extra, + void (*set_val)(const DBT* new_val, void* set_extra), + void* set_extra) { + int error = 0; tokudb::buffer extra_val(extra->data, 0, extra->size); // decode the operation uint8_t operation; extra_val.consume(&operation, sizeof operation); - assert(operation == UPDATE_OP_EXPAND_VARIABLE_OFFSETS); + assert_always(operation == UPDATE_OP_EXPAND_VARIABLE_OFFSETS); // decode number of offsets uint32_t number_of_offsets; @@ -781,18 +785,20 @@ static int tokudb_expand_variable_offsets( uint32_t offset_start; extra_val.consume(&offset_start, sizeof offset_start); - assert(extra_val.size() == extra_val.limit()); + assert_always(extra_val.size() == extra_val.limit()); DBT new_val; memset(&new_val, 0, sizeof new_val); if (old_val != NULL) { - assert(offset_start + number_of_offsets <= old_val->size); + assert_always(offset_start + number_of_offsets <= old_val->size); // compute the new val from the old val - uchar *old_val_ptr = (uchar *)old_val->data; + uchar* old_val_ptr = (uchar*)old_val->data; // allocate space for the new val's data - uchar *new_val_ptr = (uchar *)tokudb_my_malloc(number_of_offsets + old_val->size, MYF(MY_FAE)); + uchar* new_val_ptr = (uchar*)tokudb::memory::malloc( + number_of_offsets + old_val->size, + MYF(MY_FAE)); if (!new_val_ptr) { error = ENOMEM; goto cleanup; @@ -819,8 +825,8 @@ static int tokudb_expand_variable_offsets( old_val_ptr += n; new_val.size = new_val_ptr - (uchar *)new_val.data; - assert(new_val_ptr == (uchar *)new_val.data + new_val.size); - assert(old_val_ptr == (uchar *)old_val->data + old_val->size); + assert_always(new_val_ptr == (uchar *)new_val.data + new_val.size); + assert_always(old_val_ptr == (uchar *)old_val->data + old_val->size); // set the new val set_val(&new_val, set_extra); @@ -829,46 +835,50 @@ static int tokudb_expand_variable_offsets( error = 0; cleanup: - tokudb_my_free(new_val.data); + tokudb::memory::free(new_val.data); return error; } // Expand an int field in a old row given the expand message in the extra. static int tokudb_expand_int_field( DB* db, - const DBT *key, - const DBT *old_val, - const DBT *extra, - void (*set_val)(const DBT *new_val, void *set_extra), - void *set_extra - ) -{ + const DBT* key, + const DBT* old_val, + const DBT* extra, + void (*set_val)(const DBT* new_val, void* set_extra), + void* set_extra) { + int error = 0; tokudb::buffer extra_val(extra->data, 0, extra->size); uint8_t operation; extra_val.consume(&operation, sizeof operation); - assert(operation == UPDATE_OP_EXPAND_INT || operation == UPDATE_OP_EXPAND_UINT); + assert_always( + operation == UPDATE_OP_EXPAND_INT || + operation == UPDATE_OP_EXPAND_UINT); uint32_t the_offset; extra_val.consume(&the_offset, sizeof the_offset); uint32_t old_length; extra_val.consume(&old_length, sizeof old_length); uint32_t new_length; extra_val.consume(&new_length, sizeof new_length); - assert(extra_val.size() == extra_val.limit()); + assert_always(extra_val.size() == extra_val.limit()); - assert(new_length >= old_length); // expand only + assert_always(new_length >= old_length); // expand only DBT new_val; memset(&new_val, 0, sizeof new_val); if (old_val != NULL) { - assert(the_offset + old_length <= old_val->size); // old field within the old val + // old field within the old val + assert_always(the_offset + old_length <= old_val->size); // compute the new val from the old val - uchar *old_val_ptr = (uchar *)old_val->data; + uchar* old_val_ptr = (uchar*)old_val->data; // allocate space for the new val's data - uchar *new_val_ptr = (uchar *)tokudb_my_malloc(old_val->size + (new_length - old_length), MYF(MY_FAE)); + uchar* new_val_ptr = (uchar*)tokudb::memory::malloc( + old_val->size + (new_length - old_length), + MYF(MY_FAE)); if (!new_val_ptr) { error = ENOMEM; goto cleanup; @@ -882,21 +892,27 @@ static int tokudb_expand_int_field( switch (operation) { case UPDATE_OP_EXPAND_INT: - // fill the entire new value with ones or zeros depending on the sign bit - // the encoding is little endian - memset(new_val_ptr, (old_val_ptr[old_length-1] & 0x80) ? 0xff : 0x00, new_length); - memcpy(new_val_ptr, old_val_ptr, old_length); // overlay the low bytes of the new value with the old value + // fill the entire new value with ones or zeros depending on the + // sign bit the encoding is little endian + memset( + new_val_ptr, + (old_val_ptr[old_length-1] & 0x80) ? 0xff : 0x00, + new_length); + // overlay the low bytes of the new value with the old value + memcpy(new_val_ptr, old_val_ptr, old_length); new_val_ptr += new_length; old_val_ptr += old_length; break; case UPDATE_OP_EXPAND_UINT: - memset(new_val_ptr, 0, new_length); // fill the entire new value with zeros - memcpy(new_val_ptr, old_val_ptr, old_length); // overlay the low bytes of the new value with the old value + // fill the entire new value with zeros + memset(new_val_ptr, 0, new_length); + // overlay the low bytes of the new value with the old value + memcpy(new_val_ptr, old_val_ptr, old_length); new_val_ptr += new_length; old_val_ptr += old_length; break; default: - assert(0); + assert_unreachable(); } // copy the rest @@ -906,8 +922,8 @@ static int tokudb_expand_int_field( old_val_ptr += n; new_val.size = new_val_ptr - (uchar *)new_val.data; - assert(new_val_ptr == (uchar *)new_val.data + new_val.size); - assert(old_val_ptr == (uchar *)old_val->data + old_val->size); + assert_always(new_val_ptr == (uchar *)new_val.data + new_val.size); + assert_always(old_val_ptr == (uchar *)old_val->data + old_val->size); // set the new val set_val(&new_val, set_extra); @@ -916,26 +932,27 @@ static int tokudb_expand_int_field( error = 0; cleanup: - tokudb_my_free(new_val.data); + tokudb::memory::free(new_val.data); return error; } // Expand a char field in a old row given the expand message in the extra. static int tokudb_expand_char_field( DB* db, - const DBT *key, - const DBT *old_val, - const DBT *extra, - void (*set_val)(const DBT *new_val, void *set_extra), - void *set_extra - ) -{ + const DBT* key, + const DBT* old_val, + const DBT* extra, + void (*set_val)(const DBT* new_val, void* set_extra), + void* set_extra) { + int error = 0; tokudb::buffer extra_val(extra->data, 0, extra->size); uint8_t operation; extra_val.consume(&operation, sizeof operation); - assert(operation == UPDATE_OP_EXPAND_CHAR || operation == UPDATE_OP_EXPAND_BINARY); + assert_always( + operation == UPDATE_OP_EXPAND_CHAR || + operation == UPDATE_OP_EXPAND_BINARY); uint32_t the_offset; extra_val.consume(&the_offset, sizeof the_offset); uint32_t old_length; @@ -944,20 +961,23 @@ static int tokudb_expand_char_field( extra_val.consume(&new_length, sizeof new_length); uchar pad_char; extra_val.consume(&pad_char, sizeof pad_char); - assert(extra_val.size() == extra_val.limit()); + assert_always(extra_val.size() == extra_val.limit()); - assert(new_length >= old_length); // expand only + assert_always(new_length >= old_length); // expand only DBT new_val; memset(&new_val, 0, sizeof new_val); if (old_val != NULL) { - assert(the_offset + old_length <= old_val->size); // old field within the old val + // old field within the old val + assert_always(the_offset + old_length <= old_val->size); // compute the new val from the old val - uchar *old_val_ptr = (uchar *)old_val->data; + uchar* old_val_ptr = (uchar*)old_val->data; // allocate space for the new val's data - uchar *new_val_ptr = (uchar *)tokudb_my_malloc(old_val->size + (new_length - old_length), MYF(MY_FAE)); + uchar* new_val_ptr = (uchar*)tokudb::memory::malloc( + old_val->size + (new_length - old_length), + MYF(MY_FAE)); if (!new_val_ptr) { error = ENOMEM; goto cleanup; @@ -972,13 +992,15 @@ static int tokudb_expand_char_field( switch (operation) { case UPDATE_OP_EXPAND_CHAR: case UPDATE_OP_EXPAND_BINARY: - memset(new_val_ptr, pad_char, new_length); // fill the entire new value with the pad char - memcpy(new_val_ptr, old_val_ptr, old_length); // overlay the low bytes of the new value with the old value + // fill the entire new value with the pad char + memset(new_val_ptr, pad_char, new_length); + // overlay the low bytes of the new value with the old value + memcpy(new_val_ptr, old_val_ptr, old_length); new_val_ptr += new_length; old_val_ptr += old_length; break; default: - assert(0); + assert_unreachable(); } // copy the rest @@ -988,8 +1010,8 @@ static int tokudb_expand_char_field( old_val_ptr += n; new_val.size = new_val_ptr - (uchar *)new_val.data; - assert(new_val_ptr == (uchar *)new_val.data + new_val.size); - assert(old_val_ptr == (uchar *)old_val->data + old_val->size); + assert_always(new_val_ptr == (uchar *)new_val.data + new_val.size); + assert_always(old_val_ptr == (uchar *)old_val->data + old_val->size); // set the new val set_val(&new_val, set_extra); @@ -998,7 +1020,7 @@ static int tokudb_expand_char_field( error = 0; cleanup: - tokudb_my_free(new_val.data); + tokudb::memory::free(new_val.data); return error; } @@ -1006,17 +1028,25 @@ namespace tokudb { class var_fields { public: - var_fields() { + inline var_fields() { } - void init_var_fields(uint32_t var_offset, uint32_t offset_bytes, uint32_t bytes_per_offset, tokudb::buffer *val_buffer) { - assert(bytes_per_offset == 0 || bytes_per_offset == 1 || bytes_per_offset == 2); + inline void init_var_fields( + uint32_t var_offset, + uint32_t offset_bytes, + uint32_t bytes_per_offset, + tokudb::buffer* val_buffer) { + + assert_always( + bytes_per_offset == 0 || + bytes_per_offset == 1 || + bytes_per_offset == 2); m_var_offset = var_offset; m_val_offset = m_var_offset + offset_bytes; m_bytes_per_offset = bytes_per_offset; if (bytes_per_offset > 0) { m_num_fields = offset_bytes / bytes_per_offset; } else { - assert(offset_bytes == 0); + assert_always(offset_bytes == 0); m_num_fields = 0; } m_val_buffer = val_buffer; @@ -1025,7 +1055,10 @@ public: uint32_t value_length(uint32_t var_index); void update_offsets(uint32_t var_index, uint32_t old_s, uint32_t new_s); uint32_t end_offset(); - void replace(uint32_t var_index, void *new_val_ptr, uint32_t new_val_length); + void replace( + uint32_t var_index, + void* new_val_ptr, + uint32_t new_val_length); private: uint32_t read_offset(uint32_t var_index); void write_offset(uint32_t var_index, uint32_t v); @@ -1034,24 +1067,28 @@ private: uint32_t m_val_offset; uint32_t m_bytes_per_offset; uint32_t m_num_fields; - tokudb::buffer *m_val_buffer; + tokudb::buffer* m_val_buffer; }; // Return the ith variable length offset uint32_t var_fields::read_offset(uint32_t var_index) { uint32_t offset = 0; - m_val_buffer->read(&offset, m_bytes_per_offset, m_var_offset + var_index * m_bytes_per_offset); + m_val_buffer->read( + &offset, m_bytes_per_offset, m_var_offset + var_index * m_bytes_per_offset); return offset; } // Write the ith variable length offset with a new offset. void var_fields::write_offset(uint32_t var_index, uint32_t new_offset) { - m_val_buffer->write(&new_offset, m_bytes_per_offset, m_var_offset + var_index * m_bytes_per_offset); + m_val_buffer->write( + &new_offset, + m_bytes_per_offset, + m_var_offset + var_index * m_bytes_per_offset); } // Return the offset of the ith variable length field uint32_t var_fields::value_offset(uint32_t var_index) { - assert(var_index < m_num_fields); + assert_always(var_index < m_num_fields); if (var_index == 0) return m_val_offset; else @@ -1060,16 +1097,21 @@ uint32_t var_fields::value_offset(uint32_t var_index) { // Return the length of the ith variable length field uint32_t var_fields::value_length(uint32_t var_index) { - assert(var_index < m_num_fields); + assert_always(var_index < m_num_fields); if (var_index == 0) return read_offset(0); else return read_offset(var_index) - read_offset(var_index-1); } -// The length of the ith variable length fields changed. Update all of the subsequent offsets. -void var_fields::update_offsets(uint32_t var_index, uint32_t old_s, uint32_t new_s) { - assert(var_index < m_num_fields); +// The length of the ith variable length fields changed. +// Update all of the subsequent offsets. +void var_fields::update_offsets( + uint32_t var_index, + uint32_t old_s, + uint32_t new_s) { + + assert_always(var_index < m_num_fields); if (old_s == new_s) return; for (uint i = var_index; i < m_num_fields; i++) { @@ -1088,7 +1130,11 @@ uint32_t var_fields::end_offset() { return m_val_offset + read_offset(m_num_fields-1); } -void var_fields::replace(uint32_t var_index, void *new_val_ptr, uint32_t new_val_length) { +void var_fields::replace( + uint32_t var_index, + void* new_val_ptr, + uint32_t new_val_length) { + // replace the new val with the extra val uint32_t the_offset = value_offset(var_index); uint32_t old_s = value_length(var_index); @@ -1103,15 +1149,23 @@ class blob_fields { public: blob_fields() { } - void init_blob_fields(uint32_t num_blobs, const uint8_t *blob_lengths, tokudb::buffer *val_buffer) { - m_num_blobs = num_blobs; m_blob_lengths = blob_lengths; m_val_buffer = val_buffer; + void init_blob_fields( + uint32_t num_blobs, + const uint8_t* blob_lengths, + tokudb::buffer* val_buffer) { + m_num_blobs = num_blobs; + m_blob_lengths = blob_lengths; + m_val_buffer = val_buffer; } void start_blobs(uint32_t offset) { m_blob_offset = offset; } void replace(uint32_t blob_index, uint32_t length, void *p); - void expand_length(uint32_t blob_index, uint8_t old_length_length, uint8_t new_length_length); + void expand_length( + uint32_t blob_index, + uint8_t old_length_length, + uint8_t new_length_length); private: uint32_t read_length(uint32_t offset, size_t size); void write_length(uint32_t offset, size_t size, uint32_t new_length); @@ -1129,12 +1183,15 @@ uint32_t blob_fields::read_length(uint32_t offset, size_t blob_length) { return length; } -void blob_fields::write_length(uint32_t offset, size_t size, uint32_t new_length) { +void blob_fields::write_length( + uint32_t offset, + size_t size, + uint32_t new_length) { m_val_buffer->write(&new_length, size, offset); } uint32_t blob_fields::blob_offset(uint32_t blob_index) { - assert(blob_index < m_num_blobs); + assert_always(blob_index < m_num_blobs); uint32_t offset = m_blob_offset; for (uint i = 0; i < blob_index; i++) { uint32_t blob_length = m_blob_lengths[i]; @@ -1144,8 +1201,12 @@ uint32_t blob_fields::blob_offset(uint32_t blob_index) { return offset; } -void blob_fields::replace(uint32_t blob_index, uint32_t new_length, void *new_value) { - assert(blob_index < m_num_blobs); +void blob_fields::replace( + uint32_t blob_index, + uint32_t new_length, + void* new_value) { + + assert_always(blob_index < m_num_blobs); // compute the ith blob offset uint32_t offset = blob_offset(blob_index); @@ -1155,15 +1216,23 @@ void blob_fields::replace(uint32_t blob_index, uint32_t new_length, void *new_va uint32_t old_length = read_length(offset, blob_length); // replace the data - m_val_buffer->replace(offset + blob_length, old_length, new_value, new_length); + m_val_buffer->replace( + offset + blob_length, + old_length, + new_value, + new_length); // write the new length write_length(offset, blob_length, new_length); } -void blob_fields::expand_length(uint32_t blob_index, uint8_t old_length_length, uint8_t new_length_length) { - assert(blob_index < m_num_blobs); - assert(old_length_length == m_blob_lengths[blob_index]); +void blob_fields::expand_length( + uint32_t blob_index, + uint8_t old_length_length, + uint8_t new_length_length) { + + assert_always(blob_index < m_num_blobs); + assert_always(old_length_length == m_blob_lengths[blob_index]); // compute the ith blob offset uint32_t offset = blob_offset(blob_index); @@ -1172,7 +1241,11 @@ void blob_fields::expand_length(uint32_t blob_index, uint8_t old_length_length, uint32_t blob_length = read_length(offset, old_length_length); // expand the length - m_val_buffer->replace(offset, old_length_length, &blob_length, new_length_length); + m_val_buffer->replace( + offset, + old_length_length, + &blob_length, + new_length_length); } class value_map { @@ -1180,8 +1253,16 @@ public: value_map(tokudb::buffer *val_buffer) : m_val_buffer(val_buffer) { } - void init_var_fields(uint32_t var_offset, uint32_t offset_bytes, uint32_t bytes_per_offset) { - m_var_fields.init_var_fields(var_offset, offset_bytes, bytes_per_offset, m_val_buffer); + void init_var_fields( + uint32_t var_offset, + uint32_t offset_bytes, + uint32_t bytes_per_offset) { + + m_var_fields.init_var_fields( + var_offset, + offset_bytes, + bytes_per_offset, + m_val_buffer); } void init_blob_fields(uint32_t num_blobs, const uint8_t *blob_lengths) { @@ -1189,31 +1270,63 @@ public: } // Replace the value of a fixed length field - void replace_fixed(uint32_t the_offset, uint32_t field_null_num, void *new_val_ptr, uint32_t new_val_length) { - m_val_buffer->replace(the_offset, new_val_length, new_val_ptr, new_val_length); + void replace_fixed( + uint32_t the_offset, + uint32_t field_null_num, + void* new_val_ptr, + uint32_t new_val_length) { + + m_val_buffer->replace( + the_offset, + new_val_length, + new_val_ptr, + new_val_length); maybe_clear_null(field_null_num); } // Replace the value of a variable length field - void replace_varchar(uint32_t var_index, uint32_t field_null_num, void *new_val_ptr, uint32_t new_val_length) { + void replace_varchar( + uint32_t var_index, + uint32_t field_null_num, + void* new_val_ptr, + uint32_t new_val_length) { + m_var_fields.replace(var_index, new_val_ptr, new_val_length); maybe_clear_null(field_null_num); } // Replace the value of a blob field - void replace_blob(uint32_t blob_index, uint32_t field_null_num, void *new_val_ptr, uint32_t new_val_length) { + void replace_blob( + uint32_t blob_index, + uint32_t field_null_num, + void* new_val_ptr, + uint32_t new_val_length) { + m_blob_fields.start_blobs(m_var_fields.end_offset()); m_blob_fields.replace(blob_index, new_val_length, new_val_ptr); maybe_clear_null(field_null_num); } - void expand_blob_lengths(uint32_t num_blob, const uint8_t *old_length, const uint8_t *new_length); + void expand_blob_lengths( + uint32_t num_blob, + const uint8_t* old_length, + const uint8_t* new_length); - void int_op(uint32_t operation, uint32_t the_offset, uint32_t length, uint32_t field_null_num, - tokudb::buffer &old_val, void *extra_val); + void int_op( + uint32_t operation, + uint32_t the_offset, + uint32_t length, + uint32_t field_null_num, + tokudb::buffer& old_val, + void* extra_val); - void uint_op(uint32_t operation, uint32_t the_offset, uint32_t length, uint32_t field_null_num, - tokudb::buffer &old_val, void *extra_val); + void uint_op( + uint32_t operation, + uint32_t the_offset, + uint32_t length, + uint32_t field_null_num, + tokudb::buffer& old_val, + void* extra_val); private: bool is_null(uint32_t null_num, uchar *null_bytes) { @@ -1234,7 +1347,10 @@ private: null_num &= ~(1<<31); else null_num -= 1; - set_overall_null_position((uchar *) m_val_buffer->data(), null_num, false); + set_overall_null_position( + (uchar*)m_val_buffer->data(), + null_num, + false); } } @@ -1245,11 +1361,19 @@ private: }; // Update an int field: signed newval@offset = old_val@offset OP extra_val -void value_map::int_op(uint32_t operation, uint32_t the_offset, uint32_t length, uint32_t field_null_num, - tokudb::buffer &old_val, void *extra_val) { - assert(the_offset + length <= m_val_buffer->size()); - assert(the_offset + length <= old_val.size()); - assert(length == 1 || length == 2 || length == 3 || length == 4 || length == 8); +void value_map::int_op( + uint32_t operation, + uint32_t the_offset, + uint32_t length, + uint32_t field_null_num, + tokudb::buffer &old_val, + void* extra_val) { + + assert_always(the_offset + length <= m_val_buffer->size()); + assert_always(the_offset + length <= old_val.size()); + assert_always( + length == 1 || length == 2 || length == 3 || + length == 4 || length == 8); uchar *old_val_ptr = (uchar *) old_val.data(); bool field_is_null = is_null(field_null_num, old_val_ptr); @@ -1287,16 +1411,24 @@ void value_map::int_op(uint32_t operation, uint32_t the_offset, uint32_t length, } break; default: - assert(0); + assert_unreachable(); } } // Update an unsigned field: unsigned newval@offset = old_val@offset OP extra_val -void value_map::uint_op(uint32_t operation, uint32_t the_offset, uint32_t length, uint32_t field_null_num, - tokudb::buffer &old_val, void *extra_val) { - assert(the_offset + length <= m_val_buffer->size()); - assert(the_offset + length <= old_val.size()); - assert(length == 1 || length == 2 || length == 3 || length == 4 || length == 8); +void value_map::uint_op( + uint32_t operation, + uint32_t the_offset, + uint32_t length, + uint32_t field_null_num, + tokudb::buffer& old_val, + void* extra_val) { + + assert_always(the_offset + length <= m_val_buffer->size()); + assert_always(the_offset + length <= old_val.size()); + assert_always( + length == 1 || length == 2 || length == 3 || + length == 4 || length == 8); uchar *old_val_ptr = (uchar *) old_val.data(); bool field_is_null = is_null(field_null_num, old_val_ptr); @@ -1326,16 +1458,23 @@ void value_map::uint_op(uint32_t operation, uint32_t the_offset, uint32_t length } break; default: - assert(0); + assert_unreachable(); } } -void value_map::expand_blob_lengths(uint32_t num_blob, const uint8_t *old_length, const uint8_t *new_length) { +void value_map::expand_blob_lengths( + uint32_t num_blob, + const uint8_t* old_length, + const uint8_t* new_length) { + uint8_t current_length[num_blob]; memcpy(current_length, old_length, num_blob); for (uint32_t i = 0; i < num_blob; i++) { if (new_length[i] > current_length[i]) { - m_blob_fields.init_blob_fields(num_blob, current_length, m_val_buffer); + m_blob_fields.init_blob_fields( + num_blob, + current_length, + m_val_buffer); m_blob_fields.start_blobs(m_var_fields.end_offset()); m_blob_fields.expand_length(i, current_length[i], new_length[i]); current_length[i] = new_length[i]; @@ -1348,30 +1487,29 @@ void value_map::expand_blob_lengths(uint32_t num_blob, const uint8_t *old_length static uint32_t consume_uint32(tokudb::buffer &b) { uint32_t n; size_t s = b.consume_ui(&n); - assert(s > 0); + assert_always(s > 0); return n; } static uint8_t *consume_uint8_array(tokudb::buffer &b, uint32_t array_size) { uint8_t *p = (uint8_t *) b.consume_ptr(array_size); - assert(p); + assert_always(p); return p; } static int tokudb_expand_blobs( DB* db, - const DBT *key_dbt, - const DBT *old_val_dbt, - const DBT *extra, - void (*set_val)(const DBT *new_val_dbt, void *set_extra), - void *set_extra - ) -{ + const DBT* key_dbt, + const DBT* old_val_dbt, + const DBT* extra, + void (*set_val)(const DBT* new_val_dbt, void* set_extra), + void* set_extra) { + tokudb::buffer extra_val(extra->data, 0, extra->size); uint8_t operation; extra_val.consume(&operation, sizeof operation); - assert(operation == UPDATE_OP_EXPAND_BLOB); + assert_always(operation == UPDATE_OP_EXPAND_BLOB); if (old_val_dbt != NULL) { // new val = old val @@ -1384,13 +1522,18 @@ static int tokudb_expand_blobs( uint32_t var_field_offset = consume_uint32(extra_val); uint32_t var_offset_bytes = consume_uint32(extra_val); uint32_t bytes_per_offset = consume_uint32(extra_val); - vd.init_var_fields(var_field_offset, var_offset_bytes, bytes_per_offset); + vd.init_var_fields( + var_field_offset, + var_offset_bytes, + bytes_per_offset); // decode blob info uint32_t num_blob = consume_uint32(extra_val); - const uint8_t *old_blob_length = consume_uint8_array(extra_val, num_blob); - const uint8_t *new_blob_length = consume_uint8_array(extra_val, num_blob); - assert(extra_val.size() == extra_val.limit()); + const uint8_t* old_blob_length = + consume_uint8_array(extra_val, num_blob); + const uint8_t* new_blob_length = + consume_uint8_array(extra_val, num_blob); + assert_always(extra_val.size() == extra_val.limit()); // expand blob lengths vd.expand_blob_lengths(num_blob, old_blob_length, new_blob_length); @@ -1404,8 +1547,14 @@ static int tokudb_expand_blobs( return 0; } -// Decode and apply a sequence of update operations defined in the extra to the old value and put the result in the new value. -static void apply_1_updates(tokudb::value_map &vd, tokudb::buffer &new_val, tokudb::buffer &old_val, tokudb::buffer &extra_val) { +// Decode and apply a sequence of update operations defined in the extra to +// the old value and put the result in the new value. +static void apply_1_updates( + tokudb::value_map& vd, + tokudb::buffer& new_val, + tokudb::buffer& old_val, + tokudb::buffer& extra_val) { + uint32_t num_updates; extra_val.consume(&num_updates, sizeof num_updates); for ( ; num_updates > 0; num_updates--) { @@ -1428,46 +1577,70 @@ static void apply_1_updates(tokudb::value_map &vd, tokudb::buffer &new_val, toku switch (field_type) { case UPDATE_TYPE_INT: if (update_operation == '=') - vd.replace_fixed(the_offset, field_null_num, extra_val_ptr, extra_val_length); + vd.replace_fixed( + the_offset, + field_null_num, + extra_val_ptr, + extra_val_length); else - vd.int_op(update_operation, the_offset, extra_val_length, field_null_num, old_val, extra_val_ptr); + vd.int_op( + update_operation, + the_offset, + extra_val_length, + field_null_num, + old_val, + extra_val_ptr); break; case UPDATE_TYPE_UINT: if (update_operation == '=') - vd.replace_fixed(the_offset, field_null_num, extra_val_ptr, extra_val_length); + vd.replace_fixed( + the_offset, + field_null_num, + extra_val_ptr, + extra_val_length); else - vd.uint_op(update_operation, the_offset, extra_val_length, field_null_num, old_val, extra_val_ptr); + vd.uint_op( + update_operation, + the_offset, + extra_val_length, + field_null_num, + old_val, + extra_val_ptr); break; case UPDATE_TYPE_CHAR: case UPDATE_TYPE_BINARY: if (update_operation == '=') - vd.replace_fixed(the_offset, field_null_num, extra_val_ptr, extra_val_length); + vd.replace_fixed( + the_offset, + field_null_num, + extra_val_ptr, + extra_val_length); else - assert(0); + assert_unreachable(); break; default: - assert(0); + assert_unreachable(); break; } } - assert(extra_val.size() == extra_val.limit()); + assert_always(extra_val.size() == extra_val.limit()); } -// Simple update handler. Decode the update message, apply the update operations to the old value, and set the new value. +// Simple update handler. Decode the update message, apply the update operations +// to the old value, and set the new value. static int tokudb_update_1_fun( DB* db, - const DBT *key_dbt, - const DBT *old_val_dbt, - const DBT *extra, - void (*set_val)(const DBT *new_val_dbt, void *set_extra), - void *set_extra - ) -{ + const DBT* key_dbt, + const DBT* old_val_dbt, + const DBT* extra, + void (*set_val)(const DBT* new_val_dbt, void* set_extra), + void* set_extra) { + tokudb::buffer extra_val(extra->data, 0, extra->size); uint8_t operation; extra_val.consume(&operation, sizeof operation); - assert(operation == UPDATE_OP_UPDATE_1); + assert_always(operation == UPDATE_OP_UPDATE_1); if (old_val_dbt != NULL) { // get the simple descriptor @@ -1480,14 +1653,20 @@ static int tokudb_update_1_fun( uint32_t m_bytes_per_offset; extra_val.consume(&m_bytes_per_offset, sizeof m_bytes_per_offset); - tokudb::buffer old_val(old_val_dbt->data, old_val_dbt->size, old_val_dbt->size); + tokudb::buffer old_val( + old_val_dbt->data, + old_val_dbt->size, + old_val_dbt->size); // new val = old val tokudb::buffer new_val; new_val.append(old_val_dbt->data, old_val_dbt->size); tokudb::value_map vd(&new_val); - vd.init_var_fields(m_var_field_offset, m_var_offset_bytes, m_bytes_per_offset); + vd.init_var_fields( + m_var_field_offset, + m_var_offset_bytes, + m_bytes_per_offset); // apply updates to new val apply_1_updates(vd, new_val, old_val, extra_val); @@ -1502,22 +1681,23 @@ static int tokudb_update_1_fun( return 0; } -// Simple upsert handler. Decode the upsert message. If the key does not exist, then insert a new value from the extra. -// Otherwise, apply the update operations to the old value, and then set the new value. +// Simple upsert handler. Decode the upsert message. If the key does not exist, +// then insert a new value from the extra. +// Otherwise, apply the update operations to the old value, and then set the +// new value. static int tokudb_upsert_1_fun( DB* db, - const DBT *key_dbt, - const DBT *old_val_dbt, - const DBT *extra, - void (*set_val)(const DBT *new_val_dbt, void *set_extra), - void *set_extra - ) -{ + const DBT* key_dbt, + const DBT* old_val_dbt, + const DBT* extra, + void (*set_val)(const DBT* new_val_dbt, void* set_extra), + void* set_extra) { + tokudb::buffer extra_val(extra->data, 0, extra->size); uint8_t operation; extra_val.consume(&operation, sizeof operation); - assert(operation == UPDATE_OP_UPSERT_1); + assert_always(operation == UPDATE_OP_UPSERT_1); uint32_t insert_length; extra_val.consume(&insert_length, sizeof insert_length); @@ -1540,14 +1720,20 @@ static int tokudb_upsert_1_fun( uint32_t m_bytes_per_offset; extra_val.consume(&m_bytes_per_offset, sizeof m_bytes_per_offset); - tokudb::buffer old_val(old_val_dbt->data, old_val_dbt->size, old_val_dbt->size); + tokudb::buffer old_val( + old_val_dbt->data, + old_val_dbt->size, + old_val_dbt->size); // new val = old val tokudb::buffer new_val; new_val.append(old_val_dbt->data, old_val_dbt->size); tokudb::value_map vd(&new_val); - vd.init_var_fields(m_var_field_offset, m_var_offset_bytes, m_bytes_per_offset); + vd.init_var_fields( + m_var_field_offset, + m_var_offset_bytes, + m_bytes_per_offset); // apply updates to new val apply_1_updates(vd, new_val, old_val, extra_val); @@ -1562,8 +1748,14 @@ static int tokudb_upsert_1_fun( return 0; } -// Decode and apply a sequence of update operations defined in the extra to the old value and put the result in the new value. -static void apply_2_updates(tokudb::value_map &vd, tokudb::buffer &new_val, tokudb::buffer &old_val, tokudb::buffer &extra_val) { +// Decode and apply a sequence of update operations defined in the extra to the +// old value and put the result in the new value. +static void apply_2_updates( + tokudb::value_map& vd, + tokudb::buffer& new_val, + tokudb::buffer& old_val, + tokudb::buffer& extra_val) { + uint32_t num_updates = consume_uint32(extra_val); for (uint32_t i = 0; i < num_updates; i++) { uint32_t update_operation = consume_uint32(extra_val); @@ -1571,79 +1763,118 @@ static void apply_2_updates(tokudb::value_map &vd, tokudb::buffer &new_val, toku uint32_t var_field_offset = consume_uint32(extra_val); uint32_t var_offset_bytes = consume_uint32(extra_val); uint32_t bytes_per_offset = consume_uint32(extra_val); - vd.init_var_fields(var_field_offset, var_offset_bytes, bytes_per_offset); + vd.init_var_fields( + var_field_offset, + var_offset_bytes, + bytes_per_offset); } else if (update_operation == 'b') { uint32_t num_blobs = consume_uint32(extra_val); - const uint8_t *blob_lengths = consume_uint8_array(extra_val, num_blobs); + const uint8_t* blob_lengths = + consume_uint8_array(extra_val, num_blobs); vd.init_blob_fields(num_blobs, blob_lengths); } else { uint32_t field_type = consume_uint32(extra_val); uint32_t field_null_num = consume_uint32(extra_val); uint32_t the_offset = consume_uint32(extra_val); uint32_t extra_val_length = consume_uint32(extra_val); - void *extra_val_ptr = extra_val.consume_ptr(extra_val_length); assert(extra_val_ptr); + void* extra_val_ptr = extra_val.consume_ptr(extra_val_length); + assert_always(extra_val_ptr); switch (field_type) { case UPDATE_TYPE_INT: if (update_operation == '=') - vd.replace_fixed(the_offset, field_null_num, extra_val_ptr, extra_val_length); + vd.replace_fixed( + the_offset, + field_null_num, + extra_val_ptr, + extra_val_length); else - vd.int_op(update_operation, the_offset, extra_val_length, field_null_num, old_val, extra_val_ptr); + vd.int_op( + update_operation, + the_offset, + extra_val_length, + field_null_num, + old_val, + extra_val_ptr); break; case UPDATE_TYPE_UINT: if (update_operation == '=') - vd.replace_fixed(the_offset, field_null_num, extra_val_ptr, extra_val_length); + vd.replace_fixed( + the_offset, + field_null_num, + extra_val_ptr, + extra_val_length); else - vd.uint_op(update_operation, the_offset, extra_val_length, field_null_num, old_val, extra_val_ptr); + vd.uint_op( + update_operation, + the_offset, + extra_val_length, + field_null_num, + old_val, + extra_val_ptr); break; case UPDATE_TYPE_CHAR: case UPDATE_TYPE_BINARY: if (update_operation == '=') - vd.replace_fixed(the_offset, field_null_num, extra_val_ptr, extra_val_length); + vd.replace_fixed( + the_offset, + field_null_num, + extra_val_ptr, + extra_val_length); else - assert(0); + assert_unreachable(); break; case UPDATE_TYPE_VARBINARY: case UPDATE_TYPE_VARCHAR: if (update_operation == '=') - vd.replace_varchar(the_offset, field_null_num, extra_val_ptr, extra_val_length); + vd.replace_varchar( + the_offset, + field_null_num, + extra_val_ptr, + extra_val_length); else - assert(0); + assert_unreachable(); break; case UPDATE_TYPE_TEXT: case UPDATE_TYPE_BLOB: if (update_operation == '=') - vd.replace_blob(the_offset, field_null_num, extra_val_ptr, extra_val_length); + vd.replace_blob( + the_offset, + field_null_num, + extra_val_ptr, + extra_val_length); else - assert(0); + assert_unreachable(); break; default: - assert(0); - break; + assert_unreachable(); } } } - assert(extra_val.size() == extra_val.limit()); + assert_always(extra_val.size() == extra_val.limit()); } -// Simple update handler. Decode the update message, apply the update operations to the old value, and set the new value. +// Simple update handler. Decode the update message, apply the update +// operations to the old value, and set the new value. static int tokudb_update_2_fun( DB* db, - const DBT *key_dbt, - const DBT *old_val_dbt, - const DBT *extra, - void (*set_val)(const DBT *new_val_dbt, void *set_extra), - void *set_extra - ) -{ + const DBT* key_dbt, + const DBT* old_val_dbt, + const DBT* extra, + void (*set_val)(const DBT* new_val_dbt, void* set_extra), + void* set_extra) { + tokudb::buffer extra_val(extra->data, 0, extra->size); uint8_t op; extra_val.consume(&op, sizeof op); - assert(op == UPDATE_OP_UPDATE_2); + assert_always(op == UPDATE_OP_UPDATE_2); if (old_val_dbt != NULL) { - tokudb::buffer old_val(old_val_dbt->data, old_val_dbt->size, old_val_dbt->size); + tokudb::buffer old_val( + old_val_dbt->data, + old_val_dbt->size, + old_val_dbt->size); // new val = old val tokudb::buffer new_val; @@ -1664,26 +1895,28 @@ static int tokudb_update_2_fun( return 0; } -// Simple upsert handler. Decode the upsert message. If the key does not exist, then insert a new value from the extra. -// Otherwise, apply the update operations to the old value, and then set the new value. +// Simple upsert handler. Decode the upsert message. If the key does not exist, +// then insert a new value from the extra. +// Otherwise, apply the update operations to the old value, and then set the +// new value. static int tokudb_upsert_2_fun( DB* db, - const DBT *key_dbt, - const DBT *old_val_dbt, - const DBT *extra, - void (*set_val)(const DBT *new_val_dbt, void *set_extra), - void *set_extra - ) -{ + const DBT* key_dbt, + const DBT* old_val_dbt, + const DBT* extra, + void (*set_val)(const DBT* new_val_dbt, void* set_extra), + void* set_extra) { + tokudb::buffer extra_val(extra->data, 0, extra->size); uint8_t op; extra_val.consume(&op, sizeof op); - assert(op == UPDATE_OP_UPSERT_2); + assert_always(op == UPDATE_OP_UPSERT_2); uint32_t insert_length = consume_uint32(extra_val); - assert(insert_length < extra_val.limit()); - void *insert_row = extra_val.consume_ptr(insert_length); assert(insert_row); + assert_always(insert_length < extra_val.limit()); + void* insert_row = extra_val.consume_ptr(insert_length); + assert_always(insert_row); if (old_val_dbt == NULL) { // insert a new row @@ -1692,7 +1925,10 @@ static int tokudb_upsert_2_fun( new_val_dbt.data = insert_row; set_val(&new_val_dbt, set_extra); } else { - tokudb::buffer old_val(old_val_dbt->data, old_val_dbt->size, old_val_dbt->size); + tokudb::buffer old_val( + old_val_dbt->data, + old_val_dbt->size, + old_val_dbt->size); // new val = old val tokudb::buffer new_val; @@ -1713,56 +1949,107 @@ static int tokudb_upsert_2_fun( return 0; } -// This function is the update callback function that is registered with the YDB environment. -// It uses the first byte in the update message to identify the update message type and call -// the handler for that message. +// This function is the update callback function that is registered with the +// YDB environment. It uses the first byte in the update message to identify +// the update message type and call the handler for that message. int tokudb_update_fun( DB* db, - const DBT *key, - const DBT *old_val, - const DBT *extra, - void (*set_val)(const DBT *new_val, void *set_extra), - void *set_extra - ) -{ - assert(extra->size > 0); - uint8_t *extra_pos = (uchar *)extra->data; + const DBT* key, + const DBT* old_val, + const DBT* extra, + void (*set_val)(const DBT* new_val, void* set_extra), + void* set_extra) { + + assert_always(extra->size > 0); + uint8_t* extra_pos = (uchar*)extra->data; uint8_t operation = extra_pos[0]; int error; switch (operation) { case UPDATE_OP_COL_ADD_OR_DROP: - error = tokudb_hcad_update_fun(db, key, old_val, extra, set_val, set_extra); + error = tokudb_hcad_update_fun( + db, + key, + old_val, + extra, + set_val, + set_extra); break; case UPDATE_OP_EXPAND_VARIABLE_OFFSETS: - error = tokudb_expand_variable_offsets(db, key, old_val, extra, set_val, set_extra); + error = tokudb_expand_variable_offsets( + db, + key, + old_val, + extra, + set_val, + set_extra); break; case UPDATE_OP_EXPAND_INT: case UPDATE_OP_EXPAND_UINT: - error = tokudb_expand_int_field(db, key, old_val, extra, set_val, set_extra); + error = tokudb_expand_int_field( + db, + key, + old_val, + extra, + set_val, + set_extra); break; case UPDATE_OP_EXPAND_CHAR: case UPDATE_OP_EXPAND_BINARY: - error = tokudb_expand_char_field(db, key, old_val, extra, set_val, set_extra); + error = tokudb_expand_char_field( + db, + key, + old_val, + extra, + set_val, + set_extra); break; case UPDATE_OP_EXPAND_BLOB: - error = tokudb_expand_blobs(db, key, old_val, extra, set_val, set_extra); + error = tokudb_expand_blobs( + db, + key, + old_val, + extra, + set_val, + set_extra); break; case UPDATE_OP_UPDATE_1: - error = tokudb_update_1_fun(db, key, old_val, extra, set_val, set_extra); + error = tokudb_update_1_fun( + db, + key, + old_val, + extra, + set_val, + set_extra); break; case UPDATE_OP_UPSERT_1: - error = tokudb_upsert_1_fun(db, key, old_val, extra, set_val, set_extra); + error = tokudb_upsert_1_fun( + db, + key, + old_val, + extra, + set_val, + set_extra); break; case UPDATE_OP_UPDATE_2: - error = tokudb_update_2_fun(db, key, old_val, extra, set_val, set_extra); + error = tokudb_update_2_fun( + db, + key, + old_val, + extra, + set_val, + set_extra); break; case UPDATE_OP_UPSERT_2: - error = tokudb_upsert_2_fun(db, key, old_val, extra, set_val, set_extra); + error = tokudb_upsert_2_fun( + db, + key, + old_val, + extra, + set_val, + set_extra); break; default: - assert(0); - error = EINVAL; - break; + assert_unreachable(); } return error; } diff --git a/storage/xtradb/CMakeLists.txt b/storage/xtradb/CMakeLists.txt index cdcdf0286e8..7d2a3fad56d 100644 --- a/storage/xtradb/CMakeLists.txt +++ b/storage/xtradb/CMakeLists.txt @@ -496,17 +496,9 @@ SET(INNOBASE_SOURCES ut/ut0wqueue.cc ut/ut0timer.cc) -IF(CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64le") - enable_language(ASM) - LIST(APPEND INNOBASE_SOURCES - ut/crc32_power8/crc32.S - ut/crc32_power8/crc32_wrapper.c - ) -ENDIF() - MYSQL_ADD_PLUGIN(xtradb ${INNOBASE_SOURCES} STORAGE_ENGINE DEFAULT RECOMPILE_FOR_EMBEDDED - LINK_LIBRARIES ${ZLIB_LIBRARY} ${LINKER_SCRIPT}) + LINK_LIBRARIES ${ZLIB_LIBRARY} ${CRC32_VPMSUM_LIBRARY} ${LINKER_SCRIPT}) IF(TARGET xtradb AND NOT XTRADB_OK) MESSAGE(FATAL_ERROR "Percona XtraDB is not supported on this platform") diff --git a/storage/xtradb/btr/btr0cur.cc b/storage/xtradb/btr/btr0cur.cc index 5bb94dfce2a..7ee37836bfb 100644 --- a/storage/xtradb/btr/btr0cur.cc +++ b/storage/xtradb/btr/btr0cur.cc @@ -4257,7 +4257,7 @@ btr_estimate_number_of_different_key_vals( */ if (index->stat_index_size > 1) { n_sample_pages = (srv_stats_transient_sample_pages < index->stat_index_size) ? - ut_min(index->stat_index_size, + (ulint) ut_min((double) index->stat_index_size, log2(index->stat_index_size)*srv_stats_transient_sample_pages) : index->stat_index_size; diff --git a/storage/xtradb/btr/btr0defragment.cc b/storage/xtradb/btr/btr0defragment.cc index 6e7a3fd2411..8de85e746ca 100644 --- a/storage/xtradb/btr/btr0defragment.cc +++ b/storage/xtradb/btr/btr0defragment.cc @@ -151,7 +151,7 @@ void btr_defragment_init() { srv_defragment_interval = ut_microseconds_to_timer( - 1000000.0 / srv_defragment_frequency); + (ulonglong) (1000000.0 / srv_defragment_frequency)); mutex_create(btr_defragment_mutex_key, &btr_defragment_mutex, SYNC_ANY_LATCH); os_thread_create(btr_defragment_thread, NULL, NULL); diff --git a/storage/xtradb/btr/btr0sea.cc b/storage/xtradb/btr/btr0sea.cc index ac5e9aec67b..683bf7cd1c7 100644 --- a/storage/xtradb/btr/btr0sea.cc +++ b/storage/xtradb/btr/btr0sea.cc @@ -53,17 +53,10 @@ UNIV_INTERN ulint btr_search_index_num; /** A dummy variable to fool the compiler */ UNIV_INTERN ulint btr_search_this_is_zero = 0; -#ifdef UNIV_SEARCH_PERF_STAT -/** Number of successful adaptive hash index lookups */ -UNIV_INTERN ulint btr_search_n_succ = 0; -/** Number of failed adaptive hash index lookups */ -UNIV_INTERN ulint btr_search_n_hash_fail = 0; -#endif /* UNIV_SEARCH_PERF_STAT */ - /** padding to prevent other memory update hotspots from residing on the same memory cache line as btr_search_latch */ -UNIV_INTERN byte btr_sea_pad1[64]; +UNIV_INTERN byte btr_sea_pad1[CACHE_LINE_SIZE]; /** Array of latches protecting individual AHI partitions. The latches protect: (1) positions of records on those pages where a hash index from the @@ -76,7 +69,7 @@ UNIV_INTERN prio_rw_lock_t* btr_search_latch_arr; /** padding to prevent other memory update hotspots from residing on the same memory cache line */ -UNIV_INTERN byte btr_sea_pad2[64]; +UNIV_INTERN byte btr_sea_pad2[CACHE_LINE_SIZE]; /** The adaptive hash index */ UNIV_INTERN btr_search_sys_t* btr_search_sys; @@ -698,10 +691,6 @@ btr_search_info_update_slow( if (cursor->flag == BTR_CUR_HASH_FAIL) { /* Update the hash node reference, if appropriate */ -#ifdef UNIV_SEARCH_PERF_STAT - btr_search_n_hash_fail++; -#endif /* UNIV_SEARCH_PERF_STAT */ - rw_lock_x_lock(btr_search_get_latch(cursor->index)); btr_search_update_hash_ref(info, block, cursor); @@ -1059,7 +1048,6 @@ btr_search_guess_on_hash( info->last_hash_succ = TRUE; #ifdef UNIV_SEARCH_PERF_STAT - btr_search_n_succ++; #endif if (UNIV_LIKELY(!has_search_latch) && buf_page_peek_if_too_old(&block->page)) { diff --git a/storage/xtradb/buf/buf0buf.cc b/storage/xtradb/buf/buf0buf.cc index 556096ca7e4..19dd375f6e6 100644 --- a/storage/xtradb/buf/buf0buf.cc +++ b/storage/xtradb/buf/buf0buf.cc @@ -1544,6 +1544,7 @@ buf_pool_free_instance( buf_chunk_t* chunk; buf_chunk_t* chunks; buf_page_t* bpage; + ulint i; bpage = UT_LIST_GET_LAST(buf_pool->LRU); while (bpage != NULL) { @@ -1567,10 +1568,29 @@ buf_pool_free_instance( mem_free(buf_pool->watch); buf_pool->watch = NULL; + for (i = BUF_FLUSH_LRU; i < BUF_FLUSH_N_TYPES; i++) { + os_event_free(buf_pool->no_flush[i]); + } + mutex_free(&buf_pool->LRU_list_mutex); + mutex_free(&buf_pool->free_list_mutex); + mutex_free(&buf_pool->zip_free_mutex); + mutex_free(&buf_pool->zip_hash_mutex); + mutex_free(&buf_pool->zip_mutex); + mutex_free(&buf_pool->flush_state_mutex); + mutex_free(&buf_pool->flush_list_mutex); + chunks = buf_pool->chunks; chunk = chunks + buf_pool->n_chunks; while (--chunk >= chunks) { + buf_block_t* block = chunk->blocks; + for (i = 0; i < chunk->size; i++, block++) { + mutex_free(&block->mutex); + rw_lock_free(&block->lock); +#ifdef UNIV_SYNC_DEBUG + rw_lock_free(&block->debug_latch); +#endif + } os_mem_free_large(chunk->mem, chunk->mem_size); } diff --git a/storage/xtradb/buf/buf0dblwr.cc b/storage/xtradb/buf/buf0dblwr.cc index 7c7f28ddc2f..ff334003524 100644 --- a/storage/xtradb/buf/buf0dblwr.cc +++ b/storage/xtradb/buf/buf0dblwr.cc @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1995, 2014, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2013, 2015, MariaDB Corporation. All Rights Reserved. +Copyright (c) 2013, 2016, MariaDB Corporation. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -37,6 +37,7 @@ Created 2011/12/19 #include "page0zip.h" #include "trx0sys.h" #include "fil0crypt.h" +#include "fil0pagecompress.h" #ifndef UNIV_HOTBACKUP @@ -500,6 +501,7 @@ buf_dblwr_process() for (std::list::iterator i = recv_dblwr.pages.begin(); i != recv_dblwr.pages.end(); ++i, ++page_no_dblwr ) { + bool is_compressed = false; page = *i; page_no = mach_read_from_4(page + FIL_PAGE_OFFSET); @@ -533,6 +535,16 @@ buf_dblwr_process() NULL, 0); + /* Is page compressed ? */ + is_compressed = fil_page_is_compressed_encrypted(read_buf) | + fil_page_is_compressed(read_buf); + + /* If page was compressed, decompress it before we + check checksum. */ + if (is_compressed) { + fil_decompress_page(NULL, read_buf, UNIV_PAGE_SIZE, NULL, true); + } + if (fil_space_verify_crypt_checksum(read_buf, zip_size)) { /* page is encrypted and checksum is OK */ } else if (buf_page_is_corrupted(true, read_buf, zip_size)) { @@ -546,6 +558,16 @@ buf_dblwr_process() " the doublewrite buffer.\n", (ulong) space_id, (ulong) page_no); + /* Is page compressed ? */ + is_compressed = fil_page_is_compressed_encrypted(page) | + fil_page_is_compressed(page); + + /* If page was compressed, decompress it before we + check checksum. */ + if (is_compressed) { + fil_decompress_page(NULL, page, UNIV_PAGE_SIZE, NULL, true); + } + if (fil_space_verify_crypt_checksum(page, zip_size)) { /* the doublewrite buffer page is encrypted and OK */ } else if (buf_page_is_corrupted(true, diff --git a/storage/xtradb/buf/buf0dump.cc b/storage/xtradb/buf/buf0dump.cc index 7bce480e652..a68bb8a1344 100644 --- a/storage/xtradb/buf/buf0dump.cc +++ b/storage/xtradb/buf/buf0dump.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2011, 2012, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2011, 2015, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -163,6 +163,25 @@ buf_load_status( va_end(ap); } +/** Returns the directory path where the buffer pool dump file will be created. +@return directory path */ +static +const char* +get_buf_dump_dir() +{ + const char* dump_dir; + + /* The dump file should be created in the default data directory if + innodb_data_home_dir is set as an empty string. */ + if (strcmp(srv_data_home, "") == 0) { + dump_dir = fil_path_to_mysql_datadir; + } else { + dump_dir = srv_data_home; + } + + return(dump_dir); +} + /*****************************************************************//** Perform a buffer pool dump into the file specified by innodb_buffer_pool_filename. If any errors occur then the value of @@ -186,7 +205,7 @@ buf_dump( int ret; ut_snprintf(full_filename, sizeof(full_filename), - "%s%c%s", srv_data_home, SRV_PATH_SEPARATOR, + "%s%c%s", get_buf_dump_dir(), SRV_PATH_SEPARATOR, srv_buf_dump_filename); ut_snprintf(tmp_filename, sizeof(tmp_filename), @@ -471,7 +490,7 @@ buf_load() buf_load_abort_flag = FALSE; ut_snprintf(full_filename, sizeof(full_filename), - "%s%c%s", srv_data_home, SRV_PATH_SEPARATOR, + "%s%c%s", get_buf_dump_dir(), SRV_PATH_SEPARATOR, srv_buf_dump_filename); buf_load_status(STATUS_NOTICE, diff --git a/storage/xtradb/buf/buf0flu.cc b/storage/xtradb/buf/buf0flu.cc index 5d64b75784a..1dfd92e4fba 100644 --- a/storage/xtradb/buf/buf0flu.cc +++ b/storage/xtradb/buf/buf0flu.cc @@ -72,12 +72,6 @@ UNIV_INTERN mysql_pfs_key_t buf_page_cleaner_thread_key; UNIV_INTERN mysql_pfs_key_t buf_lru_manager_thread_key; #endif /* UNIV_PFS_THREAD */ -/** If LRU list of a buf_pool is less than this size then LRU eviction -should not happen. This is because when we do LRU flushing we also put -the blocks on free list. If LRU list is very small then we can end up -in thrashing. */ -#define BUF_LRU_MIN_LEN 256 - /* @} */ /******************************************************************//** @@ -2425,7 +2419,7 @@ ulint af_get_pct_for_dirty() /*==================*/ { - ulint dirty_pct = buf_get_modified_ratio_pct(); + ulint dirty_pct = (ulint) buf_get_modified_ratio_pct(); if (dirty_pct > 0 && srv_max_buf_pool_modified_pct == 0) { return(100); @@ -2445,7 +2439,7 @@ af_get_pct_for_dirty() } } else if (dirty_pct > srv_max_dirty_pages_pct_lwm) { /* We should start flushing pages gradually. */ - return((dirty_pct * 100) + return (ulint) ((dirty_pct * 100) / (srv_max_buf_pool_modified_pct + 1)); } @@ -2463,8 +2457,8 @@ af_get_pct_for_lsn( { lsn_t max_async_age; lsn_t lsn_age_factor; - lsn_t af_lwm = (srv_adaptive_flushing_lwm - * log_get_capacity()) / 100; + lsn_t af_lwm = (lsn_t) ((srv_adaptive_flushing_lwm + * log_get_capacity()) / 100); if (age < af_lwm) { /* No adaptive flushing. */ diff --git a/storage/xtradb/buf/buf0lru.cc b/storage/xtradb/buf/buf0lru.cc index b36136e4079..fdec0e48198 100644 --- a/storage/xtradb/buf/buf0lru.cc +++ b/storage/xtradb/buf/buf0lru.cc @@ -607,6 +607,7 @@ rescan: bpage != NULL; bpage = prev) { + ut_ad(!must_restart); ut_a(buf_page_in_file(bpage)); /* Save the previous link because once we free the @@ -624,9 +625,6 @@ rescan: /* Remove was unsuccessful, we have to try again by scanning the entire list from the end. - This also means that we never released the - flush list mutex. Therefore we can trust the prev - pointer. buf_flush_or_remove_page() released the flush list mutex but not the LRU list mutex. Therefore it is possible that a new page was @@ -643,6 +641,11 @@ rescan: iteration. */ all_freed = false; + if (UNIV_UNLIKELY(must_restart)) { + + /* Cannot trust the prev pointer */ + break; + } } else if (flush) { /* The processing was successful. And during the @@ -650,12 +653,9 @@ rescan: when calling buf_page_flush(). We cannot trust prev pointer. */ goto rescan; - } else if (UNIV_UNLIKELY(must_restart)) { - - ut_ad(!all_freed); - break; } + ut_ad(!must_restart); ++processed; /* Yield if we have hogged the CPU and mutexes for too long. */ @@ -666,6 +666,11 @@ rescan: /* Reset the batch size counter if we had to yield. */ processed = 0; + } else if (UNIV_UNLIKELY(must_restart)) { + + /* Cannot trust the prev pointer */ + all_freed = false; + break; } #ifdef DBUG_OFF diff --git a/storage/xtradb/dict/dict0crea.cc b/storage/xtradb/dict/dict0crea.cc index 68cbde8c342..e2c7355b2e4 100644 --- a/storage/xtradb/dict/dict0crea.cc +++ b/storage/xtradb/dict/dict0crea.cc @@ -1369,7 +1369,7 @@ dict_create_or_check_foreign_constraint_tables(void) ib_logf(IB_LOG_LEVEL_WARN, "Dropping incompletely created " "SYS_FOREIGN table."); - row_drop_table_for_mysql("SYS_FOREIGN", trx, TRUE); + row_drop_table_for_mysql("SYS_FOREIGN", trx, TRUE, TRUE); } if (sys_foreign_cols_err == DB_CORRUPTION) { @@ -1377,7 +1377,7 @@ dict_create_or_check_foreign_constraint_tables(void) "Dropping incompletely created " "SYS_FOREIGN_COLS table."); - row_drop_table_for_mysql("SYS_FOREIGN_COLS", trx, TRUE); + row_drop_table_for_mysql("SYS_FOREIGN_COLS", trx, TRUE, TRUE); } ib_logf(IB_LOG_LEVEL_WARN, @@ -1431,8 +1431,8 @@ dict_create_or_check_foreign_constraint_tables(void) ut_ad(err == DB_OUT_OF_FILE_SPACE || err == DB_TOO_MANY_CONCURRENT_TRXS); - row_drop_table_for_mysql("SYS_FOREIGN", trx, TRUE); - row_drop_table_for_mysql("SYS_FOREIGN_COLS", trx, TRUE); + row_drop_table_for_mysql("SYS_FOREIGN", trx, TRUE, TRUE); + row_drop_table_for_mysql("SYS_FOREIGN_COLS", trx, TRUE, TRUE); if (err == DB_OUT_OF_FILE_SPACE) { err = DB_MUST_GET_MORE_FILE_SPACE; @@ -1856,7 +1856,7 @@ dict_create_or_check_sys_tablespace(void) ib_logf(IB_LOG_LEVEL_WARN, "Dropping incompletely created " "SYS_TABLESPACES table."); - row_drop_table_for_mysql("SYS_TABLESPACES", trx, TRUE); + row_drop_table_for_mysql("SYS_TABLESPACES", trx, TRUE, TRUE); } if (sys_datafiles_err == DB_CORRUPTION) { @@ -1864,7 +1864,7 @@ dict_create_or_check_sys_tablespace(void) "Dropping incompletely created " "SYS_DATAFILES table."); - row_drop_table_for_mysql("SYS_DATAFILES", trx, TRUE); + row_drop_table_for_mysql("SYS_DATAFILES", trx, TRUE, TRUE); } ib_logf(IB_LOG_LEVEL_INFO, @@ -1900,8 +1900,8 @@ dict_create_or_check_sys_tablespace(void) ut_a(err == DB_OUT_OF_FILE_SPACE || err == DB_TOO_MANY_CONCURRENT_TRXS); - row_drop_table_for_mysql("SYS_TABLESPACES", trx, TRUE); - row_drop_table_for_mysql("SYS_DATAFILES", trx, TRUE); + row_drop_table_for_mysql("SYS_TABLESPACES", trx, TRUE, TRUE); + row_drop_table_for_mysql("SYS_DATAFILES", trx, TRUE, TRUE); if (err == DB_OUT_OF_FILE_SPACE) { err = DB_MUST_GET_MORE_FILE_SPACE; diff --git a/storage/xtradb/dict/dict0dict.cc b/storage/xtradb/dict/dict0dict.cc index 206038d36c9..a147fbbc671 100644 --- a/storage/xtradb/dict/dict0dict.cc +++ b/storage/xtradb/dict/dict0dict.cc @@ -1116,7 +1116,7 @@ dict_init(void) &dict_operation_lock, SYNC_DICT_OPERATION); if (!srv_read_only_mode) { - dict_foreign_err_file = os_file_create_tmpfile(); + dict_foreign_err_file = os_file_create_tmpfile(NULL); ut_a(dict_foreign_err_file); mutex_create(dict_foreign_err_mutex_key, diff --git a/storage/xtradb/dict/dict0load.cc b/storage/xtradb/dict/dict0load.cc index d6ed8acb39e..cf2a5b69509 100644 --- a/storage/xtradb/dict/dict0load.cc +++ b/storage/xtradb/dict/dict0load.cc @@ -1,6 +1,7 @@ /***************************************************************************** Copyright (c) 1996, 2013, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2016, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -488,7 +489,7 @@ err_len: return("incorrect column length in SYS_FOREIGN"); } - /* This recieves a dict_foreign_t* that points to a stack variable. + /* This receives a dict_foreign_t* that points to a stack variable. So mem_heap_free(foreign->heap) is not used as elsewhere. Since the heap used here is freed elsewhere, foreign->heap is not assigned. */ @@ -2242,8 +2243,9 @@ dict_get_and_save_data_dir_path( bool dict_mutex_own) /*!< in: true if dict_sys->mutex is owned already */ { - if (DICT_TF_HAS_DATA_DIR(table->flags) - && (!table->data_dir_path)) { + bool is_temp = DICT_TF2_FLAG_IS_SET(table, DICT_TF2_TEMPORARY); + + if (!is_temp && !table->data_dir_path && table->space) { char* path = fil_space_get_first_path(table->space); if (!dict_mutex_own) { @@ -2255,6 +2257,7 @@ dict_get_and_save_data_dir_path( } if (path) { + table->flags |= (1 << DICT_TF_POS_DATA_DIR); dict_save_data_dir_path(table, path); mem_free(path); } @@ -2395,16 +2398,14 @@ err_exit: } /* Use the remote filepath if needed. */ - if (DICT_TF_HAS_DATA_DIR(table->flags)) { - /* This needs to be added to the table - from SYS_DATAFILES */ - dict_get_and_save_data_dir_path(table, true); + /* This needs to be added to the table + from SYS_DATAFILES */ + dict_get_and_save_data_dir_path(table, true); - if (table->data_dir_path) { - filepath = os_file_make_remote_pathname( + if (table->data_dir_path) { + filepath = os_file_make_remote_pathname( table->data_dir_path, table->name, "ibd"); - } } /* Try to open the tablespace. We set the diff --git a/storage/xtradb/dict/dict0stats.cc b/storage/xtradb/dict/dict0stats.cc index 12ead09d829..5c283f693d5 100644 --- a/storage/xtradb/dict/dict0stats.cc +++ b/storage/xtradb/dict/dict0stats.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2009, 2014, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2009, 2015, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -1488,7 +1488,6 @@ on the leaf page. when comparing records @param[out] n_diff number of distinct records @param[out] n_external_pages number of external pages -@param[in,out] mtr mini-transaction @return number of distinct records on the leaf page */ static void @@ -1496,8 +1495,7 @@ dict_stats_analyze_index_below_cur( const btr_cur_t* cur, ulint n_prefix, ib_uint64_t* n_diff, - ib_uint64_t* n_external_pages, - mtr_t* mtr) + ib_uint64_t* n_external_pages) { dict_index_t* index; ulint space; @@ -1511,6 +1509,7 @@ dict_stats_analyze_index_below_cur( ulint* offsets2; ulint* offsets_rec; ulint size; + mtr_t mtr; index = btr_cur_get_index(cur); @@ -1549,12 +1548,14 @@ dict_stats_analyze_index_below_cur( function without analyzing any leaf pages */ *n_external_pages = 0; + mtr_start(&mtr); + /* descend to the leaf level on the B-tree */ for (;;) { block = buf_page_get_gen(space, zip_size, page_no, RW_S_LATCH, NULL /* no guessed block */, - BUF_GET, __FILE__, __LINE__, mtr); + BUF_GET, __FILE__, __LINE__, &mtr); page = buf_block_get_frame(block); @@ -1576,6 +1577,8 @@ dict_stats_analyze_index_below_cur( ut_a(*n_diff > 0); if (*n_diff == 1) { + mtr_commit(&mtr); + /* page has all keys equal and the end of the page was reached by dict_stats_scan_page(), no need to descend to the leaf level */ @@ -1600,7 +1603,7 @@ dict_stats_analyze_index_below_cur( } /* make sure we got a leaf page as a result from the above loop */ - ut_ad(btr_page_get_level(page, mtr) == 0); + ut_ad(btr_page_get_level(page, &mtr) == 0); /* scan the leaf page and find the number of distinct keys, when looking only at the first n_prefix columns; also estimate @@ -1617,6 +1620,7 @@ dict_stats_analyze_index_below_cur( __func__, page_no, n_diff); #endif + mtr_commit(&mtr); mem_heap_free(heap); } @@ -1826,8 +1830,7 @@ dict_stats_analyze_index_for_n_prefix( dict_stats_analyze_index_below_cur(btr_pcur_get_btr_cur(&pcur), n_prefix, &n_diff_on_leaf_page, - &n_external_pages, - mtr); + &n_external_pages); /* We adjust n_diff_on_leaf_page here to avoid counting one record twice - once as the last on some page and once diff --git a/storage/xtradb/fil/fil0crypt.cc b/storage/xtradb/fil/fil0crypt.cc index ceffa950739..4b7102d9fd6 100644 --- a/storage/xtradb/fil/fil0crypt.cc +++ b/storage/xtradb/fil/fil0crypt.cc @@ -465,7 +465,7 @@ fil_parse_write_crypt_data( buf_block_t* block) /*!< in: buffer block */ { /* check that redo log entry is complete */ - uint entry_size = + size_t entry_size = 4 + // size of space_id 2 + // size of offset 1 + // size of type @@ -474,7 +474,7 @@ fil_parse_write_crypt_data( 4 + // size of key_id 1; // fil_encryption_t - if (end_ptr - ptr < entry_size){ + if ((size_t) (end_ptr - ptr) < entry_size){ return NULL; } @@ -484,7 +484,7 @@ fil_parse_write_crypt_data( ptr += 2; uint type = mach_read_from_1(ptr); ptr += 1; - uint len = mach_read_from_1(ptr); + size_t len = mach_read_from_1(ptr); ptr += 1; ut_a(type == CRYPT_SCHEME_UNENCRYPTED || @@ -500,7 +500,7 @@ fil_parse_write_crypt_data( fil_encryption_t encryption = (fil_encryption_t)mach_read_from_1(ptr); ptr +=1; - if (end_ptr - ptr < len) { + if ((size_t) (end_ptr - ptr) < len) { return NULL; } @@ -1351,7 +1351,7 @@ fil_crypt_space_needs_rotation( last_scrub_completed; bool need_scrubbing = crypt_data->rotate_state.scrubbing.is_active - && diff >= srv_background_scrub_data_interval; + && diff >= (time_t) srv_background_scrub_data_interval; if (need_key_rotation == false && need_scrubbing == false) break; @@ -2247,7 +2247,7 @@ DECLARE_THREAD(fil_crypt_thread)( time_t waited = time(0) - wait_start; - if (waited >= srv_background_scrub_data_check_interval) { + if (waited >= (time_t) srv_background_scrub_data_check_interval) { break; } } diff --git a/storage/xtradb/fil/fil0fil.cc b/storage/xtradb/fil/fil0fil.cc index 2da234ad094..b0695e2f260 100644 --- a/storage/xtradb/fil/fil0fil.cc +++ b/storage/xtradb/fil/fil0fil.cc @@ -1,7 +1,7 @@ /***************************************************************************** -Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2013, 2015, MariaDB Corporation. All Rights Reserved. +Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2013, 2016, MariaDB Corporation. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -719,16 +719,23 @@ fil_node_open_file( } if (UNIV_UNLIKELY(space->flags != flags)) { - fprintf(stderr, - "InnoDB: Error: table flags are 0x%lx" - " in the data dictionary\n" - "InnoDB: but the flags in file %s are 0x%lx!\n", - space->flags, node->name, flags); + ulint sflags = (space->flags & ~FSP_FLAGS_MASK_DATA_DIR); + ulint fflags = (flags & ~FSP_FLAGS_MASK_DATA_DIR_ORACLE); - ut_error; - } + /* DATA_DIR option is on different place on MariaDB + compared to MySQL. If this is the difference. Fix + it. */ + + if (sflags == fflags) { + fprintf(stderr, + "InnoDB: Warning: Table flags 0x%lx" + " in the data dictionary but in file %s are 0x%lx!\n" + " Temporally corrected because DATA_DIR option to 0x%lx.\n", + space->flags, node->name, flags, space->flags); + + flags = space->flags; + } - if (UNIV_UNLIKELY(space->flags != flags)) { if (!dict_tf_verify_flags(space->flags, flags)) { fprintf(stderr, "InnoDB: Error: table flags are 0x%lx" @@ -3218,8 +3225,6 @@ fil_create_link_file( const char* tablename, /*!< in: tablename */ const char* filepath) /*!< in: pathname of tablespace */ { - os_file_t file; - ibool success; dberr_t err = DB_SUCCESS; char* link_filepath; char* prev_filepath = fil_read_link_file(tablename); @@ -3238,16 +3243,24 @@ fil_create_link_file( link_filepath = fil_make_isl_name(tablename); - /* Note that OS_FILE_READ_WRITE_CACHED used here to avoid - unnecessary errors on O_DIRECT, link files are not really - a data files. */ - file = os_file_create_simple_no_error_handling( - innodb_file_data_key, link_filepath, - OS_FILE_CREATE, OS_FILE_READ_WRITE_CACHED, &success, 0); + /** Check if the file already exists. */ + FILE* file = NULL; + ibool exists; + os_file_type_t ftype; - if (!success) { - /* The following call will print an error message */ - ulint error = os_file_get_last_error(true); + bool success = os_file_status(link_filepath, &exists, &ftype); + + ulint error = 0; + if (success && !exists) { + file = fopen(link_filepath, "w"); + if (file == NULL) { + /* This call will print its own error message */ + error = os_file_get_last_error(true); + } + } else { + error = OS_FILE_ALREADY_EXISTS; + } + if (error != 0) { ut_print_timestamp(stderr); fputs(" InnoDB: Cannot create file ", stderr); @@ -3259,10 +3272,8 @@ fil_create_link_file( ut_print_filename(stderr, filepath); fputs(" already exists.\n", stderr); err = DB_TABLESPACE_EXISTS; - } else if (error == OS_FILE_DISK_FULL) { err = DB_OUT_OF_FILE_SPACE; - } else if (error == OS_FILE_OPERATION_NOT_SUPPORTED) { err = DB_UNSUPPORTED; } else { @@ -3274,13 +3285,17 @@ fil_create_link_file( return(err); } - if (!os_file_write(link_filepath, file, filepath, 0, - strlen(filepath))) { + ulint rbytes = fwrite(filepath, 1, strlen(filepath), file); + if (rbytes != strlen(filepath)) { + os_file_get_last_error(true); + ib_logf(IB_LOG_LEVEL_ERROR, + "cannot write link file " + "%s",filepath); err = DB_ERROR; } /* Close the file, we only need it at startup */ - os_file_close(file); + fclose(file); mem_free(link_filepath); @@ -3829,8 +3844,18 @@ fil_open_single_table_tablespace( /* Validate this single-table-tablespace with SYS_TABLES, but do not compare the DATA_DIR flag, in case the tablespace was relocated. */ + + ulint newf = def.flags; + if (newf != mod_flags) { + if (FSP_FLAGS_HAS_DATA_DIR(newf)) { + newf = (newf & ~FSP_FLAGS_MASK_DATA_DIR); + } else if(FSP_FLAGS_HAS_DATA_DIR_ORACLE(newf)) { + newf = (newf & ~FSP_FLAGS_MASK_DATA_DIR_ORACLE); + } + } + if (def.valid && def.id == id - && (def.flags & ~FSP_FLAGS_MASK_DATA_DIR) == mod_flags) { + && newf == mod_flags) { valid_tablespaces_found++; } else { def.valid = false; @@ -3855,8 +3880,17 @@ fil_open_single_table_tablespace( /* Validate this single-table-tablespace with SYS_TABLES, but do not compare the DATA_DIR flag, in case the tablespace was relocated. */ + ulint newf = remote.flags; + if (newf != mod_flags) { + if (FSP_FLAGS_HAS_DATA_DIR(newf)) { + newf = (newf & ~FSP_FLAGS_MASK_DATA_DIR); + } else if(FSP_FLAGS_HAS_DATA_DIR_ORACLE(newf)) { + newf = (newf & ~FSP_FLAGS_MASK_DATA_DIR_ORACLE); + } + } + if (remote.valid && remote.id == id - && (remote.flags & ~FSP_FLAGS_MASK_DATA_DIR) == mod_flags) { + && newf == mod_flags) { valid_tablespaces_found++; } else { remote.valid = false; @@ -3882,8 +3916,17 @@ fil_open_single_table_tablespace( /* Validate this single-table-tablespace with SYS_TABLES, but do not compare the DATA_DIR flag, in case the tablespace was relocated. */ + ulint newf = dict.flags; + if (newf != mod_flags) { + if (FSP_FLAGS_HAS_DATA_DIR(newf)) { + newf = (newf & ~FSP_FLAGS_MASK_DATA_DIR); + } else if(FSP_FLAGS_HAS_DATA_DIR_ORACLE(newf)) { + newf = (newf & ~FSP_FLAGS_MASK_DATA_DIR_ORACLE); + } + } + if (dict.valid && dict.id == id - && (dict.flags & ~FSP_FLAGS_MASK_DATA_DIR) == mod_flags) { + && newf == mod_flags) { valid_tablespaces_found++; } else { dict.valid = false; @@ -5249,7 +5292,7 @@ retry: if (posix_fallocate(node->handle, start_offset, len) == -1) { ib_logf(IB_LOG_LEVEL_ERROR, "preallocating file " "space for file \'%s\' failed. Current size " - INT64PF ", desired size " INT64PF "\n", + INT64PF ", desired size " INT64PF, node->name, start_offset, len+start_offset); os_file_handle_error_no_exit(node->name, "posix_fallocate", FALSE, __FILE__, __LINE__); success = FALSE; @@ -5293,12 +5336,15 @@ retry: os_offset_t offset = ((os_offset_t) (start_page_no - file_start_page_no)) * page_size; + + const char* name = node->name == NULL ? space->name : node->name; + #ifdef UNIV_HOTBACKUP - success = os_file_write(node->name, node->handle, buf, + success = os_file_write(name, node->handle, buf, offset, page_size * n_pages); #else success = os_aio(OS_FILE_WRITE, 0, OS_AIO_SYNC, - node->name, node->handle, buf, + name, node->handle, buf, offset, page_size * n_pages, page_size, node, NULL, space_id, NULL, 0); #endif /* UNIV_HOTBACKUP */ @@ -5962,22 +6008,12 @@ _fil_io( } } + const char* name = node->name == NULL ? space->name : node->name; + /* Queue the aio request */ - ret = os_aio( - type, - is_log, - mode | wake_later, - node->name, - node->handle, - buf, - offset, - len, - zip_size ? zip_size : UNIV_PAGE_SIZE, - node, - message, - space_id, - trx, - write_size); + ret = os_aio(type, is_log, mode | wake_later, name, node->handle, buf, + offset, len, zip_size ? zip_size : UNIV_PAGE_SIZE, node, + message, space_id, trx, write_size); #else /* In mysqlbackup do normal i/o, not aio */ @@ -5985,7 +6021,7 @@ _fil_io( ret = os_file_read(node->handle, buf, offset, len); } else { ut_ad(!srv_read_only_mode); - ret = os_file_write(node->name, node->handle, buf, + ret = os_file_write(name, node->handle, buf, offset, len); } #endif /* !UNIV_HOTBACKUP */ @@ -6418,10 +6454,7 @@ fil_close(void) { fil_space_crypt_cleanup(); -#ifndef UNIV_HOTBACKUP - /* The mutex should already have been freed. */ - ut_ad(fil_system->mutex.magic_n == 0); -#endif /* !UNIV_HOTBACKUP */ + mutex_free(&fil_system->mutex); hash_table_free(fil_system->spaces); @@ -7070,27 +7103,6 @@ fil_mtr_rename_log( /************************************************************************* functions to access is_corrupt flag of fil_space_t*/ -ibool -fil_space_is_corrupt( -/*=================*/ - ulint space_id) -{ - fil_space_t* space; - ibool ret = FALSE; - - mutex_enter(&fil_system->mutex); - - space = fil_space_get_by_id(space_id); - - if (UNIV_UNLIKELY(space && space->is_corrupt)) { - ret = TRUE; - } - - mutex_exit(&fil_system->mutex); - - return(ret); -} - void fil_space_set_corrupt( /*==================*/ diff --git a/storage/xtradb/fil/fil0pagecompress.cc b/storage/xtradb/fil/fil0pagecompress.cc index 4451116337e..fe4f64d88ca 100644 --- a/storage/xtradb/fil/fil0pagecompress.cc +++ b/storage/xtradb/fil/fil0pagecompress.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (C) 2013, 2015, MariaDB Corporation. All Rights Reserved. +Copyright (C) 2013, 2016, MariaDB Corporation. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -446,8 +446,11 @@ fil_decompress_page( byte* buf, /*!< out: buffer from which to read; in aio this must be appropriately aligned */ ulong len, /*!< in: length of output buffer.*/ - ulint* write_size) /*!< in/out: Actual payload size of + ulint* write_size, /*!< in/out: Actual payload size of the compressed data. */ + bool return_error) /*!< in: true if only an error should + be produced when decompression fails. + By default this parameter is false. */ { int err = 0; ulint actual_size = 0; @@ -492,6 +495,9 @@ fil_decompress_page( mach_read_from_2(buf+FIL_PAGE_TYPE), len); fflush(stderr); + if (return_error) { + goto error_return; + } ut_error; } @@ -511,6 +517,9 @@ fil_decompress_page( " actual size %lu compression %s.", actual_size, fil_get_compression_alg_name(compression_alg)); fflush(stderr); + if (return_error) { + goto error_return; + } ut_error; } @@ -542,6 +551,9 @@ fil_decompress_page( fflush(stderr); + if (return_error) { + goto error_return; + } ut_error; } break; @@ -558,6 +570,9 @@ fil_decompress_page( err, actual_size, len); fflush(stderr); + if (return_error) { + goto error_return; + } ut_error; } break; @@ -576,6 +591,9 @@ fil_decompress_page( olen, actual_size, len); fflush(stderr); + if (return_error) { + goto error_return; + } ut_error; } break; @@ -609,6 +627,9 @@ fil_decompress_page( dst_pos, actual_size, len); fflush(stderr); + if (return_error) { + goto error_return; + } ut_error; } @@ -635,6 +656,9 @@ fil_decompress_page( dst_pos, actual_size, len, err); fflush(stderr); + if (return_error) { + goto error_return; + } ut_error; } break; @@ -660,6 +684,9 @@ fil_decompress_page( olen, actual_size, len, (int)cstatus); fflush(stderr); + if (return_error) { + goto error_return; + } ut_error; } break; @@ -673,6 +700,9 @@ fil_decompress_page( ,fil_get_compression_alg_name(compression_alg)); fflush(stderr); + if (return_error) { + goto error_return; + } ut_error; break; } @@ -683,6 +713,7 @@ fil_decompress_page( really any other options. */ memcpy(buf, in_buf, len); +error_return: // Need to free temporal buffer if no buffer was given if (page_buf == NULL) { ut_free(in_buf); diff --git a/storage/xtradb/fts/fts0fts.cc b/storage/xtradb/fts/fts0fts.cc index 712dfa264d4..a2e8a3d90ac 100644 --- a/storage/xtradb/fts/fts0fts.cc +++ b/storage/xtradb/fts/fts0fts.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2011, 2015, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2011, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -260,16 +260,18 @@ static const char* fts_config_table_insert_values_sql = "INSERT INTO \"%s\" VALUES ('" FTS_TABLE_STATE "', '0');\n"; -/****************************************************************//** -Run SYNC on the table, i.e., write out data from the cache to the +/** Run SYNC on the table, i.e., write out data from the cache to the FTS auxiliary INDEX table and clear the cache at the end. -@return DB_SUCCESS if all OK */ +@param[in,out] sync sync state +@param[in] unlock_cache whether unlock cache lock when write node +@param[in] wait whether wait when a sync is in progress +@return DB_SUCCESS if all OK */ static dberr_t fts_sync( -/*=====*/ - fts_sync_t* sync) /*!< in: sync state */ - __attribute__((nonnull)); + fts_sync_t* sync, + bool unlock_cache, + bool wait); /****************************************************************//** Release all resources help by the words rb tree e.g., the node ilist. */ @@ -653,6 +655,7 @@ fts_cache_create( mem_heap_zalloc(heap, sizeof(fts_sync_t))); cache->sync->table = table; + cache->sync->event = os_event_create(); /* Create the index cache vector that will hold the inverted indexes. */ cache->indexes = ib_vector_create( @@ -1207,6 +1210,7 @@ fts_cache_destroy( mutex_free(&cache->optimize_lock); mutex_free(&cache->deleted_lock); mutex_free(&cache->doc_id_lock); + os_event_free(cache->sync->event); if (cache->stopword_info.cached_stopword) { rbt_free(cache->stopword_info.cached_stopword); @@ -1435,7 +1439,7 @@ fts_cache_add_doc( ib_vector_last(word->nodes)); } - if (fts_node == NULL + if (fts_node == NULL || fts_node->synced || fts_node->ilist_size > FTS_ILIST_MAX_SIZE || doc_id < fts_node->last_doc_id) { @@ -1915,7 +1919,7 @@ func_exit: trx_rollback_to_savepoint(trx, NULL); - row_drop_table_for_mysql(table->name, trx, FALSE); + row_drop_table_for_mysql(table->name, trx, FALSE, TRUE); trx->error_state = DB_SUCCESS; } @@ -2067,7 +2071,7 @@ fts_create_index_tables_low( trx_rollback_to_savepoint(trx, NULL); - row_drop_table_for_mysql(table_name, trx, FALSE); + row_drop_table_for_mysql(table_name, trx, FALSE, TRUE); trx->error_state = DB_SUCCESS; } @@ -2886,35 +2890,28 @@ fts_doc_ids_free( } /*********************************************************************//** -Do commit-phase steps necessary for the insertion of a new row. -@return DB_SUCCESS or error code */ -static __attribute__((nonnull, warn_unused_result)) -dberr_t +Do commit-phase steps necessary for the insertion of a new row. */ +void fts_add( /*====*/ fts_trx_table_t*ftt, /*!< in: FTS trx table */ fts_trx_row_t* row) /*!< in: row */ { dict_table_t* table = ftt->table; - dberr_t error = DB_SUCCESS; doc_id_t doc_id = row->doc_id; ut_a(row->state == FTS_INSERT || row->state == FTS_MODIFY); fts_add_doc_by_id(ftt, doc_id, row->fts_indexes); - if (error == DB_SUCCESS) { - mutex_enter(&table->fts->cache->deleted_lock); - ++table->fts->cache->added; - mutex_exit(&table->fts->cache->deleted_lock); + mutex_enter(&table->fts->cache->deleted_lock); + ++table->fts->cache->added; + mutex_exit(&table->fts->cache->deleted_lock); - if (!DICT_TF2_FLAG_IS_SET(table, DICT_TF2_FTS_HAS_DOC_ID) - && doc_id >= table->fts->cache->next_doc_id) { - table->fts->cache->next_doc_id = doc_id + 1; - } + if (!DICT_TF2_FLAG_IS_SET(table, DICT_TF2_FTS_HAS_DOC_ID) + && doc_id >= table->fts->cache->next_doc_id) { + table->fts->cache->next_doc_id = doc_id + 1; } - - return(error); } /*********************************************************************//** @@ -3025,7 +3022,7 @@ fts_modify( error = fts_delete(ftt, row); if (error == DB_SUCCESS) { - error = fts_add(ftt, row); + fts_add(ftt, row); } return(error); @@ -3114,7 +3111,7 @@ fts_commit_table( switch (row->state) { case FTS_INSERT: - error = fts_add(ftt, row); + fts_add(ftt, row); break; case FTS_MODIFY: @@ -3554,16 +3551,34 @@ fts_add_doc_by_id( get_doc->index_cache, doc_id, doc.tokens); + bool need_sync = false; + if ((cache->total_size > fts_max_cache_size / 10 + || fts_need_sync) + && !cache->sync->in_progress) { + need_sync = true; + } + rw_lock_x_unlock(&table->fts->cache->lock); DBUG_EXECUTE_IF( "fts_instrument_sync", - fts_sync(cache->sync); + fts_optimize_request_sync_table(table); + os_event_wait(cache->sync->event); ); - if (cache->total_size > fts_max_cache_size - || fts_need_sync) { - fts_sync(cache->sync); + DBUG_EXECUTE_IF( + "fts_instrument_sync_debug", + fts_sync(cache->sync, true, true); + ); + + DEBUG_SYNC_C("fts_instrument_sync_request"); + DBUG_EXECUTE_IF( + "fts_instrument_sync_request", + fts_optimize_request_sync_table(table); + ); + + if (need_sync) { + fts_optimize_request_sync_table(table); } mtr_start(&mtr); @@ -3934,16 +3949,17 @@ fts_sync_add_deleted_cache( return(error); } -/*********************************************************************//** -Write the words and ilist to disk. +/** Write the words and ilist to disk. +@param[in,out] trx transaction +@param[in] index_cache index cache +@param[in] unlock_cache whether unlock cache when write node @return DB_SUCCESS if all went well else error code */ static __attribute__((nonnull, warn_unused_result)) dberr_t fts_sync_write_words( -/*=================*/ - trx_t* trx, /*!< in: transaction */ - fts_index_cache_t* - index_cache) /*!< in: index cache */ + trx_t* trx, + fts_index_cache_t* index_cache, + bool unlock_cache) { fts_table_t fts_table; ulint n_nodes = 0; @@ -3951,8 +3967,8 @@ fts_sync_write_words( const ib_rbt_node_t* rbt_node; dberr_t error = DB_SUCCESS; ibool print_error = FALSE; -#ifdef FTS_DOC_STATS_DEBUG dict_table_t* table = index_cache->index->table; +#ifdef FTS_DOC_STATS_DEBUG ulint n_new_words = 0; #endif /* FTS_DOC_STATS_DEBUG */ @@ -3965,7 +3981,7 @@ fts_sync_write_words( since we want to free the memory used during caching. */ for (rbt_node = rbt_first(index_cache->words); rbt_node; - rbt_node = rbt_first(index_cache->words)) { + rbt_node = rbt_next(index_cache->words, rbt_node)) { ulint i; ulint selected; @@ -3998,27 +4014,47 @@ fts_sync_write_words( } #endif /* FTS_DOC_STATS_DEBUG */ - n_nodes += ib_vector_size(word->nodes); - - /* We iterate over all the nodes even if there was an error, - this is to free the memory of the fts_node_t elements. */ + /* We iterate over all the nodes even if there was an error */ for (i = 0; i < ib_vector_size(word->nodes); ++i) { fts_node_t* fts_node = static_cast( ib_vector_get(word->nodes, i)); + if (fts_node->synced) { + continue; + } else { + fts_node->synced = true; + } + + /*FIXME: we need to handle the error properly. */ if (error == DB_SUCCESS) { + if (unlock_cache) { + rw_lock_x_unlock( + &table->fts->cache->lock); + } error = fts_write_node( trx, &index_cache->ins_graph[selected], &fts_table, &word->text, fts_node); - } - ut_free(fts_node->ilist); - fts_node->ilist = NULL; + DEBUG_SYNC_C("fts_write_node"); + DBUG_EXECUTE_IF("fts_write_node_crash", + DBUG_SUICIDE();); + + DBUG_EXECUTE_IF("fts_instrument_sync_sleep", + os_thread_sleep(1000000); + ); + + if (unlock_cache) { + rw_lock_x_lock( + &table->fts->cache->lock); + } + } } + n_nodes += ib_vector_size(word->nodes); + if (error != DB_SUCCESS && !print_error) { ut_print_timestamp(stderr); fprintf(stderr, " InnoDB: Error (%s) writing " @@ -4027,9 +4063,6 @@ fts_sync_write_words( print_error = TRUE; } - - /* NOTE: We are responsible for free'ing the node */ - ut_free(rbt_remove_node(index_cache->words, rbt_node)); } #ifdef FTS_DOC_STATS_DEBUG @@ -4330,7 +4363,7 @@ fts_sync_index( ut_ad(rbt_validate(index_cache->words)); - error = fts_sync_write_words(trx, index_cache); + error = fts_sync_write_words(sync->trx, index_cache, sync->unlock_cache); #ifdef FTS_DOC_STATS_DEBUG /* FTS_RESOLVE: the word counter info in auxiliary table "DOC_ID" @@ -4346,6 +4379,36 @@ fts_sync_index( return(error); } +/** Check if index cache has been synced completely +@param[in,out] sync sync state +@param[in,out] index_cache index cache +@return true if index is synced, otherwise false. */ +static +bool +fts_sync_index_check( + fts_sync_t* sync, + fts_index_cache_t* index_cache) +{ + const ib_rbt_node_t* rbt_node; + + for (rbt_node = rbt_first(index_cache->words); + rbt_node != NULL; + rbt_node = rbt_next(index_cache->words, rbt_node)) { + + fts_tokenizer_word_t* word; + word = rbt_value(fts_tokenizer_word_t, rbt_node); + + fts_node_t* fts_node; + fts_node = static_cast(ib_vector_last(word->nodes)); + + if (!fts_node->synced) { + return(false); + } + } + + return(true); +} + /*********************************************************************//** Commit the SYNC, change state of processed doc ids etc. @return DB_SUCCESS if all OK */ @@ -4422,21 +4485,53 @@ fts_sync_rollback( trx_t* trx = sync->trx; fts_cache_t* cache = sync->table->fts->cache; + for (ulint i = 0; i < ib_vector_size(cache->indexes); ++i) { + ulint j; + fts_index_cache_t* index_cache; + + index_cache = static_cast( + ib_vector_get(cache->indexes, i)); + + for (j = 0; fts_index_selector[j].value; ++j) { + + if (index_cache->ins_graph[j] != NULL) { + + fts_que_graph_free_check_lock( + NULL, index_cache, + index_cache->ins_graph[j]); + + index_cache->ins_graph[j] = NULL; + } + + if (index_cache->sel_graph[j] != NULL) { + + fts_que_graph_free_check_lock( + NULL, index_cache, + index_cache->sel_graph[j]); + + index_cache->sel_graph[j] = NULL; + } + } + } + rw_lock_x_unlock(&cache->lock); fts_sql_rollback(trx); trx_free_for_background(trx); } -/****************************************************************//** -Run SYNC on the table, i.e., write out data from the cache to the +/** Run SYNC on the table, i.e., write out data from the cache to the FTS auxiliary INDEX table and clear the cache at the end. +@param[in,out] sync sync state +@param[in] unlock_cache whether unlock cache lock when write node +@param[in] wait whether wait when a sync is in progress @return DB_SUCCESS if all OK */ static dberr_t fts_sync( -/*=====*/ - fts_sync_t* sync) /*!< in: sync state */ + fts_sync_t* sync, + bool unlock_cache, + bool wait) { ulint i; dberr_t error = DB_SUCCESS; @@ -4444,8 +4539,35 @@ fts_sync( rw_lock_x_lock(&cache->lock); + /* Check if cache is being synced. + Note: we release cache lock in fts_sync_write_words() to + avoid long wait for the lock by other threads. */ + while (sync->in_progress) { + rw_lock_x_unlock(&cache->lock); + + if (wait) { + os_event_wait(sync->event); + } else { + return(DB_SUCCESS); + } + + rw_lock_x_lock(&cache->lock); + } + + sync->unlock_cache = unlock_cache; + sync->in_progress = true; + + DEBUG_SYNC_C("fts_sync_begin"); fts_sync_begin(sync); +begin_sync: + if (cache->total_size > fts_max_cache_size) { + /* Avoid the case: sync never finish when + insert/update keeps comming. */ + ut_ad(sync->unlock_cache); + sync->unlock_cache = false; + } + for (i = 0; i < ib_vector_size(cache->indexes); ++i) { fts_index_cache_t* index_cache; @@ -4460,21 +4582,43 @@ fts_sync( if (error != DB_SUCCESS && !sync->interrupted) { - break; + goto end_sync; } } DBUG_EXECUTE_IF("fts_instrument_sync_interrupted", sync->interrupted = true; error = DB_INTERRUPTED; + goto end_sync; ); + /* Make sure all the caches are synced. */ + for (i = 0; i < ib_vector_size(cache->indexes); ++i) { + fts_index_cache_t* index_cache; + + index_cache = static_cast( + ib_vector_get(cache->indexes, i)); + + if (index_cache->index->to_be_dropped + || fts_sync_index_check(sync, index_cache)) { + continue; + } + + goto begin_sync; + } + +end_sync: if (error == DB_SUCCESS && !sync->interrupted) { error = fts_sync_commit(sync); } else { fts_sync_rollback(sync); } + rw_lock_x_lock(&cache->lock); + sync->in_progress = false; + os_event_set(sync->event); + rw_lock_x_unlock(&cache->lock); + /* We need to check whether an optimize is required, for that we make copies of the two variables that control the trigger. These variables can change behind our back and we don't want to hold the @@ -4489,21 +4633,25 @@ fts_sync( return(error); } -/****************************************************************//** -Run SYNC on the table, i.e., write out data from the cache to the -FTS auxiliary INDEX table and clear the cache at the end. */ +/** Run SYNC on the table, i.e., write out data from the cache to the +FTS auxiliary INDEX table and clear the cache at the end. +@param[in,out] table fts table +@param[in] unlock_cache whether unlock cache when write node +@param[in] wait whether wait for existing sync to finish +@return DB_SUCCESS on success, error code on failure. */ UNIV_INTERN dberr_t fts_sync_table( -/*===========*/ - dict_table_t* table) /*!< in: table */ + dict_table_t* table, + bool unlock_cache, + bool wait) { dberr_t err = DB_SUCCESS; ut_ad(table->fts); if (!dict_table_is_discarded(table) && table->fts->cache) { - err = fts_sync(table->fts->cache->sync); + err = fts_sync(table->fts->cache->sync, unlock_cache, wait); } return(err); diff --git a/storage/xtradb/fts/fts0opt.cc b/storage/xtradb/fts/fts0opt.cc index 0703b050848..ccb7090c61d 100644 --- a/storage/xtradb/fts/fts0opt.cc +++ b/storage/xtradb/fts/fts0opt.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2007, 2015, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2007, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -87,6 +87,7 @@ enum fts_msg_type_t { FTS_MSG_DEL_TABLE, /*!< Remove a table from the optimize threads work queue */ + FTS_MSG_SYNC_TABLE /*!< Sync fts cache of a table */ }; /** Compressed list of words that have been read from FTS INDEX @@ -580,7 +581,7 @@ fts_zip_read_word( #ifdef UNIV_DEBUG ulint i; #endif - byte len = 0; + short len = 0; void* null = NULL; byte* ptr = word->f_str; int flush = Z_NO_FLUSH; @@ -590,7 +591,7 @@ fts_zip_read_word( return(NULL); } - zip->zp->next_out = &len; + zip->zp->next_out = reinterpret_cast(&len); zip->zp->avail_out = sizeof(len); while (zip->status == Z_OK && zip->zp->avail_out > 0) { @@ -688,11 +689,12 @@ fts_fetch_index_words( fts_zip_t* zip = static_cast(user_arg); que_node_t* exp = sel_node->select_list; dfield_t* dfield = que_node_get_val(exp); - byte len = (byte) dfield_get_len(dfield); + short len = static_cast(dfield_get_len(dfield)); void* data = dfield_get_data(dfield); /* Skip the duplicate words. */ - if (zip->word.f_len == len && !memcmp(zip->word.f_str, data, len)) { + if (zip->word.f_len == static_cast(len) + && !memcmp(zip->word.f_str, data, len)) { return(TRUE); } @@ -706,7 +708,7 @@ fts_fetch_index_words( ut_a(zip->zp->next_in == NULL); /* The string is prefixed by len. */ - zip->zp->next_in = &len; + zip->zp->next_in = reinterpret_cast(&len); zip->zp->avail_in = sizeof(len); /* Compress the word, create output blocks as necessary. */ @@ -2651,6 +2653,39 @@ fts_optimize_remove_table( os_event_free(event); } +/** Send sync fts cache for the table. +@param[in] table table to sync */ +UNIV_INTERN +void +fts_optimize_request_sync_table( + dict_table_t* table) +{ + fts_msg_t* msg; + table_id_t* table_id; + + /* if the optimize system not yet initialized, return */ + if (!fts_optimize_wq) { + return; + } + + /* FTS optimizer thread is already exited */ + if (fts_opt_start_shutdown) { + ib_logf(IB_LOG_LEVEL_INFO, + "Try to sync table %s after FTS optimize" + " thread exiting.", table->name); + return; + } + + msg = fts_optimize_create_msg(FTS_MSG_SYNC_TABLE, NULL); + + table_id = static_cast( + mem_heap_alloc(msg->heap, sizeof(table_id_t))); + *table_id = table->id; + msg->ptr = table_id; + + ib_wqueue_add(fts_optimize_wq, msg, msg->heap); +} + /**********************************************************************//** Find the slot for a particular table. @return slot if found else NULL. */ @@ -2931,6 +2966,25 @@ fts_optimize_need_sync( } #endif +/** Sync fts cache of a table +@param[in] table_id table id */ +void +fts_optimize_sync_table( + table_id_t table_id) +{ + dict_table_t* table = NULL; + + table = dict_table_open_on_id(table_id, FALSE, DICT_TABLE_OP_NORMAL); + + if (table) { + if (dict_table_has_fts_index(table) && table->fts->cache) { + fts_sync_table(table, true, false); + } + + dict_table_close(table, FALSE, FALSE); + } +} + /**********************************************************************//** Optimize all FTS tables. @return Dummy return */ @@ -3052,6 +3106,11 @@ fts_optimize_thread( ((fts_msg_del_t*) msg->ptr)->event); break; + case FTS_MSG_SYNC_TABLE: + fts_optimize_sync_table( + *static_cast(msg->ptr)); + break; + default: ut_error; } @@ -3078,26 +3137,7 @@ fts_optimize_thread( ib_vector_get(tables, i)); if (slot->state != FTS_STATE_EMPTY) { - dict_table_t* table = NULL; - - /*slot->table may be freed, so we try to open - table by slot->table_id.*/ - table = dict_table_open_on_id( - slot->table_id, FALSE, - DICT_TABLE_OP_NORMAL); - - if (table) { - - if (dict_table_has_fts_index(table)) { - fts_sync_table(table); - } - - if (table->fts) { - fts_free(table); - } - - dict_table_close(table, FALSE, FALSE); - } + fts_optimize_sync_table(slot->table_id); } } } diff --git a/storage/xtradb/ha/ha0ha.cc b/storage/xtradb/ha/ha0ha.cc index b79ae922045..3674260f173 100644 --- a/storage/xtradb/ha/ha0ha.cc +++ b/storage/xtradb/ha/ha0ha.cc @@ -155,11 +155,15 @@ ha_clear( switch (table->type) { case HASH_TABLE_SYNC_MUTEX: + for (ulint i = 0; i < table->n_sync_obj; i++) + mutex_free(table->sync_obj.mutexes + i); mem_free(table->sync_obj.mutexes); table->sync_obj.mutexes = NULL; break; case HASH_TABLE_SYNC_RW_LOCK: + for (ulint i = 0; i < table->n_sync_obj; i++) + rw_lock_free(table->sync_obj.rw_locks + i); mem_free(table->sync_obj.rw_locks); table->sync_obj.rw_locks = NULL; break; diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc index df0f74fbb92..292d498ebfb 100644 --- a/storage/xtradb/handler/ha_innodb.cc +++ b/storage/xtradb/handler/ha_innodb.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2000, 2015, Oracle and/or its affiliates. +Copyright (c) 2000, 2016, Oracle and/or its affiliates. Copyright (c) 2013, 2016, MariaDB Corporation. Copyright (c) 2008, 2009 Google Inc. Copyright (c) 2009, Percona Inc. @@ -617,7 +617,6 @@ ib_cb_t innodb_api_cb[] = { (ib_cb_t) ib_trx_read_only }; - static void innodb_remember_check_sysvar_funcs(); mysql_var_check_func check_sysvar_enum; @@ -652,6 +651,67 @@ ha_create_table_option innodb_table_option_list[]= HA_TOPTION_END }; +/** + Test a file path whether it is same as mysql data directory path. + + @param path null terminated character string + + @return + @retval TRUE The path is different from mysql data directory. + @retval FALSE The path is same as mysql data directory. +*/ +static bool is_mysql_datadir_path(const char *path) +{ + if (path == NULL) + return false; + + char mysql_data_dir[FN_REFLEN], path_dir[FN_REFLEN]; + convert_dirname(path_dir, path, NullS); + convert_dirname(mysql_data_dir, mysql_unpacked_real_data_home, NullS); + size_t mysql_data_home_len= dirname_length(mysql_data_dir); + size_t path_len = dirname_length(path_dir); + + if (path_len < mysql_data_home_len) + return true; + + if (!lower_case_file_system) + return(memcmp(mysql_data_dir, path_dir, mysql_data_home_len)); + + return(files_charset_info->coll->strnncoll(files_charset_info, + (uchar *) path_dir, path_len, + (uchar *) mysql_data_dir, + mysql_data_home_len, + TRUE)); +} + + +static int mysql_tmpfile_path(const char *path, const char *prefix) +{ + DBUG_ASSERT(path != NULL); + DBUG_ASSERT((strlen(path) + strlen(prefix)) <= FN_REFLEN); + + char filename[FN_REFLEN]; + File fd = create_temp_file(filename, path, prefix, +#ifdef __WIN__ + O_BINARY | O_TRUNC | O_SEQUENTIAL | + O_SHORT_LIVED | +#endif /* __WIN__ */ + O_CREAT | O_EXCL | O_RDWR | O_TEMPORARY, + MYF(MY_WME)); + if (fd >= 0) { +#ifndef __WIN__ + /* + This can be removed once the following bug is fixed: + Bug #28903 create_temp_file() doesn't honor O_TEMPORARY option + (file not removed) (Unix) + */ + unlink(filename); +#endif /* !__WIN__ */ + } + + return fd; +} + /*************************************************************//** Check whether valid argument given to innodb_ft_*_stopword_table. This function is registered as a callback with MySQL. @@ -667,6 +727,108 @@ innodb_stopword_table_validate( for update function */ struct st_mysql_value* value); /*!< in: incoming string */ +/** Validate passed-in "value" is a valid directory name. +This function is registered as a callback with MySQL. +@param[in,out] thd thread handle +@param[in] var pointer to system variable +@param[out] save immediate result for update +@param[in] value incoming string +@return 0 for valid name */ +static +int +innodb_tmpdir_validate( + THD* thd, + struct st_mysql_sys_var* var, + void* save, + struct st_mysql_value* value) +{ + + char* alter_tmp_dir; + char* innodb_tmp_dir; + char buff[OS_FILE_MAX_PATH]; + int len = sizeof(buff); + char tmp_abs_path[FN_REFLEN + 2]; + + ut_ad(save != NULL); + ut_ad(value != NULL); + + if (check_global_access(thd, FILE_ACL)) { + push_warning_printf( + thd, Sql_condition::WARN_LEVEL_WARN, + ER_WRONG_ARGUMENTS, + "InnoDB: FILE Permissions required"); + *static_cast(save) = NULL; + return(1); + } + + alter_tmp_dir = (char*) value->val_str(value, buff, &len); + + if (!alter_tmp_dir) { + *static_cast(save) = alter_tmp_dir; + return(0); + } + + if (strlen(alter_tmp_dir) > FN_REFLEN) { + push_warning_printf( + thd, Sql_condition::WARN_LEVEL_WARN, + ER_WRONG_ARGUMENTS, + "Path length should not exceed %d bytes", FN_REFLEN); + *static_cast(save) = NULL; + return(1); + } + + my_realpath(tmp_abs_path, alter_tmp_dir, 0); + size_t tmp_abs_len = strlen(tmp_abs_path); + + if (my_access(tmp_abs_path, F_OK)) { + + push_warning_printf( + thd, Sql_condition::WARN_LEVEL_WARN, + ER_WRONG_ARGUMENTS, + "InnoDB: Path doesn't exist."); + *static_cast(save) = NULL; + return(1); + } else if (my_access(tmp_abs_path, R_OK | W_OK)) { + push_warning_printf( + thd, Sql_condition::WARN_LEVEL_WARN, + ER_WRONG_ARGUMENTS, + "InnoDB: Server doesn't have permission in " + "the given location."); + *static_cast(save) = NULL; + return(1); + } + + MY_STAT stat_info_dir; + + if (my_stat(tmp_abs_path, &stat_info_dir, MYF(0))) { + if ((stat_info_dir.st_mode & S_IFDIR) != S_IFDIR) { + + push_warning_printf( + thd, Sql_condition::WARN_LEVEL_WARN, + ER_WRONG_ARGUMENTS, + "Given path is not a directory. "); + *static_cast(save) = NULL; + return(1); + } + } + + if (!is_mysql_datadir_path(tmp_abs_path)) { + + push_warning_printf( + thd, Sql_condition::WARN_LEVEL_WARN, + ER_WRONG_ARGUMENTS, + "InnoDB: Path Location should not be same as " + "mysql data directory location."); + *static_cast(save) = NULL; + return(1); + } + + innodb_tmp_dir = static_cast( + thd_memdup(thd, tmp_abs_path, tmp_abs_len + 1)); + *static_cast(save) = innodb_tmp_dir; + return(0); +} + /** "GEN_CLUST_INDEX" is the name reserved for InnoDB default system clustered index when there is no primary key. */ const char innobase_index_reserve_name[] = "GEN_CLUST_INDEX"; @@ -796,6 +958,11 @@ static MYSQL_THDVAR_BOOL(fake_changes, PLUGIN_VAR_OPCMDARG, "This is to cause replication prefetch IO. ATTENTION: the transaction started after enabled is affected.", NULL, NULL, FALSE); +static MYSQL_THDVAR_STR(tmpdir, + PLUGIN_VAR_OPCMDARG|PLUGIN_VAR_MEMALLOC, + "Directory for temporary non-tablespace files.", + innodb_tmpdir_validate, NULL, NULL); + static ibool innodb_have_lzo=IF_LZO(1, 0); static ibool innodb_have_lz4=IF_LZ4(1, 0); static ibool innodb_have_lzma=IF_LZMA(1, 0); @@ -1492,6 +1659,28 @@ normalize_table_name_low( ibool set_lower_case); /* in: TRUE if we want to set name to lower case */ +/*************************************************************//** +Checks if buffer pool is big enough to enable backoff algorithm. +InnoDB empty free list algorithm backoff requires free pages +from LRU for the best performance. +buf_LRU_buf_pool_running_out cancels query if 1/4 of +buffer pool belongs to LRU or freelist. +At the same time buf_flush_LRU_list_batch +keeps up to BUF_LRU_MIN_LEN in LRU. +In order to avoid deadlock baclkoff requires buffer pool +to be at least 4*BUF_LRU_MIN_LEN, +but flush peformance is bad because of trashing +and additional BUF_LRU_MIN_LEN pages are requested. +@return true if it's possible to enable backoff. */ +static +bool +innodb_empty_free_list_algorithm_backoff_allowed( + srv_empty_free_list_t + algorithm, /*!< in: desired algorithm + from srv_empty_free_list_t */ + long long buf_pool_pages); /*!< in: total number + of pages inside buffer pool */ + #ifdef NOT_USED /*************************************************************//** Removes old archived transaction log files. @@ -1780,6 +1969,26 @@ thd_supports_xa( return(THDVAR(thd, support_xa)); } +/** Get the value of innodb_tmpdir. +@param[in] thd thread handle, or NULL to query + the global innodb_tmpdir. +@retval NULL if innodb_tmpdir="" */ +UNIV_INTERN +const char* +thd_innodb_tmpdir( + THD* thd) +{ +#ifdef UNIV_SYNC_DEBUG + ut_ad(!sync_thread_levels_nonempty_trx(false)); +#endif /* UNIV_SYNC_DEBUG */ + + const char* tmp_dir = THDVAR(thd, tmpdir); + if (tmp_dir != NULL && *tmp_dir == '\0') { + tmp_dir = NULL; + } + + return(tmp_dir); +} /******************************************************************//** Check the status of fake changes mode (innodb_fake_changes) @return true if fake change mode is enabled. */ @@ -2360,13 +2569,14 @@ innobase_get_lower_case_table_names(void) return(lower_case_table_names); } -/*********************************************************************//** -Creates a temporary file. +/** Create a temporary file in the location specified by the parameter +path. If the path is null, then it will be created in tmpdir. +@param[in] path location for creating temporary file @return temporary file descriptor, or < 0 on error */ UNIV_INTERN int -innobase_mysql_tmpfile(void) -/*========================*/ +innobase_mysql_tmpfile( + const char* path) { #ifdef WITH_INNODB_DISALLOW_WRITES os_event_wait(srv_allow_writes_event); @@ -2379,7 +2589,11 @@ innobase_mysql_tmpfile(void) return(-1); ); - fd = mysql_tmpfile("ib"); + if (path == NULL) { + fd = mysql_tmpfile("ib"); + } else { + fd = mysql_tmpfile_path(path, "ib"); + } if (fd >= 0) { /* Copy the file descriptor, so that the additional resources @@ -2922,7 +3136,7 @@ ha_innobase::ha_innobase( :handler(hton, table_arg), int_table_flags(HA_REC_NOT_IN_SEQ | HA_NULL_IN_KEY | HA_CAN_VIRTUAL_COLUMNS | - HA_CAN_INDEX_BLOBS | + HA_CAN_INDEX_BLOBS | HA_CONCURRENT_OPTIMIZE | HA_CAN_SQL_HANDLER | HA_PRIMARY_KEY_REQUIRED_FOR_POSITION | HA_PRIMARY_KEY_IN_READ_INDEX | @@ -3408,6 +3622,13 @@ ha_innobase::reset_template(void) ut_ad(prebuilt->magic_n == ROW_PREBUILT_ALLOCATED); ut_ad(prebuilt->magic_n2 == prebuilt->magic_n); + /* Force table to be freed in close_thread_table(). */ + DBUG_EXECUTE_IF("free_table_in_fts_query", + if (prebuilt->in_fts_query) { + table->m_needs_reopen = true; + } + ); + prebuilt->keep_other_fields_on_keyread = 0; prebuilt->read_just_key = 0; prebuilt->in_fts_query = 0; @@ -4035,6 +4256,16 @@ innobase_change_buffering_inited_ok: innobase_open_files = tc_size; } } + + if (innobase_open_files > (long) open_files_limit) { + fprintf(stderr, + "innodb_open_files should not be greater" + " than the open_files_limit.\n"); + if (innobase_open_files > (long) tc_size) { + innobase_open_files = tc_size; + } + } + srv_max_n_open_files = (ulint) innobase_open_files; srv_innodb_status = (ibool) innobase_create_status_file; @@ -4076,6 +4307,22 @@ innobase_change_buffering_inited_ok: #ifdef HAVE_POSIX_FALLOCATE srv_use_posix_fallocate = (ibool) innobase_use_fallocate; #endif + + /* Do not enable backoff algorithm for small buffer pool. */ + if (!innodb_empty_free_list_algorithm_backoff_allowed( + static_cast( + srv_empty_free_list_algorithm), + innobase_buffer_pool_size / srv_page_size)) { + sql_print_information( + "InnoDB: innodb_empty_free_list_algorithm " + "has been changed to legacy " + "because of small buffer pool size. " + "In order to use backoff, " + "increase buffer pool at least up to 20MB.\n"); + srv_empty_free_list_algorithm + = SRV_EMPTY_FREE_LIST_LEGACY; + } + srv_use_atomic_writes = (ibool) innobase_use_atomic_writes; if (innobase_use_atomic_writes) { ib_logf(IB_LOG_LEVEL_INFO, "using atomic writes."); @@ -5718,7 +5965,7 @@ building based on the assumption that there is no concurrent index creation/drop and DMLs that requires index lookup. All table handle will be closed before the index creation/drop. @return TRUE if index translation table built successfully */ -static +UNIV_INTERN ibool innobase_build_index_translation( /*=============================*/ @@ -6270,20 +6517,14 @@ table_opened: prebuilt->clust_index_was_generated = FALSE; if (UNIV_UNLIKELY(primary_key >= MAX_KEY)) { - sql_print_error("Table %s has a primary key in " - "InnoDB data dictionary, but not " - "in MySQL!", name); + ib_table->dict_frm_mismatch = DICT_FRM_NO_PK; /* This mismatch could cause further problems if not attended, bring this to the user's attention by printing a warning in addition to log a message in the errorlog */ - push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, - ER_NO_SUCH_INDEX, - "InnoDB: Table %s has a " - "primary key in InnoDB data " - "dictionary, but not in " - "MySQL!", name); + + ib_push_frm_error(thd, ib_table, table, 0, true); /* If primary_key >= MAX_KEY, its (primary_key) value could be out of bound if continue to index @@ -6330,27 +6571,14 @@ table_opened: } } else { if (primary_key != MAX_KEY) { - sql_print_error( - "Table %s has no primary key in InnoDB data " - "dictionary, but has one in MySQL! If you " - "created the table with a MySQL version < " - "3.23.54 and did not define a primary key, " - "but defined a unique key with all non-NULL " - "columns, then MySQL internally treats that " - "key as the primary key. You can fix this " - "error by dump + DROP + CREATE + reimport " - "of the table.", name); + + ib_table->dict_frm_mismatch = DICT_NO_PK_FRM_HAS; /* This mismatch could cause further problems if not attended, bring this to the user attention by printing a warning in addition to log a message in the errorlog */ - push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, - ER_NO_SUCH_INDEX, - "InnoDB: Table %s has no " - "primary key in InnoDB data " - "dictionary, but has one in " - "MySQL!", name); + ib_push_frm_error(thd, ib_table, table, 0, true); } prebuilt->clust_index_was_generated = TRUE; @@ -12862,7 +13090,8 @@ ha_innobase::delete_table( /* Drop the table in InnoDB */ err = row_drop_table_for_mysql( - norm_name, trx, thd_sql_command(thd) == SQLCOM_DROP_DB); + norm_name, trx, thd_sql_command(thd) == SQLCOM_DROP_DB, + FALSE); if (err == DB_TABLE_NOT_FOUND @@ -12893,7 +13122,8 @@ ha_innobase::delete_table( #endif err = row_drop_table_for_mysql( par_case_name, trx, - thd_sql_command(thd) == SQLCOM_DROP_DB); + thd_sql_command(thd) == SQLCOM_DROP_DB, + FALSE); } } @@ -13960,12 +14190,8 @@ ha_innobase::info_low( } if (table->s->keys != num_innodb_index) { - sql_print_error("InnoDB: Table %s contains %lu " - "indexes inside InnoDB, which " - "is different from the number of " - "indexes %u defined in the MySQL ", - ib_table->name, num_innodb_index, - table->s->keys); + ib_table->dict_frm_mismatch = DICT_FRM_INCONSISTENT_KEYS; + ib_push_frm_error(user_thd, ib_table, table, num_innodb_index, true); } if (!(flag & HA_STATUS_NO_LOCK)) { @@ -13985,15 +14211,8 @@ ha_innobase::info_low( dict_index_t* index = innobase_get_index(i); if (index == NULL) { - sql_print_error("Table %s contains fewer " - "indexes inside InnoDB than " - "are defined in the MySQL " - ".frm file. Have you mixed up " - ".frm files from different " - "installations? See " - REFMAN - "innodb-troubleshooting.html\n", - ib_table->name); + ib_table->dict_frm_mismatch = DICT_FRM_INCONSISTENT_KEYS; + ib_push_frm_error(user_thd, ib_table, table, num_innodb_index, true); break; } @@ -14229,7 +14448,7 @@ ha_innobase::optimize( if (innodb_optimize_fulltext_only) { if (prebuilt->table->fts && prebuilt->table->fts->cache && !dict_table_is_discarded(prebuilt->table)) { - fts_sync_table(prebuilt->table); + fts_sync_table(prebuilt->table, false, true); fts_optimize_table(prebuilt->table); } return(HA_ADMIN_OK); @@ -14291,6 +14510,34 @@ ha_innobase::check( DBUG_RETURN(HA_ADMIN_CORRUPT); } + if (prebuilt->table->corrupted) { + char index_name[MAX_FULL_NAME_LEN + 1]; + /* If some previous operation has marked the table as + corrupted in memory, and has not propagated such to + clustered index, we will do so here */ + index = dict_table_get_first_index(prebuilt->table); + + if (!dict_index_is_corrupted(index)) { + row_mysql_lock_data_dictionary(prebuilt->trx); + dict_set_corrupted(index, prebuilt->trx, "CHECK TABLE"); + row_mysql_unlock_data_dictionary(prebuilt->trx); + } + + innobase_format_name(index_name, sizeof index_name, + index->name, TRUE); + + push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, + HA_ERR_INDEX_CORRUPT, + "InnoDB: Index %s is marked as" + " corrupted", index_name); + + /* Now that the table is already marked as corrupted, + there is no need to check any index of this table */ + prebuilt->trx->op_info = ""; + + DBUG_RETURN(HA_ADMIN_CORRUPT); + } + prebuilt->trx->op_info = "checking table"; old_isolation_level = prebuilt->trx->isolation_level; @@ -14374,6 +14621,15 @@ ha_innobase::check( prebuilt->index_usable = row_merge_is_index_usable( prebuilt->trx, prebuilt->index); + DBUG_EXECUTE_IF( + "dict_set_index_corrupted", + if (!dict_index_is_clust(index)) { + prebuilt->index_usable = FALSE; + row_mysql_lock_data_dictionary(prebuilt->trx); + dict_set_corrupted(index, prebuilt->trx, "dict_set_index_corrupted");; + row_mysql_unlock_data_dictionary(prebuilt->trx); + }); + if (UNIV_UNLIKELY(!prebuilt->index_usable)) { innobase_format_name( index_name, sizeof index_name, @@ -15991,7 +16247,7 @@ ha_innobase::store_lock( /* Use consistent read for checksum table */ if (sql_command == SQLCOM_CHECKSUM - || sql_command == SQLCOM_CHECKSUM + || (sql_command == SQLCOM_ANALYZE && lock_type == TL_READ) || ((srv_locks_unsafe_for_binlog || trx->isolation_level <= TRX_ISO_READ_COMMITTED) && trx->isolation_level != TRX_ISO_SERIALIZABLE @@ -18361,7 +18617,7 @@ innodb_defragment_frequency_update( { srv_defragment_frequency = (*static_cast(save)); srv_defragment_interval = ut_microseconds_to_timer( - 1000000.0 / srv_defragment_frequency); + (ulonglong) (1000000.0 / srv_defragment_frequency)); } /****************************************************************//** @@ -18762,8 +19018,6 @@ innobase_fts_close_ranking( { fts_result_t* result; - ((NEW_FT_INFO*) fts_hdl)->ft_prebuilt->in_fts_query = false; - result = ((NEW_FT_INFO*) fts_hdl)->ft_result; fts_query_free_result(result); @@ -19226,22 +19480,22 @@ wsrep_innobase_kill_one_trx( if (!thd) { DBUG_PRINT("wsrep", ("no thd for conflicting lock")); - WSREP_WARN("no THD for trx: %lu", victim_trx->id); + WSREP_WARN("no THD for trx: %lu", (ulong) victim_trx->id); DBUG_RETURN(1); } if (!bf_thd) { DBUG_PRINT("wsrep", ("no BF thd for conflicting lock")); - WSREP_WARN("no BF THD for trx: %lu", (bf_trx) ? bf_trx->id : 0); + WSREP_WARN("no BF THD for trx: %lu", (bf_trx) ? (ulong) bf_trx->id : (ulong) 0); DBUG_RETURN(1); } WSREP_LOG_CONFLICT(bf_thd, thd, TRUE); - WSREP_DEBUG("BF kill (%lu, seqno: %lld), victim: (%lu) trx: %lu", + WSREP_DEBUG("BF kill (%lu, seqno: %lld), victim: (%lu) trx: %llu", signal, (long long)bf_seqno, thd_get_thread_id(thd), - victim_trx->id); + (ulonglong) victim_trx->id); WSREP_DEBUG("Aborting query: %s", (thd && wsrep_thd_query(thd)) ? wsrep_thd_query(thd) : "void"); @@ -19258,14 +19512,15 @@ wsrep_innobase_kill_one_trx( if (wsrep_thd_query_state(thd) == QUERY_EXITING) { - WSREP_DEBUG("kill trx EXITING for %lu", victim_trx->id); + WSREP_DEBUG("kill trx EXITING for %llu", + (ulonglong) victim_trx->id); wsrep_thd_UNLOCK(thd); DBUG_RETURN(0); } if(wsrep_thd_exec_mode(thd) != LOCAL_STATE) { - WSREP_DEBUG("withdraw for BF trx: %lu, state: %d", - victim_trx->id, + WSREP_DEBUG("withdraw for BF trx: %llu, state: %d", + (longlong) victim_trx->id, wsrep_thd_get_conflict_state(thd)); } @@ -19274,8 +19529,8 @@ wsrep_innobase_kill_one_trx( wsrep_thd_set_conflict_state(thd, MUST_ABORT); break; case MUST_ABORT: - WSREP_DEBUG("victim %lu in MUST ABORT state", - victim_trx->id); + WSREP_DEBUG("victim %llu in MUST ABORT state", + (longlong) victim_trx->id); wsrep_thd_UNLOCK(thd); wsrep_thd_awake(thd, signal); DBUG_RETURN(0); @@ -19283,8 +19538,9 @@ wsrep_innobase_kill_one_trx( case ABORTED: case ABORTING: // fall through default: - WSREP_DEBUG("victim %lu in state %d", - victim_trx->id, wsrep_thd_get_conflict_state(thd)); + WSREP_DEBUG("victim %llu in state %d", + (longlong) victim_trx->id, + wsrep_thd_get_conflict_state(thd)); wsrep_thd_UNLOCK(thd); DBUG_RETURN(0); break; @@ -19296,8 +19552,8 @@ wsrep_innobase_kill_one_trx( WSREP_DEBUG("kill query for: %ld", thd_get_thread_id(thd)); - WSREP_DEBUG("kill trx QUERY_COMMITTING for %lu", - victim_trx->id); + WSREP_DEBUG("kill trx QUERY_COMMITTING for %llu", + (longlong) victim_trx->id); if (wsrep_thd_exec_mode(thd) == REPL_RECV) { wsrep_abort_slave_trx(bf_seqno, @@ -19311,8 +19567,8 @@ wsrep_innobase_kill_one_trx( switch (rcode) { case WSREP_WARNING: - WSREP_DEBUG("cancel commit warning: %lu", - victim_trx->id); + WSREP_DEBUG("cancel commit warning: %llu", + (ulonglong) victim_trx->id); wsrep_thd_UNLOCK(thd); wsrep_thd_awake(thd, signal); DBUG_RETURN(1); @@ -19321,9 +19577,9 @@ wsrep_innobase_kill_one_trx( break; default: WSREP_ERROR( - "cancel commit bad exit: %d %lu", + "cancel commit bad exit: %d %llu", rcode, - victim_trx->id); + (ulonglong) victim_trx->id); /* unable to interrupt, must abort */ /* note: kill_mysql() will block, if we cannot. * kill the lock holder first. @@ -19339,7 +19595,8 @@ wsrep_innobase_kill_one_trx( /* it is possible that victim trx is itself waiting for some * other lock. We need to cancel this waiting */ - WSREP_DEBUG("kill trx QUERY_EXEC for %lu", victim_trx->id); + WSREP_DEBUG("kill trx QUERY_EXEC for %llu", + (ulonglong) victim_trx->id); victim_trx->lock.was_chosen_as_deadlock_victim= TRUE; if (victim_trx->lock.wait_lock) { @@ -19374,7 +19631,7 @@ wsrep_innobase_kill_one_trx( break; case QUERY_IDLE: { - WSREP_DEBUG("kill IDLE for %lu", victim_trx->id); + WSREP_DEBUG("kill IDLE for %llu", (ulonglong) victim_trx->id); if (wsrep_thd_exec_mode(thd) == REPL_RECV) { WSREP_DEBUG("kill BF IDLE, seqno: %lld", @@ -19391,7 +19648,7 @@ wsrep_innobase_kill_one_trx( if (wsrep_aborting_thd_contains(thd)) { WSREP_WARN("duplicate thd aborter %lu", - thd_get_thread_id(thd)); + (ulong) thd_get_thread_id(thd)); } else { wsrep_aborting_thd_enqueue(thd); DBUG_PRINT("wsrep",("enqueuing trx abort for %lu", @@ -19473,6 +19730,7 @@ static int innobase_wsrep_get_checkpoint(handlerton* hton, XID* xid) return 0; } + static void wsrep_fake_trx_id( /*==================*/ @@ -19488,6 +19746,88 @@ wsrep_fake_trx_id( #endif /* WITH_WSREP */ + +/*************************************************************//** +Empty free list algorithm. +Checks if buffer pool is big enough to enable backoff algorithm. +InnoDB empty free list algorithm backoff requires free pages +from LRU for the best performance. +buf_LRU_buf_pool_running_out cancels query if 1/4 of +buffer pool belongs to LRU or freelist. +At the same time buf_flush_LRU_list_batch +keeps up to BUF_LRU_MIN_LEN in LRU. +In order to avoid deadlock baclkoff requires buffer pool +to be at least 4*BUF_LRU_MIN_LEN, +but flush peformance is bad because of trashing +and additional BUF_LRU_MIN_LEN pages are requested. +@return true if it's possible to enable backoff. */ +static +bool +innodb_empty_free_list_algorithm_backoff_allowed( + srv_empty_free_list_t algorithm, /*!< in: desired algorithm + from srv_empty_free_list_t */ + long long buf_pool_pages) /*!< in: total number + of pages inside buffer pool */ +{ + return(buf_pool_pages >= BUF_LRU_MIN_LEN * (4 + 1) + || algorithm != SRV_EMPTY_FREE_LIST_BACKOFF); +} + +/*************************************************************//** +Empty free list algorithm. This function is registered as +a callback with MySQL. +@return 0 for valid algorithm */ +static +int +innodb_srv_empty_free_list_algorithm_validate( +/*===========================*/ + THD* thd, /*!< in: thread handle */ + struct st_mysql_sys_var* var, /*!< in: pointer to system + variable */ + void* save, /*!< out: immediate result + for update function */ + struct st_mysql_value* value) /*!< in: incoming string */ +{ + const char* algorithm_name; + char buff[STRING_BUFFER_USUAL_SIZE]; + int len = sizeof(buff); + ulint algo; + srv_empty_free_list_t algorithm; + + algorithm_name = value->val_str(value, buff, &len); + + if (!algorithm_name) { + return(1); + } + + for (algo = 0; algo < array_elements( + innodb_empty_free_list_algorithm_names + ) - 1; + algo++) { + if (!innobase_strcasecmp( + algorithm_name, + innodb_empty_free_list_algorithm_names[algo])) + break; + } + + if (algo == array_elements( innodb_empty_free_list_algorithm_names) - 1) + return(1); + + algorithm = static_cast(algo); + if (!innodb_empty_free_list_algorithm_backoff_allowed( + algorithm, + innobase_buffer_pool_size / srv_page_size)) { + sql_print_warning( + "InnoDB: innodb_empty_free_list_algorithm " + "= 'backoff' requires at least" + " 20MB buffer pool.\n"); + return(1); + } + + *reinterpret_cast(save) = static_cast(algorithm); + return(0); +} + /* plugin options */ static MYSQL_SYSVAR_ENUM(checksum_algorithm, srv_checksum_algorithm, @@ -20038,7 +20378,7 @@ static MYSQL_SYSVAR_ENUM(empty_free_list_algorithm, "The algorithm to use for empty free list handling. Allowed values: " "LEGACY: Original Oracle MySQL 5.6 handling with single page flushes; " "BACKOFF: (default) Wait until cleaner produces a free page.", - NULL, NULL, SRV_EMPTY_FREE_LIST_BACKOFF, + innodb_srv_empty_free_list_algorithm_validate, NULL, SRV_EMPTY_FREE_LIST_BACKOFF, &innodb_empty_free_list_algorithm_typelib); static MYSQL_SYSVAR_LONG(buffer_pool_instances, innobase_buffer_pool_instances, @@ -21078,6 +21418,7 @@ static struct st_mysql_sys_var* innobase_system_variables[]= { MYSQL_SYSVAR(corrupt_table_action), MYSQL_SYSVAR(fake_changes), MYSQL_SYSVAR(locking_fake_changes), + MYSQL_SYSVAR(tmpdir), MYSQL_SYSVAR(use_stacktrace), MYSQL_SYSVAR(force_primary_key), MYSQL_SYSVAR(fatal_semaphore_wait_threshold), @@ -21822,3 +22163,96 @@ ib_push_warning( my_free(buf); va_end(args); } + +/********************************************************************//** +Helper function to push frm mismatch error to error log and +if needed to sql-layer. */ +UNIV_INTERN +void +ib_push_frm_error( +/*==============*/ + THD* thd, /*!< in: MySQL thd */ + dict_table_t* ib_table, /*!< in: InnoDB table */ + TABLE* table, /*!< in: MySQL table */ + ulint n_keys, /*!< in: InnoDB #keys */ + bool push_warning) /*!< in: print warning ? */ +{ + switch (ib_table->dict_frm_mismatch) { + case DICT_FRM_NO_PK: + sql_print_error("Table %s has a primary key in " + "InnoDB data dictionary, but not " + "in MySQL!" + " Have you mixed up " + ".frm files from different " + "installations? See " + REFMAN + "innodb-troubleshooting.html\n", + ib_table->name); + + if (push_warning) { + push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, + ER_NO_SUCH_INDEX, + "InnoDB: Table %s has a " + "primary key in InnoDB data " + "dictionary, but not in " + "MySQL!", ib_table->name); + } + break; + case DICT_NO_PK_FRM_HAS: + sql_print_error( + "Table %s has no primary key in InnoDB data " + "dictionary, but has one in MySQL! If you " + "created the table with a MySQL version < " + "3.23.54 and did not define a primary key, " + "but defined a unique key with all non-NULL " + "columns, then MySQL internally treats that " + "key as the primary key. You can fix this " + "error by dump + DROP + CREATE + reimport " + "of the table.", ib_table->name); + + if (push_warning) { + push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, + ER_NO_SUCH_INDEX, + "InnoDB: Table %s has no " + "primary key in InnoDB data " + "dictionary, but has one in " + "MySQL!", + ib_table->name); + } + break; + + case DICT_FRM_INCONSISTENT_KEYS: + sql_print_error("InnoDB: Table %s contains %lu " + "indexes inside InnoDB, which " + "is different from the number of " + "indexes %u defined in the MySQL " + " Have you mixed up " + ".frm files from different " + "installations? See " + REFMAN + "innodb-troubleshooting.html\n", + ib_table->name, n_keys, + table->s->keys); + + if (push_warning) { + push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, + ER_NO_SUCH_INDEX, + "InnoDB: Table %s contains %lu " + "indexes inside InnoDB, which " + "is different from the number of " + "indexes %u defined in the MySQL ", + ib_table->name, n_keys, + table->s->keys); + } + break; + + case DICT_FRM_CONSISTENT: + default: + sql_print_error("InnoDB: Table %s is consistent " + "on InnoDB data dictionary and MySQL " + " FRM file.", + ib_table->name); + ut_error; + break; + } +} diff --git a/storage/xtradb/handler/ha_innodb.h b/storage/xtradb/handler/ha_innodb.h index 2027a593140..ea4be1fb2e0 100644 --- a/storage/xtradb/handler/ha_innodb.h +++ b/storage/xtradb/handler/ha_innodb.h @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 2000, 2012, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2013, 2014, SkySQL Ab. All Rights Reserved. +Copyright (c) 2013, 2016, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -696,3 +696,39 @@ innobase_copy_frm_flags_from_table_share( /*=====================================*/ dict_table_t* innodb_table, /*!< in/out: InnoDB table */ const TABLE_SHARE* table_share); /*!< in: table share */ + +/*******************************************************************//** +This function builds a translation table in INNOBASE_SHARE +structure for fast index location with mysql array number from its +table->key_info structure. This also provides the necessary translation +between the key order in mysql key_info and Innodb ib_table->indexes if +they are not fully matched with each other. +Note we do not have any mutex protecting the translation table +building based on the assumption that there is no concurrent +index creation/drop and DMLs that requires index lookup. All table +handle will be closed before the index creation/drop. +@return TRUE if index translation table built successfully */ +UNIV_INTERN +ibool +innobase_build_index_translation( +/*=============================*/ + const TABLE* table, /*!< in: table in MySQL data + dictionary */ + dict_table_t* ib_table, /*!< in: table in Innodb data + dictionary */ + INNOBASE_SHARE* share); /*!< in/out: share structure + where index translation table + will be constructed in. */ + +/********************************************************************//** +Helper function to push frm mismatch error to error log and +if needed to sql-layer. */ +UNIV_INTERN +void +ib_push_frm_error( +/*==============*/ + THD* thd, /*!< in: MySQL thd */ + dict_table_t* ib_table, /*!< in: InnoDB table */ + TABLE* table, /*!< in: MySQL table */ + ulint n_keys, /*!< in: InnoDB #keys */ + bool push_warning); /*!< in: print warning ? */ diff --git a/storage/xtradb/handler/handler0alter.cc b/storage/xtradb/handler/handler0alter.cc index c0d85451a9e..5724d9fe8ff 100644 --- a/storage/xtradb/handler/handler0alter.cc +++ b/storage/xtradb/handler/handler0alter.cc @@ -452,7 +452,7 @@ ha_innobase::check_if_supported_inplace_alter( we must use "Copy" method. */ if (is_timestamp_type(def->sql_type)) { if ((def->flags & NOT_NULL_FLAG) != 0 && // NOT NULL - (def->def != NULL || // constant default ? + (def->default_value != NULL || // constant default ? def->unireg_check != Field::NONE)) { // function default ha_alter_info->unsupported_reason = innobase_get_err_msg( ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_NOT_NULL); @@ -463,6 +463,20 @@ ha_innobase::check_if_supported_inplace_alter( } } + ulint n_indexes = UT_LIST_GET_LEN((prebuilt->table)->indexes); + + /* If InnoDB dictionary and MySQL frm file are not consistent + use "Copy" method. */ + if (prebuilt->table->dict_frm_mismatch) { + + ha_alter_info->unsupported_reason = innobase_get_err_msg( + ER_NO_SUCH_INDEX); + ib_push_frm_error(user_thd, prebuilt->table, altered_table, + n_indexes, true); + + DBUG_RETURN(HA_ALTER_INPLACE_NOT_SUPPORTED); + } + /* We should be able to do the operation in-place. See if we can do it online (LOCK=NONE). */ bool online = true; @@ -2777,6 +2791,10 @@ prepare_inplace_alter_table_dict( ctx->num_to_add_index = ha_alter_info->index_add_count; + ut_ad(ctx->prebuilt->trx->mysql_thd != NULL); + const char* path = thd_innodb_tmpdir( + ctx->prebuilt->trx->mysql_thd); + index_defs = innobase_create_key_defs( ctx->heap, ha_alter_info, altered_table, ctx->num_to_add_index, num_fts_index, @@ -3130,8 +3148,10 @@ prepare_inplace_alter_table_dict( error = DB_OUT_OF_MEMORY; goto error_handling;); rw_lock_x_lock(&ctx->add_index[a]->lock); + bool ok = row_log_allocate(ctx->add_index[a], - NULL, true, NULL, NULL); + NULL, true, NULL, + NULL, path); rw_lock_x_unlock(&ctx->add_index[a]->lock); if (!ok) { @@ -3157,7 +3177,7 @@ prepare_inplace_alter_table_dict( clust_index, ctx->new_table, !(ha_alter_info->handler_flags & Alter_inplace_info::ADD_PK_INDEX), - ctx->add_cols, ctx->col_map); + ctx->add_cols, ctx->col_map, path); rw_lock_x_unlock(&clust_index->lock); if (!ok) { @@ -3783,7 +3803,7 @@ check_if_ok_to_rename: } my_error(ER_CANT_DROP_FIELD_OR_KEY, MYF(0), - drop->name); + drop->type_name(), drop->name); goto err_exit; found_fk: continue; @@ -3920,6 +3940,24 @@ check_if_can_drop_indexes: drop_index = NULL; } + /* Check if any of the existing indexes are marked as corruption + and if they are, refuse adding more indexes. */ + if (ha_alter_info->handler_flags & Alter_inplace_info::ADD_INDEX) { + for (dict_index_t* index = dict_table_get_first_index(indexed_table); + index != NULL; index = dict_table_get_next_index(index)) { + + if (!index->to_be_dropped && dict_index_is_corrupted(index)) { + char index_name[MAX_FULL_NAME_LEN + 1]; + + innobase_format_name(index_name, sizeof index_name, + index->name, TRUE); + + my_error(ER_INDEX_CORRUPT, MYF(0), index_name); + DBUG_RETURN(true); + } + } + } + n_add_fk = 0; if (ha_alter_info->handler_flags @@ -4159,6 +4197,7 @@ ok_exit: files and merge sort. */ DBUG_EXECUTE_IF("innodb_OOM_inplace_alter", error = DB_OUT_OF_MEMORY; goto oom;); + error = row_merge_build_indexes( prebuilt->trx, prebuilt->table, ctx->new_table, @@ -6194,6 +6233,21 @@ foreign_fail: row_mysql_unlock_data_dictionary(trx); trx_free_for_mysql(trx); + /* Rebuild index translation table now for temporary tables if we are + restoring secondary keys, as ha_innobase::open will not be called for + the next access. */ + if (dict_table_is_temporary(ctx0->new_table) + && ctx0->num_to_add_index > 0) { + ut_ad(!ctx0->num_to_drop_index); + ut_ad(!ctx0->num_to_drop_fk); + if (!innobase_build_index_translation(altered_table, + ctx0->new_table, + share)) { + MONITOR_ATOMIC_DEC(MONITOR_PENDING_ALTER_TABLE); + DBUG_RETURN(true); + } + } + /* TODO: The following code could be executed while allowing concurrent access to the table (MDL downgrade). */ diff --git a/storage/xtradb/ibuf/ibuf0ibuf.cc b/storage/xtradb/ibuf/ibuf0ibuf.cc index bac2a92dd0b..4467b713c88 100644 --- a/storage/xtradb/ibuf/ibuf0ibuf.cc +++ b/storage/xtradb/ibuf/ibuf0ibuf.cc @@ -2917,7 +2917,7 @@ ibuf_contract_in_background( sum_bytes += n_bytes; sum_pages += n_pag2; - srv_inc_activity_count(); + srv_inc_activity_count(true); } return(sum_bytes); diff --git a/storage/xtradb/include/btr0sea.h b/storage/xtradb/include/btr0sea.h index d40094461ff..6e4ef16cf79 100644 --- a/storage/xtradb/include/btr0sea.h +++ b/storage/xtradb/include/btr0sea.h @@ -332,13 +332,6 @@ struct btr_search_sys_t{ /** The adaptive hash index */ extern btr_search_sys_t* btr_search_sys; -#ifdef UNIV_SEARCH_PERF_STAT -/** Number of successful adaptive hash index lookups */ -extern ulint btr_search_n_succ; -/** Number of failed adaptive hash index lookups */ -extern ulint btr_search_n_hash_fail; -#endif /* UNIV_SEARCH_PERF_STAT */ - /** After change in n_fields or n_bytes in info, this many rounds are waited before starting the hash analysis again: this is to save CPU time when there is no hope in building a hash index. */ diff --git a/storage/xtradb/include/buf0buf.ic b/storage/xtradb/include/buf0buf.ic index f7e51231471..7b1c66f2a05 100644 --- a/storage/xtradb/include/buf0buf.ic +++ b/storage/xtradb/include/buf0buf.ic @@ -305,6 +305,20 @@ buf_page_set_state( ut_a(state == BUF_BLOCK_NOT_USED); break; case BUF_BLOCK_FILE_PAGE: + if (!(state == BUF_BLOCK_NOT_USED + || state == BUF_BLOCK_REMOVE_HASH)) { + const char *old_state_name = buf_get_state_name((buf_block_t*)bpage); + bpage->state = state; + + fprintf(stderr, + "InnoDB: Error: block old state %d (%s) " + " new state %d (%s) not correct\n", + old_state, + old_state_name, + state, + buf_get_state_name((buf_block_t*)bpage)); + } + ut_a(state == BUF_BLOCK_NOT_USED || state == BUF_BLOCK_REMOVE_HASH); break; diff --git a/storage/xtradb/include/buf0flu.h b/storage/xtradb/include/buf0flu.h index 87ce7d88bdf..c8a329251fa 100644 --- a/storage/xtradb/include/buf0flu.h +++ b/storage/xtradb/include/buf0flu.h @@ -312,6 +312,12 @@ buf_flush_flush_list_in_progress(void) /*==================================*/ __attribute__((warn_unused_result)); +/** If LRU list of a buf_pool is less than this size then LRU eviction +should not happen. This is because when we do LRU flushing we also put +the blocks on free list. If LRU list is very small then we can end up +in thrashing. */ +#define BUF_LRU_MIN_LEN 256 + /******************************************************************//** Start a buffer flush batch for LRU or flush list */ ibool diff --git a/storage/xtradb/include/dict0mem.h b/storage/xtradb/include/dict0mem.h index 9c43829cecf..a55d5316969 100644 --- a/storage/xtradb/include/dict0mem.h +++ b/storage/xtradb/include/dict0mem.h @@ -2,7 +2,7 @@ Copyright (c) 1996, 2015, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2012, Facebook Inc. -Copyright (c) 2013, 2015, MariaDB Corporation. +Copyright (c) 2013, 2016, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -1025,6 +1025,18 @@ if table->memcached_sync_count == DICT_TABLE_IN_DDL means there's DDL running on the table, DML from memcached will be blocked. */ #define DICT_TABLE_IN_DDL -1 +/** These are used when MySQL FRM and InnoDB data dictionary are +in inconsistent state. */ +typedef enum { + DICT_FRM_CONSISTENT = 0, /*!< Consistent state */ + DICT_FRM_NO_PK = 1, /*!< MySQL has no primary key + but InnoDB dictionary has + non-generated one. */ + DICT_NO_PK_FRM_HAS = 2, /*!< MySQL has primary key but + InnoDB dictionary has not. */ + DICT_FRM_INCONSISTENT_KEYS = 3 /*!< Key count mismatch */ +} dict_frm_t; + /** Data structure for a database table. Most fields will be initialized to 0, NULL or FALSE in dict_mem_table_create(). */ struct dict_table_t{ @@ -1085,6 +1097,10 @@ struct dict_table_t{ /*!< True if the table belongs to a system database (mysql, information_schema or performance_schema) */ + dict_frm_t dict_frm_mismatch; + /*!< !DICT_FRM_CONSISTENT==0 if data + dictionary information and + MySQL FRM information mismatch. */ #ifndef UNIV_HOTBACKUP hash_node_t name_hash; /*!< hash chain node */ hash_node_t id_hash; /*!< hash chain node */ diff --git a/storage/xtradb/include/fil0fil.h b/storage/xtradb/include/fil0fil.h index 973882a50b4..fb9c79a3e5a 100644 --- a/storage/xtradb/include/fil0fil.h +++ b/storage/xtradb/include/fil0fil.h @@ -1281,11 +1281,6 @@ fil_system_hash_nodes(void); /************************************************************************* functions to access is_corrupt flag of fil_space_t*/ -ibool -fil_space_is_corrupt( -/*=================*/ - ulint space_id); - void fil_space_set_corrupt( /*==================*/ diff --git a/storage/xtradb/include/fil0pagecompress.h b/storage/xtradb/include/fil0pagecompress.h index 8316083d52d..99a05f14ffe 100644 --- a/storage/xtradb/include/fil0pagecompress.h +++ b/storage/xtradb/include/fil0pagecompress.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (C) 2013, 2015 MariaDB Corporation. All Rights Reserved. +Copyright (C) 2013, 2016 MariaDB Corporation. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -117,8 +117,12 @@ fil_decompress_page( byte* buf, /*!< out: buffer from which to read; in aio this must be appropriately aligned */ ulong len, /*!< in: length of output buffer.*/ - ulint* write_size); /*!< in/out: Actual payload size of + ulint* write_size, /*!< in/out: Actual payload size of the compressed data. */ + bool return_error=false); + /*!< in: true if only an error should + be produced when decompression fails. + By default this parameter is false. */ /****************************************************************//** Get space id from fil node diff --git a/storage/xtradb/include/fsp0fsp.h b/storage/xtradb/include/fsp0fsp.h index 8fdacc51277..839aed80418 100644 --- a/storage/xtradb/include/fsp0fsp.h +++ b/storage/xtradb/include/fsp0fsp.h @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1995, 2012, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2013, SkySQL Ab. All Rights Reserved. +Copyright (c) 2013, 2016, MariaDB Corporation. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -99,6 +99,9 @@ dictionary */ /** Zero relative shift position of the start of the DATA DIR bits */ #define FSP_FLAGS_POS_DATA_DIR (FSP_FLAGS_POS_PAGE_SSIZE \ + FSP_FLAGS_WIDTH_PAGE_SSIZE) +#define FSP_FLAGS_POS_DATA_DIR_ORACLE (FSP_FLAGS_POS_ATOMIC_BLOBS \ + + FSP_FLAGS_WIDTH_ATOMIC_BLOBS \ + + FSP_FLAGS_WIDTH_PAGE_SSIZE) /** Zero relative shift position of the start of the UNUSED bits */ #define FSP_FLAGS_POS_UNUSED (FSP_FLAGS_POS_DATA_DIR\ + FSP_FLAGS_WIDTH_DATA_DIR) @@ -123,6 +126,10 @@ dictionary */ #define FSP_FLAGS_MASK_DATA_DIR \ ((~(~0 << FSP_FLAGS_WIDTH_DATA_DIR)) \ << FSP_FLAGS_POS_DATA_DIR) +/** Bit mask of the DATA_DIR field */ +#define FSP_FLAGS_MASK_DATA_DIR_ORACLE \ + ((~(~0 << FSP_FLAGS_WIDTH_DATA_DIR)) \ + << FSP_FLAGS_POS_DATA_DIR_ORACLE) /** Bit mask of the PAGE_COMPRESSION field */ #define FSP_FLAGS_MASK_PAGE_COMPRESSION \ ((~(~0 << FSP_FLAGS_WIDTH_PAGE_COMPRESSION)) \ @@ -156,6 +163,9 @@ dictionary */ #define FSP_FLAGS_HAS_DATA_DIR(flags) \ ((flags & FSP_FLAGS_MASK_DATA_DIR) \ >> FSP_FLAGS_POS_DATA_DIR) +#define FSP_FLAGS_HAS_DATA_DIR_ORACLE(flags) \ + ((flags & FSP_FLAGS_MASK_DATA_DIR_ORACLE) \ + >> FSP_FLAGS_POS_DATA_DIR_ORACLE) /** Return the contents of the UNUSED bits */ #define FSP_FLAGS_GET_UNUSED(flags) \ (flags >> FSP_FLAGS_POS_UNUSED) diff --git a/storage/xtradb/include/fts0fts.h b/storage/xtradb/include/fts0fts.h index d54ed281d9a..9f7b0216d9b 100644 --- a/storage/xtradb/include/fts0fts.h +++ b/storage/xtradb/include/fts0fts.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2011, 2015, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2011, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -724,6 +724,13 @@ fts_optimize_remove_table( /*======================*/ dict_table_t* table); /*!< in: table to remove */ +/** Send sync fts cache for the table. +@param[in] table table to sync */ +UNIV_INTERN +void +fts_optimize_request_sync_table( + dict_table_t* table); + /**********************************************************************//** Signal the optimize thread to prepare for shutdown. */ UNIV_INTERN @@ -826,15 +833,18 @@ fts_drop_index_split_tables( dict_index_t* index) /*!< in: fts instance */ __attribute__((nonnull, warn_unused_result)); -/****************************************************************//** -Run SYNC on the table, i.e., write out data from the cache to the -FTS auxiliary INDEX table and clear the cache at the end. */ +/** Run SYNC on the table, i.e., write out data from the cache to the +FTS auxiliary INDEX table and clear the cache at the end. +@param[in,out] table fts table +@param[in] unlock_cache whether unlock cache when write node +@param[in] wait whether wait for existing sync to finish +@return DB_SUCCESS on success, error code on failure. */ UNIV_INTERN dberr_t fts_sync_table( -/*===========*/ - dict_table_t* table) /*!< in: table */ - __attribute__((nonnull)); + dict_table_t* table, + bool unlock_cache, + bool wait); /****************************************************************//** Free the query graph but check whether dict_sys->mutex is already diff --git a/storage/xtradb/include/fts0types.h b/storage/xtradb/include/fts0types.h index 64677428331..e495fe72a60 100644 --- a/storage/xtradb/include/fts0types.h +++ b/storage/xtradb/include/fts0types.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2007, 2011, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2007, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -122,7 +122,11 @@ struct fts_sync_t { doc_id_t max_doc_id; /*!< The doc id at which the cache was noted as being full, we use this to set the upper_limit field */ - ib_time_t start_time; /*!< SYNC start time */ + ib_time_t start_time; /*!< SYNC start time */ + bool in_progress; /*!< flag whether sync is in progress.*/ + bool unlock_cache; /*!< flag whether unlock cache when + write fts node */ + os_event_t event; /*!< sync finish event */ }; /** The cache for the FTS system. It is a memory-based inverted index @@ -165,7 +169,6 @@ struct fts_cache_t { objects, they are recreated after a SYNC is completed */ - ib_alloc_t* self_heap; /*!< This heap is the heap out of which an instance of the cache itself was created. Objects created using @@ -212,6 +215,7 @@ struct fts_node_t { ulint ilist_size_alloc; /*!< Allocated size of ilist in bytes */ + bool synced; /*!< flag whether the node is synced */ }; /** A tokenizer word. Contains information about one word. */ diff --git a/storage/xtradb/include/ha_prototypes.h b/storage/xtradb/include/ha_prototypes.h index a9c003d5bb1..077c00d8eb0 100644 --- a/storage/xtradb/include/ha_prototypes.h +++ b/storage/xtradb/include/ha_prototypes.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2006, 2014, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2006, 2015, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -295,8 +295,10 @@ innobase_casedn_str( #ifdef WITH_WSREP UNIV_INTERN int -wsrep_innobase_kill_one_trx(void *thd_ptr, - const trx_t *bf_trx, trx_t *victim_trx, ibool signal); +wsrep_innobase_kill_one_trx(void * const thd_ptr, + const trx_t * const bf_trx, + trx_t *victim_trx, + ibool signal); int wsrep_innobase_mysql_sort(int mysql_type, uint charset_number, unsigned char* str, unsigned int str_length, unsigned int buf_length); @@ -356,6 +358,15 @@ thd_supports_xa( THD* thd); /*!< in: thread handle, or NULL to query the global innodb_supports_xa */ +/** Get status of innodb_tmpdir. +@param[in] thd thread handle, or NULL to query + the global innodb_tmpdir. +@retval NULL if innodb_tmpdir="" */ +UNIV_INTERN +const char* +thd_innodb_tmpdir( + THD* thd); + /******************************************************************//** Check the status of fake changes mode (innodb_fake_changes) @return true if fake change mode is enabled. */ diff --git a/storage/xtradb/include/log0log.h b/storage/xtradb/include/log0log.h index 34ac9bb7038..f5655e98a13 100644 --- a/storage/xtradb/include/log0log.h +++ b/storage/xtradb/include/log0log.h @@ -352,17 +352,6 @@ log_archive_do( ulint* n_bytes);/*!< out: archive log buffer size, 0 if nothing to archive */ /****************************************************************//** -Writes the log contents to the archive up to the lsn when this function was -called, and stops the archiving. When archiving is started again, the archived -log file numbers start from a number one higher, so that the archiving will -not write again to the archived log files which exist when this function -returns. -@return DB_SUCCESS or DB_ERROR */ -UNIV_INTERN -ulint -log_archive_stop(void); -/*==================*/ -/****************************************************************//** Starts again archiving which has been stopped. @return DB_SUCCESS or DB_ERROR */ UNIV_INTERN @@ -624,25 +613,14 @@ log_mem_free(void); /*==============*/ /****************************************************************//** -Safely reads the log_sys->tracked_lsn value. Uses atomic operations -if available, otherwise this field is protected with the log system -mutex. The writer counterpart function is log_set_tracked_lsn() in -log0online.c. +Safely reads the log_sys->tracked_lsn value. The writer counterpart function +is log_set_tracked_lsn() in log0online.c. @return log_sys->tracked_lsn value. */ UNIV_INLINE lsn_t log_get_tracked_lsn(void); /*=====================*/ -/****************************************************************//** -Unsafely reads the log_sys->tracked_lsn value. Uses atomic operations -if available, or use dirty read. Use for printing only. - -@return log_sys->tracked_lsn value. */ -UNIV_INLINE -lsn_t -log_get_tracked_lsn_peek(void); -/*==========================*/ extern log_t* log_sys; @@ -857,7 +835,7 @@ struct log_group_t{ /** Redo log buffer */ struct log_t{ - byte pad[64]; /*!< padding to prevent other memory + byte pad[CACHE_LINE_SIZE]; /*!< padding to prevent other memory update hotspots from residing on the same memory cache line */ lsn_t lsn; /*!< log sequence number */ @@ -951,7 +929,7 @@ struct log_t{ pending flushes or writes */ /* NOTE on the 'flush' in names of the fields below: starting from 4.0.14, we separate the write of the log file and the actual fsync() - or other method to flush it to disk. The names below shhould really + or other method to flush it to disk. The names below should really be 'flush_or_write'! */ os_event_t no_flush_event; /*!< this event is in the reset state when a flush or a write is running; diff --git a/storage/xtradb/include/log0log.ic b/storage/xtradb/include/log0log.ic index ff5a83be249..70458fa546b 100644 --- a/storage/xtradb/include/log0log.ic +++ b/storage/xtradb/include/log0log.ic @@ -553,37 +553,15 @@ log_free_check(void) #endif /* !UNIV_HOTBACKUP */ /****************************************************************//** -Unsafely reads the log_sys->tracked_lsn value. Uses atomic operations -if available, or use dirty read. Use for printing only. +Safely reads the log_sys->tracked_lsn value. The writer counterpart function +is log_set_tracked_lsn() in log0online.c. -@return log_sys->tracked_lsn value. */ -UNIV_INLINE -lsn_t -log_get_tracked_lsn_peek(void) -/*==========================*/ -{ -#ifdef HAVE_ATOMIC_BUILTINS_64 - return os_atomic_increment_uint64(&log_sys->tracked_lsn, 0); -#else - return log_sys->tracked_lsn; -#endif -} - -/****************************************************************//** -Safely reads the log_sys->tracked_lsn value. Uses atomic operations -if available, otherwise this field is protected with the log system -mutex. The writer counterpart function is log_set_tracked_lsn() in -log0online.c. @return log_sys->tracked_lsn value. */ UNIV_INLINE lsn_t log_get_tracked_lsn(void) /*=====================*/ { -#ifdef HAVE_ATOMIC_BUILTINS_64 - return os_atomic_increment_uint64(&log_sys->tracked_lsn, 0); -#else - ut_ad(mutex_own(&(log_sys->mutex))); + os_rmb; return log_sys->tracked_lsn; -#endif } diff --git a/storage/xtradb/include/log0online.h b/storage/xtradb/include/log0online.h index 1ef4df7d6da..67dc0d72b4b 100644 --- a/storage/xtradb/include/log0online.h +++ b/storage/xtradb/include/log0online.h @@ -73,20 +73,7 @@ UNIV_INTERN ibool log_online_purge_changed_page_bitmaps( /*==================================*/ - ib_uint64_t lsn); /*!(signal_count()) < count_mask); + count_and_set++; + } + + /** Return how many times this event has been signalled */ + ib_int64_t signal_count(void) const + { + return (count_and_set & count_mask); + } }; /** Denotes an infinite delay for os_event_wait_time() */ @@ -115,8 +160,7 @@ struct os_event { /** Operating system mutex handle */ typedef struct os_mutex_t* os_ib_mutex_t; -/** Mutex protecting counts and the event and OS 'slow' mutex lists */ -extern os_ib_mutex_t os_sync_mutex; +// All the os_*_count variables are accessed atomically /** This is incremented by 1 in os_thread_create and decremented by 1 in os_thread_exit */ @@ -132,12 +176,15 @@ UNIV_INTERN void os_sync_init(void); /*==============*/ -/*********************************************************//** -Frees created events and OS 'slow' mutexes. */ + +/** Create an event semaphore, i.e., a semaphore which may just have two +states: signaled and nonsignaled. The created event is manual reset: it must be +reset explicitly by calling sync_os_reset_event. +@param[in,out] event memory block where to create the event */ UNIV_INTERN void -os_sync_free(void); -/*==============*/ +os_event_create(os_event_t event); + /*********************************************************//** Creates an event semaphore, i.e., a semaphore which may just have two states: signaled and nonsignaled. The created event is manual reset: it must be reset @@ -173,7 +220,10 @@ UNIV_INTERN void os_event_free( /*==========*/ - os_event_t event); /*!< in: event to free */ + os_event_t event, /*!< in: event to free */ + bool free_memory = true); + /*!< in: if true, deallocate the event memory + block too */ /**********************************************************//** Waits for an event object until it is in the signaled state. @@ -467,28 +517,7 @@ amount to decrement. */ # define os_atomic_decrement_uint64(ptr, amount) \ os_atomic_decrement(ptr, amount) -# if defined(HAVE_IB_GCC_ATOMIC_TEST_AND_SET) - -/** Do an atomic test-and-set. -@param[in,out] ptr Memory location to set to non-zero -@return the previous value */ -inline -lock_word_t -os_atomic_test_and_set(volatile lock_word_t* ptr) -{ - return(__atomic_test_and_set(ptr, __ATOMIC_ACQUIRE)); -} - -/** Do an atomic clear. -@param[in,out] ptr Memory location to set to zero */ -inline -void -os_atomic_clear(volatile lock_word_t* ptr) -{ - __atomic_clear(ptr, __ATOMIC_RELEASE); -} - -# elif defined(HAVE_ATOMIC_BUILTINS) +# if defined(HAVE_ATOMIC_BUILTINS) /** Do an atomic test and set. @param[in,out] ptr Memory location to set to non-zero @@ -517,6 +546,27 @@ os_atomic_clear(volatile lock_word_t* ptr) return(__sync_lock_test_and_set(ptr, 0)); } +# elif defined(HAVE_IB_GCC_ATOMIC_TEST_AND_SET) + +/** Do an atomic test-and-set. +@param[in,out] ptr Memory location to set to non-zero +@return the previous value */ +inline +lock_word_t +os_atomic_test_and_set(volatile lock_word_t* ptr) +{ + return(__atomic_test_and_set(ptr, __ATOMIC_ACQUIRE)); +} + +/** Do an atomic clear. +@param[in,out] ptr Memory location to set to zero */ +inline +void +os_atomic_clear(volatile lock_word_t* ptr) +{ + __atomic_clear(ptr, __ATOMIC_RELEASE); +} + # else # error "Unsupported platform" diff --git a/storage/xtradb/include/row0log.h b/storage/xtradb/include/row0log.h index f105838eece..e127504c484 100644 --- a/storage/xtradb/include/row0log.h +++ b/storage/xtradb/include/row0log.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2011, 2014, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2011, 2015, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -55,8 +55,9 @@ row_log_allocate( const dtuple_t* add_cols, /*!< in: default values of added columns, or NULL */ - const ulint* col_map)/*!< in: mapping of old column + const ulint* col_map,/*!< in: mapping of old column numbers to new ones, or NULL if !table */ + const char* path) /*!< in: where to create temporary file */ __attribute__((nonnull(1), warn_unused_result)); /******************************************************//** diff --git a/storage/xtradb/include/row0merge.h b/storage/xtradb/include/row0merge.h index 3e3459b8703..53164b5197f 100644 --- a/storage/xtradb/include/row0merge.h +++ b/storage/xtradb/include/row0merge.h @@ -1,7 +1,7 @@ /***************************************************************************** -Copyright (c) 2005, 2014, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2015, MariaDB Corporation. +Copyright (c) 2005, 2015, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2015, 2016, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -187,14 +187,14 @@ void row_merge_drop_temp_indexes(void); /*=============================*/ -/*********************************************************************//** -Creates temporary merge files, and if UNIV_PFS_IO defined, register -the file descriptor with Performance Schema. +/** Create temporary merge files in the given paramater path, and if +UNIV_PFS_IO defined, register the file descriptor with Performance Schema. +@param[in] path location for creating temporary merge files. @return File descriptor */ UNIV_INTERN int -row_merge_file_create_low(void) -/*===========================*/ +row_merge_file_create_low( + const char* path) __attribute__((warn_unused_result)); /*********************************************************************//** Destroy a merge file. And de-register the file from Performance Schema @@ -372,15 +372,17 @@ row_merge_buf_empty( /*================*/ row_merge_buf_t* buf) /*!< in,own: sort buffer */ __attribute__((warn_unused_result, nonnull)); -/*********************************************************************//** -Create a merge file. + +/** Create a merge file in the given location. +@param[out] merge_file merge file structure +@param[in] path location for creating temporary file @return file descriptor, or -1 on failure */ UNIV_INTERN int row_merge_file_create( -/*==================*/ - merge_file_t* merge_file) /*!< out: merge file structure */ - __attribute__((nonnull)); + merge_file_t* merge_file, + const char* path); + /*********************************************************************//** Merge disk files. @return DB_SUCCESS or error code */ diff --git a/storage/xtradb/include/row0mysql.h b/storage/xtradb/include/row0mysql.h index a0ff6cdad15..e6a201be7a5 100644 --- a/storage/xtradb/include/row0mysql.h +++ b/storage/xtradb/include/row0mysql.h @@ -491,6 +491,9 @@ row_drop_table_for_mysql( const char* name, /*!< in: table name */ trx_t* trx, /*!< in: dictionary transaction handle */ bool drop_db,/*!< in: true=dropping whole database */ + ibool create_failed,/*!wait_ex_event); + os_event_set(&lock->wait_ex_event); sync_array_object_signalled(); } @@ -642,7 +642,7 @@ rw_lock_s_unlock_func( /* A waiting next-writer exists, either high priority or regular, sharing the same wait event. */ - os_event_set(lock->base_lock.wait_ex_event); + os_event_set(&lock->base_lock.wait_ex_event); sync_array_object_signalled(); } else if (lock_word == X_LOCK_DECR) { @@ -653,7 +653,7 @@ rw_lock_s_unlock_func( if (lock->base_lock.waiters) { rw_lock_reset_waiter_flag(&lock->base_lock); - os_event_set(lock->base_lock.event); + os_event_set(&lock->base_lock.event); sync_array_object_signalled(); } } @@ -735,7 +735,7 @@ rw_lock_x_unlock_func( if (lock->waiters) { rw_lock_reset_waiter_flag(lock); - os_event_set(lock->event); + os_event_set(&lock->event); sync_array_object_signalled(); } } @@ -778,16 +778,16 @@ rw_lock_x_unlock_func( if (lock->high_priority_x_waiters) { - os_event_set(lock->high_priority_x_event); + os_event_set(&lock->high_priority_x_event); sync_array_object_signalled(); } else if (lock->high_priority_s_waiters) { - os_event_set(lock->high_priority_s_event); + os_event_set(&lock->high_priority_s_event); sync_array_object_signalled(); } else if (lock->base_lock.waiters) { rw_lock_reset_waiter_flag(&lock->base_lock); - os_event_set(lock->base_lock.event); + os_event_set(&lock->base_lock.event); sync_array_object_signalled(); } } diff --git a/storage/xtradb/include/sync0sync.h b/storage/xtradb/include/sync0sync.h index 88fe4644a07..2b794059399 100644 --- a/storage/xtradb/include/sync0sync.h +++ b/storage/xtradb/include/sync0sync.h @@ -926,7 +926,7 @@ implementation of a mutual exclusion semaphore. */ /** InnoDB mutex */ struct ib_mutex_t { - os_event_t event; /*!< Used by sync0arr.cc for the wait queue */ + struct os_event event; /*!< Used by sync0arr.cc for the wait queue */ volatile lock_word_t lock_word; /*!< lock_word is the target of the atomic test-and-set instruction when atomic operations are enabled. */ @@ -974,14 +974,13 @@ struct ib_mutex_t { struct ib_prio_mutex_t { ib_mutex_t base_mutex; /* The regular mutex provides the lock word etc. for the priority mutex */ - os_event_t high_priority_event; /* High priority wait array + struct os_event high_priority_event; /* High priority wait array event */ volatile ulint high_priority_waiters; /* Number of threads that asked for this mutex to be acquired with high priority in the global wait array waiting for this mutex to be released. */ - UT_LIST_NODE_T(ib_prio_mutex_t) list; }; /** Constant determining how long spin wait is continued before suspending diff --git a/storage/xtradb/include/sync0sync.ic b/storage/xtradb/include/sync0sync.ic index fa0724d7996..83f28bfeded 100644 --- a/storage/xtradb/include/sync0sync.ic +++ b/storage/xtradb/include/sync0sync.ic @@ -224,7 +224,7 @@ mutex_exit_func( /* Wake up any high priority waiters first. */ if (mutex->high_priority_waiters != 0) { - os_event_set(mutex->high_priority_event); + os_event_set(&mutex->high_priority_event); sync_array_object_signalled(); } else if (mutex_get_waiters(&mutex->base_mutex) != 0) { diff --git a/storage/xtradb/include/trx0sys.h b/storage/xtradb/include/trx0sys.h index 7892fdd0bf1..d8067e1f936 100644 --- a/storage/xtradb/include/trx0sys.h +++ b/storage/xtradb/include/trx0sys.h @@ -674,17 +674,17 @@ struct trx_sys_t{ trx_id_t max_trx_id; /*!< The smallest number not yet assigned as a transaction id or transaction number */ - char pad1[64]; /*!< Ensure max_trx_id does not share + char pad1[CACHE_LINE_SIZE]; /*!< Ensure max_trx_id does not share cache line with other fields. */ trx_id_t* descriptors; /*!< Array of trx descriptors */ ulint descr_n_max; /*!< The current size of the descriptors array. */ - char pad2[64]; /*!< Ensure static descriptor fields + char pad2[CACHE_LINE_SIZE]; /*!< Ensure static descriptor fields do not share cache lines with descr_n_used */ ulint descr_n_used; /*!< Number of used elements in the descriptors array. */ - char pad3[64]; /*!< Ensure descriptors do not share + char pad3[CACHE_LINE_SIZE]; /*!< Ensure descriptors do not share cache line with other fields */ #ifdef UNIV_DEBUG trx_id_t rw_max_trx_id; /*!< Max trx id of read-write transactions @@ -694,7 +694,7 @@ struct trx_sys_t{ memory read-write transactions, sorted on trx id, biggest first. Recovered transactions are always on this list. */ - char pad4[64]; /*!< Ensure list base nodes do not + char pad4[CACHE_LINE_SIZE]; /*!< Ensure list base nodes do not share cache line with other fields */ trx_list_t ro_trx_list; /*!< List of active and committed in memory read-only transactions, sorted @@ -703,7 +703,7 @@ struct trx_sys_t{ is not necessary. We should exploit this and increase concurrency during add/remove. */ - char pad5[64]; /*!< Ensure list base nodes do not + char pad5[CACHE_LINE_SIZE]; /*!< Ensure list base nodes do not share cache line with other fields */ trx_list_t mysql_trx_list; /*!< List of transactions created for MySQL. All transactions on @@ -717,14 +717,14 @@ struct trx_sys_t{ mysql_trx_list may additionally contain transactions that have not yet been started in InnoDB. */ - char pad6[64]; /*!< Ensure list base nodes do not + char pad6[CACHE_LINE_SIZE]; /*!< Ensure list base nodes do not share cache line with other fields */ trx_list_t trx_serial_list; /*!< trx->no ordered List of transactions in either TRX_PREPARED or TRX_ACTIVE which have already been assigned a serialization number */ - char pad7[64]; /*!< Ensure list base nodes do not + char pad7[CACHE_LINE_SIZE]; /*!< Ensure list base nodes do not share cache line with other fields */ trx_rseg_t* const rseg_array[TRX_SYS_N_RSEGS]; /*!< Pointer array to rollback diff --git a/storage/xtradb/include/univ.i b/storage/xtradb/include/univ.i index f4a0da12476..528abe183c7 100644 --- a/storage/xtradb/include/univ.i +++ b/storage/xtradb/include/univ.i @@ -45,10 +45,10 @@ Created 1/20/1994 Heikki Tuuri #define INNODB_VERSION_MAJOR 5 #define INNODB_VERSION_MINOR 6 -#define INNODB_VERSION_BUGFIX 28 +#define INNODB_VERSION_BUGFIX 30 #ifndef PERCONA_INNODB_VERSION -#define PERCONA_INNODB_VERSION 76.1 +#define PERCONA_INNODB_VERSION 76.3 #endif /* Enable UNIV_LOG_ARCHIVE in XtraDB */ diff --git a/storage/xtradb/include/ut0byte.ic b/storage/xtradb/include/ut0byte.ic index 873d98c727e..1a7af5ae33d 100644 --- a/storage/xtradb/include/ut0byte.ic +++ b/storage/xtradb/include/ut0byte.ic @@ -110,7 +110,7 @@ ut_align_down( ut_ad(sizeof(void*) == sizeof(ulint)); - return((void*)((((ulint) ptr)) & ~(align_no - 1))); + return((void*)(((ulint) ptr) & ~(align_no - 1))); } /*********************************************************//** diff --git a/storage/xtradb/include/ut0counter.h b/storage/xtradb/include/ut0counter.h index 63a133a175d..447484ba985 100644 --- a/storage/xtradb/include/ut0counter.h +++ b/storage/xtradb/include/ut0counter.h @@ -32,11 +32,15 @@ Created 2012/04/12 by Sunny Bains #include "os0thread.h" /** CPU cache line size */ -#ifdef __powerpc__ -#define CACHE_LINE_SIZE 128 +#ifndef UNIV_HOTBACKUP +# ifdef CPU_LEVEL1_DCACHE_LINESIZE +# define CACHE_LINE_SIZE CPU_LEVEL1_DCACHE_LINESIZE +# else +# error CPU_LEVEL1_DCACHE_LINESIZE is undefined +# endif /* CPU_LEVEL1_DCACHE_LINESIZE */ #else -#define CACHE_LINE_SIZE 64 -#endif +# define CACHE_LINE_SIZE 64 +#endif /* UNIV_HOTBACKUP */ /** Default number of slots to use in ib_counter_t */ #define IB_N_SLOTS 64 diff --git a/storage/xtradb/lock/lock0lock.cc b/storage/xtradb/lock/lock0lock.cc index 6d69f441019..6aef3e666aa 100644 --- a/storage/xtradb/lock/lock0lock.cc +++ b/storage/xtradb/lock/lock0lock.cc @@ -639,7 +639,7 @@ lock_sys_create( lock_sys->rec_num = 0; if (!srv_read_only_mode) { - lock_latest_err_file = os_file_create_tmpfile(); + lock_latest_err_file = os_file_create_tmpfile(NULL); ut_a(lock_latest_err_file); } } @@ -661,6 +661,17 @@ lock_sys_close(void) mutex_free(&lock_sys->mutex); mutex_free(&lock_sys->wait_mutex); + os_event_free(lock_sys->timeout_event); + + for (srv_slot_t* slot = lock_sys->waiting_threads; + slot < lock_sys->waiting_threads + OS_THREAD_MAX_N; slot++) { + + ut_ad(!slot->in_use); + ut_ad(!slot->thr); + if (slot->event != NULL) + os_event_free(slot->event); + } + mem_free(lock_stack); mem_free(lock_sys); @@ -2409,7 +2420,7 @@ lock_rec_add_to_queue( if (wsrep_debug) { fprintf(stderr, "BF skipping wait: %lu\n", - trx->id); + (ulong) trx->id); lock_rec_print(stderr, lock); } } else @@ -4998,7 +5009,7 @@ lock_table_other_has_incompatible( #ifdef WITH_WSREP if(wsrep_thd_is_wsrep(trx->mysql_thd)) { if (wsrep_debug) { - fprintf(stderr, "WSREP: trx %ld table lock abort\n", + fprintf(stderr, "WSREP: trx " TRX_ID_FMT " table lock abort\n", trx->id); } trx_mutex_enter(lock->trx); diff --git a/storage/xtradb/log/log0crypt.cc b/storage/xtradb/log/log0crypt.cc index db2e84d7e45..f518845b1a8 100644 --- a/storage/xtradb/log/log0crypt.cc +++ b/storage/xtradb/log/log0crypt.cc @@ -144,11 +144,11 @@ log_crypt_print_checkpoint_keys( ib_uint64_t checkpoint_no = log_block_get_checkpoint_no(log_block); if (crypt_info.size()) { - fprintf(stderr, "InnoDB: redo log checkpoint: %lu [ chk key ]: ", checkpoint_no); + fprintf(stderr, "InnoDB: redo log checkpoint: %lu [ chk key ]: ", (ulong) checkpoint_no); for (size_t i = 0; i < crypt_info.size(); i++) { struct crypt_info_t* it = &crypt_info[i]; fprintf(stderr, "[ %lu %u ] ", - it->checkpoint_no, + (ulong) it->checkpoint_no, it->key_version); } fprintf(stderr, "\n"); diff --git a/storage/xtradb/log/log0log.cc b/storage/xtradb/log/log0log.cc index 36531f3c6f4..a19cb70e747 100644 --- a/storage/xtradb/log/log0log.cc +++ b/storage/xtradb/log/log0log.cc @@ -1086,8 +1086,7 @@ log_group_init( ulint space_id, /*!< in: space id of the file space which contains the log files of this group */ - ulint archive_space_id __attribute__((unused))) - /*!< in: space id of the file space + ulint archive_space_id) /*!< in: space id of the file space which contains some archived log files for this group; currently, only for the first log group this is @@ -3304,10 +3303,9 @@ log_archive_close_groups( Writes the log contents to the archive up to the lsn when this function was called, and stops the archiving. When archiving is started again, the archived log file numbers start from 2 higher, so that the archiving will not write -again to the archived log files which exist when this function returns. -@return DB_SUCCESS or DB_ERROR */ -UNIV_INTERN -ulint +again to the archived log files which exist when this function returns. */ +static +void log_archive_stop(void) /*==================*/ { @@ -3315,13 +3313,7 @@ log_archive_stop(void) mutex_enter(&(log_sys->mutex)); - if (log_sys->archiving_state != LOG_ARCH_ON) { - - mutex_exit(&(log_sys->mutex)); - - return(DB_ERROR); - } - + ut_ad(log_sys->archiving_state == LOG_ARCH_ON); log_sys->archiving_state = LOG_ARCH_STOPPING; mutex_exit(&(log_sys->mutex)); @@ -3363,8 +3355,6 @@ log_archive_stop(void) log_sys->archiving_state = LOG_ARCH_STOPPED; mutex_exit(&(log_sys->mutex)); - - return(DB_SUCCESS); } /****************************************************************//** @@ -4013,7 +4003,7 @@ log_print( "Log tracking enabled\n" "Log tracked up to " LSN_PF "\n" "Max tracked LSN age " LSN_PF "\n", - log_get_tracked_lsn_peek(), + log_get_tracked_lsn(), log_sys->max_checkpoint_age); } @@ -4110,6 +4100,7 @@ log_shutdown(void) rw_lock_free(&log_sys->checkpoint_lock); mutex_free(&log_sys->mutex); + mutex_free(&log_sys->log_flush_order_mutex); #ifdef UNIV_LOG_ARCHIVE rw_lock_free(&log_sys->archive_lock); diff --git a/storage/xtradb/log/log0online.cc b/storage/xtradb/log/log0online.cc index 51a9fa8f6c5..3f53791ed4c 100644 --- a/storage/xtradb/log/log0online.cc +++ b/storage/xtradb/log/log0online.cc @@ -290,7 +290,7 @@ log_online_read_bitmap_page( /* The following call prints an error message */ os_file_get_last_error(TRUE); ib_logf(IB_LOG_LEVEL_WARN, - "failed reading changed page bitmap file \'%s\'\n", + "failed reading changed page bitmap file \'%s\'", bitmap_file->name); return FALSE; } @@ -350,7 +350,7 @@ log_online_read_last_tracked_lsn(void) ib_logf(IB_LOG_LEVEL_WARN, "corruption detected in \'%s\' at offset " - UINT64PF "\n", + UINT64PF, log_bmp_sys->out.name, read_offset); } }; @@ -364,7 +364,7 @@ log_online_read_last_tracked_lsn(void) log_bmp_sys->out.offset)) { ib_logf(IB_LOG_LEVEL_WARN, "failed truncating changed page bitmap file \'%s\' to " - UINT64PF " bytes\n", + UINT64PF " bytes", log_bmp_sys->out.name, log_bmp_sys->out.offset); result = 0; } @@ -382,16 +382,8 @@ log_set_tracked_lsn( /*================*/ lsn_t tracked_lsn) /*!tracked_lsn, 0); - (void) os_atomic_increment_uint64(&log_sys->tracked_lsn, - tracked_lsn - old_value); -#else - mutex_enter(&log_sys->mutex); log_sys->tracked_lsn = tracked_lsn; - mutex_exit(&log_sys->mutex); -#endif + os_wmb; } /*********************************************************************//** @@ -416,7 +408,7 @@ log_online_can_track_missing( ib_logf(IB_LOG_LEVEL_ERROR, "last tracked LSN " LSN_PF " is ahead of tracking " "start LSN " LSN_PF ". This can be caused by " - "mismatched bitmap files.\n", + "mismatched bitmap files.", last_tracked_lsn, tracking_start_lsn); exit(1); } @@ -444,7 +436,7 @@ log_online_track_missing_on_startup( ib_logf(IB_LOG_LEVEL_WARN, "last tracked LSN in \'%s\' is " LSN_PF ", but the last checkpoint LSN is " LSN_PF ". This might be " - "due to a server crash or a very fast shutdown. ", + "due to a server crash or a very fast shutdown.", log_bmp_sys->out.name, last_tracked_lsn, tracking_start_lsn); /* See if we can fully recover the missing interval */ @@ -452,7 +444,7 @@ log_online_track_missing_on_startup( tracking_start_lsn)) { ib_logf(IB_LOG_LEVEL_INFO, - "reading the log to advance the last tracked LSN.\n"); + "reading the log to advance the last tracked LSN."); log_bmp_sys->start_lsn = ut_max(last_tracked_lsn, MIN_TRACKED_LSN); @@ -463,22 +455,22 @@ log_online_track_missing_on_startup( ut_ad(log_bmp_sys->end_lsn >= tracking_start_lsn); ib_logf(IB_LOG_LEVEL_INFO, - "continuing tracking changed pages from LSN " LSN_PF - "\n", log_bmp_sys->end_lsn); + "continuing tracking changed pages from LSN " LSN_PF, + log_bmp_sys->end_lsn); } else { ib_logf(IB_LOG_LEVEL_WARN, "the age of last tracked LSN exceeds log capacity, " "tracking-based incremental backups will work only " - "from the higher LSN!\n"); + "from the higher LSN!"); log_bmp_sys->end_lsn = log_bmp_sys->start_lsn = tracking_start_lsn; log_set_tracked_lsn(log_bmp_sys->start_lsn); ib_logf(IB_LOG_LEVEL_INFO, - "starting tracking changed pages from LSN " LSN_PF - "\n", log_bmp_sys->end_lsn); + "starting tracking changed pages from LSN " LSN_PF, + log_bmp_sys->end_lsn); } } @@ -546,7 +538,7 @@ log_online_start_bitmap_file(void) /* The following call prints an error message */ os_file_get_last_error(TRUE); ib_logf(IB_LOG_LEVEL_ERROR, - "cannot create \'%s\'\n", log_bmp_sys->out.name); + "cannot create \'%s\'", log_bmp_sys->out.name); return FALSE; } @@ -682,7 +674,7 @@ log_online_read_init(void) if (os_file_closedir(bitmap_dir)) { os_file_get_last_error(TRUE); - ib_logf(IB_LOG_LEVEL_ERROR, "cannot close \'%s\'\n", + ib_logf(IB_LOG_LEVEL_ERROR, "cannot close \'%s\'", log_bmp_sys->bmp_file_home); exit(1); } @@ -722,7 +714,7 @@ log_online_read_init(void) ib_logf(IB_LOG_LEVEL_WARN, "truncated block detected in \'%s\' at offset " - UINT64PF "\n", + UINT64PF, log_bmp_sys->out.name, log_bmp_sys->out.offset); log_bmp_sys->out.offset -= @@ -760,14 +752,14 @@ log_online_read_init(void) "last tracked LSN is " LSN_PF ", but the last " "checkpoint LSN is " LSN_PF ". The " "tracking-based incremental backups will work " - "only from the latter LSN!\n", + "only from the latter LSN!", last_tracked_lsn, tracking_start_lsn); } } ib_logf(IB_LOG_LEVEL_INFO, "starting tracking changed pages from LSN " - LSN_PF "\n", tracking_start_lsn); + LSN_PF, tracking_start_lsn); log_bmp_sys->start_lsn = tracking_start_lsn; log_set_tracked_lsn(tracking_start_lsn); } @@ -911,7 +903,7 @@ log_online_is_valid_log_seg( ib_logf(IB_LOG_LEVEL_ERROR, "log block checksum mismatch: expected " ULINTPF ", " - "calculated checksum " ULINTPF "\n", + "calculated checksum " ULINTPF, log_block_get_checksum(log_block), log_block_calc_checksum(log_block)); } @@ -1110,7 +1102,7 @@ log_online_write_bitmap_page( /* The following call prints an error message */ os_file_get_last_error(TRUE); ib_logf(IB_LOG_LEVEL_ERROR, "failed writing changed page " - "bitmap file \'%s\'\n", log_bmp_sys->out.name); + "bitmap file \'%s\'", log_bmp_sys->out.name); return FALSE; } @@ -1120,7 +1112,7 @@ log_online_write_bitmap_page( /* The following call prints an error message */ os_file_get_last_error(TRUE); ib_logf(IB_LOG_LEVEL_ERROR, "failed flushing changed page " - "bitmap file \'%s\'\n", log_bmp_sys->out.name); + "bitmap file \'%s\'", log_bmp_sys->out.name); return FALSE; } @@ -1267,8 +1259,7 @@ log_online_diagnose_inconsistent_dir( ib_logf(IB_LOG_LEVEL_WARN, "InnoDB: Warning: inconsistent bitmap file " "directory for a " - "INFORMATION_SCHEMA.INNODB_CHANGED_PAGES query" - "\n"); + "INFORMATION_SCHEMA.INNODB_CHANGED_PAGES query"); free(bitmap_files->files); } @@ -1310,7 +1301,7 @@ log_online_setup_bitmap_file_range( if (UNIV_UNLIKELY(!bitmap_dir)) { ib_logf(IB_LOG_LEVEL_ERROR, - "failed to open bitmap directory \'%s\'\n", + "failed to open bitmap directory \'%s\'", srv_data_home); return FALSE; } @@ -1360,7 +1351,7 @@ log_online_setup_bitmap_file_range( if (UNIV_UNLIKELY(os_file_closedir(bitmap_dir))) { os_file_get_last_error(TRUE); - ib_logf(IB_LOG_LEVEL_ERROR, "cannot close \'%s\'\n", + ib_logf(IB_LOG_LEVEL_ERROR, "cannot close \'%s\'", srv_data_home); return FALSE; } @@ -1381,7 +1372,7 @@ log_online_setup_bitmap_file_range( if (UNIV_UNLIKELY(!bitmap_dir)) { ib_logf(IB_LOG_LEVEL_ERROR, - "failed to open bitmap directory \'%s\'\n", + "failed to open bitmap directory \'%s\'", srv_data_home); return FALSE; } @@ -1432,7 +1423,7 @@ log_online_setup_bitmap_file_range( if (UNIV_UNLIKELY(os_file_closedir(bitmap_dir))) { os_file_get_last_error(TRUE); - ib_logf(IB_LOG_LEVEL_ERROR, "cannot close \'%s\'\n", + ib_logf(IB_LOG_LEVEL_ERROR, "cannot close \'%s\'", srv_data_home); free(bitmap_files->files); return FALSE; @@ -1507,7 +1498,7 @@ log_online_open_bitmap_file_read_only( /* Here and below assume that bitmap file names do not contain apostrophes, thus no need for ut_print_filename(). */ ib_logf(IB_LOG_LEVEL_WARN, - "error opening the changed page bitmap \'%s\'\n", + "error opening the changed page bitmap \'%s\'", bitmap_file->name); return FALSE; } @@ -1553,7 +1544,7 @@ log_online_diagnose_bitmap_eof( ib_logf(IB_LOG_LEVEL_WARN, "junk at the end of changed page bitmap file " - "\'%s\'.\n", bitmap_file->name); + "\'%s\'.", bitmap_file->name); } if (UNIV_UNLIKELY(!last_page_in_run)) { @@ -1564,7 +1555,7 @@ log_online_diagnose_bitmap_eof( for the whole server */ ib_logf(IB_LOG_LEVEL_WARN, "changed page bitmap file \'%s\' does not " - "contain a complete run at the end.\n", + "contain a complete run at the end.", bitmap_file->name); return FALSE; } @@ -1757,7 +1748,7 @@ log_online_bitmap_iterator_next( os_file_get_last_error(TRUE); ib_logf(IB_LOG_LEVEL_WARN, "failed reading changed page bitmap file " - "\'%s\'\n", i->in_files.files[i->in_i].name); + "\'%s\'", i->in_files.files[i->in_i].name); i->failed = TRUE; return FALSE; } diff --git a/storage/xtradb/log/log0recv.cc b/storage/xtradb/log/log0recv.cc index 23ca8b1381f..67f4050a1f1 100644 --- a/storage/xtradb/log/log0recv.cc +++ b/storage/xtradb/log/log0recv.cc @@ -90,10 +90,6 @@ UNIV_INTERN recv_sys_t* recv_sys = NULL; otherwise. Note that this is FALSE while a background thread is rolling back incomplete transactions. */ UNIV_INTERN ibool recv_recovery_on; -#ifdef UNIV_LOG_ARCHIVE -/** TRUE when applying redo log records from an archived log file */ -UNIV_INTERN ibool recv_recovery_from_backup_on; -#endif /* UNIV_LOG_ARCHIVE */ #ifndef UNIV_HOTBACKUP /** TRUE when recv_init_crash_recovery() has been called. */ @@ -306,10 +302,6 @@ recv_sys_var_init(void) recv_recovery_on = FALSE; -#ifdef UNIV_LOG_ARCHIVE - recv_recovery_from_backup_on = FALSE; -#endif /* UNIV_LOG_ARCHIVE */ - recv_needed_recovery = FALSE; recv_lsn_checks_on = FALSE; @@ -3779,332 +3771,6 @@ recv_reset_log_files_for_backup( } #endif /* UNIV_HOTBACKUP */ -#ifdef UNIV_LOG_ARCHIVE -/******************************************************//** -Reads from the archive of a log group and performs recovery. -@return TRUE if no more complete consistent archive files */ -static -ibool -log_group_recover_from_archive_file( -/*================================*/ - log_group_t* group) /*!< in: log group */ -{ - os_file_t file_handle; - ib_uint64_t start_lsn; - ib_uint64_t file_end_lsn; - ib_uint64_t dummy_lsn; - ib_uint64_t scanned_lsn; - ulint len; - ibool ret; - byte* buf; - os_offset_t read_offset; - os_offset_t file_size; - int input_char; - char name[OS_FILE_MAX_PATH]; - dberr_t err; - - ut_a(0); - -try_open_again: - buf = log_sys->buf; - - /* Add the file to the archive file space; open the file */ - - log_archived_file_name_gen(name, sizeof(name), - group->id, group->archived_file_no); - - file_handle = os_file_create(innodb_file_log_key, - name, OS_FILE_OPEN, - OS_FILE_LOG, OS_FILE_AIO, &ret, FALSE); - - if (ret == FALSE) { -ask_again: - fprintf(stderr, - "InnoDB: Do you want to copy additional" - " archived log files\n" - "InnoDB: to the directory\n"); - fprintf(stderr, - "InnoDB: or were these all the files needed" - " in recovery?\n"); - fprintf(stderr, - "InnoDB: (Y == copy more files; N == this is all)?"); - - input_char = getchar(); - - if (input_char == (int) 'N') { - - return(TRUE); - } else if (input_char == (int) 'Y') { - - goto try_open_again; - } else { - goto ask_again; - } - } - - file_size = os_file_get_size(file_handle); - ut_a(file_size != (os_offset_t) -1); - - fprintf(stderr, "InnoDB: Opened archived log file %s\n", name); - - ret = os_file_close(file_handle); - - if (file_size < LOG_FILE_HDR_SIZE) { - fprintf(stderr, - "InnoDB: Archive file header incomplete %s\n", name); - - return(TRUE); - } - - ut_a(ret); - - /* Add the archive file as a node to the space */ - - ut_a(fil_node_create(name, 1 + file_size / UNIV_PAGE_SIZE, - group->archive_space_id, FALSE)); - ut_a(RECV_SCAN_SIZE >= LOG_FILE_HDR_SIZE); - - /* Read the archive file header */ - fil_io(OS_FILE_READ | OS_FILE_LOG, true, group->archive_space_id, 0, - 0, 0, - LOG_FILE_HDR_SIZE, buf, NULL, 0); - - /* Check if the archive file header is consistent */ - - if (mach_read_from_4(buf + LOG_GROUP_ID) != group->id - || mach_read_from_8(buf + LOG_FILE_START_LSN) - != group->archived_file_no) { - fprintf(stderr, - "InnoDB: Archive file header inconsistent %s\n", name); - - return(TRUE); - } - - if (!mach_read_from_4(buf + LOG_FILE_ARCH_COMPLETED)) { - fprintf(stderr, - "InnoDB: Archive file not completely written %s\n", - name); - - return(TRUE); - } - - start_lsn = mach_read_from_8(buf + LOG_FILE_START_LSN); - file_end_lsn = mach_read_from_8(buf + LOG_FILE_END_LSN); - - if (!recv_sys->scanned_lsn) { - - if (recv_sys->parse_start_lsn < start_lsn) { - fprintf(stderr, - "InnoDB: Archive log file %s" - " starts from too big a lsn\n", - name); - return(TRUE); - } - - recv_sys->scanned_lsn = start_lsn; - } - - if (recv_sys->scanned_lsn != start_lsn) { - - fprintf(stderr, - "InnoDB: Archive log file %s starts from" - " a wrong lsn\n", - name); - return(TRUE); - } - - read_offset = LOG_FILE_HDR_SIZE; - - for (;;) { - len = RECV_SCAN_SIZE; - - if (read_offset + len > file_size) { - len = ut_calc_align_down(file_size - read_offset, - OS_FILE_LOG_BLOCK_SIZE); - } - - if (len == 0) { - - break; - } - -#ifdef UNIV_DEBUG - if (log_debug_writes) { - fprintf(stderr, - "InnoDB: Archive read starting at" - " lsn " LSN_PF ", len %lu from file %s\n", - start_lsn, - (ulong) len, name); - } -#endif /* UNIV_DEBUG */ - - fil_io(OS_FILE_READ | OS_FILE_LOG, true, - group->archive_space_id, 0, - read_offset / UNIV_PAGE_SIZE, - read_offset % UNIV_PAGE_SIZE, len, buf, NULL, 0); - - ret = recv_scan_log_recs( - (buf_pool_get_n_pages() - - (recv_n_pool_free_frames * srv_buf_pool_instances)) - * UNIV_PAGE_SIZE, TRUE, buf, len, start_lsn, - &dummy_lsn, &scanned_lsn, &err); - - if (err != DB_SUCCESS) { - return(FALSE); - } - - if (scanned_lsn == file_end_lsn) { - - return(FALSE); - } - - if (ret) { - fprintf(stderr, - "InnoDB: Archive log file %s" - " does not scan right\n", - name); - return(TRUE); - } - - read_offset += len; - start_lsn += len; - - ut_ad(start_lsn == scanned_lsn); - } - - return(FALSE); -} - -/********************************************************//** -Recovers from archived log files, and also from log files, if they exist. -@return error code or DB_SUCCESS */ -UNIV_INTERN -dberr_t -recv_recovery_from_archive_start( -/*=============================*/ - ib_uint64_t min_flushed_lsn,/*!< in: min flushed lsn field from the - data files */ - ib_uint64_t limit_lsn, /*!< in: recover up to this lsn if - possible */ - lsn_t first_log_no) /*!< in: number of the first archived - log file to use in the recovery; the - file will be searched from - INNOBASE_LOG_ARCH_DIR specified in - server config file */ -{ - log_group_t* group; - ulint group_id; - ulint trunc_len; - ibool ret; - dberr_t err; - - ut_a(0); - - recv_sys_create(); - recv_sys_init(buf_pool_get_curr_size()); - - recv_recovery_on = TRUE; - recv_recovery_from_backup_on = TRUE; - - recv_sys->limit_lsn = limit_lsn; - - group_id = 0; - - group = UT_LIST_GET_FIRST(log_sys->log_groups); - - while (group) { - if (group->id == group_id) { - - break; - } - - group = UT_LIST_GET_NEXT(log_groups, group); - } - - if (!group) { - fprintf(stderr, - "InnoDB: There is no log group defined with id %lu!\n", - (ulong) group_id); - return(DB_ERROR); - } - - group->archived_file_no = first_log_no; - - recv_sys->parse_start_lsn = min_flushed_lsn; - - recv_sys->scanned_lsn = 0; - recv_sys->scanned_checkpoint_no = 0; - recv_sys->recovered_lsn = recv_sys->parse_start_lsn; - - recv_sys->archive_group = group; - - ret = FALSE; - - mutex_enter(&(log_sys->mutex)); - - while (!ret) { - ret = log_group_recover_from_archive_file(group); - - /* Close and truncate a possible processed archive file - from the file space */ - - trunc_len = UNIV_PAGE_SIZE - * fil_space_get_size(group->archive_space_id); - if (trunc_len > 0) { - fil_space_truncate_start(group->archive_space_id, - trunc_len); - } - - group->archived_file_no += group->file_size - LOG_FILE_HDR_SIZE; - } - - if (recv_sys->recovered_lsn < limit_lsn) { - - if (!recv_sys->scanned_lsn) { - - recv_sys->scanned_lsn = recv_sys->parse_start_lsn; - } - - mutex_exit(&(log_sys->mutex)); - - err = recv_recovery_from_checkpoint_start(LOG_ARCHIVE, - limit_lsn, - LSN_MAX, - LSN_MAX); - if (err != DB_SUCCESS) { - - return(err); - } - - mutex_enter(&(log_sys->mutex)); - } - - if (limit_lsn != LSN_MAX) { - - recv_apply_hashed_log_recs(FALSE); - - recv_reset_logs(0, FALSE, recv_sys->recovered_lsn); - } - - mutex_exit(&(log_sys->mutex)); - - return(DB_SUCCESS); -} - -/********************************************************//** -Completes recovery from archive. */ -UNIV_INTERN -void -recv_recovery_from_archive_finish(void) -/*===================================*/ -{ - recv_recovery_from_checkpoint_finish(); - - recv_recovery_from_backup_on = FALSE; -} -#endif /* UNIV_LOG_ARCHIVE */ - - void recv_dblwr_t::add(byte* page) { pages.push_back(page); diff --git a/storage/xtradb/mem/mem0pool.cc b/storage/xtradb/mem/mem0pool.cc index fe9a84d21fa..42d0417c768 100644 --- a/storage/xtradb/mem/mem0pool.cc +++ b/storage/xtradb/mem/mem0pool.cc @@ -280,6 +280,7 @@ mem_pool_free( /*==========*/ mem_pool_t* pool) /*!< in, own: memory pool */ { + mutex_free(&pool->mutex); ut_free(pool->buf); ut_free(pool); } diff --git a/storage/xtradb/mysql-test/storage_engine/lock_concurrent.rdiff b/storage/xtradb/mysql-test/storage_engine/lock_concurrent.rdiff index fe4a0087fa9..6b7a52046e2 100644 --- a/storage/xtradb/mysql-test/storage_engine/lock_concurrent.rdiff +++ b/storage/xtradb/mysql-test/storage_engine/lock_concurrent.rdiff @@ -1,7 +1,7 @@ --- suite/storage_engine/lock_concurrent.result 2012-06-24 23:55:19.539380000 +0400 +++ suite/storage_engine/lock_concurrent.reject 2012-07-15 17:50:21.279222746 +0400 -@@ -3,10 +3,19 @@ - LOCK TABLES t1 WRITE CONCURRENT, t1 AS t2 READ; +@@ -4,6 +4,14 @@ + connect con1,localhost,root,,; SET lock_wait_timeout = 1; LOCK TABLES t1 READ LOCAL; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction @@ -13,10 +13,13 @@ +# Also, this problem may cause a chain effect (more errors of different kinds in the test). +# ------------------------------------------- UNLOCK TABLES; + connection default; UNLOCK TABLES; +@@ -11,6 +19,7 @@ LOCK TABLES t1 READ LOCAL; + connection default; LOCK TABLES t1 WRITE CONCURRENT, t1 AS t2 READ; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction UNLOCK TABLES; + connection con1; UNLOCK TABLES; - DROP TABLE t1; diff --git a/storage/xtradb/os/os0file.cc b/storage/xtradb/os/os0file.cc index 2bb094e115d..ed16a18e548 100644 --- a/storage/xtradb/os/os0file.cc +++ b/storage/xtradb/os/os0file.cc @@ -553,6 +553,42 @@ PIMAGE_TLS_CALLBACK p_thread_callback_base = win_tls_thread_exit; } #endif /*_WIN32 */ +/***********************************************************************//** +For an EINVAL I/O error, prints a diagnostic message if innodb_flush_method +== ALL_O_DIRECT. +@return true if the diagnostic message was printed +@return false if the diagnostic message does not apply */ +static +bool +os_diagnose_all_o_direct_einval( +/*============================*/ + ulint err) /*!< in: C error code */ +{ + if ((err == EINVAL) + && (srv_unix_file_flush_method == SRV_UNIX_ALL_O_DIRECT)) { + ib_logf(IB_LOG_LEVEL_INFO, + "The error might be caused by redo log I/O not " + "satisfying innodb_flush_method=ALL_O_DIRECT " + "requirements by the underlying file system."); + if (srv_log_block_size != 512) + ib_logf(IB_LOG_LEVEL_INFO, + "This might be caused by an incompatible " + "non-default innodb_log_block_size value %lu.", + srv_log_block_size); + ib_logf(IB_LOG_LEVEL_INFO, + "Please file a bug at https://bugs.percona.com and " + "include this error message, my.cnf settings, and " + "information about the file system where the redo log " + "resides."); + ib_logf(IB_LOG_LEVEL_INFO, + "A possible workaround is to change " + "innodb_flush_method value to something else " + "than ALL_O_DIRECT."); + return(true); + } + return(false); +} + /***********************************************************************//** Retrieves the last error number if an error occurs in a file io function. The number should be retrieved before any other OS calls (because they may @@ -717,7 +753,7 @@ os_file_get_last_error_low( "InnoDB: Error trying to enable atomic writes on " "non-supported destination!\n"); } - } else { + } else if (!os_diagnose_all_o_direct_einval(err)) { if (strerror(err) != NULL) { fprintf(stderr, "InnoDB: Error number %d" @@ -974,7 +1010,7 @@ os_file_lock( #ifndef UNIV_HOTBACKUP /****************************************************************//** Creates the seek mutexes used in positioned reads and writes. */ -UNIV_INTERN +static void os_io_init_simple(void) /*===================*/ @@ -991,19 +1027,21 @@ os_io_init_simple(void) #endif } -/***********************************************************************//** -Creates a temporary file. This function is like tmpfile(3), but -the temporary file is created in the MySQL temporary directory. -@return temporary file handle, or NULL on error */ +/** Create a temporary file. This function is like tmpfile(3), but +the temporary file is created in the given parameter path. If the path +is null then it will create the file in the mysql server configuration +parameter (--tmpdir). +@param[in] path location for creating temporary file +@return temporary file handle, or NULL on error */ UNIV_INTERN FILE* -os_file_create_tmpfile(void) -/*========================*/ +os_file_create_tmpfile( + const char* path) { - FILE* file = NULL; - int fd; WAIT_ALLOW_WRITES(); - fd = innobase_mysql_tmpfile(); + + FILE* file = NULL; + int fd = innobase_mysql_tmpfile(path); ut_ad(!srv_read_only_mode); @@ -2526,7 +2564,7 @@ os_file_set_size( ib_logf(IB_LOG_LEVEL_ERROR, "preallocating file " "space for file \'%s\' failed. Current size " - INT64PF ", desired size " INT64PF "\n", + INT64PF ", desired size " INT64PF, name, current_size, size); os_file_handle_error_no_exit (name, "posix_fallocate", FALSE, __FILE__, __LINE__); @@ -2996,6 +3034,9 @@ os_file_pwrite( /* Handle partial writes and signal interruptions correctly */ for (ret = 0; ret < (ssize_t) n; ) { n_written = pwrite(file, buf, (ssize_t)n - ret, offs); + DBUG_EXECUTE_IF("xb_simulate_all_o_direct_write_failure", + n_written = -1; + errno = EINVAL;); if (n_written >= 0) { ret += n_written; offs += n_written; @@ -3141,6 +3182,10 @@ try_again: try_again: ret = os_file_pread(file, buf, n, offset, trx); + DBUG_EXECUTE_IF("xb_simulate_all_o_direct_read_failure", + ret = -1; + errno = EINVAL;); + if ((ulint) ret == n) { return(TRUE); } else if (ret == -1) { @@ -3470,6 +3515,8 @@ retry: "InnoDB: " REFMAN "operating-system-error-codes.html\n"); + os_diagnose_all_o_direct_einval(errno); + os_has_said_disk_full = TRUE; } @@ -4067,7 +4114,7 @@ os_aio_native_aio_supported(void) return(FALSE); } else if (!srv_read_only_mode) { /* Now check if tmpdir supports native aio ops. */ - fd = innobase_mysql_tmpfile(); + fd = innobase_mysql_tmpfile(NULL); if (fd < 0) { ib_logf(IB_LOG_LEVEL_WARN, @@ -4437,6 +4484,14 @@ os_aio_free(void) os_event_free(os_aio_segment_wait_events[i]); } +#if !defined(HAVE_ATOMIC_BUILTINS) || UNIV_WORD_SIZE < 8 + os_mutex_free(os_file_count_mutex); +#endif /* !HAVE_ATOMIC_BUILTINS || UNIV_WORD_SIZE < 8 */ + + for (ulint i = 0; i < OS_FILE_N_SEEK_MUTEXES; i++) { + os_mutex_free(os_file_seek_mutexes[i]); + } + ut_free(os_aio_segment_wait_events); os_aio_segment_wait_events = 0; os_aio_n_segments = 0; @@ -6124,7 +6179,7 @@ os_aio_print( srv_io_thread_function[i]); #ifndef __WIN__ - if (os_aio_segment_wait_events[i]->is_set) { + if (os_aio_segment_wait_events[i]->is_set()) { fprintf(file, " ev set"); } #endif /* __WIN__ */ @@ -6364,7 +6419,7 @@ os_file_trim( fprintf(stderr, " InnoDB: Warning: fallocate call failed with error code %d.\n" " InnoDB: start: %lu len: %lu payload: %lu\n" - " InnoDB: Disabling fallocate for now.\n", errno, off, trim_len, len); + " InnoDB: Disabling fallocate for now.\n", errno, (ulong) off, (ulong) trim_len, (ulong) len); os_file_handle_error_no_exit(slot->name, " fallocate(FALLOC_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE) ", diff --git a/storage/xtradb/os/os0sync.cc b/storage/xtradb/os/os0sync.cc index 03c53848832..423b94c6db0 100644 --- a/storage/xtradb/os/os0sync.cc +++ b/storage/xtradb/os/os0sync.cc @@ -47,27 +47,14 @@ struct os_mutex_t{ do not assume that the OS mutex supports recursive locking, though NT seems to do that */ - UT_LIST_NODE_T(os_mutex_t) os_mutex_list; - /* list of all 'slow' OS mutexes created */ }; -/** Mutex protecting counts and the lists of OS mutexes and events */ -UNIV_INTERN os_ib_mutex_t os_sync_mutex; -/** TRUE if os_sync_mutex has been initialized */ -static ibool os_sync_mutex_inited = FALSE; -/** TRUE when os_sync_free() is being executed */ -static ibool os_sync_free_called = FALSE; +// All the os_*_count variables are accessed atomically /** This is incremented by 1 in os_thread_create and decremented by 1 in -os_thread_exit */ +os_thread_exit. */ UNIV_INTERN ulint os_thread_count = 0; -/** The list of all events created */ -static UT_LIST_BASE_NODE_T(os_event) os_event_list; - -/** The list of all OS 'slow' mutexes */ -static UT_LIST_BASE_NODE_T(os_mutex_t) os_mutex_list; - UNIV_INTERN ulint os_event_count = 0; UNIV_INTERN ulint os_mutex_count = 0; UNIV_INTERN ulint os_fast_mutex_count = 0; @@ -80,37 +67,6 @@ UNIV_INTERN mysql_pfs_key_t event_os_mutex_key; UNIV_INTERN mysql_pfs_key_t os_mutex_key; #endif -/* Because a mutex is embedded inside an event and there is an -event embedded inside a mutex, on free, this generates a recursive call. -This version of the free event function doesn't acquire the global lock */ -static void os_event_free_internal(os_event_t event); - -/* On Windows (Vista and later), load function pointers for condition -variable handling. Those functions are not available in prior versions, -so we have to use them via runtime loading, as long as we support XP. */ -static void os_cond_module_init(void); - -#ifdef __WIN__ -/* Prototypes and function pointers for condition variable functions */ -typedef VOID (WINAPI* InitializeConditionVariableProc) - (PCONDITION_VARIABLE ConditionVariable); -static InitializeConditionVariableProc initialize_condition_variable; - -typedef BOOL (WINAPI* SleepConditionVariableCSProc) - (PCONDITION_VARIABLE ConditionVariable, - PCRITICAL_SECTION CriticalSection, - DWORD dwMilliseconds); -static SleepConditionVariableCSProc sleep_condition_variable; - -typedef VOID (WINAPI* WakeAllConditionVariableProc) - (PCONDITION_VARIABLE ConditionVariable); -static WakeAllConditionVariableProc wake_all_condition_variable; - -typedef VOID (WINAPI* WakeConditionVariableProc) - (PCONDITION_VARIABLE ConditionVariable); -static WakeConditionVariableProc wake_condition_variable; -#endif - /*********************************************************//** Initialitze condition variable */ UNIV_INLINE @@ -122,8 +78,7 @@ os_cond_init( ut_a(cond); #ifdef __WIN__ - ut_a(initialize_condition_variable != NULL); - initialize_condition_variable(cond); + InitializeConditionVariable(cond); #else ut_a(pthread_cond_init(cond, NULL) == 0); #endif @@ -151,9 +106,8 @@ os_cond_wait_timed( BOOL ret; DWORD err; - ut_a(sleep_condition_variable != NULL); - ret = sleep_condition_variable(cond, mutex, time_in_ms); + ret = SleepConditionVariableCS(cond, mutex, time_in_ms); if (!ret) { err = GetLastError(); @@ -208,8 +162,7 @@ os_cond_wait( ut_a(mutex); #ifdef __WIN__ - ut_a(sleep_condition_variable != NULL); - ut_a(sleep_condition_variable(cond, mutex, INFINITE)); + ut_a(SleepConditionVariableCS(cond, mutex, INFINITE)); #else ut_a(pthread_cond_wait(cond, mutex) == 0); #endif @@ -226,8 +179,7 @@ os_cond_broadcast( ut_a(cond); #ifdef __WIN__ - ut_a(wake_all_condition_variable != NULL); - wake_all_condition_variable(cond); + WakeAllConditionVariable(cond); #else ut_a(pthread_cond_broadcast(cond) == 0); #endif @@ -248,40 +200,6 @@ os_cond_destroy( #endif } -/*********************************************************//** -On Windows (Vista and later), load function pointers for condition variable -handling. Those functions are not available in prior versions, so we have to -use them via runtime loading, as long as we support XP. */ -static -void -os_cond_module_init(void) -/*=====================*/ -{ -#ifdef __WIN__ - HMODULE h_dll; - - if (!srv_use_native_conditions) - return; - - h_dll = GetModuleHandle("kernel32"); - - initialize_condition_variable = (InitializeConditionVariableProc) - GetProcAddress(h_dll, "InitializeConditionVariable"); - sleep_condition_variable = (SleepConditionVariableCSProc) - GetProcAddress(h_dll, "SleepConditionVariableCS"); - wake_all_condition_variable = (WakeAllConditionVariableProc) - GetProcAddress(h_dll, "WakeAllConditionVariable"); - wake_condition_variable = (WakeConditionVariableProc) - GetProcAddress(h_dll, "WakeConditionVariable"); - - /* When using native condition variables, check function pointers */ - ut_a(initialize_condition_variable); - ut_a(sleep_condition_variable); - ut_a(wake_all_condition_variable); - ut_a(wake_condition_variable); -#endif -} - /*********************************************************//** Initializes global event and OS 'slow' mutex lists. */ UNIV_INTERN @@ -289,55 +207,27 @@ void os_sync_init(void) /*==============*/ { - UT_LIST_INIT(os_event_list); - UT_LIST_INIT(os_mutex_list); - - os_sync_mutex = NULL; - os_sync_mutex_inited = FALSE; - - /* Now for Windows only */ - os_cond_module_init(); - - os_sync_mutex = os_mutex_create(); - - os_sync_mutex_inited = TRUE; } -/*********************************************************//** -Frees created events and OS 'slow' mutexes. */ +/** Create an event semaphore, i.e., a semaphore which may just have two +states: signaled and nonsignaled. The created event is manual reset: it must be +reset explicitly by calling sync_os_reset_event. +@param[in,out] event memory block where to create the event */ UNIV_INTERN void -os_sync_free(void) -/*==============*/ +os_event_create(os_event_t event) { - os_event_t event; - os_ib_mutex_t mutex; +#ifndef PFS_SKIP_EVENT_MUTEX + os_fast_mutex_init(event_os_mutex_key, &event->os_mutex); +#else + os_fast_mutex_init(PFS_NOT_INSTRUMENTED, &event->os_mutex); +#endif - os_sync_free_called = TRUE; - event = UT_LIST_GET_FIRST(os_event_list); + os_cond_init(&(event->cond_var)); - while (event) { + event->init_count_and_set(); - os_event_free(event); - - event = UT_LIST_GET_FIRST(os_event_list); - } - - mutex = UT_LIST_GET_FIRST(os_mutex_list); - - while (mutex) { - if (mutex == os_sync_mutex) { - /* Set the flag to FALSE so that we do not try to - reserve os_sync_mutex any more in remaining freeing - operations in shutdown */ - os_sync_mutex_inited = FALSE; - } - - os_mutex_free(mutex); - - mutex = UT_LIST_GET_FIRST(os_mutex_list); - } - os_sync_free_called = FALSE; + os_atomic_increment_ulint(&os_event_count, 1); } /*********************************************************//** @@ -350,59 +240,9 @@ os_event_t os_event_create(void) /*==================*/ { - os_event_t event; + os_event_t event = static_cast(ut_malloc(sizeof(*event)));; -#ifdef __WIN__ - if(!srv_use_native_conditions) { - - event = static_cast(ut_malloc(sizeof(*event))); - - event->handle = CreateEvent(NULL, TRUE, FALSE, NULL); - if (!event->handle) { - fprintf(stderr, - "InnoDB: Could not create a Windows event" - " semaphore; Windows error %lu\n", - (ulong) GetLastError()); - } - } else /* Windows with condition variables */ -#endif - { - event = static_cast(ut_malloc(sizeof *event)); - -#ifndef PFS_SKIP_EVENT_MUTEX - os_fast_mutex_init(event_os_mutex_key, &event->os_mutex); -#else - os_fast_mutex_init(PFS_NOT_INSTRUMENTED, &event->os_mutex); -#endif - - os_cond_init(&(event->cond_var)); - - event->is_set = FALSE; - - /* We return this value in os_event_reset(), which can then be - be used to pass to the os_event_wait_low(). The value of zero - is reserved in os_event_wait_low() for the case when the - caller does not want to pass any signal_count value. To - distinguish between the two cases we initialize signal_count - to 1 here. */ - event->signal_count = 1; - } - - /* The os_sync_mutex can be NULL because during startup an event - can be created [ because it's embedded in the mutex/rwlock ] before - this module has been initialized */ - if (os_sync_mutex != NULL) { - os_mutex_enter(os_sync_mutex); - } - - /* Put to the list of events */ - UT_LIST_ADD_FIRST(os_event_list, os_event_list, event); - - os_event_count++; - - if (os_sync_mutex != NULL) { - os_mutex_exit(os_sync_mutex); - } + os_event_create(event); return(event); } @@ -418,20 +258,13 @@ os_event_set( { ut_a(event); -#ifdef __WIN__ - if (!srv_use_native_conditions) { - ut_a(SetEvent(event->handle)); - return; - } -#endif - os_fast_mutex_lock(&(event->os_mutex)); - if (event->is_set) { + if (UNIV_UNLIKELY(event->is_set())) { /* Do nothing */ } else { - event->is_set = TRUE; - event->signal_count += 1; + event->set(); + event->inc_signal_count(); os_cond_broadcast(&(event->cond_var)); } @@ -456,88 +289,40 @@ os_event_reset( ut_a(event); -#ifdef __WIN__ - if(!srv_use_native_conditions) { - ut_a(ResetEvent(event->handle)); - return(0); - } -#endif - os_fast_mutex_lock(&(event->os_mutex)); - if (!event->is_set) { + if (UNIV_UNLIKELY(!event->is_set())) { /* Do nothing */ } else { - event->is_set = FALSE; + event->reset(); } - ret = event->signal_count; + ret = event->signal_count(); os_fast_mutex_unlock(&(event->os_mutex)); return(ret); } -/**********************************************************//** -Frees an event object, without acquiring the global lock. */ -static -void -os_event_free_internal( -/*===================*/ - os_event_t event) /*!< in: event to free */ -{ -#ifdef __WIN__ - if(!srv_use_native_conditions) { - ut_a(event); - ut_a(CloseHandle(event->handle)); - } else -#endif - { - ut_a(event); - - /* This is to avoid freeing the mutex twice */ - os_fast_mutex_free(&(event->os_mutex)); - - os_cond_destroy(&(event->cond_var)); - } - - /* Remove from the list of events */ - UT_LIST_REMOVE(os_event_list, os_event_list, event); - - os_event_count--; - - ut_free(event); -} - /**********************************************************//** Frees an event object. */ UNIV_INTERN void os_event_free( /*==========*/ - os_event_t event) /*!< in: event to free */ + os_event_t event, /*!< in: event to free */ + bool free_memory)/*!< in: if true, deallocate the event + memory block too */ { ut_a(event); -#ifdef __WIN__ - if(!srv_use_native_conditions){ - ut_a(CloseHandle(event->handle)); - } else /*Windows with condition variables */ -#endif - { - os_fast_mutex_free(&(event->os_mutex)); - os_cond_destroy(&(event->cond_var)); - } + os_fast_mutex_free(&(event->os_mutex)); - /* Remove from the list of events */ - os_mutex_enter(os_sync_mutex); + os_cond_destroy(&(event->cond_var)); - UT_LIST_REMOVE(os_event_list, os_event_list, event); + os_atomic_decrement_ulint(&os_event_count, 1); - os_event_count--; - - os_mutex_exit(os_sync_mutex); - - ut_free(event); + if (free_memory) + ut_free(event); } /**********************************************************//** @@ -566,29 +351,14 @@ os_event_wait_low( returned by previous call of os_event_reset(). */ { -#ifdef __WIN__ - if(!srv_use_native_conditions) { - DWORD err; - - ut_a(event); - - UT_NOT_USED(reset_sig_count); - - /* Specify an infinite wait */ - err = WaitForSingleObject(event->handle, INFINITE); - - ut_a(err == WAIT_OBJECT_0); - return; - } -#endif os_fast_mutex_lock(&event->os_mutex); if (!reset_sig_count) { - reset_sig_count = event->signal_count; + reset_sig_count = event->signal_count(); } - while (!event->is_set && event->signal_count == reset_sig_count) { + while (!event->is_set() && event->signal_count() == reset_sig_count) { os_cond_wait(&(event->cond_var), &(event->os_mutex)); /* Solaris manual said that spurious wakeups may occur: we @@ -619,36 +389,10 @@ os_event_wait_time_low( #ifdef __WIN__ DWORD time_in_ms; - - if (!srv_use_native_conditions) { - DWORD err; - - ut_a(event); - - if (time_in_usec != OS_SYNC_INFINITE_TIME) { - time_in_ms = static_cast(time_in_usec / 1000); - err = WaitForSingleObject(event->handle, time_in_ms); - } else { - err = WaitForSingleObject(event->handle, INFINITE); - } - - if (err == WAIT_OBJECT_0) { - return(0); - } else if ((err == WAIT_TIMEOUT) || (err == ERROR_TIMEOUT)) { - return(OS_SYNC_TIME_EXCEEDED); - } - - ut_error; - /* Dummy value to eliminate compiler warning. */ - return(42); + if (time_in_usec != OS_SYNC_INFINITE_TIME) { + time_in_ms = static_cast(time_in_usec / 1000); } else { - ut_a(sleep_condition_variable != NULL); - - if (time_in_usec != OS_SYNC_INFINITE_TIME) { - time_in_ms = static_cast(time_in_usec / 1000); - } else { - time_in_ms = INFINITE; - } + time_in_ms = INFINITE; } #else struct timespec abstime; @@ -686,11 +430,12 @@ os_event_wait_time_low( os_fast_mutex_lock(&event->os_mutex); if (!reset_sig_count) { - reset_sig_count = event->signal_count; + reset_sig_count = event->signal_count(); } do { - if (event->is_set || event->signal_count != reset_sig_count) { + if (event->is_set() + || event->signal_count() != reset_sig_count) { break; } @@ -734,18 +479,7 @@ os_mutex_create(void) mutex_str->count = 0; mutex_str->event = os_event_create(); - if (UNIV_LIKELY(os_sync_mutex_inited)) { - /* When creating os_sync_mutex itself we cannot reserve it */ - os_mutex_enter(os_sync_mutex); - } - - UT_LIST_ADD_FIRST(os_mutex_list, os_mutex_list, mutex_str); - - os_mutex_count++; - - if (UNIV_LIKELY(os_sync_mutex_inited)) { - os_mutex_exit(os_sync_mutex); - } + os_atomic_increment_ulint(&os_mutex_count, 1); return(mutex_str); } @@ -791,21 +525,9 @@ os_mutex_free( { ut_a(mutex); - if (UNIV_LIKELY(!os_sync_free_called)) { - os_event_free_internal(mutex->event); - } + os_event_free(mutex->event); - if (UNIV_LIKELY(os_sync_mutex_inited)) { - os_mutex_enter(os_sync_mutex); - } - - UT_LIST_REMOVE(os_mutex_list, os_mutex_list, mutex); - - os_mutex_count--; - - if (UNIV_LIKELY(os_sync_mutex_inited)) { - os_mutex_exit(os_sync_mutex); - } + os_atomic_decrement_ulint(&os_mutex_count, 1); os_fast_mutex_free(static_cast(mutex->handle)); ut_free(mutex->handle); @@ -827,18 +549,7 @@ os_fast_mutex_init_func( #else ut_a(0 == pthread_mutex_init(fast_mutex, MY_MUTEX_INIT_FAST)); #endif - if (UNIV_LIKELY(os_sync_mutex_inited)) { - /* When creating os_sync_mutex itself (in Unix) we cannot - reserve it */ - - os_mutex_enter(os_sync_mutex); - } - - os_fast_mutex_count++; - - if (UNIV_LIKELY(os_sync_mutex_inited)) { - os_mutex_exit(os_sync_mutex); - } + os_atomic_increment_ulint(&os_fast_mutex_count, 1); } /**********************************************************//** @@ -919,17 +630,6 @@ os_fast_mutex_free_func( putc('\n', stderr); } #endif - if (UNIV_LIKELY(os_sync_mutex_inited)) { - /* When freeing the last mutexes, we have - already freed os_sync_mutex */ - os_mutex_enter(os_sync_mutex); - } - - ut_ad(os_fast_mutex_count > 0); - os_fast_mutex_count--; - - if (UNIV_LIKELY(os_sync_mutex_inited)) { - os_mutex_exit(os_sync_mutex); - } + os_atomic_decrement_ulint(&os_fast_mutex_count, 1); } diff --git a/storage/xtradb/os/os0thread.cc b/storage/xtradb/os/os0thread.cc index 8420a94787b..aabdd06d76b 100644 --- a/storage/xtradb/os/os0thread.cc +++ b/storage/xtradb/os/os0thread.cc @@ -145,9 +145,7 @@ os_thread_create_func( os_thread_t thread; DWORD win_thread_id; - os_mutex_enter(os_sync_mutex); - os_thread_count++; - os_mutex_exit(os_sync_mutex); + os_atomic_increment_ulint(&os_thread_count, 1); thread = CreateThread(NULL, /* no security attributes */ 0, /* default size stack */ @@ -186,9 +184,8 @@ os_thread_create_func( exit(1); } #endif - os_mutex_enter(os_sync_mutex); - os_thread_count++; - os_mutex_exit(os_sync_mutex); + ulint new_count = os_atomic_increment_ulint(&os_thread_count, 1); + ut_a(new_count <= OS_THREAD_MAX_N); #ifdef UNIV_HPUX10 ret = pthread_create(&pthread, pthread_attr_default, func, arg); @@ -205,8 +202,6 @@ os_thread_create_func( pthread_attr_destroy(&attr); #endif - ut_a(os_thread_count <= OS_THREAD_MAX_N); - if (thread_id) { *thread_id = pthread; } @@ -233,9 +228,7 @@ os_thread_exit( pfs_delete_thread(); #endif - os_mutex_enter(os_sync_mutex); - os_thread_count--; - os_mutex_exit(os_sync_mutex); + os_atomic_decrement_ulint(&os_thread_count, 1); #ifdef __WIN__ ExitThread((DWORD) exit_value); diff --git a/storage/xtradb/row/row0ftsort.cc b/storage/xtradb/row/row0ftsort.cc index c7a5b51ef55..ac0dc844b1b 100644 --- a/storage/xtradb/row/row0ftsort.cc +++ b/storage/xtradb/row/row0ftsort.cc @@ -1,7 +1,7 @@ /***************************************************************************** -Copyright (c) 2010, 2014, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2015, MariaDB Corporation. +Copyright (c) 2010, 2015, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2015, 2016, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -240,6 +240,9 @@ row_fts_psort_info_init( crypt_data = NULL; } + ut_ad(trx->mysql_thd != NULL); + const char* path = thd_innodb_tmpdir(trx->mysql_thd); + /* There will be FTS_NUM_AUX_INDEX number of "sort buckets" for each parallel sort thread. Each "sort bucket" holds records for a particular "FTS index partition" */ @@ -261,8 +264,8 @@ row_fts_psort_info_init( psort_info[j].merge_buf[i] = row_merge_buf_create( dup->index); - if (row_merge_file_create(psort_info[j].merge_file[i]) - < 0) { + if (row_merge_file_create(psort_info[j].merge_file[i], + path) < 0) { goto func_exit; } @@ -662,6 +665,11 @@ fts_parallel_tokenization( dberr_t error = DB_SUCCESS; fil_space_crypt_t* crypt_data = NULL; + ut_ad(psort_info->psort_common->trx->mysql_thd != NULL); + + const char* path = thd_innodb_tmpdir( + psort_info->psort_common->trx->mysql_thd); + ut_ad(psort_info); buf = psort_info->merge_buf; @@ -905,7 +913,7 @@ exit: continue; } - tmpfd[i] = row_merge_file_create_low(); + tmpfd[i] = row_merge_file_create_low(path); if (tmpfd[i] < 0) { error = DB_OUT_OF_MEMORY; goto func_exit; diff --git a/storage/xtradb/row/row0log.cc b/storage/xtradb/row/row0log.cc index b0c6f881f81..f0b200459dd 100644 --- a/storage/xtradb/row/row0log.cc +++ b/storage/xtradb/row/row0log.cc @@ -198,8 +198,25 @@ struct row_log_t { or by index->lock X-latch only */ row_log_buf_t head; /*!< reader context; protected by MDL only; modifiable by row_log_apply_ops() */ + const char* path; /*!< where to create temporary file during + log operation */ }; +/** Create the file or online log if it does not exist. +@param[in,out] log online rebuild log +@return file descriptor. */ +static __attribute__((warn_unused_result)) +int +row_log_tmpfile( + row_log_t* log) +{ + DBUG_ENTER("row_log_tmpfile"); + if (log->fd < 0) { + log->fd = row_merge_file_create_low(log->path); + } + + DBUG_RETURN(log->fd); +} /** Allocate the memory for the log buffer. @param[in,out] log_buf Buffer used for log operation @@ -344,6 +361,12 @@ row_log_online_op( log->tail.buf, avail_size); } UNIV_MEM_ASSERT_RW(log->tail.block, srv_sort_buf_size); + + if (row_log_tmpfile(log) < 0) { + log->error = DB_OUT_OF_MEMORY; + goto err_exit; + } + ret = os_file_write( "(modification log)", OS_FILE_FROM_FD(log->fd), @@ -454,6 +477,12 @@ row_log_table_close_func( log->tail.buf, avail); } UNIV_MEM_ASSERT_RW(log->tail.block, srv_sort_buf_size); + + if (row_log_tmpfile(log) < 0) { + log->error = DB_OUT_OF_MEMORY; + goto err_exit; + } + ret = os_file_write( "(modification log)", OS_FILE_FROM_FD(log->fd), @@ -473,6 +502,7 @@ write_failed: log->tail.total += size; UNIV_MEM_INVALID(log->tail.buf, sizeof log->tail.buf); +err_exit: mutex_exit(&log->mutex); os_atomic_increment_ulint(&onlineddl_rowlog_rows, 1); @@ -2544,7 +2574,8 @@ corruption: if (index->online_log->head.blocks) { #ifdef HAVE_FTRUNCATE /* Truncate the file in order to save space. */ - if (ftruncate(index->online_log->fd, 0) == -1) { + if (index->online_log->fd != -1 + && ftruncate(index->online_log->fd, 0) == -1) { perror("ftruncate"); } #endif /* HAVE_FTRUNCATE */ @@ -2860,8 +2891,9 @@ row_log_allocate( const dtuple_t* add_cols, /*!< in: default values of added columns, or NULL */ - const ulint* col_map)/*!< in: mapping of old column + const ulint* col_map,/*!< in: mapping of old column numbers to new ones, or NULL if !table */ + const char* path) /*!< in: where to create temporary file */ { row_log_t* log; DBUG_ENTER("row_log_allocate"); @@ -2880,11 +2912,7 @@ row_log_allocate( DBUG_RETURN(false); } - log->fd = row_merge_file_create_low(); - if (log->fd < 0) { - ut_free(log); - DBUG_RETURN(false); - } + log->fd = -1; mutex_create(index_online_log_key, &log->mutex, SYNC_INDEX_ONLINE_LOG); log->blobs = NULL; @@ -2899,6 +2927,7 @@ row_log_allocate( log->tail.block = log->head.block = NULL; log->head.blocks = log->head.bytes = 0; log->head.total = 0; + log->path = path; dict_index_set_online_status(index, ONLINE_INDEX_CREATION); index->online_log = log; @@ -3376,7 +3405,8 @@ corruption: if (index->online_log->head.blocks) { #ifdef HAVE_FTRUNCATE /* Truncate the file in order to save space. */ - if (ftruncate(index->online_log->fd, 0) == -1) { + if (index->online_log->fd != -1 + && ftruncate(index->online_log->fd, 0) == -1) { perror("ftruncate"); } #endif /* HAVE_FTRUNCATE */ diff --git a/storage/xtradb/row/row0merge.cc b/storage/xtradb/row/row0merge.cc index 8d7fcd7388c..9c3e9dfc885 100644 --- a/storage/xtradb/row/row0merge.cc +++ b/storage/xtradb/row/row0merge.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2005, 2015, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2005, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -97,7 +97,7 @@ row_merge_encrypt_buf( key_version = encryption_key_get_latest_version(crypt_data->key_id); - /* Store key_version at the begining of the input buffer */ + /* Store key_version at the beginning of the input buffer */ mach_write_to_4((byte *)crypted_buf, key_version); int rc = encryption_scheme_encrypt(input_buf+ROW_MERGE_RESERVE_SIZE, @@ -109,9 +109,9 @@ row_merge_encrypt_buf( if (! ((rc == MY_AES_OK) && ((ulint)dstlen == srv_sort_buf_size-ROW_MERGE_RESERVE_SIZE))) { ib_logf(IB_LOG_LEVEL_FATAL, "Unable to encrypt data-block " - " src: %p srclen: %lu buf: %p buflen: %d." + " src: %p srclen: %lu buf: %p buflen: %u." " return-code: %d. Can't continue!\n", - input_buf, (size_t)srv_sort_buf_size, + input_buf, (ulong) srv_sort_buf_size, crypted_buf, dstlen, rc); ut_error; } @@ -134,7 +134,7 @@ row_merge_decrypt_buf( uint dstlen=0; os_offset_t ofs = (os_offset_t)srv_sort_buf_size * (os_offset_t)offset; - /* Read key_version from begining of the buffer */ + /* Read key_version from beginning of the buffer */ key_version = mach_read_from_4((byte *)input_buf); if (key_version == 0) { @@ -153,7 +153,7 @@ row_merge_decrypt_buf( "Unable to encrypt data-block " " src: %p srclen: %lu buf: %p buflen: %d." " return-code: %d. Can't continue!\n", - input_buf, (size_t)srv_sort_buf_size, + input_buf, (ulong) srv_sort_buf_size, crypted_buf, dstlen, rc); ut_error; } @@ -1389,47 +1389,95 @@ row_merge_write_eof( return(&block[0]); } -/********************************************************************//** -Reads clustered index of the table and create temporary files +/** Create a temporary file if it has not been created already. +@param[in,out] tmpfd temporary file handle +@param[in] path path to create temporary file +@return file descriptor, or -1 on failure */ +static __attribute__((warn_unused_result)) +int +row_merge_tmpfile_if_needed( + int* tmpfd, + const char* path) +{ + if (*tmpfd < 0) { + *tmpfd = row_merge_file_create_low(path); + } + + return(*tmpfd); +} + +/** Create a temporary file for merge sort if it was not created already. +@param[in,out] file merge file structure +@param[in,out] tmpfd temporary file structure +@param[in] nrec number of records in the file +@param[in] path path to create temporary files +@return file descriptor, or -1 on failure */ +static __attribute__((warn_unused_result)) +int +row_merge_file_create_if_needed( + merge_file_t* file, + int* tmpfd, + ulint nrec, + const char* path) +{ + ut_ad(file->fd < 0 || *tmpfd >=0); + if (file->fd < 0 && row_merge_file_create(file, path) >= 0) { + if (row_merge_tmpfile_if_needed(tmpfd, path) < 0) { + return(-1); + } + + file->n_rec = nrec; + } + + ut_ad(file->fd < 0 || *tmpfd >=0); + return(file->fd); +} + +/** Reads clustered index of the table and create temporary files containing the index entries for the indexes to be built. -@return DB_SUCCESS or error */ +@param[in] trx transaction +@param[in,out] table MySQL table object, for reporting erroneous + records +@param[in] old_table table where rows are read from +@param[in] new_table table where indexes are created; identical to + old_table unless creating a PRIMARY KEY +@param[in] online true if creating indexes online +@param[in] index indexes to be created +@param[in] fts_sort_idx full-text index to be created, or NULL +@param[in] psort_info parallel sort info for fts_sort_idx creation, + or NULL +@param[in] files temporary files +@param[in] key_numbers MySQL key numbers to create +@param[in] n_index number of indexes to create +@param[in] add_cols default values of added columns, or NULL +@param[in] col_map mapping of old column numbers to new ones, or + NULL if old_table == new_table +@param[in] add_autoinc number of added AUTO_INCREMENT columns, or + ULINT_UNDEFINED if none is added +@param[in,out] sequence autoinc sequence +@param[in,out] block file buffer +@param[in,out] tmpfd temporary file handle +return DB_SUCCESS or error */ static __attribute__((nonnull(1,2,3,4,6,9,10,16), warn_unused_result)) dberr_t row_merge_read_clustered_index( -/*===========================*/ - trx_t* trx, /*!< in: transaction */ - struct TABLE* table, /*!< in/out: MySQL table object, - for reporting erroneous records */ - const dict_table_t* old_table,/*!< in: table where rows are - read from */ - const dict_table_t* new_table,/*!< in: table where indexes are - created; identical to old_table - unless creating a PRIMARY KEY */ - bool online, /*!< in: true if creating indexes - online */ - dict_index_t** index, /*!< in: indexes to be created */ + trx_t* trx, + struct TABLE* table, + const dict_table_t* old_table, + const dict_table_t* new_table, + bool online, + dict_index_t** index, dict_index_t* fts_sort_idx, - /*!< in: full-text index to be created, - or NULL */ fts_psort_t* psort_info, - /*!< in: parallel sort info for - fts_sort_idx creation, or NULL */ - merge_file_t* files, /*!< in: temporary files */ + merge_file_t* files, const ulint* key_numbers, - /*!< in: MySQL key numbers to create */ - ulint n_index,/*!< in: number of indexes to create */ + ulint n_index, const dtuple_t* add_cols, - /*!< in: default values of - added columns, or NULL */ - const ulint* col_map,/*!< in: mapping of old column - numbers to new ones, or NULL - if old_table == new_table */ + const ulint* col_map, ulint add_autoinc, - /*!< in: number of added - AUTO_INCREMENT column, or - ULINT_UNDEFINED if none is added */ - ib_sequence_t& sequence,/*!< in/out: autoinc sequence */ - row_merge_block_t* block, /*!< in/out: file buffer */ + ib_sequence_t& sequence, + row_merge_block_t* block, + int* tmpfd, float pct_cost, /*!< in: percent of task weight out of total alter job */ fil_space_crypt_t* crypt_data,/*!< in: crypt data or NULL */ @@ -1477,6 +1525,9 @@ row_merge_read_clustered_index( DEBUG_FTS_SORT_PRINT("FTS_SORT: Start Create Index\n"); #endif + ut_ad(trx->mysql_thd != NULL); + const char* path = thd_innodb_tmpdir(trx->mysql_thd); + /* Create and initialize memory for record buffers */ merge_buf = static_cast( @@ -1954,13 +2005,26 @@ write_buffers: dict_index_get_lock(buf->index)); } - row_merge_buf_write(buf, file, block); + if (buf->n_tuples > 0) { - if (!row_merge_write(file->fd, file->offset++, block, - crypt_data, crypt_block, new_table->space)) { - err = DB_TEMP_FILE_WRITE_FAILURE; - trx->error_key_num = i; - break; + if (row_merge_file_create_if_needed( + file, tmpfd, buf->n_tuples, path) < 0) { + err = DB_OUT_OF_MEMORY; + trx->error_key_num = i; + break; + } + + ut_ad(file->n_rec > 0); + + row_merge_buf_write(buf, file, block); + + if (!row_merge_write(file->fd, file->offset++, + block, crypt_data, crypt_block, + new_table->space)) { + err = DB_TEMP_FILE_WRITE_FAILURE; + trx->error_key_num = i; + break; + } } UNIV_MEM_INVALID(&block[0], srv_sort_buf_size); @@ -2010,12 +2074,13 @@ write_buffers: pct_cost : ((pct_cost * read_rows) / table_total_rows); /* presenting 10.12% as 1012 integer */ - onlineddl_pct_progress = curr_progress * 100; + onlineddl_pct_progress = (ulint) (curr_progress * 100); } } func_exit: mtr_commit(&mtr); + mem_heap_free(row_heap); if (nonnull) { @@ -2111,7 +2176,8 @@ wait_again: if (max_doc_id && err == DB_SUCCESS) { /* Sync fts cache for other fts indexes to keep all fts indexes consistent in sync_doc_id. */ - err = fts_sync_table(const_cast(new_table)); + err = fts_sync_table(const_cast(new_table), + false, true); if (err == DB_SUCCESS) { fts_update_next_doc_id( @@ -2545,7 +2611,7 @@ row_merge_sort( /* Find the number N which 2^N is greater or equal than num_runs */ /* N is merge sort running count */ - total_merge_sort_count = ceil(my_log2f(num_runs)); + total_merge_sort_count = (ulint) ceil(my_log2f(num_runs)); if(total_merge_sort_count <= 0) { total_merge_sort_count=1; } @@ -2592,7 +2658,7 @@ row_merge_sort( pct_cost : ((pct_cost * merge_count) / total_merge_sort_count); /* presenting 10.12% as 1012 integer */; - onlineddl_pct_progress = (pct_progress + curr_progress) * 100; + onlineddl_pct_progress = (ulint) ((pct_progress + curr_progress) * 100); } if (error != DB_SUCCESS) { @@ -2875,7 +2941,7 @@ row_merge_insert_index_tuples( ((pct_cost * inserted_rows) / table_total_rows); /* presenting 10.12% as 1012 integer */; - onlineddl_pct_progress = (pct_progress + curr_progress) * 100; + onlineddl_pct_progress = (ulint) ((pct_progress + curr_progress) * 100); } } } @@ -3344,14 +3410,15 @@ row_merge_drop_temp_indexes(void) trx_free_for_background(trx); } -/*********************************************************************//** -Creates temporary merge files, and if UNIV_PFS_IO defined, register -the file descriptor with Performance Schema. -@return file descriptor, or -1 on failure */ + +/** Create temporary merge files in the given paramater path, and if +UNIV_PFS_IO defined, register the file descriptor with Performance Schema. +@param[in] path location for creating temporary merge files. +@return File descriptor */ UNIV_INTERN int -row_merge_file_create_low(void) -/*===========================*/ +row_merge_file_create_low( + const char* path) { int fd; #ifdef UNIV_PFS_IO @@ -3365,7 +3432,7 @@ row_merge_file_create_low(void) "Innodb Merge Temp File", __FILE__, __LINE__); #endif - fd = innobase_mysql_tmpfile(); + fd = innobase_mysql_tmpfile(path); #ifdef UNIV_PFS_IO register_pfs_file_open_end(locker, fd); #endif @@ -3378,16 +3445,18 @@ row_merge_file_create_low(void) return(fd); } -/*********************************************************************//** -Create a merge file. + +/** Create a merge file in the given location. +@param[out] merge_file merge file structure +@param[in] path location for creating temporary file @return file descriptor, or -1 on failure */ UNIV_INTERN int row_merge_file_create( -/*==================*/ - merge_file_t* merge_file) /*!< out: merge file structure */ + merge_file_t* merge_file, + const char* path) { - merge_file->fd = row_merge_file_create_low(); + merge_file->fd = row_merge_file_create_low(path); merge_file->offset = 0; merge_file->n_rec = 0; @@ -3845,7 +3914,7 @@ row_merge_drop_table( /* There must be no open transactions on the table. */ ut_a(table->n_ref_count == 0); - return(row_drop_table_for_mysql(table->name, trx, false, false)); + return(row_drop_table_for_mysql(table->name, trx, false, false, false)); } /*********************************************************************//** @@ -3958,10 +4027,6 @@ row_merge_build_indexes( total_dynamic_cost = COST_BUILD_INDEX_DYNAMIC * n_indexes; for (i = 0; i < n_indexes; i++) { - if (row_merge_file_create(&merge_files[i]) < 0) { - error = DB_OUT_OF_MEMORY; - goto func_exit; - } if (indexes[i]->type & DICT_FTS) { ibool opt_doc_id_size = FALSE; @@ -3990,13 +4055,6 @@ row_merge_build_indexes( } } - tmpfd = row_merge_file_create_low(); - - if (tmpfd < 0) { - error = DB_OUT_OF_MEMORY; - goto func_exit; - } - /* Reset the MySQL row buffer that is used when reporting duplicate keys. */ innobase_rec_reset(table); @@ -4025,7 +4083,7 @@ row_merge_build_indexes( trx, table, old_table, new_table, online, indexes, fts_sort_idx, psort_info, merge_files, key_numbers, n_indexes, add_cols, col_map, - add_autoinc, sequence, block, pct_cost, + add_autoinc, sequence, block, &tmpfd, pct_cost, crypt_data, crypt_block); pct_progress += pct_cost; @@ -4119,7 +4177,7 @@ wait_again: #ifdef FTS_INTERNAL_DIAG_PRINT DEBUG_FTS_SORT_PRINT("FTS_SORT: Complete Insert\n"); #endif - } else if (UNIV_LIKELY(merge_files[i].n_rec)) { + } else if (merge_files[i].fd != -1) { char buf[3 * NAME_LEN]; char *bufend; row_merge_dup_t dup = { diff --git a/storage/xtradb/row/row0mysql.cc b/storage/xtradb/row/row0mysql.cc index 9427b20daf9..ccdfc1332a0 100644 --- a/storage/xtradb/row/row0mysql.cc +++ b/storage/xtradb/row/row0mysql.cc @@ -2419,7 +2419,7 @@ err_exit: dict_table_close(table, TRUE, FALSE); - row_drop_table_for_mysql(table->name, trx, FALSE); + row_drop_table_for_mysql(table->name, trx, FALSE, TRUE); if (commit) { trx_commit_for_mysql(trx); @@ -2579,7 +2579,7 @@ error_handling: trx_rollback_to_savepoint(trx, NULL); - row_drop_table_for_mysql(table_name, trx, FALSE); + row_drop_table_for_mysql(table_name, trx, FALSE, TRUE); trx_commit_for_mysql(trx); @@ -2656,7 +2656,7 @@ row_table_add_foreign_constraints( trx_rollback_to_savepoint(trx, NULL); - row_drop_table_for_mysql(name, trx, FALSE); + row_drop_table_for_mysql(name, trx, FALSE, TRUE); trx_commit_for_mysql(trx); @@ -2697,7 +2697,7 @@ row_drop_table_for_mysql_in_background( /* Try to drop the table in InnoDB */ - error = row_drop_table_for_mysql(name, trx, FALSE); + error = row_drop_table_for_mysql(name, trx, FALSE, FALSE); /* Flush the log to reduce probability that the .frm files and the InnoDB data dictionary get out-of-sync if the user runs @@ -3844,6 +3844,9 @@ row_drop_table_for_mysql( const char* name, /*!< in: table name */ trx_t* trx, /*!< in: transaction handle */ bool drop_db,/*!< in: true=dropping whole database */ + ibool create_failed,/*!foreign_table_name_lookup); - if (foreign->foreign_table != table && !ref_ok) { + /* We should allow dropping a referenced table if creating + that referenced table has failed for some reason. For example + if referenced table is created but it column types that are + referenced do not match. */ + if (foreign->foreign_table != table && + !create_failed && !ref_ok) { FILE* ef = dict_foreign_err_file; @@ -4593,7 +4601,7 @@ row_mysql_drop_temp_tables(void) table = dict_table_get_low(table_name); if (table) { - row_drop_table_for_mysql(table_name, trx, FALSE); + row_drop_table_for_mysql(table_name, trx, FALSE, FALSE); trx_commit_for_mysql(trx); } @@ -4762,7 +4770,7 @@ loop: goto loop; } - err = row_drop_table_for_mysql(table_name, trx, TRUE); + err = row_drop_table_for_mysql(table_name, trx, TRUE, FALSE); trx_commit_for_mysql(trx); if (err != DB_SUCCESS) { diff --git a/storage/xtradb/srv/srv0conc.cc b/storage/xtradb/srv/srv0conc.cc index c4cf1b9ab7b..a8e7e2ab1aa 100644 --- a/storage/xtradb/srv/srv0conc.cc +++ b/storage/xtradb/srv/srv0conc.cc @@ -110,7 +110,7 @@ UNIV_INTERN mysql_pfs_key_t srv_conc_mutex_key; /** Variables tracking the active and waiting threads. */ struct srv_conc_t { - char pad[64 - (sizeof(ulint) + sizeof(lint))]; + char pad[CACHE_LINE_SIZE - (sizeof(ulint) + sizeof(lint))]; /** Number of transactions that have declared_to_be_inside_innodb set. It used to be a non-error for this value to drop below zero temporarily. @@ -165,6 +165,10 @@ srv_conc_free(void) { #ifndef HAVE_ATOMIC_BUILTINS os_fast_mutex_free(&srv_conc_mutex); + + for (ulint i = 0; i < OS_THREAD_MAX_N; i++) + os_event_free(srv_conc_slots[i].event); + mem_free(srv_conc_slots); srv_conc_slots = NULL; #endif /* !HAVE_ATOMIC_BUILTINS */ diff --git a/storage/xtradb/srv/srv0srv.cc b/storage/xtradb/srv/srv0srv.cc index 794b119a090..85e988e16b2 100644 --- a/storage/xtradb/srv/srv0srv.cc +++ b/storage/xtradb/srv/srv0srv.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2008, 2009 Google Inc. Copyright (c) 2009, Percona Inc. Copyright (c) 2013, 2014, SkySQL Ab. All Rights Reserved. @@ -372,8 +372,6 @@ UNIV_INTERN ulong srv_read_ahead_threshold = 56; #ifdef UNIV_LOG_ARCHIVE UNIV_INTERN ibool srv_log_archive_on = FALSE; -UNIV_INTERN ibool srv_archive_recovery = 0; -UNIV_INTERN ib_uint64_t srv_archive_recovery_limit_lsn; #endif /* UNIV_LOG_ARCHIVE */ /* This parameter is used to throttle the number of insert buffers that are @@ -580,11 +578,6 @@ UNIV_INTERN ib_uint64_t srv_index_page_decompressed = 0; /* Ensure status variables are on separate cache lines */ -#ifdef __powerpc__ -#define CACHE_LINE_SIZE 128 -#else -#define CACHE_LINE_SIZE 64 -#endif #define CACHE_ALIGNED __attribute__ ((aligned (CACHE_LINE_SIZE))) UNIV_INTERN byte @@ -810,6 +803,10 @@ struct srv_sys_t{ srv_stats_t::ulint_ctr_1_t activity_count; /*!< For tracking server activity */ + srv_stats_t::ulint_ctr_1_t + ibuf_merge_activity_count;/*!< For tracking change + buffer merge activity, a subset + of overall server activity */ }; #ifndef HAVE_ATOMIC_BUILTINS @@ -1200,8 +1197,9 @@ srv_init(void) srv_checkpoint_completed_event = os_event_create(); + srv_redo_log_tracked_event = os_event_create(); + if (srv_track_changed_pages) { - srv_redo_log_tracked_event = os_event_create(); os_event_set(srv_redo_log_tracked_event); } @@ -1251,17 +1249,34 @@ srv_free(void) { srv_conc_free(); - /* The mutexes srv_sys->mutex and srv_sys->tasks_mutex should have - been freed by sync_close() already. */ + if (!srv_read_only_mode) { + + for (ulint i = 0; i < srv_sys->n_sys_threads; i++) + os_event_free(srv_sys->sys_threads[i].event); + + os_event_free(srv_error_event); + os_event_free(srv_monitor_event); + os_event_free(srv_buf_dump_event); + os_event_free(srv_checkpoint_completed_event); + os_event_free(srv_redo_log_tracked_event); + mutex_free(&srv_sys->mutex); + mutex_free(&srv_sys->tasks_mutex); + } + +#ifdef WITH_INNODB_DISALLOW_WRITES + os_event_free(srv_allow_writes_event); +#endif /* WITH_INNODB_DISALLOW_WRITES */ + +#ifndef HAVE_ATOMIC_BUILTINS + mutex_free(&server_mutex); +#endif + mutex_free(&srv_innodb_monitor_mutex); + mutex_free(&page_zip_stat_per_index_mutex); + mem_free(srv_sys); srv_sys = NULL; trx_i_s_cache_free(trx_i_s_cache); - - if (!srv_read_only_mode) { - os_event_free(srv_buf_dump_event); - srv_buf_dump_event = NULL; - } } /*********************************************************************//** @@ -2243,6 +2258,8 @@ exit_func: /*********************************************************************//** A thread which prints warnings about semaphore waits which have lasted too long. These can be used to track bugs which cause hangs. +Note: In order to make sync_arr_wake_threads_if_sema_free work as expected, +we should avoid waiting any mutexes in this function! @return a dummy parameter */ extern "C" UNIV_INTERN os_thread_ret_t @@ -2282,23 +2299,21 @@ loop: /* Try to track a strange bug reported by Harald Fuchs and others, where the lsn seems to decrease at times */ - /* We have to use nowait to ensure we don't block */ - new_lsn= log_get_lsn_nowait(); + if (log_peek_lsn(&new_lsn)) { + if (new_lsn < old_lsn) { + ut_print_timestamp(stderr); + fprintf(stderr, + " InnoDB: Error: old log sequence number " LSN_PF + " was greater\n" + "InnoDB: than the new log sequence number " LSN_PF "!\n" + "InnoDB: Please submit a bug report" + " to http://bugs.mysql.com\n", + old_lsn, new_lsn); + ut_ad(0); + } - if (new_lsn && new_lsn < old_lsn) { - ut_print_timestamp(stderr); - fprintf(stderr, - " InnoDB: Error: old log sequence number " LSN_PF - " was greater\n" - "InnoDB: than the new log sequence number " LSN_PF "!\n" - "InnoDB: Please submit a bug report" - " to http://bugs.mysql.com\n", - old_lsn, new_lsn); - ut_ad(0); - } - - if (new_lsn) old_lsn = new_lsn; + } if (difftime(time(NULL), srv_last_monitor_time) > 60) { /* We referesh InnoDB Monitor values so that averages are @@ -2320,7 +2335,7 @@ loop: if (sync_array_print_long_waits(&waiter, &sema) && sema == old_sema && os_thread_eq(waiter, old_waiter)) { #if defined(WITH_WSREP) && defined(WITH_INNODB_DISALLOW_WRITES) - if (srv_allow_writes_event->is_set) { + if (srv_allow_writes_event->is_set()) { #endif /* WITH_WSREP */ fatal_cnt++; #if defined(WITH_WSREP) && defined(WITH_INNODB_DISALLOW_WRITES) @@ -2408,10 +2423,15 @@ rescan_idle: Increment the server activity count. */ UNIV_INTERN void -srv_inc_activity_count(void) -/*========================*/ +srv_inc_activity_count( +/*===================*/ + bool ibuf_merge_activity) /*!< whether this activity bump + is caused by the background + change buffer merge */ { srv_sys->activity_count.inc(); + if (ibuf_merge_activity) + srv_sys->ibuf_merge_activity_count.inc(); } /**********************************************************************//** @@ -2531,7 +2551,7 @@ DECLARE_THREAD(srv_redo_log_follow_thread)( /* TODO: sync with I_S log tracking status? */ ib_logf(IB_LOG_LEVEL_ERROR, "log tracking bitmap write failed, " - "stopping log tracking thread!\n"); + "stopping log tracking thread!"); break; } os_event_set(srv_redo_log_tracked_event); @@ -2573,7 +2593,7 @@ purge_archived_logs( if (!dir) { ib_logf(IB_LOG_LEVEL_WARN, "opening archived log directory %s failed. " - "Purge archived logs are not available\n", + "Purge archived logs are not available", srv_arch_dir); /* failed to open directory */ return(DB_ERROR); @@ -2661,7 +2681,7 @@ purge_archived_logs( archived_log_filename)) { ib_logf(IB_LOG_LEVEL_WARN, - "can't delete archived log file %s.\n", + "can't delete archived log file %s.", archived_log_filename); mutex_exit(&log_sys->mutex); @@ -2769,16 +2789,49 @@ srv_get_activity_count(void) return(srv_sys->activity_count); } +/** Get current server ibuf merge activity count. +@return ibuf merge activity count */ +static +ulint +srv_get_ibuf_merge_activity_count(void) +{ + return(srv_sys->ibuf_merge_activity_count); +} + /*******************************************************************//** -Check if there has been any activity. +Check if there has been any activity. Considers background change buffer +merge as regular server activity unless a non-default +old_ibuf_merge_activity_count value is passed, in which case the merge will be +treated as keeping server idle. @return FALSE if no change in activity counter. */ UNIV_INTERN ibool srv_check_activity( /*===============*/ - ulint old_activity_count) /*!< in: old activity count */ + ulint old_activity_count, /*!< in: old activity count */ + /*!< old change buffer merge + activity count, or + ULINT_UNDEFINED */ + ulint old_ibuf_merge_activity_count) { - return(srv_sys->activity_count != old_activity_count); + ulint new_activity_count = srv_sys->activity_count; + if (old_ibuf_merge_activity_count == ULINT_UNDEFINED) + return(new_activity_count != old_activity_count); + + /* If we care about ibuf merge activity, then the server is considered + idle if all activity, if any, was due to ibuf merge. */ + ulint new_ibuf_merge_activity_count + = srv_sys->ibuf_merge_activity_count; + + ut_ad(new_ibuf_merge_activity_count <= new_activity_count); + ut_ad(new_ibuf_merge_activity_count >= old_ibuf_merge_activity_count); + ut_ad(new_activity_count >= old_activity_count); + + ulint ibuf_merge_activity_delta = + new_ibuf_merge_activity_count - old_ibuf_merge_activity_count; + ulint activity_delta = new_activity_count - old_activity_count; + + return (activity_delta > ibuf_merge_activity_delta); } /********************************************************************//** @@ -3142,6 +3195,8 @@ DECLARE_THREAD(srv_master_thread)( { srv_slot_t* slot; ulint old_activity_count = srv_get_activity_count(); + ulint old_ibuf_merge_activity_count + = srv_get_ibuf_merge_activity_count(); ib_time_t last_print_time; ut_ad(!srv_read_only_mode); @@ -3179,8 +3234,12 @@ loop: srv_current_thread_priority = srv_master_thread_priority; - if (srv_check_activity(old_activity_count)) { + if (srv_check_activity(old_activity_count, + old_ibuf_merge_activity_count)) { + old_activity_count = srv_get_activity_count(); + old_ibuf_merge_activity_count + = srv_get_ibuf_merge_activity_count(); srv_master_do_active_tasks(); } else { srv_master_do_idle_tasks(); diff --git a/storage/xtradb/srv/srv0start.cc b/storage/xtradb/srv/srv0start.cc index 17f9e53e76f..6a3e756cb44 100644 --- a/storage/xtradb/srv/srv0start.cc +++ b/storage/xtradb/srv/srv0start.cc @@ -1836,32 +1836,7 @@ innobase_start_or_create_for_mysql(void) srv_startup_is_before_trx_rollback_phase = TRUE; #ifdef __WIN__ - switch (os_get_os_version()) { - case OS_WIN95: - case OS_WIN31: - case OS_WINNT: - srv_use_native_conditions = FALSE; - /* On Win 95, 98, ME, Win32 subsystem for Windows 3.1, - and NT use simulated aio. In NT Windows provides async i/o, - but when run in conjunction with InnoDB Hot Backup, it seemed - to corrupt the data files. */ - - srv_use_native_aio = FALSE; - break; - - case OS_WIN2000: - case OS_WINXP: - /* On 2000 and XP, async IO is available, but no condition variables. */ - srv_use_native_aio = TRUE; - srv_use_native_conditions = FALSE; - break; - - default: - /* Vista and later have both async IO and condition variables */ - srv_use_native_aio = TRUE; - srv_use_native_conditions = TRUE; - break; - } + srv_use_native_aio = TRUE; #elif defined(LINUX_NATIVE_AIO) @@ -2000,7 +1975,7 @@ innobase_start_or_create_for_mysql(void) } } else { srv_monitor_file_name = NULL; - srv_monitor_file = os_file_create_tmpfile(); + srv_monitor_file = os_file_create_tmpfile(NULL); if (!srv_monitor_file) { return(DB_ERROR); @@ -2010,7 +1985,7 @@ innobase_start_or_create_for_mysql(void) mutex_create(srv_dict_tmpfile_mutex_key, &srv_dict_tmpfile_mutex, SYNC_DICT_OPERATION); - srv_dict_tmpfile = os_file_create_tmpfile(); + srv_dict_tmpfile = os_file_create_tmpfile(NULL); if (!srv_dict_tmpfile) { return(DB_ERROR); @@ -2019,7 +1994,7 @@ innobase_start_or_create_for_mysql(void) mutex_create(srv_misc_tmpfile_mutex_key, &srv_misc_tmpfile_mutex, SYNC_ANY_LATCH); - srv_misc_tmpfile = os_file_create_tmpfile(); + srv_misc_tmpfile = os_file_create_tmpfile(NULL); if (!srv_misc_tmpfile) { return(DB_ERROR); @@ -2483,40 +2458,6 @@ files_checked: create_log_files_rename(logfilename, dirnamelen, max_flushed_lsn, logfile0); -#ifdef UNIV_LOG_ARCHIVE - } else if (srv_archive_recovery) { - - ib_logf(IB_LOG_LEVEL_INFO, - " Starting archive recovery from a backup..."); - - err = recv_recovery_from_archive_start( - min_flushed_lsn, srv_archive_recovery_limit_lsn, - min_arch_log_no); - if (err != DB_SUCCESS) { - - return(DB_ERROR); - } - /* Since ibuf init is in dict_boot, and ibuf is needed - in any disk i/o, first call dict_boot */ - - err = dict_boot(); - - if (err != DB_SUCCESS) { - return(err); - } - - ib_bh = trx_sys_init_at_db_start(); - n_recovered_trx = UT_LIST_GET_LEN(trx_sys->rw_trx_list); - - /* The purge system needs to create the purge view and - therefore requires that the trx_sys is inited. */ - - trx_purge_sys_create(srv_n_purge_threads, ib_bh); - - srv_startup_is_before_trx_rollback_phase = FALSE; - - recv_recovery_from_archive_finish(); -#endif /* UNIV_LOG_ARCHIVE */ } else { /* Check if we support the max format that is stamped @@ -3213,15 +3154,13 @@ innobase_shutdown_for_mysql(void) logs_empty_and_mark_files_at_shutdown() and should have already quit or is quitting right now. */ - if (srv_use_mtflush) { /* g. Exit the multi threaded flush threads */ buf_mtflu_io_thread_exit(); } - os_mutex_enter(os_sync_mutex); - + os_rmb; if (os_thread_count == 0) { /* All the threads have exited or are just exiting; NOTE that the threads may not have completed their @@ -3231,15 +3170,11 @@ innobase_shutdown_for_mysql(void) os_thread_exit(). Now we just sleep 0.1 seconds and hope that is enough! */ - os_mutex_exit(os_sync_mutex); - os_thread_sleep(100000); break; } - os_mutex_exit(os_sync_mutex); - os_thread_sleep(100000); } @@ -3348,26 +3283,23 @@ innobase_shutdown_for_mysql(void) que_close(); row_mysql_close(); srv_mon_free(); - sync_close(); srv_free(); fil_close(); - /* 4. Free the os_conc_mutex and all os_events and os_mutexes */ - - os_sync_free(); - - /* 5. Free all allocated memory */ + /* 4. Free all allocated memory */ pars_lexer_close(); log_mem_free(); buf_pool_free(srv_buf_pool_instances); mem_close(); + sync_close(); /* ut_free_all_mem() frees all allocated memory not freed yet in shutdown, and it will also free the ut_list_mutex, so it should be the last one for all operation */ ut_free_all_mem(); + os_rmb; if (os_thread_count != 0 || os_event_count != 0 || os_mutex_count != 0 diff --git a/storage/xtradb/sync/sync0arr.cc b/storage/xtradb/sync/sync0arr.cc index d881c5de2f5..c311d2cbd7d 100644 --- a/storage/xtradb/sync/sync0arr.cc +++ b/storage/xtradb/sync/sync0arr.cc @@ -336,21 +336,21 @@ sync_cell_get_event( ulint type = cell->request_type; if (type == SYNC_MUTEX) { - return(((ib_mutex_t*) cell->wait_object)->event); + return(&((ib_mutex_t*) cell->wait_object)->event); } else if (type == SYNC_PRIO_MUTEX) { - return(((ib_prio_mutex_t*) cell->wait_object) + return(&((ib_prio_mutex_t*) cell->wait_object) ->high_priority_event); } else if (type == RW_LOCK_WAIT_EX) { - return(((rw_lock_t*) cell->wait_object)->wait_ex_event); + return(&((rw_lock_t*) cell->wait_object)->wait_ex_event); } else if (type == PRIO_RW_LOCK_SHARED) { - return(((prio_rw_lock_t *) cell->wait_object) + return(&((prio_rw_lock_t *) cell->wait_object) ->high_priority_s_event); } else if (type == PRIO_RW_LOCK_EX) { - return(((prio_rw_lock_t *) cell->wait_object) + return(&((prio_rw_lock_t *) cell->wait_object) ->high_priority_x_event); } else { /* RW_LOCK_SHARED and RW_LOCK_EX wait on the same event */ ut_ad(type == RW_LOCK_SHARED || type == RW_LOCK_EX); - return(((rw_lock_t*) cell->wait_object)->event); + return(&((rw_lock_t*) cell->wait_object)->event); } } diff --git a/storage/xtradb/sync/sync0rw.cc b/storage/xtradb/sync/sync0rw.cc index 00fb5e511a4..729f510013d 100644 --- a/storage/xtradb/sync/sync0rw.cc +++ b/storage/xtradb/sync/sync0rw.cc @@ -261,8 +261,8 @@ rw_lock_create_func( lock->last_x_file_name = "not yet reserved"; lock->last_s_line = 0; lock->last_x_line = 0; - lock->event = os_event_create(); - lock->wait_ex_event = os_event_create(); + os_event_create(&lock->event); + os_event_create(&lock->wait_ex_event); mutex_enter(&rw_lock_list_mutex); @@ -304,9 +304,9 @@ rw_lock_create_func( cline); lock->high_priority_s_waiters = 0; - lock->high_priority_s_event = os_event_create(); + os_event_create(&lock->high_priority_s_event); lock->high_priority_x_waiters = 0; - lock->high_priority_x_event = os_event_create(); + os_event_create(&lock->high_priority_x_event); lock->high_priority_wait_ex_waiter = 0; } @@ -334,9 +334,9 @@ rw_lock_free_func( mutex = rw_lock_get_mutex(lock); #endif /* !INNODB_RW_LOCKS_USE_ATOMICS */ - os_event_free(lock->event); + os_event_free(&lock->event, false); - os_event_free(lock->wait_ex_event); + os_event_free(&lock->wait_ex_event, false); ut_ad(UT_LIST_GET_PREV(list, lock) == NULL || UT_LIST_GET_PREV(list, lock)->magic_n == RW_LOCK_MAGIC_N); @@ -366,8 +366,8 @@ rw_lock_free_func( /*==============*/ prio_rw_lock_t* lock) /*!< in: rw-lock */ { - os_event_free(lock->high_priority_s_event); - os_event_free(lock->high_priority_x_event); + os_event_free(&lock->high_priority_s_event, false); + os_event_free(&lock->high_priority_x_event, false); rw_lock_free_func(&lock->base_lock); } diff --git a/storage/xtradb/sync/sync0sync.cc b/storage/xtradb/sync/sync0sync.cc index 702dd240f16..c699fbf2ded 100644 --- a/storage/xtradb/sync/sync0sync.cc +++ b/storage/xtradb/sync/sync0sync.cc @@ -212,10 +212,7 @@ UNIV_INTERN mysql_pfs_key_t sync_thread_mutex_key; /** Global list of database mutexes (not OS mutexes) created. */ UNIV_INTERN ut_list_base_node_t mutex_list; -/** Global list of priority mutexes. A subset of mutex_list */ -UNIV_INTERN UT_LIST_BASE_NODE_T(ib_prio_mutex_t) prio_mutex_list; - -/** Mutex protecting the mutex_list and prio_mutex_list variables */ +/** Mutex protecting the mutex_list variable */ UNIV_INTERN ib_mutex_t mutex_list_mutex; #ifdef UNIV_PFS_MUTEX @@ -280,7 +277,7 @@ mutex_create_func( os_fast_mutex_init(PFS_NOT_INSTRUMENTED, &mutex->os_fast_mutex); mutex->lock_word = 0; #endif - mutex->event = os_event_create(); + os_event_create(&mutex->event); mutex_set_waiters(mutex, 0); #ifdef UNIV_DEBUG mutex->magic_n = MUTEX_MAGIC_N; @@ -349,11 +346,7 @@ mutex_create_func( cline, cmutex_name); mutex->high_priority_waiters = 0; - mutex->high_priority_event = os_event_create(); - - mutex_enter(&mutex_list_mutex); - UT_LIST_ADD_FIRST(list, prio_mutex_list, mutex); - mutex_exit(&mutex_list_mutex); + os_event_create(&mutex->high_priority_event); } /******************************************************************//** @@ -400,7 +393,7 @@ mutex_free_func( mutex_exit(&mutex_list_mutex); } - os_event_free(mutex->event); + os_event_free(&mutex->event, false); #ifdef UNIV_MEM_DEBUG func_exit: #endif /* UNIV_MEM_DEBUG */ @@ -427,12 +420,8 @@ mutex_free_func( /*============*/ ib_prio_mutex_t* mutex) /*!< in: mutex */ { - mutex_enter(&mutex_list_mutex); - UT_LIST_REMOVE(list, prio_mutex_list, mutex); - mutex_exit(&mutex_list_mutex); - ut_a(mutex->high_priority_waiters == 0); - os_event_free(mutex->high_priority_event); + os_event_free(&mutex->high_priority_event, false); mutex_free_func(&mutex->base_mutex); } @@ -722,7 +711,7 @@ mutex_signal_object( /* The memory order of resetting the waiters field and signaling the object is important. See LEMMA 1 above. */ - os_event_set(mutex->event); + os_event_set(&mutex->event); sync_array_object_signalled(); } @@ -1555,7 +1544,6 @@ sync_init(void) /* Init the mutex list and create the mutex to protect it. */ UT_LIST_INIT(mutex_list); - UT_LIST_INIT(prio_mutex_list); mutex_create(mutex_list_mutex_key, &mutex_list_mutex, SYNC_NO_ORDER_CHECK); #ifdef UNIV_SYNC_DEBUG @@ -1602,22 +1590,17 @@ sync_thread_level_arrays_free(void) #endif /* UNIV_SYNC_DEBUG */ /******************************************************************//** -Frees the resources in InnoDB's own synchronization data structures. Use -os_sync_free() after calling this. */ +Frees the resources in InnoDB's own synchronization data structures. */ UNIV_INTERN void sync_close(void) /*===========*/ { ib_mutex_t* mutex; - ib_prio_mutex_t* prio_mutex; sync_array_close(); - for (prio_mutex = UT_LIST_GET_FIRST(prio_mutex_list); prio_mutex;) { - mutex_free(prio_mutex); - prio_mutex = UT_LIST_GET_FIRST(prio_mutex_list); - } + mutex_free(&rw_lock_list_mutex); for (mutex = UT_LIST_GET_FIRST(mutex_list); mutex != NULL; @@ -1635,7 +1618,6 @@ sync_close(void) mutex = UT_LIST_GET_FIRST(mutex_list); } - mutex_free(&mutex_list_mutex); #ifdef UNIV_SYNC_DEBUG mutex_free(&sync_thread_mutex); @@ -1646,6 +1628,8 @@ sync_close(void) os_fast_mutex_free(&rw_lock_debug_mutex); #endif /* UNIV_SYNC_DEBUG */ + mutex_free(&mutex_list_mutex); + sync_initialized = FALSE; } diff --git a/storage/xtradb/trx/trx0i_s.cc b/storage/xtradb/trx/trx0i_s.cc index 3230ac8308c..eacd9212d2f 100644 --- a/storage/xtradb/trx/trx0i_s.cc +++ b/storage/xtradb/trx/trx0i_s.cc @@ -1466,6 +1466,8 @@ trx_i_s_cache_free( /*===============*/ trx_i_s_cache_t* cache) /*!< in, own: cache to free */ { + rw_lock_free(&cache->rw_lock); + mutex_free(&cache->last_read_mutex); hash_table_free(cache->locks_hash); ha_storage_free(cache->storage); table_cache_free(&cache->innodb_trx); diff --git a/storage/xtradb/trx/trx0roll.cc b/storage/xtradb/trx/trx0roll.cc index 67f63d08303..4e8547c7d64 100644 --- a/storage/xtradb/trx/trx0roll.cc +++ b/storage/xtradb/trx/trx0roll.cc @@ -653,7 +653,7 @@ trx_rollback_active( "in recovery", table->name, trx->table_id); - err = row_drop_table_for_mysql(table->name, trx, TRUE); + err = row_drop_table_for_mysql(table->name, trx, TRUE, FALSE); trx_commit_for_mysql(trx); ut_a(err == DB_SUCCESS); diff --git a/storage/xtradb/trx/trx0sys.cc b/storage/xtradb/trx/trx0sys.cc index 9b136ccef92..182bdc5d74c 100644 --- a/storage/xtradb/trx/trx0sys.cc +++ b/storage/xtradb/trx/trx0sys.cc @@ -353,10 +353,17 @@ trx_sys_update_wsrep_checkpoint( unsigned char xid_uuid[16]; long long xid_seqno = read_wsrep_xid_seqno(xid); read_wsrep_xid_uuid(xid, xid_uuid); - if (!memcmp(xid_uuid, trx_sys_cur_xid_uuid, 8)) + if (!memcmp(xid_uuid, trx_sys_cur_xid_uuid, 16)) { + /* + This check is a protection against the initial seqno (-1) + assigned in read_wsrep_xid_uuid(), which, if not checked, + would cause the following assertion to fail. + */ + if (xid_seqno > -1 ) + { ut_ad(xid_seqno > trx_sys_cur_xid_seqno); - trx_sys_cur_xid_seqno = xid_seqno; + } } else { @@ -415,6 +422,8 @@ trx_sys_read_wsrep_checkpoint(XID* xid) + TRX_SYS_WSREP_XID_MAGIC_N_FLD)) != TRX_SYS_WSREP_XID_MAGIC_N) { memset(xid, 0, sizeof(*xid)); + long long seqno= -1; + memcpy(xid->data + 24, &seqno, sizeof(long long)); xid->formatID = -1; trx_sys_update_wsrep_checkpoint(xid, sys_header, &mtr); mtr_commit(&mtr); diff --git a/storage/xtradb/ut/crc32_power8/crc32.S b/storage/xtradb/ut/crc32_power8/crc32.S deleted file mode 100644 index b064ce3dc96..00000000000 --- a/storage/xtradb/ut/crc32_power8/crc32.S +++ /dev/null @@ -1,775 +0,0 @@ -/* - * Calculate the checksum of data that is 16 byte aligned and a multiple of - * 16 bytes. - * - * The first step is to reduce it to 1024 bits. We do this in 8 parallel - * chunks in order to mask the latency of the vpmsum instructions. If we - * have more than 32 kB of data to checksum we repeat this step multiple - * times, passing in the previous 1024 bits. - * - * The next step is to reduce the 1024 bits to 64 bits. This step adds - * 32 bits of 0s to the end - this matches what a CRC does. We just - * calculate constants that land the data in this 32 bits. - * - * We then use fixed point Barrett reduction to compute a mod n over GF(2) - * for n = CRC using POWER8 instructions. We use x = 32. - * - * http://en.wikipedia.org/wiki/Barrett_reduction - * - * Copyright (C) 2015 Anton Blanchard , IBM - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#ifdef __powerpc__ - -#include -#include "ppc-opcode.h" - -#undef toc - -#ifndef r1 -#define r1 1 -#endif - -#ifndef r2 -#define r2 2 -#endif - - .section .rodata -.balign 16 - -.byteswap_constant: - /* byte reverse permute constant */ - .octa 0x0F0E0D0C0B0A09080706050403020100 - -#define __ASSEMBLY__ -#include "crc32_constants.h" - - .text - -#if defined(__BIG_ENDIAN__) && defined(REFLECT) -#define BYTESWAP_DATA -#elif defined(__LITTLE_ENDIAN__) && !defined(REFLECT) -#define BYTESWAP_DATA -#else -#undef BYTESWAP_DATA -#endif - -#define off16 r25 -#define off32 r26 -#define off48 r27 -#define off64 r28 -#define off80 r29 -#define off96 r30 -#define off112 r31 - -#define const1 v24 -#define const2 v25 - -#define byteswap v26 -#define mask_32bit v27 -#define mask_64bit v28 -#define zeroes v29 - -#ifdef BYTESWAP_DATA -#define VPERM(A, B, C, D) vperm A, B, C, D -#else -#define VPERM(A, B, C, D) -#endif - -/* unsigned int __crc32_vpmsum(unsigned int crc, void *p, unsigned long len) */ -FUNC_START(__crc32_vpmsum) - std r31,-8(r1) - std r30,-16(r1) - std r29,-24(r1) - std r28,-32(r1) - std r27,-40(r1) - std r26,-48(r1) - std r25,-56(r1) - - li off16,16 - li off32,32 - li off48,48 - li off64,64 - li off80,80 - li off96,96 - li off112,112 - li r0,0 - - /* Enough room for saving 10 non volatile VMX registers */ - subi r6,r1,56+10*16 - subi r7,r1,56+2*16 - - stvx v20,0,r6 - stvx v21,off16,r6 - stvx v22,off32,r6 - stvx v23,off48,r6 - stvx v24,off64,r6 - stvx v25,off80,r6 - stvx v26,off96,r6 - stvx v27,off112,r6 - stvx v28,0,r7 - stvx v29,off16,r7 - - mr r10,r3 - - vxor zeroes,zeroes,zeroes - vspltisw v0,-1 - - vsldoi mask_32bit,zeroes,v0,4 - vsldoi mask_64bit,zeroes,v0,8 - - /* Get the initial value into v8 */ - vxor v8,v8,v8 - MTVRD(v8, r3) -#ifdef REFLECT - vsldoi v8,zeroes,v8,8 /* shift into bottom 32 bits */ -#else - vsldoi v8,v8,zeroes,4 /* shift into top 32 bits */ -#endif - -#ifdef BYTESWAP_DATA - addis r3,r2,.byteswap_constant@toc@ha - addi r3,r3,.byteswap_constant@toc@l - - lvx byteswap,0,r3 - addi r3,r3,16 -#endif - - cmpdi r5,256 - blt .Lshort - - rldicr r6,r5,0,56 - - /* Checksum in blocks of MAX_SIZE */ -1: lis r7,MAX_SIZE@h - ori r7,r7,MAX_SIZE@l - mr r9,r7 - cmpd r6,r7 - bgt 2f - mr r7,r6 -2: subf r6,r7,r6 - - /* our main loop does 128 bytes at a time */ - srdi r7,r7,7 - - /* - * Work out the offset into the constants table to start at. Each - * constant is 16 bytes, and it is used against 128 bytes of input - * data - 128 / 16 = 8 - */ - sldi r8,r7,4 - srdi r9,r9,3 - subf r8,r8,r9 - - /* We reduce our final 128 bytes in a separate step */ - addi r7,r7,-1 - mtctr r7 - - addis r3,r2,.constants@toc@ha - addi r3,r3,.constants@toc@l - - /* Find the start of our constants */ - add r3,r3,r8 - - /* zero v0-v7 which will contain our checksums */ - vxor v0,v0,v0 - vxor v1,v1,v1 - vxor v2,v2,v2 - vxor v3,v3,v3 - vxor v4,v4,v4 - vxor v5,v5,v5 - vxor v6,v6,v6 - vxor v7,v7,v7 - - lvx const1,0,r3 - - /* - * If we are looping back to consume more data we use the values - * already in v16-v23. - */ - cmpdi r0,1 - beq 2f - - /* First warm up pass */ - lvx v16,0,r4 - lvx v17,off16,r4 - VPERM(v16,v16,v16,byteswap) - VPERM(v17,v17,v17,byteswap) - lvx v18,off32,r4 - lvx v19,off48,r4 - VPERM(v18,v18,v18,byteswap) - VPERM(v19,v19,v19,byteswap) - lvx v20,off64,r4 - lvx v21,off80,r4 - VPERM(v20,v20,v20,byteswap) - VPERM(v21,v21,v21,byteswap) - lvx v22,off96,r4 - lvx v23,off112,r4 - VPERM(v22,v22,v22,byteswap) - VPERM(v23,v23,v23,byteswap) - addi r4,r4,8*16 - - /* xor in initial value */ - vxor v16,v16,v8 - -2: bdz .Lfirst_warm_up_done - - addi r3,r3,16 - lvx const2,0,r3 - - /* Second warm up pass */ - VPMSUMD(v8,v16,const1) - lvx v16,0,r4 - VPERM(v16,v16,v16,byteswap) - ori r2,r2,0 - - VPMSUMD(v9,v17,const1) - lvx v17,off16,r4 - VPERM(v17,v17,v17,byteswap) - ori r2,r2,0 - - VPMSUMD(v10,v18,const1) - lvx v18,off32,r4 - VPERM(v18,v18,v18,byteswap) - ori r2,r2,0 - - VPMSUMD(v11,v19,const1) - lvx v19,off48,r4 - VPERM(v19,v19,v19,byteswap) - ori r2,r2,0 - - VPMSUMD(v12,v20,const1) - lvx v20,off64,r4 - VPERM(v20,v20,v20,byteswap) - ori r2,r2,0 - - VPMSUMD(v13,v21,const1) - lvx v21,off80,r4 - VPERM(v21,v21,v21,byteswap) - ori r2,r2,0 - - VPMSUMD(v14,v22,const1) - lvx v22,off96,r4 - VPERM(v22,v22,v22,byteswap) - ori r2,r2,0 - - VPMSUMD(v15,v23,const1) - lvx v23,off112,r4 - VPERM(v23,v23,v23,byteswap) - - addi r4,r4,8*16 - - bdz .Lfirst_cool_down - - /* - * main loop. We modulo schedule it such that it takes three iterations - * to complete - first iteration load, second iteration vpmsum, third - * iteration xor. - */ - .balign 16 -4: lvx const1,0,r3 - addi r3,r3,16 - ori r2,r2,0 - - vxor v0,v0,v8 - VPMSUMD(v8,v16,const2) - lvx v16,0,r4 - VPERM(v16,v16,v16,byteswap) - ori r2,r2,0 - - vxor v1,v1,v9 - VPMSUMD(v9,v17,const2) - lvx v17,off16,r4 - VPERM(v17,v17,v17,byteswap) - ori r2,r2,0 - - vxor v2,v2,v10 - VPMSUMD(v10,v18,const2) - lvx v18,off32,r4 - VPERM(v18,v18,v18,byteswap) - ori r2,r2,0 - - vxor v3,v3,v11 - VPMSUMD(v11,v19,const2) - lvx v19,off48,r4 - VPERM(v19,v19,v19,byteswap) - lvx const2,0,r3 - ori r2,r2,0 - - vxor v4,v4,v12 - VPMSUMD(v12,v20,const1) - lvx v20,off64,r4 - VPERM(v20,v20,v20,byteswap) - ori r2,r2,0 - - vxor v5,v5,v13 - VPMSUMD(v13,v21,const1) - lvx v21,off80,r4 - VPERM(v21,v21,v21,byteswap) - ori r2,r2,0 - - vxor v6,v6,v14 - VPMSUMD(v14,v22,const1) - lvx v22,off96,r4 - VPERM(v22,v22,v22,byteswap) - ori r2,r2,0 - - vxor v7,v7,v15 - VPMSUMD(v15,v23,const1) - lvx v23,off112,r4 - VPERM(v23,v23,v23,byteswap) - - addi r4,r4,8*16 - - bdnz 4b - -.Lfirst_cool_down: - /* First cool down pass */ - lvx const1,0,r3 - addi r3,r3,16 - - vxor v0,v0,v8 - VPMSUMD(v8,v16,const1) - ori r2,r2,0 - - vxor v1,v1,v9 - VPMSUMD(v9,v17,const1) - ori r2,r2,0 - - vxor v2,v2,v10 - VPMSUMD(v10,v18,const1) - ori r2,r2,0 - - vxor v3,v3,v11 - VPMSUMD(v11,v19,const1) - ori r2,r2,0 - - vxor v4,v4,v12 - VPMSUMD(v12,v20,const1) - ori r2,r2,0 - - vxor v5,v5,v13 - VPMSUMD(v13,v21,const1) - ori r2,r2,0 - - vxor v6,v6,v14 - VPMSUMD(v14,v22,const1) - ori r2,r2,0 - - vxor v7,v7,v15 - VPMSUMD(v15,v23,const1) - ori r2,r2,0 - -.Lsecond_cool_down: - /* Second cool down pass */ - vxor v0,v0,v8 - vxor v1,v1,v9 - vxor v2,v2,v10 - vxor v3,v3,v11 - vxor v4,v4,v12 - vxor v5,v5,v13 - vxor v6,v6,v14 - vxor v7,v7,v15 - -#ifdef REFLECT - /* - * vpmsumd produces a 96 bit result in the least significant bits - * of the register. Since we are bit reflected we have to shift it - * left 32 bits so it occupies the least significant bits in the - * bit reflected domain. - */ - vsldoi v0,v0,zeroes,4 - vsldoi v1,v1,zeroes,4 - vsldoi v2,v2,zeroes,4 - vsldoi v3,v3,zeroes,4 - vsldoi v4,v4,zeroes,4 - vsldoi v5,v5,zeroes,4 - vsldoi v6,v6,zeroes,4 - vsldoi v7,v7,zeroes,4 -#endif - - /* xor with last 1024 bits */ - lvx v8,0,r4 - lvx v9,off16,r4 - VPERM(v8,v8,v8,byteswap) - VPERM(v9,v9,v9,byteswap) - lvx v10,off32,r4 - lvx v11,off48,r4 - VPERM(v10,v10,v10,byteswap) - VPERM(v11,v11,v11,byteswap) - lvx v12,off64,r4 - lvx v13,off80,r4 - VPERM(v12,v12,v12,byteswap) - VPERM(v13,v13,v13,byteswap) - lvx v14,off96,r4 - lvx v15,off112,r4 - VPERM(v14,v14,v14,byteswap) - VPERM(v15,v15,v15,byteswap) - - addi r4,r4,8*16 - - vxor v16,v0,v8 - vxor v17,v1,v9 - vxor v18,v2,v10 - vxor v19,v3,v11 - vxor v20,v4,v12 - vxor v21,v5,v13 - vxor v22,v6,v14 - vxor v23,v7,v15 - - li r0,1 - cmpdi r6,0 - addi r6,r6,128 - bne 1b - - /* Work out how many bytes we have left */ - andi. r5,r5,127 - - /* Calculate where in the constant table we need to start */ - subfic r6,r5,128 - add r3,r3,r6 - - /* How many 16 byte chunks are in the tail */ - srdi r7,r5,4 - mtctr r7 - - /* - * Reduce the previously calculated 1024 bits to 64 bits, shifting - * 32 bits to include the trailing 32 bits of zeros - */ - lvx v0,0,r3 - lvx v1,off16,r3 - lvx v2,off32,r3 - lvx v3,off48,r3 - lvx v4,off64,r3 - lvx v5,off80,r3 - lvx v6,off96,r3 - lvx v7,off112,r3 - addi r3,r3,8*16 - - VPMSUMW(v0,v16,v0) - VPMSUMW(v1,v17,v1) - VPMSUMW(v2,v18,v2) - VPMSUMW(v3,v19,v3) - VPMSUMW(v4,v20,v4) - VPMSUMW(v5,v21,v5) - VPMSUMW(v6,v22,v6) - VPMSUMW(v7,v23,v7) - - /* Now reduce the tail (0 - 112 bytes) */ - cmpdi r7,0 - beq 1f - - lvx v16,0,r4 - lvx v17,0,r3 - VPERM(v16,v16,v16,byteswap) - VPMSUMW(v16,v16,v17) - vxor v0,v0,v16 - bdz 1f - - lvx v16,off16,r4 - lvx v17,off16,r3 - VPERM(v16,v16,v16,byteswap) - VPMSUMW(v16,v16,v17) - vxor v0,v0,v16 - bdz 1f - - lvx v16,off32,r4 - lvx v17,off32,r3 - VPERM(v16,v16,v16,byteswap) - VPMSUMW(v16,v16,v17) - vxor v0,v0,v16 - bdz 1f - - lvx v16,off48,r4 - lvx v17,off48,r3 - VPERM(v16,v16,v16,byteswap) - VPMSUMW(v16,v16,v17) - vxor v0,v0,v16 - bdz 1f - - lvx v16,off64,r4 - lvx v17,off64,r3 - VPERM(v16,v16,v16,byteswap) - VPMSUMW(v16,v16,v17) - vxor v0,v0,v16 - bdz 1f - - lvx v16,off80,r4 - lvx v17,off80,r3 - VPERM(v16,v16,v16,byteswap) - VPMSUMW(v16,v16,v17) - vxor v0,v0,v16 - bdz 1f - - lvx v16,off96,r4 - lvx v17,off96,r3 - VPERM(v16,v16,v16,byteswap) - VPMSUMW(v16,v16,v17) - vxor v0,v0,v16 - - /* Now xor all the parallel chunks together */ -1: vxor v0,v0,v1 - vxor v2,v2,v3 - vxor v4,v4,v5 - vxor v6,v6,v7 - - vxor v0,v0,v2 - vxor v4,v4,v6 - - vxor v0,v0,v4 - -.Lbarrett_reduction: - /* Barrett constants */ - addis r3,r2,.barrett_constants@toc@ha - addi r3,r3,.barrett_constants@toc@l - - lvx const1,0,r3 - lvx const2,off16,r3 - - vsldoi v1,v0,v0,8 - vxor v0,v0,v1 /* xor two 64 bit results together */ - -#ifdef REFLECT - /* shift left one bit */ - vspltisb v1,1 - vsl v0,v0,v1 -#endif - - vand v0,v0,mask_64bit - -#ifndef REFLECT - /* - * Now for the Barrett reduction algorithm. The idea is to calculate q, - * the multiple of our polynomial that we need to subtract. By - * doing the computation 2x bits higher (ie 64 bits) and shifting the - * result back down 2x bits, we round down to the nearest multiple. - */ - VPMSUMD(v1,v0,const1) /* ma */ - vsldoi v1,zeroes,v1,8 /* q = floor(ma/(2^64)) */ - VPMSUMD(v1,v1,const2) /* qn */ - vxor v0,v0,v1 /* a - qn, subtraction is xor in GF(2) */ - - /* - * Get the result into r3. We need to shift it left 8 bytes: - * V0 [ 0 1 2 X ] - * V0 [ 0 X 2 3 ] - */ - vsldoi v0,v0,zeroes,8 /* shift result into top 64 bits */ -#else - /* - * The reflected version of Barrett reduction. Instead of bit - * reflecting our data (which is expensive to do), we bit reflect our - * constants and our algorithm, which means the intermediate data in - * our vector registers goes from 0-63 instead of 63-0. We can reflect - * the algorithm because we don't carry in mod 2 arithmetic. - */ - vand v1,v0,mask_32bit /* bottom 32 bits of a */ - VPMSUMD(v1,v1,const1) /* ma */ - vand v1,v1,mask_32bit /* bottom 32bits of ma */ - VPMSUMD(v1,v1,const2) /* qn */ - vxor v0,v0,v1 /* a - qn, subtraction is xor in GF(2) */ - - /* - * Since we are bit reflected, the result (ie the low 32 bits) is in - * the high 32 bits. We just need to shift it left 4 bytes - * V0 [ 0 1 X 3 ] - * V0 [ 0 X 2 3 ] - */ - vsldoi v0,v0,zeroes,4 /* shift result into top 64 bits of */ -#endif - -.Lout: - subi r6,r1,56+10*16 - subi r7,r1,56+2*16 - - lvx v20,0,r6 - lvx v21,off16,r6 - lvx v22,off32,r6 - lvx v23,off48,r6 - lvx v24,off64,r6 - lvx v25,off80,r6 - lvx v26,off96,r6 - lvx v27,off112,r6 - lvx v28,0,r7 - lvx v29,off16,r7 - - /* Get it into r3 */ - MFVRD(r3, v0) - - ld r31,-8(r1) - ld r30,-16(r1) - ld r29,-24(r1) - ld r28,-32(r1) - ld r27,-40(r1) - ld r26,-48(r1) - ld r25,-56(r1) - - blr - -.Lfirst_warm_up_done: - lvx const1,0,r3 - addi r3,r3,16 - - VPMSUMD(v8,v16,const1) - VPMSUMD(v9,v17,const1) - VPMSUMD(v10,v18,const1) - VPMSUMD(v11,v19,const1) - VPMSUMD(v12,v20,const1) - VPMSUMD(v13,v21,const1) - VPMSUMD(v14,v22,const1) - VPMSUMD(v15,v23,const1) - - b .Lsecond_cool_down - -.Lshort: - cmpdi r5,0 - beq .Lzero - - addis r3,r2,.short_constants@toc@ha - addi r3,r3,.short_constants@toc@l - - /* Calculate where in the constant table we need to start */ - subfic r6,r5,256 - add r3,r3,r6 - - /* How many 16 byte chunks? */ - srdi r7,r5,4 - mtctr r7 - - vxor v19,v19,v19 - vxor v20,v20,v20 - - lvx v0,0,r4 - lvx v16,0,r3 - VPERM(v0,v0,v16,byteswap) - vxor v0,v0,v8 /* xor in initial value */ - VPMSUMW(v0,v0,v16) - bdz .Lv0 - - lvx v1,off16,r4 - lvx v17,off16,r3 - VPERM(v1,v1,v17,byteswap) - VPMSUMW(v1,v1,v17) - bdz .Lv1 - - lvx v2,off32,r4 - lvx v16,off32,r3 - VPERM(v2,v2,v16,byteswap) - VPMSUMW(v2,v2,v16) - bdz .Lv2 - - lvx v3,off48,r4 - lvx v17,off48,r3 - VPERM(v3,v3,v17,byteswap) - VPMSUMW(v3,v3,v17) - bdz .Lv3 - - lvx v4,off64,r4 - lvx v16,off64,r3 - VPERM(v4,v4,v16,byteswap) - VPMSUMW(v4,v4,v16) - bdz .Lv4 - - lvx v5,off80,r4 - lvx v17,off80,r3 - VPERM(v5,v5,v17,byteswap) - VPMSUMW(v5,v5,v17) - bdz .Lv5 - - lvx v6,off96,r4 - lvx v16,off96,r3 - VPERM(v6,v6,v16,byteswap) - VPMSUMW(v6,v6,v16) - bdz .Lv6 - - lvx v7,off112,r4 - lvx v17,off112,r3 - VPERM(v7,v7,v17,byteswap) - VPMSUMW(v7,v7,v17) - bdz .Lv7 - - addi r3,r3,128 - addi r4,r4,128 - - lvx v8,0,r4 - lvx v16,0,r3 - VPERM(v8,v8,v16,byteswap) - VPMSUMW(v8,v8,v16) - bdz .Lv8 - - lvx v9,off16,r4 - lvx v17,off16,r3 - VPERM(v9,v9,v17,byteswap) - VPMSUMW(v9,v9,v17) - bdz .Lv9 - - lvx v10,off32,r4 - lvx v16,off32,r3 - VPERM(v10,v10,v16,byteswap) - VPMSUMW(v10,v10,v16) - bdz .Lv10 - - lvx v11,off48,r4 - lvx v17,off48,r3 - VPERM(v11,v11,v17,byteswap) - VPMSUMW(v11,v11,v17) - bdz .Lv11 - - lvx v12,off64,r4 - lvx v16,off64,r3 - VPERM(v12,v12,v16,byteswap) - VPMSUMW(v12,v12,v16) - bdz .Lv12 - - lvx v13,off80,r4 - lvx v17,off80,r3 - VPERM(v13,v13,v17,byteswap) - VPMSUMW(v13,v13,v17) - bdz .Lv13 - - lvx v14,off96,r4 - lvx v16,off96,r3 - VPERM(v14,v14,v16,byteswap) - VPMSUMW(v14,v14,v16) - bdz .Lv14 - - lvx v15,off112,r4 - lvx v17,off112,r3 - VPERM(v15,v15,v17,byteswap) - VPMSUMW(v15,v15,v17) - -.Lv15: vxor v19,v19,v15 -.Lv14: vxor v20,v20,v14 -.Lv13: vxor v19,v19,v13 -.Lv12: vxor v20,v20,v12 -.Lv11: vxor v19,v19,v11 -.Lv10: vxor v20,v20,v10 -.Lv9: vxor v19,v19,v9 -.Lv8: vxor v20,v20,v8 -.Lv7: vxor v19,v19,v7 -.Lv6: vxor v20,v20,v6 -.Lv5: vxor v19,v19,v5 -.Lv4: vxor v20,v20,v4 -.Lv3: vxor v19,v19,v3 -.Lv2: vxor v20,v20,v2 -.Lv1: vxor v19,v19,v1 -.Lv0: vxor v20,v20,v0 - - vxor v0,v19,v20 - - b .Lbarrett_reduction - -.Lzero: - mr r3,r10 - blr - b .Lout - -FUNC_END(__crc32_vpmsum) - -#endif /* __powerpc__ */ diff --git a/storage/xtradb/ut/crc32_power8/crc32_constants.h b/storage/xtradb/ut/crc32_power8/crc32_constants.h deleted file mode 100644 index ba2592b829c..00000000000 --- a/storage/xtradb/ut/crc32_power8/crc32_constants.h +++ /dev/null @@ -1,911 +0,0 @@ -#ifndef CRC32_CONSTANTS_H -#define CRC32_CONSTANTS_H - -#ifdef __powerpc__ - - -#define CRC 0x1edc6f41 -#define CRC_XOR -#define REFLECT - -#ifndef __ASSEMBLY__ -#ifdef CRC_TABLE -static const unsigned int crc_table[] = { - 0x00000000, 0xf26b8303, 0xe13b70f7, 0x1350f3f4, - 0xc79a971f, 0x35f1141c, 0x26a1e7e8, 0xd4ca64eb, - 0x8ad958cf, 0x78b2dbcc, 0x6be22838, 0x9989ab3b, - 0x4d43cfd0, 0xbf284cd3, 0xac78bf27, 0x5e133c24, - 0x105ec76f, 0xe235446c, 0xf165b798, 0x030e349b, - 0xd7c45070, 0x25afd373, 0x36ff2087, 0xc494a384, - 0x9a879fa0, 0x68ec1ca3, 0x7bbcef57, 0x89d76c54, - 0x5d1d08bf, 0xaf768bbc, 0xbc267848, 0x4e4dfb4b, - 0x20bd8ede, 0xd2d60ddd, 0xc186fe29, 0x33ed7d2a, - 0xe72719c1, 0x154c9ac2, 0x061c6936, 0xf477ea35, - 0xaa64d611, 0x580f5512, 0x4b5fa6e6, 0xb93425e5, - 0x6dfe410e, 0x9f95c20d, 0x8cc531f9, 0x7eaeb2fa, - 0x30e349b1, 0xc288cab2, 0xd1d83946, 0x23b3ba45, - 0xf779deae, 0x05125dad, 0x1642ae59, 0xe4292d5a, - 0xba3a117e, 0x4851927d, 0x5b016189, 0xa96ae28a, - 0x7da08661, 0x8fcb0562, 0x9c9bf696, 0x6ef07595, - 0x417b1dbc, 0xb3109ebf, 0xa0406d4b, 0x522bee48, - 0x86e18aa3, 0x748a09a0, 0x67dafa54, 0x95b17957, - 0xcba24573, 0x39c9c670, 0x2a993584, 0xd8f2b687, - 0x0c38d26c, 0xfe53516f, 0xed03a29b, 0x1f682198, - 0x5125dad3, 0xa34e59d0, 0xb01eaa24, 0x42752927, - 0x96bf4dcc, 0x64d4cecf, 0x77843d3b, 0x85efbe38, - 0xdbfc821c, 0x2997011f, 0x3ac7f2eb, 0xc8ac71e8, - 0x1c661503, 0xee0d9600, 0xfd5d65f4, 0x0f36e6f7, - 0x61c69362, 0x93ad1061, 0x80fde395, 0x72966096, - 0xa65c047d, 0x5437877e, 0x4767748a, 0xb50cf789, - 0xeb1fcbad, 0x197448ae, 0x0a24bb5a, 0xf84f3859, - 0x2c855cb2, 0xdeeedfb1, 0xcdbe2c45, 0x3fd5af46, - 0x7198540d, 0x83f3d70e, 0x90a324fa, 0x62c8a7f9, - 0xb602c312, 0x44694011, 0x5739b3e5, 0xa55230e6, - 0xfb410cc2, 0x092a8fc1, 0x1a7a7c35, 0xe811ff36, - 0x3cdb9bdd, 0xceb018de, 0xdde0eb2a, 0x2f8b6829, - 0x82f63b78, 0x709db87b, 0x63cd4b8f, 0x91a6c88c, - 0x456cac67, 0xb7072f64, 0xa457dc90, 0x563c5f93, - 0x082f63b7, 0xfa44e0b4, 0xe9141340, 0x1b7f9043, - 0xcfb5f4a8, 0x3dde77ab, 0x2e8e845f, 0xdce5075c, - 0x92a8fc17, 0x60c37f14, 0x73938ce0, 0x81f80fe3, - 0x55326b08, 0xa759e80b, 0xb4091bff, 0x466298fc, - 0x1871a4d8, 0xea1a27db, 0xf94ad42f, 0x0b21572c, - 0xdfeb33c7, 0x2d80b0c4, 0x3ed04330, 0xccbbc033, - 0xa24bb5a6, 0x502036a5, 0x4370c551, 0xb11b4652, - 0x65d122b9, 0x97baa1ba, 0x84ea524e, 0x7681d14d, - 0x2892ed69, 0xdaf96e6a, 0xc9a99d9e, 0x3bc21e9d, - 0xef087a76, 0x1d63f975, 0x0e330a81, 0xfc588982, - 0xb21572c9, 0x407ef1ca, 0x532e023e, 0xa145813d, - 0x758fe5d6, 0x87e466d5, 0x94b49521, 0x66df1622, - 0x38cc2a06, 0xcaa7a905, 0xd9f75af1, 0x2b9cd9f2, - 0xff56bd19, 0x0d3d3e1a, 0x1e6dcdee, 0xec064eed, - 0xc38d26c4, 0x31e6a5c7, 0x22b65633, 0xd0ddd530, - 0x0417b1db, 0xf67c32d8, 0xe52cc12c, 0x1747422f, - 0x49547e0b, 0xbb3ffd08, 0xa86f0efc, 0x5a048dff, - 0x8ecee914, 0x7ca56a17, 0x6ff599e3, 0x9d9e1ae0, - 0xd3d3e1ab, 0x21b862a8, 0x32e8915c, 0xc083125f, - 0x144976b4, 0xe622f5b7, 0xf5720643, 0x07198540, - 0x590ab964, 0xab613a67, 0xb831c993, 0x4a5a4a90, - 0x9e902e7b, 0x6cfbad78, 0x7fab5e8c, 0x8dc0dd8f, - 0xe330a81a, 0x115b2b19, 0x020bd8ed, 0xf0605bee, - 0x24aa3f05, 0xd6c1bc06, 0xc5914ff2, 0x37faccf1, - 0x69e9f0d5, 0x9b8273d6, 0x88d28022, 0x7ab90321, - 0xae7367ca, 0x5c18e4c9, 0x4f48173d, 0xbd23943e, - 0xf36e6f75, 0x0105ec76, 0x12551f82, 0xe03e9c81, - 0x34f4f86a, 0xc69f7b69, 0xd5cf889d, 0x27a40b9e, - 0x79b737ba, 0x8bdcb4b9, 0x988c474d, 0x6ae7c44e, - 0xbe2da0a5, 0x4c4623a6, 0x5f16d052, 0xad7d5351,}; - -#endif -#else -#define MAX_SIZE 32768 -.constants: - - /* Reduce 262144 kbits to 1024 bits */ - /* x^261120 mod p(x)` << 1, x^261184 mod p(x)` << 1 */ - .octa 0x00000000b6ca9e20000000009c37c408 - - /* x^260096 mod p(x)` << 1, x^260160 mod p(x)` << 1 */ - .octa 0x00000000350249a800000001b51df26c - - /* x^259072 mod p(x)` << 1, x^259136 mod p(x)` << 1 */ - .octa 0x00000001862dac54000000000724b9d0 - - /* x^258048 mod p(x)` << 1, x^258112 mod p(x)` << 1 */ - .octa 0x00000001d87fb48c00000001c00532fe - - /* x^257024 mod p(x)` << 1, x^257088 mod p(x)` << 1 */ - .octa 0x00000001f39b699e00000000f05a9362 - - /* x^256000 mod p(x)` << 1, x^256064 mod p(x)` << 1 */ - .octa 0x0000000101da11b400000001e1007970 - - /* x^254976 mod p(x)` << 1, x^255040 mod p(x)` << 1 */ - .octa 0x00000001cab571e000000000a57366ee - - /* x^253952 mod p(x)` << 1, x^254016 mod p(x)` << 1 */ - .octa 0x00000000c7020cfe0000000192011284 - - /* x^252928 mod p(x)` << 1, x^252992 mod p(x)` << 1 */ - .octa 0x00000000cdaed1ae0000000162716d9a - - /* x^251904 mod p(x)` << 1, x^251968 mod p(x)` << 1 */ - .octa 0x00000001e804effc00000000cd97ecde - - /* x^250880 mod p(x)` << 1, x^250944 mod p(x)` << 1 */ - .octa 0x0000000077c3ea3a0000000058812bc0 - - /* x^249856 mod p(x)` << 1, x^249920 mod p(x)` << 1 */ - .octa 0x0000000068df31b40000000088b8c12e - - /* x^248832 mod p(x)` << 1, x^248896 mod p(x)` << 1 */ - .octa 0x00000000b059b6c200000001230b234c - - /* x^247808 mod p(x)` << 1, x^247872 mod p(x)` << 1 */ - .octa 0x0000000145fb8ed800000001120b416e - - /* x^246784 mod p(x)` << 1, x^246848 mod p(x)` << 1 */ - .octa 0x00000000cbc0916800000001974aecb0 - - /* x^245760 mod p(x)` << 1, x^245824 mod p(x)` << 1 */ - .octa 0x000000005ceeedc2000000008ee3f226 - - /* x^244736 mod p(x)` << 1, x^244800 mod p(x)` << 1 */ - .octa 0x0000000047d74e8600000001089aba9a - - /* x^243712 mod p(x)` << 1, x^243776 mod p(x)` << 1 */ - .octa 0x00000001407e9e220000000065113872 - - /* x^242688 mod p(x)` << 1, x^242752 mod p(x)` << 1 */ - .octa 0x00000001da967bda000000005c07ec10 - - /* x^241664 mod p(x)` << 1, x^241728 mod p(x)` << 1 */ - .octa 0x000000006c8983680000000187590924 - - /* x^240640 mod p(x)` << 1, x^240704 mod p(x)` << 1 */ - .octa 0x00000000f2d14c9800000000e35da7c6 - - /* x^239616 mod p(x)` << 1, x^239680 mod p(x)` << 1 */ - .octa 0x00000001993c6ad4000000000415855a - - /* x^238592 mod p(x)` << 1, x^238656 mod p(x)` << 1 */ - .octa 0x000000014683d1ac0000000073617758 - - /* x^237568 mod p(x)` << 1, x^237632 mod p(x)` << 1 */ - .octa 0x00000001a7c93e6c0000000176021d28 - - /* x^236544 mod p(x)` << 1, x^236608 mod p(x)` << 1 */ - .octa 0x000000010211e90a00000001c358fd0a - - /* x^235520 mod p(x)` << 1, x^235584 mod p(x)` << 1 */ - .octa 0x000000001119403e00000001ff7a2c18 - - /* x^234496 mod p(x)` << 1, x^234560 mod p(x)` << 1 */ - .octa 0x000000001c3261aa00000000f2d9f7e4 - - /* x^233472 mod p(x)` << 1, x^233536 mod p(x)` << 1 */ - .octa 0x000000014e37a634000000016cf1f9c8 - - /* x^232448 mod p(x)` << 1, x^232512 mod p(x)` << 1 */ - .octa 0x0000000073786c0c000000010af9279a - - /* x^231424 mod p(x)` << 1, x^231488 mod p(x)` << 1 */ - .octa 0x000000011dc037f80000000004f101e8 - - /* x^230400 mod p(x)` << 1, x^230464 mod p(x)` << 1 */ - .octa 0x0000000031433dfc0000000070bcf184 - - /* x^229376 mod p(x)` << 1, x^229440 mod p(x)` << 1 */ - .octa 0x000000009cde8348000000000a8de642 - - /* x^228352 mod p(x)` << 1, x^228416 mod p(x)` << 1 */ - .octa 0x0000000038d3c2a60000000062ea130c - - /* x^227328 mod p(x)` << 1, x^227392 mod p(x)` << 1 */ - .octa 0x000000011b25f26000000001eb31cbb2 - - /* x^226304 mod p(x)` << 1, x^226368 mod p(x)` << 1 */ - .octa 0x000000001629e6f00000000170783448 - - /* x^225280 mod p(x)` << 1, x^225344 mod p(x)` << 1 */ - .octa 0x0000000160838b4c00000001a684b4c6 - - /* x^224256 mod p(x)` << 1, x^224320 mod p(x)` << 1 */ - .octa 0x000000007a44011c00000000253ca5b4 - - /* x^223232 mod p(x)` << 1, x^223296 mod p(x)` << 1 */ - .octa 0x00000000226f417a0000000057b4b1e2 - - /* x^222208 mod p(x)` << 1, x^222272 mod p(x)` << 1 */ - .octa 0x0000000045eb2eb400000000b6bd084c - - /* x^221184 mod p(x)` << 1, x^221248 mod p(x)` << 1 */ - .octa 0x000000014459d70c0000000123c2d592 - - /* x^220160 mod p(x)` << 1, x^220224 mod p(x)` << 1 */ - .octa 0x00000001d406ed8200000000159dafce - - /* x^219136 mod p(x)` << 1, x^219200 mod p(x)` << 1 */ - .octa 0x0000000160c8e1a80000000127e1a64e - - /* x^218112 mod p(x)` << 1, x^218176 mod p(x)` << 1 */ - .octa 0x0000000027ba80980000000056860754 - - /* x^217088 mod p(x)` << 1, x^217152 mod p(x)` << 1 */ - .octa 0x000000006d92d01800000001e661aae8 - - /* x^216064 mod p(x)` << 1, x^216128 mod p(x)` << 1 */ - .octa 0x000000012ed7e3f200000000f82c6166 - - /* x^215040 mod p(x)` << 1, x^215104 mod p(x)` << 1 */ - .octa 0x000000002dc8778800000000c4f9c7ae - - /* x^214016 mod p(x)` << 1, x^214080 mod p(x)` << 1 */ - .octa 0x0000000018240bb80000000074203d20 - - /* x^212992 mod p(x)` << 1, x^213056 mod p(x)` << 1 */ - .octa 0x000000001ad381580000000198173052 - - /* x^211968 mod p(x)` << 1, x^212032 mod p(x)` << 1 */ - .octa 0x00000001396b78f200000001ce8aba54 - - /* x^210944 mod p(x)` << 1, x^211008 mod p(x)` << 1 */ - .octa 0x000000011a68133400000001850d5d94 - - /* x^209920 mod p(x)` << 1, x^209984 mod p(x)` << 1 */ - .octa 0x000000012104732e00000001d609239c - - /* x^208896 mod p(x)` << 1, x^208960 mod p(x)` << 1 */ - .octa 0x00000000a140d90c000000001595f048 - - /* x^207872 mod p(x)` << 1, x^207936 mod p(x)` << 1 */ - .octa 0x00000001b7215eda0000000042ccee08 - - /* x^206848 mod p(x)` << 1, x^206912 mod p(x)` << 1 */ - .octa 0x00000001aaf1df3c000000010a389d74 - - /* x^205824 mod p(x)` << 1, x^205888 mod p(x)` << 1 */ - .octa 0x0000000029d15b8a000000012a840da6 - - /* x^204800 mod p(x)` << 1, x^204864 mod p(x)` << 1 */ - .octa 0x00000000f1a96922000000001d181c0c - - /* x^203776 mod p(x)` << 1, x^203840 mod p(x)` << 1 */ - .octa 0x00000001ac80d03c0000000068b7d1f6 - - /* x^202752 mod p(x)` << 1, x^202816 mod p(x)` << 1 */ - .octa 0x000000000f11d56a000000005b0f14fc - - /* x^201728 mod p(x)` << 1, x^201792 mod p(x)` << 1 */ - .octa 0x00000001f1c022a20000000179e9e730 - - /* x^200704 mod p(x)` << 1, x^200768 mod p(x)` << 1 */ - .octa 0x0000000173d00ae200000001ce1368d6 - - /* x^199680 mod p(x)` << 1, x^199744 mod p(x)` << 1 */ - .octa 0x00000001d4ffe4ac0000000112c3a84c - - /* x^198656 mod p(x)` << 1, x^198720 mod p(x)` << 1 */ - .octa 0x000000016edc5ae400000000de940fee - - /* x^197632 mod p(x)` << 1, x^197696 mod p(x)` << 1 */ - .octa 0x00000001f1a0214000000000fe896b7e - - /* x^196608 mod p(x)` << 1, x^196672 mod p(x)` << 1 */ - .octa 0x00000000ca0b28a000000001f797431c - - /* x^195584 mod p(x)` << 1, x^195648 mod p(x)` << 1 */ - .octa 0x00000001928e30a20000000053e989ba - - /* x^194560 mod p(x)` << 1, x^194624 mod p(x)` << 1 */ - .octa 0x0000000097b1b002000000003920cd16 - - /* x^193536 mod p(x)` << 1, x^193600 mod p(x)` << 1 */ - .octa 0x00000000b15bf90600000001e6f579b8 - - /* x^192512 mod p(x)` << 1, x^192576 mod p(x)` << 1 */ - .octa 0x00000000411c5d52000000007493cb0a - - /* x^191488 mod p(x)` << 1, x^191552 mod p(x)` << 1 */ - .octa 0x00000001c36f330000000001bdd376d8 - - /* x^190464 mod p(x)` << 1, x^190528 mod p(x)` << 1 */ - .octa 0x00000001119227e0000000016badfee6 - - /* x^189440 mod p(x)` << 1, x^189504 mod p(x)` << 1 */ - .octa 0x00000000114d47020000000071de5c58 - - /* x^188416 mod p(x)` << 1, x^188480 mod p(x)` << 1 */ - .octa 0x00000000458b5b9800000000453f317c - - /* x^187392 mod p(x)` << 1, x^187456 mod p(x)` << 1 */ - .octa 0x000000012e31fb8e0000000121675cce - - /* x^186368 mod p(x)` << 1, x^186432 mod p(x)` << 1 */ - .octa 0x000000005cf619d800000001f409ee92 - - /* x^185344 mod p(x)` << 1, x^185408 mod p(x)` << 1 */ - .octa 0x0000000063f4d8b200000000f36b9c88 - - /* x^184320 mod p(x)` << 1, x^184384 mod p(x)` << 1 */ - .octa 0x000000004138dc8a0000000036b398f4 - - /* x^183296 mod p(x)` << 1, x^183360 mod p(x)` << 1 */ - .octa 0x00000001d29ee8e000000001748f9adc - - /* x^182272 mod p(x)` << 1, x^182336 mod p(x)` << 1 */ - .octa 0x000000006a08ace800000001be94ec00 - - /* x^181248 mod p(x)` << 1, x^181312 mod p(x)` << 1 */ - .octa 0x0000000127d4201000000000b74370d6 - - /* x^180224 mod p(x)` << 1, x^180288 mod p(x)` << 1 */ - .octa 0x0000000019d76b6200000001174d0b98 - - /* x^179200 mod p(x)` << 1, x^179264 mod p(x)` << 1 */ - .octa 0x00000001b1471f6e00000000befc06a4 - - /* x^178176 mod p(x)` << 1, x^178240 mod p(x)` << 1 */ - .octa 0x00000001f64c19cc00000001ae125288 - - /* x^177152 mod p(x)` << 1, x^177216 mod p(x)` << 1 */ - .octa 0x00000000003c0ea00000000095c19b34 - - /* x^176128 mod p(x)` << 1, x^176192 mod p(x)` << 1 */ - .octa 0x000000014d73abf600000001a78496f2 - - /* x^175104 mod p(x)` << 1, x^175168 mod p(x)` << 1 */ - .octa 0x00000001620eb84400000001ac5390a0 - - /* x^174080 mod p(x)` << 1, x^174144 mod p(x)` << 1 */ - .octa 0x0000000147655048000000002a80ed6e - - /* x^173056 mod p(x)` << 1, x^173120 mod p(x)` << 1 */ - .octa 0x0000000067b5077e00000001fa9b0128 - - /* x^172032 mod p(x)` << 1, x^172096 mod p(x)` << 1 */ - .octa 0x0000000010ffe20600000001ea94929e - - /* x^171008 mod p(x)` << 1, x^171072 mod p(x)` << 1 */ - .octa 0x000000000fee8f1e0000000125f4305c - - /* x^169984 mod p(x)` << 1, x^170048 mod p(x)` << 1 */ - .octa 0x00000001da26fbae00000001471e2002 - - /* x^168960 mod p(x)` << 1, x^169024 mod p(x)` << 1 */ - .octa 0x00000001b3a8bd880000000132d2253a - - /* x^167936 mod p(x)` << 1, x^168000 mod p(x)` << 1 */ - .octa 0x00000000e8f3898e00000000f26b3592 - - /* x^166912 mod p(x)` << 1, x^166976 mod p(x)` << 1 */ - .octa 0x00000000b0d0d28c00000000bc8b67b0 - - /* x^165888 mod p(x)` << 1, x^165952 mod p(x)` << 1 */ - .octa 0x0000000030f2a798000000013a826ef2 - - /* x^164864 mod p(x)` << 1, x^164928 mod p(x)` << 1 */ - .octa 0x000000000fba10020000000081482c84 - - /* x^163840 mod p(x)` << 1, x^163904 mod p(x)` << 1 */ - .octa 0x00000000bdb9bd7200000000e77307c2 - - /* x^162816 mod p(x)` << 1, x^162880 mod p(x)` << 1 */ - .octa 0x0000000075d3bf5a00000000d4a07ec8 - - /* x^161792 mod p(x)` << 1, x^161856 mod p(x)` << 1 */ - .octa 0x00000000ef1f98a00000000017102100 - - /* x^160768 mod p(x)` << 1, x^160832 mod p(x)` << 1 */ - .octa 0x00000000689c760200000000db406486 - - /* x^159744 mod p(x)` << 1, x^159808 mod p(x)` << 1 */ - .octa 0x000000016d5fa5fe0000000192db7f88 - - /* x^158720 mod p(x)` << 1, x^158784 mod p(x)` << 1 */ - .octa 0x00000001d0d2b9ca000000018bf67b1e - - /* x^157696 mod p(x)` << 1, x^157760 mod p(x)` << 1 */ - .octa 0x0000000041e7b470000000007c09163e - - /* x^156672 mod p(x)` << 1, x^156736 mod p(x)` << 1 */ - .octa 0x00000001cbb6495e000000000adac060 - - /* x^155648 mod p(x)` << 1, x^155712 mod p(x)` << 1 */ - .octa 0x000000010052a0b000000000bd8316ae - - /* x^154624 mod p(x)` << 1, x^154688 mod p(x)` << 1 */ - .octa 0x00000001d8effb5c000000019f09ab54 - - /* x^153600 mod p(x)` << 1, x^153664 mod p(x)` << 1 */ - .octa 0x00000001d969853c0000000125155542 - - /* x^152576 mod p(x)` << 1, x^152640 mod p(x)` << 1 */ - .octa 0x00000000523ccce2000000018fdb5882 - - /* x^151552 mod p(x)` << 1, x^151616 mod p(x)` << 1 */ - .octa 0x000000001e2436bc00000000e794b3f4 - - /* x^150528 mod p(x)` << 1, x^150592 mod p(x)` << 1 */ - .octa 0x00000000ddd1c3a2000000016f9bb022 - - /* x^149504 mod p(x)` << 1, x^149568 mod p(x)` << 1 */ - .octa 0x0000000019fcfe3800000000290c9978 - - /* x^148480 mod p(x)` << 1, x^148544 mod p(x)` << 1 */ - .octa 0x00000001ce95db640000000083c0f350 - - /* x^147456 mod p(x)` << 1, x^147520 mod p(x)` << 1 */ - .octa 0x00000000af5828060000000173ea6628 - - /* x^146432 mod p(x)` << 1, x^146496 mod p(x)` << 1 */ - .octa 0x00000001006388f600000001c8b4e00a - - /* x^145408 mod p(x)` << 1, x^145472 mod p(x)` << 1 */ - .octa 0x0000000179eca00a00000000de95d6aa - - /* x^144384 mod p(x)` << 1, x^144448 mod p(x)` << 1 */ - .octa 0x0000000122410a6a000000010b7f7248 - - /* x^143360 mod p(x)` << 1, x^143424 mod p(x)` << 1 */ - .octa 0x000000004288e87c00000001326e3a06 - - /* x^142336 mod p(x)` << 1, x^142400 mod p(x)` << 1 */ - .octa 0x000000016c5490da00000000bb62c2e6 - - /* x^141312 mod p(x)` << 1, x^141376 mod p(x)` << 1 */ - .octa 0x00000000d1c71f6e0000000156a4b2c2 - - /* x^140288 mod p(x)` << 1, x^140352 mod p(x)` << 1 */ - .octa 0x00000001b4ce08a6000000011dfe763a - - /* x^139264 mod p(x)` << 1, x^139328 mod p(x)` << 1 */ - .octa 0x00000001466ba60c000000007bcca8e2 - - /* x^138240 mod p(x)` << 1, x^138304 mod p(x)` << 1 */ - .octa 0x00000001f6c488a40000000186118faa - - /* x^137216 mod p(x)` << 1, x^137280 mod p(x)` << 1 */ - .octa 0x000000013bfb06820000000111a65a88 - - /* x^136192 mod p(x)` << 1, x^136256 mod p(x)` << 1 */ - .octa 0x00000000690e9e54000000003565e1c4 - - /* x^135168 mod p(x)` << 1, x^135232 mod p(x)` << 1 */ - .octa 0x00000000281346b6000000012ed02a82 - - /* x^134144 mod p(x)` << 1, x^134208 mod p(x)` << 1 */ - .octa 0x000000015646402400000000c486ecfc - - /* x^133120 mod p(x)` << 1, x^133184 mod p(x)` << 1 */ - .octa 0x000000016063a8dc0000000001b951b2 - - /* x^132096 mod p(x)` << 1, x^132160 mod p(x)` << 1 */ - .octa 0x0000000116a663620000000048143916 - - /* x^131072 mod p(x)` << 1, x^131136 mod p(x)` << 1 */ - .octa 0x000000017e8aa4d200000001dc2ae124 - - /* x^130048 mod p(x)` << 1, x^130112 mod p(x)` << 1 */ - .octa 0x00000001728eb10c00000001416c58d6 - - /* x^129024 mod p(x)` << 1, x^129088 mod p(x)` << 1 */ - .octa 0x00000001b08fd7fa00000000a479744a - - /* x^128000 mod p(x)` << 1, x^128064 mod p(x)` << 1 */ - .octa 0x00000001092a16e80000000096ca3a26 - - /* x^126976 mod p(x)` << 1, x^127040 mod p(x)` << 1 */ - .octa 0x00000000a505637c00000000ff223d4e - - /* x^125952 mod p(x)` << 1, x^126016 mod p(x)` << 1 */ - .octa 0x00000000d94869b2000000010e84da42 - - /* x^124928 mod p(x)` << 1, x^124992 mod p(x)` << 1 */ - .octa 0x00000001c8b203ae00000001b61ba3d0 - - /* x^123904 mod p(x)` << 1, x^123968 mod p(x)` << 1 */ - .octa 0x000000005704aea000000000680f2de8 - - /* x^122880 mod p(x)` << 1, x^122944 mod p(x)` << 1 */ - .octa 0x000000012e295fa2000000008772a9a8 - - /* x^121856 mod p(x)` << 1, x^121920 mod p(x)` << 1 */ - .octa 0x000000011d0908bc0000000155f295bc - - /* x^120832 mod p(x)` << 1, x^120896 mod p(x)` << 1 */ - .octa 0x0000000193ed97ea00000000595f9282 - - /* x^119808 mod p(x)` << 1, x^119872 mod p(x)` << 1 */ - .octa 0x000000013a0f1c520000000164b1c25a - - /* x^118784 mod p(x)` << 1, x^118848 mod p(x)` << 1 */ - .octa 0x000000010c2c40c000000000fbd67c50 - - /* x^117760 mod p(x)` << 1, x^117824 mod p(x)` << 1 */ - .octa 0x00000000ff6fac3e0000000096076268 - - /* x^116736 mod p(x)` << 1, x^116800 mod p(x)` << 1 */ - .octa 0x000000017b3609c000000001d288e4cc - - /* x^115712 mod p(x)` << 1, x^115776 mod p(x)` << 1 */ - .octa 0x0000000088c8c92200000001eaac1bdc - - /* x^114688 mod p(x)` << 1, x^114752 mod p(x)` << 1 */ - .octa 0x00000001751baae600000001f1ea39e2 - - /* x^113664 mod p(x)` << 1, x^113728 mod p(x)` << 1 */ - .octa 0x000000010795297200000001eb6506fc - - /* x^112640 mod p(x)` << 1, x^112704 mod p(x)` << 1 */ - .octa 0x0000000162b00abe000000010f806ffe - - /* x^111616 mod p(x)` << 1, x^111680 mod p(x)` << 1 */ - .octa 0x000000000d7b404c000000010408481e - - /* x^110592 mod p(x)` << 1, x^110656 mod p(x)` << 1 */ - .octa 0x00000000763b13d40000000188260534 - - /* x^109568 mod p(x)` << 1, x^109632 mod p(x)` << 1 */ - .octa 0x00000000f6dc22d80000000058fc73e0 - - /* x^108544 mod p(x)` << 1, x^108608 mod p(x)` << 1 */ - .octa 0x000000007daae06000000000391c59b8 - - /* x^107520 mod p(x)` << 1, x^107584 mod p(x)` << 1 */ - .octa 0x000000013359ab7c000000018b638400 - - /* x^106496 mod p(x)` << 1, x^106560 mod p(x)` << 1 */ - .octa 0x000000008add438a000000011738f5c4 - - /* x^105472 mod p(x)` << 1, x^105536 mod p(x)` << 1 */ - .octa 0x00000001edbefdea000000008cf7c6da - - /* x^104448 mod p(x)` << 1, x^104512 mod p(x)` << 1 */ - .octa 0x000000004104e0f800000001ef97fb16 - - /* x^103424 mod p(x)` << 1, x^103488 mod p(x)` << 1 */ - .octa 0x00000000b48a82220000000102130e20 - - /* x^102400 mod p(x)` << 1, x^102464 mod p(x)` << 1 */ - .octa 0x00000001bcb4684400000000db968898 - - /* x^101376 mod p(x)` << 1, x^101440 mod p(x)` << 1 */ - .octa 0x000000013293ce0a00000000b5047b5e - - /* x^100352 mod p(x)` << 1, x^100416 mod p(x)` << 1 */ - .octa 0x00000001710d0844000000010b90fdb2 - - /* x^99328 mod p(x)` << 1, x^99392 mod p(x)` << 1 */ - .octa 0x0000000117907f6e000000004834a32e - - /* x^98304 mod p(x)` << 1, x^98368 mod p(x)` << 1 */ - .octa 0x0000000087ddf93e0000000059c8f2b0 - - /* x^97280 mod p(x)` << 1, x^97344 mod p(x)` << 1 */ - .octa 0x000000005970e9b00000000122cec508 - - /* x^96256 mod p(x)` << 1, x^96320 mod p(x)` << 1 */ - .octa 0x0000000185b2b7d0000000000a330cda - - /* x^95232 mod p(x)` << 1, x^95296 mod p(x)` << 1 */ - .octa 0x00000001dcee0efc000000014a47148c - - /* x^94208 mod p(x)` << 1, x^94272 mod p(x)` << 1 */ - .octa 0x0000000030da27220000000042c61cb8 - - /* x^93184 mod p(x)` << 1, x^93248 mod p(x)` << 1 */ - .octa 0x000000012f925a180000000012fe6960 - - /* x^92160 mod p(x)` << 1, x^92224 mod p(x)` << 1 */ - .octa 0x00000000dd2e357c00000000dbda2c20 - - /* x^91136 mod p(x)` << 1, x^91200 mod p(x)` << 1 */ - .octa 0x00000000071c80de000000011122410c - - /* x^90112 mod p(x)` << 1, x^90176 mod p(x)` << 1 */ - .octa 0x000000011513140a00000000977b2070 - - /* x^89088 mod p(x)` << 1, x^89152 mod p(x)` << 1 */ - .octa 0x00000001df876e8e000000014050438e - - /* x^88064 mod p(x)` << 1, x^88128 mod p(x)` << 1 */ - .octa 0x000000015f81d6ce0000000147c840e8 - - /* x^87040 mod p(x)` << 1, x^87104 mod p(x)` << 1 */ - .octa 0x000000019dd94dbe00000001cc7c88ce - - /* x^86016 mod p(x)` << 1, x^86080 mod p(x)` << 1 */ - .octa 0x00000001373d206e00000001476b35a4 - - /* x^84992 mod p(x)` << 1, x^85056 mod p(x)` << 1 */ - .octa 0x00000000668ccade000000013d52d508 - - /* x^83968 mod p(x)` << 1, x^84032 mod p(x)` << 1 */ - .octa 0x00000001b192d268000000008e4be32e - - /* x^82944 mod p(x)` << 1, x^83008 mod p(x)` << 1 */ - .octa 0x00000000e30f3a7800000000024120fe - - /* x^81920 mod p(x)` << 1, x^81984 mod p(x)` << 1 */ - .octa 0x000000010ef1f7bc00000000ddecddb4 - - /* x^80896 mod p(x)` << 1, x^80960 mod p(x)` << 1 */ - .octa 0x00000001f5ac738000000000d4d403bc - - /* x^79872 mod p(x)` << 1, x^79936 mod p(x)` << 1 */ - .octa 0x000000011822ea7000000001734b89aa - - /* x^78848 mod p(x)` << 1, x^78912 mod p(x)` << 1 */ - .octa 0x00000000c3a33848000000010e7a58d6 - - /* x^77824 mod p(x)` << 1, x^77888 mod p(x)` << 1 */ - .octa 0x00000001bd151c2400000001f9f04e9c - - /* x^76800 mod p(x)` << 1, x^76864 mod p(x)` << 1 */ - .octa 0x0000000056002d7600000000b692225e - - /* x^75776 mod p(x)` << 1, x^75840 mod p(x)` << 1 */ - .octa 0x000000014657c4f4000000019b8d3f3e - - /* x^74752 mod p(x)` << 1, x^74816 mod p(x)` << 1 */ - .octa 0x0000000113742d7c00000001a874f11e - - /* x^73728 mod p(x)` << 1, x^73792 mod p(x)` << 1 */ - .octa 0x000000019c5920ba000000010d5a4254 - - /* x^72704 mod p(x)` << 1, x^72768 mod p(x)` << 1 */ - .octa 0x000000005216d2d600000000bbb2f5d6 - - /* x^71680 mod p(x)` << 1, x^71744 mod p(x)` << 1 */ - .octa 0x0000000136f5ad8a0000000179cc0e36 - - /* x^70656 mod p(x)` << 1, x^70720 mod p(x)` << 1 */ - .octa 0x000000018b07beb600000001dca1da4a - - /* x^69632 mod p(x)` << 1, x^69696 mod p(x)` << 1 */ - .octa 0x00000000db1e93b000000000feb1a192 - - /* x^68608 mod p(x)` << 1, x^68672 mod p(x)` << 1 */ - .octa 0x000000000b96fa3a00000000d1eeedd6 - - /* x^67584 mod p(x)` << 1, x^67648 mod p(x)` << 1 */ - .octa 0x00000001d9968af0000000008fad9bb4 - - /* x^66560 mod p(x)` << 1, x^66624 mod p(x)` << 1 */ - .octa 0x000000000e4a77a200000001884938e4 - - /* x^65536 mod p(x)` << 1, x^65600 mod p(x)` << 1 */ - .octa 0x00000000508c2ac800000001bc2e9bc0 - - /* x^64512 mod p(x)` << 1, x^64576 mod p(x)` << 1 */ - .octa 0x0000000021572a8000000001f9658a68 - - /* x^63488 mod p(x)` << 1, x^63552 mod p(x)` << 1 */ - .octa 0x00000001b859daf2000000001b9224fc - - /* x^62464 mod p(x)` << 1, x^62528 mod p(x)` << 1 */ - .octa 0x000000016f7884740000000055b2fb84 - - /* x^61440 mod p(x)` << 1, x^61504 mod p(x)` << 1 */ - .octa 0x00000001b438810e000000018b090348 - - /* x^60416 mod p(x)` << 1, x^60480 mod p(x)` << 1 */ - .octa 0x0000000095ddc6f2000000011ccbd5ea - - /* x^59392 mod p(x)` << 1, x^59456 mod p(x)` << 1 */ - .octa 0x00000001d977c20c0000000007ae47f8 - - /* x^58368 mod p(x)` << 1, x^58432 mod p(x)` << 1 */ - .octa 0x00000000ebedb99a0000000172acbec0 - - /* x^57344 mod p(x)` << 1, x^57408 mod p(x)` << 1 */ - .octa 0x00000001df9e9e9200000001c6e3ff20 - - /* x^56320 mod p(x)` << 1, x^56384 mod p(x)` << 1 */ - .octa 0x00000001a4a3f95200000000e1b38744 - - /* x^55296 mod p(x)` << 1, x^55360 mod p(x)` << 1 */ - .octa 0x00000000e2f5122000000000791585b2 - - /* x^54272 mod p(x)` << 1, x^54336 mod p(x)` << 1 */ - .octa 0x000000004aa01f3e00000000ac53b894 - - /* x^53248 mod p(x)` << 1, x^53312 mod p(x)` << 1 */ - .octa 0x00000000b3e90a5800000001ed5f2cf4 - - /* x^52224 mod p(x)` << 1, x^52288 mod p(x)` << 1 */ - .octa 0x000000000c9ca2aa00000001df48b2e0 - - /* x^51200 mod p(x)` << 1, x^51264 mod p(x)` << 1 */ - .octa 0x000000015168231600000000049c1c62 - - /* x^50176 mod p(x)` << 1, x^50240 mod p(x)` << 1 */ - .octa 0x0000000036fce78c000000017c460c12 - - /* x^49152 mod p(x)` << 1, x^49216 mod p(x)` << 1 */ - .octa 0x000000009037dc10000000015be4da7e - - /* x^48128 mod p(x)` << 1, x^48192 mod p(x)` << 1 */ - .octa 0x00000000d3298582000000010f38f668 - - /* x^47104 mod p(x)` << 1, x^47168 mod p(x)` << 1 */ - .octa 0x00000001b42e8ad60000000039f40a00 - - /* x^46080 mod p(x)` << 1, x^46144 mod p(x)` << 1 */ - .octa 0x00000000142a983800000000bd4c10c4 - - /* x^45056 mod p(x)` << 1, x^45120 mod p(x)` << 1 */ - .octa 0x0000000109c7f1900000000042db1d98 - - /* x^44032 mod p(x)` << 1, x^44096 mod p(x)` << 1 */ - .octa 0x0000000056ff931000000001c905bae6 - - /* x^43008 mod p(x)` << 1, x^43072 mod p(x)` << 1 */ - .octa 0x00000001594513aa00000000069d40ea - - /* x^41984 mod p(x)` << 1, x^42048 mod p(x)` << 1 */ - .octa 0x00000001e3b5b1e8000000008e4fbad0 - - /* x^40960 mod p(x)` << 1, x^41024 mod p(x)` << 1 */ - .octa 0x000000011dd5fc080000000047bedd46 - - /* x^39936 mod p(x)` << 1, x^40000 mod p(x)` << 1 */ - .octa 0x00000001675f0cc20000000026396bf8 - - /* x^38912 mod p(x)` << 1, x^38976 mod p(x)` << 1 */ - .octa 0x00000000d1c8dd4400000000379beb92 - - /* x^37888 mod p(x)` << 1, x^37952 mod p(x)` << 1 */ - .octa 0x0000000115ebd3d8000000000abae54a - - /* x^36864 mod p(x)` << 1, x^36928 mod p(x)` << 1 */ - .octa 0x00000001ecbd0dac0000000007e6a128 - - /* x^35840 mod p(x)` << 1, x^35904 mod p(x)` << 1 */ - .octa 0x00000000cdf67af2000000000ade29d2 - - /* x^34816 mod p(x)` << 1, x^34880 mod p(x)` << 1 */ - .octa 0x000000004c01ff4c00000000f974c45c - - /* x^33792 mod p(x)` << 1, x^33856 mod p(x)` << 1 */ - .octa 0x00000000f2d8657e00000000e77ac60a - - /* x^32768 mod p(x)` << 1, x^32832 mod p(x)` << 1 */ - .octa 0x000000006bae74c40000000145895816 - - /* x^31744 mod p(x)` << 1, x^31808 mod p(x)` << 1 */ - .octa 0x0000000152af8aa00000000038e362be - - /* x^30720 mod p(x)` << 1, x^30784 mod p(x)` << 1 */ - .octa 0x0000000004663802000000007f991a64 - - /* x^29696 mod p(x)` << 1, x^29760 mod p(x)` << 1 */ - .octa 0x00000001ab2f5afc00000000fa366d3a - - /* x^28672 mod p(x)` << 1, x^28736 mod p(x)` << 1 */ - .octa 0x0000000074a4ebd400000001a2bb34f0 - - /* x^27648 mod p(x)` << 1, x^27712 mod p(x)` << 1 */ - .octa 0x00000001d7ab3a4c0000000028a9981e - - /* x^26624 mod p(x)` << 1, x^26688 mod p(x)` << 1 */ - .octa 0x00000001a8da60c600000001dbc672be - - /* x^25600 mod p(x)` << 1, x^25664 mod p(x)` << 1 */ - .octa 0x000000013cf6382000000000b04d77f6 - - /* x^24576 mod p(x)` << 1, x^24640 mod p(x)` << 1 */ - .octa 0x00000000bec12e1e0000000124400d96 - - /* x^23552 mod p(x)` << 1, x^23616 mod p(x)` << 1 */ - .octa 0x00000001c6368010000000014ca4b414 - - /* x^22528 mod p(x)` << 1, x^22592 mod p(x)` << 1 */ - .octa 0x00000001e6e78758000000012fe2c938 - - /* x^21504 mod p(x)` << 1, x^21568 mod p(x)` << 1 */ - .octa 0x000000008d7f2b3c00000001faed01e6 - - /* x^20480 mod p(x)` << 1, x^20544 mod p(x)` << 1 */ - .octa 0x000000016b4a156e000000007e80ecfe - - /* x^19456 mod p(x)` << 1, x^19520 mod p(x)` << 1 */ - .octa 0x00000001c63cfeb60000000098daee94 - - /* x^18432 mod p(x)` << 1, x^18496 mod p(x)` << 1 */ - .octa 0x000000015f902670000000010a04edea - - /* x^17408 mod p(x)` << 1, x^17472 mod p(x)` << 1 */ - .octa 0x00000001cd5de11e00000001c00b4524 - - /* x^16384 mod p(x)` << 1, x^16448 mod p(x)` << 1 */ - .octa 0x000000001acaec540000000170296550 - - /* x^15360 mod p(x)` << 1, x^15424 mod p(x)` << 1 */ - .octa 0x000000002bd0ca780000000181afaa48 - - /* x^14336 mod p(x)` << 1, x^14400 mod p(x)` << 1 */ - .octa 0x0000000032d63d5c0000000185a31ffa - - /* x^13312 mod p(x)` << 1, x^13376 mod p(x)` << 1 */ - .octa 0x000000001c6d4e4c000000002469f608 - - /* x^12288 mod p(x)` << 1, x^12352 mod p(x)` << 1 */ - .octa 0x0000000106a60b92000000006980102a - - /* x^11264 mod p(x)` << 1, x^11328 mod p(x)` << 1 */ - .octa 0x00000000d3855e120000000111ea9ca8 - - /* x^10240 mod p(x)` << 1, x^10304 mod p(x)` << 1 */ - .octa 0x00000000e312563600000001bd1d29ce - - /* x^9216 mod p(x)` << 1, x^9280 mod p(x)` << 1 */ - .octa 0x000000009e8f7ea400000001b34b9580 - - /* x^8192 mod p(x)` << 1, x^8256 mod p(x)` << 1 */ - .octa 0x00000001c82e562c000000003076054e - - /* x^7168 mod p(x)` << 1, x^7232 mod p(x)` << 1 */ - .octa 0x00000000ca9f09ce000000012a608ea4 - - /* x^6144 mod p(x)` << 1, x^6208 mod p(x)` << 1 */ - .octa 0x00000000c63764e600000000784d05fe - - /* x^5120 mod p(x)` << 1, x^5184 mod p(x)` << 1 */ - .octa 0x0000000168d2e49e000000016ef0d82a - - /* x^4096 mod p(x)` << 1, x^4160 mod p(x)` << 1 */ - .octa 0x00000000e986c1480000000075bda454 - - /* x^3072 mod p(x)` << 1, x^3136 mod p(x)` << 1 */ - .octa 0x00000000cfb65894000000003dc0a1c4 - - /* x^2048 mod p(x)` << 1, x^2112 mod p(x)` << 1 */ - .octa 0x0000000111cadee400000000e9a5d8be - - /* x^1024 mod p(x)` << 1, x^1088 mod p(x)` << 1 */ - .octa 0x0000000171fb63ce00000001609bc4b4 - -.short_constants: - - /* Reduce final 1024-2048 bits to 64 bits, shifting 32 bits to include the trailing 32 bits of zeros */ - /* x^1952 mod p(x)`, x^1984 mod p(x)`, x^2016 mod p(x)`, x^2048 mod p(x)` */ - .octa 0x7fec2963e5bf80485cf015c388e56f72 - - /* x^1824 mod p(x)`, x^1856 mod p(x)`, x^1888 mod p(x)`, x^1920 mod p(x)` */ - .octa 0x38e888d4844752a9963a18920246e2e6 - - /* x^1696 mod p(x)`, x^1728 mod p(x)`, x^1760 mod p(x)`, x^1792 mod p(x)` */ - .octa 0x42316c00730206ad419a441956993a31 - - /* x^1568 mod p(x)`, x^1600 mod p(x)`, x^1632 mod p(x)`, x^1664 mod p(x)` */ - .octa 0x543d5c543e65ddf9924752ba2b830011 - - /* x^1440 mod p(x)`, x^1472 mod p(x)`, x^1504 mod p(x)`, x^1536 mod p(x)` */ - .octa 0x78e87aaf56767c9255bd7f9518e4a304 - - /* x^1312 mod p(x)`, x^1344 mod p(x)`, x^1376 mod p(x)`, x^1408 mod p(x)` */ - .octa 0x8f68fcec1903da7f6d76739fe0553f1e - - /* x^1184 mod p(x)`, x^1216 mod p(x)`, x^1248 mod p(x)`, x^1280 mod p(x)` */ - .octa 0x3f4840246791d588c133722b1fe0b5c3 - - /* x^1056 mod p(x)`, x^1088 mod p(x)`, x^1120 mod p(x)`, x^1152 mod p(x)` */ - .octa 0x34c96751b04de25a64b67ee0e55ef1f3 - - /* x^928 mod p(x)`, x^960 mod p(x)`, x^992 mod p(x)`, x^1024 mod p(x)` */ - .octa 0x156c8e180b4a395b069db049b8fdb1e7 - - /* x^800 mod p(x)`, x^832 mod p(x)`, x^864 mod p(x)`, x^896 mod p(x)` */ - .octa 0xe0b99ccbe661f7bea11bfaf3c9e90b9e - - /* x^672 mod p(x)`, x^704 mod p(x)`, x^736 mod p(x)`, x^768 mod p(x)` */ - .octa 0x041d37768cd75659817cdc5119b29a35 - - /* x^544 mod p(x)`, x^576 mod p(x)`, x^608 mod p(x)`, x^640 mod p(x)` */ - .octa 0x3a0777818cfaa9651ce9d94b36c41f1c - - /* x^416 mod p(x)`, x^448 mod p(x)`, x^480 mod p(x)`, x^512 mod p(x)` */ - .octa 0x0e148e8252377a554f256efcb82be955 - - /* x^288 mod p(x)`, x^320 mod p(x)`, x^352 mod p(x)`, x^384 mod p(x)` */ - .octa 0x9c25531d19e65ddeec1631edb2dea967 - - /* x^160 mod p(x)`, x^192 mod p(x)`, x^224 mod p(x)`, x^256 mod p(x)` */ - .octa 0x790606ff9957c0a65d27e147510ac59a - - /* x^32 mod p(x)`, x^64 mod p(x)`, x^96 mod p(x)`, x^128 mod p(x)` */ - .octa 0x82f63b786ea2d55ca66805eb18b8ea18 - - -.barrett_constants: - /* 33 bit reflected Barrett constant m - (4^32)/n */ - .octa 0x000000000000000000000000dea713f1 /* x^64 div p(x)` */ - /* 33 bit reflected Barrett constant n */ - .octa 0x00000000000000000000000105ec76f1 -#endif - -#endif /* __powerpc__ */ - -#endif diff --git a/storage/xtradb/ut/crc32_power8/crc32_wrapper.c b/storage/xtradb/ut/crc32_power8/crc32_wrapper.c deleted file mode 100644 index d4c91371fa1..00000000000 --- a/storage/xtradb/ut/crc32_power8/crc32_wrapper.c +++ /dev/null @@ -1,68 +0,0 @@ -#ifdef __powerpc__ - -#define CRC_TABLE -#include "crc32_constants.h" - -#define VMX_ALIGN 16 -#define VMX_ALIGN_MASK (VMX_ALIGN-1) - -#ifdef REFLECT -static unsigned int crc32_align(unsigned int crc, unsigned char *p, - unsigned long len) -{ - while (len--) - crc = crc_table[(crc ^ *p++) & 0xff] ^ (crc >> 8); - return crc; -} -#else -static unsigned int crc32_align(unsigned int crc, unsigned char *p, - unsigned long len) -{ - while (len--) - crc = crc_table[((crc >> 24) ^ *p++) & 0xff] ^ (crc << 8); - return crc; -} -#endif - -unsigned int __crc32_vpmsum(unsigned int crc, unsigned char *p, - unsigned long len); - -unsigned int crc32_vpmsum(unsigned int crc, unsigned char *p, - unsigned long len) -{ - unsigned int prealign; - unsigned int tail; - -#ifdef CRC_XOR - crc ^= 0xffffffff; -#endif - - if (len < VMX_ALIGN + VMX_ALIGN_MASK) { - crc = crc32_align(crc, p, len); - goto out; - } - - if ((unsigned long)p & VMX_ALIGN_MASK) { - prealign = VMX_ALIGN - ((unsigned long)p & VMX_ALIGN_MASK); - crc = crc32_align(crc, p, prealign); - len -= prealign; - p += prealign; - } - - crc = __crc32_vpmsum(crc, p, len & ~VMX_ALIGN_MASK); - - tail = len & VMX_ALIGN_MASK; - if (tail) { - p += len & ~VMX_ALIGN_MASK; - crc = crc32_align(crc, p, tail); - } - -out: -#ifdef CRC_XOR - crc ^= 0xffffffff; -#endif - - return crc; -} - -#endif /* __powerpc__ */ diff --git a/storage/xtradb/ut/crc32_power8/ppc-opcode.h b/storage/xtradb/ut/crc32_power8/ppc-opcode.h deleted file mode 100644 index 5942bd4923a..00000000000 --- a/storage/xtradb/ut/crc32_power8/ppc-opcode.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef __OPCODES_H -#define __OPCODES_H - -#define __PPC_RA(a) (((a) & 0x1f) << 16) -#define __PPC_RB(b) (((b) & 0x1f) << 11) -#define __PPC_XA(a) ((((a) & 0x1f) << 16) | (((a) & 0x20) >> 3)) -#define __PPC_XB(b) ((((b) & 0x1f) << 11) | (((b) & 0x20) >> 4)) -#define __PPC_XS(s) ((((s) & 0x1f) << 21) | (((s) & 0x20) >> 5)) -#define __PPC_XT(s) __PPC_XS(s) -#define VSX_XX3(t, a, b) (__PPC_XT(t) | __PPC_XA(a) | __PPC_XB(b)) -#define VSX_XX1(s, a, b) (__PPC_XS(s) | __PPC_RA(a) | __PPC_RB(b)) - -#define PPC_INST_VPMSUMW 0x10000488 -#define PPC_INST_VPMSUMD 0x100004c8 -#define PPC_INST_MFVSRD 0x7c000066 -#define PPC_INST_MTVSRD 0x7c000166 - -#define VPMSUMW(t, a, b) .long PPC_INST_VPMSUMW | VSX_XX3((t), a, b) -#define VPMSUMD(t, a, b) .long PPC_INST_VPMSUMD | VSX_XX3((t), a, b) -#define MFVRD(a, t) .long PPC_INST_MFVSRD | VSX_XX1((t)+32, a, 0) -#define MTVRD(t, a) .long PPC_INST_MTVSRD | VSX_XX1((t)+32, a, 0) - -#endif diff --git a/storage/xtradb/ut/ut0crc32.cc b/storage/xtradb/ut/ut0crc32.cc index 2e3924a997e..1484d245953 100644 --- a/storage/xtradb/ut/ut0crc32.cc +++ b/storage/xtradb/ut/ut0crc32.cc @@ -104,6 +104,7 @@ UNIV_INTERN bool ut_crc32_power8_enabled = false; /********************************************************************//** Initializes the table that is used to generate the CRC32 if the CPU does not have support for it. */ +#ifndef HAVE_CRC32_VPMSUM static void ut_crc32_slice8_table_init() @@ -133,6 +134,7 @@ ut_crc32_slice8_table_init() ut_crc32_slice8_table_initialized = TRUE; } +#endif #if defined(__GNUC__) && defined(__x86_64__) /********************************************************************//** @@ -181,27 +183,22 @@ for RHEL4 support (GCC 3 doesn't support this instruction) */ len -= 8, buf += 8 #endif /* defined(__GNUC__) && defined(__x86_64__) */ -#if defined(__powerpc__) + +#ifdef HAVE_CRC32_VPMSUM extern "C" { -unsigned int crc32_vpmsum(unsigned int crc, const unsigned char *p, unsigned long len); +unsigned int crc32c_vpmsum(unsigned int crc, const unsigned char *p, unsigned long len); }; -#endif /* __powerpc__ */ UNIV_INLINE ib_uint32_t ut_crc32_power8( /*===========*/ const byte* buf, /*!< in: data over which to calculate CRC32 */ - ulint len) /*!< in: data length */ + ulint len) /*!< in: data length */ { -#if defined(__powerpc__) && !defined(WORDS_BIGENDIAN) - return crc32_vpmsum(0, buf, len); -#else - ut_error; - /* silence compiler warning about unused parameters */ - return((ib_uint32_t) buf[len]); -#endif /* __powerpc__ */ + return crc32c_vpmsum(0, buf, len); } +#endif /********************************************************************//** Calculates CRC32 using CPU instructions. @@ -338,18 +335,15 @@ ut_crc32_init() #endif /* defined(__GNUC__) && defined(__x86_64__) */ -#if defined(__linux__) && defined(__powerpc__) && defined(AT_HWCAP2) \ - && !defined(WORDS_BIGENDIAN) - if (getauxval(AT_HWCAP2) & PPC_FEATURE2_ARCH_2_07) - ut_crc32_power8_enabled = true; -#endif /* defined(__linux__) && defined(__powerpc__) */ - +#ifdef HAVE_CRC32_VPMSUM + ut_crc32_power8_enabled = true; + ut_crc32 = ut_crc32_power8; +#else if (ut_crc32_sse2_enabled) { ut_crc32 = ut_crc32_sse42; - } else if (ut_crc32_power8_enabled) { - ut_crc32 = ut_crc32_power8; } else { ut_crc32_slice8_table_init(); ut_crc32 = ut_crc32_slice8; } +#endif } diff --git a/strings/ctype-tis620.c b/strings/ctype-tis620.c index 82fd864b05d..7f3bdc9140a 100644 --- a/strings/ctype-tis620.c +++ b/strings/ctype-tis620.c @@ -40,7 +40,6 @@ #ifdef HAVE_CHARSET_tis620 -#define BUFFER_MULTIPLY 4 #define M L_MIDDLE #define U L_UPPER #define L L_LOWER diff --git a/strings/ctype-uca.c b/strings/ctype-uca.c index 0b279b620fd..a85c4f75408 100644 --- a/strings/ctype-uca.c +++ b/strings/ctype-uca.c @@ -6539,7 +6539,8 @@ MY_UCA_INFO my_uca_v400= 0, /* nitems */ NULL, /* item */ NULL /* flags */ - } + }, + 0 /* levelno */ }, }, @@ -19104,6 +19105,11021 @@ NULL ,NULL ,NULL ,NULL }; +static const uint16 uca520_p000_w2[]= { /* 0000 (4 weights per char) */ +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, /* 0000 */ +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, /* 0002 */ +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, /* 0004 */ +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, /* 0006 */ +0x0000,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0008 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 000A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 000C */ +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, /* 000E */ +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, /* 0010 */ +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, /* 0012 */ +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, /* 0014 */ +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, /* 0016 */ +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, /* 0018 */ +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, /* 001A */ +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, /* 001C */ +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, /* 001E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0020 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0022 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0024 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0026 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0028 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 002A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 002C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 002E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0030 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0032 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0034 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0036 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0038 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 003A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 003C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 003E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0040 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0042 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0044 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0046 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0048 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 004A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 004C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 004E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0050 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0052 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0054 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0056 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0058 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 005A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 005C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 005E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0060 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0062 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0064 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0066 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0068 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 006A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 006C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 006E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0070 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0072 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0074 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0076 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0078 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 007A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 007C */ +0x0020,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, /* 007E */ +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, /* 0080 */ +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, /* 0082 */ +0x0000,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0084 */ +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, /* 0086 */ +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, /* 0088 */ +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, /* 008A */ +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, /* 008C */ +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, /* 008E */ +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, /* 0090 */ +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, /* 0092 */ +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, /* 0094 */ +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, /* 0096 */ +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, /* 0098 */ +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, /* 009A */ +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, /* 009C */ +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, /* 009E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 00A0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 00A2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 00A4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 00A6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 00A8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 00AA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 00AC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 00AE */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 00B0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 00B2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 00B4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 00B6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 00B8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 00BA */ +0x0020,0x0020,0x0020,0x0000, 0x0020,0x0020,0x0020,0x0000, /* 00BC */ +0x0020,0x0020,0x0020,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 00BE */ +0x0020,0x0035,0x0000,0x0000, 0x0020,0x0032,0x0000,0x0000, /* 00C0 */ +0x0020,0x003C,0x0000,0x0000, 0x0020,0x004E,0x0000,0x0000, /* 00C2 */ +0x0020,0x0047,0x0000,0x0000, 0x0020,0x0043,0x0000,0x0000, /* 00C4 */ +0x0020,0x0159,0x0020,0x0000, 0x0020,0x0056,0x0000,0x0000, /* 00C6 */ +0x0020,0x0035,0x0000,0x0000, 0x0020,0x0032,0x0000,0x0000, /* 00C8 */ +0x0020,0x003C,0x0000,0x0000, 0x0020,0x0047,0x0000,0x0000, /* 00CA */ +0x0020,0x0035,0x0000,0x0000, 0x0020,0x0032,0x0000,0x0000, /* 00CC */ +0x0020,0x003C,0x0000,0x0000, 0x0020,0x0047,0x0000,0x0000, /* 00CE */ +0x0020,0x0159,0x0000,0x0000, 0x0020,0x004E,0x0000,0x0000, /* 00D0 */ +0x0020,0x0035,0x0000,0x0000, 0x0020,0x0032,0x0000,0x0000, /* 00D2 */ +0x0020,0x003C,0x0000,0x0000, 0x0020,0x004E,0x0000,0x0000, /* 00D4 */ +0x0020,0x0047,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 00D6 */ +0x0020,0x0054,0x0000,0x0000, 0x0020,0x0035,0x0000,0x0000, /* 00D8 */ +0x0020,0x0032,0x0000,0x0000, 0x0020,0x003C,0x0000,0x0000, /* 00DA */ +0x0020,0x0047,0x0000,0x0000, 0x0020,0x0032,0x0000,0x0000, /* 00DC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0159,0x0020,0x0000, /* 00DE */ +0x0020,0x0035,0x0000,0x0000, 0x0020,0x0032,0x0000,0x0000, /* 00E0 */ +0x0020,0x003C,0x0000,0x0000, 0x0020,0x004E,0x0000,0x0000, /* 00E2 */ +0x0020,0x0047,0x0000,0x0000, 0x0020,0x0043,0x0000,0x0000, /* 00E4 */ +0x0020,0x0159,0x0020,0x0000, 0x0020,0x0056,0x0000,0x0000, /* 00E6 */ +0x0020,0x0035,0x0000,0x0000, 0x0020,0x0032,0x0000,0x0000, /* 00E8 */ +0x0020,0x003C,0x0000,0x0000, 0x0020,0x0047,0x0000,0x0000, /* 00EA */ +0x0020,0x0035,0x0000,0x0000, 0x0020,0x0032,0x0000,0x0000, /* 00EC */ +0x0020,0x003C,0x0000,0x0000, 0x0020,0x0047,0x0000,0x0000, /* 00EE */ +0x0020,0x0159,0x0000,0x0000, 0x0020,0x004E,0x0000,0x0000, /* 00F0 */ +0x0020,0x0035,0x0000,0x0000, 0x0020,0x0032,0x0000,0x0000, /* 00F2 */ +0x0020,0x003C,0x0000,0x0000, 0x0020,0x004E,0x0000,0x0000, /* 00F4 */ +0x0020,0x0047,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 00F6 */ +0x0020,0x0054,0x0000,0x0000, 0x0020,0x0035,0x0000,0x0000, /* 00F8 */ +0x0020,0x0032,0x0000,0x0000, 0x0020,0x003C,0x0000,0x0000, /* 00FA */ +0x0020,0x0047,0x0000,0x0000, 0x0020,0x0032,0x0000,0x0000, /* 00FC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0047,0x0000,0x0000 /* 00FE */ +}; + +static const uint16 uca520_p001_w2[]= { /* 0100 (5 weights per char) */ +0x0020,0x005B,0x0000,0x0000,0x0000, /* 0100 */ +0x0020,0x005B,0x0000,0x0000,0x0000, /* 0101 */ +0x0020,0x0037,0x0000,0x0000,0x0000, /* 0102 */ +0x0020,0x0037,0x0000,0x0000,0x0000, /* 0103 */ +0x0020,0x0059,0x0000,0x0000,0x0000, /* 0104 */ +0x0020,0x0059,0x0000,0x0000,0x0000, /* 0105 */ +0x0020,0x0032,0x0000,0x0000,0x0000, /* 0106 */ +0x0020,0x0032,0x0000,0x0000,0x0000, /* 0107 */ +0x0020,0x003C,0x0000,0x0000,0x0000, /* 0108 */ +0x0020,0x003C,0x0000,0x0000,0x0000, /* 0109 */ +0x0020,0x0052,0x0000,0x0000,0x0000, /* 010A */ +0x0020,0x0052,0x0000,0x0000,0x0000, /* 010B */ +0x0020,0x0041,0x0000,0x0000,0x0000, /* 010C */ +0x0020,0x0041,0x0000,0x0000,0x0000, /* 010D */ +0x0020,0x0041,0x0000,0x0000,0x0000, /* 010E */ +0x0020,0x0041,0x0000,0x0000,0x0000, /* 010F */ +0x0020,0x007D,0x0000,0x0000,0x0000, /* 0110 */ +0x0020,0x007D,0x0000,0x0000,0x0000, /* 0111 */ +0x0020,0x005B,0x0000,0x0000,0x0000, /* 0112 */ +0x0020,0x005B,0x0000,0x0000,0x0000, /* 0113 */ +0x0020,0x0037,0x0000,0x0000,0x0000, /* 0114 */ +0x0020,0x0037,0x0000,0x0000,0x0000, /* 0115 */ +0x0020,0x0052,0x0000,0x0000,0x0000, /* 0116 */ +0x0020,0x0052,0x0000,0x0000,0x0000, /* 0117 */ +0x0020,0x0059,0x0000,0x0000,0x0000, /* 0118 */ +0x0020,0x0059,0x0000,0x0000,0x0000, /* 0119 */ +0x0020,0x0041,0x0000,0x0000,0x0000, /* 011A */ +0x0020,0x0041,0x0000,0x0000,0x0000, /* 011B */ +0x0020,0x003C,0x0000,0x0000,0x0000, /* 011C */ +0x0020,0x003C,0x0000,0x0000,0x0000, /* 011D */ +0x0020,0x0037,0x0000,0x0000,0x0000, /* 011E */ +0x0020,0x0037,0x0000,0x0000,0x0000, /* 011F */ +0x0020,0x0052,0x0000,0x0000,0x0000, /* 0120 */ +0x0020,0x0052,0x0000,0x0000,0x0000, /* 0121 */ +0x0020,0x0056,0x0000,0x0000,0x0000, /* 0122 */ +0x0020,0x0056,0x0000,0x0000,0x0000, /* 0123 */ +0x0020,0x003C,0x0000,0x0000,0x0000, /* 0124 */ +0x0020,0x003C,0x0000,0x0000,0x0000, /* 0125 */ +0x0020,0x007D,0x0000,0x0000,0x0000, /* 0126 */ +0x0020,0x007D,0x0000,0x0000,0x0000, /* 0127 */ +0x0020,0x004E,0x0000,0x0000,0x0000, /* 0128 */ +0x0020,0x004E,0x0000,0x0000,0x0000, /* 0129 */ +0x0020,0x005B,0x0000,0x0000,0x0000, /* 012A */ +0x0020,0x005B,0x0000,0x0000,0x0000, /* 012B */ +0x0020,0x0037,0x0000,0x0000,0x0000, /* 012C */ +0x0020,0x0037,0x0000,0x0000,0x0000, /* 012D */ +0x0020,0x0059,0x0000,0x0000,0x0000, /* 012E */ +0x0020,0x0059,0x0000,0x0000,0x0000, /* 012F */ +0x0020,0x0052,0x0000,0x0000,0x0000, /* 0130 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 0131 */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 0132 */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 0133 */ +0x0020,0x003C,0x0000,0x0000,0x0000, /* 0134 */ +0x0020,0x003C,0x0000,0x0000,0x0000, /* 0135 */ +0x0020,0x0056,0x0000,0x0000,0x0000, /* 0136 */ +0x0020,0x0056,0x0000,0x0000,0x0000, /* 0137 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 0138 */ +0x0020,0x0032,0x0000,0x0000,0x0000, /* 0139 */ +0x0020,0x0032,0x0000,0x0000,0x0000, /* 013A */ +0x0020,0x0056,0x0000,0x0000,0x0000, /* 013B */ +0x0020,0x0056,0x0000,0x0000,0x0000, /* 013C */ +0x0020,0x0041,0x0000,0x0000,0x0000, /* 013D */ +0x0020,0x0041,0x0000,0x0000,0x0000, /* 013E */ +0x0020,0x0159,0x0000,0x0000,0x0000, /* 013F */ +0x0020,0x0159,0x0000,0x0000,0x0000, /* 0140 */ +0x0020,0x007D,0x0000,0x0000,0x0000, /* 0141 */ +0x0020,0x007D,0x0000,0x0000,0x0000, /* 0142 */ +0x0020,0x0032,0x0000,0x0000,0x0000, /* 0143 */ +0x0020,0x0032,0x0000,0x0000,0x0000, /* 0144 */ +0x0020,0x0056,0x0000,0x0000,0x0000, /* 0145 */ +0x0020,0x0056,0x0000,0x0000,0x0000, /* 0146 */ +0x0020,0x0041,0x0000,0x0000,0x0000, /* 0147 */ +0x0020,0x0041,0x0000,0x0000,0x0000, /* 0148 */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 0149 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 014A */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 014B */ +0x0020,0x005B,0x0000,0x0000,0x0000, /* 014C */ +0x0020,0x005B,0x0000,0x0000,0x0000, /* 014D */ +0x0020,0x0037,0x0000,0x0000,0x0000, /* 014E */ +0x0020,0x0037,0x0000,0x0000,0x0000, /* 014F */ +0x0020,0x004D,0x0000,0x0000,0x0000, /* 0150 */ +0x0020,0x004D,0x0000,0x0000,0x0000, /* 0151 */ +0x0020,0x0159,0x0020,0x0000,0x0000, /* 0152 */ +0x0020,0x0159,0x0020,0x0000,0x0000, /* 0153 */ +0x0020,0x0032,0x0000,0x0000,0x0000, /* 0154 */ +0x0020,0x0032,0x0000,0x0000,0x0000, /* 0155 */ +0x0020,0x0056,0x0000,0x0000,0x0000, /* 0156 */ +0x0020,0x0056,0x0000,0x0000,0x0000, /* 0157 */ +0x0020,0x0041,0x0000,0x0000,0x0000, /* 0158 */ +0x0020,0x0041,0x0000,0x0000,0x0000, /* 0159 */ +0x0020,0x0032,0x0000,0x0000,0x0000, /* 015A */ +0x0020,0x0032,0x0000,0x0000,0x0000, /* 015B */ +0x0020,0x003C,0x0000,0x0000,0x0000, /* 015C */ +0x0020,0x003C,0x0000,0x0000,0x0000, /* 015D */ +0x0020,0x0056,0x0000,0x0000,0x0000, /* 015E */ +0x0020,0x0056,0x0000,0x0000,0x0000, /* 015F */ +0x0020,0x0041,0x0000,0x0000,0x0000, /* 0160 */ +0x0020,0x0041,0x0000,0x0000,0x0000, /* 0161 */ +0x0020,0x0056,0x0000,0x0000,0x0000, /* 0162 */ +0x0020,0x0056,0x0000,0x0000,0x0000, /* 0163 */ +0x0020,0x0041,0x0000,0x0000,0x0000, /* 0164 */ +0x0020,0x0041,0x0000,0x0000,0x0000, /* 0165 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 0166 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 0167 */ +0x0020,0x004E,0x0000,0x0000,0x0000, /* 0168 */ +0x0020,0x004E,0x0000,0x0000,0x0000, /* 0169 */ +0x0020,0x005B,0x0000,0x0000,0x0000, /* 016A */ +0x0020,0x005B,0x0000,0x0000,0x0000, /* 016B */ +0x0020,0x0037,0x0000,0x0000,0x0000, /* 016C */ +0x0020,0x0037,0x0000,0x0000,0x0000, /* 016D */ +0x0020,0x0043,0x0000,0x0000,0x0000, /* 016E */ +0x0020,0x0043,0x0000,0x0000,0x0000, /* 016F */ +0x0020,0x004D,0x0000,0x0000,0x0000, /* 0170 */ +0x0020,0x004D,0x0000,0x0000,0x0000, /* 0171 */ +0x0020,0x0059,0x0000,0x0000,0x0000, /* 0172 */ +0x0020,0x0059,0x0000,0x0000,0x0000, /* 0173 */ +0x0020,0x003C,0x0000,0x0000,0x0000, /* 0174 */ +0x0020,0x003C,0x0000,0x0000,0x0000, /* 0175 */ +0x0020,0x003C,0x0000,0x0000,0x0000, /* 0176 */ +0x0020,0x003C,0x0000,0x0000,0x0000, /* 0177 */ +0x0020,0x0047,0x0000,0x0000,0x0000, /* 0178 */ +0x0020,0x0032,0x0000,0x0000,0x0000, /* 0179 */ +0x0020,0x0032,0x0000,0x0000,0x0000, /* 017A */ +0x0020,0x0052,0x0000,0x0000,0x0000, /* 017B */ +0x0020,0x0052,0x0000,0x0000,0x0000, /* 017C */ +0x0020,0x0041,0x0000,0x0000,0x0000, /* 017D */ +0x0020,0x0041,0x0000,0x0000,0x0000, /* 017E */ +0x0020,0x015A,0x0000,0x0000,0x0000, /* 017F */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 0180 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 0181 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 0182 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 0183 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 0184 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 0185 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 0186 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 0187 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 0188 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 0189 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 018A */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 018B */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 018C */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 018D */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 018E */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 018F */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 0190 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 0191 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 0192 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 0193 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 0194 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 0195 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 0196 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 0197 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 0198 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 0199 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 019A */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 019B */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 019C */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 019D */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 019E */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 019F */ +0x0020,0x0068,0x0000,0x0000,0x0000, /* 01A0 */ +0x0020,0x0068,0x0000,0x0000,0x0000, /* 01A1 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 01A2 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 01A3 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 01A4 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 01A5 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 01A6 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 01A7 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 01A8 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 01A9 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 01AA */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 01AB */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 01AC */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 01AD */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 01AE */ +0x0020,0x0068,0x0000,0x0000,0x0000, /* 01AF */ +0x0020,0x0068,0x0000,0x0000,0x0000, /* 01B0 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 01B1 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 01B2 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 01B3 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 01B4 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 01B5 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 01B6 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 01B7 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 01B8 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 01B9 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 01BA */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 01BB */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 01BC */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 01BD */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 01BE */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 01BF */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 01C0 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 01C1 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 01C2 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 01C3 */ +0x0020,0x0020,0x0041,0x0000,0x0000, /* 01C4 */ +0x0020,0x0020,0x0041,0x0000,0x0000, /* 01C5 */ +0x0020,0x0020,0x0041,0x0000,0x0000, /* 01C6 */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 01C7 */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 01C8 */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 01C9 */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 01CA */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 01CB */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 01CC */ +0x0020,0x0041,0x0000,0x0000,0x0000, /* 01CD */ +0x0020,0x0041,0x0000,0x0000,0x0000, /* 01CE */ +0x0020,0x0041,0x0000,0x0000,0x0000, /* 01CF */ +0x0020,0x0041,0x0000,0x0000,0x0000, /* 01D0 */ +0x0020,0x0041,0x0000,0x0000,0x0000, /* 01D1 */ +0x0020,0x0041,0x0000,0x0000,0x0000, /* 01D2 */ +0x0020,0x0041,0x0000,0x0000,0x0000, /* 01D3 */ +0x0020,0x0041,0x0000,0x0000,0x0000, /* 01D4 */ +0x0020,0x0047,0x005B,0x0000,0x0000, /* 01D5 */ +0x0020,0x0047,0x005B,0x0000,0x0000, /* 01D6 */ +0x0020,0x0047,0x0032,0x0000,0x0000, /* 01D7 */ +0x0020,0x0047,0x0032,0x0000,0x0000, /* 01D8 */ +0x0020,0x0047,0x0041,0x0000,0x0000, /* 01D9 */ +0x0020,0x0047,0x0041,0x0000,0x0000, /* 01DA */ +0x0020,0x0047,0x0035,0x0000,0x0000, /* 01DB */ +0x0020,0x0047,0x0035,0x0000,0x0000, /* 01DC */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 01DD */ +0x0020,0x0047,0x005B,0x0000,0x0000, /* 01DE */ +0x0020,0x0047,0x005B,0x0000,0x0000, /* 01DF */ +0x0020,0x0052,0x005B,0x0000,0x0000, /* 01E0 */ +0x0020,0x0052,0x005B,0x0000,0x0000, /* 01E1 */ +0x0020,0x0159,0x0020,0x005B,0x0000, /* 01E2 */ +0x0020,0x0159,0x0020,0x005B,0x0000, /* 01E3 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 01E4 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 01E5 */ +0x0020,0x0041,0x0000,0x0000,0x0000, /* 01E6 */ +0x0020,0x0041,0x0000,0x0000,0x0000, /* 01E7 */ +0x0020,0x0041,0x0000,0x0000,0x0000, /* 01E8 */ +0x0020,0x0041,0x0000,0x0000,0x0000, /* 01E9 */ +0x0020,0x0059,0x0000,0x0000,0x0000, /* 01EA */ +0x0020,0x0059,0x0000,0x0000,0x0000, /* 01EB */ +0x0020,0x0059,0x005B,0x0000,0x0000, /* 01EC */ +0x0020,0x0059,0x005B,0x0000,0x0000, /* 01ED */ +0x0020,0x0041,0x0000,0x0000,0x0000, /* 01EE */ +0x0020,0x0041,0x0000,0x0000,0x0000, /* 01EF */ +0x0020,0x0041,0x0000,0x0000,0x0000, /* 01F0 */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 01F1 */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 01F2 */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 01F3 */ +0x0020,0x0032,0x0000,0x0000,0x0000, /* 01F4 */ +0x0020,0x0032,0x0000,0x0000,0x0000, /* 01F5 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 01F6 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 01F7 */ +0x0020,0x0035,0x0000,0x0000,0x0000, /* 01F8 */ +0x0020,0x0035,0x0000,0x0000,0x0000, /* 01F9 */ +0x0020,0x0043,0x0032,0x0000,0x0000, /* 01FA */ +0x0020,0x0043,0x0032,0x0000,0x0000, /* 01FB */ +0x0020,0x0159,0x0020,0x0032,0x0000, /* 01FC */ +0x0020,0x0159,0x0020,0x0032,0x0000, /* 01FD */ +0x0020,0x0054,0x0032,0x0000,0x0000, /* 01FE */ +0x0020,0x0054,0x0032,0x0000,0x0000 /* 01FF */ +}; + +static const uint16 uca520_p002_w2[]= { /* 0200 (4 weights per char) */ +0x0020,0x0065,0x0000,0x0000, 0x0020,0x0065,0x0000,0x0000, /* 0200 */ +0x0020,0x0067,0x0000,0x0000, 0x0020,0x0067,0x0000,0x0000, /* 0202 */ +0x0020,0x0065,0x0000,0x0000, 0x0020,0x0065,0x0000,0x0000, /* 0204 */ +0x0020,0x0067,0x0000,0x0000, 0x0020,0x0067,0x0000,0x0000, /* 0206 */ +0x0020,0x0065,0x0000,0x0000, 0x0020,0x0065,0x0000,0x0000, /* 0208 */ +0x0020,0x0067,0x0000,0x0000, 0x0020,0x0067,0x0000,0x0000, /* 020A */ +0x0020,0x0065,0x0000,0x0000, 0x0020,0x0065,0x0000,0x0000, /* 020C */ +0x0020,0x0067,0x0000,0x0000, 0x0020,0x0067,0x0000,0x0000, /* 020E */ +0x0020,0x0065,0x0000,0x0000, 0x0020,0x0065,0x0000,0x0000, /* 0210 */ +0x0020,0x0067,0x0000,0x0000, 0x0020,0x0067,0x0000,0x0000, /* 0212 */ +0x0020,0x0065,0x0000,0x0000, 0x0020,0x0065,0x0000,0x0000, /* 0214 */ +0x0020,0x0067,0x0000,0x0000, 0x0020,0x0067,0x0000,0x0000, /* 0216 */ +0x0020,0x0077,0x0000,0x0000, 0x0020,0x0077,0x0000,0x0000, /* 0218 */ +0x0020,0x0077,0x0000,0x0000, 0x0020,0x0077,0x0000,0x0000, /* 021A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 021C */ +0x0020,0x0041,0x0000,0x0000, 0x0020,0x0041,0x0000,0x0000, /* 021E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0220 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0222 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0224 */ +0x0020,0x0052,0x0000,0x0000, 0x0020,0x0052,0x0000,0x0000, /* 0226 */ +0x0020,0x0056,0x0000,0x0000, 0x0020,0x0056,0x0000,0x0000, /* 0228 */ +0x0020,0x0047,0x005B,0x0000, 0x0020,0x0047,0x005B,0x0000, /* 022A */ +0x0020,0x004E,0x005B,0x0000, 0x0020,0x004E,0x005B,0x0000, /* 022C */ +0x0020,0x0052,0x0000,0x0000, 0x0020,0x0052,0x0000,0x0000, /* 022E */ +0x0020,0x0052,0x005B,0x0000, 0x0020,0x0052,0x005B,0x0000, /* 0230 */ +0x0020,0x005B,0x0000,0x0000, 0x0020,0x005B,0x0000,0x0000, /* 0232 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0234 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0236 */ +0x0020,0x0020,0x0000,0x0000, 0x0020,0x0020,0x0000,0x0000, /* 0238 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 023A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 023C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 023E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0240 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0242 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0244 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0246 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0248 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 024A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 024C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 024E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0250 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0252 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0254 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0256 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0258 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 025A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 025C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 025E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0260 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0262 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0264 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0266 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0268 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 026A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 026C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 026E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0270 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0272 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0274 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0276 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0278 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 027A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 027C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 027E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0280 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0282 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0284 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0286 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0288 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 028A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 028C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 028E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0290 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0292 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0294 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0296 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0298 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 029A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 029C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 029E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 02A0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0020,0x0000,0x0000, /* 02A2 */ +0x0020,0x0020,0x0000,0x0000, 0x0020,0x0020,0x0000,0x0000, /* 02A4 */ +0x0020,0x0020,0x0000,0x0000, 0x0020,0x0020,0x0000,0x0000, /* 02A6 */ +0x0020,0x0020,0x0000,0x0000, 0x0020,0x0020,0x0000,0x0000, /* 02A8 */ +0x0020,0x0020,0x0000,0x0000, 0x0020,0x0020,0x0000,0x0000, /* 02AA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 02AC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 02AE */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 02B0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 02B2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 02B4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 02B6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 02B8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 02BA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 02BC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 02BE */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 02C0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 02C2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 02C4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 02C6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 02C8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 02CA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 02CC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 02CE */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 02D0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 02D2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 02D4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 02D6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 02D8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 02DA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 02DC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 02DE */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 02E0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 02E2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 02E4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 02E6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 02E8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 02EA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 02EC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 02EE */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 02F0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 02F2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 02F4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 02F6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 02F8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 02FA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 02FC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000 /* 02FE */ +}; + +static const uint16 uca520_p003_w2[]= { /* 0300 (4 weights per char) */ +0x0035,0x0000,0x0000,0x0000, 0x0032,0x0000,0x0000,0x0000, /* 0300 */ +0x003C,0x0000,0x0000,0x0000, 0x004E,0x0000,0x0000,0x0000, /* 0302 */ +0x005B,0x0000,0x0000,0x0000, 0x0063,0x0000,0x0000,0x0000, /* 0304 */ +0x0037,0x0000,0x0000,0x0000, 0x0052,0x0000,0x0000,0x0000, /* 0306 */ +0x0047,0x0000,0x0000,0x0000, 0x0064,0x0000,0x0000,0x0000, /* 0308 */ +0x0043,0x0000,0x0000,0x0000, 0x004D,0x0000,0x0000,0x0000, /* 030A */ +0x0041,0x0000,0x0000,0x0000, 0x005F,0x0000,0x0000,0x0000, /* 030C */ +0x005F,0x0000,0x0000,0x0000, 0x0065,0x0000,0x0000,0x0000, /* 030E */ +0x0066,0x0000,0x0000,0x0000, 0x0067,0x0000,0x0000,0x0000, /* 0310 */ +0x005F,0x0000,0x0000,0x0000, 0x0022,0x0000,0x0000,0x0000, /* 0312 */ +0x002A,0x0000,0x0000,0x0000, 0x005F,0x0000,0x0000,0x0000, /* 0314 */ +0x0060,0x0000,0x0000,0x0000, 0x0060,0x0000,0x0000,0x0000, /* 0316 */ +0x0060,0x0000,0x0000,0x0000, 0x0060,0x0000,0x0000,0x0000, /* 0318 */ +0x005F,0x0000,0x0000,0x0000, 0x0068,0x0000,0x0000,0x0000, /* 031A */ +0x0060,0x0000,0x0000,0x0000, 0x0060,0x0000,0x0000,0x0000, /* 031C */ +0x0060,0x0000,0x0000,0x0000, 0x0060,0x0000,0x0000,0x0000, /* 031E */ +0x0060,0x0000,0x0000,0x0000, 0x006E,0x0000,0x0000,0x0000, /* 0320 */ +0x006F,0x0000,0x0000,0x0000, 0x0070,0x0000,0x0000,0x0000, /* 0322 */ +0x0075,0x0000,0x0000,0x0000, 0x0076,0x0000,0x0000,0x0000, /* 0324 */ +0x0077,0x0000,0x0000,0x0000, 0x0056,0x0000,0x0000,0x0000, /* 0326 */ +0x0059,0x0000,0x0000,0x0000, 0x0060,0x0000,0x0000,0x0000, /* 0328 */ +0x0060,0x0000,0x0000,0x0000, 0x0060,0x0000,0x0000,0x0000, /* 032A */ +0x0060,0x0000,0x0000,0x0000, 0x0078,0x0000,0x0000,0x0000, /* 032C */ +0x0079,0x0000,0x0000,0x0000, 0x0060,0x0000,0x0000,0x0000, /* 032E */ +0x007A,0x0000,0x0000,0x0000, 0x007B,0x0000,0x0000,0x0000, /* 0330 */ +0x0021,0x0000,0x0000,0x0000, 0x0060,0x0000,0x0000,0x0000, /* 0332 */ +0x007C,0x0000,0x0000,0x0000, 0x007D,0x0000,0x0000,0x0000, /* 0334 */ +0x0061,0x0000,0x0000,0x0000, 0x0061,0x0000,0x0000,0x0000, /* 0336 */ +0x0054,0x0000,0x0000,0x0000, 0x007E,0x0000,0x0000,0x0000, /* 0338 */ +0x0060,0x0000,0x0000,0x0000, 0x0060,0x0000,0x0000,0x0000, /* 033A */ +0x0060,0x0000,0x0000,0x0000, 0x005F,0x0000,0x0000,0x0000, /* 033C */ +0x005F,0x0000,0x0000,0x0000, 0x005F,0x0000,0x0000,0x0000, /* 033E */ +0x0035,0x0000,0x0000,0x0000, 0x0032,0x0000,0x0000,0x0000, /* 0340 */ +0x0045,0x0000,0x0000,0x0000, 0x0022,0x0000,0x0000,0x0000, /* 0342 */ +0x0047,0x0032,0x0000,0x0000, 0x007F,0x0000,0x0000,0x0000, /* 0344 */ +0x005F,0x0000,0x0000,0x0000, 0x0060,0x0000,0x0000,0x0000, /* 0346 */ +0x0060,0x0000,0x0000,0x0000, 0x0060,0x0000,0x0000,0x0000, /* 0348 */ +0x005F,0x0000,0x0000,0x0000, 0x005F,0x0000,0x0000,0x0000, /* 034A */ +0x005F,0x0000,0x0000,0x0000, 0x0060,0x0000,0x0000,0x0000, /* 034C */ +0x0060,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, /* 034E */ +0x005F,0x0000,0x0000,0x0000, 0x005F,0x0000,0x0000,0x0000, /* 0350 */ +0x005F,0x0000,0x0000,0x0000, 0x0060,0x0000,0x0000,0x0000, /* 0352 */ +0x0060,0x0000,0x0000,0x0000, 0x0060,0x0000,0x0000,0x0000, /* 0354 */ +0x0060,0x0000,0x0000,0x0000, 0x005F,0x0000,0x0000,0x0000, /* 0356 */ +0x0080,0x0000,0x0000,0x0000, 0x0060,0x0000,0x0000,0x0000, /* 0358 */ +0x0060,0x0000,0x0000,0x0000, 0x005F,0x0000,0x0000,0x0000, /* 035A */ +0x0060,0x0000,0x0000,0x0000, 0x005F,0x0000,0x0000,0x0000, /* 035C */ +0x005F,0x0000,0x0000,0x0000, 0x0060,0x0000,0x0000,0x0000, /* 035E */ +0x0081,0x0000,0x0000,0x0000, 0x0082,0x0000,0x0000,0x0000, /* 0360 */ +0x0060,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0362 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0364 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0366 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0368 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 036A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 036C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 036E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0370 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0372 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0374 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0376 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0378 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 037A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 037C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 037E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0380 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0382 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0032,0x0000,0x0000, /* 0384 */ +0x0020,0x0032,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0386 */ +0x0020,0x0032,0x0000,0x0000, 0x0020,0x0032,0x0000,0x0000, /* 0388 */ +0x0020,0x0032,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 038A */ +0x0020,0x0032,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 038C */ +0x0020,0x0032,0x0000,0x0000, 0x0020,0x0032,0x0000,0x0000, /* 038E */ +0x0020,0x0047,0x0032,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0390 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0392 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0394 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0396 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0398 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 039A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 039C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 039E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 03A0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 03A2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 03A4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 03A6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 03A8 */ +0x0020,0x0047,0x0000,0x0000, 0x0020,0x0047,0x0000,0x0000, /* 03AA */ +0x0020,0x0032,0x0000,0x0000, 0x0020,0x0032,0x0000,0x0000, /* 03AC */ +0x0020,0x0032,0x0000,0x0000, 0x0020,0x0032,0x0000,0x0000, /* 03AE */ +0x0020,0x0047,0x0032,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 03B0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 03B2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 03B4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 03B6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 03B8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 03BA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 03BC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 03BE */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 03C0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 03C2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 03C4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 03C6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 03C8 */ +0x0020,0x0047,0x0000,0x0000, 0x0020,0x0047,0x0000,0x0000, /* 03CA */ +0x0020,0x0032,0x0000,0x0000, 0x0020,0x0032,0x0000,0x0000, /* 03CC */ +0x0020,0x0032,0x0000,0x0000, 0x0020,0x0020,0x0020,0x0000, /* 03CE */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 03D0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0032,0x0000,0x0000, /* 03D2 */ +0x0020,0x0047,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 03D4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0020,0x0020,0x0000, /* 03D6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 03D8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 03DA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 03DC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 03DE */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 03E0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 03E2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 03E4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 03E6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 03E8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 03EA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 03EC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 03EE */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 03F0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 03F2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 03F4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 03F6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 03F8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 03FA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 03FC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000 /* 03FE */ +}; + +static const uint16 uca520_p004_w2[]= { /* 0400 (3 weights per char) */ +0x0020,0x0035,0x0000, 0x0020,0x0047,0x0000, 0x0020,0x0000,0x0000, /* 0400 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0403 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0406 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0409 */ +0x0020,0x0000,0x0000, 0x0020,0x0035,0x0000, 0x0020,0x0000,0x0000, /* 040C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 040F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0412 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0415 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0418 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 041B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 041E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0421 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0424 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0427 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 042A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 042D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0430 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0433 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0436 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0439 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 043C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 043F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0442 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0445 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0448 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 044B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0035,0x0000, /* 044E */ +0x0020,0x0047,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0451 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0454 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0457 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 045A */ +0x0020,0x0035,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 045D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0460 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0463 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0466 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0469 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 046C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 046F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0472 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0475 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0478 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 047B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 047E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0083,0x0000,0x0000, /* 0481 */ +0x005F,0x0000,0x0000, 0x002A,0x0000,0x0000, 0x0022,0x0000,0x0000, /* 0484 */ +0x005F,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, /* 0487 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 048A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 048D */ +0x0020,0x015A,0x0000, 0x0020,0x015A,0x0000, 0x0020,0x0000,0x0000, /* 0490 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0493 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0496 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0499 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 049C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 049F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 04A2 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 04A5 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 04A8 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 04AB */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 04AE */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 04B1 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 04B4 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 04B7 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 04BA */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 04BD */ +0x0020,0x0000,0x0000, 0x0020,0x0037,0x0000, 0x0020,0x0037,0x0000, /* 04C0 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 04C3 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 04C6 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 04C9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 04CC */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 04CF */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 04D2 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 04D5 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 04D8 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 04DB */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 04DE */ +0x0020,0x0000,0x0000, 0x0020,0x005B,0x0000, 0x0020,0x005B,0x0000, /* 04E1 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 04E4 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 04E7 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 04EA */ +0x0020,0x0000,0x0000, 0x0020,0x005B,0x0000, 0x0020,0x005B,0x0000, /* 04ED */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 04F0 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 04F3 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 04F6 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 04F9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 04FC */ +0x0020,0x0000,0x0000 }; + +static const uint16 uca520_p005_w2[]= { /* 0500 (3 weights per char) */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0500 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0503 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0506 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0509 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 050C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 050F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0512 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0515 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0518 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 051B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 051E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0521 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0524 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0527 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 052A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 052D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0530 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0533 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0536 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0539 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 053C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 053F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0542 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0545 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0548 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 054B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 054E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0551 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0554 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0557 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 055A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 055D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0560 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0563 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0566 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0569 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 056C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 056F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0572 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0575 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0578 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 057B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 057E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0581 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0584 */ +0x0020,0x0020,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0587 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 058A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 058D */ +0x0020,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, /* 0590 */ +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, /* 0593 */ +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, /* 0596 */ +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, /* 0599 */ +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, /* 059C */ +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, /* 059F */ +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, /* 05A2 */ +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, /* 05A5 */ +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, /* 05A8 */ +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, /* 05AB */ +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0085,0x0000,0x0000, /* 05AE */ +0x0086,0x0000,0x0000, 0x0087,0x0000,0x0000, 0x0088,0x0000,0x0000, /* 05B1 */ +0x0089,0x0000,0x0000, 0x008A,0x0000,0x0000, 0x008B,0x0000,0x0000, /* 05B4 */ +0x008C,0x0000,0x0000, 0x008D,0x0000,0x0000, 0x008E,0x0000,0x0000, /* 05B7 */ +0x008E,0x0000,0x0000, 0x008F,0x0000,0x0000, 0x0092,0x0000,0x0000, /* 05BA */ +0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0095,0x0000,0x0000, /* 05BD */ +0x0020,0x0000,0x0000, 0x0091,0x0000,0x0000, 0x0090,0x0000,0x0000, /* 05C0 */ +0x0020,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, /* 05C3 */ +0x0020,0x0000,0x0000, 0x008D,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 05C6 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 05C9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 05CC */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 05CF */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 05D2 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 05D5 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 05D8 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 05DB */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 05DE */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 05E1 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 05E4 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 05E7 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 05EA */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 05ED */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* 05F0 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 05F3 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 05F6 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 05F9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 05FC */ +0x0020,0x0000,0x0000 }; + +static const uint16 uca520_p006_w2[]= { /* 0600 (3 weights per char) */ +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, /* 0600 */ +0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0603 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0606 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0609 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 060C */ +0x0020,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, /* 060F */ +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, /* 0612 */ +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, /* 0615 */ +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, /* 0618 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 061B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 061E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0621 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0624 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0627 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 062A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 062D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0630 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0633 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0636 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0639 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 063C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 063F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0642 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0645 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0648 */ +0x00A2,0x0000,0x0000, 0x00A3,0x0000,0x0000, 0x00A5,0x0000,0x0000, /* 064B */ +0x00A7,0x0000,0x0000, 0x00A9,0x0000,0x0000, 0x00AB,0x0000,0x0000, /* 064E */ +0x00AD,0x0000,0x0000, 0x00AF,0x0000,0x0000, 0x00B0,0x0000,0x0000, /* 0651 */ +0x00B1,0x0000,0x0000, 0x00B2,0x0000,0x0000, 0x00B3,0x0000,0x0000, /* 0654 */ +0x00B4,0x0000,0x0000, 0x00B5,0x0000,0x0000, 0x00B6,0x0000,0x0000, /* 0657 */ +0x00B7,0x0000,0x0000, 0x00B8,0x0000,0x0000, 0x00B9,0x0000,0x0000, /* 065A */ +0x00BA,0x0000,0x0000, 0x00BB,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 065D */ +0x0020,0x015F,0x0000, 0x0020,0x015F,0x0000, 0x0020,0x015F,0x0000, /* 0660 */ +0x0020,0x015F,0x0000, 0x0020,0x015F,0x0000, 0x0020,0x015F,0x0000, /* 0663 */ +0x0020,0x015F,0x0000, 0x0020,0x015F,0x0000, 0x0020,0x015F,0x0000, /* 0666 */ +0x0020,0x015F,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0669 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 066C */ +0x0020,0x0000,0x0000, 0x00BC,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 066F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0672 */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* 0675 */ +0x0020,0x0020,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0678 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 067B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 067E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0681 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0684 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0687 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 068A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 068D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0690 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0693 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0696 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0699 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 069C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 069F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 06A2 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 06A5 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 06A8 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 06AB */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 06AE */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 06B1 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 06B4 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 06B7 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 06BA */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 06BD */ +0x0020,0x00B1,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x00B1,0x0000, /* 06C0 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 06C3 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 06C6 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 06C9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 06CC */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 06CF */ +0x0020,0x0000,0x0000, 0x0020,0x00B1,0x0000, 0x0020,0x0000,0x0000, /* 06D2 */ +0x0020,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, /* 06D5 */ +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, /* 06D8 */ +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, /* 06DB */ +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, /* 06DE */ +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, /* 06E1 */ +0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 06E4 */ +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 06E7 */ +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, /* 06EA */ +0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 06ED */ +0x0020,0x0160,0x0000, 0x0020,0x0160,0x0000, 0x0020,0x0160,0x0000, /* 06F0 */ +0x0020,0x0160,0x0000, 0x0020,0x0160,0x0000, 0x0020,0x0160,0x0000, /* 06F3 */ +0x0020,0x0160,0x0000, 0x0020,0x0160,0x0000, 0x0020,0x0160,0x0000, /* 06F6 */ +0x0020,0x0160,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 06F9 */ +0x0020,0x0000,0x0000, 0x0020,0x015A,0x0000, 0x0020,0x015A,0x0000, /* 06FC */ +0x0020,0x0000,0x0000 }; + +static const uint16 uca520_p007_w2[]= { /* 0700 (3 weights per char) */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0700 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0703 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0706 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0709 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 070C */ +0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x00BD,0x0000,0x0000, /* 070F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x015A,0x0000, /* 0712 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0715 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0718 */ +0x0020,0x0000,0x0000, 0x0020,0x015A,0x0000, 0x0020,0x0000,0x0000, /* 071B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 071E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0721 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0724 */ +0x0020,0x015A,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0727 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 072A */ +0x0020,0x015C,0x0000, 0x0020,0x015C,0x0000, 0x0020,0x015C,0x0000, /* 072D */ +0x00BE,0x0000,0x0000, 0x00BF,0x0000,0x0000, 0x00C0,0x0000,0x0000, /* 0730 */ +0x00C1,0x0000,0x0000, 0x00C2,0x0000,0x0000, 0x00C3,0x0000,0x0000, /* 0733 */ +0x00C4,0x0000,0x0000, 0x00C5,0x0000,0x0000, 0x00C6,0x0000,0x0000, /* 0736 */ +0x00C7,0x0000,0x0000, 0x00C8,0x0000,0x0000, 0x00C9,0x0000,0x0000, /* 0739 */ +0x00CA,0x0000,0x0000, 0x00CB,0x0000,0x0000, 0x00CC,0x0000,0x0000, /* 073C */ +0x00CD,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x005F,0x0000,0x0000, /* 073F */ +0x0060,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, /* 0742 */ +0x005F,0x0000,0x0000, 0x0060,0x0000,0x0000, 0x0000,0x0000,0x0000, /* 0745 */ +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, /* 0748 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 074B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 074E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0751 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0754 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0757 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 075A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 075D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0760 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0763 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0766 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0769 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 076C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 076F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0772 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0775 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0778 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 077B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 077E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0781 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0784 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0787 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 078A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 078D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0790 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0793 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0796 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0799 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 079C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 079F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 07A2 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 07A5 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 07A8 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 07AB */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 07AE */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 07B1 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 07B4 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 07B7 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 07BA */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 07BD */ +0x0020,0x0162,0x0000, 0x0020,0x0162,0x0000, 0x0020,0x0162,0x0000, /* 07C0 */ +0x0020,0x0162,0x0000, 0x0020,0x0162,0x0000, 0x0020,0x0162,0x0000, /* 07C3 */ +0x0020,0x0162,0x0000, 0x0020,0x0162,0x0000, 0x0020,0x0162,0x0000, /* 07C6 */ +0x0020,0x0162,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 07C9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 07CC */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 07CF */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 07D2 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 07D5 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 07D8 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 07DB */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 07DE */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 07E1 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 07E4 */ +0x0020,0x0000,0x0000, 0x0020,0x0159,0x0000, 0x0020,0x0159,0x0000, /* 07E7 */ +0x0020,0x0159,0x0000, 0x00CE,0x0000,0x0000, 0x00CF,0x0000,0x0000, /* 07EA */ +0x00D0,0x0000,0x0000, 0x00D1,0x0000,0x0000, 0x00D2,0x0000,0x0000, /* 07ED */ +0x00D3,0x0000,0x0000, 0x00D4,0x0000,0x0000, 0x00D5,0x0000,0x0000, /* 07F0 */ +0x00D6,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 07F3 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 07F6 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 07F9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 07FC */ +0x0020,0x0000,0x0000 }; + +static const uint16 uca520_p008_w2[]= { /* 0800 (2 weights per char) */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 0800 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 0804 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 0808 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 080C */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 0810 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 0814 */ +0x009F,0x0000, 0x00A0,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 0818 */ +0x0097,0x0000, 0x0097,0x0000, 0x0098,0x0000, 0x0098,0x0000, /* 081C */ +0x0098,0x0000, 0x0099,0x0000, 0x0099,0x0000, 0x0099,0x0000, /* 0820 */ +0x009A,0x0000, 0x009A,0x0000, 0x009B,0x0000, 0x009B,0x0000, /* 0824 */ +0x009C,0x0000, 0x009C,0x0000, 0x009C,0x0000, 0x009D,0x0000, /* 0828 */ +0x009E,0x0000, 0x00A1,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 082C */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 0830 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 0834 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 0838 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 083C */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 0840 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 0844 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 0848 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 084C */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 0850 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 0854 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 0858 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 085C */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 0860 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 0864 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 0868 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 086C */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 0870 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 0874 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 0878 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 087C */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 0880 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 0884 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 0888 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 088C */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 0890 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 0894 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 0898 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 089C */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 08A0 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 08A4 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 08A8 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 08AC */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 08B0 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 08B4 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 08B8 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 08BC */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 08C0 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 08C4 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 08C8 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 08CC */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 08D0 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 08D4 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 08D8 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 08DC */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 08E0 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 08E4 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 08E8 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 08EC */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 08F0 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 08F4 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 08F8 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000 /* 08FC */ +}; + +static const uint16 uca520_p009_w2[]= { /* 0900 (3 weights per char) */ +0x00DB,0x0000,0x0000, 0x00DB,0x0000,0x0000, 0x00DC,0x0000,0x0000, /* 0900 */ +0x00DD,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0903 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0906 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0909 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 090C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 090F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0912 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0915 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0918 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 091B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 091E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0921 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0924 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x00DA,0x0000, /* 0927 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 092A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 092D */ +0x0020,0x0000,0x0000, 0x0020,0x00DA,0x0000, 0x0020,0x0000,0x0000, /* 0930 */ +0x0020,0x0000,0x0000, 0x0020,0x00DA,0x0000, 0x0020,0x0000,0x0000, /* 0933 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0936 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0939 */ +0x00DA,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 093C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 093F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0942 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0945 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0948 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 094B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 094E */ +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0035,0x0000,0x0000, /* 0951 */ +0x0032,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0954 */ +0x0020,0x0000,0x0000, 0x0020,0x00DA,0x0000, 0x0020,0x00DA,0x0000, /* 0957 */ +0x0020,0x00DA,0x0000, 0x0020,0x00DA,0x0000, 0x0020,0x00DA,0x0000, /* 095A */ +0x0020,0x00DA,0x0000, 0x0020,0x00DA,0x0000, 0x0020,0x00DA,0x0000, /* 095D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0960 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0963 */ +0x0020,0x0165,0x0000, 0x0020,0x0165,0x0000, 0x0020,0x0165,0x0000, /* 0966 */ +0x0020,0x0165,0x0000, 0x0020,0x0165,0x0000, 0x0020,0x0165,0x0000, /* 0969 */ +0x0020,0x0165,0x0000, 0x0020,0x0165,0x0000, 0x0020,0x0165,0x0000, /* 096C */ +0x0020,0x0165,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 096F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0972 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0975 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0978 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 097B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 097E */ +0x00DF,0x0000,0x0000, 0x00E0,0x0000,0x0000, 0x00E1,0x0000,0x0000, /* 0981 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0984 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0987 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 098A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 098D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0990 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0993 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0996 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0999 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 099C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 099F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 09A2 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 09A5 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 09A8 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 09AB */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 09AE */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 09B1 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 09B4 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 09B7 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x00DE,0x0000,0x0000, /* 09BA */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 09BD */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 09C0 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 09C3 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 09C6 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 09C9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0020,0x0000, /* 09CC */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 09CF */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 09D2 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 09D5 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 09D8 */ +0x0020,0x0000,0x0000, 0x0020,0x00DE,0x0000, 0x0020,0x00DE,0x0000, /* 09DB */ +0x0020,0x0000,0x0000, 0x0020,0x00DE,0x0000, 0x0020,0x0000,0x0000, /* 09DE */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 09E1 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0166,0x0000, /* 09E4 */ +0x0020,0x0166,0x0000, 0x0020,0x0166,0x0000, 0x0020,0x0166,0x0000, /* 09E7 */ +0x0020,0x0166,0x0000, 0x0020,0x0166,0x0000, 0x0020,0x0166,0x0000, /* 09EA */ +0x0020,0x0166,0x0000, 0x0020,0x0166,0x0000, 0x0020,0x0166,0x0000, /* 09ED */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 09F0 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 09F3 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 09F6 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 09F9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 09FC */ +0x0020,0x0000,0x0000 }; + +static const uint16 uca520_p00A_w2[]= { /* 0A00 (3 weights per char) */ +0x0020,0x0000,0x0000, 0x00E3,0x0000,0x0000, 0x00E4,0x0000,0x0000, /* 0A00 */ +0x00E5,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0A03 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0A06 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0A09 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0A0C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0A0F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0A12 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0A15 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0A18 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0A1B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0A1E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0A21 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0A24 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0A27 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0A2A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0A2D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0A30 */ +0x0020,0x00E2,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0A33 */ +0x0020,0x00E2,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0A36 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0A39 */ +0x00E2,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0A3C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0A3F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0A42 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0A45 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0A48 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0A4B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0A4E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0A51 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0A54 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x00E2,0x0000, /* 0A57 */ +0x0020,0x00E2,0x0000, 0x0020,0x00E2,0x0000, 0x0020,0x0000,0x0000, /* 0A5A */ +0x0020,0x0000,0x0000, 0x0020,0x00E2,0x0000, 0x0020,0x0000,0x0000, /* 0A5D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0A60 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0A63 */ +0x0020,0x0167,0x0000, 0x0020,0x0167,0x0000, 0x0020,0x0167,0x0000, /* 0A66 */ +0x0020,0x0167,0x0000, 0x0020,0x0167,0x0000, 0x0020,0x0167,0x0000, /* 0A69 */ +0x0020,0x0167,0x0000, 0x0020,0x0167,0x0000, 0x0020,0x0167,0x0000, /* 0A6C */ +0x0020,0x0167,0x0000, 0x00E6,0x0000,0x0000, 0x00E7,0x0000,0x0000, /* 0A6F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0A72 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0A75 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0A78 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0A7B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0A7E */ +0x00E9,0x0000,0x0000, 0x00EA,0x0000,0x0000, 0x00EB,0x0000,0x0000, /* 0A81 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0A84 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0A87 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0A8A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0A8D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0A90 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0A93 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0A96 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0A99 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0A9C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0A9F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0AA2 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0AA5 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0AA8 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0AAB */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0AAE */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0AB1 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0AB4 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0AB7 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x00E8,0x0000,0x0000, /* 0ABA */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0ABD */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0AC0 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0AC3 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0AC6 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0AC9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0ACC */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0ACF */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0AD2 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0AD5 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0AD8 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0ADB */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0ADE */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0AE1 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0168,0x0000, /* 0AE4 */ +0x0020,0x0168,0x0000, 0x0020,0x0168,0x0000, 0x0020,0x0168,0x0000, /* 0AE7 */ +0x0020,0x0168,0x0000, 0x0020,0x0168,0x0000, 0x0020,0x0168,0x0000, /* 0AEA */ +0x0020,0x0168,0x0000, 0x0020,0x0168,0x0000, 0x0020,0x0168,0x0000, /* 0AED */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0AF0 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0AF3 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0AF6 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0AF9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0AFC */ +0x0020,0x0000,0x0000 }; + +static const uint16 uca520_p00B_w2[]= { /* 0B00 (3 weights per char) */ +0x0020,0x0000,0x0000, 0x00ED,0x0000,0x0000, 0x00EE,0x0000,0x0000, /* 0B00 */ +0x00EF,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0B03 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0B06 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0B09 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0B0C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0B0F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0B12 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0B15 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0B18 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0B1B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0B1E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0B21 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0B24 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0B27 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0B2A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0B2D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0B30 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0B33 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0B36 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0B39 */ +0x00EC,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0B3C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0B3F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0B42 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0B45 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0B48 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0B4B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0B4E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0B51 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0B54 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0B57 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x00EC,0x0000, /* 0B5A */ +0x0020,0x00EC,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0B5D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0B60 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0B63 */ +0x0020,0x0169,0x0000, 0x0020,0x0169,0x0000, 0x0020,0x0169,0x0000, /* 0B66 */ +0x0020,0x0169,0x0000, 0x0020,0x0169,0x0000, 0x0020,0x0169,0x0000, /* 0B69 */ +0x0020,0x0169,0x0000, 0x0020,0x0169,0x0000, 0x0020,0x0169,0x0000, /* 0B6C */ +0x0020,0x0169,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0B6F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0B72 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0B75 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0B78 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0B7B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0B7E */ +0x0020,0x0000,0x0000, 0x00F0,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0B81 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0B84 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0B87 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0B8A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0B8D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0B90 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0B93 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0B96 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0B99 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0B9C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0B9F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0BA2 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0BA5 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0BA8 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0BAB */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0BAE */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0BB1 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0BB4 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0BB7 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0BBA */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0BBD */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0BC0 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0BC3 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0BC6 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0BC9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0BCC */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0BCF */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0BD2 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0BD5 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0BD8 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0BDB */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0BDE */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0BE1 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x016A,0x0000, /* 0BE4 */ +0x0020,0x016A,0x0000, 0x0020,0x016A,0x0000, 0x0020,0x016A,0x0000, /* 0BE7 */ +0x0020,0x016A,0x0000, 0x0020,0x016A,0x0000, 0x0020,0x016A,0x0000, /* 0BEA */ +0x0020,0x016A,0x0000, 0x0020,0x016A,0x0000, 0x0020,0x016A,0x0000, /* 0BED */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0BF0 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0BF3 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0BF6 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0BF9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0BFC */ +0x0020,0x0000,0x0000 }; + +static const uint16 uca520_p00C_w2[]= { /* 0C00 (3 weights per char) */ +0x0020,0x0000,0x0000, 0x00F1,0x0000,0x0000, 0x00F2,0x0000,0x0000, /* 0C00 */ +0x00F3,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0C03 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0C06 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0C09 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0C0C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0C0F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0C12 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0C15 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0C18 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0C1B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0C1E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0C21 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0C24 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0C27 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0C2A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0C2D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0C30 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0C33 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0C36 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0C39 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0C3C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0C3F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0C42 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0C45 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0C48 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0C4B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0C4E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0C51 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0C54 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0C57 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0C5A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0C5D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0C60 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0C63 */ +0x0020,0x016B,0x0000, 0x0020,0x016B,0x0000, 0x0020,0x016B,0x0000, /* 0C66 */ +0x0020,0x016B,0x0000, 0x0020,0x016B,0x0000, 0x0020,0x016B,0x0000, /* 0C69 */ +0x0020,0x016B,0x0000, 0x0020,0x016B,0x0000, 0x0020,0x016B,0x0000, /* 0C6C */ +0x0020,0x016B,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0C6F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0C72 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0C75 */ +0x0020,0x016B,0x0000, 0x0020,0x016B,0x0000, 0x0020,0x016B,0x0000, /* 0C78 */ +0x0020,0x016B,0x0000, 0x0020,0x016B,0x0000, 0x0020,0x016B,0x0000, /* 0C7B */ +0x0020,0x016B,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0C7E */ +0x0020,0x0000,0x0000, 0x00F5,0x0000,0x0000, 0x00F6,0x0000,0x0000, /* 0C81 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0C84 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0C87 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0C8A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0C8D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0C90 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0C93 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0C96 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0C99 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0C9C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0C9F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0CA2 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0CA5 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0CA8 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0CAB */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0CAE */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0CB1 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0CB4 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0CB7 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x00F4,0x0000,0x0000, /* 0CBA */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0CBD */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0CC0 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0CC3 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0CC6 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0CC9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0CCC */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0CCF */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0CD2 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0CD5 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0CD8 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0CDB */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0CDE */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0CE1 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x016C,0x0000, /* 0CE4 */ +0x0020,0x016C,0x0000, 0x0020,0x016C,0x0000, 0x0020,0x016C,0x0000, /* 0CE7 */ +0x0020,0x016C,0x0000, 0x0020,0x016C,0x0000, 0x0020,0x016C,0x0000, /* 0CEA */ +0x0020,0x016C,0x0000, 0x0020,0x016C,0x0000, 0x0020,0x016C,0x0000, /* 0CED */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0CF0 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0CF3 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0CF6 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0CF9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0CFC */ +0x0020,0x0000,0x0000 }; + +static const uint16 uca520_p00D_w2[]= { /* 0D00 (3 weights per char) */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x00F7,0x0000,0x0000, /* 0D00 */ +0x00F8,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0D03 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0D06 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0D09 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0D0C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0D0F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0D12 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0D15 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0D18 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0D1B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0D1E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0D21 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0D24 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0D27 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0D2A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0D2D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0D30 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0D33 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0D36 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0D39 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0D3C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0D3F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0D42 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0D45 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0D48 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0D4B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0D4E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0D51 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0D54 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0D57 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0D5A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0D5D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0D60 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0D63 */ +0x0020,0x016D,0x0000, 0x0020,0x016D,0x0000, 0x0020,0x016D,0x0000, /* 0D66 */ +0x0020,0x016D,0x0000, 0x0020,0x016D,0x0000, 0x0020,0x016D,0x0000, /* 0D69 */ +0x0020,0x016D,0x0000, 0x0020,0x016D,0x0000, 0x0020,0x016D,0x0000, /* 0D6C */ +0x0020,0x016D,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0D6F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0D72 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0D75 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0020,0x0000, /* 0D78 */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* 0D7B */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0000,0x0000, /* 0D7E */ +0x0020,0x0000,0x0000, 0x00F9,0x0000,0x0000, 0x00FA,0x0000,0x0000, /* 0D81 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0D84 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0D87 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0D8A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0D8D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0D90 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0D93 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0D96 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0D99 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0D9C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0D9F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0DA2 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0DA5 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0DA8 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0DAB */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0DAE */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0DB1 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0DB4 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0DB7 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0DBA */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0DBD */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0DC0 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0DC3 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0DC6 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0DC9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0DCC */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0DCF */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0DD2 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0DD5 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0DD8 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0DDB */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0DDE */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0DE1 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0DE4 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0DE7 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0DEA */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0DED */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0DF0 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0DF3 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0DF6 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0DF9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0DFC */ +0x0020,0x0000,0x0000 }; + +static const uint16 uca520_p00E_w2[]= { /* 0E00 (3 weights per char) */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0E00 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0E03 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0E06 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0E09 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0E0C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0E0F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0E12 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0E15 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0E18 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0E1B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0E1E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0E21 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0E24 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0E27 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0E2A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0E2D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0E30 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0E33 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0E36 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0E39 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0E3C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0E3F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0E42 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0117,0x0000,0x0000, /* 0E45 */ +0x0118,0x0000,0x0000, 0x0119,0x0000,0x0000, 0x011A,0x0000,0x0000, /* 0E48 */ +0x011B,0x0000,0x0000, 0x011C,0x0000,0x0000, 0x011D,0x0000,0x0000, /* 0E4B */ +0x0116,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0175,0x0000, /* 0E4E */ +0x0020,0x0175,0x0000, 0x0020,0x0175,0x0000, 0x0020,0x0175,0x0000, /* 0E51 */ +0x0020,0x0175,0x0000, 0x0020,0x0175,0x0000, 0x0020,0x0175,0x0000, /* 0E54 */ +0x0020,0x0175,0x0000, 0x0020,0x0175,0x0000, 0x0020,0x0175,0x0000, /* 0E57 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0E5A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0E5D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0E60 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0E63 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0E66 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0E69 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0E6C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0E6F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0E72 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0E75 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0E78 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0E7B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0E7E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0E81 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0E84 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0E87 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0E8A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0E8D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0E90 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0E93 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0E96 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0E99 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0E9C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0E9F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0EA2 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0EA5 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0EA8 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0EAB */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0EAE */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0EB1 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0EB4 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0EB7 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0EBA */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0EBD */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0EC0 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0EC3 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x011E,0x0000,0x0000, /* 0EC6 */ +0x011F,0x0000,0x0000, 0x0120,0x0000,0x0000, 0x0121,0x0000,0x0000, /* 0EC9 */ +0x0122,0x0000,0x0000, 0x0123,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0ECC */ +0x0020,0x0000,0x0000, 0x0020,0x0176,0x0000, 0x0020,0x0176,0x0000, /* 0ECF */ +0x0020,0x0176,0x0000, 0x0020,0x0176,0x0000, 0x0020,0x0176,0x0000, /* 0ED2 */ +0x0020,0x0176,0x0000, 0x0020,0x0176,0x0000, 0x0020,0x0176,0x0000, /* 0ED5 */ +0x0020,0x0176,0x0000, 0x0020,0x0176,0x0000, 0x0020,0x0000,0x0000, /* 0ED8 */ +0x0020,0x0000,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* 0EDB */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0EDE */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0EE1 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0EE4 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0EE7 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0EEA */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0EED */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0EF0 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0EF3 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0EF6 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0EF9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 0EFC */ +0x0020,0x0000,0x0000 }; + +static const uint16 uca520_p00F_w2[]= { /* 0F00 (4 weights per char) */ +0x0020,0x0020,0x0127,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0F00 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0F02 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0F04 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0F06 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0F08 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0F0A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0F0C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0F0E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0F10 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0F12 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0F14 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0F16 */ +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, /* 0F18 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0F1A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0F1C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0F1E */ +0x0020,0x0177,0x0000,0x0000, 0x0020,0x0177,0x0000,0x0000, /* 0F20 */ +0x0020,0x0177,0x0000,0x0000, 0x0020,0x0177,0x0000,0x0000, /* 0F22 */ +0x0020,0x0177,0x0000,0x0000, 0x0020,0x0177,0x0000,0x0000, /* 0F24 */ +0x0020,0x0177,0x0000,0x0000, 0x0020,0x0177,0x0000,0x0000, /* 0F26 */ +0x0020,0x0177,0x0000,0x0000, 0x0020,0x0177,0x0000,0x0000, /* 0F28 */ +0x0020,0x0177,0x0000,0x0000, 0x0020,0x0177,0x0000,0x0000, /* 0F2A */ +0x0020,0x0177,0x0000,0x0000, 0x0020,0x0177,0x0000,0x0000, /* 0F2C */ +0x0020,0x0177,0x0000,0x0000, 0x0020,0x0177,0x0000,0x0000, /* 0F2E */ +0x0020,0x0177,0x0000,0x0000, 0x0020,0x0177,0x0000,0x0000, /* 0F30 */ +0x0020,0x0177,0x0000,0x0000, 0x0020,0x0177,0x0000,0x0000, /* 0F32 */ +0x0020,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, /* 0F34 */ +0x0020,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, /* 0F36 */ +0x0020,0x0000,0x0000,0x0000, 0x0126,0x0000,0x0000,0x0000, /* 0F38 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0F3A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0F3C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0F3E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0F40 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0020,0x0000,0x0000, /* 0F42 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0F44 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0F46 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0F48 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0F4A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0020,0x0000,0x0000, /* 0F4C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0F4E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0F50 */ +0x0020,0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0F52 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0F54 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0020,0x0000,0x0000, /* 0F56 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0F58 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0F5A */ +0x0020,0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0F5C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0F5E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0F60 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0F62 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0F64 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0F66 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0020,0x0000,0x0000, /* 0F68 */ +0x0020,0x015A,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0F6A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0F6C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0F6E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0F70 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0F72 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0F74 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0F76 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0F78 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0F7A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0F7C */ +0x0127,0x0000,0x0000,0x0000, 0x0128,0x0000,0x0000,0x0000, /* 0F7E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0F80 */ +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, /* 0F82 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0F84 */ +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, /* 0F86 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0F88 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0F8A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0F8C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0F8E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0F90 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0020,0x0000,0x0000, /* 0F92 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0F94 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0F96 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0F98 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0F9A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0020,0x0000,0x0000, /* 0F9C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0F9E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0FA0 */ +0x0020,0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0FA2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0FA4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0020,0x0000,0x0000, /* 0FA6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0FA8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0FAA */ +0x0020,0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0FAC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0FAE */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0FB0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0FB2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0FB4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0FB6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0020,0x0000,0x0000, /* 0FB8 */ +0x0020,0x015A,0x0000,0x0000, 0x0020,0x015A,0x0000,0x0000, /* 0FBA */ +0x0020,0x015A,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0FBC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0FBE */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0FC0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0FC2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0FC4 */ +0x0000,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0FC6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0FC8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0FCA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0FCC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0FCE */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0FD0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0FD2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0FD4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0FD6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0FD8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0FDA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0FDC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0FDE */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0FE0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0FE2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0FE4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0FE6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0FE8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0FEA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0FEC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0FEE */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0FF0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0FF2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0FF4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0FF6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0FF8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0FFA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 0FFC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000 /* 0FFE */ +}; + +static const uint16 uca520_p010_w2[]= { /* 1000 (4 weights per char) */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1000 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1002 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1004 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1006 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1008 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 100A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 100C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 100E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1010 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1012 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1014 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1016 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1018 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 101A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 101C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 101E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1020 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1022 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1024 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1026 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1028 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 102A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 102C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 102E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1030 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1032 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1034 */ +0x012D,0x0000,0x0000,0x0000, 0x012E,0x0000,0x0000,0x0000, /* 1036 */ +0x012F,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1038 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 103A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 103C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0020,0x0020,0x0000, /* 103E */ +0x0020,0x017A,0x0000,0x0000, 0x0020,0x017A,0x0000,0x0000, /* 1040 */ +0x0020,0x017A,0x0000,0x0000, 0x0020,0x017A,0x0000,0x0000, /* 1042 */ +0x0020,0x017A,0x0000,0x0000, 0x0020,0x017A,0x0000,0x0000, /* 1044 */ +0x0020,0x017A,0x0000,0x0000, 0x0020,0x017A,0x0000,0x0000, /* 1046 */ +0x0020,0x017A,0x0000,0x0000, 0x0020,0x017A,0x0000,0x0000, /* 1048 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 104A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 104C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 104E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1050 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1052 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1054 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1056 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1058 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 105A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 105C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 105E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1060 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1062 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1064 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1066 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1068 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 106A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 106C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 106E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1070 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1072 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1074 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1076 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1078 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 107A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 107C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 107E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1080 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1082 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1084 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1086 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1088 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 108A */ +0x0020,0x0000,0x0000,0x0000, 0x0130,0x0000,0x0000,0x0000, /* 108C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 108E */ +0x0020,0x017B,0x0000,0x0000, 0x0020,0x017B,0x0000,0x0000, /* 1090 */ +0x0020,0x017B,0x0000,0x0000, 0x0020,0x017B,0x0000,0x0000, /* 1092 */ +0x0020,0x017B,0x0000,0x0000, 0x0020,0x017B,0x0000,0x0000, /* 1094 */ +0x0020,0x017B,0x0000,0x0000, 0x0020,0x017B,0x0000,0x0000, /* 1096 */ +0x0020,0x017B,0x0000,0x0000, 0x0020,0x017B,0x0000,0x0000, /* 1098 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 109A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 109C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 109E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 10A0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 10A2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 10A4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 10A6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 10A8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 10AA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 10AC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 10AE */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 10B0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 10B2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 10B4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 10B6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 10B8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 10BA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 10BC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 10BE */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 10C0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 10C2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 10C4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 10C6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 10C8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 10CA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 10CC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 10CE */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 10D0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 10D2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 10D4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 10D6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 10D8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 10DA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 10DC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 10DE */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 10E0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 10E2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 10E4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 10E6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 10E8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 10EA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 10EC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 10EE */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 10F0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 10F2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 10F4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 10F6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 10F8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 10FA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 10FC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000 /* 10FE */ +}; + +static const uint16 uca520_p013_w2[]= { /* 1300 (3 weights per char) */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1300 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1303 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1306 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1309 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 130C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 130F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1312 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1315 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1318 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 131B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 131E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1321 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1324 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1327 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 132A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 132D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1330 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1333 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1336 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1339 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 133C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 133F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1342 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1345 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1348 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 134B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 134E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1351 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1354 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1357 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 135A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x00D7,0x0000,0x0000, /* 135D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1360 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1363 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1366 */ +0x0020,0x0163,0x0000, 0x0020,0x0163,0x0000, 0x0020,0x0163,0x0000, /* 1369 */ +0x0020,0x0163,0x0000, 0x0020,0x0163,0x0000, 0x0020,0x0163,0x0000, /* 136C */ +0x0020,0x0163,0x0000, 0x0020,0x0163,0x0000, 0x0020,0x0163,0x0000, /* 136F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1372 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1375 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1378 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 137B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 137E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1381 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1384 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1387 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 138A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 138D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1390 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1393 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1396 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1399 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 139C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 139F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 13A2 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 13A5 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 13A8 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 13AB */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 13AE */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 13B1 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 13B4 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 13B7 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 13BA */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 13BD */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 13C0 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 13C3 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 13C6 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 13C9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 13CC */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 13CF */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 13D2 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 13D5 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 13D8 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 13DB */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 13DE */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 13E1 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 13E4 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 13E7 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 13EA */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 13ED */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 13F0 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 13F3 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 13F6 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 13F9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 13FC */ +0x0020,0x0000,0x0000 }; + +static const uint16 uca520_p016_w2[]= { /* 1600 (5 weights per char) */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1600 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1601 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1602 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1603 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1604 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1605 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1606 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1607 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1608 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1609 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 160A */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 160B */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 160C */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 160D */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 160E */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 160F */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1610 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1611 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1612 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1613 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1614 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1615 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1616 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1617 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1618 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1619 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 161A */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 161B */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 161C */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 161D */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 161E */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 161F */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1620 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1621 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1622 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1623 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1624 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1625 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1626 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1627 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1628 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1629 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 162A */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 162B */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 162C */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 162D */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 162E */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 162F */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1630 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1631 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1632 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1633 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1634 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1635 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1636 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1637 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1638 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1639 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 163A */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 163B */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 163C */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 163D */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 163E */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 163F */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1640 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1641 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1642 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1643 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1644 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1645 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1646 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1647 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1648 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1649 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 164A */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 164B */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 164C */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 164D */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 164E */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 164F */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1650 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1651 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1652 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1653 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1654 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1655 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1656 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1657 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1658 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1659 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 165A */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 165B */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 165C */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 165D */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 165E */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 165F */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1660 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1661 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1662 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1663 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1664 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1665 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1666 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1667 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1668 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1669 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 166A */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 166B */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 166C */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 166D */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 166E */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 166F */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1670 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1671 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1672 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1673 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1674 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1675 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1676 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1677 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1678 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1679 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 167A */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 167B */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 167C */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 167D */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 167E */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 167F */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1680 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1681 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1682 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1683 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1684 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1685 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1686 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1687 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1688 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1689 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 168A */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 168B */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 168C */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 168D */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 168E */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 168F */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1690 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1691 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1692 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1693 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1694 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1695 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1696 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1697 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1698 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1699 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 169A */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 169B */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 169C */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 169D */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 169E */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 169F */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 16A0 */ +0x0020,0x0159,0x0000,0x0000,0x0000, /* 16A1 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 16A2 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 16A3 */ +0x0020,0x0159,0x0000,0x0000,0x0000, /* 16A4 */ +0x0020,0x015A,0x0000,0x0000,0x0000, /* 16A5 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 16A6 */ +0x0020,0x0159,0x0000,0x0000,0x0000, /* 16A7 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 16A8 */ +0x0020,0x0159,0x0000,0x0000,0x0000, /* 16A9 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 16AA */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 16AB */ +0x0020,0x015A,0x0000,0x0000,0x0000, /* 16AC */ +0x0020,0x015C,0x0000,0x0000,0x0000, /* 16AD */ +0x0020,0x015D,0x0000,0x0000,0x0000, /* 16AE */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 16AF */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 16B0 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 16B1 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 16B2 */ +0x0020,0x0159,0x0000,0x0000,0x0000, /* 16B3 */ +0x0020,0x015A,0x0000,0x0000,0x0000, /* 16B4 */ +0x0020,0x015C,0x0000,0x0000,0x0000, /* 16B5 */ +0x0020,0x015D,0x0000,0x0000,0x0000, /* 16B6 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 16B7 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 16B8 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 16B9 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 16BA */ +0x0020,0x0159,0x0000,0x0000,0x0000, /* 16BB */ +0x0020,0x015A,0x0000,0x0000,0x0000, /* 16BC */ +0x0020,0x015C,0x0000,0x0000,0x0000, /* 16BD */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 16BE */ +0x0020,0x0159,0x0000,0x0000,0x0000, /* 16BF */ +0x0020,0x015A,0x0000,0x0000,0x0000, /* 16C0 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 16C1 */ +0x0020,0x0159,0x0000,0x0000,0x0000, /* 16C2 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 16C3 */ +0x0020,0x0159,0x0000,0x0000,0x0000, /* 16C4 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 16C5 */ +0x0020,0x0159,0x0000,0x0000,0x0000, /* 16C6 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 16C7 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 16C8 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 16C9 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 16CA */ +0x0020,0x0159,0x0000,0x0000,0x0000, /* 16CB */ +0x0020,0x015C,0x0000,0x0000,0x0000, /* 16CC */ +0x0020,0x015D,0x0000,0x0000,0x0000, /* 16CD */ +0x0020,0x015E,0x0000,0x0000,0x0000, /* 16CE */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 16CF */ +0x0020,0x0159,0x0000,0x0000,0x0000, /* 16D0 */ +0x0020,0x015A,0x0000,0x0000,0x0000, /* 16D1 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 16D2 */ +0x0020,0x0159,0x0000,0x0000,0x0000, /* 16D3 */ +0x0020,0x015A,0x0000,0x0000,0x0000, /* 16D4 */ +0x0020,0x0159,0x0000,0x0000,0x0000, /* 16D5 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 16D6 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 16D7 */ +0x0020,0x0159,0x0000,0x0000,0x0000, /* 16D8 */ +0x0020,0x015A,0x0000,0x0000,0x0000, /* 16D9 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 16DA */ +0x0020,0x0159,0x0000,0x0000,0x0000, /* 16DB */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 16DC */ +0x0020,0x0159,0x0000,0x0000,0x0000, /* 16DD */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 16DE */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 16DF */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 16E0 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 16E1 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 16E2 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 16E3 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 16E4 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 16E5 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 16E6 */ +0x0020,0x0159,0x0000,0x0000,0x0000, /* 16E7 */ +0x0020,0x015A,0x0000,0x0000,0x0000, /* 16E8 */ +0x0020,0x0159,0x0000,0x0000,0x0000, /* 16E9 */ +0x0020,0x015A,0x0000,0x0000,0x0000, /* 16EA */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 16EB */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 16EC */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 16ED */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 16EE */ +0x0020,0x0159,0x0020,0x0159,0x0000, /* 16EF */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 16F0 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 16F1 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 16F2 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 16F3 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 16F4 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 16F5 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 16F6 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 16F7 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 16F8 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 16F9 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 16FA */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 16FB */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 16FC */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 16FD */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 16FE */ +0x0020,0x0000,0x0000,0x0000,0x0000 /* 16FF */ +}; + +static const uint16 uca520_p017_w2[]= { /* 1700 (3 weights per char) */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1700 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1703 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1706 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1709 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 170C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 170F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1712 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1715 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1718 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 171B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 171E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1721 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1724 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1727 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 172A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 172D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1730 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1733 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1736 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1739 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 173C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 173F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1742 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1745 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1748 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 174B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 174E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1751 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1754 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1757 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 175A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 175D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1760 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1763 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1766 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1769 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 176C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 176F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1772 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1775 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1778 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 177B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 177E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1781 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1784 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1787 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 178A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 178D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1790 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1793 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1796 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1799 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 179C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 179F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 17A2 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 17A5 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 17A8 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 17AB */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 17AE */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 17B1 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 17B4 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 17B7 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 17BA */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 17BD */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 17C0 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 17C3 */ +0x0131,0x0000,0x0000, 0x0132,0x0000,0x0000, 0x0133,0x0000,0x0000, /* 17C6 */ +0x0134,0x0000,0x0000, 0x0135,0x0000,0x0000, 0x005F,0x0000,0x0000, /* 17C9 */ +0x005F,0x0000,0x0000, 0x005F,0x0000,0x0000, 0x005F,0x0000,0x0000, /* 17CC */ +0x005F,0x0000,0x0000, 0x005F,0x0000,0x0000, 0x005F,0x0000,0x0000, /* 17CF */ +0x0020,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 17D2 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 17D5 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 17D8 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x005F,0x0000,0x0000, /* 17DB */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x017C,0x0000, /* 17DE */ +0x0020,0x017C,0x0000, 0x0020,0x017C,0x0000, 0x0020,0x017C,0x0000, /* 17E1 */ +0x0020,0x017C,0x0000, 0x0020,0x017C,0x0000, 0x0020,0x017C,0x0000, /* 17E4 */ +0x0020,0x017C,0x0000, 0x0020,0x017C,0x0000, 0x0020,0x017C,0x0000, /* 17E7 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 17EA */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 17ED */ +0x0020,0x017D,0x0000, 0x0020,0x017D,0x0000, 0x0020,0x017D,0x0000, /* 17F0 */ +0x0020,0x017D,0x0000, 0x0020,0x017D,0x0000, 0x0020,0x017D,0x0000, /* 17F3 */ +0x0020,0x017D,0x0000, 0x0020,0x017D,0x0000, 0x0020,0x017D,0x0000, /* 17F6 */ +0x0020,0x017D,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 17F9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 17FC */ +0x0020,0x0000,0x0000 }; + +static const uint16 uca520_p018_w2[]= { /* 1800 (3 weights per char) */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1800 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1803 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1806 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0000,0x0000,0x0000, /* 1809 */ +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 180C */ +0x0020,0x0000,0x0000, 0x0020,0x0182,0x0000, 0x0020,0x0182,0x0000, /* 180F */ +0x0020,0x0182,0x0000, 0x0020,0x0182,0x0000, 0x0020,0x0182,0x0000, /* 1812 */ +0x0020,0x0182,0x0000, 0x0020,0x0182,0x0000, 0x0020,0x0182,0x0000, /* 1815 */ +0x0020,0x0182,0x0000, 0x0020,0x0182,0x0000, 0x0020,0x0000,0x0000, /* 1818 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 181B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 181E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1821 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1824 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1827 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 182A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 182D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1830 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1833 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1836 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1839 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 183C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 183F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1842 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1845 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1848 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 184B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 184E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1851 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1854 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1857 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 185A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 185D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1860 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1863 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1866 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1869 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 186C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 186F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1872 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1875 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1878 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 187B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 187E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1881 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1884 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1887 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 188A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 188D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1890 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1893 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1896 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1899 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 189C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 189F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 18A2 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 18A5 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 18A8 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 18AB */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 18AE */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 18B1 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 18B4 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 18B7 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 18BA */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 18BD */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 18C0 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 18C3 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 18C6 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 18C9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 18CC */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 18CF */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 18D2 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 18D5 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 18D8 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 18DB */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 18DE */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 18E1 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 18E4 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 18E7 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 18EA */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 18ED */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 18F0 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 18F3 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 18F6 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 18F9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 18FC */ +0x0020,0x0000,0x0000 }; + +static const uint16 uca520_p019_w2[]= { /* 1900 (4 weights per char) */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1900 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1902 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1904 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1906 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1908 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 190A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 190C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 190E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1910 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1912 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1914 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1916 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1918 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 191A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 191C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 191E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1920 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1922 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1924 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1926 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1928 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 192A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 192C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 192E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1930 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1932 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1934 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1936 */ +0x0020,0x0000,0x0000,0x0000, 0x013F,0x0000,0x0000,0x0000, /* 1938 */ +0x0140,0x0000,0x0000,0x0000, 0x0141,0x0000,0x0000,0x0000, /* 193A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 193C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 193E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1940 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1942 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1944 */ +0x0020,0x0170,0x0000,0x0000, 0x0020,0x0170,0x0000,0x0000, /* 1946 */ +0x0020,0x0170,0x0000,0x0000, 0x0020,0x0170,0x0000,0x0000, /* 1948 */ +0x0020,0x0170,0x0000,0x0000, 0x0020,0x0170,0x0000,0x0000, /* 194A */ +0x0020,0x0170,0x0000,0x0000, 0x0020,0x0170,0x0000,0x0000, /* 194C */ +0x0020,0x0170,0x0000,0x0000, 0x0020,0x0170,0x0000,0x0000, /* 194E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1950 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1952 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1954 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1956 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1958 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 195A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 195C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 195E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1960 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1962 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1964 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1966 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1968 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 196A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 196C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 196E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1970 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1972 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1974 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1976 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1978 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 197A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 197C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 197E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1980 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1982 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1984 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1986 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1988 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 198A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 198C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 198E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1990 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1992 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1994 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1996 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1998 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 199A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 199C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 199E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 19A0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 19A2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 19A4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 19A6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 19A8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 19AA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 19AC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 19AE */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 19B0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 19B2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 19B4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 19B6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 19B8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 19BA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 19BC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 19BE */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 19C0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 19C2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 19C4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 19C6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 19C8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 19CA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 19CC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 19CE */ +0x0020,0x0171,0x0000,0x0000, 0x0020,0x0171,0x0000,0x0000, /* 19D0 */ +0x0020,0x0171,0x0000,0x0000, 0x0020,0x0171,0x0000,0x0000, /* 19D2 */ +0x0020,0x0171,0x0000,0x0000, 0x0020,0x0171,0x0000,0x0000, /* 19D4 */ +0x0020,0x0171,0x0000,0x0000, 0x0020,0x0171,0x0000,0x0000, /* 19D6 */ +0x0020,0x0171,0x0000,0x0000, 0x0020,0x0171,0x0000,0x0000, /* 19D8 */ +0x0020,0x0172,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 19DA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 19DC */ +0x0020,0x0020,0x0000,0x0000, 0x0020,0x0020,0x0020,0x0000, /* 19DE */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 19E0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 19E2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 19E4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 19E6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 19E8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 19EA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 19EC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 19EE */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 19F0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 19F2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 19F4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 19F6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 19F8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 19FA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 19FC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000 /* 19FE */ +}; + +static const uint16 uca520_p01A_w2[]= { /* 1A00 (4 weights per char) */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1A00 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1A02 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1A04 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1A06 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1A08 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1A0A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1A0C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1A0E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1A10 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1A12 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1A14 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1A16 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1A18 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1A1A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1A1C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1A1E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1A20 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1A22 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1A24 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1A26 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1A28 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1A2A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1A2C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1A2E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1A30 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1A32 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1A34 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1A36 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1A38 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1A3A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1A3C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1A3E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1A40 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1A42 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1A44 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1A46 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1A48 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1A4A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1A4C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1A4E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1A50 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1A52 */ +0x0020,0x0020,0x0020,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1A54 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1A56 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1A58 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1A5A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1A5C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1A5E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1A60 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1A62 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1A64 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1A66 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1A68 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1A6A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1A6C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1A6E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1A70 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1A72 */ +0x0136,0x0000,0x0000,0x0000, 0x0137,0x0000,0x0000,0x0000, /* 1A74 */ +0x0138,0x0000,0x0000,0x0000, 0x0139,0x0000,0x0000,0x0000, /* 1A76 */ +0x013A,0x0000,0x0000,0x0000, 0x013B,0x0000,0x0000,0x0000, /* 1A78 */ +0x013C,0x0000,0x0000,0x0000, 0x013D,0x0000,0x0000,0x0000, /* 1A7A */ +0x013E,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1A7C */ +0x0020,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, /* 1A7E */ +0x0020,0x0173,0x0000,0x0000, 0x0020,0x0173,0x0000,0x0000, /* 1A80 */ +0x0020,0x0173,0x0000,0x0000, 0x0020,0x0173,0x0000,0x0000, /* 1A82 */ +0x0020,0x0173,0x0000,0x0000, 0x0020,0x0173,0x0000,0x0000, /* 1A84 */ +0x0020,0x0173,0x0000,0x0000, 0x0020,0x0173,0x0000,0x0000, /* 1A86 */ +0x0020,0x0173,0x0000,0x0000, 0x0020,0x0173,0x0000,0x0000, /* 1A88 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1A8A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1A8C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1A8E */ +0x0020,0x0174,0x0000,0x0000, 0x0020,0x0174,0x0000,0x0000, /* 1A90 */ +0x0020,0x0174,0x0000,0x0000, 0x0020,0x0174,0x0000,0x0000, /* 1A92 */ +0x0020,0x0174,0x0000,0x0000, 0x0020,0x0174,0x0000,0x0000, /* 1A94 */ +0x0020,0x0174,0x0000,0x0000, 0x0020,0x0174,0x0000,0x0000, /* 1A96 */ +0x0020,0x0174,0x0000,0x0000, 0x0020,0x0174,0x0000,0x0000, /* 1A98 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1A9A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1A9C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1A9E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1AA0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1AA2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1AA4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1AA6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1AA8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1AAA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1AAC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1AAE */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1AB0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1AB2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1AB4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1AB6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1AB8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1ABA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1ABC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1ABE */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1AC0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1AC2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1AC4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1AC6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1AC8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1ACA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1ACC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1ACE */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1AD0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1AD2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1AD4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1AD6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1AD8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1ADA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1ADC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1ADE */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1AE0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1AE2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1AE4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1AE6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1AE8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1AEA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1AEC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1AEE */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1AF0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1AF2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1AF4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1AF6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1AF8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1AFA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1AFC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000 /* 1AFE */ +}; + +static const uint16 uca520_p01B_w2[]= { /* 1B00 (3 weights per char) */ +0x00FC,0x0000,0x0000, 0x00FD,0x0000,0x0000, 0x00FE,0x0000,0x0000, /* 1B00 */ +0x00FF,0x0000,0x0000, 0x0100,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1B03 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1B06 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1B09 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1B0C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1B0F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1B12 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1B15 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1B18 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1B1B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1B1E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1B21 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1B24 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1B27 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1B2A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1B2D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1B30 */ +0x0020,0x0000,0x0000, 0x00FB,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1B33 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1B36 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1B39 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1B3C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1B3F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1B42 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1B45 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1B48 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1B4B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x017F,0x0000, /* 1B4E */ +0x0020,0x017F,0x0000, 0x0020,0x017F,0x0000, 0x0020,0x017F,0x0000, /* 1B51 */ +0x0020,0x017F,0x0000, 0x0020,0x017F,0x0000, 0x0020,0x017F,0x0000, /* 1B54 */ +0x0020,0x017F,0x0000, 0x0020,0x017F,0x0000, 0x0020,0x017F,0x0000, /* 1B57 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1B5A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1B5D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1B60 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1B63 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1B66 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0000,0x0000,0x0000, /* 1B69 */ +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, /* 1B6C */ +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, /* 1B6F */ +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1B72 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1B75 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1B78 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1B7B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0106,0x0000,0x0000, /* 1B7E */ +0x0107,0x0000,0x0000, 0x0108,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1B81 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1B84 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1B87 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1B8A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1B8D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1B90 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1B93 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1B96 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1B99 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1B9C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1B9F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1BA2 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1BA5 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1BA8 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1BAB */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0181,0x0000, /* 1BAE */ +0x0020,0x0181,0x0000, 0x0020,0x0181,0x0000, 0x0020,0x0181,0x0000, /* 1BB1 */ +0x0020,0x0181,0x0000, 0x0020,0x0181,0x0000, 0x0020,0x0181,0x0000, /* 1BB4 */ +0x0020,0x0181,0x0000, 0x0020,0x0181,0x0000, 0x0020,0x0181,0x0000, /* 1BB7 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1BBA */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1BBD */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1BC0 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1BC3 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1BC6 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1BC9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1BCC */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1BCF */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1BD2 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1BD5 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1BD8 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1BDB */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1BDE */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1BE1 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1BE4 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1BE7 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1BEA */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1BED */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1BF0 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1BF3 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1BF6 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1BF9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1BFC */ +0x0020,0x0000,0x0000 }; + +static const uint16 uca520_p01C_w2[]= { /* 1C00 (3 weights per char) */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1C00 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1C03 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1C06 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1C09 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1C0C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1C0F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1C12 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1C15 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1C18 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1C1B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1C1E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1C21 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1C24 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1C27 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1C2A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1C2D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1C30 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1C33 */ +0x0020,0x0000,0x0000, 0x0129,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1C36 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1C39 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1C3C */ +0x0020,0x0000,0x0000, 0x0020,0x0178,0x0000, 0x0020,0x0178,0x0000, /* 1C3F */ +0x0020,0x0178,0x0000, 0x0020,0x0178,0x0000, 0x0020,0x0178,0x0000, /* 1C42 */ +0x0020,0x0178,0x0000, 0x0020,0x0178,0x0000, 0x0020,0x0178,0x0000, /* 1C45 */ +0x0020,0x0178,0x0000, 0x0020,0x0178,0x0000, 0x0020,0x0000,0x0000, /* 1C48 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1C4B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0183,0x0000, /* 1C4E */ +0x0020,0x0183,0x0000, 0x0020,0x0183,0x0000, 0x0020,0x0183,0x0000, /* 1C51 */ +0x0020,0x0183,0x0000, 0x0020,0x0183,0x0000, 0x0020,0x0183,0x0000, /* 1C54 */ +0x0020,0x0183,0x0000, 0x0020,0x0183,0x0000, 0x0020,0x0183,0x0000, /* 1C57 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1C5A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1C5D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1C60 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1C63 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1C66 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1C69 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1C6C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1C6F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1C72 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1C75 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1C78 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1C7B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1C7E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1C81 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1C84 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1C87 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1C8A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1C8D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1C90 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1C93 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1C96 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1C99 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1C9C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1C9F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1CA2 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1CA5 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1CA8 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1CAB */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1CAE */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1CB1 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1CB4 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1CB7 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1CBA */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1CBD */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1CC0 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1CC3 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1CC6 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1CC9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1CCC */ +0x0020,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, /* 1CCF */ +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, /* 1CD2 */ +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, /* 1CD5 */ +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, /* 1CD8 */ +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, /* 1CDB */ +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, /* 1CDE */ +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, /* 1CE1 */ +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, /* 1CE4 */ +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1CE7 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1CEA */ +0x00DC,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1CED */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x00DD,0x0000,0x0000, /* 1CF0 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1CF3 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1CF6 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1CF9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1CFC */ +0x0020,0x0000,0x0000 }; + +static const uint16 uca520_p01D_w2[]= { /* 1D00 (4 weights per char) */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D00 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D02 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D04 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D06 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D08 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D0A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D0C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D0E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D10 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D12 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D14 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D16 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D18 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D1A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D1C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D1E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D20 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D22 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D24 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D26 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D28 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D2A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0159,0x0020,0x0000, /* 1D2C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D2E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D30 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D32 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D34 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D36 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D38 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D3A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D3C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D3E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D40 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D42 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D44 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D46 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D48 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D4A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D4C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D4E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D50 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D52 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D54 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D56 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D58 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D5A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D5C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D5E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D60 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D62 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D64 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D66 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D68 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D6A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D6C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D6E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D70 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D72 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D74 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D76 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x015A,0x0000,0x0000, /* 1D78 */ +0x0020,0x0159,0x0020,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D7A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D7C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D7E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D80 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D82 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D84 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D86 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D88 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D8A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D8C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D8E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D90 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D92 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D94 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D96 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D98 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D9A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D9C */ +0x0020,0x0159,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1D9E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1DA0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1DA2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1DA4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1DA6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1DA8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1DAA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1DAC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1DAE */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1DB0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1DB2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1DB4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1DB6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1DB8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1DBA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1DBC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1DBE */ +0x005F,0x0000,0x0000,0x0000, 0x005F,0x0000,0x0000,0x0000, /* 1DC0 */ +0x0060,0x0000,0x0000,0x0000, 0x005F,0x0000,0x0000,0x0000, /* 1DC2 */ +0x005F,0x0000,0x0000,0x0000, 0x005F,0x0000,0x0000,0x0000, /* 1DC4 */ +0x005F,0x0000,0x0000,0x0000, 0x005F,0x0000,0x0000,0x0000, /* 1DC6 */ +0x005F,0x0000,0x0000,0x0000, 0x005F,0x0000,0x0000,0x0000, /* 1DC8 */ +0x0020,0x0000,0x0000,0x0000, 0x005F,0x0000,0x0000,0x0000, /* 1DCA */ +0x005F,0x0000,0x0000,0x0000, 0x005F,0x0000,0x0000,0x0000, /* 1DCC */ +0x005F,0x0000,0x0000,0x0000, 0x0060,0x0000,0x0000,0x0000, /* 1DCE */ +0x0060,0x0000,0x0000,0x0000, 0x005F,0x0000,0x0000,0x0000, /* 1DD0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0159,0x0000,0x0000, /* 1DD2 */ +0x0020,0x0159,0x0020,0x0000, 0x0020,0x0020,0x0000,0x0000, /* 1DD4 */ +0x0020,0x0020,0x0000,0x0000, 0x0020,0x0056,0x0000,0x0000, /* 1DD6 */ +0x0020,0x015A,0x0000,0x0000, 0x0020,0x0159,0x0000,0x0000, /* 1DD8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1DDA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1DDC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1DDE */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1DE0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1DE2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x015A,0x0000,0x0000, /* 1DE4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1DE6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1DE8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1DEA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1DEC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1DEE */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1DF0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1DF2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1DF4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1DF6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1DF8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1DFA */ +0x0020,0x0000,0x0000,0x0000, 0x0060,0x0000,0x0000,0x0000, /* 1DFC */ +0x005F,0x0000,0x0000,0x0000, 0x0060,0x0000,0x0000,0x0000 /* 1DFE */ +}; + +static const uint16 uca520_p01E_w2[]= { /* 1E00 (4 weights per char) */ +0x0020,0x0076,0x0000,0x0000, 0x0020,0x0076,0x0000,0x0000, /* 1E00 */ +0x0020,0x0052,0x0000,0x0000, 0x0020,0x0052,0x0000,0x0000, /* 1E02 */ +0x0020,0x0070,0x0000,0x0000, 0x0020,0x0070,0x0000,0x0000, /* 1E04 */ +0x0020,0x007B,0x0000,0x0000, 0x0020,0x007B,0x0000,0x0000, /* 1E06 */ +0x0020,0x0056,0x0032,0x0000, 0x0020,0x0056,0x0032,0x0000, /* 1E08 */ +0x0020,0x0052,0x0000,0x0000, 0x0020,0x0052,0x0000,0x0000, /* 1E0A */ +0x0020,0x0070,0x0000,0x0000, 0x0020,0x0070,0x0000,0x0000, /* 1E0C */ +0x0020,0x007B,0x0000,0x0000, 0x0020,0x007B,0x0000,0x0000, /* 1E0E */ +0x0020,0x0056,0x0000,0x0000, 0x0020,0x0056,0x0000,0x0000, /* 1E10 */ +0x0020,0x0078,0x0000,0x0000, 0x0020,0x0078,0x0000,0x0000, /* 1E12 */ +0x0020,0x005B,0x0035,0x0000, 0x0020,0x005B,0x0035,0x0000, /* 1E14 */ +0x0020,0x005B,0x0032,0x0000, 0x0020,0x005B,0x0032,0x0000, /* 1E16 */ +0x0020,0x0078,0x0000,0x0000, 0x0020,0x0078,0x0000,0x0000, /* 1E18 */ +0x0020,0x007A,0x0000,0x0000, 0x0020,0x007A,0x0000,0x0000, /* 1E1A */ +0x0020,0x0056,0x0037,0x0000, 0x0020,0x0056,0x0037,0x0000, /* 1E1C */ +0x0020,0x0052,0x0000,0x0000, 0x0020,0x0052,0x0000,0x0000, /* 1E1E */ +0x0020,0x005B,0x0000,0x0000, 0x0020,0x005B,0x0000,0x0000, /* 1E20 */ +0x0020,0x0052,0x0000,0x0000, 0x0020,0x0052,0x0000,0x0000, /* 1E22 */ +0x0020,0x0070,0x0000,0x0000, 0x0020,0x0070,0x0000,0x0000, /* 1E24 */ +0x0020,0x0047,0x0000,0x0000, 0x0020,0x0047,0x0000,0x0000, /* 1E26 */ +0x0020,0x0056,0x0000,0x0000, 0x0020,0x0056,0x0000,0x0000, /* 1E28 */ +0x0020,0x0079,0x0000,0x0000, 0x0020,0x0079,0x0000,0x0000, /* 1E2A */ +0x0020,0x007A,0x0000,0x0000, 0x0020,0x007A,0x0000,0x0000, /* 1E2C */ +0x0020,0x0047,0x0032,0x0000, 0x0020,0x0047,0x0032,0x0000, /* 1E2E */ +0x0020,0x0032,0x0000,0x0000, 0x0020,0x0032,0x0000,0x0000, /* 1E30 */ +0x0020,0x0070,0x0000,0x0000, 0x0020,0x0070,0x0000,0x0000, /* 1E32 */ +0x0020,0x007B,0x0000,0x0000, 0x0020,0x007B,0x0000,0x0000, /* 1E34 */ +0x0020,0x0070,0x0000,0x0000, 0x0020,0x0070,0x0000,0x0000, /* 1E36 */ +0x0020,0x0070,0x005B,0x0000, 0x0020,0x0070,0x005B,0x0000, /* 1E38 */ +0x0020,0x007B,0x0000,0x0000, 0x0020,0x007B,0x0000,0x0000, /* 1E3A */ +0x0020,0x0078,0x0000,0x0000, 0x0020,0x0078,0x0000,0x0000, /* 1E3C */ +0x0020,0x0032,0x0000,0x0000, 0x0020,0x0032,0x0000,0x0000, /* 1E3E */ +0x0020,0x0052,0x0000,0x0000, 0x0020,0x0052,0x0000,0x0000, /* 1E40 */ +0x0020,0x0070,0x0000,0x0000, 0x0020,0x0070,0x0000,0x0000, /* 1E42 */ +0x0020,0x0052,0x0000,0x0000, 0x0020,0x0052,0x0000,0x0000, /* 1E44 */ +0x0020,0x0070,0x0000,0x0000, 0x0020,0x0070,0x0000,0x0000, /* 1E46 */ +0x0020,0x007B,0x0000,0x0000, 0x0020,0x007B,0x0000,0x0000, /* 1E48 */ +0x0020,0x0078,0x0000,0x0000, 0x0020,0x0078,0x0000,0x0000, /* 1E4A */ +0x0020,0x004E,0x0032,0x0000, 0x0020,0x004E,0x0032,0x0000, /* 1E4C */ +0x0020,0x004E,0x0047,0x0000, 0x0020,0x004E,0x0047,0x0000, /* 1E4E */ +0x0020,0x005B,0x0035,0x0000, 0x0020,0x005B,0x0035,0x0000, /* 1E50 */ +0x0020,0x005B,0x0032,0x0000, 0x0020,0x005B,0x0032,0x0000, /* 1E52 */ +0x0020,0x0032,0x0000,0x0000, 0x0020,0x0032,0x0000,0x0000, /* 1E54 */ +0x0020,0x0052,0x0000,0x0000, 0x0020,0x0052,0x0000,0x0000, /* 1E56 */ +0x0020,0x0052,0x0000,0x0000, 0x0020,0x0052,0x0000,0x0000, /* 1E58 */ +0x0020,0x0070,0x0000,0x0000, 0x0020,0x0070,0x0000,0x0000, /* 1E5A */ +0x0020,0x0070,0x005B,0x0000, 0x0020,0x0070,0x005B,0x0000, /* 1E5C */ +0x0020,0x007B,0x0000,0x0000, 0x0020,0x007B,0x0000,0x0000, /* 1E5E */ +0x0020,0x0052,0x0000,0x0000, 0x0020,0x0052,0x0000,0x0000, /* 1E60 */ +0x0020,0x0070,0x0000,0x0000, 0x0020,0x0070,0x0000,0x0000, /* 1E62 */ +0x0020,0x0032,0x0052,0x0000, 0x0020,0x0032,0x0052,0x0000, /* 1E64 */ +0x0020,0x0041,0x0052,0x0000, 0x0020,0x0041,0x0052,0x0000, /* 1E66 */ +0x0020,0x0070,0x0052,0x0000, 0x0020,0x0070,0x0052,0x0000, /* 1E68 */ +0x0020,0x0052,0x0000,0x0000, 0x0020,0x0052,0x0000,0x0000, /* 1E6A */ +0x0020,0x0070,0x0000,0x0000, 0x0020,0x0070,0x0000,0x0000, /* 1E6C */ +0x0020,0x007B,0x0000,0x0000, 0x0020,0x007B,0x0000,0x0000, /* 1E6E */ +0x0020,0x0078,0x0000,0x0000, 0x0020,0x0078,0x0000,0x0000, /* 1E70 */ +0x0020,0x0075,0x0000,0x0000, 0x0020,0x0075,0x0000,0x0000, /* 1E72 */ +0x0020,0x007A,0x0000,0x0000, 0x0020,0x007A,0x0000,0x0000, /* 1E74 */ +0x0020,0x0078,0x0000,0x0000, 0x0020,0x0078,0x0000,0x0000, /* 1E76 */ +0x0020,0x004E,0x0032,0x0000, 0x0020,0x004E,0x0032,0x0000, /* 1E78 */ +0x0020,0x005B,0x0047,0x0000, 0x0020,0x005B,0x0047,0x0000, /* 1E7A */ +0x0020,0x004E,0x0000,0x0000, 0x0020,0x004E,0x0000,0x0000, /* 1E7C */ +0x0020,0x0070,0x0000,0x0000, 0x0020,0x0070,0x0000,0x0000, /* 1E7E */ +0x0020,0x0035,0x0000,0x0000, 0x0020,0x0035,0x0000,0x0000, /* 1E80 */ +0x0020,0x0032,0x0000,0x0000, 0x0020,0x0032,0x0000,0x0000, /* 1E82 */ +0x0020,0x0047,0x0000,0x0000, 0x0020,0x0047,0x0000,0x0000, /* 1E84 */ +0x0020,0x0052,0x0000,0x0000, 0x0020,0x0052,0x0000,0x0000, /* 1E86 */ +0x0020,0x0070,0x0000,0x0000, 0x0020,0x0070,0x0000,0x0000, /* 1E88 */ +0x0020,0x0052,0x0000,0x0000, 0x0020,0x0052,0x0000,0x0000, /* 1E8A */ +0x0020,0x0047,0x0000,0x0000, 0x0020,0x0047,0x0000,0x0000, /* 1E8C */ +0x0020,0x0052,0x0000,0x0000, 0x0020,0x0052,0x0000,0x0000, /* 1E8E */ +0x0020,0x003C,0x0000,0x0000, 0x0020,0x003C,0x0000,0x0000, /* 1E90 */ +0x0020,0x0070,0x0000,0x0000, 0x0020,0x0070,0x0000,0x0000, /* 1E92 */ +0x0020,0x007B,0x0000,0x0000, 0x0020,0x007B,0x0000,0x0000, /* 1E94 */ +0x0020,0x007B,0x0000,0x0000, 0x0020,0x0047,0x0000,0x0000, /* 1E96 */ +0x0020,0x0043,0x0000,0x0000, 0x0020,0x0043,0x0000,0x0000, /* 1E98 */ +0x0020,0x0020,0x0000,0x0000, 0x0020,0x015A,0x0052,0x0000, /* 1E9A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1E9C */ +0x0020,0x0159,0x0020,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1E9E */ +0x0020,0x0070,0x0000,0x0000, 0x0020,0x0070,0x0000,0x0000, /* 1EA0 */ +0x0020,0x0064,0x0000,0x0000, 0x0020,0x0064,0x0000,0x0000, /* 1EA2 */ +0x0020,0x003C,0x0032,0x0000, 0x0020,0x003C,0x0032,0x0000, /* 1EA4 */ +0x0020,0x003C,0x0035,0x0000, 0x0020,0x003C,0x0035,0x0000, /* 1EA6 */ +0x0020,0x003C,0x0064,0x0000, 0x0020,0x003C,0x0064,0x0000, /* 1EA8 */ +0x0020,0x003C,0x004E,0x0000, 0x0020,0x003C,0x004E,0x0000, /* 1EAA */ +0x0020,0x0070,0x003C,0x0000, 0x0020,0x0070,0x003C,0x0000, /* 1EAC */ +0x0020,0x0037,0x0032,0x0000, 0x0020,0x0037,0x0032,0x0000, /* 1EAE */ +0x0020,0x0037,0x0035,0x0000, 0x0020,0x0037,0x0035,0x0000, /* 1EB0 */ +0x0020,0x0037,0x0064,0x0000, 0x0020,0x0037,0x0064,0x0000, /* 1EB2 */ +0x0020,0x0037,0x004E,0x0000, 0x0020,0x0037,0x004E,0x0000, /* 1EB4 */ +0x0020,0x0070,0x0037,0x0000, 0x0020,0x0070,0x0037,0x0000, /* 1EB6 */ +0x0020,0x0070,0x0000,0x0000, 0x0020,0x0070,0x0000,0x0000, /* 1EB8 */ +0x0020,0x0064,0x0000,0x0000, 0x0020,0x0064,0x0000,0x0000, /* 1EBA */ +0x0020,0x004E,0x0000,0x0000, 0x0020,0x004E,0x0000,0x0000, /* 1EBC */ +0x0020,0x003C,0x0032,0x0000, 0x0020,0x003C,0x0032,0x0000, /* 1EBE */ +0x0020,0x003C,0x0035,0x0000, 0x0020,0x003C,0x0035,0x0000, /* 1EC0 */ +0x0020,0x003C,0x0064,0x0000, 0x0020,0x003C,0x0064,0x0000, /* 1EC2 */ +0x0020,0x003C,0x004E,0x0000, 0x0020,0x003C,0x004E,0x0000, /* 1EC4 */ +0x0020,0x0070,0x003C,0x0000, 0x0020,0x0070,0x003C,0x0000, /* 1EC6 */ +0x0020,0x0064,0x0000,0x0000, 0x0020,0x0064,0x0000,0x0000, /* 1EC8 */ +0x0020,0x0070,0x0000,0x0000, 0x0020,0x0070,0x0000,0x0000, /* 1ECA */ +0x0020,0x0070,0x0000,0x0000, 0x0020,0x0070,0x0000,0x0000, /* 1ECC */ +0x0020,0x0064,0x0000,0x0000, 0x0020,0x0064,0x0000,0x0000, /* 1ECE */ +0x0020,0x003C,0x0032,0x0000, 0x0020,0x003C,0x0032,0x0000, /* 1ED0 */ +0x0020,0x003C,0x0035,0x0000, 0x0020,0x003C,0x0035,0x0000, /* 1ED2 */ +0x0020,0x003C,0x0064,0x0000, 0x0020,0x003C,0x0064,0x0000, /* 1ED4 */ +0x0020,0x003C,0x004E,0x0000, 0x0020,0x003C,0x004E,0x0000, /* 1ED6 */ +0x0020,0x0070,0x003C,0x0000, 0x0020,0x0070,0x003C,0x0000, /* 1ED8 */ +0x0020,0x0068,0x0032,0x0000, 0x0020,0x0068,0x0032,0x0000, /* 1EDA */ +0x0020,0x0068,0x0035,0x0000, 0x0020,0x0068,0x0035,0x0000, /* 1EDC */ +0x0020,0x0068,0x0064,0x0000, 0x0020,0x0068,0x0064,0x0000, /* 1EDE */ +0x0020,0x0068,0x004E,0x0000, 0x0020,0x0068,0x004E,0x0000, /* 1EE0 */ +0x0020,0x0068,0x0070,0x0000, 0x0020,0x0068,0x0070,0x0000, /* 1EE2 */ +0x0020,0x0070,0x0000,0x0000, 0x0020,0x0070,0x0000,0x0000, /* 1EE4 */ +0x0020,0x0064,0x0000,0x0000, 0x0020,0x0064,0x0000,0x0000, /* 1EE6 */ +0x0020,0x0068,0x0032,0x0000, 0x0020,0x0068,0x0032,0x0000, /* 1EE8 */ +0x0020,0x0068,0x0035,0x0000, 0x0020,0x0068,0x0035,0x0000, /* 1EEA */ +0x0020,0x0068,0x0064,0x0000, 0x0020,0x0068,0x0064,0x0000, /* 1EEC */ +0x0020,0x0068,0x004E,0x0000, 0x0020,0x0068,0x004E,0x0000, /* 1EEE */ +0x0020,0x0068,0x0070,0x0000, 0x0020,0x0068,0x0070,0x0000, /* 1EF0 */ +0x0020,0x0035,0x0000,0x0000, 0x0020,0x0035,0x0000,0x0000, /* 1EF2 */ +0x0020,0x0070,0x0000,0x0000, 0x0020,0x0070,0x0000,0x0000, /* 1EF4 */ +0x0020,0x0064,0x0000,0x0000, 0x0020,0x0064,0x0000,0x0000, /* 1EF6 */ +0x0020,0x004E,0x0000,0x0000, 0x0020,0x004E,0x0000,0x0000, /* 1EF8 */ +0x0020,0x0020,0x0000,0x0000, 0x0020,0x0020,0x0000,0x0000, /* 1EFA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1EFC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000 /* 1EFE */ +}; + +static const uint16 uca520_p01F_w2[]= { /* 1F00 (5 weights per char) */ +0x0020,0x0022,0x0000,0x0000,0x0000, /* 1F00 */ +0x0020,0x002A,0x0000,0x0000,0x0000, /* 1F01 */ +0x0020,0x0022,0x0035,0x0000,0x0000, /* 1F02 */ +0x0020,0x002A,0x0035,0x0000,0x0000, /* 1F03 */ +0x0020,0x0022,0x0032,0x0000,0x0000, /* 1F04 */ +0x0020,0x002A,0x0032,0x0000,0x0000, /* 1F05 */ +0x0020,0x0022,0x0045,0x0000,0x0000, /* 1F06 */ +0x0020,0x002A,0x0045,0x0000,0x0000, /* 1F07 */ +0x0020,0x0022,0x0000,0x0000,0x0000, /* 1F08 */ +0x0020,0x002A,0x0000,0x0000,0x0000, /* 1F09 */ +0x0020,0x0022,0x0035,0x0000,0x0000, /* 1F0A */ +0x0020,0x002A,0x0035,0x0000,0x0000, /* 1F0B */ +0x0020,0x0022,0x0032,0x0000,0x0000, /* 1F0C */ +0x0020,0x002A,0x0032,0x0000,0x0000, /* 1F0D */ +0x0020,0x0022,0x0045,0x0000,0x0000, /* 1F0E */ +0x0020,0x002A,0x0045,0x0000,0x0000, /* 1F0F */ +0x0020,0x0022,0x0000,0x0000,0x0000, /* 1F10 */ +0x0020,0x002A,0x0000,0x0000,0x0000, /* 1F11 */ +0x0020,0x0022,0x0035,0x0000,0x0000, /* 1F12 */ +0x0020,0x002A,0x0035,0x0000,0x0000, /* 1F13 */ +0x0020,0x0022,0x0032,0x0000,0x0000, /* 1F14 */ +0x0020,0x002A,0x0032,0x0000,0x0000, /* 1F15 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1F16 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1F17 */ +0x0020,0x0022,0x0000,0x0000,0x0000, /* 1F18 */ +0x0020,0x002A,0x0000,0x0000,0x0000, /* 1F19 */ +0x0020,0x0022,0x0035,0x0000,0x0000, /* 1F1A */ +0x0020,0x002A,0x0035,0x0000,0x0000, /* 1F1B */ +0x0020,0x0022,0x0032,0x0000,0x0000, /* 1F1C */ +0x0020,0x002A,0x0032,0x0000,0x0000, /* 1F1D */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1F1E */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1F1F */ +0x0020,0x0022,0x0000,0x0000,0x0000, /* 1F20 */ +0x0020,0x002A,0x0000,0x0000,0x0000, /* 1F21 */ +0x0020,0x0022,0x0035,0x0000,0x0000, /* 1F22 */ +0x0020,0x002A,0x0035,0x0000,0x0000, /* 1F23 */ +0x0020,0x0022,0x0032,0x0000,0x0000, /* 1F24 */ +0x0020,0x002A,0x0032,0x0000,0x0000, /* 1F25 */ +0x0020,0x0022,0x0045,0x0000,0x0000, /* 1F26 */ +0x0020,0x002A,0x0045,0x0000,0x0000, /* 1F27 */ +0x0020,0x0022,0x0000,0x0000,0x0000, /* 1F28 */ +0x0020,0x002A,0x0000,0x0000,0x0000, /* 1F29 */ +0x0020,0x0022,0x0035,0x0000,0x0000, /* 1F2A */ +0x0020,0x002A,0x0035,0x0000,0x0000, /* 1F2B */ +0x0020,0x0022,0x0032,0x0000,0x0000, /* 1F2C */ +0x0020,0x002A,0x0032,0x0000,0x0000, /* 1F2D */ +0x0020,0x0022,0x0045,0x0000,0x0000, /* 1F2E */ +0x0020,0x002A,0x0045,0x0000,0x0000, /* 1F2F */ +0x0020,0x0022,0x0000,0x0000,0x0000, /* 1F30 */ +0x0020,0x002A,0x0000,0x0000,0x0000, /* 1F31 */ +0x0020,0x0022,0x0035,0x0000,0x0000, /* 1F32 */ +0x0020,0x002A,0x0035,0x0000,0x0000, /* 1F33 */ +0x0020,0x0022,0x0032,0x0000,0x0000, /* 1F34 */ +0x0020,0x002A,0x0032,0x0000,0x0000, /* 1F35 */ +0x0020,0x0022,0x0045,0x0000,0x0000, /* 1F36 */ +0x0020,0x002A,0x0045,0x0000,0x0000, /* 1F37 */ +0x0020,0x0022,0x0000,0x0000,0x0000, /* 1F38 */ +0x0020,0x002A,0x0000,0x0000,0x0000, /* 1F39 */ +0x0020,0x0022,0x0035,0x0000,0x0000, /* 1F3A */ +0x0020,0x002A,0x0035,0x0000,0x0000, /* 1F3B */ +0x0020,0x0022,0x0032,0x0000,0x0000, /* 1F3C */ +0x0020,0x002A,0x0032,0x0000,0x0000, /* 1F3D */ +0x0020,0x0022,0x0045,0x0000,0x0000, /* 1F3E */ +0x0020,0x002A,0x0045,0x0000,0x0000, /* 1F3F */ +0x0020,0x0022,0x0000,0x0000,0x0000, /* 1F40 */ +0x0020,0x002A,0x0000,0x0000,0x0000, /* 1F41 */ +0x0020,0x0022,0x0035,0x0000,0x0000, /* 1F42 */ +0x0020,0x002A,0x0035,0x0000,0x0000, /* 1F43 */ +0x0020,0x0022,0x0032,0x0000,0x0000, /* 1F44 */ +0x0020,0x002A,0x0032,0x0000,0x0000, /* 1F45 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1F46 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1F47 */ +0x0020,0x0022,0x0000,0x0000,0x0000, /* 1F48 */ +0x0020,0x002A,0x0000,0x0000,0x0000, /* 1F49 */ +0x0020,0x0022,0x0035,0x0000,0x0000, /* 1F4A */ +0x0020,0x002A,0x0035,0x0000,0x0000, /* 1F4B */ +0x0020,0x0022,0x0032,0x0000,0x0000, /* 1F4C */ +0x0020,0x002A,0x0032,0x0000,0x0000, /* 1F4D */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1F4E */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1F4F */ +0x0020,0x0022,0x0000,0x0000,0x0000, /* 1F50 */ +0x0020,0x002A,0x0000,0x0000,0x0000, /* 1F51 */ +0x0020,0x0022,0x0035,0x0000,0x0000, /* 1F52 */ +0x0020,0x002A,0x0035,0x0000,0x0000, /* 1F53 */ +0x0020,0x0022,0x0032,0x0000,0x0000, /* 1F54 */ +0x0020,0x002A,0x0032,0x0000,0x0000, /* 1F55 */ +0x0020,0x0022,0x0045,0x0000,0x0000, /* 1F56 */ +0x0020,0x002A,0x0045,0x0000,0x0000, /* 1F57 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1F58 */ +0x0020,0x002A,0x0000,0x0000,0x0000, /* 1F59 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1F5A */ +0x0020,0x002A,0x0035,0x0000,0x0000, /* 1F5B */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1F5C */ +0x0020,0x002A,0x0032,0x0000,0x0000, /* 1F5D */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1F5E */ +0x0020,0x002A,0x0045,0x0000,0x0000, /* 1F5F */ +0x0020,0x0022,0x0000,0x0000,0x0000, /* 1F60 */ +0x0020,0x002A,0x0000,0x0000,0x0000, /* 1F61 */ +0x0020,0x0022,0x0035,0x0000,0x0000, /* 1F62 */ +0x0020,0x002A,0x0035,0x0000,0x0000, /* 1F63 */ +0x0020,0x0022,0x0032,0x0000,0x0000, /* 1F64 */ +0x0020,0x002A,0x0032,0x0000,0x0000, /* 1F65 */ +0x0020,0x0022,0x0045,0x0000,0x0000, /* 1F66 */ +0x0020,0x002A,0x0045,0x0000,0x0000, /* 1F67 */ +0x0020,0x0022,0x0000,0x0000,0x0000, /* 1F68 */ +0x0020,0x002A,0x0000,0x0000,0x0000, /* 1F69 */ +0x0020,0x0022,0x0035,0x0000,0x0000, /* 1F6A */ +0x0020,0x002A,0x0035,0x0000,0x0000, /* 1F6B */ +0x0020,0x0022,0x0032,0x0000,0x0000, /* 1F6C */ +0x0020,0x002A,0x0032,0x0000,0x0000, /* 1F6D */ +0x0020,0x0022,0x0045,0x0000,0x0000, /* 1F6E */ +0x0020,0x002A,0x0045,0x0000,0x0000, /* 1F6F */ +0x0020,0x0035,0x0000,0x0000,0x0000, /* 1F70 */ +0x0020,0x0032,0x0000,0x0000,0x0000, /* 1F71 */ +0x0020,0x0035,0x0000,0x0000,0x0000, /* 1F72 */ +0x0020,0x0032,0x0000,0x0000,0x0000, /* 1F73 */ +0x0020,0x0035,0x0000,0x0000,0x0000, /* 1F74 */ +0x0020,0x0032,0x0000,0x0000,0x0000, /* 1F75 */ +0x0020,0x0035,0x0000,0x0000,0x0000, /* 1F76 */ +0x0020,0x0032,0x0000,0x0000,0x0000, /* 1F77 */ +0x0020,0x0035,0x0000,0x0000,0x0000, /* 1F78 */ +0x0020,0x0032,0x0000,0x0000,0x0000, /* 1F79 */ +0x0020,0x0035,0x0000,0x0000,0x0000, /* 1F7A */ +0x0020,0x0032,0x0000,0x0000,0x0000, /* 1F7B */ +0x0020,0x0035,0x0000,0x0000,0x0000, /* 1F7C */ +0x0020,0x0032,0x0000,0x0000,0x0000, /* 1F7D */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1F7E */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1F7F */ +0x0020,0x0022,0x007F,0x0000,0x0000, /* 1F80 */ +0x0020,0x002A,0x007F,0x0000,0x0000, /* 1F81 */ +0x0020,0x0022,0x0035,0x007F,0x0000, /* 1F82 */ +0x0020,0x002A,0x0035,0x007F,0x0000, /* 1F83 */ +0x0020,0x0022,0x0032,0x007F,0x0000, /* 1F84 */ +0x0020,0x002A,0x0032,0x007F,0x0000, /* 1F85 */ +0x0020,0x0022,0x0045,0x007F,0x0000, /* 1F86 */ +0x0020,0x002A,0x0045,0x007F,0x0000, /* 1F87 */ +0x0020,0x0022,0x007F,0x0000,0x0000, /* 1F88 */ +0x0020,0x002A,0x007F,0x0000,0x0000, /* 1F89 */ +0x0020,0x0022,0x0035,0x007F,0x0000, /* 1F8A */ +0x0020,0x002A,0x0035,0x007F,0x0000, /* 1F8B */ +0x0020,0x0022,0x0032,0x007F,0x0000, /* 1F8C */ +0x0020,0x002A,0x0032,0x007F,0x0000, /* 1F8D */ +0x0020,0x0022,0x0045,0x007F,0x0000, /* 1F8E */ +0x0020,0x002A,0x0045,0x007F,0x0000, /* 1F8F */ +0x0020,0x0022,0x007F,0x0000,0x0000, /* 1F90 */ +0x0020,0x002A,0x007F,0x0000,0x0000, /* 1F91 */ +0x0020,0x0022,0x0035,0x007F,0x0000, /* 1F92 */ +0x0020,0x002A,0x0035,0x007F,0x0000, /* 1F93 */ +0x0020,0x0022,0x0032,0x007F,0x0000, /* 1F94 */ +0x0020,0x002A,0x0032,0x007F,0x0000, /* 1F95 */ +0x0020,0x0022,0x0045,0x007F,0x0000, /* 1F96 */ +0x0020,0x002A,0x0045,0x007F,0x0000, /* 1F97 */ +0x0020,0x0022,0x007F,0x0000,0x0000, /* 1F98 */ +0x0020,0x002A,0x007F,0x0000,0x0000, /* 1F99 */ +0x0020,0x0022,0x0035,0x007F,0x0000, /* 1F9A */ +0x0020,0x002A,0x0035,0x007F,0x0000, /* 1F9B */ +0x0020,0x0022,0x0032,0x007F,0x0000, /* 1F9C */ +0x0020,0x002A,0x0032,0x007F,0x0000, /* 1F9D */ +0x0020,0x0022,0x0045,0x007F,0x0000, /* 1F9E */ +0x0020,0x002A,0x0045,0x007F,0x0000, /* 1F9F */ +0x0020,0x0022,0x007F,0x0000,0x0000, /* 1FA0 */ +0x0020,0x002A,0x007F,0x0000,0x0000, /* 1FA1 */ +0x0020,0x0022,0x0035,0x007F,0x0000, /* 1FA2 */ +0x0020,0x002A,0x0035,0x007F,0x0000, /* 1FA3 */ +0x0020,0x0022,0x0032,0x007F,0x0000, /* 1FA4 */ +0x0020,0x002A,0x0032,0x007F,0x0000, /* 1FA5 */ +0x0020,0x0022,0x0045,0x007F,0x0000, /* 1FA6 */ +0x0020,0x002A,0x0045,0x007F,0x0000, /* 1FA7 */ +0x0020,0x0022,0x007F,0x0000,0x0000, /* 1FA8 */ +0x0020,0x002A,0x007F,0x0000,0x0000, /* 1FA9 */ +0x0020,0x0022,0x0035,0x007F,0x0000, /* 1FAA */ +0x0020,0x002A,0x0035,0x007F,0x0000, /* 1FAB */ +0x0020,0x0022,0x0032,0x007F,0x0000, /* 1FAC */ +0x0020,0x002A,0x0032,0x007F,0x0000, /* 1FAD */ +0x0020,0x0022,0x0045,0x007F,0x0000, /* 1FAE */ +0x0020,0x002A,0x0045,0x007F,0x0000, /* 1FAF */ +0x0020,0x0037,0x0000,0x0000,0x0000, /* 1FB0 */ +0x0020,0x005B,0x0000,0x0000,0x0000, /* 1FB1 */ +0x0020,0x0035,0x007F,0x0000,0x0000, /* 1FB2 */ +0x0020,0x007F,0x0000,0x0000,0x0000, /* 1FB3 */ +0x0020,0x0032,0x007F,0x0000,0x0000, /* 1FB4 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1FB5 */ +0x0020,0x0045,0x0000,0x0000,0x0000, /* 1FB6 */ +0x0020,0x0045,0x007F,0x0000,0x0000, /* 1FB7 */ +0x0020,0x0037,0x0000,0x0000,0x0000, /* 1FB8 */ +0x0020,0x005B,0x0000,0x0000,0x0000, /* 1FB9 */ +0x0020,0x0035,0x0000,0x0000,0x0000, /* 1FBA */ +0x0020,0x0032,0x0000,0x0000,0x0000, /* 1FBB */ +0x0020,0x007F,0x0000,0x0000,0x0000, /* 1FBC */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1FBD */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1FBE */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1FBF */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1FC0 */ +0x0020,0x0045,0x0000,0x0000,0x0000, /* 1FC1 */ +0x0020,0x0035,0x007F,0x0000,0x0000, /* 1FC2 */ +0x0020,0x007F,0x0000,0x0000,0x0000, /* 1FC3 */ +0x0020,0x0032,0x007F,0x0000,0x0000, /* 1FC4 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1FC5 */ +0x0020,0x0045,0x0000,0x0000,0x0000, /* 1FC6 */ +0x0020,0x0045,0x007F,0x0000,0x0000, /* 1FC7 */ +0x0020,0x0035,0x0000,0x0000,0x0000, /* 1FC8 */ +0x0020,0x0032,0x0000,0x0000,0x0000, /* 1FC9 */ +0x0020,0x0035,0x0000,0x0000,0x0000, /* 1FCA */ +0x0020,0x0032,0x0000,0x0000,0x0000, /* 1FCB */ +0x0020,0x007F,0x0000,0x0000,0x0000, /* 1FCC */ +0x0020,0x0035,0x0000,0x0000,0x0000, /* 1FCD */ +0x0020,0x0032,0x0000,0x0000,0x0000, /* 1FCE */ +0x0020,0x0045,0x0000,0x0000,0x0000, /* 1FCF */ +0x0020,0x0037,0x0000,0x0000,0x0000, /* 1FD0 */ +0x0020,0x005B,0x0000,0x0000,0x0000, /* 1FD1 */ +0x0020,0x0047,0x0035,0x0000,0x0000, /* 1FD2 */ +0x0020,0x0047,0x0032,0x0000,0x0000, /* 1FD3 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1FD4 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1FD5 */ +0x0020,0x0045,0x0000,0x0000,0x0000, /* 1FD6 */ +0x0020,0x0047,0x0045,0x0000,0x0000, /* 1FD7 */ +0x0020,0x0037,0x0000,0x0000,0x0000, /* 1FD8 */ +0x0020,0x005B,0x0000,0x0000,0x0000, /* 1FD9 */ +0x0020,0x0035,0x0000,0x0000,0x0000, /* 1FDA */ +0x0020,0x0032,0x0000,0x0000,0x0000, /* 1FDB */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1FDC */ +0x0020,0x0035,0x0000,0x0000,0x0000, /* 1FDD */ +0x0020,0x0032,0x0000,0x0000,0x0000, /* 1FDE */ +0x0020,0x0045,0x0000,0x0000,0x0000, /* 1FDF */ +0x0020,0x0037,0x0000,0x0000,0x0000, /* 1FE0 */ +0x0020,0x005B,0x0000,0x0000,0x0000, /* 1FE1 */ +0x0020,0x0047,0x0035,0x0000,0x0000, /* 1FE2 */ +0x0020,0x0047,0x0032,0x0000,0x0000, /* 1FE3 */ +0x0020,0x0022,0x0000,0x0000,0x0000, /* 1FE4 */ +0x0020,0x002A,0x0000,0x0000,0x0000, /* 1FE5 */ +0x0020,0x0045,0x0000,0x0000,0x0000, /* 1FE6 */ +0x0020,0x0047,0x0045,0x0000,0x0000, /* 1FE7 */ +0x0020,0x0037,0x0000,0x0000,0x0000, /* 1FE8 */ +0x0020,0x005B,0x0000,0x0000,0x0000, /* 1FE9 */ +0x0020,0x0035,0x0000,0x0000,0x0000, /* 1FEA */ +0x0020,0x0032,0x0000,0x0000,0x0000, /* 1FEB */ +0x0020,0x002A,0x0000,0x0000,0x0000, /* 1FEC */ +0x0020,0x0035,0x0000,0x0000,0x0000, /* 1FED */ +0x0020,0x0032,0x0000,0x0000,0x0000, /* 1FEE */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1FEF */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1FF0 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1FF1 */ +0x0020,0x0035,0x007F,0x0000,0x0000, /* 1FF2 */ +0x0020,0x007F,0x0000,0x0000,0x0000, /* 1FF3 */ +0x0020,0x0032,0x007F,0x0000,0x0000, /* 1FF4 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1FF5 */ +0x0020,0x0045,0x0000,0x0000,0x0000, /* 1FF6 */ +0x0020,0x0045,0x007F,0x0000,0x0000, /* 1FF7 */ +0x0020,0x0035,0x0000,0x0000,0x0000, /* 1FF8 */ +0x0020,0x0032,0x0000,0x0000,0x0000, /* 1FF9 */ +0x0020,0x0035,0x0000,0x0000,0x0000, /* 1FFA */ +0x0020,0x0032,0x0000,0x0000,0x0000, /* 1FFB */ +0x0020,0x007F,0x0000,0x0000,0x0000, /* 1FFC */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1FFD */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 1FFE */ +0x0020,0x0000,0x0000,0x0000,0x0000 /* 1FFF */ +}; + +static const uint16 uca520_p020_w2[]= { /* 2000 (5 weights per char) */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2000 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2001 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2002 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2003 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2004 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2005 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2006 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2007 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2008 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2009 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 200A */ +0x0000,0x0000,0x0000,0x0000,0x0000, /* 200B */ +0x0000,0x0000,0x0000,0x0000,0x0000, /* 200C */ +0x0000,0x0000,0x0000,0x0000,0x0000, /* 200D */ +0x0000,0x0000,0x0000,0x0000,0x0000, /* 200E */ +0x0000,0x0000,0x0000,0x0000,0x0000, /* 200F */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2010 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2011 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2012 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2013 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2014 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2015 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2016 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2017 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2018 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2019 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 201A */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 201B */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 201C */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 201D */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 201E */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 201F */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2020 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2021 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2022 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2023 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2024 */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 2025 */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 2026 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2027 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2028 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2029 */ +0x0000,0x0000,0x0000,0x0000,0x0000, /* 202A */ +0x0000,0x0000,0x0000,0x0000,0x0000, /* 202B */ +0x0000,0x0000,0x0000,0x0000,0x0000, /* 202C */ +0x0000,0x0000,0x0000,0x0000,0x0000, /* 202D */ +0x0000,0x0000,0x0000,0x0000,0x0000, /* 202E */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 202F */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2030 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2031 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2032 */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 2033 */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 2034 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2035 */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 2036 */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 2037 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2038 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2039 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 203A */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 203B */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 203C */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 203D */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 203E */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 203F */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2040 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2041 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2042 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2043 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2044 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2045 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2046 */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 2047 */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 2048 */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 2049 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 204A */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 204B */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 204C */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 204D */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 204E */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 204F */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2050 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2051 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2052 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2053 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2054 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2055 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2056 */ +0x0020,0x0020,0x0020,0x0020,0x0000, /* 2057 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2058 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2059 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 205A */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 205B */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 205C */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 205D */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 205E */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 205F */ +0x0000,0x0000,0x0000,0x0000,0x0000, /* 2060 */ +0x0000,0x0000,0x0000,0x0000,0x0000, /* 2061 */ +0x0000,0x0000,0x0000,0x0000,0x0000, /* 2062 */ +0x0000,0x0000,0x0000,0x0000,0x0000, /* 2063 */ +0x0000,0x0000,0x0000,0x0000,0x0000, /* 2064 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2065 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2066 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2067 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2068 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2069 */ +0x0000,0x0000,0x0000,0x0000,0x0000, /* 206A */ +0x0000,0x0000,0x0000,0x0000,0x0000, /* 206B */ +0x0000,0x0000,0x0000,0x0000,0x0000, /* 206C */ +0x0000,0x0000,0x0000,0x0000,0x0000, /* 206D */ +0x0000,0x0000,0x0000,0x0000,0x0000, /* 206E */ +0x0000,0x0000,0x0000,0x0000,0x0000, /* 206F */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2070 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2071 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2072 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2073 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2074 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2075 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2076 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2077 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2078 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2079 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 207A */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 207B */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 207C */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 207D */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 207E */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 207F */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2080 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2081 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2082 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2083 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2084 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2085 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2086 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2087 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2088 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2089 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 208A */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 208B */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 208C */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 208D */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 208E */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 208F */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2090 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2091 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2092 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2093 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2094 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2095 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2096 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2097 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2098 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2099 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 209A */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 209B */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 209C */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 209D */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 209E */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 209F */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 20A0 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 20A1 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 20A2 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 20A3 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 20A4 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 20A5 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 20A6 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 20A7 */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 20A8 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 20A9 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 20AA */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 20AB */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 20AC */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 20AD */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 20AE */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 20AF */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 20B0 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 20B1 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 20B2 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 20B3 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 20B4 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 20B5 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 20B6 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 20B7 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 20B8 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 20B9 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 20BA */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 20BB */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 20BC */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 20BD */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 20BE */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 20BF */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 20C0 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 20C1 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 20C2 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 20C3 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 20C4 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 20C5 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 20C6 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 20C7 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 20C8 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 20C9 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 20CA */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 20CB */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 20CC */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 20CD */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 20CE */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 20CF */ +0x014A,0x0000,0x0000,0x0000,0x0000, /* 20D0 */ +0x014B,0x0000,0x0000,0x0000,0x0000, /* 20D1 */ +0x014C,0x0000,0x0000,0x0000,0x0000, /* 20D2 */ +0x014C,0x0000,0x0000,0x0000,0x0000, /* 20D3 */ +0x014D,0x0000,0x0000,0x0000,0x0000, /* 20D4 */ +0x014E,0x0000,0x0000,0x0000,0x0000, /* 20D5 */ +0x014F,0x0000,0x0000,0x0000,0x0000, /* 20D6 */ +0x0150,0x0000,0x0000,0x0000,0x0000, /* 20D7 */ +0x0061,0x0000,0x0000,0x0000,0x0000, /* 20D8 */ +0x0061,0x0000,0x0000,0x0000,0x0000, /* 20D9 */ +0x0061,0x0000,0x0000,0x0000,0x0000, /* 20DA */ +0x0151,0x0000,0x0000,0x0000,0x0000, /* 20DB */ +0x0152,0x0000,0x0000,0x0000,0x0000, /* 20DC */ +0x0062,0x0000,0x0000,0x0000,0x0000, /* 20DD */ +0x0062,0x0000,0x0000,0x0000,0x0000, /* 20DE */ +0x0062,0x0000,0x0000,0x0000,0x0000, /* 20DF */ +0x0062,0x0000,0x0000,0x0000,0x0000, /* 20E0 */ +0x0153,0x0000,0x0000,0x0000,0x0000, /* 20E1 */ +0x0062,0x0000,0x0000,0x0000,0x0000, /* 20E2 */ +0x0062,0x0000,0x0000,0x0000,0x0000, /* 20E3 */ +0x0062,0x0000,0x0000,0x0000,0x0000, /* 20E4 */ +0x0061,0x0000,0x0000,0x0000,0x0000, /* 20E5 */ +0x0154,0x0000,0x0000,0x0000,0x0000, /* 20E6 */ +0x0155,0x0000,0x0000,0x0000,0x0000, /* 20E7 */ +0x0156,0x0000,0x0000,0x0000,0x0000, /* 20E8 */ +0x0157,0x0000,0x0000,0x0000,0x0000, /* 20E9 */ +0x0061,0x0000,0x0000,0x0000,0x0000, /* 20EA */ +0x0061,0x0000,0x0000,0x0000,0x0000, /* 20EB */ +0x0060,0x0000,0x0000,0x0000,0x0000, /* 20EC */ +0x0060,0x0000,0x0000,0x0000,0x0000, /* 20ED */ +0x0060,0x0000,0x0000,0x0000,0x0000, /* 20EE */ +0x0060,0x0000,0x0000,0x0000,0x0000, /* 20EF */ +0x005F,0x0000,0x0000,0x0000,0x0000, /* 20F0 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 20F1 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 20F2 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 20F3 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 20F4 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 20F5 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 20F6 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 20F7 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 20F8 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 20F9 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 20FA */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 20FB */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 20FC */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 20FD */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 20FE */ +0x0020,0x0000,0x0000,0x0000,0x0000 /* 20FF */ +}; + +static const uint16 uca520_p021_w2[]= { /* 2100 (5 weights per char) */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 2100 */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 2101 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2102 */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 2103 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2104 */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 2105 */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 2106 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2107 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2108 */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 2109 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 210A */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 210B */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 210C */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 210D */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 210E */ +0x0020,0x007D,0x0000,0x0000,0x0000, /* 210F */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2110 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2111 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2112 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2113 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2114 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2115 */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 2116 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2117 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2118 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2119 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 211A */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 211B */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 211C */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 211D */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 211E */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 211F */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 2120 */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 2121 */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 2122 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2123 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2124 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2125 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2126 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2127 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2128 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2129 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 212A */ +0x0020,0x0043,0x0000,0x0000,0x0000, /* 212B */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 212C */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 212D */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 212E */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 212F */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2130 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2131 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2132 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2133 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2134 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2135 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2136 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2137 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2138 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2139 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 213A */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 213B */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 213C */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 213D */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 213E */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 213F */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2140 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2141 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2142 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2143 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2144 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2145 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2146 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2147 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2148 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2149 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 214A */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 214B */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 214C */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 214D */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 214E */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 214F */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 2150 */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 2151 */ +0x0020,0x0020,0x0020,0x0020,0x0000, /* 2152 */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 2153 */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 2154 */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 2155 */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 2156 */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 2157 */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 2158 */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 2159 */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 215A */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 215B */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 215C */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 215D */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 215E */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 215F */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2160 */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 2161 */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 2162 */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 2163 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2164 */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 2165 */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 2166 */ +0x0020,0x0020,0x0020,0x0020,0x0000, /* 2167 */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 2168 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2169 */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 216A */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 216B */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 216C */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 216D */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 216E */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 216F */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2170 */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 2171 */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 2172 */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 2173 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2174 */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 2175 */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 2176 */ +0x0020,0x0020,0x0020,0x0020,0x0000, /* 2177 */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 2178 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2179 */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 217A */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 217B */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 217C */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 217D */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 217E */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 217F */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2180 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2181 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2182 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2183 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2184 */ +0x0020,0x0188,0x0000,0x0000,0x0000, /* 2185 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2186 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2187 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2188 */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 2189 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 218A */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 218B */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 218C */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 218D */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 218E */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 218F */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2190 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2191 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2192 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2193 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2194 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2195 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2196 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2197 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2198 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2199 */ +0x0020,0x0054,0x0000,0x0000,0x0000, /* 219A */ +0x0020,0x0054,0x0000,0x0000,0x0000, /* 219B */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 219C */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 219D */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 219E */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 219F */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21A0 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21A1 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21A2 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21A3 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21A4 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21A5 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21A6 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21A7 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21A8 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21A9 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21AA */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21AB */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21AC */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21AD */ +0x0020,0x0054,0x0000,0x0000,0x0000, /* 21AE */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21AF */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21B0 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21B1 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21B2 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21B3 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21B4 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21B5 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21B6 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21B7 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21B8 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21B9 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21BA */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21BB */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21BC */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21BD */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21BE */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21BF */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21C0 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21C1 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21C2 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21C3 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21C4 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21C5 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21C6 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21C7 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21C8 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21C9 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21CA */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21CB */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21CC */ +0x0020,0x0054,0x0000,0x0000,0x0000, /* 21CD */ +0x0020,0x0054,0x0000,0x0000,0x0000, /* 21CE */ +0x0020,0x0054,0x0000,0x0000,0x0000, /* 21CF */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21D0 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21D1 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21D2 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21D3 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21D4 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21D5 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21D6 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21D7 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21D8 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21D9 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21DA */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21DB */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21DC */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21DD */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21DE */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21DF */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21E0 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21E1 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21E2 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21E3 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21E4 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21E5 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21E6 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21E7 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21E8 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21E9 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21EA */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21EB */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21EC */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21ED */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21EE */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21EF */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21F0 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21F1 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21F2 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21F3 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21F4 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21F5 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21F6 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21F7 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21F8 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21F9 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21FA */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21FB */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21FC */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21FD */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 21FE */ +0x0020,0x0000,0x0000,0x0000,0x0000 /* 21FF */ +}; + +static const uint16 uca520_p022_w2[]= { /* 2200 (4 weights per char) */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2200 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2202 */ +0x0020,0x0054,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2204 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2206 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0054,0x0000,0x0000, /* 2208 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 220A */ +0x0020,0x0054,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 220C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 220E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2210 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2212 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2214 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2216 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2218 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 221A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 221C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 221E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2220 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2222 */ +0x0020,0x0054,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2224 */ +0x0020,0x0054,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2226 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2228 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 222A */ +0x0020,0x0020,0x0000,0x0000, 0x0020,0x0020,0x0020,0x0000, /* 222C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0020,0x0000,0x0000, /* 222E */ +0x0020,0x0020,0x0020,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2230 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2232 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2234 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2236 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2238 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 223A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 223C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 223E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0054,0x0000,0x0000, /* 2240 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2242 */ +0x0020,0x0054,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2244 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0054,0x0000,0x0000, /* 2246 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0054,0x0000,0x0000, /* 2248 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 224A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 224C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 224E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2250 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2252 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2254 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2256 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2258 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 225A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 225C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 225E */ +0x0020,0x0054,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2260 */ +0x0020,0x0054,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2262 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2264 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2266 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2268 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 226A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0054,0x0000,0x0000, /* 226C */ +0x0020,0x0054,0x0000,0x0000, 0x0020,0x0054,0x0000,0x0000, /* 226E */ +0x0020,0x0054,0x0000,0x0000, 0x0020,0x0054,0x0000,0x0000, /* 2270 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2272 */ +0x0020,0x0054,0x0000,0x0000, 0x0020,0x0054,0x0000,0x0000, /* 2274 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2276 */ +0x0020,0x0054,0x0000,0x0000, 0x0020,0x0054,0x0000,0x0000, /* 2278 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 227A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 227C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 227E */ +0x0020,0x0054,0x0000,0x0000, 0x0020,0x0054,0x0000,0x0000, /* 2280 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2282 */ +0x0020,0x0054,0x0000,0x0000, 0x0020,0x0054,0x0000,0x0000, /* 2284 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2286 */ +0x0020,0x0054,0x0000,0x0000, 0x0020,0x0054,0x0000,0x0000, /* 2288 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 228A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 228C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 228E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2290 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2292 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2294 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2296 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2298 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 229A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 229C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 229E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 22A0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 22A2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 22A4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 22A6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 22A8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 22AA */ +0x0020,0x0054,0x0000,0x0000, 0x0020,0x0054,0x0000,0x0000, /* 22AC */ +0x0020,0x0054,0x0000,0x0000, 0x0020,0x0054,0x0000,0x0000, /* 22AE */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 22B0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 22B2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 22B4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 22B6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 22B8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 22BA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 22BC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 22BE */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 22C0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 22C2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 22C4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 22C6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 22C8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 22CA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 22CC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 22CE */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 22D0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 22D2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 22D4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 22D6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 22D8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 22DA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 22DC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 22DE */ +0x0020,0x0054,0x0000,0x0000, 0x0020,0x0054,0x0000,0x0000, /* 22E0 */ +0x0020,0x0054,0x0000,0x0000, 0x0020,0x0054,0x0000,0x0000, /* 22E2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 22E4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 22E6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 22E8 */ +0x0020,0x0054,0x0000,0x0000, 0x0020,0x0054,0x0000,0x0000, /* 22EA */ +0x0020,0x0054,0x0000,0x0000, 0x0020,0x0054,0x0000,0x0000, /* 22EC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 22EE */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 22F0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 22F2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 22F4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 22F6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 22F8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 22FA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 22FC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000 /* 22FE */ +}; + +static const uint16 uca520_p024_w2[]= { /* 2400 (5 weights per char) */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2400 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2401 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2402 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2403 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2404 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2405 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2406 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2407 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2408 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2409 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 240A */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 240B */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 240C */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 240D */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 240E */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 240F */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2410 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2411 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2412 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2413 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2414 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2415 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2416 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2417 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2418 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2419 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 241A */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 241B */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 241C */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 241D */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 241E */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 241F */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2420 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2421 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2422 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2423 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2424 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2425 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2426 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2427 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2428 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2429 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 242A */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 242B */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 242C */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 242D */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 242E */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 242F */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2430 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2431 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2432 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2433 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2434 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2435 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2436 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2437 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2438 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2439 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 243A */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 243B */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 243C */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 243D */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 243E */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 243F */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2440 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2441 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2442 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2443 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2444 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2445 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2446 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2447 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2448 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2449 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 244A */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 244B */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 244C */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 244D */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 244E */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 244F */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2450 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2451 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2452 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2453 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2454 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2455 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2456 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2457 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2458 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2459 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 245A */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 245B */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 245C */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 245D */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 245E */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 245F */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2460 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2461 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2462 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2463 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2464 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2465 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2466 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2467 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2468 */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 2469 */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 246A */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 246B */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 246C */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 246D */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 246E */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 246F */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 2470 */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 2471 */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 2472 */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 2473 */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 2474 */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 2475 */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 2476 */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 2477 */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 2478 */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 2479 */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 247A */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 247B */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 247C */ +0x0020,0x0020,0x0020,0x0020,0x0000, /* 247D */ +0x0020,0x0020,0x0020,0x0020,0x0000, /* 247E */ +0x0020,0x0020,0x0020,0x0020,0x0000, /* 247F */ +0x0020,0x0020,0x0020,0x0020,0x0000, /* 2480 */ +0x0020,0x0020,0x0020,0x0020,0x0000, /* 2481 */ +0x0020,0x0020,0x0020,0x0020,0x0000, /* 2482 */ +0x0020,0x0020,0x0020,0x0020,0x0000, /* 2483 */ +0x0020,0x0020,0x0020,0x0020,0x0000, /* 2484 */ +0x0020,0x0020,0x0020,0x0020,0x0000, /* 2485 */ +0x0020,0x0020,0x0020,0x0020,0x0000, /* 2486 */ +0x0020,0x0020,0x0020,0x0020,0x0000, /* 2487 */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 2488 */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 2489 */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 248A */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 248B */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 248C */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 248D */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 248E */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 248F */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 2490 */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 2491 */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 2492 */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 2493 */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 2494 */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 2495 */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 2496 */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 2497 */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 2498 */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 2499 */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 249A */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 249B */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 249C */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 249D */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 249E */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 249F */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 24A0 */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 24A1 */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 24A2 */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 24A3 */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 24A4 */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 24A5 */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 24A6 */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 24A7 */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 24A8 */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 24A9 */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 24AA */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 24AB */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 24AC */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 24AD */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 24AE */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 24AF */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 24B0 */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 24B1 */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 24B2 */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 24B3 */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 24B4 */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 24B5 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 24B6 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 24B7 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 24B8 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 24B9 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 24BA */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 24BB */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 24BC */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 24BD */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 24BE */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 24BF */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 24C0 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 24C1 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 24C2 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 24C3 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 24C4 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 24C5 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 24C6 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 24C7 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 24C8 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 24C9 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 24CA */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 24CB */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 24CC */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 24CD */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 24CE */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 24CF */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 24D0 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 24D1 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 24D2 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 24D3 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 24D4 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 24D5 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 24D6 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 24D7 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 24D8 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 24D9 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 24DA */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 24DB */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 24DC */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 24DD */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 24DE */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 24DF */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 24E0 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 24E1 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 24E2 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 24E3 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 24E4 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 24E5 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 24E6 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 24E7 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 24E8 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 24E9 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 24EA */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 24EB */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 24EC */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 24ED */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 24EE */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 24EF */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 24F0 */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 24F1 */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 24F2 */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 24F3 */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 24F4 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 24F5 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 24F6 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 24F7 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 24F8 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 24F9 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 24FA */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 24FB */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 24FC */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 24FD */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 24FE */ +0x0020,0x0000,0x0000,0x0000,0x0000 /* 24FF */ +}; + +static const uint16 uca520_p027_w2[]= { /* 2700 (3 weights per char) */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2700 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2703 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2706 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2709 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 270C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 270F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2712 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2715 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2718 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 271B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 271E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2721 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2724 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2727 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 272A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 272D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2730 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2733 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2736 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2739 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 273C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 273F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2742 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2745 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2748 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 274B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 274E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2751 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2754 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2757 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 275A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 275D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2760 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2763 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2766 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2769 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 276C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 276F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2772 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2775 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2778 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 277B */ +0x0020,0x0000,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0000,0x0000, /* 277E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2781 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2784 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0020,0x0000, /* 2787 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 278A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 278D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2790 */ +0x0020,0x0020,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2793 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2796 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2799 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 279C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 279F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 27A2 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 27A5 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 27A8 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 27AB */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 27AE */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 27B1 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 27B4 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 27B7 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 27BA */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 27BD */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 27C0 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 27C3 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 27C6 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 27C9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 27CC */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 27CF */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 27D2 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 27D5 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 27D8 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 27DB */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 27DE */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 27E1 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 27E4 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 27E7 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 27EA */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 27ED */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 27F0 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 27F3 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 27F6 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 27F9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 27FC */ +0x0020,0x0000,0x0000 }; + +static const uint16 uca520_p02A_w2[]= { /* 2A00 (5 weights per char) */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A00 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A01 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A02 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A03 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A04 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A05 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A06 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A07 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A08 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A09 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A0A */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A0B */ +0x0020,0x0020,0x0020,0x0020,0x0000, /* 2A0C */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A0D */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A0E */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A0F */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A10 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A11 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A12 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A13 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A14 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A15 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A16 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A17 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A18 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A19 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A1A */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A1B */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A1C */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A1D */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A1E */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A1F */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A20 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A21 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A22 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A23 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A24 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A25 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A26 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A27 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A28 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A29 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A2A */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A2B */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A2C */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A2D */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A2E */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A2F */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A30 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A31 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A32 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A33 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A34 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A35 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A36 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A37 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A38 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A39 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A3A */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A3B */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A3C */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A3D */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A3E */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A3F */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A40 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A41 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A42 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A43 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A44 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A45 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A46 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A47 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A48 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A49 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A4A */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A4B */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A4C */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A4D */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A4E */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A4F */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A50 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A51 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A52 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A53 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A54 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A55 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A56 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A57 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A58 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A59 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A5A */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A5B */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A5C */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A5D */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A5E */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A5F */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A60 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A61 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A62 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A63 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A64 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A65 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A66 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A67 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A68 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A69 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A6A */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A6B */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A6C */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A6D */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A6E */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A6F */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A70 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A71 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A72 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A73 */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 2A74 */ +0x0020,0x0020,0x0000,0x0000,0x0000, /* 2A75 */ +0x0020,0x0020,0x0020,0x0000,0x0000, /* 2A76 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A77 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A78 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A79 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A7A */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A7B */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A7C */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A7D */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A7E */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A7F */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A80 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A81 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A82 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A83 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A84 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A85 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A86 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A87 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A88 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A89 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A8A */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A8B */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A8C */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A8D */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A8E */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A8F */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A90 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A91 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A92 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A93 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A94 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A95 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A96 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A97 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A98 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A99 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A9A */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A9B */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A9C */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A9D */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A9E */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2A9F */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AA0 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AA1 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AA2 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AA3 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AA4 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AA5 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AA6 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AA7 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AA8 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AA9 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AAA */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AAB */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AAC */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AAD */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AAE */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AAF */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AB0 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AB1 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AB2 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AB3 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AB4 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AB5 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AB6 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AB7 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AB8 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AB9 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2ABA */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2ABB */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2ABC */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2ABD */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2ABE */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2ABF */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AC0 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AC1 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AC2 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AC3 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AC4 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AC5 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AC6 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AC7 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AC8 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AC9 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2ACA */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2ACB */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2ACC */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2ACD */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2ACE */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2ACF */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AD0 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AD1 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AD2 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AD3 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AD4 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AD5 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AD6 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AD7 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AD8 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AD9 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2ADA */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2ADB */ +0x0020,0x0054,0x0000,0x0000,0x0000, /* 2ADC */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2ADD */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2ADE */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2ADF */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AE0 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AE1 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AE2 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AE3 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AE4 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AE5 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AE6 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AE7 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AE8 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AE9 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AEA */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AEB */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AEC */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AED */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AEE */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AEF */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AF0 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AF1 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AF2 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AF3 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AF4 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AF5 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AF6 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AF7 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AF8 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AF9 */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AFA */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AFB */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AFC */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AFD */ +0x0020,0x0000,0x0000,0x0000,0x0000, /* 2AFE */ +0x0020,0x0000,0x0000,0x0000,0x0000 /* 2AFF */ +}; + +static const uint16 uca520_p02C_w2[]= { /* 2C00 (4 weights per char) */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C00 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C02 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C04 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C06 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C08 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C0A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C0C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C0E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C10 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C12 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C14 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C16 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C18 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C1A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C1C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C1E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C20 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C22 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C24 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C26 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C28 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C2A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C2C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C2E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C30 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C32 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C34 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C36 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C38 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C3A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C3C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C3E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C40 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C42 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C44 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C46 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C48 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C4A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C4C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C4E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C50 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C52 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C54 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C56 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C58 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C5A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C5C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C5E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C60 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C62 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C64 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C66 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C68 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C6A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C6C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C6E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C70 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C72 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C74 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C76 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C78 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C7A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C7C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C7E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C80 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C82 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C84 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C86 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C88 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C8A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C8C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C8E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C90 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C92 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C94 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C96 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C98 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C9A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C9C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2C9E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2CA0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2CA2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2CA4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2CA6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2CA8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2CAA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2CAC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2CAE */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2CB0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2CB2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2CB4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2CB6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2CB8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2CBA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2CBC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2CBE */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2CC0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2CC2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2CC4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2CC6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2CC8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2CCA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2CCC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2CCE */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2CD0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2CD2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2CD4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2CD6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2CD8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2CDA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2CDC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2CDE */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2CE0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2CE2 */ +0x0020,0x0020,0x0020,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2CE4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2CE6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2CE8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2CEA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2CEC */ +0x0020,0x0000,0x0000,0x0000, 0x005F,0x0000,0x0000,0x0000, /* 2CEE */ +0x002A,0x0000,0x0000,0x0000, 0x0022,0x0000,0x0000,0x0000, /* 2CF0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2CF2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2CF4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2CF6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2CF8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2CFA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 2CFC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000 /* 2CFE */ +}; + +static const uint16 uca520_p02D_w2[]= { /* 2D00 (3 weights per char) */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2D00 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2D03 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2D06 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2D09 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2D0C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2D0F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2D12 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2D15 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2D18 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2D1B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2D1E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2D21 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2D24 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2D27 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2D2A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2D2D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2D30 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2D33 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2D36 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2D39 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2D3C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2D3F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2D42 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2D45 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2D48 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2D4B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2D4E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2D51 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2D54 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2D57 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2D5A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2D5D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2D60 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2D63 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2D66 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2D69 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2D6C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2D6F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2D72 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2D75 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2D78 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2D7B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2D7E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2D81 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2D84 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2D87 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2D8A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2D8D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2D90 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2D93 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2D96 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2D99 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2D9C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2D9F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2DA2 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2DA5 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2DA8 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2DAB */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2DAE */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2DB1 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2DB4 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2DB7 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2DBA */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2DBD */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2DC0 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2DC3 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2DC6 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2DC9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2DCC */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2DCF */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2DD2 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2DD5 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2DD8 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2DDB */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2DDE */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2DE1 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2DE4 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2DE7 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2DEA */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2DED */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2DF0 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0020,0x0000, /* 2DF3 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2DF6 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2DF9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2DFC */ +0x0020,0x0000,0x0000 }; + +static const uint16 uca520_p02E_w2[]= { /* 2E00 (3 weights per char) */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2E00 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2E03 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2E06 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2E09 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2E0C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2E0F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2E12 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2E15 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2E18 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2E1B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2E1E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2E21 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2E24 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2E27 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2E2A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2E2D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2E30 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2E33 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2E36 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2E39 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2E3C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2E3F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2E42 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2E45 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2E48 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2E4B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2E4E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2E51 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2E54 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2E57 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2E5A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2E5D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2E60 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2E63 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2E66 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2E69 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2E6C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2E6F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2E72 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2E75 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2E78 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2E7B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0159,0x0000, /* 2E7E */ +0x0020,0x0159,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2E81 */ +0x0020,0x0159,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0159,0x0000, /* 2E84 */ +0x0020,0x0159,0x0000, 0x0020,0x0159,0x0000, 0x0020,0x0000,0x0000, /* 2E87 */ +0x0020,0x0159,0x0000, 0x0020,0x0159,0x0000, 0x0020,0x0159,0x0000, /* 2E8A */ +0x0020,0x015A,0x0000, 0x0020,0x0159,0x0000, 0x0020,0x0000,0x0000, /* 2E8D */ +0x0020,0x0000,0x0000, 0x0020,0x0159,0x0000, 0x0020,0x0000,0x0000, /* 2E90 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0159,0x0000, /* 2E93 */ +0x0020,0x0000,0x0000, 0x0020,0x0159,0x0000, 0x0020,0x0000,0x0000, /* 2E96 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2E99 */ +0x0020,0x0159,0x0000, 0x0020,0x0159,0x0000, 0x0020,0x0159,0x0000, /* 2E9C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2E9F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2EA2 */ +0x0020,0x0159,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0159,0x0000, /* 2EA5 */ +0x0020,0x0000,0x0000, 0x0020,0x0159,0x0000, 0x0020,0x0159,0x0000, /* 2EA8 */ +0x0020,0x0159,0x0000, 0x0020,0x0159,0x0000, 0x0020,0x0000,0x0000, /* 2EAB */ +0x0020,0x0159,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2EAE */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0159,0x0000, /* 2EB1 */ +0x0020,0x015A,0x0000, 0x0020,0x0159,0x0000, 0x0020,0x0159,0x0000, /* 2EB4 */ +0x0020,0x015A,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2EB7 */ +0x0020,0x0000,0x0000, 0x0020,0x0159,0x0000, 0x0020,0x0159,0x0000, /* 2EBA */ +0x0020,0x0159,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0159,0x0000, /* 2EBD */ +0x0020,0x015A,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2EC0 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2EC3 */ +0x0020,0x0000,0x0000, 0x0020,0x0159,0x0000, 0x0020,0x0000,0x0000, /* 2EC6 */ +0x0020,0x0000,0x0000, 0x0020,0x0159,0x0000, 0x0020,0x0000,0x0000, /* 2EC9 */ +0x0020,0x0000,0x0000, 0x0020,0x0159,0x0000, 0x0020,0x015A,0x0000, /* 2ECC */ +0x0020,0x0159,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2ECF */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2ED2 */ +0x0020,0x0159,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0159,0x0000, /* 2ED5 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2ED8 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2EDB */ +0x0020,0x0159,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2EDE */ +0x0020,0x0159,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0159,0x0000, /* 2EE1 */ +0x0020,0x0159,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2EE4 */ +0x0020,0x0159,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2EE7 */ +0x0020,0x0000,0x0000, 0x0020,0x0159,0x0000, 0x0020,0x0000,0x0000, /* 2EEA */ +0x0020,0x0159,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0159,0x0000, /* 2EED */ +0x0020,0x0000,0x0000, 0x0020,0x0159,0x0000, 0x0020,0x015A,0x0000, /* 2EF0 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2EF3 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2EF6 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2EF9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 2EFC */ +0x0020,0x0000,0x0000 }; + +static const uint16 uca520_p030_w2[]= { /* 3000 (3 weights per char) */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 3000 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 3003 */ +0x0020,0x0020,0x0000, 0x0020,0x0185,0x0000, 0x0020,0x0000,0x0000, /* 3006 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 3009 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 300C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 300F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 3012 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 3015 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 3018 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 301B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 301E */ +0x0020,0x0185,0x0000, 0x0020,0x0185,0x0000, 0x0020,0x0185,0x0000, /* 3021 */ +0x0020,0x0185,0x0000, 0x0020,0x0185,0x0000, 0x0020,0x0185,0x0000, /* 3024 */ +0x0020,0x0185,0x0000, 0x0020,0x0185,0x0000, 0x0020,0x0185,0x0000, /* 3027 */ +0x0142,0x0000,0x0000, 0x0143,0x0000,0x0000, 0x0144,0x0000,0x0000, /* 302A */ +0x0145,0x0000,0x0000, 0x0146,0x0000,0x0000, 0x0147,0x0000,0x0000, /* 302D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0148,0x0000, /* 3030 */ +0x0020,0x0000,0x0000, 0x0020,0x0148,0x0000, 0x0020,0x0000,0x0000, /* 3033 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 3036 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 3039 */ +0x0020,0x0020,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 303C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 303F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 3042 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 3045 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 3048 */ +0x0020,0x0000,0x0000, 0x0020,0x0148,0x0000, 0x0020,0x0000,0x0000, /* 304B */ +0x0020,0x0148,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0148,0x0000, /* 304E */ +0x0020,0x0000,0x0000, 0x0020,0x0148,0x0000, 0x0020,0x0000,0x0000, /* 3051 */ +0x0020,0x0148,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0148,0x0000, /* 3054 */ +0x0020,0x0000,0x0000, 0x0020,0x0148,0x0000, 0x0020,0x0000,0x0000, /* 3057 */ +0x0020,0x0148,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0148,0x0000, /* 305A */ +0x0020,0x0000,0x0000, 0x0020,0x0148,0x0000, 0x0020,0x0000,0x0000, /* 305D */ +0x0020,0x0148,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0148,0x0000, /* 3060 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0148,0x0000, /* 3063 */ +0x0020,0x0000,0x0000, 0x0020,0x0148,0x0000, 0x0020,0x0000,0x0000, /* 3066 */ +0x0020,0x0148,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 3069 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 306C */ +0x0020,0x0000,0x0000, 0x0020,0x0148,0x0000, 0x0020,0x0149,0x0000, /* 306F */ +0x0020,0x0000,0x0000, 0x0020,0x0148,0x0000, 0x0020,0x0149,0x0000, /* 3072 */ +0x0020,0x0000,0x0000, 0x0020,0x0148,0x0000, 0x0020,0x0149,0x0000, /* 3075 */ +0x0020,0x0000,0x0000, 0x0020,0x0148,0x0000, 0x0020,0x0149,0x0000, /* 3078 */ +0x0020,0x0000,0x0000, 0x0020,0x0148,0x0000, 0x0020,0x0149,0x0000, /* 307B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 307E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 3081 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 3084 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 3087 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 308A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 308D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 3090 */ +0x0020,0x0000,0x0000, 0x0020,0x0148,0x0000, 0x0020,0x0000,0x0000, /* 3093 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 3096 */ +0x0148,0x0000,0x0000, 0x0149,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 3099 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0148,0x0000, /* 309C */ +0x0020,0x0020,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 309F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 30A2 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 30A5 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 30A8 */ +0x0020,0x0000,0x0000, 0x0020,0x0148,0x0000, 0x0020,0x0000,0x0000, /* 30AB */ +0x0020,0x0148,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0148,0x0000, /* 30AE */ +0x0020,0x0000,0x0000, 0x0020,0x0148,0x0000, 0x0020,0x0000,0x0000, /* 30B1 */ +0x0020,0x0148,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0148,0x0000, /* 30B4 */ +0x0020,0x0000,0x0000, 0x0020,0x0148,0x0000, 0x0020,0x0000,0x0000, /* 30B7 */ +0x0020,0x0148,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0148,0x0000, /* 30BA */ +0x0020,0x0000,0x0000, 0x0020,0x0148,0x0000, 0x0020,0x0000,0x0000, /* 30BD */ +0x0020,0x0148,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0148,0x0000, /* 30C0 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0148,0x0000, /* 30C3 */ +0x0020,0x0000,0x0000, 0x0020,0x0148,0x0000, 0x0020,0x0000,0x0000, /* 30C6 */ +0x0020,0x0148,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 30C9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 30CC */ +0x0020,0x0000,0x0000, 0x0020,0x0148,0x0000, 0x0020,0x0149,0x0000, /* 30CF */ +0x0020,0x0000,0x0000, 0x0020,0x0148,0x0000, 0x0020,0x0149,0x0000, /* 30D2 */ +0x0020,0x0000,0x0000, 0x0020,0x0148,0x0000, 0x0020,0x0149,0x0000, /* 30D5 */ +0x0020,0x0000,0x0000, 0x0020,0x0148,0x0000, 0x0020,0x0149,0x0000, /* 30D8 */ +0x0020,0x0000,0x0000, 0x0020,0x0148,0x0000, 0x0020,0x0149,0x0000, /* 30DB */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 30DE */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 30E1 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 30E4 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 30E7 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 30EA */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 30ED */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 30F0 */ +0x0020,0x0000,0x0000, 0x0020,0x0148,0x0000, 0x0020,0x0000,0x0000, /* 30F3 */ +0x0020,0x0000,0x0000, 0x0020,0x0148,0x0000, 0x0020,0x0148,0x0000, /* 30F6 */ +0x0020,0x0148,0x0000, 0x0020,0x0148,0x0000, 0x0020,0x0000,0x0000, /* 30F9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0148,0x0000, /* 30FC */ +0x0020,0x0020,0x0000 }; + +static const uint16 uca520_p031_w2[]= { /* 3100 (3 weights per char) */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 3100 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 3103 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 3106 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 3109 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 310C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 310F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 3112 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 3115 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 3118 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 311B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 311E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 3121 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 3124 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 3127 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 312A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 312D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 3130 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 3133 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 3136 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 3139 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 313C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 313F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 3142 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 3145 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 3148 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 314B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 314E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 3151 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 3154 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 3157 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 315A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 315D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 3160 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 3163 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 3166 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 3169 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 316C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 316F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 3172 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 3175 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 3178 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 317B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 317E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 3181 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 3184 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 3187 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 318A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 318D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 3190 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 3193 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 3196 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 3199 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 319C */ +0x0020,0x0000,0x0000, 0x0020,0x015A,0x0000, 0x0020,0x015A,0x0000, /* 319F */ +0x0020,0x015A,0x0000, 0x0020,0x015A,0x0000, 0x0020,0x0000,0x0000, /* 31A2 */ +0x0020,0x015A,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x015A,0x0000, /* 31A5 */ +0x0020,0x015C,0x0000, 0x0020,0x015A,0x0000, 0x0020,0x015A,0x0000, /* 31A8 */ +0x0020,0x015A,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 31AB */ +0x0020,0x015A,0x0000, 0x0020,0x015A,0x0000, 0x0020,0x0000,0x0000, /* 31AE */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x015A,0x0000, /* 31B1 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 31B4 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 31B7 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 31BA */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 31BD */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 31C0 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 31C3 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 31C6 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 31C9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 31CC */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 31CF */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 31D2 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 31D5 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 31D8 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 31DB */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 31DE */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 31E1 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 31E4 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 31E7 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 31EA */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 31ED */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 31F0 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 31F3 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 31F6 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 31F9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 31FC */ +0x0020,0x0000,0x0000 }; + +static const uint16 uca520_p032_w2[]= { /* 3200 (8 weights per char) */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3200 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3201 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3202 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3203 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3204 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3205 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3206 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3207 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3208 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3209 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 320A */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 320B */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 320C */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 320D */ +0x0020,0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 320E */ +0x0020,0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 320F */ +0x0020,0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 3210 */ +0x0020,0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 3211 */ +0x0020,0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 3212 */ +0x0020,0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 3213 */ +0x0020,0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 3214 */ +0x0020,0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 3215 */ +0x0020,0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 3216 */ +0x0020,0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 3217 */ +0x0020,0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 3218 */ +0x0020,0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 3219 */ +0x0020,0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 321A */ +0x0020,0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 321B */ +0x0020,0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 321C */ +0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0000, /* 321D */ +0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0000,0x0000, /* 321E */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 321F */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3220 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3221 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3222 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3223 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3224 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3225 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3226 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3227 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3228 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3229 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 322A */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 322B */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 322C */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 322D */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 322E */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 322F */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3230 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3231 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3232 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3233 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3234 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3235 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3236 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3237 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3238 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3239 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 323A */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 323B */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 323C */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 323D */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 323E */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 323F */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3240 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3241 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3242 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3243 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3244 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3245 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3246 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3247 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3248 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3249 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 324A */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 324B */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 324C */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 324D */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 324E */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 324F */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3250 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3251 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3252 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3253 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3254 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3255 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3256 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3257 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3258 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3259 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 325A */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 325B */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 325C */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 325D */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 325E */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 325F */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3260 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3261 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3262 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3263 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3264 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3265 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3266 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3267 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3268 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3269 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 326A */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 326B */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 326C */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 326D */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 326E */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 326F */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3270 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3271 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3272 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3273 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3274 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3275 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3276 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3277 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3278 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3279 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 327A */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 327B */ +0x0020,0x0020,0x0020,0x0020,0x0020,0x0000,0x0000,0x0000, /* 327C */ +0x0020,0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 327D */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 327E */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 327F */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3280 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3281 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3282 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3283 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3284 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3285 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3286 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3287 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3288 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3289 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 328A */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 328B */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 328C */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 328D */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 328E */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 328F */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3290 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3291 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3292 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3293 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3294 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3295 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3296 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3297 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3298 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3299 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 329A */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 329B */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 329C */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 329D */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 329E */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 329F */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32A0 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32A1 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32A2 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32A3 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32A4 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32A5 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32A6 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32A7 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32A8 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32A9 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32AA */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32AB */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32AC */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32AD */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32AE */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32AF */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32B0 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32B1 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32B2 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32B3 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32B4 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32B5 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32B6 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32B7 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32B8 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32B9 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32BA */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32BB */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32BC */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32BD */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32BE */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32BF */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32C0 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32C1 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32C2 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32C3 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32C4 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32C5 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32C6 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32C7 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32C8 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32C9 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32CA */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32CB */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32CC */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32CD */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32CE */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32CF */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32D0 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32D1 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32D2 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32D3 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32D4 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32D5 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32D6 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32D7 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32D8 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32D9 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32DA */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32DB */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32DC */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32DD */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32DE */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32DF */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32E0 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32E1 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32E2 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32E3 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32E4 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32E5 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32E6 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32E7 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32E8 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32E9 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32EA */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32EB */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32EC */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32ED */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32EE */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32EF */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32F0 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32F1 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32F2 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32F3 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32F4 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32F5 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32F6 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32F7 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32F8 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32F9 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32FA */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32FB */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32FC */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32FD */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* 32FE */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000 /* 32FF */ +}; + +static const uint16 uca520_p033_w2[]= { /* 3300 (7 weights per char) */ +0x0020,0x0020,0x0149,0x0020,0x0020,0x0000,0x0000, /* 3300 */ +0x0020,0x0020,0x0020,0x0020,0x0000,0x0000,0x0000, /* 3301 */ +0x0020,0x0020,0x0020,0x0149,0x0020,0x0000,0x0000, /* 3302 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 3303 */ +0x0020,0x0020,0x0020,0x0020,0x0148,0x0000,0x0000, /* 3304 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 3305 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 3306 */ +0x0020,0x0020,0x0020,0x0020,0x0020,0x0148,0x0000, /* 3307 */ +0x0020,0x0020,0x0020,0x0020,0x0000,0x0000,0x0000, /* 3308 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 3309 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 330A */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 330B */ +0x0020,0x0020,0x0020,0x0020,0x0000,0x0000,0x0000, /* 330C */ +0x0020,0x0020,0x0020,0x0020,0x0000,0x0000,0x0000, /* 330D */ +0x0020,0x0148,0x0020,0x0020,0x0000,0x0000,0x0000, /* 330E */ +0x0020,0x0148,0x0020,0x0020,0x0000,0x0000,0x0000, /* 330F */ +0x0020,0x0148,0x0020,0x0148,0x0000,0x0000,0x0000, /* 3310 */ +0x0020,0x0148,0x0020,0x0020,0x0000,0x0000,0x0000, /* 3311 */ +0x0020,0x0020,0x0020,0x0020,0x0000,0x0000,0x0000, /* 3312 */ +0x0020,0x0148,0x0020,0x0020,0x0148,0x0020,0x0000, /* 3313 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3314 */ +0x0020,0x0020,0x0020,0x0148,0x0020,0x0020,0x0000, /* 3315 */ +0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0000, /* 3316 */ +0x0020,0x0020,0x0020,0x0020,0x0020,0x0000,0x0000, /* 3317 */ +0x0020,0x0148,0x0020,0x0020,0x0000,0x0000,0x0000, /* 3318 */ +0x0020,0x0148,0x0020,0x0020,0x0020,0x0020,0x0000, /* 3319 */ +0x0020,0x0020,0x0020,0x0148,0x0020,0x0020,0x0000, /* 331A */ +0x0020,0x0020,0x0020,0x0020,0x0000,0x0000,0x0000, /* 331B */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 331C */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 331D */ +0x0020,0x0020,0x0020,0x0149,0x0000,0x0000,0x0000, /* 331E */ +0x0020,0x0020,0x0020,0x0020,0x0000,0x0000,0x0000, /* 331F */ +0x0020,0x0020,0x0020,0x0020,0x0020,0x0000,0x0000, /* 3320 */ +0x0020,0x0020,0x0020,0x0020,0x0148,0x0000,0x0000, /* 3321 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 3322 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 3323 */ +0x0020,0x0148,0x0020,0x0020,0x0000,0x0000,0x0000, /* 3324 */ +0x0020,0x0148,0x0020,0x0000,0x0000,0x0000,0x0000, /* 3325 */ +0x0020,0x0148,0x0020,0x0000,0x0000,0x0000,0x0000, /* 3326 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3327 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3328 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 3329 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 332A */ +0x0020,0x0149,0x0020,0x0020,0x0020,0x0020,0x0000, /* 332B */ +0x0020,0x0149,0x0020,0x0020,0x0000,0x0000,0x0000, /* 332C */ +0x0020,0x0148,0x0020,0x0020,0x0020,0x0000,0x0000, /* 332D */ +0x0020,0x0149,0x0020,0x0020,0x0020,0x0020,0x0000, /* 332E */ +0x0020,0x0149,0x0020,0x0020,0x0000,0x0000,0x0000, /* 332F */ +0x0020,0x0149,0x0020,0x0000,0x0000,0x0000,0x0000, /* 3330 */ +0x0020,0x0148,0x0020,0x0000,0x0000,0x0000,0x0000, /* 3331 */ +0x0020,0x0020,0x0020,0x0020,0x0020,0x0148,0x0000, /* 3332 */ +0x0020,0x0020,0x0020,0x0020,0x0000,0x0000,0x0000, /* 3333 */ +0x0020,0x0148,0x0020,0x0020,0x0020,0x0020,0x0000, /* 3334 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 3335 */ +0x0020,0x0020,0x0020,0x0020,0x0020,0x0000,0x0000, /* 3336 */ +0x0020,0x0149,0x0020,0x0000,0x0000,0x0000,0x0000, /* 3337 */ +0x0020,0x0149,0x0020,0x0020,0x0000,0x0000,0x0000, /* 3338 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 3339 */ +0x0020,0x0149,0x0020,0x0020,0x0000,0x0000,0x0000, /* 333A */ +0x0020,0x0149,0x0020,0x0020,0x0148,0x0000,0x0000, /* 333B */ +0x0020,0x0148,0x0020,0x0020,0x0000,0x0000,0x0000, /* 333C */ +0x0020,0x0149,0x0020,0x0020,0x0020,0x0000,0x0000, /* 333D */ +0x0020,0x0148,0x0020,0x0020,0x0000,0x0000,0x0000, /* 333E */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 333F */ +0x0020,0x0149,0x0020,0x0020,0x0148,0x0000,0x0000, /* 3340 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 3341 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 3342 */ +0x0020,0x0020,0x0020,0x0020,0x0000,0x0000,0x0000, /* 3343 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 3344 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 3345 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 3346 */ +0x0020,0x0020,0x0020,0x0020,0x0020,0x0000,0x0000, /* 3347 */ +0x0020,0x0020,0x0020,0x0020,0x0000,0x0000,0x0000, /* 3348 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3349 */ +0x0020,0x0020,0x0020,0x0148,0x0020,0x0020,0x0000, /* 334A */ +0x0020,0x0020,0x0148,0x0000,0x0000,0x0000,0x0000, /* 334B */ +0x0020,0x0020,0x0148,0x0020,0x0020,0x0000,0x0000, /* 334C */ +0x0020,0x0020,0x0020,0x0020,0x0000,0x0000,0x0000, /* 334D */ +0x0020,0x0020,0x0020,0x0148,0x0000,0x0000,0x0000, /* 334E */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 334F */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 3350 */ +0x0020,0x0020,0x0020,0x0020,0x0000,0x0000,0x0000, /* 3351 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3352 */ +0x0020,0x0020,0x0149,0x0020,0x0000,0x0000,0x0000, /* 3353 */ +0x0020,0x0020,0x0020,0x0148,0x0020,0x0000,0x0000, /* 3354 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3355 */ +0x0020,0x0020,0x0020,0x0020,0x0148,0x0020,0x0000, /* 3356 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 3357 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3358 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3359 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 335A */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 335B */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 335C */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 335D */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 335E */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 335F */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3360 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3361 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 3362 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 3363 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 3364 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 3365 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 3366 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 3367 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 3368 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 3369 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 336A */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 336B */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 336C */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 336D */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 336E */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 336F */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 3370 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 3371 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3372 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3373 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 3374 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3375 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3376 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3377 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 3378 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 3379 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 337A */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 337B */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 337C */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 337D */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 337E */ +0x0020,0x0020,0x0020,0x0020,0x0000,0x0000,0x0000, /* 337F */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3380 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3381 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3382 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3383 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3384 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3385 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3386 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3387 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 3388 */ +0x0020,0x0020,0x0020,0x0020,0x0000,0x0000,0x0000, /* 3389 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 338A */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 338B */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 338C */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 338D */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 338E */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 338F */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3390 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 3391 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 3392 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 3393 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 3394 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3395 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3396 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3397 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3398 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 3399 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 339A */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 339B */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 339C */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 339D */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 339E */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 339F */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 33A0 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 33A1 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 33A2 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 33A3 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 33A4 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 33A5 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 33A6 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 33A7 */ +0x0020,0x0020,0x0020,0x0020,0x0000,0x0000,0x0000, /* 33A8 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 33A9 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 33AA */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 33AB */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 33AC */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 33AD */ +0x0020,0x0020,0x0020,0x0020,0x0020,0x0000,0x0000, /* 33AE */ +0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0000, /* 33AF */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 33B0 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 33B1 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 33B2 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 33B3 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 33B4 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 33B5 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 33B6 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 33B7 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 33B8 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 33B9 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 33BA */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 33BB */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 33BC */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 33BD */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 33BE */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 33BF */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 33C0 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 33C1 */ +0x0020,0x0020,0x0020,0x0020,0x0000,0x0000,0x0000, /* 33C2 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 33C3 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 33C4 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 33C5 */ +0x0020,0x0020,0x0020,0x0020,0x0000,0x0000,0x0000, /* 33C6 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 33C7 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 33C8 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 33C9 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 33CA */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 33CB */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 33CC */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 33CD */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 33CE */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 33CF */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 33D0 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 33D1 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 33D2 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 33D3 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 33D4 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 33D5 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 33D6 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 33D7 */ +0x0020,0x0020,0x0020,0x0020,0x0000,0x0000,0x0000, /* 33D8 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 33D9 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 33DA */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 33DB */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 33DC */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 33DD */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 33DE */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 33DF */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 33E0 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 33E1 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 33E2 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 33E3 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 33E4 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 33E5 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 33E6 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 33E7 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* 33E8 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 33E9 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 33EA */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 33EB */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 33EC */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 33ED */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 33EE */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 33EF */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 33F0 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 33F1 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 33F2 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 33F3 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 33F4 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 33F5 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 33F6 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 33F7 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 33F8 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 33F9 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 33FA */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 33FB */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 33FC */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 33FD */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000, /* 33FE */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000 /* 33FF */ +}; + +static const uint16 uca520_p0A6_w2[]= { /* A600 (3 weights per char) */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A600 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A603 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A606 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A609 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A60C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A60F */ +0x0020,0x0000,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* A612 */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* A615 */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* A618 */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* A61B */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0184,0x0000, /* A61E */ +0x0020,0x0184,0x0000, 0x0020,0x0184,0x0000, 0x0020,0x0184,0x0000, /* A621 */ +0x0020,0x0184,0x0000, 0x0020,0x0184,0x0000, 0x0020,0x0184,0x0000, /* A624 */ +0x0020,0x0184,0x0000, 0x0020,0x0184,0x0000, 0x0020,0x0184,0x0000, /* A627 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A62A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A62D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A630 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A633 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A636 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A639 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A63C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A63F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A642 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A645 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A648 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A64B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A64E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A651 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A654 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A657 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A65A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A65D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A660 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A663 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A666 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A669 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A66C */ +0x0084,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, /* A66F */ +0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A672 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A675 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A678 */ +0x0020,0x0000,0x0000, 0x005F,0x0000,0x0000, 0x005F,0x0000,0x0000, /* A67B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A67E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A681 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A684 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A687 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A68A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A68D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A690 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A693 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A696 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A699 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A69C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A69F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A6A2 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A6A5 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A6A8 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A6AB */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A6AE */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A6B1 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A6B4 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A6B7 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A6BA */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A6BD */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A6C0 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A6C3 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A6C6 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A6C9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A6CC */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A6CF */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A6D2 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A6D5 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A6D8 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A6DB */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A6DE */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A6E1 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A6E4 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A6E7 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A6EA */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A6ED */ +0x00D8,0x0000,0x0000, 0x00D9,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A6F0 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A6F3 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A6F6 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A6F9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A6FC */ +0x0020,0x0000,0x0000 }; + +static const uint16 uca520_p0A7_w2[]= { /* A700 (4 weights per char) */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A700 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A702 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A704 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A706 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A708 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A70A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A70C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A70E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A710 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A712 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A714 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A716 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A718 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A71A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A71C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A71E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A720 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A722 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A724 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A726 */ +0x0020,0x0020,0x0000,0x0000, 0x0020,0x0020,0x0000,0x0000, /* A728 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A72A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A72C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A72E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A730 */ +0x0020,0x0020,0x0000,0x0000, 0x0020,0x0020,0x0000,0x0000, /* A732 */ +0x0020,0x0020,0x0000,0x0000, 0x0020,0x0020,0x0000,0x0000, /* A734 */ +0x0020,0x0020,0x0000,0x0000, 0x0020,0x0020,0x0000,0x0000, /* A736 */ +0x0020,0x0020,0x0000,0x0000, 0x0020,0x0020,0x0000,0x0000, /* A738 */ +0x0020,0x0159,0x0020,0x0000, 0x0020,0x0159,0x0020,0x0000, /* A73A */ +0x0020,0x0020,0x0000,0x0000, 0x0020,0x0020,0x0000,0x0000, /* A73C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A73E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A740 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A742 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A744 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A746 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A748 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A74A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A74C */ +0x0020,0x0020,0x0000,0x0000, 0x0020,0x0020,0x0000,0x0000, /* A74E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A750 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A752 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A754 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A756 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A758 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A75A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A75C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A75E */ +0x0020,0x0020,0x0000,0x0000, 0x0020,0x0020,0x0000,0x0000, /* A760 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A762 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A764 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A766 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A768 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A76A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A76C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A76E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A770 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A772 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A774 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A776 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x015A,0x0000,0x0000, /* A778 */ +0x0020,0x015A,0x0000,0x0000, 0x0020,0x015A,0x0000,0x0000, /* A77A */ +0x0020,0x015A,0x0000,0x0000, 0x0020,0x015A,0x0000,0x0000, /* A77C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A77E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A780 */ +0x0020,0x015A,0x0000,0x0000, 0x0020,0x015A,0x0000,0x0000, /* A782 */ +0x0020,0x015A,0x0000,0x0000, 0x0020,0x015A,0x0000,0x0000, /* A784 */ +0x0020,0x015A,0x0000,0x0000, 0x0020,0x015A,0x0000,0x0000, /* A786 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A788 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A78A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A78C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A78E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A790 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A792 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A794 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A796 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A798 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A79A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A79C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A79E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A7A0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A7A2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A7A4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A7A6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A7A8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A7AA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A7AC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A7AE */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A7B0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A7B2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A7B4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A7B6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A7B8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A7BA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A7BC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A7BE */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A7C0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A7C2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A7C4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A7C6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A7C8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A7CA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A7CC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A7CE */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A7D0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A7D2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A7D4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A7D6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A7D8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A7DA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A7DC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A7DE */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A7E0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A7E2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A7E4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A7E6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A7E8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A7EA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A7EC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A7EE */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A7F0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A7F2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A7F4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A7F6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A7F8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A7FA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* A7FC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000 /* A7FE */ +}; + +static const uint16 uca520_p0A8_w2[]= { /* A800 (3 weights per char) */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A800 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A803 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A806 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x010A,0x0000,0x0000, /* A809 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A80C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A80F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A812 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A815 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A818 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A81B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A81E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A821 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A824 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A827 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A82A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A82D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A830 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A833 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A836 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A839 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A83C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A83F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A842 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A845 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A848 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A84B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A84E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A851 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A854 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A857 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A85A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A85D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A860 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A863 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A866 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A869 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A86C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A86F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A872 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A875 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A878 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A87B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x010B,0x0000,0x0000, /* A87E */ +0x010C,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A881 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A884 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A887 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A88A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A88D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A890 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A893 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A896 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A899 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A89C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A89F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A8A2 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A8A5 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A8A8 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A8AB */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A8AE */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A8B1 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A8B4 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A8B7 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A8BA */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A8BD */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A8C0 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A8C3 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A8C6 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A8C9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A8CC */ +0x0020,0x0000,0x0000, 0x0020,0x016F,0x0000, 0x0020,0x016F,0x0000, /* A8CF */ +0x0020,0x016F,0x0000, 0x0020,0x016F,0x0000, 0x0020,0x016F,0x0000, /* A8D2 */ +0x0020,0x016F,0x0000, 0x0020,0x016F,0x0000, 0x0020,0x016F,0x0000, /* A8D5 */ +0x0020,0x016F,0x0000, 0x0020,0x016F,0x0000, 0x0020,0x0000,0x0000, /* A8D8 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A8DB */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0000,0x0000,0x0000, /* A8DE */ +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, /* A8E1 */ +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, /* A8E4 */ +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, /* A8E7 */ +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, /* A8EA */ +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, /* A8ED */ +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A8F0 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A8F3 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A8F6 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A8F9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A8FC */ +0x0020,0x0000,0x0000 }; + +static const uint16 uca520_p0A9_w2[]= { /* A900 (3 weights per char) */ +0x0020,0x0179,0x0000, 0x0020,0x0179,0x0000, 0x0020,0x0179,0x0000, /* A900 */ +0x0020,0x0179,0x0000, 0x0020,0x0179,0x0000, 0x0020,0x0179,0x0000, /* A903 */ +0x0020,0x0179,0x0000, 0x0020,0x0179,0x0000, 0x0020,0x0179,0x0000, /* A906 */ +0x0020,0x0179,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A909 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A90C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A90F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A912 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A915 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A918 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A91B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A91E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A921 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A924 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A927 */ +0x0020,0x0000,0x0000, 0x012A,0x0000,0x0000, 0x012B,0x0000,0x0000, /* A92A */ +0x012C,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A92D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A930 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A933 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A936 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A939 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A93C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A93F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A942 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A945 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A948 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A94B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A94E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A951 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A954 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A957 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A95A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A95D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A960 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A963 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A966 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A969 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A96C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A96F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A972 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A975 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A978 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A97B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0102,0x0000,0x0000, /* A97E */ +0x0103,0x0000,0x0000, 0x0104,0x0000,0x0000, 0x0105,0x0000,0x0000, /* A981 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A984 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A987 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A98A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A98D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A990 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A993 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A996 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A999 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A99C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A99F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A9A2 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A9A5 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A9A8 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A9AB */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A9AE */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0101,0x0000,0x0000, /* A9B1 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A9B4 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A9B7 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A9BA */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A9BD */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A9C0 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A9C3 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A9C6 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A9C9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A9CC */ +0x0020,0x0000,0x0000, 0x0020,0x0180,0x0000, 0x0020,0x0180,0x0000, /* A9CF */ +0x0020,0x0180,0x0000, 0x0020,0x0180,0x0000, 0x0020,0x0180,0x0000, /* A9D2 */ +0x0020,0x0180,0x0000, 0x0020,0x0180,0x0000, 0x0020,0x0180,0x0000, /* A9D5 */ +0x0020,0x0180,0x0000, 0x0020,0x0180,0x0000, 0x0020,0x0000,0x0000, /* A9D8 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A9DB */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A9DE */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A9E1 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A9E4 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A9E7 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A9EA */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A9ED */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A9F0 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A9F3 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A9F6 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A9F9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* A9FC */ +0x0020,0x0000,0x0000 }; + +static const uint16 uca520_p0AA_w2[]= { /* AA00 (3 weights per char) */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AA00 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AA03 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AA06 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AA09 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AA0C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AA0F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AA12 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AA15 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AA18 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AA1B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AA1E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AA21 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AA24 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AA27 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AA2A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AA2D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AA30 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AA33 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AA36 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AA39 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AA3C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AA3F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AA42 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AA45 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AA48 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AA4B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x017E,0x0000, /* AA4E */ +0x0020,0x017E,0x0000, 0x0020,0x017E,0x0000, 0x0020,0x017E,0x0000, /* AA51 */ +0x0020,0x017E,0x0000, 0x0020,0x017E,0x0000, 0x0020,0x017E,0x0000, /* AA54 */ +0x0020,0x017E,0x0000, 0x0020,0x017E,0x0000, 0x0020,0x017E,0x0000, /* AA57 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AA5A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AA5D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AA60 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AA63 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AA66 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AA69 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AA6C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AA6F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AA72 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AA75 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AA78 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AA7B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AA7E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AA81 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AA84 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AA87 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AA8A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AA8D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AA90 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AA93 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AA96 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AA99 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AA9C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AA9F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AAA2 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AAA5 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AAA8 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AAAB */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AAAE */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AAB1 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AAB4 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AAB7 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AABA */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0124,0x0000,0x0000, /* AABD */ +0x0020,0x0000,0x0000, 0x0125,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AAC0 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AAC3 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AAC6 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AAC9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AACC */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AACF */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AAD2 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AAD5 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AAD8 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AADB */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AADE */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AAE1 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AAE4 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AAE7 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AAEA */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AAED */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AAF0 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AAF3 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AAF6 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AAF9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AAFC */ +0x0020,0x0000,0x0000 }; + +static const uint16 uca520_p0AB_w2[]= { /* AB00 (3 weights per char) */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AB00 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AB03 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AB06 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AB09 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AB0C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AB0F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AB12 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AB15 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AB18 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AB1B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AB1E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AB21 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AB24 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AB27 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AB2A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AB2D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AB30 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AB33 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AB36 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AB39 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AB3C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AB3F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AB42 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AB45 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AB48 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AB4B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AB4E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AB51 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AB54 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AB57 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AB5A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AB5D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AB60 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AB63 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AB66 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AB69 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AB6C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AB6F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AB72 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AB75 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AB78 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AB7B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AB7E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AB81 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AB84 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AB87 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AB8A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AB8D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AB90 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AB93 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AB96 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AB99 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AB9C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* AB9F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* ABA2 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* ABA5 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* ABA8 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* ABAB */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* ABAE */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* ABB1 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* ABB4 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* ABB7 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* ABBA */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* ABBD */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* ABC0 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* ABC3 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* ABC6 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* ABC9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* ABCC */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* ABCF */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* ABD2 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* ABD5 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* ABD8 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* ABDB */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* ABDE */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* ABE1 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* ABE4 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* ABE7 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0109,0x0000,0x0000, /* ABEA */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* ABED */ +0x0020,0x016E,0x0000, 0x0020,0x016E,0x0000, 0x0020,0x016E,0x0000, /* ABF0 */ +0x0020,0x016E,0x0000, 0x0020,0x016E,0x0000, 0x0020,0x016E,0x0000, /* ABF3 */ +0x0020,0x016E,0x0000, 0x0020,0x016E,0x0000, 0x0020,0x016E,0x0000, /* ABF6 */ +0x0020,0x016E,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* ABF9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* ABFC */ +0x0020,0x0000,0x0000 }; + +static const uint16 uca520_p0FB_w2[]= { /* FB00 (4 weights per char) */ +0x0020,0x0020,0x0000,0x0000, 0x0020,0x0020,0x0000,0x0000, /* FB00 */ +0x0020,0x0020,0x0000,0x0000, 0x0020,0x0020,0x0020,0x0000, /* FB02 */ +0x0020,0x0020,0x0020,0x0000, 0x0020,0x015A,0x0020,0x0000, /* FB04 */ +0x0020,0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FB06 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FB08 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FB0A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FB0C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FB0E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FB10 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0020,0x0000,0x0000, /* FB12 */ +0x0020,0x0020,0x0000,0x0000, 0x0020,0x0020,0x0000,0x0000, /* FB14 */ +0x0020,0x0020,0x0000,0x0000, 0x0020,0x0020,0x0000,0x0000, /* FB16 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FB18 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FB1A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0089,0x0000,0x0000, /* FB1C */ +0x0096,0x0000,0x0000,0x0000, 0x0020,0x0020,0x008C,0x0000, /* FB1E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FB20 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FB22 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FB24 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FB26 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FB28 */ +0x0020,0x0091,0x0000,0x0000, 0x0020,0x0090,0x0000,0x0000, /* FB2A */ +0x0020,0x0092,0x0091,0x0000, 0x0020,0x0092,0x0090,0x0000, /* FB2C */ +0x0020,0x008C,0x0000,0x0000, 0x0020,0x008D,0x0000,0x0000, /* FB2E */ +0x0020,0x0092,0x0000,0x0000, 0x0020,0x0092,0x0000,0x0000, /* FB30 */ +0x0020,0x0092,0x0000,0x0000, 0x0020,0x0092,0x0000,0x0000, /* FB32 */ +0x0020,0x0092,0x0000,0x0000, 0x0020,0x0092,0x0000,0x0000, /* FB34 */ +0x0020,0x0092,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FB36 */ +0x0020,0x0092,0x0000,0x0000, 0x0020,0x0092,0x0000,0x0000, /* FB38 */ +0x0020,0x0092,0x0000,0x0000, 0x0020,0x0092,0x0000,0x0000, /* FB3A */ +0x0020,0x0092,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FB3C */ +0x0020,0x0092,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FB3E */ +0x0020,0x0092,0x0000,0x0000, 0x0020,0x0092,0x0000,0x0000, /* FB40 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0092,0x0000,0x0000, /* FB42 */ +0x0020,0x0092,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FB44 */ +0x0020,0x0092,0x0000,0x0000, 0x0020,0x0092,0x0000,0x0000, /* FB46 */ +0x0020,0x0092,0x0000,0x0000, 0x0020,0x0092,0x0000,0x0000, /* FB48 */ +0x0020,0x0092,0x0000,0x0000, 0x0020,0x008E,0x0000,0x0000, /* FB4A */ +0x0020,0x0095,0x0000,0x0000, 0x0020,0x0095,0x0000,0x0000, /* FB4C */ +0x0020,0x0095,0x0000,0x0000, 0x0020,0x0020,0x0000,0x0000, /* FB4E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FB50 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FB52 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FB54 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FB56 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FB58 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FB5A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FB5C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FB5E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FB60 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FB62 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FB64 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FB66 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FB68 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FB6A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FB6C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FB6E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FB70 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FB72 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FB74 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FB76 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FB78 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FB7A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FB7C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FB7E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FB80 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FB82 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FB84 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FB86 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FB88 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FB8A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FB8C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FB8E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FB90 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FB92 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FB94 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FB96 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FB98 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FB9A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FB9C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FB9E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FBA0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FBA2 */ +0x0020,0x00B1,0x0000,0x0000, 0x0020,0x00B1,0x0000,0x0000, /* FBA4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FBA6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FBA8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FBAA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FBAC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FBAE */ +0x0020,0x00B1,0x0000,0x0000, 0x0020,0x00B1,0x0000,0x0000, /* FBB0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FBB2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FBB4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FBB6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FBB8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FBBA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FBBC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FBBE */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FBC0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FBC2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FBC4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FBC6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FBC8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FBCA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FBCC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FBCE */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FBD0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FBD2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FBD4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FBD6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FBD8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FBDA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0020,0x0000,0x0000, /* FBDC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FBDE */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FBE0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FBE2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FBE4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FBE6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FBE8 */ +0x0020,0x0020,0x0000,0x0000, 0x0020,0x0020,0x0000,0x0000, /* FBEA */ +0x0020,0x0020,0x0000,0x0000, 0x0020,0x0020,0x0000,0x0000, /* FBEC */ +0x0020,0x0020,0x0000,0x0000, 0x0020,0x0020,0x0000,0x0000, /* FBEE */ +0x0020,0x0020,0x0000,0x0000, 0x0020,0x0020,0x0000,0x0000, /* FBF0 */ +0x0020,0x0020,0x0000,0x0000, 0x0020,0x0020,0x0000,0x0000, /* FBF2 */ +0x0020,0x0020,0x0000,0x0000, 0x0020,0x0020,0x0000,0x0000, /* FBF4 */ +0x0020,0x0020,0x0000,0x0000, 0x0020,0x0020,0x0000,0x0000, /* FBF6 */ +0x0020,0x0020,0x0000,0x0000, 0x0020,0x0020,0x0000,0x0000, /* FBF8 */ +0x0020,0x0020,0x0000,0x0000, 0x0020,0x0020,0x0000,0x0000, /* FBFA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FBFC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000 /* FBFE */ +}; + +static const uint16 uca520_p0FC_w2[]= { /* FC00 (3 weights per char) */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FC00 */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FC03 */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FC06 */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FC09 */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FC0C */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FC0F */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FC12 */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FC15 */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FC18 */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FC1B */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FC1E */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FC21 */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FC24 */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FC27 */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FC2A */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FC2D */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FC30 */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FC33 */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FC36 */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FC39 */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FC3C */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FC3F */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FC42 */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FC45 */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FC48 */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FC4B */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FC4E */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FC51 */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FC54 */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FC57 */ +0x0020,0x0020,0x0000, 0x0020,0x00BC,0x0000, 0x0020,0x00BC,0x0000, /* FC5A */ +0x0020,0x00BC,0x0000, 0x00A3,0x00AD,0x0000, 0x00A5,0x00AD,0x0000, /* FC5D */ +0x00A7,0x00AD,0x0000, 0x00A9,0x00AD,0x0000, 0x00AB,0x00AD,0x0000, /* FC60 */ +0x00AD,0x00BC,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FC63 */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FC66 */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FC69 */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FC6C */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FC6F */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FC72 */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FC75 */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FC78 */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FC7B */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FC7E */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FC81 */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FC84 */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FC87 */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FC8A */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FC8D */ +0x0020,0x00BC,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FC90 */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FC93 */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FC96 */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FC99 */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FC9C */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FC9F */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FCA2 */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FCA5 */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FCA8 */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FCAB */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FCAE */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FCB1 */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FCB4 */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FCB7 */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FCBA */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FCBD */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FCC0 */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FCC3 */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FCC6 */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FCC9 */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FCCC */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FCCF */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FCD2 */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FCD5 */ +0x0020,0x0020,0x0000, 0x0020,0x00BC,0x0000, 0x0020,0x0020,0x0000, /* FCD8 */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FCDB */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FCDE */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FCE1 */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FCE4 */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FCE7 */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FCEA */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FCED */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x00A7,0x00AD,0x0000, /* FCF0 */ +0x00A9,0x00AD,0x0000, 0x00AB,0x00AD,0x0000, 0x0020,0x0020,0x0000, /* FCF3 */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FCF6 */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FCF9 */ +0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, 0x0020,0x0020,0x0000, /* FCFC */ +0x0020,0x0020,0x0000 }; + +static const uint16 uca520_p0FD_w2[]= { /* FD00 (9 weights per char) */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD00 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD01 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD02 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD03 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD04 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD05 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD06 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD07 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD08 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD09 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD0A */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD0B */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD0C */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD0D */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD0E */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD0F */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD10 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD11 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD12 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD13 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD14 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD15 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD16 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD17 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD18 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD19 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD1A */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD1B */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD1C */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD1D */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD1E */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD1F */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD20 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD21 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD22 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD23 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD24 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD25 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD26 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD27 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD28 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD29 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD2A */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD2B */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD2C */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD2D */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD2E */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD2F */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD30 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD31 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD32 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD33 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD34 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD35 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD36 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD37 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD38 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD39 */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD3A */ +0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD3B */ +0x0020,0x00A2,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD3C */ +0x0020,0x00A2,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD3D */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD3E */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD3F */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD40 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD41 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD42 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD43 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD44 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD45 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD46 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD47 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD48 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD49 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD4A */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD4B */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD4C */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD4D */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD4E */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD4F */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD50 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD51 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD52 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD53 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD54 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD55 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD56 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD57 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD58 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD59 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD5A */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD5B */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD5C */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD5D */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD5E */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD5F */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD60 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD61 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD62 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD63 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD64 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD65 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD66 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD67 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD68 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD69 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD6A */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD6B */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD6C */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD6D */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD6E */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD6F */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD70 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD71 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD72 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD73 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD74 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD75 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD76 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD77 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD78 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD79 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD7A */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD7B */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD7C */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD7D */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD7E */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD7F */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD80 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD81 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD82 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD83 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD84 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD85 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD86 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD87 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD88 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD89 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD8A */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD8B */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD8C */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD8D */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD8E */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD8F */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD90 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD91 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD92 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD93 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD94 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD95 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD96 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD97 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD98 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD99 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD9A */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD9B */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD9C */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD9D */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD9E */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FD9F */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDA0 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDA1 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDA2 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDA3 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDA4 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDA5 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDA6 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDA7 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDA8 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDA9 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDAA */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDAB */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDAC */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDAD */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDAE */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDAF */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDB0 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDB1 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDB2 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDB3 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDB4 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDB5 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDB6 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDB7 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDB8 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDB9 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDBA */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDBB */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDBC */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDBD */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDBE */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDBF */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDC0 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDC1 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDC2 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDC3 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDC4 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDC5 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDC6 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDC7 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDC8 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDC9 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDCA */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDCB */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDCC */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDCD */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDCE */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDCF */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDD0 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDD1 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDD2 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDD3 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDD4 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDD5 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDD6 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDD7 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDD8 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDD9 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDDA */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDDB */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDDC */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDDD */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDDE */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDDF */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDE0 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDE1 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDE2 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDE3 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDE4 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDE5 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDE6 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDE7 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDE8 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDE9 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDEA */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDEB */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDEC */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDED */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDEE */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDEF */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDF0 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDF1 */ +0x0020,0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDF2 */ +0x0020,0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDF3 */ +0x0020,0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDF4 */ +0x0020,0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDF5 */ +0x0020,0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDF6 */ +0x0020,0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDF7 */ +0x0020,0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDF8 */ +0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDF9 */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDFA */ +0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0000, /* FDFB */ +0x0020,0x0020,0x0020,0x0020,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDFC */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDFD */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, /* FDFE */ +0x0020,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000 /* FDFF */ +}; + +static const uint16 uca520_p0FE_w2[]= { /* FE00 (4 weights per char) */ +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, /* FE00 */ +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, /* FE02 */ +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, /* FE04 */ +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, /* FE06 */ +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, /* FE08 */ +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, /* FE0A */ +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, /* FE0C */ +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, /* FE0E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FE10 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FE12 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FE14 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FE16 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0020,0x0020,0x0000, /* FE18 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FE1A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FE1C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FE1E */ +0x0082,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, /* FE20 */ +0x0081,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, /* FE22 */ +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, /* FE24 */ +0x0000,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FE26 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FE28 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FE2A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FE2C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FE2E */ +0x0020,0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FE30 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FE32 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FE34 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FE36 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FE38 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FE3A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FE3C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FE3E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FE40 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FE42 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FE44 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FE46 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FE48 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FE4A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FE4C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FE4E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FE50 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FE52 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FE54 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FE56 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FE58 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FE5A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FE5C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FE5E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FE60 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FE62 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FE64 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FE66 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FE68 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FE6A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FE6C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FE6E */ +0x00A2,0x0000,0x0000,0x0000, 0x00A2,0x0000,0x0000,0x0000, /* FE70 */ +0x00A3,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, /* FE72 */ +0x00A5,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FE74 */ +0x00A7,0x0000,0x0000,0x0000, 0x00A7,0x0000,0x0000,0x0000, /* FE76 */ +0x00A9,0x0000,0x0000,0x0000, 0x00A9,0x0000,0x0000,0x0000, /* FE78 */ +0x00AB,0x0000,0x0000,0x0000, 0x00AB,0x0000,0x0000,0x0000, /* FE7A */ +0x00AD,0x0000,0x0000,0x0000, 0x00AD,0x0000,0x0000,0x0000, /* FE7C */ +0x00AF,0x0000,0x0000,0x0000, 0x00AF,0x0000,0x0000,0x0000, /* FE7E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FE80 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FE82 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FE84 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FE86 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FE88 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FE8A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FE8C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FE8E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FE90 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FE92 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FE94 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FE96 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FE98 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FE9A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FE9C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FE9E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FEA0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FEA2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FEA4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FEA6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FEA8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FEAA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FEAC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FEAE */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FEB0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FEB2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FEB4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FEB6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FEB8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FEBA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FEBC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FEBE */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FEC0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FEC2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FEC4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FEC6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FEC8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FECA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FECC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FECE */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FED0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FED2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FED4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FED6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FED8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FEDA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FEDC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FEDE */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FEE0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FEE2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FEE4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FEE6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FEE8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FEEA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FEEC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FEEE */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FEF0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FEF2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0020,0x0000,0x0000, /* FEF4 */ +0x0020,0x0020,0x0000,0x0000, 0x0020,0x0020,0x0000,0x0000, /* FEF6 */ +0x0020,0x0020,0x0000,0x0000, 0x0020,0x0020,0x0000,0x0000, /* FEF8 */ +0x0020,0x0020,0x0000,0x0000, 0x0020,0x0020,0x0000,0x0000, /* FEFA */ +0x0020,0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* FEFC */ +0x0020,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000 /* FEFE */ +}; + +static const uint16 uca520_p0FF_w2[]= { /* FF00 (2 weights per char) */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* FF00 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* FF04 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* FF08 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* FF0C */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* FF10 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* FF14 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* FF18 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* FF1C */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* FF20 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* FF24 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* FF28 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* FF2C */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* FF30 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* FF34 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* FF38 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* FF3C */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* FF40 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* FF44 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* FF48 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* FF4C */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* FF50 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* FF54 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* FF58 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* FF5C */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* FF60 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* FF64 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* FF68 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* FF6C */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* FF70 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* FF74 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* FF78 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* FF7C */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* FF80 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* FF84 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* FF88 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* FF8C */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* FF90 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* FF94 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* FF98 */ +0x0020,0x0000, 0x0020,0x0000, 0x0148,0x0000, 0x0149,0x0000, /* FF9C */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* FFA0 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* FFA4 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* FFA8 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* FFAC */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* FFB0 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* FFB4 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* FFB8 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* FFBC */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* FFC0 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* FFC4 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* FFC8 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* FFCC */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* FFD0 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* FFD4 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* FFD8 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* FFDC */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* FFE0 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* FFE4 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* FFE8 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* FFEC */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* FFF0 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* FFF4 */ +0x0020,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* FFF8 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000 /* FFFC */ +}; + +static const uint16 uca520_p101_w2[]= { /* 10100 (3 weights per char) */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10100 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10103 */ +0x0020,0x0000,0x0000, 0x0020,0x0186,0x0000, 0x0020,0x0186,0x0000, /* 10106 */ +0x0020,0x0186,0x0000, 0x0020,0x0186,0x0000, 0x0020,0x0186,0x0000, /* 10109 */ +0x0020,0x0186,0x0000, 0x0020,0x0186,0x0000, 0x0020,0x0186,0x0000, /* 1010C */ +0x0020,0x0186,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1010F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10112 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10115 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10118 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1011B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1011E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10121 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10124 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10127 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1012A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1012D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10130 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10133 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10136 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10139 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1013C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1013F */ +0x0020,0x0187,0x0000, 0x0020,0x0187,0x0000, 0x0020,0x0000,0x0000, /* 10142 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10145 */ +0x0020,0x0187,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10148 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1014B */ +0x0020,0x0000,0x0000, 0x0020,0x0187,0x0000, 0x0020,0x0000,0x0000, /* 1014E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10151 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10154 */ +0x0020,0x0000,0x0000, 0x0020,0x0187,0x0000, 0x0020,0x0187,0x0000, /* 10157 */ +0x0020,0x0187,0x0000, 0x0020,0x0187,0x0000, 0x0020,0x0187,0x0000, /* 1015A */ +0x0020,0x0187,0x0000, 0x0020,0x0187,0x0000, 0x0020,0x0187,0x0000, /* 1015D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10160 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10163 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10166 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10169 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1016C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1016F */ +0x0020,0x0000,0x0000, 0x0020,0x0187,0x0000, 0x0020,0x0000,0x0000, /* 10172 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10175 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10178 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1017B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1017E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10181 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10184 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10187 */ +0x0020,0x0187,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1018A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1018D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10190 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10193 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10196 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10199 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1019C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1019F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 101A2 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 101A5 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 101A8 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 101AB */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 101AE */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 101B1 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 101B4 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 101B7 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 101BA */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 101BD */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 101C0 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 101C3 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 101C6 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 101C9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 101CC */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 101CF */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 101D2 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 101D5 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 101D8 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 101DB */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 101DE */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 101E1 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 101E4 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 101E7 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 101EA */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 101ED */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 101F0 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 101F3 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 101F6 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 101F9 */ +0x0020,0x0000,0x0000, 0x0158,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 101FC */ +0x0020,0x0000,0x0000 }; + +static const uint16 uca520_p103_w2[]= { /* 10300 (3 weights per char) */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10300 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10303 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10306 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10309 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1030C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1030F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10312 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10315 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10318 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1031B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0189,0x0000, /* 1031E */ +0x0020,0x0189,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10321 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10324 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10327 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1032A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1032D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10330 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10333 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10336 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10339 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1033C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1033F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10342 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10345 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10348 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1034B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1034E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10351 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10354 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10357 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1035A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1035D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10360 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10363 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10366 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10369 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1036C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1036F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10372 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10375 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10378 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1037B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1037E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10381 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10384 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10387 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1038A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1038D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10390 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10393 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10396 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10399 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1039C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1039F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 103A2 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 103A5 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 103A8 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 103AB */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 103AE */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 103B1 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 103B4 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 103B7 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 103BA */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 103BD */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 103C0 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 103C3 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 103C6 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 103C9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 103CC */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x018A,0x0000, /* 103CF */ +0x0020,0x018A,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 103D2 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 103D5 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 103D8 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 103DB */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 103DE */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 103E1 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 103E4 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 103E7 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 103EA */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 103ED */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 103F0 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 103F3 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 103F6 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 103F9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 103FC */ +0x0020,0x0000,0x0000 }; + +static const uint16 uca520_p104_w2[]= { /* 10400 (3 weights per char) */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10400 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10403 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10406 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10409 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1040C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1040F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10412 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10415 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10418 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1041B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1041E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10421 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10424 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10427 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1042A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1042D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10430 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10433 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10436 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10439 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1043C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1043F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10442 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10445 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10448 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1044B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1044E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10451 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10454 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10457 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1045A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1045D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10460 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10463 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10466 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10469 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1046C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1046F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10472 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10475 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10478 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1047B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1047E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10481 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10484 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10487 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1048A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1048D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10490 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10493 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10496 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10499 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1049C */ +0x0020,0x0000,0x0000, 0x0020,0x0164,0x0000, 0x0020,0x0164,0x0000, /* 1049F */ +0x0020,0x0164,0x0000, 0x0020,0x0164,0x0000, 0x0020,0x0164,0x0000, /* 104A2 */ +0x0020,0x0164,0x0000, 0x0020,0x0164,0x0000, 0x0020,0x0164,0x0000, /* 104A5 */ +0x0020,0x0164,0x0000, 0x0020,0x0164,0x0000, 0x0020,0x0000,0x0000, /* 104A8 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 104AB */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 104AE */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 104B1 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 104B4 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 104B7 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 104BA */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 104BD */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 104C0 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 104C3 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 104C6 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 104C9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 104CC */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 104CF */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 104D2 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 104D5 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 104D8 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 104DB */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 104DE */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 104E1 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 104E4 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 104E7 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 104EA */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 104ED */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 104F0 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 104F3 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 104F6 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 104F9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 104FC */ +0x0020,0x0000,0x0000 }; + +static const uint16 uca520_p108_w2[]= { /* 10800 (3 weights per char) */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10800 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10803 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10806 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10809 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1080C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1080F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10812 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10815 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10818 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1081B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1081E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10821 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10824 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10827 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1082A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1082D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10830 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10833 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10836 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10839 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1083C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1083F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10842 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10845 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10848 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1084B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1084E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10851 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10854 */ +0x0020,0x0000,0x0000, 0x0020,0x018E,0x0000, 0x0020,0x018E,0x0000, /* 10857 */ +0x0020,0x018E,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1085A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1085D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10860 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10863 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10866 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10869 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1086C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1086F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10872 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10875 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10878 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1087B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1087E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10881 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10884 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10887 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1088A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1088D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10890 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10893 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10896 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10899 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1089C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1089F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 108A2 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 108A5 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 108A8 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 108AB */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 108AE */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 108B1 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 108B4 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 108B7 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 108BA */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 108BD */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 108C0 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 108C3 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 108C6 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 108C9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 108CC */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 108CF */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 108D2 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 108D5 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 108D8 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 108DB */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 108DE */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 108E1 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 108E4 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 108E7 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 108EA */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 108ED */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 108F0 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 108F3 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 108F6 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 108F9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 108FC */ +0x0020,0x0000,0x0000 }; + +static const uint16 uca520_p109_w2[]= { /* 10900 (3 weights per char) */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10900 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10903 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10906 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10909 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1090C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1090F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10912 */ +0x0020,0x0000,0x0000, 0x0020,0x018D,0x0000, 0x0020,0x0000,0x0000, /* 10915 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x018D,0x0000, /* 10918 */ +0x0020,0x018D,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1091B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1091E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10921 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10924 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10927 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1092A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1092D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10930 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10933 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10936 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10939 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1093C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1093F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10942 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10945 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10948 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1094B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1094E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10951 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10954 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10957 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1095A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1095D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10960 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10963 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10966 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10969 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1096C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1096F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10972 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10975 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10978 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1097B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1097E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10981 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10984 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10987 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1098A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1098D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10990 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10993 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10996 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10999 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1099C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1099F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 109A2 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 109A5 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 109A8 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 109AB */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 109AE */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 109B1 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 109B4 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 109B7 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 109BA */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 109BD */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 109C0 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 109C3 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 109C6 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 109C9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 109CC */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 109CF */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 109D2 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 109D5 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 109D8 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 109DB */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 109DE */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 109E1 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 109E4 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 109E7 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 109EA */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 109ED */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 109F0 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 109F3 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 109F6 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 109F9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 109FC */ +0x0020,0x0000,0x0000 }; + +static const uint16 uca520_p10A_w2[]= { /* 10A00 (3 weights per char) */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10A00 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10A03 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10A06 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10A09 */ +0x0020,0x0000,0x0000, 0x0060,0x0000,0x0000, 0x010D,0x0000,0x0000, /* 10A0C */ +0x010E,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10A0F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10A12 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10A15 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10A18 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10A1B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10A1E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10A21 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10A24 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10A27 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10A2A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10A2D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10A30 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10A33 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x010F,0x0000,0x0000, /* 10A36 */ +0x0110,0x0000,0x0000, 0x0111,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10A39 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10A3C */ +0x0020,0x0000,0x0000, 0x0020,0x0191,0x0000, 0x0020,0x0191,0x0000, /* 10A3F */ +0x0020,0x0191,0x0000, 0x0020,0x0191,0x0000, 0x0020,0x0000,0x0000, /* 10A42 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10A45 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10A48 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10A4B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10A4E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10A51 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10A54 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10A57 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10A5A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10A5D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10A60 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10A63 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10A66 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10A69 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10A6C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10A6F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10A72 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10A75 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10A78 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x018C,0x0000, /* 10A7B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10A7E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10A81 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10A84 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10A87 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10A8A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10A8D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10A90 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10A93 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10A96 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10A99 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10A9C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10A9F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10AA2 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10AA5 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10AA8 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10AAB */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10AAE */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10AB1 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10AB4 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10AB7 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10ABA */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10ABD */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10AC0 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10AC3 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10AC6 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10AC9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10ACC */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10ACF */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10AD2 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10AD5 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10AD8 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10ADB */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10ADE */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10AE1 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10AE4 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10AE7 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10AEA */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10AED */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10AF0 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10AF3 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10AF6 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10AF9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10AFC */ +0x0020,0x0000,0x0000 }; + +static const uint16 uca520_p10B_w2[]= { /* 10B00 (3 weights per char) */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10B00 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10B03 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10B06 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10B09 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10B0C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10B0F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10B12 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10B15 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10B18 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10B1B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10B1E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10B21 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10B24 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10B27 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10B2A */ +0x0020,0x0000,0x0000, 0x0020,0x0159,0x0000, 0x0020,0x0000,0x0000, /* 10B2D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10B30 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10B33 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10B36 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10B39 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10B3C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10B3F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10B42 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10B45 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10B48 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10B4B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10B4E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10B51 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10B54 */ +0x0020,0x0000,0x0000, 0x0020,0x018F,0x0000, 0x0020,0x018F,0x0000, /* 10B57 */ +0x0020,0x018F,0x0000, 0x0020,0x018F,0x0000, 0x0020,0x0000,0x0000, /* 10B5A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10B5D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10B60 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10B63 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10B66 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10B69 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10B6C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10B6F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10B72 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10B75 */ +0x0020,0x0190,0x0000, 0x0020,0x0190,0x0000, 0x0020,0x0190,0x0000, /* 10B78 */ +0x0020,0x0190,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10B7B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10B7E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10B81 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10B84 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10B87 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10B8A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10B8D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10B90 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10B93 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10B96 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10B99 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10B9C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10B9F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10BA2 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10BA5 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10BA8 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10BAB */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10BAE */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10BB1 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10BB4 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10BB7 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10BBA */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10BBD */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10BC0 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10BC3 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10BC6 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10BC9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10BCC */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10BCF */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10BD2 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10BD5 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10BD8 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10BDB */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10BDE */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10BE1 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10BE4 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10BE7 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10BEA */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10BED */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10BF0 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10BF3 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10BF6 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10BF9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10BFC */ +0x0020,0x0000,0x0000 }; + +static const uint16 uca520_p10C_w2[]= { /* 10C00 (3 weights per char) */ +0x0020,0x0000,0x0000, 0x0020,0x0159,0x0000, 0x0020,0x0000,0x0000, /* 10C00 */ +0x0020,0x0000,0x0000, 0x0020,0x0159,0x0000, 0x0020,0x0000,0x0000, /* 10C03 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0159,0x0000, /* 10C06 */ +0x0020,0x0000,0x0000, 0x0020,0x0159,0x0000, 0x0020,0x0000,0x0000, /* 10C09 */ +0x0020,0x0159,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0159,0x0000, /* 10C0C */ +0x0020,0x0000,0x0000, 0x0020,0x0159,0x0000, 0x0020,0x0000,0x0000, /* 10C0F */ +0x0020,0x0159,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10C12 */ +0x0020,0x0159,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0159,0x0000, /* 10C15 */ +0x0020,0x0000,0x0000, 0x0020,0x0159,0x0000, 0x0020,0x0000,0x0000, /* 10C18 */ +0x0020,0x0159,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0159,0x0000, /* 10C1B */ +0x0020,0x0000,0x0000, 0x0020,0x0159,0x0000, 0x0020,0x0000,0x0000, /* 10C1E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10C21 */ +0x0020,0x0000,0x0000, 0x0020,0x0159,0x0000, 0x0020,0x0000,0x0000, /* 10C24 */ +0x0020,0x0159,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0159,0x0000, /* 10C27 */ +0x0020,0x0000,0x0000, 0x0020,0x0159,0x0000, 0x0020,0x0000,0x0000, /* 10C2A */ +0x0020,0x0000,0x0000, 0x0020,0x0159,0x0000, 0x0020,0x0000,0x0000, /* 10C2D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10C30 */ +0x0020,0x0159,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0159,0x0000, /* 10C33 */ +0x0020,0x0000,0x0000, 0x0020,0x0159,0x0000, 0x0020,0x0000,0x0000, /* 10C36 */ +0x0020,0x0159,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0159,0x0000, /* 10C39 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10C3C */ +0x0020,0x0000,0x0000, 0x0020,0x0159,0x0000, 0x0020,0x0000,0x0000, /* 10C3F */ +0x0020,0x0159,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0159,0x0000, /* 10C42 */ +0x0020,0x0000,0x0000, 0x0020,0x0159,0x0000, 0x0020,0x0000,0x0000, /* 10C45 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10C48 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10C4B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10C4E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10C51 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10C54 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10C57 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10C5A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10C5D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10C60 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10C63 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10C66 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10C69 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10C6C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10C6F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10C72 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10C75 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10C78 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10C7B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10C7E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10C81 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10C84 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10C87 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10C8A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10C8D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10C90 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10C93 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10C96 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10C99 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10C9C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10C9F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10CA2 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10CA5 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10CA8 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10CAB */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10CAE */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10CB1 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10CB4 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10CB7 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10CBA */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10CBD */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10CC0 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10CC3 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10CC6 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10CC9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10CCC */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10CCF */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10CD2 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10CD5 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10CD8 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10CDB */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10CDE */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10CE1 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10CE4 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10CE7 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10CEA */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10CED */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10CF0 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10CF3 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10CF6 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10CF9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10CFC */ +0x0020,0x0000,0x0000 }; + +static const uint16 uca520_p10E_w2[]= { /* 10E00 (3 weights per char) */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10E00 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10E03 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10E06 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10E09 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10E0C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10E0F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10E12 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10E15 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10E18 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10E1B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10E1E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10E21 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10E24 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10E27 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10E2A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10E2D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10E30 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10E33 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10E36 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10E39 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10E3C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10E3F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10E42 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10E45 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10E48 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10E4B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10E4E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10E51 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10E54 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10E57 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10E5A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10E5D */ +0x0020,0x0161,0x0000, 0x0020,0x0161,0x0000, 0x0020,0x0161,0x0000, /* 10E60 */ +0x0020,0x0161,0x0000, 0x0020,0x0161,0x0000, 0x0020,0x0161,0x0000, /* 10E63 */ +0x0020,0x0161,0x0000, 0x0020,0x0161,0x0000, 0x0020,0x0161,0x0000, /* 10E66 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10E69 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10E6C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10E6F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10E72 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10E75 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10E78 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10E7B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10E7E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10E81 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10E84 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10E87 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10E8A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10E8D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10E90 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10E93 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10E96 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10E99 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10E9C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10E9F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10EA2 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10EA5 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10EA8 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10EAB */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10EAE */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10EB1 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10EB4 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10EB7 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10EBA */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10EBD */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10EC0 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10EC3 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10EC6 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10EC9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10ECC */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10ECF */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10ED2 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10ED5 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10ED8 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10EDB */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10EDE */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10EE1 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10EE4 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10EE7 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10EEA */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10EED */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10EF0 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10EF3 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10EF6 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10EF9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 10EFC */ +0x0020,0x0000,0x0000 }; + +static const uint16 uca520_p110_w2[]= { /* 11000 (3 weights per char) */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 11000 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 11003 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 11006 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 11009 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1100C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1100F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 11012 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 11015 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 11018 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1101B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1101E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 11021 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 11024 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 11027 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1102A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1102D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 11030 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 11033 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 11036 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 11039 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1103C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1103F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 11042 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 11045 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 11048 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1104B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1104E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 11051 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 11054 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 11057 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1105A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1105D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 11060 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 11063 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 11066 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 11069 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1106C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1106F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 11072 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 11075 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 11078 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1107B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0113,0x0000,0x0000, /* 1107E */ +0x0114,0x0000,0x0000, 0x0115,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 11081 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 11084 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 11087 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1108A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1108D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 11090 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 11093 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 11096 */ +0x0020,0x0000,0x0000, 0x0020,0x0112,0x0000, 0x0020,0x0000,0x0000, /* 11099 */ +0x0020,0x0112,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1109C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1109F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 110A2 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 110A5 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 110A8 */ +0x0020,0x0112,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 110AB */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 110AE */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 110B1 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 110B4 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 110B7 */ +0x0112,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 110BA */ +0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 110BD */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 110C0 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 110C3 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 110C6 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 110C9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 110CC */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 110CF */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 110D2 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 110D5 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 110D8 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 110DB */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 110DE */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 110E1 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 110E4 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 110E7 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 110EA */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 110ED */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 110F0 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 110F3 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 110F6 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 110F9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 110FC */ +0x0020,0x0000,0x0000 }; + +static const uint16 uca520_p124_w2[]= { /* 12400 (3 weights per char) */ +0x0020,0x018B,0x0000, 0x0020,0x018B,0x0000, 0x0020,0x018B,0x0000, /* 12400 */ +0x0020,0x018B,0x0000, 0x0020,0x018B,0x0000, 0x0020,0x018B,0x0000, /* 12403 */ +0x0020,0x018B,0x0000, 0x0020,0x018B,0x0000, 0x0020,0x018B,0x0000, /* 12406 */ +0x0020,0x018B,0x0000, 0x0020,0x018B,0x0000, 0x0020,0x018B,0x0000, /* 12409 */ +0x0020,0x018B,0x0000, 0x0020,0x018B,0x0000, 0x0020,0x018B,0x0000, /* 1240C */ +0x0020,0x018B,0x0000, 0x0020,0x018B,0x0000, 0x0020,0x018B,0x0000, /* 1240F */ +0x0020,0x018B,0x0000, 0x0020,0x018B,0x0000, 0x0020,0x018B,0x0000, /* 12412 */ +0x0020,0x018B,0x0000, 0x0020,0x018B,0x0000, 0x0020,0x018B,0x0000, /* 12415 */ +0x0020,0x018B,0x0000, 0x0020,0x018B,0x0000, 0x0020,0x018B,0x0000, /* 12418 */ +0x0020,0x018B,0x0000, 0x0020,0x018B,0x0000, 0x0020,0x018B,0x0000, /* 1241B */ +0x0020,0x018B,0x0000, 0x0020,0x018B,0x0000, 0x0020,0x018B,0x0000, /* 1241E */ +0x0020,0x018B,0x0000, 0x0020,0x018B,0x0000, 0x0020,0x018B,0x0000, /* 12421 */ +0x0020,0x018B,0x0000, 0x0020,0x018B,0x0000, 0x0020,0x018B,0x0000, /* 12424 */ +0x0020,0x018B,0x0000, 0x0020,0x018B,0x0000, 0x0020,0x018B,0x0000, /* 12427 */ +0x0020,0x018B,0x0000, 0x0020,0x018B,0x0000, 0x0020,0x018B,0x0000, /* 1242A */ +0x0020,0x018B,0x0000, 0x0020,0x018B,0x0000, 0x0020,0x018B,0x0000, /* 1242D */ +0x0020,0x018B,0x0000, 0x0020,0x018B,0x0000, 0x0020,0x0000,0x0000, /* 12430 */ +0x0020,0x0000,0x0000, 0x0020,0x018B,0x0000, 0x0020,0x018B,0x0000, /* 12433 */ +0x0020,0x018B,0x0000, 0x0020,0x018B,0x0000, 0x0020,0x018B,0x0000, /* 12436 */ +0x0020,0x018B,0x0000, 0x0020,0x018B,0x0000, 0x0020,0x018B,0x0000, /* 12439 */ +0x0020,0x018B,0x0000, 0x0020,0x018B,0x0000, 0x0020,0x018B,0x0000, /* 1243C */ +0x0020,0x018B,0x0000, 0x0020,0x018B,0x0000, 0x0020,0x018B,0x0000, /* 1243F */ +0x0020,0x018B,0x0000, 0x0020,0x018B,0x0000, 0x0020,0x018B,0x0000, /* 12442 */ +0x0020,0x018B,0x0000, 0x0020,0x018B,0x0000, 0x0020,0x018B,0x0000, /* 12445 */ +0x0020,0x018B,0x0000, 0x0020,0x018B,0x0000, 0x0020,0x018B,0x0000, /* 12448 */ +0x0020,0x018B,0x0000, 0x0020,0x018B,0x0000, 0x0020,0x018B,0x0000, /* 1244B */ +0x0020,0x018B,0x0000, 0x0020,0x018B,0x0000, 0x0020,0x018B,0x0000, /* 1244E */ +0x0020,0x018B,0x0000, 0x0020,0x018B,0x0000, 0x0020,0x018B,0x0000, /* 12451 */ +0x0020,0x018B,0x0000, 0x0020,0x018B,0x0000, 0x0020,0x0000,0x0000, /* 12454 */ +0x0020,0x0000,0x0000, 0x0020,0x018B,0x0000, 0x0020,0x018B,0x0000, /* 12457 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1245A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1245D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 12460 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 12463 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 12466 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 12469 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1246C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1246F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 12472 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 12475 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 12478 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1247B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1247E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 12481 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 12484 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 12487 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1248A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1248D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 12490 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 12493 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 12496 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 12499 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1249C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1249F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 124A2 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 124A5 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 124A8 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 124AB */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 124AE */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 124B1 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 124B4 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 124B7 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 124BA */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 124BD */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 124C0 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 124C3 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 124C6 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 124C9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 124CC */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 124CF */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 124D2 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 124D5 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 124D8 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 124DB */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 124DE */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 124E1 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 124E4 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 124E7 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 124EA */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 124ED */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 124F0 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 124F3 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 124F6 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 124F9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 124FC */ +0x0020,0x0000,0x0000 }; + +static const uint16 uca520_p1D1_w2[]= { /* 1D100 (2 weights per char) */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D100 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D104 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D108 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D10C */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D110 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D114 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D118 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D11C */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D120 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D124 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D128 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D12C */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D130 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D134 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D138 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D13C */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D140 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D144 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D148 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D14C */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D150 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D154 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D158 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D15C */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D160 */ +0x0020,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* 1D164 */ +0x0000,0x0000, 0x0000,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D168 */ +0x0020,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* 1D16C */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* 1D170 */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* 1D174 */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* 1D178 */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* 1D17C */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0020,0x0000, /* 1D180 */ +0x0020,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* 1D184 */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* 1D188 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D18C */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D190 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D194 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D198 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D19C */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D1A0 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D1A4 */ +0x0020,0x0000, 0x0020,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* 1D1A8 */ +0x0000,0x0000, 0x0000,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D1AC */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D1B0 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D1B4 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D1B8 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D1BC */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D1C0 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D1C4 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D1C8 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D1CC */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D1D0 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D1D4 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D1D8 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D1DC */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D1E0 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D1E4 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D1E8 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D1EC */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D1F0 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D1F4 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D1F8 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000 /* 1D1FC */ +}; + +static const uint16 uca520_p1D2_w2[]= { /* 1D200 (2 weights per char) */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D200 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D204 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D208 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D20C */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D210 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D214 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D218 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D21C */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D220 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D224 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D228 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D22C */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D230 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D234 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D238 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D23C */ +0x0020,0x0000, 0x0020,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* 1D240 */ +0x0000,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D244 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D248 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D24C */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D250 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D254 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D258 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D25C */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D260 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D264 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D268 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D26C */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D270 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D274 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D278 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D27C */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D280 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D284 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D288 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D28C */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D290 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D294 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D298 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D29C */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D2A0 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D2A4 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D2A8 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D2AC */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D2B0 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D2B4 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D2B8 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D2BC */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D2C0 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D2C4 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D2C8 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D2CC */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D2D0 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D2D4 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D2D8 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D2DC */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D2E0 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D2E4 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D2E8 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D2EC */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D2F0 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D2F4 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* 1D2F8 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000 /* 1D2FC */ +}; + +static const uint16 uca520_p1D3_w2[]= { /* 1D300 (3 weights per char) */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D300 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D303 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D306 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D309 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D30C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D30F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D312 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D315 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D318 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D31B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D31E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D321 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D324 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D327 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D32A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D32D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D330 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D333 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D336 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D339 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D33C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D33F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D342 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D345 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D348 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D34B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D34E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D351 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D354 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D357 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D35A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D35D */ +0x0020,0x0192,0x0000, 0x0020,0x0192,0x0000, 0x0020,0x0192,0x0000, /* 1D360 */ +0x0020,0x0192,0x0000, 0x0020,0x0192,0x0000, 0x0020,0x0192,0x0000, /* 1D363 */ +0x0020,0x0192,0x0000, 0x0020,0x0192,0x0000, 0x0020,0x0192,0x0000, /* 1D366 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D369 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D36C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D36F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D372 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D375 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D378 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D37B */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D37E */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D381 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D384 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D387 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D38A */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D38D */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D390 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D393 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D396 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D399 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D39C */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D39F */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D3A2 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D3A5 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D3A8 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D3AB */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D3AE */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D3B1 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D3B4 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D3B7 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D3BA */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D3BD */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D3C0 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D3C3 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D3C6 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D3C9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D3CC */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D3CF */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D3D2 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D3D5 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D3D8 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D3DB */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D3DE */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D3E1 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D3E4 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D3E7 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D3EA */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D3ED */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D3F0 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D3F3 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D3F6 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D3F9 */ +0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000, /* 1D3FC */ +0x0020,0x0000,0x0000 }; + +static const uint16 uca520_p1F1_w2[]= { /* 1F100 (4 weights per char) */ +0x0020,0x0020,0x0000,0x0000, 0x0020,0x0020,0x0000,0x0000, /* 1F100 */ +0x0020,0x0020,0x0000,0x0000, 0x0020,0x0020,0x0000,0x0000, /* 1F102 */ +0x0020,0x0020,0x0000,0x0000, 0x0020,0x0020,0x0000,0x0000, /* 1F104 */ +0x0020,0x0020,0x0000,0x0000, 0x0020,0x0020,0x0000,0x0000, /* 1F106 */ +0x0020,0x0020,0x0000,0x0000, 0x0020,0x0020,0x0000,0x0000, /* 1F108 */ +0x0020,0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F10A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F10C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F10E */ +0x0020,0x0020,0x0020,0x0000, 0x0020,0x0020,0x0020,0x0000, /* 1F110 */ +0x0020,0x0020,0x0020,0x0000, 0x0020,0x0020,0x0020,0x0000, /* 1F112 */ +0x0020,0x0020,0x0020,0x0000, 0x0020,0x0020,0x0020,0x0000, /* 1F114 */ +0x0020,0x0020,0x0020,0x0000, 0x0020,0x0020,0x0020,0x0000, /* 1F116 */ +0x0020,0x0020,0x0020,0x0000, 0x0020,0x0020,0x0020,0x0000, /* 1F118 */ +0x0020,0x0020,0x0020,0x0000, 0x0020,0x0020,0x0020,0x0000, /* 1F11A */ +0x0020,0x0020,0x0020,0x0000, 0x0020,0x0020,0x0020,0x0000, /* 1F11C */ +0x0020,0x0020,0x0020,0x0000, 0x0020,0x0020,0x0020,0x0000, /* 1F11E */ +0x0020,0x0020,0x0020,0x0000, 0x0020,0x0020,0x0020,0x0000, /* 1F120 */ +0x0020,0x0020,0x0020,0x0000, 0x0020,0x0020,0x0020,0x0000, /* 1F122 */ +0x0020,0x0020,0x0020,0x0000, 0x0020,0x0020,0x0020,0x0000, /* 1F124 */ +0x0020,0x0020,0x0020,0x0000, 0x0020,0x0020,0x0020,0x0000, /* 1F126 */ +0x0020,0x0020,0x0020,0x0000, 0x0020,0x0020,0x0020,0x0000, /* 1F128 */ +0x0020,0x0020,0x0020,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F12A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0020,0x0000,0x0000, /* 1F12C */ +0x0020,0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F12E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F130 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F132 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F134 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F136 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F138 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F13A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F13C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F13E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F140 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F142 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F144 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F146 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F148 */ +0x0020,0x0020,0x0000,0x0000, 0x0020,0x0020,0x0000,0x0000, /* 1F14A */ +0x0020,0x0020,0x0000,0x0000, 0x0020,0x0020,0x0000,0x0000, /* 1F14C */ +0x0020,0x0020,0x0020,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F14E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F150 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F152 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F154 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F156 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F158 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F15A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F15C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F15E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F160 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F162 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F164 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F166 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F168 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F16A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F16C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F16E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F170 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F172 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F174 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F176 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F178 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F17A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F17C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F17E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F180 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F182 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F184 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F186 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F188 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0020,0x0000,0x0000, /* 1F18A */ +0x0020,0x0020,0x0000,0x0000, 0x0020,0x0020,0x0000,0x0000, /* 1F18C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F18E */ +0x0020,0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F190 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F192 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F194 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F196 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F198 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F19A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F19C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F19E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F1A0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F1A2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F1A4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F1A6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F1A8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F1AA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F1AC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F1AE */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F1B0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F1B2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F1B4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F1B6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F1B8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F1BA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F1BC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F1BE */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F1C0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F1C2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F1C4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F1C6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F1C8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F1CA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F1CC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F1CE */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F1D0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F1D2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F1D4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F1D6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F1D8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F1DA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F1DC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F1DE */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F1E0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F1E2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F1E4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F1E6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F1E8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F1EA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F1EC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F1EE */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F1F0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F1F2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F1F4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F1F6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F1F8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F1FA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F1FC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000 /* 1F1FE */ +}; + +static const uint16 uca520_p1F2_w2[]= { /* 1F200 (4 weights per char) */ +0x0020,0x0020,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F200 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F202 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F204 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F206 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F208 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F20A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F20C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F20E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F210 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0148,0x0000,0x0000, /* 1F212 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F214 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F216 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F218 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F21A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F21C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F21E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F220 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F222 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F224 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F226 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F228 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F22A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F22C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F22E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F230 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F232 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F234 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F236 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F238 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F23A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F23C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F23E */ +0x0020,0x0020,0x0020,0x0000, 0x0020,0x0020,0x0020,0x0000, /* 1F240 */ +0x0020,0x0020,0x0020,0x0000, 0x0020,0x0020,0x0020,0x0000, /* 1F242 */ +0x0020,0x0020,0x0020,0x0000, 0x0020,0x0020,0x0020,0x0000, /* 1F244 */ +0x0020,0x0020,0x0020,0x0000, 0x0020,0x0020,0x0020,0x0000, /* 1F246 */ +0x0020,0x0020,0x0020,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F248 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F24A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F24C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F24E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F250 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F252 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F254 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F256 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F258 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F25A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F25C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F25E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F260 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F262 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F264 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F266 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F268 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F26A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F26C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F26E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F270 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F272 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F274 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F276 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F278 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F27A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F27C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F27E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F280 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F282 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F284 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F286 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F288 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F28A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F28C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F28E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F290 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F292 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F294 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F296 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F298 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F29A */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F29C */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F29E */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F2A0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F2A2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F2A4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F2A6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F2A8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F2AA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F2AC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F2AE */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F2B0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F2B2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F2B4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F2B6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F2B8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F2BA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F2BC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F2BE */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F2C0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F2C2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F2C4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F2C6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F2C8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F2CA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F2CC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F2CE */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F2D0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F2D2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F2D4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F2D6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F2D8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F2DA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F2DC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F2DE */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F2E0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F2E2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F2E4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F2E6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F2E8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F2EA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F2EC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F2EE */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F2F0 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F2F2 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F2F4 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F2F6 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F2F8 */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F2FA */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000, /* 1F2FC */ +0x0020,0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000,0x0000 /* 1F2FE */ +}; + +static const uint16 uca520_pE00_w2[]= { /* E0000 (2 weights per char) */ +0x0020,0x0000, 0x0000,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* E0000 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* E0004 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* E0008 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* E000C */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* E0010 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* E0014 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* E0018 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* E001C */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E0020 */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E0024 */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E0028 */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E002C */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E0030 */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E0034 */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E0038 */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E003C */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E0040 */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E0044 */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E0048 */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E004C */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E0050 */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E0054 */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E0058 */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E005C */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E0060 */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E0064 */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E0068 */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E006C */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E0070 */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E0074 */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E0078 */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E007C */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* E0080 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* E0084 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* E0088 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* E008C */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* E0090 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* E0094 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* E0098 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* E009C */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* E00A0 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* E00A4 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* E00A8 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* E00AC */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* E00B0 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* E00B4 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* E00B8 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* E00BC */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* E00C0 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* E00C4 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* E00C8 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* E00CC */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* E00D0 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* E00D4 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* E00D8 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* E00DC */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* E00E0 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* E00E4 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* E00E8 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* E00EC */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* E00F0 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* E00F4 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* E00F8 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000 /* E00FC */ +}; + +static const uint16 uca520_pE01_w2[]= { /* E0100 (2 weights per char) */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E0100 */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E0104 */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E0108 */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E010C */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E0110 */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E0114 */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E0118 */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E011C */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E0120 */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E0124 */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E0128 */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E012C */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E0130 */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E0134 */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E0138 */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E013C */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E0140 */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E0144 */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E0148 */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E014C */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E0150 */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E0154 */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E0158 */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E015C */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E0160 */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E0164 */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E0168 */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E016C */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E0170 */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E0174 */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E0178 */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E017C */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E0180 */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E0184 */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E0188 */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E018C */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E0190 */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E0194 */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E0198 */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E019C */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E01A0 */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E01A4 */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E01A8 */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E01AC */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E01B0 */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E01B4 */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E01B8 */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E01BC */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E01C0 */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E01C4 */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E01C8 */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E01CC */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E01D0 */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E01D4 */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E01D8 */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E01DC */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E01E0 */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E01E4 */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E01E8 */ +0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, /* E01EC */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* E01F0 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* E01F4 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, /* E01F8 */ +0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000, 0x0020,0x0000 /* E01FC */ +}; + +const uchar uca520_length_w2[4352]={ +4,5,4,4,3,3,3,3,2,3,3,3,3,3,3,4, +4,0,0,3,0,0,5,3,3,4,4,3,3,4,4,5, +5,5,4,0,5,0,0,3,0,0,5,0,4,3,3,0, +3,3,8,7,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,3,4,3,3,3,3,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,4,3,9,4,2, +0,3,0,3,3,0,0,0,3,3,3,3,3,0,3,0, +3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,2,2,3,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +}; +static const uint16 *uca520_weight_w2[4352]= { +uca520_p000_w2,uca520_p001_w2,uca520_p002_w2,uca520_p003_w2, +uca520_p004_w2,uca520_p005_w2,uca520_p006_w2,uca520_p007_w2, +uca520_p008_w2,uca520_p009_w2,uca520_p00A_w2,uca520_p00B_w2, +uca520_p00C_w2,uca520_p00D_w2,uca520_p00E_w2,uca520_p00F_w2, +uca520_p010_w2,NULL ,NULL ,uca520_p013_w2, +NULL ,NULL ,uca520_p016_w2,uca520_p017_w2, +uca520_p018_w2,uca520_p019_w2,uca520_p01A_w2,uca520_p01B_w2, +uca520_p01C_w2,uca520_p01D_w2,uca520_p01E_w2,uca520_p01F_w2, +uca520_p020_w2,uca520_p021_w2,uca520_p022_w2,NULL , +uca520_p024_w2,NULL ,NULL ,uca520_p027_w2, +NULL ,NULL ,uca520_p02A_w2,NULL , +uca520_p02C_w2,uca520_p02D_w2,uca520_p02E_w2,NULL , +uca520_p030_w2,uca520_p031_w2,uca520_p032_w2,uca520_p033_w2, +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,uca520_p0A6_w2,uca520_p0A7_w2, +uca520_p0A8_w2,uca520_p0A9_w2,uca520_p0AA_w2,uca520_p0AB_w2, +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,uca520_p0FB_w2, +uca520_p0FC_w2,uca520_p0FD_w2,uca520_p0FE_w2,uca520_p0FF_w2, +NULL ,uca520_p101_w2,NULL ,uca520_p103_w2, +uca520_p104_w2,NULL ,NULL ,NULL , +uca520_p108_w2,uca520_p109_w2,uca520_p10A_w2,uca520_p10B_w2, +uca520_p10C_w2,NULL ,uca520_p10E_w2,NULL , +uca520_p110_w2,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +uca520_p124_w2,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,uca520_p1D1_w2,uca520_p1D2_w2,uca520_p1D3_w2, +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,uca520_p1F1_w2,uca520_p1F2_w2,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +uca520_pE00_w2,uca520_pE01_w2,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL +}; + +#define THAI_CONTRACTIONS 231 +#define THAI_CONTRACTIONS_W2 1 + +MY_CONTRACTION thai_contractions[THAI_CONTRACTIONS]= +{ + { /* */ + { 0x0E40, 0x0E01, 0 }, + { 0x1F70, 0x1FAA, 0 }, + FALSE + }, + { /* */ + { 0x0E41, 0x0E01, 0 }, + { 0x1F70, 0x1FAB, 0 }, + FALSE + }, + { /* */ + { 0x0E42, 0x0E01, 0 }, + { 0x1F70, 0x1FAC, 0 }, + FALSE + }, + { /* */ + { 0x0E43, 0x0E01, 0 }, + { 0x1F70, 0x1FAD, 0 }, + FALSE + }, + { /* */ + { 0x0E44, 0x0E01, 0 }, + { 0x1F70, 0x1FAE, 0 }, + FALSE + }, + { /* */ + { 0x0E40, 0x0E02, 0 }, + { 0x1F71, 0x1FAA, 0 }, + FALSE + }, + { /* */ + { 0x0E41, 0x0E02, 0 }, + { 0x1F71, 0x1FAB, 0 }, + FALSE + }, + { /* */ + { 0x0E42, 0x0E02, 0 }, + { 0x1F71, 0x1FAC, 0 }, + FALSE + }, + { /* */ + { 0x0E43, 0x0E02, 0 }, + { 0x1F71, 0x1FAD, 0 }, + FALSE + }, + { /* */ + { 0x0E44, 0x0E02, 0 }, + { 0x1F71, 0x1FAE, 0 }, + FALSE + }, + { /* */ + { 0x0E40, 0x0E03, 0 }, + { 0x1F72, 0x1FAA, 0 }, + FALSE + }, + { /* */ + { 0x0E41, 0x0E03, 0 }, + { 0x1F72, 0x1FAB, 0 }, + FALSE + }, + { /* */ + { 0x0E42, 0x0E03, 0 }, + { 0x1F72, 0x1FAC, 0 }, + FALSE + }, + { /* */ + { 0x0E43, 0x0E03, 0 }, + { 0x1F72, 0x1FAD, 0 }, + FALSE + }, + { /* */ + { 0x0E44, 0x0E03, 0 }, + { 0x1F72, 0x1FAE, 0 }, + FALSE + }, + { /* */ + { 0x0E40, 0x0E04, 0 }, + { 0x1F73, 0x1FAA, 0 }, + FALSE + }, + { /* */ + { 0x0E41, 0x0E04, 0 }, + { 0x1F73, 0x1FAB, 0 }, + FALSE + }, + { /* */ + { 0x0E42, 0x0E04, 0 }, + { 0x1F73, 0x1FAC, 0 }, + FALSE + }, + { /* */ + { 0x0E43, 0x0E04, 0 }, + { 0x1F73, 0x1FAD, 0 }, + FALSE + }, + { /* */ + { 0x0E44, 0x0E04, 0 }, + { 0x1F73, 0x1FAE, 0 }, + FALSE + }, + { /* */ + { 0x0E40, 0x0E05, 0 }, + { 0x1F74, 0x1FAA, 0 }, + FALSE + }, + { /* */ + { 0x0E41, 0x0E05, 0 }, + { 0x1F74, 0x1FAB, 0 }, + FALSE + }, + { /* */ + { 0x0E42, 0x0E05, 0 }, + { 0x1F74, 0x1FAC, 0 }, + FALSE + }, + { /* */ + { 0x0E43, 0x0E05, 0 }, + { 0x1F74, 0x1FAD, 0 }, + FALSE + }, + { /* */ + { 0x0E44, 0x0E05, 0 }, + { 0x1F74, 0x1FAE, 0 }, + FALSE + }, + { /* */ + { 0x0E40, 0x0E06, 0 }, + { 0x1F75, 0x1FAA, 0 }, + FALSE + }, + { /* */ + { 0x0E41, 0x0E06, 0 }, + { 0x1F75, 0x1FAB, 0 }, + FALSE + }, + { /* */ + { 0x0E42, 0x0E06, 0 }, + { 0x1F75, 0x1FAC, 0 }, + FALSE + }, + { /* */ + { 0x0E43, 0x0E06, 0 }, + { 0x1F75, 0x1FAD, 0 }, + FALSE + }, + { /* */ + { 0x0E44, 0x0E06, 0 }, + { 0x1F75, 0x1FAE, 0 }, + FALSE + }, + { /* */ + { 0x0E40, 0x0E07, 0 }, + { 0x1F76, 0x1FAA, 0 }, + FALSE + }, + { /* */ + { 0x0E41, 0x0E07, 0 }, + { 0x1F76, 0x1FAB, 0 }, + FALSE + }, + { /* */ + { 0x0E42, 0x0E07, 0 }, + { 0x1F76, 0x1FAC, 0 }, + FALSE + }, + { /* */ + { 0x0E43, 0x0E07, 0 }, + { 0x1F76, 0x1FAD, 0 }, + FALSE + }, + { /* */ + { 0x0E44, 0x0E07, 0 }, + { 0x1F76, 0x1FAE, 0 }, + FALSE + }, + { /* */ + { 0x0E40, 0x0E08, 0 }, + { 0x1F77, 0x1FAA, 0 }, + FALSE + }, + { /* */ + { 0x0E41, 0x0E08, 0 }, + { 0x1F77, 0x1FAB, 0 }, + FALSE + }, + { /* */ + { 0x0E42, 0x0E08, 0 }, + { 0x1F77, 0x1FAC, 0 }, + FALSE + }, + { /* */ + { 0x0E43, 0x0E08, 0 }, + { 0x1F77, 0x1FAD, 0 }, + FALSE + }, + { /* */ + { 0x0E44, 0x0E08, 0 }, + { 0x1F77, 0x1FAE, 0 }, + FALSE + }, + { /* */ + { 0x0E40, 0x0E09, 0 }, + { 0x1F78, 0x1FAA, 0 }, + FALSE + }, + { /* */ + { 0x0E41, 0x0E09, 0 }, + { 0x1F78, 0x1FAB, 0 }, + FALSE + }, + { /* */ + { 0x0E42, 0x0E09, 0 }, + { 0x1F78, 0x1FAC, 0 }, + FALSE + }, + { /* */ + { 0x0E43, 0x0E09, 0 }, + { 0x1F78, 0x1FAD, 0 }, + FALSE + }, + { /* */ + { 0x0E44, 0x0E09, 0 }, + { 0x1F78, 0x1FAE, 0 }, + FALSE + }, + { /* */ + { 0x0E40, 0x0E0A, 0 }, + { 0x1F79, 0x1FAA, 0 }, + FALSE + }, + { /* */ + { 0x0E41, 0x0E0A, 0 }, + { 0x1F79, 0x1FAB, 0 }, + FALSE + }, + { /* */ + { 0x0E42, 0x0E0A, 0 }, + { 0x1F79, 0x1FAC, 0 }, + FALSE + }, + { /* */ + { 0x0E43, 0x0E0A, 0 }, + { 0x1F79, 0x1FAD, 0 }, + FALSE + }, + { /* */ + { 0x0E44, 0x0E0A, 0 }, + { 0x1F79, 0x1FAE, 0 }, + FALSE + }, + { /* */ + { 0x0E40, 0x0E0B, 0 }, + { 0x1F7A, 0x1FAA, 0 }, + FALSE + }, + { /* */ + { 0x0E41, 0x0E0B, 0 }, + { 0x1F7A, 0x1FAB, 0 }, + FALSE + }, + { /* */ + { 0x0E42, 0x0E0B, 0 }, + { 0x1F7A, 0x1FAC, 0 }, + FALSE + }, + { /* */ + { 0x0E43, 0x0E0B, 0 }, + { 0x1F7A, 0x1FAD, 0 }, + FALSE + }, + { /* */ + { 0x0E44, 0x0E0B, 0 }, + { 0x1F7A, 0x1FAE, 0 }, + FALSE + }, + { /* */ + { 0x0E40, 0x0E0C, 0 }, + { 0x1F7B, 0x1FAA, 0 }, + FALSE + }, + { /* */ + { 0x0E41, 0x0E0C, 0 }, + { 0x1F7B, 0x1FAB, 0 }, + FALSE + }, + { /* */ + { 0x0E42, 0x0E0C, 0 }, + { 0x1F7B, 0x1FAC, 0 }, + FALSE + }, + { /* */ + { 0x0E43, 0x0E0C, 0 }, + { 0x1F7B, 0x1FAD, 0 }, + FALSE + }, + { /* */ + { 0x0E44, 0x0E0C, 0 }, + { 0x1F7B, 0x1FAE, 0 }, + FALSE + }, + { /* */ + { 0x0E40, 0x0E0D, 0 }, + { 0x1F7C, 0x1FAA, 0 }, + FALSE + }, + { /* */ + { 0x0E41, 0x0E0D, 0 }, + { 0x1F7C, 0x1FAB, 0 }, + FALSE + }, + { /* */ + { 0x0E42, 0x0E0D, 0 }, + { 0x1F7C, 0x1FAC, 0 }, + FALSE + }, + { /* */ + { 0x0E43, 0x0E0D, 0 }, + { 0x1F7C, 0x1FAD, 0 }, + FALSE + }, + { /* */ + { 0x0E44, 0x0E0D, 0 }, + { 0x1F7C, 0x1FAE, 0 }, + FALSE + }, + { /* */ + { 0x0E40, 0x0E0E, 0 }, + { 0x1F7D, 0x1FAA, 0 }, + FALSE + }, + { /* */ + { 0x0E41, 0x0E0E, 0 }, + { 0x1F7D, 0x1FAB, 0 }, + FALSE + }, + { /* */ + { 0x0E42, 0x0E0E, 0 }, + { 0x1F7D, 0x1FAC, 0 }, + FALSE + }, + { /* */ + { 0x0E43, 0x0E0E, 0 }, + { 0x1F7D, 0x1FAD, 0 }, + FALSE + }, + { /* */ + { 0x0E44, 0x0E0E, 0 }, + { 0x1F7D, 0x1FAE, 0 }, + FALSE + }, + { /* */ + { 0x0E40, 0x0E0F, 0 }, + { 0x1F7E, 0x1FAA, 0 }, + FALSE + }, + { /* */ + { 0x0E41, 0x0E0F, 0 }, + { 0x1F7E, 0x1FAB, 0 }, + FALSE + }, + { /* */ + { 0x0E42, 0x0E0F, 0 }, + { 0x1F7E, 0x1FAC, 0 }, + FALSE + }, + { /* */ + { 0x0E43, 0x0E0F, 0 }, + { 0x1F7E, 0x1FAD, 0 }, + FALSE + }, + { /* */ + { 0x0E44, 0x0E0F, 0 }, + { 0x1F7E, 0x1FAE, 0 }, + FALSE + }, + { /* */ + { 0x0E40, 0x0E10, 0 }, + { 0x1F7F, 0x1FAA, 0 }, + FALSE + }, + { /* */ + { 0x0E41, 0x0E10, 0 }, + { 0x1F7F, 0x1FAB, 0 }, + FALSE + }, + { /* */ + { 0x0E42, 0x0E10, 0 }, + { 0x1F7F, 0x1FAC, 0 }, + FALSE + }, + { /* */ + { 0x0E43, 0x0E10, 0 }, + { 0x1F7F, 0x1FAD, 0 }, + FALSE + }, + { /* */ + { 0x0E44, 0x0E10, 0 }, + { 0x1F7F, 0x1FAE, 0 }, + FALSE + }, + { /* */ + { 0x0E40, 0x0E11, 0 }, + { 0x1F80, 0x1FAA, 0 }, + FALSE + }, + { /* */ + { 0x0E41, 0x0E11, 0 }, + { 0x1F80, 0x1FAB, 0 }, + FALSE + }, + { /* */ + { 0x0E42, 0x0E11, 0 }, + { 0x1F80, 0x1FAC, 0 }, + FALSE + }, + { /* */ + { 0x0E43, 0x0E11, 0 }, + { 0x1F80, 0x1FAD, 0 }, + FALSE + }, + { /* */ + { 0x0E44, 0x0E11, 0 }, + { 0x1F80, 0x1FAE, 0 }, + FALSE + }, + { /* */ + { 0x0E40, 0x0E12, 0 }, + { 0x1F81, 0x1FAA, 0 }, + FALSE + }, + { /* */ + { 0x0E41, 0x0E12, 0 }, + { 0x1F81, 0x1FAB, 0 }, + FALSE + }, + { /* */ + { 0x0E42, 0x0E12, 0 }, + { 0x1F81, 0x1FAC, 0 }, + FALSE + }, + { /* */ + { 0x0E43, 0x0E12, 0 }, + { 0x1F81, 0x1FAD, 0 }, + FALSE + }, + { /* */ + { 0x0E44, 0x0E12, 0 }, + { 0x1F81, 0x1FAE, 0 }, + FALSE + }, + { /* */ + { 0x0E40, 0x0E13, 0 }, + { 0x1F82, 0x1FAA, 0 }, + FALSE + }, + { /* */ + { 0x0E41, 0x0E13, 0 }, + { 0x1F82, 0x1FAB, 0 }, + FALSE + }, + { /* */ + { 0x0E42, 0x0E13, 0 }, + { 0x1F82, 0x1FAC, 0 }, + FALSE + }, + { /* */ + { 0x0E43, 0x0E13, 0 }, + { 0x1F82, 0x1FAD, 0 }, + FALSE + }, + { /* */ + { 0x0E44, 0x0E13, 0 }, + { 0x1F82, 0x1FAE, 0 }, + FALSE + }, + { /* */ + { 0x0E40, 0x0E14, 0 }, + { 0x1F83, 0x1FAA, 0 }, + FALSE + }, + { /* */ + { 0x0E41, 0x0E14, 0 }, + { 0x1F83, 0x1FAB, 0 }, + FALSE + }, + { /* */ + { 0x0E42, 0x0E14, 0 }, + { 0x1F83, 0x1FAC, 0 }, + FALSE + }, + { /* */ + { 0x0E43, 0x0E14, 0 }, + { 0x1F83, 0x1FAD, 0 }, + FALSE + }, + { /* */ + { 0x0E44, 0x0E14, 0 }, + { 0x1F83, 0x1FAE, 0 }, + FALSE + }, + { /* */ + { 0x0E40, 0x0E15, 0 }, + { 0x1F84, 0x1FAA, 0 }, + FALSE + }, + { /* */ + { 0x0E41, 0x0E15, 0 }, + { 0x1F84, 0x1FAB, 0 }, + FALSE + }, + { /* */ + { 0x0E42, 0x0E15, 0 }, + { 0x1F84, 0x1FAC, 0 }, + FALSE + }, + { /* */ + { 0x0E43, 0x0E15, 0 }, + { 0x1F84, 0x1FAD, 0 }, + FALSE + }, + { /* */ + { 0x0E44, 0x0E15, 0 }, + { 0x1F84, 0x1FAE, 0 }, + FALSE + }, + { /* */ + { 0x0E40, 0x0E16, 0 }, + { 0x1F85, 0x1FAA, 0 }, + FALSE + }, + { /* */ + { 0x0E41, 0x0E16, 0 }, + { 0x1F85, 0x1FAB, 0 }, + FALSE + }, + { /* */ + { 0x0E42, 0x0E16, 0 }, + { 0x1F85, 0x1FAC, 0 }, + FALSE + }, + { /* */ + { 0x0E43, 0x0E16, 0 }, + { 0x1F85, 0x1FAD, 0 }, + FALSE + }, + { /* */ + { 0x0E44, 0x0E16, 0 }, + { 0x1F85, 0x1FAE, 0 }, + FALSE + }, + { /* */ + { 0x0E40, 0x0E17, 0 }, + { 0x1F86, 0x1FAA, 0 }, + FALSE + }, + { /* */ + { 0x0E41, 0x0E17, 0 }, + { 0x1F86, 0x1FAB, 0 }, + FALSE + }, + { /* */ + { 0x0E42, 0x0E17, 0 }, + { 0x1F86, 0x1FAC, 0 }, + FALSE + }, + { /* */ + { 0x0E43, 0x0E17, 0 }, + { 0x1F86, 0x1FAD, 0 }, + FALSE + }, + { /* */ + { 0x0E44, 0x0E17, 0 }, + { 0x1F86, 0x1FAE, 0 }, + FALSE + }, + { /* */ + { 0x0E40, 0x0E18, 0 }, + { 0x1F87, 0x1FAA, 0 }, + FALSE + }, + { /* */ + { 0x0E41, 0x0E18, 0 }, + { 0x1F87, 0x1FAB, 0 }, + FALSE + }, + { /* */ + { 0x0E42, 0x0E18, 0 }, + { 0x1F87, 0x1FAC, 0 }, + FALSE + }, + { /* */ + { 0x0E43, 0x0E18, 0 }, + { 0x1F87, 0x1FAD, 0 }, + FALSE + }, + { /* */ + { 0x0E44, 0x0E18, 0 }, + { 0x1F87, 0x1FAE, 0 }, + FALSE + }, + { /* */ + { 0x0E40, 0x0E19, 0 }, + { 0x1F88, 0x1FAA, 0 }, + FALSE + }, + { /* */ + { 0x0E41, 0x0E19, 0 }, + { 0x1F88, 0x1FAB, 0 }, + FALSE + }, + { /* */ + { 0x0E42, 0x0E19, 0 }, + { 0x1F88, 0x1FAC, 0 }, + FALSE + }, + { /* */ + { 0x0E43, 0x0E19, 0 }, + { 0x1F88, 0x1FAD, 0 }, + FALSE + }, + { /* */ + { 0x0E44, 0x0E19, 0 }, + { 0x1F88, 0x1FAE, 0 }, + FALSE + }, + { /* */ + { 0x0E40, 0x0E1A, 0 }, + { 0x1F89, 0x1FAA, 0 }, + FALSE + }, + { /* */ + { 0x0E41, 0x0E1A, 0 }, + { 0x1F89, 0x1FAB, 0 }, + FALSE + }, + { /* */ + { 0x0E42, 0x0E1A, 0 }, + { 0x1F89, 0x1FAC, 0 }, + FALSE + }, + { /* */ + { 0x0E43, 0x0E1A, 0 }, + { 0x1F89, 0x1FAD, 0 }, + FALSE + }, + { /* */ + { 0x0E44, 0x0E1A, 0 }, + { 0x1F89, 0x1FAE, 0 }, + FALSE + }, + { /* */ + { 0x0E40, 0x0E1B, 0 }, + { 0x1F8A, 0x1FAA, 0 }, + FALSE + }, + { /* */ + { 0x0E41, 0x0E1B, 0 }, + { 0x1F8A, 0x1FAB, 0 }, + FALSE + }, + { /* */ + { 0x0E42, 0x0E1B, 0 }, + { 0x1F8A, 0x1FAC, 0 }, + FALSE + }, + { /* */ + { 0x0E43, 0x0E1B, 0 }, + { 0x1F8A, 0x1FAD, 0 }, + FALSE + }, + { /* */ + { 0x0E44, 0x0E1B, 0 }, + { 0x1F8A, 0x1FAE, 0 }, + FALSE + }, + { /* */ + { 0x0E40, 0x0E1C, 0 }, + { 0x1F8B, 0x1FAA, 0 }, + FALSE + }, + { /* */ + { 0x0E41, 0x0E1C, 0 }, + { 0x1F8B, 0x1FAB, 0 }, + FALSE + }, + { /* */ + { 0x0E42, 0x0E1C, 0 }, + { 0x1F8B, 0x1FAC, 0 }, + FALSE + }, + { /* */ + { 0x0E43, 0x0E1C, 0 }, + { 0x1F8B, 0x1FAD, 0 }, + FALSE + }, + { /* */ + { 0x0E44, 0x0E1C, 0 }, + { 0x1F8B, 0x1FAE, 0 }, + FALSE + }, + { /* */ + { 0x0E40, 0x0E1D, 0 }, + { 0x1F8C, 0x1FAA, 0 }, + FALSE + }, + { /* */ + { 0x0E41, 0x0E1D, 0 }, + { 0x1F8C, 0x1FAB, 0 }, + FALSE + }, + { /* */ + { 0x0E42, 0x0E1D, 0 }, + { 0x1F8C, 0x1FAC, 0 }, + FALSE + }, + { /* */ + { 0x0E43, 0x0E1D, 0 }, + { 0x1F8C, 0x1FAD, 0 }, + FALSE + }, + { /* */ + { 0x0E44, 0x0E1D, 0 }, + { 0x1F8C, 0x1FAE, 0 }, + FALSE + }, + { /* */ + { 0x0E40, 0x0E1E, 0 }, + { 0x1F8D, 0x1FAA, 0 }, + FALSE + }, + { /* */ + { 0x0E41, 0x0E1E, 0 }, + { 0x1F8D, 0x1FAB, 0 }, + FALSE + }, + { /* */ + { 0x0E42, 0x0E1E, 0 }, + { 0x1F8D, 0x1FAC, 0 }, + FALSE + }, + { /* */ + { 0x0E43, 0x0E1E, 0 }, + { 0x1F8D, 0x1FAD, 0 }, + FALSE + }, + { /* */ + { 0x0E44, 0x0E1E, 0 }, + { 0x1F8D, 0x1FAE, 0 }, + FALSE + }, + { /* */ + { 0x0E40, 0x0E1F, 0 }, + { 0x1F8E, 0x1FAA, 0 }, + FALSE + }, + { /* */ + { 0x0E41, 0x0E1F, 0 }, + { 0x1F8E, 0x1FAB, 0 }, + FALSE + }, + { /* */ + { 0x0E42, 0x0E1F, 0 }, + { 0x1F8E, 0x1FAC, 0 }, + FALSE + }, + { /* */ + { 0x0E43, 0x0E1F, 0 }, + { 0x1F8E, 0x1FAD, 0 }, + FALSE + }, + { /* */ + { 0x0E44, 0x0E1F, 0 }, + { 0x1F8E, 0x1FAE, 0 }, + FALSE + }, + { /* */ + { 0x0E40, 0x0E20, 0 }, + { 0x1F8F, 0x1FAA, 0 }, + FALSE + }, + { /* */ + { 0x0E41, 0x0E20, 0 }, + { 0x1F8F, 0x1FAB, 0 }, + FALSE + }, + { /* */ + { 0x0E42, 0x0E20, 0 }, + { 0x1F8F, 0x1FAC, 0 }, + FALSE + }, + { /* */ + { 0x0E43, 0x0E20, 0 }, + { 0x1F8F, 0x1FAD, 0 }, + FALSE + }, + { /* */ + { 0x0E44, 0x0E20, 0 }, + { 0x1F8F, 0x1FAE, 0 }, + FALSE + }, + { /* */ + { 0x0E40, 0x0E21, 0 }, + { 0x1F90, 0x1FAA, 0 }, + FALSE + }, + { /* */ + { 0x0E41, 0x0E21, 0 }, + { 0x1F90, 0x1FAB, 0 }, + FALSE + }, + { /* */ + { 0x0E42, 0x0E21, 0 }, + { 0x1F90, 0x1FAC, 0 }, + FALSE + }, + { /* */ + { 0x0E43, 0x0E21, 0 }, + { 0x1F90, 0x1FAD, 0 }, + FALSE + }, + { /* */ + { 0x0E44, 0x0E21, 0 }, + { 0x1F90, 0x1FAE, 0 }, + FALSE + }, + { /* */ + { 0x0E40, 0x0E22, 0 }, + { 0x1F91, 0x1FAA, 0 }, + FALSE + }, + { /* */ + { 0x0E41, 0x0E22, 0 }, + { 0x1F91, 0x1FAB, 0 }, + FALSE + }, + { /* */ + { 0x0E42, 0x0E22, 0 }, + { 0x1F91, 0x1FAC, 0 }, + FALSE + }, + { /* */ + { 0x0E43, 0x0E22, 0 }, + { 0x1F91, 0x1FAD, 0 }, + FALSE + }, + { /* */ + { 0x0E44, 0x0E22, 0 }, + { 0x1F91, 0x1FAE, 0 }, + FALSE + }, + { /* */ + { 0x0E40, 0x0E23, 0 }, + { 0x1F92, 0x1FAA, 0 }, + FALSE + }, + { /* */ + { 0x0E41, 0x0E23, 0 }, + { 0x1F92, 0x1FAB, 0 }, + FALSE + }, + { /* */ + { 0x0E42, 0x0E23, 0 }, + { 0x1F92, 0x1FAC, 0 }, + FALSE + }, + { /* */ + { 0x0E43, 0x0E23, 0 }, + { 0x1F92, 0x1FAD, 0 }, + FALSE + }, + { /* */ + { 0x0E44, 0x0E23, 0 }, + { 0x1F92, 0x1FAE, 0 }, + FALSE + }, + { /* */ + { 0x0E40, 0x0E24, 0 }, + { 0x1F93, 0x1FAA, 0 }, + FALSE + }, + { /* */ + { 0x0E41, 0x0E24, 0 }, + { 0x1F93, 0x1FAB, 0 }, + FALSE + }, + { /* */ + { 0x0E42, 0x0E24, 0 }, + { 0x1F93, 0x1FAC, 0 }, + FALSE + }, + { /* */ + { 0x0E43, 0x0E24, 0 }, + { 0x1F93, 0x1FAD, 0 }, + FALSE + }, + { /* */ + { 0x0E44, 0x0E24, 0 }, + { 0x1F93, 0x1FAE, 0 }, + FALSE + }, + { /* */ + { 0x0E40, 0x0E25, 0 }, + { 0x1F94, 0x1FAA, 0 }, + FALSE + }, + { /* */ + { 0x0E41, 0x0E25, 0 }, + { 0x1F94, 0x1FAB, 0 }, + FALSE + }, + { /* */ + { 0x0E42, 0x0E25, 0 }, + { 0x1F94, 0x1FAC, 0 }, + FALSE + }, + { /* */ + { 0x0E43, 0x0E25, 0 }, + { 0x1F94, 0x1FAD, 0 }, + FALSE + }, + { /* */ + { 0x0E44, 0x0E25, 0 }, + { 0x1F94, 0x1FAE, 0 }, + FALSE + }, + { /* */ + { 0x0E40, 0x0E26, 0 }, + { 0x1F95, 0x1FAA, 0 }, + FALSE + }, + { /* */ + { 0x0E41, 0x0E26, 0 }, + { 0x1F95, 0x1FAB, 0 }, + FALSE + }, + { /* */ + { 0x0E42, 0x0E26, 0 }, + { 0x1F95, 0x1FAC, 0 }, + FALSE + }, + { /* */ + { 0x0E43, 0x0E26, 0 }, + { 0x1F95, 0x1FAD, 0 }, + FALSE + }, + { /* */ + { 0x0E44, 0x0E26, 0 }, + { 0x1F95, 0x1FAE, 0 }, + FALSE + }, + { /* */ + { 0x0E40, 0x0E27, 0 }, + { 0x1F96, 0x1FAA, 0 }, + FALSE + }, + { /* */ + { 0x0E41, 0x0E27, 0 }, + { 0x1F96, 0x1FAB, 0 }, + FALSE + }, + { /* */ + { 0x0E42, 0x0E27, 0 }, + { 0x1F96, 0x1FAC, 0 }, + FALSE + }, + { /* */ + { 0x0E43, 0x0E27, 0 }, + { 0x1F96, 0x1FAD, 0 }, + FALSE + }, + { /* */ + { 0x0E44, 0x0E27, 0 }, + { 0x1F96, 0x1FAE, 0 }, + FALSE + }, + { /* */ + { 0x0E40, 0x0E28, 0 }, + { 0x1F97, 0x1FAA, 0 }, + FALSE + }, + { /* */ + { 0x0E41, 0x0E28, 0 }, + { 0x1F97, 0x1FAB, 0 }, + FALSE + }, + { /* */ + { 0x0E42, 0x0E28, 0 }, + { 0x1F97, 0x1FAC, 0 }, + FALSE + }, + { /* */ + { 0x0E43, 0x0E28, 0 }, + { 0x1F97, 0x1FAD, 0 }, + FALSE + }, + { /* */ + { 0x0E44, 0x0E28, 0 }, + { 0x1F97, 0x1FAE, 0 }, + FALSE + }, + { /* */ + { 0x0E40, 0x0E29, 0 }, + { 0x1F98, 0x1FAA, 0 }, + FALSE + }, + { /* */ + { 0x0E41, 0x0E29, 0 }, + { 0x1F98, 0x1FAB, 0 }, + FALSE + }, + { /* */ + { 0x0E42, 0x0E29, 0 }, + { 0x1F98, 0x1FAC, 0 }, + FALSE + }, + { /* */ + { 0x0E43, 0x0E29, 0 }, + { 0x1F98, 0x1FAD, 0 }, + FALSE + }, + { /* */ + { 0x0E44, 0x0E29, 0 }, + { 0x1F98, 0x1FAE, 0 }, + FALSE + }, + { /* */ + { 0x0E40, 0x0E2A, 0 }, + { 0x1F99, 0x1FAA, 0 }, + FALSE + }, + { /* */ + { 0x0E41, 0x0E2A, 0 }, + { 0x1F99, 0x1FAB, 0 }, + FALSE + }, + { /* */ + { 0x0E42, 0x0E2A, 0 }, + { 0x1F99, 0x1FAC, 0 }, + FALSE + }, + { /* */ + { 0x0E43, 0x0E2A, 0 }, + { 0x1F99, 0x1FAD, 0 }, + FALSE + }, + { /* */ + { 0x0E44, 0x0E2A, 0 }, + { 0x1F99, 0x1FAE, 0 }, + FALSE + }, + { /* */ + { 0x0E40, 0x0E2B, 0 }, + { 0x1F9A, 0x1FAA, 0 }, + FALSE + }, + { /* */ + { 0x0E41, 0x0E2B, 0 }, + { 0x1F9A, 0x1FAB, 0 }, + FALSE + }, + { /* */ + { 0x0E42, 0x0E2B, 0 }, + { 0x1F9A, 0x1FAC, 0 }, + FALSE + }, + { /* */ + { 0x0E43, 0x0E2B, 0 }, + { 0x1F9A, 0x1FAD, 0 }, + FALSE + }, + { /* */ + { 0x0E44, 0x0E2B, 0 }, + { 0x1F9A, 0x1FAE, 0 }, + FALSE + }, + { /* */ + { 0x0E40, 0x0E2C, 0 }, + { 0x1F9B, 0x1FAA, 0 }, + FALSE + }, + { /* */ + { 0x0E41, 0x0E2C, 0 }, + { 0x1F9B, 0x1FAB, 0 }, + FALSE + }, + { /* */ + { 0x0E42, 0x0E2C, 0 }, + { 0x1F9B, 0x1FAC, 0 }, + FALSE + }, + { /* */ + { 0x0E43, 0x0E2C, 0 }, + { 0x1F9B, 0x1FAD, 0 }, + FALSE + }, + { /* */ + { 0x0E44, 0x0E2C, 0 }, + { 0x1F9B, 0x1FAE, 0 }, + FALSE + }, + { /* */ + { 0x0E40, 0x0E2D, 0 }, + { 0x1F9C, 0x1FAA, 0 }, + FALSE + }, + { /* */ + { 0x0E41, 0x0E2D, 0 }, + { 0x1F9C, 0x1FAB, 0 }, + FALSE + }, + { /* */ + { 0x0E42, 0x0E2D, 0 }, + { 0x1F9C, 0x1FAC, 0 }, + FALSE + }, + { /* */ + { 0x0E43, 0x0E2D, 0 }, + { 0x1F9C, 0x1FAD, 0 }, + FALSE + }, + { /* */ + { 0x0E44, 0x0E2D, 0 }, + { 0x1F9C, 0x1FAE, 0 }, + FALSE + }, + { /* */ + { 0x0E40, 0x0E2E, 0 }, + { 0x1F9D, 0x1FAA, 0 }, + FALSE + }, + { /* */ + { 0x0E41, 0x0E2E, 0 }, + { 0x1F9D, 0x1FAB, 0 }, + FALSE + }, + { /* */ + { 0x0E42, 0x0E2E, 0 }, + { 0x1F9D, 0x1FAC, 0 }, + FALSE + }, + { /* */ + { 0x0E43, 0x0E2E, 0 }, + { 0x1F9D, 0x1FAD, 0 }, + FALSE + }, + { /* */ + { 0x0E44, 0x0E2E, 0 }, + { 0x1F9D, 0x1FAE, 0 }, + FALSE + }, + { /* */ + { 0x0E4D, 0x0E32, 0 }, + { 0x1FA2, 0 }, + FALSE + }, +}; + +MY_CONTRACTION thai_contractions_w2[THAI_CONTRACTIONS_W2]= +{ + { /* */ + { 0x0E4D, 0x0E32, 0 }, + { 0x0020, 0 }, + FALSE + }, + +}; + +MY_UCA_INFO my_uca_v520_th= +{ + { + { + 0x10FFFF, /* maxchar */ + (uchar *)uca520_length, + (uint16 **)uca520_weight, + { /* Contractions: */ + THAI_CONTRACTIONS, /* nitems */ + thai_contractions, /* item */ + NULL /* flags */ + }, + 0 /* levelno */ + }, + { + 0x10FFFF, /* maxchar */ + (uchar *)uca520_length_w2, + (uint16 **)uca520_weight_w2, + { /* Contractions: */ + THAI_CONTRACTIONS_W2, /* nitems */ + thai_contractions_w2, /* item */ + NULL /* flags */ + }, + 1 /* levelno */ + }, + }, + + 0x0009, /* first_non_ignorable p != ignore */ + 0x1342E, /* last_non_ignorable Not a CJK and not UASSIGNED */ + + 0x0332, /* first_primary_ignorable p == ignore */ + 0x101FD, /* last_primary_ignorable */ + + 0x0000, /* first_secondary_ignorable p,s= ignore */ + 0xFE73, /* last_secondary_ignorable */ + + 0x0000, /* first_tertiary_ignorable p,s,t == ignore */ + 0xFE73, /* last_tertiary_ignorable */ + + 0x0000, /* first_trailing */ + 0x0000, /* last_trailing */ + + 0x0009, /* first_variable if alt=non-ignorable: p != ignore */ + 0x1D371, /* last_variable if alt=shifter: p,s,t == ignore */ +}; + MY_UCA_INFO my_uca_v520= { { @@ -19112,10 +30128,11 @@ MY_UCA_INFO my_uca_v520= (uchar *) uca520_length, (uint16 **) uca520_weight, { /* Contractions: */ - 0, /* nitems */ - NULL, /* item */ - NULL /* flags */ - } + 0, /* nitems */ + NULL, /* item */ + NULL /* flags */ + }, + 0 /* levelno */ }, }, @@ -20448,7 +31465,7 @@ my_uca_scanner_contraction_find(my_uca_scanner *scanner, my_wc_t *wc) size_t clen= 1; int flag; const uchar *s, *beg[MY_UCA_MAX_CONTRACTION]; - memset(beg, 0, sizeof(beg)); + memset((void*) beg, 0, sizeof(beg)); /* Scan all contraction candidates */ for (s= scanner->sbeg, flag= MY_UCA_CNT_MID1; @@ -20516,37 +31533,108 @@ my_uca_previous_context_find(my_uca_scanner *scanner, /****************************************************************/ +/** + Implicit weights for a code CP are constructed as follows: + [.AAAA.0020.0002][.BBBB.0000.0000] + + where: + AAAA= BASE + (CP >> 15); + BBBB= (CP & 0x7FFF) | 0x8000; + + There are two weights in the primary level (AAAA followed by BBBB). + There is one weight on other levels: + - 0020 on the secondary level + - 0002 on the tertiary level +*/ + /** - Return implicit UCA weight + Return BASE for an implicit weight on the primary level + + According to UCA, BASE is calculated as follows: + - FB40 for Unified_Ideograph=True AND + ((Block=CJK_Unified_Ideograph) OR + (Block=CJK_Compatibility_Ideographs)) + - FB80 for Unified_Ideograph=True AND NOT + ((Block=CJK_Unified_Ideograph) OR + (Block=CJK_Compatibility_Ideographs)) + - FBC0 for any other code point + TODO: it seems we're not handling BASE correctly: + - check what are those blocks + - there are more Unified Ideograph blocks in the latest Unicode versions +*/ +static inline uint16 +my_uca_implicit_weight_base(my_wc_t code) +{ + if (code >= 0x3400 && code <= 0x4DB5) + return 0xFB80; + if (code >= 0x4E00 && code <= 0x9FA5) + return 0xFB40; + return 0xFBC0; +} + + +static inline void +my_uca_implicit_weight_put(uint16 *to, my_wc_t code, uint level) +{ + switch (level) { + case 1: to[0]= 0x0020; to[1]= 0; break; /* Secondary level */ + case 2: to[0]= 0x0002; to[1]= 0; break; /* Tertiary level */ + case 3: to[0]= 0x0001; to[1]= 0; break; /* Quaternary level */ + default: + DBUG_ASSERT(0); + case 0: + break; + } + /* Primary level */ + to[0]= (code >> 15) + my_uca_implicit_weight_base(code); + to[1]= (code & 0x7FFF) | 0x8000; + to[2]= 0; +} + +/****************************************************************/ + +/** + Return an implicit UCA weight for the primary level. Used for characters that do not have assigned UCA weights. @param scanner UCA weight scanner @return The leading implicit weight. + + The second weight is stored in scanner->implicit[0] + and is later returned on the next my_uca_scanner_next_any() call. */ static inline int -my_uca_scanner_next_implicit(my_uca_scanner *scanner) +my_uca_scanner_next_implicit_primary(my_uca_scanner *scanner) { - scanner->code= (scanner->page << 8) + scanner->code; - scanner->implicit[0]= (scanner->code & 0x7FFF) | 0x8000; - scanner->implicit[1]= 0; + my_wc_t wc= (scanner->page << 8) + scanner->code; + scanner->implicit[0]= (wc & 0x7FFF) | 0x8000; /* The second weight */ + scanner->implicit[1]= 0; /* 0 terminator */ scanner->wbeg= scanner->implicit; - - scanner->page= scanner->page >> 7; - - if (scanner->code >= 0x3400 && scanner->code <= 0x4DB5) - scanner->page+= 0xFB80; - else if (scanner->code >= 0x4E00 && scanner->code <= 0x9FA5) - scanner->page+= 0xFB40; - else - scanner->page+= 0xFBC0; - - return scanner->page; + return my_uca_implicit_weight_base(wc) + (wc >> 15); } +/** + Return an implicit weight for the current level + (according to scanner->level->levelno). + +*/ +static inline int +my_uca_scanner_next_implicit(my_uca_scanner *scanner) +{ + switch (scanner->level->levelno) { + case 0: return my_uca_scanner_next_implicit_primary(scanner);/* Primary level*/ + case 1: scanner->wbeg= nochar; return 0x0020; /* Secondary level */ + case 2: scanner->wbeg= nochar; return 0x0002; /* Tertiary level */ + default: scanner->wbeg= nochar; break; + } + DBUG_ASSERT(0); + return 0; +} + /* The same two functions for any character set */ @@ -20678,6 +31766,7 @@ static my_uca_scanner_handler my_any_uca_scanner_handler= slen First string length t Second string tlen Seconf string length + level DUCETweight level NOTES: Initializes two weight scanners and gets weights @@ -20709,19 +31798,20 @@ static my_uca_scanner_handler my_any_uca_scanner_handler= positive number - means the first string is bigger */ -static int my_strnncoll_uca(CHARSET_INFO *cs, - my_uca_scanner_handler *scanner_handler, - const uchar *s, size_t slen, - const uchar *t, size_t tlen, - my_bool t_is_prefix) +static int my_strnncoll_uca_onelevel(CHARSET_INFO *cs, + my_uca_scanner_handler *scanner_handler, + const MY_UCA_WEIGHT_LEVEL *level, + const uchar *s, size_t slen, + const uchar *t, size_t tlen, + my_bool t_is_prefix) { my_uca_scanner sscanner; my_uca_scanner tscanner; int s_res; int t_res; - scanner_handler->init(&sscanner, cs, &cs->uca->level[0], s, slen); - scanner_handler->init(&tscanner, cs, &cs->uca->level[0], t, tlen); + scanner_handler->init(&sscanner, cs, level, s, slen); + scanner_handler->init(&tscanner, cs, level, t, tlen); do { @@ -20732,11 +31822,39 @@ static int my_strnncoll_uca(CHARSET_INFO *cs, return (t_is_prefix && t_res < 0) ? 0 : (s_res - t_res); } +static int my_strnncoll_uca(CHARSET_INFO *cs, + my_uca_scanner_handler *scanner_handler, + const uchar *s, size_t slen, + const uchar *t, size_t tlen, + my_bool t_is_prefix) +{ + return my_strnncoll_uca_onelevel(cs, scanner_handler, &cs->uca->level[0], + s, slen, t, tlen, t_is_prefix); +} + +static int my_strnncoll_uca_multilevel(CHARSET_INFO *cs, + my_uca_scanner_handler *scanner_handler, + const uchar *s, size_t slen, + const uchar *t, size_t tlen, + my_bool t_is_prefix) +{ + uint num_level= cs->levels_for_order; + uint i; + for (i= 0; i != num_level; i++) + { + int ret= my_strnncoll_uca_onelevel(cs, scanner_handler, &cs->uca->level[i], + s, slen, t, tlen, t_is_prefix); + if (ret) + return ret; + } + return 0; +} + static inline int -my_space_weight(CHARSET_INFO *cs) /* W3-TODO */ +my_space_weight(const MY_UCA_WEIGHT_LEVEL *level) { - return cs->uca->level[0].weights[0][0x20 * cs->uca->level[0].lengths[0]]; + return level->weights[0][0x20 * level->lengths[0]]; } @@ -20775,6 +31893,7 @@ my_char_weight_addr(const MY_UCA_WEIGHT_LEVEL *level, uint wc) slen First string length t Second string tlen Seconf string length + level DUCETweight level NOTES: Works exactly the same with my_strnncoll_uca(), @@ -20809,16 +31928,17 @@ my_char_weight_addr(const MY_UCA_WEIGHT_LEVEL *level, uint wc) positive number - means the first string is bigger */ -static int my_strnncollsp_uca(CHARSET_INFO *cs, - my_uca_scanner_handler *scanner_handler, - const uchar *s, size_t slen, - const uchar *t, size_t tlen) +static int my_strnncollsp_uca_onelevel(CHARSET_INFO *cs, + my_uca_scanner_handler *scanner_handler, + const MY_UCA_WEIGHT_LEVEL *level, + const uchar *s, size_t slen, + const uchar *t, size_t tlen) { my_uca_scanner sscanner, tscanner; int s_res, t_res; - scanner_handler->init(&sscanner, cs, &cs->uca->level[0], s, slen); - scanner_handler->init(&tscanner, cs, &cs->uca->level[0], t, tlen); + scanner_handler->init(&sscanner, cs, level, s, slen); + scanner_handler->init(&tscanner, cs, level, t, tlen); do { @@ -20829,7 +31949,7 @@ static int my_strnncollsp_uca(CHARSET_INFO *cs, if (s_res > 0 && t_res < 0) { /* Calculate weight for SPACE character */ - t_res= my_space_weight(cs); + t_res= my_space_weight(level); /* compare the first string to spaces */ do @@ -20844,7 +31964,7 @@ static int my_strnncollsp_uca(CHARSET_INFO *cs, if (s_res < 0 && t_res > 0) { /* Calculate weight for SPACE character */ - s_res= my_space_weight(cs); + s_res= my_space_weight(level); /* compare the second string to spaces */ do @@ -20859,6 +31979,32 @@ static int my_strnncollsp_uca(CHARSET_INFO *cs, return ( s_res - t_res ); } +static int my_strnncollsp_uca(CHARSET_INFO *cs, + my_uca_scanner_handler *scanner_handler, + const uchar *s, size_t slen, + const uchar *t, size_t tlen) +{ + return my_strnncollsp_uca_onelevel(cs, scanner_handler, &cs->uca->level[0], + s, slen, t, tlen); +} + +static int my_strnncollsp_uca_multilevel(CHARSET_INFO *cs, + my_uca_scanner_handler *scanner_handler, + const uchar *s, size_t slen, + const uchar *t, size_t tlen) +{ + uint num_level= cs->levels_for_order; + uint i; + for (i= 0; i != num_level; i++) + { + int ret= my_strnncollsp_uca_onelevel(cs, scanner_handler, + &cs->uca->level[i], s, slen, t, tlen); + if (ret) + return ret; + } + return 0; +} + /* Calculates hash value for the given string, according to the collation, and ignoring trailing spaces. @@ -20877,19 +32023,25 @@ static int my_strnncollsp_uca(CHARSET_INFO *cs, upper and lower case of the same letter will return the same weight sequence, and thus will produce the same hash values in n1 and n2. - + + This functions is used for one-level and for multi-level collations. + We intentionally use only primary level in multi-level collations. + This helps to have PARTITION BY KEY put primarily equal records + into the same partition. E.g. in utf8_thai_520_ci records that differ + only in tone marks go into the same partition. + RETURN N/A */ static void my_hash_sort_uca(CHARSET_INFO *cs, my_uca_scanner_handler *scanner_handler, - const uchar *s, size_t slen, - ulong *nr1, ulong *nr2) + const uchar *s, size_t slen, + ulong *nr1, ulong *nr2) { int s_res; my_uca_scanner scanner; - int space_weight= my_space_weight(cs); + int space_weight= my_space_weight(&cs->uca->level[0]); register ulong m1= *nr1, m2= *nr2; scanner_handler->init(&scanner, cs, &cs->uca->level[0], s, slen); @@ -20936,6 +32088,41 @@ end: } +static uchar * +my_strnxfrm_uca_onelevel(CHARSET_INFO *cs, + my_uca_scanner_handler *scanner_handler, + MY_UCA_WEIGHT_LEVEL *level, + uchar *dst, uchar *de, uint nweights, + const uchar *src, size_t srclen, uint flags) +{ + my_uca_scanner scanner; + uchar *d0= dst; + int s_res; + + scanner_handler->init(&scanner, cs, level, src, srclen); + for (; dst < de && nweights && + (s_res= scanner_handler->next(&scanner)) > 0 ; nweights--) + { + *dst++= s_res >> 8; + if (dst < de) + *dst++= s_res & 0xFF; + } + + if (dst < de && nweights && (flags & MY_STRXFRM_PAD_WITH_SPACE)) + { + uint space_count= MY_MIN((uint) (de - dst) / 2, nweights); + s_res= my_space_weight(level); + for (; space_count ; space_count--) + { + *dst++= s_res >> 8; + *dst++= s_res & 0xFF; + } + } + my_strxfrm_desc_and_reverse(d0, dst, flags, 0); + return dst; +} + + /* For the given string creates its "binary image", suitable to be used in binary comparison, i.e. in memcmp(). @@ -20976,32 +32163,16 @@ my_strnxfrm_uca(CHARSET_INFO *cs, { uchar *d0= dst; uchar *de= dst + dstlen; - int s_res; - my_uca_scanner scanner; - scanner_handler->init(&scanner, cs, &cs->uca->level[0], src, srclen); - - for (; dst < de && nweights && - (s_res= scanner_handler->next(&scanner)) > 0 ; nweights--) - { - *dst++= s_res >> 8; - if (dst < de) - *dst++= s_res & 0xFF; - } - - if (dst < de && nweights && (flags & MY_STRXFRM_PAD_WITH_SPACE)) - { - uint space_count= MY_MIN((uint) (de - dst) / 2, nweights); - s_res= my_space_weight(cs); - for (; space_count ; space_count--) - { - *dst++= s_res >> 8; - *dst++= s_res & 0xFF; - } - } - my_strxfrm_desc_and_reverse(d0, dst, flags, 0); + + dst= my_strnxfrm_uca_onelevel(cs, scanner_handler, &cs->uca->level[0], + dst, de, nweights, src, srclen, flags); + /* + This can probably be changed to memset(dst, 0, de - dst), + like my_strnxfrm_uca_multilevel() does. + */ if ((flags & MY_STRXFRM_PAD_TO_MAXLEN) && dst < de) { - s_res= my_space_weight(cs); + int s_res= my_space_weight(&cs->uca->level[0]); for ( ; dst < de; ) { *dst++= s_res >> 8; @@ -21013,6 +32184,35 @@ my_strnxfrm_uca(CHARSET_INFO *cs, } +static size_t +my_strnxfrm_uca_multilevel(CHARSET_INFO *cs, + my_uca_scanner_handler *scanner_handler, + uchar *dst, size_t dstlen, uint nweights, + const uchar *src, size_t srclen, uint flags) +{ + uint num_level= cs->levels_for_order; + uchar *d0= dst; + uchar *de= dst + dstlen; + uint current_level; + + for (current_level= 0; current_level != num_level; current_level++) + { + if (!(flags & MY_STRXFRM_LEVEL_ALL) || + (flags & (MY_STRXFRM_LEVEL1 << current_level))) + dst= my_strnxfrm_uca_onelevel(cs, scanner_handler, + &cs->uca->level[current_level], + dst, de, nweights, + src, srclen, flags); + } + + if (dst < de && (flags & MY_STRXFRM_PAD_TO_MAXLEN)) + { + memset(dst, 0, de - dst); + dst= de; + } + + return dst - d0; +} /* This function compares if two characters are the same. @@ -21022,11 +32222,12 @@ my_strnxfrm_uca(CHARSET_INFO *cs, little-endian and big-endian machines. */ -static int my_uca_charcmp(CHARSET_INFO *cs, my_wc_t wc1, my_wc_t wc2) +static int my_uca_charcmp_onelevel(CHARSET_INFO *cs, my_wc_t wc1, + my_wc_t wc2, uint level) { size_t length1, length2; - const uint16 *weight1= my_char_weight_addr(&cs->uca->level[0], wc1); - const uint16 *weight2= my_char_weight_addr(&cs->uca->level[0], wc2); + const uint16 *weight1= my_char_weight_addr(&cs->uca->level[level], wc1); + const uint16 *weight2= my_char_weight_addr(&cs->uca->level[level], wc2); if (!weight1 || !weight2) return wc1 != wc2; @@ -21036,8 +32237,8 @@ static int my_uca_charcmp(CHARSET_INFO *cs, my_wc_t wc1, my_wc_t wc2) return 1; /* Thoroughly compare all weights */ - length1= cs->uca->level[0].lengths[wc1 >> MY_UCA_PSHIFT]; /* W3-TODO */ - length2= cs->uca->level[0].lengths[wc2 >> MY_UCA_PSHIFT]; + length1= cs->uca->level[level].lengths[wc1 >> MY_UCA_PSHIFT]; + length2= cs->uca->level[level].lengths[wc2 >> MY_UCA_PSHIFT]; if (length1 > length2) return memcmp((const void*)weight1, (const void*)weight2, length2*2) ? @@ -21050,6 +32251,21 @@ static int my_uca_charcmp(CHARSET_INFO *cs, my_wc_t wc1, my_wc_t wc2) return memcmp((const void*)weight1, (const void*)weight2, length1*2); } +static int my_uca_charcmp(CHARSET_INFO *cs, my_wc_t wc1, my_wc_t wc2) +{ + uint num_level= cs->levels_for_order; + int ret; + uint i; + for (i= 0; i != num_level; i++) + { + ret= my_uca_charcmp_onelevel(cs, wc1, wc2, i); + if (ret) { + return ret; + } + } + return 0; +} + /* ** Compare string against string with wildcard ** 0 if matched @@ -22374,6 +33590,7 @@ my_char_weight_put(MY_UCA_WEIGHT_LEVEL *dst, { size_t chlen; const uint16 *from= NULL; + uint16 implicit_weights[3]; for (chlen= len; chlen > 1; chlen--) { @@ -22388,6 +33605,11 @@ my_char_weight_put(MY_UCA_WEIGHT_LEVEL *dst, if (!from) { from= my_char_weight_addr(dst, *str); + if (!from) + { + from= implicit_weights; + my_uca_implicit_weight_put(implicit_weights, *str, dst->levelno); + } str++; len--; } @@ -22440,6 +33662,25 @@ my_uca_copy_page(MY_CHARSET_LOADER *loader, } +static my_bool +my_uca_generate_implicit_page(MY_CHARSET_LOADER *loader, + MY_UCA_WEIGHT_LEVEL *dst, + uint page) +{ + uint chc, size= 256 * dst->lengths[page] * sizeof(uint16); + if (!(dst->weights[page]= (uint16 *) (loader->once_alloc)(size))) + return TRUE; + + memset(dst->weights[page], 0, size); + for (chc= 0 ; chc < 256; chc++) + { + uint16 *w= dst->weights[page] + chc * dst->lengths[page]; + my_uca_implicit_weight_put(w, (page << 8) + chc, dst->levelno); + } + return FALSE; +} + + static my_bool apply_shift(MY_CHARSET_LOADER *loader, MY_COLL_RULES *rules, MY_COLL_RULE *r, int level, @@ -22523,9 +33764,41 @@ my_charset_loader_error_for_rule(MY_CHARSET_LOADER *loader, } +/** + Initialize one contraction: + - add flags for the characters in the contraction + - add a contraction to the arrray + @param contractions - + @param str - array of characters in the contraction + @param length - number of characters in the contraction + @param with_context - "previous context" or a normal contraction + @return a pointer where the caller should store contraction weights +*/ +static uint16 * +my_uca_init_one_contraction(MY_CONTRACTIONS *contractions, + my_wc_t *str, uint length, my_bool with_context) +{ + int flag; + uint i; + my_uca_add_contraction_flag(contractions, str[0], + with_context ? + MY_UCA_PREVIOUS_CONTEXT_HEAD : + MY_UCA_CNT_HEAD); + for (i= 1, flag= MY_UCA_CNT_MID1; i < length - 1; i++, flag<<= 1) + my_uca_add_contraction_flag(contractions, str[i], flag); + my_uca_add_contraction_flag(contractions, str[i], + with_context ? + MY_UCA_PREVIOUS_CONTEXT_TAIL : + MY_UCA_CNT_TAIL); + /* Add new contraction to the contraction list */ + return my_uca_add_contraction(contractions, str, length, + with_context)->weight; +} + + static my_bool apply_one_rule(MY_CHARSET_LOADER *loader, - MY_COLL_RULES *rules, MY_COLL_RULE *r, int level, + MY_COLL_RULES *rules, MY_COLL_RULE *r, MY_UCA_WEIGHT_LEVEL *dst) { size_t nweights; @@ -22576,23 +33849,9 @@ apply_one_rule(MY_CHARSET_LOADER *loader, if (nshift >= 2) /* Contraction */ { - size_t i; - int flag; MY_CONTRACTIONS *contractions= &dst->contractions; - /* Add HEAD, MID and TAIL flags for the contraction parts */ - my_uca_add_contraction_flag(contractions, r->curr[0], - r->with_context ? - MY_UCA_PREVIOUS_CONTEXT_HEAD : - MY_UCA_CNT_HEAD); - for (i= 1, flag= MY_UCA_CNT_MID1; i < nshift - 1; i++, flag<<= 1) - my_uca_add_contraction_flag(contractions, r->curr[i], flag); - my_uca_add_contraction_flag(contractions, r->curr[i], - r->with_context ? - MY_UCA_PREVIOUS_CONTEXT_TAIL : - MY_UCA_CNT_TAIL); - /* Add new contraction to the contraction list */ - to= my_uca_add_contraction(contractions, r->curr, nshift, - r->with_context)->weight; + to= my_uca_init_one_contraction(contractions, + r->curr, nshift, r->with_context); /* Store weights of the "reset to" character */ dst->contractions.nitems--; /* Temporarily hide - it's incomplete */ rc= my_char_weight_put(dst, @@ -22615,7 +33874,7 @@ apply_one_rule(MY_CHARSET_LOADER *loader, } /* Apply level difference. */ - return apply_shift(loader, rules, r, level, to, nweights); + return apply_shift(loader, rules, r, dst->levelno, to, nweights); } @@ -22648,8 +33907,92 @@ check_rules(MY_CHARSET_LOADER *loader, } +/** + Calculates how many weights are needed on the given page. + + In case of implicit weights, the functions returns 3: + two implicit weights plus trailing 0. + + Implicit weights can appear if we do something like this: + \u3400 + a + I.e. we reset to a character that does not have an explicit weight (U+3400), + and then reorder another character relatively to it. +*/ +static uint my_weight_size_on_page(const MY_UCA_WEIGHT_LEVEL *src, uint page) +{ + return src->lengths[page] ? src->lengths[page] : 3; +} + + +/** + Generate default weights for a page: + - copy default weights from "src", or + - generate implicit weights algorithmically. + Note, some of these default weights will change later, + during a apply_one_rule() call. +*/ static my_bool -init_weight_level(MY_CHARSET_LOADER *loader, MY_COLL_RULES *rules, int level, +my_uca_generate_page(MY_CHARSET_LOADER *loader, + MY_UCA_WEIGHT_LEVEL *dst, const MY_UCA_WEIGHT_LEVEL *src, + uint pageno) +{ + DBUG_ASSERT(dst->levelno == src->levelno); + return src->lengths[pageno] ? + /* + A page with explicit weights and some special rules. + Copy all weights from the page in "src". + */ + my_uca_copy_page(loader, src, dst, pageno) : + /* + A page with implicit weights and some special rules. + Generate default weights for all characters on this page + algorithmically now, at initialization time. + */ + my_uca_generate_implicit_page(loader, dst, pageno); +} + + +/** + Find all pages that we have special rules on and + populate default (explicit or implicit) weights for these pages. +*/ +static my_bool +my_uca_generate_pages(MY_CHARSET_LOADER *loader, + MY_UCA_WEIGHT_LEVEL *dst, + const MY_UCA_WEIGHT_LEVEL *src, + uint npages) +{ + uint page; + for (page= 0; page < npages; page++) + { + if (dst->weights[page]) + { + /* A page with explicit weights with no special rules */ + continue; + } + + if (!dst->lengths[page]) + { + /* + A page with implicit weights with no special rules. + Keep dst->weights[page]==NULL and dst->lengths[page]==0. + Weights for this page will be generated at run time algorithmically, + using my_uca_scanner_next_implicit(). + */ + continue; + } + + /* Found a page with some special rules. */ + if (my_uca_generate_page(loader, dst, src, page)) + return TRUE; + } + return FALSE; +} + + +static my_bool +init_weight_level(MY_CHARSET_LOADER *loader, MY_COLL_RULES *rules, MY_UCA_WEIGHT_LEVEL *dst, const MY_UCA_WEIGHT_LEVEL *src) { MY_COLL_RULE *r, *rlast; @@ -22657,6 +34000,7 @@ init_weight_level(MY_CHARSET_LOADER *loader, MY_COLL_RULES *rules, int level, size_t i, npages= (src->maxchar + 1) / 256; dst->maxchar= src->maxchar; + dst->levelno= src->levelno; if (check_rules(loader, rules, dst, src)) return TRUE; @@ -22688,9 +34032,15 @@ init_weight_level(MY_CHARSET_LOADER *loader, MY_COLL_RULES *rules, int level, } else { - uint pageb= (r->base[0] >> 8); - if (dst->lengths[pagec] < src->lengths[pageb]) - dst->lengths[pagec]= src->lengths[pageb]; + /* + Not an expansion and not a contraction. + The page correspoding to r->curr[0] in "dst" + will need at least the same amount of weights + that r->base[0] has in "src". + */ + uint wsize= my_weight_size_on_page(src, r->base[0] >> 8); + if (dst->lengths[pagec] < wsize) + dst->lengths[pagec]= wsize; } dst->weights[pagec]= NULL; /* Mark that we'll overwrite this page */ } @@ -22698,18 +34048,10 @@ init_weight_level(MY_CHARSET_LOADER *loader, MY_COLL_RULES *rules, int level, ncontractions++; } - /* Allocate pages that we'll overwrite and copy default weights */ - for (i= 0; i < npages; i++) - { - my_bool rc; - /* - Don't touch pages with lengths[i]==0, they have implicit weights - calculated algorithmically. - */ - if (!dst->weights[i] && dst->lengths[i] && - (rc= my_uca_copy_page(loader, src, dst, i))) - return rc; - } + ncontractions += src->contractions.nitems; + + if ((my_uca_generate_pages(loader, dst, src, npages))) + return TRUE; if (ncontractions) { @@ -22727,9 +34069,27 @@ init_weight_level(MY_CHARSET_LOADER *loader, MY_COLL_RULES *rules, int level, */ for (r= rules->rule; r < rlast; r++) { - if (apply_one_rule(loader, rules, r, level, dst)) + if (apply_one_rule(loader, rules, r, dst)) return TRUE; } + + /* + Add built-in contractions (e.g. for Thai) + */ + for (i= 0; i != src->contractions.nitems; i++) + { + MY_CONTRACTION *item= &src->contractions.item[i]; + /* + TODO: calculate length from item->ch. + Generally contractions can consist of more than 2 characters. + */ + uint length= 2; + uint16 *weights= my_uca_init_one_contraction(&dst->contractions, + item->ch, length, + item->with_context); + memcpy(weights, item->weight, length * sizeof(uint16)); + weights[length]= 0; + } return FALSE; } @@ -22752,7 +34112,8 @@ init_weight_level(MY_CHARSET_LOADER *loader, MY_COLL_RULES *rules, int level, */ static my_bool -create_tailoring(struct charset_info_st *cs, MY_CHARSET_LOADER *loader) +create_tailoring(struct charset_info_st *cs, + MY_CHARSET_LOADER *loader) { MY_COLL_RULES rules; MY_UCA_INFO new_uca, *src_uca= NULL; @@ -22791,7 +34152,7 @@ create_tailoring(struct charset_info_st *cs, MY_CHARSET_LOADER *loader) cs->caseinfo= &my_unicase_default; } - if ((rc= init_weight_level(loader, &rules, 0, + if ((rc= init_weight_level(loader, &rules, &new_uca.level[0], &src_uca->level[0]))) goto ex; @@ -22809,6 +34170,69 @@ ex: return rc; } +static my_bool +create_tailoring_multilevel(struct charset_info_st *cs, + MY_CHARSET_LOADER *loader) +{ + uint num_level= cs->levels_for_order; + MY_COLL_RULES rules; + MY_UCA_INFO new_uca, *src_uca= NULL; + int rc= 0; + uint i; + + *loader->error= '\0'; + + if (!cs->tailoring) + return 0; /* Ok to add a collation without tailoring */ + + memset(&rules, 0, sizeof(rules)); + rules.loader= loader; + rules.uca= cs->uca ? cs->uca : &my_uca_v400; /* For logical positions, etc */ + memset(&new_uca, 0, sizeof(new_uca)); + + /* Parse ICU Collation Customization expression */ + if ((rc= my_coll_rule_parse(&rules, + cs->tailoring, + cs->tailoring + strlen(cs->tailoring)))) + goto ex; + + if (rules.version == 520) /* Unicode-5.2.0 requested */ + { + src_uca= &my_uca_v520; + cs->caseinfo= &my_unicase_unicode520; + } + else if (rules.version == 400) /* Unicode-4.0.0 requested */ + { + src_uca= &my_uca_v400; + cs->caseinfo= &my_unicase_default; + } + else /* No Unicode version specified */ + { + src_uca= cs->uca ? cs->uca : &my_uca_v400; + if (!cs->caseinfo) + cs->caseinfo= &my_unicase_default; + } + + for (i= 0; i != num_level; i++) + { + if ((rc= init_weight_level(loader, &rules, + &new_uca.level[i], &src_uca->level[i]))) + goto ex; + } + + if (!(cs->uca= (MY_UCA_INFO *) (loader->once_alloc)(sizeof(MY_UCA_INFO)))) + { + rc= 1; + goto ex; + } + cs->uca[0]= new_uca; + +ex: + (loader->free)(rules.rule); + if (rc != 0 && loader->error[0]) + loader->reporter(ERROR_LEVEL, "%s", loader->error); + return rc; +} /* Universal CHARSET_INFO compatible wrappers @@ -22826,6 +34250,17 @@ my_coll_init_uca(struct charset_info_st *cs, MY_CHARSET_LOADER *loader) return create_tailoring(cs, loader); } +static my_bool +my_coll_init_uca_multilevel(struct charset_info_st *cs, + MY_CHARSET_LOADER *loader) +{ + cs->pad_char= ' '; + cs->ctype= my_charset_utf8_unicode_ci.ctype; + if (!cs->caseinfo) + cs->caseinfo= &my_unicase_default; + return create_tailoring_multilevel(cs, loader); +} + static int my_strnncoll_any_uca(CHARSET_INFO *cs, const uchar *s, size_t slen, const uchar *t, size_t tlen, @@ -22835,6 +34270,15 @@ static int my_strnncoll_any_uca(CHARSET_INFO *cs, s, slen, t, tlen, t_is_prefix); } +static int my_strnncoll_any_uca_multilevel(CHARSET_INFO *cs, + const uchar *s, size_t slen, + const uchar *t, size_t tlen, + my_bool t_is_prefix) +{ + return my_strnncoll_uca_multilevel(cs, &my_any_uca_scanner_handler, + s, slen, t, tlen, t_is_prefix); +} + static int my_strnncollsp_any_uca(CHARSET_INFO *cs, const uchar *s, size_t slen, const uchar *t, size_t tlen) @@ -22842,11 +34286,19 @@ static int my_strnncollsp_any_uca(CHARSET_INFO *cs, return my_strnncollsp_uca(cs, &my_any_uca_scanner_handler, s, slen, t, tlen); } +static int my_strnncollsp_any_uca_multilevel(CHARSET_INFO *cs, + const uchar *s, size_t slen, + const uchar *t, size_t tlen) +{ + return my_strnncollsp_uca_multilevel(cs, &my_any_uca_scanner_handler, + s, slen, t, tlen); +} + static void my_hash_sort_any_uca(CHARSET_INFO *cs, const uchar *s, size_t slen, ulong *n1, ulong *n2) { - my_hash_sort_uca(cs, &my_any_uca_scanner_handler, s, slen, n1, n2); + my_hash_sort_uca(cs, &my_any_uca_scanner_handler, s, slen, n1, n2); } static size_t my_strnxfrm_any_uca(CHARSET_INFO *cs, @@ -22857,12 +34309,43 @@ static size_t my_strnxfrm_any_uca(CHARSET_INFO *cs, dst, dstlen, nweights, src, srclen, flags); } +static size_t my_strnxfrm_any_uca_multilevel(CHARSET_INFO *cs, + uchar *dst, size_t dstlen, + uint nweights, const uchar *src, + size_t srclen, uint flags) +{ + return my_strnxfrm_uca_multilevel(cs, &my_any_uca_scanner_handler, + dst, dstlen, nweights, src, srclen, + flags); +} + static size_t my_strnxfrmlen_any_uca(CHARSET_INFO *cs, size_t len) { /* UCA uses 2 bytes per weight */ return (len + cs->mbmaxlen - 1) / cs->mbmaxlen * cs->strxfrm_multiply * 2; } +static size_t my_strnxfrmlen_any_uca_multilevel(CHARSET_INFO *cs, size_t len) +{ + return my_strnxfrmlen_any_uca(cs, len) * cs->levels_for_order; +} + + +MY_COLLATION_HANDLER my_collation_any_uca_handler_multilevel= +{ + my_coll_init_uca_multilevel, + my_strnncoll_any_uca_multilevel, + my_strnncollsp_any_uca_multilevel, + my_strnxfrm_any_uca_multilevel, + my_strnxfrmlen_any_uca_multilevel, + my_like_range_generic, + my_wildcmp_uca, + NULL, + my_instr_mb, + my_hash_sort_any_uca, + my_propagate_complex +}; + #ifdef HAVE_CHARSET_ucs2 /* @@ -23694,6 +35177,38 @@ struct charset_info_st my_charset_ucs2_myanmar_uca_ci= }; +struct charset_info_st my_charset_ucs2_thai_520_w2= +{ + MY_PAGE2_COLLATION_ID_UCS2+2,0,0, /* number */ + MY_CS_UCS2_UCA_FLAGS,/* flags */ + "ucs2", /* csname */ + "ucs2_thai_520_w2", /* name */ + "", /* comment */ + "", /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + &my_uca_v520_th, /* uca */ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + &my_unicase_unicode520,/* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 4, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 2, /* mbminlen */ + 2, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 2, /* levels_for_order */ + &my_charset_ucs2_handler, + &my_collation_any_uca_handler_multilevel +}; + struct charset_info_st my_charset_ucs2_unicode_520_ci= { 150,0,0, /* number */ @@ -24615,6 +36130,37 @@ struct charset_info_st my_charset_utf8_unicode_520_ci= &my_collation_any_uca_handler }; +struct charset_info_st my_charset_utf8_thai_520_w2= +{ + MY_PAGE2_COLLATION_ID_UTF8+2,0,0, /* number */ + MY_CS_UTF8MB3_UCA_FLAGS,/* flags */ + MY_UTF8MB3, /* csname */ + MY_UTF8MB3 "_thai_520_w2",/* name */ + "", /* comment */ + "", /* tailoring */ + ctype_utf8, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + &my_uca_v520_th, /* uca */ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + &my_unicase_unicode520,/* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 4, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 3, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 2, /* levels_for_order */ + &my_charset_utf8_handler, + &my_collation_any_uca_handler_multilevel +}; struct charset_info_st my_charset_utf8_vietnamese_ci= { @@ -25430,6 +36976,37 @@ struct charset_info_st my_charset_utf8mb4_myanmar_uca_ci= &my_collation_any_uca_handler }; +struct charset_info_st my_charset_utf8mb4_thai_520_w2= +{ + MY_PAGE2_COLLATION_ID_UTF8MB4+2,0,0, /* number */ + MY_CS_UTF8MB4_UCA_FLAGS,/* flags */ + MY_UTF8MB4, /* csname */ + MY_UTF8MB4 "_thai_520_w2", /* name */ + "", /* comment */ + "", /* tailoring */ + ctype_utf8, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + &my_uca_v520_th, /* uca */ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + &my_unicase_unicode520,/* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 4, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 2, /* levels_for_order */ + &my_charset_utf8mb4_handler, + &my_collation_any_uca_handler_multilevel +}; struct charset_info_st my_charset_utf8mb4_unicode_520_ci= { @@ -26293,6 +37870,39 @@ struct charset_info_st my_charset_utf32_myanmar_uca_ci= }; +struct charset_info_st my_charset_utf32_thai_520_w2= +{ + MY_PAGE2_COLLATION_ID_UTF32+2,0,0, /* number */ + MY_CS_UTF32_UCA_FLAGS,/* state */ + "utf32", /* csname */ + "utf32_thai_520_w2",/* name */ + "", /* comment */ + "", /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + &my_uca_v520_th, /* uca */ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + &my_unicase_unicode520,/* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 4, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 4, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 2, /* levels_for_order */ + &my_charset_utf32_handler, + &my_collation_any_uca_handler_multilevel +}; + + struct charset_info_st my_charset_utf32_unicode_520_ci= { 182,0,0, /* number */ @@ -27158,6 +38768,39 @@ struct charset_info_st my_charset_utf16_myanmar_uca_ci= }; +struct charset_info_st my_charset_utf16_thai_520_w2= +{ + MY_PAGE2_COLLATION_ID_UTF16+2,0,0, /* number */ + MY_CS_UTF16_UCA_FLAGS,/* state */ + "utf16", /* cs name */ + "utf16_thai_520_w2",/* name */ + "", /* comment */ + "", /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + &my_uca_v520_th, /* uca */ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + &my_unicase_unicode520,/* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 4, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 2, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 2, /* levels_for_order */ + &my_charset_utf16_handler, + &my_collation_any_uca_handler_multilevel +}; + + struct charset_info_st my_charset_utf16_unicode_520_ci= { 123,0,0, /* number */ diff --git a/strings/ctype-utf8.c b/strings/ctype-utf8.c index b6a7a0d0347..494e292aac6 100644 --- a/strings/ctype-utf8.c +++ b/strings/ctype-utf8.c @@ -5426,6 +5426,38 @@ my_weight_mb3_utf8_general_mysql500_ci(uchar b0, uchar b1, uchar b2) #include "strcoll.ic" +/* + TODO-10.2: join this with pad_max_char() in ctype-mb.c +*/ +static void +my_fill_utf8_mb(CHARSET_INFO *cs, char *str, size_t length, int fill) +{ + char *end= str + length; + char buf[10]; + char buflen= cs->cset->native_to_mb(cs, (my_wc_t) fill, (uchar*) buf, + (uchar*) buf + sizeof(buf)); + DBUG_ASSERT(buflen > 0); + for ( ; str + buflen <= end ; ) + { + memcpy(str, buf, buflen); + str+= buflen; + } + + for ( ; str < end; ) + *str++= ' '; +} + + +static void +my_fill_utf8(CHARSET_INFO *cs, char *str, size_t length, int fill) +{ + if (fill < 0x80) + my_fill_8bit(cs, str, length, fill); + else + my_fill_utf8_mb(cs, str, length, fill); +} + + static MY_COLLATION_HANDLER my_collation_utf8_general_ci_handler = { NULL, /* init */ @@ -5491,7 +5523,7 @@ MY_CHARSET_HANDLER my_charset_utf8_handler= my_snprintf_8bit, my_long10_to_str_8bit, my_longlong10_to_str_8bit, - my_fill_8bit, + my_fill_utf8, my_strntol_8bit, my_strntoul_8bit, my_strntoll_8bit, @@ -7737,7 +7769,7 @@ MY_CHARSET_HANDLER my_charset_utf8mb4_handler= my_snprintf_8bit, my_long10_to_str_8bit, my_longlong10_to_str_8bit, - my_fill_8bit, + my_fill_utf8, my_strntol_8bit, my_strntoul_8bit, my_strntoll_8bit, diff --git a/strings/decimal.c b/strings/decimal.c index 74d456c9c9f..7db5111fc84 100644 --- a/strings/decimal.c +++ b/strings/decimal.c @@ -457,7 +457,7 @@ static void digits_bounds(decimal_t *from, int *start_result, int *end_result) dec1 *end= from->buf + ROUND_UP(from->intg) + ROUND_UP(from->frac); dec1 *buf_end= end - 1; - /* find non-zero digit from number begining */ + /* find non-zero digit from number beginning */ while (buf_beg < end && *buf_beg == 0) buf_beg++; @@ -468,7 +468,7 @@ static void digits_bounds(decimal_t *from, int *start_result, int *end_result) return; } - /* find non-zero decimal digit from number begining */ + /* find non-zero decimal digit from number beginning */ if (buf_beg == from->buf && from->intg) { start= DIG_PER_DEC1 - (i= ((from->intg-1) % DIG_PER_DEC1 + 1)); @@ -928,6 +928,8 @@ internal_str2dec(const char *from, decimal_t *to, char **end, my_bool fixed) error= decimal_shift(to, (int) exponent); } } + if (to->sign && decimal_is_zero(to)) + to->sign= 0; return error; fatal_error: @@ -1005,7 +1007,7 @@ static int ull2dec(ulonglong from, decimal_t *to) error=E_DEC_OVERFLOW; } to->frac=0; - to->intg=intg1*DIG_PER_DEC1; + for(to->intg= (intg1-1)*DIG_PER_DEC1; from; to->intg++, from/=10) {} for (buf=to->buf+intg1; intg1; intg1--) { diff --git a/strings/dtoa.c b/strings/dtoa.c index c3ab347f94c..fdf7bceddfd 100644 --- a/strings/dtoa.c +++ b/strings/dtoa.c @@ -90,7 +90,7 @@ size_t my_fcvt(double x, int precision, char *to, my_bool *error) int decpt, sign, len, i; char *res, *src, *end, *dst= to; char buf[DTOA_BUFF_SIZE]; - DBUG_ASSERT(precision >= 0 && precision < NOT_FIXED_DEC && to != NULL); + DBUG_ASSERT(precision >= 0 && precision < DECIMAL_NOT_SPECIFIED && to != NULL); res= dtoa(x, 5, precision, &decpt, &sign, &end, buf, sizeof(buf)); diff --git a/strings/my_vsnprintf.c b/strings/my_vsnprintf.c index 75514a90925..846803d9b24 100644 --- a/strings/my_vsnprintf.c +++ b/strings/my_vsnprintf.c @@ -16,11 +16,10 @@ #include "strings_def.h" #include -#include #include #include #include - +#include /* For FLOATING_POINT_DECIMALS */ #define MAX_ARGS 32 /* max positional args count*/ #define MAX_PRINT_INFO 32 /* max print position count */ @@ -240,8 +239,8 @@ static char *process_dbl_arg(char *to, char *end, size_t width, { if (width == MAX_WIDTH) width= FLT_DIG; /* width not set, use default */ - else if (width >= NOT_FIXED_DEC) - width= NOT_FIXED_DEC - 1; /* max.precision for my_fcvt() */ + else if (width >= FLOATING_POINT_DECIMALS) + width= FLOATING_POINT_DECIMALS - 1; /* max.precision for my_fcvt() */ width= MY_MIN(width, (size_t)(end-to) - 1); if (arg_type == 'f') @@ -496,7 +495,7 @@ start: char errmsg_buff[MYSYS_STRERROR_SIZE]; *to++= ' '; *to++= '"'; - my_strerror(errmsg_buff, sizeof(errmsg_buff), larg); + my_strerror(errmsg_buff, sizeof(errmsg_buff), (int) larg); to= process_str_arg(cs, to, real_end, width, errmsg_buff, print_arr[i].flags); if (real_end > to) *to++= '"'; @@ -676,7 +675,7 @@ size_t my_vsnprintf_ex(CHARSET_INFO *cs, char *to, size_t n, char errmsg_buff[MYSYS_STRERROR_SIZE]; *to++= ' '; *to++= '"'; - my_strerror(errmsg_buff, sizeof(errmsg_buff), larg); + my_strerror(errmsg_buff, sizeof(errmsg_buff), (int) larg); to= process_str_arg(cs, to, real_end, width, errmsg_buff, print_type); if (real_end > to) *to++= '"'; } diff --git a/strings/string.doc b/strings/string.doc index fcd020b8c60..3e5b607347a 100644 --- a/strings/string.doc +++ b/strings/string.doc @@ -41,7 +41,7 @@ Speciella anv backwards from pos from. pat is not a regex(3) pattern, it is a literal string which must be matched exactly. The result 0 if the pattern was not found else it is the start char of - the pattern counted from the begining of the string. + the pattern counted from the beginning of the string. strappend(dest, len, fill) appends fill-characters to a string so that the result length == len. If the string is longer than len it's diff --git a/strings/uca-dump.c b/strings/uca-dump.c index d5c20854636..5d183608826 100644 --- a/strings/uca-dump.c +++ b/strings/uca-dump.c @@ -35,19 +35,29 @@ struct uca_item_st #define MY_UCA_CMASK 63 #define MY_UCA_PSHIFT 6 #else -#define MY_UCA_NPAGES 256 +#define MY_UCA_NPAGES 4352 /* 0x110000 characters / 0x100 chars per page */ #define MY_UCA_NCHARS 256 #define MY_UCA_CMASK 255 #define MY_UCA_PSHIFT 8 #endif -static char *pname[]= {"", "2", "3"}; +#define MAX_ALLOWED_CODE 0x10FFFF + +/* Name that goes into all array names */ +static const char *global_name_prefix= "uca520"; + +/* Name prefix that goes into page weight array names after global_name_prefix */ +static char *pname_prefix[]= {"_p", "_p", "_p"}; + +/* Name suffix that goes into page weight array names after page number */ +static char *pname_suffix[]= {"", "_w2", "_w3"}; + int main(int ac, char **av) { char str[256]; char *weights[64]; - struct uca_item_st uca[64*1024]; + static struct uca_item_st uca[MAX_ALLOWED_CODE+1]; size_t code, w; int pageloaded[MY_UCA_NPAGES]; @@ -63,7 +73,7 @@ int main(int ac, char **av) code= strtol(str,NULL,16); - if (str[0]=='#' || (code > 0xFFFF)) + if (str[0]=='#' || (code > MAX_ALLOWED_CODE)) continue; if ((comment=strchr(str,'#'))) { @@ -129,7 +139,7 @@ int main(int ac, char **av) /* Now set implicit weights */ - for (code=0; code <= 0xFFFF; code++) + for (code=0; code <= MAX_ALLOWED_CODE; code++) { size_t base, aaaa, bbbb; @@ -173,7 +183,7 @@ int main(int ac, char **av) printf("#define MY_UCA_NCHARS %d\n",MY_UCA_NCHARS); printf("#define MY_UCA_CMASK %d\n",MY_UCA_CMASK); printf("#define MY_UCA_PSHIFT %d\n",MY_UCA_PSHIFT); - + for (w=0; w<3; w++) { size_t page; @@ -186,6 +196,7 @@ int main(int ac, char **av) size_t nchars= 0; size_t mchars; size_t ndefs= 0; + size_t code_line_start= page * MY_UCA_NCHARS; pagemaxlen[page]= 0; @@ -256,8 +267,9 @@ int main(int ac, char **av) */ - printf("uint16 page%03Xdata%s[]= { /* %04X (%d weights per char) */\n", - page, pname[w], page*MY_UCA_NCHARS, maxnum); + printf("static const uint16 %s%s%03X%s[]= { /* %04X (%d weights per char) */\n", + global_name_prefix, pname_prefix[w], (int) page, pname_suffix[w], + (int) page*MY_UCA_NCHARS, (int) maxnum); for (offs=0; offs < MY_UCA_NCHARS; offs++) { @@ -293,11 +305,14 @@ int main(int ac, char **av) printf("0x%04X", tmp); if ((offs+1 != MY_UCA_NCHARS) || (i+1!=maxnum)) printf(","); + else + printf(" "); nchars++; } if (nchars >=mchars) { - printf("\n"); + printf(" /* %04X */\n", (int) code_line_start); + code_line_start= code + 1; nchars=0; } else @@ -308,7 +323,8 @@ int main(int ac, char **av) printf("};\n\n"); } - printf("uchar uca_length%s[%d]={\n", pname[w], MY_UCA_NPAGES); + printf("const uchar %s_length%s[%d]={\n", + global_name_prefix, pname_suffix[w], MY_UCA_NPAGES); for (page=0; page < MY_UCA_NPAGES; page++) { printf("%d%s%s",pagemaxlen[page],page /dev/null +# to see the errors that are not filtered +# # By default, just filters the output for suppressed warnings. If the # FAILONWARNING environment variable is set, then instead will fail the # compile on encountering a non-suppressed warnings. + use strict; use warnings; my $suppressions; +my $filter_stderr= $ARGV[0] ne "cat"; open STDOUT_COPY, ">&STDOUT" or die "Failed to dup stdout: $!]n"; @@ -27,11 +33,14 @@ if (!defined($pid)) { # Child. # actually want to send the STDERR to the parent, not the STDOUT. # So shuffle things around a bit. - open STDERR, ">&STDOUT" - or die "Child: Failed to dup pipe to parent: $!\n"; - open STDOUT, ">&STDOUT_COPY" - or die "Child: Failed to dup parent stdout: $!\n"; - close STDOUT_COPY; + if ($filter_stderr) + { + open STDERR, ">&STDOUT" + or die "Child: Failed to dup pipe to parent: $!\n"; + open STDOUT, ">&STDOUT_COPY" + or die "Child: Failed to dup parent stdout: $!\n"; + close STDOUT_COPY; + } exec { $ARGV[0] } @ARGV; die "Child: exec() failed: $!\n"; } else { @@ -41,9 +50,9 @@ if (!defined($pid)) { chomp($cwd); while () { my $line= $_; - if (/^(.*?):([0-9]+): [Ww]arning: (.*)$/) { + if (/^(.*?):([0-9]+):(?:[0-9]+:)? [Ww]arning: (.*)$/) { my ($file, $lineno, $msg)= ($1, $2, $3); - $file= "$cwd/$file"; + $file= "$cwd/$file" if (length($file) > 0 && substr($file,0,1) ne "/"); next if check_if_suppressed($file, $lineno, $msg); @@ -52,8 +61,14 @@ if (!defined($pid)) { print STDERR $line; next; } - - print STDERR $line; + if ($filter_stderr) + { + print STDERR $line; + } + else + { + print STDOUT $line; + } } close(PIPE); } diff --git a/support-files/compiler_warnings.supp b/support-files/compiler_warnings.supp index 61c6b483aa9..6b82d83a8fe 100644 --- a/support-files/compiler_warnings.supp +++ b/support-files/compiler_warnings.supp @@ -3,61 +3,61 @@ # be ignored for various reasons. # -integer.cpp: .*control reaches end of non-void function.*: 1288-1427 -integer.cpp: .*no return statement in function returning non-void.*: 1288-1427 -DictTabInfo.cpp : .*invalid access to non-static.* -DictTabInfo.cpp : .*macro was used incorrectly.* -DbdihMain.cpp : .*unused variable.* : 6666-7013 -DbtupExecQuery.cpp : .*unused variable.* : 1823 -kernel_types.h : .*only defines private constructors and has no friends.* : 51 -Dbtup.hpp: .*only defines private constructors and has no friends.* -diskpage.hpp: .*only defines private constructors and has no friends.* -tuppage.hpp: .*only defines private constructors and has no friends.* -sql_yacc.cc : .*label 'yyerrlab1' defined but not used.* -kernel_types.h : .*'struct Local_key' only defines private constructors and has no friends.* -lgman.hpp : .*'struct Lgman::Buffer_idx' only defines private constructors and has no friends.* -SchemaFile.hpp : .*'struct SchemaFile::TableEntry' only defines private constructors and has no friends.* -sql_yacc.cc : .*switch statement contains 'default' but no 'case' labels.* +.*/integer.cpp: .*control reaches end of non-void function.*: 1288-1427 +.*/integer.cpp: .*no return statement in function returning non-void.*: 1288-1427 +.*/DictTabInfo.cpp : .*invalid access to non-static.* +.*/DictTabInfo.cpp : .*macro was used incorrectly.* +.*/DbdihMain.cpp : .*unused variable.* : 6666-7013 +.*/DbtupExecQuery.cpp : .*unused variable.* : 1823 +.*/kernel_types.h : .*only defines private constructors and has no friends.* : 51 +.*/Dbtup.hpp: .*only defines private constructors and has no friends.* +.*/diskpage.hpp: .*only defines private constructors and has no friends.* +.*/tuppage.hpp: .*only defines private constructors and has no friends.* +.*/sql_yacc.cc : .*label 'yyerrlab1' defined but not used.* +.*/kernel_types.h : .*'struct Local_key' only defines private constructors and has no friends.* +.*/lgman.hpp : .*'struct Lgman::Buffer_idx' only defines private constructors and has no friends.* +.*/SchemaFile.hpp : .*'struct SchemaFile::TableEntry' only defines private constructors and has no friends.* +.*/sql_yacc.cc : .*switch statement contains 'default' but no 'case' labels.* # # Things that can be ignored in InnoDB # -pars0grm.tab.c: .*'yyerrorlab' : unreferenced label.* -pars0grm.c: 'yyerrorlab' : unreferenced label -_flex_tmp.c: .*not enough actual parameters for macro 'yywrap'.* -lexyy.c : not enough actual parameters for macro 'yywrap' -pars0lex.l: .*conversion from 'ulint' to 'int', possible loss of data.* -include/buf0buf\.ic: unused parameter .*mtr.* -fil/fil0fil\.c: pointer targets in passing argument.*differ in signedness -fil/fil0fil\.c: comparison between signed and unsigned : 3100-3199 -fil/fil0fil\.c: unused parameter -log/log0recv\.c: unused variable -os/os0file\.c: unused parameter -os/os0file\.c: pointer targets in assignment differ in signedness -handler/i_s\.cc: unused variable -sync/sync0rw\.c: unused parameter -sync/sync0sync\.c: unused parameter -sync/sync0sync\.c: unused variable -ut/ut0ut\.c: ignoring return value of -srv/srv0srv\.c: value computed is not used -buf/buf0buf\.c: .*block_mutex.* might be used uninitialized -btr/btr0cur\.c: null argument where non-null required: 1800-3000 -btr/btr0btr\.c: null argument where non-null required -btr/btr0cur\.c: .*value computed is not used.*: 3175-3375 -btr/btr0sea\.c: passing argument 2 .* discards qualifiers from pointer target type -ibuf/ibuf0ibuf.c: null argument where non-null required: 700-1000 -fsp0fsp\.c: result of 32-bit shift implicitly converted to 64 bits -log/log0log\.c : passing arg 1 of `atomic_add_64_nv' from incompatible pointer type -log/log0online\.c : passing arg 1 of `atomic_add_64_nv' from incompatible pointer type -buf/buf0buf\.c : label.*loop2.* defined but not used +.*/pars0grm.tab.c: .*'yyerrorlab' : unreferenced label.* +.*/pars0grm.c: 'yyerrorlab' : unreferenced label +.*/_flex_tmp.c: .*not enough actual parameters for macro 'yywrap'.* +.*/lexyy.c : not enough actual parameters for macro 'yywrap' +.*/pars0lex.l: .*conversion from 'ulint' to 'int', possible loss of data.* +.*/include/buf0buf\.ic: unused parameter .*mtr.* +.*/fil/fil0fil\.c: pointer targets in passing argument.*differ in signedness +.*/fil/fil0fil\.c: comparison between signed and unsigned : 3100-3199 +.*/fil/fil0fil\.c: unused parameter +.*/log/log0recv\.c: unused variable +.*/os/os0file\.c: unused parameter +.*/os/os0file\.c: pointer targets in assignment differ in signedness +.*/handler/i_s\.cc: unused variable +.*/sync/sync0rw\.c: unused parameter +.*/sync/sync0sync\.c: unused parameter +.*/sync/sync0sync\.c: unused variable +.*/ut/ut0ut\.c: ignoring return value of +.*/srv/srv0srv\.c: value computed is not used +.*/buf/buf0buf\.c: .*block_mutex.* might be used uninitialized +.*/btr/btr0cur\.c: null argument where non-null required: 1800-3000 +.*/btr/btr0btr\.c: null argument where non-null required +.*/btr/btr0cur\.c: .*value computed is not used.*: 3175-3375 +.*/btr/btr0sea\.c: passing argument 2 .* discards qualifiers from pointer target type +.*/ibuf/ibuf0ibuf.c: null argument where non-null required: 700-1000 +.*/fsp0fsp\.c: result of 32-bit shift implicitly converted to 64 bits +.*/log/log0log\.c : passing arg 1 of `atomic_add_64_nv' from incompatible pointer type +.*/log/log0online\.c : passing arg 1 of `atomic_add_64_nv' from incompatible pointer type +.*/buf/buf0buf\.c : label.*loop2.* defined but not used # # Xtradb engine # -storage/xtradb/handler/ha_innodb\.cc: ignoring return value of -storage/xtradb/row/row0log\.cc: ignoring return value of -storage/xtradb/btr/btr0cur\.cc : null argument where non-null required -storage/xtradb/btr/btr0scrub\.cc : null argument where non-null required +.*/storage/xtradb/handler/ha_innodb\.cc: ignoring return value of +.*/storage/xtradb/row/row0log\.cc: ignoring return value of +.*/storage/xtradb/btr/btr0cur\.cc : null argument where non-null required +.*/storage/xtradb/btr/btr0scrub\.cc : null argument where non-null required # # bdb is not critical to keep up to date @@ -66,29 +66,29 @@ storage/xtradb/btr/btr0scrub\.cc : null argument where non-null required .*/bdb/.* : .*unused parameter.* .*/bdb/.* : .*may be used uninitialized.* .*/bdb/.* : .*empty body in an if-statement.* -db_vrfy.c : .*comparison is always false due to limited range of data type.* +.*/db_vrfy.c : .*comparison is always false due to limited range of data type.* # # readline is not maintained by us # .*/cmd-line-utils/readline/.* : .* -readline\.c : unused parameter -term\.c : unused parameter -vi\.c : unused parameter -common\.c : unused parameter -term\.c : .* +.*/readline\.c : unused parameter +.*/term\.c : unused parameter +.*/vi\.c : unused parameter +.*/common\.c : unused parameter +.*/term\.c : .* # # Ignore some warnings in libevent, which is not maintained by us. # .*/extra/libevent/.* : .*unused parameter.* .*/extra/libevent/select\.c : .*comparison between signed and unsigned.* : 270-280 -signal\.c : .*unused parameter.* +.*/signal\.c : .*unused parameter.* # # Ignore warnings from system libraries # -/usr/share/aclocal/audiofile.m4 : .* +.*/aclocal/audiofile.m4 : .* # # Ignore strict-aliasing warnings (for now) @@ -131,30 +131,30 @@ signal\.c : .*unused parameter.* # # Aria warning that is ok in debug builds # -storage/maria/ma_pagecache.c: .*'info_check_pin' defined but not used +.*/storage/maria/ma_pagecache.c: .*'info_check_pin' defined but not used # # oqgraph errors that are hard to fix # -oqgraph/graphcore\.cc : may be used uninitialized in this function +.*/oqgraph/graphcore\.cc : may be used uninitialized in this function # # Yassl # -include/runtime.hpp: .*pure_error.* +.*/include/runtime.hpp: .*pure_error.* .*/extra/yassl/.*taocrypt/.*: comparison with string literal .*/extra/yassl/taocrypt/src/blowfish\.cpp: array subscript is above array bounds .*/extra/yassl/taocrypt/src/file\.cpp: ignoring return value .*/extra/yassl/taocrypt/src/integer\.cpp: control reaches end of non-void function -mySTL/algorithm\.hpp: is used uninitialized in this function -include/pwdbased\.hpp: comparison of unsigned expression +.*/mySTL/algorithm\.hpp: is used uninitialized in this function +.*/include/pwdbased\.hpp: comparison of unsigned expression # # OpenSSL # # The following comes because of different prototype between yassl and openssl. # Save as the argument is a function withing the library. -vio/viosslfactories\.c: discards ~const~ qualifier from pointer target type +.*/vio/viosslfactories\.c: discards ~const~ qualifier from pointer target type # # Groff warnings on OpenSUSE. @@ -166,83 +166,105 @@ vio/viosslfactories\.c: discards ~const~ qualifier from pointer target type # Warnings on OpenSolaris # .*/my_config\.h : _FILE_OFFSET_BITS -/usr/include/sys/feature_tests.h : this is the location of the previous definition -.*auth_pam\.c : initialization from incompatible pointer type : 100-200 +.*/include/sys/feature_tests.h : this is the location of the previous definition +.*/auth_pam\.c : initialization from incompatible pointer type : 100-200 +.*/mysys/my_lock\.c : incompatible pointer # # jemalloc # -jemalloc/src/jemalloc\.c: always_inline function might not be inlinable -jemalloc/src/jemalloc\.c: set but not used +.*/jemalloc/src/jemalloc\.c: always_inline function might not be inlinable +.*/jemalloc/src/jemalloc\.c: set but not used # # Connect engine # -storage/connect/ha_connect\.cc: might be clobbered by ~longjmp~ -storage/connect/connect\.cc: might be clobbered by ~longjmp~ -storage/connect/filamvct\.cpp: ignoring return value of -storage/connect/filamvct\.cpp: might be clobbered by -storage/connect/xindex\.cpp: ignoring return value of -storage/connect/value\.cpp: always false +.*/storage/connect/ha_connect\.cc: might be clobbered by.*longjmp +.*/storage/connect/connect\.cc: might be clobbered by.*longjmp +.*/storage/connect/filamvct\.cpp: ignoring return value of +.*/storage/connect/filamvct\.cpp: might be clobbered by +.*/storage/connect/xindex\.cpp: ignoring return value of +.*/storage/connect/value\.cpp: always false : 1000-1020 +.*/storage/connect/json\.cpp: might be clobbered by # # mroonga # -groonga/lib/expr\.c: propagation disabled -groonga/lib/expr\.c: PRE disabled -groonga/lib/expr\.c: always false +.*/groonga/lib/expr\.c : GCSE disabled +.*/groonga/lib/expr\.c : NULL pointer checks disabled +.*/groonga/lib/expr\.c : PRE disabled +.*/groonga/lib/expr\.c : always false +.*/groonga/lib/expr\.c : jump bypassing disabled +.*/groonga/lib/expr\.c : propagation disabled +.*/groonga/lib/nfkc\.c : GCSE disabled +.*/groonga/lib/nfkc\.c : NULL pointer checks disabled +.*/groonga/lib/nfkc\.c : jump bypassing disabled +.*/groonga/lib/str\.c : comparing floating point +.*/groonga/lib/db\.c : missing initializer +.*/groonga/lib/ii\.c : missing initializer +.*/groonga/lib/normalizer\.c : missing initializer +.*/groonga/lib/proc\.c : missing initializer +.*/groonga/lib/tokenizer\.c : missing initializer # -# Mroonga +# TokuDB # -groonga/lib/expr\.c : const/copy propagation disabled + +# This one is marked with __attribute__, but we still get a (wrong) warning +.*/liblzma/lz/lz_encoder\.c : variable.*in_used.*set but not used # # Unexplanable (?) stuff # -listener\.cc : .*conversion from 'SOCKET' to 'int'.* -net_serv\.cc : .*conversion from 'SOCKET' to 'int'.* +.*/listener\.cc : .*conversion from 'SOCKET' to 'int'.* +.*/net_serv\.cc : .*conversion from 'SOCKET' to 'int'.* # # Ignorable warnings from header files # -backward_warning\.h : This file includes at least one +.*/backward_warning\.h : This file includes at least one /usr/include/i386-linux-gnu/bits/string3\.h: memset used with constant zero length parameter -bits/string3.h : might overflow destination buffer +.*/bits/string3.h : might overflow destination buffer # allow a little moving space for the warning below -mi_packrec\.c : .*result of 32-bit shift implicitly converted to 64 bits.* : 560-600 -ma_packrec\.c : .*result of 32-bit shift implicitly converted to 64 bits.* : 550-650 +.*/mi_packrec\.c : .*result of 32-bit shift implicitly converted to 64 bits.* : 560-600 +.*/ma_packrec\.c : .*result of 32-bit shift implicitly converted to 64 bits.* : 550-650 # # Wrong compiler warnings # .* : .*no matching operator delete found; memory will not be freed if initialization throws an exception.* -ctype-simple\.c : .*unary minus operator applied to unsigned type, result still unsigned.* -sql/sys_vars\.cc : invalid access to non-static data member -string3\.h : memset used with constant zero length parameter +.*/ctype-simple\.c : .*unary minus operator applied to unsigned type, result still unsigned.* +.*/sql/sys_vars\.cc : invalid access to non-static data member +.*/string3\.h : memset used with constant zero length parameter +.*/sql/wsrep_hton\.cc : NULL used in arithmetic : 500-600 +.* : missing-declarations.*is valid # # Ignorable errors on mac # -my_aes\.c: deprecated -my_sha1\.cc: deprecated -my_md5\.cc: deprecated -my_rnd\.cc: deprecated -mdl\.cc: invalid access -mdl\.cc: offsetoff +.*/my_aes\.c: deprecated +.*/my_sha1\.cc: deprecated +.*/my_md5\.cc: deprecated +.*/my_rnd\.cc: deprecated +.*/mdl\.cc: invalid access +.*/mdl\.cc: offsetoff # Wrong warning due to GCC bug: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29478 -regexec\.c : passing argument 3 of.*matcher.* discards qualifiers from pointer target type -libmysql\.c: passing argument 2 of .*memcpy.* discards qualifiers from pointer target type : 3000-4000 -storage/.*/dict/dict0dict\.c : passing argument 1 of .*strcpy.* discards qualifiers from pointer target type : 2500-3500 -storage/.*/sync/sync0rw\.c : passing argument 1 of .*memset.* discards qualifiers from pointer target type : 200-300 -storage/.*/btr/btr0sea\.c : passing argument 2 of .*btr_cur_position.* discards qualifiers from pointer +.*/regexec\.c : passing argument 3 of.*matcher.* discards qualifiers from pointer target type +.*/libmysql\.c: passing argument 2 of .*memcpy.* discards qualifiers from pointer target type : 3000-4000 +.*/storage/.*/dict/dict0dict\.c : passing argument 1 of .*strcpy.* discards qualifiers from pointer target type : 2500-3500 +.*/storage/.*/sync/sync0rw\.c : passing argument 1 of .*memset.* discards qualifiers from pointer target type : 200-300 +.*/storage/.*/btr/btr0sea\.c : passing argument 2 of .*btr_cur_position.* discards qualifiers from pointer + +# Fixed wrong warning in GCC due to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61520 +.*/strings/decimal\.c : array subscript is .* array bounds # # Strange things from autoconf that is probably safe to ignore # -configure.in : warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body -configure.in : config/ac-macros/character_sets.m4.*prefer named diversions -warning: File listed twice +.*configure.in : warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body +.*configure.in : config/ac-macros/character_sets.m4.*prefer named diversions warning: File listed twice +.*/include/mysql/client_plugin\.h : _mysql_client_plugin_declaration_ +.*/plugin/auth_gssapi/client_plugin\.cc: _mysql_client_plugin_declaration_ diff --git a/support-files/mariadb.service.in b/support-files/mariadb.service.in index b18674bea46..55202c696fb 100644 --- a/support-files/mariadb.service.in +++ b/support-files/mariadb.service.in @@ -48,6 +48,14 @@ CapabilityBoundingSet=CAP_IPC_LOCK # Execute pre and post scripts as root, otherwise it does it as User= PermissionsStartOnly=true +# Perform automatic wsrep recovery. When server is started without wsrep, +# galera_recovery simply returns an empty string. In any case, however, +# the script is not expected to return with a non-zero status. +# It is always safe to unset _WSREP_START_POSITION environment variable. +ExecStartPre=/bin/sh -c "systemctl unset-environment _WSREP_START_POSITION" +ExecStartPre=/bin/sh -c "VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ] && \ + systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1" + # Needed to create system tables etc. # ExecStartPre=/usr/bin/mysql_install_db -u mysql @@ -57,9 +65,12 @@ PermissionsStartOnly=true # This isn't a replacement for my.cnf. # _WSREP_NEW_CLUSTER is for the exclusive use of the script galera_new_cluster @SYSTEMD_EXECSTARTPRE@ -ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER +ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION @SYSTEMD_EXECSTARTPOST@ +# Unset _WSREP_START_POSITION environment variable. +ExecStartPost=/bin/sh -c "systemctl unset-environment _WSREP_START_POSITION" + KillMode=process KillSignal=SIGTERM diff --git a/support-files/mariadb@.service.in b/support-files/mariadb@.service.in index fb3b4b5f41d..18adf0e0eac 100644 --- a/support-files/mariadb@.service.in +++ b/support-files/mariadb@.service.in @@ -55,6 +55,21 @@ CapabilityBoundingSet=CAP_IPC_LOCK # Execute pre and post scripts as root, otherwise it does it as User= PermissionsStartOnly=true +# Perform automatic wsrep recovery. When server is started without wsrep, +# galera_recovery simply returns an empty string. In any case, however, +# the script is not expected to return with a non-zero status. +# It is always safe to unset _WSREP_START_POSITION%I environment variable. +ExecStartPre=/bin/sh -c "systemctl unset-environment _WSREP_START_POSITION%I" +ExecStartPre=/bin/sh -c "VAR=`/usr/bin/galera_recovery \ + --defaults-file=@INSTALL_SYSCONF2DIR@/my%I.cnf`; [ $? -eq 0 ] && \ + systemctl set-environment _WSREP_START_POSITION%I=$VAR || exit 1" +# Alternate: (remove ConditionPathExists above) +# use [mysqld.INSTANCENAME] as sections in my.cnf +# +#ExecStartPre=/bin/sh -c "VAR=`/usr/bin/galera_recovery \ +# --defaults-group-suffix=%I`; [ $? -eq 0 ] && \ +# systemctl set-environment _WSREP_START_POSITION%I=$VAR || exit 1" + # Needed to create system tables etc. # ExecStartPre=/usr/bin/mysql_install_db -u mysql @@ -64,11 +79,18 @@ PermissionsStartOnly=true # This isn't a replacement for my.cnf. # _WSREP_NEW_CLUSTER is for the exclusive use of the script galera_new_cluster -ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER --defaults-file=@INSTALL_SYSCONF2DIR@/my%I.cnf +# Note: Place $MYSQLD_OPTS at the very end for its options to take precedence. + +ExecStart=/usr/sbin/mysqld --defaults-file=@INSTALL_SYSCONF2DIR@/my%I.cnf \ + $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION%I $MYSQLD_OPTS # Alternate: (remove ConditionPathExists above) # use [mysqld.INSTANCENAME] as sections in my.cnf # -# ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS --defaults-group-suffix=%I +# ExecStart=/usr/sbin/mysqld --defaults-group-suffix=%I \ +# $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION%I $MYSQLD_OPTS + +# Unset _WSREP_START_POSITION environment variable. +ExecStartPost=/bin/sh -c "systemctl unset-environment _WSREP_START_POSITION%I" KillMode=process KillSignal=SIGTERM diff --git a/support-files/mysql.server.sh b/support-files/mysql.server.sh index e5cdbfd3ce8..d09cefef50d 100644 --- a/support-files/mysql.server.sh +++ b/support-files/mysql.server.sh @@ -47,8 +47,8 @@ basedir= datadir= # Default value, in seconds, afterwhich the script should timeout waiting -# for server start. -# Value here is overriden by value in my.cnf. +# for server start. +# Value here is overridden by value in my.cnf. # 0 means don't wait at all # Negative numbers mean to wait indefinitely service_startup_timeout=900 @@ -379,9 +379,9 @@ case "$mode" in ;; 'status') # First, check to see if pid file exists - if test -s "$mysqld_pid_file_path" ; then + if test -s "$mysqld_pid_file_path" ; then read mysqld_pid < "$mysqld_pid_file_path" - if kill -0 $mysqld_pid 2>/dev/null ; then + if kill -0 $mysqld_pid 2>/dev/null ; then log_success_msg "MySQL running ($mysqld_pid)" exit 0 else @@ -397,11 +397,11 @@ case "$mode" in if test $pid_count -gt 1 ; then log_failure_msg "Multiple MySQL running but PID file could not be found ($mysqld_pid)" exit 5 - elif test -z $mysqld_pid ; then - if test -f "$lock_file_path" ; then + elif test -z $mysqld_pid ; then + if test -f "$lock_file_path" ; then log_failure_msg "MySQL is not running, but lock file ($lock_file_path) exists" exit 2 - fi + fi log_failure_msg "MySQL is not running" exit 3 else diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index 7af1249f596..806924e8e0e 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -2142,7 +2142,7 @@ static void test_ps_conj_select() "(2, 'hh', 'hh'), (1, 'ii', 'ii'), (2, 'ii', 'ii')"); myquery(rc); - strmov(query, "select id1, value1 from t1 where id1= ? or " + strmov(query, "SELECT id1, value1 from t1 where id1= ? or " "CONVERT(value1 USING utf8)= ?"); stmt= mysql_simple_prepare(mysql, query); check_stmt(stmt); @@ -2310,7 +2310,7 @@ static void test_ps_query_cache() return; } - rc= mysql_query(mysql, "SET SQL_MODE=''"); + rc= mysql_set_character_set(mysql, "utf8"); myquery(rc); /* prepare the table */ @@ -2362,6 +2362,8 @@ static void test_ps_query_cache() } rc= mysql_query(lmysql, "SET SQL_MODE=''"); myquery(rc); + rc= mysql_set_character_set(lmysql, "utf8"); + myquery(rc); if (!opt_silent) fprintf(stdout, "OK"); @@ -16711,7 +16713,7 @@ static void test_bug30472() /* Switch client character set. */ - DIE_IF(mysql_set_character_set(&con, "utf8")); + DIE_IF(mysql_set_character_set(&con, "latin2")); /* Retrieve character set information. */ @@ -16727,10 +16729,10 @@ static void test_bug30472() 2) new character set is different from the original one. */ - DIE_UNLESS(strcmp(character_set_name_2, "utf8") == 0); - DIE_UNLESS(strcmp(character_set_client_2, "utf8") == 0); - DIE_UNLESS(strcmp(character_set_results_2, "utf8") == 0); - DIE_UNLESS(strcmp(collation_connnection_2, "utf8_general_ci") == 0); + DIE_UNLESS(strcmp(character_set_name_2, "latin2") == 0); + DIE_UNLESS(strcmp(character_set_client_2, "latin2") == 0); + DIE_UNLESS(strcmp(character_set_results_2, "latin2") == 0); + DIE_UNLESS(strcmp(collation_connnection_2, "latin2_general_ci") == 0); DIE_UNLESS(strcmp(character_set_name_1, character_set_name_2) != 0); DIE_UNLESS(strcmp(character_set_client_1, character_set_client_2) != 0); diff --git a/unittest/sql/mf_iocache-t.cc b/unittest/sql/mf_iocache-t.cc index e0c8c98f4e9..8bbe4db53cf 100644 --- a/unittest/sql/mf_iocache-t.cc +++ b/unittest/sql/mf_iocache-t.cc @@ -93,7 +93,7 @@ IO_CACHE info; #define CACHE_SIZE 16384 #define INFO_TAIL ", pos_in_file = %llu, pos_in_mem = %lu", \ - info.pos_in_file, (*info.current_pos - info.request_pos) + info.pos_in_file, (ulong) (*info.current_pos - info.request_pos) #define FILL 0x5A diff --git a/vio/vio.c b/vio/vio.c index e3bc8ca8ab8..77a58a8272c 100644 --- a/vio/vio.c +++ b/vio/vio.c @@ -67,7 +67,7 @@ int vio_shared_memory_shutdown(Vio *vio, int how) int vio_pipe_shutdown(Vio *vio, int how) { - return cancel_io(vio->hPipe, vio->thread_id); + return CancelIoEx(vio->hPipe, NULL); } #endif diff --git a/vio/viosocket.c b/vio/viosocket.c index e724165612c..a33de48c020 100644 --- a/vio/viosocket.c +++ b/vio/viosocket.c @@ -299,59 +299,12 @@ size_t vio_write(Vio *vio, const uchar* buf, size_t size) DBUG_RETURN(ret); } -#ifdef _WIN32 -static void CALLBACK cancel_io_apc(ULONG_PTR data) -{ - CancelIo((HANDLE)data); -} - -/* - Cancel IO on Windows. - - On XP, issue CancelIo as asynchronous procedure call to the thread - that started IO. On Vista+, simpler cancelation is done with - CancelIoEx. -*/ - -int cancel_io(HANDLE handle, DWORD thread_id) -{ - static BOOL (WINAPI *fp_CancelIoEx) (HANDLE, OVERLAPPED *); - static volatile int first_time= 1; - int rc; - HANDLE thread_handle; - - if (first_time) - { - /* Try to load CancelIoEx using GetProcAddress */ - InterlockedCompareExchangePointer((volatile void *)&fp_CancelIoEx, - GetProcAddress(GetModuleHandle("kernel32"), "CancelIoEx"), NULL); - first_time =0; - } - - if (fp_CancelIoEx) - { - return fp_CancelIoEx(handle, NULL)? 0 :-1; - } - - thread_handle= OpenThread(THREAD_SET_CONTEXT, FALSE, thread_id); - if (thread_handle) - { - rc= QueueUserAPC(cancel_io_apc, thread_handle, (ULONG_PTR)handle); - CloseHandle(thread_handle); - } - return rc; - -} -#endif - - int vio_socket_shutdown(Vio *vio, int how) { int ret= shutdown(mysql_socket_getfd(vio->mysql_socket), how); #ifdef _WIN32 /* Cancel possible IO in progress (shutdown does not do that on Windows). */ - (void) cancel_io((HANDLE) mysql_socket_getfd(vio->mysql_socket), - vio->thread_id); + (void) CancelIoEx((HANDLE)mysql_socket_getfd(vio->mysql_socket), NULL); #endif return ret; } diff --git a/vio/viosslfactories.c b/vio/viosslfactories.c index 3117cdf82ae..52b624d3376 100644 --- a/vio/viosslfactories.c +++ b/vio/viosslfactories.c @@ -1,5 +1,5 @@ -/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. - Copyright (c) 2011, 2015, MariaDB +/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. + Copyright (c) 2011, 2016, MariaDB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -213,7 +213,7 @@ new_VioSSLFd(const char *key_file, const char *cert_file, } /* Load certs from the trusted ca */ - if (SSL_CTX_load_verify_locations(ssl_fd->ssl_context, ca_file, ca_path) == 0) + if (SSL_CTX_load_verify_locations(ssl_fd->ssl_context, ca_file, ca_path) <= 0) { DBUG_PRINT("warning", ("SSL_CTX_load_verify_locations failed")); if (ca_file || ca_path) diff --git a/win/packaging/ca/CustomAction.cpp b/win/packaging/ca/CustomAction.cpp index 3cb8520b65d..56df4ae791e 100644 --- a/win/packaging/ca/CustomAction.cpp +++ b/win/packaging/ca/CustomAction.cpp @@ -886,11 +886,11 @@ extern "C" UINT __stdcall CheckServiceUpgrades(MSIHANDLE hInstall) (QUERY_SERVICE_CONFIGW*)(void *)config_buffer; DWORD needed; BOOL ok= QueryServiceConfigW(service, config,sizeof(config_buffer), - &needed); + &needed) && (config->dwStartType != SERVICE_DISABLED); CloseServiceHandle(service); if (ok) { - mysqld_service_properties props; + mysqld_service_properties props; if (get_mysql_service_properties(config->lpBinaryPathName, &props)) continue; /* diff --git a/win/packaging/extra.wxs.in b/win/packaging/extra.wxs.in index 978a5c9c90d..befe070b404 100644 --- a/win/packaging/extra.wxs.in +++ b/win/packaging/extra.wxs.in @@ -66,6 +66,7 @@ + @@ -463,7 +464,7 @@ Key='SOFTWARE\Monty Program AB\@CPACK_WIX_PACKAGE_NAME@' Name='DATADIR' Value='[DATADIR]' Type='string' KeyPath='yes'/> - + @@ -851,6 +852,7 @@ + + + + = 600)]]> diff --git a/win/packaging/heidisql.cmake b/win/packaging/heidisql.cmake index dfde0cc53b3..bf9433ca34f 100644 --- a/win/packaging/heidisql.cmake +++ b/win/packaging/heidisql.cmake @@ -1,4 +1,4 @@ -SET(HEIDISQL_BASE_NAME "HeidiSQL_9.1_Portable") +SET(HEIDISQL_BASE_NAME "HeidiSQL_9.3_Portable") SET(HEIDISQL_ZIP "${HEIDISQL_BASE_NAME}.zip") SET(HEIDISQL_URL "http://www.heidisql.com/downloads/releases/${HEIDISQL_ZIP}") SET(HEIDISQL_DOWNLOAD_DIR ${THIRD_PARTY_DOWNLOAD_LOCATION}/${HEIDISQL_BASE_NAME})