Commit graph

12841 commits

Author SHA1 Message Date
unknown
683c1e6ad7 After merge fix
mysql-test/t/rpl_loaddata_simple.test:
  Rename: mysql-test/t/rpl_loaddata2.test -> mysql-test/t/rpl_loaddata_simple.test
mysql-test/r/rpl_loaddata_simple.result:
  Rename: mysql-test/r/rpl_loaddata2.result -> mysql-test/r/rpl_loaddata_simple.result
2007-03-01 18:16:17 +04:00
unknown
b9959b748a after merge fix 2007-03-01 16:08:13 +04:00
unknown
783634d6d4 Merge mysql.com:/home/bar/mysql-5.0.merge
into  mysql.com:/home/bar/mysql-5.1-rpl


mysql-test/r/mysqlbinlog.result:
  Auto merged
mysql-test/t/mysqlbinlog.test:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/log_event.h:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_load.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
2007-03-01 16:06:29 +04:00
unknown
58e93b1f9f Merge mysql.com:/nfsdisk1/lars/bkroot/mysql-5.1-new-rpl
into  mysql.com:/nfsdisk1/lars/MERGE/mysql-5.1-merge


sql/field.cc:
  Auto merged
sql/log.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sql_insert.cc:
  Auto merged
2007-02-28 22:32:44 +01:00
unknown
4a83cd38ea Additional test changes for
Bug N 15126 character_set_database is not replicated (LOAD DATA INFILE need it)
Positions of some binlog events were changed because of
additional logging of @@collation_database.
2007-02-28 18:13:23 +04:00
unknown
18f1d1a200 After merge fix 2007-02-28 17:32:18 +04:00
unknown
de61d5b0d5 Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-5.0-rpl
into  mysql.com:/home/bar/mysql-5.0.b15126


sql/log_event.cc:
  Auto merged
sql/log_event.h:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_load.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
mysql-test/r/mysqlbinlog.result:
  After merge fix
mysql-test/t/mysqlbinlog.test:
  After merge fix
2007-02-28 17:17:06 +04:00
unknown
c3a3aff54f Bug#15126 character_set_database is not replicated (LOAD DATA INFILE need it)
This patch fixes problem that LOAD DATA could use different
character sets when loading files on master and on slave sides:
- Adding replication of thd->variables.collation_database
- Adding optional character set clause into LOAD DATA

Note, the second way, with explicit CHARACTER SET clause
should be the recommended way to load data using an alternative
character set.
The old way, using "SET @@character_set_database=xxx" should be
gradually depricated.


mysql-test/r/mysqlbinlog.result:
  Adding test case
mysql-test/t/mysqlbinlog.test:
  Adding test case
sql/log_event.cc:
  Adding logging of thd->variables.collation_database
sql/log_event.h:
  Adding declarations
sql/sql_class.cc:
  Exchange character set is null by default
sql/sql_class.h:
  Adding character set into sql_exchange
sql/sql_load.cc:
  - Using exchange character set (if it was specified in LOAD DATA syntax)
  - Using thd->variables.collation_database by default
sql/sql_yacc.yy:
  Adding optional character set clause into LOAD DATA syntax
mysql-test/r/rpl_loaddata2.result:
  New BitKeeper file ``mysql-test/r/rpl_loaddata2.result''
mysql-test/std_data/loaddata6.dat:
  New BitKeeper file ``mysql-test/std_data/loaddata6.dat''
mysql-test/t/rpl_loaddata2.test:
  New BitKeeper file ``mysql-test/t/rpl_loaddata2.test''
2007-02-28 17:06:57 +04:00
unknown
71b762bf69 Fix of incorrect merge of test case 2007-02-27 20:57:46 +01:00
unknown
9cf5f2c94a Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-5.1-opt
into  mysql.com:/home/psergey/mysql-5.1-bug26117
2007-02-27 22:05:52 +03:00
unknown
b68a22019e BUG#26117 "index_merge sort-union over partitioned table crashes"
Before the fix: 
  ha_partition objects had ha_partition::m_part_info==NULL and that caused
  crash
After: 
- The new ha_partition::clone() function makes the clones use parent's
  m_part_info value.
- The parent ha_partition object remains responsible for deallocation of
  m_part_info.


mysql-test/r/partition_innodb.result:
  BUG#26117 "index_merge sort-union over partitioned table crashes"
   - Testcase
mysql-test/t/partition_innodb.test:
  BUG#26117 "index_merge sort-union over partitioned table crashes"
   - Testcase
2007-02-27 22:01:03 +03:00
unknown
7443227bca Merge mysql.com:/nfsdisk1/lars/MERGE/mysql-5.0-merge
into  mysql.com:/nfsdisk1/lars/MERGE/mysql-5.1-merge


sql/sql_load.cc:
  Auto merged
mysql-test/r/rpl_user_variables.result:
  Manual merge
mysql-test/t/rpl_user_variables.test:
  Manual merge
sql/item_func.cc:
  Manual merge
sql/log.cc:
  Manual merge
sql/sp_head.cc:
  Manual merge
sql/sql_class.cc:
  Manual merge
sql/sql_class.h:
  Manual merge
2007-02-27 19:20:47 +01:00
unknown
f3377aa894 Merge cbell@bk-internal.mysql.com:/home/bk/mysql-5.1-new-rpl
into  mysql_cab_desk.:C:/source/C++/mysql-5.1-new-rpl


sql/item_func.cc:
  Auto merged
sql/log.cc:
  Auto merged
sql/log.h:
  Auto merged
sql/sp_head.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
2007-02-26 14:33:58 -05:00
unknown
1636d00fa7 Merge cbell@bk-internal.mysql.com:/home/bk/mysql-5.0-rpl
into  mysql_cab_desk.:C:/source/c++/mysql-5.0-rpl


sql/item_func.cc:
  Auto merged
sql/log.cc:
  Auto merged
sql/sp_head.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
2007-02-26 14:30:44 -05:00
unknown
9f957f1429 BUG#20141 "User-defined variables are not replicated properly for
SF/Triggers in SBR mode."
BUG#14914 "SP: Uses of session variables in routines are not always replicated"
BUG#25167 "Dupl. usage of user-variables in trigger/function is not replicated
          correctly"

User-defined variables used inside of stored functions/triggers in
statements which did not update tables directly were not replicated.
We also had problems with replication of user-defined variables which
were used in triggers (or stored functions called from table-updating
statements) more than once.

This patch addresses the first issue by enabling logging of all
references to user-defined variables in triggers/stored functions
and not only references from table-updating statements.

The second issue stemmed from the fact that for user-defined
variables used from triggers or stored functions called from
table-updating statements we were writing binlog events for each
reference instead of only one event for the first reference.
This problem is already solved for stored functions called from
non-updating statements with help of "event unioning" mechanism.
So the patch simply extends this mechanism to the case affected.
It also fixes small problem in this mechanism which caused wrong
logging of references to user-variables in cases when non-updating
statement called several stored functions which used the same
variable and some of these function calls were omitted from binlog
as they were not updating any tables.



mysql-test/r/rpl_user_variables.result:
  BUG#20141 - User-defined variables are not replicated properly for 
              SF/Triggers in SBR mode.
  This patch adds the correct results for execution of the added test 
  procedures to the rpl_user_variables test.
mysql-test/t/rpl_user_variables.test:
  BUG#20141 - User-defined variables are not replicated properly for 
              SF/Triggers in SBR mode.
  This patch adds additional tests to the rpl_user_variables test that test 
  many of the different ways user-defined variables can be required to be 
  replicated.
sql/item_func.cc:
  BUG#20141 - User-defined variables are not replicated properly for SF/Triggers
              in SBR mode.
  To properly log accesses to user-defined variables from stored 
  functions/triggers, the get_var_with_binlog() method needs to log references 
  to such variables even from non-table-updating statements within them.
sql/log.cc:
  BUG#20141 - User-defined variables are not replicated properly for SF/Triggers 
              in SBR mode.
  This patch modifies the start_union_events method to accept the query id from 
  a parameter. This allows callers to set the query_id to the id of the sub 
  statement such as a trigger or stored function. Which permits the code to 
  identify when a user defined variable has been used by the statement and this 
  already present in THD::user_var_event.
  
  Note:
  The changes to sql_class.cc, sp_head.cc, and log.cc are designed to allow the 
  proper replication of access to user-defined variables under a special test 
  case (the last case shown in rpl_user_variables.test).
sql/log.h:
  BUG#20141 - User-defined variables are not replicated properly for 
              SF/Triggers in SBR mode.
  This patch adds the query_id parameter to the calls to 
  mysql_bin_log.start_union_events().
sql/sp_head.cc:
  BUG#20141 - User-defined variables are not replicated properly for 
              SF/Triggers in SBR mode.
  This patch modifies the code to allow for cases where events for function calls
  have a separate union for each event and thus cannot use the query_id of the 
  caller as the start of the union. Thus, we use an artifically created query_id
  to set the start of the events.
  
  Note:
  The changes to sql_class.cc, sp_head.cc, and log.cc are designed to allow the 
  proper replication of access to user-defined variables under a special test 
  case (the last case shown in rpl_user_variables.test).
sql/sql_class.cc:
  BUG#20141 - User-defined variables are not replicated properly for 
              SF/Triggers in SBR mode.
  This patch adds the query_id parameter to the calls to 
  mysql_bin_log.start_union_events().
  
  Note:
  The changes to sql_class.cc, sp_head.cc, and log.cc are designed to allow 
  the proper replication of access to user-defined variables under a special 
  test case (the last case shown in rpl_user_variables.test).
2007-02-26 14:06:10 -05:00
unknown
536adef69d Merge mysql.com:/home/gluh/MySQL/Merge/5.1
into  mysql.com:/home/gluh/MySQL/Merge/5.1-opt


sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_cmpfunc.h:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_prepare.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_union.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
2007-02-26 17:46:52 +04:00
unknown
bab42f674d after merge fix 2007-02-26 16:52:54 +04:00
unknown
b10600528d Merge mysql.com:/home/gluh/MySQL/Merge/5.0-opt
into  mysql.com:/home/gluh/MySQL/Merge/5.1-opt


mysql-test/r/innodb.result:
  Auto merged
mysql-test/r/insert_update.result:
  Auto merged
mysql-test/r/myisam.result:
  Auto merged
mysql-test/r/select.result:
  Auto merged
mysql-test/r/subselect3.result:
  Auto merged
mysql-test/r/type_blob.result:
  Auto merged
mysql-test/t/insert_update.test:
  Auto merged
mysql-test/t/select.test:
  Auto merged
BitKeeper/deleted/.del-bdb.result:
  Auto merged
mysql-test/extra/binlog_tests/blackhole.test:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_delete.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_prepare.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_union.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
storage/blackhole/ha_blackhole.cc:
  Auto merged
mysql-test/r/binlog_stm_blackhole.result:
  manual merge
mysql-test/r/insert_select.result:
  manual merge
mysql-test/r/subselect.result:
  manual merge
mysql-test/r/update.result:
  manual merge
mysql-test/t/insert_select.test:
  manual merge
mysql-test/t/subselect.test:
  manual merge
sql/sql_help.cc:
  manual merge
sql/sql_insert.cc:
  manual merge
sql/sql_update.cc:
  manual merge
2007-02-26 15:54:43 +04:00
unknown
a5abde17ea Merge mysql.com:/nfsdisk1/lars/bkroot/mysql-5.1-new-rpl
into  mysql.com:/nfsdisk1/lars/MERGE/mysql-5.1-merge


client/mysqlbinlog.cc:
  Auto merged
include/my_global.h:
  Auto merged
mysql-test/t/disabled.def:
  Auto merged
sql/field.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/log.cc:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/slave.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
2007-02-25 00:12:14 +01:00
unknown
33dbda5eae Merge mysql.com:/nfsdisk1/lars/bkroot/mysql-5.0-rpl
into  mysql.com:/nfsdisk1/lars/MERGE/mysql-5.0-merge


sql/field.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/log.cc:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/log_event.h:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/slave.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
2007-02-25 00:10:51 +01:00
unknown
2a86b8ecfc Merge mysql.com:/nfsdisk1/lars/bkroot/mysql-5.1-new-rpl
into  mysql.com:/nfsdisk1/lars/MERGE/mysql-5.1-merge


client/mysqlbinlog.cc:
  Auto merged
include/my_global.h:
  Auto merged
mysql-test/extra/rpl_tests/rpl_insert_id.test:
  Auto merged
mysql-test/t/show_check.test:
  Auto merged
mysys/mf_iocache2.c:
  Auto merged
sql/field.cc:
  Auto merged
sql/item_xmlfunc.cc:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/log_event.h:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/slave.cc:
  Auto merged
sql/slave.h:
  Auto merged
sql/sql_show.cc:
  Auto merged
mysql-test/t/disabled.def:
  Manual merge
sql/log.cc:
  Manual merge
sql/sql_insert.cc:
  Manual merge
2007-02-24 11:52:08 +01:00
unknown
dfb019ea74 Merge mysql.com:/nfsdisk1/lars/bkroot/mysql-5.0-rpl
into  mysql.com:/nfsdisk1/lars/MERGE/mysql-5.0-merge


sql/field.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/slave.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
mysql-test/t/disabled.def:
  Manual merge
2007-02-24 11:41:31 +01:00
unknown
6f6951d218 Fix for BUG#25628: "mysqlbinlog crashes while processing binary logs".
mysqlbinlog prints all row-based events of a single statement as a
single "BINLOG" statement containing the concatenation of those events.
Big (i.e. >64k) concatenations of row-based events
(e.g. Write_rows_log_event) caused mysqlbinlog's IO_CACHE to overflow
to a temporary file but the IO_CACHE had not been inited with
open_cached_file(), so it tried to create a temporary file in
an uninitialized directory (thus failing to create, then to write;
some OS errors were printed, and it finally segfaulted).
After fixing this, it appeared that mysqlbinlog was printing only
a piece of big concatenations of row-based events (it printed
at most the size of the IO_CACHE's buffer i.e. 64k); that caused data
loss at restore. We fix and test that.
Last, mysqlbinlog's printouts looked a bit strange with the informative
header (#-prefixed) of groupped Rows_log_event all on one line,
so we insert \n. After that, a small bug in the --hexdump code appeared
(only if the string to hex-print had its length a multiple of 16),
we fix it.



client/mysqlbinlog.cc:
  if we write to IO_CACHE more than can fit into its memory buffer,
  it will try to overflow into a file; for that to work, IO_CACHE
  must be inited via open_cached_file().
mysql-test/r/mysqlbinlog_base64.result:
  result update
mysql-test/t/mysqlbinlog_base64.test:
  test for BUG#25628: test that mysqlbinlog does not have OS errors
  with big concatenations of row-based events
  (e.g. Write_rows_log_event), and prints those concatenations entirely
  (testing by piping the output back into the server and comparing data).
mysys/mf_iocache2.c:
  my_b_copy_to_file() had a problem: it assumed that bytes_in_cache
  are all the bytes to copy to the file, while it only tells how many
  bytes are in the buffer; so the code forgot to copy what had already
  overflown into a temporary file. Thus any big event was printed only
  partially by mysqlbinlog (loss of data at restore). The fix is
  inspired by MYSQL_BIN_LOG::write_cache().
sql/log_event.cc:
  Several Table_map/Write_rows events generated by one single statement
  get groupped together in mysqlbinlog's output; it printed things like
  #718 7:30:51 server id 12 end_log_pos 988      Write_rows: table id 17#718 7:30:51 server id 12 #718 7:30:51 server id 12  end_log_pos 988      Write_rows: table id 17#718 7:30:51 server id 12 end_log_pos 1413 <cut>
  It didn't look nice to have printouts glued like this without line
  breaks. Adding a line break.
  Doing this, when using --hexdump the result was:
  #718 7:30:51 server id 12 end_log_pos 988
  # <hexdump output>
  # Write_rows: table id 17
  which is correct; unfortunately if the hex dump had only full lines
  (i.e the string to print in hex had its length a multiple of 16),
  then the # in front of Write_rows was not printed. Fixed.
sql/log_event.h:
  removing strcpy() (one less function call).
  If we write to IO_CACHE more than can fit into its memory buffer,
  it will try to overflow into a file; for that to work, IO_CACHE
  must be inited via open_cached_file().
  open_cached_file(), like init_io_cache(), can fail; we make sure to
  catch this constructor's problem via the init_ok() method.
2007-02-23 22:23:54 +01:00
unknown
8777e35a14 Merge dl145h.mysql.com:/users/gbichot/mysql-5.0-rpl
into  dl145h.mysql.com:/users/gbichot/mysql-5.1-rpl


sql/slave.cc:
  Auto merged
mysql-test/t/disabled.def:
  merge
2007-02-23 22:00:45 +01:00
unknown
3a8a519acb Merge mysql_cab_desk.:C:/source/c++/mysql-5.0-rpl
into  mysql_cab_desk.:C:/source/c++/mysql-5.0_BUG_20141


sql/log.cc:
  Auto merged
2007-02-23 13:00:08 -05:00
unknown
e52ec3e6d5 BUG#20141 "User-defined variables are not replicated properly for SF/
Triggers in SBR mode."
BUG#14914 "SP: Uses of session variables in routines are not always
           replicated"
BUG#25167 "Dupl. usage of user-variables in trigger/function is not
           replicated correctly"

User-defined variables used inside of stored functions/triggers in
statements which did not update tables directly were not replicated.
We also had problems with replication of user-defined variables which
were used in triggers (or stored functions called from table-updating
statements) more than once.

This patch addresses the first issue by enabling logging of all
references to user-defined variables in triggers/stored functions
and not only references from table-updating statements.

The second issue stemmed from the fact that for user-defined
variables used from triggers or stored functions called from
table-updating statements we were writing binlog events for each
reference instead of only one event for the first reference.
This problem is already solved for stored functions called from
non-updating statements with help of "event unioning" mechanism.
So the patch simply extends this mechanism to the case affected.
It also fixes small problem in this mechanism which caused wrong
logging of references to user-variables in cases when non-updating
statement called several stored functions which used the same
variable and some of these function calls were omitted from binlog
as they were not updating any tables.


mysql-test/r/rpl_user_variables.result:
  BUG#20141 - User-defined variables are not replicated properly for SF/Triggers in SBR mode.
  This patch adds the correct results for execution of the added test procedures to the
  rpl_user_variables test.
mysql-test/t/rpl_user_variables.test:
  BUG#20141 - User-defined variables are not replicated properly for SF/Triggers in SBR mode.
  This patch adds additional tests to the rpl_user_variables test that test many of the
  different ways user-defined variables can be required to be replicated.
sql/item_func.cc:
  BUG#20141 - User-defined variables are not replicated properly for SF/Triggers in SBR mode.
  To properly log accesses to user-defined variables from stored functions/triggers,
  the get_var_with_binlog() method needs to log references to such variables even from 
  non-table-updating statements within them.
sql/log.cc:
  BUG#20141 - User-defined variables are not replicated properly for SF/Triggers in SBR mode.
  This patch modifies the start_union_events method to accept the query id from a parameter.
  This allows callers to set the query_id to the id of the sub statement such as a trigger
  or stored function. Which permits the code to identify when a user defined variable has
  been used by the statement and this already present in THD::user_var_event.
  
  Note:
  The changes to sql_class.cc, sp_head.cc, and log.cc are designed to allow the proper 
  replication of access to user-defined variables under a special test case (the last case 
  shown in rpl_user_variables.test).
sql/sp_head.cc:
  BUG#20141 - User-defined variables are not replicated properly for SF/Triggers in SBR mode.
  This patch modifies the code to allow for cases where events for function calls have
  a separate union for each event and thus cannot use the query_id of the caller as the
  start of the union. Thus, we use an artifically created query_id to set the start of 
  the events.
  
  Note:
  The changes to sql_class.cc, sp_head.cc, and log.cc are designed to allow the proper 
  replication of access to user-defined variables under a special test case (the last case 
  shown in rpl_user_variables.test).
sql/sql_class.cc:
  BUG#20141 - User-defined variables are not replicated properly for SF/Triggers in SBR mode.
  This patch adds the query_id parameter to the calls to mysql_bin_log.start_union_events().
  
  Note:
  The changes to sql_class.cc, sp_head.cc, and log.cc are designed to allow the proper 
  replication of access to user-defined variables under a special test case (the last case 
  shown in rpl_user_variables.test).
sql/sql_class.h:
  BUG#20141 - User-defined variables are not replicated properly for SF/Triggers in SBR mode.
  This patch adds the query_id parameter to the calls to mysql_bin_log.start_union_events().
2007-02-23 12:58:56 -05:00
unknown
8c07265ce1 the fix for BUG#24432
"INSERT... ON DUPLICATE KEY UPDATE skips auto_increment values"
didn't make it into 5.0.36 and 5.1.16,
so we need to adjust the bug-detection-based-on-version-number code.
Because the rpl tree has a too old version, rpl_insert_id cannot pass,
so I disable it (like is already the case in 5.1-rpl for the same reason),
and the repl team will re-enable it when they merge 5.0 and 5.1 into
their trees (thus getting the right version number).


mysql-test/t/disabled.def:
      rpl_insert_id tests statement-based replication of INSERT ON
      DUPLICATE KEY UPDATE. This type of INSERT had BUG#24432, which is
      fixed in 5.0.38; we made the slave detect if it is connected to a
      <5.0.38 master and if so refuse to replicate.
      The problem is that this 5.0-rpl tree, even though it will produce
      the 5.0.38 release, still has a 5.0.36 version in configure.in.
      Thus rpl_insert_id fails. So I disable it. As soon as the 5.0-rpl
      tree gets the changesets from the main 5.0, its version will change
      to 5.0.38 and so the repl team will re-enable the test.
sql/slave.cc:
  the fix for BUG#24432 didn't make it into 5.0.36 and 5.1.16,
  so we need to adjust the bug-detection-based-on-version-number code.
2007-02-23 15:32:51 +01:00
unknown
9e6784924a Fixed compiler warnings
Fixed compile-pentium64 scripts
Fixed wrong estimate of update_with_key_prefix in sql-bench
Merge bk-internal.mysql.com:/home/bk/mysql-5.1 into mysql.com:/home/my/mysql-5.1
Fixed unsafe define of uint4korr()
Fixed that --extern works with mysql-test-run.pl
Small trivial cleanups
This also fixes a bug in counting number of rows that are updated when we have many simultanous queries
Move all connection handling and command exectuion main loop from sql_parse.cc to sql_connection.cc
Split handle_one_connection() into reusable sub functions.
Split create_new_thread() into reusable sub functions.
Added thread_scheduler; Preliminary interface code for future thread_handling code.

Use 'my_thread_id' for internal thread id's
Make thr_alarm_kill() to depend on thread_id instead of thread
Make thr_abort_locks_for_thread() depend on thread_id instead of thread
In store_globals(), set my_thread_var->id to be thd->thread_id.
Use my_thread_var->id as basis for my_thread_name()
The above changes makes the connection we have between THD and threads more soft.

Added a lot of DBUG_PRINT() and DBUG_ASSERT() functions
Fixed compiler warnings
Fixed core dumps when running with --debug
Removed setting of signal masks (was never used)
Made event code call pthread_exit() (portability fix)
Fixed that event code doesn't call DBUG_xxx functions before my_thread_init() is called.
Made handling of thread_id and thd->variables.pseudo_thread_id uniform.
Removed one common 'not freed memory' warning from mysqltest
Fixed a couple of usage of not initialized warnings (unlikely cases)
Suppress compiler warnings from bdb and (for the moment) warnings from ndb


BitKeeper/deleted/.del-SETUP.sh.rej:
  Rename: BUILD/SETUP.sh.rej -> BitKeeper/deleted/.del-SETUP.sh.rej
BitKeeper/deleted/.del-configure.in.rej:
  Rename: configure.in.rej -> BitKeeper/deleted/.del-configure.in.rej
BitKeeper/deleted/.del-my_global.h.rej:
  Rename: include/my_global.h.rej -> BitKeeper/deleted/.del-my_global.h.rej
BitKeeper/deleted/.del-my_pthread.h.rej:
  Rename: include/my_pthread.h.rej -> BitKeeper/deleted/.del-my_pthread.h.rej
BitKeeper/deleted/.del-mysql_client_test.c.rej:
  Rename: tests/mysql_client_test.c.rej -> BitKeeper/deleted/.del-mysql_client_test.c.rej
BitKeeper/deleted/.del-mysqld.cc.rej~35c1c438e11ebd89:
  Rename: sql/mysqld.cc.rej -> BitKeeper/deleted/.del-mysqld.cc.rej~35c1c438e11ebd89
BitKeeper/deleted/.del-sql_parse.cc.rej:
  Rename: sql/sql_parse.cc.rej -> BitKeeper/deleted/.del-sql_parse.cc.rej
BitKeeper/deleted/.del-table.cc.rej:
  Rename: sql/table.cc.rej -> BitKeeper/deleted/.del-table.cc.rej
BitKeeper/deleted/.del-thr_alarm.c.rej:
  Rename: mysys/thr_alarm.c.rej -> BitKeeper/deleted/.del-thr_alarm.c.rej
BUILD/compile-pentium64:
  Update this to be in line with compile-pentium
BUILD/compile-pentium:
  Send command line options to SETUP.sh
BUILD/compile-solaris-sparc-debug:
  Update scripts
BUILD/compile-solaris-sparc-forte:
  Update scripts
BUILD/compile-solaris-sparc-purify:
  Update scripts
BUILD/compile-solaris-sparc:
  Update scripts
BitKeeper/deleted/.del-DbtupSystemRestart.cpp~15b54d7e4e75d2d:
  Removed compiler warning
BitKeeper/deleted/.del-ha_berkeley.cc:
  Moved get_auto_primary_key() here as int5store() gives (wrong) compiler warnings in win64
configure.in:
  Added detection of port_create and port.h (for future)as 
  ---
  manual merge
BitKeeper/deleted/.del-ha_berkeley.h:
  Moved get_auto_primary_key() to ha_berkeley.cc
BitKeeper/deleted/.del-mysqlmanager.c~e97636d71145a0b:
  Fixed compiler warnings
BitKeeper/etc/ignore:
  added storage/ndb/src/ndbapi/ndberror_check
client/mysqlbinlog.cc:
  Removed not needed 'static' (caused compiler warning)
client/mysqldump.c:
  Fixed compiler warnings from 'max' build
client/mysqltest.c:
  Free warning and query memory no abort.
  (Removes strange warnings on screen if mysql-test-run fails)
  Removed compiler warnings
  Portability fix for windows (windows doesn't have mode_t)
client/sql_string.h:
  Removed compiler warning
cmd-line-utils/readline/xmalloc.c:
  Fixed compiler warnings from 'max' build
extra/charset2html.c:
  Fixed compiler warnings
extra/comp_err.c:
  Fixed compiler warnings from 'max' build
extra/yassl/include/lock.hpp:
  Fix for windows64
extra/yassl/include/openssl/ssl.h:
  Changed prototype for SSL_set_fd() to fix compiler warnings (and possible errors) on windows 64 bit
extra/yassl/include/socket_wrapper.hpp:
  Moved socket_t to ssl.h, to be able to removed compiler warnings on windows 64 bit
extra/yassl/include/yassl.hpp:
  Fix for windows64
extra/yassl/src/ssl.cpp:
  Removed compiler warning
  Detect wrong parameter (Happens when running test suite on solaris)
  Changed prototype for SSL_set_fd() to fix compiler warnings (and possible errors) on windows 64 bit
extra/yassl/taocrypt/src/integer.cpp:
  Fixed compiler warnings
extra/yassl/testsuite/testsuite.cpp:
  Removed compiler warning
include/config-win.h:
  Added HAVE_WINSOCK2 (for future)
include/my_dbug.h:
  Fixed DBUG_PROCESS() so that we don't get compiler warnings for it
include/my_global.h:
  Fixed unsafe define of uint4korr()
  manual merge (ignore changes from 5.0)
  Fixed warnings on win64 when using int5store and int6store
include/my_pthread.h:
  Added my_thread_id typedef
  Renamed 'my_thread_id() function to my_thead_dbug_id()
include/thr_alarm.h:
  Make thr_alarm_kill() to depend on thread_id instead of thread
include/thr_lock.h:
  Make thr_abort_locks_for_thread() depend on thread_id instead of thread
libmysql/libmysql.def:
  Fixed compiler warnings on win64
libmysqld/CMakeLists.txt:
  Added missing files
libmysqld/Makefile.am:
  Added new files
libmysqld/lib_sql.cc:
  Remove not needed code (store_globals() now takes care of things)
mysql-test/lib/mtr_report.pl:
  Removed wrong messages when using --extern
mysql-test/mysql-test-run.pl:
  Fixed that --extern works
  Print help on stdout instead of stderr (make it easier to pipe it to less)
  Fixed typo that caused mysql-test-run.pl to fail on Solaris
mysql-test/r/keywords.result:
  manual merge
mysql-test/r/ndb_lock.result:
  After merge fixes
mysql-test/r/ps.result:
  Portability fix
mysql-test/t/disabled.def:
  Disabled ndb_alter_table as this very often fails for me (and have done it for a long time)
mysql-test/t/keywords.test:
  manual merge
mysql-test/t/ndb_lock.test:
  Added other possible error code
mysql-test/t/ps.test:
  Portability fix (when compiling without DLOPEN)
mysql-test/t/wait_timeout.test:
  Don't run this if we are not using a thread per connection (as other thread_handling code may not support timeouts)
mysys/base64.c:
  Fixed compiler warnings on win64
mysys/mf_keycache.c:
  Fixed compiler warnings
mysys/my_getopt.c:
  Fixed compiler warning
mysys/my_init.c:
  Fixed compiler warning
  Re-indented long comment
mysys/my_thr_init.c:
  Always use mysys_var->id to generate thread name (makes things uniform accross thread implementations and thread usage)
  Always generate my_thread_name() when using DBUG
  Ensure mysys_var->pthread_self is set
  Fixed compiler warnings
mysys/ptr_cmp.c:
  Fixed compiler warnings from 'max' build
mysys/thr_alarm.c:
  Change thr_alarm_kill() to use mysys_var->id instead of thread id
  Fixed compiler warning on windows
mysys/thr_lock.c:
  Change thr_abort_locks_for_thread() to use mysys_var->id instead of thread id
  Add purecov statements around not tested code
  Fixed compiler warnings
mysys/thr_mutex.c:
  my_thread_id() -> my_thread_dbug_id()
server-tools/instance-manager/guardian.cc:
  Fixed compiler warning
server-tools/instance-manager/instance.cc:
  Fixed compiler warning
server-tools/instance-manager/mysql_connection.cc:
  Fixed compiler warnings
server-tools/instance-manager/mysqlmanager.cc:
  Fixed compiler warnings
sql/CMakeLists.txt:
  Added missing files
sql/Makefile.am:
  Added new files
sql/event_scheduler.cc:
  Added pthread_exit() calls
  Ensure DBUG_xxx calls are not made before my_thread_init()
  Use common functions to set up thread handling
sql/field.h:
  manual merge
sql/ha_ndbcluster.cc:
  Removed some trivial 'current_thd' calls
sql/handler.cc:
  Avoid warnings on KILL_CONNECTION
  Don't print out null pointer with printf()  (Causes crashes on Solaris)
sql/item.cc:
  Fixed compiler warnings from 'max' build
sql/item_cmpfunc.cc:
  After merge fixes
sql/item_func.cc:
  Merge embedded and normal code usage
  (GET_LOCK, RELEASE_LOCK now works on my_thread_id instead of pthread_t)
  Fixed compiler warning
sql/item_strfunc.cc:
  Fixed compiler warning
sql/item_timefunc.cc:
  Fixed compiler warnings
sql/lock.cc:
  Use (new) parameter to thr_abort_locks_for_thread()
sql/log.cc:
  Fixed compiler warning
sql/log_event.cc:
  Fixed compiler warnings about not used variable
sql/mysql_priv.h:
  Remove TEST_NO_THREADS (not needed with new scheduler interface)
  Added functions from sql_connect.cc and new functions from sql_parse.cc
sql/mysqld.cc:
  Use thread_scheduler structure to dispatch calls (make code more dynamic)
  Change --one-thread option to use thread_scheduler interface
  Made ONE_THREAD option independent of DBUG_BUILD
  --one-thread is now depricated. One should instead use '--thread-handling=no-threads'
  Remove not used uname() function.
  Split create_new_thread() into reusable sub functions.
  Preliminary interface code for future thread_handling code.
  Fixed compiler warnings
sql/parse_file.cc:
  Don't send zero pointer to fn_format() (Causes crashes when using --debug)
sql/repl_failsafe.cc:
  Setup pseudo_thread_id same way as other code
sql/set_var.cc:
  Added variables 'thread_handling'
  Prepare for future variable 'thread_pool_size'
  Fixed compiler warnings
sql/set_var.h:
  Fixed compiler warning
sql/slave.cc:
  Setup pseudo_thread_id same way as other code
  Removed not used signal mask
sql/sql_acl.cc:
  Fixed compiler warnings from 'max' build
sql/sql_base.cc:
  Fixed long comments
  Normalized variable setup
  Don't destroy value of thd->variables.pseduo_thread_id
  More DBUG_PRINT()'s
  More DBUG_ASSERT()'s
  Fixed compiler warnings from 'max' build
sql/sql_class.cc:
  Remove thd->real_id and thd->dbug_thread_id
  Added DBUG_ASSERT()
  Use thread_scheduler to signal threads to be killed.
  In THD::store_globals(), set my_thread_var->id to be thd->thread_id.
  Fixed compiler warnings
sql/sql_class.h:
  Use 'my_thread_id' for internal thread id's
  Remove not needed THD elements: block_signals and dbug_thread_id
  Added 'thread_scheduler' scheduling extension element to THD
sql/sql_insert.cc:
  After merge fixes
  (This actually fixes a bug in old code when many connections are in use)
  Setup pseudo_thread_id same way as other code
  Removed not used signal mask
  Initialize variable that may be used unitialized on error conditions (not fatal)
sql/sql_parse.cc:
  Move connection related code to sql_connect.cc
  Remove setting of signal mask (not needed)
  Ensure TABLE_LIST->alias is set for generated TABLE_LIST elements (fixed core dumps when running with --debug)
  Added previous 'optional' element to reset_mgh()
  Removed not needed DBUG_PRINT call
sql/sql_partition.cc:
  Fixed compiler warnings
sql/sql_prepare.cc:
  Removed not needed casts
  Fixed compiler warnings from 'max' build
sql/sql_select.cc:
  Fixed compiler warnings
sql-bench/bench-init.pl.sh:
  Added --one-missing-tests
sql-bench/example:
  Better example
sql-bench/run-all-tests.sh:
  Added --only-missing-tests
sql-bench/test-insert.sh:
  Fixed wrong estimate of update_with_key_prefix
sql/sql_show.cc:
  Don't send pthread_kill() to threads to detect if they exists.
  (Not that useful and causes problems with future thread_handling code)
  Fixed compiler warnings
sql/sql_table.cc:
  Simplify code
  Fixed compiler warnings
sql/sql_test.cc:
  Remove dbug_thread_id from test output
sql/sql_view.cc:
  Don't send zero pointer to fn_format()
sql/tztime.cc:
  Fixed compiler warning
sql/udf_example.def:
  Fixed compiler warnings on win64
sql/unireg.cc:
  Initialize variable that may be used unitialized on error conditions
storage/archive/archive_test.c:
  Fixed compiler warnings
storage/archive/azio.c:
  Fixed compiler warnings
storage/innobase/dict/dict0crea.c:
  Fixed compiler warnings detected on windows64
storage/innobase/dict/dict0dict.c:
  Fixed compiler warnings detected on windows64
storage/innobase/dict/dict0load.c:
  Fixed compiler warnings detected on windows64
storage/innobase/dict/dict0mem.c:
  Fixed compiler warnings detected on windows64
storage/innobase/eval/eval0proc.c:
  Fixed compiler warnings detected on windows64
storage/innobase/handler/ha_innodb.cc:
  Fixed compiler warnings detected on windows64
storage/innobase/include/ut0byte.ic:
  Fixed compiler warnings on win64
storage/innobase/include/ut0ut.ic:
  Fixed compiler warnings on win64
storage/innobase/mtr/mtr0log.c:
  Fixed compiler warnings detected on windows64
storage/innobase/pars/pars0lex.l:
  Fixed warnings on win64
storage/innobase/rem/rem0cmp.c:
  Fixed compiler warnings detected on windows64
storage/innobase/row/row0mysql.c:
  Fixed compiler warnings detected on windows64
storage/innobase/row/row0sel.c:
  Fixed compiler warnings detected on windows64
storage/innobase/sync/sync0rw.c:
  Fixed compiler warnings detected on windows64
storage/innobase/trx/trx0trx.c:
  Fixed compiler warnings detected on windows64
storage/myisam/mi_log.c:
  my_thread_id() -> my_thread_debug_id()
storage/myisam/mi_packrec.c:
  Fixed compiler warnings detected on windows64
storage/myisam/myisamchk.c:
  Fixed compiler warnings from 'max' build
storage/ndb/src/common/debugger/EventLogger.cpp:
  Fixed compiler warnings
storage/ndb/src/common/util/ConfigValues.cpp:
  Removed compiler warnings
storage/ndb/src/common/util/NdbSqlUtil.cpp:
  Removed compiler warnings
storage/ndb/src/cw/cpcd/CPCD.hpp:
  Fixed compiler warnings
storage/ndb/src/kernel/blocks/backup/Backup.cpp:
  Fixed compiler warnings detected on windows64
storage/ndb/src/kernel/blocks/dbacc/Dbacc.hpp:
  Fixed compiler warnings detected on windows64
storage/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp:
  Fixed compiler warnings detected on windows64
storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp:
  Fixed compiler warnings
storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp:
  Fixed compiler warnings
storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp:
  Fixed compiler warnings
storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp:
  Fixed compiler warnings
storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp:
  Fixed compiler warnings
storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp:
  Fixed compiler warnings
storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp:
  Fixed compiler warnings
storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp:
  Fixed compiler warnings
storage/ndb/src/kernel/blocks/dbtup/DbtupFixAlloc.cpp:
  Fixed compiler warnings
storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp:
  Fixed compiler warnings
storage/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp:
  Fixed compiler warnings
storage/ndb/src/kernel/blocks/dbtup/DbtupScan.cpp:
  Fixed compiler warnings
storage/ndb/src/kernel/blocks/dbtup/DbtupVarAlloc.cpp:
  Fixed compiler warnings
storage/ndb/src/kernel/blocks/dbtup/tuppage.cpp:
  Fixed compiler warnings
storage/ndb/src/kernel/blocks/dbtup/tuppage.hpp:
  Fixed compiler warnings
storage/ndb/src/kernel/blocks/dbtux/DbtuxStat.cpp:
  Fixed compiler warnings
storage/ndb/src/kernel/blocks/diskpage.hpp:
  Fixed compiler warnings
storage/ndb/src/kernel/vm/ndbd_malloc.cpp:
  Fixed compiler warnings
storage/ndb/src/kernel/vm/ndbd_malloc_impl.cpp:
  Fixed compiler warnings
storage/ndb/src/mgmclient/main.cpp:
  Fixed compiler warnings
storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp:
  Fixed compiler warnings
storage/ndb/src/ndbapi/NdbOperationExec.cpp:
  Fixed compiler warnings
storage/ndb/src/ndbapi/SignalSender.cpp:
  Fixed compiler warnings
storage/ndb/tools/restore/consumer_restore.cpp:
  Fixed compiler warnings
strings/ctype-ucs2.c:
  Fixed compiler warnings
strings/ctype-utf8.c:
  Fixed compiler warnings
strings/decimal.c:
  Fixed compiler warnings
strings/my_strchr.c:
  Fixed conflict between function and prototype
support-files/compiler_warnings.supp:
  Ignore warnings from sql_yacc.cc that are hard to remove
  Ignore some not important warnings from windows 64 bit build
  Suppress warnings from bdb and (for the moment) warnings from ndb
  Suppress all warnings for all pushbuild platforms (should make all trees green)
vio/viosslfactories.c:
  Added DBUG_PRINT
BUILD/compile-pentium64-max:
  New BitKeeper file ``BUILD/compile-pentium64-max''
libmysqld/scheduler.cc:
  New BitKeeper file ``libmysqld/scheduler.cc''
libmysqld/sql_connect.cc:
  New BitKeeper file ``libmysqld/sql_connect.cc''
mysql-test/include/one_thread_per_connection.inc:
  New BitKeeper file ``mysql-test/include/one_thread_per_connection.inc''
mysql-test/r/no-threads.result:
  New BitKeeper file ``mysql-test/r/no-threads.result''
mysql-test/r/one_thread_per_connection.require:
  New BitKeeper file ``mysql-test/r/one_thread_per_connection.require''
mysql-test/t/no-threads-master.opt:
  New BitKeeper file ``mysql-test/t/no-threads-master.opt''
mysql-test/t/no-threads.test:
  New BitKeeper file ``mysql-test/t/no-threads.test''
sql/scheduler.cc:
  New BitKeeper file ``sql/scheduler.cc''
sql/scheduler.h:
  New BitKeeper file ``sql/scheduler.h''
sql/sql_connect.cc:
  New BitKeeper file ``sql/sql_connect.cc''
2007-02-23 13:13:55 +02:00
unknown
1f93b0c83a Merge mhansson@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  dl145s.mysql.com:/users/mhansson/mysql/autopush/5.0o-bug24010
2007-02-22 14:29:00 +01:00
unknown
ddb5a5636c Bug #24010: INSERT INTO ... SELECT fails on unique constraint with data
it doesn't select.

This bug was fixed along with bug #16861: User defined variable can 
have a wrong value if a tmp table was used.

There the fix consisted of Item_func_set_user_var overloading the method
Item::save_in_field. Consider the query from the test case:


INSERT INTO foo( bar, baz )
SELECT 
  bar,
  @newBaz := 1 + baz
FROM 
  foo
WHERE 
  quux <= 0.1;

Here the assignment expression '@newBaz := 1 + baz' is represented by an 
Item_func_set_user_var. Its member method save_in_field, which writes the 
value of this assignment into the result field, writes the val_xxx() value, 
which is not updated at this point. In the fix introduced by the patch,
the save_in_field method reads the actual variable value instead.

See also comment for 
ChangeSet@1.2368.1.3, 2007-01-09 23:24:56+03:00, evgen@moonbone.local +4 -0
and comment for
Item_func_set_user_var::save_in_field (item_func.cc)


mysql-test/r/update.result:
  BUG#24010
  The correct, and expected, result
mysql-test/t/update.test:
  BUG#24010
  The test case for this bug. When the bug is active, the INSERT ... SELECT 
  statement will try to insert the values <1, 2> which gives an error
2007-02-22 14:11:01 +01:00
unknown
a1234294c6 Merge moonbone.local:/mnt/gentoo64/work/bk-trees/mysql-5.0-opt
into  moonbone.local:/mnt/gentoo64/work/23800-bug1-5.0-opt-mysql


sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sql_select.cc:
  Auto merged
2007-02-21 23:18:17 +03:00
unknown
f8855142d7 Bug#23800: Outer fields in correlated subqueries is used in a temporary table
created for sorting.

Any outer reference in a subquery was represented by an Item_field object.
If the outer select employs a temporary table all such fields should be
replaced with fields from that temporary table in order to point to the 
actual data. This replacement wasn't done and that resulted in a wrong
subquery evaluation and a wrong result of the whole query.

Now any outer field is represented by two objects - Item_field placed in the
outer select and Item_outer_ref in the subquery. Item_field object is
processed as a normal field and the reference to it is saved in the
ref_pointer_array. Thus the Item_outer_ref is always references the correct
field. The original field is substituted for a reference in the
Item_field::fix_outer_field() function.

New function called fix_inner_refs() is added to fix fields referenced from
inner selects and to fix references (Item_ref objects) to these fields.

The new Item_outer_ref class is a descendant of the Item_direct_ref class.
It additionally stores a reference to the original field and designed to
behave more like a field.


sql/item.cc:
  Bug#23800: Correlated sub query returning incorrect results when operated upon.
  Now all outer fields are substituted with references to them (Item_outer_ref objects)
  in the Item_field::fix_outer_field() function.
  The original field is saved in the Item_outer_ref object.
sql/item.h:
  Bug#23800: Correlated sub query returning incorrect results when operated upon.
  Added the Item_outer_ref class.
sql/mysql_priv.h:
  Bug#23800: Correlated sub query returning incorrect results when operated upon.
  Added the fix_inner_refs() function prototype.
sql/sql_delete.cc:
  Bug#23800: Correlated sub query returning incorrect results when operated upon.
  Added call to the fix_inner_refs() function.
sql/sql_select.cc:
  Bug#23800: Correlated sub query returning incorrect results when operated upon.
  The new function called fix_inner_refs() is added.
mysql-test/r/subselect.result:
  Added a test case for bug#23800: Correlated sub query returning incorrect results when
  operated upon.
sql/sql_update.cc:
  Bug#23800: Correlated sub query returning incorrect results when operated upon.
  Added call to the fix_inner_refs() function.
mysql-test/r/subselect3.result:
  Corrected test cases result after fix for bug#23800: Correlated sub query returning
  incorrect results when operated upon.
mysql-test/t/subselect.test:
  Added a test case for bug#23800: Correlated sub query returning incorrect results when
  operated upon.
sql/sql_lex.cc:
  Bug#23800: Correlated sub query returning incorrect results when operated upon.
  Added cleanup of the inner_refs_list.
sql/sql_lex.h:
  Bug#23800: Correlated sub query returning incorrect results when operated upon.
  The inner_refs_list is added to the SELECT_LEX class.
2007-02-21 23:00:32 +03:00
unknown
1384e64005 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/my/mysql-5.0


BitKeeper/etc/ignore:
  auto-union
BUILD/SETUP.sh:
  Auto merged
Makefile.am:
  Auto merged
client/mysql.cc:
  Auto merged
cmd-line-utils/readline/display.c:
  Auto merged
configure.in:
  Auto merged
extra/yassl/include/buffer.hpp:
  Auto merged
extra/yassl/include/crypto_wrapper.hpp:
  Auto merged
extra/yassl/include/yassl_imp.hpp:
  Auto merged
extra/yassl/include/yassl_int.hpp:
  Auto merged
extra/yassl/src/crypto_wrapper.cpp:
  Auto merged
extra/yassl/taocrypt/include/algebra.hpp:
  Auto merged
extra/yassl/taocrypt/include/des.hpp:
  Auto merged
extra/yassl/taocrypt/include/hash.hpp:
  Auto merged
extra/yassl/taocrypt/include/hmac.hpp:
  Auto merged
extra/yassl/taocrypt/include/modarith.hpp:
  Auto merged
extra/yassl/taocrypt/include/modes.hpp:
  Auto merged
extra/yassl/taocrypt/include/rsa.hpp:
  Auto merged
extra/yassl/taocrypt/include/type_traits.hpp:
  Auto merged
extra/yassl/taocrypt/mySTL/list.hpp:
  Auto merged
extra/yassl/taocrypt/src/aes.cpp:
  Auto merged
extra/yassl/taocrypt/src/algebra.cpp:
  Auto merged
extra/yassl/testsuite/testsuite.cpp:
  Auto merged
include/my_global.h:
  Auto merged
include/my_pthread.h:
  Auto merged
libmysqld/lib_sql.cc:
  Auto merged
myisam/mi_open.c:
  Auto merged
mysql-test/mysql-test-run.pl:
  Auto merged
mysql-test/r/mysqltest.result:
  Auto merged
mysql-test/t/mysqltest.test:
  Auto merged
mysys/default.c:
  Auto merged
ndb/src/common/transporter/Transporter.cpp:
  Auto merged
ndb/src/common/util/File.cpp:
  Auto merged
ndb/src/common/util/SocketClient.cpp:
  Auto merged
ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp:
  Auto merged
ndb/src/kernel/blocks/dbtc/Dbtc.hpp:
  Auto merged
ndb/src/kernel/blocks/qmgr/Qmgr.hpp:
  Auto merged
ndb/src/kernel/blocks/qmgr/QmgrMain.cpp:
  Auto merged
ndb/src/mgmapi/mgmapi.cpp:
  Auto merged
ndb/src/mgmclient/CommandInterpreter.cpp:
  Auto merged
ndb/src/mgmsrv/ConfigInfo.cpp:
  Auto merged
ndb/src/mgmsrv/MgmtSrvr.cpp:
  Auto merged
ndb/src/ndbapi/ClusterMgr.hpp:
  Auto merged
ndb/src/ndbapi/Ndb.cpp:
  Auto merged
ndb/src/ndbapi/NdbScanOperation.cpp:
  Auto merged
ndb/src/ndbapi/SignalSender.cpp:
  Auto merged
sql/field.cc:
  Auto merged
sql/filesort.cc:
  Auto merged
sql/ha_myisammrg.cc:
  Auto merged
sql/handler.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_cmpfunc.h:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_strfunc.cc:
  Auto merged
sql/item_subselect.h:
  Auto merged
sql/item_sum.cc:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/net_serv.cc:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/opt_range.h:
  Auto merged
sql/repl_failsafe.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/set_var.h:
  Auto merged
sql/slave.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_prepare.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_union.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
sql-common/client.c:
  Auto merged
sql/sql_view.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/table.cc:
  Auto merged
sql/unireg.cc:
  Auto merged
extra/yassl/taocrypt/src/asn.cpp:
  Manual merge (Fix shadowed variable name)
extra/yassl/taocrypt/test/test.cpp:
  No changes
ndb/src/common/util/ConfigValues.cpp:
  Manual merge (Fix shadowed variable name)
sql/field.h:
  manual merge
sql/ha_myisam.cc:
  manual merge
sql/ha_ndbcluster.cc:
  manual merge
sql/item_cmpfunc.cc:
  manual merge
sql/item_subselect.cc:
  Manual merge (Fix shadowed variable name)
sql/mysqld.cc:
  no changes
2007-02-21 14:07:08 +02:00
unknown
2f3a17b63e Fixed unsafe define of uint4korr()
Fixed that --extern works with mysql-test-run.pl
Small trivial cleanups


include/my_global.h:
  Fixed unsafe define of uint4korr()
mysql-test/lib/mtr_report.pl:
  Removed wrong messages when using --extern
mysql-test/mysql-test-run.pl:
  Fixed that --extern works
  Print help on stdout instead of stderr (make it easier to pipe it to less)
mysql-test/t/ndb_lock.test:
  Added other possible error code
sql/sql_prepare.cc:
  Removed not needed casts
2007-02-21 13:02:57 +02:00
unknown
a06fe4abde Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  rakia.gmz:/home/kgeorge/mysql/autopush/B19717-5.0-opt
2007-02-19 17:35:19 +02:00
unknown
3f9876d77e Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  rakia.gmz:/home/kgeorge/mysql/autopush/B19717-5.0-opt
2007-02-19 15:45:01 +02:00
unknown
6d537f01fd Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  rakia.gmz:/home/kgeorge/mysql/autopush/B25831-5.0-opt


sql/item.h:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_prepare.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
2007-02-19 14:47:16 +02:00
unknown
a97fd19371 Bug #25831: Deficiencies in INSERT ... SELECT ... field name resolving.
Several problems fixed: 
  1. There was a "catch-all" context initialization in setup_tables()
    that was causing the table that we insert into to be visible in the 
    SELECT part of an INSERT .. SELECT .. statement with no tables in
    its FROM clause. This was making sure all the under-initialized
    contexts in various parts of the code are not left uninitialized.
    Fixed by removing the "catch-all" statement and initializing the 
    context in the parser.
  2. Incomplete name resolution context when resolving the right-hand
    values in the ON DUPLICATE KEY UPDATE ... part of an INSERT ... SELECT ...
    caused columns from NATURAL JOIN/JOIN USING table references in the
    FROM clause of the select to be unavailable.
    Fixed by establishing a proper name resolution context.
  3. When setting up the special name resolution context for problem 2
    there was no check for cases where an aggregate function without a
    GROUP BY effectively takes the column from the SELECT part of an 
    INSERT ... SELECT unavailable for ON DUPLICATE KEY UPDATE.
    Fixed by checking for that condition when setting up the name 
    resolution context.


mysql-test/r/insert_update.result:
  Bug #25831: Deficiencies in INSERT ... SELECT ... field name resolving.
   - test case
mysql-test/t/insert_update.test:
  Bug #25831: Deficiencies in INSERT ... SELECT ... field name resolving.
   - test case
sql/item.h:
  Bug #25831: Deficiencies in INSERT ... SELECT ... field name resolving.
   - save_next_local is not referenced any more outside class methods
sql/sql_base.cc:
  Bug #25831: Deficiencies in INSERT ... SELECT ... field name resolving.
   - removed a "catch-all" code to cater for correct context initialization
sql/sql_help.cc:
  Bug #25831: Deficiencies in INSERT ... SELECT ... field name resolving.
   - fixed the name resolution context initialization
sql/sql_insert.cc:
  Bug #25831: Deficiencies in INSERT ... SELECT ... field name resolving.
   - Fixed the context of resolving the values in INSERT SELECT ON UPDATE
sql/sql_prepare.cc:
  Bug #25831: Deficiencies in INSERT ... SELECT ... field name resolving.
   - Correct context for name resolution of prepared INSERT .. SELECT
sql/sql_union.cc:
  Bug #25831: Deficiencies in INSERT ... SELECT ... field name resolving.
   - fixed the name resolution context initialization
sql/sql_yacc.yy:
  Bug #25831: Deficiencies in INSERT ... SELECT ... field name resolving.
   - Set the context here instead of setup_tables()
2007-02-19 14:39:37 +02:00
unknown
4b51bbde8c Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  olga.mysql.com:/home/igor/mysql-5.0-opt


sql/sql_select.cc:
  Auto merged
2007-02-16 09:39:08 -08:00
unknown
98f87d9702 Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  moonbone.local:/mnt/gentoo64/work/16630-bug-5.0-opt-mysql


sql/item.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
2007-02-16 19:44:54 +03:00
unknown
d5813a06f6 Bug#16630: The update fields of the INSERT .. SELECT .. ON DUPLICATE KEY
UPDATE contains wrong data if the SELECT employs a temporary table.

If the UPDATE values of the INSERT .. SELECT .. ON DUPLICATE KEY UPDATE
statement contains fields from the SELECT part and the select employs a
temporary table then those fields will contain wrong values because they
aren't corrected to get data from the temporary table.

The solution is to add these fields to the selects all_fields list,
to store pointers to those fields in the selects ref_pointer_array and
to access them via Item_ref objects.

The substitution for Item_ref objects is done in the new function called 
Item_field::update_value_transformer(). It is called through the
item->transform() mechanism at the end of the select_insert::prepare()
function.


sql/item.cc:
  Bug#16630: The update fields of the INSERT .. SELECT .. ON DUPLICATE KEY
  UPDATE contains wrong data if the SELECT employs a temporary table.
  The new method Item_field::update_value_transformer() is added. It
  substitutes fields in the update values list for references 
  (Item_ref objects) to them.
sql/item.h:
  Bug#16630: The update fields of the INSERT .. SELECT .. ON DUPLICATE KEY
  UPDATE contains wrong data if the SELECT employs a temporary table.
  The update_value_transformer() method is added to the Item and to the
  Item_field classes.
sql/sql_insert.cc:
  Bug#16630: The update fields of the INSERT .. SELECT .. ON DUPLICATE KEY
  UPDATE contains wrong data if the SELECT employs a temporary table.
  Traverse update values and substitute fields from the select for
  references (Item_ref objects) to them.
sql/sql_select.cc:
  Bug#16630: The update fields of the INSERT .. SELECT .. ON DUPLICATE KEY
  UPDATE contains wrong data if the SELECT employs a temporary table.
  Traverse update values and substitute fields from the select for
  references (Item_ref objects) to them.
mysql-test/r/insert_select.result:
  Added a test case for bug#16630: The update fields of the INSERT .. SELECT ..
  ON DUPLICATE KEY UPDATE contains wrong data if the SELECT employs a 
  temporary table.
mysql-test/t/insert_select.test:
  Added a test case for bug#16630: The update fields of the INSERT .. SELECT ..
  ON DUPLICATE KEY UPDATE contains wrong data if the SELECT employs a 
  temporary table.
2007-02-16 19:39:28 +03:00
unknown
5b64b12c7f Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.1-opt
into  rakia.gmz:/home/kgeorge/mysql/autopush/B20420-5.1-opt


mysql-test/r/func_in.result:
  Auto merged
mysql-test/t/func_in.test:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_cmpfunc.h:
  Auto merged
sql/opt_range.cc:
  Auto merged
2007-02-16 14:05:09 +02:00
unknown
652a090a6f BUG#20420: optimizer reports wrong keys on left join with IN
When checking if an IN predicate can be evaluated using a key
 the optimizer makes sure that all the arguments of IN are of
 the same result type. To assure that it check whether 
 Item_func_in::array is filled in. 
 However Item_func_in::array is set if the types are
 the same AND all the arguments are compile time constants.
 Fixed by introducing Item_func_in::arg_types_compatible
 flag to allow correct checking of the desired condition.


mysql-test/r/func_in.result:
  BUG#20420: optimizer reports wrong keys on left join with IN
   - reenabled the test case
mysql-test/t/func_in.test:
  BUG#20420: optimizer reports wrong keys on left join with IN
   - reenabled the test case
sql/item_cmpfunc.cc:
  BUG#20420: optimizer reports wrong keys on left join with IN
   Check the IN argument types in a correct way
sql/item_cmpfunc.h:
  BUG#20420: optimizer reports wrong keys on left join with IN
   Check the IN argument types in a correct way
sql/opt_range.cc:
  BUG#20420: optimizer reports wrong keys on left join with IN
   Check the IN argument types in a correct way
2007-02-16 13:56:06 +02:00
unknown
af71cac0e4 Manual merge from 5.0-rpl, of fixes for:
1)
  BUG#25507 "multi-row insert delayed + auto increment causes
  duplicate key entries on slave" (two concurrrent connections doing
  multi-row INSERT DELAYED to insert into an auto_increment column,
  caused replication slave to stop with "duplicate key error" (and
  binlog was wrong), and BUG#26116 "If multi-row INSERT
  DELAYED has errors, statement-based binlogging breaks" (the binlog
  was not accounting for all rows inserted, or slave could stop).
  The fix is that: in statement-based binlogging, a multi-row INSERT
  DELAYED is silently converted to a non-delayed INSERT.
  This is supposed to not affect many 5.1 users as in 5.1, the default
  binlog format is "mixed", which does not have the bug (the bug is
  only with binlog_format=STATEMENT).
  We should document how the system delayed_insert thread decides of
  its binlog format (which is not modified by this patch):
  this decision is taken when the thread is created
  and holds until it is terminated (is not affected by any later change
  via SET GLOBAL BINLOG_FORMAT). It is also not affected by the binlog
  format of the connection which issues INSERT DELAYED (this binlog
  format does not affect how the row will be binlogged).
  If one wants to change the binlog format of its server with SET
  GLOBAL BINLOG_FORMAT, it should do FLUSH TABLES to be sure all
  delayed_insert threads terminate and thus new threads are created,
  taking into account the new format.
2)
  BUG#24432
  "INSERT... ON DUPLICATE KEY UPDATE skips auto_increment values".
  When in an INSERT ON DUPLICATE KEY UPDATE, using
  an autoincrement column, we inserted some autogenerated values and
  also updated some rows, some autogenerated values were not used
  (for example, even if 10 was the largest autoinc value in the table
  at the start of the statement, 12 could be the first autogenerated
  value inserted by the statement, instead of 11). One autogenerated
  value was lost per updated row. Led to exhausting the range of the
  autoincrement column faster.
  Bug introduced by fix of BUG#20188; present since 5.0.24 and 5.1.12.
  This bug breaks replication from a pre-5.0.24/pre-5.1.12 master.
  But the present bugfix, as it makes INSERT ON DUP KEY UPDATE
  behave like pre-5.0.24/pre-5.1.12, breaks replication from a
  [5.0.24,5.0.34]/[5.1.12,5.1.15]
  master to a fixed (5.0.36/5.1.16) slave! To warn users against this when
  they upgrade their slave, as agreed with the support team, we add
  code for a fixed slave to detect that it is connected to a buggy
  master in a situation (INSERT ON DUP KEY UPDATE into autoinc column)
  likely to break replication, in which case it cannot replicate so
  stops and prints a message to the slave's error log and to SHOW SLAVE
  STATUS.
  For 5.0.36->[5.0.24,5.0.34] replication or 5.1.16->[5.1.12,5.1.15]
  replication we cannot warn as master
  does not know the slave's version (but we always recommended to users
  to have slave at least as new as master).
  As agreed with support, I have asked for an alert to be put into
  the MySQL Network Monitoring and Advisory Service.
3) note that I'll re-enable rpl_insert_id as soon as 5.1-rpl gets
  the changes from the main 5.1.


BitKeeper/deleted/.del-rpl_insert_delayed.result:
  Delete: mysql-test/r/rpl_insert_delayed.result
mysql-test/extra/rpl_tests/rpl_insert_delayed.test:
  tests for BUG#25507 (lauch many concurrent INSERT DELAYED into an auto_inc
  column and see if they cause duplicates) and BUG#26116 (see if one error
  at first row on master makes the slave's data incorrect).
  It is then incorporated into a statement-based and mixed binlogging
  test, and into a row-based test.
  It is in fact mysql-test/t/rpl_insert_delayed.test from 5.0, renamed
  and extended to test BUG#25507.
mysql-test/extra/rpl_tests/rpl_insert_id.test:
  manual merge of test for BUG#24432
  "INSERT... ON DUPLICATE KEY UPDATE skips auto_increment values"
  from 5.0
mysql-test/r/rpl_insert_id.result:
  result update (it automerged from 5.0, contrary to the test file)
mysql-test/r/rpl_known_bugs_detection.result:
  result update (binlog event sizes differ from 5.0)
mysql-test/t/disabled.def:
  rpl_insert_id tests statement-based replication of INSERT ON
  DUPLICATE KEY UPDATE. This type of INSERT had BUG#24432, which is
  fixed in 5.1.16; we made the slave detect if it is connected to a
  <5.1.16 master and if so refuse to replicate.
  The problem is that this 5.1-rpl tree, even though it will produce
  the 5.1.16 release, still has a 5.1.15 version in configure.in.
  Thus rpl_insert_id fails. So I disable it. As soon as the 5.1-rpl
  tree gets the changesets from the main 5.1, its version will change
  to 5.1.16 and so I'll be able to re-enable the test.
mysql-test/t/rpl_known_bugs_detection.test:
  only in statement-based; row-based has no bug so test would fail.
sql/slave.cc:
  slave_print_msg(ERROR_LEVEL) calls my_error(ER_UNKNOWN_ERROR);
  so, for our my_printf_error(), which has a nicer message than this
  my_error(), to have any effect, it must be 
  called before slave_print_msg()
sql/sql_insert.cc:
  manual merge from 5.0 of a piece of the fixes for
  BUG#24432 "INSERT... ON DUPLICATE KEY UPDATE skips auto_increment values"
  BUG#25507 "multi-row insert delayed + auto increment causes
  duplicate key entries on slave"
  BUG#26116 "If multi-row INSERT DELAYED has errors, statement-based
  binlogging breaks".
  The other pieces (e.g. log_event.cc) automerged from 5.0.
mysql-test/r/rpl_row_insert_delayed.result:
  result
mysql-test/r/rpl_stm_insert_delayed.result:
  result. Note how "mixed" and "statement" insert different data in
  the table.
mysql-test/t/rpl_row_insert_delayed.test:
  wrapper to test INSERT DELAYED binlogging in row-based mode
mysql-test/t/rpl_stm_insert_delayed.test:
  wrapper to test INSERT DELAYED binlogging in statement-based and mixed
  mode
