Commit graph

24311 commits

Author SHA1 Message Date
unknown
232481e477 Merge zippy.cornsilk.net:/home/cmiller/work/mysql/bug26703/my51-bug26703
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.1-build
2008-03-12 16:15:34 -04:00
unknown
054341a6d0 Fix manual merge. 2008-03-12 23:07:10 +03:00
unknown
b5978a9424 Bug#26703: DROP DATABASE fails if database contains a #mysql50# \
table with backticks

(Thanks to Lu Jingdong, though I did not take his patch directly, as
it contained a significant flaw.)

It wasn't a backtick/parsing problem.  We merely didn't anticipate
and allocate enough space to handle the optional "#mysql50#" table-
name prefix. 

Now, allocate that extra space in case we need it when we look up 
a legacy table to get its file's name.


mysql-test/r/drop.result:
  Verify that databases with old-style files can be removed.
mysql-test/t/drop.test:
  Verify that databases with old-style files can be removed.
sql/sql_db.cc:
  Extend the size of the memory that holds the table's name, so that
  the legacy "mysql50" prefix fits.
2008-03-12 12:40:12 -04:00
unknown
b279be388e Fix for Bug#33507: Event scheduler creates more threads
than max_connections -- which results in user lockout.

The problem was that the variable thread_count that contains
the number of active threads was interpreted as a number of
active connections.

The fix is to introduce a new counter for active connections.


mysql-test/r/connect.result:
  A test case for Bug#33507: Event scheduler creates more threads
  than max_connections -- which results in user lockout.
mysql-test/t/connect.test:
  A test case for Bug#33507: Event scheduler creates more threads
  than max_connections -- which results in user lockout.
sql/mysql_priv.h:
  1. Polishing: login_connection() and end_connection() need not
     to be public.
  
  2. Introduce connection_count -- a variable to contain the number
     of active connections. It is protected by LOCK_connection_count.
sql/mysqld.cc:
  Use connection_count to count active connections.
sql/sql_connect.cc:
  1. Use connection_count to count active connections.
  2. Make login_connection(), end_connection() private for the module
  as they had to be.
2008-03-12 17:44:40 +03:00
unknown
d80e7ce4e5 Fix manual merge. 2008-03-12 16:50:24 +03:00
unknown
d958f2984f Merge quad.:/mnt/raid/alik/MySQL/devel/5.0-rt
into  quad.:/mnt/raid/alik/MySQL/devel/5.1-rt-merged


sql/sql_delete.cc:
  Manually merged.
2008-03-12 16:29:00 +03:00
unknown
326c4e9058 A fix for Bug#34643: TRUNCATE crash if trigger and foreign key.
In cases when TRUNCATE was executed by invoking mysql_delete() rather
than by table recreation (for example, when TRUNCATE was issued on
InnoDB table with is referenced by foreign key) triggers were invoked.
In debug builds this also led to crash because of an assertion, which
assumes that some preliminary actions take place before trigger 
invocation, which doesn't happen in case of TRUNCATE.

The fix is not to execute triggers in mysql_delete() when this
function is used by TRUNCATE.


mysql-test/r/trigger-trans.result:
  Update result file.
mysql-test/t/trigger-trans.test:
  A test case for Bug#34643: TRUNCATE crash if trigger and foreign key.
sql/sql_delete.cc:
  Do not process triggers in TRUNCATE.
2008-03-12 16:13:33 +03:00
unknown
6c2f9bf5e1 Merge ssh://bk-internal.mysql.com//home/bk/mysql-5.1-opt
into  kaamos.(none):/data/src/opt/mysql-5.1-opt


sql/sql_show.cc:
  Auto merged
sql/table.h:
  Auto merged
2008-03-12 13:56:50 +03:00
unknown
d6df18dd33 Merge kaamos.(none):/data/src/mysql-5.1
into  kaamos.(none):/data/src/opt/mysql-5.1-opt


client/mysql.cc:
  Auto merged
client/mysqldump.c:
  Auto merged
configure.in:
  Auto merged
include/my_global.h:
  Auto merged
libmysql/libmysql.c:
  Auto merged
libmysqld/lib_sql.cc:
  Auto merged
mysql-test/include/mix1.inc:
  Auto merged
mysql-test/r/create.result:
  Auto merged
mysql-test/r/func_str.result:
  Auto merged
mysql-test/r/innodb.result:
  Auto merged
mysql-test/r/innodb_mysql.result:
  Auto merged
mysql-test/r/select.result:
  Auto merged
mysql-test/r/subselect.result:
  Auto merged
mysql-test/t/create.test:
  Auto merged
mysql-test/t/disabled.def:
  Auto merged
sql/filesort.cc:
  Auto merged
sql/handler.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_func.h:
  Auto merged
sql/item_sum.cc:
  Auto merged
sql/log.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sp.cc:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_plugin.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
storage/ndb/src/kernel/blocks/backup/Backup.hpp:
  Auto merged
tests/mysql_client_test.c:
  Auto merged
mysql-test/r/func_time.result:
  Manual merge.
mysql-test/r/view.result:
  Manual merge.
mysql-test/t/view.test:
  Manual merge.
scripts/mysql_config.sh:
  Manual merge.
sql-common/client.c:
  Manual merge.
sql/sql_parse.cc:
  Manual merge.
2008-03-12 11:19:46 +03:00
unknown
09f8a4af63 Merge kaamos.(none):/data/src/mysql-5.0
into  kaamos.(none):/data/src/opt/mysql-5.0-opt


client/mysql.cc:
  Auto merged
sql/filesort.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
tests/mysql_client_test.c:
  Auto merged
mysql-test/r/view.result:
  Manual merge.
mysql-test/t/view.test:
  Manual merge.
scripts/mysql_config.sh:
  Manual merge.
2008-03-12 10:59:15 +03:00
unknown
1836625fb4 BUG#31024: STOP SLAVE does not stop attempted connect()s
Problem: if the IO slave thread is attempting to connect,
STOP SLAVE waits for the attempt to finish. 
It may take a long time.
Fix: don't wait, stop the slave immediately.


sql/slave.cc:
  Send a SIGALRM signal to the slave thread when stopping it (using
  pthread_kill()). This breaks current socket(), connect(), poll() etc.
  calls, and makes the subsequent thd->awake() call effective.
  
  Also, move the definition of KICK_SLAVE to slave.cc.
sql/sql_repl.h:
  Removed KICK_SLAVE and inlined it in slave.cc because:
   - it was only called once, so better to make it local to where it is used
   - it needed to include a preprocessor conditional in the middle
2008-03-11 14:42:54 +01:00
unknown
a5e775b4d6 Merge kaamos.(none):/data/src/opt/mysql-5.0-opt
into  kaamos.(none):/data/src/opt/mysql-5.1-opt


mysql-test/r/func_misc.result:
  Auto merged
mysql-test/r/null_key.result:
  Auto merged
mysql-test/t/func_misc.test:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/sql_select.cc:
  Manual merge.
2008-03-11 15:47:16 +03:00
unknown
f9bbd7533c Merge mhansson@bk-internal:/home/bk/mysql-5.1-opt
into  riffraff.(none):/data0/martin/bug34367/my51-bug34367-pushee
2008-03-11 11:31:59 +01:00
unknown
269ccba9e7 Merge adventure.(none):/home/thek/Development/cpp/bug25132/my50-bug25132
into  adventure.(none):/home/thek/Development/cpp/mysql-5.1-runtime


sql/sql_cache.cc:
  Auto merged
mysql-test/r/query_cache.result:
  Manual merge
mysql-test/t/query_cache.test:
  Manual merge
2008-03-10 16:46:38 +01:00
unknown
ec62aba3f0 Bug#34731: highest possible value for INT erroneously filtered by WHERE
WHERE f1 < n ignored row if f1 was indexed integer column and
f1 = TYPE_MAX ^ n = TYPE_MAX+1. The latter value when treated
as TYPE overflowed (obviously). This was not handled, it is now.


mysql-test/r/range.result:
  show that on an index int column, we no longer disregard
  a field val of TYPE_MAX in SELECT ... WHERE ... < TYPE_MAX+1
mysql-test/t/range.test:
  show that on an index int column, we no longer disregard
  a field val of TYPE_MAX in SELECT ... WHERE ... < TYPE_MAX+1
sql/opt_range.cc:
  Handle overflowing of int-types in range-optimizer.
  Unfortunately requires re-indentation of entire block.
  Overflow (err == 1) was handled, but only if
  field->cmp_type() != value->result_type(), which it
  just wasn't in our case.
2008-03-10 11:12:12 +01:00
unknown
ccf7f74e52 Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.1-opt
into  mysql.com:/misc/mysql/34749/51-34749


mysql-test/r/func_misc.result:
  Auto merged
mysql-test/t/func_misc.test:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_func.h:
  Auto merged
2008-03-10 07:39:04 +01:00
unknown
0abcb8ca5e Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  mysql.com:/misc/mysql/34749/50-34749


mysql-test/r/func_misc.result:
  Auto merged
mysql-test/t/func_misc.test:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
2008-03-10 07:11:12 +01:00
unknown
111de516ab Merge mysql.com:/misc/mysql/34749/50-34749
into  mysql.com:/misc/mysql/34749/51-34749


mysql-test/r/func_misc.result:
  Auto merged
mysql-test/t/func_misc.test:
  Auto merged
sql/ha_ndbcluster_cond.cc:
  Auto merged
sql/ha_ndbcluster_cond.h:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_func.h:
  Auto merged
2008-03-10 07:07:56 +01:00
unknown
319cd7e494 Merge kaamos.(none):/data/src/opt/bug34889/my50
into  kaamos.(none):/data/src/opt/mysql-5.0-opt
2008-03-08 14:20:55 +03:00
unknown
7b5da0aa77 Merge pcg5ppc.xiphis.org:/Network/Servers/anubis.xiphis.org/home/antony/work/mysql-5.1-engines
into  pcg5ppc.xiphis.org:/Network/Servers/anubis.xiphis.org/home/antony/work/merge.20080307/mysql-5.1


configure.in:
  Auto merged
include/mysql/plugin.h:
  Auto merged
mysql-test/r/information_schema.result:
  Auto merged
mysql-test/r/partition_innodb.result:
  Auto merged
mysql-test/t/information_schema.test:
  Auto merged
mysql-test/t/partition_innodb.test:
  Auto merged
sql/item.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_func.h:
  Auto merged
sql/log.cc:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/repl_failsafe.cc:
  Auto merged
sql/slave.cc:
  Auto merged
sql/slave.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_partition.cc:
  Auto merged
sql/sql_plugin.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
storage/myisam/mi_dynrec.c:
  Auto merged
2008-03-07 13:46:29 -08:00
unknown
1e8b11c656 Merge pcg5ppc.xiphis.org:/Network/Servers/anubis.xiphis.org/home/antony/work/mysql-5.0-engines
into  pcg5ppc.xiphis.org:/Network/Servers/anubis.xiphis.org/home/antony/work/merge.20080307/mysql-5.0


sql/item.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
2008-03-07 13:41:11 -08:00
unknown
e0075179c3 Merge mysql.com:/home/svoj/devel/mysql/BUG34656/mysql-5.1-engines
into  mysql.com:/home/svoj/devel/mysql/BUG13861/mysql-5.1-engines
2008-03-07 21:22:39 +04:00
unknown
928c449ad2 Merge mysql.com:/home/svoj/devel/bk/mysql-5.1-engines
into  mysql.com:/home/svoj/devel/mysql/BUG13861/mysql-5.1-engines
2008-03-07 21:20:49 +04:00
unknown
e78f628499 Merge mysql.com:/home/svoj/devel/bk/mysql-5.0-engines
into  mysql.com:/home/svoj/devel/mysql/BUG13861/mysql-5.0-engines
2008-03-07 21:19:30 +04:00
unknown
44df0f6e9c BUG#34656 - KILL a query = Assertion failed: m_status == DA_ERROR ||
m_status == DA_OK

Reading from information_scema.tables or information_schema.columns
may cause assertion failure in debug builds. This may happen under
rare circumstances when information_schema fails to get information
about a table (e.g. when a connection is killed).

This happens because open_normal_and_derived_tables() can return an
error without setting an error message in THD. But information_schema
attempts to get an error message from THD unconditionally.

With this fix information_schema attempts to get an error message
from THD only in case error message is set in THD.


mysql-test/r/information_schema.result:
  A test case for BUG#34656.
mysql-test/t/information_schema.test:
  A test case for BUG#34656.
sql/item_func.cc:
  Set proc info to "User sleep".
sql/sql_show.cc:
  open_normal_and_derived_tables() can return an error without
  setting an error message in THD. That means we must access
  error message conditionally, only in case thd->is_error() is
  true.
2008-03-07 18:41:50 +04:00
unknown
875ad6d8b8 BUG#31168: @@hostname does not replicate
Problem: in mixed and statement mode, a query that refers to a
system variable will use the slave's value when replayed on
slave. So if the value of a system variable is inserted into a
table, the slave will differ from the master.
Fix: mark statements that refer to a system variable as "unsafe",
meaning they will be replicated by row in mixed mode and produce a warning
in statement mode. There are some exceptions: some variables are actually
replicated. Those should *not* be marked as unsafe.
BUG#34732: mysqlbinlog does not print default values for auto_increment variables
Problem: mysqlbinlog does not print default values for some variables,
including auto_increment_increment and others. So if a client executing
the output of mysqlbinlog has different default values, replication will
be wrong.
Fix: Always print default values for all variables that are replicated.
I need to fix the two bugs at the same time, because the test cases would
fail if I only fixed one of them.


include/m_ctype.h:
  Added definition of ILLEGAL_CHARSET_INFO_NUMBER. We just need a symbol
  for a number that will never be used by any charset. ~0U should be safe
  since charset numbers are sequential, starting from 0.
mysql-test/include/commit.inc:
  Upated test to avoid making statements unsafe.
mysql-test/r/commit_1innodb.result:
  Updated test needs updated result file.
mysql-test/r/mysqlbinlog.result:
  Updated result file.
mysql-test/r/mysqlbinlog2.result:
  Updated result file.
mysql-test/r/user_var-binlog.result:
  Updated result file.
mysql-test/suite/binlog/r/binlog_base64_flag.result:
  Updated result file.
mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result:
  Updated result file.
mysql-test/suite/binlog/r/binlog_unsafe.result:
  Modified test file needs modified result file.
mysql-test/suite/binlog/t/binlog_base64_flag.test:
  Need to filter out pseudo_thread_id from result since it is
  nondeterministic.
mysql-test/suite/binlog/t/binlog_unsafe.test:
  Add tests that using variables is unsafe. The 'CREATE VIEW' tests didn't
  make sense, so I removed them. SHOW WARNINGS is not necessary either,
  because we get warnings for each statement in the result file.
mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result:
  Updated result file.
mysql-test/suite/rpl/r/rpl_skip_error.result:
  Updated result file.
mysql-test/suite/rpl/t/rpl_skip_error.test:
  The test used @@server_id, which is not safe to replicate, so it would
  have given a warning. The way it used @@server_id was hackish (issue a
  query on master that removes rows only on master), so I replaced it by a
  more robust way to do the same thing (connect to slave and insert the
  rows only there).
  Also clarified what the test case does.
mysql-test/t/mysqlbinlog2.test:
  Use --short-form instead of manually filtering out nondeterministic stuff
  from mysqlbinlog (because we added the nondeterministic @@pseudo_thread_id
  to the output).
sql/item_func.cc:
  Added method of Item_func_get_system_var that indicates whether the given
  system variable will be written to the binlog or not.
sql/item_func.h:
  Added method of Item_func_get_system_var that indicates whether the given
  system variable will be written to the binlog or not.
sql/log_event.cc:
   - auto_increment_offset was not written to the binlog if
  auto_increment_increment=1
   - mysqlbinlog did not output default values for some variables
  (BUG#34732). In st_print_event_info, we remember for each variable whether
  it has been printed or not. This is achieved in different ways for
  different variables:
      - For auto_increment_*, lc_time_names, charset_database_number,
        we set the default values in st_print_event_info to something
        illegal, so that it will look like they have changed the first time
        they are seen.
      - For charset, sql_mode, pseudo_thread_id, we add a flag to
        st_print_event_info which indicates whether the variable has been
        printed.
      - Since pseudo_thread_id is now printed more often, and its value is
        not guaranteed to be constant across different runs of the same
        test script, I replaced it by a constant if --short-form is used.
   - Moved st_print_event_info constructor from log_event.h to log_event.cc,
  since it now depends on ILLEGAL_CHARSET_NUMBER, which is defined in
  m_ctype.h, which is better to include from a .cc file than from a header
  file.
sql/log_event.h:
  Added fields to st_print_event_info that indicate whether some of the
  variables have been written or not. Since the initialization of
  charset_database_number now depends on ILLEGAL_CHARSET_INFO_NUMBER, which
  is defined in a header file, which we'd better not include from this
  header file -- I moved the constructor from here to log_event.cc.
sql/set_var.cc:
  System variables now have a flag binlog_status, which indicates if they
  are written to the binlog. If nothing is specified, all variables are
  marked as not written to the binlog (NOT_IN_BINLOG) when created. In this
  file, the variables that are written to the binlog are marked with
  SESSION_VARIABLE_IN_BINLOG.
sql/set_var.h:
  Added flag binlog_status to class sys_var. Added a getter and a
  constructor parameter that sets it.
  Since I had to change sys_var_thd_enum constructor anyways, I simplified
  it to use default values of arguments instead of three copies of the
  constructor.
sql/sql_yacc.yy:
  Mark statements that refer to a system variable as "unsafe",
  meaning they will be replicated by row in mixed mode. Added comment to
  explain strange piece of code just above.
mysql-test/include/diff_tables.inc:
  New auxiliary test file that tests whether two tables (possibly one on
  master and one on slave) differ.
mysql-test/suite/rpl/r/rpl_variables.result:
  New test case needs new result file.
mysql-test/suite/rpl/r/rpl_variables_stm.result:
  New test file needs new result file.
mysql-test/suite/rpl/t/rpl_variables.test:
  Test that INSERT of @@variables is replicated correctly (by switching to
  row-based mode).
mysql-test/suite/rpl/t/rpl_variables_stm.test:
  Test that replication of @@variables which are replicated explicitly works
  as expected in statement mode (without giving warnings).
2008-03-07 13:59:36 +01:00
unknown
4aae2099c9 Bug #34367: sql/sql_show.cc: create_schema_table should handle
MYSQL_TYPE_NEWDECIMAL

Added support for the type MYSQL_TYPE_NEWDECIMAL. It now works like
MYSQL_TYPE_DECIMAL. Unfortunately there cannot be a test case until
we have a working information_schema plugin as part of the source
distribution.


sql/sql_show.cc:
  Bug#34367: The fix. Corrected wrong comments and a DBUG_ENTER with wrong 
  function name.
sql/table.h:
  Bug#34367: Added comments to st_field_info.
2008-03-07 13:56:15 +01:00
unknown
f613588c2b Bug #28780 report_host is not available through SELECT @@report_host
merging and post-make-test changes.


mysql-test/suite/rpl/r/rpl_report.result:
  results changed
mysql-test/suite/rpl/t/rpl_report.test:
  correcting test because of non-deterministic select's result
sql/set_var.cc:
  compilation issue
2008-03-07 14:39:37 +02:00
unknown
a03f1a4c1d Merge mysql.com:/home/bar/mysql-work/mysql-5.0.b27580v2
into  mysql.com:/home/bar/mysql-work/mysql-5.1.b27580
Additonal after merge fix


mysql-test/r/ctype_cp1250_ch.result:
  Auto merged
mysql-test/r/ctype_euckr.result:
  Auto merged
mysql-test/r/ctype_uca.result:
  Auto merged
mysql-test/r/ctype_ucs.result:
  Auto merged
mysql-test/t/ctype_cp1250_ch.test:
  Auto merged
mysql-test/t/ctype_ucs.test:
  Auto merged
mysql-test/suite/binlog/r/binlog_stm_ctype_cp932.result:
  Auto merged
sql/item_create.cc:
  After merge fix
2008-03-07 15:28:51 +04:00
unknown
abf0761539 Merge a88-113-38-195.elisa-laajakaista.fi:/home/my/bk/mysql-5.1-main
into  a88-113-38-195.elisa-laajakaista.fi:/home/my/bk/mysql-5.1-marvel


client/mysqltest.c:
  Auto merged
mysql-test/r/change_user.result:
  Auto merged
mysql-test/t/change_user.test:
  Auto merged
sql/handler.cc:
  Auto merged
sql/handler.h:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/log.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_test.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/table.h:
  Auto merged
2008-03-07 11:25:47 +02:00
unknown
43f15ec126 Merge mysql1000.(none):/home/andrei/MySQL/FIXES/5.1/bug22234-Extra_Slave_Col_Slave_should_stop_on_Error_Field
into  mysql1000.(none):/home/andrei/MySQL/MERGE/5.1


sql/log_event.cc:
  manual merge
2008-03-06 20:35:59 +02:00
unknown
b8bf43d59d Merge mysql1000.(none):/home/andrei/MySQL/FIXES/5.1/bug28780_report_host_no_show
into  mysql1000.(none):/home/andrei/MySQL/MERGE/5.1


sql/set_var.cc:
  Auto merged
2008-03-06 20:33:29 +02:00
unknown
9526a24b2f Bug #22234 Extra Slave Col: Slave should stop on Error Field d of table
There was a failure in that show slave status displayed a wrong message
when slave stopped at processing a row event inserting to a default-less
column.

The problem seem to have ceased after recent fixes in rbr code.
However, the test was not updated to carry testing of the case commented-out.

Uncommenting and editing the test.
Notice, Bug#23907 is most probably a duplicate of this one.


mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test:
  uncommenting the test that previously failed.
mysql-test/suite/rpl/r/rpl_extraCol_innodb.result:
  results changed due to the correct expected error message of an added test
  is displayed.
mysql-test/suite/rpl/r/rpl_extraCol_myisam.result:
  results changed to reflect the test changes
mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result:
  results changed to reflect the uncommented test
sql/log_event.cc:
  correcting of a merge with bug#12713 to use the correct object holding
  the error code.
2008-03-06 20:32:47 +02:00
unknown
8270d9875f Fix for bug #34512: CAST( AVG( double ) AS DECIMAL )
returns wrong results

Casting AVG() to DECIMAL led to incorrect results when the arguments
had a non-DECIMAL type, because in this case
Item_sum_avg::val_decimal() performed the division by the number of
arguments twice.

Fixed by changing Item_sum_avg::val_decimal() to not rely on
Item_sum_sum::val_decimal(), i.e. calculate sum and divide using
DECIMAL arithmetics for DECIMAL arguments, and utilize val_real() with
subsequent conversion to DECIMAL otherwise.


mysql-test/r/func_group.result:
  Added a test case for bug #34512.
mysql-test/t/func_group.test:
  Added a test case for bug #34512.
sql/item_sum.cc:
  Do not use Item_sum_sum::val_decimal() in Item_sum_avg::val_decimal()
  because the first one, depending on the arguments type, may return
  either the sum of the arguments, or the average calculated by the
  virtual val_real() method of Item_sum_avg. Instead, do our own
  calculation based on the arguments type.
2008-03-06 18:19:47 +03:00
unknown
fcdf0d11c5 Merge bk-internal.mysql.com:/home/bk/mysql-5.1-build
into  chorlton.adsl.perkin.org.uk:/Users/jonathan/mysql/bk/build/5.1


libmysqld/Makefile.am:
  Auto merged
scripts/Makefile.am:
  Auto merged
scripts/make_binary_distribution.sh:
  Auto merged
scripts/mysql_config.sh:
  Auto merged
sql/Makefile.am:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/unireg.h:
  Auto merged
2008-03-06 15:13:14 +00:00
unknown
04c5af1802 Bug#26622 MASTER_POS_WAIT does not work as documented
MASTER_POS_WAIT return values are different than expected when the server is not a slave. 
It returns -1 instead of NULL.

Fixed with correcting  st_relay_log_info::wait_for_pos() to return the proper
value in the case of rli info is not inited.


mysql-test/r/rpl_master_pos_wait.result:
  results changed
mysql-test/t/rpl_master_pos_wait.test:
  the new test to check that select master_pos_wait() to a server does 
  not have master info returns NULL as specified.
sql/slave.cc:
  changing the return value to correspond the specification.
2008-03-06 14:49:21 +02:00
unknown
c184cd6320 Bug#25132 disabled query cache: Qcache_free_blocks = 1
The initial value of free memory blocks in 0. When the query cache is enabled 
a new memory block gets allocated and is assigned number 1. The free memory
block is later split each time query cache memory is allocated for new blocks.
This means that the free memory block counter won't be reduced to zero when
the number of allocated blocks are zero, but rather one. To avoid confusion
this patch changes this behavior so that the free memory block counter is
reset to zero when the query cache is disabled.
Note that when the query cache is enabled and resized the free memory block
counter was still calculated correctly.


mysql-test/r/query_cache.result:
  test case
mysql-test/t/query_cache.test:
  test case
sql/sql_cache.cc:
  Restore the memory block count to 0 for consistency.
2008-03-06 12:40:46 +01:00
unknown
89fb97c500 Merge mysql.com:/home/bar/mysql-work/mysql-5.0.b27580
into  mysql.com:/home/bar/mysql-work/mysql-5.0.b27580v2


mysql-test/r/ctype_ucs.result:
  Auto merged
mysql-test/t/ctype_ucs.test:
  Auto merged
mysql-test/include/ctype_common.inc:
  after merge fix
mysql-test/r/ctype_big5.result:
  after merge fix
mysql-test/r/ctype_euckr.result:
  after merge fix
mysql-test/r/ctype_gb2312.result:
  after merge fix
mysql-test/r/ctype_gbk.result:
  after merge fix
mysql-test/r/ctype_uca.result:
  after merge fix
2008-03-06 08:41:05 +04:00
unknown
5521666f65 Merge zippy.cornsilk.net:/home/cmiller/work/mysql/bug34726/my51-bug34726
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.1-build


sql/sql_class.cc:
  Auto merged
2008-03-05 17:13:00 -05:00
unknown
b6595704ef Bug#34726: open_tables() crashes server if running with --debug
The DBUG code emits the current value of the proc_info member of THD,
which may be set to NULL.  It was wrong to dereference that value
with the format string %s without verifying that it was valid.

Now, insert an inline test that substitutes the string "(null)" for
NULL pointers.


sql/sql_class.cc:
  Dereferencing a NULL is illegal (though not fatal for %s on some 
  platforms), and we have no assurance that the caller didn't call us 
  with a valid string.
2008-03-05 11:23:58 -05:00
unknown
97fc693147 Merge zippy.cornsilk.net:/home/cmiller/work/mysql/bug#33464/my51-bug#33464
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.1-build


sql/sql_acl.cc:
  Auto merged
2008-03-05 09:42:16 -05:00
unknown
2b7dda9e9d Bug#33464: DROP FUNCTION caused a crash
The cause of the crash is an assertion failure that we do not emit 
an error message (grant not found) and then return "ok".  The 
assertion is valid, and we were ignoring the buggy behavior prior 
to the "Diagnostics" result-verification.

Use an error handler to mutate innocuous missing-grant errors, when 
removing routines, into warnings.


mysql-test/r/drop.result:
  Show that the crash disappears.  Also prepare for the larger bug to
  be fixed with only minor changes to this test.
mysql-test/t/drop.test:
  Show that the crash disappears.  Also prepare for the larger bug to
  be fixed with only minor changes to this test.
sql/sql_acl.cc:
  Disable a segment of code that makes a faulty assumption
  about the existence of a routine's defining user, until that 
  assumption becomes true.
  
  Push a new handler onto the error-handler stack, so that when 
  removing a routine, a missing ACL grant is now a warning
  instead of an error.  If any unexpected error is raised then tell
  the caller.
2008-03-05 09:33:32 -05:00
unknown
0c1dd98ec8 Fix for bug #34889: mysql_client_test::test_mysql_insert_id test fails
sporadically

Under some circumstances, the mysql_insert_id() value after SELECT ...
INSERT could return a wrong value. This could happen when the last
SELECT ... INSERT did not involve an AUTO_INCREMENT column, but the
value of mysql_insert_id() was changed by some previous statements.

Fixed by checking the value of thd->insert_id_used in
select_insert::send_eof() and returning 0 for mysql_insert_id() if it
is not set.


sql/sql_insert.cc:
  Do not return thd->last_insert_id unconditionally in
  select_insert::send_eof(). First check if thd->insert_id_used is
  non-zero, and return 0 otherwise.
tests/mysql_client_test.c:
  Added a test case for bug #34889.
2008-03-05 16:02:33 +03:00
unknown
657ef27076 Bug #28780 report_host is not available through SELECT @@report_host
There was no way to see if report-{host,port,user,password} were set up.

Fixed with introducing new global variables.
The variables are made read-only because of a possible need to change them
most probably require the slave server restart.

Todo: transform the startup options to be CHANGE master parameters - i.e
to deprecate `report-' options, and to change the new vars 
to be updatable at time of CHANGE master executes with new
values.


sql/set_var.cc:
  Adding associations of the server init arguments with the new global read-only
  variables.
mysql-test/suite/rpl/r/rpl_report.result:
  new results file
mysql-test/suite/rpl/t/rpl_report-slave.opt:
  options initialize the new global variables.
mysql-test/suite/rpl/t/rpl_report.test:
  The new test to check SHOW-ability and SELECT-ablity for the report
  global vars.
2008-03-05 12:25:55 +02:00
unknown
d9833dc41f Merge dl145h.mysql.com:/data0/mkindahl/mysql-5.1
into  dl145h.mysql.com:/data0/mkindahl/mysql-5.1-rpl


mysql-test/r/mysqldump.result:
  Auto merged
mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result:
  Auto merged
mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result:
  Auto merged
mysql-test/t/mysqldump.test:
  Auto merged
sql/log.cc:
  Auto merged
sql/slave.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_delete.cc:
  Auto merged
sql/handler.cc:
  Manual merge.
sql/sql_update.cc:
  Manual merge.
2008-03-05 10:16:20 +01:00
unknown
d20bfbbef6 Merge dl145h.mysql.com:/data0/mkindahl/mysql-5.0
into  dl145h.mysql.com:/data0/mkindahl/mysql-5.0-rpl
2008-03-05 09:42:26 +01:00
unknown
c32e663dfe fix for compilation failure in non-debug builds
sql/mysqld.cc:
  option -# and --debug, and default_dbug_option, do not exist in non-debug builds
2008-03-04 18:00:59 +01:00
unknown
09e4e954c3 Fixed crashing bug when starting mysqld with --dbug
Fixed crash when using other maria block size than 8192
Fixed bug that caused tables to be reported as crashed if maria_log_control was deleted


mysql-test/valgrind.supp:
  Suppress leaks on SuSE 10.3, x86 64 bit
sql/mysqld.cc:
  Don't give warning in case of timeout for pthread_cond_timedwait
  Fixed crashing bug when starting mysqld with --dbug
storage/maria/ha_maria.cc:
  Fixed crash when using other block size than 8192 (Crash happend later in bitmap page handling)
storage/maria/ma_locking.c:
  When we write a new uuid for a zerofilled file, also update the lsn's
storage/maria/ma_open.c:
  Don't update lsn on open. Wait until first time file is changed
  Fixed bug that caused tables to be reported as crashed if maria_log_control was deleted
strings/strmake.c:
  Fixed warnings for strings without end 0 when running under valgrind.
2008-03-04 17:13:34 +02:00
unknown
cd9f2d1c28 BUG#34945: "ref_or_null queries that are null_rejecting and have a null value crash mysql"
- Apply Eric Bergen's patch: in join_read_always_key(), move ha_index_init() call
  to before the late NULLs filtering code.
- Backport function comments from 6.0.


mysql-test/r/null_key.result:
  BUG#34945: "ref_or_null queries that are null_rejecting and have a null value crash mysql"
  - Testcase
mysql-test/t/null_key.test:
  BUG#34945: "ref_or_null queries that are null_rejecting and have a null value crash mysql"
  - Testcase
sql/sql_select.cc:
  BUG#34945: "ref_or_null queries that are null_rejecting and have a null value crash mysql"
  - Apply Eric Bergen's patch: in join_read_always_key(), move ha_index_init() call
    to before the late NULLs filtering code.
  - Backport function comments from 6.0
2008-03-03 20:35:44 +03:00
unknown
0ab3eab55c Merge bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into  quad.:/mnt/raid/alik/MySQL/devel/5.1-rt
2008-03-03 14:02:36 +03:00
unknown
72f6ffe3b0 Merge host.loc:/home/uchum/work/5.0-opt-34830
into  host.loc:/home/uchum/work/5.0-opt
2008-03-01 12:24:55 +04:00
unknown
b225bf1c0e Merge host.loc:/home/uchum/work/5.0-opt-34830
into  host.loc:/home/uchum/work/5.1-opt


sql/sql_select.cc:
  Auto merged
2008-03-01 12:24:00 +04:00
unknown
29cfe3161a Merge bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into  mysql.com:/Users/davi/mysql/mysql-5.1-runtime
2008-02-29 11:18:13 -03:00
unknown
1ed34fed33 Bug#23924 general_log truncates queries with character set introducers.
Problem: logging of utf8-incompatible binary strings didn't work
Fix: hex-encoding of incompatible sequences.


mysql-test/r/log_tables.result:
  Adding test
mysql-test/t/log_tables.test:
  Adding test
sql/field.cc:
  Copying with hex escaping
sql/field.h:
  New field flag
sql/log.cc:
  Marking the column "general_log.argument" as hex-escaping field.
sql/sql_string.cc:
  New function to copy strings with hex-encoding of incompatible characters.
sql/sql_string.h:
  Prototype for the new function
2008-02-29 17:56:50 +04:00
unknown
4e7c4ab929 wrong merge fix 2008-02-29 17:50:01 +04:00
unknown
d276cd9059 Fixed bug #34830: mixed table and field names in Item_ref
and Item_direct_ref constructor calls.

Order of ref->field_name and ref->table_name arguments
is of Item_ref and Item_direct_ref in the fix_inner_refs
function is inverted.


sql/sql_select.cc:
  Fixed bug #34830: mixed table and field names in Item_ref
                    and Item_direct_ref constructor calls.
  
  Order of ref->field_name and ref->table_name arguments
  is of Item_ref and Item_direct_ref in the fix_inner_refs
  function is inverted. See definitions:
  
    Item_ref(Name_resolution_context *context_arg, Item **item,
             const char *table_name_arg, const char *field_name_arg,
             bool alias_name_used_arg= FALSE)
    and
  
    Item_direct_ref(Name_resolution_context *context_arg, Item **item,
                    const char *table_name_arg,
                    const char *field_name_arg,
                    bool alias_name_used_arg= FALSE)
2008-02-29 15:11:11 +04:00
unknown
fa9e35b48d after merge fix 2008-02-29 15:04:00 +04:00
unknown
8bdb243fd7 Merge mysql.com:/home/gluh/MySQL/Merge/4.1-opt
into  mysql.com:/home/gluh/MySQL/Merge/5.0-opt


sql/mysql_priv.h:
  Auto merged
mysql-test/r/symlink.result:
  manual merge
mysql-test/t/symlink.test:
  manual merge
sql/mysqld.cc:
  manual merge
sql/sql_parse.cc:
  manual merge
2008-02-29 14:05:38 +04:00
unknown
ab60425901 Bug#32167 another privilege bypass with DATA/INDEX DIRECORY(ver 4.1,5.0)
added new function test_if_data_home_dir() which checks that
path does not contain mysql data home directory.
Using of mysql data home directory in
DATA DIRECTORY & INDEX DIRECTORY is disallowed.


mysql-test/r/symlink.result:
  test result
mysql-test/t/symlink.test:
  test case
sql/mysql_priv.h:
  new variable mysql_unpacked_real_data_home
sql/mysqld.cc:
  new variable mysql_unpacked_real_data_home
sql/sql_parse.cc:
  added new function test_if_data_home_dir() which checks that
  path does not contain mysql data home directory.
  Using of mysql data home directory in
  DATA DIRECTORY & INDEX DIRECTORY is disallowed.
2008-02-29 13:55:00 +04:00
unknown
de534f2bc1 Fix for Bug#31947: Declare with a reserved word succeeded.
READ_ONLY token was accidentally placed into wrong place
('ident' rule). The proper place is in the 'keyword_sp' rule.

The manual should be re-generated after this patch, because
the manual depends on the 'keyword_sp' rule.


sql/sql_yacc.yy:
  Move READ_ONLY token to the 'keyword_sp' rule.
2008-02-29 12:21:19 +03:00
unknown
fa3fb2f6ca Merge sgluhov@bk-internal.mysql.com:/home/bk/mysql-5.1-opt
into  mysql.com:/home/gluh/MySQL/Merge/5.1-opt
2008-02-29 13:00:45 +04:00
unknown
05480a8863 Merge buzz.(none):/home/davi/mysql-5.0-runtime
into  buzz.(none):/home/davi/mysql-5.1-runtime


mysql-test/r/ps.result:
  Auto merged
mysql-test/t/limit.test:
  Auto merged
mysql-test/t/ps.test:
  Auto merged
sql/item.h:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/item.cc:
  Auto merged
mysql-test/suite/rpl/r/rpl_user_variables.result:
  Manual merge
mysql-test/suite/rpl/t/rpl_user_variables.test:
  Manual merge
sql/sql_yacc.yy:
  Manual merge
2008-02-28 20:22:50 -03:00
unknown
8b77945615 Post-merge fix for Bug 33851. The initialization order of members
must match the order which they were declared in the class definition. 


sql/item.cc:
  Fix initialization order, parameter was the last one declared.
2008-02-28 20:22:11 -03:00
unknown
ee51eeb6de Merge host.loc:/home/uchum/work/PP/5.0-opt-34620
into  host.loc:/home/uchum/work/5.1-opt


mysql-test/r/row.result:
  Auto merged
sql/item.h:
  Auto merged
2008-02-28 23:01:22 +04:00
unknown
7f572871ad Merge host.loc:/home/uchum/work/PP/5.0-opt-34620
into  host.loc:/home/uchum/work/5.0-opt
2008-02-28 22:57:22 +04:00
unknown
d40ca16156 Fixed bug #34620: item_row.cc:50: Item_row::illegal_method_call(const char*):
Assertion `0' failed

If ROW item is a part of an expression that also has
aggregate function calls (COUNT/SUM/AVG...), a
"splitting" with an Item::split_sum_func2 function
is applied to that ROW item.
Current implementation of Item::split_sum_func2
replaces this Item_row with a newly created
Item_aggregate_ref reference to it.
Then the row cache tries to work with the
Item_aggregate_ref object as with the Item_row object:
row cache calls row-emulation methods such as cols and
element_index. Item_aggregate_ref (like it's parent
Item_ref) inherits dummy implementations of those
methods from the hierarchy root Item, and call to
them leads to failed assertions and wrong data
output.

Row-emulation virtual functions (cols, element_index, addr,
check_cols, null_inside and bring_value) of Item_ref have
been overloaded to forward calls to an underlying item
reference.




mysql-test/r/row.result:
  Added test case for bug #34620.
mysql-test/t/row.test:
  Added test case for bug #34620.
sql/item.h:
  Fixed bug #34620.
  Row-emulation virtual functions (cols, element_index, addr,
  check_cols, null_inside and bring_value) of Item_ref have
  been overloaded to forward calls to an underlying item
  reference.
2008-02-28 22:53:31 +04:00
unknown
33a4e76090 Bug#34655 Compile error
Rename client_last_error to last_error and client_last_errno to last_errno
to not break connectors which use the internal net structure for error handling.


include/mysql_com.h:
  Rename client_last_error to last_error, client_last_errno to last_errno.
include/mysql_h.ic:
  Rename client_last_error to last_error, client_last_errno to last_errno.
libmysql/libmysql.c:
  Rename client_last_error to last_error, client_last_errno to last_errno.
libmysql/manager.c:
  Rename client_last_error to last_error, client_last_errno to last_errno.
libmysqld/lib_sql.cc:
  Rename client_last_error to last_error, client_last_errno to last_errno.
libmysqld/libmysqld.c:
  Rename client_last_error to last_error, client_last_errno to last_errno.
server-tools/instance-manager/mysql_connection.cc:
  Rename client_last_error to last_error, client_last_errno to last_errno.
sql/log_event.cc:
  Rename client_last_error to last_error, client_last_errno to last_errno.
sql-common/client.c:
  Rename client_last_error to last_error, client_last_errno to last_errno.
sql/log_event_old.cc:
  Rename client_last_error to last_error, client_last_errno to last_errno.
sql/net_serv.cc:
  Rename client_last_error to last_error, client_last_errno to last_errno.
sql/repl_failsafe.cc:
  Rename client_last_error to last_error, client_last_errno to last_errno.
2008-02-28 14:55:46 -03:00
unknown
1164e2bc7a Bug#33851 Passing UNSIGNED param to EXECUTE returns ERROR 1210
The problem is that passing anything other than a integer to a limit
clause in a prepared statement would fail. This limitation was introduced
to avoid replication problems (e.g: replicating the statement with a
string argument would cause a parse failure in the slave).

The solution is to convert arguments to the limit clause to a integer
value and use this converted value when persisting the query to the log.


mysql-test/r/limit.result:
  Update test case result.
mysql-test/r/ps.result:
  Add test case result for Bug#33851
mysql-test/r/rpl_user_variables.result:
  Test case result for replication of prepared statement with
  limit clause.
mysql-test/t/limit.test:
  Test parameters to limit clause.
mysql-test/t/ps.test:
  Add test case for Bug#33851
mysql-test/t/rpl_user_variables.test:
  Test replication of a parameter which value is converted.
sql/item.cc:
  Convert value to integer if it's a parameter to a limit clause.
sql/item.h:
  Flag signal that item is a parameter to a limit clause.
sql/item_func.cc:
  Const member functions, object is not mutated.
sql/sql_class.h:
  Const member functions, object is not mutated.
sql/sql_yacc.yy:
  Flag that item is a parameter to a limit clause.
2008-02-28 11:34:08 -03:00
unknown
9a19de7a7f Merge magare.gmz:/home/kgeorge/mysql/work/B34747-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/work/B34747-5.1-opt


libmysql/libmysql.c:
  Auto merged
libmysqld/lib_sql.cc:
  Auto merged
mysql-test/r/func_gconcat.result:
  Auto merged
mysql-test/t/func_gconcat.test:
  Auto merged
sql/item_sum.cc:
  Auto merged
sql/log.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
mysql-test/r/subselect.result:
  merged bug 34747 and 33266 5.0-opt->5.1-opt
mysql-test/t/subselect.test:
  merged bug 34747 and 33266 5.0-opt->5.1-opt
2008-02-28 15:45:54 +02:00
unknown
a0eec8abbb Bug#34749: Server crash when using NAME_CONST() with an aggregate function
NAME_CONST('whatever', -1) * MAX(whatever) bombed since -1 was
not seen as constant, but as FUNCTION_UNARY_MINUS(constant)
while we are at the same time pretending it was a basic const
item. This confused the aggregate handlers in exciting ways.
We now make NAME_CONST() behave more consistently.


mysql-test/r/func_misc.result:
  show that a combination of NAME_CONST('x', -y) and an aggregate
  no longer crashes the server.
mysql-test/t/func_misc.test:
  show that a combination of NAME_CONST('x', -y) and an aggregate
  no longer crashes the server.
sql/ha_ndbcluster_cond.cc:
  tell cluster about "new" function type NEG_FUNC.
  (this was previous identified as UNKNOWN_FUNC,
  so we just handle it the same way, that's all.)
sql/ha_ndbcluster_cond.h:
  tell cluster about "new" function type NEG_FUNC.
  (this was previous identified as UNKNOWN_FUNC,
  so we just handle it the same way, that's all.)
sql/item.cc:
  make NAME_CONST() transparent in that type() of
  -constant is that of constant, not that of unary
  minus (id est, FUNC_ITEM).
sql/item.h:
  Move constructor to item.cc
sql/item_func.h:
  Revert Bug#30832; we can apply the magic more narrowly
  (just for NAME_CONST() rather than all Item_func_neg).
  
  Introduce new function type "NEG_FUNC."
2008-02-28 14:23:22 +01:00
unknown
1af4194364 Bug#32167 another privilege bypass with DATA/INDEX DIRECORY(3rd version for 5.1)
added new function test_if_data_home_dir() which checks that
path does not contain mysql data home directory.
Using of 'mysql data home'/'any db name' in
DATA DIRECTORY & INDEX DIRECTORY is disallowed


mysql-test/r/partition.result:
  test result
mysql-test/r/partition_not_windows.result:
  result fix
mysql-test/r/partition_symlink.result:
  result fix
mysql-test/r/symlink.result:
  test result update
mysql-test/t/partition.test:
  test case
mysql-test/t/partition_not_windows.test:
  test case update
mysql-test/t/partition_symlink.test:
  test case update
mysql-test/t/symlink.test:
  test case
sql/mysql_priv.h:
  new variable mysql_unpacked_real_data_home
sql/mysqld.cc:
  new variable mysql_unpacked_real_data_home
sql/partition_info.cc:
  new check_partition_dirs() which checks
  data directory and index directory for partition elements
sql/partition_info.h:
  new check_partition_dirs() which checks
  data directory and index directory for partition elements
sql/sql_parse.cc:
  added new function test_if_data_home_dir() which checks that
  path does not contain mysql data home directory.
  Using of 'mysql data home'/'any db name' in
  DATA DIRECTORY & INDEX DIRECTORY is disallowed
2008-02-28 16:46:52 +04:00
unknown
f28612eae2 Bug #34747: crash in debug assertion check after derived table
Was a double-free of the Unique member of Item_func_group_concat.
This was not causing a crash because the Unique is a descendent of
Sql_alloc.
Fixed to free the Unique only if it was allocated for the instance 
of Item_func_group_concat it was referenced from


mysql-test/r/func_gconcat.result:
  Bug #34747: test case
mysql-test/t/func_gconcat.test:
  Bug #34747: test case
sql/item_sum.cc:
  Bug #34747: free the Unique only if it was allocated
  for this instance of Item_func_group_concat
2008-02-28 13:31:19 +02:00
unknown
83bcd5dfab BUG#13861 - START SLAVE UNTIL may stop 1 evnt too late if
log-slave-updates and circul repl

After merge fixes.


mysql-test/suite/rpl/t/rpl_dual_pos_advance-slave.opt:
  Rename: mysql-test/t/rpl_dual_pos_advance-slave.opt -> mysql-test/suite/rpl/t/rpl_dual_pos_advance-slave.opt
mysql-test/include/wait_for_slave_sql_to_stop.inc:
  Do not change connection if it was requested by caller (needed for
  circular replication tests).
mysql-test/suite/rpl/t/rpl_dual_pos_advance.test:
  Let include/wait_for_slave_sql_to_stop.inc know that we do not want to
  change connection to slave.
sql/rpl_rli.cc:
  After merge fix.
sql/rpl_rli.h:
  After merge fix.
sql/slave.cc:
  After merge fix.
2008-02-27 21:46:06 +04:00
unknown
bfbea4f4b4 Merge hynda.mysql.fi:/home/my/mysql-5.1-main
into  hynda.mysql.fi:/home/my/mysql-5.1-marvel


BitKeeper/etc/ignore:
  auto-union
client/mysqldump.c:
  Auto merged
client/mysqltest.c:
  Auto merged
include/my_global.h:
  Auto merged
include/my_sys.h:
  Auto merged
sql/handler.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_plugin.cc:
  Auto merged
storage/myisam/mi_check.c:
  Auto merged
storage/myisam/mi_dynrec.c:
  Auto merged
storage/myisam/mi_write.c:
  Auto merged
storage/myisam/myisamdef.h:
  Auto merged
storage/myisam/myisampack.c:
  Auto merged
sql/mysqld.cc:
  Manual merge with main 5.1 tree.
2008-02-27 16:46:32 +02:00
unknown
eec647badb Merge mysql.com:/home/svoj/devel/mysql/BUG13861/mysql-5.0-engines
into  mysql.com:/home/svoj/devel/mysql/BUG13861/mysql-5.1-engines


mysql-test/suite/rpl/r/rpl_dual_pos_advance.result:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/slave.h:
  Use local.
mysql-test/suite/rpl/t/rpl_dual_pos_advance.test:
  Manual merge.
sql/slave.cc:
  Manual merge.
2008-02-27 17:43:54 +04:00
unknown
432bc1f259 Merge mysql.com:/home/svoj/devel/bk/mysql-5.0-engines
into  mysql.com:/home/svoj/devel/mysql/BUG13861/mysql-5.0-engines
2008-02-27 17:33:19 +04:00
unknown
c7db565fc8 Merge dl145h.mysql.com:/data0/mkindahl/mysql-5.1
into  dl145h.mysql.com:/data0/mkindahl/mysql-5.1-rpl


sql/handler.cc:
  Auto merged
2008-02-27 11:00:43 +01:00
unknown
b66e0f7524 Merge dl145h.mysql.com:/data0/mkindahl/mysql-5.0
into  dl145h.mysql.com:/data0/mkindahl/mysql-5.0-rpl
2008-02-27 10:57:48 +01:00
unknown
68b21ebb83 Merge bk@192.168.21.1:mysql-5.1-opt
into  mysql.com:/home/hf/work/25097/my51-25097


libmysql/libmysql.c:
  Auto merged
libmysqld/lib_sql.cc:
  Auto merged
sql-common/client.c:
  Auto merged
sql/log.cc:
  Auto merged
2008-02-27 13:54:34 +04:00
unknown
87007702fe Merge bk@192.168.21.1:mysql-5.0-opt
into  mysql.com:/home/hf/work/25097/my50-25097


libmysql/libmysql.c:
  Auto merged
libmysqld/lib_sql.cc:
  Auto merged
sql/log.cc:
  Auto merged
2008-02-27 13:43:41 +04:00
unknown
33c4301922 Merge mysql.com:/home/hf/work/25097/my50-25097
into  mysql.com:/home/hf/work/25097/my51-25097


client/mysql.cc:
  Auto merged
include/sql_common.h:
  Auto merged
libmysql/libmysql.c:
  Auto merged
libmysqld/lib_sql.cc:
  Auto merged
sql-common/client.c:
  merging
sql/log.cc:
  merging
2008-02-27 13:00:59 +04:00
unknown
a4b0a2cf67 Bug #25097 mysql_server_init fails silently if no errmsg.sys is present.
There was no way to return an error from the client library
if no MYSQL connections was established.
So here i added variables to store that king of errors and
made functions like mysql_error(NULL) to return these.


client/mysql.cc:
  Bug #25097 mysql_server_init fails silently if no errmsg.sys is present.
  
  Show the error message on std_error
include/sql_common.h:
  Bug #25097 mysql_server_init fails silently if no errmsg.sys is present.
  
  cant_connect_sqlstate constant declared
libmysql/libmysql.c:
  Bug #25097 mysql_server_init fails silently if no errmsg.sys is present.
  
  mysql_sqlstate(NULL) returns 'unknown_sqlstate'
libmysqld/lib_sql.cc:
  Bug #25097 mysql_server_init fails silently if no errmsg.sys is present.
  
  EMBEDDED_SERVER version of the vprint_msg_to_log() implemented
sql-common/client.c:
  Bug #25097 mysql_server_init fails silently if no errmsg.sys is present.
  
  mysql_server_last_errno and mysql_server_last_error introduced
  to store errors not related to particular connections.
  
  mysql_error(NULL) and mysql_errno(NULL) now returns these
  mysql_server_last_error and errno respectively
sql/log.cc:
  Bug #25097 mysql_server_init fails silently if no errmsg.sys is present.
  
  EMBEDDED_LIBRARY implementation of the vprint_msg_to_log() moved
  to lib_sql.cc
2008-02-27 12:42:43 +04:00
unknown
e265b62b52 Reverted wrong patch, fix for Windows 32bit build.
mysys/my_getsystime.c:
  Added extra parenthesis to apply cast to the whole result.
sql/mysqld.cc:
  Reversed a wrong patch. This should however be made
  better in the future in my_getopt.h, having own define
  for GET_HA_ROWS.
2008-02-26 18:44:04 +02:00
unknown
336f2c7e51 Merge quad.:/mnt/raid/alik/MySQL/devel/5.1
into  quad.:/mnt/raid/alik/MySQL/devel/5.1-rt-merged


client/mysqltest.c:
  Auto merged
mysql-test/r/view.result:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/ha_ndbcluster_binlog.cc:
  Auto merged
sql/handler.cc:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_connect.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
tests/mysql_client_test.c:
  Auto merged
mysql-test/suite/rpl_ndb/t/disabled.def:
  Manually merged.
mysql-test/t/disabled.def:
  Manually merged.
2008-02-26 19:34:02 +03:00
unknown
a86e504f59 Merge quad.:/mnt/raid/alik/MySQL/devel/5.0
into  quad.:/mnt/raid/alik/MySQL/devel/5.0-rt-merged


mysql-test/r/view.result:
  Auto merged
2008-02-26 19:23:37 +03:00
unknown
fb3f8bdbb6 Merge mysql.com:/Users/davi/mysql/bugs/34424-5.1
into  mysql.com:/Users/davi/mysql/mysql-5.1-runtime
2008-02-26 12:12:57 -03:00
unknown
bf9bb656a6 Bug#34424 query_cache_debug.test leads to valgrind warnings
Bug#34678 @@debug variable's incremental mode

The problem is that the per-thread debugging settings stack wasn't
being deallocated before the thread termination, leaking the stack
memory. The chosen solution is to push a new state if the current
is set to the initial settings and pop it (free) once the thread
finishes.


dbug/dbug.c:
  Move dbug parser out of _db_set_ to a separate function and
  make _db_set_ push a new stack if the corrent one is set to
  the initial settings.
dbug/user.r:
  Update DBUG_SET description.
mysql-test/t/disabled.def:
  Re-enable test case which triggered the leak.
mysys/my_thr_init.c:
  Pop a pushed state, nop if stack is empty.
sql/set_var.cc:
  Handle incremental debug settings.
mysql-test/r/variables_debug.result:
  Add new test case result for Bug#34678
mysql-test/t/variables_debug.test:
  Add new test case for Bug#34678
2008-02-26 12:03:59 -03:00
unknown
0a1c0059df Merge bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into  dipika.(none):/opt/local/work/mysql-5.1-runtime
2008-02-26 16:22:42 +03:00
unknown
226e682139 We never check the return value of mysql_frm_type for an error. Do
not try to push an error into the error stack as it will be ignored anyway.
2008-02-26 16:19:23 +03:00
unknown
da0a2e4397 Merge kaamos.(none):/data/src/opt/bug33834/my51-bug33834
into  kaamos.(none):/data/src/opt/mysql-5.1-opt


sql/sql_yacc.yy:
  Auto merged
2008-02-26 16:11:52 +03:00
unknown
25620347fc Merge kaamos.(none):/data/src/opt/bug33834/my50-bug33834
into  kaamos.(none):/data/src/opt/mysql-5.0-opt


sql/sql_yacc.yy:
  Auto merged
2008-02-26 16:10:31 +03:00
unknown
2583c281b6 Removed compiler warning
(Missed a change of printf format)


sql/sql_table.cc:
  wrong printf type
2008-02-26 07:58:46 +01:00
unknown
db9b2bdc1b Post push fix
Fixed a missed case in the patch for Bug#31931.
Also makes Bug#33722 a duplicate of Bug#31931.
Added tests for better coverage.
Replaced some legacy function calls.


mysql-test/r/partition.result:
  Added tests for better coverage
mysql-test/r/partition_datatype.result:
  Added tests for better coverage
mysql-test/r/partition_error.result:
  Added tests for better coverage
mysql-test/suite/parts/inc/partition_engine.inc:
  Bug#31931: Mix of handlers error message
  
  Bug#33722 is fixed within this patch too
mysql-test/suite/parts/r/partition_engine_innodb.result:
  Bug#31931: Mix of handlers error message
  
  Bug#33722 is fixed within this patch too
mysql-test/suite/parts/r/partition_engine_myisam.result:
  Bug#31931: Mix of handlers error message
  
  Bug#33722 is fixed within this patch too
mysql-test/t/partition.test:
  Added tests for better coverage
mysql-test/t/partition_datatype.test:
  Added tests for better coverage
mysql-test/t/partition_error.test:
  Added tests for Bug#31931
sql/partition_info.cc:
  Bug#31931: Mix of handlers error message
  
  Fixed case where given info->db_type not matched
  thd->lex->create_info.db_type
  
  And the check for inconsistent subpartition engines-clauses.
sql/sql_partition.cc:
  Changed ha_legacy_type to ha_resolve_storage_engine_name
sql/sql_table.cc:
  Changed ha_legacy_type to ha_resolve_storage_engine_name
2008-02-25 21:18:50 +01:00
unknown
561827e238 Post-merge fixes for bug #33834. 2008-02-25 16:03:28 +03:00
unknown
b2e879cbe8 Bug#28386 the general log is incomplete
The problem is that the commands COM_STMT_CLOSE, COM_STMT_RESET,
COM_STMT_SEND_LONG_DATA weren't being logged to the general log.

The solution is to log the general log the aforementioned commands.


mysql-test/t/mysql_client_test-master.opt:
  Also log to table.
sql/sql_prepare.cc:
  Log COM_STMT_CLOSE, COM_STMT_RESET and COM_STMT_SEND_LONG_DATA.
tests/mysql_client_test.c:
  Add test case for Bug#28386
2008-02-25 07:48:02 -03:00
unknown
c6d141a5c9 Merge kaamos.(none):/data/src/opt/bug33834/my50-bug33834
into  kaamos.(none):/data/src/opt/bug33834/my51-bug33834


mysql-test/r/func_time.result:
  Auto merged
mysql-test/t/func_time.test:
  Auto merged
sql/sql_yacc.yy:
  Manual merge.
2008-02-25 13:40:43 +03:00
unknown
4f3eab5804 Fix for bug #33834: FRAC_SECOND: Applicability not clear in
documentation

While the manual mentions FRAC_SECOND only for the TIMESTAMPADD()
function, it was also possible to use FRAC_SECOND with DATE_ADD(),
DATE_SUB() and +/- INTERVAL.

Fixed the parser to match the manual, i.e. using FRAC_SECOND for 
anything other than TIMESTAMPADD()/TIMESTAMPDIFF() now produces a 
syntax error.

Additionally, the patch allows MICROSECOND to be used in TIMESTAMPADD/
TIMESTAMPDIFF and marks FRAC_SECOND as deprecated.


mysql-test/r/func_time.result:
  Added a test case for bug #33834.
mysql-test/t/func_time.test:
  Added a test case for bug #33834.
sql/sql_yacc.yy:
  Reject FRAC_SECOND for anything other than TIMESTAMPADD() or
  TIMESTAMPDIFF().
  Allow MICROSECOND to be used with TIMESTAMPADD()/TIMESTAMPDIFF().
  Warn about FRAC_SECOND being a deprecated unit.
2008-02-25 13:25:57 +03:00
unknown
c37fdbcdfd Pre push fixes
Test file fixes for bugs 20129, 31931 and 34225


mysql-test/suite/parts/r/partition_basic_symlink_innodb.result:
  Manual merge, new test case to be modified for Bug#20129
mysql-test/suite/parts/r/partition_basic_symlink_myisam.result:
  Manual merge, new test case to be modified for Bug#20129
mysql-test/suite/parts/r/partition_engine_innodb.result:
  Manual merge, fix for bug#31931
mysql-test/suite/parts/r/partition_engine_myisam.result:
  Manual merge, fix for bug#31931
mysql-test/suite/parts/t/disabled.def:
  These should work now since Bug#34225 is fixed
sql/ha_partition.cc:
  Bug#20129: partition maintenance command not working with crashed tables
  
  Fix for compiler warnings.
2008-02-24 19:13:18 +01:00
unknown
8144fd1a15 Merge witty.:/Users/mattiasj/clones/mysql-5.1-bug20129.2
into  witty.:/Users/mattiasj/clones/topush-51


mysql-test/r/partition.result:
  Auto merged
mysql-test/suite/parts/t/disabled.def:
  Auto merged
mysql-test/t/partition.test:
  Auto merged
sql/sql_partition.cc:
  Auto merged
mysql-test/suite/parts/r/partition_basic_innodb.result:
  Manual merge
mysql-test/suite/parts/r/partition_basic_myisam.result:
  Manual merge
mysql-test/suite/parts/r/partition_engine_innodb.result:
  Manual merge
mysql-test/suite/parts/r/partition_engine_myisam.result:
  Manual merge
2008-02-24 17:48:57 +01:00
unknown
1864caeafc Merge witty.:/Users/mattiasj/clones/mysql-5.1-bug31931.2
into  witty.:/Users/mattiasj/clones/topush-51


mysql-test/r/partition.result:
  Auto merged
mysql-test/suite/ndb/r/ndb_partition_key.result:
  Auto merged
mysql-test/suite/ndb/t/ndb_partition_key.test:
  Auto merged
mysql-test/t/partition.test:
  Auto merged
sql/sql_partition.cc:
  Auto merged
sql/partition_info.cc:
  SCCS merged
2008-02-24 16:46:35 +01:00
unknown
f13831f4d0 Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.1-opt
into  mysql.com:/misc/mysql/99999/51-99999


sql/set_var.cc:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_plugin.cc:
  Auto merged
2008-02-24 14:23:28 +01:00
unknown
9bd3b8545a Bug#32757: hang with sql_mode set when setting some global variables
If setting a system-variable provided by a plug-in failed, no OK or
error was sent in some cases, hanging the client. We now send an error
in the case from the ticket (integer-argument out of range in STRICT
mode). We also provide a semi-generic fallback message for possible
future cases like this where an error is signalled, but no message is
sent to the client. The error/warning handling is unified so it's the
same again for variables provided by plugins and those in the server
proper.


mysql-test/r/plugin.result:
  show that on out-of-range values, plugin interface throws errors
  in STRICT mode and warnings otherwise.
mysql-test/t/plugin.test:
  show that on out-of-range values, plugin interface throws errors
  in STRICT mode and warnings otherwise.
sql/set_var.cc:
  - handle signedness of values used in warnings
  - in STRICT mode, throw errors rather than warnings
sql/sql_parse.cc:
  If sql_set_variables() returns with an error but no message
  was sent to the client, send a semi-generic one so the session
  won't hang and we won't fail silently.
sql/sql_plugin.cc:
  throw a warning if more than just block-size was corrected
  (or an error in STRICT mode). use functions from set_var
  for uniform behaviour of server- and plug-in variables.
storage/example/ha_example.cc:
  Add a ULONG system variable to example plugin so
  we can test integers in the plugin-interface without
  having to depend on the presence of innobase.
2008-02-24 14:12:17 +01:00
unknown
a22c3d2109 Bug#32753: PAD_CHAR_TO_FULL_LENGTH is not documented and interferes with grant tables
SQL-mode PAD_CHAR_TO_FULL_LENGTH affected mysqld's user-table too. If
enabled, user-name and host were space-padded and no longer matched
the login-data of incoming connexions.

Patch disregards pad-flag while loading privileges so ability to log
in does not depend on SQL-mode.


mysql-test/r/sql_mode.result:
  show that SQL-mode 'PAD_CHAR_TO_FULL_LENGTH' does not affect
  loading of privileges (and by extension, ability to log in).
mysql-test/t/sql_mode.test:
  show that SQL-mode 'PAD_CHAR_TO_FULL_LENGTH' does not affect
  loading of privileges (and by extension, ability to log in).
sql/sql_acl.cc:
  temporarily disable SQL-mode 'PAD_CHAR_TO_FULL_LENGTH' while
  reloading privileges
2008-02-24 13:58:07 +01:00
unknown
197b41196d Merge mysql.com:/home/ram/work/mysql-5.0-engines
into  mysql.com:/home/ram/work/b33304/b33304.5.0
2008-02-24 16:24:53 +04:00
unknown
86bad436a7 Merge mysql.com:/home/ram/work/mysql-5.1-engines
into  mysql.com:/home/ram/work/b33304/b33304.5.1
2008-02-24 16:23:43 +04:00
unknown
177a0a0c3e Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.1-opt
into  mysql.com:/misc/mysql/20752/51-20752


sql/item_func.cc:
  Auto merged
2008-02-24 01:35:50 +01:00
unknown
7b8717ace8 Bug#20752: BENCHMARK with many iterations returns too quickly
In BENCHMARK(count, expr), count could overflow/wrap-around.
Patch changes to a sufficiently large data-type. Adds a warning
for negative count values.


mysql-test/r/func_str.result:
  show that a negative 'count' for BENCHMARK(count, expr)
  throws a warning and returns NULL.
mysql-test/t/func_str.test:
  show that a negative 'count' for BENCHMARK(count, expr)
  throws a warning and returns NULL.
sql/item_func.cc:
  use ulonglong rather than ulong in BENCHMARK(count, expr)
  throw warning on negative 'count'; return SQL-NULL.
2008-02-24 01:31:54 +01:00
unknown
482d60082f Bug #34053: normal users can enable innodb_monitor logging
The check_global_access() function was made available to InnoDB, but
was not defined in the embedded server library.  InnoDB, as a plugin,
is not recompiled when the embedded server is built.  This caused a
link failure when compiling applications which use the embedded server.

The fix here is to always define check_global_access() externally; in
the embedded server case, it is defined to just return OK.

Also, don't run the test case for this bug in embedded server.


mysql-test/t/innodb_bug34053.test:
  Disable this test on embedded server - it tests privilege
  checks which are not in place there.
sql/mysql_priv.h:
  Since check_global_access() may be used from some storage engine plugins
  (InnoDB, currently), and the plugins are not recompiled for the embedded
  server, it must be defined externally even for NO_EMBEDDED_ACCESS_CHECKS.
sql/sql_parse.cc:
  Since check_global_access() may be used from some storage engine plugins
  (InnoDB, currently), and the plugins are not recompiled for the embedded
  server, it must be defined externally even for NO_EMBEDDED_ACCESS_CHECKS.
2008-02-22 16:56:34 -07:00
unknown
8e129eb901 Merge ssh://bk-internal.mysql.com//home/bk/mysql-5.1-opt
into  kaamos.(none):/data/src/opt/mysql-5.1-opt
2008-02-22 21:44:07 +03:00
unknown
30de8b7237 Merge kaamos.(none):/data/src/opt/bug33049/my51-bug33790
into  kaamos.(none):/data/src/opt/mysql-5.1-opt


sql/item_sum.cc:
  Auto merged
2008-02-22 21:25:51 +03:00
unknown
62ba88327f Merge kaamos.(none):/data/src/opt/bug33049/my50-bug33790
into  kaamos.(none):/data/src/opt/mysql-5.0-opt
2008-02-22 21:25:11 +03:00
unknown
72f1b329e1 Merge kaamos.(none):/data/src/opt/bug33049/my50-bug33790
into  kaamos.(none):/data/src/opt/bug33049/my51-bug33790


mysql-test/r/view.result:
  Auto merged
sql/item_sum.cc:
  Auto merged
mysql-test/t/view.test:
  Manual merge.
2008-02-22 19:55:23 +03:00
unknown
1bee6a3c7c Merge trift2.:/MySQL/M50/mysql-5.0
into  trift2.:/MySQL/M50/push-5.0


ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp:
  Auto merged
2008-02-22 16:36:09 +01:00
unknown
0dedada2ff Merge ahristov@bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into  whirlpool.hristov.com:/work/mysql-5.1-runtime


sql/events.cc:
  Auto merged
2008-02-22 16:20:05 +01:00
unknown
5d6ca9c2a3 Fix for bug#22738 Events: After stop and start disabled events could reside in the queue
Disabled events weren't removed from the memory queue after the scheduler has been
re-enabled. After recalculation of next execution time of an event, it might get disabled.


sql/event_queue.cc:
  Sort the event queue in a way that the disabled events will always be
  at the end. We will use this for cleaning it, starting from the end.
  
  After recalculating times in the queue, after the scheduler has been enabled
  after disabled state, the queue should be cleaned from DISABLED events.
  The queue is sorted in a way such that the disabled events are at the end.
  Thus, we can start from the end of the queue and remove all DISABLED till we
  find the first with different state.
sql/events.cc:
  Add a comment about possible problem with replication of events,
  disabled events and server restarts.
2008-02-22 16:18:31 +01:00
unknown
50ba314c98 Merge trift2.:/MySQL/M51/mysql-5.1
into  trift2.:/MySQL/M51/push-5.1


configure.in:
  Auto merged
extra/yassl/src/handshake.cpp:
  Auto merged
extra/yassl/src/template_instnt.cpp:
  Auto merged
extra/yassl/src/yassl_imp.cpp:
  Auto merged
mysql-test/mysql-test-run.pl:
  Auto merged
sql/ha_ndbcluster_binlog.cc:
  Auto merged
sql/handler.cc:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
storage/ndb/src/common/util/OutputStream.cpp:
  Auto merged
storage/ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp:
  Auto merged
storage/ndb/tools/waiter.cpp:
  Auto merged
2008-02-22 16:14:27 +01:00
unknown
fea2a5d83d BUG#13861 - START SLAVE UNTIL may stop 1 evnt too late if
log-slave-updates and circul repl

Slave SQL thread may execute one extra event when there are events
skipped by slave I/O thread (e.g. originated by the same server).
Whereas it was requested not to do so by the UNTIL condition.

This happens because we compare with the end position of previously
executed event. This is fine when there are no skipped by slave I/O
thread events, as end position of previous event equals to start
position of to be executed event. Otherwise this position equals to
start position of skipped event.

This is fixed by:
- reading the event to be executed before checking if the until condition
  is satisfied.
- comparing the start position of the event to be executed. Since we do
  not have the start position available, we compute it by subtracting
  event length from end position (which is available).
- if there are no events on the event queue at the slave sql starting
  time, that meet until condition, we stop immediately, as in this
  case we do not want to wait for next event.


mysql-test/r/rpl_dual_pos_advance.result:
  A test case for BUG#13861.
mysql-test/t/rpl_dual_pos_advance.test:
  A test case for BUG#13861.
sql/log_event.cc:
  Store length of event. This is needed for further calculation of
  the beginning of event.
sql/slave.cc:
  Slave SQL thread may execute one extra event when there are events
  skipped by slave I/O thread (e.g. originated by the same server).
  Whereas it was requested not to do so by the UNTIL condition.
  
  This happens because we compare with the end position of previously
  executed event. This is fine when there are no skipped by slave I/O
  thread events, as end position of previous event equals to start
  position of to be executed event. Otherwise this position equals to
  start position of skipped event.
  
  This is fixed by:
  - reading the event to be executed before checking if the until condition
    is satisfied.
  - comparing the start position of the event to be executed. Since we do
    not have the start position available, we compute it by subtracting
    event length from end position (which is available).
  - if there are no events on the event queue at the slave sql starting
    time, that meet until condition, we stop immediately, as in this
    case we do not want to wait for next event.
sql/slave.h:
  Added master_log_pos parametr to is_until_satisfied().
mysql-test/t/rpl_dual_pos_advance-slave.opt:
  New BitKeeper file ``mysql-test/t/rpl_dual_pos_advance-slave.opt''
2008-02-22 19:07:07 +04:00
unknown
5d26f63c95 An unused variable (compile-time warning).
sql/sql_view.cc:
  An unused variable.
2008-02-22 17:45:09 +03:00
unknown
bc73783ad4 Merge magare.gmz:/home/kgeorge/mysql/work/B30604-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/work/B30604-5.1-opt


BitKeeper/deleted/.del-binlog_innodb.result:
  Auto merged
BitKeeper/deleted/.del-binlog_innodb.test:
  Auto merged
mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result:
  merged bug 30604 to 5.1-opt
sql/sp.cc:
  merged bug 30604 to 5.1-opt
2008-02-22 15:45:40 +02:00
unknown
4368dcdc2d Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/autopush/B30604-5.0-opt
2008-02-22 15:36:27 +02:00
unknown
83d331a553 Small fixes; the missing DBUG_RETURN() fixes
BUG#34741 "prepared show master logs without binlogging debug assert"


sql/sql_repl.cc:
  missing DBUG_RETURN
storage/maria/unittest/ma_control_file-t.c:
  fix for icc warning.
2008-02-22 14:31:37 +01:00
unknown
00ff33cf8a Merge bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into  quad.:/mnt/raid/alik/MySQL/devel/bug-30217/5.1-rt-bug30217


sql/item.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_view.cc:
  Auto merged
2008-02-22 13:56:44 +03:00
unknown
a3e83048a3 Fix for Bug#30217: Views: changes in metadata behaviour
between 5.0 and 5.1.
  
The problem was that in the patch for Bug#11986 it was decided
to store original query in UTF8 encoding for the INFORMATION_SCHEMA.
This approach however turned out to be quite difficult to implement
properly. The main problem is to preserve the same IS-output after
dump/restore.
  
So, the fix is to rollback to the previous functionality, but also
to fix it to support multi-character-set-queries properly. The idea
is to generate INFORMATION_SCHEMA-query from the item-tree after
parsing view declaration. The IS-query should:
  - be completely in UTF8;
  - not contain character set introducers.
  
For more information, see WL4052.


mysql-test/include/ddl_i18n.check_views.inc:
  Add a test case for Bug#30217.
mysql-test/r/ddl_i18n_koi8r.result:
  Update result file.
mysql-test/r/ddl_i18n_utf8.result:
  Update result file.
mysql-test/r/information_schema.result:
  Update result file.
mysql-test/r/information_schema_db.result:
  Update result file.
mysql-test/r/mysqldump.result:
  Update result file.
mysql-test/r/show_check.result:
  Update result file.
mysql-test/t/ddl_i18n_koi8r.test:
  Add a test case for Bug#30217.
mysql-test/t/ddl_i18n_utf8.test:
  Add a test case for Bug#30217.
mysql-test/t/mysqldump.test:
  Add a test case for Bug#30217.
sql/ha_ndbcluster.cc:
  Add a parameter to print().
sql/item.cc:
  1. Add a parameter to print().
  2. Item_string::print():
        - Do not append character set introducer to the text literal
          if we're building a query for INFORMATION_SCHEMA;
        - Convert text literal to UTF8 if we're building a query
          for INFORMATION_SCHEMA.
sql/item.h:
  Add a parameter to print().
sql/item_cmpfunc.cc:
  Add a parameter to print().
sql/item_cmpfunc.h:
  Add a parameter to print().
sql/item_func.cc:
  Add a parameter to print().
sql/item_func.h:
  Add a parameter to print().
sql/item_geofunc.h:
  Add a parameter to print().
sql/item_row.cc:
  Add a parameter to print().
sql/item_row.h:
  Add a parameter to print().
sql/item_strfunc.cc:
  Add a parameter to print().
sql/item_strfunc.h:
  Add a parameter to print().
sql/item_subselect.cc:
  Add a parameter to print().
sql/item_subselect.h:
  Add a parameter to print().
sql/item_sum.cc:
  Add a parameter to print().
sql/item_sum.h:
  Add a parameter to print().
sql/item_timefunc.cc:
  Add a parameter to print().
sql/item_timefunc.h:
  Add a parameter to print().
sql/mysql_priv.h:
  Add a parameter to print().
sql/sp_head.cc:
  Add a parameter to print().
sql/sql_lex.cc:
  Add a parameter to print().
sql/sql_lex.h:
  Add a parameter to print().
sql/sql_parse.cc:
  Add a parameter to print().
sql/sql_select.cc:
  Add a parameter to print().
sql/sql_show.cc:
  Add a parameter to print().
sql/sql_test.cc:
  Add a parameter to print().
sql/sql_view.cc:
  Build INFORMATION_SCHEMA query from Item-tree.
sql/sql_yacc.yy:
  Build INFORMATION_SCHEMA query from Item-tree.
sql/table.h:
  Add a parameter to print().
2008-02-22 13:30:33 +03:00
unknown
012aab7d8b Fix for bug #33049: Assert while running test-as3ap test(mysql-bench
suite)

Under some circumstances a combination of aggregate functions and
GROUP BY in a SELECT query over a VIEW could lead to incorrect
calculation of the result type of the aggregate function. This in
turn could result in incorrect results, or assertion failures on debug
builds.

Fixed by changing the logic in Item_sum_hybrid::fix_fields() so that
the argument's item is dereferenced before calling its type() method.


mysql-test/r/view.result:
  Added a test case for bug #33049.
mysql-test/t/view.test:
  Added a test case for bug #33049.
sql/item_sum.cc:
  When calculating the result type of an aggregate function, dereference
  the argument's item before calling its type() method.
2008-02-22 11:34:18 +03:00
unknown
e1378d1624 Merge mysql.com:/home/gluh/MySQL/mysql-5.0-opt
into  mysql.com:/home/gluh/MySQL/mysql-5.1-opt


sql/sql_base.cc:
  Auto merged
2008-02-22 12:31:12 +04:00
unknown
1a8be8bccb Bug#23588 SHOW COLUMNS on a temporary table causes locking issues
skip lock_type update for temporary tables


mysql-test/r/tablelock.result:
  test result
mysql-test/t/tablelock.test:
  test case
sql/sql_base.cc:
  skip lock_type update for temporary tables
2008-02-22 12:30:17 +04:00
unknown
3676f5188e Post-merge fixes for bug 32890
mysql-test/r/ps.result:
  Update test case results
sql/item.h:
  Manual merge
sql/sql_view.cc:
  Manual merge
2008-02-21 23:58:45 -02:00
unknown
955b3e3d0b Merge buzz.(none):/home/davi/mysql-5.0-runtime
into  buzz.(none):/home/davi/mysql-5.1-runtime


mysql-test/r/ps.result:
  Auto merged
mysql-test/t/ps.test:
  Auto merged
sql/sql_view.h:
  Auto merged
sql/item.h:
  Manual merge
sql/sql_prepare.cc:
  Manual merge
sql/sql_view.cc:
  Manual merge
2008-02-21 23:21:52 -02:00
unknown
a7341383ef Merge bk-internal.mysql.com:/home/bk/mysql-5.1-build
into  alf.(none):/src/mysql-5.1-build_31929


sql/CMakeLists.txt:
  Auto merged
storage/myisam/CMakeLists.txt:
  Auto merged
2008-02-21 19:53:37 -05:00
unknown
9f245df853 Post-merge fix to silence compiler warning.
sql/sql_prepare.cc:
  Removed unused variable.
2008-02-21 19:28:25 -02:00
unknown
315665cf67 Bug#32890 Crash after repeated create and drop of tables and views
The problem is that CREATE VIEW statements inside prepared statements
weren't being expanded during the prepare phase, which leads to objects
not being allocated in the appropriate memory arenas.

The solution is to perform the validation of CREATE VIEW statements
during the prepare phase of a prepared statement. The validation
during the prepare phase assures that transformations of the parsed
tree will use the permanent arena of the prepared statement.


mysql-test/r/ps.result:
  Add test case result for Bug#32890
mysql-test/t/ps.test:
  Add test case for Bug#32890
sql/item.h:
  Restore original field name if name is auto generated.
sql/sql_prepare.cc:
  Validate and prepare a CREATE VIEW statement for execution.
sql/sql_view.cc:
  Move privileges check to it's own function.
sql/sql_view.h:
  Export function which check privileges of a CREATE VIEW statement.
2008-02-21 14:58:29 -03:00
unknown
d8c8fd5b4f Fix for Bug#33065: Mysql not writing general query logs after
sending SIGHUP.

There were two problems:
  - after some recent fix, the server started to crash after
    receiving SIGHUP. That happened because LEX of new THD-object
    was not properly initialized.
  - user-specified log options were ignored when logs were reopened.

The fix is to 1) initialize LEX and 2) take user-specified options
into account.

There is no test case in this CS, because our test suite does not
support sending SIGHUP to the server.


sql/mysqld.cc:
  Use proper logging after SIGHUP.
sql/sql_parse.cc:
  Initialize LEX of new THD -- it is required to avoid crash
  in SIGHUP handling.
2008-02-21 14:49:27 +03:00
unknown
fa08b28085 Fix for Bug#34337: Server crash when Altering a view using
a table name.
  
The problem was that fill_defined_view_parts() did not return
an error if a table is going to be altered. That happened if
the table was already in the table cache. In that case,
open_table() returned non-NULL value (valid TABLE-instance from
the cache).
  
The fix is to ensure that an error is thrown even if the table
is in the cache.

(This is a backport of the original patch for 5.1)


mysql-test/r/view.result:
  Fix result file.
mysql-test/r/view_grant.result:
  Fix result file.
mysql-test/t/view.test:
  Add a test case for Bug#34337: Server crash when Altering a view
  using a table name.
mysql-test/t/view_grant.test:
  Fix order-dependency.
sql/sql_view.cc:
  Report an error if we're going to work with a table.
2008-02-21 12:17:32 +03:00
unknown
a66767311c Merge xiphis.org:/anubis/antony/work/mysql-5.1-engines
into  xiphis.org:/anubis/antony/work/merge.20080220/mysql-5.1
2008-02-20 22:47:08 -08:00
unknown
c3a5c0a076 Merge xiphis.org:/anubis/antony/work/mysql-5.0-engines
into  xiphis.org:/anubis/antony/work/merge.20080220/mysql-5.0
2008-02-20 22:42:24 -08:00
unknown
88421ee503 Post-merge fixes for bugs 34587 and 32265.
mysql-test/r/view.result:
  Drop created view.
mysql-test/t/view.test:
  Update test result.
sql/sql_cursor.cc:
  Fix compilation failure.
tests/mysql_client_test.c:
  Manual merge.
2008-02-20 23:30:29 -02:00
unknown
54fc802a6c Merge vvaintroub@bk-internal.mysql.com:/home/bk/mysql-5.0-build
into  wva.:C:/bk/bug31745_2/mysql-5.0-build


sql/sql_parse.cc:
  Auto merged
2008-02-21 02:22:02 +01:00
unknown
96b4648b01 Merge buzz.(none):/home/davi/mysql-5.0-runtime
into  buzz.(none):/home/davi/mysql-5.1-runtime


sql/sql_cursor.cc:
  Auto merged
tests/mysql_client_test.c:
  SCCS merged
2008-02-20 23:18:40 -02:00
unknown
b4e1e5e5dc Merge vvaintroub@bk-internal.mysql.com:/home/bk/mysql-5.1-build
into  wva.:C:/bk/bug31745_2/mysql-5.1-build


sql/mysqld.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/stacktrace.h:
  Auto merged
sql/stacktrace.c:
  SCCS merged
2008-02-21 01:53:35 +01:00
unknown
7b85da497e Merge aelkin@bk-internal.mysql.com:/home/bk/mysql-5.1-new-rpl
into  mysql1000.(none):/home/andrei/MySQL/FIXES/5.1/bug31316-sss_server_id_clashes


sql/slave.cc:
  Auto merged
2008-02-20 23:25:01 +02:00
unknown
e19c8e2ebf Bug #31316 Report server id clashes in SHOW SLAVE STATUS
"Server_IO_State" field

Critical error messages from get_master_version_and_clock() were written
only to the slave errorlog while Show slave status did not display any
incident happened.

Although the artifact was reported for a particular --replicate-same-server-id
related issue the fix refines all critical error reporting with 
deploying rli->report().

The test for the bug covers only --replicate-same-server-id error reporting.


mysql-test/suite/rpl/r/rpl_server_id1.result:
  new results reflecting changes
mysql-test/suite/rpl/t/rpl_server_id1.test:
  Preserving the idea of the test unnecessary queries and the sleep are
  eliminated.
  In the end the slave must stop with the error displayable via $$$.
sql/slave.cc:
  improving get_master_version_and_clock() code to report a critical incident
  via rli->report() that takes care of bothe the error log and
  the slave's status info placeholders.
  
  A critical error that force the IO slave thread to terminate is handled
  immediately (goto err).
2008-02-20 23:18:01 +02:00
unknown
25ac83c0a9 Merge bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into  mysql.com:/Users/davi/mysql/mysql-5.1-runtime


mysql-test/r/view.result:
  Auto merged
mysql-test/t/view.test:
  Auto merged
sql/sql_view.cc:
  Auto merged
2008-02-20 17:30:12 -03:00
unknown
43717ba1d1 Merge mysql.com:/Users/davi/mysql/bugs/34587-5.1
into  mysql.com:/Users/davi/mysql/mysql-5.1-runtime


sql/sql_view.cc:
  Auto merged
2008-02-20 17:29:29 -03:00
unknown
7114fbb943 Bug#34587 Creating a view inside a stored procedure leads to a server crash
The problem is that when a stored procedure is being parsed for
the first execution, the body is copied to a temporary buffer
which is disregarded sometime after the statement is parsed.
And during this parsing phase, the rule for CREATE VIEW was
holding a reference to the string being parsed for use during
the execution of the CREATE VIEW statement, leading to invalid
memory access later.

The solution is to allocate and copy the SELECT of a CREATE
VIEW statement using the thread memory root, which is set to
the permanent arena of the stored procedure. 


mysql-test/r/view.result:
  Add test case result for Bug#34587
mysql-test/t/view.test:
  Add test case for Bug#34587
sql/sql_lex.h:
  Remove start and end position variables. The SELECT of a
  CREATE VIEW is now allocated at parse time.
sql/sql_view.cc:
  Remove assertion that is not true when the statement is
  being re-executed. Use string that was trimmed of leading
  and trailing whitespace at parse time.
sql/sql_yacc.yy:
  Allocate the SELECT of a CREATE VIEW using the current thread
  memory root and remove any leading and trailing whitespace.
2008-02-20 17:26:50 -03:00
unknown
a399fefd56 Bug#32265 Server returns different metadata if prepared statement is used
Executing a prepared statement associated with a materialized
cursor yields to the client a metadata packet with wrong table
and database names. The problem was occurring because the server
was sending the the name of the temporary table used by the cursor
instead of the table name of the original table. The same problem
occurs when selecting from views, in which case the table name was
being sent and not the name of the view.
  
The solution is to fill the list item from the temporary table but
preserving the table and database names of the original fields. This
is achieved by tweaking the Select_materialize to accept a pointer to
the Materialized_cursor class which contains the item list to be filled.


sql/sql_cursor.cc:
  Fill the item list in the send_fields method and preserve
  the table and database name of the fields.
tests/mysql_client_test.c:
  Add test case for Bug#32265
2008-02-20 16:45:24 -03:00
unknown
985e952347 Fix for Bug#34337: Server crash when Altering a view using
a table name.

The problem was that fill_defined_view_parts() did not return
an error if a table is going to be altered. That happened if
the table was already in the table cache. In that case,
open_table() returned non-NULL value (valid TABLE-instance from
the cache).

The fix is to ensure that an error is thrown even if the table
is in the cache.


mysql-test/r/view.result:
  Fix result file.
mysql-test/t/view.test:
  Add a test case for Bug#34337: Server crash when Altering a view
  using a table name.
sql/sql_view.cc:
  Report an error if we're going to work with a table.
2008-02-20 22:23:39 +03:00
unknown
5408421019 Merge dl145h.mysql.com:/data0/mkindahl/mysql-5.1
into  dl145h.mysql.com:/data0/mkindahl/mysql-5.1-rpl


sql/handler.cc:
  Auto merged
2008-02-20 19:27:06 +01:00
unknown
0e767df5e0 Merge dl145h.mysql.com:/data0/mkindahl/mysql-5.0
into  dl145h.mysql.com:/data0/mkindahl/mysql-5.0-rpl
2008-02-20 19:25:18 +01:00
unknown
f7c575e43c Merge mysql.com:/home/svoj/devel/mysql/BUG34289/mysql-5.0-engines
into  mysql.com:/home/svoj/devel/mysql/BUG34289/mysql-5.1-engines


mysql-test/r/func_misc.result:
  Auto merged
mysql-test/t/func_misc.test:
  Auto merged
sql/item.cc:
  Auto merged
2008-02-20 21:22:21 +04:00
unknown
27498bbaba Fixed a test.
mysql-test/r/change_user.result:
  Replaced value in result file, it was dependend on architecture.
mysql-test/t/change_user.test:
  Replaced an architecture dependend value in test
sql/mysqld.cc:
  Can be made shorter and without ifdefs.
2008-02-20 16:59:03 +02:00
unknown
46db2da52f Removed the unused function int THD::binlog_flush_transaction_cache() 2008-02-20 15:22:14 +01:00
unknown
6988f45e6b WL#4078: Document binary format of binlog entries
Minor update with corrections and notes on the binlog format.
This only affects comments, not code.


sql/log_event.h:
  Fixes in documentation of binlog format.
2008-02-20 14:52:21 +01:00
unknown
9dfc925db0 Upon the sql command flush logs, we need to ensure that all outstanding
ndb data to be logged has made it to the binary log to get a deterministic
behavior on the rotation of the log.
2008-02-20 12:52:04 +01:00
unknown
4a05e13d17 Merge xiphis.org:/anubis/antony/work/p1-bug34598.2
into  xiphis.org:/anubis/antony/work/p1-bug34598.2.merge.maria


include/mysql/plugin.h:
  Auto merged
sql/sql_plugin.cc:
  Auto merged
2008-02-19 14:01:08 -08:00
unknown
3b2aea3839 Merge ramayana.hindu.god:/home/tsmith/m/inno/feb18/51
into  ramayana.hindu.god:/home/tsmith/m/bk/build/51
2008-02-19 15:00:13 -07:00
unknown
173efef438 Merge kaamos.(none):/data/src/opt/bug31236/my51-bug31236
into  kaamos.(none):/data/src/opt/mysql-5.1-opt


configure.in:
  Auto merged
mysql-test/r/strict.result:
  Auto merged
sql/field.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/unireg.h:
  Auto merged
2008-02-20 00:37:51 +03:00
unknown
53fe1435e6 Merge xiphis.org:/anubis/antony/work/p1-bug34598.2
into  xiphis.org:/anubis/antony/work/p1-bug34598.2.merge.1


sql/sql_plugin.cc:
  Auto merged
2008-02-19 13:36:49 -08:00
unknown
61c31af45d Fix for bug #31236: Inconsistent division by zero behavior for
floating point numbers

Some math functions did not check if the result is a valid number
(i.e. neither of +-inf or nan).

Fixed by validating the result where necessary and returning NULL in
case of invalid result.


BitKeeper/deleted/.del-matherr.c:
  Rename: sql/matherr.c -> BitKeeper/deleted/.del-matherr.c
configure.in:
  Removed DONT_USE_FINITE, it is not used anywhere.
include/my_global.h:
  isfinite() is a C99 macro which absoletes finite(). First try to use
  it, then fall back to finite() if the target platform has it,
  otherwise use our own implementation.
mysql-test/r/func_math.result:
  Added a test case for bug #31236.
mysql-test/r/strict.result:
  Fixed a test case which relied on old behavior.
mysql-test/t/func_math.test:
  Added a test case for bug #31236.
mysql-test/t/strict.test:
  Fixed a test case which relied on old behavior.
sql/field.cc:
  No need to check if the finite() or its equivalent is available.
sql/item_func.cc:
  Use fix_result() wherever the result can be one of +-inf or nan, 
  assuming the function arguments are valid numbers.
  Removed fix_result() from functions that are defined for all possible
  input numbers.
sql/item_func.h:
  Moved fix_result() from Item_dec_func to Item_func which is a common
  ancestor for Item_dec_func and Item_num_op.
sql/unireg.h:
  Removed POSTFIX_ERROR because no code returns it.
2008-02-20 00:33:43 +03:00
unknown
0b6bc7ef84 Merge bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into  dipika.(none):/opt/local/work/mysql-5.1-runtime
2008-02-20 00:32:03 +03:00
unknown
a1915039e8 Bug#34598
"crash on hpita: Invalid address alignment"
  Replace dangerous pointer arithmetic - it may occurr where sizeof(int) is
  less than size of machine alignment requirement.


include/mysql/plugin.h:
  bug34598
    change of update func prototype
sql/sql_plugin.cc:
  bug34598
    Avoid dangerous pointer arithmetic which can cause unaligned word access.
    Change of update function prototype
2008-02-19 12:55:13 -08:00
unknown
533d435463 Fix a compilation failure of the community tree. 2008-02-19 23:47:15 +03:00
unknown
ded39d5a5e Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.1
into  poseidon.bredbandsbolaget.se:/home/tomas/mysql-5.1-new-ndb-merge
2008-02-19 20:56:14 +01:00
unknown
4b25d5b10c Applied InnoDB snapshot innodb-5.1-ss2298
Fixes the following bugs:

- Bug #33349: possible race condition revolving around data dictionary and repartitioning
  Introduce retry/sleep logic as a workaround for a transient bug
  where ::open fails for partitioned tables randomly if we are using
  one file per table.

- Bug #34053: normal users can enable innodb_monitor logging
  In CREATE TABLE and DROP TABLE check whether the table in question is one
  of the magic innodb_monitor tables and whether the user has enough rights
  to mess with it before doing anything else.

- Bug #22868: 'Thread thrashing' with > 50 concurrent conns under an upd-intensive workloadw
- Bug #29560: InnoDB >= 5.0.30 hangs on adaptive hash rw-lock 'waiting for an X-lock'
  This is a combination of changes that forward port the scalability fix applied to 5.0
  through r1001.
  It reverts changes r149 and r122 (these were 5.1 specific changes made in lieu of
  scalability fix of 5.0)
  Then it applies r1001 to 5.0 which is the original scalability fix.
  Finally it applies r2082 which fixes an issue with the original fix.

- Bug #30930: Add auxiliary function to retrieve THD::thread_id
  Add thd_get_thread_id() function.  Also make check_global_access() function
  visible to InnoDB under INNODB_COMPATIBILITY_HOOKS #define.


include/mysql/plugin.h:
  Add thd_get_thread_id() accessor function
mysql-test/r/innodb.result:
  Applied InnoDB snapshot innodb-5.1-ss2298
  
  Revision r2261:
  branches/5.1: Merge a change from MySQL AB:
  
  ChangeSet@2007-10-13 15:49:42+03:00, aelkin@koti.dsl.inet.fi
  
  Bug #29136 erred multi-delete on trans table does not rollback the statement
  
  innodb.test, innodb.result: trans table specific test added
mysql-test/t/innodb.test:
  Applied InnoDB snapshot innodb-5.1-ss2298
sql/mysql_priv.h:
  Make check_global_access() declaration available if when
  INNODB_COMPATIBILITY_HOOKS is defined.
sql/sql_class.cc:
  Add thd_get_thread_id() accessor function.
  
  Add 'extern "C"' to definition for thd_get_xid().  Not strictly
  needed, but in keeping with our coding style.
storage/innobase/btr/btr0cur.c:
  Applied InnoDB snapshot innodb-5.1-ss2298
  
  Revision r2295:
  branches/5.1:
  
  Merge r2294 from branches/5.0:
  
  Fix typo and add comma in comment.
storage/innobase/handler/ha_innodb.cc:
  Applied InnoDB snapshot innodb-5.1-ss2298
  
  - But remove the declaration of check_global_access() from ha_innodb.cc,
    because it is now visible in mysql_priv.h under INNODB_COMPATIBILITY_HOOKS
  
  Revision r2270:
  branches/5.1:
  
  Rename the user visible parameter innodb-use-adaptive-hash-indexes to
  innodb-adaptive-hash-index so that it is in sync with MySQL 5.0.
  
  Suggested by:	Heikki
  Approved by:	Heikki
  
  
  Revision r2236:
  branches/5.1: bug#33349
  
  Introduce retry/sleep logic as a workaround for a transient bug
  where ::open fails for partitioned tables randomly if we are using
  one file per table.
  
  
  Reviewed by: Heikki
  
  
  Revision r2282:
  branches/5.1:
  
  Fix Bug#34053:
  * In CREATE TABLE and DROP TABLE check whether the table in question is one
    of the magic innodb_monitor tables and whether the user has enough rights
    to mess with it before doing anything else.
  * Implement a mysql-test testcase.
  
  Approved by:	Heikki
  
  
  Revision r2246:
  branches/5.1:
  
  Fix formatting of the autoinc-lock-mode command line parameter.
  
  Old view (./mysqld --help --verbose):
  
    --innodb-autoinc-lock-mode=#
                        The AUTOINC lock modes supported by InnoDB:
    0 => Old
                        style AUTOINC locking (for backward compatibility)
    1 =>
                        New style AUTOINC locking
    2 => No AUTOINC locking
                        (unsafe for SBR)
  
  New view:
  
    --innodb-autoinc-lock-mode=#
                        The AUTOINC lock modes supported by InnoDB:
                        0 => Old style AUTOINC locking (for backward
                        compatibility)
                        1 => New style AUTOINC locking
                        2 => No AUTOINC locking (unsafe for SBR)
  
  Looks like these strings are "automatically" wrapped by MySQL in the
  following way:
  * newlines (\n) in the string are ignored
  * newline separator (\n) is inserted every 57 or so characters.
  * lots of white space is appended to each inserted new line.
  
  Approved by:	Heikki
storage/innobase/include/os0sync.h:
  Applied InnoDB snapshot innodb-5.1-ss2298
  
  Revision r2268:
  branches/5.1: Port of r2267
  
  This is a combination of changes that forward port the scalability fix applied to 5.0
  through r1001.
  It reverts changes r149 and r122 (these were 5.1 specific changes made in lieu of
  scalability fix of 5.0)
  Then it applies r1001 to 5.0 which is the original scalability fix.
  Finally it applies r2082 which fixes an issue with the original fix.
  
  Reviewed by: Heikki
storage/innobase/include/read0read.h:
  Applied InnoDB snapshot innodb-5.1-ss2298
  
  Revision r2188:
  branches/5.1: Remove unused field can_be_too_old from read_view_struct.
storage/innobase/include/row0mysql.h:
  Applied InnoDB snapshot innodb-5.1-ss2298
  
  Revision r2282:
  branches/5.1:
  
  Fix Bug#34053:
  * In CREATE TABLE and DROP TABLE check whether the table in question is one
    of the magic innodb_monitor tables and whether the user has enough rights
    to mess with it before doing anything else.
  * Implement a mysql-test testcase.
  
  Approved by:	Heikki
  
  
  Revision r2272:
  branches/5.1:
  
  Fix typo in comment.
storage/innobase/include/sync0arr.h:
  Applied InnoDB snapshot innodb-5.1-ss2298
  
  Revision r2268:
  branches/5.1: Port of r2267
  
  This is a combination of changes that forward port the scalability fix applied to 5.0
  through r1001.
  It reverts changes r149 and r122 (these were 5.1 specific changes made in lieu of
  scalability fix of 5.0)
  Then it applies r1001 to 5.0 which is the original scalability fix.
  Finally it applies r2082 which fixes an issue with the original fix.
  
  Reviewed by: Heikki
storage/innobase/include/sync0rw.h:
  Applied InnoDB snapshot innodb-5.1-ss2298
  
  Revision r2268:
  branches/5.1: Port of r2267
  
  This is a combination of changes that forward port the scalability fix applied to 5.0
  through r1001.
  It reverts changes r149 and r122 (these were 5.1 specific changes made in lieu of
  scalability fix of 5.0)
  Then it applies r1001 to 5.0 which is the original scalability fix.
  Finally it applies r2082 which fixes an issue with the original fix.
  
  Reviewed by: Heikki
storage/innobase/include/sync0rw.ic:
  Applied InnoDB snapshot innodb-5.1-ss2298
  
  Revision r2268:
  branches/5.1: Port of r2267
  
  This is a combination of changes that forward port the scalability fix applied to 5.0
  through r1001.
  It reverts changes r149 and r122 (these were 5.1 specific changes made in lieu of
  scalability fix of 5.0)
  Then it applies r1001 to 5.0 which is the original scalability fix.
  Finally it applies r2082 which fixes an issue with the original fix.
  
  Reviewed by: Heikki
storage/innobase/include/sync0sync.h:
  Applied InnoDB snapshot innodb-5.1-ss2298
  
  Revision r2268:
  branches/5.1: Port of r2267
  
  This is a combination of changes that forward port the scalability fix applied to 5.0
  through r1001.
  It reverts changes r149 and r122 (these were 5.1 specific changes made in lieu of
  scalability fix of 5.0)
  Then it applies r1001 to 5.0 which is the original scalability fix.
  Finally it applies r2082 which fixes an issue with the original fix.
  
  Reviewed by: Heikki
storage/innobase/include/sync0sync.ic:
  Applied InnoDB snapshot innodb-5.1-ss2298
  
  Revision r2268:
  branches/5.1: Port of r2267
  
  This is a combination of changes that forward port the scalability fix applied to 5.0
  through r1001.
  It reverts changes r149 and r122 (these were 5.1 specific changes made in lieu of
  scalability fix of 5.0)
  Then it applies r1001 to 5.0 which is the original scalability fix.
  Finally it applies r2082 which fixes an issue with the original fix.
  
  Reviewed by: Heikki
storage/innobase/os/os0sync.c:
  Applied InnoDB snapshot innodb-5.1-ss2298
  
  Revision r2268:
  branches/5.1: Port of r2267
  
  This is a combination of changes that forward port the scalability fix applied to 5.0
  through r1001.
  It reverts changes r149 and r122 (these were 5.1 specific changes made in lieu of
  scalability fix of 5.0)
  Then it applies r1001 to 5.0 which is the original scalability fix.
  Finally it applies r2082 which fixes an issue with the original fix.
  
  Reviewed by: Heikki
storage/innobase/read/read0read.c:
  Applied InnoDB snapshot innodb-5.1-ss2298
  
  Revision r2188:
  branches/5.1: Remove unused field can_be_too_old from read_view_struct.
storage/innobase/row/row0mysql.c:
  Applied InnoDB snapshot innodb-5.1-ss2298
  
  Revision r2282:
  branches/5.1:
  
  Fix Bug#34053:
  * In CREATE TABLE and DROP TABLE check whether the table in question is one
    of the magic innodb_monitor tables and whether the user has enough rights
    to mess with it before doing anything else.
  * Implement a mysql-test testcase.
  
  Approved by:	Heikki
  
  
  Revision r2272:
  branches/5.1:
  
  Fix typo in comment.
storage/innobase/srv/srv0srv.c:
  Applied InnoDB snapshot innodb-5.1-ss2298
  
  Revision r2268:
  branches/5.1: Port of r2267
  
  This is a combination of changes that forward port the scalability fix applied to 5.0
  through r1001.
  It reverts changes r149 and r122 (these were 5.1 specific changes made in lieu of
  scalability fix of 5.0)
  Then it applies r1001 to 5.0 which is the original scalability fix.
  Finally it applies r2082 which fixes an issue with the original fix.
  
  Reviewed by: Heikki
storage/innobase/sync/sync0arr.c:
  Applied InnoDB snapshot innodb-5.1-ss2298
  
  Revision r2268:
  branches/5.1: Port of r2267
  
  This is a combination of changes that forward port the scalability fix applied to 5.0
  through r1001.
  It reverts changes r149 and r122 (these were 5.1 specific changes made in lieu of
  scalability fix of 5.0)
  Then it applies r1001 to 5.0 which is the original scalability fix.
  Finally it applies r2082 which fixes an issue with the original fix.
  
  Reviewed by: Heikki
storage/innobase/sync/sync0rw.c:
  Applied InnoDB snapshot innodb-5.1-ss2298
  
  Revision r2268:
  branches/5.1: Port of r2267
  
  This is a combination of changes that forward port the scalability fix applied to 5.0
  through r1001.
  It reverts changes r149 and r122 (these were 5.1 specific changes made in lieu of
  scalability fix of 5.0)
  Then it applies r1001 to 5.0 which is the original scalability fix.
  Finally it applies r2082 which fixes an issue with the original fix.
  
  Reviewed by: Heikki
storage/innobase/sync/sync0sync.c:
  Applied InnoDB snapshot innodb-5.1-ss2298
  
  Revision r2268:
  branches/5.1: Port of r2267
  
  This is a combination of changes that forward port the scalability fix applied to 5.0
  through r1001.
  It reverts changes r149 and r122 (these were 5.1 specific changes made in lieu of
  scalability fix of 5.0)
  Then it applies r1001 to 5.0 which is the original scalability fix.
  Finally it applies r2082 which fixes an issue with the original fix.
  
  Reviewed by: Heikki
mysql-test/r/innodb_bug34053.result:
  Applied InnoDB snapshot innodb-5.1-ss2298
  
  Revision r2282:
  branches/5.1:
  
  Fix Bug#34053:
  * In CREATE TABLE and DROP TABLE check whether the table in question is one
    of the magic innodb_monitor tables and whether the user has enough rights
    to mess with it before doing anything else.
  * Implement a mysql-test testcase.
  
  Approved by:	Heikki
mysql-test/t/innodb_bug34053.test:
  Applied InnoDB snapshot innodb-5.1-ss2298
  
  Revision r2282:
  branches/5.1:
  
  Fix Bug#34053:
  * In CREATE TABLE and DROP TABLE check whether the table in question is one
    of the magic innodb_monitor tables and whether the user has enough rights
    to mess with it before doing anything else.
  * Implement a mysql-test testcase.
  
  Approved by:	Heikki
2008-02-19 09:44:09 -07:00
unknown
1ac319248f Bug #30604: different flagging of time_zone_used in normal
and ps-protocol
Finding a routine should be a transparent operation as 
far as the binary log is concerned.
But it was influencing the binary log because of the TIMESTAMP
column in the proc table.

Fixed by preserving and restoring the time_zone usage flag when
searching for a stored routine in the proc table.


mysql-test/r/binlog_innodb.result:
  Bug #30604: test case
mysql-test/r/ctype_cp932_binlog.result:
  Bug #30604: updated test results (a procedure call before that)
mysql-test/t/binlog_innodb.test:
  Bug #30604: test case
sql/sp.cc:
  Bug #30604: finding a routine should be a transparent operation as 
  far as the binary log is concerned.
  Fixed by preserving and restoring the time_zone usage flag.
2008-02-19 17:27:18 +02:00
unknown
f802cd5123 BUG#34289 - Incorrect NAME_CONST substitution in stored procedures
breaks replication

NAME_CONST() didn't replicate constant character set and collation
correctly.

With this fix NAME_CONST() inherits collation from the value argument.


mysql-test/r/func_misc.result:
  A test case for BUG#34289.
mysql-test/t/func_misc.test:
  A test case for BUG#34289.
sql/item.cc:
  Inherit collation from value argument.
2008-02-19 18:16:17 +04:00
unknown
c0f54824ad Merge dl145h.mysql.com:/data0/mkindahl/mysql-5.1-rpl-merge
into  dl145h.mysql.com:/data0/mkindahl/mysql-5.1-rpl


mysql-test/r/ctype_ucs.result:
  Auto merged
mysql-test/r/variables.result:
  Auto merged
mysql-test/t/ctype_ucs.test:
  Auto merged
mysql-test/t/variables.test:
  Auto merged
sql/slave.cc:
  Auto merged
2008-02-19 14:47:29 +01:00
unknown
86301df6d4 Merge bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into  mysql.com:/Users/davi/mysql/mysql-5.1-runtime


sql/sql_update.cc:
  Auto merged
2008-02-19 10:39:14 -03:00
unknown
90313b02e2 Merge mysql.com:/Users/davi/mysql/bugs/23771-5.1
into  mysql.com:/Users/davi/mysql/mysql-5.1-runtime
2008-02-19 10:36:31 -03:00
unknown
8b91756be1 Post-merge fix 2008-02-19 14:25:26 +01:00
unknown
13791914a5 Merge wva.:C:/bk/bug31745_2/my51_31754_2/..\my50-bug31745_2
into  wva.:C:/bk/bug31745_2/my51_31754_2


sql/CMakeLists.txt:
  Auto merged
sql/stacktrace.c:
  Auto merged
sql/sql_parse.cc:
  merge.
sql/mysqld.cc:
  merge
sql/stacktrace.h:
  merge
2008-02-19 14:20:46 +01:00
unknown
9060b50f14 Rename send_eof() to my_eof() for consistency with my_ok() and my_error() 2008-02-19 15:58:08 +03:00
unknown
14021c96c4 Rename send_ok to my_ok. Similarly to my_error, it only records the status,
does not send it to the client.
2008-02-19 15:45:21 +03:00
unknown
ead02981ea Merge bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into  dipika.(none):/opt/local/work/mysql-5.1-2pc-opt-merge-push


mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result:
  Auto merged
mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result:
  Auto merged
sql/ha_ndbcluster_binlog.cc:
  Auto merged
sql/log.cc:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/sp.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
mysql-test/suite/rpl_ndb/t/disabled.def:
  Manual merge.
2008-02-19 14:53:22 +03:00
unknown
526798dbb5 A fix and a test case for Bug#12713 "Error in a stored function called from
a SELECT doesn't cause ROLLBACK of statem".

The idea of the fix is to ensure that we always commit the current
statement at the end of dispatch_command(). In order to not issue
redundant disc syncs, an optimization of the two-phase commit
protocol is implemented to bypass the two phase commit if
the transaction is read-only.


mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result:
  Update test results.
mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result:
  Update test results.
mysql-test/suite/rpl_ndb/t/disabled.def:
  Disable the tests, for which this changeset reveals a bug:
  the injector thread does not always add 'statement commit' to the
  rows injected in circular replication set up.
  To be investigated separately.
sql/ha_ndbcluster_binlog.cc:
  Add close_thread_tables() to run_query: this ensures
  that all tables are closed and there is no pending statement transaction.
sql/handler.cc:
  Implement optimisation of read-only transactions.
  If a transaction consists only of DML statements that do not change
  data, we do not perform a two-phase commit for it 
  (run one phase commit only).
sql/handler.h:
  Implement optimisation of read-only transactions.
  If a transaction consists only of DML statements that do not change
  data, we do not perform a two-phase commit for it 
  (run one phase commit only).
sql/log.cc:
  Mark the binlog transaction read-write whenever it's started.
  We never read from binlog, so it's safe and least intrusive to add
  this mark up here.
sql/log_event.cc:
  Update to the new layout of thd->transaction.
sql/rpl_injector.cc:
  Always commit statement transaction before committing the global one.
sql/sp.cc:
  Ad comments.
sql/sp_head.cc:
  Add comments.
sql/sql_base.cc:
  Commit transaction at the end of the statement. Always.
sql/sql_class.cc:
  Update thd_ha_data to return the right pointer in the new layout.
  
  Fix select_dumpvar::send_data to properly return operation status.
  A test case from commit.inc would lead to an assertion failure in the 
  diagnostics area (double assignment). Not test otherwise by the test suite.
sql/sql_class.h:
  Implement a new layout of storage engine transaction info in which 
  it is easy to access all members related to the handlerton only
  based on ht->slot.
sql/sql_cursor.cc:
  Update to the new layout of thd->transaction.
sql/sql_delete.cc:
  Remove wrong and now redundant calls to ha_autocommit_or_rollback.
  The transaction is committed in one place, at the end of the statement.
  Remove calls to mysql_unlock_tables, since some engines count locks
  and commit statement transaction in unlock_tables(), which essentially
  equates mysql_unlock_tables to ha_autocommit_or_rollback.
  Previously it was necessary to unlock tables soon because we wanted
  to avoid sending of 'ok' packet to the client under locked tables.
  This is no longer necessary, since OK packet is also sent from one place
  at the end of transaction.
