diff options
Diffstat (limited to 'sql')
102 files changed, 531 insertions, 568 deletions
diff --git a/sql/cache_manager.cc b/sql/cache_manager.cc index 9aec222909a..307fe331e5c 100644 --- a/sql/cache_manager.cc +++ b/sql/cache_manager.cc @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ @@ -117,7 +117,7 @@ void *cache_manager::alloc(uint size) { void *llist; void *abs_ptr; - + size=ALIGN_SIZE(size+HEADER_LENGTH+SUFFIX_LENGTH); if (!(llist = find_in_llist(size))) { @@ -127,7 +127,7 @@ void *cache_manager::alloc(uint size) } size_of_found_block=int4korr((char*) llist) & ALLOC_MASK; // if (size_of_found_block < SMALLEST_BLOCK) - + abs_ptr = link_into_abs(llist); return abs_ptr; } diff --git a/sql/cache_manager.h b/sql/cache_manager.h index fc3b8f7016a..d422a86ea8e 100644 --- a/sql/cache_manager.h +++ b/sql/cache_manager.h @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ @@ -59,7 +59,3 @@ class cache_manager { bool *dealloc(void *); /* Deallocate blocks (with *ptr_arg) */ void clear(void); /* Clear the cache */ }; - - - - diff --git a/sql/convert.cc b/sql/convert.cc index 2645690a71f..7a06208759c 100644 --- a/sql/convert.cc +++ b/sql/convert.cc @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ diff --git a/sql/custom_conf.h b/sql/custom_conf.h index af6012e28ec..19ced12bfbb 100644 --- a/sql/custom_conf.h +++ b/sql/custom_conf.h @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ diff --git a/sql/derror.cc b/sql/derror.cc index bda0690ae7d..d0519c37dca 100644 --- a/sql/derror.cc +++ b/sql/derror.cc @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ diff --git a/sql/field.cc b/sql/field.cc index fc5feba8eb8..2a0d0160d00 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ @@ -4549,7 +4549,7 @@ bool Field_enum::eq_def(Field *field) if (!Field::eq_def(field)) return 0; TYPELIB *from_lib=((Field_enum*) field)->typelib; - + if (typelib->count < from_lib->count) return 0; for (uint i=0 ; i < from_lib->count ; i++) @@ -4559,7 +4559,7 @@ bool Field_enum::eq_def(Field *field) } bool Field_num::eq_def(Field *field) -{ +{ if (!Field::eq_def(field)) return 0; Field_num *from_num= (Field_num*) field; diff --git a/sql/field.h b/sql/field.h index 03fd6d46a78..861f2629550 100644 --- a/sql/field.h +++ b/sql/field.h @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ @@ -93,7 +93,7 @@ public: // Caller beware: sql_type can change str.Ptr, so check // ptr() to see if it changed if you are using your own buffer // in str and restore it with set() if needed - + virtual uint size_of() const =0; // For new field inline bool is_null(uint row_offset=0) { return null_ptr ? (null_ptr[row_offset] & null_bit ? 1 : 0) : table->null_row; } diff --git a/sql/field_conv.cc b/sql/field_conv.cc index 606edd84c74..c7a6d778953 100644 --- a/sql/field_conv.cc +++ b/sql/field_conv.cc @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ diff --git a/sql/filesort.cc b/sql/filesort.cc index 16eedb94c59..ce46f1c461c 100644 --- a/sql/filesort.cc +++ b/sql/filesort.cc @@ -274,7 +274,7 @@ static BUFFPEK *read_buffpek_from_file(IO_CACHE *buffpek_pointers, uint count) } } DBUG_RETURN(tmp); -} +} diff --git a/sql/frm_crypt.cc b/sql/frm_crypt.cc index 629e4ffab95..8dd70900648 100644 --- a/sql/frm_crypt.cc +++ b/sql/frm_crypt.cc @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ diff --git a/sql/ha_berkeley.cc b/sql/ha_berkeley.cc index 3cb14b5e72f..e0a802b499a 100644 --- a/sql/ha_berkeley.cc +++ b/sql/ha_berkeley.cc @@ -1043,7 +1043,7 @@ int ha_berkeley::restore_keys(DB_TXN *trans, key_map changed_keys, break; /* purecov: inspected */ } } - + err: DBUG_ASSERT(error != DB_KEYEXIST); DBUG_RETURN(error); @@ -2176,7 +2176,7 @@ static BDB_SHARE *get_share(const char *table_name, TABLE *table) char *tmp_name; DB **key_file; u_int32_t *key_type; - + if ((share=(BDB_SHARE *) my_multi_malloc(MYF(MY_WME | MY_ZEROFILL), &share, sizeof(*share), diff --git a/sql/ha_heap.cc b/sql/ha_heap.cc index eff69893502..079fba05f0a 100644 --- a/sql/ha_heap.cc +++ b/sql/ha_heap.cc @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ @@ -49,11 +49,11 @@ int ha_heap::open(const char *name, int mode, uint test_if_locked) { KEY *pos=table->key_info+key; mem_per_row += (pos->key_length + (sizeof(char*) * 2)); - + keydef[key].keysegs=(uint) pos->key_parts; keydef[key].flag = (pos->flags & HA_NOSAME); keydef[key].seg=seg; - + for (part=0 ; part < pos->key_parts ; part++) { uint flag=pos->key_part[part].key_type; @@ -147,7 +147,7 @@ int ha_heap::index_prev(byte * buf) table->status=error ? STATUS_NOT_FOUND: 0; return error; } - + int ha_heap::index_first(byte * buf) { statistic_increment(ha_read_first_count,&LOCK_status); @@ -227,7 +227,7 @@ int ha_heap::delete_all_rows() int ha_heap::external_lock(THD *thd, int lock_type) { return 0; // No external locking -} +} THR_LOCK_DATA **ha_heap::store_lock(THD *thd, THR_LOCK_DATA **to, diff --git a/sql/ha_heap.h b/sql/ha_heap.h index 6b7e9c6c626..93deedb65d2 100644 --- a/sql/ha_heap.h +++ b/sql/ha_heap.h @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ diff --git a/sql/ha_innobase.cc b/sql/ha_innobase.cc index b96eb86dbc1..fb22b2d079c 100644 --- a/sql/ha_innobase.cc +++ b/sql/ha_innobase.cc @@ -21,7 +21,7 @@ InnoDB */ - Ask Monty if strings of different languages can exist in the same database. Answer: in near future yes, but not yet. */ - + #ifdef __GNUC__ #pragma implementation // gcc: Class implementation #endif @@ -439,7 +439,7 @@ innobase_parse_data_file_paths_and_sizes(void) && *(str + 1) == 'a' && *(str + 2) == 'w') { str += 3; - + if (srv_data_file_is_raw_partition[i] == 0) { srv_data_file_is_raw_partition[i] = SRV_OLD_RAW; } @@ -623,7 +623,7 @@ innobase_init(void) For non-latin1 charsets we use the MySQL comparison functions, and consequently we do not need to know the ordering internally in InnoDB. */ - + memcpy(srv_latin1_ordering, default_charset_info->sort_order, 256); } @@ -765,7 +765,7 @@ innobase_rollback( } srv_conc_exit_innodb(); - + trx_mark_sql_stat_end(trx); DBUG_RETURN(convert_error_code_to_mysql(error)); @@ -974,7 +974,7 @@ ha_innobase::open( ->clust_index_was_generated = TRUE; ref_length = DATA_ROW_ID_LEN + 10; - + DBUG_ASSERT(key_used_on_scan == MAX_KEY); } @@ -1288,7 +1288,7 @@ build_template( } else { /* We are building a temporary table: fetch all columns */ - + templ_type = ROW_MYSQL_WHOLE_ROW; } } @@ -1425,7 +1425,7 @@ ha_innobase::write_row( row_prebuilt_t* prebuilt = (row_prebuilt_t*)innobase_prebuilt; int error; longlong auto_inc; - + DBUG_ENTER("ha_innobase::write_row"); statistic_increment(ha_write_count, &LOCK_status); @@ -1443,7 +1443,7 @@ ha_innobase::write_row( /* Fetch the value the user possibly has set in the autoincrement field */ - + auto_inc = table->next_number_field->val_int(); /* In replication and also otherwise the auto-inc column @@ -1471,7 +1471,7 @@ ha_innobase::write_row( auto-inc column */ user_thd->next_insert_id = auto_inc; } - + if (auto_inc != 0) { /* This call will calculate the max of the current value and the value supplied by the user, if @@ -1490,11 +1490,11 @@ ha_innobase::write_row( srv_conc_exit_innodb(); if (error != DB_SUCCESS) { - + error = convert_error_code_to_mysql(error); goto func_exit; } - + dict_table_autoinc_update(prebuilt->table, auto_inc); } else { srv_conc_enter_innodb(prebuilt->trx); @@ -1505,7 +1505,7 @@ ha_innobase::write_row( prebuilt); if (error != DB_SUCCESS) { srv_conc_exit_innodb(); - + error = convert_error_code_to_mysql( error); goto func_exit; @@ -1523,13 +1523,13 @@ ha_innobase::write_row( user_thd->next_insert_id = auto_inc; } } - + /* Set the 'in_update_remember_pos' flag to FALSE to make sure all columns are fetched in the select done by update_auto_increment */ prebuilt->in_update_remember_pos = FALSE; - + update_auto_increment(); if (auto_inc == 0) { @@ -1543,15 +1543,15 @@ ha_innobase::write_row( srv_conc_exit_innodb(); if (error != DB_SUCCESS) { - + error = convert_error_code_to_mysql(error); goto func_exit; } - + dict_table_autoinc_initialize(prebuilt->table, auto_inc); } - + /* We have to set sql_stat_start to TRUE because update_auto_increment has called a select, and has reset that flag; row_insert_for_mysql has to @@ -2108,7 +2108,7 @@ ha_innobase::general_fetch( DBUG_ENTER("general_fetch"); srv_conc_enter_innodb(prebuilt->trx); - + ret = row_search_for_mysql((byte*)buf, 0, prebuilt, match_mode, direction); srv_conc_exit_innodb(); @@ -2244,7 +2244,7 @@ ha_innobase::rnd_init( bool scan) /* in: ???????? */ { int err; - + row_prebuilt_t* prebuilt = (row_prebuilt_t*) innobase_prebuilt; if (prebuilt->clust_index_was_generated) { @@ -2331,7 +2331,7 @@ ha_innobase::rnd_pos( if (error) { DBUG_RETURN(error); } - + error = index_read(buf, pos, ref_stored_len, HA_READ_KEY_EXACT); change_active_index(keynr); @@ -2473,11 +2473,11 @@ ha_innobase::external_lock( } if (trx->auto_inc_lock) { - + /* If we had reserved the auto-inc lock for some table in this SQL statement, we release it now */ - + srv_conc_enter_innodb(trx); row_unlock_table_autoinc_for_mysql(trx); srv_conc_exit_innodb(); @@ -2757,7 +2757,7 @@ ha_innobase::create( /* Flush the log to reduce probability that the .frm files and the InnoDB data dictionary get out-of-sync if the user runs with innodb_flush_log_at_trx_commit = 0 */ - + log_flush_up_to(ut_dulint_max, LOG_WAIT_ONE_GROUP); innobase_table = dict_table_get(norm_name, NULL); @@ -2812,7 +2812,7 @@ ha_innobase::delete_table( /* Flush the log to reduce probability that the .frm files and the InnoDB data dictionary get out-of-sync if the user runs with innodb_flush_log_at_trx_commit = 0 */ - + log_flush_up_to(ut_dulint_max, LOG_WAIT_ONE_GROUP); /* Tell the InnoDB server that there might be work for @@ -2846,9 +2846,9 @@ innobase_drop_database( char* ptr; int error; char namebuf[10000]; - + ptr = strend(path) - 2; - + while (ptr >= path && *ptr != '\\' && *ptr != '/') { ptr--; len++; @@ -2859,7 +2859,7 @@ innobase_drop_database( memcpy(namebuf, ptr, len); namebuf[len] = '/'; namebuf[len + 1] = '\0'; - + trx = trx_allocate_for_mysql(); error = row_drop_database_for_mysql(namebuf, trx); @@ -2867,7 +2867,7 @@ innobase_drop_database( /* Flush the log to reduce probability that the .frm files and the InnoDB data dictionary get out-of-sync if the user runs with innodb_flush_log_at_trx_commit = 0 */ - + log_flush_up_to(ut_dulint_max, LOG_WAIT_ONE_GROUP); /* Tell the InnoDB server that there might be work for @@ -2920,7 +2920,7 @@ ha_innobase::rename_table( /* Flush the log to reduce probability that the .frm files and the InnoDB data dictionary get out-of-sync if the user runs with innodb_flush_log_at_trx_commit = 0 */ - + log_flush_up_to(ut_dulint_max, LOG_WAIT_ONE_GROUP); /* Tell the InnoDB server that there might be work for @@ -2976,7 +2976,7 @@ ha_innobase::records_in_range( if (prebuilt->trx) { prebuilt->trx->op_info = (char*) "estimating range size"; } - + active_index = keynr; key = table->key_info + active_index; @@ -3012,7 +3012,7 @@ ha_innobase::records_in_range( if (prebuilt->trx) { prebuilt->trx->op_info = (char*) ""; } - + DBUG_RETURN((ha_rows) n_rows); } @@ -3032,7 +3032,7 @@ ha_innobase::estimate_number_of_rows(void) dict_index_t* index; ulonglong estimate; ulonglong data_file_length; - + if (prebuilt->trx) { prebuilt->trx->op_info = (char*) "estimating upper bound of table size"; @@ -3043,13 +3043,13 @@ ha_innobase::estimate_number_of_rows(void) dict_update_statistics(prebuilt->table); index = dict_table_get_first_index_noninline(prebuilt->table); - + data_file_length = ((ulonglong) index->stat_n_leaf_pages) * UNIV_PAGE_SIZE; /* Calculate a minimum length for a clustered index record */ estimate = data_file_length / dict_index_calc_min_rec_len(index); - + if (prebuilt->trx) { prebuilt->trx->op_info = (char*) ""; } @@ -3096,7 +3096,7 @@ ha_innobase::info( if (prebuilt->trx) { prebuilt->trx->op_info = (char*) "calculating table stats"; } - + ib_table = prebuilt->table; if (flag & HA_STATUS_TIME) { @@ -3146,11 +3146,11 @@ ha_innobase::info( if (rec_per_key == 0) { rec_per_key = 1; } - + table->key_info[i].rec_per_key[j] = rec_per_key; } - + index = dict_table_get_next_index_noninline(index); } } @@ -3170,7 +3170,7 @@ ha_innobase::info( if (prebuilt->trx) { prebuilt->trx->op_info = (char*) ""; } - + DBUG_VOID_RETURN; } @@ -3190,7 +3190,7 @@ ha_innobase::check( { row_prebuilt_t* prebuilt = (row_prebuilt_t*) innobase_prebuilt; ulint ret; - + if (prebuilt->mysql_template == NULL) { /* Build the template; we will use a dummy template in index scans done in checking */ @@ -3203,7 +3203,7 @@ ha_innobase::check( if (ret == DB_SUCCESS) { return(HA_ADMIN_OK); } - + return(HA_ADMIN_CORRUPT); } @@ -3241,7 +3241,7 @@ ha_innobase::update_table_comment( /* We assume 150 bytes of space to print info */ dict_print_info_on_foreign_keys(pos, 150, prebuilt->table); - + return(str); } @@ -3380,7 +3380,7 @@ ha_innobase::get_auto_increment() prebuilt->select_lock_type = LOCK_X; prebuilt->trx->mysql_n_tables_locked += 1; - + error=index_last(table->record[1]); if (error) { diff --git a/sql/ha_isam.cc b/sql/ha_isam.cc index 1a950ce0a9d..a96f42c202f 100644 --- a/sql/ha_isam.cc +++ b/sql/ha_isam.cc @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ @@ -124,7 +124,7 @@ int ha_isam::index_prev(byte * buf) table->status=error ? STATUS_NOT_FOUND: 0; return !error ? 0 : my_errno ? my_errno : HA_ERR_END_OF_FILE; } - + int ha_isam::index_first(byte * buf) { statistic_increment(ha_read_first_count,&LOCK_status); @@ -236,7 +236,7 @@ int ha_isam::reset(void) int ha_isam::external_lock(THD *thd, int lock_type) { return nisam_lock_database(file,lock_type); -} +} THR_LOCK_DATA **ha_isam::store_lock(THD *thd, diff --git a/sql/ha_isam.h b/sql/ha_isam.h index 5e01edcf889..d839a6b1141 100644 --- a/sql/ha_isam.h +++ b/sql/ha_isam.h @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ @@ -80,9 +80,3 @@ class ha_isam: public handler enum thr_lock_type lock_type); }; - - - - - - diff --git a/sql/ha_isammrg.cc b/sql/ha_isammrg.cc index 41fb99fe867..b110ffba2f9 100644 --- a/sql/ha_isammrg.cc +++ b/sql/ha_isammrg.cc @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ @@ -110,7 +110,7 @@ int ha_isammrg::index_prev(byte * buf) { return (my_errno=HA_ERR_WRONG_COMMAND); } - + int ha_isammrg::index_first(byte * buf) { return (my_errno=HA_ERR_WRONG_COMMAND); @@ -179,7 +179,7 @@ int ha_isammrg::reset(void) int ha_isammrg::external_lock(THD *thd, int lock_type) { return !mrg_lock_database(file,lock_type) ? 0 : my_errno ? my_errno : -1; -} +} uint ha_isammrg::lock_count(void) const { diff --git a/sql/ha_isammrg.h b/sql/ha_isammrg.h index c8eb7dd9f69..5e0eaa1b2aa 100644 --- a/sql/ha_isammrg.h +++ b/sql/ha_isammrg.h @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc index fa130c59a88..0378ff7ba6f 100644 --- a/sql/ha_myisam.cc +++ b/sql/ha_myisam.cc @@ -426,7 +426,7 @@ int ha_myisam::backup(THD* thd, HA_CHECK_OPT *check_opt) error = HA_ADMIN_INVALID; goto err; } - + if (my_copy(fn_format(src_path, table->path,"", reg_ext, MY_UNPACK_FILENAME), dst_path, MYF(MY_WME | MY_HOLD_ORIGINAL_MODES))) @@ -883,7 +883,7 @@ void ha_myisam::info(uint flag) raid_type=info.raid_type; raid_chunks=info.raid_chunks; raid_chunksize=info.raid_chunksize; - + /* Set data_file_name and index_file_name to point at the symlink value if table is symlinked (Ie; Real name is not same as generated name) @@ -1214,4 +1214,3 @@ int ha_myisam::ft_read(byte * buf) table->status=error ? STATUS_NOT_FOUND: 0; return error; } - diff --git a/sql/handler.cc b/sql/handler.cc index d7c6f3fe93c..f097e501a8b 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ @@ -338,7 +338,7 @@ int ha_delete_table(enum db_type table_type, const char *path) delete file; return error; } - + void ha_store_ptr(byte *buff, uint pack_length, my_off_t pos) { switch (pack_length) { diff --git a/sql/hash_filo.cc b/sql/hash_filo.cc index 990d2d662d6..b85f8054f10 100644 --- a/sql/hash_filo.cc +++ b/sql/hash_filo.cc @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ diff --git a/sql/hash_filo.h b/sql/hash_filo.h index 69301479ec7..b8d45f0d3be 100644 --- a/sql/hash_filo.h +++ b/sql/hash_filo.h @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ diff --git a/sql/hostname.cc b/sql/hostname.cc index bc812341337..7d4e4a8ca75 100644 --- a/sql/hostname.cc +++ b/sql/hostname.cc @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ diff --git a/sql/init.cc b/sql/init.cc index e6606b82b7c..df06ddd41ef 100644 --- a/sql/init.cc +++ b/sql/init.cc @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ diff --git a/sql/item.cc b/sql/item.cc index 1f8d653e612..c081fd9dd5f 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ diff --git a/sql/item.h b/sql/item.h index 355d81d0c6c..cd752710523 100644 --- a/sql/item.h +++ b/sql/item.h @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ diff --git a/sql/item_buff.cc b/sql/item_buff.cc index 61e1f5498a9..b55a4dc66a0 100644 --- a/sql/item_buff.cc +++ b/sql/item_buff.cc @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 8d2a4d491c4..0c83698e60a 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h index 9ed3e86d6e8..c9c7d5654d6 100644 --- a/sql/item_cmpfunc.h +++ b/sql/item_cmpfunc.h @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ diff --git a/sql/item_create.cc b/sql/item_create.cc index 5809091275e..71dc99f2558 100644 --- a/sql/item_create.cc +++ b/sql/item_create.cc @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ diff --git a/sql/item_create.h b/sql/item_create.h index 54d2ff035ea..9318025cae8 100644 --- a/sql/item_create.h +++ b/sql/item_create.h @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ diff --git a/sql/item_func.cc b/sql/item_func.cc index eeae891b793..652896bb1e4 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -1445,7 +1445,7 @@ longlong Item_master_pos_wait::val_int() THD* thd = current_thd; String *log_name = args[0]->val_str(&value); int event_count; - + null_value=0; if (thd->slave_thread || !log_name || !log_name->length()) { diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 08d8fb7c38b..29f06c11bcf 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ @@ -285,7 +285,7 @@ String *Item_func_des_decrypt::val_str(String *str) return 0; if (res->length() == 0) return &empty_string; - + if(res->c_ptr()[0]=='1') // Skip decryption if not encrypted { str->set((const char*)0,(uint)0); @@ -294,7 +294,7 @@ String *Item_func_des_decrypt::val_str(String *str) str->append((ascii_to_bin(res->c_ptr()[i])) | (ascii_to_bin(res->c_ptr()[i+1]) << 5 )); } - + String *keystr=args[1]->val_str(&tmp_value); int32 mode=0; if(arg_count == 3 && !args[2]->null_value) @@ -1854,7 +1854,7 @@ String* Item_func_inet_ntoa::val_str(String* str) // we handle the possibility of an 8-byte IP address // however, we do not want to confuse those who are just using // 4 byte ones - + for (p= buf + 8; p > buf+4 && p[-1] == 0 ; p-- ) ; num[3]='.'; while (p-- > buf) diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 431d8b56e6a..e8f16e3ed56 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ @@ -967,7 +967,7 @@ bool Item_sum_count_distinct::setup(THD *thd) table->file->extra(HA_EXTRA_NO_ROWS); // Don't update rows table->no_rows=1; - + // no blobs, otherwise it would be MyISAM if (table->db_type == DB_TYPE_HEAP) { @@ -976,7 +976,7 @@ bool Item_sum_count_distinct::setup(THD *thd) // to make things easier for dump_leaf if we ever have to dump to MyISAM restore_record(table,2); - + if (table->fields == 1) { /* diff --git a/sql/item_sum.h b/sql/item_sum.h index 18b0c3ff577..4840ae8298d 100644 --- a/sql/item_sum.h +++ b/sql/item_sum.h @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ @@ -159,7 +159,7 @@ class Item_sum_count_distinct :public Item_sum_int // are just markers for deleted and NULLs. We want to skip them since // they will just bloat the tree without providing any valuable info int rec_offset; - + // If there are no blobs, we can use a tree, which // is faster than heap table. In that case, we still use the table // to help get things set up, but we insert nothing in it @@ -167,7 +167,7 @@ class Item_sum_count_distinct :public Item_sum_int bool always_null; // Set to 1 if the result is always NULL int tree_to_myisam(); - + friend int composite_key_cmp(void* arg, byte* key1, byte* key2); friend int dump_leaf(byte* key, uint32 count __attribute__((unused)), Item_sum_count_distinct* item); diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index b198900d24e..e65f7679cae 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h index 1343cdad390..bb33e4541aa 100644 --- a/sql/item_timefunc.h +++ b/sql/item_timefunc.h @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ diff --git a/sql/item_uniq.cc b/sql/item_uniq.cc index 80ed6433fd8..88e0cbbc0e6 100644 --- a/sql/item_uniq.cc +++ b/sql/item_uniq.cc @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ diff --git a/sql/item_uniq.h b/sql/item_uniq.h index ff11222e2ee..4be64ecc74a 100644 --- a/sql/item_uniq.h +++ b/sql/item_uniq.h @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ diff --git a/sql/key.cc b/sql/key.cc index b6fb260bf36..d2f483e3d73 100644 --- a/sql/key.cc +++ b/sql/key.cc @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ @@ -258,7 +258,7 @@ bool check_if_key_used(TABLE *table, uint idx, List<Item> &fields) key_part++) { Item_field *field; - + if (key_part->field == table->timestamp_field) return 1; // Can't be used for update diff --git a/sql/lex_symbol.h b/sql/lex_symbol.h index a011e27b59e..9fff1751b1b 100644 --- a/sql/lex_symbol.h +++ b/sql/lex_symbol.h @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ diff --git a/sql/lock.cc b/sql/lock.cc index 520821629e3..9f4f23b01e3 100644 --- a/sql/lock.cc +++ b/sql/lock.cc @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ diff --git a/sql/log.cc b/sql/log.cc index fa45d938b24..84fb3d8f5b9 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ @@ -112,7 +112,7 @@ void MYSQL_LOG::set_index_file_name(const char* index_file_name) int MYSQL_LOG::generate_new_name(char *new_name, const char *log_name) -{ +{ if (log_type == LOG_NORMAL) fn_format(new_name,log_name,mysql_data_home,"",4); else @@ -166,11 +166,11 @@ void MYSQL_LOG::open(const char *log_name, enum_log_type log_type_arg, char buff[512]; File file= -1; bool do_magic; - + if (!inited && log_type_arg == LOG_BIN && *fn_ext(log_name)) no_rotate = 1; init(log_type_arg); - + if (!(name=my_strdup(log_name,MYF(MY_WME)))) goto err; if (new_name) @@ -180,11 +180,11 @@ void MYSQL_LOG::open(const char *log_name, enum_log_type log_type_arg, if (log_type == LOG_BIN && !index_file_name[0]) fn_format(index_file_name, name, mysql_data_home, ".index", 6); - + db[0]=0; do_magic = ((log_type == LOG_BIN) && !my_stat(log_file_name, &tmp_stat, MYF(0))); - + if ((file=my_open(log_file_name,O_CREAT | O_APPEND | O_WRONLY | O_BINARY, MYF(MY_WME | ME_WAITTANG))) < 0 || init_io_cache(&log_file, file, IO_SIZE, io_cache_type, @@ -266,7 +266,7 @@ err: log_type=LOG_CLOSED; return; - + } int MYSQL_LOG::get_current_log(LOG_INFO* linfo) @@ -322,7 +322,7 @@ err: pthread_mutex_unlock(&LOCK_index); end_io_cache(&io_cache); return error; - + } @@ -359,7 +359,7 @@ err: return error; } - + int MYSQL_LOG::purge_logs(THD* thd, const char* to_log) { if (index_file < 0) return LOG_INFO_INVALID; @@ -373,9 +373,9 @@ int MYSQL_LOG::purge_logs(THD* thd, const char* to_log) my_off_t purge_offset ; LINT_INIT(purge_offset); IO_CACHE io_cache; - + pthread_mutex_lock(&LOCK_index); - + if (init_io_cache(&io_cache,index_file, IO_SIZE*2, READ_CACHE, (my_off_t) 0, 0, MYF(MY_WME))) { @@ -388,7 +388,7 @@ int MYSQL_LOG::purge_logs(THD* thd, const char* to_log) goto err; } logs_to_purge_inited = 1; - + if (init_dynamic_array(&logs_to_keep, sizeof(char*), 1024, 1024)) { error = LOG_INFO_MEM; @@ -396,7 +396,7 @@ int MYSQL_LOG::purge_logs(THD* thd, const char* to_log) } logs_to_keep_inited = 1; - + for(;;) { my_off_t init_purge_offset= my_b_tell(&io_cache); @@ -414,14 +414,14 @@ int MYSQL_LOG::purge_logs(THD* thd, const char* to_log) found_log = 1; purge_offset = init_purge_offset; } - + // if one of the logs before the target is in use if(!found_log && log_in_use(fname)) { error = LOG_INFO_IN_USE; goto err; } - + if (!(p = sql_memdup(fname, fname_len+1)) || insert_dynamic(found_log ? &logs_to_keep : &logs_to_purge, (gptr) &p)) @@ -430,14 +430,14 @@ int MYSQL_LOG::purge_logs(THD* thd, const char* to_log) goto err; } } - + end_io_cache(&io_cache); if(!found_log) { error = LOG_INFO_EOF; goto err; } - + for(i = 0; i < logs_to_purge.elements; i++) { char* l; @@ -445,7 +445,7 @@ int MYSQL_LOG::purge_logs(THD* thd, const char* to_log) if (my_delete(l, MYF(MY_WME))) sql_print_error("Error deleting %s during purge", l); } - + // if we get killed -9 here, the sysadmin would have to do a small // vi job on the log index file after restart - otherwise, this should // be safe @@ -471,7 +471,7 @@ during log purge for write"); goto err; } #endif - + for(i = 0; i < logs_to_keep.elements; i++) { char* l; @@ -509,7 +509,7 @@ void MYSQL_LOG::make_log_name(char* buf, const char* log_ident) int ident_len = (uint) strlen(log_ident); if (dir_len + ident_len + 1 > FN_REFLEN) return; // protection agains malicious buffer overflow - + memcpy(buf, log_file_name, dir_len); // copy filename + end null memcpy(buf + dir_len, log_ident, ident_len + 1); @@ -661,7 +661,7 @@ bool MYSQL_LOG::write(Log_event* event_info) /* In most cases this is only called if 'is_open()' is true */ bool error=0; bool should_rotate = 0; - + if (!inited) // Can't use mutex if not init return 0; VOID(pthread_mutex_lock(&LOCK_log)); @@ -761,7 +761,7 @@ bool MYSQL_LOG::write(IO_CACHE *cache) { VOID(pthread_mutex_lock(&LOCK_log)); bool error=1; - + if (is_open()) { uint length; @@ -801,9 +801,9 @@ err: write_error=1; else VOID(pthread_cond_broadcast(&COND_binlog_update)); - + VOID(pthread_mutex_unlock(&LOCK_log)); - + return error; } diff --git a/sql/log_event.cc b/sql/log_event.cc index b8c2435e84e..6f931bd8f42 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ @@ -238,7 +238,7 @@ void Load_log_event::pack_info(String* packet) tmp.append(" REPLACE "); else if (sql_ex.opt_flags && IGNORE_FLAG ) tmp.append(" IGNORE "); - + tmp.append("INTO TABLE "); tmp.append(table_name); if (sql_ex.field_term_len) @@ -254,13 +254,13 @@ void Load_log_event::pack_info(String* packet) tmp.append( " ENCLOSED BY "); pretty_print_str(&tmp, sql_ex.enclosed, sql_ex.enclosed_len); } - + if (sql_ex.escaped_len) { tmp.append( " ESCAPED BY "); pretty_print_str(&tmp, sql_ex.escaped, sql_ex.escaped_len); } - + if (sql_ex.line_term_len) { tmp.append(" LINES TERMINATED BY "); @@ -272,7 +272,7 @@ void Load_log_event::pack_info(String* packet) tmp.append(" LINES STARTING BY "); pretty_print_str(&tmp, sql_ex.line_start, sql_ex.line_start_len); } - + if ((int)skip_lines > 0) tmp.append( " IGNORE %ld LINES ", (long) skip_lines); @@ -285,7 +285,7 @@ void Load_log_event::pack_info(String* packet) if (i) tmp.append(" ,"); tmp.append( field); - + field += field_lens[i] + 1; } tmp.append(')'); @@ -355,7 +355,7 @@ int Log_event::net_send(THD* thd, const char* log_name, my_off_t pos) const char* event_type; if (p) log_name = p + 1; - + packet->length(0); net_store_data(packet, log_name, strlen(log_name)); net_store_data(packet, (longlong) pos); @@ -524,9 +524,9 @@ Log_event* Log_event::read_log_event(const char* buf, int event_len, if (event_len < EVENT_LEN_OFFSET || (uint)event_len != uint4korr(buf+EVENT_LEN_OFFSET)) return NULL; // general sanity check - will fail on a partial read - + Log_event* ev = NULL; - + switch(buf[EVENT_TYPE_OFFSET]) { case QUERY_EVENT: @@ -779,7 +779,7 @@ void Query_log_event::print(FILE* file, bool short_form, char* last_db) if (!(same_db = !memcmp(last_db, db, db_len + 1))) memcpy(last_db, db, db_len + 1); } - + if (db && db[0] && !same_db) fprintf(file, "use %s;\n", db); end=int10_to_str((long) when, strmov(buff,"SET TIMESTAMP="),10); @@ -795,7 +795,7 @@ void Query_log_event::print(FILE* file, bool short_form, char* last_db) int Query_log_event::write_data(IO_CACHE* file) { if (!query) return -1; - + char buf[QUERY_HEADER_LEN]; int4store(buf + Q_THREAD_ID_OFFSET, thread_id); int4store(buf + Q_EXEC_TIME_OFFSET, exec_time); @@ -855,7 +855,7 @@ void Intvar_log_event::print(FILE* file, bool short_form, char* last_db) } fprintf(file, "%s;\n", llstr(val,llbuff)); fflush(file); - + } #endif @@ -994,7 +994,7 @@ Load_log_event::Load_log_event(THD* thd, sql_exchange* ex, sql_ex.escaped_len = (uint8) ex->escaped->length(); sql_ex.opt_flags = 0; sql_ex.cached_new_format = -1; - + if (ex->dumpfile) sql_ex.opt_flags |= DUMPFILE_FLAG; if (ex->opt_enclosed) @@ -1019,7 +1019,7 @@ Load_log_event::Load_log_event(THD* thd, sql_exchange* ex, sql_ex.empty_flags |= LINE_START_EMPTY; if (!ex->escaped->length()) sql_ex.empty_flags |= ESCAPED_EMPTY; - + skip_lines = ex->skip_lines; List_iterator<Item> li(fields_arg); @@ -1066,7 +1066,7 @@ int Load_log_event::copy_log_event(const char *buf, ulong event_len, table_name_len = (uint)data_head[L_TBL_LEN_OFFSET]; db_len = (uint)data_head[L_DB_LEN_OFFSET]; num_fields = uint4korr(data_head + L_NUM_FIELDS_OFFSET); - + int body_offset = get_data_body_offset(); if ((int) event_len < body_offset) return 1; @@ -1076,7 +1076,7 @@ int Load_log_event::copy_log_event(const char *buf, ulong event_len, buf_end, buf[EVENT_TYPE_OFFSET] != LOAD_EVENT))) return 1; - + data_len = event_len - body_offset; if (num_fields > data_len) // simple sanity check against corruption return 1; @@ -1113,7 +1113,7 @@ void Load_log_event::print(FILE* file, bool short_form, char* last_db) if (!(same_db = !memcmp(last_db, db, db_len + 1))) memcpy(last_db, db, db_len + 1); } - + if (db && db[0] && !same_db) fprintf(file, "use %s;\n", db); @@ -1123,7 +1123,7 @@ void Load_log_event::print(FILE* file, bool short_form, char* last_db) fprintf(file," REPLACE "); else if (sql_ex.opt_flags && IGNORE_FLAG ) fprintf(file," IGNORE "); - + fprintf(file, "INTO TABLE %s ", table_name); if (sql_ex.field_term) { @@ -1138,13 +1138,13 @@ void Load_log_event::print(FILE* file, bool short_form, char* last_db) fprintf(file, " ENCLOSED BY "); pretty_print_str(file, sql_ex.enclosed, sql_ex.enclosed_len); } - + if (sql_ex.escaped) { fprintf(file, " ESCAPED BY "); pretty_print_str(file, sql_ex.escaped, sql_ex.escaped_len); } - + if (sql_ex.line_term) { fprintf(file," LINES TERMINATED BY "); @@ -1156,7 +1156,7 @@ void Load_log_event::print(FILE* file, bool short_form, char* last_db) fprintf(file," LINES STARTING BY "); pretty_print_str(file, sql_ex.line_start, sql_ex.line_start_len); } - + if ((int)skip_lines > 0) fprintf(file, " IGNORE %ld LINES ", (long) skip_lines); @@ -1170,7 +1170,7 @@ void Load_log_event::print(FILE* file, bool short_form, char* last_db) if (i) fputc(',', file); fprintf(file, field); - + field += field_lens[i] + 1; } fputc(')', file); @@ -1198,7 +1198,7 @@ void Load_log_event::set_fields(List<Item> &fields) fields.push_back(new Item_field(db, table_name, field)); field += field_lens[i] + 1; } - + } Slave_log_event::Slave_log_event(THD* thd_arg,struct st_master_info* mi): @@ -1388,7 +1388,7 @@ Append_block_log_event::Append_block_log_event(THD* thd_arg, char* block_arg, { } #endif - + Append_block_log_event::Append_block_log_event(const char* buf, int len): Log_event(buf, 0),block(0) { @@ -1487,7 +1487,7 @@ Execute_load_log_event::Execute_load_log_event(THD* thd_arg): { } #endif - + Execute_load_log_event::Execute_load_log_event(const char* buf,int len): Log_event(buf, 0),file_id(0) { @@ -1546,7 +1546,7 @@ int Query_log_event::exec_event(struct st_master_info* mi) thd->net.last_errno = 0; thd->net.last_error[0] = 0; thd->slave_proxy_id = thread_id; // for temp tables - + /* sanity check to make sure the master did not get a really bad error on the query @@ -1587,7 +1587,7 @@ int Query_log_event::exec_event(struct st_master_info* mi) // assume no convert for next query unless set explictly thd->convert_set = 0; close_thread_tables(thd); - + if (thd->query_error || thd->fatal_error) { slave_print_error(actual_error, "error '%s' on query '%s'", @@ -1606,7 +1606,7 @@ int Load_log_event::exec_event(NET* net, struct st_master_info* mi) thd->db = rewrite_db((char*)db); thd->query = 0; thd->query_error = 0; - + if (db_ok(thd->db, replicate_do_db, replicate_ignore_db)) { thd->set_time((time_t)when); @@ -1639,7 +1639,7 @@ int Load_log_event::exec_event(NET* net, struct st_master_info* mi) String line_term(sql_ex.line_term,sql_ex.line_term_len); String line_start(sql_ex.line_start,sql_ex.line_start_len); String escaped(sql_ex.escaped,sql_ex.escaped_len); - + ex.opt_enclosed = (sql_ex.opt_flags & OPT_ENCLOSED_FLAG); if (sql_ex.empty_flags & FIELD_TERM_EMPTY) ex.field_term->length(0); @@ -1674,7 +1674,7 @@ int Load_log_event::exec_event(NET* net, struct st_master_info* mi) if (net) skip_load_data_infile(net); } - + thd->net.vio = 0; thd->db = 0;// prevent db from being freed close_thread_tables(thd); @@ -1683,14 +1683,14 @@ int Load_log_event::exec_event(NET* net, struct st_master_info* mi) int sql_error = thd->net.last_errno; if (!sql_error) sql_error = ER_UNKNOWN_ERROR; - + slave_print_error(sql_error, "Slave: Error '%s' running load data infile ", ER_SAFE(sql_error)); free_root(&thd->mem_root,0); return 1; } free_root(&thd->mem_root,0); - + if (thd->fatal_error) { sql_print_error("Slave: Fatal error running LOAD DATA INFILE "); @@ -1728,7 +1728,7 @@ int Rotate_log_event::exec_event(struct st_master_info* mi) bool rotate_binlog = 0, write_slave_event = 0; char* log_name = mi->log_file_name; pthread_mutex_lock(&mi->lock); - + // rotate local binlog only if the name of remote has changed if (!*log_name || !(log_name[ident_len] == 0 && !memcmp(log_name, new_log_ident, ident_len))) @@ -1753,7 +1753,7 @@ int Rotate_log_event::exec_event(struct st_master_info* mi) pthread_cond_broadcast(&mi->cond); pthread_mutex_unlock(&mi->lock); flush_master_info(mi); - + if (write_slave_event) { Slave_log_event s(thd, mi); @@ -1810,7 +1810,7 @@ int Create_file_log_event::exec_event(struct st_master_info* mi) slave_print_error(my_errno, "Could not open file '%s'", fname_buf); goto err; } - + // a trick to avoid allocating another buffer strmov(p, ".data"); fname = fname_buf; @@ -1823,7 +1823,7 @@ int Create_file_log_event::exec_event(struct st_master_info* mi) } end_io_cache(&file); my_close(fd, MYF(0)); - + // fname_buf now already has .data, not .info, because we did our trick if ((fd = my_open(fname_buf, O_WRONLY|O_CREAT|O_BINARY|O_TRUNC, MYF(MY_WME))) < 0) diff --git a/sql/log_event.h b/sql/log_event.h index 4426232008b..8b26ecef109 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ @@ -77,7 +77,7 @@ struct sql_ex_info char opt_flags; char empty_flags; int cached_new_format; - + // store in new format even if old is possible void force_new_format() { cached_new_format = 1;} int data_size() { return new_format() ? @@ -231,7 +231,7 @@ public: { my_free((gptr) ptr, MYF(MY_WME|MY_ALLOW_ZERO_PTR)); } - + int write(IO_CACHE* file); int write_header(IO_CACHE* file); virtual int write_data(IO_CACHE* file) @@ -288,7 +288,7 @@ public: void print_timestamp(FILE* file, time_t *ts = 0); void print_header(FILE* file); #endif - + }; @@ -391,11 +391,11 @@ public: uint32 field_block_len; uint32 skip_lines; sql_ex_info sql_ex; - + #ifndef MYSQL_CLIENT String field_lens_buf; String fields_buf; - + Load_log_event(THD* thd, sql_exchange* ex, const char* db_arg, const char* table_name_arg, List<Item>& fields_arg, enum enum_duplicates handle_dup); @@ -605,7 +605,7 @@ public: char* block; uint block_len; uint file_id; - + Append_block_log_event(const char* buf, int event_len); ~Append_block_log_event() { @@ -630,7 +630,7 @@ class Delete_file_log_event: public Log_event { public: uint file_id; - + Delete_file_log_event(const char* buf, int event_len); ~Delete_file_log_event() { @@ -653,7 +653,7 @@ class Execute_load_log_event: public Log_event { public: uint file_id; - + Execute_load_log_event(const char* buf, int event_len); ~Execute_load_log_event() { diff --git a/sql/matherr.c b/sql/matherr.c index ed18438cd0c..ea0c15d2feb 100644 --- a/sql/matherr.c +++ b/sql/matherr.c @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ diff --git a/sql/mf_iocache.cc b/sql/mf_iocache.cc index 860318d5a79..1bc65eebd23 100644 --- a/sql/mf_iocache.cc +++ b/sql/mf_iocache.cc @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ diff --git a/sql/mini_client.cc b/sql/mini_client.cc index f75f5b09cef..3da5edac37f 100644 --- a/sql/mini_client.cc +++ b/sql/mini_client.cc @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ @@ -809,7 +809,7 @@ mc_mysql_connect(MYSQL *mysql,const char *host, const char *user, #endif /* HAVE_OPENSSL */ int3store(buff+2,max_allowed_packet); - + if (user && user[0]) strmake(buff+5,user,32); else @@ -1397,11 +1397,3 @@ MYSQL_RES * STDCALL mc_mysql_store_result(MYSQL *mysql) mysql->fields=0; /* fields is now in result */ DBUG_RETURN(result); /* Data fetched */ } - - - - - - - - diff --git a/sql/mini_client.h b/sql/mini_client.h index de78da06eec..b370a498a3f 100644 --- a/sql/mini_client.h +++ b/sql/mini_client.h @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ @@ -55,4 +55,3 @@ int STDCALL mc_mysql_select_db(MYSQL *mysql, const char *db); #endif - diff --git a/sql/my_lock.c b/sql/my_lock.c index 19d38fd9c79..9b4ac502e57 100644 --- a/sql/my_lock.c +++ b/sql/my_lock.c @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 5acec4ead67..8290e659a25 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -277,7 +277,7 @@ volatile ulong cached_thread_count=0; my_string master_user = (char*) "test", master_password = 0, master_host=0, master_info_file = (char*) "master.info", master_ssl_key=0, master_ssl_cert=0; my_string report_user = 0, report_password = 0, report_host=0; - + const char *localhost=LOCAL_HOST; const char *delayed_user="DELAYED"; uint master_port = MYSQL_PORT, master_connect_retry = 60; @@ -307,7 +307,7 @@ ulong max_connections,max_insert_delayed_threads,max_used_connections, ulong thread_id=1L,current_pid; ulong slow_launch_threads = 0; ulong myisam_max_sort_file_size, myisam_max_extra_sort_file_size; - + char mysql_real_data_home[FN_REFLEN], language[LIBLEN],reg_ext[FN_EXTLEN], default_charset[LIBLEN],mysql_charsets_dir[FN_REFLEN], *charsets_list, @@ -606,7 +606,7 @@ void kill_mysql(void) #ifdef SIGNALS_DONT_BREAK_READ close_server_sock(); /* force accept to wake up */ #endif - + #if defined(__WIN__) { if (!SetEvent(hEventShutdown)) @@ -1230,7 +1230,7 @@ static sig_handler handle_segfault(int sig) fprintf(stderr, "Fatal signal %d while backtracing\n", sig); exit(1); } - + segfaulted = 1; fprintf(stderr,"\ mysqld got signal %d;\n\ @@ -1253,7 +1253,7 @@ key_buffer_size + (record_buffer + sort_buffer)*max_connections = %ld K\n\ bytes of memory\n", (keybuff_size + (my_default_record_cache_size + sortbuff_size) * max_connections)/ 1024); fprintf(stderr, "Hope that's ok; if not, decrease some variables in the equation.\n\n"); - + #if defined(HAVE_LINUXTHREADS) if (sizeof(char*) == 4 && thread_count > UNSAFE_DEFAULT_LINUX_THREADS) { @@ -1819,7 +1819,7 @@ int main(int argc, char **argv) reset_floating_point_exceptions(); init_thr_lock(); init_slave_list(); - + /* Setup log files */ if (opt_log) open_log(&mysql_log, glob_hostname, opt_logname, ".log", LOG_NORMAL); @@ -2097,7 +2097,7 @@ The server will not act as a slave."); /* Wait until cleanup is done */ (void) pthread_mutex_lock(&LOCK_thread_count); DBUG_PRINT("quit", ("Got thread_count mutex for clean up wait")); - + while (!ready_to_exit) { DBUG_PRINT("quit", ("not yet ready to exit")); @@ -2297,7 +2297,7 @@ static void create_new_thread(THD *thd) (void) pthread_mutex_unlock(&LOCK_thread_count); DBUG_VOID_RETURN; } - + (void) pthread_mutex_unlock(&LOCK_thread_count); } } @@ -3222,7 +3222,7 @@ static void use_help(void) { print_version(); printf("Use '--help' or '--no-defaults --help' for a list of available options\n"); -} +} static void usage(void) { diff --git a/sql/net_pkg.cc b/sql/net_pkg.cc index 0b50b34c7bd..9fb478ca664 100644 --- a/sql/net_pkg.cc +++ b/sql/net_pkg.cc @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ @@ -104,7 +104,7 @@ net_printf(NET *net, uint errcode, ...) if(thd) thd->query_error = 1; // if we are here, something is wrong :-) - + va_start(args,errcode); format=ER(errcode); offset= net->return_errno ? 2 : 0; @@ -142,7 +142,7 @@ send_ok(NET *net,ha_rows affected_rows,ulonglong id,const char *message) { if (net->no_send_ok) // hack for re-parsing queries return; - + char buff[MYSQL_ERRMSG_SIZE+10],*pos; DBUG_ENTER("send_ok"); buff[0]=0; // No fields diff --git a/sql/net_serv.cc b/sql/net_serv.cc index 5a39b071b4f..7eb4e0159a5 100644 --- a/sql/net_serv.cc +++ b/sql/net_serv.cc @@ -1,19 +1,18 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB +/* Copyright (C) 2000 MySQL AB - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. - This library is distributed in the hope that it will be useful, + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - MA 02111-1307, USA */ + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* Write and read of logical packets to/from socket ** Writes are cached into net_buffer_length big packets. @@ -749,7 +748,7 @@ my_net_read(NET *net) for (;;) { ulong packet_len; - + if (buf_length - start_of_packet >= NET_HEADER_SIZE) { read_length = uint3korr(net->buff+start_of_packet); diff --git a/sql/opt_sum.cc b/sql/opt_sum.cc index 3dd13cbebb9..69fc5aa88ff 100644 --- a/sql/opt_sum.cc +++ b/sql/opt_sum.cc @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ diff --git a/sql/password.c b/sql/password.c index 1db94e0db8a..48181ea18e6 100644 --- a/sql/password.c +++ b/sql/password.c @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ diff --git a/sql/procedure.cc b/sql/procedure.cc index 526bbe0feab..437bd82d6e5 100644 --- a/sql/procedure.cc +++ b/sql/procedure.cc @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ diff --git a/sql/procedure.h b/sql/procedure.h index 1583f1169ce..db0e0b7f9e2 100644 --- a/sql/procedure.h +++ b/sql/procedure.h @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ diff --git a/sql/records.cc b/sql/records.cc index 37f79e54cf6..395acbba47d 100644 --- a/sql/records.cc +++ b/sql/records.cc @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc index d846662947d..6b15bd92ac6 100644 --- a/sql/repl_failsafe.cc +++ b/sql/repl_failsafe.cc @@ -256,7 +256,7 @@ int translate_master(THD* thd, LEX_MASTER_INFO* mi, char* errmsg) } linfo.index_file_offset = 0; - + search_file_name[0] = 0; @@ -364,7 +364,7 @@ static Slave_log_event* find_slave_event(IO_CACHE* log, int i; bool slave_event_found = 0; LINT_INIT(ev); - + for (i = 0; i < 2; i++) { if (!(ev = Log_event::read_log_event(log, (pthread_mutex_t*)0, 0))) @@ -436,7 +436,7 @@ int update_slave_list(MYSQL* mysql) const char* error=0; bool have_auth_info; int port_ind; - + if (mc_mysql_query(mysql,"SHOW SLAVE HOSTS",0) || !(res = mc_mysql_store_result(mysql))) { @@ -504,7 +504,7 @@ err: int find_recovery_captain(THD* thd, MYSQL* mysql) { - + return 0; } @@ -826,7 +826,3 @@ err: return error; } - - - - diff --git a/sql/slave.cc b/sql/slave.cc index 700838d7cd7..0d463b04a4a 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ @@ -97,7 +97,7 @@ static TABLE_RULE_ENT* find_wild(DYNAMIC_ARRAY *a, const char* key, int len) { uint i; const char* key_end = key + len; - + for(i = 0; i < a->elements; i++) { TABLE_RULE_ENT* e ; @@ -106,7 +106,7 @@ static TABLE_RULE_ENT* find_wild(DYNAMIC_ARRAY *a, const char* key, int len) (const char*)(e->db + e->key_len),'\\')) return e; } - + return 0; } @@ -205,7 +205,7 @@ void end_slave() pthread_cond_wait(&COND_slave_stopped, &LOCK_slave); } pthread_mutex_unlock(&LOCK_slave); - + end_master_info(&glob_mi); if(do_table_inited) hash_free(&replicate_do_table); @@ -287,7 +287,7 @@ int db_ok(const char* db, I_List<i_string> &do_list, if(!strcmp(tmp->ptr, db)) return 0; // match } - + return 1; } } @@ -321,7 +321,7 @@ static int init_strvar_from_file(char* var, int max_size, IO_CACHE* f, static int init_intvar_from_file(int* var, IO_CACHE* f, int default_val) { char buf[32]; - + if (my_b_gets(f, buf, sizeof(buf))) { *var = atoi(buf); @@ -341,7 +341,7 @@ static int check_master_version(MYSQL* mysql, MASTER_INFO* mi) MYSQL_ROW row; const char* version; const char* errmsg = 0; - + if (mc_mysql_query(mysql, "SELECT VERSION()", 0) || !(res = mc_mysql_store_result(mysql))) { @@ -359,7 +359,7 @@ static int check_master_version(MYSQL* mysql, MASTER_INFO* mi) errmsg = "Master reported NULL for the version"; goto err; } - + switch (*version) { case '3': @@ -394,7 +394,7 @@ static int create_table_from_dump(THD* thd, NET* net, const char* db, int error= 1; handler *file; uint save_options; - + if (packet_len == packet_error) { send_error(&thd->net, ER_MASTER_NET_READ); @@ -419,7 +419,7 @@ static int create_table_from_dump(THD* thd, NET* net, const char* db, thd->current_tablenr = 0; thd->query_error = 0; thd->net.no_send_ok = 1; - + /* we do not want to log create table statement */ save_options = thd->options; thd->options &= ~OPTION_BIN_LOG; @@ -430,7 +430,7 @@ static int create_table_from_dump(THD* thd, NET* net, const char* db, mysql_parse(thd, thd->query, packet_len); // run create table thd->db = save_db; // leave things the way the were before thd->options = save_options; - + if (thd->query_error) goto err; // mysql_parse took care of the error send @@ -445,7 +445,7 @@ static int create_table_from_dump(THD* thd, NET* net, const char* db, sql_print_error("create_table_from_dump: could not open created table"); goto err; } - + file = tables.table->file; thd->proc_info = "Reading master dump table data"; if (file->net_read_dump(net)) @@ -516,7 +516,7 @@ int fetch_nx_table(THD* thd, const char* db_name, const char* table_name, sql_print_error("fetch_nx_table: failed on create table "); goto err; } - + error = 0; err: @@ -555,7 +555,7 @@ int init_master_info(MASTER_INFO* mi) pthread_mutex_lock(&mi->lock); mi->pending = 0; fd = mi->fd; - + // we do not want any messages if the file does not exist if (!my_stat(fname, &stat_area, MYF(0))) { @@ -575,7 +575,7 @@ int init_master_info(MASTER_INFO* mi) mi->log_file_name[0] = 0; mi->pos = 4; // skip magic number mi->fd = fd; - + if (master_host) strmake(mi->host, master_host, sizeof(mi->host) - 1); if (master_user) @@ -598,7 +598,7 @@ int init_master_info(MASTER_INFO* mi) pthread_mutex_unlock(&mi->lock); return 1; } - + if ((length=my_b_gets(&mi->file, mi->log_file_name, sizeof(mi->log_file_name))) < 1) { @@ -632,7 +632,7 @@ int init_master_info(MASTER_INFO* mi) goto error; } } - + mi->inited = 1; // now change the cache from READ to WRITE - must do this // before flush_master_info @@ -656,7 +656,7 @@ int register_slave_on_master(MYSQL* mysql) if(!report_host) return 0; - + int4store(buf, server_id); packet.append(buf, 4); @@ -665,7 +665,7 @@ int register_slave_on_master(MYSQL* mysql) net_store_data(&packet, report_user); else packet.append((char)0); - + if(report_password) net_store_data(&packet, report_user); else @@ -716,7 +716,7 @@ int show_master_info(THD* thd) String* packet = &thd->packet; uint32 last_log_seq; packet->length(0); - + pthread_mutex_lock(&glob_mi.lock); net_store_data(packet, glob_mi.host); net_store_data(packet, glob_mi.user); @@ -735,7 +735,7 @@ int show_master_info(THD* thd) net_store_data(packet, last_slave_error); net_store_data(packet, slave_skip_counter); net_store_data(packet, last_log_seq); - + if (my_net_write(&thd->net, (char*)thd->packet.ptr(), packet->length())) DBUG_RETURN(-1); @@ -748,7 +748,7 @@ int flush_master_info(MASTER_INFO* mi) IO_CACHE* file = &mi->file; char lbuf[22]; char lbuf1[22]; - + my_b_seek(file, 0L); my_b_printf(file, "%s\n%s\n%s\n%s\n%s\n%d\n%d\n%d\n", mi->log_file_name, llstr(mi->pos, lbuf), mi->host, mi->user, @@ -782,11 +782,11 @@ int st_master_info::wait_for_pos(THD* thd, String* log_name, ulonglong log_pos) } else cmp_result = 0; - + pos_reached = ((!cmp_result && pos >= log_pos) || cmp_result > 0); if (pos_reached || thd->killed) break; - + const char* msg = thd->enter_cond(&cond, &lock, "Waiting for master update"); pthread_cond_wait(&cond, &lock); @@ -868,7 +868,7 @@ static int safe_sleep(THD* thd, int sec) // so it will not wake up the wife and kids :-) if (thr_alarm_in_use(&alarmed)) thr_end_alarm(&alarmed); - + if (slave_killed(thd)) return 1; start_time=time((time_t*) 0); @@ -912,13 +912,13 @@ static int request_table_dump(MYSQL* mysql, const char* db, const char* table) sql_print_error("request_table_dump: Buffer overrun"); return 1; } - + *p++ = db_len; memcpy(p, db, db_len); p += db_len; *p++ = table_len; memcpy(p, table, table_len); - + if (mc_simple_command(mysql, COM_TABLE_DUMP, buf, p - buf + table_len, 1)) { sql_print_error("request_table_dump: Error sending the table dump \ @@ -943,7 +943,7 @@ static ulong read_event(MYSQL* mysql, MASTER_INFO *mi) if (disconnect_slave_event_count && !(events_till_disconnect--)) return packet_error; #endif - + while (!abort_loop && !abort_slave && len == packet_error && read_errno == EINTR ) { @@ -967,7 +967,7 @@ server_errno=%d)", mc_mysql_error(mysql), read_errno); return packet_error; } - + DBUG_PRINT("info",( "len=%u, net->read_pos[4] = %d\n", len, mysql->net.read_pos[4])); return len - 1; @@ -1010,7 +1010,7 @@ static int exec_event(THD* thd, NET* net, MASTER_INFO* mi, int event_len) { if(type_code == LOAD_EVENT) skip_load_data_infile(net); - + mi->inc_pos(event_len, ev->log_seq); flush_master_info(mi); if(slave_skip_counter && /* protect against common user error of @@ -1023,7 +1023,7 @@ static int exec_event(THD* thd, NET* net, MASTER_INFO* mi, int event_len) delete ev; return 0; // avoid infinite update loops } - + thd->server_id = ev->server_id; // use the original server id for logging thd->set_time(); // time the query if(!thd->log_seq) @@ -1044,7 +1044,7 @@ This may also be a network problem, or just a bug in the master or slave code.\ return 1; } } - + // slave thread pthread_handler_decl(handle_slave,arg __attribute__((unused))) @@ -1064,7 +1064,7 @@ pthread_handler_decl(handle_slave,arg __attribute__((unused))) sql_print_error("Server id not set, will not start slave"); pthread_exit((void*)1); } - + if(slave_running) { pthread_cond_broadcast(&COND_slave_start); @@ -1078,11 +1078,11 @@ pthread_handler_decl(handle_slave,arg __attribute__((unused))) #endif pthread_cond_broadcast(&COND_slave_start); pthread_mutex_unlock(&LOCK_slave); - + // int error = 1; bool retried_once = 0; ulonglong last_failed_pos = 0; - + // needs to call my_thread_init(), otherwise we get a coredump in DBUG_ stuff my_thread_init(); slave_thd = thd = new THD; // note that contructor of THD uses DBUG_ ! @@ -1099,17 +1099,17 @@ pthread_handler_decl(handle_slave,arg __attribute__((unused))) threads.append(thd); glob_mi.pending = 0; //this should always be set to 0 when the slave thread // is started - + DBUG_PRINT("info",("master info: log_file_name=%s, position=%s", glob_mi.log_file_name, llstr(glob_mi.pos,llbuff))); - + if (!(mysql = mc_mysql_init(NULL))) { sql_print_error("Slave thread: error in mc_mysql_init()"); goto err; } - + thd->proc_info = "connecting to master"; #ifndef DBUG_OFF sql_print_error("Slave thread initialized"); @@ -1144,7 +1144,7 @@ connected: if (register_slave_on_master(mysql) || update_slave_list(mysql)) goto err; } - + while (!slave_killed(thd)) { thd->proc_info = "Requesting binlog dump"; @@ -1157,7 +1157,7 @@ connected: dump"); goto err; } - + thd->proc_info = "Waiiting to reconnect after a failed dump request"; if(mysql->net.vio) vio_close(mysql->net.vio); @@ -1168,7 +1168,7 @@ dump"); safe_sleep(thd, glob_mi.connect_retry); else retried_once = 1; - + if(slave_killed(thd)) { sql_print_error("Slave thread killed while retrying master \ @@ -1201,7 +1201,7 @@ try again, log '%s' at postion %s", RPL_LOG_NAME, goto err; } - + if (event_len == packet_error) { if(mc_mysql_errno(mysql) == ER_NET_PACKET_TOO_LARGE) @@ -1212,7 +1212,7 @@ really supposed to be that long, restart the server with a higher value of \ max_allowed_packet. The current value is %ld", max_allowed_packet); goto err; } - + thd->proc_info = "Waiting to reconnect after a failed read"; if(mysql->net.vio) vio_close(mysql->net.vio); @@ -1220,7 +1220,7 @@ max_allowed_packet. The current value is %ld", max_allowed_packet); safe_sleep(thd, glob_mi.connect_retry); else retried_once = 1; - + if(slave_killed(thd)) { sql_print_error("Slave thread killed while waiting to \ @@ -1238,10 +1238,10 @@ reconnecting to retry, log '%s' position %s", RPL_LOG_NAME, reconnect done to recover from failed read"); goto err; } - + goto connected; } // if(event_len == packet_error) - + thd->proc_info = "Processing master log event"; if(exec_event(thd, &mysql->net, &glob_mi, event_len)) { @@ -1262,7 +1262,7 @@ the slave thread with \"mysqladmin start-slave\". We stopped at log \ goto err; } #endif - + // successful exec with offset advance, // the slave repents and his sins are forgiven! if(glob_mi.pos > last_failed_pos) diff --git a/sql/slave.h b/sql/slave.h index a5bc4d61309..705572bd7a8 100644 --- a/sql/slave.h +++ b/sql/slave.h @@ -24,7 +24,7 @@ typedef struct st_master_info pthread_cond_t cond; bool inited; bool old_format; /* master binlog is in 3.23 format */ - + st_master_info():pending(0),fd(-1),last_log_seq(0),inited(0), old_format(0) { @@ -148,5 +148,3 @@ extern I_List<i_string_pair> replicate_rewrite_db; extern I_List<THD> threads; #endif - - diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 13923f0a637..6a54e3b2b16 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ @@ -943,7 +943,7 @@ bool change_password(THD *thd, const char *host, const char *user, VOID(pthread_mutex_unlock(&acl_cache->lock)); char buff[460]; - + Query_log_event qinfo(thd, buff); qinfo.q_len = my_sprintf(buff, diff --git a/sql/sql_acl.h b/sql/sql_acl.h index e6a39f1b269..4453194e0b8 100644 --- a/sql/sql_acl.h +++ b/sql/sql_acl.h @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ diff --git a/sql/sql_analyse.cc b/sql/sql_analyse.cc index 161e0f9b2e7..795b63ac281 100644 --- a/sql/sql_analyse.cc +++ b/sql/sql_analyse.cc @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ diff --git a/sql/sql_analyse.h b/sql/sql_analyse.h index 2147f14e160..1c60d0c150f 100644 --- a/sql/sql_analyse.h +++ b/sql/sql_analyse.h @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 7f6ffd04d98..88239eecf3c 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -510,7 +510,7 @@ void close_temporary_tables(THD *thd) const uint init_query_buf_size = 11; // "drop table " uint query_buf_size; bool found_user_tables = 0; - + LINT_INIT(end); query_buf_size = init_query_buf_size; @@ -1166,7 +1166,7 @@ bool wait_for_tables(THD *thd) /* Now we can open all tables without any interference */ thd->proc_info="Reopen tables"; result=reopen_tables(thd,0,0); - + } pthread_mutex_unlock(&LOCK_open); thd->proc_info=0; @@ -2209,4 +2209,3 @@ int init_ftfuncs(THD *thd, bool no_order) } return 0; } - diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index 9b83a14c6d6..94062978fa5 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -698,7 +698,7 @@ ulong Query_cache::resize(ulong query_cache_size) TODO: When will be realized pack() optimize case when query_cache_size < this->query_cache_size - + Try to copy old cache in new memory */ DBUG_ENTER("Query_cache::resize"); diff --git a/sql/sql_class.cc b/sql/sql_class.cc index d293a62903d..93db784b66d 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ @@ -202,7 +202,7 @@ THD::~THD() hash_free(&user_vars); DBUG_PRINT("info", ("freeing host")); - + if (host != localhost) // If not pointer to constant safeFree(host); if (user != delayed_user) diff --git a/sql/sql_class.h b/sql/sql_class.h index 5d20508e728..803c1df9dd9 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ @@ -662,5 +662,3 @@ public: int do_deletes (bool from_send_error); bool send_eof(); }; - - diff --git a/sql/sql_crypt.cc b/sql/sql_crypt.cc index 371d63f8c73..f2e4a8934be 100644 --- a/sql/sql_crypt.cc +++ b/sql/sql_crypt.cc @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ diff --git a/sql/sql_crypt.h b/sql/sql_crypt.h index b3a9d54133f..1b27f0a4d27 100644 --- a/sql/sql_crypt.h +++ b/sql/sql_crypt.h @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ diff --git a/sql/sql_db.cc b/sql/sql_db.cc index b7f078e7b2b..b476a8b1797 100644 --- a/sql/sql_db.cc +++ b/sql/sql_db.cc @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ @@ -38,7 +38,7 @@ int mysql_create_db(THD *thd, char *db, uint create_options, bool silent) long result=1; int error = 0; DBUG_ENTER("mysql_create_db"); - + VOID(pthread_mutex_lock(&LOCK_mysql_create_db)); // do not create database if another thread is holding read lock diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index bb04712aaee..c0c0e4244d9 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ @@ -266,7 +266,7 @@ multi_delete::initialize_tables(JOIN *join) table_map tables_to_delete_from=0; for (walk= delete_tables ; walk ; walk=walk->next) tables_to_delete_from|= walk->table->map; - + walk= delete_tables; for (JOIN_TAB *tab=join->join_tab, *end=join->join_tab+join->tables; tab < end; @@ -314,7 +314,7 @@ bool multi_delete::send_data(List<Item> &values) continue; table->file->position(table->record[0]); - + if (secure_counter < 0) { table->status|= STATUS_DELETED; diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc index 46cbe5e44d3..8de74adae45 100644 --- a/sql/sql_handler.cc +++ b/sql/sql_handler.cc @@ -23,17 +23,17 @@ /* TODO: HANDLER blabla OPEN [ AS foobar ] [ (column-list) ] - + the most natural (easiest, fastest) way to do it is to compute List<Item> field_list not in mysql_ha_read but in mysql_ha_open, and then store it in TABLE structure. - + The problem here is that mysql_parse calls free_item to free all the items allocated at the end of every query. The workaround would to keep two item lists per THD - normal free_list and handler_items. The second is to be freeed only on thread end. mysql_ha_open should then do { handler_items=concat(handler_items, free_list); free_list=0; } - + But !!! do_cammand calls free_root at the end of every query and frees up all the sql_alloc'ed memory. It's harder to work around... */ @@ -53,7 +53,7 @@ int mysql_ha_open(THD *thd, TABLE_LIST *tables) HANDLER_TABLES_HACK(thd); if (err) return -1; - + send_ok(&thd->net); return 0; } @@ -68,14 +68,14 @@ int mysql_ha_close(THD *thd, TABLE_LIST *tables) close_thread_table(thd, ptr); VOID(pthread_mutex_unlock(&LOCK_open)); } - + send_ok(&thd->net); return 0; } static enum enum_ha_read_modes rkey_to_rnext[]= { RNEXT, RNEXT, RPREV, RNEXT, RPREV, RNEXT, RPREV }; - + int mysql_ha_read(THD *thd, TABLE_LIST *tables, enum enum_ha_read_modes mode, char *keyname, List<Item> *key_expr, enum ha_rkey_function ha_rkey_mode, Item *cond, @@ -93,7 +93,7 @@ int mysql_ha_read(THD *thd, TABLE_LIST *tables, if (cond && cond->fix_fields(thd,tables)) return -1; - + if (keyname) { if ((keyno=find_type(keyname, &table->keynames, 1+2)-1)<0) @@ -115,7 +115,7 @@ int mysql_ha_read(THD *thd, TABLE_LIST *tables, select_limit+=offset_limit; send_fields(thd,list,1); - + MYSQL_LOCK *lock=mysql_lock_tables(thd,&tables->table,1); for (uint num_rows=0; num_rows < select_limit; ) @@ -241,12 +241,12 @@ static TABLE **find_table_ptr_by_name(THD *thd, const char *db, { int dblen; TABLE **ptr; - + if (!db || ! *db) db= thd->db ? thd->db : ""; dblen=strlen(db)+1; ptr=&(thd->handler_tables); - + for (TABLE *table=*ptr; table ; table=*ptr) { if (!memcmp(table->table_cache_key, db, dblen) && diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 548e7c9062f..526bd86bb58 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ @@ -364,7 +364,7 @@ int write_record(TABLE *table,COPY_INFO *info) { int error; char *key=0; - + info->records++; if (info->handle_duplicates == DUP_REPLACE) { @@ -398,7 +398,7 @@ int write_record(TABLE *table,COPY_INFO *info) error=my_errno; goto err; } - + if (!key) { if (!(key=(char*) my_safe_alloca(table->max_unique_length, diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 67f0d05d2d3..d61e47d0883 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 9f9fe6c79b3..d9eeb6de66d 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ diff --git a/sql/sql_list.cc b/sql/sql_list.cc index be630dfc038..1124605ca24 100644 --- a/sql/sql_list.cc +++ b/sql/sql_list.cc @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ diff --git a/sql/sql_list.h b/sql/sql_list.h index 66311b03435..542eef623f0 100644 --- a/sql/sql_list.h +++ b/sql/sql_list.h @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ diff --git a/sql/sql_load.cc b/sql/sql_load.cc index 17d1765495c..abc9fa5a121 100644 --- a/sql/sql_load.cc +++ b/sql/sql_load.cc @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ @@ -175,7 +175,7 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list, MY_STAT stat_info; if (!my_stat(name,&stat_info,MYF(MY_WME))) DBUG_RETURN(-1); - + // if we are not in slave thread, the file must be: if (!thd->slave_thread && !((stat_info.st_mode & S_IROTH) == S_IROTH && // readable by others @@ -292,7 +292,7 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list, // on the slave thd->query is never initialized if(!thd->slave_thread) mysql_update_log.write(thd,thd->query,thd->query_length); - + if (!using_transactions) thd->options|=OPTION_STATUS_NO_TRANS_UPDATE; if (mysql_bin_log.is_open()) @@ -547,7 +547,7 @@ READ_INFO::READ_INFO(File file_par, uint tot_length, String &field_term, */ if (get_it_from_net) cache.read_function = _my_b_net_read; - + need_end_io_cache = 1; if (!opt_old_rpl_compat && mysql_bin_log.is_open()) cache.pre_read = cache.pre_close = @@ -748,7 +748,7 @@ found_eof: /* ** One can't use fixed length with multi-byte charset ** */ - + int READ_INFO::read_fixed_length() { int chr; @@ -872,4 +872,3 @@ bool READ_INFO::find_start_of_fields() } return 0; } - diff --git a/sql/sql_map.cc b/sql/sql_map.cc index 4578b85d10a..e7e24f957c6 100644 --- a/sql/sql_map.cc +++ b/sql/sql_map.cc @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ diff --git a/sql/sql_map.h b/sql/sql_map.h index 34f2f755b43..632eb6e4f64 100644 --- a/sql/sql_map.h +++ b/sql/sql_map.h @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 8eef80bc985..669eee1df4a 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1239,13 +1239,13 @@ mysql_execute_command(void) res = show_binlog_info(thd); break; } - + case SQLCOM_LOAD_MASTER_DATA: // sync with master if (check_process_priv(thd)) goto error; res = load_master_data(thd); break; - + case SQLCOM_LOAD_MASTER_TABLE: if (!tables->db) @@ -1681,7 +1681,7 @@ mysql_execute_command(void) TABLE_LIST *auxi; uint table_count=0; multi_delete *result; - + /* sql_yacc guarantees that tables and aux_tables are not zero */ if (check_db_used(thd, tables) || check_db_used(thd,aux_tables) || check_table_access(thd,SELECT_ACL, tables) || @@ -2241,7 +2241,7 @@ check_access(THD *thd,uint want_access,const char *db, uint *save_priv, if (db == any_db) return FALSE; // Allow select on anything - + if (db && (!thd->db || strcmp(db,thd->db))) db_access=acl_get(thd->host, thd->ip, (char*) &thd->remote.sin_addr, thd->priv_user, db); /* purecov: inspected */ @@ -2911,7 +2911,7 @@ static bool create_total_list(THD *thd, LEX *lex, TABLE_LIST **result) SELECT_LEX *sl; TABLE_LIST **new_table_list= result, *aux; - + *new_table_list=0; // end result list for (sl= &lex->select_lex; sl; sl=sl->next) { diff --git a/sql/sql_rename.cc b/sql/sql_rename.cc index 38d861d03d6..e4a277d1434 100644 --- a/sql/sql_rename.cc +++ b/sql/sql_rename.cc @@ -34,7 +34,7 @@ bool mysql_rename_tables(THD *thd, TABLE_LIST *table_list) bool error=1,got_all_locks=1; TABLE_LIST *lock_table,*ren_table=0; DBUG_ENTER("mysql_rename_tables"); - + /* Avoid problems with a rename on a table that we have locked or if the user is trying to to do this in a transcation context */ @@ -43,7 +43,7 @@ bool mysql_rename_tables(THD *thd, TABLE_LIST *table_list) my_error(ER_LOCK_OR_ACTIVE_TRANSACTION,MYF(0)); DBUG_RETURN(1); } - + VOID(pthread_mutex_lock(&LOCK_open)); for (lock_table=table_list ; lock_table ; lock_table=lock_table->next) { @@ -53,13 +53,13 @@ bool mysql_rename_tables(THD *thd, TABLE_LIST *table_list) if (got_lock) got_all_locks=0; } - + if (!got_all_locks && wait_for_locked_table_names(thd,table_list)) goto end; if (!(ren_table=rename_tables(thd,table_list,0))) error=0; - + end: if (ren_table) { diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index 6c738ba36b4..acad297cda1 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -612,7 +612,7 @@ int stop_slave(THD* thd, bool net_report ) /* there is a small chance that slave thread might miss the first alarm. To protect againts it, resend the signal until it reacts */ - + struct timespec abstime; #ifdef HAVE_TIMESPEC_TS_SEC abstime.ts_sec=time(NULL)+2; @@ -1051,5 +1051,3 @@ int log_loaded_block(IO_CACHE* file) } return 0; } - - diff --git a/sql/sql_select.h b/sql/sql_select.h index 1e62f1b7809..dc8c97736a5 100644 --- a/sql/sql_select.h +++ b/sql/sql_select.h @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ diff --git a/sql/sql_string.cc b/sql/sql_string.cc index 4649af918d5..8fe84947ac2 100644 --- a/sql/sql_string.cc +++ b/sql/sql_string.cc @@ -1,19 +1,18 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - - This program file is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, +/* Copyright (C) 2000 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - MA 02111-1307, USA */ + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* This file is originally from the mysql distribution. Coded by monty */ diff --git a/sql/sql_string.h b/sql/sql_string.h index 00a078640b3..ad7455ecbf1 100644 --- a/sql/sql_string.h +++ b/sql/sql_string.h @@ -1,19 +1,18 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, +/* Copyright (C) 2000 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - MA 02111-1307, USA */ + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* This file is originally from the mysql distribution. Coded by monty */ diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 2f9fa17faf1..d4324a4e5ac 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -171,7 +171,7 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists, } } } - + error = 0; if (wrong_tables.length()) { diff --git a/sql/sql_test.cc b/sql/sql_test.cc index 651fd52d6c3..43c24da85a2 100644 --- a/sql/sql_test.cc +++ b/sql/sql_test.cc @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ diff --git a/sql/sql_udf.cc b/sql/sql_udf.cc index 8184ae3b15e..3ee4b9ff37e 100644 --- a/sql/sql_udf.cc +++ b/sql/sql_udf.cc @@ -1,21 +1,19 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - +/* Copyright (C) 2000 MySQL AB + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - - /* This implements 'user defined functions' */ /* @@ -52,11 +50,11 @@ extern "C" { FreeLibrary((HMODULE)lib); } - + #elif !defined(OS2) #include <dlfcn.h> #endif - + #include <stdarg.h> #include <hash.h> } diff --git a/sql/sql_udf.h b/sql/sql_udf.h index d0b20f0a734..1ee9c44ce48 100644 --- a/sql/sql_udf.h +++ b/sql/sql_udf.h @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ diff --git a/sql/stacktrace.c b/sql/stacktrace.c index bef53c71a42..17e65462144 100644 --- a/sql/stacktrace.c +++ b/sql/stacktrace.c @@ -122,7 +122,7 @@ terribly wrong...\n"); return; } #endif /* __alpha__ */ - + if (!stack_bottom) { ulong tmp= min(0x10000,thread_stack); @@ -150,7 +150,7 @@ terribly wrong...\n"); :"=r"(pc) :"r"(pc)); #endif /* __alpha__ */ - + while (fp < (uchar**) stack_bottom) { #ifdef __i386__ @@ -165,7 +165,7 @@ terribly wrong...\n"); { new_fp += 90; } - + if (fp && pc) { pc = find_prev_pc(pc, fp); @@ -195,7 +195,7 @@ terribly wrong...\n"); } fprintf(stderr, "Stack trace seems successful - bottom reached\n"); - + end: fprintf(stderr, "Please read http://www.mysql.com/doc/U/s/Using_stack_trace.html and follow instructions on how to resolve the stack trace. Resolved\n\ stack trace is much more helpful in diagnosing the problem, so please do \n\ diff --git a/sql/structs.h b/sql/structs.h index 780057061c3..9272e1f28e0 100644 --- a/sql/structs.h +++ b/sql/structs.h @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ diff --git a/sql/table.cc b/sql/table.cc index 11c30f12ca2..ac03d385458 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ @@ -1009,7 +1009,7 @@ void update_create_info_from_table(HA_CREATE_INFO *create_info, TABLE *table) create_info->raid_chunks=table->raid_chunks; create_info->raid_chunksize=table->raid_chunksize; DBUG_VOID_RETURN; -} +} int rename_file_ext(const char * from,const char * to,const char * ext) diff --git a/sql/table.h b/sql/table.h index 071c447e660..259c34030b2 100644 --- a/sql/table.h +++ b/sql/table.h @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ diff --git a/sql/thr_malloc.cc b/sql/thr_malloc.cc index 4017b7c30b8..8b9baa6f045 100644 --- a/sql/thr_malloc.cc +++ b/sql/thr_malloc.cc @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ diff --git a/sql/time.cc b/sql/time.cc index 4d194a94b8e..aab886648e3 100644 --- a/sql/time.cc +++ b/sql/time.cc @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ @@ -54,7 +54,7 @@ void init_time(void) This code handles also day light saving time. The idea is to cache the time zone (including daylight saving time) for the next call to make things faster. - + */ long my_gmt_sec(TIME *t) diff --git a/sql/udf_example.cc b/sql/udf_example.cc index 44a1d00437a..a5ec77f88e4 100644 --- a/sql/udf_example.cc +++ b/sql/udf_example.cc @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ diff --git a/sql/uniques.cc b/sql/uniques.cc index fcee97dbb1a..6b05618bcc7 100644 --- a/sql/uniques.cc +++ b/sql/uniques.cc @@ -127,14 +127,14 @@ bool Unique::get(TABLE *table) MYF(MY_WME))) return 1; reinit_io_cache(outfile,WRITE_CACHE,0L,0,0); - + bzero((char*) &sort_param,sizeof(sort_param)); sort_param.max_rows= elements; sort_param.sort_form=table; sort_param.sort_length=sort_param.ref_length=tree.size_of_element; sort_param.keys= max_in_memory_size / sort_param.sort_length; sort_param.not_killable=1; - + if (!(sort_buffer=(uchar*) my_malloc((sort_param.keys+1) * sort_param.sort_length, MYF(0)))) diff --git a/sql/unireg.cc b/sql/unireg.cc index b0dd3471a64..9f34e9cc71b 100644 --- a/sql/unireg.cc +++ b/sql/unireg.cc @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ diff --git a/sql/unireg.h b/sql/unireg.h index abba79cbda5..9b220f87918 100644 --- a/sql/unireg.h +++ b/sql/unireg.h @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ |