diff options
93 files changed, 872 insertions, 813 deletions
diff --git a/.bzrignore b/.bzrignore index 6d77ebb79c8..b012c553da2 100644 --- a/.bzrignore +++ b/.bzrignore @@ -183,3 +183,4 @@ mysqld.S mysqld.sym .snprj/* sql-bench/output/* +sql-bench/Results-linux/ATIS-mysql_bdb-Linux_2.2.14_my_SMP_i686 diff --git a/Docs/manual.texi b/Docs/manual.texi index 8d3e037728d..7b273eb5bf1 100644 --- a/Docs/manual.texi +++ b/Docs/manual.texi @@ -20271,7 +20271,7 @@ differ somewhat: | flush | OFF | | flush_time | 0 | | have_bdb | YES | -| have_gemeni | NO | +| have_gemini | NO | | have_innobase | YES | | have_raid | YES | | have_ssl | NO | @@ -20449,9 +20449,9 @@ very little resources. @item @code{have_bdb} @code{YES} if @code{mysqld} supports Berkeley DB tables. @code{DISABLED} if @code{--skip-bdb} is used. -@item @code{have_gemeni} -@code{YES} if @code{mysqld} supports Gemeni tables. @code{DISABLED} -if @code{--skip-gemeni} is used. +@item @code{have_gemini} +@code{YES} if @code{mysqld} supports Gemini tables. @code{DISABLED} +if @code{--skip-gemini} is used. @item @code{have_innobase} @code{YES} if @code{mysqld} supports Innobase tables. @code{DISABLED} if @code{--skip-innobase} is used. @@ -40052,7 +40052,7 @@ though, so Version 3.23 is not released as a stable version yet. @item Added option @code{--safe-show-databases}. @item -Added @code{have_bdb}, @code{have_gemeni}, @code{have_innobase}, +Added @code{have_bdb}, @code{have_gemini}, @code{have_innobase}, @code{have_raid} and @code{have_ssl} to @code{SHOW VARIABLES} to make it easy to test for supported extensions. @item diff --git a/client/mysqltest.c b/client/mysqltest.c index 98ef9c99399..c3f5d4b0bcf 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -23,7 +23,7 @@ * **/ -#define MTEST_VERSION "1.0" +#define MTEST_VERSION "1.1" #include "global.h" #include "my_sys.h" @@ -42,12 +42,12 @@ #include <errno.h> #define MAX_QUERY 16384 -#define PAD_SIZE 128 +#define PAD_SIZE 128 #define MAX_CONS 1024 #define MAX_INCLUDE_DEPTH 16 #define LAZY_GUESS_BUF_SIZE 8192 -#define INIT_Q_LINES 1024 -#define MIN_VAR_ALLOC 32 +#define INIT_Q_LINES 1024 +#define MIN_VAR_ALLOC 32 #define BLOCK_STACK_DEPTH 32 int record = 0, verbose = 0, silent = 0; @@ -100,21 +100,31 @@ VAR var_reg[10]; struct connection cons[MAX_CONS]; struct connection* cur_con, *next_con, *cons_end; -/* this should really be called command*/ +/* this should really be called command */ struct query { char q[MAX_QUERY]; - int has_result_set; int first_word_len; - int abort_on_error; + my_bool abort_on_error, require_file; uint expected_errno; char record_file[FN_REFLEN]; - enum {Q_CONNECTION, Q_QUERY, Q_CONNECT, - Q_SLEEP, Q_INC, Q_DEC,Q_SOURCE, - Q_DISCONNECT,Q_LET, Q_ECHO, Q_WHILE, Q_END_BLOCK, - Q_SYSTEM, Q_UNKNOWN} type; + /* Add new commands before Q_UNKNOWN */ + enum { Q_CONNECTION=1, Q_QUERY, Q_CONNECT, + Q_SLEEP, Q_INC, Q_DEC,Q_SOURCE, + Q_DISCONNECT,Q_LET, Q_ECHO, Q_WHILE, Q_END_BLOCK, + Q_SYSTEM, Q_RESULT, Q_REQUIRE, + Q_UNKNOWN, Q_COMMENT, Q_COMMENT_WITH_COMMAND} type; }; +const char *command_names[] = { +"connection", "query","connect","sleep","inc","dec","source","disconnect", +"let","echo","while","end","system","result", "require",0 +}; + +TYPELIB command_typelib= {array_elements(command_names),"", + command_names}; + + #define DS_CHUNK 16384 typedef struct dyn_string @@ -131,11 +141,53 @@ void dyn_string_append(DYN_STRING* ds, const char* str, int len); int dyn_string_cmp(DYN_STRING* ds, const char* fname); void reject_dump(const char* record_file, char* buf, int size); - -static void die(const char* fmt, ...); int close_connection(struct query* q); VAR* var_get(char* var_name, char* var_name_end, int raw); -void verbose_msg(const char* fmt, ...); + +static void close_cons() +{ + for(--next_con; next_con >= cons; --next_con) + { + mysql_close(&next_con->mysql); + my_free(next_con->name, MYF(MY_ALLOW_ZERO_PTR)); + } +} + +static void die(const char* fmt, ...) +{ + va_list args; + va_start(args, fmt); + fprintf(stderr, "%s: ", my_progname); + vfprintf(stderr, fmt, args); + fprintf(stderr, "\n"); + va_end(args); + close_cons(); + exit(1); +} + +static void abort_not_supported_test() +{ + fprintf(stderr, "This test is not supported by this installation\n"); + if (!silent) + printf("skipped\n"); + close_cons(); + exit(2); +} + +static void verbose_msg(const char* fmt, ...) +{ + va_list args; + + if (!verbose) return; + + va_start(args, fmt); + + fprintf(stderr, "%s: ", my_progname); + vfprintf(stderr, fmt, args); + fprintf(stderr, "\n"); + va_end(args); +} + void init_parser() { @@ -145,9 +197,9 @@ void init_parser() int hex_val(int c) { - if(isdigit(c)) + if (isdigit(c)) return c - '0'; - else if((c = tolower(c)) >= 'a' && c <= 'f') + else if ((c = tolower(c)) >= 'a' && c <= 'f') return c - 'a' + 10; else return -1; @@ -155,7 +207,7 @@ int hex_val(int c) void dyn_string_init(DYN_STRING* ds) { - if(!(ds->str = (char*)my_malloc(DS_CHUNK, MYF(0)))) + if (!(ds->str = (char*)my_malloc(DS_CHUNK, MYF(0)))) die("Out of memory"); ds->len = 0; ds->max_len = DS_CHUNK; @@ -170,14 +222,14 @@ void dyn_string_end(DYN_STRING* ds) void dyn_string_append(DYN_STRING* ds, const char* str, int len) { int new_len; - if(!len) + if (!len) len = strlen(str); new_len = ds->len + len; - if(new_len > ds->max_len) + if (new_len > ds->max_len) { int new_alloc_len = (new_len & ~(DS_CHUNK-1)) + DS_CHUNK; char* tmp = (char*) my_malloc(new_alloc_len, MYF(0)); - if(!tmp) + if (!tmp) die("Out of memory"); memcpy(tmp, ds->str, ds->len); memcpy(tmp + ds->len, str, len); @@ -192,21 +244,23 @@ void dyn_string_append(DYN_STRING* ds, const char* str, int len) ds->len += len; } } + + int dyn_string_cmp(DYN_STRING* ds, const char* fname) { MY_STAT stat_info; char *tmp; int res; int fd; - if(!my_stat(fname, &stat_info, MYF(MY_WME))) + if (!my_stat(fname, &stat_info, MYF(MY_WME))) die("Could not stat %s: errno =%d", fname, errno); - if(stat_info.st_size != ds->len) + if (stat_info.st_size != ds->len) return 2; - if(!(tmp = (char*) my_malloc(ds->len, MYF(0)))) + if (!(tmp = (char*) my_malloc(ds->len, MYF(0)))) die("Out of memory"); - if((fd = my_open(fname, O_RDONLY, MYF(MY_WME))) < 0) + if ((fd = my_open(fname, O_RDONLY, MYF(MY_WME))) < 0) die("Could not open %s: errno = %d", fname, errno); - if(my_read(fd, (byte*)tmp, stat_info.st_size, MYF(MY_WME|MY_NABP))) + if (my_read(fd, (byte*)tmp, stat_info.st_size, MYF(MY_WME|MY_NABP))) die("read failed"); res = (memcmp(tmp, ds->str, stat_info.st_size)) ? 1 : 0; my_free((gptr)tmp, MYF(0)); @@ -214,25 +268,30 @@ int dyn_string_cmp(DYN_STRING* ds, const char* fname) return res; } -int check_result(DYN_STRING* ds, const char* fname) +static int check_result(DYN_STRING* ds, const char* fname, + my_bool require_option) { int error = 0; - switch(dyn_string_cmp(ds, fname)) - { - case 0: - break; /* ok */ - case 2: - verbose_msg("Result length mismatch"); - error = 1; - break; - case 1: - verbose_msg("Result content mismatch"); - error = 1; - break; - default: /* impossible */ - die("Unknown error code from dyn_string_cmp()"); - } - if(error) + int res=dyn_string_cmp(ds, fname); + + if (res && require_option) + abort_not_supported_test(); + switch (res) + { + case 0: + break; /* ok */ + case 2: + verbose_msg("Result length mismatch"); + error = 1; + break; + case 1: + verbose_msg("Result content mismatch"); + error = 1; + break; + default: /* impossible */ + die("Unknown error code from dyn_string_cmp()"); + } + if (error) reject_dump(fname, ds->str, ds->len); return error; } @@ -241,26 +300,26 @@ VAR* var_get(char* var_name, char* var_name_end, int raw) { int digit; VAR* v; - if(*var_name++ != '$') - { - --var_name; - goto err; - } + if (*var_name++ != '$') + { + --var_name; + goto err; + } digit = *var_name - '0'; - if(!(digit < 10 && digit >= 0)) - { - --var_name; - goto err; - } + if (!(digit < 10 && digit >= 0)) + { + --var_name; + goto err; + } v = var_reg + digit; - if(!raw && v->int_dirty) - { - sprintf(v->str_val, "%d", v->int_val); - v->int_dirty = 0; - } + if (!raw && v->int_dirty) + { + sprintf(v->str_val, "%d", v->int_val); + v->int_dirty = 0; + } return v; - err: - if(var_name_end) +err: + if (var_name_end) *var_name_end = 0; die("Unsupported variable name: %s", var_name); return 0; @@ -272,23 +331,23 @@ int var_set(char* var_name, char* var_name_end, char* var_val, int digit; int val_len; VAR* v; - if(*var_name++ != '$') + if (*var_name++ != '$') { --var_name; *var_name_end = 0; die("Variable name in %s does not start with '$'", var_name); } digit = *var_name - '0'; - if(!(digit < 10 && digit >= 0)) + if (!(digit < 10 && digit >= 0)) { *var_name_end = 0; die("Unsupported variable name: %s", var_name); } v = var_reg + digit; - if(v->alloced_len < (val_len = (int)(var_val_end - var_val)+1)) + if (v->alloced_len < (val_len = (int)(var_val_end - var_val)+1)) { v->alloced_len = (val_len < MIN_VAR_ALLOC) ? MIN_VAR_ALLOC : val_len; - if(!(v->str_val = + if (!(v->str_val = v->str_val ? my_realloc(v->str_val, v->alloced_len, MYF(MY_WME)) : my_malloc(v->alloced_len, MYF(MY_WME)))) die("Out of memory"); @@ -302,9 +361,9 @@ int var_set(char* var_name, char* var_name_end, char* var_val, int open_file(const char* name) { - if(*cur_file && ++cur_file == file_stack_end) + if (*cur_file && ++cur_file == file_stack_end) die("Source directives are nesting too deep"); - if(!(*cur_file = fopen(name, "r"))) + if (!(*cur_file = my_fopen(name, O_RDONLY, MYF(MY_WME)))) die("Could not read '%s': errno %d\n", name, errno); return 0; @@ -315,7 +374,7 @@ int do_source(struct query* q) char* p, *name; p = (char*)q->q + q->first_word_len; while(*p && isspace(*p)) p++; - if(!*p) + if (!*p) die("Missing file name in source\n"); name = p; while(*p && !isspace(*p)) @@ -329,9 +388,9 @@ int do_source(struct query* q) int eval_expr(VAR* v, char* p, char* p_end) { VAR* vp; - if(*p == '$') + if (*p == '$') { - if((vp = var_get(p,p_end,0))) + if ((vp = var_get(p,p_end,0))) { memcpy(v, vp, sizeof(VAR)); return 0; @@ -344,7 +403,7 @@ int eval_expr(VAR* v, char* p, char* p_end) return 0; } - if(p_end) + if (p_end) *p_end = 0; die("Invalid expr: %s", p); return 1; @@ -381,14 +440,14 @@ int do_system(struct query* q) p = (char*)q->q + q->first_word_len; while(*p && isspace(*p)) p++; eval_expr(&v, p, 0); /* NULL terminated */ - if(v.str_val_len > 1) + if (v.str_val_len > 1) { char expr_buf[512]; - if((uint)v.str_val_len > sizeof(expr_buf) - 1) + if ((uint)v.str_val_len > sizeof(expr_buf) - 1) v.str_val_len = sizeof(expr_buf) - 1; memcpy(expr_buf, v.str_val, v.str_val_len); expr_buf[v.str_val_len] = 0; - if(system(expr_buf) && q->abort_on_error) + if (system(expr_buf) && q->abort_on_error) die("system command '%s' failed", expr_buf); } return 0; @@ -401,7 +460,7 @@ int do_echo(struct query* q) p = (char*)q->q + q->first_word_len; while(*p && isspace(*p)) p++; eval_expr(&v, p, 0); /* NULL terminated */ - if(v.str_val_len > 1) + if (v.str_val_len > 1) { fflush(stdout); write(1, v.str_val, v.str_val_len - 1); @@ -415,13 +474,13 @@ int do_let(struct query* q) char* p, *var_name, *var_name_end, *var_val_start; p = (char*)q->q + q->first_word_len; while(*p && isspace(*p)) p++; - if(!*p) + if (!*p) die("Missing variable name in let\n"); var_name = p; while(*p && (*p != '=' || isspace(*p))) p++; var_name_end = p; - if(*p == '=') p++; + if (*p == '=') p++; while(*p && isspace(*p)) p++; var_val_start = p; @@ -437,37 +496,48 @@ int do_sleep(struct query* q) int dec_mul = 1000000; p = (char*)q->q + q->first_word_len; while(*p && isspace(*p)) p++; - if(!*p) - die("Missing agument in sleep\n"); + if (!*p) + die("Missing argument in sleep\n"); arg = p; t.tv_sec = atoi(arg); t.tv_usec = 0; while(*p && *p != '.' && !isspace(*p)) p++; - if(*p == '.') - { - char c; - char *p_end; - p++; - p_end = p + 6; + if (*p == '.') + { + char c; + char *p_end; + p++; + p_end = p + 6; - for(;p <= p_end; ++p) - { - c = *p - '0'; - if(c < 10 && c >= 0) - { - t.tv_usec = t.tv_usec * 10 + c; - dec_mul /= 10; - } - else - break; - } + for(;p <= p_end; ++p) + { + c = *p - '0'; + if (c < 10 && c >= 0) + { + t.tv_usec = t.tv_usec * 10 + c; + dec_mul /= 10; + } + else + break; } + } *p = 0; t.tv_usec *= dec_mul; return select(0,0,0,0, &t); } +static void get_file_name(char *filename, struct query* q) +{ + char *p = (char*) q->q + q->first_word_len; + while(*p && isspace(*p)) p++; + strnmov(filename, p, FN_REFLEN); + /* Remove end space */ + while (p > filename && isspace(p[-1])) + p--; + p[0]=0; +} + int select_connection(struct query* q) { @@ -475,7 +545,7 @@ int select_connection(struct query* q) struct connection *con; p = (char*)q->q + q->first_word_len; while(*p && isspace(*p)) p++; - if(!*p) + if (!*p) die("Missing connection name in connect\n"); name = p; while(*p && !isspace(*p)) @@ -483,7 +553,7 @@ int select_connection(struct query* q) *p = 0; for(con = cons; con < next_con; con++) - if(!strcmp(con->name, name)) + if (!strcmp(con->name, name)) { cur_con = con; return 0; @@ -499,7 +569,7 @@ int close_connection(struct query* q) struct connection *con; p = (char*)q->q + q->first_word_len; while(*p && isspace(*p)) p++; - if(!*p) + if (!*p) die("Missing connection name in connect\n"); name = p; while(*p && !isspace(*p)) @@ -507,7 +577,7 @@ int close_connection(struct query* q) *p = 0; for(con = cons; con < next_con; con++) - if(!strcmp(con->name, name)) + if (!strcmp(con->name, name)) { mysql_close(&con->mysql); return 0; @@ -529,10 +599,10 @@ char* safe_get_param(char* str, char** arg, const char* msg) *arg = str; while(*str && *str != ',' && *str != ')') { - if(isspace(*str)) *str = 0; + if (isspace(*str)) *str = 0; str++; } - if(!*str) + if (!*str) die(msg); *str++ = 0; @@ -548,7 +618,7 @@ int do_connect(struct query* q) p = q->q + q->first_word_len; while(*p && isspace(*p)) p++; - if(*p != '(') + if (*p != '(') die("Syntax error in connect - expeected '(' found '%c'", *p); p++; p = safe_get_param(p, &con_name, "missing connection name"); @@ -558,17 +628,17 @@ int do_connect(struct query* q) p = safe_get_param(p, &con_db, "missing connection db"); p = safe_get_param(p, &con_port_str, "missing connection port"); p = safe_get_param(p, &con_sock, "missing connection scoket"); - if(next_con == cons_end) + if (next_con == cons_end) die("Connection limit exhausted - incread MAX_CONS in mysqltest.c"); - if(!mysql_init(&next_con->mysql)) + if (!mysql_init(&next_con->mysql)) die("Failed on mysql_init()"); - if(!mysql_real_connect(&next_con->mysql, con_host, con_user, con_pass, + if (!mysql_real_connect(&next_con->mysql, con_host, con_user, con_pass, con_db, atoi(con_port_str), con_sock, 0)) die("Could not open connection '%s': %s", con_name, mysql_error(&next_con->mysql)); - if(!(next_con->name = my_strdup(con_name, MYF(MY_WME)))) + if (!(next_con->name = my_strdup(con_name, MYF(MY_WME)))) die("Out of memory"); cur_con = next_con++; @@ -578,13 +648,13 @@ int do_connect(struct query* q) int do_done(struct query* q) { q->type = Q_END_BLOCK; - if(cur_block == block_stack) + if (cur_block == block_stack) die("Stray '}' - end of block before beginning"); - if(block_ok) + if (block_ok) parser.current_line = *--cur_block; else { - if(!--false_block_depth) + if (!--false_block_depth) block_ok = 1; ++parser.current_line; } @@ -596,22 +666,22 @@ int do_while(struct query* q) char *p = q->q + q->first_word_len; char* expr_start, *expr_end; VAR v; - if(cur_block == block_stack_end) + if (cur_block == block_stack_end) die("Nesting too deep"); - if(!block_ok) + if (!block_ok) { ++false_block_depth; return 0; } expr_start = strchr(p, '('); - if(!expr_start) + if (!expr_start) die("missing '(' in while"); expr_end = strrchr(expr_start, ')'); - if(!expr_end) + if (!expr_end) die("missing ')' in while"); eval_expr(&v, ++expr_start, --expr_end); *cur_block++ = parser.current_line++; - if(!v.int_val) + if (!v.int_val) { block_ok = 0; false_block_depth = 1; @@ -619,14 +689,6 @@ int do_while(struct query* q) return 0; } -void close_cons() -{ - for(--next_con; next_con >= cons; --next_con) - { - mysql_close(&next_con->mysql); - my_free(next_con->name, MYF(MY_ALLOW_ZERO_PTR)); - } -} int safe_copy_unescape(char* dest, char* src, int size) { @@ -642,7 +704,7 @@ int safe_copy_unescape(char* dest, char* src, int size) switch(state) { case ST_NORMAL: - if(c == '\\') + if (c == '\\') { state = ST_ESCAPED; } @@ -650,7 +712,7 @@ int safe_copy_unescape(char* dest, char* src, int size) *p_dest++ = c; break; case ST_ESCAPED: - if((val = hex_val(c)) > 0) + if ((val = hex_val(c)) > 0) { *p_dest = val; state = ST_HEX2; @@ -662,7 +724,7 @@ int safe_copy_unescape(char* dest, char* src, int size) } break; case ST_HEX2: - if((val = hex_val(c)) > 0) + if ((val = hex_val(c)) > 0) { *p_dest = (*p_dest << 4) + val; p_dest++; @@ -683,118 +745,118 @@ int safe_copy_unescape(char* dest, char* src, int size) int read_line(char* buf, int size) { int c; - char* p = buf, *buf_end = buf + size; + char* p = buf, *buf_end = buf + size-1; int no_save = 0; enum {R_NORMAL, R_Q1, R_ESC_Q_Q1, R_ESC_Q_Q2, R_ESC_SLASH_Q1, R_ESC_SLASH_Q2, R_Q2, R_COMMENT, R_LINE_START} state = R_LINE_START; - for(; p < buf_end ;) + for (; p < buf_end ;) + { + no_save = 0; + c = fgetc(*cur_file); + if (feof(*cur_file)) { - no_save = 0; - c = fgetc(*cur_file); - if(feof(*cur_file)) - { - fclose(*cur_file); + my_fclose(*cur_file,MYF(0)); - if(cur_file == file_stack) - return 1; - else - { - cur_file--; - continue; - } - } - - switch(state) - { - case R_NORMAL: - if(c == ';' || c == '{') /* '{' allows some interesting syntax - * but we don't care, as long as the - * correct sytnax gets parsed right */ - { - *p = 0; - return 0; - } - else if(c == '\'') - state = R_Q1; - else if(c == '"') - state = R_Q2; - else if(c == '\n') - state = R_LINE_START; - - break; - case R_COMMENT: - no_save = 1; - if(c == '\n') - state = R_LINE_START; - break; + if (cur_file == file_stack) + return 1; + else + { + cur_file--; + continue; + } + } - case R_LINE_START: - if(c == '#') - { - state = R_COMMENT; - no_save = 1; - } - else if(isspace(c)) - no_save = 1; - else if(c == '}') - { - *buf++ = '}'; - *buf = 0; - return 0; - } - else if(c == ';' || c == '{') - { - *p = 0; - return 0; - } - else - state = R_NORMAL; - break; + switch(state) { + case R_NORMAL: + if (c == ';' || c == '{') /* '{' allows some interesting syntax + * but we don't care, as long as the + * correct sytnax gets parsed right */ + { + *p = 0; + return 0; + } + else if (c == '\'') + state = R_Q1; + else if (c == '"') + state = R_Q2; + else if (c == '\n') + state = R_LINE_START; - case R_Q1: - if(c == '\'') - state = R_ESC_Q_Q1; - else if(c == '\\') - state = R_ESC_SLASH_Q1; - break; - case R_ESC_Q_Q1: - if(c == ';') - { - *p = 0; - return 0; - } - if(c != '\'') - state = R_NORMAL; - break; - case R_ESC_SLASH_Q1: - state = R_Q1; - break; + break; + case R_COMMENT: + if (c == '\n') + { + *p=0; + return 0; + } + break; + case R_LINE_START: + if (c == '#' || c == '-') + { + state = R_COMMENT; + } + else if (isspace(c)) + no_save = 1; + else if (c == '}') + { + *buf++ = '}'; + *buf = 0; + return 0; + } + else if (c == ';' || c == '{') + { + *p = 0; + return 0; + } + else + state = R_NORMAL; + break; - case R_Q2: - if(c == '"') - state = R_ESC_Q_Q2; - else if(c == '\\') - state = R_ESC_SLASH_Q2; - break; - case R_ESC_Q_Q2: - if(c == ';') - { - *p = 0; - return 0; - } - if(c != '"') - state = R_NORMAL; - break; - case R_ESC_SLASH_Q2: - state = R_Q2; - break; - } + case R_Q1: + if (c == '\'') + state = R_ESC_Q_Q1; + else if (c == '\\') + state = R_ESC_SLASH_Q1; + break; + case R_ESC_Q_Q1: + if (c == ';') + { + *p = 0; + return 0; + } + if (c != '\'') + state = R_NORMAL; + break; + case R_ESC_SLASH_Q1: + state = R_Q1; + break; - if(!no_save) - *p++ = c; + case R_Q2: + if (c == '"') + state = R_ESC_Q_Q2; + else if (c == '\\') + state = R_ESC_SLASH_Q2; + break; + case R_ESC_Q_Q2: + if (c == ';') + { + *p = 0; + return 0; + } + if (c != '"') + state = R_NORMAL; + break; + case R_ESC_SLASH_Q2: + state = R_Q2; + break; } + + if (!no_save) + *p++ = c; + } + *p=0; /* Always end with \0 */ return feof(*cur_file); } @@ -804,58 +866,69 @@ int read_query(struct query** q_ptr) char* p = buf,* p1 ; int c, expected_errno; struct query* q; - if(parser.current_line < parser.read_lines) - { - get_dynamic(&q_lines, (gptr)q_ptr, parser.current_line) ; - return 0; - } - if(!(*q_ptr=q=(struct query*)my_malloc(sizeof(*q), MYF(MY_WME))) + if (parser.current_line < parser.read_lines) + { + get_dynamic(&q_lines, (gptr)q_ptr, parser.current_line) ; + return 0; + } + if (!(*q_ptr=q=(struct query*)my_malloc(sizeof(*q), MYF(MY_WME))) || insert_dynamic(&q_lines, (gptr)&q) ) die("Out of memory"); q->record_file[0] = 0; + q->require_file=0; q->abort_on_error = 1; - q->has_result_set = 0; q->first_word_len = 0; q->expected_errno = 0; q->type = Q_UNKNOWN; - if(read_line(buf, sizeof(buf))) + if (read_line(buf, sizeof(buf))) return 1; - if(*p == '!') + + if (*p == '#') + { + q->type = Q_COMMENT; + } + else if (p[0] == '-' && p[1] == '-') + { + q->type = Q_COMMENT_WITH_COMMAND; + p+=2; /* To calculate first word */ + } + else + { + if (*p == '!') { - q->abort_on_error = 0; - p++; - if(*p == '$') - { - expected_errno = 0; - p++; - for(;isdigit(*p);p++) - expected_errno = expected_errno * 10 + *p - '0'; - q->expected_errno = expected_errno; - } + q->abort_on_error = 0; + p++; + if (*p == '$') + { + expected_errno = 0; + p++; + for (;isdigit(*p);p++) + expected_errno = expected_errno * 10 + *p - '0'; + q->expected_errno = expected_errno; + } } - while(*p && isspace(*p)) p++ ; - if(*p == '@') + while(*p && isspace(*p)) p++ ; + if (*p == '@') { - q->has_result_set = 1; p++; p1 = q->record_file; while(!isspace(c = *p) && p1 < q->record_file + sizeof(q->record_file) - 1) *p1++ = *p++; *p1 = 0; - } - + } while(*p && isspace(*p)) p++; + /* Calculate first word */ p1 = q->q; while(*p && !isspace(*p)) *p1++ = *p++; q->first_word_len = p1 - q->q; - strcpy(p1, p); + strmov(p1, p); parser.read_lines++; return 0; } @@ -878,31 +951,6 @@ struct option long_options[] = {0, 0,0,0} }; -void die(const char* fmt, ...) -{ - va_list args; - va_start(args, fmt); - fprintf(stderr, "%s: ", my_progname); - vfprintf(stderr, fmt, args); - fprintf(stderr, "\n"); - va_end(args); - close_cons(); - exit(1); -} - -void verbose_msg(const char* fmt, ...) -{ - va_list args; - - if(!verbose) return; - - va_start(args, fmt); - - fprintf(stderr, "%s: ", my_progname); - vfprintf(stderr, fmt, args); - fprintf(stderr, "\n"); - va_end(args); -} static void print_version(void) { @@ -957,7 +1005,7 @@ int parse_args(int argc, char **argv) case 'R': result_file = optarg; break; - case 'p': + case 'p': if (optarg) { my_free(pass,MYF(MY_ALLOW_ZERO_PTR)); @@ -990,7 +1038,7 @@ int parse_args(int argc, char **argv) exit(0); default: usage(); - exit(0); + exit(1); } } @@ -1002,10 +1050,7 @@ int parse_args(int argc, char **argv) exit(1); } if (argc == 1) - { - my_free(db,MYF(MY_ALLOW_ZERO_PTR)); - db=my_strdup(*argv,MYF(MY_WME)); - } + db= *argv; if (tty_password) pass=get_tty_password(NullS); @@ -1024,9 +1069,9 @@ char* safe_str_append(char* buf, const char* str, int size) void str_to_file(const char* fname, char* str, int size) { int fd; - if((fd = my_open(fname, O_WRONLY|O_CREAT, MYF(MY_WME | MY_FFNF))) < 0) + if ((fd = my_open(fname, O_WRONLY|O_CREAT, MYF(MY_WME | MY_FFNF))) < 0) die("Could not open %s: errno = %d", fname, errno); - if(my_write(fd, (byte*)str, size, MYF(MY_WME|MY_FNABP))) + if (my_write(fd, (byte*)str, size, MYF(MY_WME|MY_FNABP))) die("write failed"); my_close(fd, MYF(0)); } @@ -1042,6 +1087,7 @@ void reject_dump(const char* record_file, char* buf, int size) str_to_file(reject_file, buf, size); } + int run_query(MYSQL* mysql, struct query* q) { MYSQL_RES* res = 0; @@ -1055,66 +1101,69 @@ int run_query(MYSQL* mysql, struct query* q) DYN_STRING ds_tmp; dyn_string_init(&ds_tmp); - if( q->record_file[0]) - { - ds = &ds_tmp; - } - - + if ( q->record_file[0]) + { + ds = &ds_tmp; + } - if(mysql_query(mysql, q->q)) + if (mysql_query(mysql, q->q)) + { + if (q->require_file) + abort_not_supported_test(); + if (q->abort_on_error) + die("query '%s' failed: %s", q->q, mysql_error(mysql)); + else { - if(q->abort_on_error) - die("query '%s' failed: %s", q->q, mysql_error(mysql)); - else - { - if(q->expected_errno) - { - error = (q->expected_errno != mysql_errno(mysql)); - if(error) - verbose_msg("query '%s' failed with wrong errno\ + if (q->expected_errno) + { + error = (q->expected_errno != mysql_errno(mysql)); + if (error) + verbose_msg("query '%s' failed with wrong errno\ %d instead of %d", q->q, mysql_errno(mysql), q->expected_errno); - goto end; - } - - verbose_msg("query '%s' failed: %s", q->q, mysql_error(mysql)); - /* if we do not abort on error, failure to run the query does - not fail the whole test case - */ - goto end; - } - } + goto end; + } - if(q->expected_errno) - { - error = 1; - verbose_msg("query '%s' succeeded - should have failed with errno %d", - q->q, q->expected_errno); + verbose_msg("query '%s' failed: %s", q->q, mysql_error(mysql)); + /* if we do not abort on error, failure to run the query does + not fail the whole test case + */ goto end; } + } + + if (q->expected_errno) + { + error = 1; + verbose_msg("query '%s' succeeded - should have failed with errno %d", + q->q, q->expected_errno); + goto end; + } - if(!(res = mysql_store_result(mysql)) && mysql_field_count(mysql)) + if (!(res = mysql_store_result(mysql)) && mysql_field_count(mysql)) + { + if (q->require_file) + abort_not_supported_test(); + if (q->abort_on_error) + die("failed in mysql_store_result for query '%s'", q->q); + else { - if(q->abort_on_error) - die("failed in mysql_store_result for query '%s'", q->q); - else - { - verbose_msg("failed in mysql_store_result for query '%s'", q->q); - error = 1; - goto end; - } + verbose_msg("failed in mysql_store_result for query '%s'", q->q); + error = 1; + goto end; } + } - if(!res) goto end; + if (!res) goto end; fields = mysql_fetch_fields(res); - num_fields = mysql_num_fields(res); + num_fields = mysql_num_fields(res); for( i = 0; i < num_fields; i++) - { - dyn_string_append(ds, fields[i].name, 0); + { + if (i) dyn_string_append(ds, "\t", 1); - } + dyn_string_append(ds, fields[i].name, 0); + } dyn_string_append(ds, "\n", 1); @@ -1123,111 +1172,71 @@ int run_query(MYSQL* mysql, struct query* q) { lengths = mysql_fetch_lengths(res); for(i = 0; i < num_fields; i++) - { - val = (char*)row[i]; - len = lengths[i]; + { + val = (char*)row[i]; + len = lengths[i]; - if(!val) - { - val = (char*)"NULL"; - len = 4; - } + if (!val) + { + val = (char*)"NULL"; + len = 4; + } - dyn_string_append(ds, val, len); + if (i) dyn_string_append(ds, "\t", 1); - } + dyn_string_append(ds, val, len); + } dyn_string_append(ds, "\n", 1); } - if(record) - { - if(!q->record_file[0] && !result_file) - die("Missing result file"); - if(!result_file) - str_to_file(q->record_file, ds->str, ds->len); - } - else if(q->record_file[0]) - { - error = check_result(ds, q->record_file); - } + if (record) + { + if (!q->record_file[0] && !result_file) + die("Missing result file"); + if (!result_file) + str_to_file(q->record_file, ds->str, ds->len); + } + else if (q->record_file[0]) + { + error = check_result(ds, q->record_file, q->require_file); + } - end: - if(res) mysql_free_result(res); +end: + if (res) mysql_free_result(res); return error; } -int check_first_word(struct query* q, const char* word, int len) -{ - const char* p, *p1, *end; - - if(len != q->first_word_len) - return 0; - - - p = word; - end = p + len; - p1 = q->q; - - for(; p < end; p++, p1++) - if(tolower(*p) != tolower(*p1)) - return 0; - - return 1; -} void get_query_type(struct query* q) { - if(*q->q == '}') - { - q->type = Q_END_BLOCK; - return; - } - q->type = Q_QUERY; - switch(q->first_word_len) - { - case 3: - if(check_first_word(q, "inc", 3)) - q->type = Q_INC; - else if(check_first_word(q, "dec", 3)) - q->type = Q_DEC; - else if(check_first_word(q, "let", 3)) - q->type = Q_LET; - break; - case 4: - if(check_first_word(q, "echo", 4)) - q->type = Q_ECHO; - break; - case 5: - if(check_first_word(q, "sleep", 5)) - q->type = Q_SLEEP; - else if(check_first_word(q, "while", 5)) - q->type = Q_WHILE; - break; - case 6: - if(check_first_word(q, "source", 6)) - q->type = Q_SOURCE; - else if(check_first_word(q, "system", 6)) - q->type = Q_SYSTEM; - break; - case 7: - if(check_first_word(q, "connect", 7)) - q->type = Q_CONNECT; - break; - case 10: - if(check_first_word(q, "connection", 10)) - q->type = Q_CONNECTION; - else if(check_first_word(q, "disconnect", 10)) - q->type = Q_DISCONNECT; - break; - - } + char save; + uint type; + if (*q->q == '}') + { + q->type = Q_END_BLOCK; + return; + } + if (q->type != Q_COMMENT_WITH_COMMAND) + q->type = Q_QUERY; + + save=q->q[q->first_word_len]; + q->q[q->first_word_len]=0; + type=find_type(q->q, &command_typelib, 0); + q->q[q->first_word_len]=save; + if (type > 0) + q->type=type; /* Found command */ } + + int main(int argc, char** argv) { int error = 0; struct query* q; + my_bool require_file=0; + char save_file[FN_REFLEN]; + save_file[0]=0; MY_INIT(argv[0]); memset(cons, 0, sizeof(cons)); @@ -1245,73 +1254,90 @@ int main(int argc, char** argv) cur_block = block_stack; dyn_string_init(&ds_res); parse_args(argc, argv); - if(!*cur_file) + if (!*cur_file) *cur_file = stdin; - - if(!( mysql_init(&cur_con->mysql))) + if (!( mysql_init(&cur_con->mysql))) die("Failed in mysql_init()"); mysql_options(&cur_con->mysql, MYSQL_READ_DEFAULT_GROUP, "mysql"); cur_con->name = my_strdup("default", MYF(MY_WME)); - if(!cur_con->name) + if (!cur_con->name) die("Out of memory"); - if(!mysql_real_connect(&cur_con->mysql, host, + if (!mysql_real_connect(&cur_con->mysql, host, user, pass, db, port, unix_sock, 0)) die("Failed in mysql_real_connect(): %s", mysql_error(&cur_con->mysql)); for(;!read_query(&q);) + { + int current_line_inc = 1, processed = 0; + if (q->type == Q_UNKNOWN || q->type == Q_COMMENT_WITH_COMMAND) + get_query_type(q); + if (block_ok) { - int current_line_inc = 1, processed = 0; - if(q->type == Q_UNKNOWN) - get_query_type(q); - if(block_ok) - { - processed = 1; - switch(q->type) - { - case Q_CONNECT: do_connect(q); break; - case Q_CONNECTION: select_connection(q); break; - case Q_DISCONNECT: close_connection(q); break; - case Q_SOURCE: do_source(q); break; - case Q_SLEEP: do_sleep(q); break; - case Q_INC: do_inc(q); break; - case Q_DEC: do_dec(q); break; - case Q_ECHO: do_echo(q); break; - case Q_SYSTEM: do_system(q); break; - case Q_LET: do_let(q); break; - case Q_QUERY: error |= run_query(&cur_con->mysql, q); break; - default: processed = 0; break; - } - } - - if(!processed) + processed = 1; + switch (q->type) { + case Q_CONNECT: do_connect(q); break; + case Q_CONNECTION: select_connection(q); break; + case Q_DISCONNECT: close_connection(q); break; + case Q_SOURCE: do_source(q); break; + case Q_SLEEP: do_sleep(q); break; + case Q_INC: do_inc(q); break; + case Q_DEC: do_dec(q); break; + case Q_ECHO: do_echo(q); break; + case Q_SYSTEM: do_system(q); break; + case Q_LET: do_let(q); break; + case Q_QUERY: + { + if (save_file[0]) { - current_line_inc = 0; - switch(q->type) - { - case Q_WHILE: do_while(q); break; - case Q_END_BLOCK: do_done(q); break; - default: current_line_inc = 1; break; - } + strmov(q->record_file,save_file); + q->require_file=require_file; + save_file[0]=0; } + error |= run_query(&cur_con->mysql, q); break; + } + case Q_RESULT: + get_file_name(save_file,q); + require_file=0; + break; + case Q_REQUIRE: + get_file_name(save_file,q); + require_file=1; + break; + case Q_COMMENT: /* Ignore row */ + case Q_COMMENT_WITH_COMMAND: + default: processed = 0; break; + } + } - parser.current_line += current_line_inc; + if (!processed) + { + current_line_inc = 0; + switch(q->type) + { + case Q_WHILE: do_while(q); break; + case Q_END_BLOCK: do_done(q); break; + default: current_line_inc = 1; break; + } } + parser.current_line += current_line_inc; + } + close_cons(); - if(result_file && ds_res.len) - { - if(!record) - error |= check_result(&ds_res, result_file); - else - str_to_file(result_file, ds_res.str, ds_res.len); - } + if (result_file && ds_res.len) + { + if(!record) + error |= check_result(&ds_res, result_file, q->require_file); + else + str_to_file(result_file, ds_res.str, ds_res.len); + } dyn_string_end(&ds_res); if (!silent) { diff --git a/configure.in b/configure.in index 9731b4f3f5f..bb39772af1b 100644 --- a/configure.in +++ b/configure.in @@ -4,7 +4,7 @@ dnl Process this file with autoconf to produce a configure script. AC_INIT(sql/mysqld.cc) AC_CANONICAL_SYSTEM # The Docs Makefile.am parses this line! -AM_INIT_AUTOMAKE(mysql, 3.23.29a-gamma) +AM_INIT_AUTOMAKE(mysql, 3.23.30-gamma) AM_CONFIG_HEADER(config.h) PROTOCOL_VERSION=10 diff --git a/myisam/myisamlog.c b/myisam/myisamlog.c index 87f09f984f7..ca2c4f27a74 100644 --- a/myisam/myisamlog.c +++ b/myisam/myisamlog.c @@ -393,7 +393,7 @@ static int examine_log(my_string file_name, char **table_names) char *pos,*to; /* Fix if old DOS files to new format */ - for (pos=file_info.name; pos=strchr(pos,'\\') ; pos++) + for (pos=file_info.name; (pos=strchr(pos,'\\')) ; pos++) *pos= '/'; pos=file_info.name; diff --git a/mysql-test/include/have_bdb.inc b/mysql-test/include/have_bdb.inc new file mode 100644 index 00000000000..0126e30210f --- /dev/null +++ b/mysql-test/include/have_bdb.inc @@ -0,0 +1,2 @@ +-- require r/have_bdb.require +show variables like "have_bdb"; diff --git a/mysql-test/include/have_isam.inc b/mysql-test/include/have_isam.inc new file mode 100644 index 00000000000..d83328f70f4 --- /dev/null +++ b/mysql-test/include/have_isam.inc @@ -0,0 +1,2 @@ +-- require r/have_isam.require +show variables like "have_isam"; diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index bcc3e0259ec..6fff899b0db 100755 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -189,6 +189,10 @@ fail_inc () { TOT_FAIL=`$EXPR $TOT_FAIL + 1` } +skip_inc () { + TOT_SKIP=`$EXPR $TOT_SKIP + 1` +} + total_inc () { TOT_TEST=`$EXPR $TOT_TEST + 1` } @@ -463,9 +467,14 @@ run_testcase () $SETCOLOR_NORMAL && $ECHO -n "$pname $timestr" - total_inc - if [ $res != 0 ]; then + if [ $res == 0 ]; then + total_inc + pass_inc + echo "$RES_SPACE [ pass ]" + else + if [ $res == 1 ]; then + total_inc fail_inc echo "$RES_SPACE [ fail ]" $ECHO "failed output" @@ -481,12 +490,12 @@ run_testcase () echo "Restarting mysqld" mysql_restart echo "Resuming Tests" - else - pass_inc - echo "$RES_SPACE [ pass ]" + else + pass_inc + echo "$RES_SPACE [ skipped ]" + fi fi fi - } @@ -525,7 +534,8 @@ then done fi else - tf=$TESTDIR/$1.$TESTSUFFIX + tname=`$BASENAME $1 .test` + tf=$TESTDIR/$tname.$TESTSUFFIX if [ -f $tf ] ; then run_testcase $tf else diff --git a/mysql-test/r/3.23/README b/mysql-test/r/3.23/README deleted file mode 100644 index e69de29bb2d..00000000000 --- a/mysql-test/r/3.23/README +++ /dev/null diff --git a/mysql-test/r/alt000001.result b/mysql-test/r/alt000001.result index cc95b808d23..d8594916c0b 100644 --- a/mysql-test/r/alt000001.result +++ b/mysql-test/r/alt000001.result @@ -1,5 +1,5 @@ -n -3 -9 -10 -12 +n +3 +9 +10 +12 diff --git a/mysql-test/r/bdb.result b/mysql-test/r/bdb.result index 957f1803079..1ac0a8ea62d 100644 --- a/mysql-test/r/bdb.result +++ b/mysql-test/r/bdb.result @@ -1,24 +1,27 @@ -id code name -1 1 Tim -2 1 Monty -3 2 David -4 2 Erik -5 3 Sasha -6 3 Jeremy -7 4 Matt -id code name -2 1 Monty -3 2 David -4 2 Erik -5 3 Sasha -6 3 Jeremy -7 4 Matt -8 1 Sinisa -id code name -3 2 David -4 2 Erik -5 3 Sasha -6 3 Jeremy -7 4 Matt -8 1 Sinisa -12 1 Ralph +id code name +1 1 Tim +2 1 Monty +3 2 David +4 2 Erik +5 3 Sasha +6 3 Jeremy +7 4 Matt +id code name +2 1 Monty +3 2 David +4 2 Erik +5 3 Sasha +6 3 Jeremy +7 4 Matt +8 1 Sinisa +id code name +3 2 David +4 2 Erik +5 3 Sasha +6 3 Jeremy +7 4 Matt +8 1 Sinisa +12 1 Ralph +gesuchnr benutzer_id +1 1 +2 1 diff --git a/mysql-test/r/crypt.result b/mysql-test/r/crypt.result index fe3f80dc90d..7e0f5f7981d 100644 --- a/mysql-test/r/crypt.result +++ b/mysql-test/r/crypt.result @@ -1,2 +1,2 @@ -encrypt('foo', 'ff') -ffTU0fyIP09Z. +encrypt('foo', 'ff') +ffTU0fyIP09Z. diff --git a/mysql-test/r/equal.result b/mysql-test/r/equal.result index 9de9eafee6a..6e2933641aa 100644 --- a/mysql-test/r/equal.result +++ b/mysql-test/r/equal.result @@ -1,15 +1,15 @@ -0<=>0 0.0<=>0.0 "A"<=>"A" NULL<=>NULL -1 1 1 1 -1<=>0 0<=>NULL NULL<=>0 -0 0 0 -1.0<=>0.0 0.0<=>NULL NULL<=>0.0 -0 0 0 -"A"<=>"B" "A"<=>NULL NULL<=>"A" -0 0 0 -id value id value t1.value<=>t2.value -1 NULL 1 NULL 1 -id value -1 NULL -id value -1 NULL -id value +0<=>0 0.0<=>0.0 "A"<=>"A" NULL<=>NULL +1 1 1 1 +1<=>0 0<=>NULL NULL<=>0 +0 0 0 +1.0<=>0.0 0.0<=>NULL NULL<=>0.0 +0 0 0 +"A"<=>"B" "A"<=>NULL NULL<=>"A" +0 0 0 +id value id value t1.value<=>t2.value +1 NULL 1 NULL 1 +id value +1 NULL +id value +1 NULL +id value diff --git a/mysql-test/r/ft0000001.a.result b/mysql-test/r/ft0000001.a.result index 2b9a1515532..0a99bccec1e 100644 --- a/mysql-test/r/ft0000001.a.result +++ b/mysql-test/r/ft0000001.a.result @@ -1,3 +1,3 @@ -a MATCH (message) AGAINST ('steve') -4 0.90587321329654 -7 0.89568988462614 +a MATCH (message) AGAINST ('steve') +4 0.90587321329654 +7 0.89568988462614 diff --git a/mysql-test/r/ft0000001.b.result b/mysql-test/r/ft0000001.b.result index 2b9a1515532..0a99bccec1e 100644 --- a/mysql-test/r/ft0000001.b.result +++ b/mysql-test/r/ft0000001.b.result @@ -1,3 +1,3 @@ -a MATCH (message) AGAINST ('steve') -4 0.90587321329654 -7 0.89568988462614 +a MATCH (message) AGAINST ('steve') +4 0.90587321329654 +7 0.89568988462614 diff --git a/mysql-test/r/ft0000001.c.result b/mysql-test/r/ft0000001.c.result index a88e4b25f2e..0a495a119e2 100644 --- a/mysql-test/r/ft0000001.c.result +++ b/mysql-test/r/ft0000001.c.result @@ -1,3 +1,3 @@ -a MATCH (message) AGAINST ('steve') -7 0.89568988462614 -4 0.90587321329654 +a MATCH (message) AGAINST ('steve') +7 0.89568988462614 +4 0.90587321329654 diff --git a/mysql-test/r/ft0000001.d.result b/mysql-test/r/ft0000001.d.result index f9ffb78d49d..c3c145b2744 100644 --- a/mysql-test/r/ft0000001.d.result +++ b/mysql-test/r/ft0000001.d.result @@ -1,2 +1,2 @@ -a MATCH (message) AGAINST ('steve') -7 0.89568988462614 +a MATCH (message) AGAINST ('steve') +7 0.89568988462614 diff --git a/mysql-test/r/ft0000001.e.result b/mysql-test/r/ft0000001.e.result index 90d27233ec5..372839e5cf8 100644 --- a/mysql-test/r/ft0000001.e.result +++ b/mysql-test/r/ft0000001.e.result @@ -1,8 +1,8 @@ -a rel -1 0 -2 0 -3 0 -5 0 -6 0 -7 0.89568988462614 -4 0.90587321329654 +a rel +1 0 +2 0 +3 0 +5 0 +6 0 +7 0.89568988462614 +4 0.90587321329654 diff --git a/mysql-test/r/ft0000002.a.result b/mysql-test/r/ft0000002.a.result index f48a6a4fb5e..576b086d13c 100644 --- a/mysql-test/r/ft0000002.a.result +++ b/mysql-test/r/ft0000002.a.result @@ -1,4 +1,4 @@ -a MATCH b AGAINST ('lala lkjh') -1 0.67003110026735 -2 0 -3 0 +a MATCH b AGAINST ('lala lkjh') +1 0.67003110026735 +2 0 +3 0 diff --git a/mysql-test/r/ft0000002.b.result b/mysql-test/r/ft0000002.b.result index aeaf0283ba6..d18d3484f21 100644 --- a/mysql-test/r/ft0000002.b.result +++ b/mysql-test/r/ft0000002.b.result @@ -1,4 +1,4 @@ -a MATCH c AGAINST ('lala lkjh') -1 0 -2 0.67756324121582 -3 0 +a MATCH c AGAINST ('lala lkjh') +1 0 +2 0.67756324121582 +3 0 diff --git a/mysql-test/r/ft0000002.c.result b/mysql-test/r/ft0000002.c.result index 2993e25d842..58179329034 100644 --- a/mysql-test/r/ft0000002.c.result +++ b/mysql-test/r/ft0000002.c.result @@ -1,4 +1,4 @@ -a MATCH b,c AGAINST ('lala lkjh') -1 0.64840710366884 -2 0.66266459031789 -3 0 +a MATCH b,c AGAINST ('lala lkjh') +1 0.64840710366884 +2 0.66266459031789 +3 0 diff --git a/mysql-test/r/have_bdb.require b/mysql-test/r/have_bdb.require new file mode 100644 index 00000000000..969cd6863db --- /dev/null +++ b/mysql-test/r/have_bdb.require @@ -0,0 +1,2 @@ +Variable_name Value +have_bdb YES diff --git a/mysql-test/r/have_isam.require b/mysql-test/r/have_isam.require new file mode 100644 index 00000000000..9b4142361ed --- /dev/null +++ b/mysql-test/r/have_isam.require @@ -0,0 +1,2 @@ +Variable_name Value +have_isam YES diff --git a/mysql-test/r/ins000001.result b/mysql-test/r/ins000001.result index 1003b3b6b18..0db93d6732d 100644 --- a/mysql-test/r/ins000001.result +++ b/mysql-test/r/ins000001.result @@ -1,4 +1,4 @@ -id domain -1 mysql.com -2 hotmail.com -3 aol.com +id domain +1 mysql.com +2 hotmail.com +3 aol.com diff --git a/mysql-test/r/mrg000001.dummy.result b/mysql-test/r/mrg000001.dummy.result index 767f92bc2cb..4c969dfa3bf 100644 --- a/mysql-test/r/mrg000001.dummy.result +++ b/mysql-test/r/mrg000001.dummy.result @@ -1 +1 @@ -incr othr +incr othr diff --git a/mysql-test/r/mrg000001.result b/mysql-test/r/mrg000001.result index 8b351ebe780..97dc723f349 100644 --- a/mysql-test/r/mrg000001.result +++ b/mysql-test/r/mrg000001.result @@ -1,5 +1,5 @@ -incr othr -1 10 -2 24 -4 33 -3 53 +incr othr +1 10 +2 24 +4 33 +3 53 diff --git a/mysql-test/r/mrg000002.result b/mysql-test/r/mrg000002.result index b4960c74ae6..f2ad6c76f01 100644 --- a/mysql-test/r/mrg000002.result +++ b/mysql-test/r/mrg000002.result @@ -1 +1 @@ -c +c diff --git a/mysql-test/r/rpl000001.a.result b/mysql-test/r/rpl000001.a.result index 982e0523cfb..c52b83d729a 100644 --- a/mysql-test/r/rpl000001.a.result +++ b/mysql-test/r/rpl000001.a.result @@ -1,3 +1,3 @@ -n -1 -2 +n +1 +2 diff --git a/mysql-test/r/rpl000001.b.result b/mysql-test/r/rpl000001.b.result index 17cdaf46fa6..5108cfdaf26 100644 --- a/mysql-test/r/rpl000001.b.result +++ b/mysql-test/r/rpl000001.b.result @@ -1,2 +1,2 @@ -sum(length(word)) -71 +sum(length(word)) +71 diff --git a/mysql-test/r/rpl000002.result b/mysql-test/r/rpl000002.result index c76fc46ae97..5b34f36bd05 100644 --- a/mysql-test/r/rpl000002.result +++ b/mysql-test/r/rpl000002.result @@ -1,4 +1,4 @@ -n -2000 -2001 -2002 +n +2000 +2001 +2002 diff --git a/mysql-test/r/rpl000003.result b/mysql-test/r/rpl000003.result index c62967af0bb..f85b057eefa 100644 --- a/mysql-test/r/rpl000003.result +++ b/mysql-test/r/rpl000003.result @@ -1,4 +1,4 @@ -n -1 -2 -3 +n +1 +2 +3 diff --git a/mysql-test/r/rpl000004.a.result b/mysql-test/r/rpl000004.a.result index 4061fdb4a0d..2c9c8bf0c4f 100644 --- a/mysql-test/r/rpl000004.a.result +++ b/mysql-test/r/rpl000004.a.result @@ -1,2 +1,2 @@ -Table Op Msg_type Msg_text -test.words check status OK +Table Op Msg_type Msg_text +test.words check status OK diff --git a/mysql-test/r/rpl000004.b.result b/mysql-test/r/rpl000004.b.result index c71e0b46471..7e05933909e 100644 --- a/mysql-test/r/rpl000004.b.result +++ b/mysql-test/r/rpl000004.b.result @@ -1,2 +1,2 @@ -count(*) -10 +count(*) +10 diff --git a/mysql-test/r/rpl000005.result b/mysql-test/r/rpl000005.result index 763154b938e..2be354af151 100644 --- a/mysql-test/r/rpl000005.result +++ b/mysql-test/r/rpl000005.result @@ -1,4 +1,4 @@ -name age id -Andy 31 00000001 -Jacob 2 00000002 -Caleb 1 00000003 +name age id +Andy 31 00000001 +Jacob 2 00000002 +Caleb 1 00000003 diff --git a/mysql-test/r/rpl000006.result b/mysql-test/r/rpl000006.result index c3e4a2326d0..d2a036b9154 100644 --- a/mysql-test/r/rpl000006.result +++ b/mysql-test/r/rpl000006.result @@ -1,2 +1,2 @@ -unix_timestamp(t) -200006 +unix_timestamp(t) +200006 diff --git a/mysql-test/r/rpl000007.result b/mysql-test/r/rpl000007.result index 08f13272f2a..d5b4cdf3bee 100644 --- a/mysql-test/r/rpl000007.result +++ b/mysql-test/r/rpl000007.result @@ -1,2 +1,2 @@ -n m -4 15 +n m +4 15 diff --git a/mysql-test/r/rpl000008.result b/mysql-test/r/rpl000008.result index 964ea8d84de..870e8a5510d 100644 --- a/mysql-test/r/rpl000008.result +++ b/mysql-test/r/rpl000008.result @@ -1,2 +1,2 @@ -n m k -4 15 55 +n m k +4 15 55 diff --git a/mysql-test/r/rpl000009.result b/mysql-test/r/rpl000009.result index 08f13272f2a..d5b4cdf3bee 100644 --- a/mysql-test/r/rpl000009.result +++ b/mysql-test/r/rpl000009.result @@ -1,2 +1,2 @@ -n m -4 15 +n m +4 15 diff --git a/mysql-test/r/rpl000010.result b/mysql-test/r/rpl000010.result index 982e0523cfb..c52b83d729a 100644 --- a/mysql-test/r/rpl000010.result +++ b/mysql-test/r/rpl000010.result @@ -1,3 +1,3 @@ -n -1 -2 +n +1 +2 diff --git a/mysql-test/r/rpl000011.result b/mysql-test/r/rpl000011.result index 982e0523cfb..c52b83d729a 100644 --- a/mysql-test/r/rpl000011.result +++ b/mysql-test/r/rpl000011.result @@ -1,3 +1,3 @@ -n -1 -2 +n +1 +2 diff --git a/mysql-test/r/rpl000012.result b/mysql-test/r/rpl000012.result index 22fd6be3003..414468f0998 100644 --- a/mysql-test/r/rpl000012.result +++ b/mysql-test/r/rpl000012.result @@ -1,7 +1,7 @@ -n -1 -2 -3 -4 -5 -6 +n +1 +2 +3 +4 +5 +6 diff --git a/mysql-test/r/rpl000012.status.result b/mysql-test/r/rpl000012.status.result index fbbae06c3f9..c03e09c99bc 100644 --- a/mysql-test/r/rpl000012.status.result +++ b/mysql-test/r/rpl000012.status.result @@ -1,2 +1,2 @@ -Variable_name Value -Slave_open_temp_tables 0 +Variable_name Value +Slave_open_temp_tables 0 diff --git a/mysql-test/r/rpl000013.result b/mysql-test/r/rpl000013.result index 22fd6be3003..414468f0998 100644 --- a/mysql-test/r/rpl000013.result +++ b/mysql-test/r/rpl000013.result @@ -1,7 +1,7 @@ -n -1 -2 -3 -4 -5 -6 +n +1 +2 +3 +4 +5 +6 diff --git a/mysql-test/r/rpl000013.status.result b/mysql-test/r/rpl000013.status.result index fbbae06c3f9..c03e09c99bc 100644 --- a/mysql-test/r/rpl000013.status.result +++ b/mysql-test/r/rpl000013.status.result @@ -1,2 +1,2 @@ -Variable_name Value -Slave_open_temp_tables 0 +Variable_name Value +Slave_open_temp_tables 0 diff --git a/mysql-test/r/rpl000014.result b/mysql-test/r/rpl000014.result index 25082dcc60f..40421f71fee 100644 --- a/mysql-test/r/rpl000014.result +++ b/mysql-test/r/rpl000014.result @@ -1,16 +1,16 @@ -File Position Binlog_do_db Binlog_ignore_db -master-bin.001 73 -Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db -127.0.0.1 root 9306 1 73 Yes -Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db -127.0.0.1 root 9306 1 73 No -Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db -127.0.0.1 root 9306 1 73 Yes -Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db -127.0.0.1 root 9306 1 173 Yes -File Position Binlog_do_db Binlog_ignore_db -master-bin.001 73 -n -1 -2 -3 +File Position Binlog_do_db Binlog_ignore_db +master-bin.001 73 +Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db +127.0.0.1 root 9306 1 73 Yes +Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db +127.0.0.1 root 9306 1 73 No +Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db +127.0.0.1 root 9306 1 73 Yes +Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db +127.0.0.1 root 9306 1 173 Yes +File Position Binlog_do_db Binlog_ignore_db +master-bin.001 73 +n +1 +2 +3 diff --git a/mysql-test/r/rpl000015.result b/mysql-test/r/rpl000015.result index 199c2410a09..45abae3976e 100644 --- a/mysql-test/r/rpl000015.result +++ b/mysql-test/r/rpl000015.result @@ -1,14 +1,14 @@ -File Position Binlog_do_db Binlog_ignore_db -master-bin.001 73 -Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db - 0 0 0 No -Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db -127.0.0.1 test 3306 60 4 No -Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db -127.0.0.1 root 9306 60 4 No -Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db -127.0.0.1 root 9306 60 4 Yes -n -10 -45 -90 +File Position Binlog_do_db Binlog_ignore_db +master-bin.001 73 +Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db + 0 0 0 No +Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db +127.0.0.1 test 3306 60 4 No +Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db +127.0.0.1 root 9306 60 4 No +Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db +127.0.0.1 root 9306 60 4 Yes +n +10 +45 +90 diff --git a/mysql-test/r/rpl000016.result b/mysql-test/r/rpl000016.result index 56108ae37cc..5d0ff3877b8 100644 --- a/mysql-test/r/rpl000016.result +++ b/mysql-test/r/rpl000016.result @@ -1,14 +1,14 @@ -s -Could not break slave -Tried hard -Log_name -master-bin.001 -master-bin.002 -master-bin.003 -Log_name -master-bin.003 -m -34 -67 -123 -65 +s +Could not break slave +Tried hard +Log_name +master-bin.001 +master-bin.002 +master-bin.003 +Log_name +master-bin.003 +m +34 +67 +123 +65 diff --git a/mysql-test/r/sel000001.result b/mysql-test/r/sel000001.result index 749778fabac..bee97cc7b53 100644 --- a/mysql-test/r/sel000001.result +++ b/mysql-test/r/sel000001.result @@ -1,2 +1,2 @@ -s id -mouse 3 +s id +mouse 3 diff --git a/mysql-test/r/sel000002.result b/mysql-test/r/sel000002.result index c62967af0bb..f85b057eefa 100644 --- a/mysql-test/r/sel000002.result +++ b/mysql-test/r/sel000002.result @@ -1,4 +1,4 @@ -n -1 -2 -3 +n +1 +2 +3 diff --git a/mysql-test/r/sel000003.result b/mysql-test/r/sel000003.result index 098e2cce1b0..77312414818 100644 --- a/mysql-test/r/sel000003.result +++ b/mysql-test/r/sel000003.result @@ -1,3 +1,3 @@ -n score -4 10 -2 20 +n score +4 10 +2 20 diff --git a/mysql-test/r/sel000004.result b/mysql-test/r/sel000004.result index 7ef0cdabb96..81b7f808dd5 100644 --- a/mysql-test/r/sel000004.result +++ b/mysql-test/r/sel000004.result @@ -1,2 +1,2 @@ -1+1 1-1 1+1*2 8/5 8%5 MOD(8,5) MOD(8,5)|0 -(1+1)*-2 SIGN(-5) -2 0 3 1.60 3 3 3 4 -1 +1+1 1-1 1+1*2 8/5 8%5 MOD(8,5) MOD(8,5)|0 -(1+1)*-2 SIGN(-5) +2 0 3 1.60 3 3 3 4 -1 diff --git a/mysql-test/r/sel000005.result b/mysql-test/r/sel000005.result index b213d603c4e..0b81584ba16 100644 --- a/mysql-test/r/sel000005.result +++ b/mysql-test/r/sel000005.result @@ -1,2 +1,2 @@ -FLOOR(5.5) FLOOR(-5.5) CEILING(5.5) CEILING(-5.5) ROUND(5.5) ROUND(-5.5) -5 -6 6 -5 6 -6 +FLOOR(5.5) FLOOR(-5.5) CEILING(5.5) CEILING(-5.5) ROUND(5.5) ROUND(-5.5) +5 -6 6 -5 6 -6 diff --git a/mysql-test/r/sel000006.result b/mysql-test/r/sel000006.result index 82967786fce..78876f03c96 100644 --- a/mysql-test/r/sel000006.result +++ b/mysql-test/r/sel000006.result @@ -1,2 +1,2 @@ -ROUND(5.64,1) ROUND(5.64,2) ROUND(5.64,-1) ROUND(5.64,-2) -5.6 5.64 10 0 +ROUND(5.64,1) ROUND(5.64,2) ROUND(5.64,-1) ROUND(5.64,-2) +5.6 5.64 10 0 diff --git a/mysql-test/r/sel000007.result b/mysql-test/r/sel000007.result index 2a175b2d723..a1243aa547f 100644 --- a/mysql-test/r/sel000007.result +++ b/mysql-test/r/sel000007.result @@ -1,2 +1,2 @@ -TRUNCATE(52.64,1) TRUNCATE(52.64,2) TRUNCATE(52.64,-1) TRUNCATE(52.64,-2) -52.6 52.64 50 0 +TRUNCATE(52.64,1) TRUNCATE(52.64,2) TRUNCATE(52.64,-1) TRUNCATE(52.64,-2) +52.6 52.64 50 0 diff --git a/mysql-test/r/sel000008.result b/mysql-test/r/sel000008.result index 3438a3e6970..8129d7951f5 100644 --- a/mysql-test/r/sel000008.result +++ b/mysql-test/r/sel000008.result @@ -1,2 +1,2 @@ -ABS(-10) LOG(EXP(10)) EXP(LOG(SQRT(10))*2) POW(10,LOG10(10)) RAND(999999) RAND() POWER(2,4) -10 10.000000 10.000000 10.000000 0.18435012473199 0.76373626176616 16.000000 +ABS(-10) LOG(EXP(10)) EXP(LOG(SQRT(10))*2) POW(10,LOG10(10)) RAND(999999) RAND() POWER(2,4) +10 10.000000 10.000000 10.000000 0.18435012473199 0.76373626176616 16.000000 diff --git a/mysql-test/r/sel000009.result b/mysql-test/r/sel000009.result index 410b404774f..5118e2d3966 100644 --- a/mysql-test/r/sel000009.result +++ b/mysql-test/r/sel000009.result @@ -1,2 +1,2 @@ -PI() SIN(PI()/2) COS(PI()/2) TAN(PI()) COT(1) ASIN(1) ACOS(0) ATAN(1) -3.141593 1.000000 0.000000 -0.000000 0.64209262 1.570796 1.570796 0.785398 +PI() SIN(PI()/2) COS(PI()/2) TAN(PI()) COT(1) ASIN(1) ACOS(0) ATAN(1) +3.141593 1.000000 0.000000 -0.000000 0.64209262 1.570796 1.570796 0.785398 diff --git a/mysql-test/r/sel000010.result b/mysql-test/r/sel000010.result index 439e30093aa..2a76c331cb3 100644 --- a/mysql-test/r/sel000010.result +++ b/mysql-test/r/sel000010.result @@ -1,2 +1,2 @@ -1 | (1+1) 5 & 3 BIT_COUNT(7) -3 1 3 +1 | (1+1) 5 & 3 BIT_COUNT(7) +3 1 3 diff --git a/mysql-test/r/sel000011.result b/mysql-test/r/sel000011.result index a0e5f33bc6b..00ca3a4d917 100644 --- a/mysql-test/r/sel000011.result +++ b/mysql-test/r/sel000011.result @@ -1,2 +1,2 @@ -1 << 32 1 << 63 1 << 64 4 >> 2 4 >> 63 1<< 63 >> 60 -4294967296 -9223372036854775808 0 1 0 8 +1 << 32 1 << 63 1 << 64 4 >> 2 4 >> 63 1<< 63 >> 60 +4294967296 -9223372036854775808 0 1 0 8 diff --git a/mysql-test/r/sel000012.result b/mysql-test/r/sel000012.result index 579fe8d87a3..79108ddfd9f 100644 --- a/mysql-test/r/sel000012.result +++ b/mysql-test/r/sel000012.result @@ -1,2 +1,2 @@ -10 10.0 10. .1e+2 100.0e-1 -10 10.0 10 10 10 +10 10.0 10. .1e+2 100.0e-1 +10 10.0 10 10 10 diff --git a/mysql-test/r/sel000013.result b/mysql-test/r/sel000013.result index eda7608ef4d..9c1be0bf4b2 100644 --- a/mysql-test/r/sel000013.result +++ b/mysql-test/r/sel000013.result @@ -1,2 +1,2 @@ -6e-05 -6e-05 --6e-05 -6e-05+1.000000 -6e-05 -6e-05 6e-05 0.99994 +6e-05 -6e-05 --6e-05 -6e-05+1.000000 +6e-05 -6e-05 6e-05 0.99994 diff --git a/mysql-test/r/sel000014.result b/mysql-test/r/sel000014.result index bd8b967d300..ad3c1f9a0a3 100644 --- a/mysql-test/r/sel000014.result +++ b/mysql-test/r/sel000014.result @@ -1,2 +1,2 @@ -0 256 00000000000000065536 2147483647 -2147483648 2147483648 +4294967296 -0 256 65536 2147483647 -2147483648 2147483648 4294967296 +0 256 00000000000000065536 2147483647 -2147483648 2147483648 +4294967296 +0 256 65536 2147483647 -2147483648 2147483648 4294967296 diff --git a/mysql-test/r/sel000015.result b/mysql-test/r/sel000015.result index e4fca79f398..61e880eee90 100644 --- a/mysql-test/r/sel000015.result +++ b/mysql-test/r/sel000015.result @@ -1,2 +1,2 @@ -922337203685477580 92233720368547758000 -922337203685477580 92233720368547758080 +922337203685477580 92233720368547758000 +922337203685477580 92233720368547758080 diff --git a/mysql-test/r/sel000016.result b/mysql-test/r/sel000016.result index 58384e104cc..a5deee463f4 100644 --- a/mysql-test/r/sel000016.result +++ b/mysql-test/r/sel000016.result @@ -1,2 +1,2 @@ --922337203685477580 -92233720368547758000 --922337203685477580 -92233720368547758080 +-922337203685477580 -92233720368547758000 +-922337203685477580 -92233720368547758080 diff --git a/mysql-test/r/sel000017.result b/mysql-test/r/sel000017.result index d68bb440274..62c695d4cd9 100644 --- a/mysql-test/r/sel000017.result +++ b/mysql-test/r/sel000017.result @@ -1,2 +1,2 @@ -9223372036854775807 -009223372036854775808 -9223372036854775807 -9223372036854775808 +9223372036854775807 -009223372036854775808 +9223372036854775807 -9223372036854775808 diff --git a/mysql-test/r/sel000018.result b/mysql-test/r/sel000018.result index 1155ffd553e..60c53c39bb5 100644 --- a/mysql-test/r/sel000018.result +++ b/mysql-test/r/sel000018.result @@ -1,2 +1,2 @@ -+9999999999999999999 -9999999999999999999 -10000000000000000000 -10000000000000000000 ++9999999999999999999 -9999999999999999999 +10000000000000000000 -10000000000000000000 diff --git a/mysql-test/r/sel000019.result b/mysql-test/r/sel000019.result index 56e8bfebdcd..c08322d34eb 100644 --- a/mysql-test/r/sel000019.result +++ b/mysql-test/r/sel000019.result @@ -1,2 +1,2 @@ -DEGREES(PI()) RADIANS(360) -180 6.2831853071796 +DEGREES(PI()) RADIANS(360) +180 6.2831853071796 diff --git a/mysql-test/r/sel000020.result b/mysql-test/r/sel000020.result index 3d3b68fca73..5be406f52c6 100644 --- a/mysql-test/r/sel000020.result +++ b/mysql-test/r/sel000020.result @@ -1,2 +1,2 @@ -0=0 1>0 1>=1 1<0 1<=0 1!=0 STRCMP("abc","abcd") STRCMP("b","a") STRCMP("a","a") -1 1 1 0 0 1 -1 1 0 +0=0 1>0 1>=1 1<0 1<=0 1!=0 STRCMP("abc","abcd") STRCMP("b","a") STRCMP("a","a") +1 1 1 0 0 1 -1 1 0 diff --git a/mysql-test/r/sel000021.result b/mysql-test/r/sel000021.result index 03ab284ac5d..8ad4705eb95 100644 --- a/mysql-test/r/sel000021.result +++ b/mysql-test/r/sel000021.result @@ -1,2 +1,2 @@ -"a"<"b" "a"<="b" "b">="a" "b">"a" "a"="A" "a"<>"b" -1 1 1 1 1 1 +"a"<"b" "a"<="b" "b">="a" "b">"a" "a"="A" "a"<>"b" +1 1 1 1 1 1 diff --git a/mysql-test/r/sel000022.result b/mysql-test/r/sel000022.result index 4f6dedaa83f..43006335b13 100644 --- a/mysql-test/r/sel000022.result +++ b/mysql-test/r/sel000022.result @@ -1,2 +1,2 @@ -"a "="A" "A "="a" "a " <= "A b" -1 1 1 +"a "="A" "A "="a" "a " <= "A b" +1 1 1 diff --git a/mysql-test/r/sel000023.result b/mysql-test/r/sel000023.result index 835c340b686..0f88219b1c3 100644 --- a/mysql-test/r/sel000023.result +++ b/mysql-test/r/sel000023.result @@ -1,2 +1,2 @@ -"abc" LIKE "a%" "abc" NOT LIKE "%d%" "a%" LIKE "a\%" "abc%" LIKE "a%\%" "abcd" LIKE "a%b_%d" "a" LIKE "%%a" "abcde" LIKE "a%_e" "abc" LIKE "abc%" -1 1 1 1 1 1 1 1 +"abc" LIKE "a%" "abc" NOT LIKE "%d%" "a%" LIKE "a\%" "abc%" LIKE "a%\%" "abcd" LIKE "a%b_%d" "a" LIKE "%%a" "abcde" LIKE "a%_e" "abc" LIKE "abc%" +1 1 1 1 1 1 1 1 diff --git a/mysql-test/r/sel000024.result b/mysql-test/r/sel000024.result index daa9a143b60..a0ceee902bd 100644 --- a/mysql-test/r/sel000024.result +++ b/mysql-test/r/sel000024.result @@ -1,2 +1,2 @@ -"a" LIKE "%%b" "a" LIKE "%%ab" "ab" LIKE "a\%" "ab" LIKE "_" "ab" LIKE "ab_" "abc" LIKE "%_d" "abc" LIKE "abc%d" -0 0 0 0 0 0 0 +"a" LIKE "%%b" "a" LIKE "%%ab" "ab" LIKE "a\%" "ab" LIKE "_" "ab" LIKE "ab_" "abc" LIKE "%_d" "abc" LIKE "abc%d" +0 0 0 0 0 0 0 diff --git a/mysql-test/r/sel000025.result b/mysql-test/r/sel000025.result index caf244be1d9..12a2cce2067 100644 --- a/mysql-test/r/sel000025.result +++ b/mysql-test/r/sel000025.result @@ -1,2 +1,2 @@ -'?' LIKE '|%' '?' LIKE '|%' ESCAPE '|' '%' LIKE '|%' '%' LIKE '|%' ESCAPE '|' '%' LIKE '%' -0 0 0 1 1 +'?' LIKE '|%' '?' LIKE '|%' ESCAPE '|' '%' LIKE '|%' '%' LIKE '|%' ESCAPE '|' '%' LIKE '%' +0 0 0 1 1 diff --git a/mysql-test/r/sel000026.result b/mysql-test/r/sel000026.result index acf301a349f..1f268717bcc 100644 --- a/mysql-test/r/sel000026.result +++ b/mysql-test/r/sel000026.result @@ -1,2 +1,2 @@ -'abc' LIKE '%c' 'abcabc' LIKE '%c' "ab" LIKE "" "ab" LIKE "a" "ab" LIKE "ab" -1 1 0 0 1 +'abc' LIKE '%c' 'abcabc' LIKE '%c' "ab" LIKE "" "ab" LIKE "a" "ab" LIKE "ab" +1 1 0 0 1 diff --git a/mysql-test/r/sel000027.result b/mysql-test/r/sel000027.result index df2945c6da8..0541b8a7037 100644 --- a/mysql-test/r/sel000027.result +++ b/mysql-test/r/sel000027.result @@ -1,2 +1,2 @@ -"Det här är svenska" REGEXP "h[[:alpha:]]+r" "aba" REGEXP "^(a|b)*$" -1 1 +"Det här är svenska" REGEXP "h[[:alpha:]]+r" "aba" REGEXP "^(a|b)*$" +1 1 diff --git a/mysql-test/r/sel000028.result b/mysql-test/r/sel000028.result index cd5b3268b53..ecb81bdbf23 100644 --- a/mysql-test/r/sel000028.result +++ b/mysql-test/r/sel000028.result @@ -1,2 +1,2 @@ -"aba" REGEXP CONCAT("^","a") -1 +"aba" REGEXP CONCAT("^","a") +1 diff --git a/mysql-test/r/sel000029.result b/mysql-test/r/sel000029.result index 0ceb7494fd3..2df43a28462 100644 --- a/mysql-test/r/sel000029.result +++ b/mysql-test/r/sel000029.result @@ -1,2 +1,2 @@ -!0 NOT 0=1 !(0=0) 1 AND 1 1 && 0 0 OR 1 1 || NULL 1=1 OR 1=1 AND 1=0 -1 1 0 1 0 1 1 1 +!0 NOT 0=1 !(0=0) 1 AND 1 1 && 0 0 OR 1 1 || NULL 1=1 OR 1=1 AND 1=0 +1 1 0 1 0 1 1 1 diff --git a/mysql-test/r/sel000030.result b/mysql-test/r/sel000030.result index 575549b600f..460df893025 100644 --- a/mysql-test/r/sel000030.result +++ b/mysql-test/r/sel000030.result @@ -1,2 +1,2 @@ -IF(0,"ERROR","this") IF(1,"is","ERROR") IF(NULL,"ERROR","a") IF(1,2,3)|0 IF(1,2.0,3.0)+0 -this is a 2 2.0 +IF(0,"ERROR","this") IF(1,"is","ERROR") IF(NULL,"ERROR","a") IF(1,2,3)|0 IF(1,2.0,3.0)+0 +this is a 2 2.0 diff --git a/mysql-test/r/sel000031.result b/mysql-test/r/sel000031.result index 26f5563f3df..c1caa04a00a 100644 --- a/mysql-test/r/sel000031.result +++ b/mysql-test/r/sel000031.result @@ -1,4 +1,4 @@ -id elt(two.val,'one','two') -1 one -2 one -4 two +id elt(two.val,'one','two') +1 one +2 one +4 two diff --git a/mysql-test/r/sel000032.result b/mysql-test/r/sel000032.result index 26f5563f3df..c1caa04a00a 100644 --- a/mysql-test/r/sel000032.result +++ b/mysql-test/r/sel000032.result @@ -1,4 +1,4 @@ -id elt(two.val,'one','two') -1 one -2 one -4 two +id elt(two.val,'one','two') +1 one +2 one +4 two diff --git a/mysql-test/r/sel000033.result b/mysql-test/r/sel000033.result index 201d8bc9e0e..1a1325d4360 100644 --- a/mysql-test/r/sel000033.result +++ b/mysql-test/r/sel000033.result @@ -1,4 +1,4 @@ -id -2 -5 -9 +id +2 +5 +9 diff --git a/mysql-test/r/sel000100.result b/mysql-test/r/sel000100.result index 6c204279c28..e7d8cf0e7ac 100644 --- a/mysql-test/r/sel000100.result +++ b/mysql-test/r/sel000100.result @@ -1,2 +1,2 @@ -key_link_id link -NULL NULL +key_link_id link +NULL NULL diff --git a/mysql-test/r/shw000001.result b/mysql-test/r/shw000001.result index f38d2f1ef36..28ad1296d67 100644 --- a/mysql-test/r/shw000001.result +++ b/mysql-test/r/shw000001.result @@ -1,5 +1,5 @@ -Table Create Table +Table Create Table test CREATE TABLE `test` ( `test_set` set('val1','val2','val3') NOT NULL default '', `name` char(20) default 'O''Brien' -) TYPE=MyISAM COMMENT='it''s a table' +) TYPE=MyISAM COMMENT='it''s a table' diff --git a/mysql-test/r/slave-running.result b/mysql-test/r/slave-running.result index 1dc7c7ddd9c..794d0935ef4 100644 --- a/mysql-test/r/slave-running.result +++ b/mysql-test/r/slave-running.result @@ -1,2 +1,2 @@ -Variable_name Value -Slave_running ON +Variable_name Value +Slave_running ON diff --git a/mysql-test/r/slave-stopped.result b/mysql-test/r/slave-stopped.result index 64323ecc0f3..29ab2ac73e4 100644 --- a/mysql-test/r/slave-stopped.result +++ b/mysql-test/r/slave-stopped.result @@ -1,2 +1,2 @@ -Variable_name Value -Slave_running OFF +Variable_name Value +Slave_running OFF diff --git a/mysql-test/t/bdb.test b/mysql-test/t/bdb.test index c60e3b0b72e..ed415a91205 100644 --- a/mysql-test/t/bdb.test +++ b/mysql-test/t/bdb.test @@ -1,3 +1,5 @@ +-- source include/have_bdb.inc + drop table if exists t1; create table t1 (id int unsigned not null auto_increment, code tinyint unsigned not null, name char(20) not null, primary key (id), key (code), unique (name)) type=bdb; @@ -10,3 +12,19 @@ update ignore t1 set id = id + 10, name = 'Ralph' where id < 4; select id, code, name from t1 order by id; drop table t1; + +# +# Test replace +# + +CREATE TABLE t1 ( + gesuchnr int(11) DEFAULT '0' NOT NULL, + benutzer_id int(11) DEFAULT '0' NOT NULL, + PRIMARY KEY (gesuchnr,benutzer_id) +) type=BDB; + +replace into t1 (gesuchnr,benutzer_id) values (2,1); +replace into t1 (gesuchnr,benutzer_id) values (1,1); +replace into t1 (gesuchnr,benutzer_id) values (1,1); +select * from t1; +drop table t1; diff --git a/mysql-test/t/include/master-slave.inc b/mysql-test/t/include/master-slave.inc deleted file mode 100644 index 137749912a7..00000000000 --- a/mysql-test/t/include/master-slave.inc +++ /dev/null @@ -1,11 +0,0 @@ -connect (master,localhost,root,,test,0,var/tmp/mysql.sock); -connect (master1,localhost,root,,test,0,var/tmp/mysql.sock); -connect (slave,localhost,root,,test,0,var/tmp/mysql-slave.sock); -connect (slave1,localhost,root,,test,0,var/tmp/mysql-slave.sock); -connection slave; -!slave stop; -connection master; -reset master; -connection slave; -reset slave; -!slave start; diff --git a/mysql-test/t/replace.test b/mysql-test/t/replace.test index 2d59b26a525..100941108c8 100644 --- a/mysql-test/t/replace.test +++ b/mysql-test/t/replace.test @@ -1,5 +1,7 @@ +-- source include/have_isam.inc + # -# Test of REPLACE with ISAM and MyISAM and BDB +# Test of REPLACE with ISAM and MyISAM and HEAP # drop table if exists t1; @@ -15,8 +17,6 @@ replace into t1 (gesuchnr,benutzer_id) values (1,1); replace into t1 (gesuchnr,benutzer_id) values (1,1); alter table t1 type=myisam; replace into t1 (gesuchnr,benutzer_id) values (1,1); -alter table t1 type=bdb; -replace into t1 (gesuchnr,benutzer_id) values (1,1); alter table t1 type=heap; replace into t1 (gesuchnr,benutzer_id) values (1,1); drop table t1; diff --git a/sql/gen_lex_hash.cc b/sql/gen_lex_hash.cc index 97a3bc6f518..274445f7432 100644 --- a/sql/gen_lex_hash.cc +++ b/sql/gen_lex_hash.cc @@ -330,7 +330,7 @@ static struct option long_options[] = static void usage(int version) { - printf("%s Ver 3.1 Distrib %s, for %s (%s)\n", + printf("%s Ver 3.2 Distrib %s, for %s (%s)\n", my_progname, MYSQL_SERVER_VERSION, SYSTEM_TYPE, MACHINE_TYPE); if (version) return; @@ -350,7 +350,7 @@ static void usage(int version) } static uint best_type; -static ulong best_t1,best_t2; +static ulong best_t1,best_t2, best_start_value; static int get_options(int argc, char **argv) { @@ -510,8 +510,10 @@ int main(int argc,char **argv) best_mod=function_mod; best_add=function_plus; best_functype=function_type; best_t1=t1; best_t2=t2; best_type=type; - printf("\nstart_value=%ldL; best_t1=%ldL; best_t2=%ldL; best_type=%d; /* mode=%d add=%d func_type: %d */\n", - start_value,best_t1,best_t2,best_type,best_mod,best_add,best_functype); + best_start_value=start_value; + printf("\nstart_value=%ldL; best_t1=%ldL; best_t2=%ldL; best_type=%d; /* mode=%d add=%d type: %d */\n", + best_start_value,best_t1,best_t2,best_type,best_mod,best_add, + best_functype); } } } @@ -537,8 +539,8 @@ printf("/* This code is generated by gen_lex_hash.cc that seeks for a perfect\nh print_arrays(); - printf("/* start_value=%ldL; best_t1=%ldL; best_t2=%ldL; best_type=%d; */ /* mode=%d add=%d type: %d */\n\n", - start_value, best_t1, best_t2,best_type, + printf("/* start_value=%ldL; best_t1=%ldL; best_t2=%ldL; best_type=%d; */ /* mode=%d add=%d t ype: %d */\n\n", + best_start_value, best_t1, best_t2, best_type, best_mod, best_add, best_functype); printf("inline SYMBOL *get_hash_symbol(const char *s,unsigned int length,bool function)\n\ diff --git a/sql/ha_berkeley.cc b/sql/ha_berkeley.cc index d1f5937263c..98e798a377b 100644 --- a/sql/ha_berkeley.cc +++ b/sql/ha_berkeley.cc @@ -89,7 +89,7 @@ static DB_ENV *db_env; static HASH bdb_open_tables; const char *berkeley_lock_names[] = -{ "DEFAULT", "OLDEST","RANDOM","YOUNGEST" }; +{ "DEFAULT", "OLDEST","RANDOM","YOUNGEST",0 }; u_int32_t berkeley_lock_types[]= { DB_LOCK_DEFAULT, DB_LOCK_OLDEST, DB_LOCK_RANDOM }; TYPELIB berkeley_lock_typelib= {array_elements(berkeley_lock_names),"", diff --git a/sql/ha_berkeley.h b/sql/ha_berkeley.h index 91b3405d593..5da38cd41fd 100644 --- a/sql/ha_berkeley.h +++ b/sql/ha_berkeley.h @@ -91,7 +91,7 @@ class ha_berkeley: public handler HA_BLOB_KEY | HA_NOT_EXACT_COUNT | HA_PRIMARY_KEY_IN_READ_INDEX | HA_DROP_BEFORE_CREATE | HA_AUTO_PART_KEY), - last_dup_key((uint) -1),version(0) + last_dup_key((uint) -1),version(0),using_ignore(0) { } ~ha_berkeley() {} diff --git a/sql/handler.h b/sql/handler.h index 571825c36ef..a4ebe9b51ff 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -25,7 +25,7 @@ #define NO_HASH /* Not yet implemented */ #endif -#if defined(HAVE_BERKELEY_DB) || defined(HAVE_INNOBASE_DB) || defined(HAVE_GEMENI_DB) +#if defined(HAVE_BERKELEY_DB) || defined(HAVE_INNOBASE_DB) || defined(HAVE_GEMINI_DB) #define USING_TRANSACTIONS #endif @@ -121,7 +121,7 @@ enum row_type { ROW_TYPE_DEFAULT, ROW_TYPE_FIXED, ROW_TYPE_DYNAMIC, typedef struct st_thd_trans { void *bdb_tid; void *innobase_tid; - void *gemeni_tid; + void *gemini_tid; } THD_TRANS; typedef struct st_ha_create_information diff --git a/sql/mysqld.cc b/sql/mysqld.cc index d48171d49be..c56e98b305e 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -151,16 +151,21 @@ SHOW_COMP_OPTION have_berkeley_db=SHOW_OPTION_YES; #else SHOW_COMP_OPTION have_berkeley_db=SHOW_OPTION_NO; #endif -#ifdef HAVE_GEMENI_DB -SHOW_COMP_OPTION have_gemeni=SHOW_OPTION_YES; +#ifdef HAVE_GEMINI_DB +SHOW_COMP_OPTION have_gemini=SHOW_OPTION_YES; #else -SHOW_COMP_OPTION have_gemeni=SHOW_OPTION_NO; +SHOW_COMP_OPTION have_gemini=SHOW_OPTION_NO; #endif #ifdef HAVE_INNOBASE_DB SHOW_COMP_OPTION have_innobase=SHOW_OPTION_YES; #else SHOW_COMP_OPTION have_innobase=SHOW_OPTION_NO; #endif +#ifndef NO_ISAM +SHOW_COMP_OPTION have_isam=SHOW_OPTION_YES; +#else +SHOW_COMP_OPTION have_isam=SHOW_OPTION_NO; +#endif #ifdef USE_RAID SHOW_COMP_OPTION have_raid=SHOW_OPTION_YES; #else @@ -1077,26 +1082,26 @@ inline static __volatile__ void trace_stack() uchar **stack_bottom; uchar** ebp; LINT_INIT(ebp); - fprintf(stderr, "Attemping backtrace, please send the info below to\ - bugs@lists.mysql.com. If you see no messages after this, something \ - went terribly wrong - report this anyway\n"); + fprintf(stderr, "Attemping backtrace, please send the info below to \ +bugs@lists.mysql.com. If you see no messages after this, something \ +went terribly wrong - report this anyway\n"); THD* thd = current_thd; uint frame_count = 0; __asm __volatile__ ("movl %%ebp,%0" :"=r"(ebp) :"r"(ebp)); - if(!ebp) - { - fprintf(stderr, "frame pointer (ebp) is NULL, did you compile with \ - -fomit-frame-pointer? Aborting backtrace\n"); - return; - } - if(!thd) - { - fprintf(stderr, "Cannot determine thread, ebp=%p, aborting backtrace\n", - ebp); - return; - } + if (!ebp) + { + fprintf(stderr, "frame pointer (ebp) is NULL, did you compile with \ +-fomit-frame-pointer? Aborting backtrace\n"); + return; + } + if (!thd) + { + fprintf(stderr, "Cannot determine thread, ebp=%p, aborting backtrace\n", + ebp); + return; + } stack_bottom = (uchar**)thd->thread_stack; if(ebp > stack_bottom || ebp < stack_bottom - thread_stack) { @@ -1107,20 +1112,20 @@ inline static __volatile__ void trace_stack() fprintf(stderr, "stack range sanity check, ok, backtrace follows\n"); - while(ebp < stack_bottom) + while (ebp < stack_bottom) + { + uchar** new_ebp = (uchar**)*ebp; + fprintf(stderr, "%p\n", frame_count == SIGRETURN_FRAME_COUNT ? + *(ebp+17) : *(ebp+1)); + if (new_ebp <= ebp ) { - uchar** new_ebp = (uchar**)*ebp; - fprintf(stderr, "%p\n", frame_count == SIGRETURN_FRAME_COUNT ? - *(ebp+17) : *(ebp+1)); - if(new_ebp <= ebp ) - { - fprintf(stderr, "New value of ebp failed sanity check\ + fprintf(stderr, "New value of ebp failed sanity check\ terminating backtrace\n"); - return; - } - ebp = new_ebp; - ++frame_count; + return; } + ebp = new_ebp; + ++frame_count; + } fprintf(stderr, "stack trace successful\n"); } @@ -1133,31 +1138,27 @@ static sig_handler handle_segfault(int sig) // but since we have got SIGSEGV already, things are a mess // so not having the mutex is not as bad as possibly using a buggy // mutex - so we keep things simple - if(segfaulted) + if (segfaulted) return; segfaulted = 1; fprintf(stderr,"\ -mysqld got signal %s in thread %d; \n\ +mysqld got signal %d;\n\ The manual section 'Debugging a MySQL server' tells you how to use a \n\ debugger on the core file to produce a backtrace that may help you find out\n\ -why mysqld died\n",sys_siglist[sig],getpid()); -#if defined(HAVE_LINUXTHREADS) && defined(__i386__) +why mysqld died\n",sig); +#if defined(HAVE_LINUXTHREADS) +#ifdef __i386__ trace_stack(); -#endif -#ifdef HAVE_LINUXTHREADS +#endif /* __i386__ */ if (test_flags & TEST_CORE_ON_SIGNAL) write_core(sig); - else - exit(1); -#else - exit(1); /* abort everything */ -#endif +#endif /* HAVE_LINUXTHREADS */ + exit(1); } -#ifdef HAVE_LINUXTHREADS - /* Produce a core for the thread */ +#ifdef HAVE_LINUXTHREADS static sig_handler write_core(int sig) { signal(sig, SIG_DFL); @@ -1756,7 +1757,7 @@ The server will not act as a slave"); if (master_host) { pthread_t hThread; - if(!opt_skip_slave_start && + if (!opt_skip_slave_start && pthread_create(&hThread, &connection_attrib, handle_slave, 0)) sql_print_error("Warning: Can't create thread to handle slave"); else if(opt_skip_slave_start) @@ -2623,8 +2624,9 @@ struct show_var_st init_vars[]= { {"flush", (char*) &myisam_flush, SHOW_MY_BOOL}, {"flush_time", (char*) &flush_time, SHOW_LONG}, {"have_bdb", (char*) &have_berkeley_db, SHOW_HAVE}, - {"have_gemeni", (char*) &have_gemeni, SHOW_HAVE}, + {"have_gemini", (char*) &have_gemini, SHOW_HAVE}, {"have_innobase", (char*) &have_innobase, SHOW_HAVE}, + {"have_isam", (char*) &have_isam, SHOW_HAVE}, {"have_raid", (char*) &have_raid, SHOW_HAVE}, {"have_ssl", (char*) &have_ssl, SHOW_HAVE}, {"init_file", (char*) &opt_init_file, SHOW_CHAR_PTR}, @@ -3101,7 +3103,7 @@ static void get_options(int argc,char **argv) { char* key = optarg,*p, *val; p = strstr(optarg, "->"); - if(!p) + if (!p) { fprintf(stderr, "bad syntax in replicate-rewrite-db - missing ->\n"); @@ -3118,7 +3120,7 @@ static void get_options(int argc,char **argv) *val = 0; val += 2; while(*val && isspace(*val)) *val++; - if(!*val) + if (!*val) { fprintf(stderr, "bad syntax in replicate-rewrite-db - empty TO db\n"); @@ -3144,7 +3146,7 @@ static void get_options(int argc,char **argv) } case (int)OPT_REPLICATE_DO_TABLE: { - if(!do_table_inited) + if (!do_table_inited) init_table_rule_hash(&replicate_do_table, &do_table_inited); if(add_table_rule(&replicate_do_table, optarg)) { @@ -3156,7 +3158,7 @@ static void get_options(int argc,char **argv) } case (int)OPT_REPLICATE_WILD_DO_TABLE: { - if(!wild_do_table_inited) + if (!wild_do_table_inited) init_table_rule_array(&replicate_wild_do_table, &wild_do_table_inited); if(add_wild_table_rule(&replicate_wild_do_table, optarg)) @@ -3169,7 +3171,7 @@ static void get_options(int argc,char **argv) } case (int)OPT_REPLICATE_WILD_IGNORE_TABLE: { - if(!wild_ignore_table_inited) + if (!wild_ignore_table_inited) init_table_rule_array(&replicate_wild_ignore_table, &wild_ignore_table_inited); if(add_wild_table_rule(&replicate_wild_ignore_table, optarg)) @@ -3182,7 +3184,7 @@ static void get_options(int argc,char **argv) } case (int)OPT_REPLICATE_IGNORE_TABLE: { - if(!ignore_table_inited) + if (!ignore_table_inited) init_table_rule_hash(&replicate_ignore_table, &ignore_table_inited); if(add_table_rule(&replicate_ignore_table, optarg)) { diff --git a/sql/sql_class.h b/sql/sql_class.h index 67aac31257f..bd295be101c 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -301,7 +301,7 @@ public: { return (transaction.all.bdb_tid != 0 || transaction.all.innobase_tid != 0 || - transaction.all.gemeni_tid != 0); + transaction.all.gemini_tid != 0); } inline gptr alloc(unsigned int size) { return alloc_root(&mem_root,size); } inline gptr calloc(unsigned int size) |