sql/sql_do.cc:
  Add DO always clears the error, we must rollback the current
  statement before this happens. Otherwise the statement will be committed,
  and not rolled back in the end.
sql/sql_insert.cc:
  Remove wrong and now redundant calls to ha_autocommit_or_rollback.
  The transaction is committed in one place, at the end of the statement.
  Remove calls to mysql_unlock_tables, since some engines count locks
  and commit statement transaction in unlock_tables(), which essentially
  equates mysql_unlock_tables to ha_autocommit_or_rollback.
  Previously it was necessary to unlock tables soon because we wanted
  to avoid sending of 'ok' packet to the client under locked tables.
  This is no longer necessary, since OK packet is also sent from one place
  at the end of transaction.
sql/sql_load.cc:
  Remove wrong and now redundant calls to ha_autocommit_or_rollback.
  The transaction is committed in one place, at the end of the statement.
  Remove calls to mysql_unlock_tables, since some engines count locks
  and commit statement transaction in unlock_tables(), which essentially
  equates mysql_unlock_tables to ha_autocommit_or_rollback.
  Previously it was necessary to unlock tables soon because we wanted
  to avoid sending of 'ok' packet to the client under locked tables.
  This is no longer necessary, since OK packet is also sent from one place
  at the end of transaction.
sql/sql_parse.cc:
  Implement optimisation of read-only transactions: bypass 2-phase
  commit for them.
  Always commit statement transaction before commiting the global one.
  Fix an unrelated crash in check_table_access, when called from 
  information_schema.
sql/sql_partition.cc:
  Partitions commit at the end of a DDL operation.
  Make sure that send_ok() is done only if the commit has succeeded.
sql/sql_table.cc:
  Use ha_autocommit_or_rollback and end_active_trans everywhere.
  Add end_trans to mysql_admin_table, so that it leaves no pending
  transaction.
sql/sql_udf.cc:
  Remvove a redundant call to close_thread_tables()
sql/sql_update.cc:
  Remove wrong and now redundant calls to ha_autocommit_or_rollback.
  The transaction is committed in one place, at the end of the statement.
  Remove calls to mysql_unlock_tables, since some engines count locks
  and commit statement transaction in unlock_tables(), which essentially
  equates mysql_unlock_tables to ha_autocommit_or_rollback.
  Previously it was necessary to unlock tables soon because we wanted
  to avoid sending of 'ok' packet to the client under locked tables.
  This is no longer necessary, since OK packet is also sent from one place
  at the end of transaction.
mysql-test/include/commit.inc:
  New BitKeeper file ``mysql-test/include/commit.inc''
mysql-test/r/commit_1innodb.result:
  New BitKeeper file ``mysql-test/r/commit_1innodb.result''
mysql-test/t/commit_1innodb.test:
  New BitKeeper file ``mysql-test/t/commit_1innodb.test''
2008-02-19 14:43:01 +03:00
unknown
721d24124f Bug#31745 - crash handler does not work on Windows
- Replace per-thread signal()'s with  SetUnhandledExceptionFilter(). 
  The only remaining signal() is for SIGABRT (default abort()
  handler in VS2005 is broken, i.e removes user exception filter)
- remove MessageBox()'es  from error handling code
- Windows port for print_stacktrace() and write_core() 
- Cleanup, removed some unused functions


sql/CMakeLists.txt:
  Implement stack tracing on and generating crash dumps on Windows
sql/mysqld.cc:
  Correct signal handling on Windows. 
  - For console events, like CTRL-C use SetConsoleCtrlHandler
  - For exceptions like access violation, use SetUnhandledExceptionFilter
  - For SIGABRT generate exception via __debugbreak() intrinsic
    if built with VS2005 and later , since default SIGABRT handler 
    replaces unhandled exception filter specified by user
  - make provisions to debug exception filter, as it is not trivial 
  (should be compiled with /DDEBUG_UNHANDLED_EXCEPTION_FILTER)
sql/sql_parse.cc:
  Remove message box from windows signal handler.
  The only thread specific handler left is for SIGABRT,
  which is broken on VS2005 and later (user specified unhandled exception 
  filter gets overwritten)
sql/stacktrace.c:
  Stack tracing and generating crash dumps on Windows
sql/stacktrace.h:
  Implement print_stacktrace and write_core on Windows
2008-02-19 12:37:39 +01:00
unknown
ae25da10a3 Merge gbichot@bk-internal.mysql.com:/home/bk/mysql-5.1-build
into  gbichot4.local:/home/mysql_src/mysql-5.1-build-gca


client/mysqltest.c:
  Auto merged
include/my_sys.h:
  Auto merged
mysys/thr_lock.c:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sql_plugin.cc:
  Auto merged
2008-02-18 23:36:57 +01:00
unknown
34fff04d03 Merge gbichot4.local:/home/mysql_src/mysql-5.1-build-gca
into  gbichot4.local:/home/mysql_src/mysql-maria-monty


client/mysqldump.c:
  Auto merged
client/mysqltest.c:
  Auto merged
extra/replace.c:
  Auto merged
include/my_sys.h:
  Auto merged
libmysql/libmysql.c:
  Auto merged
mysys/my_getopt.c:
  Auto merged
mysys/thr_lock.c:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sql_plugin.cc:
  Auto merged
storage/myisam/mi_check.c:
  Auto merged
storage/myisam/mi_dynrec.c:
  Auto merged
storage/myisam/mi_search.c:
  Auto merged
storage/myisam/mi_update.c:
  Auto merged
storage/myisam/mi_write.c:
  Auto merged
storage/myisam/myisamlog.c:
  Auto merged
storage/myisam/myisampack.c:
  Auto merged
tests/mysql_client_test.c:
  Auto merged
include/my_global.h:
  merge
storage/myisam/myisamdef.h:
  merge
2008-02-18 23:35:17 +01:00
unknown
85213f6235 Fix for server bug experienced in Maria (wrong "Truncated incorrect <var_name>
value" error even though the value was correct): a C function in my_getopt.c
was taking bool* in parameter and was called from C++ sql_plugin.cc,
but on some Mac OS X sizeof(bool) is 1 in C and 4 in C++, giving funny
mismatches. Fixed, all other occurences of bool in C are removed, future
ones are blocked by a "C-bool-catcher" in my_global.h (use my_bool).


client/mysqldump.c:
  my_bool for C
client/mysqltest.c:
  my_bool for C
extra/replace.c:
  my_bool for C
include/my_getopt.h:
  my_bool for C
include/my_global.h:
  Prevent people from using bool in C, it causes real bugs.
include/my_sys.h:
  my_bool for C
include/my_time.h:
  my_bool for C
include/thr_lock.h:
  my_bool for C
libmysql/libmysql.c:
  my_bool for C
mysys/charset.c:
  my_bool for C
mysys/my_getopt.c:
  my_bool for C
mysys/queues.c:
  my_bool for C
mysys/thr_lock.c:
  my_bool for C
regex/reginit.c:
  my_bool for C
sql/set_var.cc:
  C functions use my_bool so we must use my_bool too.
sql/sql_plugin.cc:
  C functions use my_bool so we must use my_bool too.
  This fixes a real observed bug of Maria, because on some Mac OS X,
  sizeof(bool) is 1 in C and 4 in C++, so the bool* does wrong.
  Removing useless line.
storage/heap/hp_update.c:
  my_bool for C
storage/myisam/mi_check.c:
  my_bool for C
storage/myisam/mi_dynrec.c:
  my_bool for C
storage/myisam/mi_search.c:
  my_bool for C
storage/myisam/mi_update.c:
  my_bool for C
storage/myisam/mi_write.c:
  my_bool for C
storage/myisam/myisamdef.h:
  my_bool for C
storage/myisam/myisamlog.c:
  my_bool for C
storage/myisam/myisampack.c:
  my_bool for C
tests/mysql_client_test.c:
  my_bool for C
unittest/mysys/bitmap-t.c:
  my_bool for C
vio/viosslfactories.c:
  my_bool for C
2008-02-18 23:29:39 +01:00
unknown
a09384cba0 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.1-opt
into  magare.gmz:/home/kgeorge/mysql/autopush/warnings-5.1-opt
2008-02-18 18:23:05 +02:00
unknown
0ef346047d Fixed duplicate defition warning for bug 31887 2008-02-18 18:21:14 +02:00
unknown
06c85bc1f0 Merge abotchkov@bk-internal.mysql.com:/home/bk/mysql-5.1-opt
into  mysql.com:/home/hf/work/32942/my51-32942
2008-02-18 19:25:12 +04:00
unknown
18f885ed4c Merge bk@192.168.21.1:mysql-5.0-opt
into  mysql.com:/home/hf/work/32942/my50-32942


sql/sql_select.cc:
  Auto merged
mysql-test/r/select.result:
  merging
mysql-test/t/select.test:
  merging
2008-02-18 19:18:44 +04:00
unknown
da1a6127d6 Merge quad.:/mnt/raid/alik/MySQL/devel/5.1
into  quad.:/mnt/raid/alik/MySQL/devel/5.1-rt-merged


client/mysqlbinlog.cc:
  Auto merged
sql/slave.cc:
  Auto merged
sql/slave.h:
  Auto merged
sql/sql_class.cc:
  Auto merged
2008-02-18 18:12:37 +03:00
unknown
622635b663 Merge quad.:/mnt/raid/alik/MySQL/devel/5.0-rt
into  quad.:/mnt/raid/alik/MySQL/devel/5.1-rt-merged


client/mysqlbinlog.cc:
  Auto merged
sql/slave.cc:
  Auto merged
sql/slave.h:
  Auto merged
2008-02-18 18:12:05 +03:00
unknown
78d12b299e Merge bk@192.168.21.1:mysql-5.1-opt
into  mysql.com:/home/hf/work/32942/my51-32942


sql/sql_select.cc:
  Auto merged
mysql-test/r/select.result:
  merging
mysql-test/t/select.test:
  merging
2008-02-18 19:08:35 +04:00
unknown
16f69a3d54 Merge mysql.com:/home/hf/work/32942/my50-32942
into  mysql.com:/home/hf/work/32942/my51-32942


mysql-test/r/select.result:
  Auto merged
mysql-test/t/select.test:
  Auto merged
sql/sql_select.cc:
  Auto merged
2008-02-18 16:07:47 +04:00
unknown
9191052de5 Initialization order cleanups to get rid of warnings from the
-Wreorder option added by the patch for bug#31326.
2008-02-18 14:35:44 +03:00
unknown
02e7537f1c Merge ssh://bk-internal.mysql.com//home/bk/mysql-5.1-opt
into  kaamos.(none):/data/src/opt/mysql-5.1-opt


sql/mysql_priv.h:
  Auto merged
sql/item.cc:
  SCCS merged
2008-02-17 16:59:26 +03:00
unknown
787dbacab2 Merge ssh://bk-internal.mysql.com//home/bk/mysql-5.0-opt
into  kaamos.(none):/data/src/opt/mysql-5.0-opt


sql/item.cc:
  Auto merged
2008-02-17 16:57:07 +03:00
unknown
695865fee9 Merge kaamos.(none):/data/src/mysql-5.1
into  kaamos.(none):/data/src/opt/mysql-5.1-opt


libmysqld/lib_sql.cc:
  Auto merged
mysql-test/r/create.result:
  Auto merged
mysql-test/r/innodb_mysql.result:
  Auto merged
mysql-test/r/variables.result:
  Auto merged
BitKeeper/deleted/.del-rpl_ndb_charset.result:
  Auto merged
BitKeeper/deleted/.del-rpl_row_charset.result:
  Auto merged
BitKeeper/deleted/.del-rpl_row_charset.test:
  Auto merged
BitKeeper/deleted/.del-rpl_row_charset_innodb.result:
  Auto merged
mysql-test/t/create.test:
  Auto merged
mysql-test/t/sp.test:
  Auto merged
mysql-test/t/variables.test:
  Auto merged
sql/field.cc:
  Auto merged
sql/filesort.cc:
  Auto merged
sql/handler.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/share/errmsg.txt:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
mysql-test/lib/mtr_report.pl:
  Manual merge.
mysql-test/r/sp.result:
  Manual merge.
2008-02-17 14:57:01 +03:00
unknown
d6be1a9b95 Bug #32942 now() - interval '7200' second NOT pre-calculated, causing "full table scan"
Problem is not about intervals and doesn't actually cause 'full table scan'.
We have an optimization for DISTINCT when we have
'DISTINCT field_from_first_join_table' we don't need to read all the
rows from the JOIN-ed table if we found one conforming row.
It stopped working in 5.0 as we return NESTED_LOOP_OK if we came upon
that case in the evaluate_join_record() and that doesn't break the
recordreading loop in sub_select().

Fixed by returning NESTED_LOOP_NO_MORE_ROWS in this case.


mysql-test/r/select.result:
  Bug #32942 now() - interval '7200' second is NOT pre-calculated, causing "full table scan".
  
  test result
mysql-test/t/select.test:
  Bug #32942 now() - interval '7200' second is NOT pre-calculated, causing "full table scan"
  
  test case
sql/sql_select.cc:
  Bug #32942 now() - interval '7200' second NOT pre-calculated, causing "full table scan"
  
  return NESTED_LOOP_NO_MORE_ROWS when we don't need to read rows from
  this table anymore
2008-02-17 15:48:17 +04:00
unknown
4a834b4b12 Merge kaamos.(none):/data/src/mysql-5.0
into  kaamos.(none):/data/src/opt/mysql-5.0-opt


mysql-test/r/variables.result:
  Auto merged
mysql-test/t/variables.test:
  Auto merged
sql/item.cc:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
mysql-test/r/sp.result:
  Manual merge.
mysql-test/t/sp.test:
  Manual merge.
2008-02-17 14:37:39 +03:00
unknown
f5be846390 Merge mysql.com:/home/ram/work/b33304/b33304.5.0
into  mysql.com:/home/ram/work/b33304/b33304.5.1


sql/item_func.cc:
  Auto merged
2008-02-16 15:02:49 +04:00
unknown
e95c7b8a03 Merge magare.gmz:/home/kgeorge/mysql/work/B31887-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/work/B31887-5.1-opt


sql/item.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
2008-02-16 10:48:33 +02:00
unknown
8da41ba0bb Merge stella.local:/home2/mydev/mysql-5.1-amain
into  stella.local:/home2/mydev/mysql-5.1-axmrg


configure.in:
  Auto merged
2008-02-15 20:44:33 +01:00
unknown
40f7e29670 Merge stella.local:/home2/mydev/mysql-5.0-amain
into  stella.local:/home2/mydev/mysql-5.0-axmrg
2008-02-15 20:06:15 +01:00
unknown
0946b1d2a7 Merge dl145h.mysql.com:/data0/mkindahl/mysql-5.0-rpl-merge
into  dl145h.mysql.com:/data0/mkindahl/mysql-5.0-rpl
2008-02-15 17:51:35 +01:00
unknown
51cd734d8a Merge dl145h.mysql.com:/data0/mkindahl/mysql-5.0-rpl
into  dl145h.mysql.com:/data0/mkindahl/mysql-5.1-rpl


sql/sql_delete.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
BitKeeper/deleted/.del-rpl_variables.test:
  Manual merge.
mysql-test/r/multi_update.result:
  Manual merge.
mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result:
  Manual merge.
sql/slave.cc:
  Manual merge.
2008-02-15 17:49:05 +01:00
unknown
0529125af1 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/autopush/B31887-5.0-opt


sql/item.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
2008-02-15 18:34:03 +02:00
unknown
ad144fa6e1 Merge hynda.mysql.fi:/home/my/mysql-5.1-main
into  hynda.mysql.fi:/home/my/mysql-5.1-marvel


sql/mysqld.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
include/my_base.h:
  Manual merge between main 5.1 and team tree.
2008-02-15 17:58:09 +02:00