2007-02-15 20:28:58 +01:00
unknown
3ecd96ee97 Merge gbichot3.local:/home/mysql_src/mysql-5.0-rpl-25507
into  gbichot3.local:/home/mysql_src/mysql-5.1-rpl-25507


mysql-test/r/rpl_insert_id.result:
  Auto merged
sql/log.cc:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/log_event.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/slave.cc:
  Auto merged
sql/slave.h:
  Auto merged
mysql-test/t/rpl_insert_id.test:
  will merge by hand
sql/sql_insert.cc:
  will fix by hand
2007-02-15 16:05:22 +01:00
unknown
f6834c02ca Fix for BUG#25507 "multi-row insert delayed + auto increment causes
duplicate key entries on slave" (two concurrrent connections doing
multi-row INSERT DELAYED to insert into an auto_increment column,
caused replication slave to stop with "duplicate key error" (and
binlog was wrong)), and BUG#26116 "If multi-row INSERT
DELAYED has errors, statement-based binlogging breaks" (the binlog
was not accounting for all rows inserted, or slave could stop).
The fix is that: if (statement-based) binlogging is on, a multi-row
INSERT DELAYED is silently converted to a non-delayed INSERT.
Note: it is not possible to test BUG#25507 in 5.0 (requires mysqlslap),
so it is tested only in the changeset for 5.1. However, BUG#26116
is tested here, and the fix for BUG#25507 is the same code change.


