Commit graph

412 commits

Author SHA1 Message Date
unknown
3b4c38336d Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-4.1
into sanja.is.com.ua:/home/bell/mysql/bk/work-sum-4.1


sql/item.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
2004-09-16 16:24:46 +03:00
unknown
77ee831d3d fixed temporary table processing expresions of subqueries and removed wrong restrictions of field resolving (BUG#5326)
mysql-test/r/subselect.result:
  tests of fields resolving
mysql-test/t/subselect.test:
  tests of fields resolving
sql/item.cc:
  fixed fild resolving
sql/item_subselect.cc:
  removed aneed call
sql/sql_base.cc:
  fixed case whan we scan un-fixfielded fields
sql/sql_select.cc:
  fixed temporary table processing expresions of subqueries
2004-09-06 13:00:24 +03:00
unknown
df8a43b8b2 sql_print_error cleanup 2004-09-04 20:17:09 +02:00
unknown
762bee96d2 After merge fixes
mysql-test/mysql-test-run.sh:
  Export MASTER_MYSOCK (used in some tests)
mysql-test/t/alter_table.test:
  Use MASTER_MYSOCK instead of master.sock
2004-09-02 16:57:26 +03:00
unknown
fe937a2b1b Merge with 4.0
BitKeeper/etc/logging_ok:
  auto-union
BitKeeper/deleted/.del-acconfig.h~8d2e3113fc8056da:
  Auto merged
BitKeeper/deleted/.del-convert.cc~437689acaffb7446:
  Auto merged
BitKeeper/deleted/.del-flush_block_commit-master.opt~3bcd295d5bf68796:
  Auto merged
BitKeeper/deleted/.del-message.mc:
  Delete: VC++Files/sql/message.mc
BitKeeper/deleted/.del-mysql_install.c~8c089740d79a92:
  Auto merged
BitKeeper/deleted/.del-win1251.conf~b6bb6681f02917b6:
  Auto merged
Build-tools/Bootstrap:
  Auto merged
client/mysql.cc:
  Auto merged
client/mysqladmin.c:
  Auto merged
client/mysqlbinlog.cc:
  Auto merged
client/mysqlcheck.c:
  Auto merged
client/mysqldump.c:
  Auto merged
client/mysqlimport.c:
  Auto merged
client/mysqlmanager-pwgen.c:
  Auto merged
client/mysqlshow.c:
  Auto merged
client/mysqltest.c:
  Auto merged
extra/my_print_defaults.c:
  Auto merged
extra/perror.c:
  Auto merged
extra/resolve_stack_dump.c:
  Auto merged
extra/resolveip.c:
  Auto merged
include/m_string.h:
  Auto merged
include/my_getopt.h:
  Auto merged
isam/isamchk.c:
  Auto merged
isam/pack_isam.c:
  Auto merged
myisam/mi_test1.c:
  Auto merged
myisam/myisamchk.c:
  Auto merged
myisam/myisampack.c:
  Auto merged
sql/field.cc:
  Auto merged
sql/gen_lex_hash.cc:
  Auto merged
strings/strto.c:
  Auto merged
strings/strtol.c:
  Auto merged
strings/strtoll.c:
  Auto merged
strings/strtoull.c:
  Auto merged
support-files/Makefile.am:
  Auto merged
tools/mysqlmanager.c:
  Auto merged
2004-09-01 04:12:09 +03:00
unknown
ae3dd78b5f Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/home/my/mysql-4.1


sql/sql_base.cc:
  Auto merged
sql/sql_prepare.cc:
  Auto merged
2004-08-31 16:53:25 +03:00
unknown
07f5a44bc0 Review of new pushed code (Indentation fixes and simple optimizations)
Use 'mysqltest' as test database instead of test_$1 or test1,test2 to not accidently delete an important database
Safety fix for mailformed MERGE files


Build-tools/mysql-copyright:
  Print correct file name in case of errors
  Fixed indentation
include/config-win.h:
  Removed unnecessary #ifdef
myisammrg/myrg_open.c:
  Don't give a core if merge file contains INSERT_METHOD first (not legal but better safe than sorry)
  Don't set struct variables to zero that are already zero
  Indentation fixes
mysql-test/r/create.result:
  Use 'mysqltest' as test database
mysql-test/r/ndb_basic.result:
  Use 'mysqltest' as test database
mysql-test/r/ndb_blob.result:
  Use 'mysqltest' as test database
mysql-test/r/ndb_transaction.result:
  Use 'mysqltest' as test database
mysql-test/r/ps_1general.result:
  Use 'mysqltest' as test database
mysql-test/r/rpl_charset.result:
  Use 'mysqltest' as test database
mysql-test/r/rpl_delete_all.result:
  Use 'mysqltest' as test database
mysql-test/r/show_check.result:
  Use 'mysqltest' as test database
mysql-test/t/create.test:
  Use 'mysqltest' as test database
mysql-test/t/ndb_basic.test:
  Use 'mysqltest' as test database
mysql-test/t/ndb_blob.test:
  Use 'mysqltest' as test database
mysql-test/t/ndb_transaction.test:
  Use 'mysqltest' as test database
mysql-test/t/ps_1general.test:
  Use 'mysqltest' as test database
mysql-test/t/rpl_charset.test:
  Use 'mysqltest' as test database
mysql-test/t/rpl_delete_all.test:
  Use 'mysqltest' as test database
mysql-test/t/show_check.test:
  Use 'mysqltest' as test database
sql/field.h:
  Mark functions that should be deleted as soon as we have a new prototype for store(longlong)
sql/lock.cc:
  Indentation fix
sql/sql_base.cc:
  Better comment.
  Break find_item_in_list in case of perfect match
sql/sql_prepare.cc:
  Simple optimization
sql/sql_select.cc:
  Portability fix
2004-08-31 14:35:04 +03:00
unknown
db15b91915 Code style fixes.
Initialize LOG_error_log before get_options to not use an uninitalized mutex in case of an error from handle_options()


mysql-test/r/lowercase_table.result:
  Changed foo database -> mysqltest
  More test cases
mysql-test/t/lowercase_table.test:
  Changed foo database -> mysqltest
  More test cases
mysys/my_getopt.c:
  Fix new code to use MySQL indentation style
sql/log.cc:
  Change to use MySQL indentation style and naming conventions
  Remove usage of strlen() and strcat()
sql/mysqld.cc:
  Initialize LOG_error_log before get_options to not use an uninitalized mutex in case of an error from handle_options()
sql/sql_base.cc:
  Added comment
sql/table.cc:
  Added #if MYSQL_VERSION_ID < 40100 to ensure code is merged correctly
2004-08-28 00:49:54 +03:00
unknown
82257f94f4 after merge
sql/item_row.cc:
  ds20 compat fix
2004-08-26 18:22:22 +02:00
unknown
e8d41a5b1b merged
BitKeeper/etc/logging_ok:
  auto-union
VC++Files/sql/mysqld.dsp:
  Auto merged
client/mysql.cc:
  Auto merged
client/mysqladmin.c:
  Auto merged
BitKeeper/deleted/.del-mysql_install.c~8c089740d79a92:
  Auto merged
client/mysqlbinlog.cc:
  Auto merged
client/mysqlcheck.c:
  Auto merged
client/mysqldump.c:
  Auto merged
client/mysqlimport.c:
  Auto merged
client/mysqlmanager-pwgen.c:
  Auto merged
client/mysqlshow.c:
  Auto merged
client/mysqltest.c:
  Auto merged
extra/my_print_defaults.c:
  Auto merged
extra/perror.c:
  Auto merged
extra/resolve_stack_dump.c:
  Auto merged
extra/resolveip.c:
  Auto merged
include/my_getopt.h:
  Auto merged
innobase/buf/buf0rea.c:
  Auto merged
isam/isamchk.c:
  Auto merged
isam/pack_isam.c:
  Auto merged
libmysqld/Makefile.am:
  Auto merged
myisam/mi_test1.c:
  Auto merged
myisam/myisamchk.c:
  Auto merged
myisam/myisampack.c:
  Auto merged
mysql-test/mysql-test-run.sh:
  Auto merged
sql/gen_lex_hash.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
tools/mysqlmanager.c:
  Auto merged
2004-08-26 15:19:46 +02:00
unknown
ca59bf4746 Bug #4792 lower_case_table_names does not resolve db.tbl.column in SELECT list
sql_base.cc:
  Added code to lowercase database name in insert_fields when lower_case_table_names=1. This fixes bug# 4792


sql/sql_base.cc:
  Added code to lowercase database name in insert_fields when lower_case_table_names=1. This fixes bug# 4792
2004-08-25 15:12:31 +02:00
unknown
282ec5bd28 Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/home/kostja/work/mysql-4.1-4912


sql/item_cmpfunc.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_prepare.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
2004-08-21 02:08:20 +04:00
unknown
095b686c09 Fix for bug#4912 "mysqld crashs in case a statement is executed
a second time". The bug was caused by incompatibility of
negations elimination algorithm and PS: during first statement 
execute a subtree with negation was replaced with equivalent 
subtree without NOTs.
The problem was that although this transformation was permanent, 
items of the new subtree were created in execute-local memory.
The patch adds means to check if it is the first execute of a
prepared statement, and if this is the case, to allocate items
in memory of the prepared statement.
The implementation:
- backports Item_arena from 5.0
- adds Item_arena::is_stmt_prepare(), 
  Item_arena::is_first_stmt_execute().
- deletes THD::allocate_temporary_pool_for_ps_preparing(),
  THD::free_temporary_pool_for_ps_preparing(); they
  were redundant.
and adds a few invariants:
- thd->free_list never contains junk (= freed items)
- thd->current_arena is never null. If there is no
  prepared statement, it points at the thd. 
The rest of the patch contains mainly mechanical changes and
cleanups.


mysql-test/r/ps.result:
  Test results updated (test case for Bug#4912)
mysql-test/t/ps.test:
  A test case for Bug#4912 "mysqld crashs in case a statement is 
  executed a second time"
sql/item_cmpfunc.cc:
  current_statement -> current_arena
sql/item_subselect.cc:
  Statement -> Item_arena, current_statement -> current_arena
sql/item_subselect.h:
  Item_subselect does not need to save thd->current_statement.
sql/item_sum.cc:
  Statement -> Item_arena
sql/item_sum.h:
  Statement -> Item_arena
sql/mysql_priv.h:
  Statement -> Item_arena
sql/sql_base.cc:
  current_statement -> current_arena
sql/sql_class.cc:
  - Item_arena
  - convenient set_n_backup_statement, restore_backup_statement
  (nice idea, Sanja)
sql/sql_class.h:
  - Item_arena: backport from 5.0
  - allocate_temporary_pool_for_ps_preparing,
    free_temporary_pool_for_ps_preparing removed.
sql/sql_derived.cc:
  current_statement -> current_arena
sql/sql_lex.cc:
  current_statement -> current_arena
sql/sql_parse.cc:
  Deploy invariant that thd->free_list never contains junk items
  (backport from 5.0).
sql/sql_prepare.cc:
  - backporting Item_arena
  - no need to allocate_temporary_pool_for_ps_preparing().
sql/sql_select.cc:
  Fix for bug#4912 "mysqld crashs in case a statement is 
  executed a second time": if this is the first execute of
  a prepared statement, negation elimination is
  done in memory of the prepared statement.
sql/sql_union.cc:
  Backporting Item_arena from 5.0.
2004-08-21 02:02:46 +04:00
unknown
f9c3cb5f2e Fix for bug#4302 "ambiguos order by when renamed column is identical to another in result"
When in find_item_in_list() we are looking for item we should take into account unaliased 
names of the fields but only if item with such aliased name is not found.
Also we should ignore aliases when looking for fully specified field.


mysql-test/r/order_by.result:
  Fixed wrong (non-standard) test results
  Added test case for bug #4302
  Added tests for other ambiguos and potentially ambigous cases in order by clause
mysql-test/t/order_by.test:
  Fixed wrong (non-standard) test results
  Added test case for bug #4302
  Added tests for other ambiguos and potentially ambigous cases in order by clause
sql/sql_select.cc:
  We should ignore only not_found_item errors when searching for item in find_order_in_list() 
  to be able to catch ambiguities.
2004-08-20 17:53:46 +04:00
unknown
68d7b26698 Fix for bug #4508 "CONVERT_TZ() function with new time zone as param crashes server".
Instead of trying to open time zone tables during calculation of CONVERT_TZ() function
or setting of @@time_zone variable we should open and lock them with the rest of 
statement's table (so we should add them to global table list) and after that use such 
pre-opened tables for loading info about time zones.


mysql-test/r/timezone2.result:
  Added test for bug #4508
mysql-test/t/timezone2.test:
  Added test for bug #4508
scripts/mysql_create_system_tables.sh:
  Added one more test time zone to time zone tables which is needed for test for bug #4508.
sql/item_create.cc:
  CONVERT_TZ() now is treated as special function.
sql/item_create.h:
  CONVERT_TZ() now is treated as special function.
sql/item_timefunc.cc:
  Item_func_convert_tz now uses list of pre-opened time zone tables instead of trying to
  open them ad-hoc. Also it avoid calling of current_thd.
sql/item_timefunc.h:
  Added comment describing special nature of CONVERT_TZ() function.
  Optimization: Added own fix_fields() method and tz_tables member for caching pointer
  to list of open time zone tables to Item_func_convert_tz class.
sql/lex.h:
  CONVERT_TZ() now is treated as special function.
sql/mysql_priv.h:
  Removed function which is no longer used.
sql/set_var.cc:
  Now my_tz_find() accepts list of pre-opened time zone tables as last argument 
  and no longer needs pointer to current THD.
sql/set_var.h:
  Exported sys_time_zone, which is now used in sql_yacc.yy for quick finding out if we are
  setting @@time_zone variable.
sql/sql_base.cc:
  Moved propagation of pointers to open tables from global list to local select lists to
  open_and_lock_tables(), also added implicit usage of time zone tables as condition for
  such propagation.
sql/sql_lex.cc:
  Added fake_time_zone_tables_list which is used to indicate that time zone tables are
  implicitly used in statement.
  st_select_lex_unit::create_total_list(): if time zone tables are implicitly used in
  statement add them to global tables list.
sql/sql_lex.h:
  Added LEX::time_zone_tables_used member which is used to indicate that time zone tables 
  are implicitly used in this statement (by pointing to fake_time_zone_table_list) and 
  for holding pointer to those tables after they've been opened.
sql/sql_parse.cc:
  We should also create global table list if statement uses time zone tables implicitly.
  Added initialization of LEX::time_zone_tables_used to mysql_query_init().
sql/sql_prepare.cc:
  We should also create global table list if statement uses time zone tables implicitly.
sql/sql_select.cc:
  Removed functions which are no longer used.
sql/sql_yacc.yy:
  CONVERT_TZ() and @@time_zone variable are handled in special way since they implicitly 
  use time zone tables.
sql/tztime.cc:
  Fix for bug #4508 "CONVERT_TZ() function with new time zone as param crashes server".
  If statement uses CONVERT_TZ() function or @@time_zone variable is set then it implicitly
  uses time zone tables. We need to open and lock such tables with all other tables of 
  such statement.
  
  All code responsible for opening table was removed from tz_load_from_db() and function was 
  renamed to tz_load_from_open_tables() (which uses list of pre-opened tables).
  We also have new functions for construction and initialization of table list of time
  zone tables.
  my_tz_find() now always require list of pre-opened time zone tables and no longer needs
  current THD. So we have to pre-open them in my_tz_init().
  Also now we try to open time zone tables only if they were found during startup.
sql/tztime.h:
  New function for construction of table list of time zone tables my_tz_get_table_list().
  Now my_tz_find() requires list of pre-pened time zone tables instead of current thread.
2004-08-10 12:42:31 +04:00
unknown
ea8ac8ab98 hang in dummy natural join (no common columns) Bug #4807 2004-08-02 11:12:11 +02:00
unknown
e452548352 auto_value_on_zero bug test
mysql-test/r/auto_increment.result:
  bug test
mysql-test/t/auto_increment.test:
  bug test
sql/sql_base.cc:
  cleanup
2004-07-30 09:47:56 +02:00
unknown
c6e23c8549 Merge with 4.0 to get the latest bug patches to 4.1
BitKeeper/etc/ignore:
  added sql/mysql_tzinfo_to_sql
BitKeeper/etc/logging_ok:
  auto-union
acinclude.m4:
  Auto merged
extra/perror.c:
  Auto merged
include/mysql.h:
  Auto merged
innobase/include/mach0data.ic:
  Auto merged
innobase/include/mtr0log.h:
  Auto merged
innobase/include/mtr0log.ic:
  Auto merged
innobase/mem/mem0dbg.c:
  Auto merged
innobase/pars/lexyy.c:
  Auto merged
BitKeeper/deleted/.del-4.0.XX-gpl.ipr~f5909a9e9bd8094:
  Auto merged
BitKeeper/deleted/.del-Clients and Tools.fgl~bf0f776883577f02:
  Auto merged
BitKeeper/deleted/.del-Development.fgl~6392ce285e73f5fc:
  Auto merged
mysql-test/mysql-test-run.sh:
  Auto merged
mysql-test/r/innodb_cache.result:
  Auto merged
mysql-test/r/lowercase_table2.result:
  Auto merged
mysql-test/t/innodb_cache.test:
  Auto merged
mysql-test/t/lowercase_table2.test:
  Auto merged
sql/ha_berkeley.cc:
  Auto merged
sql/handler.cc:
  Auto merged
scripts/make_win_src_distribution.sh:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
libmysql/libmysql.c:
  Merge with 4.0
mysql-test/r/bdb.result:
  Merge with 4.0
mysql-test/r/range.result:
  Merge with 4.0
mysql-test/t/bdb.test:
  Merge with 4.0
mysys/hash.c:
  Merge with 4.0
scripts/mysql_install_db.sh:
  Merge with 4.0
sql/field.cc:
  Merge with 4.0
sql/field.h:
  Merge with 4.0
sql/mysql_priv.h:
  Merge with 4.0
sql/sql_handler.cc:
  Merge with 4.0
sql/sql_select.cc:
  Merge with 4.0
sql/sql_table.cc:
  Merge with 4.0
2004-06-25 20:13:05 +03:00
unknown
8f6664c59a bug#3565 - HANDLER and FLUSH TABLE/TABLES deadlock.
Redesigned the handler close functions so that they are usable
at different places where waiting for closing tables is done.


mysql-test/r/flush_table.result:
  bug#3565 - HANDLER and FLUSH TABLE/TABLES deadlock.
  Added the test results.
mysql-test/t/flush_table.test:
  bug#3565 - HANDLER and FLUSH TABLE/TABLES deadlock.
  Activated old test case.
  Added new test cases.
sql/mysql_priv.h:
  bug#3565 - HANDLER and FLUSH TABLE/TABLES deadlock.
  Made mysql_ha_close() more flexible.
  Removed mysql_ha_closeall(), which closed only one table despite its name.
  Added mysql_ha_close_list(), which closes the complete list or all tables and does not lock.
  Removed a duplicate declaration.
sql/sql_base.cc:
  bug#3565 - HANDLER and FLUSH TABLE/TABLES deadlock.
  Added proper close calls before some wait points to avoid deadlocks
  or infinite loops.
sql/sql_handler.cc:
  bug#3565 - HANDLER and FLUSH TABLE/TABLES deadlock.
  Redesigned the internal function find_table_ptr_by_name().
  It can now suppress locking and tells if the requested table
  has been flushed by itself.
  Extended mysql_ha_close() so that it can now suppres locking
  and error reporting. That way it can be used at more places and the
  old function mysql_ha_closeall() is now obsolete.
  Added a new function mysql_ha_close_list() which closes a whole list
  of HANDLER tables or all HANDLER tables, if the list is NULL.
  Furthermore is can close all 'old' (marked for flush) HANDLER tables.
sql/sql_table.cc:
  bug#3565 - HANDLER and FLUSH TABLE/TABLES deadlock.
  Replaced the obsolte mysql_ha_closeall() by the new mysql_ha_close().
2004-06-24 15:06:56 +02:00
unknown
6aaccbcbf7 WL#1264 "Per-thread time zone support infrastructure".
Added basic per-thread time zone functionality (based on public
domain elsie-code). Now user can select current time zone
(from the list of time zones described in system tables).
All NOW-like functions honor this time zone, values of TIMESTAMP
type are interpreted as values in this time zone, so now
our TIMESTAMP type behaves similar to Oracle's TIMESTAMP WITH
LOCAL TIME ZONE (or proper PostgresSQL type).
  
WL#1266 "CONVERT_TZ() - basic time with time zone conversion 
function".
  
Fixed problems described in Bug #2336 (Different number of warnings 
when inserting bad datetime as string or as number). This required
reworking of datetime realted warning hadling (they now generated 
at Field object level not in conversion functions).
  
Optimization: Now Field class descendants use table->in_use member
instead of current_thd macro.


include/my_global.h:
  Added macro for reading of 32-bit ints stored in network order from
  unaligned memory location.
include/mysqld_error.h:
  Added error-code for invalid timestamp warning and error-code
  for wrong or unknown time zone specification.
libmysqld/Makefile.am:
  Added main per-thread time zone support file to libmysqld
libmysqld/lib_sql.cc:
  Added initialization of time zones infrastructure to embedded server.
mysql-test/r/connect.result:
  Updated test result since now mysql database contains more
  system tables.
mysql-test/r/date_formats.result:
  Now when truncation occurs during conversion to datetime value we are producing Warnings 
  instead of Notes. Also we are giving more clear warnings about this in some cases.
mysql-test/r/func_sapdb.result:
  New warnings about truncation occured during conversion to datetime value added due
  their better handling.
mysql-test/r/func_time.result:
  New warnings about truncation occured during conversion to datetime value added due
  their better handling.
mysql-test/r/select.result:
  New warnings about truncation occured during conversion to datetime value added due
  their better handling. Also tweaked test a bit to made it less ambigious for reader.
mysql-test/r/system_mysql_db.result:
  Updated test result because new system tables holding time zone descriptions were 
  added.
mysql-test/r/timezone.result:
  Updated timezone.test to use new system variable which shows system time zone.
  Added test of warning which is produced if someone tries to store non-existing (due 
  falling into spring time-gap) datetime value into TIMESTAMP field.
mysql-test/r/type_datetime.result:
  Separated and extended test of values and warnings produced for bad values stored in 
  DATETTIME fields.
mysql-test/r/type_time.result:
  Now we are producing more consistent warning when we are truncating datetime value while
  storing it in TIME field.
mysql-test/r/type_timestamp.result:
  Separated and extended test of values and warnings produced for bad
  values stored in TIMESTAMP fields.
mysql-test/t/select.test:
  Updated test to make it less ambigous for reader.
mysql-test/t/timezone.test:
  Updated timezone.test to use new system variable which shows system time zone.
  Added test of warning which is produced if someone tries to store non-existing (due 
  falling into spring time-gap) datetime value into TIMESTAMP field.
mysql-test/t/type_datetime.test:
  Separated and extended test of values and warnings produced for bad
  values stored in DATETTIME fields.
mysql-test/t/type_timestamp.test:
  Separated and extended test of values and warnings produced for bad
  values stored in TIMESTAMP fields.
scripts/mysql_create_system_tables.sh:
  Added creation of tables with time zone descriptions.
  Also added descriptions of time zones used in tests.
scripts/mysql_fix_privilege_tables.sql:
  Added mysql.time_zone* tables family.
sql/Makefile.am:
  Added files implementing time zone support to server, also added
  rules for building of mysql_tzinfo_to_sql converter and test_time
  test.
sql/field.cc:
  Now we are using per-thread time zone for TIMESTAMP <-> whatever conversion.
  Fixed generation of warnings for datetime types (DATETIME/TIMESTAMP/DATE/...) and
  any other Field to datetime conversion (now we are generating warnings no in lower
  level functions like in str_to_TIME() but in Field methods. This allows generate
  better and more consistent warnings and to reuse code of str_to_TIME() outside of
  server).
  
  Added 3rd parameter to set_warning() method to be able to not increment cut fields
  but still produce a warning. Also added set_datetime_warning() family of auxiliary 
  methods which allow easier generate datetime related warnings.
  Also replaced occurences of current_thd with table->in_use member, added
  asserts for catching all places there we need to set table->in_use
  accordingly. Renamed fix_datetime() function to number_to_TIME() and
  moved it to sql/time.cc there it fits better.
sql/field.h:
  Added comment about places where we can use table->in_use member
  instead of current_thd.
  Added 3rd parameter to Field::set_warning() method and set_datetime_warning()
  family of methods.
sql/field_conv.cc:
  Field::set_warning() method with 2 arguments was replaced with more 
  generic set_warning() method with 3 arguments.
sql/ha_berkeley.cc:
  Now we set table->in_use for temporary tables so we have to use
  table->tmp_table for checking if table is temporary.
sql/item.cc:
  Replaced calls to str_to_time() and str_to_TIME() funcs with their warning
  generating analogs.
sql/item_create.cc:
  Added creation of CONVERT_TZ function as FUNC_ARG3.
sql/item_create.h:
  Added creation of CONVERT_TZ function as FUNC_ARG3.
sql/item_timefunc.cc:
  Added support of per-thread time zone to NOW-like and FROM_UNIXTIME,
  UNIX_TIMESTAMP functions. 
  Added support for CONVERT_TZ function.
  Removed call to str_to_timestamp function which caused non-optimal
  behavior in certain cases. Replaced calls to str_to_time() function 
  with its warning generating analog.
sql/item_timefunc.h:
  Added support of per-thread time zone to NOW-like and
  FROM_UNIXTIME, UNIX_TIMESTAMP functions.
  Added support of CONVERT_TZ function.
sql/lex.h:
  Added support of CONVERT_TZ function.
sql/log.cc:
  Added support for replication of statements depending on time zone.
sql/mysql_priv.h:
  Now including headers with per-thread time zone support functions
  and classes. Added portable replacement of time_t - my_time_t type. 
  Added time zone as one of query distinguishing parameters for
  query cache. 
  Fixed declarations of str_to_TIME, str_to_time and 
  my_system_gmt_sec (former my_gmt_sec) since now they have one more
  out parameter which informs about wrong datetime value or data 
  truncation during conversion.
  Added warning generating version of str_to_TIME() and str_to_time()
  functions.
  Thrown away str_to_datetime/timestamp functions since they are not
  needed any longer. Added number_to_TIME function.
sql/mysqld.cc:
  Added per-thread time zone support initialization.
  Added new startup parameter --default-time-zone.
sql/set_var.cc:
  Added support for per-thread time_zone variable.
  Renamed old timezone variable to system_time_zone.
sql/set_var.h:
  Added support for per-thread time_zone variable.
sql/share/czech/errmsg.txt:
  Added error message for barking when incorrect time zone name or
  specifiaction is provided and for warning about invalid TIMESTAMP
  values (e.g. falling into the spring time-gap).
sql/share/danish/errmsg.txt:
  Added error message for barking when incorrect time zone name or
  specifiaction is provided and for warning about invalid TIMESTAMP
  values (e.g. falling into the spring time-gap).
sql/share/dutch/errmsg.txt:
  Added error message for barking when incorrect time zone name or
  specifiaction is provided and for warning about invalid TIMESTAMP
  values (e.g. falling into the spring time-gap).
sql/share/english/errmsg.txt:
  Added error message for barking when incorrect time zone name or
  specifiaction is provided and for warning about invalid TIMESTAMP
  values (e.g. falling into the spring time-gap).
sql/share/estonian/errmsg.txt:
  Added error message for barking when incorrect time zone name or
  specifiaction is provided and for warning about invalid TIMESTAMP
  values (e.g. falling into the spring time-gap).
sql/share/french/errmsg.txt:
  Added error message for barking when incorrect time zone name or
  specifiaction is provided and for warning about invalid TIMESTAMP
  values (e.g. falling into the spring time-gap).
sql/share/german/errmsg.txt:
  Added error message for barking when incorrect time zone name or
  specifiaction is provided and for warning about invalid TIMESTAMP
  values (e.g. falling into the spring time-gap).
sql/share/greek/errmsg.txt:
  Added error message for barking when incorrect time zone name or
  specifiaction is provided and for warning about invalid TIMESTAMP
  values (e.g. falling into the spring time-gap).
sql/share/hungarian/errmsg.txt:
  Added error message for barking when incorrect time zone name or
  specifiaction is provided and for warning about invalid TIMESTAMP
  values (e.g. falling into the spring time-gap).
sql/share/italian/errmsg.txt:
  Added error message for barking when incorrect time zone name or
  specifiaction is provided and for warning about invalid TIMESTAMP
  values (e.g. falling into the spring time-gap).
sql/share/japanese/errmsg.txt:
  Added error message for barking when incorrect time zone name or
  specifiaction is provided and for warning about invalid TIMESTAMP
  values (e.g. falling into the spring time-gap).
sql/share/korean/errmsg.txt:
  Added error message for barking when incorrect time zone name or
  specifiaction is provided and for warning about invalid TIMESTAMP
  values (e.g. falling into the spring time-gap).
sql/share/norwegian-ny/errmsg.txt:
  Added error message for barking when incorrect time zone name or
  specifiaction is provided and for warning about invalid TIMESTAMP
  values (e.g. falling into the spring time-gap).
sql/share/norwegian/errmsg.txt:
  Added error message for barking when incorrect time zone name or
  specifiaction is provided and for warning about invalid TIMESTAMP
  values (e.g. falling into the spring time-gap).
sql/share/polish/errmsg.txt:
  Added error message for barking when incorrect time zone name or
  specifiaction is provided and for warning about invalid TIMESTAMP
  values (e.g. falling into the spring time-gap).
sql/share/portuguese/errmsg.txt:
  Added error message for barking when incorrect time zone name or
  specifiaction is provided and for warning about invalid TIMESTAMP
  values (e.g. falling into the spring time-gap).
sql/share/romanian/errmsg.txt:
  Added error message for barking when incorrect time zone name or
  specifiaction is provided and for warning about invalid TIMESTAMP
  values (e.g. falling into the spring time-gap).
sql/share/russian/errmsg.txt:
  Added error message for barking when incorrect time zone name or
  specifiaction is provided and for warning about invalid TIMESTAMP
  values (e.g. falling into the spring time-gap).
sql/share/serbian/errmsg.txt:
  Added error message for barking when incorrect time zone name or
  specifiaction is provided and for warning about invalid TIMESTAMP
  values (e.g. falling into the spring time-gap).
sql/share/slovak/errmsg.txt:
  Added error message for barking when incorrect time zone name or
  specifiaction is provided and for warning about invalid TIMESTAMP
  values (e.g. falling into the spring time-gap).
sql/share/spanish/errmsg.txt:
  Added error message for barking when incorrect time zone name or
  specifiaction is provided and for warning about invalid TIMESTAMP
  values (e.g. falling into the spring time-gap).
sql/share/swedish/errmsg.txt:
  Added error message for barking when incorrect time zone name or
  specifiaction is provided and for warning about invalid TIMESTAMP
  values (e.g. falling into the spring time-gap).
sql/share/ukrainian/errmsg.txt:
  Added error message for barking when incorrect time zone name or
  specifiaction is provided and for warning about invalid TIMESTAMP
  values (e.g. falling into the spring time-gap).
sql/slave.cc:
  In order to support replication of statements using time zones in 4.1 we should 
  ensure that both master and slave have same default time zone.
sql/sql_base.cc:
  Now we are setting TABLE::in_use member for all tables (which assume
  calls to Field::store or val_ methods).
sql/sql_cache.cc:
  Added time zone as one more query distinguishing parameter
  for query cache.
sql/sql_class.cc:
  Added THD::time_zone_used variable indicating that this query
  uses per thread time zone.
sql/sql_class.h:
  Added per-thread time zone variable. Added THD::time_zone_used
  variable indicating that this query uses per thread time zone
  so if this is updating query the time zone should be logged to 
  binlog.
sql/sql_insert.cc:
  We should set TABLE::in_use member pointing to thread which is called
  INSERT DELAYED and not to worker thread.
sql/sql_load.cc:
  Field::set_warning() now has one more argument now.
sql/sql_parse.cc:
  Resetting THD::time_zone_used variable in the end of query
  processing.
sql/sql_select.cc:
  Now we are setting TABLE::in_use member for all tables (which assume
  calls to Field::store or val_ methods).
sql/sql_show.cc:
  Now using per thread time zone for extended show tables.
sql/time.cc:
  Added support for per-thread time zones for TIMESTAMP type and
  reworked generation of warnings for TIMESTAMP and DATETIME types.
  (Introduced new TIME_to_timestamp() function. Removed hours 
  normalisation from former my_gmt_sec() since it was not working 
  and not used anywhere now, but breaks parameter constness, added
  to this function generation of warning if we are falling in spring 
  time-gap. Removed str_to_timestamp and str_to_datetime functions 
  which are no longer used. Moved fix_datetime function from
  sql/field.cc to this file as number_to_TIME() function. Added
  out parameter for str_to_TIME and str_to_time functions which
  indicates if value was truncated during conversion, removed direct 
  generation of warnings from this functions.)
sql/unireg.cc:
  Now we are setting TABLE::in_use member for all tables (which assume
    calls to Field::store or val_ methods).
BitKeeper/etc/ignore:
  Added sql/test_time sql/mysql_tzinfo_to_sql libmysqld/tztime.cc to the ignore list
2004-06-18 10:11:31 +04:00
unknown
d9b81f3a08 EXISTS(SELECT * ...)
close table before opening in optimize


mysql-test/r/subselect.result:
  test of EXISTS(SELECT * ...)
mysql-test/t/subselect.test:
  test of EXISTS(SELECT * ...)
sql/sql_base.cc:
  EXISTS(SELECT * ...)
sql/sql_table.cc:
  close table before opening one
2004-06-10 21:33:15 +03:00
unknown
f1ffa13923 backport wild_compare fix from 4.1 - bug#3924 2004-05-29 17:52:20 +02:00
unknown
484f6cb3b4 bug#3681 - order by, distinct, refer to aliased field by name
check for field_name (not only for name) in find_item_in_list, to be compatible with item->eq() that is done later


mysql-test/r/order_by.result:
  bug#3681 - order by, distinct, refer to aliased field by name
2004-05-17 11:04:12 +02:00
unknown
c585b669d6 check of item name presence in find_item_in_list (Bug #3752)
mysql-test/r/func_gconcat.result:
  test of Bug #3752
mysql-test/t/func_gconcat.test:
  test of Bug #3752
sql/sql_base.cc:
  check of item name presence in find_item_in_list
2004-05-14 18:55:24 +03:00
unknown
cd21f7ce40 Merge with 4.0.19
BitKeeper/etc/logging_ok:
  auto-union
VC++Files/client/mysqlclient.dsp:
  Auto merged
VC++Files/mysql.dsw:
  Auto merged
extra/perror.c:
  Auto merged
extra/replace.c:
  Auto merged
innobase/configure.in:
  Auto merged
innobase/include/lock0lock.h:
  Auto merged
innobase/include/row0mysql.h:
  Auto merged
innobase/include/sync0sync.h:
  Auto merged
innobase/lock/lock0lock.c:
  Auto merged
ltmain.sh:
  Auto merged
BitKeeper/deleted/.del-libmysqld.def~8edf7b8780ce943c:
  Auto merged
innobase/os/os0file.c:
  Auto merged
innobase/pars/lexyy.c:
  Auto merged
innobase/row/row0mysql.c:
  Auto merged
innobase/srv/srv0srv.c:
  Auto merged
innobase/srv/srv0start.c:
  Auto merged
innobase/sync/sync0arr.c:
  Auto merged
innobase/sync/sync0sync.c:
  Auto merged
innobase/trx/trx0trx.c:
  Auto merged
mysql-test/r/alias.result:
  Auto merged
mysql-test/t/system_mysql_db_fix-master.opt:
  Auto merged
mysql-test/r/func_time.result:
  Automatic merge
mysql-test/r/innodb.result:
  Automatic merge
mysql-test/t/alias.test:
  Automatic merge
mysql-test/t/create.test:
  Automatic merge
mysql-test/t/func_time.test:
  Automatic merge
sql/ha_innodb.cc:
  Automatic merge
sql/mysql_priv.h:
  Automatic merge
mysql-test/r/rpl_multi_update.result:
  Automatic merge
mysql-test/t/rpl_error_ignored_table.test:
  Automatic merge
mysql-test/t/rpl_multi_update.test:
  Automatic merge
sql/slave.h:
  Automatic merge
sql/sql_base.cc:
  Automatic merge
sql/sql_db.cc:
  Automatic merge
sql/sql_insert.cc:
  Automatic merge
sql/structs.h:
  Automatic merge
sql/table.cc:
  Automatic merge
strings/longlong2str-x86.s:
  Automatic merge
strings/strings-x86.s:
  Automatic merge
support-files/my-medium.cnf.sh:
  Automatic merge
2004-05-05 17:05:24 +03:00
unknown
68d07cbcc4 Fixed crashing bug with alter table when table was in use (Bug #3643)
We didn't use 'only index' for tables of type 'const'. (Bug #3497)


mysql-test/r/func_str.result:
  New testfin
mysql-test/r/key.result:
  New test
mysql-test/r/key_primary.result:
  Update after "We didn't use 'only index' for tables of type 'const'" fix.
mysql-test/r/null_key.result:
  Update after "We didn't use 'only index' for tables of type 'const'" fix.
mysql-test/r/subselect.result:
  Update after "We didn't use 'only index' for tables of type 'const'" fix.
mysql-test/t/func_str.test:
  Updated bug texts
  Added test for conversion of long string value to integer (Bug #3472)
mysql-test/t/key.test:
  Test of key read with primary key (Bug #3497)
sql/item.cc:
  Added assert
sql/sql_base.cc:
  Fixed crashing bug with alter table when table was in use (Bug #3643)
sql/sql_load.cc:
  Indentation fixes
sql/sql_select.cc:
  We didn't use 'only index' for tables of type 'const'. (Bug #3497)
2004-05-05 12:31:17 +03:00
unknown
7e41bc959c don't rely on readdir() returning . and .. first 2004-05-04 14:36:23 +02:00
unknown
b43af929f8 Added NDB storage engine
include/my_base.h:
  Added three new errorcodes to be returned by the handler
sql/Makefile.am:
  Add new files discover.cc, ha_ndbcluster.cc and ha_ndbcluster.h
  Add include path of NDB files
sql/handler.cc:
  Added variable for keeping track of number of "discovers"
  Added NDB to list of storage engines
  Added calls to NDB for commit, rollback etc.
  Added function ha_discover for discovering a table from handler
sql/handler.h:
  Added NDB to list of storage engines
  Added vbariable in transaction for keeping a ndb transaction handle
sql/lex.h:
  Changed AND to AND_SYM and OR to OR_SYM to avoid nameclash
sql/mysql_priv.h:
  Added prototypes for new functions readfrm, writefrm and create_table_from_handler
sql/mysqld.cc:
  Added NDB support
  Disable NDB with --skip-ndbcluster
sql/set_var.cc:
  Add posibilty to show if NDB handler is supported
sql/ha_ndbcluster.cc:
  Add ifdef for whole file for not compiling anything if NDB sholdn't be included
  Updated timestamp handling to use new vars timestamp_default_now and timestamp_on_update_now
sql/sql_base.cc:
  If frm file is not found on disk, ask handler if it knows about the table. Then retry the open.
  This new functionality is called "discover" and can be used by any handler.
sql/sql_class.h:
  Added variable for keeping a NDB connection handle
sql/sql_table.cc:
  Before trying to create a table, ask handler if a table with that name already exists.
  If user said CREATE TABLE IF NOT EXISTS, disocver the table from handler
sql/sql_yacc.yy:
  Add NDBCLUSTER_SYM
  Change AND to AND_SYM
  Change OR to OR_SYM
sql/table.cc:
  Fixe for probelm when NullS is returned from bas_ext of a handler.
2004-04-15 09:14:14 +02:00
unknown
3c8ae89052 merged
sql/handler.h:
  Auto merged
sql/sql_base.cc:
  Auto merged
2004-04-07 17:14:38 +02:00
unknown
b6f2a534fe merged
sql/field.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/protocol.cc:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/table.cc:
  Auto merged
2004-04-07 16:20:46 +02:00
unknown
cc168fc6fd Hand-resolved auto merge
BitKeeper/etc/ignore:
  auto-union
sql/handler.h:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/unireg.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_table.cc:
  Hand-merged
sql/sql_yacc.yy:
  Hand-merged
2004-04-07 14:56:24 +02:00
unknown
0948f9769b Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-4.1
into sanja.is.com.ua:/home/bell/mysql/bk/work-ps3-4.1


mysql-test/r/union.result:
  Auto merged
sql/item.cc:
  Auto merged
sql/item_sum.cc:
  Auto merged
sql/item_sum.h:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/slave.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_cache.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_prepare.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
2004-04-07 15:23:05 +03:00
unknown
08594c4795 after review changes
sql/log_event.cc:
  non_cachable_table flag changed to cacheable_table
sql/repl_failsafe.cc:
  non_cachable_table flag changed to cacheable_table
sql/slave.cc:
  non_cachable_table flag changed to cacheable_table
sql/sql_acl.cc:
  non_cachable_table flag changed to cacheable_table
sql/sql_base.cc:
  non_cachable_table flag changed to cacheable_table
sql/sql_cache.cc:
  non_cachable_table flag changed to cacheable_table
sql/sql_help.cc:
  non_cachable_table flag changed to cacheable_table
sql/sql_insert.cc:
  non_cachable_table flag changed to cacheable_table
sql/sql_parse.cc:
  non_cachable_table flag changed to cacheable_table
sql/sql_prepare.cc:
  renamed DEBUG tag
sql/table.h:
  non_cachable_table flag changed to cacheable_table
2004-04-07 13:25:24 +03:00
unknown
c627054340 ::reset(), HA_FAST_KEY_READ, disable_indexes(), enable_indexes(), start_bulk_insert(), end_bulk_insert()
Field::val_str simplification, comment


include/my_base.h:
  typos fixed
mysql-test/r/myisam.result:
  alter table enable/disable keys
mysql-test/t/help.test:
  cleanup
mysql-test/t/myisam.test:
  alter table enable/disable keys
sql/field.cc:
  Field::val_str() simplification
sql/field.h:
  Field::val_str() simplification and comment
sql/field_conv.cc:
  Field::val_str() simplification
sql/ha_berkeley.cc:
  ::reset(), HA_FAST_KEY_READ
sql/ha_berkeley.h:
  ::reset(), HA_FAST_KEY_READ
sql/ha_heap.cc:
  ::reset(), HA_FAST_KEY_READ
sql/ha_heap.h:
  ::reset(), HA_FAST_KEY_READ
sql/ha_innodb.cc:
  ::reset(), HA_FAST_KEY_READ
sql/ha_innodb.h:
  ::reset(), HA_FAST_KEY_READ
sql/ha_isam.cc:
  ::reset(), HA_FAST_KEY_READ
sql/ha_isam.h:
  ::reset(), HA_FAST_KEY_READ
sql/ha_isammrg.cc:
  ::reset(), HA_FAST_KEY_READ
sql/ha_isammrg.h:
  ::reset(), HA_FAST_KEY_READ
sql/ha_myisam.cc:
  ::reset(), HA_FAST_KEY_READ, disable_indexes(), enable_indexes(), start_bulk_insert(), end_bulk_insert()
sql/ha_myisam.h:
  ::reset(), HA_FAST_KEY_READ, disable_indexes(), enable_indexes(), start_bulk_insert(), end_bulk_insert()
sql/ha_myisammrg.cc:
  ::reset(), HA_FAST_KEY_READ
sql/ha_myisammrg.h:
  ::reset(), HA_FAST_KEY_READ
sql/handler.h:
  ::reset(), HA_FAST_KEY_READ, disable_indexes(), enable_indexes(), start_bulk_insert(), end_bulk_insert()
sql/item.cc:
  Field::val_str() simplification
sql/item_sum.cc:
  Field::val_str() simplification
sql/key.cc:
  Field::val_str() simplification
sql/opt_range.cc:
  Field::val_str() simplification
sql/protocol.cc:
  Field::val_str() simplification
sql/records.cc:
  HA_FAST_KEY_READ
sql/sql_acl.cc:
  Field::val_str() simplification
sql/sql_base.cc:
  ::reset
sql/sql_insert.cc:
  ::reset(), start_bulk_insert(), end_bulk_insert()
sql/sql_load.cc:
  start_bulk_insert(), end_bulk_insert()
sql/sql_show.cc:
  Field::val_str() simplification
sql/sql_table.cc:
  disable_indexes(), enable_indexes(), start_bulk_insert(), end_bulk_insert()
sql/table.cc:
  Field::val_str() simplification
2004-04-06 21:35:26 +02:00
unknown
6a868cca91 Fixed warnings from valgrind (not a bug)
Don't add -debug to server version if MYSQL_SERVER_PREFIX is used
Indentation cleanups


myisam/mi_write.c:
  Indentation cleanup
mysql-test/r/lowercase_table2.result:
  Fixed test results
sql/filesort.cc:
  Fixed warnings from valgrind (not a bug)
sql/ha_myisam.cc:
  Indentation cleanup
sql/mysqld.cc:
  Don't add -debug to server if MYSQL_SERVER_PREFIX is used
sql/sql_base.cc:
  Indentation cleanup
sql/sql_show.cc:
  Fixed typo in comment
sql/sql_table.cc:
  Indentation cleanup
2004-04-06 12:13:43 +03:00
unknown
3c01162f0e removed old way to prevent using stack tables for caching Items in PS
fixed error code in union test


mysql-test/t/union.test:
  right code worr 4.1 error
sql/log_event.cc:
  assign non-cachable for Item status for all stack tables for safety
sql/repl_failsafe.cc:
  assign non-cachable for Item status for all stack tables for safety
sql/slave.cc:
  assign non-cachable for Item status for all stack tables for safety
sql/sql_acl.cc:
  assign non-cachable for Item status for all stack tables for safety
sql/sql_base.cc:
  assign non-cachable for Item status for all stack tables for safety
  non-cachable status processing
sql/sql_cache.cc:
  assign non-cachable for Item status for all stack tables for safety
sql/sql_class.cc:
  removed ald way to prevent using stack tables for caching Items in PS
sql/sql_class.h:
  removed old way to prevent using stack tables for caching Items in PS
sql/sql_help.cc:
  assign non-cachable for Item status for all stack tables for safety
sql/sql_insert.cc:
  assign non-cachable for Item status for all stack tables for safety
  removed old way to prevent using stack tables for caching Items in PS
sql/table.h:
  non-cachable for Item status for tables
2004-04-04 03:05:44 +03:00
unknown
e65aed9cbd for Item_param we have to have value set instead of fave item fixed (BUG#3353)
fixed outer joins
test of different joins included


sql/item.cc:
  for Item_param we have to have value set instead of fave item fixed
sql/sql_base.cc:
  fixed PS with outer joins
tests/client_test.c:
  test of different types of joins
2004-04-03 17:23:41 +03:00
unknown
d7c25fe28e Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-4.1
into sanja.is.com.ua:/home/bell/mysql/bk/work-on-4.1


sql/mysql_priv.h:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/table.h:
  Auto merged
2004-04-03 11:28:20 +03:00
unknown
8c8dffb60d fixed brocken of client_test
fixed aggregate functions in PS (BUG#3360)


mysql-test/r/union.result:
  4.1 more correct error
sql/item_cmpfunc.h:
  and_conds do not make fix fields
sql/item_sum.cc:
  storing/restoring argument of aggregate function for prepared statements
  restoring order list of group_concat for safety
sql/item_sum.h:
  storing/restoring argument of aggregate function for prepared statements
  layout fix
sql/mysql_priv.h:
  just declaration
sql/sql_base.cc:
  fix_fields() have to be called with temporary memory pool active
sql/sql_parse.cc:
  removed hack with item pointer storing
sql/sql_prepare.cc:
  debug output added
  removed hack with item pointer storing
sql/sql_select.cc:
  fix_fields now should be called separately
sql/sql_union.cc:
  removed wrong merged check from 4.0 (4.1 have its own protection)
sql/table.h:
  removed hack with item pointer storing
tests/client_test.c:
  new test fo PS
2004-04-03 11:13:51 +03:00
unknown
32b28f9298 WL#1266 "Separate auto-set logic from TIMESTAMP type."
Final version of patch.

Adds support for specifying of DEFAULT NOW() and/or ON UPDATE NOW()
clauses for TIMESTAMP field definition.
Current implementation allows only one such field per table and
uses several unireg types for storing info about this properties of
field. It should be replaced with better implementation when new
.frm format is introduced.


include/mysqld_error.h:
  Added error codes for case when we have more than one column with NOW()
  in DEFAULT or ON UPDATE clauses and for case when we are using ON UPDATE
  clause with wrong type.
mysql-test/r/create.result:
  Added tests for using of DEFAULT NOW() and ON UPDATE NOW() with
  non-TIMESTAMP fields.
mysql-test/r/show_check.result:
  Updated test results to reflect new default look of TIMESTAMP fields
  in SHOW CREATE TABLE.
mysql-test/r/system_mysql_db.result:
  Updated test results to reflect new default look of TIMESTAMP fields
  in SHOW CREATE TABLE.
mysql-test/r/type_ranges.result:
  Updated test results to reflect new default look of TIMESTAMP fields
  in SHOW COLUMNS.
mysql-test/r/type_timestamp.result:
  Added tests for various DEFAULT and ON UPDATE clauses for TIMESTAMP
  fields definitions.
mysql-test/t/create.test:
  Added tests for using of DEFAULT NOW() and ON UPDATE NOW() with
  non-TIMESTAMP fields.
mysql-test/t/type_timestamp.test:
  Added tests for various DEFAULT and ON UPDATE clauses for TIMESTAMP
  fields definitions.
sql/field.cc:
  Added support for various combinations of DEFAULT and ON UPDATE clauses
  for TIMESTAMP field. 
  
  Setting TABLE::timestamp* members for TIMESTAMP fields with auto-set 
  option taking into account their unireg type (which corresponds to 
  various DEFAULT/ON UPDATE values combinations). Replaced 
  TABLE::time_stamp with TABLE::timestamp_default_now/on_update_now
  couple moved their setup to separate method set_timestamp_offsets(),
  which now is called from  open_table instead of Field_timestamp cons.
sql/field.h:
  Added more unireg types for handling of DEFAULT NOW() and ON UPDATE
  NOW() for TIMESTAMP fields.
  Fixed value corresponding to DEFAULT item for TIMESTAMP field.
sql/ha_berkeley.cc:
  Now TIMESTAMP column with auto-set property could be updated during
  INSERT or/and UPDATE independently.
sql/ha_heap.cc:
  Now TIMESTAMP column with auto-set property could be updated during
  INSERT or/and UPDATE independently.
sql/ha_innodb.cc:
  Now TIMESTAMP column with auto-set property could be updated during
  INSERT or/and UPDATE independently.
sql/ha_isam.cc:
  Now TIMESTAMP column with auto-set property could be updated during
  INSERT or/and UPDATE independently.
sql/ha_isammrg.cc:
  Now TIMESTAMP column with auto-set property could be updated during
  INSERT or/and UPDATE independently.
sql/ha_myisam.cc:
  Now TIMESTAMP column with auto-set property could be updated during
  INSERT or/and UPDATE independently.
sql/ha_myisammrg.cc:
  Now TIMESTAMP column with auto-set property could be updated during
  INSERT or/and UPDATE independently.
sql/item_func.h:
  We need to distinguish NOW() from other function for using in 
  DEFAULT and in ON UPDATE clauses.
sql/item_timefunc.h:
  We need to distinguish NOW() from other function for using in 
  DEFAULT and in ON UPDATE clauses.
sql/mysql_priv.h:
  Added parameter for ON UPDATE value to add_field_to_list() function.
sql/share/czech/errmsg.txt:
  Added error messages for case when we have more than one column with
  NOW() (CURRENT_TIMESTAMP is just more standard alias) in DEFAULT or 
  ON UPDATE clauses and for case when we are using ON UPDATE clause with
  wrong type.
sql/share/danish/errmsg.txt:
  Added error messages for case when we have more than one column with
  NOW() (CURRENT_TIMESTAMP is just more standard alias) in DEFAULT or 
  ON UPDATE clauses and for case when we are using ON UPDATE clause with
  wrong type.
sql/share/dutch/errmsg.txt:
  Added error messages for case when we have more than one column with
  NOW() (CURRENT_TIMESTAMP is just more standard alias) in DEFAULT or 
  ON UPDATE clauses and for case when we are using ON UPDATE clause with
  wrong type.
sql/share/english/errmsg.txt:
  Added error messages for case when we have more than one column with
  NOW() (CURRENT_TIMESTAMP is just more standard alias) in DEFAULT or 
  ON UPDATE clauses and for case when we are using ON UPDATE clause with
  wrong type.
sql/share/estonian/errmsg.txt:
  Added error messages for case when we have more than one column with
  NOW() (CURRENT_TIMESTAMP is just more standard alias) in DEFAULT or 
  ON UPDATE clauses and for case when we are using ON UPDATE clause with
  wrong type.
sql/share/french/errmsg.txt:
  Added error messages for case when we have more than one column with
  NOW() (CURRENT_TIMESTAMP is just more standard alias) in DEFAULT or 
  ON UPDATE clauses and for case when we are using ON UPDATE clause with
  wrong type.
sql/share/german/errmsg.txt:
  Added error messages for case when we have more than one column with
  NOW() (CURRENT_TIMESTAMP is just more standard alias) in DEFAULT or 
  ON UPDATE clauses and for case when we are using ON UPDATE clause with
  wrong type.
sql/share/greek/errmsg.txt:
  Added error messages for case when we have more than one column with
  NOW() (CURRENT_TIMESTAMP is just more standard alias) in DEFAULT or 
  ON UPDATE clauses and for case when we are using ON UPDATE clause with
  wrong type.
sql/share/hungarian/errmsg.txt:
  Added error messages for case when we have more than one column with
  NOW() (CURRENT_TIMESTAMP is just more standard alias) in DEFAULT or 
  ON UPDATE clauses and for case when we are using ON UPDATE clause with
  wrong type.
sql/share/italian/errmsg.txt:
  Added error messages for case when we have more than one column with
  NOW() (CURRENT_TIMESTAMP is just more standard alias) in DEFAULT or 
  ON UPDATE clauses and for case when we are using ON UPDATE clause with
  wrong type.
sql/share/japanese/errmsg.txt:
  Added error messages for case when we have more than one column with
  NOW() (CURRENT_TIMESTAMP is just more standard alias) in DEFAULT or 
  ON UPDATE clauses and for case when we are using ON UPDATE clause with
  wrong type.
sql/share/korean/errmsg.txt:
  Added error messages for case when we have more than one column with
  NOW() (CURRENT_TIMESTAMP is just more standard alias) in DEFAULT or 
  ON UPDATE clauses and for case when we are using ON UPDATE clause with
  wrong type.
sql/share/norwegian-ny/errmsg.txt:
  Added error messages for case when we have more than one column with
  NOW() (CURRENT_TIMESTAMP is just more standard alias) in DEFAULT or 
  ON UPDATE clauses and for case when we are using ON UPDATE clause with
  wrong type.
sql/share/norwegian/errmsg.txt:
  Added error messages for case when we have more than one column with
  NOW() (CURRENT_TIMESTAMP is just more standard alias) in DEFAULT or 
  ON UPDATE clauses and for case when we are using ON UPDATE clause with
  wrong type.
sql/share/polish/errmsg.txt:
  Added error messages for case when we have more than one column with
  NOW() (CURRENT_TIMESTAMP is just more standard alias) in DEFAULT or 
  ON UPDATE clauses and for case when we are using ON UPDATE clause with
  wrong type.
sql/share/portuguese/errmsg.txt:
  Added error messages for case when we have more than one column with
  NOW() (CURRENT_TIMESTAMP is just more standard alias) in DEFAULT or 
  ON UPDATE clauses and for case when we are using ON UPDATE clause with
  wrong type.
sql/share/romanian/errmsg.txt:
  Added error messages for case when we have more than one column with
  NOW() (CURRENT_TIMESTAMP is just more standard alias) in DEFAULT or 
  ON UPDATE clauses and for case when we are using ON UPDATE clause with
  wrong type.
sql/share/russian/errmsg.txt:
  Added error messages for case when we have more than one column with
  NOW() (CURRENT_TIMESTAMP is just more standard alias) in DEFAULT or 
  ON UPDATE clauses and for case when we are using ON UPDATE clause with
  wrong type.
sql/share/serbian/errmsg.txt:
  Added error messages for case when we have more than one column with
  NOW() (CURRENT_TIMESTAMP is just more standard alias) in DEFAULT or 
  ON UPDATE clauses and for case when we are using ON UPDATE clause with
  wrong type.
sql/share/slovak/errmsg.txt:
  Added error messages for case when we have more than one column with
  NOW() (CURRENT_TIMESTAMP is just more standard alias) in DEFAULT or 
  ON UPDATE clauses and for case when we are using ON UPDATE clause with
  wrong type.
sql/share/spanish/errmsg.txt:
  Added error messages for case when we have more than one column with
  NOW() (CURRENT_TIMESTAMP is just more standard alias) in DEFAULT or 
  ON UPDATE clauses and for case when we are using ON UPDATE clause with
  wrong type.
sql/share/swedish/errmsg.txt:
  Added error messages for case when we have more than one column with
  NOW() (CURRENT_TIMESTAMP is just more standard alias) in DEFAULT or 
  ON UPDATE clauses and for case when we are using ON UPDATE clause with
  wrong type.
sql/share/ukrainian/errmsg.txt:
  Added error messages for case when we have more than one column with
  NOW() (CURRENT_TIMESTAMP is just more standard alias) in DEFAULT or 
  ON UPDATE clauses and for case when we are using ON UPDATE clause with
  wrong type.
sql/sql_base.cc:
  Added setup of TABLE::timestamp_default_now/on_update_now pair
  for each statement to open_table().
sql/sql_insert.cc:
  Using TABLE::timestamp_default_now/on_update_now pair instead of
  old TABLE::time_stamp. Added check for case then REPLACE could not
  be converted to UPDATE because of different DEFAULT/ON UPDATE values
  for TIMESTAMP field.
sql/sql_lex.h:
  Added member for value used in ON UPDATE clause to st_lex.
sql/sql_load.cc:
  Using TABLE::timestamp_default_now/on_update_now pair instead of
  old TABLE::time_stamp. We don't need to restore these members
  since they are set up for each statement in open_table().
sql/sql_parse.cc:
  Added handling of DEFAULT NOW() and ON UPDATE NOW() clauses for
  TIMESTAMP fields to add_field_to_list() function.
sql/sql_show.cc:
  Added support for DEFAULT CURRENT_TIMESTAMP (aka NOW() ) and 
  ON UPDATE CURRENT_TIMESTAMP to SHOW CREATE TABLE and SHOW COLUMNS.
sql/sql_table.cc:
  mysql_create_table() function - added check for number of TIMESTAMP 
    fields with auto-set values and replacing of old style TIMESTAMPs
    with their newer analogs.
  mysql_alter_table(): Using TABLE::timestamp_default_now/on_update_now 
    pair instead of old TABLE::time_stamp. We don't need to restore these
    members since they are set up for each statement in open_table().
sql/sql_update.cc:
  Left only setting of TABLE::timestamp_default_now/on_update_now
  to 0 since they should be already set up in open_table().
sql/sql_yacc.yy:
  Added support for DEFAULT NOW() and ON UPDATE NOW() in field
  definitions.
sql/table.h:
  Replaced TABLE::time_stamp withTABLE::timestamp_default_now/timestamp_on_update_now
  pair which allows to distinguish TIMESTAMP's with various DEFAULT/ON UPDATE
  clauses and optimize checks if TIMESTAMP field should be set to NOW()
  in handlers.
sql/unireg.cc:
  Now we are marking only TIMESTAMP fields with NOW() as default or
  as on update value as special field for unireg.
2004-04-02 10:12:53 +04:00
unknown
54a8eb623a fix for table/field caching mechanism
save moving ON/USING tables conditions to WHERE clause (BUG#2794)


sql/sql_base.cc:
  fix for table/field caching mechanism (global lock of it and right table passed as parameter)
  save moving ON/USING tables conditions to WHERE clause (BUG#2794)
sql/sql_class.cc:
  lock for using field/table cache in Item name resolution
sql/sql_class.h:
  lock for using field/table cache in Item name resolution
sql/sql_insert.cc:
  lock for using field/table cache in Item name resolution
tests/client_test.c:
  Test of PS queries with ON condition
2004-04-01 03:00:38 +03:00
unknown
dead63012a More after-merge fixes for patch fixing bug #2050 2004-04-01 00:19:30 +04:00
unknown
e6d7661547 Merge of fix for bug #2050 and bug #3307
BitKeeper/etc/logging_ok:
  auto-union
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/sql_base.cc:
  Manual merge
2004-03-31 22:17:10 +04:00
unknown
d2906f0ed0 Fix for Bug #3307 "FLUSH TABLES sometimes breaks prepared statement
table resolution".
Added members to Item_ident for storing original db, table and field
names since those that set later from Field have shorter life-time 
than required by prep. stmt. So we need to restore original names in 
Item_ident::cleanup(). Also now using special construnctor for creation
of Item_field from Field object that ensures that table and field name 
have big enough life-time.

"Fix" for bug #2050 "10 to 1 performance drop with server 4.1.1"
Clean ups in implementation of caching of field number in table.
Added caching of table in which field is found in find_field_in_tables(). 


sql/item.cc:
  Added members to Item_ident for storing original db, table and field
  names since those that set later from Field have shorter life-time 
  than required by prep. stmt. So we need to restore original names in 
  Item_ident::cleanup().
  Added Item_ident::cached_table for caching table there we found 
  our field.
  Added special constructor for creation of Item_field from Field object
  that ensures that table and field name have big enough life-time.
sql/item.h:
  Added members to Item_ident for storing original db, table and field
  names since those that set later from Field have shorter life-time 
  than required by prep. stmt. So we need to restore original names in 
  Item_ident::cleanup().
  Changed type of Item_ident::cached_field_index from int to uint
  (and so NO_CACHED_FIELD_INDEX is UINT_MAX now) because we want to
  save one comparison in find_field_in_table().
  Added Item_ident::cached_table for caching table there we found 
  our field.
  Added special constructor for creation of Item_field from Field object
  that ensures that table and field name have big enough life-time.
sql/mysql_priv.h:
  Changed type of cached_field_index_ptr from int* to uint*
  (and so NO_CACHED_FIELD_INDEX is UINT_MAX now) because we want to
  save one comparison in find_field_in_table().
sql/sql_acl.cc:
  Changed type of find_field_in_table() paremeter to make it 
  faster.
sql/sql_base.cc:
  find_field_in_table(): small optimization and soime clean ups in 
   caching of field index.
  find_field_in_tables(): added aggresive caching of table in which
   field is found in Item_ident::cached_table.
  insert_fields():
   using special construnctor for creation of Item_field from Field 
   object that ensures that table and field name have big enough life-time.
2004-03-31 21:25:55 +04:00
unknown
93c70c0772 simple optimzation
Portability fixes


client/mysqltest.c:
  Fixed that if error number 0 is included in --error, we will not generate an error message
include/mysql.h:
  Portability fix
mysql-test/mysql-test-run.sh:
  Portability fix
mysql-test/r/heap_btree.result:
  Portability fix
mysql-test/r/rpl_error_ignored_table.result:
  Portability fix
mysql-test/t/heap_btree.test:
  Portability fix
mysql-test/t/rpl_error_ignored_table.test:
  Portability fix
sql/sql_base.cc:
  simple optimzation
sql/sql_yacc.yy:
  simple optimzation
2004-03-31 03:32:38 +03:00
unknown
f5297edcae Worklog#1563 - Support of on-line CREATE/DROP INDEX.
This is to enable table handlers to implement online create/drop index.
It consists of some parts:
- New default handler methods in handler.h
- Split of mysql_alter_table. It decides if only one kind of
  alteration is to be done (e.g. only create indexes or only drop
  indexes etc.) It then calls the specialized new handler method if
  the handler implements it. Otherwise it calls real_alter_table.
- The parser sets flags for each alter operation detected in a
  command. These are used by mysql_alter_table for the decision.
- mysql_prepare_table is pulled out of mysql_create_table. This is
  also used by mysql_create_index to prepare the key structure array
  for the handler. It is also used by mysql_create_index and
  mysql_drop_index to prepare a call to mysql_create_frm.
- mysql_create_frm is pulled out of rea_create_table for use by
  mysql_create_index and mysql_drop_index after the index is
  created/dropped.
Thanks to Antony who supplied most of the changes.


sql/handler.h:
  Worklog#1563 - Support of on-line CREATE/DROP INDEX.
  New virtual handler methods with default implementation and return flags.
sql/mysql_priv.h:
  Worklog#1563 - Support of on-line CREATE/DROP INDEX.
  New function prototypes. mysql_prepare_table is pulled out of
  mysql_create_table. It prepares a table structure, which is used by 
  mysql_create_table, mysql_create_index and mysql_drop_index.
  real_alter_table is pulled out of mysql_alter_table. The latter only
  looks if the requested operation can be done by specialized functions
  or else calls real_alter_table, which does the real thing.
  mysql_add_column and mysql_drop_colunm are for future use. They simply
  call real_alter_table. mysql_create_frm is pulled out of
  rea_create_table. It is called also from mysql_create_index and
  mysql_drop_index after successful create/drop index.
  mysql_alter_table prototype is extended by the new alter_flags argument.
sql/sql_base.cc:
  Worklog#1563 - Support of on-line CREATE/DROP INDEX.
  mysql_create_index and mysql_drop_index moved to sql_table.cc.
sql/sql_lex.h:
  Worklog#1563 - Support of on-line CREATE/DROP INDEX.
  Definitions for the new alter_flags.
sql/sql_parse.cc:
  Worklog#1563 - Support of on-line CREATE/DROP INDEX.
  Extend the calls to mysql_alter_table by the new alter_flags argument.
sql/sql_table.cc:
  Worklog#1563 - Support of on-line CREATE/DROP INDEX.
  mysql_prepare_table is pulled out of mysql_create_table.
  mysql_create_index and mysql_drop_index are changed so that they use
  the new handler functions if the handler implements them.
  mysql_add_column and mysql_drop_column are for future use. They simply
  call real_alter_table. mysql_alter_table only decides which function
  to use for the requested operation. real_alter_table implements most
  of what mysql_alter_table did before.
sql/sql_yacc.yy:
  Worklog#1563 - Support of on-line CREATE/DROP INDEX.
  Set the alter_flags where appropriate.
sql/unireg.cc:
  Worklog#1563 - Support of on-line CREATE/DROP INDEX.
  mysql_create_frm is pulled out of rea_create_table.
2004-03-30 19:22:14 +02:00
unknown
b26165d3a2 resolving conflicts 2004-03-30 16:04:08 +05:00
unknown
3004dc7ef2 An improvement of
ChangeSet
  1.1707 04/03/19 12:36:55 ram@gw.mysql.r18.ru +4 -0
  Fix for the bug #2976: NATURAL JOIN produces duplicate columns.
2004-03-30 15:54:26 +05:00
unknown
1cff3d98b3 Disable INSERT DELAYED for embedded library
sql-bench/crash-me.sh:
  Fixed typo
sql/mysql_priv.h:
  Moved things for embedded library into one section
sql/sql_string.cc:
  Simple optimization
2004-03-29 17:57:07 +03:00
unknown
f6a8ec5f92 "Fix" for BUG #2050 "10 to 1 performance drop with server 4.1.1".
Actually it is not a bug but right behavior observed as pefomance 
degradation after we have forced Item_field::fix_fields() to 
re-execute each time when we are executing prep stmt.

This patch implements small optimization which heals this bad 
behavior. We are caching field position in TABLE::field array in
Item's member and are using this position for speeding up field
lookups in fix_fields() in case of its re-execution.


sql/item.cc:
  Added cached_field_index member to Item_ident for caching field
  position in TABLE::field array for quicker field lookup in case 
  fix_fields() is executed twice.
sql/item.h:
  Added cached_field_index member to Item_ident for caching field
  position in TABLE::field array for quicker field lookup in case 
  fix_fields() is executed twice.
sql/mysql_priv.h:
  Now find_field_in_table has one more in-out parameter which is used
  for caching field index in TABLE::field array stored for quicker
  field look up.
sql/sql_acl.cc:
  Now find_field_in_table has one more in-out parameter which is used
  for caching field index in TABLE::field array stored for quicker
  field look up.
sql/sql_base.cc:
  Optimization: Now when we are looking up Field by its name we are 
  caching its position in TABLE::field array in Item_ident::cached_field_index,
  so when we will call fix_fields() second time for this item (e.g.
  when we are re-executing prep statement) we can reuse this index
  to speed up this lookup.
sql/table.cc:
  Now we storing in TABLE::name_hash pointers to elements of 
  TABLE::field array, because this allows easily retrieve index
  of field in this array when it is looked up by its name.
sql/table.h:
  Added comment claryfying what we store in TABLE::name_hash.
BitKeeper/etc/logging_ok:
  Logging to logging@openlogging.org accepted
2004-03-28 04:11:54 +04:00