diff options
author | venu@myvenu.com <> | 2003-05-21 00:12:09 -0700 |
---|---|---|
committer | venu@myvenu.com <> | 2003-05-21 00:12:09 -0700 |
commit | 39cbb547d433f7fdcfbe5655f14ffb8c93fe6122 (patch) | |
tree | 390fab0240f652c5c3ddbf153549ac34cb5c1b2b /sql | |
parent | 9ad75823e7406c3afec09e642615e4821d25df5a (diff) | |
parent | 666d46b6ee19c0399fadff220952a9ac9a097f85 (diff) | |
download | mariadb-git-39cbb547d433f7fdcfbe5655f14ffb8c93fe6122.tar.gz |
Resolve merge colflict
Diffstat (limited to 'sql')
63 files changed, 861 insertions, 733 deletions
diff --git a/sql/cache_manager.cc b/sql/cache_manager.cc deleted file mode 100644 index 307fe331e5c..00000000000 --- a/sql/cache_manager.cc +++ /dev/null @@ -1,150 +0,0 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult 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 - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -#ifdef __GNUC__ -#pragma implementation /* gcc: Class implementation */ -#endif - -#include <my_global.h> -#include <my_sys.h> -#include "cache_manager.h" - -/* - cache_manager.cc - ----------------------------------------------------------------------- - The cache_manager class manages a number of blocks (which are allocatable - units of memory). - ----------------------------------------------------------------------- -*/ - -#define HEADER_LENGTH ALIGN_SIZE(8) -#define SUFFIX_LENGTH 4 - -#define ALLOC_MASK 0x3FFFFFFFL -#define FREE_BIT (1L << 31) -#define LOCK_BIT (1L << 30) -#define SMALLEST_BLOCK 32 - - - -/* -** Internal Methods -** -------------------- -*/ - - -/* list manipulation methods */ -void *cache_manager::init_list(void) -{ - -return; -} - - -void *cache_manager::link_into_abs(void *ptr) -{ - for (int i(0); (*abs_list)[i] != NULL; i++); - - (*abs_list)[i] = ptr; - - return (abs_list)[i]; // ??? -} - - - -bool *cache_manager::unlink_from_abs(void *ptr) -{ - (*ptr) = NULL; - -return; -} - - - -/* memory allocation methods */ -void *cache_manager::find_in_llist(uint) -{ - -return; -} - - -void cache_manager::defrag(void) -{ - printf("Defragging: .........."); - - return; -} - - - -/* -** Public Methods -** ------------------ -*/ - -cache_manager::cache_manager(uint size) -{ - base_ptr = my_malloc(size, MY_WME); /* MY_WME = write mesg on err */ - - return; -} - - -cache_manager::~cache_manager(void) -{ - free(base_ptr); - delete base_ptr; - - return; -} - - -void *cache_manager::alloc(uint size) -{ - void *llist; - void *abs_ptr; - - size=ALIGN_SIZE(size+HEADER_LENGTH+SUFFIX_LENGTH); - if (!(llist = find_in_llist(size))) - { - //defrag(); - if (!(llist = find_in_llist(size))) - return 0; /* return null pointer, buffer exhausted! */ - } - size_of_found_block=int4korr((char*) llist) & ALLOC_MASK; - // if (size_of_found_block < SMALLEST_BLOCK) - - abs_ptr = link_into_abs(llist); - return abs_ptr; -} - - -void cache_manager::dealloc(void) -{ - printf("Deallocating: ..........\n"); - - return; -} - - - -void cache_manager::clear(void) -{ - // reset the internal linked list, forgetting all pointers to mem blks - - return; -} diff --git a/sql/cache_manager.h b/sql/cache_manager.h deleted file mode 100644 index d422a86ea8e..00000000000 --- a/sql/cache_manager.h +++ /dev/null @@ -1,61 +0,0 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult 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 - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -#ifdef __GNUC__ -#pragma interface /* gcc class implementation */ -#endif - -#ifndef _CACHE_MANAGER_H_ -#define _CACHE_MANAGER_H_ -#endif - -/* - cache_manager.h - ----------------------------------------------------------------------- - The cache_manager class manages a number of blocks (which are allocatable - units of memory). - ----------------------------------------------------------------------- -*/ - - - -class cache_manager { - void **abs_list; /* List holding block abstraction ptrs */ - - typedef struct free_blks { - struct free_blks *next, **prev; - uint Size; - } FREE_BLKS; - FREE_BLKS *base_ptr; /* Pointer to newly allocated sys mem */ - - - /* list manipulation methods */ - void *link_into_abs(void *); /* Return an abstract pointer to blk */ - bool *unlink_from_abs(void *); /* Used to dealloc a blk */ - void *find_in_fblist(uint); /* */ - - /* memory allocation methods */ - void defrag(void); /* Defragment the cache */ - bool *init_blk(void *); /* Return a pointer to new list */ - - public: - cache_manager(uint); /* Get allocation of size from system */ - ~cache_manager(void); /* Destructor; return the cache */ - - void *alloc(uint); /* Alloc size bytes from the cache */ - bool *dealloc(void *); /* Deallocate blocks (with *ptr_arg) */ - void clear(void); /* Clear the cache */ -}; diff --git a/sql/field.cc b/sql/field.cc index adf199c5148..3b358446da1 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -5476,9 +5476,9 @@ create_field::create_field(Field *old_field,Field *orig_field) char buff[MAX_FIELD_WIDTH],*pos; String tmp(buff,sizeof(buff), charset); - /* Get the value from record[2] (the default value row) */ + /* Get the value from default_values */ my_ptrdiff_t diff= (my_ptrdiff_t) (orig_field->table->rec_buff_length*2); - orig_field->move_field(diff); // Points now at record[2] + orig_field->move_field(diff); // Points now at default_values bool is_null=orig_field->is_real_null(); orig_field->val_str(&tmp,&tmp); orig_field->move_field(-diff); // Back to record[0] diff --git a/sql/field.h b/sql/field.h index 4349e8fe26d..8e395b7cace 100644 --- a/sql/field.h +++ b/sql/field.h @@ -57,7 +57,7 @@ public: GEOM_GEOMETRYCOLLECTION = 7 }; enum imagetype { itRAW, itMBR}; - + utype unireg_check; uint32 field_length; // Length of field uint16 flags; @@ -83,7 +83,7 @@ public: virtual void reset_fields() {} virtual void set_default() { - my_ptrdiff_t offset = table->default_values() - table->record[0]; + my_ptrdiff_t offset = table->default_values - table->record[0]; memcpy(ptr, ptr + offset, pack_length()); if (null_ptr) *null_ptr= ((*null_ptr & (uchar) ~null_bit) | diff --git a/sql/filesort.cc b/sql/filesort.cc index 928138b8d48..a3d24cd9242 100644 --- a/sql/filesort.cc +++ b/sql/filesort.cc @@ -262,6 +262,22 @@ ha_rows filesort(THD *thd, TABLE *table, SORT_FIELD *sortorder, uint s_length, } /* filesort */ +void filesort_free_buffers(TABLE *table) +{ + if (table->sort.record_pointers) + { + my_free((gptr) table->sort.record_pointers,MYF(0)); + table->sort.record_pointers=0; + } + if (table->sort.addon_buf) + { + my_free((char *) table->sort.addon_buf, MYF(0)); + my_free((char *) table->sort.addon_field, MYF(MY_ALLOW_ZERO_PTR)); + table->sort.addon_buf=0; + table->sort.addon_field=0; + } +} + /* Make a array of string pointers */ static char **make_char_array(register uint fields, uint length, myf my_flag) diff --git a/sql/ha_isam.cc b/sql/ha_isam.cc index 7371628890f..3acc385d251 100644 --- a/sql/ha_isam.cc +++ b/sql/ha_isam.cc @@ -34,10 +34,11 @@ ** isam tables *****************************************************************************/ +bool isam_skip; + const char **ha_isam::bas_ext() const { static const char *ext[]= { ".ISM",".ISD", NullS }; return ext; } - int ha_isam::open(const char *name, int mode, uint test_if_locked) { char name_buff[FN_REFLEN]; diff --git a/sql/ha_isam.h b/sql/ha_isam.h index 82a243ef5c0..3cea79da3ea 100644 --- a/sql/ha_isam.h +++ b/sql/ha_isam.h @@ -81,3 +81,5 @@ class ha_isam: public handler THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to, enum thr_lock_type lock_type); }; + +extern bool isam_skip; diff --git a/sql/handler.cc b/sql/handler.cc index 762e07eec64..f2b7dbdf531 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -34,6 +34,8 @@ #endif #ifdef HAVE_INNOBASE_DB #include "ha_innodb.h" +#else +#define innobase_query_caching_of_table_permitted(X,Y,Z) 1 #endif #include <myisampack.h> #include <errno.h> @@ -86,7 +88,12 @@ enum db_type ha_checktype(enum db_type database_type) #endif #ifdef HAVE_ISAM case DB_TYPE_ISAM: + return (isam_skip ? DB_TYPE_MYISAM : database_type); case DB_TYPE_MRG_ISAM: + return (isam_skip ? DB_TYPE_MRG_MYISAM : database_type); +#else + case DB_TYPE_MRG_ISAM: + return (DB_TYPE_MRG_MYISAM); #endif case DB_TYPE_HEAP: case DB_TYPE_MYISAM: @@ -110,6 +117,9 @@ handler *get_new_handler(TABLE *table, enum db_type db_type) return new ha_isammrg(table); case DB_TYPE_ISAM: return new ha_isam(table); +#else + case DB_TYPE_MRG_ISAM: + return new ha_myisammrg(table); #endif #ifdef HAVE_BERKELEY_DB case DB_TYPE_BERKELEY_DB: @@ -877,7 +887,7 @@ int handler::delete_all_rows() return (my_errno=HA_ERR_WRONG_COMMAND); } -bool handler::caching_allowed(THD* thd, char* table_key, +bool handler::caching_allowed(THD* thd, char* table_key, uint key_length, uint8 cache_type) { if (cache_type == HA_CACHE_TBL_ASKTRANSACT) diff --git a/sql/item.cc b/sql/item.cc index 7dd8392b695..053a94cb695 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -349,7 +349,7 @@ table_map Item_field::used_tables() const { if (field->table->const_table) return 0; // const item - return (depended_from ? RAND_TABLE_BIT : field->table->map); + return (depended_from ? OUTER_REF_TABLE_BIT : field->table->map); } Item *Item_field::get_tmp_table_item(THD *thd) @@ -772,10 +772,9 @@ bool Item_field::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) (last= sl)->get_table_list(), &where, 0)) != not_found_field) break; - if (sl->item_list.elements && - ((refer= find_item_in_list(this, sl->item_list, &counter, + if ((refer= find_item_in_list(this, sl->item_list, &counter, REPORT_EXCEPT_NOT_FOUND)) != - (Item **)not_found_item)) + (Item **) not_found_item) break; if (sl->master_unit()->first_select()->linkage == DERIVED_TABLE_TYPE) @@ -1389,8 +1388,8 @@ bool Item_default_value::fix_fields(THD *thd, struct st_table_list *table_list, if (!def_field) return 1; memcpy(def_field, field_arg->field, field_arg->field->size_of()); - def_field->move_field(def_field->table->default_values() - - def_field->table->record[0]); + def_field->move_field(def_field->table->default_values - + def_field->table->record[0]); set_field(def_field); return 0; } @@ -1407,6 +1406,59 @@ void Item_default_value::print(String *str) str->append(')'); } +bool Item_insert_value::eq(const Item *item, bool binary_cmp) const +{ + return item->type() == INSERT_VALUE_ITEM && + ((Item_default_value *)item)->arg->eq(arg, binary_cmp); +} + + +bool Item_insert_value::fix_fields(THD *thd, struct st_table_list *table_list, Item **items) +{ + bool res= arg->fix_fields(thd, table_list, items); + if (res) + return res; + /* + arg->type() can be only REF_ITEM or FIELD_ITEM as arg is + a simple_ident in sql_yacc.yy + */ + if (arg->type() == REF_ITEM) + { + Item_ref *ref= (Item_ref *)arg; + if (ref->ref[0]->type() != FIELD_ITEM) + { + return 1; + } + arg= ref->ref[0]; + } + Item_field *field_arg= (Item_field *)arg; + if (field_arg->field->table->insert_values) + { + Field *def_field= (Field*) sql_alloc(field_arg->field->size_of()); + if (!def_field) + return 1; + memcpy(def_field, field_arg->field, field_arg->field->size_of()); + def_field->move_field(def_field->table->insert_values - + def_field->table->record[0]); + set_field(def_field); + } + else + { + Field *field=field_arg->field; + /* charset doesn't matter here, it's to avoid sigsegv only */ + set_field(new Field_null(0,0,Field::NONE,field->field_name,field->table, + default_charset_info)); + } + return 0; +} + +void Item_insert_value::print(String *str) +{ + str->append("VALUE("); + arg->print(str); + str->append(')'); +} + /* If item is a const function, calculate it and return a const item The original item is freed if not returned diff --git a/sql/item.h b/sql/item.h index 4862ad21fbe..470937f8ee7 100644 --- a/sql/item.h +++ b/sql/item.h @@ -34,14 +34,25 @@ public: enum Type {FIELD_ITEM, FUNC_ITEM, SUM_FUNC_ITEM, STRING_ITEM, INT_ITEM, REAL_ITEM, NULL_ITEM, VARBIN_ITEM, COPY_STR_ITEM, FIELD_AVG_ITEM, DEFAULT_VALUE_ITEM, - PROC_ITEM,COND_ITEM, REF_ITEM, FIELD_STD_ITEM, - FIELD_VARIANCE_ITEM, CONST_ITEM, + PROC_ITEM,COND_ITEM, REF_ITEM, FIELD_STD_ITEM, + FIELD_VARIANCE_ITEM, INSERT_VALUE_ITEM, SUBSELECT_ITEM, ROW_ITEM, CACHE_ITEM}; enum cond_result { COND_UNDEF,COND_OK,COND_TRUE,COND_FALSE }; - enum coercion { COER_COERCIBLE=3, COER_IMPLICIT=2, - COER_NOCOLL=1, COER_EXPLICIT=0 }; - + enum coercion { COER_COERCIBLE=3, COER_IMPLICIT=2, + COER_NOCOLL=1, COER_EXPLICIT=0 }; + const char *coercion_name(enum coercion coer) const + { + switch(coer) + { + case COER_COERCIBLE: return "COERCIBLE"; + case COER_IMPLICIT: return "IMPLICIT"; + case COER_EXPLICIT: return "EXPLICIT"; + case COER_NOCOLL: return "NO COLLATION"; + default: return "UNKNOWN"; + } + } + String str_value; /* used to store value */ my_string name; /* Name from select */ Item *next; @@ -201,6 +212,7 @@ public: bool is_null() { return field->is_null(); } Item *get_tmp_table_item(THD *thd); friend class Item_default_value; + friend class Item_insert_value; }; class Item_null :public Item @@ -456,7 +468,7 @@ public: longlong val_int(); String *val_str(String*) { return &str_value; } int save_in_field(Field *field, bool no_conversions); - enum Item_result result_type () const { return INT_RESULT; } + enum Item_result result_type () const { return STRING_RESULT; } enum_field_types field_type() const { return MYSQL_TYPE_STRING; } }; @@ -734,7 +746,7 @@ public: Item *arg; Item_default_value() : Item_field((const char *)NULL, (const char *)NULL, (const char *)NULL), arg(NULL) {} - Item_default_value(Item *a) : + Item_default_value(Item *a) : Item_field((const char *)NULL, (const char *)NULL, (const char *)NULL), arg(a) {} enum Type type() const { return DEFAULT_VALUE_ITEM; } bool eq(const Item *item, bool binary_cmp) const; @@ -754,6 +766,24 @@ public: table_map used_tables() const { return (table_map)0L; } }; +class Item_insert_value : public Item_field +{ +public: + Item *arg; + Item_insert_value(Item *a) : + Item_field((const char *)NULL, (const char *)NULL, (const char *)NULL), arg(a) {} + bool eq(const Item *item, bool binary_cmp) const; + bool fix_fields(THD *, struct st_table_list *, Item **); + void set_outer_resolving() { arg->set_outer_resolving(); } + void print(String *str); + virtual bool basic_const_item() const { return true; } + int save_in_field(Field *field, bool no_conversions) + { + return Item_field::save_in_field(field, no_conversions); + } + table_map used_tables() const { return (table_map)0L; } +}; + class Item_cache: public Item { table_map used_table_map; diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 0f21cf5a774..e2885c8764a 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -170,7 +170,10 @@ void Item_bool_func2::fix_length_and_dec() if (set_cmp_charset(args[0]->charset(), args[0]->coercibility, args[1]->charset(), args[1]->coercibility)) { - my_error(ER_WRONG_ARGUMENTS,MYF(0),func_name()); + my_error(ER_CANT_AGGREGATE_COLLATIONS,MYF(0), + args[0]->charset()->name,coercion_name(args[0]->coercibility), + args[1]->charset()->name,coercion_name(args[1]->coercibility), + func_name()); return; } set_cmp_func(); @@ -346,7 +349,7 @@ bool Item_in_optimizer::fix_fields(THD *thd, struct st_table_list *tables, if (cache->cols() == 1) { if (args[0]->used_tables()) - cache->set_used_tables(RAND_TABLE_BIT); + cache->set_used_tables(OUTER_REF_TABLE_BIT); else cache->set_used_tables(0); } @@ -356,7 +359,7 @@ bool Item_in_optimizer::fix_fields(THD *thd, struct st_table_list *tables, for (uint i= 0; i < n; i++) { if (args[0]->el(i)->used_tables()) - ((Item_cache *)cache->el(i))->set_used_tables(RAND_TABLE_BIT); + ((Item_cache *)cache->el(i))->set_used_tables(OUTER_REF_TABLE_BIT); else ((Item_cache *)cache->el(i))->set_used_tables(0); } @@ -652,7 +655,10 @@ Item_func_ifnull::fix_length_and_dec() decimals= 0; if (set_charset(args[0]->charset(),args[0]->coercibility, args[1]->charset(),args[1]->coercibility)) - my_error(ER_WRONG_ARGUMENTS,MYF(0),func_name()); + my_error(ER_CANT_AGGREGATE_COLLATIONS,MYF(0), + args[0]->charset()->name,coercion_name(args[0]->coercibility), + args[1]->charset()->name,coercion_name(args[1]->coercibility), + func_name()); } @@ -731,7 +737,10 @@ Item_func_if::fix_length_and_dec() if (set_charset(args[1]->charset(), args[1]->coercibility, args[2]->charset(), args[2]->coercibility)) { - my_error(ER_WRONG_ARGUMENTS,MYF(0),func_name()); + my_error(ER_CANT_AGGREGATE_COLLATIONS,MYF(0), + args[0]->charset()->name,coercion_name(args[0]->coercibility), + args[1]->charset()->name,coercion_name(args[1]->coercibility), + func_name()); return; } } @@ -1878,7 +1887,10 @@ bool Item_func_like::fix_fields(THD *thd, TABLE_LIST *tlist, Item ** ref) if (set_cmp_charset(args[0]->charset(), args[0]->coercibility, args[1]->charset(), args[1]->coercibility)) { - my_error(ER_WRONG_ARGUMENTS,MYF(0),func_name()); + my_error(ER_CANT_AGGREGATE_COLLATIONS,MYF(0), + args[0]->charset()->name,coercion_name(args[0]->coercibility), + args[1]->charset()->name,coercion_name(args[1]->coercibility), + func_name()); return 1; } diff --git a/sql/item_create.cc b/sql/item_create.cc index 23e4ce1d2b4..1e547a9c76e 100644 --- a/sql/item_create.cc +++ b/sql/item_create.cc @@ -84,8 +84,12 @@ Item *create_func_connection_id(void) { THD *thd=current_thd; thd->lex.safe_to_cache_query=0; - return new Item_int(NullS,(longlong) thd->thread_id,10); -} + return new Item_int(NullS,(longlong) + ((thd->slave_thread) ? + thd->variables.pseudo_thread_id : + thd->thread_id), + 10); +} Item *create_func_conv(Item* a, Item *b, Item *c) { diff --git a/sql/item_func.cc b/sql/item_func.cc index d427e3c5a3a..6af65ece692 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -859,7 +859,10 @@ void Item_func_min_max::fix_length_and_dec() else if (set_charset(charset(), coercibility, args[i]->charset(), args[i]->coercibility)) { - my_error(ER_WRONG_ARGUMENTS,MYF(0),func_name()); + my_error(ER_CANT_AGGREGATE_COLLATIONS,MYF(0), + charset()->name,coercion_name(coercibility), + args[i]->charset()->name,coercion_name(args[i]->coercibility), + func_name()); break; } } diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index bba3799d398..8aaf9f944e8 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -326,7 +326,10 @@ void Item_func_concat::fix_length_and_dec() if (set_charset(charset(), coercibility, args[i]->charset(), args[i]->coercibility)) { - my_error(ER_WRONG_ARGUMENTS,MYF(0),func_name()); + my_error(ER_CANT_AGGREGATE_COLLATIONS,MYF(0), + charset()->name,coercion_name(coercibility), + args[i]->charset()->name,coercion_name(args[i]->coercibility), + func_name()); break; } } @@ -630,7 +633,10 @@ void Item_func_concat_ws::fix_length_and_dec() if (set_charset(charset(), coercibility, args[i]->charset(), args[i]->coercibility)) { - my_error(ER_WRONG_ARGUMENTS,MYF(0),func_name()); + my_error(ER_CANT_AGGREGATE_COLLATIONS,MYF(0), + charset()->name,coercion_name(coercibility), + args[i]->charset()->name,coercion_name(args[i]->coercibility), + func_name()); break; } } @@ -1288,6 +1294,18 @@ String *Item_func_trim::val_str(String *str) void Item_func_password::fix_length_and_dec() { + /* + If PASSWORD() was called with only one argument, it depends on a random + number so we need to save this random number into the binary log. + If called with two arguments, it is repeatable. + */ + if (arg_count == 1) + { + THD *thd= current_thd; + thd->rand_used= 1; + thd->rand_saved_seed1= thd->rand.seed1; + thd->rand_saved_seed2= thd->rand.seed2; + } max_length= get_password_length(use_old_passwords); } @@ -1457,12 +1475,13 @@ String *Item_func_user::val_str(String *str) { THD *thd=current_thd; CHARSET_INFO *cs= default_charset(); - const char *host=thd->host ? thd->host : thd->ip ? thd->ip : ""; + const char *host= thd->host_or_ip; + uint res_length; + // For system threads (e.g. replication SQL thread) user may be empty if (!thd->user) return &empty_string; - uint32 res_length=(strlen(thd->user)+strlen(host)+3) * cs->mbmaxlen; -// it is +3 , because 1 for each string and 1 for '@' sign + res_length= (strlen(thd->user)+strlen(host)+2) * cs->mbmaxlen; if (str->alloc(res_length)) { @@ -1611,7 +1630,10 @@ void Item_func_elt::fix_length_and_dec() if (set_charset(charset(), coercibility, args[i]->charset(), args[i]->coercibility)) { - my_error(ER_WRONG_ARGUMENTS,MYF(0),func_name()); + my_error(ER_CANT_AGGREGATE_COLLATIONS,MYF(0), + charset()->name,coercion_name(coercibility), + args[i]->charset()->name,coercion_name(args[i]->coercibility), + func_name()); break; } } @@ -2955,8 +2977,9 @@ String *Item_func_compress::val_str(String *str) null_value= 1; return 0; } - - int4store(buffer.c_ptr(),res->length() & 0x3FFFFFFF); + + char *tmp= buffer.c_ptr(); // int4store is a macro; avoid side effects + int4store(tmp, res->length() & 0x3FFFFFFF); /* This is for the stupid char fields which trim ' ': */ char *last_char= ((char*)body)+new_size-1; diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index 6c0b799b4de..c749fba616f 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -128,7 +128,7 @@ void Item_subselect::fix_length_and_dec() inline table_map Item_subselect::used_tables() const { return (table_map) (engine->dependent() ? 1L : - (engine->uncacheable() ? RAND_TABLE_BIT : 0L)); + (engine->uncacheable() ? OUTER_REF_TABLE_BIT : 0L)); } Item_singlerow_subselect::Item_singlerow_subselect(THD *thd, diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 653f71e3d79..11c850f9d5f 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -993,7 +993,7 @@ int dump_leaf(byte* key, uint32 count __attribute__((unused)), int error; /* The first item->rec_offset bytes are taken care of with - restore_record(table,2) in setup() + restore_record(table,default_values) in setup() */ memcpy(buf + item->rec_offset, key, item->tree->size_of_element); if ((error = item->table->file->write_row(buf))) @@ -1075,7 +1075,7 @@ bool Item_sum_count_distinct::setup(THD *thd) void* cmp_arg; // to make things easier for dump_leaf if we ever have to dump to MyISAM - restore_record(table,2); + restore_record(table,default_values); if (table->fields == 1) { @@ -1348,7 +1348,7 @@ static int group_concat_key_cmp_with_distinct(void* arg, byte* key1, byte* key2) { Item_func_group_concat* item= (Item_func_group_concat*)arg; - for (int i= 0; i<item->arg_count_field; i++) + for (uint i= 0; i < item->arg_count_field; i++) { Item *field_item= item->expr[i]; Field *field= field_item->tmp_table_field(); @@ -1377,7 +1377,7 @@ static int group_concat_key_cmp_with_distinct(void* arg, byte* key1, static int group_concat_key_cmp_with_order(void* arg, byte* key1, byte* key2) { Item_func_group_concat* item= (Item_func_group_concat*)arg; - for (int i=0; i<item->arg_count_order; i++) + for (uint i=0; i < item->arg_count_order; i++) { ORDER *order_item= item->order[i]; Item *item= *order_item->item; @@ -1404,9 +1404,10 @@ static int group_concat_key_cmp_with_order(void* arg, byte* key1, byte* key2) GROUP_CONCAT(DISTINCT expr,... ORDER BY col,... ) */ -static int group_concat_key_cmp_with_distinct_and_order(void* arg, byte* key1, byte* key2) +static int group_concat_key_cmp_with_distinct_and_order(void* arg, + byte* key1, + byte* key2) { - Item_func_group_concat* item= (Item_func_group_concat*)arg; if (!group_concat_key_cmp_with_distinct(arg,key1,key2)) return 0; return(group_concat_key_cmp_with_order(arg,key1,key2)); @@ -1427,7 +1428,7 @@ static int dump_leaf_key(byte* key, uint32 count __attribute__((unused)), tmp.length(0); - for (int i= 0; i < group_concat_item->arg_show_fields; i++) + for (uint i= 0; i < group_concat_item->arg_show_fields; i++) { Item *show_item= group_concat_item->expr[i]; if (!show_item->const_item()) @@ -1481,13 +1482,13 @@ static int dump_leaf_key(byte* key, uint32 count __attribute__((unused)), is_separator - string value of separator */ -Item_func_group_concat::Item_func_group_concat(int is_distinct, +Item_func_group_concat::Item_func_group_concat(bool is_distinct, List<Item> *is_select, SQL_LIST *is_order, String *is_separator) :Item_sum(), tmp_table_param(0), warning_available(false), - separator(is_separator), tree(&tree_base), table(0), distinct(is_distinct), - tree_mode(0), count_cut_values(0) + separator(is_separator), tree(&tree_base), table(0), + count_cut_values(0), tree_mode(0), distinct(is_distinct) { original= 0; quick_group= 0; @@ -1506,39 +1507,31 @@ Item_func_group_concat::Item_func_group_concat(int is_distinct, expr - arg_count_field order - arg_count_order */ - args= (Item**)sql_alloc(sizeof(Item*)*(arg_count+arg_count_order+arg_count_field)+ - sizeof(ORDER*)*arg_count_order); + args= (Item**) sql_alloc(sizeof(Item*)*(arg_count+arg_count_order+ + arg_count_field)+ + sizeof(ORDER*)*arg_count_order); if (!args) - { - my_error(ER_OUTOFMEMORY,MYF(0)); - } + return; // thd->fatal is set expr= args; expr+= arg_count+arg_count_order; - if (arg_count_order) - { - order= (ORDER**)(expr + arg_count_field); - } - /* - fill args items of show and sort - */ + + /* fill args items of show and sort */ int i= 0; List_iterator_fast<Item> li(*is_select); Item *item_select; - while ((item_select= li++)) - { + for ( ; (item_select= li++) ; i++) args[i]= expr[i]= item_select; - i++; - } - - if (order) + + if (arg_count_order) { - uint j= 0; - for (ORDER *order_item= (ORDER*)is_order->first; + i= 0; + order= (ORDER**)(expr + arg_count_field); + for (ORDER *order_item= (ORDER*) is_order->first; order_item != NULL; order_item= order_item->next) { - order[j++]= order_item; + order[i++]= order_item; } } } @@ -1561,8 +1554,7 @@ Item_func_group_concat::~Item_func_group_concat() } if (table) free_tmp_table(thd, table); - if (tmp_table_param) - delete tmp_table_param; + delete tmp_table_param; if (tree_mode) delete_tree(tree); } @@ -1593,14 +1585,17 @@ bool Item_func_group_concat::add() copy_funcs(tmp_table_param->items_to_copy); bool record_is_null= TRUE; - for (int i= 0; i < arg_show_fields; i++) + for (uint i= 0; i < arg_show_fields; i++) { Item *show_item= expr[i]; if (!show_item->const_item()) { Field *f= show_item->tmp_table_field(); if (!f->is_null()) + { record_is_null= FALSE; + break; + } } } if (record_is_null) @@ -1631,7 +1626,7 @@ void Item_func_group_concat::reset_field() bool Item_func_group_concat::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) { - int i; /* for loop variable */ + uint i; /* for loop variable */ if (!thd->allow_sum_func) { @@ -1641,11 +1636,11 @@ Item_func_group_concat::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) thd->allow_sum_func= 0; maybe_null= 0; - for (uint ui= 0 ; ui < arg_count ; ui++) + for (i= 0 ; i < arg_count ; i++) { - if (args[ui]->fix_fields(thd, tables, args + ui) || args[ui]->check_cols(1)) + if (args[i]->fix_fields(thd, tables, args + i) || args[i]->check_cols(1)) return 1; - maybe_null |= args[ui]->maybe_null; + maybe_null |= args[i]->maybe_null; } for (i= 0 ; i < arg_count_field ; i++) { diff --git a/sql/item_sum.h b/sql/item_sum.h index 1b3e993fffc..37d7e7f79d0 100644 --- a/sql/item_sum.h +++ b/sql/item_sum.h @@ -643,21 +643,20 @@ class Item_func_group_concat : public Item_sum public: String result; String *separator; - uint show_elements; TREE tree_base; TREE *tree; TABLE *table; - int arg_count_order; - int arg_count_field; - int arg_show_fields; - int distinct; Item **expr; ORDER **order; - bool tree_mode; - int count_cut_values; + TABLE_LIST *tables_list; ulong group_concat_max_len; + uint show_elements; + uint arg_count_order; + uint arg_count_field; + uint arg_show_fields; + uint count_cut_values; + bool tree_mode, distinct; bool warning_for_row; - TABLE_LIST *tables_list; bool always_null; /* Following is 0 normal object and pointer to original one for copy @@ -665,7 +664,7 @@ class Item_func_group_concat : public Item_sum */ Item_func_group_concat *original; - Item_func_group_concat(int is_distinct,List<Item> *is_select, + Item_func_group_concat(bool is_distinct,List<Item> *is_select, SQL_LIST *is_order,String *is_separator); Item_func_group_concat(THD *thd, Item_func_group_concat &item) @@ -675,20 +674,20 @@ class Item_func_group_concat : public Item_sum warning(item.warning), warning_available(item.warning_available), separator(item.separator), - show_elements(item.show_elements), tree(item.tree), table(item.table), + expr(item.expr), + order(item.order), + tables_list(item.tables_list), + group_concat_max_len(item.group_concat_max_len), + show_elements(item.show_elements), arg_count_order(item.arg_count_order), arg_count_field(item.arg_count_field), arg_show_fields(item.arg_show_fields), - distinct(item.distinct), - expr(item.expr), - order(item.order), - tree_mode(0), count_cut_values(item.count_cut_values), - group_concat_max_len(item.group_concat_max_len), + tree_mode(0), + distinct(item.distinct), warning_for_row(item.warning_for_row), - tables_list(item.tables_list), original(&item) { quick_group = 0; diff --git a/sql/lex.h b/sql/lex.h index e51b3efff87..f85431aadf7 100644 --- a/sql/lex.h +++ b/sql/lex.h @@ -412,6 +412,7 @@ static SYMBOL symbols[] = { { "WRITE", SYM(WRITE_SYM),0,0}, { "WHEN", SYM(WHEN_SYM),0,0}, { "WHERE", SYM(WHERE),0,0}, + { "NO_WRITE_TO_BINLOG", SYM(NO_WRITE_TO_BINLOG),0,0}, { "XOR", SYM(XOR),0,0}, { "X509", SYM(X509_SYM),0,0}, { "YEAR", SYM(YEAR_SYM),0,0}, diff --git a/sql/log.cc b/sql/log.cc index 50471041ee1..c9e20bc0cc9 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -767,6 +767,7 @@ int MYSQL_LOG::purge_logs(const char *to_log, !log_in_use(log_info.log_file_name)) { ulong tmp; + LINT_INIT(tmp); if (decrease_log_space) //stat the file we want to delete { MY_STAT s; diff --git a/sql/log_event.cc b/sql/log_event.cc index 39db264d898..530e878b458 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -1182,15 +1182,19 @@ void Load_log_event::pack_info(Protocol *protocol) pos= pretty_print_str(pos, sql_ex.escaped, sql_ex.escaped_len); } + bool line_lexem_added= false; if (sql_ex.line_term_len) { pos= strmov(pos, " LINES TERMINATED BY "); pos= pretty_print_str(pos, sql_ex.line_term, sql_ex.line_term_len); + line_lexem_added= true; } if (sql_ex.line_start_len) { - pos= strmov(pos, " LINES STARTING BY "); + if (!line_lexem_added) + pos= strmov(pos," LINES"); + pos= strmov(pos, " STARTING BY "); pos= pretty_print_str(pos, sql_ex.line_start, sql_ex.line_start_len); } @@ -1438,10 +1442,10 @@ void Load_log_event::print(FILE* file, bool short_form, char* last_db) if (db && db[0] && !same_db) fprintf(file, "use %s;\n", db); - fprintf(file, "LOAD "); + fprintf(file, "LOAD DATA "); if (check_fname_outside_temp_buf()) fprintf(file, "LOCAL "); - fprintf(file, "DATA INFILE '%-*s' ", fname_len, fname); + fprintf(file, "INFILE '%-*s' ", fname_len, fname); if (sql_ex.opt_flags & REPLACE_FLAG) fprintf(file," REPLACE "); @@ -1469,15 +1473,19 @@ void Load_log_event::print(FILE* file, bool short_form, char* last_db) pretty_print_str(file, sql_ex.escaped, sql_ex.escaped_len); } + bool line_lexem_added= false; if (sql_ex.line_term) { fprintf(file," LINES TERMINATED BY "); pretty_print_str(file, sql_ex.line_term, sql_ex.line_term_len); + line_lexem_added= true; } if (sql_ex.line_start) { - fprintf(file," LINES STARTING BY "); + if (!line_lexem_added) + fprintf(file," LINES"); + fprintf(file," STARTING BY "); pretty_print_str(file, sql_ex.line_start, sql_ex.line_start_len); } diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index d17faa3cea5..ea6e544a1fd 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -30,7 +30,7 @@ #undef write /* remove pthread.h macro definition for EMX */ #endif -typedef ulong table_map; /* Used for table bits in join */ +typedef ulonglong table_map; /* Used for table bits in join */ typedef ulong key_map; /* Used for finding keys */ typedef ulong key_part_map; /* Used for finding key parts */ @@ -369,7 +369,8 @@ bool do_command(THD *thd); bool dispatch_command(enum enum_server_command command, THD *thd, char* packet, uint packet_length); bool check_stack_overrun(THD *thd,char *dummy); -bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables); +bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables, + bool *write_to_binlog); void table_cache_init(void); void table_cache_free(void); uint cached_tables(void); @@ -846,6 +847,7 @@ void end_read_record(READ_RECORD *info); ha_rows filesort(THD *thd, TABLE *form,struct st_sort_field *sortorder, uint s_length, SQL_SELECT *select, ha_rows max_rows, ha_rows *examined_rows); +void filesort_free_buffers(TABLE *table); void change_double_for_sort(double nr,byte *to); int get_quick_record(SQL_SELECT *select); int calc_weekday(long daynr,bool sunday_first_day_of_week); diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 6907da7d8e1..f73bd6721f0 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -29,6 +29,9 @@ #include "ha_innodb.h" #endif #include "ha_myisam.h" +#ifdef HAVE_ISAM +#include "ha_isam.h" +#endif #include <nisam.h> #include <thr_alarm.h> #include <ft_global.h> @@ -314,18 +317,12 @@ my_bool opt_safe_user_create = 0, opt_no_mix_types = 0; my_bool lower_case_table_names, opt_old_rpl_compat; my_bool opt_show_slave_auth_info, opt_sql_bin_update = 0; my_bool opt_log_slave_updates= 0, opt_old_passwords=0, use_old_passwords=0; -my_bool opt_console= 0, opt_bdb, opt_innodb; +my_bool opt_console= 0, opt_bdb, opt_innodb, opt_isam; volatile bool mqh_used = 0; FILE *bootstrap_file=0; -int segfaulted = 0; // ensure we do not enter SIGSEGV handler twice -/* - If sql_bin_update is true, SQL_LOG_UPDATE and SQL_LOG_BIN are kept in sync, - and are treated as aliases for each other -*/ - -static bool kill_in_progress=FALSE; +static bool kill_in_progress=0, segfaulted= 0; struct rand_struct sql_rand; // used by sql_class.cc:THD::THD() static int cleanup_done; static char **defaults_argv; @@ -379,7 +376,7 @@ arg_cmp_func Arg_comparator::comparator_matrix[4][2] = {&Arg_comparator::compare_row, &Arg_comparator::compare_e_row}}; #ifdef HAVE_SMEM char *shared_memory_base_name=default_shared_memory_base_name; -bool opt_enable_shared_memory = 0; +my_bool opt_enable_shared_memory = 0; #endif volatile ulong cached_thread_count=0; @@ -1496,7 +1493,7 @@ static void check_data_home(const char *path) static void sig_reload(int signo) { // Flush everything - reload_acl_and_cache((THD*) 0,REFRESH_LOG, (TABLE_LIST*) 0); + reload_acl_and_cache((THD*) 0,REFRESH_LOG, (TABLE_LIST*) 0, NULL); signal(signo, SIG_ACK); } @@ -1832,7 +1829,7 @@ extern "C" void *signal_hand(void *arg __attribute__((unused))) (REFRESH_LOG | REFRESH_TABLES | REFRESH_FAST | REFRESH_STATUS | REFRESH_GRANT | REFRESH_THREADS | REFRESH_HOSTS), - (TABLE_LIST*) 0); // Flush logs + (TABLE_LIST*) 0, NULL); // Flush logs mysql_print_status((THD*) 0); // Send debug some info } break; @@ -3431,7 +3428,7 @@ enum options OPT_INNODB_FLUSH_METHOD, OPT_INNODB_FAST_SHUTDOWN, OPT_SAFE_SHOW_DB, - OPT_INNODB, OPT_SKIP_SAFEMALLOC, + OPT_INNODB, OPT_ISAM, OPT_SKIP_SAFEMALLOC, OPT_TEMP_POOL, OPT_TX_ISOLATION, OPT_SKIP_STACK_TRACE, OPT_SKIP_SYMLINKS, OPT_MAX_BINLOG_DUMP_EVENTS, OPT_SPORADIC_BINLOG_DUMP_FAIL, @@ -3892,6 +3889,10 @@ Disable with --skip-bdb (will save memory)", Disable with --skip-innodb (will save memory)", (gptr*) &opt_innodb, (gptr*) &opt_innodb, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, + {"isam", OPT_ISAM, "Enable isam (if this version of MySQL supports it). \ +Disable with --skip-isam", + (gptr*) &opt_isam, (gptr*) &opt_isam, 0, GET_BOOL, NO_ARG, 1, 0, 0, + 0, 0, 0}, {"skip-locking", OPT_SKIP_LOCK, "Deprecated option, use --skip-external-locking instead", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, @@ -5045,6 +5046,20 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), } #endif break; + case OPT_ISAM: +#ifdef HAVE_ISAM + if (opt_isam) + { + isam_skip=0; + have_isam= SHOW_OPTION_YES; + } + else + { + isam_skip=1; + have_isam= SHOW_OPTION_DISABLED; + } +#endif + break; case OPT_INNODB: #ifdef HAVE_INNOBASE_DB if (opt_innodb) diff --git a/sql/records.cc b/sql/records.cc index e6c6e62a516..9d8627bc1fc 100644 --- a/sql/records.cc +++ b/sql/records.cc @@ -134,19 +134,7 @@ void end_read_record(READ_RECORD *info) } if (info->table) { - TABLE *table= info->table; - if (table->sort.record_pointers) - { - my_free((gptr) table->sort.record_pointers,MYF(0)); - table->sort.record_pointers=0; - } - if (table->sort.addon_buf) - { - my_free((char *) table->sort.addon_buf, MYF(0)); - my_free((char *) table->sort.addon_field, MYF(MY_ALLOW_ZERO_PTR)); - table->sort.addon_buf=0; - table->sort.addon_field=0; - } + filesort_free_buffers(info->table); (void) info->file->extra(HA_EXTRA_NO_CACHE); (void) info->file->rnd_end(); info->table=0; diff --git a/sql/share/czech/errmsg.txt b/sql/share/czech/errmsg.txt index 2e6e732fc28..e04d4494a93 100644 --- a/sql/share/czech/errmsg.txt +++ b/sql/share/czech/errmsg.txt @@ -256,16 +256,18 @@ v/* "Cyclic reference on subqueries", "Converting column '%s' from %s to %s", "Reference '%-.64s' not supported (%s)", -"Every derived table must have it's own alias" +"Every derived table must have it's own alias", "Select %u was reduced during optimisation", -"Table '%-.64s' from one of SELECT's can not be used in %-.32s" -"Client does not support authentication protocol requested by server. Consider upgrading MySQL client" -"All parts of a SPATIAL KEY must be NOT NULL" -"COLLATION '%s' is not valid for CHARACTER SET '%s'" -"The slave was already running" -"The slave was already stopped" -"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)" -"Z_BUF_ERROR: Not enough memory available for zlib" -"Z_MEM_ERROR: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)" -"Z_DATA_ERROR: Input data was corrupted for zlib" -"%d line(s) was(were) cut by group_concat()" +"Table '%-.64s' from one of SELECT's can not be used in %-.32s", +"Client does not support authentication protocol requested by server. Consider upgrading MySQL client", +"All parts of a SPATIAL KEY must be NOT NULL", +"COLLATION '%s' is not valid for CHARACTER SET '%s'", +"The slave was already running", +"The slave was already stopped", +"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)", +"Z_BUF_ERROR: Not enough memory available for zlib", +"Z_MEM_ERROR: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)", +"Z_DATA_ERROR: Input data was corrupted for zlib", +"%d line(s) was(were) cut by group_concat()", +"Using storage engine %s for table '%s'", +"Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", diff --git a/sql/share/danish/errmsg.txt b/sql/share/danish/errmsg.txt index 4b2c5438738..ff89dbb6bcf 100644 --- a/sql/share/danish/errmsg.txt +++ b/sql/share/danish/errmsg.txt @@ -250,16 +250,18 @@ "Cyclic reference on subqueries", "Converting column '%s' from %s to %s", "Reference '%-.64s' not supported (%s)", -"Every derived table must have it's own alias" +"Every derived table must have it's own alias", "Select %u was reduced during optimisation", -"Table '%-.64s' from one of SELECT's can not be used in %-.32s" -"Client does not support authentication protocol requested by server. Consider upgrading MySQL client" -"All parts of a SPATIAL KEY must be NOT NULL" -"COLLATION '%s' is not valid for CHARACTER SET '%s'" -"The slave was already running" -"The slave was already stopped" -"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)" -"Z_BUF_ERROR: Not enough memory available for zlib" -"Z_MEM_ERROR: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)" -"Z_DATA_ERROR: Input data was corrupted for zlib" -"%d line(s) was(were) cut by group_concat()"
\ No newline at end of file +"Table '%-.64s' from one of SELECT's can not be used in %-.32s", +"Client does not support authentication protocol requested by server. Consider upgrading MySQL client", +"All parts of a SPATIAL KEY must be NOT NULL", +"COLLATION '%s' is not valid for CHARACTER SET '%s'", +"The slave was already running", +"The slave was already stopped", +"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)", +"Z_BUF_ERROR: Not enough memory available for zlib", +"Z_MEM_ERROR: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)", +"Z_DATA_ERROR: Input data was corrupted for zlib", +"%d line(s) was(were) cut by group_concat()", +"Using storage engine %s for table '%s'", +"Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", diff --git a/sql/share/dutch/errmsg.txt b/sql/share/dutch/errmsg.txt index 29bf735928d..98ca6a834e4 100644 --- a/sql/share/dutch/errmsg.txt +++ b/sql/share/dutch/errmsg.txt @@ -258,16 +258,18 @@ "Cyclic reference on subqueries", "Converting column '%s' from %s to %s", "Reference '%-.64s' not supported (%s)", -"Every derived table must have it's own alias" +"Every derived table must have it's own alias", "Select %u was reduced during optimisation", -"Table '%-.64s' from one of SELECT's can not be used in %-.32s" -"Client does not support authentication protocol requested by server. Consider upgrading MySQL client" -"All parts of a SPATIAL KEY must be NOT NULL" -"COLLATION '%s' is not valid for CHARACTER SET '%s'" -"The slave was already running" -"The slave was already stopped" -"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)" -"Z_BUF_ERROR: Not enough memory available for zlib" -"Z_MEM_ERROR: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)" -"Z_DATA_ERROR: Input data was corrupted for zlib" -"%d line(s) was(were) cut by group_concat()"
\ No newline at end of file +"Table '%-.64s' from one of SELECT's can not be used in %-.32s", +"Client does not support authentication protocol requested by server. Consider upgrading MySQL client", +"All parts of a SPATIAL KEY must be NOT NULL", +"COLLATION '%s' is not valid for CHARACTER SET '%s'", +"The slave was already running", +"The slave was already stopped", +"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)", +"Z_BUF_ERROR: Not enough memory available for zlib", +"Z_MEM_ERROR: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)", +"Z_DATA_ERROR: Input data was corrupted for zlib", +"%d line(s) was(were) cut by group_concat()", +"Using storage engine %s for table '%s'", +"Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", diff --git a/sql/share/english/errmsg.txt b/sql/share/english/errmsg.txt index b9c4ebed390..cb709c45326 100644 --- a/sql/share/english/errmsg.txt +++ b/sql/share/english/errmsg.txt @@ -31,8 +31,8 @@ "'%-.64s' is locked against change", "Sort aborted", "View '%-.64s' doesn't exist for '%-.64s'", -"Got error %d from table handler", -"Table handler for '%-.64s' doesn't have this option", +"Got error %d from storage engine", +"Table storage engine for '%-.64s' doesn't have this option", "Can't find record in '%-.64s'", "Incorrect information in file: '%-.64s'", "Incorrect key file for table: '%-.64s'. Try to repair it", @@ -90,7 +90,7 @@ "File '%-.80s' already exists", "Records: %ld Deleted: %ld Skipped: %ld Warnings: %ld", "Records: %ld Duplicates: %ld", -"Incorrect sub part key. The used key part isn't a string, the used length is longer than the key part or the table handler doesn't support unique sub keys", +"Incorrect sub part key. The used key part isn't a string, the used length is longer than the key part or the store engine doesn't support unique sub keys", "You can't delete all columns with ALTER TABLE. Use DROP TABLE instead", "Can't DROP '%-.64s'. Check that column/key exists", "Records: %ld Duplicates: %ld Warnings: %ld", @@ -168,7 +168,7 @@ "The used table type doesn't support AUTO_INCREMENT columns", "INSERT DELAYED can't be used with table '%-.64s' because it is locked with LOCK TABLES", "Incorrect column name '%-.100s'", -"The used table handler can't index column '%-.64s'", +"The used storage engine can't index column '%-.64s'", "All tables in the MERGE table are not identically defined", "Can't write, because of unique constraint, to table '%-.64s'", "BLOB column '%-.64s' used in key specification without a key length", @@ -179,14 +179,14 @@ "You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column", "Key '%-.64s' doesn't exist in table '%-.64s'", "Can't open table", -"The handler for the table doesn't support %s", +"The storage enginge for the table doesn't support %s", "You are not allowed to execute this command in a transaction", "Got error %d during COMMIT", "Got error %d during ROLLBACK", "Got error %d during FLUSH_LOGS", "Got error %d during CHECKPOINT", "Aborted connection %ld to db: '%-.64s' user: '%-.32s' host: `%-.64s' (%-.64s)", -"The handler for the table does not support binary table dump", +"The store engine for the table does not support binary table dump", "Binlog closed, cannot RESET MASTER", "Failed rebuilding the index of dumped table '%-.64s'", "Error from master: '%-.64s'", @@ -249,21 +249,16 @@ "Reference '%-.64s' not supported (%s)", "Every derived table must have it's own alias", "Select %u was reduced during optimisation", -"Table '%-.64s' from one of SELECT's can not be used in %-.32s" -"Client does not support authentication protocol requested by server. Consider upgrading MySQL client" -"All parts of a SPATIAL KEY must be NOT NULL" -"COLLATION '%s' is not valid for CHARACTER SET '%s'" -"The slave was already running" -"The slave was already stopped" -"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)" -"Z_BUF_ERROR: Not enough memory available for zlib" -"Z_MEM_ERROR: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)" -"Z_DATA_ERROR: Input data was corrupted for zlib" -"%d line(s) was(were) cut by group_concat()"; -"Record count is fewer than the column count at row %ld"; -"Record count is more than the column count at row %ld"; -"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld"; -"Data truncated, out of range for column '%s' at row %ld"; -"Data truncated for column '%s' at row %ld" - - +"Table '%-.64s' from one of SELECT's can not be used in %-.32s", +"Client does not support authentication protocol requested by server. Consider upgrading MySQL client", +"All parts of a SPATIAL KEY must be NOT NULL", +"COLLATION '%s' is not valid for CHARACTER SET '%s'", +"The slave was already running", +"The slave was already stopped", +"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)", +"Z_BUF_ERROR: Not enough memory available for zlib", +"Z_MEM_ERROR: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)", +"Z_DATA_ERROR: Input data was corrupted for zlib", +"%d line(s) was(were) cut by group_concat()", +"Using storage engine %s for table '%s'", +"Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", diff --git a/sql/share/estonian/errmsg.txt b/sql/share/estonian/errmsg.txt index ed5d5c680d5..f9d5a2b6324 100644 --- a/sql/share/estonian/errmsg.txt +++ b/sql/share/estonian/errmsg.txt @@ -252,16 +252,18 @@ "Cyclic reference on subqueries", "Converting column '%s' from %s to %s", "Reference '%-.64s' not supported (%s)", -"Every derived table must have it's own alias" +"Every derived table must have it's own alias", "Select %u was reduced during optimisation", -"Table '%-.64s' from one of SELECT's can not be used in %-.32s" -"Client does not support authentication protocol requested by server. Consider upgrading MySQL client" -"All parts of a SPATIAL KEY must be NOT NULL" -"COLLATION '%s' is not valid for CHARACTER SET '%s'" -"The slave was already running" -"The slave was already stopped" -"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)" -"Z_BUF_ERROR: Not enough memory available for zlib" -"Z_MEM_ERROR: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)" -"Z_DATA_ERROR: Input data was corrupted for zlib" -"%d line(s) was(were) cut by group_concat()"
\ No newline at end of file +"Table '%-.64s' from one of SELECT's can not be used in %-.32s", +"Client does not support authentication protocol requested by server. Consider upgrading MySQL client", +"All parts of a SPATIAL KEY must be NOT NULL", +"COLLATION '%s' is not valid for CHARACTER SET '%s'", +"The slave was already running", +"The slave was already stopped", +"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)", +"Z_BUF_ERROR: Not enough memory available for zlib", +"Z_MEM_ERROR: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)", +"Z_DATA_ERROR: Input data was corrupted for zlib", +"%d line(s) was(were) cut by group_concat()", +"Using storage engine %s for table '%s'", +"Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", diff --git a/sql/share/french/errmsg.txt b/sql/share/french/errmsg.txt index 6a36c4a2c2e..1c4efab7e53 100644 --- a/sql/share/french/errmsg.txt +++ b/sql/share/french/errmsg.txt @@ -247,16 +247,18 @@ "Cyclic reference on subqueries", "Converting column '%s' from %s to %s", "Reference '%-.64s' not supported (%s)", -"Every derived table must have it's own alias" +"Every derived table must have it's own alias", "Select %u was reduced during optimisation", -"Table '%-.64s' from one of SELECT's can not be used in %-.32s" -"Client does not support authentication protocol requested by server. Consider upgrading MySQL client" -"All parts of a SPATIAL KEY must be NOT NULL" -"COLLATION '%s' is not valid for CHARACTER SET '%s'" -"The slave was already running" -"The slave was already stopped" -"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)" -"Z_BUF_ERROR: Not enough memory available for zlib" -"Z_MEM_ERROR: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)" -"Z_DATA_ERROR: Input data was corrupted for zlib" -"%d line(s) was(were) cut by group_concat()"
\ No newline at end of file +"Table '%-.64s' from one of SELECT's can not be used in %-.32s", +"Client does not support authentication protocol requested by server. Consider upgrading MySQL client", +"All parts of a SPATIAL KEY must be NOT NULL", +"COLLATION '%s' is not valid for CHARACTER SET '%s'", +"The slave was already running", +"The slave was already stopped", +"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)", +"Z_BUF_ERROR: Not enough memory available for zlib", +"Z_MEM_ERROR: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)", +"Z_DATA_ERROR: Input data was corrupted for zlib", +"%d line(s) was(were) cut by group_concat()", +"Using storage engine %s for table '%s'", +"Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", diff --git a/sql/share/german/errmsg.txt b/sql/share/german/errmsg.txt index 1f9a19ffda2..00d6e784dcb 100644 --- a/sql/share/german/errmsg.txt +++ b/sql/share/german/errmsg.txt @@ -260,12 +260,14 @@ "Select %u wurde während der Optimierung reduziert.", "Tabelle '%-.64s', die in einem der SELECT-Befehle verwendet wurde kann nicht in %-.32s verwendet werden", "Client does not support authentication protocol requested by server. Consider upgrading MySQL client", -"All parts of a SPATIAL KEY must be NOT NULL" -"COLLATION '%s' is not valid for CHARACTER SET '%s'" -"The slave was already running" -"The slave was already stopped" -"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)" -"Z_BUF_ERROR: Not enough memory available for zlib" -"Z_MEM_ERROR: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)" -"Z_DATA_ERROR: Input data was corrupted for zlib" -"%d line(s) was(were) cut by group_concat()"
\ No newline at end of file +"All parts of a SPATIAL KEY must be NOT NULL", +"COLLATION '%s' is not valid for CHARACTER SET '%s'", +"The slave was already running", +"The slave was already stopped", +"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)", +"Z_BUF_ERROR: Not enough memory available for zlib", +"Z_MEM_ERROR: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)", +"Z_DATA_ERROR: Input data was corrupted for zlib", +"%d line(s) was(were) cut by group_concat()", +"Using storage engine %s for table '%s'", +"Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", diff --git a/sql/share/greek/errmsg.txt b/sql/share/greek/errmsg.txt index cee08e0a6fd..fdeb787859c 100644 --- a/sql/share/greek/errmsg.txt +++ b/sql/share/greek/errmsg.txt @@ -247,16 +247,18 @@ "Cyclic reference on subqueries", "Converting column '%s' from %s to %s", "Reference '%-.64s' not supported (%s)", -"Every derived table must have it's own alias" +"Every derived table must have it's own alias", "Select %u was reduced during optimisation", -"Table '%-.64s' from one of SELECT's can not be used in %-.32s" -"Client does not support authentication protocol requested by server. Consider upgrading MySQL client" -"All parts of a SPATIAL KEY must be NOT NULL" -"COLLATION '%s' is not valid for CHARACTER SET '%s'" -"The slave was already running" -"The slave was already stopped" -"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)" -"Z_BUF_ERROR: Not enough memory available for zlib" -"Z_MEM_ERROR: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)" -"Z_DATA_ERROR: Input data was corrupted for zlib" -"%d line(s) was(were) cut by group_concat()"
\ No newline at end of file +"Table '%-.64s' from one of SELECT's can not be used in %-.32s", +"Client does not support authentication protocol requested by server. Consider upgrading MySQL client", +"All parts of a SPATIAL KEY must be NOT NULL", +"COLLATION '%s' is not valid for CHARACTER SET '%s'", +"The slave was already running", +"The slave was already stopped", +"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)", +"Z_BUF_ERROR: Not enough memory available for zlib", +"Z_MEM_ERROR: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)", +"Z_DATA_ERROR: Input data was corrupted for zlib", +"%d line(s) was(were) cut by group_concat()", +"Using storage engine %s for table '%s'", +"Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", diff --git a/sql/share/hungarian/errmsg.txt b/sql/share/hungarian/errmsg.txt index d33bdfe803f..708bad26391 100644 --- a/sql/share/hungarian/errmsg.txt +++ b/sql/share/hungarian/errmsg.txt @@ -249,16 +249,18 @@ "Cyclic reference on subqueries", "Converting column '%s' from %s to %s", "Reference '%-.64s' not supported (%s)", -"Every derived table must have it's own alias" +"Every derived table must have it's own alias", "Select %u was reduced during optimisation", -"Table '%-.64s' from one of SELECT's can not be used in %-.32s" -"Client does not support authentication protocol requested by server. Consider upgrading MySQL client" -"All parts of a SPATIAL KEY must be NOT NULL" -"COLLATION '%s' is not valid for CHARACTER SET '%s'" -"The slave was already running" -"The slave was already stopped" -"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)" -"Z_BUF_ERROR: Not enough memory available for zlib" -"Z_MEM_ERROR: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)" -"Z_DATA_ERROR: Input data was corrupted for zlib" -"%d line(s) was(were) cut by group_concat()"
\ No newline at end of file +"Table '%-.64s' from one of SELECT's can not be used in %-.32s", +"Client does not support authentication protocol requested by server. Consider upgrading MySQL client", +"All parts of a SPATIAL KEY must be NOT NULL", +"COLLATION '%s' is not valid for CHARACTER SET '%s'", +"The slave was already running", +"The slave was already stopped", +"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)", +"Z_BUF_ERROR: Not enough memory available for zlib", +"Z_MEM_ERROR: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)", +"Z_DATA_ERROR: Input data was corrupted for zlib", +"%d line(s) was(were) cut by group_concat()", +"Using storage engine %s for table '%s'", +"Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", diff --git a/sql/share/italian/errmsg.txt b/sql/share/italian/errmsg.txt index 1e9a0e5b634..23d157ce628 100644 --- a/sql/share/italian/errmsg.txt +++ b/sql/share/italian/errmsg.txt @@ -247,16 +247,18 @@ "Cyclic reference on subqueries", "Converting column '%s' from %s to %s", "Reference '%-.64s' not supported (%s)", -"Every derived table must have it's own alias" +"Every derived table must have it's own alias", "Select %u was reduced during optimisation", -"Table '%-.64s' from one of SELECT's can not be used in %-.32s" -"Client does not support authentication protocol requested by server. Consider upgrading MySQL client" -"All parts of a SPATIAL KEY must be NOT NULL" -"COLLATION '%s' is not valid for CHARACTER SET '%s'" -"The slave was already running" -"The slave was already stopped" -"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)" -"Z_BUF_ERROR: Not enough memory available for zlib" -"Z_MEM_ERROR: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)" -"Z_DATA_ERROR: Input data was corrupted for zlib" -"%d line(s) was(were) cut by group_concat()"
\ No newline at end of file +"Table '%-.64s' from one of SELECT's can not be used in %-.32s", +"Client does not support authentication protocol requested by server. Consider upgrading MySQL client", +"All parts of a SPATIAL KEY must be NOT NULL", +"COLLATION '%s' is not valid for CHARACTER SET '%s'", +"The slave was already running", +"The slave was already stopped", +"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)", +"Z_BUF_ERROR: Not enough memory available for zlib", +"Z_MEM_ERROR: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)", +"Z_DATA_ERROR: Input data was corrupted for zlib", +"%d line(s) was(were) cut by group_concat()", +"Using storage engine %s for table '%s'", +"Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", diff --git a/sql/share/japanese/errmsg.txt b/sql/share/japanese/errmsg.txt index 6a5e7289908..82a8c23ab67 100644 --- a/sql/share/japanese/errmsg.txt +++ b/sql/share/japanese/errmsg.txt @@ -249,16 +249,18 @@ "Cyclic reference on subqueries", "Converting column '%s' from %s to %s", "Reference '%-.64s' not supported (%s)", -"Every derived table must have it's own alias" +"Every derived table must have it's own alias", "Select %u was reduced during optimisation", -"Table '%-.64s' from one of SELECT's can not be used in %-.32s" -"Client does not support authentication protocol requested by server. Consider upgrading MySQL client" -"All parts of a SPATIAL KEY must be NOT NULL" -"COLLATION '%s' is not valid for CHARACTER SET '%s'" -"The slave was already running" -"The slave was already stopped" -"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)" -"Z_BUF_ERROR: Not enough memory available for zlib" -"Z_MEM_ERROR: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)" -"Z_DATA_ERROR: Input data was corrupted for zlib" -"%d line(s) was(were) cut by group_concat()"
\ No newline at end of file +"Table '%-.64s' from one of SELECT's can not be used in %-.32s", +"Client does not support authentication protocol requested by server. Consider upgrading MySQL client", +"All parts of a SPATIAL KEY must be NOT NULL", +"COLLATION '%s' is not valid for CHARACTER SET '%s'", +"The slave was already running", +"The slave was already stopped", +"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)", +"Z_BUF_ERROR: Not enough memory available for zlib", +"Z_MEM_ERROR: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)", +"Z_DATA_ERROR: Input data was corrupted for zlib", +"%d line(s) was(were) cut by group_concat()", +"Using storage engine %s for table '%s'", +"Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", diff --git a/sql/share/korean/errmsg.txt b/sql/share/korean/errmsg.txt index b4810f2e47a..a96805c1dc5 100644 --- a/sql/share/korean/errmsg.txt +++ b/sql/share/korean/errmsg.txt @@ -247,16 +247,18 @@ "Cyclic reference on subqueries", "Converting column '%s' from %s to %s", "Reference '%-.64s' not supported (%s)", -"Every derived table must have it's own alias" +"Every derived table must have it's own alias", "Select %u was reduced during optimisation", -"Table '%-.64s' from one of SELECT's can not be used in %-.32s" -"Client does not support authentication protocol requested by server. Consider upgrading MySQL client" -"All parts of a SPATIAL KEY must be NOT NULL" -"COLLATION '%s' is not valid for CHARACTER SET '%s'" -"The slave was already running" -"The slave was already stopped" -"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)" -"Z_BUF_ERROR: Not enough memory available for zlib" -"Z_MEM_ERROR: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)" -"Z_DATA_ERROR: Input data was corrupted for zlib" -"%d line(s) was(were) cut by group_concat()"
\ No newline at end of file +"Table '%-.64s' from one of SELECT's can not be used in %-.32s", +"Client does not support authentication protocol requested by server. Consider upgrading MySQL client", +"All parts of a SPATIAL KEY must be NOT NULL", +"COLLATION '%s' is not valid for CHARACTER SET '%s'", +"The slave was already running", +"The slave was already stopped", +"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)", +"Z_BUF_ERROR: Not enough memory available for zlib", +"Z_MEM_ERROR: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)", +"Z_DATA_ERROR: Input data was corrupted for zlib", +"%d line(s) was(were) cut by group_concat()", +"Using storage engine %s for table '%s'", +"Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", diff --git a/sql/share/norwegian-ny/errmsg.txt b/sql/share/norwegian-ny/errmsg.txt index 405c093f7c0..31e2afa0cc9 100644 --- a/sql/share/norwegian-ny/errmsg.txt +++ b/sql/share/norwegian-ny/errmsg.txt @@ -249,16 +249,18 @@ "Cyclic reference on subqueries", "Converting column '%s' from %s to %s", "Reference '%-.64s' not supported (%s)", -"Every derived table must have it's own alias" +"Every derived table must have it's own alias", "Select %u was reduced during optimisation", -"Table '%-.64s' from one of SELECT's can not be used in %-.32s" -"Client does not support authentication protocol requested by server. Consider upgrading MySQL client" -"All parts of a SPATIAL KEY must be NOT NULL" -"COLLATION '%s' is not valid for CHARACTER SET '%s'" -"The slave was already running" -"The slave was already stopped" -"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)" -"Z_BUF_ERROR: Not enough memory available for zlib" -"Z_MEM_ERROR: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)" -"Z_DATA_ERROR: Input data was corrupted for zlib" -"%d line(s) was(were) cut by group_concat()"
\ No newline at end of file +"Table '%-.64s' from one of SELECT's can not be used in %-.32s", +"Client does not support authentication protocol requested by server. Consider upgrading MySQL client", +"All parts of a SPATIAL KEY must be NOT NULL", +"COLLATION '%s' is not valid for CHARACTER SET '%s'", +"The slave was already running", +"The slave was already stopped", +"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)", +"Z_BUF_ERROR: Not enough memory available for zlib", +"Z_MEM_ERROR: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)", +"Z_DATA_ERROR: Input data was corrupted for zlib", +"%d line(s) was(were) cut by group_concat()", +"Using storage engine %s for table '%s'", +"Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", diff --git a/sql/share/norwegian/errmsg.txt b/sql/share/norwegian/errmsg.txt index f52fa772e6e..2e1468bc815 100644 --- a/sql/share/norwegian/errmsg.txt +++ b/sql/share/norwegian/errmsg.txt @@ -249,16 +249,18 @@ "Cyclic reference on subqueries", "Converting column '%s' from %s to %s", "Reference '%-.64s' not supported (%s)", -"Every derived table must have it's own alias" +"Every derived table must have it's own alias", "Select %u was reduced during optimisation", -"Table '%-.64s' from one of SELECT's can not be used in %-.32s" -"Client does not support authentication protocol requested by server. Consider upgrading MySQL client" -"All parts of a SPATIAL KEY must be NOT NULL" -"COLLATION '%s' is not valid for CHARACTER SET '%s'" -"The slave was already running" -"The slave was already stopped" -"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)" -"Z_BUF_ERROR: Not enough memory available for zlib" -"Z_MEM_ERROR: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)" -"Z_DATA_ERROR: Input data was corrupted for zlib" -"%d line(s) was(were) cut by group_concat()"
\ No newline at end of file +"Table '%-.64s' from one of SELECT's can not be used in %-.32s", +"Client does not support authentication protocol requested by server. Consider upgrading MySQL client", +"All parts of a SPATIAL KEY must be NOT NULL", +"COLLATION '%s' is not valid for CHARACTER SET '%s'", +"The slave was already running", +"The slave was already stopped", +"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)", +"Z_BUF_ERROR: Not enough memory available for zlib", +"Z_MEM_ERROR: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)", +"Z_DATA_ERROR: Input data was corrupted for zlib", +"%d line(s) was(were) cut by group_concat()", +"Using storage engine %s for table '%s'", +"Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", diff --git a/sql/share/polish/errmsg.txt b/sql/share/polish/errmsg.txt index 89f7b359ffc..997ee08e66a 100644 --- a/sql/share/polish/errmsg.txt +++ b/sql/share/polish/errmsg.txt @@ -251,16 +251,18 @@ "Cyclic reference on subqueries", "Converting column '%s' from %s to %s", "Reference '%-.64s' not supported (%s)", -"Every derived table must have it's own alias" +"Every derived table must have it's own alias", "Select %u was reduced during optimisation", -"Table '%-.64s' from one of SELECT's can not be used in %-.32s" -"Client does not support authentication protocol requested by server. Consider upgrading MySQL client" -"All parts of a SPATIAL KEY must be NOT NULL" -"COLLATION '%s' is not valid for CHARACTER SET '%s'" -"The slave was already running" -"The slave was already stopped" -"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)" -"Z_BUF_ERROR: Not enough memory available for zlib" -"Z_MEM_ERROR: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)" -"Z_DATA_ERROR: Input data was corrupted for zlib" -"%d line(s) was(were) cut by group_concat()"
\ No newline at end of file +"Table '%-.64s' from one of SELECT's can not be used in %-.32s", +"Client does not support authentication protocol requested by server. Consider upgrading MySQL client", +"All parts of a SPATIAL KEY must be NOT NULL", +"COLLATION '%s' is not valid for CHARACTER SET '%s'", +"The slave was already running", +"The slave was already stopped", +"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)", +"Z_BUF_ERROR: Not enough memory available for zlib", +"Z_MEM_ERROR: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)", +"Z_DATA_ERROR: Input data was corrupted for zlib", +"%d line(s) was(were) cut by group_concat()", +"Using storage engine %s for table '%s'", +"Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", diff --git a/sql/share/portuguese/errmsg.txt b/sql/share/portuguese/errmsg.txt index fff7dadface..284334cbfbd 100644 --- a/sql/share/portuguese/errmsg.txt +++ b/sql/share/portuguese/errmsg.txt @@ -247,16 +247,18 @@ "Cyclic reference on subqueries", "Converting column '%s' from %s to %s", "Reference '%-.64s' not supported (%s)", -"Every derived table must have it's own alias" +"Every derived table must have it's own alias", "Select %u was reduced during optimisation", -"Table '%-.64s' from one of SELECT's can not be used in %-.32s" -"Client does not support authentication protocol requested by server. Consider upgrading MySQL client" -"All parts of a SPATIAL KEY must be NOT NULL" -"COLLATION '%s' is not valid for CHARACTER SET '%s'" -"The slave was already running" -"The slave was already stopped" -"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)" -"Z_BUF_ERROR: Not enough memory available for zlib" -"Z_MEM_ERROR: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)" -"Z_DATA_ERROR: Input data was corrupted for zlib" -"%d line(s) was(were) cut by group_concat()"
\ No newline at end of file +"Table '%-.64s' from one of SELECT's can not be used in %-.32s", +"Client does not support authentication protocol requested by server. Consider upgrading MySQL client", +"All parts of a SPATIAL KEY must be NOT NULL", +"COLLATION '%s' is not valid for CHARACTER SET '%s'", +"The slave was already running", +"The slave was already stopped", +"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)", +"Z_BUF_ERROR: Not enough memory available for zlib", +"Z_MEM_ERROR: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)", +"Z_DATA_ERROR: Input data was corrupted for zlib", +"%d line(s) was(were) cut by group_concat()", +"Using storage engine %s for table '%s'", +"Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", diff --git a/sql/share/romanian/errmsg.txt b/sql/share/romanian/errmsg.txt index 48a2d15d49e..1966b37bc72 100644 --- a/sql/share/romanian/errmsg.txt +++ b/sql/share/romanian/errmsg.txt @@ -251,16 +251,18 @@ "Cyclic reference on subqueries", "Converting column '%s' from %s to %s" "Reference '%-.64s' not supported (%s)", -"Every derived table must have it's own alias" +"Every derived table must have it's own alias", "Select %u was reduced during optimisation", -"Table '%-.64s' from one of SELECT's can not be used in %-.32s" -"Client does not support authentication protocol requested by server. Consider upgrading MySQL client" -"All parts of a SPATIAL KEY must be NOT NULL" -"COLLATION '%s' is not valid for CHARACTER SET '%s'" -"The slave was already running" -"The slave was already stopped" -"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)" -"Z_BUF_ERROR: Not enough memory available for zlib" -"Z_MEM_ERROR: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)" -"Z_DATA_ERROR: Input data was corrupted for zlib" -"%d line(s) was(were) cut by group_concat()" +"Table '%-.64s' from one of SELECT's can not be used in %-.32s", +"Client does not support authentication protocol requested by server. Consider upgrading MySQL client", +"All parts of a SPATIAL KEY must be NOT NULL", +"COLLATION '%s' is not valid for CHARACTER SET '%s'", +"The slave was already running", +"The slave was already stopped", +"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)", +"Z_BUF_ERROR: Not enough memory available for zlib", +"Z_MEM_ERROR: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)", +"Z_DATA_ERROR: Input data was corrupted for zlib", +"%d line(s) was(were) cut by group_concat()", +"Using storage engine %s for table '%s'", +"Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", diff --git a/sql/share/russian/errmsg.txt b/sql/share/russian/errmsg.txt index c21d4dd9422..3935aef82e3 100644 --- a/sql/share/russian/errmsg.txt +++ b/sql/share/russian/errmsg.txt @@ -249,16 +249,18 @@ "ãÉËÌÉÞÅÓËÁÑ ÓÓÙÌËÁ ÎÁ ÐÏÄÚÁÐÒÏÓ", "ðÒÅÏÂÒÁÚÏ×ÁÎÉÅ ÐÏÌÑ '%s' ÉÚ %s × %s", "óÓÙÌËÁ '%-.64s' ÎÅ ÐÏÄÄÅÒÖÉ×ÁÅÔÓÑ (%s)", -"Every derived table must have it's own alias" +"Every derived table must have it's own alias", "Select %u ÂÙÌ ÕÐÒÁÚÄÎÅÎ × ÐÒÏÃÅÓÓÅ ÏÐÔÉÍÉÚÁÃÉÉ", -"Table '%-.64s' from one of SELECT's can not be used in %-.32s" -"Client does not support authentication protocol requested by server. Consider upgrading MySQL client" -"All parts of a SPATIAL KEY must be NOT NULL" -"COLLATION '%s' is not valid for CHARACTER SET '%s'" -"The slave was already running" -"The slave was already stopped" -"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)" -"Z_BUF_ERROR: Not enough memory available for zlib" -"Z_MEM_ERROR: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)" -"Z_DATA_ERROR: Input data was corrupted for zlib" -"%d line(s) was(were) cut by group_concat()"
\ No newline at end of file +"Table '%-.64s' from one of SELECT's can not be used in %-.32s", +"Client does not support authentication protocol requested by server. Consider upgrading MySQL client", +"All parts of a SPATIAL KEY must be NOT NULL", +"COLLATION '%s' is not valid for CHARACTER SET '%s'", +"The slave was already running", +"The slave was already stopped", +"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)", +"Z_BUF_ERROR: Not enough memory available for zlib", +"Z_MEM_ERROR: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)", +"Z_DATA_ERROR: Input data was corrupted for zlib", +"%d line(s) was(were) cut by group_concat()", +"Using storage engine %s for table '%s'", +"Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", diff --git a/sql/share/serbian/errmsg.txt b/sql/share/serbian/errmsg.txt index 8e40e195d1a..d954e7998a2 100644 --- a/sql/share/serbian/errmsg.txt +++ b/sql/share/serbian/errmsg.txt @@ -243,16 +243,18 @@ "Cyclic reference on subqueries", "Converting column '%s' from %s to %s", "Reference '%-.64s' not supported (%s)", -"Every derived table must have it's own alias" +"Every derived table must have it's own alias", "Select %u was reduced during optimisation", -"Table '%-.64s' from one of SELECT's can not be used in %-.32s" -"Client does not support authentication protocol requested by server. Consider upgrading MySQL client" -"All parts of a SPATIAL KEY must be NOT NULL" -"COLLATION '%s' is not valid for CHARACTER SET '%s'" -"The slave was already running" -"The slave was already stopped" -"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)" -"Z_BUF_ERROR: Not enough memory available for zlib" -"Z_MEM_ERROR: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)" -"Z_DATA_ERROR: Input data was corrupted for zlib" -"%d line(s) was(were) cut by group_concat()"
\ No newline at end of file +"Table '%-.64s' from one of SELECT's can not be used in %-.32s", +"Client does not support authentication protocol requested by server. Consider upgrading MySQL client", +"All parts of a SPATIAL KEY must be NOT NULL", +"COLLATION '%s' is not valid for CHARACTER SET '%s'", +"The slave was already running", +"The slave was already stopped", +"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)", +"Z_BUF_ERROR: Not enough memory available for zlib", +"Z_MEM_ERROR: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)", +"Z_DATA_ERROR: Input data was corrupted for zlib", +"%d line(s) was(were) cut by group_concat()", +"Using storage engine %s for table '%s'", +"Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", diff --git a/sql/share/slovak/errmsg.txt b/sql/share/slovak/errmsg.txt index f49e31e8c57..db25f12ed13 100644 --- a/sql/share/slovak/errmsg.txt +++ b/sql/share/slovak/errmsg.txt @@ -255,16 +255,18 @@ "Cyclic reference on subqueries", "Converting column '%s' from %s to %s", "Reference '%-.64s' not supported (%s)", -"Every derived table must have it's own alias" +"Every derived table must have it's own alias", "Select %u was reduced during optimisation", -"Table '%-.64s' from one of SELECT's can not be used in %-.32s" -"Client does not support authentication protocol requested by server. Consider upgrading MySQL client" -"All parts of a SPATIAL KEY must be NOT NULL" -"COLLATION '%s' is not valid for CHARACTER SET '%s'" -"The slave was already running" -"The slave was already stopped" -"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)" -"Z_BUF_ERROR: Not enough memory available for zlib" -"Z_MEM_ERROR: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)" -"Z_DATA_ERROR: Input data was corrupted for zlib" -"%d line(s) was(were) cut by group_concat()"
\ No newline at end of file +"Table '%-.64s' from one of SELECT's can not be used in %-.32s", +"Client does not support authentication protocol requested by server. Consider upgrading MySQL client", +"All parts of a SPATIAL KEY must be NOT NULL", +"COLLATION '%s' is not valid for CHARACTER SET '%s'", +"The slave was already running", +"The slave was already stopped", +"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)", +"Z_BUF_ERROR: Not enough memory available for zlib", +"Z_MEM_ERROR: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)", +"Z_DATA_ERROR: Input data was corrupted for zlib", +"%d line(s) was(were) cut by group_concat()", +"Using storage engine %s for table '%s'", +"Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", diff --git a/sql/share/spanish/errmsg.txt b/sql/share/spanish/errmsg.txt index 67967c08404..44fb0a19640 100644 --- a/sql/share/spanish/errmsg.txt +++ b/sql/share/spanish/errmsg.txt @@ -248,16 +248,18 @@ "Cyclic reference on subqueries", "Converting column '%s' from %s to %s", "Reference '%-.64s' not supported (%s)", -"Every derived table must have it's own alias" +"Every derived table must have it's own alias", "Select %u was reduced during optimisation", -"Table '%-.64s' from one of SELECT's can not be used in %-.32s" -"Client does not support authentication protocol requested by server. Consider upgrading MySQL client" -"All parts of a SPATIAL KEY must be NOT NULL" -"COLLATION '%s' is not valid for CHARACTER SET '%s'" -"The slave was already running" -"The slave was already stopped" -"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)" -"Z_BUF_ERROR: Not enough memory available for zlib" -"Z_MEM_ERROR: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)" -"Z_DATA_ERROR: Input data was corrupted for zlib" -"%d line(s) was(were) cut by group_concat()"
\ No newline at end of file +"Table '%-.64s' from one of SELECT's can not be used in %-.32s", +"Client does not support authentication protocol requested by server. Consider upgrading MySQL client", +"All parts of a SPATIAL KEY must be NOT NULL", +"COLLATION '%s' is not valid for CHARACTER SET '%s'", +"The slave was already running", +"The slave was already stopped", +"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)", +"Z_BUF_ERROR: Not enough memory available for zlib", +"Z_MEM_ERROR: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)", +"Z_DATA_ERROR: Input data was corrupted for zlib", +"%d line(s) was(were) cut by group_concat()", +"Using storage engine %s for table '%s'", +"Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", diff --git a/sql/share/swedish/errmsg.txt b/sql/share/swedish/errmsg.txt index fbc423a90af..e40a44957f1 100644 --- a/sql/share/swedish/errmsg.txt +++ b/sql/share/swedish/errmsg.txt @@ -249,14 +249,16 @@ "Referens '%-.64s' stöds inte (%s)", "Varje 'derived table' måste ha sitt eget alias", "Select %u reducerades vid optimiering", -"Tabell '%-.64s' från en SELECT kan inte användas i %-.32s" -"Klienten stöder inte autentiseringsprotokollet som begärts av servern. Överväg uppgradering av klientprogrammet." -"Alla delar av en SPATIAL KEY måste vara NOT NULL" -"COLLATION '%s' är inte tillåtet för CHARACTER SET '%s'" -"Slaven har redan startat" -"Slaven har redan stoppat" -"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)" -"Z_BUF_ERROR: Not enough memory available for zlib" -"Z_MEM_ERROR: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)" -"Z_DATA_ERROR: Input data was corrupted for zlib" -"%d rad(er) kapades av group_concat()"
\ No newline at end of file +"Tabell '%-.64s' från en SELECT kan inte användas i %-.32s", +"Klienten stöder inte autentiseringsprotokollet som begärts av servern. Överväg uppgradering av klientprogrammet.", +"Alla delar av en SPATIAL KEY måste vara NOT NULL", +"COLLATION '%s' är inte tillåtet för CHARACTER SET '%s'", +"Slaven har redan startat", +"Slaven har redan stoppat", +"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)", +"Z_BUF_ERROR: Not enough memory available for zlib", +"Z_MEM_ERROR: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)", +"Z_DATA_ERROR: Input data was corrupted for zlib", +"%d rad(er) kapades av group_concat()", +"Använder handler %s för tabell '%s'", +"Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", diff --git a/sql/share/ukrainian/errmsg.txt b/sql/share/ukrainian/errmsg.txt index 7e023c8cc28..968327a1024 100644 --- a/sql/share/ukrainian/errmsg.txt +++ b/sql/share/ukrainian/errmsg.txt @@ -252,16 +252,18 @@ "ãÉË̦ÞÎÅ ÐÏÓÉÌÁÎÎÑ ÎÁ ЦÄÚÁÐÉÔ", "ðÅÒÅÔ×ÏÒÅÎÎÑ ÓÔÏ×ÂÃÁ '%s' Ú %s Õ %s", "ðÏÓÉÌÁÎÎÑ '%-.64s' ÎÅ ÐiÄÔÒÉÍÕÅÔÓÑ (%s)", -"Every derived table must have it's own alias" +"Every derived table must have it's own alias", "Select %u was ÓËÁÓÏ×ÁÎÏ ÐÒÉ ÏÐÔÉÍiÚÁÃii", -"Table '%-.64s' from one of SELECT's can not be used in %-.32s" -"Client does not support authentication protocol requested by server. Consider upgrading MySQL client" -"All parts of a SPATIAL KEY must be NOT NULL" -"COLLATION '%s' is not valid for CHARACTER SET '%s'" -"The slave was already running" -"The slave was already stopped" -"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)" -"Z_BUF_ERROR: Not enough memory available for zlib" -"Z_MEM_ERROR: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)" -"Z_DATA_ERROR: Input data was corrupted for zlib" -"%d line(s) was(were) cut by group_concat()"
\ No newline at end of file +"Table '%-.64s' from one of SELECT's can not be used in %-.32s", +"Client does not support authentication protocol requested by server. Consider upgrading MySQL client", +"All parts of a SPATIAL KEY must be NOT NULL", +"COLLATION '%s' is not valid for CHARACTER SET '%s'", +"The slave was already running", +"The slave was already stopped", +"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)", +"Z_BUF_ERROR: Not enough memory available for zlib", +"Z_MEM_ERROR: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)", +"Z_DATA_ERROR: Input data was corrupted for zlib", +"%d line(s) was(were) cut by group_concat()", +"Using storage engine %s for table '%s'", +"Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 4bed99489de..b6191b2061e 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -1281,7 +1281,7 @@ static bool update_user_table(THD *thd, const char *host, const char *user, my_error(ER_PASSWORD_NO_MATCH,MYF(0)); /* purecov: deadcode */ DBUG_RETURN(1); /* purecov: deadcode */ } - store_record(table,1); + store_record(table,record[1]); table->field[2]->store(new_password,(uint) strlen(new_password), &my_charset_latin1); if ((error=table->file->update_row(table->record[1],table->record[0]))) { @@ -1372,7 +1372,7 @@ static int replace_user_table(THD *thd, TABLE *table, const LEX_USER &combo, goto end; } old_row_exists = 0; - restore_record(table,2); // cp empty row from record[2] + restore_record(table,default_values); // cp empty row from default_values table->field[0]->store(combo.host.str,combo.host.length, &my_charset_latin1); table->field[1]->store(combo.user.str,combo.user.length, &my_charset_latin1); table->field[2]->store(password,(uint) strlen(password), &my_charset_latin1); @@ -1380,7 +1380,7 @@ static int replace_user_table(THD *thd, TABLE *table, const LEX_USER &combo, else { old_row_exists = 1; - store_record(table,1); // Save copy for update + store_record(table,record[1]); // Save copy for update if (combo.password.str) // If password given table->field[2]->store(password,(uint) strlen(password), &my_charset_latin1); } @@ -1455,7 +1455,7 @@ static int replace_user_table(THD *thd, TABLE *table, const LEX_USER &combo, We should NEVER delete from the user table, as a uses can still use mysqld even if he doesn't have any privileges in the user table! */ - if (cmp_record(table,1) && + if (cmp_record(table,record[1]) && (error=table->file->update_row(table->record[1],table->record[0]))) { // This should never happen table->file->print_error(error,MYF(0)); /* purecov: deadcode */ @@ -1539,7 +1539,7 @@ static int replace_db_table(TABLE *table, const char *db, goto abort; } old_row_exists = 0; - restore_record(table,2); // cp empty row from record[2] + restore_record(table,default_values); // cp empty row from default_values table->field[0]->store(combo.host.str,combo.host.length, &my_charset_latin1); table->field[1]->store(db,(uint) strlen(db), &my_charset_latin1); table->field[2]->store(combo.user.str,combo.user.length, &my_charset_latin1); @@ -1547,7 +1547,7 @@ static int replace_db_table(TABLE *table, const char *db, else { old_row_exists = 1; - store_record(table,1); + store_record(table,record[1]); } store_rights=get_rights_for_db(rights); @@ -1827,7 +1827,7 @@ static int replace_column_table(GRANT_TABLE *g_t, continue; /* purecov: inspected */ } old_row_exists = 0; - restore_record(table,2); // Get empty record + restore_record(table,default_values); // Get empty record key_restore(table,key,0,key_length); table->field[4]->store(xx->column.ptr(),xx->column.length(), &my_charset_latin1); } @@ -1841,7 +1841,7 @@ static int replace_column_table(GRANT_TABLE *g_t, else privileges |= tmp; old_row_exists = 1; - store_record(table,1); // copy original row + store_record(table,record[1]); // copy original row } table->field[6]->store((longlong) get_rights_for_column(privileges)); @@ -1895,7 +1895,7 @@ static int replace_column_table(GRANT_TABLE *g_t, { ulong privileges = (ulong) table->field[6]->val_int(); privileges=fix_rights_for_column(privileges); - store_record(table,1); + store_record(table,record[1]); if (privileges & rights) // is in this record the priv to be revoked ?? { @@ -1970,12 +1970,12 @@ static int replace_table_table(THD *thd, GRANT_TABLE *grant_table, DBUG_RETURN(-1); /* purecov: deadcode */ } - restore_record(table,2); // Get empty record + restore_record(table,default_values); // Get empty record table->field[0]->store(combo.host.str,combo.host.length, &my_charset_latin1); table->field[1]->store(db,(uint) strlen(db), &my_charset_latin1); table->field[2]->store(combo.user.str,combo.user.length, &my_charset_latin1); table->field[3]->store(table_name,(uint) strlen(table_name), &my_charset_latin1); - store_record(table,1); // store at pos 1 + store_record(table,record[1]); // store at pos 1 if (table->file->index_read_idx(table->record[0],0, (byte*) table->field[0]->ptr,0, @@ -1995,7 +1995,7 @@ static int replace_table_table(THD *thd, GRANT_TABLE *grant_table, DBUG_RETURN(-1); /* purecov: deadcode */ } old_row_exists = 0; - restore_record(table,1); // Get saved record + restore_record(table,record[1]); // Get saved record } store_table_rights= get_rights_for_table(rights); @@ -2003,7 +2003,7 @@ static int replace_table_table(THD *thd, GRANT_TABLE *grant_table, if (old_row_exists) { ulong j,k; - store_record(table,1); + store_record(table,record[1]); j = (ulong) table->field[6]->val_int(); k = (ulong) table->field[7]->val_int(); @@ -2516,7 +2516,7 @@ bool check_grant(THD *thd, ulong want_access, TABLE_LIST *tables, rw_rdlock(&LOCK_grant); for (table=tables; table ;table=table->next) { - if (!(~table->grant.privilege & want_access)) + if (!(~table->grant.privilege & want_access) || table->derived) { table->grant.want_privilege=0; continue; // Already checked diff --git a/sql/sql_base.cc b/sql/sql_base.cc index e374cdb3696..fc95f5deb40 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -1906,9 +1906,9 @@ find_item_in_list(Item *find, List<Item> &items, uint *counter, } } else if (!table_name && (item->eq(find,0) || - find->name && - !my_strcasecmp(system_charset_info, - item->name,find->name))) + find->name && + !my_strcasecmp(system_charset_info, + item->name,find->name))) { found= li.ref(); *counter= i; diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 05abc25143b..a3e11d9d1c6 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -184,6 +184,15 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, thd->proc_info="init"; thd->used_tables=0; values= its++; + + if (duplic == DUP_UPDATE && !table->insert_values) + { + /* it should be allocated before Item::fix_fields() */ + table->insert_values=alloc_root(&table->mem_root, table->rec_buff_length); + if (!table->insert_values) + goto abort; + } + if (check_insert_fields(thd,table,fields,*values,1) || setup_tables(insert_table_list) || setup_fields(thd, 0, insert_table_list, *values, 0, 0, 0) || @@ -248,7 +257,7 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, { if (fields.elements || !value_count) { - restore_record(table,2); // Get empty record + restore_record(table,default_values); // Get empty record if (fill_record(fields,*values)|| thd->net.report_error || check_null_fields(thd,table)) { @@ -264,9 +273,9 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, else { if (thd->used_tables) // Column used in values() - restore_record(table,2); // Get empty record + restore_record(table,default_values); // Get empty record else - table->record[0][0]=table->record[2][0]; // Fix delete marker + table->record[0][0]=table->default_values[0]; // Fix delete marker if (fill_record(table->field,*values) || thd->net.report_error) { if (values_list.elements != 1 && ! thd->net.report_error) @@ -334,7 +343,7 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, thd->insert_id(id); // For update log else if (table->next_number_field) id=table->next_number_field->val_int(); // Return auto_increment value - + transactional_table= table->file->has_transactions(); log_delayed= (transactional_table || table->tmp_table); if ((info.copied || info.deleted) && (error <= 0 || !transactional_table)) @@ -384,7 +393,7 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, char buff[160]; if (duplic == DUP_IGNORE) sprintf(buff,ER(ER_INSERT_INFO),info.records, - (lock_type == TL_WRITE_DELAYED) ? 0 : + (lock_type == TL_WRITE_DELAYED) ? 0 : info.records-info.copied, thd->cuted_fields); else @@ -393,12 +402,14 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, ::send_ok(thd,info.copied+info.deleted,(ulonglong)id,buff); } free_underlaid_joins(thd, &thd->lex.select_lex); + table->insert_values=0; DBUG_RETURN(0); abort: if (lock_type == TL_WRITE_DELAYED) end_delayed_insert(thd); free_underlaid_joins(thd, &thd->lex.select_lex); + table->insert_values=0; DBUG_RETURN(-1); } @@ -483,7 +494,8 @@ int write_record(TABLE *table,COPY_INFO *info) that matches, is updated. If update causes a conflict again, an error is returned */ - restore_record(table,1); + store_record(table,insert_values); + restore_record(table,record[1]); if (fill_record(*info->update_fields,*info->update_values)) goto err; if ((error=table->file->update_row(table->record[1],table->record[0]))) @@ -1350,7 +1362,7 @@ select_insert::prepare(List<Item> &values, SELECT_LEX_UNIT *u) if (check_insert_fields(thd,table,*fields,values,1)) DBUG_RETURN(1); - restore_record(table,2); // Get empty record + restore_record(table,default_values); // Get empty record table->next_number_field=table->found_next_number_field; thd->count_cuted_fields=1; // calc cuted fields thd->cuted_fields=0; @@ -1481,7 +1493,7 @@ select_create::prepare(List<Item> &values, SELECT_LEX_UNIT *u) } table->next_number_field=table->found_next_number_field; - restore_record(table,2); // Get empty record + restore_record(table,default_values); // Get empty record thd->count_cuted_fields=1; // count warnings thd->cuted_fields=0; if (info.handle_duplicates == DUP_IGNORE || diff --git a/sql/sql_lex.h b/sql/sql_lex.h index e03814bcd2f..f31b3305e07 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -481,7 +481,7 @@ typedef struct st_lex uint fk_delete_opt, fk_update_opt, fk_match_option; uint param_count; bool drop_primary, drop_if_exists, drop_temporary, local_file; - bool in_comment, ignore_space, verbose, simple_alter; + bool in_comment, ignore_space, verbose, simple_alter, no_write_to_binlog; bool derived_tables, describe; bool safe_to_cache_query; uint slave_thd_opt; diff --git a/sql/sql_list.h b/sql/sql_list.h index 6eb4f98c011..f4cca627515 100644 --- a/sql/sql_list.h +++ b/sql/sql_list.h @@ -319,7 +319,8 @@ template <class T> class I_List_iterator; class base_ilist { public: struct ilink *first,last; - base_ilist() { first= &last; last.prev= &first; } + inline void empty() { first= &last; last.prev= &first; } + base_ilist() { empty(); } inline bool is_empty() { return first == &last; } inline void append(ilink *a) { diff --git a/sql/sql_load.cc b/sql/sql_load.cc index c9c0e36ff7b..fa2321a1e9d 100644 --- a/sql/sql_load.cc +++ b/sql/sql_load.cc @@ -238,7 +238,7 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list, lf_info.log_delayed= log_delayed; read_info.set_io_cache_arg((void*) &lf_info); } - restore_record(table,2); + restore_record(table,default_values); thd->count_cuted_fields=1; /* calc cuted fields */ thd->cuted_fields=0L; diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index e8f142ca4c3..815068ff470 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1391,8 +1391,10 @@ restore_user: if (check_global_access(thd,RELOAD_ACL)) break; mysql_log.write(thd,command,NullS); - /* error sending is deferred to reload_acl_and_cache */ - reload_acl_and_cache(thd, options, (TABLE_LIST*) 0) ; + if (reload_acl_and_cache(thd, options, (TABLE_LIST*) 0, NULL)) + send_error(thd, 0); + else + send_ok(thd); break; } #ifndef EMBEDDED_LIBRARY @@ -2164,6 +2166,16 @@ mysql_execute_command(THD *thd) check_table_access(thd,SELECT_ACL | INSERT_ACL, tables)) goto error; /* purecov: inspected */ res = mysql_repair_table(thd, tables, &lex->check_opt); + /* ! we write after unlocking the table */ + if (!res && !lex->no_write_to_binlog) + { + mysql_update_log.write(thd, thd->query, thd->query_length); + if (mysql_bin_log.is_open()) + { + Query_log_event qinfo(thd, thd->query, thd->query_length, 0); + mysql_bin_log.write(&qinfo); + } + } break; } case SQLCOM_CHECK: @@ -2180,6 +2192,16 @@ mysql_execute_command(THD *thd) check_table_access(thd,SELECT_ACL | INSERT_ACL, tables)) goto error; /* purecov: inspected */ res = mysql_analyze_table(thd, tables, &lex->check_opt); + /* ! we write after unlocking the table */ + if (!res && !lex->no_write_to_binlog) + { + mysql_update_log.write(thd, thd->query, thd->query_length); + if (mysql_bin_log.is_open()) + { + Query_log_event qinfo(thd, thd->query, thd->query_length, 0); + mysql_bin_log.write(&qinfo); + } + } break; } @@ -2209,6 +2231,16 @@ mysql_execute_command(THD *thd) } else res = mysql_optimize_table(thd, tables, &lex->check_opt); + /* ! we write after unlocking the table */ + if (!res && !lex->no_write_to_binlog) + { + mysql_update_log.write(thd, thd->query, thd->query_length); + if (mysql_bin_log.is_open()) + { + Query_log_event qinfo(thd, thd->query, thd->query_length, 0); + mysql_bin_log.write(&qinfo); + } + } break; } case SQLCOM_UPDATE: @@ -2217,7 +2249,9 @@ mysql_execute_command(THD *thd) goto error; for (table=tables ; table ; table=table->next) { - if (check_access(thd,UPDATE_ACL,table->db,&table->grant.privilege)) + if (table->derived) + table->grant.privilege= SELECT_ACL; + else if (check_access(thd,UPDATE_ACL,table->db,&table->grant.privilege)) goto error; } if (grant_option && check_grant(thd,UPDATE_ACL,tables)) @@ -2892,13 +2926,42 @@ mysql_execute_command(THD *thd) } break; } - case SQLCOM_FLUSH: case SQLCOM_RESET: + /* + RESET commands are never written to the binary log, so we have to + initialize this variable because RESET shares the same code as FLUSH + */ + lex->no_write_to_binlog= 1; + case SQLCOM_FLUSH: + { if (check_global_access(thd,RELOAD_ACL) || check_db_used(thd, tables)) goto error; - /* error sending is deferred to reload_acl_and_cache */ - reload_acl_and_cache(thd, lex->type, tables); + /* + reload_acl_and_cache() will tell us if we are allowed to write to the + binlog or not. + */ + bool write_to_binlog; + if (reload_acl_and_cache(thd, lex->type, tables, &write_to_binlog)) + send_error(thd, 0); + else + { + /* + We WANT to write and we CAN write. + ! we write after unlocking the table. + */ + if (!lex->no_write_to_binlog && write_to_binlog) + { + mysql_update_log.write(thd, thd->query, thd->query_length); + if (mysql_bin_log.is_open()) + { + Query_log_event qinfo(thd, thd->query, thd->query_length, 0); + mysql_bin_log.write(&qinfo); + } + } + send_ok(thd); + } break; + } case SQLCOM_KILL: kill_one_thread(thd,lex->thread_id); break; @@ -3956,14 +4019,31 @@ void add_join_natural(TABLE_LIST *a,TABLE_LIST *b) /* - Reload/resets privileges and the different caches + Reload/resets privileges and the different caches. + + SYNOPSIS + reload_acl_and_cache() + thd Thread handler + options What should be reset/reloaded (tables, privileges, + slave...) + tables Tables to flush (if any) + write_to_binlog Depending on 'options', it may be very bad to write the + query to the binlog (e.g. FLUSH SLAVE); this is a + pointer where, if it is not NULL, reload_acl_and_cache() + will put 0 if it thinks we really should not write to + the binlog. Otherwise it will put 1. + + RETURN + 0 ok + !=0 error */ -bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables) +bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables, + bool *write_to_binlog) { bool result=0; - bool error_already_sent=0; select_errors=0; /* Write if more errors */ + bool tmp_write_to_binlog= 1; if (options & REFRESH_GRANT) { acl_reload(thd); @@ -3973,6 +4053,12 @@ bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables) } if (options & REFRESH_LOG) { + /* + Writing this command to the binlog may result in infinite loops when doing + mysqlbinlog|mysql, and anyway it does not really make sense to log it + automatically (would cause more trouble to users than it would help them) + */ + tmp_write_to_binlog= 0; mysql_log.new_file(1); mysql_update_log.new_file(1); mysql_bin_log.new_file(1); @@ -4001,10 +4087,16 @@ bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables) query_cache.flush(); // RESET QUERY CACHE } #endif /*HAVE_QUERY_CACHE*/ - if (options & (REFRESH_TABLES | REFRESH_READ_LOCK)) + /* + Note that if REFRESH_READ_LOCK bit is set then REFRESH_TABLES is set too + (see sql_yacc.yy) + */ + if (options & (REFRESH_TABLES | REFRESH_READ_LOCK)) { if ((options & REFRESH_READ_LOCK) && thd) { + // writing to the binlog could cause deadlocks, as we don't log UNLOCK TABLES + tmp_write_to_binlog= 0; if (lock_global_read_lock(thd)) return 1; } @@ -4018,8 +4110,11 @@ bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables) flush_thread_cache(); #ifndef EMBEDDED_LIBRARY if (options & REFRESH_MASTER) + { + tmp_write_to_binlog= 0; if (reset_master(thd)) result=1; + } #endif #ifdef OPENSSL if (options & REFRESH_DES_KEY_FILE) @@ -4031,32 +4126,17 @@ bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables) #ifndef EMBEDDED_LIBRARY if (options & REFRESH_SLAVE) { + tmp_write_to_binlog= 0; LOCK_ACTIVE_MI; if (reset_slave(thd, active_mi)) - { result=1; - /* - reset_slave() sends error itself. - If it didn't, one would either change reset_slave()'s prototype, to - pass *errorcode and *errmsg to it when it's called or - change reset_slave to use my_error() to register the error. - */ - error_already_sent=1; - } UNLOCK_ACTIVE_MI; } #endif if (options & REFRESH_USER_RESOURCES) reset_mqh(thd,(LEX_USER *) NULL); - - if (thd && !error_already_sent) - { - if (result) - send_error(thd,0); - else - send_ok(thd); - } - + if (write_to_binlog) + *write_to_binlog= tmp_write_to_binlog; return result; } diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index 0eb444b85c0..a39541b0fc5 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -746,16 +746,9 @@ int stop_slave(THD* thd, MASTER_INFO* mi, bool net_report ) thd Thread handler mi Master info for the slave - - NOTES - We don't send ok in this functions as this is called from - reload_acl_and_cache() which may have done other tasks, which may - have failed for which we want to send and error. - RETURN 0 ok 1 error - In this case error is sent to the client with send_error() */ @@ -804,8 +797,8 @@ int reset_slave(THD *thd, MASTER_INFO* mi) err: unlock_slave_threads(mi); - if (thd && error) - send_error(thd, sql_errno, errmsg); + if (error) + my_error(sql_errno, MYF(0), errmsg); DBUG_RETURN(error); } diff --git a/sql/sql_select.cc b/sql/sql_select.cc index cc513433aaf..bc58fc534a2 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -868,12 +868,14 @@ JOIN::reinit() exec_tmp_table1->file->extra(HA_EXTRA_RESET_STATE); exec_tmp_table1->file->delete_all_rows(); free_io_cache(exec_tmp_table1); + filesort_free_buffers(exec_tmp_table1); } if (exec_tmp_table2) { exec_tmp_table2->file->extra(HA_EXTRA_RESET_STATE); exec_tmp_table2->file->delete_all_rows(); free_io_cache(exec_tmp_table2); + filesort_free_buffers(exec_tmp_table2); } if (items0) memcpy(ref_pointer_array, items0, ref_pointer_array_size); @@ -2319,7 +2321,8 @@ find_best(JOIN *join,table_map rest_tables,uint idx,double record_count, we don't make rec less than 100. */ if (keyuse->used_tables & - (map=(keyuse->used_tables & ~join->const_table_map))) + (map=(keyuse->used_tables & ~join->const_table_map & + ~OUTER_REF_TABLE_BIT))) { uint tablenr; for (tablenr=0 ; ! (map & 1) ; map>>=1, tablenr++) ; @@ -2631,7 +2634,7 @@ static double prev_record_reads(JOIN *join,table_map found_ref) { double found=1.0; - + found_ref&= ~OUTER_REF_TABLE_BIT; for (POSITION *pos=join->positions ; found_ref ; pos++) { if (pos->table->table->map & found_ref) @@ -2665,7 +2668,7 @@ get_best_combination(JOIN *join) join->full_join=0; - used_tables=0; + used_tables= OUTER_REF_TABLE_BIT; // Outer row is already read for (j=join_tab, tablenr=0 ; tablenr < table_count ; tablenr++,j++) { TABLE *form; @@ -2936,7 +2939,8 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond) DBUG_RETURN(1); // Impossible const condition } } - used_tables=(select->const_tables=join->const_table_map) | RAND_TABLE_BIT; + used_tables=((select->const_tables=join->const_table_map) | + OUTER_REF_TABLE_BIT | RAND_TABLE_BIT); for (uint i=join->const_tables ; i < join->tables ; i++) { JOIN_TAB *tab=join->join_tab+i; @@ -2946,7 +2950,7 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond) It solve problem with select like SELECT * FROM t1 WHERE rand() > 0.5 */ if (i == join->tables-1) - current_map|= RAND_TABLE_BIT; + current_map|= OUTER_REF_TABLE_BIT | RAND_TABLE_BIT; bool use_quick_range=0; used_tables|=current_map; @@ -3265,7 +3269,10 @@ join_free(JOIN *join, bool full) first non const table in join->table */ if (join->tables > join->const_tables) // Test for not-const tables + { free_io_cache(join->table[join->const_tables]); + filesort_free_buffers(join->table[join->const_tables]); + } if (join->select_lex->dependent && !full) { for (tab=join->join_tab,end=tab+join->tables ; tab != end ; tab++) @@ -3429,7 +3436,8 @@ static void update_depend_map(JOIN *join) uint i; for (i=0 ; i < ref->key_parts ; i++,item++) depend_map|=(*item)->used_tables(); - ref->depend_map=depend_map; + ref->depend_map=depend_map & ~OUTER_REF_TABLE_BIT; + depend_map&= ~OUTER_REF_TABLE_BIT; for (JOIN_TAB **tab=join->map2table; depend_map ; tab++,depend_map>>=1 ) @@ -3450,7 +3458,8 @@ static void update_depend_map(JOIN *join, ORDER *order) table_map depend_map; order->item[0]->update_used_tables(); order->depend_map=depend_map=order->item[0]->used_tables(); - if (!(order->depend_map & RAND_TABLE_BIT)) // Not item_sum() or RAND() + // Not item_sum(), RAND() and no reference to table outside of sub select + if (!(order->depend_map & (OUTER_REF_TABLE_BIT | RAND_TABLE_BIT))) { for (JOIN_TAB **tab=join->map2table; depend_map ; @@ -3497,7 +3506,7 @@ remove_const(JOIN *join,ORDER *first_order, COND *cond, bool *simple_order) } else { - if (order_tables & RAND_TABLE_BIT) + if (order_tables & (RAND_TABLE_BIT | OUTER_REF_TABLE_BIT)) *simple_order=0; else { @@ -4376,7 +4385,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields, if (!(table->record[0]= (byte *) my_malloc(alloc_length*3, MYF(MY_WME)))) goto err; table->record[1]= table->record[0]+alloc_length; - table->record[2]= table->record[1]+alloc_length; + table->default_values= table->record[1]+alloc_length; } copy_func[0]=0; // End marker @@ -4450,7 +4459,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields, param->copy_field_end=copy; param->recinfo=recinfo; - store_record(table,2); // Make empty default record + store_record(table,default_values); // Make empty default record if (thd->variables.tmp_table_size == ~(ulong) 0) // No limit table->max_rows= ~(ha_rows) 0; @@ -5055,7 +5064,7 @@ sub_select(JOIN *join,JOIN_TAB *join_tab,bool end_of_records) if (!found && on_expr) { // OUTER JOIN - restore_record(join_tab->table,2); // Make empty record + restore_record(join_tab->table,default_values); // Make empty record mark_as_null_row(join_tab->table); // For group by without error if (!select_cond || select_cond->val_int()) { @@ -5201,10 +5210,10 @@ join_read_system(JOIN_TAB *tab) empty_record(table); // Make empty record return -1; } - store_record(table,1); + store_record(table,record[1]); } else if (!table->status) // Only happens with left join - restore_record(table,1); // restore old record + restore_record(table,record[1]); // restore old record table->null_row=0; return table->status ? -1 : 0; } @@ -5241,12 +5250,12 @@ join_read_const(JOIN_TAB *tab) } return -1; } - store_record(table,1); + store_record(table,record[1]); } else if (!(table->status & ~STATUS_NULL_ROW)) // Only happens with left join { table->status=0; - restore_record(table,1); // restore old record + restore_record(table,record[1]); // restore old record } table->null_row=0; return table->status ? -1 : 0; @@ -5843,7 +5852,7 @@ end_update(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)), join->tmp_table_param.group_buff,0, HA_READ_KEY_EXACT)) { /* Update old record */ - restore_record(table,1); + restore_record(table,record[1]); update_tmptable_sum_func(join->sum_funcs,table); if ((error=table->file->update_row(table->record[1], table->record[0]))) @@ -5912,7 +5921,7 @@ end_unique_update(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)), table->file->print_error(error,MYF(0)); /* purecov: inspected */ DBUG_RETURN(-1); /* purecov: inspected */ } - restore_record(table,1); + restore_record(table,record[1]); update_tmptable_sum_func(join->sum_funcs,table); if ((error=table->file->update_row(table->record[1], table->record[0]))) @@ -7430,7 +7439,7 @@ get_sort_by_table(ORDER *a,ORDER *b,TABLE_LIST *tables) DBUG_RETURN(0); map|=a->item[0]->used_tables(); } - if (!map || (map & RAND_TABLE_BIT)) + if (!map || (map & (RAND_TABLE_BIT | OUTER_REF_TABLE_BIT))) DBUG_RETURN(0); for (; !(map & tables->table->map) ; tables=tables->next) ; diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 8d6eccae87a..2b8982f2484 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -694,7 +694,7 @@ mysqld_show_fields(THD *thd, TABLE_LIST *table_list,const char *wild, if (protocol->send_records_num(&field_list, (ulonglong)file->records) || protocol->send_fields(&field_list,0)) DBUG_RETURN(1); - restore_record(table,2); // Get empty record + restore_record(table,default_values); // Get empty record Field **ptr,*field; String *packet= &thd->packet; @@ -959,7 +959,7 @@ mysqld_list_fields(THD *thd, TABLE_LIST *table_list, const char *wild) !wild_case_compare(system_charset_info, field->field_name,wild)) field_list.push_back(new Item_field(field)); } - restore_record(table,2); // Get empty record + restore_record(table,default_values); // Get empty record if (thd->protocol->send_fields(&field_list,2)) DBUG_VOID_RETURN; net_flush(&thd->net); @@ -1041,7 +1041,7 @@ store_create_info(THD *thd, TABLE *table, String *packet) DBUG_ENTER("store_create_info"); DBUG_PRINT("enter",("table: %s",table->real_name)); - restore_record(table,2); // Get empty record + restore_record(table,default_values); // Get empty record List<Item> field_list; char tmp[MAX_FIELD_WIDTH]; diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 3dad653d644..cbd09d83a72 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -382,6 +382,7 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name, int auto_increment=0; handler *file; int field_no,dup_no; + enum db_type new_db_type; DBUG_ENTER("mysql_create_table"); /* @@ -396,6 +397,16 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name, List_iterator<create_field> it(fields),it2(fields); int select_field_pos=fields.elements - select_field_count; null_fields=blob_columns=0; + if ((new_db_type= ha_checktype(create_info->db_type)) != + create_info->db_type) + { + create_info->db_type= new_db_type; + push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN, + ER_WARN_USING_OTHER_HANDLER, + ER(ER_WARN_USING_OTHER_HANDLER), + ha_table_typelib.type_names[new_db_type], + table_name); + } db_options=create_info->table_options; if (create_info->row_type == ROW_TYPE_DYNAMIC) db_options|=HA_OPTION_PACK_RECORD; @@ -488,8 +499,8 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name, case FIELD_TYPE_GEOMETRY: if (!(file->table_flags() & HA_HAS_GEOMETRY)) { - my_printf_error(ER_WRONG_USAGE,ER(ER_WRONG_USAGE),MYF(0), - "GEOMETRY FIELD TYPE","not supported by this storage engine "); + my_printf_error(ER_CHECK_NOT_IMPLEMENTED, ER(ER_CHECK_NOT_IMPLEMENTED), + MYF(0), "GEOMETRY"); DBUG_RETURN(-1); } sql_field->pack_flag=FIELDFLAG_GEOM | @@ -1702,7 +1713,16 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name, old_db_type=table->db_type; if (create_info->db_type == DB_TYPE_DEFAULT) create_info->db_type=old_db_type; - new_db_type=create_info->db_type= ha_checktype(create_info->db_type); + if ((new_db_type= ha_checktype(create_info->db_type)) != + create_info->db_type) + { + create_info->db_type= new_db_type; + push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN, + ER_WARN_USING_OTHER_HANDLER, + ER(ER_WARN_USING_OTHER_HANDLER), + ha_table_typelib.type_names[new_db_type], + new_name); + } if (create_info->row_type == ROW_TYPE_NOT_USED) create_info->row_type=table->row_type; @@ -1762,7 +1782,7 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name, } /* Full alter table */ - restore_record(table,2); // Empty record for DEFAULT + restore_record(table,default_values); // Empty record for DEFAULT List_iterator<Alter_drop> drop_it(drop_list); List_iterator<create_field> def_it(fields); List_iterator<Alter_column> alter_it(alter_list); diff --git a/sql/sql_udf.cc b/sql/sql_udf.cc index 42f4dddea8d..d191550f396 100644 --- a/sql/sql_udf.cc +++ b/sql/sql_udf.cc @@ -429,7 +429,7 @@ int mysql_create_function(THD *thd,udf_func *udf) if (!(table = open_ltable(thd,&tables,TL_WRITE))) goto err; - restore_record(table,2); // Get default values for fields + restore_record(table,default_values); // Get default values for fields table->field[0]->store(u_d->name.str, u_d->name.length, system_charset_info); table->field[1]->store((longlong) u_d->returns); table->field[2]->store(u_d->dl,(uint) strlen(u_d->dl), system_charset_info); diff --git a/sql/sql_update.cc b/sql/sql_update.cc index 8b36dce1d23..a1464aa509f 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -30,7 +30,7 @@ static bool safe_update_on_fly(JOIN_TAB *join_tab, List<Item> *fields); static bool compare_record(TABLE *table, ulong query_id) { if (!table->blob_fields) - return cmp_record(table,1); + return cmp_record(table,record[1]); /* Compare null bits */ if (memcmp(table->null_flags, table->null_flags+table->rec_buff_length, @@ -288,7 +288,7 @@ int mysql_update(THD *thd, { if (!(select && select->skipp_record())) { - store_record(table,1); + store_record(table,record[1]); if (fill_record(fields,values) || thd->net.report_error) break; /* purecov: inspected */ found++; @@ -732,7 +732,7 @@ bool multi_update::send_data(List<Item> ¬_used_values) if (table == table_to_update) { table->status|= STATUS_UPDATED; - store_record(table,1); + store_record(table,record[1]); if (fill_record(*fields_for_table[offset], *values_for_table[offset])) DBUG_RETURN(1); found++; @@ -864,7 +864,7 @@ int multi_update::do_updates(bool from_send_error) if ((local_error= table->file->rnd_pos(table->record[0], ref_pos))) goto err; table->status|= STATUS_UPDATED; - store_record(table,1); + store_record(table,record[1]); /* Copy data from temporary table to current table */ for (copy_field_ptr=copy_field; diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 71035a75084..e3b2c738949 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -381,6 +381,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize); %token WHERE %token WITH %token WRITE_SYM +%token NO_WRITE_TO_BINLOG %token X509_SYM %token XOR %token COMPRESSED_SYM @@ -582,7 +583,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize); %type <num> type int_type real_type order_dir opt_field_spec lock_option udf_type if_exists opt_local opt_table_options table_options - table_option opt_if_not_exists opt_var_type opt_var_ident_type + table_option opt_if_not_exists opt_no_write_to_binlog opt_var_type opt_var_ident_type delete_option opt_temporary all_or_any opt_distinct %type <ulong_num> @@ -909,7 +910,13 @@ create2: if (!(lex->name= (char *)$2)) YYABORT; } - ; + | '(' LIKE table_ident ')' + { + LEX *lex=Lex; + if (!(lex->name= (char *)$3)) + YYABORT; + } + ; create3: /* empty */ {} @@ -1712,10 +1719,11 @@ backup: }; repair: - REPAIR table_or_tables + REPAIR opt_no_write_to_binlog table_or_tables { LEX *lex=Lex; lex->sql_command = SQLCOM_REPAIR; + lex->no_write_to_binlog= $2; lex->check_opt.init(); } table_list opt_mi_repair_type @@ -1736,10 +1744,11 @@ mi_repair_type: | USE_FRM { Lex->check_opt.sql_flags|= TT_USEFRM; }; analyze: - ANALYZE_SYM table_or_tables + ANALYZE_SYM opt_no_write_to_binlog table_or_tables { LEX *lex=Lex; lex->sql_command = SQLCOM_ANALYZE; + lex->no_write_to_binlog= $2; lex->check_opt.init(); } table_list opt_mi_check_type @@ -1773,16 +1782,23 @@ mi_check_type: | CHANGED { Lex->check_opt.flags|= T_CHECK_ONLY_CHANGED; }; optimize: - OPTIMIZE table_or_tables + OPTIMIZE opt_no_write_to_binlog table_or_tables { LEX *lex=Lex; lex->sql_command = SQLCOM_OPTIMIZE; + lex->no_write_to_binlog= $2; lex->check_opt.init(); } table_list opt_mi_check_type {} ; +opt_no_write_to_binlog: + /* empty */ { $$= 0; } + | NO_WRITE_TO_BINLOG { $$= 1; } + | LOCAL_SYM { $$= 1; } + ; + rename: RENAME table_or_tables { @@ -2174,12 +2190,12 @@ simple_expr: | '@' ident_or_text SET_VAR expr { $$= new Item_func_set_user_var($2,$4); - Lex->uncacheable();; + Lex->uncacheable(); } | '@' ident_or_text { $$= new Item_func_get_user_var($2); - Lex->uncacheable();; + Lex->uncacheable(); } | '@' '@' opt_var_ident_type ident_or_text { @@ -2227,6 +2243,8 @@ simple_expr: { $$= new Item_func_conv_charset3($3,$7,$5); } | DEFAULT '(' simple_ident ')' { $$= new Item_default_value($3); } + | VALUES '(' simple_ident ')' + { $$= new Item_insert_value($3); } | FUNC_ARG0 '(' ')' { $$= ((Item*(*)(void))($1.symbol->create_func))();} | FUNC_ARG1 '(' expr ')' @@ -2276,7 +2294,7 @@ simple_expr: | ENCRYPT '(' expr ')' { $$= new Item_func_encrypt($3); - Lex->uncacheable();; + Lex->uncacheable(); } | ENCRYPT '(' expr ',' expr ')' { $$= new Item_func_encrypt($3,$5); } | DECODE_SYM '(' expr ',' TEXT_STRING_literal ')' @@ -3730,10 +3748,11 @@ opt_describe_column: /* flush things */ flush: - FLUSH_SYM + FLUSH_SYM opt_no_write_to_binlog { LEX *lex=Lex; lex->sql_command= SQLCOM_FLUSH; lex->type=0; + lex->no_write_to_binlog= $2; } flush_options {} diff --git a/sql/table.cc b/sql/table.cc index fda1fcb36e4..3aed75c7ac6 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -267,6 +267,7 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, (ulong) (uint2korr(head+6)+uint2korr(head+14)), MYF(MY_NABP))) goto err_not_open; /* purecov: inspected */ + /* HACK: table->record[2] is used instead of table->default_values here */ for (i=0 ; i < records ; i++, record+=rec_buff_length) { outparam->record[i]=(byte*) record; @@ -276,11 +277,12 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, if (records == 2) { /* fix for select */ - outparam->record[2]=outparam->record[1]; + outparam->default_values=outparam->record[1]; if (db_stat & HA_READ_ONLY) outparam->record[1]=outparam->record[0]; /* purecov: inspected */ } - + outparam->insert_values=0; /* for INSERT ... UPDATE */ + VOID(my_seek(file,pos,MY_SEEK_SET,MYF(0))); if (my_read(file,(byte*) head,288,MYF(MY_NABP))) goto err_not_open; if (crypted) diff --git a/sql/table.h b/sql/table.h index 55bc48db604..2aefe23cb2f 100644 --- a/sql/table.h +++ b/sql/table.h @@ -65,7 +65,9 @@ struct st_table { Field **field; /* Pointer to fields */ Field_blob **blob_field; /* Pointer to blob fields */ HASH name_hash; /* hash of field names */ - byte *record[3]; /* Pointer to records */ + byte *record[2]; /* Pointer to records */ + byte *default_values; /* record with default values for INSERT */ + byte *insert_values; /* used by INSERT ... UPDATE */ uint fields; /* field count */ uint reclength; /* Recordlength */ uint rec_buff_length; @@ -144,10 +146,9 @@ struct st_table { struct st_table_list *pos_in_table_list; }; /* number of select if it is derived table */ - uint derived_select_number; + uint derived_select_number; THD *in_use; /* Which thread uses this */ struct st_table *next,*prev; - byte *default_values() { return record[2]; } }; diff --git a/sql/unireg.h b/sql/unireg.h index 9430329e67a..ff942f6748a 100644 --- a/sql/unireg.h +++ b/sql/unireg.h @@ -57,7 +57,8 @@ #endif #define MAX_FIELD_WIDTH 256 /* Max column width +1 */ -#define MAX_TABLES (sizeof(table_map)*8-1) /* Max tables in join */ +#define MAX_TABLES (sizeof(table_map)*8-2) /* Max tables in join */ +#define OUTER_REF_TABLE_BIT (((table_map) 1) << (sizeof(table_map)*8-2)) #define RAND_TABLE_BIT (((table_map) 1) << (sizeof(table_map)*8-1)) #define MAX_FIELDS 4096 /* Limit in the .frm file */ @@ -103,13 +104,13 @@ #define SPECIAL_SAFE_MODE 2048 /* Extern defines */ -#define store_record(A,B) bmove_allign((A)->record[B],(A)->record[0],(size_t) (A)->reclength) -#define restore_record(A,B) bmove_allign((A)->record[0],(A)->record[B],(size_t) (A)->reclength) -#define cmp_record(A,B) memcmp((A)->record[0],(A)->record[B],(size_t) (A)->reclength) +#define store_record(A,B) bmove_allign((A)->B,(A)->record[0],(size_t) (A)->reclength) +#define restore_record(A,B) bmove_allign((A)->record[0],(A)->B,(size_t) (A)->reclength) +#define cmp_record(A,B) memcmp((A)->record[0],(A)->B,(size_t) (A)->reclength) #define empty_record(A) { \ -bmove_allign((A)->record[0],(A)->record[2],(size_t) (A)->reclength); \ -bfill((A)->null_flags,(A)->null_bytes,255);\ -} + restore_record((A),default_values); \ + bfill((A)->null_flags,(A)->null_bytes,255);\ + } /* Defines for use with openfrm, openprt and openfrd */ |