diff options
author | unknown <monty@hundin.mysql.fi> | 2001-09-02 19:58:08 +0300 |
---|---|---|
committer | unknown <monty@hundin.mysql.fi> | 2001-09-02 19:58:08 +0300 |
commit | 3719b87396063fadf9a88a6acc6584f1321a7d6a (patch) | |
tree | c1066773b871f44ebb365c32dab0432f7da6da94 /sql | |
parent | fa7b17e904a73da0e938eac8e8d1503838d78202 (diff) | |
parent | ddee00a6edc735b3bbef42b7d0d662091debd560 (diff) | |
download | mariadb-git-3719b87396063fadf9a88a6acc6584f1321a7d6a.tar.gz |
merge
configure.in:
Auto merged
sql/ha_innobase.cc:
Auto merged
sql/ha_myisam.cc:
Auto merged
sql/handler.cc:
Auto merged
sql/handler.h:
Auto merged
sql/lock.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/sql_db.cc:
Auto merged
sql/sql_delete.cc:
Auto merged
sql/sql_insert.cc:
Auto merged
sql/sql_load.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_table.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
Diffstat (limited to 'sql')
65 files changed, 826 insertions, 453 deletions
diff --git a/sql/field.cc b/sql/field.cc index 78f57c5ceb5..01178efbdb1 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -2295,7 +2295,7 @@ void Field_timestamp::store(longlong nr) } else #endif - longstore(ptr,timestamp); + longstore(ptr,(ulong)timestamp); } @@ -4122,7 +4122,7 @@ ulonglong Field_blob::get_id(const char *from) ulonglong id = 0; ulong length=get_length(from); if (length) - longlongget(id, from+packlength); + uint8korr(id, from+packlength); return id; } diff --git a/sql/field.h b/sql/field.h index b5d7c613701..b9d8e1957c9 100644 --- a/sql/field.h +++ b/sql/field.h @@ -38,8 +38,8 @@ public: static void operator delete(void *ptr_arg, size_t size) {} /*lint -e715 */ enum utype { NONE,DATE,SHIELD,NOEMPTY,CASEUP,PNR,BGNR,PGNR,YES,NO,REL, - CHECK,EMPTY,UNKNOWN,CASEDN,NEXT_NUMBER,INTERVAL_FIELD,BIT_FIELD, - TIMESTAMP_FIELD,CAPITALIZE,BLOB_FIELD}; + CHECK,EMPTY,UNKNOWN_FIELD,CASEDN,NEXT_NUMBER,INTERVAL_FIELD, + BIT_FIELD, TIMESTAMP_FIELD,CAPITALIZE,BLOB_FIELD}; char *ptr; // Position to field in record uchar *null_ptr; // Byte where null_bit is uint8 null_bit; // And position to it @@ -300,6 +300,7 @@ public: void store(const char *to,uint length); void store(double nr); void store(longlong nr); + void reset(void) { ptr[0]=0; } double val_real(void); longlong val_int(void); String *val_str(String*,String *); @@ -328,6 +329,7 @@ public: void store(const char *to,uint length); void store(double nr); void store(longlong nr); + void reset(void) { ptr[0]=ptr[1]=0; } double val_real(void); longlong val_int(void); String *val_str(String*,String *); @@ -356,6 +358,7 @@ public: void store(const char *to,uint length); void store(double nr); void store(longlong nr); + void reset(void) { ptr[0]=ptr[1]=ptr[2]=0; } double val_real(void); longlong val_int(void); String *val_str(String*,String *); @@ -389,6 +392,7 @@ public: void store(const char *to,uint length); void store(double nr); void store(longlong nr); + void reset(void) { ptr[0]=ptr[1]=ptr[2]=ptr[3]=0; } double val_real(void); longlong val_int(void); String *val_str(String*,String *); @@ -423,6 +427,7 @@ public: void store(const char *to,uint length); void store(double nr); void store(longlong nr); + void reset(void) { ptr[0]=ptr[1]=ptr[2]=ptr[3]=ptr[4]=ptr[5]=ptr[6]=ptr[7]=0; } double val_real(void); longlong val_int(void); String *val_str(String*,String *); @@ -449,6 +454,7 @@ public: void store(const char *to,uint length); void store(double nr); void store(longlong nr); + void reset(void) { bzero(ptr,sizeof(float)); } double val_real(void); longlong val_int(void); String *val_str(String*,String *); @@ -480,6 +486,7 @@ public: void store(const char *to,uint length); void store(double nr); void store(longlong nr); + void reset(void) { bzero(ptr,sizeof(double)); } double val_real(void); longlong val_int(void); String *val_str(String*,String *); @@ -505,6 +512,7 @@ public: void store(const char *to, uint length) { null[0]=1; } void store(double nr) { null[0]=1; } void store(longlong nr) { null[0]=1; } + void reset(void) {} double val_real(void) { return 0.0;} longlong val_int(void) { return 0;} String *val_str(String *value,String *value2) @@ -528,6 +536,7 @@ public: void store(const char *to,uint length); void store(double nr); void store(longlong nr); + void reset(void) { ptr[0]=ptr[1]=ptr[2]=ptr[3]=0; } double val_real(void); longlong val_int(void); String *val_str(String*,String *); @@ -588,6 +597,7 @@ public: void store(const char *to,uint length); void store(double nr); void store(longlong nr); + void reset(void) { ptr[0]=ptr[1]=ptr[2]=ptr[3]=0; } double val_real(void); longlong val_int(void); String *val_str(String*,String *); @@ -615,6 +625,7 @@ public: void store(double nr); void store(longlong nr); void store_time(TIME *ltime,timestamp_type type); + void reset(void) { ptr[0]=ptr[1]=ptr[2]=0; } double val_real(void); longlong val_int(void); String *val_str(String*,String *); @@ -643,6 +654,7 @@ public: void store(const char *to,uint length); void store(double nr); void store(longlong nr); + void reset(void) { ptr[0]=ptr[1]=ptr[2]=0; } double val_real(void); longlong val_int(void); String *val_str(String*,String *); @@ -673,6 +685,7 @@ public: void store(double nr); void store(longlong nr); void store_time(TIME *ltime,timestamp_type type); + void reset(void) { ptr[0]=ptr[1]=ptr[2]=ptr[3]=ptr[4]=ptr[5]=ptr[6]=ptr[7]=0; } double val_real(void); longlong val_int(void); String *val_str(String*,String *); @@ -874,6 +887,14 @@ public: uint max_length= ~(uint) 0); ulonglong get_id(const char *from); const char *unpack_id(char *to, const char *from, const char *bdata); + inline void get_ptr_from_key_image(char **str,char *key_str) + { + *str = key_str + sizeof(uint16); + } + inline uint get_length_from_key_image(char *key_str) + { + return uint2korr(key_str); + } enum_field_types blobtype() { return (packlength == 1 ? FIELD_TYPE_TINY_BLOB : FIELD_TYPE_BLOB);} #endif char *pack_key(char *to, const char *from, uint max_length); @@ -914,6 +935,7 @@ public: void store(const char *to,uint length); void store(double nr); void store(longlong nr); + void reset() { bzero(ptr,packlength); } double val_real(void); longlong val_int(void); String *val_str(String*,String *); diff --git a/sql/filesort.cc b/sql/filesort.cc index 3519467fbea..92886242a4a 100644 --- a/sql/filesort.cc +++ b/sql/filesort.cc @@ -362,6 +362,8 @@ static ha_rows find_all_keys(SORTPARAM *param, SQL_SELECT *select, } make_sortkey(param,sort_keys[idx++],ref_pos); } + else + file->unlock_row(); } (void) file->extra(HA_EXTRA_NO_CACHE); /* End cacheing of records */ file->rnd_end(); diff --git a/sql/gen_lex_hash.cc b/sql/gen_lex_hash.cc index 4a923e039c4..e05fdafcbc4 100644 --- a/sql/gen_lex_hash.cc +++ b/sql/gen_lex_hash.cc @@ -472,7 +472,7 @@ int main(int argc,char **argv) int error; MY_INIT(argv[0]); - start_value=2663113L; best_t1=1175350L; best_t2=7404531L; best_type=4; /* mode=4327 add=3 type: 0 */ + start_value=6130115L; best_t1=3632784L; best_t2=86437L; best_type=3; /* mode=4229 add=2 type: 0 */ if (get_options(argc,(char **) argv)) exit(1); diff --git a/sql/ha_gemini.cc b/sql/ha_gemini.cc index e80d9a001e6..e8130c55fc7 100644 --- a/sql/ha_gemini.cc +++ b/sql/ha_gemini.cc @@ -93,6 +93,7 @@ bool gemini_init(void) DBUG_ENTER("gemini_init"); + gemini_basedir=mysql_home; /* If datadir isn't set, bail out */ if (*mysql_real_data_home == '\0') { @@ -955,7 +956,7 @@ int ha_gemini::handleIndexEntry(const byte * record, dsmRecid_t recid, thd = current_thd; key_info=table->key_info+keynr; - thereIsAnull = false; + thereIsAnull = FALSE; rc = createKeyString(record, key_info, theKey.akey.keystr, sizeof(theKey.apad),&keyStringLen, (short)pindexNumbers[keynr], @@ -1067,7 +1068,7 @@ int ha_gemini::createKeyString(const byte * record, KEY *pkeyinfo, isNull = record[key_part->null_offset] & key_part->null_bit; if(isNull) - *thereIsAnull = true; + *thereIsAnull = TRUE; rc = gemFieldToIdxComponent(pos, (unsigned long) key_part_length, @@ -1107,7 +1108,7 @@ int ha_gemini::update_row(const byte * old_record, byte * new_record) } for (uint keynr=0 ; keynr < table->keys ; keynr++) { - if(key_cmp(keynr,old_record, new_record,false)) + if(key_cmp(keynr,old_record, new_record,FALSE)) { error = handleIndexEntry(old_record,lastRowid,KEY_DELETE,keynr); if(error) @@ -2430,8 +2431,8 @@ int ha_gemini::analyze(THD* thd, HA_CHECK_OPT* check_opt) uint saveIsolation; dsmMask_t saveLockMode; - check_opt->quick = true; - check_opt->optimize = true; // Tells check not to get table lock + check_opt->quick = TRUE; + check_opt->optimize = TRUE; // Tells check not to get table lock saveLockMode = lockMode; saveIsolation = thd->gemini.tx_isolation; thd->gemini.tx_isolation = ISO_READ_UNCOMMITTED; @@ -2503,7 +2504,7 @@ int ha_gemini::check(THD* thd, HA_CHECK_OPT* check_opt) error = fetch_row(thd->gemini.context,buf); if(!error) { - if(key_cmp(i,buf,indexBuf,false)) + if(key_cmp(i,buf,indexBuf,FALSE)) { gemini_msg((dsmContext_t *)thd->gemini.context, @@ -2534,7 +2535,7 @@ int ha_gemini::check(THD* thd, HA_CHECK_OPT* check_opt) } } - key_cmp(i,indexBuf,prevBuf,true); + key_cmp(i,indexBuf,prevBuf,TRUE); bcopy((void *)indexBuf,(void *)prevBuf,table->rec_buff_length); if(!error) diff --git a/sql/ha_gemini.h b/sql/ha_gemini.h index 3bfe85bfba2..96c0cdd4241 100644 --- a/sql/ha_gemini.h +++ b/sql/ha_gemini.h @@ -205,3 +205,4 @@ int gemini_set_option_long(int optid, long optval); const int gemini_blocksize = BLKSIZE; const int gemini_recbits = DEFAULT_RECBITS; +extern "C" void uttrace(void); diff --git a/sql/ha_innobase.cc b/sql/ha_innobase.cc index 254fa6970a7..5920ce86116 100644 --- a/sql/ha_innobase.cc +++ b/sql/ha_innobase.cc @@ -185,6 +185,47 @@ convert_error_code_to_mysql( } } +extern "C" { +/***************************************************************** +Prints info of a THD object (== user session thread) to the +standatd output. NOTE that mysql/innobase/trx/trx0trx.c must contain +the prototype for this function! */ + +void +innobase_mysql_print_thd( +/*=====================*/ + void* input_thd)/* in: pointer to a MySQL THD object */ +{ + THD* thd; + + thd = (THD*) input_thd; + + printf("MySQL thread id %lu, query id %lu", + thd->thread_id, thd->query_id); + if (thd->host) { + printf(" %s", thd->host); + } + + if (thd->ip) { + printf(" %s", thd->ip); + } + + if (thd->user) { + printf(" %s", thd->user); + } + + if (thd->proc_info) { + printf(" %s", thd->proc_info); + } + + if (thd->query) { + printf(" %0.100s", thd->query); + } + + printf("\n"); +} +} + /************************************************************************* Gets the InnoDB transaction handle for a MySQL handler object, creates an InnoDB transaction struct if the corresponding MySQL thread struct still @@ -204,6 +245,8 @@ check_trx_exists( dbug_assert(thd != NULL); trx = trx_allocate_for_mysql(); + trx->mysql_thd = thd; + thd->transaction.all.innobase_tid = trx; /* The execution of a single SQL statement is denoted by @@ -504,7 +547,15 @@ innobase_init(void) if (!innobase_data_file_path) { fprintf(stderr, - "Can't initialize InnoDB as 'innodb_data_file_path' is not set\n"); + "Cannot initialize InnoDB as 'innodb_data_file_path' is not set.\n" + "If you do not want to use transactional InnoDB tables, add a line\n" + "skip-innodb\n" + "to the [mysqld] section of init parameters in your my.cnf\n" + "or my.ini. If you want to use InnoDB tables, add for example,\n" + "innodb_data_file_path = /mysql/data/ibdata1:20M\n" + "More information on setting the parameters you find in the\n" + "manual.\n"); + innodb_skip=1; DBUG_RETURN(FALSE); // Continue without innobase } @@ -638,7 +689,7 @@ innobase_commit( if (trx_handle != (void*)&innodb_dummy_stmt_trx_handle) { trx_commit_for_mysql(trx); - trx_mark_sql_stat_end(trx); + trx_mark_sql_stat_end_do_not_start_new(trx); } else { trx_mark_sql_stat_end(trx); } @@ -677,6 +728,7 @@ innobase_rollback( if (trx_handle != (void*)&innodb_dummy_stmt_trx_handle) { error = trx_rollback_for_mysql(trx); + trx_mark_sql_stat_end_do_not_start_new(trx); } else { error = trx_rollback_last_sql_stat_for_mysql(trx); trx_mark_sql_stat_end(trx); @@ -826,10 +878,6 @@ ha_innobase::open( DBUG_RETURN(1); } - /* MySQL allocates the buffer for ref */ - - ref_length = buff_len; - /* Get pointer to a table object in InnoDB dictionary cache */ if (NULL == (ib_table = dict_table_get(norm_name, NULL))) { @@ -866,10 +914,20 @@ ha_innobase::open( primary_key = 0; key_used_on_scan = 0; + + /* MySQL allocates the buffer for ref */ + + ref_length = table->key_info->key_length + + table->key_info->key_parts + 10; + + /* One byte per key field is consumed to the SQL NULL + info of the field; we add also 10 bytes of safety margin */ } else { ((row_prebuilt_t*)innobase_prebuilt) ->clust_index_was_generated = TRUE; + ref_length = DATA_ROW_ID_LEN + 10; + dbug_assert(key_used_on_scan == MAX_KEY); } @@ -1334,6 +1392,15 @@ ha_innobase::write_row( auto_inc = table->next_number_field->val_int(); + /* In replication and also otherwise the auto-inc column + can be set with SET INSERT_ID. Then we must look at + user_thd->next_insert_id. If it is nonzero and the user + has not supplied a value, we must use it. */ + + if (auto_inc == 0 && user_thd->next_insert_id != 0) { + auto_inc = user_thd->next_insert_id; + } + if (auto_inc != 0) { /* This call will calculate the max of the current value and the value supplied by the user, if @@ -2218,29 +2285,29 @@ ha_innobase::external_lock( if (trx->n_mysql_tables_in_use == 0) { trx_mark_sql_stat_end(trx); } - + thd->transaction.all.innodb_active_trans = 1; trx->n_mysql_tables_in_use++; if (prebuilt->select_lock_type != LOCK_NONE) { - trx->mysql_n_tables_locked++; + trx->mysql_n_tables_locked++; } } else { trx->n_mysql_tables_in_use--; if (trx->n_mysql_tables_in_use == 0) { - trx->mysql_n_tables_locked = 0; + trx->mysql_n_tables_locked = 0; - if (trx->has_search_latch) { + if (trx->has_search_latch) { - trx_search_latch_release_if_reserved(trx); - } + trx_search_latch_release_if_reserved(trx); + } - if (!(thd->options - & (OPTION_NOT_AUTO_COMMIT | OPTION_BEGIN))) { - innobase_commit(thd, trx); - } + if (!(thd->options + & (OPTION_NOT_AUTO_COMMIT | OPTION_BEGIN))) { + innobase_commit(thd, trx); + } } } @@ -2636,6 +2703,10 @@ ha_innobase::records_in_range( DBUG_ENTER("records_in_range"); + if (prebuilt->trx) { + prebuilt->trx->op_info = "estimating range size"; + } + active_index = keynr; key = table->key_info + active_index; @@ -2668,6 +2739,10 @@ ha_innobase::records_in_range( my_free((char*) key_val_buff2, MYF(0)); + if (prebuilt->trx) { + prebuilt->trx->op_info = ""; + } + DBUG_RETURN((ha_rows) n_rows); } @@ -2687,10 +2762,15 @@ ha_innobase::estimate_number_of_rows(void) row_prebuilt_t* prebuilt = (row_prebuilt_t*) innobase_prebuilt; dict_table_t* ib_table; + if (prebuilt->trx) { + prebuilt->trx->op_info = + "estimating upper bound of table size"; + } + DBUG_ENTER("info"); ib_table = prebuilt->table; - + dict_update_statistics(ib_table); data_file_length = ((ulonglong) @@ -2699,6 +2779,10 @@ ha_innobase::estimate_number_of_rows(void) /* The minimum clustered index record size is 20 bytes */ + if (prebuilt->trx) { + prebuilt->trx->op_info = ""; + } + return((ha_rows) (1000 + data_file_length / 20)); } @@ -2737,6 +2821,10 @@ ha_innobase::info( DBUG_ENTER("info"); + if (prebuilt->trx) { + prebuilt->trx->op_info = "calculating table stats"; + } + ib_table = prebuilt->table; if (flag & HA_STATUS_TIME) { @@ -2799,6 +2887,10 @@ ha_innobase::info( trx_get_error_info(prebuilt->trx)); } + if (prebuilt->trx) { + prebuilt->trx->op_info = ""; + } + DBUG_VOID_RETURN; } diff --git a/sql/ha_innobase.h b/sql/ha_innobase.h index d129e00ba6e..daa987dd757 100644 --- a/sql/ha_innobase.h +++ b/sql/ha_innobase.h @@ -83,7 +83,7 @@ class ha_innobase: public handler HA_NO_WRITE_DELAYED | HA_PRIMARY_KEY_IN_READ_INDEX | HA_DROP_BEFORE_CREATE | - HA_NOT_READ_AFTER_KEY | HA_NO_PREFIX_CHAR_KEYS), + HA_NO_PREFIX_CHAR_KEYS), last_dup_key((uint) -1), start_of_scan(0) { diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc index 7d7bae1112b..c192443da0a 100644 --- a/sql/ha_myisam.cc +++ b/sql/ha_myisam.cc @@ -231,8 +231,16 @@ int ha_myisam::close(void) int ha_myisam::write_row(byte * buf) { statistic_increment(ha_write_count,&LOCK_status); + + /* If we have a timestamp column, update it to the current time */ + if (table->time_stamp) update_timestamp(buf+table->time_stamp-1); + + /* + If we have an auto_increment column and we are writing a changed row + or a new row, then update the auto_increment value in the record. + */ if (table->next_number_field && buf == table->record[0]) update_auto_increment(); return mi_write(file,buf); diff --git a/sql/ha_myisammrg.cc b/sql/ha_myisammrg.cc index ddfd48a0e71..abcf81806ad 100644 --- a/sql/ha_myisammrg.cc +++ b/sql/ha_myisammrg.cc @@ -86,7 +86,6 @@ int ha_myisammrg::delete_row(const byte * buf) int ha_myisammrg::index_read(byte * buf, const byte * key, uint key_len, enum ha_rkey_function find_flag) { -// return (my_errno=HA_ERR_WRONG_COMMAND); statistic_increment(ha_read_key_count,&LOCK_status); int error=myrg_rkey(file,buf,active_index, key, key_len, find_flag); table->status=error ? STATUS_NOT_FOUND: 0; @@ -96,7 +95,6 @@ int ha_myisammrg::index_read(byte * buf, const byte * key, int ha_myisammrg::index_read_idx(byte * buf, uint index, const byte * key, uint key_len, enum ha_rkey_function find_flag) { -// return (my_errno=HA_ERR_WRONG_COMMAND); statistic_increment(ha_read_key_count,&LOCK_status); int error=myrg_rkey(file,buf,index, key, key_len, find_flag); table->status=error ? STATUS_NOT_FOUND: 0; @@ -105,7 +103,6 @@ int ha_myisammrg::index_read_idx(byte * buf, uint index, const byte * key, int ha_myisammrg::index_next(byte * buf) { -// return (my_errno=HA_ERR_WRONG_COMMAND); statistic_increment(ha_read_next_count,&LOCK_status); int error=myrg_rnext(file,buf,active_index); table->status=error ? STATUS_NOT_FOUND: 0; @@ -114,7 +111,6 @@ int ha_myisammrg::index_next(byte * buf) int ha_myisammrg::index_prev(byte * buf) { -// return (my_errno=HA_ERR_WRONG_COMMAND); statistic_increment(ha_read_prev_count,&LOCK_status); int error=myrg_rprev(file,buf, active_index); table->status=error ? STATUS_NOT_FOUND: 0; @@ -123,7 +119,6 @@ int ha_myisammrg::index_prev(byte * buf) int ha_myisammrg::index_first(byte * buf) { -// return (my_errno=HA_ERR_WRONG_COMMAND); statistic_increment(ha_read_first_count,&LOCK_status); int error=myrg_rfirst(file, buf, active_index); table->status=error ? STATUS_NOT_FOUND: 0; @@ -132,7 +127,6 @@ int ha_myisammrg::index_first(byte * buf) int ha_myisammrg::index_last(byte * buf) { -// return (my_errno=HA_ERR_WRONG_COMMAND); statistic_increment(ha_read_last_count,&LOCK_status); int error=myrg_rlast(file, buf, active_index); table->status=error ? STATUS_NOT_FOUND: 0; diff --git a/sql/handler.cc b/sql/handler.cc index 94910b24622..fbf5144c090 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -286,6 +286,7 @@ int ha_commit_trans(THD *thd, THD_TRANS* trans) my_error(ER_ERROR_DURING_COMMIT, MYF(0), error); error=1; } + trans->innodb_active_trans=0; } #endif #ifdef HAVE_GEMINI_DB @@ -337,6 +338,7 @@ int ha_rollback_trans(THD *thd, THD_TRANS *trans) my_error(ER_ERROR_DURING_ROLLBACK, MYF(0), error); error=1; } + trans->innodb_active_trans=0; } #endif #ifdef HAVE_GEMINI_DB diff --git a/sql/handler.h b/sql/handler.h index bbb67ace2b2..b190cedd040 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -128,6 +128,7 @@ typedef struct st_thd_trans { void *bdb_tid; void *innobase_tid; void *gemini_tid; + bool innodb_active_trans; } THD_TRANS; enum enum_tx_isolation { ISO_READ_UNCOMMITTED, ISO_READ_COMMITTED, @@ -268,6 +269,7 @@ public: virtual int extra(enum ha_extra_function operation)=0; virtual int reset()=0; virtual int external_lock(THD *thd, int lock_type)=0; + virtual void unlock_row() {} virtual int start_stmt(THD *thd) {return 0;} virtual int delete_all_rows(); virtual longlong get_auto_increment(); diff --git a/sql/hostname.cc b/sql/hostname.cc index fed9e60b574..bc812341337 100644 --- a/sql/hostname.cc +++ b/sql/hostname.cc @@ -26,7 +26,7 @@ #ifdef __cplusplus extern "C" { // Because of SCO 3.2V4.2 #endif -#ifndef __WIN__ +#if !defined( __WIN__) && !defined(OS2) #include <sys/resource.h> #ifdef HAVE_SYS_UN_H #include <sys/un.h> diff --git a/sql/item_func.cc b/sql/item_func.cc index 66a50eb0ec0..3ef5ed5d7a3 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -259,10 +259,14 @@ double Item_func_plus::val() longlong Item_func_plus::val_int() { - longlong value=args[0]->val_int()+args[1]->val_int(); - if ((null_value=args[0]->null_value || args[1]->null_value)) - return 0; - return value; + if (hybrid_type == INT_RESULT) + { + longlong value=args[0]->val_int()+args[1]->val_int(); + if ((null_value=args[0]->null_value || args[1]->null_value)) + return 0; + return value; + } + return (longlong) Item_func_plus::val(); } double Item_func_minus::val() @@ -275,12 +279,17 @@ double Item_func_minus::val() longlong Item_func_minus::val_int() { - longlong value=args[0]->val_int() - args[1]->val_int(); - if ((null_value=args[0]->null_value || args[1]->null_value)) - return 0; - return value; + if (hybrid_type == INT_RESULT) + { + longlong value=args[0]->val_int() - args[1]->val_int(); + if ((null_value=args[0]->null_value || args[1]->null_value)) + return 0; + return value; + } + return (longlong) Item_func_minus::val(); } + double Item_func_mul::val() { double value=args[0]->val()*args[1]->val(); @@ -291,10 +300,14 @@ double Item_func_mul::val() longlong Item_func_mul::val_int() { - longlong value=args[0]->val_int()*args[1]->val_int(); - if ((null_value=args[0]->null_value || args[1]->null_value)) - return 0; /* purecov: inspected */ - return value; + if (hybrid_type == INT_RESULT) + { + longlong value=args[0]->val_int()*args[1]->val_int(); + if ((null_value=args[0]->null_value || args[1]->null_value)) + return 0; /* purecov: inspected */ + return value; + } + return (longlong) Item_func_mul::val(); } @@ -309,11 +322,15 @@ double Item_func_div::val() longlong Item_func_div::val_int() { - longlong value=args[0]->val_int(); - longlong val2=args[1]->val_int(); - if ((null_value= val2 == 0 || args[0]->null_value || args[1]->null_value)) - return 0; - return value/val2; + if (hybrid_type == INT_RESULT) + { + longlong value=args[0]->val_int(); + longlong val2=args[1]->val_int(); + if ((null_value= val2 == 0 || args[0]->null_value || args[1]->null_value)) + return 0; + return value/val2; + } + return (longlong) Item_func_div::val(); } void Item_func_div::fix_length_and_dec() @@ -1382,6 +1399,23 @@ void item_user_lock_free(void) void item_user_lock_release(ULL *ull) { ull->locked=0; + if (mysql_bin_log.is_open()) + { + THD *thd = current_thd; + int save_errno; + char buf[256]; + String tmp(buf,sizeof(buf)); + tmp.length(0); + tmp.append("SELECT release_lock(\""); + tmp.append(ull->key,ull->key_length); + tmp.append("\")"); + save_errno=thd->net.last_errno; + thd->net.last_errno=0; + thd->query_length=tmp.length(); + Query_log_event qev(thd,tmp.ptr()); + mysql_bin_log.write(&qev); + thd->net.last_errno=save_errno; + } if (--ull->count) pthread_cond_signal(&ull->cond); else @@ -1428,7 +1462,7 @@ longlong Item_func_get_lock::val_int() struct timespec abstime; THD *thd=current_thd; ULL *ull; - int error; + int error=0; pthread_mutex_lock(&LOCK_user_locks); @@ -1466,23 +1500,23 @@ longlong Item_func_get_lock::val_int() /* structure is now initialized. Try to get the lock */ /* Set up control struct to allow others to abort locks */ - pthread_mutex_lock(&thd->mysys_var->mutex); thd->proc_info="User lock"; thd->mysys_var->current_mutex= &LOCK_user_locks; thd->mysys_var->current_cond= &ull->cond; - pthread_mutex_unlock(&thd->mysys_var->mutex); +#ifdef HAVE_TIMESPEC_TS_SEC + abstime.ts_sec=time((time_t*) 0)+(time_t) timeout; + abstime.ts_nsec=0; +#else abstime.tv_sec=time((time_t*) 0)+(time_t) timeout; abstime.tv_nsec=0; - while ((error=pthread_cond_timedwait(&ull->cond,&LOCK_user_locks,&abstime)) - != ETIME && error != ETIMEDOUT && ull->locked) - { - if (thd->killed || abort_loop) - { - error=EINTR; // Return NULL - break; - } - } +#endif + + while (!thd->killed && + (error=pthread_cond_timedwait(&ull->cond,&LOCK_user_locks,&abstime)) + != ETIME && error != ETIMEDOUT && ull->locked) ; + if (thd->killed) + error=EINTR; // Return NULL if (ull->locked) { if (!--ull->count) diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 9d69b713611..12561fe4326 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -1008,8 +1008,8 @@ String *Item_func_encrypt::val_str(String *str) if (arg_count == 1) { // generate random salt time_t timestamp=current_thd->query_start(); - salt[0] = bin_to_ascii(timestamp & 0x3f); - salt[1] = bin_to_ascii((timestamp >> 5) & 0x3f); + salt[0] = bin_to_ascii( (ulong) timestamp & 0x3f); + salt[1] = bin_to_ascii(( (ulong) timestamp >> 5) & 0x3f); salt[2] = 0; salt_ptr=salt; } @@ -1102,7 +1102,7 @@ void Item_func_soundex::fix_length_and_dec() */ extern "C" { -extern char *soundex_map; // In mysys/static.c +extern const char *soundex_map; // In mysys/static.c } static char get_scode(char *ptr) diff --git a/sql/lex.h b/sql/lex.h index 8e03570d93b..1d481aa7c85 100644 --- a/sql/lex.h +++ b/sql/lex.h @@ -205,6 +205,7 @@ static SYMBOL symbols[] = { { "LOAD", SYM(LOAD),0,0}, { "LOCAL", SYM(LOCAL_SYM),0,0}, { "LOCK", SYM(LOCK_SYM),0,0}, + { "LOCKS", SYM(LOCKS_SYM),0,0}, { "LOGS", SYM(LOGS_SYM),0,0}, { "LONG", SYM(LONG_SYM),0,0}, { "LONGBLOB", SYM(LONGBLOB),0,0}, diff --git a/sql/log.cc b/sql/log.cc index 8976cb87375..51bf077895a 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -149,11 +149,11 @@ void MYSQL_LOG::init(enum_log_type log_type_arg) void MYSQL_LOG::close_index() { - if(index_file >= 0) - { - my_close(index_file, MYF(0)); - index_file = -1; - } + if (index_file >= 0) + { + my_close(index_file, MYF(0)); + index_file = -1; + } } void MYSQL_LOG::open(const char *log_name, enum_log_type log_type_arg, diff --git a/sql/log_event.cc b/sql/log_event.cc index 8275896710a..64ad4cadf8e 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -355,7 +355,7 @@ int Log_event::write_header(IO_CACHE* file) { char buf[LOG_EVENT_HEADER_LEN]; char* pos = buf; - int4store(pos, when); // timestamp + int4store(pos, (ulong) when); // timestamp pos += 4; *pos++ = get_type_code(); // event type code int4store(pos, server_id); @@ -553,7 +553,11 @@ void Log_event::print_timestamp(FILE* file, time_t* ts) { ts = &when; } +#ifdef MYSQL_SERVER localtime_r(ts,&tm_tmp); +#else + localtime(ts); +#endif fprintf(file,"%02d%02d%02d %2d:%02d:%02d", tm_tmp.tm_year % 100, diff --git a/sql/md5.c b/sql/md5.c index a19f8639f3a..baf45350473 100644 --- a/sql/md5.c +++ b/sql/md5.c @@ -123,10 +123,11 @@ void my_MD5Init (my_MD5_CTX *context) /* context */ operation, processing another message block, and updating the context. */ -void my_MD5Update (context, input, inputLen) -my_MD5_CTX *context; /* context */ -unsigned char *input; /* input block */ -unsigned int inputLen; /* length of input block */ + +void MD5Update ( +my_MD5_CTX *context, /* context */ +unsigned char *input, /* input block */ +unsigned int inputLen) /* length of input block */ { unsigned int i, idx, partLen; @@ -164,9 +165,9 @@ unsigned int inputLen; /* length of input block */ /* MD5 finalization. Ends an MD5 message-digest operation, writing the the message digest and zeroizing the context. */ -void my_MD5Final (digest, context) -unsigned char digest[16]; /* message digest */ -my_MD5_CTX *context; /* context */ +void my_MD5Final ( +unsigned char digest[16], /* message digest */ +MD5_CTX *context) /* context */ { unsigned char bits[8]; unsigned int idx, padLen; @@ -193,9 +194,9 @@ my_MD5_CTX *context; /* context */ /* MD5 basic transformation. Transforms state based on block. */ -static void MD5Transform (state, block) -UINT4 state[4]; -unsigned char block[64]; +static void MD5Transform ( +UINT4 state[4], +unsigned char block[64]) { UINT4 a = state[0], b = state[1], c = state[2], d = state[3], x[16]; @@ -287,10 +288,10 @@ unsigned char block[64]; /* Encodes input (UINT4) into output (unsigned char). Assumes len is a multiple of 4. */ -static void Encode (output, input, len) -unsigned char *output; -UINT4 *input; -unsigned int len; +static void Encode ( +unsigned char *output, +UINT4 *input, +unsigned int len) { unsigned int i, j; @@ -306,10 +307,10 @@ unsigned int len; /* Decodes input (unsigned char) into output (UINT4). Assumes len is a multiple of 4. */ -static void Decode (output, input, len) -UINT4 *output; -unsigned char *input; -unsigned int len; +static void Decode ( +UINT4 *output, +unsigned char *input, +unsigned int len) { unsigned int i, j; diff --git a/sql/mini_client.cc b/sql/mini_client.cc index 31181ee2580..994f788f423 100644 --- a/sql/mini_client.cc +++ b/sql/mini_client.cc @@ -23,10 +23,23 @@ */ #define DONT_USE_RAID -#if defined(__WIN__) || defined(WIN32) +#if defined(__WIN__) #include <winsock.h> #include <odbcinst.h> +/* Disable alarms */ +typedef my_bool ALARM; +#define thr_alarm_init(A) (*(A))=0 +#define thr_alarm_in_use(A) (*(A)) +#define thr_end_alarm(A) +#define thr_alarm(A,B,C) local_thr_alarm((A),(B),(C)) +inline int local_thr_alarm(my_bool *A,int B __attribute__((unused)),ALARM *C __attribute__((unused))) +{ + *A=1; + return 0; +} +#define thr_got_alarm(A) 0 #endif + #include <global.h> #include <mysql_com.h> #include <violite.h> @@ -45,6 +58,11 @@ #define net_write_timeout net_write_timeout1 #endif +#if defined( OS2) && defined( MYSQL_SERVER) +#undef ER +#define ER CER +#endif + extern ulong net_read_timeout; extern "C" { // Because of SCO 3.2V4.2 @@ -68,7 +86,7 @@ extern "C" { // Because of SCO 3.2V4.2 #ifdef HAVE_SYS_UN_H # include <sys/un.h> #endif -#if defined(THREAD) && !defined(__WIN__) +#if defined(THREAD) #include <my_pthread.h> /* because of signal() */ #include <thr_alarm.h> #endif @@ -101,6 +119,9 @@ static MYSQL_DATA *mc_read_rows(MYSQL *mysql,MYSQL_FIELD *mysql_fields, #if defined(MSDOS) || defined(__WIN__) #define ERRNO WSAGetLastError() #define perror(A) +#elif defined(OS2) +#define ERRNO sock_errno() +#define SOCKET_ERROR -1 #else #include <sys/errno.h> #define ERRNO errno @@ -254,7 +275,7 @@ static void mc_free_old_query(MYSQL *mysql) static int mc_sock_connect(my_socket s, const struct sockaddr *name, uint namelen, uint to) { -#if defined(__WIN__) +#if defined(__WIN__) || defined(OS2) return connect(s, (struct sockaddr*) name, namelen); #else int flags, res, s_err; @@ -349,18 +370,18 @@ mc_net_safe_read(MYSQL *mysql) { DBUG_PRINT("error",("Wrong connection or packet. fd: %s len: %d", vio_description(net->vio),len)); - if(errno != EINTR) + if (socket_errno != EINTR) + { + mc_end_server(mysql); + if(net->last_errno != ER_NET_PACKET_TOO_LARGE) { - mc_end_server(mysql); - if(net->last_errno != ER_NET_PACKET_TOO_LARGE) - { - net->last_errno=CR_SERVER_LOST; - strmov(net->last_error,ER(net->last_errno)); - } - else - strmov(net->last_error, "Packet too large - increase \ + net->last_errno=CR_SERVER_LOST; + strmov(net->last_error,ER(net->last_errno)); + } + else + strmov(net->last_error, "Packet too large - increase \ max_allowed_packet on this server"); - } + } return(packet_error); } if (net->read_pos[0] == 255) @@ -470,7 +491,7 @@ mc_simple_command(MYSQL *mysql,enum enum_server_command command, if (net_write_command(net,(uchar) command,arg, length ? length :(uint) strlen(arg))) { - DBUG_PRINT("error",("Can't send command to server. Error: %d",errno)); + DBUG_PRINT("error",("Can't send command to server. Error: %d",socket_errno)); mc_end_server(mysql); if (mc_mysql_reconnect(mysql) || net_write_command(net,(uchar) command,arg, @@ -502,9 +523,7 @@ mc_mysql_connect(MYSQL *mysql,const char *host, const char *user, uint pkt_length; NET *net= &mysql->net; thr_alarm_t alarmed; -#if !defined(__WIN__) ALARM alarm_buff; -#endif #ifdef __WIN__ HANDLE hPipe=INVALID_HANDLE_VALUE; @@ -554,9 +573,9 @@ mc_mysql_connect(MYSQL *mysql,const char *host, const char *user, if (mc_sock_connect(sock,(struct sockaddr *) &UNIXaddr, sizeof(UNIXaddr), mysql->options.connect_timeout) <0) { - DBUG_PRINT("error",("Got error %d on connect to local server",ERRNO)); + DBUG_PRINT("error",("Got error %d on connect to local server",socket_errno)); net->last_errno=CR_CONNECTION_ERROR; - sprintf(net->last_error,ER(net->last_errno),unix_socket,ERRNO); + sprintf(net->last_error,ER(net->last_errno),unix_socket,socket_errno); goto error; } } @@ -604,7 +623,7 @@ mc_mysql_connect(MYSQL *mysql,const char *host, const char *user, if ((sock = socket(AF_INET,SOCK_STREAM,0)) == SOCKET_ERROR) { net->last_errno=CR_IPSOCK_ERROR; - sprintf(net->last_error,ER(net->last_errno),ERRNO); + sprintf(net->last_error,ER(net->last_errno),socket_errno); goto error; } net->vio = vio_new(sock,VIO_TYPE_TCPIP,FALSE); @@ -641,7 +660,7 @@ mc_mysql_connect(MYSQL *mysql,const char *host, const char *user, if (!(hp=gethostbyname(host))) { net->last_errno=CR_UNKNOWN_HOST; - sprintf(net->last_error, ER(CR_UNKNOWN_HOST), host, errno); + sprintf(net->last_error, ER(CR_UNKNOWN_HOST), host, socket_errno); goto error; } memcpy(&sock_addr.sin_addr,hp->h_addr, (size_t) hp->h_length); @@ -649,11 +668,12 @@ mc_mysql_connect(MYSQL *mysql,const char *host, const char *user, #endif sock_addr.sin_port = (ushort) htons((ushort) port); if (mc_sock_connect(sock,(struct sockaddr *) &sock_addr, sizeof(sock_addr), - mysql->options.connect_timeout) <0) + mysql->options.connect_timeout) <0) { - DBUG_PRINT("error",("Got error %d on connect to '%s'",ERRNO,host)); + DBUG_PRINT("error",("Got error %d on connect to '%s'", + socket_errno,host)); net->last_errno= CR_CONN_HOST_ERROR; - sprintf(net->last_error ,ER(CR_CONN_HOST_ERROR), host, ERRNO); + sprintf(net->last_error ,ER(CR_CONN_HOST_ERROR), host, socket_errno); if (thr_alarm_in_use(&alarmed)) thr_end_alarm(&alarmed); goto error; diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 11cacf44e8c..49ca09098dd 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -27,7 +27,9 @@ #include <my_base.h> /* Needed by field.h */ #include <my_bitmap.h> +#ifdef __EMX__ #undef write // remove pthread.h macro definition for EMX +#endif typedef ulong table_map; /* Used for table bits in join */ typedef ulong key_map; /* Used for finding keys */ @@ -111,7 +113,7 @@ char* query_table_status(THD *thd,const char *db,const char *table_name); #define FLUSH_TIME 0 /* Don't flush tables */ #define MAX_CONNECT_ERRORS 10 // errors before disabling host -#ifdef __WIN__ +#if defined(__WIN__) || defined(OS2) #define IF_WIN(A,B) (A) #undef FLUSH_TIME #define FLUSH_TIME 1800 /* Flush every half hour */ diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 17f201dfbc8..b228d0e4b15 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -64,7 +64,9 @@ extern "C" { // Because of SCO 3.2V4.2 #include <grp.h> #endif -#ifndef __WIN__ +#if defined(OS2) +# include <sys/un.h> +#elif !defined( __WIN__) #include <sys/resource.h> #ifdef HAVE_SYS_UN_H # include <sys/un.h> @@ -372,6 +374,10 @@ HANDLE hEventShutdown; static NTService Service; // Service object for WinNT #endif +#ifdef OS2 +pthread_cond_t eventShutdown; +#endif + static void start_signal_handler(void); static void *signal_hand(void *arg); static void set_options(void); @@ -419,7 +425,7 @@ static void close_connections(void) (void) pthread_mutex_unlock(&LOCK_manager); /* kill connection thread */ -#if !defined(__WIN__) && !defined(__EMX__) +#if !defined(__WIN__) && !defined(__EMX__) && !defined(OS2) DBUG_PRINT("quit",("waiting for select thread: %lx",select_thread)); (void) pthread_mutex_lock(&LOCK_thread_count); @@ -517,12 +523,14 @@ static void close_connections(void) if (tmp->mysys_var) { tmp->mysys_var->abort=1; - if (tmp->mysys_var->current_mutex) + pthread_mutex_lock(&tmp->mysys_var->mutex); + if (tmp->mysys_var->current_cond) { pthread_mutex_lock(tmp->mysys_var->current_mutex); pthread_cond_broadcast(tmp->mysys_var->current_cond); pthread_mutex_unlock(tmp->mysys_var->current_mutex); } + pthread_mutex_unlock(&tmp->mysys_var->mutex); } } (void) pthread_mutex_unlock(&LOCK_thread_count); // For unlink from list @@ -590,6 +598,8 @@ void kill_mysql(void) // SetEvent(hEventShutdown); // CloseHandle(hEvent); } +#elif defined(OS2) + pthread_cond_signal( &eventShutdown); // post semaphore #elif defined(HAVE_PTHREAD_KILL) if (pthread_kill(signal_thread,SIGTERM)) /* End everything nicely */ { @@ -606,7 +616,10 @@ void kill_mysql(void) /* Force server down. kill all connections and threads and exit */ -#ifndef __WIN__ +#if defined(OS2) +extern "C" void kill_server(int sig_ptr) +#define RETURN_FROM_KILL_SERVER return +#elif !defined(__WIN__) static void *kill_server(void *sig_ptr) #define RETURN_FROM_KILL_SERVER return 0 #else @@ -629,7 +642,7 @@ static void __cdecl kill_server(int sig_ptr) else sql_print_error(ER(ER_GOT_SIGNAL),my_progname,sig); /* purecov: inspected */ -#if defined(USE_ONE_SIGNAL_HAND) && !defined(__WIN__) +#if defined(USE_ONE_SIGNAL_HAND) && !defined(__WIN__) && !defined(OS2) my_thread_init(); // If this is a new thread #endif close_connections(); @@ -637,7 +650,9 @@ static void __cdecl kill_server(int sig_ptr) unireg_abort(1); /* purecov: inspected */ else unireg_end(0); +#ifndef OS2 pthread_exit(0); /* purecov: deadcode */ +#endif RETURN_FROM_KILL_SERVER; } @@ -659,7 +674,7 @@ static sig_handler print_signal_warning(int sig) #ifdef DONT_REMEMBER_SIGNAL sigset(sig,print_signal_warning); /* int. thread system calls */ #endif -#ifndef __WIN__ +#if !defined(__WIN__) && !defined(OS2) if (sig == SIGALRM) alarm(2); /* reschedule alarm */ #endif @@ -669,7 +684,9 @@ static sig_handler print_signal_warning(int sig) void unireg_end(int signal_number __attribute__((unused))) { clean_up(); +#ifndef OS2 pthread_exit(0); // Exit is in main thread +#endif } @@ -770,7 +787,7 @@ static void set_ports() static void set_user(const char *user) { -#ifndef __WIN__ +#if !defined(__WIN__) && !defined(OS2) struct passwd *ent; // don't bother if we aren't superuser @@ -818,7 +835,7 @@ static void set_user(const char *user) static void set_root(const char *path) { -#if !defined(__WIN__) && !defined(__EMX__) +#if !defined(__WIN__) && !defined(__EMX__) && !defined(OS2) if (chroot(path) == -1) { sql_perror("chroot"); @@ -877,7 +894,7 @@ static void server_init(void) } if (listen(ip_sock,(int) back_log) < 0) sql_print_error("Warning: listen() on TCP/IP failed with error %d", - errno); + socket_errno); } if (mysqld_chroot) @@ -964,7 +981,7 @@ static void server_init(void) #endif if (listen(unix_sock,(int) back_log) < 0) sql_print_error("Warning: listen() on Unix socket failed with error %d", - errno); + socket_errno); } #endif DBUG_PRINT("info",("server started")); @@ -1019,6 +1036,7 @@ sig_handler end_thread_signal(int sig __attribute__((unused))) void end_thread(THD *thd, bool put_in_cache) { DBUG_ENTER("end_thread"); + thd->cleanup(); (void) pthread_mutex_lock(&LOCK_thread_count); thread_count--; delete thd; @@ -1111,13 +1129,17 @@ static sig_handler abort_thread(int sig __attribute__((unused))) ** the signal thread is ready before continuing ******************************************************************************/ -#ifdef __WIN__ +#if defined(__WIN__) || defined(OS2) static void init_signals(void) { int signals[] = {SIGINT,SIGILL,SIGFPE,SIGSEGV,SIGTERM,SIGABRT } ; for (uint i=0 ; i < sizeof(signals)/sizeof(int) ; i++) signal( signals[i], kill_server) ; +#if defined(__WIN__) signal(SIGBREAK,SIG_IGN); //ignore SIGBREAK for NT +#else + signal(SIGBREAK, kill_server); +#endif } static void start_signal_handler(void) @@ -1213,8 +1235,13 @@ the thread stack. Please read http://www.mysql.com/doc/L/i/Linux.html\n\n", #ifdef HAVE_STACKTRACE if(!(test_flags & TEST_NO_STACKTRACE)) + { +#ifdef HAVE_GEMINI_DB + utrace(); +#endif print_stacktrace(thd ? (gptr) thd->thread_stack : (gptr) 0, thread_stack); + } if (thd) { fprintf(stderr, "Trying to get some variables.\n\ @@ -1238,6 +1265,12 @@ information that should help you find out what is causing the crash\n"); exit(1); } +#ifndef SA_RESETHAND +#define SA_RESETHAND 0 +#endif +#ifndef SA_NODEFER +#define SA_NODEFER 0 +#endif static void init_signals(void) { @@ -1246,12 +1279,14 @@ static void init_signals(void) sigset(THR_KILL_SIGNAL,end_thread_signal); sigset(THR_SERVER_ALARM,print_signal_warning); // Should never be called! - struct sigaction sa; sa.sa_flags = 0; - sigemptyset(&sa.sa_mask); - sigprocmask(SIG_SETMASK,&sa.sa_mask,NULL); if (!(test_flags & TEST_NO_STACKTRACE) || (test_flags & TEST_CORE_ON_SIGNAL)) { + struct sigaction sa; + sa.sa_flags = SA_RESETHAND | SA_NODEFER; + sigemptyset(&sa.sa_mask); + sigprocmask(SIG_SETMASK,&sa.sa_mask,NULL); + init_stacktrace(); sa.sa_handler=handle_segfault; sigaction(SIGSEGV, &sa, NULL); @@ -1501,6 +1536,29 @@ int __stdcall handle_kill(ulong ctrl_type) } #endif +#ifdef OS2 +pthread_handler_decl(handle_shutdown,arg) +{ + my_thread_init(); + + // wait semaphore + pthread_cond_wait( &eventShutdown, NULL); + + // close semaphore and kill server + pthread_cond_destroy( &eventShutdown); + + // exit main loop on main thread, so kill will be done from + // main thread (this is thread 2) + abort_loop = 1; + + // unblock select() + so_cancel( ip_sock); + so_cancel( unix_sock); + + return 0; +} +#endif + const char *load_default_groups[]= { "mysqld","server",0 }; #ifdef HAVE_LIBWRAP @@ -1586,7 +1644,7 @@ int main(int argc, char **argv) load_defaults("my",load_default_groups,&argc,&argv); defaults_argv=argv; mysql_tmpdir=getenv("TMPDIR"); /* Use this if possible */ -#ifdef __WIN__ +#if defined( __WIN__) || defined(OS2) if (!mysql_tmpdir) mysql_tmpdir=getenv("TEMP"); if (!mysql_tmpdir) @@ -1675,7 +1733,7 @@ int main(int argc, char **argv) my_pthread_attr_setprio(&connection_attrib,WAIT_PRIOR); pthread_attr_setscope(&connection_attrib, PTHREAD_SCOPE_SYSTEM); -#ifdef SET_RLIMIT_NOFILE +#if defined( SET_RLIMIT_NOFILE) || defined( OS2) /* connections and databases neads lots of files */ { uint wanted_files=10+(uint) max(max_connections*5, @@ -1884,6 +1942,14 @@ The server will not act as a slave."); Service.SetShutdownEvent(hEventShutdown); } #endif +#ifdef OS2 + { + pthread_cond_init( &eventShutdown, NULL); + pthread_t hThread; + if (pthread_create(&hThread,&connection_attrib,handle_shutdown,0)) + sql_print_error("Warning: Can't create thread to handle shutdown requests"); + } +#endif if ( #ifdef HAVE_BERKELEY_DB @@ -2092,6 +2158,7 @@ static int bootstrap(FILE *file) (void) pthread_mutex_unlock(&LOCK_thread_count); error= thd->fatal_error; net_end(&thd->net); + thd->cleanup(); delete thd; return error; } @@ -2223,8 +2290,10 @@ pthread_handler_decl(handle_connections_sockets,arg __attribute__((unused))) } #ifdef HAVE_SYS_UN_H FD_SET(unix_sock,&clientFDs); +#ifdef HAVE_FCNTL socket_flags=fcntl(unix_sock, F_GETFL, 0); #endif +#endif DBUG_PRINT("general",("Waiting for connections.")); while (!abort_loop) @@ -2236,10 +2305,10 @@ pthread_handler_decl(handle_connections_sockets,arg __attribute__((unused))) #else if (select((int) max_used_connection,&readFDs,0,0,0) < 0) { - if (errno != EINTR) + if (socket_errno != EINTR) { if (!select_errors++ && !abort_loop) /* purecov: inspected */ - sql_print_error("mysqld: Got error %d from select",errno); /* purecov: inspected */ + sql_print_error("mysqld: Got error %d from select",socket_errno); /* purecov: inspected */ } continue; } @@ -2375,6 +2444,11 @@ pthread_handler_decl(handle_connections_sockets,arg __attribute__((unused))) create_new_thread(thd); } +#ifdef OS2 + // kill server must be invoked from thread 1! + kill_server(MYSQL_KILL_SIGNAL); +#endif + #ifdef __NT__ pthread_mutex_lock(&LOCK_thread_count); handler_count--; @@ -4512,6 +4586,29 @@ static uint set_maximum_open_files(uint max_file_limit) } #endif +#ifdef OS2 +static uint set_maximum_open_files(uint max_file_limit) +{ + LONG cbReqCount; + ULONG cbCurMaxFH, cbCurMaxFH0; + APIRET ulrc; + + // get current limit + cbReqCount = 0; + DosSetRelMaxFH( &cbReqCount, &cbCurMaxFH0); + + // set new limit + cbReqCount = max_file_limit - cbCurMaxFH0; + ulrc = DosSetRelMaxFH( &cbReqCount, &cbCurMaxFH); + if (ulrc) { + sql_print_error("Warning: DosSetRelMaxFH couldn't increase number of open files to more than %d", + cbCurMaxFH0); + cbCurMaxFH = cbCurMaxFH0; + } + + return cbCurMaxFH; +} +#endif /* Return a bitfield from a string of substrings separated by ',' diff --git a/sql/net_serv.cc b/sql/net_serv.cc index cde27d4933a..be08065b589 100644 --- a/sql/net_serv.cc +++ b/sql/net_serv.cc @@ -83,9 +83,15 @@ void sql_print_error(const char *format,...); #define RETRY_COUNT mysqld_net_retry_count extern ulong mysqld_net_retry_count; #else + +#ifdef OS2 /* avoid name conflict */ +#define thr_alarm_t thr_alarm_t_net +#define ALARM ALARM_net +#endif + typedef my_bool thr_alarm_t; typedef my_bool ALARM; -#define thr_alarm_init(A) (*A)=0 +#define thr_alarm_init(A) (*(A))=0 #define thr_alarm_in_use(A) (*(A)) #define thr_end_alarm(A) #define thr_alarm(A,B,C) local_thr_alarm((A),(B),(C)) @@ -136,7 +142,7 @@ int my_net_init(NET *net, Vio* vio) if (vio != 0) /* If real connection */ { net->fd = vio_fd(vio); /* For perl DBI/DBD */ -#if defined(MYSQL_SERVER) && !defined(___WIN__) && !defined(__EMX__) +#if defined(MYSQL_SERVER) && !defined(___WIN__) && !defined(__EMX__) && !defined(OS2) if (!(test_flags & TEST_BLOCKING)) vio_blocking(vio, FALSE); #endif @@ -187,7 +193,7 @@ static my_bool net_realloc(NET *net, ulong length) void net_clear(NET *net) { #ifndef EXTRA_DEBUG - int count; + int count; // One may get 'unused' warning bool is_blocking=vio_is_blocking(net->vio); if (is_blocking) vio_blocking(net->vio, FALSE); @@ -338,7 +344,7 @@ net_real_write(NET *net,const char *packet,ulong len) int length; char *pos,*end; thr_alarm_t alarmed; -#if !defined(__WIN__) +#if !defined(__WIN__) && !defined(__EMX__) && !defined(OS2) ALARM alarm_buff; #endif uint retry_count=0; @@ -396,7 +402,7 @@ net_real_write(NET *net,const char *packet,ulong len) if ((int) (length=vio_write(net->vio,pos,(int) (end-pos))) <= 0) { my_bool interrupted = vio_should_retry(net->vio); -#if (!defined(__WIN__) && !defined(__EMX__)) +#if (!defined(__WIN__) && !defined(__EMX__) && !defined(OS2)) if ((interrupted || length==0) && !thr_alarm_in_use(&alarmed)) { if (!thr_alarm(&alarmed,(uint) net_write_timeout,&alarm_buff)) @@ -521,7 +527,7 @@ my_real_read(NET *net, ulong *complen) uint i,retry_count=0; ulong len=packet_error; thr_alarm_t alarmed; -#if (!defined(__WIN__) && !defined(__EMX__)) || defined(MYSQL_SERVER) +#if (!defined(__WIN__) && !defined(__EMX__) && !defined(OS2)) || defined(MYSQL_SERVER) ALARM alarm_buff; #endif my_bool net_blocking=vio_is_blocking(net->vio); @@ -548,7 +554,7 @@ my_real_read(NET *net, ulong *complen) DBUG_PRINT("info",("vio_read returned %d, errno: %d", length, vio_errno(net->vio))); -#if (!defined(__WIN__) && !defined(__EMX__)) || defined(MYSQL_SERVER) +#if (!defined(__WIN__) && !defined(__EMX__) && !defined(OS2)) || defined(MYSQL_SERVER) /* We got an error that there was no data on the socket. We now set up an alarm to not 'read forever', change the socket to non blocking diff --git a/sql/share/czech/errmsg.txt b/sql/share/czech/errmsg.txt index 4ae22776344..6097679b3d3 100644 --- a/sql/share/czech/errmsg.txt +++ b/sql/share/czech/errmsg.txt @@ -14,198 +14,198 @@ "isamchk", "NE", "ANO", -"Nemohu vytvo-Bøit soubor '%-.64s' (chybový kód: %d)",-A -"Nemohu vytvo-Bøit tabulku '%-.64s' (chybový kód: %d)",-A -"Nemohu vytvo-Bøit databázi '%-.64s', chyba %d",-A -"Nemohu vytvo-Bøit databázi '%-.64s', databáze ji¾ existuje",-A -"Nemohu zru-B¹it databázi '%-.64s', databáze neexistuje",-A -"Chyba p-Bøi ru¹ení databáze (nemohu vymazat '%-.64s', chyba %d)",-A -"Chyba p-Bøi ru¹ení databáze (nemohu vymazat adresáø '%-.64s', chyba %d)",-A -"Chyba p-Bøi výmazu '%-.64s' (chybový kód: %d)",-A -"Nemohu -Bèíst záznam v systémové tabulce",-A -"Nemohu z-Bískat stav '%-.64s' (chybový kód: %d)",-A -"Chyba p-Bøi zji¹»ování pracovní adresáø (chybový kód: %d)",-A -"Nemohu uzamknout soubor (chybov-Bý kód: %d)",-A -"Nemohu otev-Bøít soubor '%-.64s' (chybový kód: %d)",-A -"Nemohu naj-Bít soubor '%-.64s' (chybový kód: %d)",-A -"Nemohu -Bèíst adresáø '%-.64s' (chybový kód: %d)",-A -"Nemohu zm-Bìnit adresáø na '%-.64s' (chybový kód: %d)",-A -"Z-Báznam byl zmìnìn od posledního ètení v tabulce '%-.64s'",-A -"Disk je pln-Bý (%s), èekám na uvolnìní nìjakého místa ...",-A -"Nemohu zapsat, zdvojen-Bý klíè v tabulce '%-.64s'",-A -"Chyba p-Bøi zavírání '%-.64s' (chybový kód: %d)",-A -"Chyba p-Bøi ètení souboru '%-.64s' (chybový kód: %d)",-A -"Chyba p-Bøi pøejmenování '%-.64s' na '%-.64s' (chybový kód: %d)",-A -"Chyba p-Bøi zápisu do souboru '%-.64s' (chybový kód: %d)",-A -"'%-.64s' je zam-Bèen proti zmìnám",-A -"T-Bøídìní pøeru¹eno",-A +"Nemohu vytvo-Bøit soubor '%-.64s' (chybový kód: %d)", +"Nemohu vytvo-Bøit tabulku '%-.64s' (chybový kód: %d)", +"Nemohu vytvo-Bøit databázi '%-.64s', chyba %d", +"Nemohu vytvo-Bøit databázi '%-.64s', databáze ji¾ existuje", +"Nemohu zru-B¹it databázi '%-.64s', databáze neexistuje", +"Chyba p-Bøi ru¹ení databáze (nemohu vymazat '%-.64s', chyba %d)", +"Chyba p-Bøi ru¹ení databáze (nemohu vymazat adresáø '%-.64s', chyba %d)", +"Chyba p-Bøi výmazu '%-.64s' (chybový kód: %d)", +"Nemohu -Bèíst záznam v systémové tabulce", +"Nemohu z-Bískat stav '%-.64s' (chybový kód: %d)", +"Chyba p-Bøi zji¹»ování pracovní adresáø (chybový kód: %d)", +"Nemohu uzamknout soubor (chybov-Bý kód: %d)", +"Nemohu otev-Bøít soubor '%-.64s' (chybový kód: %d)", +"Nemohu naj-Bít soubor '%-.64s' (chybový kód: %d)", +"Nemohu -Bèíst adresáø '%-.64s' (chybový kód: %d)", +"Nemohu zm-Bìnit adresáø na '%-.64s' (chybový kód: %d)", +"Z-Báznam byl zmìnìn od posledního ètení v tabulce '%-.64s'", +"Disk je pln-Bý (%s), èekám na uvolnìní nìjakého místa ...", +"Nemohu zapsat, zdvojen-Bý klíè v tabulce '%-.64s'", +"Chyba p-Bøi zavírání '%-.64s' (chybový kód: %d)", +"Chyba p-Bøi ètení souboru '%-.64s' (chybový kód: %d)", +"Chyba p-Bøi pøejmenování '%-.64s' na '%-.64s' (chybový kód: %d)", +"Chyba p-Bøi zápisu do souboru '%-.64s' (chybový kód: %d)", +"'%-.64s' je zam-Bèen proti zmìnám", +"T-Bøídìní pøeru¹eno", "Pohled '%-.64s' pro '%-.64s' neexistuje", -"Obsluha tabulky vr-Bátila chybu %d",-A -"Obsluha tabulky '%-.64s' nem-Bá tento parametr",-A -"Nemohu naj-Bít záznam v '%-.64s'",-A -"Nespr-Bávná informace v souboru '%-.64s'",-A -"Nespr-Bávný klíè pro tabulku '%-.64s'. Pokuste se ho opravit",-A -"Star-Bý klíèový soubor pro '%-.64s'. Opravte ho.",-A -"'%-.64s' je jen pro -Bètení",-A -"M-Bálo pamìti. Pøestartujte daemona a zkuste znovu (je potøeba %d bytù)",-A -"M-Bálo pamìti pro tøídìní. Zvy¹te velikost tøídícího bufferu",-A -"Neo-Bèekávaný konec souboru pøi ètení '%-.64s' (chybový kód: %d)",-A -"P-Bøíli¹ mnoho spojení",-A -"M-Bálo prostoru/pamìti pro thread",-A -"Nemohu zjistit jm-Béno stroje pro Va¹i adresu",-A -"Chyba p-Bøi ustavování spojení",-A -"P-Bøístup pro u¾ivatele '%-.32s@%-.64s' k databázi '%-.64s' není povolen",-A -"P-Bøístup pro u¾ivatele '%-.32s@%-.64s' (s heslem %s)",-A -"Nebyla vybr-Bána ¾ádná databáze",-A -"Nezn-Bámý pøíkaz",-A -"Sloupec '%-.64s' nem-Bù¾e být null",-A -"Nezn-Bámá databáze '%-.64s'",-A -"Tabulka '%-.64s' ji-B¾ existuje",-A -"Nezn-Bámá tabulka '%-.64s'",-A -"Sloupec '%-.64s' v %s nen-Bí zcela jasný",-A -"Prob-Bíhá ukonèování práce serveru",-A -"Nezn-Bámý sloupec '%-.64s' v %s",-A -"Pou-B¾ité '%-.64s' nebylo v group by",-A -"Nemohu pou-B¾ít group na '%-.64s'",-A -"P-Bøíkaz obsahuje zároveò funkci sum a sloupce",-A -"Po-Bèet sloupcù neodpovídá zadané hodnotì",-A -"Jm-Béno identifikátoru '%-.64s' je pøíli¹ dlouhé",-A -"Zdvojen-Bé jméno sloupce '%-.64s'",-A -"Zdvojen-Bé jméno klíèe '%-.64s'",-A -"Zvojen-Bý klíè '%-.64s' (èíslo klíèe %d)",-A -"Chybn-Bá specifikace sloupce '%-.64s'",-A -"%s bl-Bízko '%-.64s' na øádku %d",-A -"V-Býsledek dotazu je prázdný",-A -"Nejednozna-Bèná tabulka/alias: '%-.64s'",-A -"Chybn-Bá defaultní hodnota pro '%-.64s'",-A -"Definov-Báno více primárních klíèù",-A -"Zad-Báno pøíli¹ mnoho klíèù, je povoleno nejvíce %d klíèù",-A -"Zad-Báno pøíli¹ mnoho èást klíèù, je povoleno nejvíce %d èástí",-A -"Zadan-Bý klíè byl pøíli¹ dlouhý, nejvìt¹í délka klíèe je %d",-A -"Kl-Bíèový sloupec '%-.64s' v tabulce neexistuje",-A -"Blob sloupec '%-.64s' nem-Bù¾e být pou¾it jako klíè",-A -"P-Bøíli¹ velká délka sloupce '%-.64s' (nejvíce %d). Pou¾ijte BLOB",-A -"M-Bù¾ete mít pouze jedno AUTO pole a to musí být definováno jako klíè",-A -"%s: p-Bøipraven na spojení\n",-A -"%s: norm-Bální ukonèení\n",-A -"%s: p-Bøijat signal %d, konèím\n",-A -"%s: ukon-Bèení práce hotovo\n",-A -"%s: n-Básilné uzavøení threadu %ld u¾ivatele '%-.64s'\n",-A -"Nemohu vytvo-Bøit IP socket",-A -"Tabulka '%-.64s' nem-Bá index odpovídající CREATE INDEX. Vytvoøte tabulku znovu",-A -"Argument separ-Bátoru polo¾ek nebyl oèekáván. Pøeètìte si manuál",-A -"Nen-Bí mo¾né pou¾ít pevný rowlength s BLOBem. Pou¾ijte 'fields terminated by'.",-A -"Soubor '%-.64s' mus-Bí být v adresáøi databáze nebo èitelný pro v¹echny",-A -"Soubor '%-.64s' ji-B¾ existuje",-A -"Z-Báznamù: %ld Vymazáno: %ld Pøeskoèeno: %ld Varování: %ld",-A -"Z-Báznamù: %ld Zdvojených: %ld",-A -"Chybn-Bá podèást klíèe -- není to øetìzec nebo je del¹í ne¾ délka èásti klíèe",-A -"Nen-Bí mo¾né vymazat v¹echny polo¾ky s ALTER TABLE. Pou¾ijte DROP TABLE",-A -"Nemohu zru-B¹it '%-.64s' (provést DROP). Zkontrolujte, zda neexistují záznamy/klíèe",-A -"Z-Báznamù: %ld Zdvojených: %ld Varování: %ld",-A -"INSERT TABLE '%-.64s' nen-Bí dovoleno v seznamu tabulek FROM",-A -"Nezn-Bámá identifikace threadu: %lu",-A -"Nejste vlastn-Bíkem threadu %lu",-A -"Nejsou pou-B¾ity ¾ádné tabulky",-A -"P-Bøíli¹ mnoho øetìzcù pro sloupec %s a SET",-A -"Nemohu vytvo-Bøit jednoznaèné jméno logovacího souboru %s.(1-999)\n",-A -"Tabulka '%-.64s' byla zam-Bèena s READ a nemù¾e být zmìnìna",-A -"Tabulka '%-.64s' nebyla zam-Bèena s LOCK TABLES",-A -"Blob polo-B¾ka '%-.64s' nemù¾e mít defaultní hodnotu",-A -"Nep-Bøípustné jméno databáze '%-.64s'",-A -"Nep-Bøípustné jméno tabulky '%-.64s'",-A -"Zadan-Bý SELECT by procházel pøíli¹ mnoho záznamù a trval velmi dlouho. Zkontrolujte tvar WHERE a je-li SELECT v poøádku, pou¾ijte SET OPTION SQL_BIG_SELECTS=1",-A -"Nezn-Bámá chyba",-A -"Nezn-Bámá procedura %s",-A -"Chybn-Bý poèet parametrù procedury %s",-A -"Chybn-Bé parametry procedury %s",-A -"Nezn-Bámá tabulka '%-.64s' v %s",-A -"Polo-B¾ka '%-.64s' je zadána dvakrát",-A -"Nespr-Bávné pou¾ití funkce group",-A -"Tabulka '%-.64s' pou-B¾ívá roz¹íøení, které v této verzi MySQL není",-A -"Tabulka mus-Bí mít alespoò jeden sloupec",-A -"Tabulka '%-.64s' je pln-Bá",-A -"Nezn-Bámá znaková sada: '%-.64s'",-A -"P-Bøíli¹ mnoho tabulek, MySQL jich mù¾e mít v joinu jen %d",-A -"P-Bøíli¹ mnoho polo¾ek",-A -"-BØádek je pøíli¹ velký. Maximální velikost øádku, nepoèítaje polo¾ky blob, je %d. Musíte zmìnit nìkteré polo¾ky na blob",-A -"P-Bøeteèení zásobníku threadu: pou¾ito %ld z %ld. Pou¾ijte 'mysqld -O thread_stack=#' k zadání vìt¹ího zásobníku",-A -"V OUTER JOIN byl nalezen k-Bøí¾ový odkaz. Provìøte ON podmínky",-A -"Sloupec '%-.32s' je pou-B¾it s UNIQUE nebo INDEX, ale není definován jako NOT NULL",-A -"Nemohu na-Bèíst funkci '%-.64s'",-A +"Obsluha tabulky vr-Bátila chybu %d", +"Obsluha tabulky '%-.64s' nem-Bá tento parametr", +"Nemohu naj-Bít záznam v '%-.64s'", +"Nespr-Bávná informace v souboru '%-.64s'", +"Nespr-Bávný klíè pro tabulku '%-.64s'. Pokuste se ho opravit", +"Star-Bý klíèový soubor pro '%-.64s'. Opravte ho.", +"'%-.64s' je jen pro -Bètení", +"M-Bálo pamìti. Pøestartujte daemona a zkuste znovu (je potøeba %d bytù)", +"M-Bálo pamìti pro tøídìní. Zvy¹te velikost tøídícího bufferu", +"Neo-Bèekávaný konec souboru pøi ètení '%-.64s' (chybový kód: %d)", +"P-Bøíli¹ mnoho spojení", +"M-Bálo prostoru/pamìti pro thread", +"Nemohu zjistit jm-Béno stroje pro Va¹i adresu", +"Chyba p-Bøi ustavování spojení", +"P-Bøístup pro u¾ivatele '%-.32s@%-.64s' k databázi '%-.64s' není povolen", +"P-Bøístup pro u¾ivatele '%-.32s@%-.64s' (s heslem %s)", +"Nebyla vybr-Bána ¾ádná databáze", +"Nezn-Bámý pøíkaz", +"Sloupec '%-.64s' nem-Bù¾e být null", +"Nezn-Bámá databáze '%-.64s'", +"Tabulka '%-.64s' ji-B¾ existuje", +"Nezn-Bámá tabulka '%-.64s'", +"Sloupec '%-.64s' v %s nen-Bí zcela jasný", +"Prob-Bíhá ukonèování práce serveru", +"Nezn-Bámý sloupec '%-.64s' v %s", +"Pou-B¾ité '%-.64s' nebylo v group by", +"Nemohu pou-B¾ít group na '%-.64s'", +"P-Bøíkaz obsahuje zároveò funkci sum a sloupce", +"Po-Bèet sloupcù neodpovídá zadané hodnotì", +"Jm-Béno identifikátoru '%-.64s' je pøíli¹ dlouhé", +"Zdvojen-Bé jméno sloupce '%-.64s'", +"Zdvojen-Bé jméno klíèe '%-.64s'", +"Zvojen-Bý klíè '%-.64s' (èíslo klíèe %d)", +"Chybn-Bá specifikace sloupce '%-.64s'", +"%s bl-Bízko '%-.64s' na øádku %d", +"V-Býsledek dotazu je prázdný", +"Nejednozna-Bèná tabulka/alias: '%-.64s'", +"Chybn-Bá defaultní hodnota pro '%-.64s'", +"Definov-Báno více primárních klíèù", +"Zad-Báno pøíli¹ mnoho klíèù, je povoleno nejvíce %d klíèù", +"Zad-Báno pøíli¹ mnoho èást klíèù, je povoleno nejvíce %d èástí", +"Zadan-Bý klíè byl pøíli¹ dlouhý, nejvìt¹í délka klíèe je %d", +"Kl-Bíèový sloupec '%-.64s' v tabulce neexistuje", +"Blob sloupec '%-.64s' nem-Bù¾e být pou¾it jako klíè", +"P-Bøíli¹ velká délka sloupce '%-.64s' (nejvíce %d). Pou¾ijte BLOB", +"M-Bù¾ete mít pouze jedno AUTO pole a to musí být definováno jako klíè", +"%s: p-Bøipraven na spojení\n", +"%s: norm-Bální ukonèení\n", +"%s: p-Bøijat signal %d, konèím\n", +"%s: ukon-Bèení práce hotovo\n", +"%s: n-Básilné uzavøení threadu %ld u¾ivatele '%-.64s'\n", +"Nemohu vytvo-Bøit IP socket", +"Tabulka '%-.64s' nem-Bá index odpovídající CREATE INDEX. Vytvoøte tabulku znovu", +"Argument separ-Bátoru polo¾ek nebyl oèekáván. Pøeètìte si manuál", +"Nen-Bí mo¾né pou¾ít pevný rowlength s BLOBem. Pou¾ijte 'fields terminated by'.", +"Soubor '%-.64s' mus-Bí být v adresáøi databáze nebo èitelný pro v¹echny", +"Soubor '%-.64s' ji-B¾ existuje", +"Z-Báznamù: %ld Vymazáno: %ld Pøeskoèeno: %ld Varování: %ld", +"Z-Báznamù: %ld Zdvojených: %ld", +"Chybn-Bá podèást klíèe -- není to øetìzec nebo je del¹í ne¾ délka èásti klíèe", +"Nen-Bí mo¾né vymazat v¹echny polo¾ky s ALTER TABLE. Pou¾ijte DROP TABLE", +"Nemohu zru-B¹it '%-.64s' (provést DROP). Zkontrolujte, zda neexistují záznamy/klíèe", +"Z-Báznamù: %ld Zdvojených: %ld Varování: %ld", +"INSERT TABLE '%-.64s' nen-Bí dovoleno v seznamu tabulek FROM", +"Nezn-Bámá identifikace threadu: %lu", +"Nejste vlastn-Bíkem threadu %lu", +"Nejsou pou-B¾ity ¾ádné tabulky", +"P-Bøíli¹ mnoho øetìzcù pro sloupec %s a SET", +"Nemohu vytvo-Bøit jednoznaèné jméno logovacího souboru %s.(1-999)\n", +"Tabulka '%-.64s' byla zam-Bèena s READ a nemù¾e být zmìnìna", +"Tabulka '%-.64s' nebyla zam-Bèena s LOCK TABLES", +"Blob polo-B¾ka '%-.64s' nemù¾e mít defaultní hodnotu", +"Nep-Bøípustné jméno databáze '%-.64s'", +"Nep-Bøípustné jméno tabulky '%-.64s'", +"Zadan-Bý SELECT by procházel pøíli¹ mnoho záznamù a trval velmi dlouho. Zkontrolujte tvar WHERE a je-li SELECT v poøádku, pou¾ijte SET OPTION SQL_BIG_SELECTS=1", +"Nezn-Bámá chyba", +"Nezn-Bámá procedura %s", +"Chybn-Bý poèet parametrù procedury %s", +"Chybn-Bé parametry procedury %s", +"Nezn-Bámá tabulka '%-.64s' v %s", +"Polo-B¾ka '%-.64s' je zadána dvakrát", +"Nespr-Bávné pou¾ití funkce group", +"Tabulka '%-.64s' pou-B¾ívá roz¹íøení, které v této verzi MySQL není", +"Tabulka mus-Bí mít alespoò jeden sloupec", +"Tabulka '%-.64s' je pln-Bá", +"Nezn-Bámá znaková sada: '%-.64s'", +"P-Bøíli¹ mnoho tabulek, MySQL jich mù¾e mít v joinu jen %d", +"P-Bøíli¹ mnoho polo¾ek", +"-BØádek je pøíli¹ velký. Maximální velikost øádku, nepoèítaje polo¾ky blob, je %d. Musíte zmìnit nìkteré polo¾ky na blob", +"P-Bøeteèení zásobníku threadu: pou¾ito %ld z %ld. Pou¾ijte 'mysqld -O thread_stack=#' k zadání vìt¹ího zásobníku", +"V OUTER JOIN byl nalezen k-Bøí¾ový odkaz. Provìøte ON podmínky", +"Sloupec '%-.32s' je pou-B¾it s UNIQUE nebo INDEX, ale není definován jako NOT NULL", +"Nemohu na-Bèíst funkci '%-.64s'", "Nemohu inicializovat funkci '%-.64s'; %-.80s", -"Pro sd-Bílenou knihovnu nejsou povoleny cesty",-A -"Funkce '%-.64s' ji-B¾ existuje",-A -"Nemohu otev-Bøít sdílenou knihovnu '%-.64s' (errno: %d %s)",-A -"Nemohu naj-Bít funkci '%-.64s' v knihovnì'",-A -"Funkce '%-.64s' nen-Bí definována",-A -"Stroj '%-.64s' je zablokov-Bán kvùli mnoha chybám pøi pøipojování. Odblokujete pou¾itím 'mysqladmin flush-hosts'",-A -"Stroj '%-.64s' nem-Bá povoleno se k tomuto MySQL serveru pøipojit",-A -"Pou-B¾íváte MySQL jako anonymní u¾ivatel a anonymní u¾ivatelé nemají povoleno mìnit hesla",-A -"Na zm-Bìnu hesel ostatním musíte mít právo provést update tabulek v databázi mysql",-A -"V tabulce user nen-Bí ¾ádný odpovídající øádek",-A -"Nalezen-Bých øádkù: %ld Zmìnìno: %ld Varování: %ld",-A -"Nemohu vytvo-Bøit nový thread (errno %d). Pokud je je¹tì nìjaká volná pamì», podívejte se do manuálu na èást o chybách specifických pro jednotlivé operaèní systémy",-A -"Po-Bèet sloupcù neodpovídá poètu hodnot na øádku %ld",-A -"Nemohu znovuotev-Bøít tabulku: '%-.64s',-A -"Neplatn-Bé u¾ití hodnoty NULL",-A -"Regul-Bární výraz vrátil chybu '%-.64s'",-A -"Pokud nen-Bí ¾ádná GROUP BY klauzule, není dovoleno souèasné pou¾ití GROUP polo¾ek (MIN(),MAX(),COUNT()...) s ne GROUP polo¾kami",-A -"Neexistuje odpov-Bídající grant pro u¾ivatele '%-.32s' na stroji '%-.64s'",-A -"%-.16s p-Bøíkaz nepøístupný pro u¾ivatele: '%-.32s@%-.64s' pro tabulku '%-.64s'",-A -"%-.16s p-Bøíkaz nepøístupný pro u¾ivatele: '%-.32s@%-.64s' pro sloupec '%-.64s' v tabulce '%-.64s'",-A -"Neplatn-Bý pøíkaz GRANT/REVOKE. Prosím, pøeètìte si v manuálu, jaká privilegia je mo¾né pou¾ít.",-A -"Argument p-Bøíkazu GRANT u¾ivatel nebo stroj je pøíli¹ dlouhý",-A +"Pro sd-Bílenou knihovnu nejsou povoleny cesty", +"Funkce '%-.64s' ji-B¾ existuje", +"Nemohu otev-Bøít sdílenou knihovnu '%-.64s' (errno: %d %s)", +"Nemohu naj-Bít funkci '%-.64s' v knihovnì'", +"Funkce '%-.64s' nen-Bí definována", +"Stroj '%-.64s' je zablokov-Bán kvùli mnoha chybám pøi pøipojování. Odblokujete pou¾itím 'mysqladmin flush-hosts'", +"Stroj '%-.64s' nem-Bá povoleno se k tomuto MySQL serveru pøipojit", +"Pou-B¾íváte MySQL jako anonymní u¾ivatel a anonymní u¾ivatelé nemají povoleno mìnit hesla", +"Na zm-Bìnu hesel ostatním musíte mít právo provést update tabulek v databázi mysql", +"V tabulce user nen-Bí ¾ádný odpovídající øádek", +"Nalezen-Bých øádkù: %ld Zmìnìno: %ld Varování: %ld", +"Nemohu vytvo-Bøit nový thread (errno %d). Pokud je je¹tì nìjaká volná pamì», podívejte se do manuálu na èást o chybách specifických pro jednotlivé operaèní systémy", +"Po-Bèet sloupcù neodpovídá poètu hodnot na øádku %ld", +"Nemohu znovuotev-Bøít tabulku: '%-.64s', +"Neplatn-Bé u¾ití hodnoty NULL", +"Regul-Bární výraz vrátil chybu '%-.64s'", +"Pokud nen-Bí ¾ádná GROUP BY klauzule, není dovoleno souèasné pou¾ití GROUP polo¾ek (MIN(),MAX(),COUNT()...) s ne GROUP polo¾kami", +"Neexistuje odpov-Bídající grant pro u¾ivatele '%-.32s' na stroji '%-.64s'", +"%-.16s p-Bøíkaz nepøístupný pro u¾ivatele: '%-.32s@%-.64s' pro tabulku '%-.64s'", +"%-.16s p-Bøíkaz nepøístupný pro u¾ivatele: '%-.32s@%-.64s' pro sloupec '%-.64s' v tabulce '%-.64s'", +"Neplatn-Bý pøíkaz GRANT/REVOKE. Prosím, pøeètìte si v manuálu, jaká privilegia je mo¾né pou¾ít.", +"Argument p-Bøíkazu GRANT u¾ivatel nebo stroj je pøíli¹ dlouhý", "Tabulka '%-64s.%s' neexistuje", -"Neexistuje odpov-Bídající grant pro u¾ivatele '%-.32s' na stroji '%-.64s' pro tabulku '%-.64s'",-A -"Pou-B¾itý pøíkaz není v této verzi MySQL povolen",-A -"Va-B¹e syntaxe je nìjaká divná",-A -"Zpo-B¾dìný insert threadu nebyl schopen získat po¾adovaný zámek pro tabulku %-.64s",-A -"P-Bøíli¹ mnoho zpo¾dìných threadù",-A -"Zru-B¹eno spojení %ld do databáze: '%-.64s' u¾ivatel: '%-.64s' (%s)",-A -"Zji-B¹tìn pøíchozí packet del¹í ne¾ 'max_allowed_packet'",-A -"Zji-B¹tìna chyba pøi ètení z roury spojení",-A -"Zji-B¹tìna chyba fcntl()",-A -"P-Bøíchozí packety v chybném poøadí",-A -"Nemohu rozkomprimovat komunika-Bèní packet",-A -"Zji-B¹tìna chyba pøi ètení komunikaèního packetu",-A -"Zji-B¹tìn timeout pøi ètení komunikaèního packetu",-A -"Zji-B¹tìna chyba pøi zápisu komunikaèního packetu",-A -"Zji-B¹tìn timeout pøi zápisu komunikaèního packetu",-A -"V-Býsledný øetìzec je del¹í ne¾ max_allowed_packet",-A -"Typ pou-B¾ité tabulky nepodporuje BLOB/TEXT sloupce",-A -"Typ pou-B¾ité tabulky nepodporuje AUTO_INCREMENT sloupce",-A -"INSERT DELAYED nen-Bí mo¾no s tabulkou '%-.64s' pou¾ít, proto¾e je zamèená pomocí LOCK TABLES",-A -"Nespr-Bávné jméno sloupce '%-.100s'",-A -"Handler pou-B¾ité tabulky neumí indexovat sloupce '%-.64s'",-A -"V-B¹echny tabulky v MERGE tabulce nejsou definovány stejnì",-A -"Kv-Bùli unique constraintu nemozu zapsat do tabulky '%-.64s'",-A -"BLOB sloupec '%-.64s' je pou-B¾it ve specifikaci klíèe bez délky",-A -"V-B¹echny èásti primárního klíèe musejí být NOT NULL; pokud potøebujete NULL, pou¾ijte UNIQUE",-A -"V-Býsledek obsahuje více ne¾ jeden øádek",-A -"Tento typ tabulky vy-B¾aduje primární klíè",-A -"Tato verze MySQL nen-Bí zkompilována s podporou RAID",-A -"Update tabulky bez WHERE s kl-Bíèem není v módu bezpeèných update dovoleno",-A -"Kl-Bíè '%-.64s' v tabulce '%-.64s' neexistuje",-A -"Nemohu otev-Bøít tabulku",-A +"Neexistuje odpov-Bídající grant pro u¾ivatele '%-.32s' na stroji '%-.64s' pro tabulku '%-.64s'", +"Pou-B¾itý pøíkaz není v této verzi MySQL povolen", +"Va-B¹e syntaxe je nìjaká divná", +"Zpo-B¾dìný insert threadu nebyl schopen získat po¾adovaný zámek pro tabulku %-.64s", +"P-Bøíli¹ mnoho zpo¾dìných threadù", +"Zru-B¹eno spojení %ld do databáze: '%-.64s' u¾ivatel: '%-.64s' (%s)", +"Zji-B¹tìn pøíchozí packet del¹í ne¾ 'max_allowed_packet'", +"Zji-B¹tìna chyba pøi ètení z roury spojení", +"Zji-B¹tìna chyba fcntl()", +"P-Bøíchozí packety v chybném poøadí", +"Nemohu rozkomprimovat komunika-Bèní packet", +"Zji-B¹tìna chyba pøi ètení komunikaèního packetu", +"Zji-B¹tìn timeout pøi ètení komunikaèního packetu", +"Zji-B¹tìna chyba pøi zápisu komunikaèního packetu", +"Zji-B¹tìn timeout pøi zápisu komunikaèního packetu", +"V-Býsledný øetìzec je del¹í ne¾ max_allowed_packet", +"Typ pou-B¾ité tabulky nepodporuje BLOB/TEXT sloupce", +"Typ pou-B¾ité tabulky nepodporuje AUTO_INCREMENT sloupce", +"INSERT DELAYED nen-Bí mo¾no s tabulkou '%-.64s' pou¾ít, proto¾e je zamèená pomocí LOCK TABLES", +"Nespr-Bávné jméno sloupce '%-.100s'", +"Handler pou-B¾ité tabulky neumí indexovat sloupce '%-.64s'", +"V-B¹echny tabulky v MERGE tabulce nejsou definovány stejnì", +"Kv-Bùli unique constraintu nemozu zapsat do tabulky '%-.64s'", +"BLOB sloupec '%-.64s' je pou-B¾it ve specifikaci klíèe bez délky", +"V-B¹echny èásti primárního klíèe musejí být NOT NULL; pokud potøebujete NULL, pou¾ijte UNIQUE", +"V-Býsledek obsahuje více ne¾ jeden øádek", +"Tento typ tabulky vy-B¾aduje primární klíè", +"Tato verze MySQL nen-Bí zkompilována s podporou RAID", +"Update tabulky bez WHERE s kl-Bíèem není v módu bezpeèných update dovoleno", +"Kl-Bíè '%-.64s' v tabulce '%-.64s' neexistuje", +"Nemohu otev-Bøít tabulku", "Handler tabulky nepodporuje check/repair", -"Proveden-Bí tohoto pøíkazu není v transakci dovoleno",-A -"Chyba %d p-Bøi COMMIT",-A -"Chyba %d p-Bøi ROLLBACK",-A -"Chyba %d p-Bøi FLUSH_LOGS",-A -"Chyba %d p-Bøi CHECKPOINT",-A -"Spojen-Bí %ld do databáze: '%-.64s' u¾ivatel: '%-.32s' stroj: `%-.64s' (%-.64s) bylo pøeru¹eno",-A -"Handler tabulky nepodporuje bin-Bární dump",-A -"Binlog uzav-Bøen pøi pokusu o FLUSH MASTER",-A -"P-Bøebudování indexu dumpnuté tabulky '%-.64s' nebylo úspì¹né",-A +"Proveden-Bí tohoto pøíkazu není v transakci dovoleno", +"Chyba %d p-Bøi COMMIT", +"Chyba %d p-Bøi ROLLBACK", +"Chyba %d p-Bøi FLUSH_LOGS", +"Chyba %d p-Bøi CHECKPOINT", +"Spojen-Bí %ld do databáze: '%-.64s' u¾ivatel: '%-.32s' stroj: `%-.64s' (%-.64s) bylo pøeru¹eno", +"Handler tabulky nepodporuje bin-Bární dump", +"Binlog uzav-Bøen pøi pokusu o FLUSH MASTER", +"P-Bøebudování indexu dumpnuté tabulky '%-.64s' nebylo úspì¹né", "Chyba masteru: '%-.64s'", -"S-Bí»ová chyba pøi ètení z masteru",-A -"S-Bí»ová chyba pøi zápisu na master",-A -"-B®ádný sloupec nemá vytvoøen fulltextový index",-A -"Nemohu prov-Bést zadaný pøíkaz, proto¾e existují aktivní zamèené tabulky nebo aktivní transakce",-A -"Nezn-Bámá systémová promìnná '%-.64'",-A -"Tabulka '%-.64s' je ozna-Bèena jako poru¹ená a mìla by být opravena",-A -"Tabulka '%-.64s' je ozna-Bèena jako poru¹ená a poslední (automatická?) oprava se nezdaøila",-A +"S-Bí»ová chyba pøi ètení z masteru", +"S-Bí»ová chyba pøi zápisu na master", +"-B®ádný sloupec nemá vytvoøen fulltextový index", +"Nemohu prov-Bést zadaný pøíkaz, proto¾e existují aktivní zamèené tabulky nebo aktivní transakce", +"Nezn-Bámá systémová promìnná '%-.64'", +"Tabulka '%-.64s' je ozna-Bèena jako poru¹ená a mìla by být opravena", +"Tabulka '%-.64s' je ozna-Bèena jako poru¹ená a poslední (automatická?) oprava se nezdaøila", "Warning: Some non-transactional changed tables couldn't be rolled back", "Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage. Increase this mysqld variable and try again', "This operation cannot be performed with a running slave, run SLAVE STOP first", @@ -222,6 +222,7 @@ "CREATE DATABASE not allowed while thread is holding global read lock", "Wrong arguments to %s", "%-.32s@%-.64s is not allowed to create new users", +"Incorrect table definition; All MERGE tables must be in the same database", "Error connecting to master: %-.128s", "Error running query on master: %-.128s", "Error when executing command %s: %-.128s", diff --git a/sql/share/danish/errmsg.txt b/sql/share/danish/errmsg.txt index f511a5d177c..805740664d0 100644 --- a/sql/share/danish/errmsg.txt +++ b/sql/share/danish/errmsg.txt @@ -216,6 +216,7 @@ "CREATE DATABASE er ikke tilladt mens en tråd holder på globalt read lock", "Wrong arguments to %s", "%-.32s@%-.64s is not allowed to create new users", +"Incorrect table definition; All MERGE tables must be in the same database", "Error connecting to master: %-.128s", "Error running query on master: %-.128s", "Error when executing command %s: %-.128s", diff --git a/sql/share/dutch/errmsg.txt b/sql/share/dutch/errmsg.txt index 91237c691c0..245ff40cf86 100644 --- a/sql/share/dutch/errmsg.txt +++ b/sql/share/dutch/errmsg.txt @@ -217,6 +217,7 @@ "CREATE DATABASE niet toegestaan terwijl thread een globale 'read lock' bezit", "Foutieve parameters voor %s", "%-.32s@%-.64s is not allowed to create new users", +"Incorrect table definition; All MERGE tables must be in the same database", "Error connecting to master: %-.128s", "Error running query on master: %-.128s", "Error when executing command %s: %-.128s", diff --git a/sql/share/english/errmsg.txt b/sql/share/english/errmsg.txt index d120575d9af..185d8ffbe33 100644 --- a/sql/share/english/errmsg.txt +++ b/sql/share/english/errmsg.txt @@ -213,6 +213,7 @@ "CREATE DATABASE not allowed while thread is holding global read lock", "Wrong arguments to %s", "%-.32s@%-.64s is not allowed to create new users", +"Incorrect table definition; All MERGE tables must be in the same database", "Error connecting to master: %-.128s", "Error running query on master: %-.128s", "Error when executing command %s: %-.128s", diff --git a/sql/share/estonian/errmsg.txt b/sql/share/estonian/errmsg.txt index 929b97e6146..5023ead91e7 100644 --- a/sql/share/estonian/errmsg.txt +++ b/sql/share/estonian/errmsg.txt @@ -217,6 +217,7 @@ "CREATE DATABASE not allowed while thread is holding global read lock", "Wrong arguments to %s", "%-.32s@%-.64s is not allowed to create new users", +"Incorrect table definition; All MERGE tables must be in the same database", "Error connecting to master: %-.128s", "Error running query on master: %-.128s", "Error when executing command %s: %-.128s", diff --git a/sql/share/french/errmsg.txt b/sql/share/french/errmsg.txt index 03589a91c77..1f282dc078d 100644 --- a/sql/share/french/errmsg.txt +++ b/sql/share/french/errmsg.txt @@ -213,6 +213,7 @@ "CREATE DATABASE not allowed while thread is holding global read lock", "Wrong arguments to %s", "%-.32s@%-.64s is not allowed to create new users", +"Incorrect table definition; All MERGE tables must be in the same database", "Error connecting to master: %-.128s", "Error running query on master: %-.128s", "Error when executing command %s: %-.128s", diff --git a/sql/share/german/errmsg.txt b/sql/share/german/errmsg.txt index deded796403..dd744ecab46 100644 --- a/sql/share/german/errmsg.txt +++ b/sql/share/german/errmsg.txt @@ -216,6 +216,7 @@ "CREATE DATABASE not allowed while thread is holding global read lock", "Wrong arguments to %s", "%-.32s@%-.64s is not allowed to create new users", +"Incorrect table definition; All MERGE tables must be in the same database", "Error connecting to master: %-.128s", "Error running query on master: %-.128s", "Error when executing command %s: %-.128s", diff --git a/sql/share/greek/errmsg.txt b/sql/share/greek/errmsg.txt index c6255689ee4..850bac1756b 100644 --- a/sql/share/greek/errmsg.txt +++ b/sql/share/greek/errmsg.txt @@ -213,6 +213,7 @@ "CREATE DATABASE not allowed while thread is holding global read lock", "Wrong arguments to %s", "%-.32s@%-.64s is not allowed to create new users", +"Incorrect table definition; All MERGE tables must be in the same database", "Error connecting to master: %-.128s", "Error running query on master: %-.128s", "Error when executing command %s: %-.128s", diff --git a/sql/share/hungarian/errmsg.txt b/sql/share/hungarian/errmsg.txt index fbedda7e329..6e1d1af015e 100644 --- a/sql/share/hungarian/errmsg.txt +++ b/sql/share/hungarian/errmsg.txt @@ -215,6 +215,7 @@ "CREATE DATABASE not allowed while thread is holding global read lock", "Wrong arguments to %s", "%-.32s@%-.64s is not allowed to create new users", +"Incorrect table definition; All MERGE tables must be in the same database", "Error connecting to master: %-.128s", "Error running query on master: %-.128s", "Error when executing command %s: %-.128s", diff --git a/sql/share/italian/errmsg.txt b/sql/share/italian/errmsg.txt index f419ddb7e0c..5d10578a6cf 100644 --- a/sql/share/italian/errmsg.txt +++ b/sql/share/italian/errmsg.txt @@ -213,6 +213,7 @@ "CREATE DATABASE not allowed while thread is holding global read lock", "Wrong arguments to %s", "%-.32s@%-.64s is not allowed to create new users", +"Incorrect table definition; All MERGE tables must be in the same database", "Error connecting to master: %-.128s", "Error running query on master: %-.128s", "Error when executing command %s: %-.128s", diff --git a/sql/share/japanese/errmsg.txt b/sql/share/japanese/errmsg.txt index 2f4b72f8cc1..1ed9b4aa346 100644 --- a/sql/share/japanese/errmsg.txt +++ b/sql/share/japanese/errmsg.txt @@ -215,6 +215,7 @@ "CREATE DATABASE not allowed while thread is holding global read lock", "Wrong arguments to %s", "%-.32s@%-.64s is not allowed to create new users", +"Incorrect table definition; All MERGE tables must be in the same database", "Error connecting to master: %-.128s", "Error running query on master: %-.128s", "Error when executing command %s: %-.128s", diff --git a/sql/share/korean/errmsg.txt b/sql/share/korean/errmsg.txt index f5f5539b8a2..8b2d689bff5 100644 --- a/sql/share/korean/errmsg.txt +++ b/sql/share/korean/errmsg.txt @@ -213,6 +213,7 @@ "CREATE DATABASE not allowed while thread is holding global read lock", "Wrong arguments to %s", "%-.32s@%-.64s is not allowed to create new users", +"Incorrect table definition; All MERGE tables must be in the same database", "Error connecting to master: %-.128s", "Error running query on master: %-.128s", "Error when executing command %s: %-.128s", diff --git a/sql/share/norwegian-ny/errmsg.txt b/sql/share/norwegian-ny/errmsg.txt index d87da187577..267eae13d67 100644 --- a/sql/share/norwegian-ny/errmsg.txt +++ b/sql/share/norwegian-ny/errmsg.txt @@ -215,6 +215,7 @@ "CREATE DATABASE not allowed while thread is holding global read lock", "Wrong arguments to %s", "%-.32s@%-.64s is not allowed to create new users", +"Incorrect table definition; All MERGE tables must be in the same database", "Error connecting to master: %-.128s", "Error running query on master: %-.128s", "Error when executing command %s: %-.128s", diff --git a/sql/share/norwegian/errmsg.txt b/sql/share/norwegian/errmsg.txt index 1d54c9aec03..8a7112ac0c1 100644 --- a/sql/share/norwegian/errmsg.txt +++ b/sql/share/norwegian/errmsg.txt @@ -215,6 +215,7 @@ "CREATE DATABASE not allowed while thread is holding global read lock", "Wrong arguments to %s", "%-.32s@%-.64s is not allowed to create new users", +"Incorrect table definition; All MERGE tables must be in the same database", "Error connecting to master: %-.128s", "Error running query on master: %-.128s", "Error when executing command %s: %-.128s", diff --git a/sql/share/polish/errmsg.txt b/sql/share/polish/errmsg.txt index 1c93fcc7f8f..6ae12f7bff1 100644 --- a/sql/share/polish/errmsg.txt +++ b/sql/share/polish/errmsg.txt @@ -217,6 +217,7 @@ "CREATE DATABASE not allowed while thread is holding global read lock", "Wrong arguments to %s", "%-.32s@%-.64s is not allowed to create new users", +"Incorrect table definition; All MERGE tables must be in the same database", "Error connecting to master: %-.128s", "Error running query on master: %-.128s", "Error when executing command %s: %-.128s", diff --git a/sql/share/portuguese/errmsg.txt b/sql/share/portuguese/errmsg.txt index 29a52900b24..787fae883ea 100644 --- a/sql/share/portuguese/errmsg.txt +++ b/sql/share/portuguese/errmsg.txt @@ -1,6 +1,6 @@ /* Copyright Abandoned 1997 TCX DataKonsult AB & Monty Program KB & Detron HB This file is public domain and comes with NO WARRANTY of any kind */ -/* Updated by Roberto M. Serqueira - martinsc@uol.com.br - 05.24.2001 */ +/* Updated by Roberto de Martin Serqueira - martinsc@uol.com.br - 08.20.2001 */ "hashchk", "isamchk", "não", @@ -35,14 +35,14 @@ "Manipulador de tabela para '%-.64s' não tem esta opção", "Não pode encontrar registro em '%-.64s'", "Informação incorreta no arquivo '%-.64s'", -"Arquivo chave incorreto para tabela '%-.64s'. Tente reparar", +"Arquivo de índice incorreto para tabela '%-.64s'. Tente reparar", "Arquivo chave desatualizado para tabela '%-.64s'. Repare-o!", "Tabela '%-.64s' é somente para leitura", "Sem memória. Reinicie o programa e tente novamente (necessita de %d bytes)", "Sem memória para ordenação. Aumente tamanho do 'buffer' de ordenação", "Encontrado fim de arquivo inesperado ao ler arquivo '%-.64s' (erro no. %d)", "Excesso de conexões", -"Sem memória. Verifique se o mysqld ou algum outro processo está usando toda memória disponível. Se não, você pode ter que usar 'ulimit' para permitir ao mysqld usar mais memória ou se você pode adicionar mais área de 'swap'", +"Sem memória. Verifique se o mysqld ou algum outro processo está usando toda memória disponível. Se não, você pode ter que usar 'ulimit' para permitir ao mysqld usar mais memória ou você pode adicionar mais área de 'swap'", "Não pode obter nome do 'host' para seu endereço", "Negociação de acesso falhou", "Acesso negado para o usuário '%-.32s@%-.64s' ao banco de dados '%-.64s'", @@ -58,7 +58,7 @@ "Coluna '%-.64s' desconhecida em '%-.64s'", "'%-.64s' não está em 'GROUP BY'", "Não pode agrupar em '%-.64s'", -"Cláusula contém funções de soma e colunas juntos", +"Cláusula contém funções de soma e colunas juntas", "Contagem de colunas não confere com a contagem de valores", "Nome identificador '%-.100s' é longo demais", "Nome da coluna '%-.64s' duplicado", @@ -72,27 +72,27 @@ "Definida mais de uma chave primária", "Especificadas chaves demais. O máximo permitido são %d chaves", "Especificadas partes de chave demais. O máximo permitido são %d partes", -"Chave especificada longa demais. O comprimento máximo permitido é %d", +"Chave especificada longa demais. O comprimento de chave máximo permitido é %d", "Coluna chave '%-.64s' não existe na tabela", "Coluna BLOB '%-.64s' não pode ser utilizada na especificação de chave para o tipo de tabela usado", "Comprimento da coluna '%-.64s' grande demais (max = %d). Use BLOB em seu lugar", -"Definição incorreta de tabela. Somente é permitido um campo auto-incrementado e ele tem que ser definido como chave", +"Definição incorreta de tabela. Somente é permitido um único campo auto-incrementado e ele tem que ser definido como chave", "%s: Pronto para conexões\n", "%s: 'Shutdown' normal\n", "%s: Obteve sinal %d. Abortando!\n", "%s: 'Shutdown' completo\n", "%s: Forçando finalização da 'thread' %ld - usuário '%-.32s'\n", -"Não pode criar 'socket' IP", +"Não pode criar 'IP socket'", "Tabela '%-.64s' não possui um índice como o usado em CREATE INDEX. Recrie a tabela", "Argumento separador de campos não é o esperado. Confira no manual", "Você não pode usar comprimento de linha fixo com BLOBs. Favor usar 'fields terminated by'", -"Arquivo '%-.64s' tem que estar no diretório do banco de dados ou ter leitura permitida para todos", +"Arquivo '%-.64s' tem que estar no diretório do banco de dados ou ter leitura possível para todos", "Arquivo '%-.80s' já existe", "Registros: %ld - Deletados: %ld - Ignorados: %ld - Avisos: %ld", "Registros: %ld - Duplicados: %ld", -"Parte de chave incorreta. A parte de chave usada não é um 'string' ou o comprimento usado é maior do que a parte de chave", +"Parte de chave incorreta. A parte de chave usada não é um 'string' ou o comprimento usado é maior do que a parte de chave ou o manipulador de tabelas não aceita partes de chaves únicas", "Você não pode deletar todas as colunas com ALTER TABLE. Use DROP TABLE em seu lugar", -"Não pode fazer DROP '%-.64s'. Confira se este campo/chave existe", +"Não pode fazer DROP '%-.64s'. Confira se esta coluna/chave existe", "Registros: %ld - Duplicados: %ld - Avisos: %ld", "INSERT TABLE '%-.64s' não é permitido em lista de tabelas FROM", "'Id' de 'thread' %lu desconhecido", @@ -112,14 +112,14 @@ "Parâmetros incorretos para a 'procedure' '%-.64s'", "Tabela '%-.64s' desconhecida em '%-.32s'", "Coluna '%-.64s' especificada duas vezes", -"Uso inválido da função GROUP", +"Uso inválido de função de grupo", "Tabela '%-.64s' usa uma extensão que não existe nesta versão do MySQL", "Uma tabela tem que ter pelo menos uma (1) coluna", "Tabela '%-.64s' está cheia", "Conjunto de caracteres '%-.64s' desconhecido", "Tabelas demais. O MySQL pode usar somente %d tabelas em um JOIN", "Colunas demais", -"Tamanho de linha grande demais. O máximo tamanho de linha, não contando BLOBs, é de %d. Você tem que mudar alguns campos para BLOBs", +"Tamanho de linha grande demais. O máximo tamanho de linha, não contando BLOBs, é %d. Você tem que mudar alguns campos para BLOBs", "Estouro da pilha do 'thread'. Usados %ld de uma pilha de %ld . Use 'mysqld -O thread_stack=#' para especificar uma pilha maior, se necessário", "Dependência cruzada encontrada em OUTER JOIN. Examine suas condições ON", "Coluna '%-.64s' é usada com UNIQUE ou INDEX, mas não está definida como NOT NULL", @@ -136,7 +136,7 @@ "Você tem que ter o privilégio para atualizar tabelas no banco de dados mysql para ser capaz de mudar a senha de outros", "Não pode encontrar nenhuma linha que combine na tabela user", "Linhas que combinaram: %ld - Alteradas: %ld - Avisos: %ld", -"Não pode criar uma nova 'thread' (erro no. %d). Se você não estiver sem memória disponível, você pode consultar o manual sobre uma possível falha dependente do sistema operacional", +"Não pode criar uma nova 'thread' (erro no. %d). Se você não estiver sem memória disponível, você pode consultar o manual sobre um possível 'bug' dependente do sistema operacional", "Contagem de colunas não confere com a contagem de valores na linha %ld", "Não pode reabrir a tabela '%-.64s', "Uso inválido do valor NULL", @@ -151,22 +151,22 @@ "Não existe tal 'grant' definido para o usuário '%-.32s' no 'host' '%-.64s', na tabela '%-.64s'", "Comando usado não é permitido para esta versão do MySQL", "Você tem um erro de sintaxe no seu SQL", -"'Thread' de inserção retardada ('delayed') não conseguiu obter trava solicitada na tabela '%-.64s'", +"'Thread' de inserção retardada ('delayed') não conseguiu obter trava solicitada para tabela '%-.64s'", "Excesso de 'threads' retardadas ('delayed') em uso", "Conexão %ld abortou para o banco de dados '%-.64s' - usuário '%-.32s' (%-.64s)", "Obteve um pacote maior do que 'max_allowed_packet'", -"Obteve um erro de leitura no 'pipe' de conexão", +"Obteve um erro de leitura no 'pipe' da conexão", "Obteve um erro em fcntl()", "Obteve pacotes fora de ordem", "Não conseguiu descomprimir pacote de comunicação", "Obteve um erro na leitura de pacotes de comunicação", "Obteve expiração de tempo ('timeout') na leitura de pacotes de comunicação", -"Obteve um erro na gravação de pacotes de comunicação", +"Obteve um erro na escrita de pacotes de comunicação", "Obteve expiração de tempo ('timeout') na escrita de pacotes de comunicação", "'String' resultante é mais longa do que 'max_allowed_packet'", "Tipo de tabela usado não permite colunas BLOB/TEXT", "Tipo de tabela usado não permite colunas AUTO_INCREMENT", -"INSERT DELAYED não pode ser usado com a tabela '%-.64s', porque está travada com LOCK TABLES", +"INSERT DELAYED não pode ser usado com a tabela '%-.64s', porque ela está travada com LOCK TABLES", "Nome de coluna '%-.100s' incorreto", "O manipulador de tabela usado não pode indexar a coluna '%-.64s'", "Tabelas no MERGE não estão todas definidas identicamente", @@ -176,7 +176,7 @@ "O resultado consistiu em mais do que uma linha", "Este tipo de tabela requer uma chave primária", "Esta versão do MySQL não foi compilada com suporte a RAID", -"Você está usando modo de atualização seguro e tentou atualizar uma tabela sem um WHERE que use uma coluna tipo KEY", +"Você está usando modo de atualização seguro e tentou atualizar uma tabela sem um WHERE que use uma coluna de KEY", "Chave '%-.64s' não existe na tabela '%-.64s'", "Não pode abrir a tabela", "O manipulador de tabela não suporta check/repair", @@ -188,7 +188,7 @@ "Conexão %ld abortada ao banco de dados '%-.64s' - usuário '%-.32s' - 'host' `%-.64s' ('%-.64s')", "O manipulador de tabela não suporta DUMP binário de tabela", "Binlog fechado. Não pode fazer RESET MASTER", -"Falhou na reconstrução do índice da tabela 'dumped' '%-.64s'", +"Falhou na reconstrução do índice da tabela '%-.64s' 'dumped'", "Erro no 'master' '%-.64s'", "Erro de rede na leitura do 'master'", "Erro de rede na gravação do 'master'", @@ -207,12 +207,13 @@ "Usuário '%-.64s' já possui 'max_user_connections' conexões ativas", "Você pode usar apenas expressões de constante com SET", "Excedido tempo de espera (timeout) do travamento", -"O número total de travamentos excede o tamanho de travamento da tabela", -"Travamentos de atualização não podem ser obtidos durante um READ UNCOMMITTED na transação", -"DROP DATABASE não permitido enquanto uma 'thread' está assegurando um travamento global de leitura", -"CREATE DATABASE não permitido enquanto uma 'thread' está assegurando um travamento global de leitura", -"Wrong arguments to %s", -"%-.32s@%-.64s is not allowed to create new users", +"O número total de travamentos excede o tamanho da tabela de travamentos", +"Travamentos de atualização não podem ser obtidos durante uma transação de READ UNCOMMITTED", +"DROP DATABASE não permitido enquanto uma 'thread' está mantendo um travamento global de leitura", +"CREATE DATABASE não permitido enquanto uma 'thread' está mantendo um travamento global de leitura", +"Argumentos errados para %s", +"Não é permitido a %-.32s@%-.64s criar novos usuários", +"Incorrect table definition; All MERGE tables must be in the same database", "Error connecting to master: %-.128s", "Error running query on master: %-.128s", "Error when executing command %s: %-.128s", diff --git a/sql/share/romanian/errmsg.txt b/sql/share/romanian/errmsg.txt index 8f957302f30..a09a8046b29 100644 --- a/sql/share/romanian/errmsg.txt +++ b/sql/share/romanian/errmsg.txt @@ -217,6 +217,7 @@ "CREATE DATABASE not allowed while thread is holding global read lock", "Wrong arguments to %s", "%-.32s@%-.64s is not allowed to create new users", +"Incorrect table definition; All MERGE tables must be in the same database", "Error connecting to master: %-.128s", "Error running query on master: %-.128s", "Error when executing command %s: %-.128s", diff --git a/sql/share/russian/errmsg.txt b/sql/share/russian/errmsg.txt index dc350a242a3..e4de072bf67 100644 --- a/sql/share/russian/errmsg.txt +++ b/sql/share/russian/errmsg.txt @@ -216,6 +216,7 @@ "CREATE DATABASE not allowed while thread is holding global read lock", "Wrong arguments to %s", "%-.32s@%-.64s is not allowed to create new users", +"Incorrect table definition; All MERGE tables must be in the same database", "Error connecting to master: %-.128s", "Error running query on master: %-.128s", "Error when executing command %s: %-.128s", diff --git a/sql/share/slovak/errmsg.txt b/sql/share/slovak/errmsg.txt index f7db353db3f..9b4491a3258 100644 --- a/sql/share/slovak/errmsg.txt +++ b/sql/share/slovak/errmsg.txt @@ -221,6 +221,7 @@ "CREATE DATABASE not allowed while thread is holding global read lock", "Wrong arguments to %s", "%-.32s@%-.64s is not allowed to create new users", +"Incorrect table definition; All MERGE tables must be in the same database", "Error connecting to master: %-.128s", "Error running query on master: %-.128s", "Error when executing command %s: %-.128s", diff --git a/sql/share/spanish/errmsg.txt b/sql/share/spanish/errmsg.txt index f10908a33ba..165fcb1d538 100644 --- a/sql/share/spanish/errmsg.txt +++ b/sql/share/spanish/errmsg.txt @@ -214,6 +214,7 @@ "CREATE DATABASE no permitido mientras un thread está ejerciendo un bloqueo de lectura global", "Wrong arguments to %s", "%-.32s@%-.64s is not allowed to create new users", +"Incorrect table definition; All MERGE tables must be in the same database", "Error de coneccion a master: %-128s", "Error executando el query en master: %-128%", "Error de %s: %-128%", diff --git a/sql/share/swedish/errmsg.txt b/sql/share/swedish/errmsg.txt index 5bdbf78e6cf..095a05faf34 100644 --- a/sql/share/swedish/errmsg.txt +++ b/sql/share/swedish/errmsg.txt @@ -212,11 +212,12 @@ "DROP DATABASE är inte tillåtet när man har ett globalt läs-lås", "CREATE DATABASE är inte tillåtet när man har ett globalt läs-lås", "Felaktiga argument till %s", -"%-.32s@%-.64s har inte rättigheter att skapa nya användare", +"%-.32s@%-.64s har inte rättighet att skapa nya användare", +"Felaktig tabell definition: Alla tabeller i en MERGE tabell måste vara i samma databas", "Fick fel vid anslutning till master: %-.128s", "Fick fel vid utförande av command på mastern: %-.128s", "Fick fel vid utförande av %s: %-.128s", "Felaktig använding av %s and %s", "SELECT kommandona har olika antal kolumner" "Kan inte utföra kommandot emedan du har ett READ lås", -"Blandning av transaktionella och icke-transaktionella tabeller är stoppat", +"Blandning av transaktionella och icke-transaktionella tabeller är inaktiverat", diff --git a/sql/slave.cc b/sql/slave.cc index 27637107b11..6b79e639a90 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -767,7 +767,7 @@ static int init_slave_thread(THD* thd) thd->mysys_var=my_thread_var; thd->dbug_thread_id=my_thread_id(); -#ifndef __WIN__ +#if !defined(__WIN__) && !defined(OS2) sigset_t set; VOID(sigemptyset(&set)); // Get mask in use VOID(pthread_sigmask(SIG_UNBLOCK,&set,&thd->block_signals)); diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 820785a1d1f..bc2222ffa48 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -366,7 +366,7 @@ static uint get_access(TABLE *form,uint fieldnr) /* - return a number with if sorted put string in this order: + return a number which, if sorted 'desc', puts strings in this order: no wildcards wildcards empty string diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 2a9043cc0d7..57679b510e3 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -352,11 +352,9 @@ bool close_cached_tables(THD *thd, bool if_wait_for_refresh, */ if (!tables) kill_delayed_threads(); - pthread_mutex_lock(&thd->mysys_var->mutex); thd->mysys_var->current_mutex= &LOCK_open; thd->mysys_var->current_cond= &COND_refresh; thd->proc_info="Flushing tables"; - pthread_mutex_unlock(&thd->mysys_var->mutex); close_old_data_files(thd,thd->open_tables,1,1); bool found=1; @@ -672,13 +670,12 @@ void wait_for_refresh(THD *thd) { /* Wait until the current table is up to date */ const char *proc_info; - pthread_mutex_lock(&thd->mysys_var->mutex); thd->mysys_var->current_mutex= &LOCK_open; thd->mysys_var->current_cond= &COND_refresh; proc_info=thd->proc_info; thd->proc_info="Waiting for table"; - pthread_mutex_unlock(&thd->mysys_var->mutex); - (void) pthread_cond_wait(&COND_refresh,&LOCK_open); + if (!thd->killed) + (void) pthread_cond_wait(&COND_refresh,&LOCK_open); pthread_mutex_unlock(&LOCK_open); // Must be unlocked first pthread_mutex_lock(&thd->mysys_var->mutex); @@ -1387,7 +1384,7 @@ TABLE *open_ltable(THD *thd, TABLE_LIST *table_list, thr_lock_type lock_type) { int error; -#ifdef __WIN__ +#if defined( __WIN__) || defined(OS2) /* Win32 can't drop a file that is open */ if (lock_type == TL_WRITE_ALLOW_READ #ifdef HAVE_GEMINI_DB @@ -1397,7 +1394,7 @@ TABLE *open_ltable(THD *thd, TABLE_LIST *table_list, thr_lock_type lock_type) { lock_type= TL_WRITE; } -#endif /* __WIN__ */ +#endif /* __WIN__ || OS2 */ table_list->table=table; table->grant= table_list->grant; @@ -2169,7 +2166,7 @@ bool remove_table_from_cache(THD *thd, const char *db, const char *table_name, { in_use->killed=1; pthread_mutex_lock(&in_use->mysys_var->mutex); - if (in_use->mysys_var->current_mutex) + if (in_use->mysys_var->current_cond) { pthread_mutex_lock(in_use->mysys_var->current_mutex); pthread_cond_broadcast(in_use->mysys_var->current_cond); diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 13c60641db0..b77166d0bc0 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -106,7 +106,7 @@ THD::THD():user_time(0),fatal_error(0),last_insert_id_used(0), mysys_var=0; net.vio=0; ull=0; - system_thread=0; + system_thread=cleanup_done=0; #ifdef __WIN__ real_id = 0; #endif @@ -155,15 +155,11 @@ THD::THD():user_time(0),fatal_error(0),last_insert_id_used(0), #endif } -THD::~THD() +/* Do operations that may take a long time */ + +void THD::cleanup(void) { - DBUG_ENTER("~THD()"); - /* Close connection */ - if (net.vio) - { - vio_delete(net.vio); - net_end(&net); - } + DBUG_ENTER("THD::cleanup"); ha_rollback(this); if (locked_tables) { @@ -183,6 +179,21 @@ THD::~THD() ha_close_connection(this); } #endif + cleanup_done=1; + DBUG_VOID_RETURN; +} + +THD::~THD() +{ + DBUG_ENTER("~THD()"); + /* Close connection */ + if (net.vio) + { + vio_delete(net.vio); + net_end(&net); + } + if (!cleanup_done) + cleanup(); if (global_read_lock) unlock_global_read_lock(this); if (ull) @@ -221,12 +232,12 @@ void THD::prepare_to_die() pthread_mutex_lock(&mysys_var->mutex); if (!system_thread) // Don't abort locks mysys_var->abort=1; - if (mysys_var->current_mutex) - { - pthread_mutex_lock(mysys_var->current_mutex); - pthread_cond_broadcast(mysys_var->current_cond); - pthread_mutex_unlock(mysys_var->current_mutex); - } + if (mysys_var->current_cond) + { + pthread_mutex_lock(mysys_var->current_mutex); + pthread_cond_broadcast(mysys_var->current_cond); + pthread_mutex_unlock(mysys_var->current_mutex); + } pthread_mutex_unlock(&mysys_var->mutex); } } diff --git a/sql/sql_class.h b/sql/sql_class.h index adbf3bd8008..a99bce0d6bc 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -291,7 +291,7 @@ public: bool no_errors, allow_sum_func, password, fatal_error; bool query_start_used,last_insert_id_used,insert_id_used; bool system_thread,in_lock_tables,global_read_lock; - bool query_error, bootstrap; + bool query_error, bootstrap, cleanup_done; bool volatile killed; LOG_INFO* current_linfo; // if we do a purge of binary logs, log index info of the threads @@ -305,6 +305,7 @@ public: THD(); ~THD(); + void cleanup(void); bool store_globals(); #ifdef SIGNAL_WITH_VIO_CLOSE inline void set_active_vio(Vio* vio) @@ -335,11 +336,9 @@ public: const char* msg) { const char* old_msg = proc_info; - pthread_mutex_lock(&mysys_var->mutex); mysys_var->current_mutex = mutex; mysys_var->current_cond = cond; proc_info = msg; - pthread_mutex_unlock(&mysys_var->mutex); return old_msg; } inline void exit_cond(const char* old_msg) @@ -374,7 +373,7 @@ public: { #ifdef USING_TRANSACTIONS return (transaction.all.bdb_tid != 0 || - transaction.all.innobase_tid != 0 || + transaction.all.innodb_active_trans != 0 || transaction.all.gemini_tid != 0); #else return 0; diff --git a/sql/sql_db.cc b/sql/sql_db.cc index 3c5a6efd9a5..ed9ceaae383 100644 --- a/sql/sql_db.cc +++ b/sql/sql_db.cc @@ -364,7 +364,9 @@ bool mysql_change_db(THD *thd,const char *name) } (void) sprintf(path,"%s/%s",mysql_data_home,dbname); - unpack_dirname(path,path); // Convert if not unix + length=unpack_dirname(path,path); // Convert if not unix + if (length && path[length-1] == FN_LIBCHAR) + path[length-1]=0; // remove ending '\' if (access(path,F_OK)) { net_printf(&thd->net,ER_BAD_DB_ERROR,dbname); diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index d9b6970b72d..1a855c927a4 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -151,6 +151,8 @@ int mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, ORDER *order, break; } } + else + table->file->unlock_row(); // Row failed selection, release lock on it } thd->proc_info="end"; end_read_record(&info); diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index f53dd12016b..1d2805d8e90 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -509,7 +509,7 @@ public: COPY_INFO info; I_List<delayed_row> rows; uint group_count; - TABLE_LIST *table_list; // Argument + TABLE_LIST table_list; // Argument delayed_insert() :locks_in_memory(0), @@ -538,10 +538,12 @@ public: delayed_row *row; while ((row=rows.get())) delete row; - pthread_mutex_destroy(&mutex); if (table) close_thread_tables(&thd); VOID(pthread_mutex_lock(&LOCK_thread_count)); + pthread_mutex_destroy(&mutex); + pthread_cond_destroy(&cond); + pthread_cond_destroy(&cond_client); thd.unlink(); // Must be unlinked under lock x_free(thd.query); thd.user=thd.host=0; @@ -636,7 +638,9 @@ static TABLE *delayed_get_table(THD *thd,TABLE_LIST *table_list) pthread_mutex_unlock(&LOCK_delayed_create); DBUG_RETURN(0); } - tmp->table_list=table_list; // Needed to open table + tmp->table_list= *table_list; // Needed to open table + tmp->table_list.db= tmp->thd.db; + tmp->table_list.name= tmp->table_list.real_name=tmp->thd.query; tmp->lock(); pthread_mutex_lock(&tmp->mutex); if ((error=pthread_create(&tmp->thd.real_id,&connection_attrib, @@ -869,13 +873,11 @@ void kill_delayed_threads(void) if (tmp->thd.mysys_var) { pthread_mutex_lock(&tmp->thd.mysys_var->mutex); - if (tmp->thd.mysys_var->current_mutex) + if (tmp->thd.mysys_var->current_cond) { - if (&tmp->mutex != tmp->thd.mysys_var->current_mutex) - pthread_mutex_lock(tmp->thd.mysys_var->current_mutex); + pthread_mutex_lock(tmp->thd.mysys_var->current_mutex); pthread_cond_broadcast(tmp->thd.mysys_var->current_cond); - if (&tmp->mutex != tmp->thd.mysys_var->current_mutex) - pthread_mutex_unlock(tmp->thd.mysys_var->current_mutex); + pthread_mutex_unlock(tmp->thd.mysys_var->current_mutex); } pthread_mutex_unlock(&tmp->thd.mysys_var->mutex); } @@ -900,10 +902,11 @@ static pthread_handler_decl(handle_delayed_insert,arg) thd->thread_id=thread_id++; thd->end_time(); threads.append(thd); + thd->killed=abort_loop; pthread_mutex_unlock(&LOCK_thread_count); pthread_mutex_lock(&di->mutex); -#ifndef __WIN__ /* Win32 calls this in pthread_create */ +#if !defined( __WIN__) && !defined(OS2) /* Win32 calls this in pthread_create */ if (my_thread_init()) { strmov(thd->net.last_error,ER(thd->net.last_errno=ER_OUT_OF_RESOURCES)); @@ -922,7 +925,7 @@ static pthread_handler_decl(handle_delayed_insert,arg) } thd->mysys_var=my_thread_var; thd->dbug_thread_id=my_thread_id(); -#ifndef __WIN__ +#if !defined(__WIN__) && !defined(OS2) sigset_t set; VOID(sigemptyset(&set)); // Get mask in use VOID(pthread_sigmask(SIG_UNBLOCK,&set,&thd->block_signals)); @@ -930,7 +933,7 @@ static pthread_handler_decl(handle_delayed_insert,arg) /* open table */ - if (!(di->table=open_ltable(thd,di->table_list,TL_WRITE_DELAYED))) + if (!(di->table=open_ltable(thd,&di->table_list,TL_WRITE_DELAYED))) { thd->fatal_error=1; // Abort waiting inserts goto end; @@ -938,7 +941,7 @@ static pthread_handler_decl(handle_delayed_insert,arg) if (di->table->file->has_transactions()) { thd->fatal_error=1; - my_error(ER_ILLEGAL_HA, MYF(0), di->table_list->real_name); + my_error(ER_ILLEGAL_HA, MYF(0), di->table_list.real_name); goto end; } di->table->copy_blobs=1; @@ -990,14 +993,12 @@ static pthread_handler_decl(handle_delayed_insert,arg) #endif /* Information for pthread_kill */ - pthread_mutex_lock(&di->thd.mysys_var->mutex); di->thd.mysys_var->current_mutex= &di->mutex; di->thd.mysys_var->current_cond= &di->cond; - pthread_mutex_unlock(&di->thd.mysys_var->mutex); di->thd.proc_info=0; DBUG_PRINT("info",("Waiting for someone to insert rows")); - for ( ; ;) + while (!thd->killed) { int error; #if (defined(HAVE_BROKEN_COND_TIMEDWAIT) || defined(HAVE_LINUXTHREADS)) @@ -1021,10 +1022,13 @@ static pthread_handler_decl(handle_delayed_insert,arg) break; } } + /* We can't lock di->mutex and mysys_var->mutex at the same time */ + pthread_mutex_unlock(&di->mutex); pthread_mutex_lock(&di->thd.mysys_var->mutex); di->thd.mysys_var->current_mutex= 0; di->thd.mysys_var->current_cond= 0; pthread_mutex_unlock(&di->thd.mysys_var->mutex); + pthread_mutex_lock(&di->mutex); } if (di->tables_in_use && ! thd->lock) diff --git a/sql/sql_load.cc b/sql/sql_load.cc index d7f273bfaa4..c2793da78f3 100644 --- a/sql/sql_load.cc +++ b/sql/sql_load.cc @@ -86,6 +86,7 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list, bool is_fifo=0; LOAD_FILE_INFO lf_info; char * db = table_list->db ? table_list->db : thd->db; + bool using_transactions; DBUG_ENTER("mysql_load"); if (escaped->length() > 1 || enclosed->length() > 1) @@ -170,7 +171,7 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list, else { unpack_filename(name,ex->file_name); -#ifndef __WIN__ +#if !defined(__WIN__) && !defined(OS2) MY_STAT stat_info; if (!my_stat(name,&stat_info,MYF(MY_WME))) DBUG_RETURN(-1); @@ -270,8 +271,11 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list, free_blobs(table); /* if pack_blob was used */ table->copy_blobs=0; thd->count_cuted_fields=0; /* Don`t calc cuted fields */ + using_transactions = table->file->has_transactions(); if (error) { + if (using_transactions) + ha_autocommit_or_rollback(thd,error); if (!opt_old_rpl_compat && mysql_bin_log.is_open()) { Delete_file_log_event d(thd); @@ -286,7 +290,7 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list, if(!thd->slave_thread) mysql_update_log.write(thd,thd->query,thd->query_length); - if (!table->file->has_transactions()) + if (!using_transactions) thd->options|=OPTION_STATUS_NO_TRANS_UPDATE; if (mysql_bin_log.is_open()) { @@ -303,7 +307,9 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list, mysql_bin_log.write(&e); } } - DBUG_RETURN(0); + if (using_transactions) + error=ha_autocommit_or_rollback(thd,error); + DBUG_RETURN(error); } diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index dac9af6d9fb..687d325a95a 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -67,9 +67,13 @@ extern struct st_VioSSLAcceptorFd * ssl_acceptor_fd; #ifdef __WIN__ static void test_signal(int sig_ptr) { -#ifndef DBUG_OFF +#if !defined( DBUG_OFF) MessageBox(NULL,"Test signal","DBUG",MB_OK); #endif +#if defined(OS2) + fprintf( stderr, "Test signal %d\n", sig_ptr); + fflush( stderr); +#endif } static void init_signals(void) { @@ -175,7 +179,6 @@ static bool check_user(THD *thd,enum_server_command command, const char *user, */ static HASH hash_user_connections; -static DYNAMIC_ARRAY user_conn_array; extern pthread_mutex_t LOCK_user_conn; struct user_conn { @@ -482,7 +485,7 @@ pthread_handler_decl(handle_one_connection,arg) pthread_detach_this_thread(); -#ifndef __WIN__ /* Win32 calls this in pthread_create */ +#if !defined( __WIN__) && !defined(OS2) /* Win32 calls this in pthread_create */ if (my_thread_init()) // needed to be called first before we call // DBUG_ macros { @@ -504,9 +507,9 @@ pthread_handler_decl(handle_one_connection,arg) thd->thread_id)); // now that we've called my_thread_init(), it is safe to call DBUG_* -#ifdef __WIN__ +#if defined(__WIN__) init_signals(); // IRENA; testing ? -#else +#elif !defined(OS2) sigset_t set; VOID(sigemptyset(&set)); // Get mask in use VOID(pthread_sigmask(SIG_UNBLOCK,&set,&thd->block_signals)); @@ -607,7 +610,7 @@ pthread_handler_decl(handle_bootstrap,arg) thd->thread_stack= (char*) &thd; thd->mysys_var=my_thread_var; thd->dbug_thread_id=my_thread_id(); -#ifndef __WIN__ +#if !defined(__WIN__) && !defined(OS2) sigset_t set; VOID(sigemptyset(&set)); // Get mask in use VOID(pthread_sigmask(SIG_UNBLOCK,&set,&thd->block_signals)); @@ -960,7 +963,9 @@ bool dispatch_command(enum enum_server_command command, THD *thd, #ifdef __WIN__ sleep(1); // must wait after eof() #endif +#ifndef OS2 send_eof(net); // This is for 'quit request' +#endif close_connection(net); close_thread_tables(thd); // Free before kill free_root(&thd->mem_root,MYF(0)); @@ -2294,10 +2299,18 @@ static bool check_merge_table_access(THD *thd, char *db, int error=0; if (table_list) { - /* Force all tables to use the current database */ + /* Check that all tables use the current database */ TABLE_LIST *tmp; for (tmp=table_list; tmp ; tmp=tmp->next) - tmp->db=db; + { + if (!tmp->db || !tmp->db[0]) + tmp->db=db; + else if (!strcmp(tmp->db,db)) + { + send_error(&thd->net,ER_UNION_TABLES_IN_DIFFERENT_DIR); + return 1; + } + } error=check_table_access(thd, SELECT_ACL | UPDATE_ACL | DELETE_ACL, table_list); } @@ -2804,13 +2817,11 @@ TABLE_LIST *add_table_to_list(Table_ident *table, LEX_STRING *alias, DBUG_RETURN(0); } -#ifdef FN_LOWER_CASE if (!alias) /* Alias is case sensitive */ if (!(alias_str=thd->memdup(alias_str,table->table.length+1))) DBUG_RETURN(0); if (lower_case_table_names) casedn_str(table->table.str); -#endif if (!(ptr = (TABLE_LIST *) thd->calloc(sizeof(TABLE_LIST)))) DBUG_RETURN(0); /* purecov: inspected */ ptr->db= table->db.str ? table->db.str : (thd->db ? thd->db : (char*) ""); diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index 7f49d6b2680..ff1cb125ef8 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -492,12 +492,10 @@ impossible position"; log.error=0; // tell the kill thread how to wake us up - pthread_mutex_lock(&thd->mysys_var->mutex); thd->mysys_var->current_mutex = log_lock; thd->mysys_var->current_cond = &COND_binlog_update; const char* proc_info = thd->proc_info; thd->proc_info = "Slave connection: waiting for binlog update"; - pthread_mutex_unlock(&thd->mysys_var->mutex); bool read_packet = 0, fatal_error = 0; @@ -522,7 +520,8 @@ impossible position"; break; case LOG_READ_EOF: DBUG_PRINT("wait",("waiting for data on binary log")); - pthread_cond_wait(&COND_binlog_update, log_lock); + if (!thd->killed) + pthread_cond_wait(&COND_binlog_update, log_lock); break; default: @@ -700,6 +699,9 @@ int stop_slave(THD* thd, bool net_report ) #ifdef HAVE_TIMESPEC_TS_SEC abstime.ts_sec=time(NULL)+2; abstime.ts_nsec=0; +#elif defined(__WIN__) + abstime.tv_sec=time((time_t*) 0)+2; + abstime.tv_nsec=0; #else struct timeval tv; gettimeofday(&tv,0); @@ -765,17 +767,19 @@ void kill_zombie_dump_threads(uint32 slave_server_id) if (tmp->command == COM_BINLOG_DUMP && tmp->server_id == slave_server_id) { - // here we do not call kill_one_thread() - // it will be slow because it will iterate through the list - // again. Plus it double-locks LOCK_thread_count, which - // make safe_mutex complain and abort - // so we just to our own thread murder + /* + Here we do not call kill_one_thread() as + it will be slow because it will iterate through the list + again. Plus it double-locks LOCK_tread_count, which + make safe_mutex complain and abort. + We just to do kill the thread ourselves. + */ thr_alarm_kill(tmp->real_id); tmp->killed = 1; - pthread_mutex_lock(&tmp->mysys_var->mutex); tmp->mysys_var->abort = 1; - if (tmp->mysys_var->current_mutex) + pthread_mutex_lock(&tmp->mysys_var->mutex); + if (tmp->mysys_var->current_cond) { pthread_mutex_lock(tmp->mysys_var->current_mutex); pthread_cond_broadcast(tmp->mysys_var->current_cond); @@ -784,7 +788,7 @@ void kill_zombie_dump_threads(uint32 slave_server_id) pthread_mutex_unlock(&tmp->mysys_var->mutex); } } - pthread_mutex_unlock(&LOCK_thread_count); + pthread_mutex_unlock(&LOCK_thread_count); } diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 12cd7a94e7f..07de0dc5b33 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -4223,6 +4223,8 @@ sub_select(JOIN *join,JOIN_TAB *join_tab,bool end_of_records) if (not_used_in_distinct && found_records != join->found_records) return 0; } + else + info->file->unlock_row(); } } while (!(error=info->read_record(info))); if (error > 0) // Fatal error diff --git a/sql/sql_show.cc b/sql/sql_show.cc index ef5fc50b4f7..7806bef7163 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -182,6 +182,8 @@ mysql_find_files(THD *thd,List<char> *files, const char *db,const char *path, TABLE_LIST table_list; DBUG_ENTER("mysql_find_files"); + if (wild && !wild[0]) + wild=0; bzero((char*) &table_list,sizeof(table_list)); if (!(dirp = my_dir(path,MYF(MY_WME | (dir ? MY_WANT_STAT : 0))))) @@ -200,7 +202,7 @@ mysql_find_files(THD *thd,List<char> *files, const char *db,const char *path, #endif { if (file->name[0] == '.' || !MY_S_ISDIR(file->mystat.st_mode) || - (wild && wild[0] && wild_compare(file->name,wild))) + (wild && wild_compare(file->name,wild))) continue; } } @@ -211,8 +213,16 @@ mysql_find_files(THD *thd,List<char> *files, const char *db,const char *path, is_prefix(file->name,tmp_file_prefix)) continue; *ext=0; - if (wild && wild[0] && wild_compare(file->name,wild)) - continue; + if (wild) + { + if (lower_case_table_names) + { + if (wild_case_compare(file->name,wild)) + continue; + } + else if (wild_compare(file->name,wild)) + continue; + } } /* Don't show tables where we don't have any privileges */ if (db && !(col_access & TABLE_ACLS)) diff --git a/sql/sql_string.cc b/sql/sql_string.cc index 174d07d8ec4..e6cdd089bf1 100644 --- a/sql/sql_string.cc +++ b/sql/sql_string.cc @@ -542,8 +542,8 @@ String *copy_if_not_alloced(String *to,String *from,uint32 from_length) #endif int wild_case_compare(const char *str,const char *str_end, - const char *wildstr,const char *wildend, - char escape) + const char *wildstr,const char *wildend, + char escape) { int result= -1; // Not found, using wildcards #ifdef USE_MB @@ -677,7 +677,7 @@ int wild_case_compare(String &match,String &wild, char escape) */ int wild_compare(const char *str,const char *str_end, - const char *wildstr,const char *wildend,char escape) + const char *wildstr,const char *wildend,char escape) { int result= -1; // Not found, using wildcards while (wildstr != wildend) diff --git a/sql/sql_table.cc b/sql/sql_table.cc index f248c675e8e..d667aeb6011 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -48,11 +48,9 @@ int mysql_rm_table(THD *thd,TABLE_LIST *tables, my_bool if_exists) /* mark for close and remove all cached entries */ - pthread_mutex_lock(&thd->mysys_var->mutex); thd->mysys_var->current_mutex= &LOCK_open; thd->mysys_var->current_cond= &COND_refresh; VOID(pthread_mutex_lock(&LOCK_open)); - pthread_mutex_unlock(&thd->mysys_var->mutex); if (global_read_lock) { @@ -1064,19 +1062,31 @@ int mysql_optimize_table(THD* thd, TABLE_LIST* tables, HA_CHECK_OPT* check_opt) int mysql_analyze_table(THD* thd, TABLE_LIST* tables, HA_CHECK_OPT* check_opt) { +#ifdef OS2 + thr_lock_type lock_type = TL_WRITE; +#else + thr_lock_type lock_type = TL_READ_NO_INSERT; +#endif + DBUG_ENTER("mysql_analyze_table"); DBUG_RETURN(mysql_admin_table(thd, tables, check_opt, - "analyze",TL_READ_NO_INSERT, 1,0,0, + "analyze", lock_type, 1,0,0, &handler::analyze)); } int mysql_check_table(THD* thd, TABLE_LIST* tables,HA_CHECK_OPT* check_opt) { +#ifdef OS2 + thr_lock_type lock_type = TL_WRITE; +#else + thr_lock_type lock_type = TL_READ_NO_INSERT; +#endif + DBUG_ENTER("mysql_check_table"); DBUG_RETURN(mysql_admin_table(thd, tables, check_opt, - "check", - TL_READ_NO_INSERT, 0, 0, HA_OPEN_FOR_REPAIR, + "check", lock_type, + 0, 0, HA_OPEN_FOR_REPAIR, &handler::check)); } @@ -1119,16 +1129,12 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name, { strmov(new_name_buff,new_name); fn_same(new_name_buff,table_name,3); -#ifdef FN_LOWER_CASE if (lower_case_table_names) casedn_str(new_name); if ((lower_case_table_names && !my_strcasecmp(new_name_buff,table_name)) || (!lower_case_table_names && !strcmp(new_name_buff,table_name))) -#else - if (!strcmp(new_name_buff,table_name)) // Check if name changed -#endif new_name=table_name; // No. Make later check easier else { @@ -1600,7 +1606,7 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name, } } -#if defined( __WIN__) || defined( __EMX__) +#if defined( __WIN__) || defined( __EMX__) || defined( OS2) // Win32 can't rename an open table, so we must close the org table! table_name=thd->strdup(table_name); // must be saved if (close_cached_table(thd,table)) @@ -1762,7 +1768,7 @@ copy_data_between_tables(TABLE *from,TABLE *to, /* Turn off recovery logging since rollback of an alter table is to delete the new table so there is no need to log the changes to it. */ - error = ha_recovery_logging(thd,false); + error = ha_recovery_logging(thd,FALSE); if (error) { error = 1; @@ -1814,7 +1820,7 @@ copy_data_between_tables(TABLE *from,TABLE *to, if (to->file->activate_all_index(thd)) error=1; - tmp_error = ha_recovery_logging(thd,true); + tmp_error = ha_recovery_logging(thd,TRUE); /* Ensure that the new table is saved properly to disk so that we can do a rename @@ -1826,7 +1832,7 @@ copy_data_between_tables(TABLE *from,TABLE *to, if (to->file->external_lock(thd,F_UNLCK)) error=1; err: - tmp_error = ha_recovery_logging(thd,true); + tmp_error = ha_recovery_logging(thd,TRUE); free_io_cache(from); *copied= found_count; *deleted=delete_count; diff --git a/sql/sql_test.cc b/sql/sql_test.cc index d20bc74ecb2..651fd52d6c3 100644 --- a/sql/sql_test.cc +++ b/sql/sql_test.cc @@ -188,7 +188,10 @@ TEST_join(JOIN *join) void mysql_print_status(THD *thd) { + char current_dir[FN_REFLEN]; printf("\nStatus information:\n\n"); + my_getwd(current_dir, sizeof(current_dir),MYF(0)); + printf("Current dir: %s\n", current_dir); if (thd) thd->proc_info="locks"; thr_print_locks(); // Write some debug info diff --git a/sql/sql_udf.cc b/sql/sql_udf.cc index 2ba937be50a..8184ae3b15e 100644 --- a/sql/sql_udf.cc +++ b/sql/sql_udf.cc @@ -53,7 +53,7 @@ extern "C" FreeLibrary((HMODULE)lib); } -#else +#elif !defined(OS2) #include <dlfcn.h> #endif diff --git a/sql/sql_update.cc b/sql/sql_update.cc index 113995b169c..fbf8239bf69 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -291,6 +291,8 @@ int mysql_update(THD *thd, } } } + else + table->file->unlock_row(); } end_read_record(&info); thd->proc_info="end"; diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 23bfd5422f9..2318a6d309e 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -129,6 +129,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize); %token KILL_SYM %token LOAD %token LOCK_SYM +%token LOCKS_SYM %token UNLOCK_SYM %token BINLOG_SYM %token EVENTS_SYM @@ -2855,6 +2856,7 @@ keyword: | LAST_SYM {} | LEVEL_SYM {} | LOCAL_SYM {} + | LOCKS_SYM {} | LOGS_SYM {} | MAX_ROWS {} | MASTER_SYM {} diff --git a/sql/stacktrace.c b/sql/stacktrace.c index ab1113f74cf..81d8debc27a 100644 --- a/sql/stacktrace.c +++ b/sql/stacktrace.c @@ -17,6 +17,7 @@ #include <global.h> #include "stacktrace.h" #include <signal.h> +#include <my_pthread.h> #ifdef HAVE_STACKTRACE #include <unistd.h> @@ -205,11 +206,17 @@ resolve it\n"); /* Produce a core for the thread */ -#ifdef HAVE_WRITE_CORE +#ifdef HAVE_LINUXTHREADS void write_core(int sig) { signal(sig, SIG_DFL); if (fork() != 0) exit(1); // Abort main program // Core will be written at exit } -#endif /* HAVE_WRITE_CORE */ +#else +void write_core(int sig) +{ + signal(sig, SIG_DFL); + pthread_kill(pthread_self(), sig); +} +#endif diff --git a/sql/stacktrace.h b/sql/stacktrace.h index b6c0ec43a0f..980e1ea07eb 100644 --- a/sql/stacktrace.h +++ b/sql/stacktrace.h @@ -30,9 +30,6 @@ extern char* heap_start; void print_stacktrace(gptr stack_bottom, ulong thread_stack); void safe_print_str(const char* name, const char* val, int max_len); #endif /* (defined (__i386__) || (defined(__alpha__) && defined(__GNUC__))) */ - -#define HAVE_WRITE_CORE -void write_core(int sig); #endif /* HAVE_LINUXTHREADS */ /* Define empty prototypes for functions that are not implemented */ @@ -42,9 +39,7 @@ void write_core(int sig); #define safe_print_str(A,B,C) {} #endif /* HAVE_STACKTRACE */ -#ifndef HAVE_WRITE_CORE -#define write_core(A) {} -#endif +void write_core(int sig); #ifdef __cplusplus } |