mysql-test/r/innodb-replace.result:
  result update
mysql-test/t/innodb-replace.test:
  now that multi-row delayed inserts are converted to normal inserts
  if the statement-based binlog is enabled,
  no error is issued even if this engine does not support INSERT DELAYED,
  as the insert does not go through the INSERT DELAYED code.
  To preserve the goal of this test, we change the statements to single-
  row inserts.
sql/sql_insert.cc:
  A multi-row INSERT DELAYED cannot be recorded to a statement-based
  binlog in a way that describes the insertions actually done;
  in that case we fallback to a non-delayed INSERT.
mysql-test/r/rpl_insert_delayed.result:
  result. Master and slave match.
mysql-test/t/rpl_insert_delayed.test:
  Test for BUG#26116 (see if one error at first row on master makes the
  slave's data incorrect, see if one error at second row on master
  makes slave stop).
2007-02-15 15:39:03 +01:00
unknown
6ae94723ca Fixed bug #25971: indexes on text columns were ignored when ref accesses
were evaluated.
According to the new rules for string comparison partial indexes on text
columns can be used in the same cases when partial indexes on varchar
columns can be used.


mysql-test/r/endspace.result:
  Adjusted results after the fix for bug #25971.
mysql-test/r/innodb.result:
  Adjusted results after the fix for bug #25971.
mysql-test/r/myisam.result:
  Adjusted results after the fix for bug #25971.
mysql-test/r/select.result:
  Added a test case for bug #25971.
mysql-test/r/type_blob.result:
  Adjusted results after the fix for bug #25971.
mysql-test/t/select.test:
  Added a test case for bug #25971.
2007-02-14 22:06:41 -08:00
unknown
6c8b5256c6 Bug#19717: The blackhole engine is returning an OK flag in
index_read(), whereas it must return HA_ERR_END_OF_FILE
instead (as there are by definition no rows in a table of 
that engine.


mysql-test/r/blackhole.result:
  Bug#19717: test case
mysql-test/t/blackhole.test:
  Bug#19717: test case
sql/ha_blackhole.cc:
  Bug#19717: return no rows instead of success.
2007-02-14 18:35:59 +02:00
unknown
69112d0132 Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into  chilla.local:/home/mydev/mysql-5.1-axmrg


mysys/my_pthread.c:
  Auto merged
2007-02-14 13:39:59 +01:00
unknown
4036bd9e03 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  chilla.local:/home/mydev/mysql-5.0-axmrg


mysys/my_pthread.c:
  SCCS merged
2007-02-14 12:02:58 +01:00