Commit graph

23193 commits

Author SHA1 Message Date
unknown
2a0f4e4faf Merge bk@192.168.21.1:mysql-5.0-opt
into  mysql.com:/home/hf/work/31758/my50-31758
2007-11-05 19:07:03 +04:00
unknown
c98b7fe5b7 Merge mysql.com:/home/hf/work/31758/my50-31758
into  mysql.com:/home/hf/work/31758/my51-31758


mysql-test/t/func_str.test:
  Auto merged
sql/item_strfunc.h:
  Auto merged
mysql-test/r/func_str.result:
  merging
2007-11-05 18:27:17 +04:00
unknown
62617b09c3 Merge mysql.com:/home/hf/work/31758/my41-31758
into  mysql.com:/home/hf/work/31758/my50-31758


mysql-test/t/func_str.test:
  Auto merged
mysql-test/r/func_str.result:
  merging
sql/item_strfunc.h:
  merging
2007-11-05 18:12:42 +04:00
unknown
cda4afc2bf BUG#31611 (Security risk with BINLOG statement):
Incremental patch to remove redundant, but benign, my_error() call.


sql/sql_binlog.cc:
  Removing redundant error reporting.
2007-11-05 14:24:20 +01:00
unknown
5d8ade4b1e Merge mysqldev@production:/data0/mysqldev/my/mysql-5.1-release
into  kindahl-laptop.dnsalias.net:/home/bk/b31611-mysql-5.1-target-5.1.22
2007-11-05 13:46:46 +01:00
unknown
860f7db3b9 Bug #31974: Wrong EXPLAIN output
The fix for bug 31148 is not correct. It does not
have a relation to the problem described in this bug.
And removing the fix will not make the bug to re-appear.
Fixed the bug #31974 by removing the fix for bug 31148
and adding a test case.


mysql-test/r/key.result:
  Bug #31974: test case
mysql-test/t/key.test:
  Bug #31974: test case
sql/sql_select.cc:
  Bug #31974: revert the fix for bug 31148
2007-11-05 13:19:56 +02:00
unknown
b835c18a80 BUG#31611 (Security risk with BINLOG statement):
Adding check that the user executing a BINLOG statement has SUPER
privileges and aborting execution of the statement with an error
otherwise.


mysql-test/r/mysqlbinlog.result:
  Result change.
mysql-test/t/mysqlbinlog.test:
  Adding test that generates a BINLOG command for inserting data into a
  table and feed the BINLOG statement into the database as an untrusted
  user. Also checking that insertion into the table fails for that user
  and that the table only contain a single line: the original one inserted.
sql/sql_binlog.cc:
  Adding a check that the executor of the BINLOG command has
  SUPER privileges and give an error and abort execution if not.
2007-11-03 01:33:48 +01:00
unknown
082bdc7eb1 Merge whalegate.ndb.mysql.com:/home/tomas/mysql-5.0
into  whalegate.ndb.mysql.com:/home/tomas/mysql-5.0-ndb-merge


ndb/include/ndbapi/Ndb.hpp:
  Auto merged
2007-11-02 23:33:25 +01:00
unknown
e308ad708c Merge whalegate.ndb.mysql.com:/home/tomas/mysql-5.0-ndb
into  whalegate.ndb.mysql.com:/home/tomas/mysql-5.0-ndb-merge


sql/ha_ndbcluster.cc:
  Auto merged
2007-11-02 23:31:23 +01:00
unknown
8d861f4383 fix for 2.4.6 bug should be properly enclosed to not break other versions. 2007-11-02 14:25:48 -07:00
unknown
9a6877f23b Merge stella.local:/home2/mydev/mysql-5.0-amain
into  stella.local:/home2/mydev/mysql-5.0-axmrg


sql/item_func.cc:
  Auto merged
2007-11-02 10:14:26 +01:00
unknown
7524dbaa89 Merge sgluhov@bk-internal.mysql.com:/home/bk/mysql-5.1-opt
into  mysql.com:/home/gluh/MySQL/Merge/5.1-opt


sql/sql_select.cc:
  Auto merged
2007-11-02 13:01:10 +04:00
unknown
dacf99b5a5 Bug#31630 debug assert with explain extended select ... from i_s
added 'in_rows' column value for 'describe extended' for the case 
when 'describe' handles I_S table


mysql-test/r/information_schema.result:
  test result
mysql-test/t/information_schema.test:
  test case
sql/sql_select.cc:
  added 'in_rows' column value for 'describe extended' for the case 
  when 'describe' handles I_S table
2007-11-02 12:39:14 +04:00
unknown
bc8e5574ae Merge bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into  bodhi.(none):/opt/local/work/mysql-5.1-runtime-inc-2
2007-11-02 02:40:23 +03:00
unknown
0c1bdcbd24 A fix for Bug#32030 "DELETE does not return an error and deletes rows if
error evaluating WHERE"

DELETE with a subquery in WHERE clause would sometimes ignore subquery
evaluation error and proceed with deletion.

The fix is to check for an error after evaluation of the WHERE clause
in DELETE.

Addressed review comments.


mysql-test/r/group_min_max.result:
  Update the test results to reflect the fix for Bug#32030.
mysql-test/r/ps.result:
  Update test results (Bug#32030)
mysql-test/t/group_min_max.test:
  Update the test case to reflect the fix for Bug#32030
mysql-test/t/ps.test:
  Add a test case for Bug#32030
sql/sql_delete.cc:
  Check for an error before calling send_ok(). Two different places are
  covered because the subquery code has slightly different execution
  paths depending on ps-protocol/old-protocol
2007-11-02 02:36:12 +03:00
unknown
fe6834439d Merge endora.local:/Users/davi/mysql/bugs/30882-5.1
into  endora.local:/Users/davi/mysql/mysql-5.1-runtime


sql/sql_parse.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
2007-11-01 20:48:14 -02:00
unknown
0e675d81ae Merge endora.local:/Users/davi/mysql/bugs/31850-5.1
into  endora.local:/Users/davi/mysql/mysql-5.1-runtime


sql/sql_connect.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
2007-11-01 20:44:09 -02:00
unknown
611dbd0bb3 Bug#30882 Dropping a temporary table inside a stored function may cause a server crash
If a stored function that contains a drop temporary table statement
is invoked by a create temporary table of the same name may cause
a server crash. The problem is that when dropping a table no check
is done to ensure that table is not being used by some outer query
(or outer statement), potentially leaving the outer query with a
reference to a stale (freed) table.

The solution is when dropping a temporary table, always check if
the table is being used by some outer statement as a temporary
table can be dropped inside stored procedures.

The check is performed by looking at the TABLE::query_id value for
temporary tables. To simplify this check and to solve a bug related
to handling of temporary tables in prelocked mode, this patch changes
the way in which this member is used to track the fact that table is
used/unused. Now we ensure that TABLE::query_id is zero for unused
temporary tables (which means that all temporary tables which were
used by a statement should be marked as free for reuse after it's
execution has been completed).


mysql-test/include/handler.inc:
  Add test case for side effect of Bug#30882
mysql-test/r/handler_innodb.result:
  Add test case result for side effect of Bug#30882
mysql-test/r/handler_myisam.result:
  Add test case result for side effect of Bug#30882
mysql-test/r/sp-error.result:
  Add test case result for Bug#30882
mysql-test/t/sp-error.test:
  Add test case for Bug#30882
sql/event_db_repository.cc:
  Update close_thread_tables call, no more default values.
sql/mysql_priv.h:
  Remove implicit default parameters values of the close_thread_tables
  function as no callers are using it.
sql/slave.cc:
  Update close_thread_tables call, no more default values
sql/sp_head.cc:
  Update close_thread_tables call, no more default values
sql/sql_base.cc:
  Changed the approach to distinguishing currently unused temporary tables.
  Now we ensure that such tables always have TABLE::query_id set to 0 and
  use this fact to perform checks during opening and dropping of temporary
  tables. This means that we have to call close_thread_tables() even for
  statements which use only temporary tables. To make this call cheaper,
  we re-factored close_thread_tables() to not take LOCK_open unless there
  are open base tables.
sql/sql_handler.cc:
  Properly close temporary tables associated with a handler.
sql/sql_insert.cc:
  close_temporary_table is now merged into drop_temporary_table.
sql/sql_parse.cc:
  Now the condition doesn't cover all cases because close_thread_tables()
  must be called even for statements that use only temporary tables.
sql/sql_table.cc:
  Use drop_temporary_table which perform checks to verify if
  the table is not being used. Error path problem is due to
  a handler tables issue and is going to be addressed in bug
  31397.
sql/table.h:
  Rename previously unused clear_query_id and document the usage of
  query_id and open_by_handler.
2007-11-01 18:52:56 -02:00
unknown
aea5007d64 Bug#30671
"ALTER SERVER can cause server to crash"
  While retrieving values, it would erronously set the socket value
  to NULL and attempt to use it in strcmp().
  Ensure it is correctly set to "" so that strcmp may not crash.


mysql-test/r/federated_server.result:
  results for bug30671
  fix inconsistent result
mysql-test/t/federated_server.test:
  surplus semicolon
  test for bug30671
sql/sql_servers.cc:
  bug30671
  inside function get_server_from_table_to_cache()
    server->socket was being set to NULL instead of empty string
2007-11-01 12:30:03 -07:00
unknown
8f0df2efe8 Bug#31850 Test crashes in "embedded" server
The mysql_change_user command fails to properly update the database pointer
when no database is selected, leading to "use after free" errors. The same
happens on the user privilege pointer in the thread security context.

The solution is to properly reset and update the database name. Also update
the user_priv pointer so that it doesn't point to freed memory.


sql/sql_connect.cc:
  After a successful call to check_user() without specifying a new
  database name, the previous database thd->db) is freed but the
  pointer is not updated to NULL.
sql/sql_parse.cc:
  Update the security_ctx->priv_user pointer as it is a alias for
  the user security_ctx->user pointer. Also remove unneeded cast,
  the x_free macro casts the argument.
2007-11-01 17:29:20 -02:00
unknown
4cb4a53eb4 Merge magare.gmz:/home/kgeorge/mysql/work/B31794-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/work/B31794-5.1-opt


mysql-test/r/func_group.result:
  Auto merged
mysql-test/t/func_group.test:
  Auto merged
sql/sql_select.cc:
  Auto merged
2007-11-01 18:49:45 +02:00
unknown
660eb5bb40 Bug #31794: no syntax error on SELECT id FROM t HAVING count(*)>2
The HAVING clause is subject to the same rules as the SELECT list
about using aggregated and non-aggregated columns.
But this was not enforced when processing implicit grouping from
using aggregate functions.
Fixed by performing the same checks for HAVING as for SELECT.


mysql-test/r/func_group.result:
  Bug #31794: test case
mysql-test/t/func_group.test:
  Bug #31794: test case
sql/sql_select.cc:
  Bug #31794: Check HAVING in addition to SELECT list
2007-11-01 18:36:24 +02:00
unknown
6dd04c22a6 Cleanup execute_ddl_log_recovery() to not generate an error if
there is nothing to recover.

Discovered while working on Bug#12713


sql/sql_table.cc:
  Use MYF(0) in my_open() in read_ddl_log_header() called from
  execute_ddl_log_recovery() called during the server start up to not
  generate an error if no ddl log exists. This is not an erroneous situation,
  in fact it's the case in any server statrtup. The error was lost
  anyway, since it was pushed into the stack of the artificial thd.
2007-11-01 18:33:51 +03:00
unknown
3536c5d5f5 Use Internal_error_handler mechanism to silence ER_TOO_MANY_FIELDS
error in mysql_create_frm instead of
direct access to my_error() members.

This is a pre-requisite for the patch for Bug#12713.


sql/unireg.cc:
  Use Internal_error_handler mechanism to silence ER_TOO_MANY_FIELDS
  error in mysql_create_frm instead of
  direct access to my_error() members.
2007-11-01 18:06:46 +03:00
unknown
ecef837931 Use thd->is_error() instead of direct access to thd->net.report_error
in evaluate_join_record().

A minor cleanup required for the fix for Bug#12713.


sql/sql_select.cc:
  Use thd->is_error() instead of direct access to thd->net.report_error
  in evaluate_join_record()
2007-11-01 17:08:02 +03:00
unknown
fbf75e0dcf Fix a compilation warning.
sql/sql_connect.cc:
  Fix a compilation warning (unused variable).
2007-11-01 17:00:24 +03:00
unknown
61bd5d0fec Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.1-opt
into  magare.gmz:/home/kgeorge/mysql/autopush/B31866-5.1-opt
2007-11-01 14:44:30 +02:00
unknown
124af3f873 Bug #31866: MySQL Server crashes on SHOW CREATE TRIGGER statement
SHOW CREATE TRIGGER was not checking for detected errors 
opening/reading the trigger file. 
Fixed to return the already generated error.


mysql-test/r/trigger.result:
  Bug #31866: test case
mysql-test/t/trigger.test:
  Bug #31866: test case
sql/sql_show.cc:
  Bug #31866: test for error and return it.
2007-11-01 14:42:14 +02:00
unknown
74394b27fe Merge lambda.hsd1.co.comcast.net.:/home/malff/TREE/mysql-5.0-base
into  lambda.hsd1.co.comcast.net.:/home/malff/TREE/mysql-5.0-rt-merge
2007-11-01 06:35:22 -06:00
unknown
4f7f5941ed Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into  janus.mylan:/usr/home/serg/Abk/mysql-5.1


client/mysqldump.c:
  Auto merged
mysql-test/r/innodb_mysql.result:
  Auto merged
mysql-test/r/mysqldump.result:
  Auto merged
mysql-test/t/mysqldump.test:
  Auto merged
sql/handler.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/table.cc:
  Auto merged
sql/table.h:
  Auto merged
tests/mysql_client_test.c:
  Auto merged
2007-11-01 12:30:45 +01:00
unknown
ad723cd5f8 Merge bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into  bodhi.(none):/opt/local/work/mysql-5.1-runtime-inc-2


sql/sql_parse.cc:
  Auto merged
2007-11-01 14:24:32 +03:00
unknown
189ec0e0af A fix for Bug#32007 select udf_function() doesn't return an error if error
during udf initialization. The bug is spotted while working on Bug 12713.

If a user-defined function was used in a SELECT statement, and an
error would occur during UDF initialization, this error would not terminate
execution of the SELECT, but rather would be converted to a warning.

The fix is to use a stack buffer to store the message from udf_init instead
of private my_error() buffer.


mysql-test/r/udf.result:
  Update the result to reflect the fix for Bug#32007 select udf_function() 
  doesn't return an error if error during udf initialization
mysql-test/t/udf.test:
  Update the test to reflect the fix for Bug #32007 select udf_function() 
  doesn't return an error if error during udf initialization
sql/item_func.cc:
  A fix for Bug#32007.
  
  net.last_error buffer was used to store the temporary message from udf_init.
  Then, when my_error() was called, net.last_error was not empty so 
  my_error() would conclude that there is already an error in the error stack, 
  and not "overwrite" it.
  However, thd->net.report_error was not set, so the the 
  SELECT was not aborted.
  
  The fix is to use a stack buffer instead of thd->net.last_error
  to store the message from udf_init. The message will end up in
  thd->net.last_error anyway after a call to my_error.
2007-11-01 00:31:57 +03:00
unknown
bfae473053 Remove net_printf_error(). Do not talk to network directly in
check_user()/check_connection()/check_for_max_user_connections().

This is a pre-requisite patch for the fix for Bug#12713 "Error in a stored 
function called from a SELECT doesn't cause ROLLBACK of statem"

Implement review comments.


sql/mysql_priv.h:
  check_for_max_user_connections() is used in one place only, make it static.
sql/mysqld.cc:
  Remove net_printf_error(): a consolidation of error reporting facilities
  is necessary to simplify maintenance of the query cache, the 
  client-server protocol, stored procedure continue handlers. 
  Rewrite the only place where its use is somewhat justified 
  (my_error() can not be used since we need to report an error for the thread 
  that does not exist) with my_snprintf()/net_send_error().
sql/protocol.cc:
  Remove net_printf_error().
sql/protocol.h:
  Remove net_printf_error().
sql/sql_connect.cc:
  Remove net_printf_error(). In check_connection()/check_user()/
  check_for_max_user_connections() do not write directly to the network,
  but use the standard my_error() mechanism to record an error in THD.
  It will be sent to the client by the caller. This was the last place
  in the server that would attempt to send an error directly, mainly left 
  untouched by 5.0 refactoring because it is executed only during 
  thread startup.
sql/sql_parse.cc:
  In the old code, when res was greater than 0, it contained an exact 
  error code, e.g. ER_OUT_OF_RESOURCES or NO SUCH DATABASE, 
  or ER_HANDSHAKE_ERROR. I don't know the reason why this error code was 
  ignored, and instead a generic  ER_UNKNOWN_COM_ERROR was pushed into the
  error stack, but knowing the relaxed attitude towards preserving the error
  codes in the old code, I'm inclinded to think that it was a bug.
  
  After this patch, the most specific error message is already pushed,
  so calling my_message() again is useless.
  
  If res is < 0, the error used to be already sent. This is not done
  by the new code, but will be done later, in the end
  of dispatch_command(). When this is done, clear_error() will be called 
  for us - it is in the first lines of do_command.
  
  To sum up, this change is to remove COM_CHANGE_USER specific error handling
  in favor of the standard one employed for all other COM_* commands.
2007-11-01 00:10:58 +03:00
unknown
cc0e546567 BUG#28086 (SBR of USER() becomes corrupted on slave):
Marking statements containing USER() or CURRENT_USER() as unsafe, causing
them to switch to using row-based logging in MIXED mode and generate a
warning in STATEMENT mode.


mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result:
  Result change.
mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test:
  Adding test to check that USER() and CURRENT_USER() cause a switch
  to row-based logging.
sql/sql_yacc.yy:
  Setting statements containing USER() or CURRENT_USER() to be unsafe.
2007-10-31 21:09:52 +01:00
unknown
9ad4366b7b Cleanup: rename select_send::status to select_send::is_result_set_started.
Add select_send::cleanup.
Fix a compilation warning.
Issues spotted while working on the fix for Bug#12713.


sql-common/client.c:
  Fix a warning.
sql/sql_class.cc:
  Give a variable a more specific name. Rewrite an incorrect comment.
  Add a cleanup for select_send. The only case now this cleanup can be
  necessary is when we have a prepared statement inside a stored procedure, 
  and a continue handler. At first execution, the statement is killed
  after having executed select_send::send_fields. At the second execution
  it is killed after having executed select_send::send_fields.
sql/sql_class.h:
  Rename a member. Add comments.
2007-10-31 18:33:13 +03:00
unknown
2ace967acd Merge adventure.(none):/home/thek/Development/cpp/bug31347/my50-bug31347
into  adventure.(none):/home/thek/Development/cpp/mysql-5.0-runtime


sql/sql_acl.cc:
  Auto merged
2007-10-31 13:41:49 +01:00
unknown
ce55bb756a Merge adventure.(none):/home/thek/Development/cpp/bug31347/my51-bug31347
into  adventure.(none):/home/thek/Development/cpp/mysql-5.1-runtime


sql/sql_acl.cc:
  Auto merged
2007-10-31 13:22:19 +01:00
unknown
1603139dd5 Merge stella.local:/home2/mydev/mysql-5.1-amain
into  stella.local:/home2/mydev/mysql-5.1-axmrg


mysql-test/r/ctype_ucs.result:
  Auto merged
mysql-test/t/ctype_ucs.test:
  Auto merged
mysql-test/t/variables.test:
  Auto merged
sql/ha_partition.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/table.cc:
  Auto merged
2007-10-31 13:13:20 +01:00
unknown
61c6024cb6 Merge adventure.(none):/home/thek/Development/cpp/bug31347/my50-bug31347
into  adventure.(none):/home/thek/Development/cpp/bug31347/my51-bug31347


sql/sql_acl.cc:
  Auto merged
2007-10-31 13:12:45 +01:00
unknown
ee4452dba4 Bug #31893 Partitions: crash if subpartitions and engine change.
The new default database engine for altered table was reassigned to
the old one. That's wrong thing by itself, and (as the engine
for a subpartition gets that new value) leads to DBUG_ASSERTION
in mysql_unpack_partition()


mysql-test/r/partition.result:
  Bug #31893 Partitions: crash if subpartitions and engine change.
  
  test result
mysql-test/t/partition.test:
  Bug #31893 Partitions: crash if subpartitions and engine change.
  
  test case
sql/sql_partition.cc:
  Bug #31893 Partitions: crash if subpartitions and engine change.
  
  Don't change part_info->default_engine_type if it's already set
2007-10-31 16:01:29 +04:00
unknown
c4f35d7c23 Merge stella.local:/home2/mydev/mysql-5.0-amain
into  stella.local:/home2/mydev/mysql-5.0-axmrg


mysql-test/r/ctype_ucs.result:
  Auto merged
mysql-test/t/ctype_ucs.test:
  Auto merged
sql/item_func.cc:
  Auto merged
2007-10-31 12:31:36 +01:00
unknown
8d69dd398d Bug#31347 Increase in memory usage after many DROP USER statements
Dropping users causes huge increase in memory usage because field values were
allocated on the server memory root for temporary usage but never deallocated.

This patch changes the target memory root to be that of the thread handler
instead since this root is cleared between each statement.


sql/sql_acl.cc:
  Changed memory root from server life time memory to thread life time memory.
2007-10-31 12:25:18 +01:00
unknown
d2a1fe14ab Merge endora.local:/Users/davi/mysql/bugs/30904-5.1
into  endora.local:/Users/davi/mysql/mysql-5.1-runtime
2007-10-30 20:52:21 -02:00
unknown
bf18f6d4b8 Bug#30904 SET PASSWORD statement is non-transactional
The SET PASSWORD statement is non-transactional (no explicit transaction
boundaries) in nature and hence is forbidden inside stored functions and
triggers, but it weren't being effectively forbidden.

The implemented fix is to issue a implicit commit with every SET PASSWORD
statement, effectively prohibiting these statements in stored functions
and triggers. 


mysql-test/r/sp-error.result:
  Add test case result for Bug#30904
mysql-test/t/sp-error.test:
  Add test case for Bug#30904
sql/sql_lex.h:
  Add variable to set that a statement with SET PASSWORD causes a implicit
  commit.
sql/sql_parse.cc:
  End active transaction in SET PASSWORD.
sql/sql_yacc.yy:
  Set the correct flag on SET PASSWORD if inside a SP, thus effectively
  prohibiting SET PASSWORD statements in stored functions and triggers.
2007-10-30 20:51:04 -02:00
unknown
44dc5049ac Merge kindahl-laptop.dnsalias.net:/home/bkroot/mysql-5.1-rpl
into  kindahl-laptop.dnsalias.net:/home/bk/b19958-mysql-5.1-rpl


sql/log_event.cc:
  Auto merged
2007-10-30 21:23:53 +01:00
unknown
eb191861e3 BUG#19958 (RBR idempotency issue for UPDATE and DELETE):
The rpl_trigger test case indicated a problem with idempotency support when run
under row-based replication, which this patch fixes.

However, despite this, the test is not designed for execution under row-based
replication and hence rpl_trigger.test is not executed under row-based
replication.

The problem is that the test expects triggers to be executed when the slave
updates rows on the slave, and this is (deliberately) not done with row-based
replication.


sql/log_event.cc:
  Adding function to print symbolic name of handler errors for debug purposes.
  Ignoring some more error messages to provide full idempotency support for
  update and delete operations.
mysql-test/suite/rpl/r/rpl_idempotency.result:
  New BitKeeper file ``mysql-test/suite/rpl/r/rpl_idempotency.result''
mysql-test/suite/rpl/t/rpl_idempotency.test:
  New BitKeeper file ``mysql-test/suite/rpl/t/rpl_idempotency.test''
2007-10-30 21:17:19 +01:00
unknown
8365a74e47 In ha_delete_table, use a standard mechanism to intercept the error message
and convert it to a warning instead of direct manipulation with the
thread error stack.
Fix a bug in handler::print_erorr when a garbled message was
printed for HA_ERR_NO_SUCH_TABLE.
This is a pre-requisite patch for the fix for Bug#12713 Error in a stored
function called from a SELECT doesn't cause ROLLBACK of statem


sql/handler.cc:
  Use a standard mechanism to intercept the error message, instead
  of direct manipulation with thread error stack. 
  Fix a bug when for HA_ERR_NO_SUCH_TABLE handler::print_error() would
  print a garbled message.
sql/log.cc:
  Extend internal error handler interface to carry the message text.
sql/mysqld.cc:
  Extend internal error handler interface to carry the message text.
sql/sql_base.cc:
  Extend internal error handler interface to carry the message text.
sql/sql_class.cc:
  Extend internal error handler interface to carry the message text.
sql/sql_class.h:
  Extend internal error handler interface to carry the message text.
sql/sql_error.cc:
  Extend internal error handler interface to carry the message text.
2007-10-30 22:35:14 +03:00
unknown
1430f4ded2 Merge bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into  bodhi.(none):/opt/local/work/mysql-5.1-runtime-inc-2


sql/sql_connect.cc:
  Manual merge.
2007-10-30 20:10:11 +03:00
unknown
2437001234 Use an inline getter method (thd->is_error()) to query if there is an error
in THD.
In future the error may be stored elsewhere (not in net.report_error) and 
it's important to start using an opaque getter to simplify merges.


sql/filesort.cc:
  net.report_error -> is_error()
sql/ha_ndbcluster_binlog.cc:
  net.report_error -> is_error()
sql/item_func.cc:
  net.report_error -> is_error()
sql/item_subselect.cc:
  net.report_error -> is_error()
sql/set_var.cc:
  net.report_error -> is_error()
sql/sp.cc:
  net.report_error -> is_error()
sql/sp_head.cc:
  net.report_error -> is_error()
sql/sql_base.cc:
  net.report_error -> is_error()
sql/sql_class.cc:
  net.report_error -> is_error()
sql/sql_class.h:
  net.report_error -> is_error()
sql/sql_connect.cc:
  net.report_error -> is_error()
sql/sql_delete.cc:
  net.report_error -> is_error()
sql/sql_insert.cc:
  net.report_error -> is_error()
sql/sql_parse.cc:
  net.report_error -> is_error()
sql/sql_prepare.cc:
  net.report_error -> is_error()
sql/sql_select.cc:
  net.report_error -> is_error()
sql/sql_union.cc:
  net.report_error -> is_error()
sql/sql_update.cc:
  net.report_error -> is_error()
sql/sql_view.cc:
  net.report_error -> is_error()
sql/sql_yacc.yy:
  net.report_error -> is_error()
2007-10-30 20:08:16 +03:00
unknown
abdb052bae Merge magare.gmz:/home/kgeorge/mysql/work/B31884-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/work/B31884-5.1-opt


sql/item_subselect.h:
  Auto merged
mysql-test/r/subselect.result:
  merged the fix for bug 31884 to 5.1-opt
mysql-test/t/subselect.test:
  merged the fix for bug 31884 to 5.1-opt
2007-10-30 16:21:17 +02:00
unknown
95acd426eb Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/autopush/B31884-5.0-opt
2007-10-30 16:18:56 +02:00
unknown
fcff3b5a8d manual merge
BitKeeper/deleted/.del-rpl_slave_skip-slave.opt:
  Delete: mysql-test/t/rpl_slave_skip-slave.opt
BitKeeper/deleted/.del-rpl_slave_skip.test:
  Delete: mysql-test/t/rpl_slave_skip.test
BitKeeper/deleted/.del-rpl_slave_skip.result:
  Delete: mysql-test/r/rpl_slave_skip.result
2007-10-30 14:08:37 +01:00
unknown
d4d4ba9a9f Fix failing init_connect.test (5.1-runtime).
sql/sql_connect.cc:
  Fix failing init_connect.test (5.1-runtime). Add comments for the unjustified use
  of thd->is_slave_error.
2007-10-30 15:39:50 +03:00
unknown
6bbdacae20 Bug #31884: Assertion + crash in subquery in the SELECT clause.
Item_in_subselect's only externally callable method is val_bool().
However the nullability in the wrapper class (Item_in_optimizer) is 
established by calling the "forbidden" method val_int().

Fixed to use the correct method (val_bool() ) to establish nullability 
of Item_in_subselect in Item_in_optimizer.


mysql-test/r/subselect.result:
  Bug #31884: test case
mysql-test/t/subselect.test:
  Bug #31884: test case
sql/item_subselect.h:
  Bug #31884: Use the correct method to establish nullability
2007-10-30 14:27:21 +02:00
unknown
356bdcb7c4 Manual merge 5.0-rpl -> 5.1-rpl.
involved bug#12691, bug#27571


mysql-test/suite/rpl/r/rpl_sp_effects.result:
  results changed
sql/slave.cc:
  pended manual merge done (mats)
sql/sql_delete.cc:
  manual merge
sql/sql_insert.cc:
  manual merge
sql/sql_load.cc:
  manual merge
sql/sql_update.cc:
  manual merge.
2007-10-30 13:49:42 +02:00
unknown
c84d4b2139 Merge whalegate.ndb.mysql.com:/home/tomas/cge-5.1
into  whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-new-ndb-merge


mysql-test/suite/rpl/r/rpl_bug31076.result:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/handler.cc:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
storage/ndb/include/ndbapi/Ndb.hpp:
  Auto merged
mysql-test/suite/rpl/t/rpl_bug31076.test:
  manual merge
2007-10-30 11:28:19 +01:00
unknown
200f0531ef Merge koti.dsl.inet.fi:/home/elkin/MySQL/TEAM/FIXES/5.0/bug27571_asyn_killed_flags
into  koti.dsl.inet.fi:/home/elkin/MySQL/5.1-merge-bug27571


client/mysql.cc:
  Auto merged
mysql-test/r/ctype_euckr.result:
  Auto merged
mysql-test/r/ctype_uca.result:
  Auto merged
mysql-test/suite/binlog/r/binlog_killed.result:
  Auto merged
mysql-test/suite/binlog/t/binlog_killed.test:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/log_event.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/sp_head.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
strings/ctype-euc_kr.c:
  Auto merged
mysql-test/suite/rpl/r/rpl_sp_effects.result:
  manual merge ul
mysql-test/suite/rpl/t/rpl_sp_effects.test:
  manual merge
sql/slave.cc:
  leaving for manual merge
sql/sql_delete.cc:
  leaving for manual merge
sql/sql_insert.cc:
  leaving for manual merge
sql/sql_load.cc:
  leaving for manual merge
sql/sql_update.cc:
  leaving for manual merge
2007-10-30 11:31:03 +02:00
unknown
e722393f51 Bug #31758 inet_ntoa, oct crashes server with null+filesort
Item_func_inet_ntoa and Item_func_conv inherit 'maybe_null' flag from an
argument, which is wrong.
Both can be NULL with notnull arguments, so that's fixed.


mysql-test/r/func_str.result:
  Bug #31758 inet_ntoa, oct crashes server with null+filesort
  
  test case
mysql-test/t/func_str.test:
  Bug #31758 inet_ntoa, oct crashes server with null+filesort
  
  test result
sql/item_strfunc.h:
  Bug #31758 inet_ntoa, oct crashes server with null+filesort
  
  missing maybe_null flags set for Item_func_inet_ntoa and Item_func_conv
2007-10-30 12:35:03 +04:00
unknown
5e314d06e6 Merge aelkin@bk-internal.mysql.com:/home/bk/mysql-5.0-rpl
into  koti.dsl.inet.fi:/home/elkin/MySQL/TEAM/FIXES/5.0/bug27571_asyn_killed_flags
2007-10-30 10:32:20 +02:00
unknown
c45171b01b Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/bar/mysql-work/mysql-5.0-rpl-merge


mysql-test/r/ctype_utf8.result:
  Auto merged
mysql-test/r/func_regexp.result:
  Auto merged
mysql-test/t/ctype_utf8.test:
  Auto merged
mysql-test/t/func_regexp.test:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_cmpfunc.h:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
mysql-test/r/ctype_ucs.result:
  After merge fix
mysql-test/t/ctype_ucs.test:
  After merge fix
2007-10-30 12:21:44 +04:00
unknown
a3b60d2d51 Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-5.1
into  mysql.com:/home/bar/mysql-work/mysql-5.1-new-rpl-merge


client/mysql.cc:
  Auto merged
mysql-test/r/ctype_euckr.result:
  Auto merged
mysql-test/r/ctype_uca.result:
  Auto merged
mysql-test/r/ctype_utf8.result:
  Auto merged
mysql-test/r/func_regexp.result:
  Auto merged
mysql-test/suite/rpl/r/rpl_bug31076.result:
  Auto merged
mysql-test/t/ctype_utf8.test:
  Auto merged
mysql-test/t/func_regexp.test:
  Auto merged
mysql-test/t/partition.test:
  Auto merged
sql/field.cc:
  Auto merged
sql/field.h:
  Auto merged
sql/handler.cc:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_cmpfunc.h:
  Auto merged
sql/item_xmlfunc.cc:
  Auto merged
sql/log.cc:
  Auto merged
sql/log.h:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/sp_head.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_delete.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_repl.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
strings/ctype-euc_kr.c:
  Auto merged
sql/sql_yacc.yy:
  Reverting Rafal's changes: TRANSACTIONAL_SYM was removed in a mistake.
mysql-test/r/ctype_ucs.result:
  After merge fix
mysql-test/suite/rpl/t/rpl_bug31076.test:
  After merge fix.
mysql-test/t/ctype_ucs.test:
  After megre fix
2007-10-30 12:03:34 +04:00
unknown
2fa9b3c9a3 Merge mysql.com:/home/ram/work/mysql-5.0-maint
into  mysql.com:/home/ram/work/b31137/b31137.5.0
2007-10-29 20:43:57 +04:00
unknown
f139033063 Merge lambda.weblab:/home/malff/TREE/mysql-5.1-base
into  lambda.weblab:/home/malff/TREE/mysql-5.1-rt-merge


mysql-test/include/mix1.inc:
  Auto merged
mysql-test/r/innodb_mysql.result:
  Auto merged
mysql-test/r/select.result:
  Auto merged
sql/handler.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/protocol.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
2007-10-29 08:07:27 -06:00
unknown
24ede323cc Merge lambda.weblab:/home/malff/TREE/mysql-5.0-base
into  lambda.weblab:/home/malff/TREE/mysql-5.0-rt-merge


sql/sql_table.cc:
  Auto merged
2007-10-29 07:53:15 -06:00
unknown
be04193c09 Merge mysql.com:/home/ram/work/b31137/b31137.5.0
into  mysql.com:/home/ram/work/b31137/b31137.5.1


sql/sql_table.cc:
  Auto merged
sql/structs.h:
  Auto merged
mysql-test/include/mix1.inc:
  will merge tests manually
mysql-test/r/innodb_mysql.result:
  will merge tests manually
mysql-test/r/key.result:
  will merge tests manually
mysql-test/t/key.test:
  will merge tests manually
include/my_base.h:
  manual merge.
2007-10-29 17:34:01 +04:00
unknown
95f3db7be1 Bug #27571 asynchronousity in setting mysql_query::error and
Query_log_event::error_code

A query can perform completely having the local var error of mysql_$query
zero, where $query in insert, update, delete, load,
and be  binlogged with error_code e.g KILLED_QUERY while there is no
reason do to so.
That can happen because Query_log_event consults thd->killed flag to
evaluate error_code.

Fixed with implementing a scheme suggested and partly implemented at
time of bug@22725 work-on. error_status is cached immediatly after the
control leaves the main rows-loop and that instance always corresponds
to `error' the local of mysql_$query functions. The cached value
is passed to Query_log_event constructor, not the default thd->killed
which can be changed in between of the caching and the constructing.


mysql-test/r/binlog_killed.result:
  results changed
mysql-test/t/binlog_killed.test:
  Demonstrating that effective killing during rows-loop execution leads to the speficied actions:
  binlogging with the error for a query modified a not-transactional table or
  rolling back effects for transactional table;
  
  fixing possible non-determinism with ID when query_log_enabled;
  
  leave commented out tests for multi-update,delete due to another bug;
  
  removing an obsolete tests template;
  
  changing system rm to --remove_file.
sql/log_event.cc:
  adding killed status arg
sql/log_event.h:
  added killed status arg
sql/sql_delete.cc:
  deploying the update part patch for delete, multi-delete
sql/sql_insert.cc:
  deploying the update-part patch for insert..select
sql/sql_load.cc:
  deploying the update-part patch for load data.
  simulation added.
sql/sql_update.cc:
  Impementing the fix as described in the comments left by bug@22725.
  Also simulation of killing after the loop that would affect binlogging in the old code.
mysql-test/t/binlog_killed_bug27571-master.opt:
  post rows-loop killing simulation's options
mysql-test/t/binlog_killed_bug27571.test:
  Checking that if killing happens inbetween of the end of rows loop and
  recording into binlog that will not lead to recording any error incl
  the killed error.
mysql-test/t/binlog_killed_simulate-master.opt:
  simulation options
mysql-test/t/binlog_killed_simulate.test:
  tests for 
  a query (update is choosen) being killed after the row-loop;
  load data killed within the loop - effective killed error in the event is gained.
2007-10-29 15:20:59 +02:00
unknown
7c92f118e4 Fix for BUG#27610: ALTER TABLE ROW_FORMAT=... does not
rebuild the table.

The problem was that ROW_FORMAT clause in ALTER TABLE did not trigger
table reconstruction.

The fix is to rebuild a table if ROW_FORMAT is specified.


mysql-test/include/mix1.inc:
  Add a test case for BUG#27610: ALTER TABLE ROW_FORMAT=... does not
  rebuild the table.
mysql-test/r/innodb_mysql.result:
  Update result file.
sql/sql_table.cc:
  Rebuild a table if ROW_FORMAT was specified in ALTER TABLE.
2007-10-29 15:42:49 +03:00
unknown
2b3e560622 Merge mysql.com:/home/gluh/MySQL/Merge/5.0-opt
into  mysql.com:/home/gluh/MySQL/Merge/5.1-opt


mysql-test/r/type_decimal.result:
  Auto merged
mysql-test/t/type_decimal.test:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_func.h:
  Auto merged
2007-10-29 15:40:41 +04:00
unknown
9e6bb07d38 Bug#30889: filesort and order by with float/numeric crashes server
There are two problems with ROUND(X, D) on an exact numeric 
(DECIMAL, NUMERIC type) field of a table:
1) The implementation of the ROUND function would change the number of decimal
places regardless of the value decided upon in fix_length_and_dec. When the
number of decimal places is not constant, this would cause an inconsistent
state where the number of digits was less than the number of decimal places,
which crashes filesort.

Fixed by not allowing the ROUND operation to add any more decimal places than
was decided in fix_length_and_dec.

2) fix_length_and_dec would allow the number of decimals to be greater than
the maximium configured value for constant values of D. This led to the same 
crash as in (1).

Fixed by not allowing the above in fix_length_and_dec.


mysql-test/r/type_decimal.result:
  Bug#30889: Test result
mysql-test/t/type_decimal.test:
  Bug#30889: Test case
sql/item_func.cc:
  Bug#30889: 
  - Avoid setting number of digits after decimal point (scale) higher than its 
    maximum value.
  - Avoid increasing the number of decimal places in ::decimal_op
sql/item_func.h:
  Bug#30889: Added comments to the declarations of Item_func_numhybrid::<type>_op
  family of methods.
2007-10-29 15:39:56 +04:00
unknown
b63ae73d50 Merge trift2.:/MySQL/M50/clone-5.0
into  trift2.:/MySQL/M50/push-5.0


mysql-test/r/derived.result:
  Auto merged
mysql-test/r/ps_2myisam.result:
  Auto merged
mysql-test/r/ps_3innodb.result:
  Auto merged
mysql-test/r/ps_4heap.result:
  Auto merged
mysql-test/r/ps_5merge.result:
  Auto merged
mysql-test/r/ps_6bdb.result:
  Auto merged
mysql-test/r/ps_7ndb.result:
  Auto merged
mysql-test/r/sp.result:
  Auto merged
mysql-test/r/type_datetime.result:
  Auto merged
mysql-test/t/derived.test:
  Auto merged
mysql-test/t/sp.test:
  Auto merged
sql/field.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
mysql-test/r/type_date.result:
  Null-merge 5.0.50 build clone:
  The test for bug#31221 is already in the receiving tree.
mysql-test/t/type_date.test:
  Null-merge 5.0.50 build clone:
  The test for bug#31221 is already in the receiving tree.
2007-10-29 12:11:05 +01:00
unknown
91ca02ad8a Merge mysql.com:/home/gluh/MySQL/Merge/5.0-opt
into  mysql.com:/home/gluh/MySQL/Merge/5.1-opt


mysql-test/r/func_gconcat.result:
  Auto merged
mysql-test/t/func_gconcat.test:
  Auto merged
sql/item_sum.cc:
  Auto merged
2007-10-29 14:53:42 +04:00
unknown
d5b1d6205b Bug#30897 GROUP_CONCAT returns extra comma on empty fields
The fix is a copy of Martin Friebe's suggestion.
added testing for no_appended which will be false if anything,
including the empty string is in result


mysql-test/r/func_gconcat.result:
  test result
mysql-test/t/func_gconcat.test:
  test case
sql/item_sum.cc:
  added testing for no_appended which will be False if anything,
  including the empty string is in result
2007-10-29 14:53:10 +04:00
unknown
016c6f615e Merge mysql.com:/home/ram/work/mysql-5.0-maint
into  mysql.com:/home/ram/work/b30782/b30782.5.0


sql/item_cmpfunc.cc:
  Auto merged
sql/item_cmpfunc.h:
  Auto merged
2007-10-29 13:42:02 +04:00
unknown
30dab869ec Merge mysql.com:/home/ram/work/b30782/b30782.5.0
into  mysql.com:/home/ram/work/b30782/b30782.5.1


sql/item_cmpfunc.cc:
  Auto merged
mysql-test/r/case.result:
  manual merge.
mysql-test/t/case.test:
  manual merge.
sql/item_cmpfunc.h:
  manual merge.
2007-10-29 13:16:26 +04:00
unknown
25939026a7 Fixed compile warnings introduced by the patch for bug #29131. 2007-10-29 11:52:44 +03:00
unknown
42894ed0b8 Fix for bug #30782: Truncated UNSIGNED BIGINT columns only in SELECT w/ CASE,
JOIN, and ORDER BY

Problem: improper maximum length calculation of the CASE function leads to 
decimal value truncation (storing/retrieving decimal field values).

Fix: accurately calculate maximum length/unsigned flag/decimals parameters 
of the CASE function.


mysql-test/r/case.result:
  Fix for bug #30782: Truncated UNSIGNED BIGINT columns only in SELECT w/ CASE, 
  JOIN, and ORDER BY
    - test result.
mysql-test/t/case.test:
  Fix for bug #30782: Truncated UNSIGNED BIGINT columns only in SELECT w/ CASE, 
  JOIN, and ORDER BY
    - test case.
sql/item_cmpfunc.cc:
  Fix for bug #30782: Truncated UNSIGNED BIGINT columns only in SELECT w/ CASE, 
  JOIN, and ORDER BY
    - accurately calculate Item_func_case::max_length/unsigned_flag/decimals.
sql/item_cmpfunc.h:
  Fix for bug #30782: Truncated UNSIGNED BIGINT columns only in SELECT w/ CASE, 
  JOIN, and ORDER BY
    - accurately calculate Item_func_case::max_length/unsigned_flag/decimals.
2007-10-29 12:20:21 +04:00
unknown
33a8fdea12 Merge polly.(none):/home/kaa/src/opt/bug29131/my51-bug29131
into  polly.(none):/home/kaa/src/opt/mysql-5.1-opt


mysql-test/r/variables.result:
  Auto merged
mysql-test/t/variables.test:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
2007-10-29 10:31:26 +03:00
unknown
b52ab3bda5 Merge polly.(none):/home/kaa/src/opt/bug29131/my50-bug29131
into  polly.(none):/home/kaa/src/opt/mysql-5.0-opt


mysql-test/r/variables.result:
  Auto merged
mysql-test/t/variables.test:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
2007-10-29 10:25:48 +03:00
unknown
e2bd6c6b12 Merge gshchepa@bk-internal.mysql.com:/home/bk/mysql-5.1-opt
into  gleb.loc:/home/uchum/work/bk/5.1-opt


mysql-test/r/type_decimal.result:
  Auto merged
mysql-test/t/type_decimal.test:
  Auto merged
sql/item.cc:
  Auto merged
2007-10-28 01:23:54 +05:00
unknown
5568084835 Merge gshchepa@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  gleb.loc:/home/uchum/work/bk/5.0-opt
2007-10-28 01:19:20 +05:00
unknown
321b1b6105 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.1-opt
into  magare.gmz:/home/kgeorge/mysql/autopush/B30715-merged-5.1-opt
2007-10-27 10:21:02 +03:00
unknown
d8f35d1dc7 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/autopush/B30715-merged-5.0-opt
2007-10-27 10:20:12 +03:00
unknown
2d380a832d Merge kindahl-laptop.dnsalias.net:/home/bkroot/mysql-5.0-rpl
into  kindahl-laptop.dnsalias.net:/home/bk/b12691-mysql-5.0-rpl


sql/slave.cc:
  Auto merged
2007-10-26 19:18:02 +02:00
unknown
f01321fd09 BUG#12691 (Exec_master_log_pos corrupted with SQL_SLAVE_SKIP_COUNTER):
Adding code to keep skipping events while inside a transaction. Execution
will start just after the transaction has been skipped.


sql/slave.cc:
  Adding code to set the thd->options flag for the slave SQL thread
  even when BEGIN, ROLLBACK, COMMIT, and XID events are being skipped.
      
  Adding code to not decrease the slave skip counter from 1 to 0 if we
  are inside a transaction. This will keep the counter at 1, and keep
  skipping events, until a transaction terminator is read. At that point,
  the slave skip counter will be decreased to 0, and events will be read
  and executed instead of read and skipped.
mysql-test/r/rpl_slave_skip.result:
  New BitKeeper file ``mysql-test/r/rpl_slave_skip.result''
mysql-test/t/rpl_slave_skip-slave.opt:
  New BitKeeper file ``mysql-test/t/rpl_slave_skip-slave.opt''
mysql-test/t/rpl_slave_skip.test:
  New BitKeeper file ``mysql-test/t/rpl_slave_skip.test''
2007-10-26 18:52:58 +02:00
unknown
0e076d4bb9 Merge gleb.loc:/home/uchum/work/bk/5.0-opt
into  gleb.loc:/home/uchum/work/bk/5.1-opt


mysql-test/r/select.result:
  Auto merged
mysql-test/r/type_decimal.result:
  Auto merged
mysql-test/t/select.test:
  Auto merged
mysql-test/t/type_decimal.test:
  Auto merged
sql/item.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/share/errmsg.txt:
  Merge with 5.0-opt
2007-10-26 18:05:46 +05:00
unknown
46b03c598d Merge gleb.loc:/home/uchum/work/bk/PA/5.0-opt-31663
into  gleb.loc:/home/uchum/work/bk/5.0-opt


sql/sql_class.cc:
  Auto merged
2007-10-26 17:55:16 +05:00
unknown
efbc310af6 Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.1-opt
into  mysql.com:/scratch/tnurnberg/31662/51-31662


sql/sql_base.cc:
  Auto merged
2007-10-26 12:47:59 +02:00
unknown
d7d93cf548 Fix for bug #31137: Assertion failed: primary_key_no == -1 || primary_key_no == 0,
file .\ha_innodb.

Problem: if a partial unique key followed by a non-partial one we declare
the second one as a primary key.

Fix: sort non-partial unique keys before partial ones.


include/my_base.h:
  Fix for bug #31137: Assertion failed: primary_key_no == -1 || primary_key_no == 0, 
  file .\ha_innodb.
    - sort unique keys that don't contain partial segments before other keys:
        set HA_KEY_HAS_PART_KEY_SEG flag for such keys in the mysql_prepare_table(),
        use it in the sort_keys();
mysql-test/r/innodb_mysql.result:
  Fix for bug #31137: Assertion failed: primary_key_no == -1 || primary_key_no == 0, 
  file .\ha_innodb.
    - test result.
mysql-test/r/key.result:
  Fix for bug #31137: Assertion failed: primary_key_no == -1 || primary_key_no == 0, 
  file .\ha_innodb.
    - test result.
mysql-test/t/innodb_mysql.test:
  Fix for bug #31137: Assertion failed: primary_key_no == -1 || primary_key_no == 0, 
  file .\ha_innodb.
    - test case.
mysql-test/t/key.test:
  Fix for bug #31137: Assertion failed: primary_key_no == -1 || primary_key_no == 0, 
  file .\ha_innodb.
    - test case.
sql/sql_table.cc:
  Fix for bug #31137: Assertion failed: primary_key_no == -1 || primary_key_no == 0, 
  file .\ha_innodb.
    - sort unique keys that don't contain partial segments before other keys:
        set HA_KEY_HAS_PART_KEY_SEG flag for such keys in the mysql_prepare_table(),
        use it in the sort_keys();
sql/structs.h:
  Fix for bug #31137: Assertion failed: primary_key_no == -1 || primary_key_no == 0, 
  file .\ha_innodb.
    - sort unique keys that don't contain partial segments before other keys:
        set HA_KEY_HAS_PART_KEY_SEG flag for such keys in the mysql_prepare_table(),
        use it in the sort_keys();
2007-10-26 15:37:38 +05:00
unknown
ca126a9990 Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  mysql.com:/misc/mysql/31662/50-31662


sql/sql_base.cc:
  Auto merged
2007-10-26 11:44:30 +02:00
unknown
4ce44da3d5 correct unused code 2007-10-26 11:43:05 +02:00
unknown
be4d062614 Merge mysql.com:/scratch/tnurnberg/31662/50-31662
into  mysql.com:/scratch/tnurnberg/31662/51-31662


mysql-test/r/information_schema_db.result:
  Auto merged
sql/sql_base.cc:
  Auto merged
2007-10-26 10:24:31 +02:00
unknown
0e700e1eeb Bug#31662: 'null' is shown as type of fields for view with bad definer, breaks mysqldump
SHOW FIELDS FROM a view with no valid definer was possible (since fix
for Bug#26817), but gave NULL as a field-type. This led to mysqldump-ing
of such views being successful, but loading such a dump with the client
failing. Patch allows SHOW FIELDS to give data-type of field in underlying
table.


mysql-test/r/information_schema_db.result:
  Fix test results: SHOW FIELDS FROM a view with no valid DEFINER
  gives us the field-type of the underlying table now rather than NULL.
sql/sql_base.cc:
  In the case of SHOW FIELDS FROM <view>, do not require a valid
  DEFINER for determining underlying data-type like we usually do.
  This is needed for mysqldump.
2007-10-26 09:01:29 +02:00
unknown
0bb55050d1 Bug#30296
"Dynamic plugins fail to load on FreeBSD"
  ELF executables need to be linked using the -export-dynamic option to
  ld(1) for symbols defined in the executable to become visible to dlsym().
  Also, do not build plugins on an all-static build.


configure.in:
  Bug#30296
    Use "-export-dynamic" when building executable for use with plugins.
    Add required option using MYSQLD_EXTRA_LDFLAGS variable so we do not
    affect any other binary.
config/ac-macros/plugins.m4:
  Do not build plugins when building all-static
sql/sql_yacc.yy:
  build fix - surplus semicolon
2007-10-25 21:19:28 -07:00
unknown
974201c7e0 Fix for bug #29131: SHOW VARIABLES reports variable 'log' but SET
doesn't recognize it
  
This is a 5.1 version of the patch.
  
Problem:
  
'log' and 'log_slow_queries' were "fixed" variables, i.e. they showed up
in SHOW VARIABLES, but could not be used in expressions like 
"select @@log". Also, using them in the SET statement produced an 
incorrect "unknown system variable" error.
  
Solution:

Since as of MySQL 5.1.12 one can enable or disable the general query log
or the slow query log at runtime by changing values of
general_log/slow_query_log, make 'log' and 'log_slow_queries" to be 
synonyms for 'general_log' and 'slow_query_log' respectively.  This 
makes expressions using the '@@var' syntax backward compatible with 
5.0 and SHOW VARIABLES output to be consistent with the SET statement.


mysql-test/r/log_state.result:
  Added a test case for bug #29131.
mysql-test/t/log_state.test:
  Added a test case for bug #29131.
sql/set_var.cc:
  Made the 'log' and 'log_slow_queries' system variables to be synonyms for 'general_log' and 'slow_query_log'.
2007-10-25 14:03:24 +04:00
unknown
6eced1b857 Fix for bug #29131: SHOW VARIABLES reports variable 'log' but SET
doesn't recognize it

This is a 5.0 version of the patch, it will be null-merged to 5.1

Problem:

'log' and 'log_slow_queries' were "fixed" variables, i.e. they showed up
in SHOW VARIABLES, but could not be used in expressions like 
"select @@log". Also, using them in the SET statement produced an 
incorrect "unknown system variable" error.

Solution:

Make 'log' and 'log_slow_queries' read-only dynamic variables to make 
them available for use in expressions, and produce a correct error 
about the variable being read-only when used in the SET statement.


mysql-test/r/variables.result:
  Added a test case for bug #29131.
mysql-test/t/variables.test:
  Added a test case for bug #29131.
sql/mysql_priv.h:
  Changed the type of opt_log and opt_slow_log to my_bool to 
  align with the interfaces in set_var.cc
sql/mysqld.cc:
  Changed the type of opt_log and opt_slow_log to my_bool to 
  align with the interfaces in set_var.cc
sql/set_var.cc:
  Made 'log' and 'log_slow_queries' to be read-only dynamic system 
  variable, i.e. available for use in expressions with the @@var syntax.
sql/set_var.h:
  Added a new system variable class representing a read-only boolean
  variable.
2007-10-25 14:02:27 +04:00
unknown
f8f8c0282a WL#4078: Document binary format of binlog entries
Documented some binlog events using doxygen. More will be done later.
Also fixed typos in other comments and added remarks about dubious code.
Only comments are affected, there is no change to the actual code.


sql/log_event.cc:
  Fixed typos in some comments.
  Added remarks (as comments) about questionable code.
sql/log_event.h:
  Documented the binary format of following binlog events:
  Log_event
  Query_log_event
  Muted_query_log_event
  Slave_log_event (partial)
  Load_log_event
  Intvar_log_event
  Rand_log_event
  Rotate_log_event (partial)
sql/sql_class.h:
  Fixed typo in comment.
2007-10-25 11:58:18 +02:00
unknown
1ebb7098c8 Merge loke.(none):/home/knielsen/devel/mysql-5.0-ndb
into  loke.(none):/home/knielsen/devel/mysql-5.1-new-ndb


storage/ndb/include/kernel/AttributeHeader.hpp:
  Auto merged
storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp:
  Auto merged
storage/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp:
  Auto merged
storage/ndb/src/kernel/blocks/dbutil/DbUtil.cpp:
  Auto merged
storage/ndb/src/ndbapi/NdbOperationDefine.cpp:
  Auto merged
sql/ha_ndbcluster.cc:
  manual merge.
2007-10-25 11:00:36 +02:00
unknown
e9b98a5de7 Merge loke.(none):/home/knielsen/devel/bug31810
into  loke.(none):/home/knielsen/devel/mysql-5.0-ndb


sql/ha_ndbcluster.cc:
  Auto merged
2007-10-25 10:54:23 +02:00
unknown
34279339dc BUG#31810: Potential infinite loop with autoincrement failures in ndb
Fix extra semicolon causing if-statement to be disabled.


sql/ha_ndbcluster.cc:
  Fix extra semicolon causing if-statement to be disabled.
2007-10-25 08:40:42 +02:00
unknown
04ff9d4da0 Fixed bug #27695: View should not be allowed to have empty or
all space column names.

The parser has been modified to check VIEW column names
with the check_column_name function and to report an error
on empty and all space column names (same as for TABLE
column names).


sql/sql_yacc.yy:
  Fixed bug #27695.
  The parser has been modified to check VIEW column aliases
  with the check_column_name function and to report an error
  on empty columns and all space columns (same as for TABLE
  column names).
mysql-test/t/select.test:
  Updated test case for bug #27695.
mysql-test/r/select.result:
  Updated test case for bug #27695.
2007-10-25 10:32:52 +05:00
unknown
35ca78a0d4 Bug#30854 (Tables name show as binary in slave err msg on vm-win2003-64-b)
The root cause of this defect is that a call to my_error() is using a
'LEX_STRING' parameter instead of a 'char*'

This patch fixes the failing calls to my_error(), as well as similar calls
found during investigation.

This is a compiling bug (see the instrumentation in the bug report), no test cases provided.


sql/sql_base.cc:
  Fix broken calls to "..." (va_args) functions.
sql/sql_table.cc:
  Fix broken calls to "..." (va_args) functions.
2007-10-24 19:01:08 -06:00
unknown
4de3fdd716 Merge mysql.com:/home/ram/work/mysql-5.0-maint
into  mysql.com:/home/ram/work/b31615/b31615.5.0


sql/set_var.cc:
  Auto merged
2007-10-24 21:57:51 +05:00
unknown
59729a7835 Merge mysql.com:/home/ram/work/mysql-5.1-maint
into  mysql.com:/home/ram/work/b31615/b31615.5.1
2007-10-24 21:56:32 +05:00
unknown
06e82cb855 Merge kindahl-laptop.dnsalias.net:/home/bkroot/mysql-5.1-rpl
into  kindahl-laptop.dnsalias.net:/home/bk/b24860-mysql-5.1-rpl


sql/log_event.cc:
  Auto merged
sql/log_event.h:
  Auto merged
sql/slave.cc:
  Auto merged
2007-10-24 16:54:18 +02:00
unknown
4a08f39214 BUG#31702 (Missing row on slave causes assertion failure under row-based
replication):

Incremental patch to enable idempotency support for update events again.
The final handling of errors will be done in BUG#31609, and until then
the handling of errors should be consistent between the different types
of changes.


mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result:
  Result change.
mysql-test/suite/rpl/r/rpl_temporary_errors.result:
  Result change.
mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test:
  Changing test to assume idempotency handling of update event.
mysql-test/suite/rpl/t/rpl_temporary_errors.test:
  Changing test to assume idempotency handling of update event.
sql/log_event.cc:
  Incremental patch to enable idempotency support for the update events again.
  The real error handling will be implemented in BUG#31609.
2007-10-24 16:02:37 +02:00
unknown
3e208eb61f Merge mskold@bk-internal.mysql.com:/home/bk/mysql-5.0-ndb
into  mysql.com:/windows/Linux_space/MySQL/mysql-5.0-ndb
2007-10-24 14:07:33 +02:00
unknown
22b3670544 Merge mysql.com:/home/svoj/devel/mysql/BUG31159/mysql-4.1-engines
into  mysql.com:/home/svoj/devel/mysql/BUG31159/mysql-5.0-engines


include/my_sys.h:
  Auto merged
mysql-test/r/ctype_ucs.result:
  Auto merged
mysql-test/t/ctype_ucs.test:
  Auto merged
mysys/charset.c:
  Manual merge.
sql/item_func.cc:
  Manual merge.
2007-10-24 16:39:13 +05:00
unknown
4fda18a3ec Merge svojtovich@bk-internal.mysql.com:/home/bk/mysql-4.1-engines
into  mysql.com:/home/svoj/devel/mysql/BUG31159/mysql-4.1-engines
2007-10-24 16:10:09 +05:00
unknown
660d66263b BUG#31159 - fulltext search on ucs2 column crashes server
ucs2 doesn't provide required by fulltext ctype array. Crash
happens because fulltext attempts to use unitialized ctype
array.

Fixed by converting ucs2 fields to compatible utf8 analogue.


include/my_sys.h:
  Added a function to find compatible character set with ctype array
  available. Currently used by fulltext search to find compatible
  substitute for ucs2 collations.
mysql-test/r/ctype_ucs.result:
  A test case for BUG#31159.
mysql-test/t/ctype_ucs.test:
  A test case for BUG#31159.
mysys/charset.c:
  Added a function to find compatible character set with ctype array
  available. Currently used by fulltext search to find compatible
  substitute for ucs2 collations.
sql/item_func.cc:
  Convert ucs2 fields to utf8. Fulltext requires ctype array, but
  ucs2 doesn't provide it.
2007-10-24 16:09:30 +05:00
unknown
ee8ab6d9e6 Merge magare.gmz:/home/kgeorge/mysql/work/B30715-merged-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/work/B30715-merged-5.1-opt


mysql-test/r/func_group.result:
  Auto merged
mysql-test/r/type_decimal.result:
  Auto merged
mysql-test/t/func_group.test:
  Auto merged
mysql-test/t/type_decimal.test:
  Auto merged
sql/item.cc:
  Auto merged
sql/opt_sum.cc:
  merge bug 30715 to 5.1-opt
2007-10-24 11:50:09 +03:00
unknown
e66f7e1d36 Merge magare.gmz:/home/kgeorge/mysql/work/B30715-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/work/B30715-merged-5.0-opt
2007-10-24 11:45:29 +03:00
unknown
b5d33614ac after-merge fix: new sys_var_character_set_client classs introduced to perform
separate checking.
2007-10-24 13:28:46 +05:00
unknown
e2433cbcaa Bug #30715: Assertion failed: item_field->field->real_maybe_null(),
file .\opt_sum.cc, line
The optimizer pre-calculates the MIN/MAX values for queries like
 SELECT MIN(kp_k) WHERE kp_1 = const AND ... AND kp_k-1 = const
when there is a key over kp_1...kp_k
In doing so it was not checking correctly nullability and 
there was a superfluous assert(). 
Fixed by making sure that the field can be null before checking and
taking out the wrong assert().
.
Introduced a correct check for nullability 
The MIN(field) can return NULL when all the row values in the group
are NULL-able or if there were no rows.
Fixed the assertion to reflect the case when there are no rows.


mysql-test/r/func_group.result:
  Bug #30715: test case
mysql-test/t/func_group.test:
  Bug #30715: test case
sql/opt_sum.cc:
  Bug #30715: correct nullability check for MIN/MAX pre-calculation over index.
2007-10-24 11:15:08 +03:00
unknown
9aa4317066 Merge station.:/mnt/raid/alik/MySQL/devel/5.0-rt
into  station.:/mnt/raid/alik/MySQL/devel/5.1-rt


mysql-test/r/select.result:
  Auto merged
mysql-test/t/select.test:
  Auto merged
sql/sql_table.cc:
  Auto merged
2007-10-24 11:43:16 +04:00
unknown
18436d48d7 Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-5.0-rpl
into  mysql.com:/home/bar/mysql-work/mysql-5.0.b31081
2007-10-24 12:09:24 +05:00
unknown
47bed4d45d Bug#31081 server crash in regexp function
Additional fix for valgrind warning
2007-10-24 12:08:33 +05:00
unknown
9be2220bfd Merge mysql.com:/home/bar/mysql-work/mysql-5.0
into  mysql.com:/home/bar/mysql-work/mysql-5.0-rpl-mr


client/mysql.cc:
  Auto merged
mysql-test/r/ctype_euckr.result:
  Auto merged
mysql-test/r/ctype_uca.result:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/sp_head.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
strings/ctype-euc_kr.c:
  Auto merged
2007-10-24 10:49:46 +05:00
unknown
957d866506 Merge mattiasj-laptop.(none):/home/mattiasj/clones/mysql-5.1-engines
into  mattiasj-laptop.(none):/home/mattiasj/clones/mysql-5.1-bug30878


mysql-test/r/partition.result:
  Auto merged
mysql-test/t/partition.test:
  Auto merged
sql/sql_partition.cc:
  Auto merged
2007-10-23 22:13:00 +02:00
unknown
2b5bcaabee Merge mattiasj-laptop.(none):/home/mattiasj/clones/mysql-5.1-bug30695
into  mattiasj-laptop.(none):/home/mattiasj/clones/mysql-5.1-bug30878


mysql-test/r/partition.result:
  SCCS merged
mysql-test/t/partition.test:
  SCCS merged
2007-10-23 22:07:45 +02:00
unknown
fe784fac00 Bug #30695: An apostrophe ' in the comment of the ADD PARTITION
causes the Server to crash.

Accessing partitioned table with an apostrophe in partition options
like DATA DIRECTORY, INDEX DIRECTORY or COMMENT causes server crash.

Partition options were saved in .frm file without escaping.
When accessing such table it is not possible to properly restore
partition information.
Crashed because there was no check for partition info parser failure.

Fixed by escaping quoted text in the partition info when writing it to
the frm-file and added a check that it was able to parse the partition
info before using it 

NOTE: If the comment is written by an earlier version of the server,
the corrupted frm-file is not fixed, but left corrupted, you have to
manually drop the table and recreate it.


mysql-test/r/partition.result:
  bug #30695: An apostrophe ' in the comment of the ADD PARTITION causes
  the Server to crash.
   testresult
mysql-test/t/partition.test:
  bug #30695: An apostrophe ' in the comment of the ADD PARTITION causes
  the Server to crash.
    testcase
sql/sql_partition.cc:
  Bug #30695: An apostrophe ' in the comment of the ADD PARTITION causes
    the Server to crash.
  
    Crashes when there is an non escaped apostrophe in the partition options
  
    fixed by escaping quoted text before writing to the frm-file
sql/table.cc:
  Bug #30695 An apostrophe ' in the comment of the ADD PARTITION
    causes the Server to crash
  
  problem was using a null poiter without check -> crash.
  
  added a check that the previus call succeded
2007-10-23 22:04:09 +02:00
unknown
4ea9a3d5cd Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  mysql.com:/home/psergey/mysql-5.0-bug31450


sql/item.cc:
  Auto merged
mysql-test/r/type_decimal.result:
  Post-merge fixes
mysql-test/t/type_decimal.test:
  Post-merge fixes
2007-10-23 20:03:06 +04:00
unknown
53dac1ee1a BUG#31450: Query causes error 1048
- Let Item::save_in_field() call set_field_to_null_with_conversions() 
  for decimal type, like this is done for the other item result types.


mysql-test/r/type_decimal.result:
  BUG#31450: Query causes error 1048: testcase
mysql-test/t/type_decimal.test:
  BUG#31450: Query causes error 1048: testcase
2007-10-23 19:24:59 +04:00
unknown
95a8bb20fb Merge mysql.com:/home/gluh/MySQL/Merge/5.1
into  mysql.com:/home/gluh/MySQL/Merge/5.1-opt


client/client_priv.h:
  Auto merged
client/mysqldump.c:
  Auto merged
include/config-win.h:
  Auto merged
libmysql/libmysql.c:
  Auto merged
mysql-test/mysql-test-run.pl:
  Auto merged
mysql-test/r/create.result:
  Auto merged
mysql-test/r/func_sapdb.result:
  Auto merged
mysql-test/r/information_schema.result:
  Auto merged
mysql-test/r/variables.result:
  Auto merged
mysql-test/t/information_schema.test:
  Auto merged
mysql-test/t/variables.test:
  Auto merged
sql/field.cc:
  Auto merged
sql/ha_partition.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_func.h:
  Auto merged
sql/item_sum.cc:
  Auto merged
sql/item_timefunc.h:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/protocol.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/table.cc:
  Auto merged
storage/innobase/handler/ha_innodb.cc:
  Auto merged
storage/myisam/sort.c:
  Auto merged
tests/mysql_client_test.c:
  Auto merged
mysql-test/r/query_cache.result:
  manual merge
mysql-test/include/mix1.inc:
  manual merge
mysql-test/r/innodb_mysql.result:
  manual merge
mysql-test/r/type_datetime.result:
  manual merge
mysql-test/r/type_decimal.result:
  manual merge
mysql-test/t/query_cache.test:
  manual merge
mysql-test/t/type_datetime.test:
  manual merge
mysql-test/t/type_decimal.test:
  manual merge
sql/item.cc:
  manual merge
2007-10-23 19:08:21 +05:00
unknown
6044965c4f Patch for BUG#30736: Row Size Too Large Error Creating a Table and
Inserting Data.

The problem was that under some circumstances Field class was not
properly initialized before calling create_length_to_internal_length()
function, which led to assert failure.

The fix is to do the proper initialization.

The user-visible problem was that under some circumstances
CREATE TABLE ... SELECT statement crashed the server or led
to wrong error message (wrong results).


mysql-test/r/select.result:
  Update result file.
mysql-test/t/select.test:
  Add a test case for BUG#30736: Row Size Too Large Error
  Creating a Table and Inserting Data.
sql/sql_table.cc:
  Move sql_field->decimals initialization before
  sql_field->create_length_to_internal_length() call.
2007-10-23 18:03:51 +04:00
unknown
8479eb1db7 Merge mysql.com:/home/gluh/MySQL/Merge/5.0
into  mysql.com:/home/gluh/MySQL/Merge/5.0-opt


client/mysqldump.c:
  Auto merged
include/config-win.h:
  Auto merged
libmysql/libmysql.c:
  Auto merged
myisam/sort.c:
  Auto merged
mysql-test/r/func_sapdb.result:
  Auto merged
mysql-test/r/variables.result:
  Auto merged
mysql-test/t/variables.test:
  Auto merged
sql/field.cc:
  Auto merged
sql/ha_innodb.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_sum.cc:
  Auto merged
sql/item_timefunc.h:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
tests/mysql_client_test.c:
  Auto merged
mysql-test/r/type_datetime.result:
  manual merge
mysql-test/r/type_decimal.result:
  manual merge
mysql-test/t/type_datetime.test:
  manual merge
mysql-test/t/type_decimal.test:
  manual merge
sql/item.cc:
  manual merge
2007-10-23 18:51:43 +05:00
unknown
c448d2ed5d Merge abotchkov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  mysql.com:/home/hf/work/30638/my50-30638
2007-10-23 17:24:57 +05:00
unknown
72bd96aef3 Merge ssh://bk-internal.mysql.com//home/bk/mysql-5.0-opt
into  polly.(none):/home/kaa/src/opt/mysql-5.0-opt
2007-10-23 16:24:56 +04:00
unknown
de3eb8fbdc Merge polly.(none):/home/kaa/src/opt/bug31742/my51-bug28550
into  polly.(none):/home/kaa/src/opt/mysql-5.1-opt
2007-10-23 16:07:03 +04:00
unknown
f7f8ca8bd7 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/autopush/B30825-new-5.0-opt
2007-10-23 15:04:40 +03:00
unknown
2d4639c40b Merge polly.(none):/home/kaa/src/opt/bug31742/my50-bug28550
into  polly.(none):/home/kaa/src/opt/mysql-5.0-opt
2007-10-23 16:03:48 +04:00
unknown
619bb76ba7 Merge polly.(none):/home/kaa/src/opt/bug31742/my50-bug28550
into  polly.(none):/home/kaa/src/opt/bug31742/my51-bug28550


sql/filesort.cc:
  SCCS merged
2007-10-23 15:52:27 +04:00
unknown
4e5c8bc7e0 type conversions fixed to get rid of warnings
sql/ha_heap.cc:
  type conversion fix
sql/opt_range.cc:
  type conversion fix
2007-10-23 16:32:05 +05:00
unknown
09c8f3e606 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.1-opt
into  magare.gmz:/home/kgeorge/mysql/autopush/B30825-5.1-opt
2007-10-23 14:28:50 +03:00
unknown
73d08e3aae Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/autopush/B30825-new-5.0-opt
2007-10-23 14:23:18 +03:00
unknown
bfa5dd2f53 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.1-opt
into  magare.gmz:/home/kgeorge/mysql/autopush/B28687-5.1-opt
2007-10-23 14:21:50 +03:00
unknown
bcc627846d Fixed bug #31663: if the FIELDS TERMINATED BY string
in the SELECT INTO OUTFILE clause starts with a special
character (one of n, t, r, b, 0, Z or N) and ENCLOSED BY
is empty, every occurrence of this character within a
field value is duplicated.

Duplication has been avoided.
New warning message has been added: "First character of
the FIELDS TERMINATED string is ambiguous; please use
non-optional and non-empty FIELDS ENCLOSED BY".


mysql-test/r/outfile_loaddata.result:
  BitKeeper file /home/uchum/work/bk/5.0-opt-31663/mysql-test/r/outfile_loaddata.result
  Added test case for bug #31663.
mysql-test/t/outfile_loaddata.test:
  BitKeeper file /home/uchum/work/bk/5.0-opt-31663/mysql-test/t/outfile_loaddata.test
  Added test case for bug #31663.
sql/sql_class.h:
  Fixed bug #31663.
  The select_export::is_ambiguous_field_term field has been added.
  This field is true if select_export::field_sep_char contains
  the first char of the FIELDS TERMINATED BY (ENCLOSED BY is empty),
  and items can contain this character.
  The select_export::field_term_char field has been added (first
  char of the FIELDS TERMINATED BY string or INT_MAX).
sql/sql_class.cc:
  Fixed bug #31663.
  The select_export::prepare method has been modified to calculate
  a value of the select_export::is_ambiguous_field_term field and
  to warn if this value is true.
  The select_export::send_data method has been modified to
  avoid escaping or duplication of the field_set_char if
  is_ambiguous_field_term is true.
sql/share/errmsg.txt:
  Fixed bug #31663.
  The ER_AMBIGUOUS_FIELD_TERM warning has been added.
2007-10-23 16:16:59 +05:00
unknown
0c396b862e Merge mysql.com:/home/ram/work/b31615/b31615.4.1
into  mysql.com:/home/ram/work/b31615/b31615.5.0


mysql-test/r/ctype_ucs.result:
  Auto merged
mysql-test/t/ctype_ucs.test:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/set_var.h:
  Auto merged
2007-10-23 16:04:32 +05:00
unknown
5cc013209e Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.1-maint
into  mysql.com:/scratch/tnurnberg/20901/51-20901
2007-10-23 12:38:09 +02:00
unknown
084753af19 Merge abotchkov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  mysql.com:/home/hf/work/30638/my50-30638
2007-10-23 15:35:52 +05:00
unknown
8262c4f445 type conversion fixed to get rid of warnings
sql/opt_range.cc:
  type conversion fixed
2007-10-23 15:34:10 +05:00
unknown
1831e8e043 Merge mysql.com:/home/ram/work/mysql-5.1-maint
into  mysql.com:/home/ram/work/b31604/b31604.5.1
2007-10-23 15:26:14 +05:00
unknown
a9a50c7287 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/autopush/B30825-new-5.0-opt
2007-10-23 13:10:35 +03:00
unknown
8a790dd155 Merge abotchkov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  mysql.com:/home/hf/work/30638/my50-30638
2007-10-23 14:31:24 +05:00
unknown
e1dc86b079 type conversions fixed to avoid warnings on Windows
myisam/mi_write.c:
  type conversion fixed
myisam/sort.c:
  type conversion fixed
sql/ha_federated.cc:
  type conversion fixed
sql/ha_heap.cc:
  type conversion fixed
sql/ha_innodb.cc:
  type conversion fixed
sql/ha_myisam.cc:
  type conversion fixed
sql/opt_range.cc:
  type conversion fixed
sql/sql_map.cc:
  type conversion fixed
sql/sql_select.cc:
  type conversion fixed
sql/sql_update.cc:
  type conversion fixed
2007-10-23 14:27:11 +05:00
unknown
31634a38e8 Merge mysql.com:/home/gluh/MySQL/Merge/4.1
into  mysql.com:/home/gluh/MySQL/Merge/4.1-opt
2007-10-23 14:06:56 +05:00
unknown
0d86a617b5 Merge mysql.com:/home/ram/work/mysql-5.0-maint
into  mysql.com:/home/ram/work/b31349/b31349.5.0
2007-10-23 14:06:26 +05:00
unknown
6e71a0f99b Merge mysql.com:/home/ram/work/b31349/b31349.5.0
into  mysql.com:/home/ram/work/b31349/b31349.5.1


mysql-test/r/func_misc.result:
  Auto merged
mysql-test/t/func_misc.test:
  Auto merged
sql/item_strfunc.h:
  Auto merged
2007-10-23 13:55:06 +05:00
unknown
760840e231 Merge mysql.com:/home/ram/work/mysql-5.1-maint
into  mysql.com:/home/ram/work/b31604/b31604.5.1


sql/set_var.cc:
  Auto merged
2007-10-23 13:54:40 +05:00
unknown
c5dfd3e193 Merge magare.gmz:/home/kgeorge/mysql/autopush/B30825-new-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/work/B30825-5.1-opt


mysql-test/r/gis-rtree.result:
  Auto merged
mysql-test/r/gis.result:
  Auto merged
mysql-test/t/gis.test:
  Auto merged
BitKeeper/deleted/.del-bdb_gis.result:
  Auto merged
BitKeeper/deleted/.del-bdb_gis.test:
  Auto merged
sql/sql_table.cc:
  Auto merged
mysql-test/r/innodb_gis.result:
  merged 5.0-opt -> 5.1-opt
mysql-test/t/innodb_gis.test:
  merged 5.0-opt -> 5.1-opt
sql/field.cc:
  merged 5.0-opt -> 5.1-opt
sql/field.h:
  merged 5.0-opt -> 5.1-opt
sql/sql_select.h:
  merged 5.0-opt -> 5.1-opt
sql/sql_yacc.yy:
  merged 5.0-opt -> 5.1-opt
sql/table.cc:
  merged 5.0-opt -> 5.1-opt
2007-10-23 11:44:14 +03:00
unknown
933bf86954 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/autopush/B30825-new-5.0-opt


sql/field.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
2007-10-23 11:26:37 +03:00
unknown
e7acb3ac71 Merge magare.gmz:/home/kgeorge/mysql/work/B28687-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/work/B28687-5.1-opt


mysql-test/t/type_date.test:
  Auto merged
mysql-test/r/type_date.result:
  merge 5.0-opt -> 5.1-opt
sql/item.cc:
  merge 5.0-opt -> 5.1-opt
2007-10-23 11:22:59 +03:00
unknown
565c105c84 Bug#31633 Information schema = NULL queries crash the server
added correct handling of NULL values for lookup fields


mysql-test/r/information_schema.result:
  test result
mysql-test/t/information_schema.test:
  test case
sql/sql_show.cc:
  added correct handling of NULL values for lookup fields
2007-10-23 13:20:51 +05:00
unknown
61b812d913 Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.1-maint
into  mysql.com:/scratch/tnurnberg/20901/51-20901


mysql-test/r/create.result:
  Auto merged
mysql-test/t/create.test:
  Auto merged
sql/sql_parse.cc:
  Auto merged
2007-10-23 08:54:20 +02:00
unknown
f7eae9d33a Merge mysql.com:/scratch/tnurnberg/20901/50-20901
into  mysql.com:/scratch/tnurnberg/20901/51-20901


mysql-test/r/create.result:
  Auto merged
mysql-test/r/grant.result:
  Auto merged
mysql-test/t/create.test:
  Auto merged
mysql-test/t/grant.test:
  Auto merged
sql/sql_parse.cc:
  Auto merged
2007-10-23 07:09:56 +02:00
unknown
a06c4b5353 Merge mysql.com:/scratch/tnurnberg/20901/41-20901
into  mysql.com:/scratch/tnurnberg/20901/50-20901


mysql-test/r/grant.result:
  Auto merged
mysql-test/t/create.test:
  Auto merged
mysql-test/t/grant.test:
  Auto merged
sql/sql_parse.cc:
  Auto merged
mysql-test/r/create.result:
  SCCS merged
2007-10-23 07:00:13 +02:00
unknown
f9d068bc09 Bug #20901: CREATE privilege is enough to insert into a table
CREATE TABLE IF NOT EXISTS ... SELECT let you insert into an existing
table as long as you had the CREATE privilege.  CREATE ... SELECT
variants now always require INSERT privilege on target table.


mysql-test/r/create.result:
  Show that CREATE...SELECT requires INSERT privilege on target table.
mysql-test/r/grant.result:
  Sort output for a defined state.
mysql-test/t/create.test:
  Show that CREATE...SELECT requires INSERT privilege on target table.
mysql-test/t/grant.test:
  Sort output for a defined state.
sql/sql_parse.cc:
  Require INSERT privilege on target table for CREATE ... SELECT.
2007-10-23 06:54:31 +02:00
unknown
50ff08918f Merge ramayana.hindu.god:/home/tsmith/m/bk/51
into  ramayana.hindu.god:/home/tsmith/m/bk/maint/51


sql/set_var.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
storage/csv/ha_tina.cc:
  Auto merged
2007-10-22 14:32:22 -06:00
unknown
966e3df374 Merge ramayana.hindu.god:/home/tsmith/m/bk/50
into  ramayana.hindu.god:/home/tsmith/m/bk/maint/50
2007-10-22 14:31:41 -06:00
unknown
c6e00be97f Bug #31332 --event-scheduler option misbehaving
Changed the behaviour of the --event-scheduler option when used without an arguments. It
now turns the option on.


mysql-test/r/events_bugs.result:
  Test that --event-scheduler with no options in events_bugs-master.opt turns the option
  on.
mysql-test/t/events_bugs.test:
  Test that --event-scheduler with no options in events_bugs-master.opt turns the option
  on.
sql/events.cc:
  Changed the behaviour of the --event-scheduler option when used without an arguments.
  It now turns the option on.
mysql-test/t/events_bugs-master.opt:
  Test that --event-scheduler with no options in events_bugs-master.opt turns the option
  on.
2007-10-22 15:16:43 -04:00
unknown
e3bd02cfbf Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into  janus.mylan:/usr/home/serg/Abk/mysql-5.1


mysql-test/r/innodb_mysql.result:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_plugin.cc:
  Auto merged
sql/table.cc:
  Auto merged
tests/mysql_client_test.c:
  Auto merged
2007-10-22 20:05:06 +02:00
unknown
849bcf941f Bug #28687: Search fails on '0000-00-00' date after sql_mode change
When doing indexed search the server constructs a key image for 
faster comparison to the stored keys. While doing that it must not
perform (and stop if they fail) the additional date checks that can 
be turned on by the SQL mode because there already may be values in 
the table that don't comply with the error checks.
Fixed by ignoring these SQL mode bits while making the key image.


mysql-test/r/type_date.result:
  Bug #28687: test case
mysql-test/t/type_date.test:
  Bug #28687: test case
sql/item.cc:
  Bug #28687: no invalid date warnings
2007-10-22 19:32:18 +03:00
unknown
bbce18c303 Fix for bug #31742: delete from ... order by function call that causes
an error, asserts server

In case of a fatal error during filesort in find_all_keys() the error
was returned without the necessary handler uninitialization.
Fixed by changing the code so that handler uninitialization is performed
before returning the error.


mysql-test/r/delete.result:
  Added a test case for bug #31742.
mysql-test/t/delete.test:
  Added a test case for bug #31742.
sql/filesort.cc:
  In case of a fatal error in find_all_keys() do not return before doing
  the necessary handler uninitialization steps.
2007-10-22 16:10:08 +04:00
unknown
82cc70959e Merge kindahl-laptop.dnsalias.net:/home/bkroot/mysql-5.1-rpl
into  kindahl-laptop.dnsalias.net:/home/bk/b28618-mysql-5.1-rpl


mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/log_event.h:
  Auto merged
sql/rpl_rli.h:
  Auto merged
sql/slave.cc:
  Auto merged
2007-10-22 08:50:08 +02:00
unknown
578c238600 Merge bk@192.168.21.1:mysql-5.0-opt
into  mysql.com:/home/hf/work/30638/my50-30638
2007-10-22 10:27:35 +05:00
unknown
dda586282d Merge mysql.com:/home/hf/work/29801/my50-29801
into  mysql.com:/home/hf/work/30638/my50-30638
2007-10-22 10:26:16 +05:00
unknown
e763badfe3 Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  mysql.com:/scratch/tnurnberg/31588/50-31588
2007-10-22 01:57:49 +02:00
unknown
8e32e10370 Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.1-opt
into  mysql.com:/scratch/tnurnberg/31588/51-31588
2007-10-21 22:49:16 +02:00
unknown
62d096496f Merge polly.(none):/home/kaa/src/opt/bug28550/my51-bug28550
into  polly.(none):/home/kaa/src/opt/mysql-5.1-opt
2007-10-21 21:57:57 +04:00
unknown
fb434504cc Merge polly.(none):/home/kaa/src/opt/bug28550/my50-bug28550
into  polly.(none):/home/kaa/src/opt/mysql-5.0-opt
2007-10-21 21:55:26 +04:00
unknown
e259d46103 Merge polly.(none):/home/kaa/src/opt/bug28550/my50-bug28550
into  polly.(none):/home/kaa/src/opt/bug28550/my51-bug28550


mysql-test/t/func_str.test:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_strfunc.h:
  Auto merged
mysql-test/r/func_str.result:
  Manual merge.
2007-10-21 21:49:30 +04:00
unknown
04311fabaa Bug #28550 "Potential bugs related to the return type of the CHAR function".
Since, as of MySQL 5.0.15, CHAR() arguments larger than 255 are converted into multiple result bytes, a single CHAR() argument can now take up to 4 bytes. This patch fixes Item_func_char::fix_length_and_dec() to take this into account.
  
This patch also fixes a regression introduced by the patch for bug21513. As now we do not always have the 'name' member of Item set for Item_hex_string and Item_bin_string, an own print() method has been added to Item_hex_string so that it could correctly be printed by Item_func::print_args().


mysql-test/r/func_str.result:
  Import patch bug288550.patch
mysql-test/t/func_str.test:
  Import patch bug288550.patch
sql/item.cc:
  Import patch bug288550.patch
sql/item.h:
  Import patch bug288550.patch
sql/item_strfunc.h:
  Import patch bug288550.patch
2007-10-21 21:45:31 +04:00
unknown
e8b8b0894e Merge aelkin@bk-internal.mysql.com:/home/bk/mysql-5.0-rpl
into  dsl-hkibras1-ff5fc300-23.dhcp.inet.fi:/home/elkin/MySQL/TEAM/FIXES/5.0/bug26199-create_proc_syntax_slave
2007-10-21 18:39:22 +03:00
unknown
6cfd9a4fc3 Bug #26199 Replication Failure on Slave when using stored procs with bit-type parameters.
The value of the actual argument of BIT-type-arg stored procedure was binlogged as non-escaped
sequence of bytes corresponding to internal representation of the bit value.

The patch enforces binlogging of the bit-argument as a valid literal: prefixing the quoted bytes
sequence with _binary.
Note, that behaviour of Item_field::var_str for field_type() of MYSQL_TYPE_BIT is exceptional
in that the returned string contains the binary representation even though result_type() of
the item is INT_RESULT.


mysql-test/r/rpl_sp_effects.result:
  testing stored function and procedure called with BIT-arg.
mysql-test/t/rpl_sp_effects.test:
  results changed
sql/sp_head.cc:
  Treating BIT field type specially to for its value to be prefixed and quoted.
2007-10-21 18:37:37 +03:00
unknown
219e6a6438 BUG#24860 (Incorrect SLAVE_TRANSACTION_RETRIES code can result in slave stuck):
If a temporary error occured inside a group on an event that was not the first
event of the group, the slave could get stuck because the retry counter is reset
whenever an event was executed successfully.

This patch only reset the retry counter when an entire group has been successfully
executed, or failed with a non-transient error.


sql/slave.cc:
  Adding debug printouts to every place where Relay_log_info::trans_retries
  is changed and to has_temporary_error() to print the error when returning.
  
  Adding debug variable all_errors_are_temporary_errors to make all errors
  for slave thread temporary errors.
  
  Adding code so that the Relay_log_info::trans_retries is only reset when
  an entire group was sucessfully executed, or a non-temporary error occured.
mysql-test/suite/rpl/r/rpl_temporary_errors.result:
  New BitKeeper file ``mysql-test/suite/rpl/r/rpl_temporary_errors.result''
mysql-test/suite/rpl/t/rpl_temporary_errors-slave.opt:
  New BitKeeper file ``mysql-test/suite/rpl/t/rpl_temporary_errors-slave.opt''
mysql-test/suite/rpl/t/rpl_temporary_errors.test:
  New BitKeeper file ``mysql-test/suite/rpl/t/rpl_temporary_errors.test''
2007-10-20 20:16:12 +02:00
unknown
d1ddc24a1a Fix for BUG#31148: bool close_thread_table(THD*, TABLE**):
Assertion `table->key_read == 0' failed.

The problem was that key_read on a table in a sub-select was not
properly reset. That happens because the code responsible for that
is copy&pasted all around the server. In some place, it was obviously
forgotten to be pasted.

The fix is to reset key_read properly.


mysql-test/r/key.result:
  Update result file.
mysql-test/t/key.test:
  A test case for BUG#31148: bool close_thread_table(THD*, TABLE**):
  Assertion `table->key_read == 0' failed.
sql/sql_select.cc:
  Reset key_read before closing index.
2007-10-20 21:48:15 +04:00
unknown
0b1c0f3173 Bug#31702 (Missing row on slave causes assertion failure under row-based replication):
When replicating an update pair (before image, after image) under row-based
replication, and the before image is not found on the slave, the after image
was not discared, and was hence read as a before image for the next row.
Eventually, this lead to an after image being read outside the block of rows
in the event, causing an assertion to fire.

This patch fixes this by reading the after image in the event that the row
was not found on the slave, adds some extra debug assertion to catch future
errors earlier, and also adds a few non-debug checks to prevent reading
outside the block of the event.


include/my_base.h:
  Adding error code HA_ERR_CORRUPT_EVENT.
mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result:
  Result change.
mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test:
  Adding test to try to use row-based replication to replicate an
  update of a row that doesn't exist on the slave. We should get
  an apropriate error and the slave should stop.
sql/log_event.cc:
  Adding debug printouts. Adding code to Update_rows_log_event::do_exec_row()
  so that the after image is read (and ignored) in the event of an error in
  finding the row. This is necessary so that the second pair of images is
  read correctly for the next update pair.
  
  Changing logic for ignoring errors to not include update events, since
  a "key not found" error or a "record changed" error is not idempotent
  for updates, just for deletes and inserts.
sql/log_event.h:
  Adding debug assertions to check that row reading is within the events block of rows.
2007-10-20 18:19:55 +02:00
unknown
1a163698b4 Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.1-opt
into  sin.intern.azundris.com:/misc/mysql/31588/51-31588
2007-10-20 17:18:23 +02:00
unknown
c33823ba83 Merge bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into  bodhi.(none):/opt/local/work/mysql-5.1-runtime


sql/sql_class.cc:
  Auto merged
2007-10-20 01:21:20 +04:00
unknown
079ae23003 Rename: query_error -> is_slave_error.
Add comments.


sql/ha_ndbcluster_binlog.cc:
  query_error -> slave_error
sql/handler.cc:
  query_error -> slave_error
sql/log.cc:
  query_error -> slave_error
sql/log_event.cc:
  query_error -> slave_error
sql/log_event_old.cc:
  query_error -> slave_error
sql/mysqld.cc:
  query_error -> slave_error
sql/protocol.cc:
  query_error -> slave_error
sql/slave.cc:
  query_error -> slave_error
sql/sp_head.cc:
  query_error -> slave_error
sql/sql_class.cc:
  query_error -> slave_error
sql/sql_class.h:
  Rename: query_error -> is_slave_error, to avoid confusion.
  Add commenta.
sql/sql_connect.cc:
  Rename: query_error -> is_slave_error, to avoid confusion.
  Originally it was the same code to handle init-connect and init-slave 
  mysqld options. Then init-connect implementation forked off,
  but the one who copy-pasted the code didn't change it to not
  use a replication-specific variable.
2007-10-20 01:20:38 +04:00
unknown
62fd471647 Merge anubis.xiphis.org:/usr/home/antony/work/mysql-5.1-engines
into  anubis.xiphis.org:/usr/home/antony/work/mysql-5.1-engines.merge


configure.in:
  Auto merged
mysql-test/r/heap_btree.result:
  Auto merged
mysql-test/r/log_tables.result:
  Auto merged
mysql-test/r/partition.result:
  Auto merged
mysql-test/r/system_mysql_db.result:
  Auto merged
mysql-test/t/heap_btree.test:
  Auto merged
mysql-test/t/log_tables.test:
  Auto merged
mysql-test/t/partition.test:
  Auto merged
mysys/my_getopt.c:
  Auto merged
scripts/mysql_system_tables.sql:
  Auto merged
sql/sql_base.cc:
  Auto merged
2007-10-19 13:06:37 -07:00
unknown
66cd6d0c8f Patch for BUG#31111: --read-only crashes MySQL (events fail to load).
There actually were several problems here:
  - WRITE-lock is required to load events from the mysql.event table,
    but in the read-only mode an ordinary user can not acquire it;
  - Security_context::master_access attribute was not properly
    initialized in Security_context::init(), which led to differences
    in behavior with and without debug configure options.
  - if the server failed to load events from mysql.event, it forgot to
    close the mysql.event table, that led to the coredump, described
    in the bug report.

The patch is to fix all these problems:
  - Use the super-user to acquire WRITE-lock on the mysql.even table;
  - The WRITE-lock is acquired by the event scheduler in two cases:
    - on initial loading of events from the database;
    - when an event has been executed, so its attributes should
      be updated.
    Other cases when WRITE-lock is needed for the mysql.event table
    happen under the user account. So, nothing should be changed there
    for the read-only mode. The user is able to create/update/drop
    an event only if he is a super-user.
  - Initialize Security_context::master_access;
  - Close the mysql.event table in case something went wrong.


mysql-test/r/events_bugs.result:
  Update result file.
mysql-test/t/events_bugs.test:
  A test case for BUG#31111: --read-only crashes MySQL (events fail
  to load).
sql/event_data_objects.cc:
  When the worker thread is going to drop event after the execution
  we should do it under the super-user privileges in order to be able
  to lock the mysql.event table for writing in the read-only mode.
  
  This is a system operation, where user SQL can not be executed.
  So, there is no risk in compromising security by dropping an event
  under the super-user privileges.
sql/event_db_repository.cc:
  1. Close tables if something went wrong in simple_open_n_lock_tables();
  2. As soon as the system event scheduler thread is running under
     the super-user privileges, we should always be able to acquire
     WRITE-lock on the mysql.event table. However, let's have an assert
     to check this.
sql/event_scheduler.cc:
  Run the system event scheduler thread under the super-user privileges.
  In particular, this is needed to be able to lock the mysql.event table
  for writing when the server is running in the read-only mode.
  
  The event scheduler executes only system operations and does not
  execute user SQL (this is what the worker threads for). So, there
  is no risk in compromising security by running the event scheduler
  under the super-user privileges.
sql/events.cc:
  Open the mysql.event table as the super user to be able to acquire
  WRITE-lock in the read-only mode.
sql/sql_class.cc:
  Initialize Security_context::master_acces.
2007-10-19 19:57:08 +04:00
unknown
ddeec5ab8d export patch for bug#31221 2007-10-19 17:07:08 +02:00
unknown
8c57b13424 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.1-opt
into  magare.gmz:/home/kgeorge/mysql/autopush/B31157-5.1-opt
2007-10-19 17:01:13 +03:00
unknown
b87f070489 Bug #31157: crash when select+order by the avg of some field within the group by
The uncacheable flag should be set at fix_fields() stage.
Fixed by moving the flag setting to match the one in 5.1


mysql-test/r/query_cache.result:
  Bug #31157: test case
mysql-test/t/query_cache.test:
  Bug #31157: test case
sql/item_func.cc:
  Bug #31157: The uncacheable flag should be set at
  fix_fields() stage.
sql/item_func.h:
  Bug #31157: The uncacheable flag should be set at
  fix_fields() stage.
2007-10-19 15:43:19 +03:00
unknown
74ef292dc2 BUG#28618 (Skipping into the middle of a group with SQL_SLAVE_SKIP_COUNTER
is possible):

When skipping the beginning of a transaction starting with BEGIN, the OPTION_BEGIN
flag was not set correctly, which caused the slave to not recognize that it was
inside a group. This patch sets the OPTION_BEGIN flag for BEGIN, COMMIT, ROLLBACK,
and XID events. It also adds checks if inside a group before decreasing the
slave skip counter to zero.

Begin_query_log_event was not marked that it could not end a group, which is now
corrected.


mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test:
  Correcting slave skip counter to get the correct behaviour.
mysql-test/suite/rpl/r/rpl_slave_skip.result:
  Result change.
mysql-test/suite/rpl/t/rpl_slave_skip.test:
  Adding tests to check that skipping works for transactions:
  - Skipping one group with BEGIN first
  - Skipping two groups with BEGIN first
  - Skipping one group without BEGIN first but with AUTOCOMMIT=0
  - LOAD DATA INFILE under statement-based replication
mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result:
  Result change.
sql/log_event.cc:
  Adding checks if we're in a group when the slave skip counter is 1.
  In that case, we should keep going.
  
  Adding helping member function Log_event::continue_group() denoting
  that this event cannot end a group, and if the skip counter indicates
  that the group ends after this event, it should not decrease the skip
  counter.
  
  Query_log_event will change the OPTION_BEGIN flag for BEGIN, COMMIT, and
  ROLLBACK, even when skipping because of a positive skip count, and
  Xid_log_event will also affect the OPTION_BEGIN flag, even when being
  skipped.
  
  Begin_load_query_log_event cannot end a group, so it is marked to
  continue the group.
sql/log_event.h:
  Adding helper function Log_event::continue_group().
sql/rpl_rli.h:
  Adding Relay_log_info::get_flag() to get the value of a
  replication flag.
sql/slave.cc:
  Adding debug output and changing debug message.
mysql-test/suite/rpl/data/rpl_bug28618.dat:
  New BitKeeper file ``mysql-test/suite/rpl/data/rpl_bug28618.dat''
mysql-test/suite/rpl/t/rpl_slave_skip-slave.opt:
  New BitKeeper file ``mysql-test/suite/rpl/t/rpl_slave_skip-slave.opt''
2007-10-19 14:18:41 +02:00
unknown
bdab4dcefe Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into  janus.mylan:/usr/home/serg/Abk/mysql-5.1


client/mysqldump.c:
  Auto merged
mysql-test/lib/mtr_report.pl:
  Auto merged
mysql-test/r/innodb_mysql.result:
  Auto merged
sql/sql_lex.cc:
  Auto merged
tests/mysql_client_test.c:
  Auto merged
2007-10-19 12:44:57 +02:00
unknown
426b551bf6 Fix for bug #31349: ERROR 1062 (23000): Duplicate entry '' for key 'group_key'
Problem: lying to the optimizer that a function (Item_func_inet_ntoa)
cannot return NULL values leads to unexpected results (in the case group
keys creation/comparison is broken). 

Fix: Item_func_inet_ntoa::maybe_null should be set properly.


mysql-test/r/func_misc.result:
  Fix for bug #31349: ERROR 1062 (23000): Duplicate entry '' for key 'group_key'
    - test result.
mysql-test/t/func_misc.test:
  Fix for bug #31349: ERROR 1062 (23000): Duplicate entry '' for key 'group_key'
    - test case.
sql/item_strfunc.h:
  Fix for bug #31349: ERROR 1062 (23000): Duplicate entry '' for key 'group_key'
    - set Item_func_inet_ntoa::maybe_null flag.
2007-10-19 14:54:05 +05:00
unknown
244fb387a3 Merge malff@bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into  lambda.hsd1.co.comcast.net.:/home/malff/TREE/mysql-5.1-rt-merge


client/mysqltest.c:
  Auto merged
mysql-test/r/udf.result:
  Auto merged
mysql-test/t/mysqltest.test:
  Auto merged
mysql-test/t/udf.test:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/udf_example.c:
  Auto merged
sql/udf_example.def:
  Auto merged
2007-10-18 19:21:07 -06:00
unknown
bf5bcb849f Merge lambda.hsd1.co.comcast.net.:/home/malff/TREE/mysql-5.1-base
into  lambda.hsd1.co.comcast.net.:/home/malff/TREE/mysql-5.1-rt-merge


client/mysqlcheck.c:
  Auto merged
client/mysqltest.c:
  Auto merged
libmysql/libmysql.c:
  Auto merged
mysql-test/include/mix1.inc:
  Auto merged
mysql-test/r/innodb_mysql.result:
  Auto merged
mysql-test/r/udf.result:
  Auto merged
mysql-test/t/udf.test:
  Auto merged
sql/item.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_select.cc:
  Auto merged
tests/mysql_client_test.c:
  Auto merged
2007-10-18 16:57:51 -06:00
unknown
d927461052 Merge lambda.hsd1.co.comcast.net.:/home/malff/TREE/mysql-5.0-base
into  lambda.hsd1.co.comcast.net.:/home/malff/TREE/mysql-5.0-rt-merge


mysql-test/r/udf.result:
  Auto merged
mysql-test/t/udf.test:
  Auto merged
sql/item.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/udf_example.c:
  Auto merged
sql/udf_example.def:
  Auto merged
2007-10-18 16:39:55 -06:00
unknown
42d4be2c75 Merge moksha.com.br:/Users/davi/mysql/bugs/21557-5.1
into  moksha.com.br:/Users/davi/mysql/mysql-5.1-runtime


sql/sp_head.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
2007-10-18 15:47:22 -03:00
unknown
b9b481ec70 Bug#21557 entries in the general query log truncated at 1000 characters.
The general log write function (general_log_print) uses printf style
arguments which need to be pre-processed, meaning that the all arguments
are copied to a single buffer and the problem is that the buffer size is
constant (1022 characters) but queries can be much larger then this.

The solution is to introduce a new log write function that accepts a
buffer and it's length as arguments. The function is to be used when
a formatted output is not required, which is the case for almost all
query write-to-log calls.

This is a incompatible change with respect to the log format of prepared
statements.


mysql-test/r/log_tables.result:
  Add test case result for Bug#21557
mysql-test/t/log_tables.test:
  Add test case for Bug#21557
sql/log.cc:
  Introduce the logger function general_log_write which is similar to
  general_log_print but accepts a single buffer and the buffer length.
  The function doesn't perform any formatting and sends the buffer
  directly to the underlying log handlers.
sql/log.h:
  Introduce the logger function general_log_write.
sql/log_event.cc:
  Pass the query buffer directly to the logger function, formatting
  is not required on this case.
sql/mysql_priv.h:
  Prototype for the logger function general_log_write.
sql/sp_head.cc:
  Pass the query buffer directly to the logger function, formatting
  is not required on this case.
sql/sql_parse.cc:
  Pass the buffer directly to the logger function when formatting
  is not required.
sql/sql_prepare.cc:
  Don't log the statement id, it avoids making a extra copy of the query
  and the query is not truncated anymore if it exceeds the limit.
2007-10-18 15:45:07 -03:00
unknown
bf82c2f9b4 Bug#31692 - binlog_killed.test crashes sometimes
The server crashed when a thread was killed while locking the
general_log table at statement begin.

The general_log table is handled like a performance schema table.
The state of open tables is saved and cleared so that this table
seems to be the only open one. Then this table is opened and locked.
After writing, the table is closed and the open table state is
restored. Before restoring, however, it is asserted that there is
no current table open.

After locking the table, mysql_lock_tables() checks if the thread
was killed in between. If so, it unlocks the table and returns an
error. open_ltable() just returns with the error and leaves closing
of the table to close_thread_tables(), which is called at
statement end.

open_performance_schema_table() did not take this into account.
It assumed that a failed open_ltable() would not leave an open
table behind.

Fixed by closing thread tables after open_ltable() and before
restore_backup_open_tables_state() if the thread was killed.

No test case. It requires correctly timed parallel execution.
Since this bug was detected by the test suite, it seems
dispensable to add another test.


sql/sql_base.cc:
  Bug#31692 - binlog_killed.test crashes sometimes
  Closing thread tables after open_ltable() and before
  restore_backup_open_tables_state() if the thread was killed.
2007-10-18 16:14:27 +02:00
unknown
0a47c29fb0 Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  mysql.com:/scratch/tnurnberg/31588/50-31588
2007-10-18 16:09:03 +02:00
unknown
0b3720facc Merge magare.gmz:/home/kgeorge/mysql/work/B31221-5.0-gca-opt
into  magare.gmz:/home/kgeorge/mysql/work/B31221-5.1-opt


mysql-test/r/derived.result:
  Auto merged
mysql-test/r/ps_2myisam.result:
  Auto merged
mysql-test/r/ps_3innodb.result:
  Auto merged
mysql-test/r/ps_4heap.result:
  Auto merged
mysql-test/r/ps_5merge.result:
  Auto merged
mysql-test/r/type_datetime.result:
  Auto merged
mysql-test/t/type_date.test:
  Auto merged
BitKeeper/deleted/.del-ps_6bdb.result:
  Auto merged
mysql-test/suite/ndb/r/ps_7ndb.result:
  Auto merged
sql/field.cc:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
mysql-test/r/type_date.result:
  merge 5.0-opt -> 5.1-opt
2007-10-18 15:57:59 +03:00
unknown
e8504c5dfd Merge magare.gmz:/home/kgeorge/mysql/work/B31221-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/work/B31221-5.0-gca-opt
2007-10-18 15:53:45 +03:00
unknown
d5819c1f7c Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/autopush/B31221-5.0-opt
2007-10-18 15:32:48 +03:00
unknown
787a4b487a Bug #31221: Optimizer incorrectly identifies impossible WHERE clause
No warning was generated when a TIMESTAMP with a non-zero time part
 was converted to a DATE value. This caused index lookup to assume
 that this is a valid conversion and was returning rows that match 
 a comparison between a TIMESTAMP value and a DATE keypart.
 Fixed by generating a warning on such a truncation.


mysql-test/r/derived.result:
  Bug #31221: fixed an existing not-precise test case
mysql-test/r/ps_2myisam.result:
  Bug #31221: Warnings cased by existing tests
mysql-test/r/ps_3innodb.result:
  Bug #31221: Warnings cased by existing tests
mysql-test/r/ps_4heap.result:
  Bug #31221: Warnings cased by existing tests
mysql-test/r/ps_5merge.result:
  Bug #31221: Warnings cased by existing tests
mysql-test/r/ps_6bdb.result:
  Bug #31221: Warnings cased by existing tests
mysql-test/r/ps_7ndb.result:
  Bug #31221: Warnings cased by existing tests
mysql-test/r/type_date.result:
  Bug #31221: Warnings cased by existing tests
mysql-test/r/type_datetime.result:
  Bug #31221: test case
mysql-test/t/derived.test:
  Bug #31221: fixed an existing not-precise test case
mysql-test/t/type_date.test:
  Bug #31221: test case
sql/field.cc:
  Bug #31221: 
   - Upgraded fix for bug 29729
   - issue a warning only if the hh:mm:ss.msec is not zero consistently 
     for all the Field_newdate::store function
sql/item_timefunc.cc:
  Bug #31221: don't ignore the errors when storing data
2007-10-18 15:19:04 +03:00
unknown
89810417ae Post-merge changes for bug #31207: Test "join_nested" shows different strategy on IA64 CPUs / Intel's ICC compiler. 2007-10-18 15:17:21 +04:00
unknown
ddaecb2161 Merge polly.(none):/home/kaa/src/maint/mysql-5.0-maint
into  polly.(none):/home/kaa/src/maint/mysql-5.1-maint


include/my_sys.h:
  Auto merged
libmysql/Makefile.shared:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_cmpfunc.h:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/records.cc:
  Auto merged
sql/sql_array.h:
  Auto merged
sql/sql_help.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
storage/myisam/ft_boolean_search.c:
  Auto merged
storage/myisam/ft_nlq_search.c:
  Auto merged
storage/myisam/myisampack.c:
  Auto merged
mysys/mf_keycache.c:
  Manual merge.
mysys/mf_sort.c:
  Manual merge.
mysys/my_lib.c:
  Manual merge.
mysys/queues.c:
  Manual merge.
sql/sql_acl.cc:
  Manual merge.
sql/sql_table.cc:
  Manual merge.
storage/csv/ha_tina.cc:
  Manual merge.
storage/myisam/sort.c:
  Manual merge.
2007-10-18 14:32:43 +04:00
unknown
85f9df837c Merge polly.(none):/home/kaa/src/maint/bug31207/my50-bug31174
into  polly.(none):/home/kaa/src/maint/mysql-5.0-maint


myisam/sort.c:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
2007-10-18 13:47:35 +04:00
unknown
4e1e091c9e Merge sin.intern.azundris.com:/misc/mysql/31588/50-31588
into  sin.intern.azundris.com:/misc/mysql/31588/51-31588


mysql-test/r/variables.result:
  Auto merged
mysql-test/t/variables.test:
  Auto merged
sql/set_var.cc:
  Auto merged
2007-10-18 10:55:42 +02:00
unknown
b088967252 Merge sin.intern.azundris.com:/misc/mysql/31588/41-31588
into  sin.intern.azundris.com:/misc/mysql/31588/50-31588


sql/set_var.cc:
  Auto merged
mysql-test/r/variables.result:
  SCCS merged
mysql-test/t/variables.test:
  SCCS merged
2007-10-18 10:51:10 +02:00
unknown
cd9d89a75d Bug#31588: buffer overrun when setting variables
Buffer used when setting variables was not dimensioned to accomodate
trailing '\0'. An overflow by one character was therefore possible.
CS corrects limits to prevent such overflows.


mysql-test/r/variables.result:
  Try to overflow buffer used for setting system variables.
  Unpatched server should throw a valgrind warning here.
  Actual value and error message irrelevant, only length counts.
mysql-test/t/variables.test:
  Try to overflow buffer used for setting system variables.
sql/set_var.cc:
  Adjust maximum number of characters we can store in 'buff' by one
  as strmake() will write a terminating '\0'.
2007-10-18 10:47:54 +02:00
unknown
367fc73e3c Bug #29804 UDF parameters don't contain correct string length
Previously, UDF *_init functions were passed constant strings with erroneous lengths. The length came from the containing variable's size, not the length of the value itself.
    
Now the *_init functions get the constant as a null terminated string with the correct length supplied too.


mysql-test/r/udf.result:
  Test case to check constants passed UDFs.
mysql-test/t/udf.test:
  Test case to check constants passed UDFs.
sql/item_func.cc:
  UDF _init functions are now passed the length of the constants, rather than the max length of the var containing the constant.
sql/udf_example.c:
  Added check_const_len functions. The check_const_len_init functions checks that lengths of constants are correctly passed.
sql/udf_example.def:
  Add new example functions to windows dll export list.
2007-10-17 17:54:11 -04:00
unknown
bfc41161b4 Bug #30878: Crashing when alter an auto_increment non partitioned
table to partitioned

Problem:
Crashed because usage of an uninitialised mutex when auto_incrementing
  a partitioned temporary table

Fix:
Only locking (using the mutex) if not temporary table.


mysql-test/r/partition.result:
  Bug #30878: Crashing when alter an auto_increment non partitioned
    table to partitioned
  test result
mysql-test/t/partition.test:
  Bug #30878: Crashing when alter an auto_increment non partitioned
    table to partitioned
  testcase
sql/ha_partition.cc:
  Bug #30878: Crashing when alter an auto_increment non partitioned
    table to partitioned
  
  If the table is a temporary table, the table_share->mutex is not
    initialised.
  
  Checking if not temporary table, then OK to lock (else no need
    to lock)
2007-10-17 20:40:23 +02:00
unknown
ce8bf087b0 Fix for bug #31207: Test "join_nested" shows different strategy on IA64
CPUs / Intel's ICC compile

The bug is a combination of two problems:

1. IA64/ICC MySQL binaries use glibc's qsort(), not the one in mysys.

2. The order relation implemented by join_tab_cmp() is not transitive,
i.e. it is possible to choose such a, b and c that (a < b) && (b < c)
but (c < a). This implies that result of a sort using the relation
implemented by join_tab_cmp() depends on the order in which
elements are compared, i.e. the result is implementation-specific. Since
choose_plan() uses qsort() to pre-sort the
join tables using join_tab_cmp() as a compare function, the results of
the sorting may vary depending on qsort() implementation.

It is neither possible nor important to implement a better ordering
algorithm in join_tab_cmp(). Therefore the only way to fix it is to
force our own qsort() to be used by renaming it to my_qsort(), so we don't depend
on linker to decide that.

This patch also "fixes" bug #20530: qsort redefinition violates the
standard.


include/my_sys.h:
  Renamed qsort() and qsort2() to my_qsort() and my_qsort2(). Since
  previously we relied on stdlib.h to provide a declaration for qsort(), a
  separate declaration for my_qsort() is now required.
libmysql/Makefile.shared:
  Added mf_qsort.c to libmysql, since my_lib.c now uses my_qsort() instead of qsort().
myisam/ft_boolean_search.c:
  Replaced qsort2() with my_qsort2().
myisam/ft_nlq_search.c:
  Replaced qsort2() with my_qsort2().
myisam/myisampack.c:
  Replaced qsort() with my_qsort().
myisam/sort.c:
  Replaced qsort2() with my_qsort2().
mysys/mf_keycache.c:
  Replaced qsort() with my_qsort().
mysys/mf_qsort.c:
  Renamed qsort() to my_qsort() and qsort2() to my_qsort2().
mysys/mf_sort.c:
  Replaced qsort2() with my_qsort2().
mysys/my_lib.c:
  Replaced qsort() with my_qsort().
mysys/queues.c:
  Replaced qsort2() with my_qsort2().
sql/item_cmpfunc.cc:
  Replaced qsort2() with my_qsort2().
sql/item_cmpfunc.h:
  Replaced qsort2() with my_qsort2().
sql/opt_range.cc:
  Replaced qsort() with my_qsort().
sql/records.cc:
  Replaced qsort() with my_qsort().
sql/sql_acl.cc:
  Replaced qsort() with my_qsort().
sql/sql_array.h:
  Replaced qsort() with my_qsort().
sql/sql_help.cc:
  Replaced qsort() with my_qsort().
sql/sql_select.cc:
  Replaced qsort() with my_qsort().
sql/examples/ha_tina.cc:
  Replaced qsort() with my_qsort().
sql/sql_table.cc:
  Replaced qsort() with my_qsort().
2007-10-17 20:08:58 +04:00
unknown
e8adc3f74b Fix for bug#31615: crash after set names ucs2 collate xxx
Problem: currently, UCS-2 cannot be used as a client character set.

Fix: raise an error if one attempts to set it to USC-2.


mysql-test/r/ctype_ucs.result:
  Fix for bug#31615: crash after set names ucs2 collate xxx
    - test result.
mysql-test/t/ctype_ucs.test:
  Fix for bug#31615: crash after set names ucs2 collate xxx
    - test case.
sql/set_var.cc:
  Fix for bug#31615: crash after set names ucs2 collate xxx
    - raise an error if one is going to set character_set_client to UCS-2.
sql/set_var.h:
  Fix for bug#31615: crash after set names ucs2 collate xxx
    - raise an error if one is going to set character_set_client to UCS-2.
2007-10-17 14:28:00 +05:00
unknown
666efa1c43 Bug#31381 Error in retrieving Data from INFORMATION_SCHEMA
move 'table_collation' field filling outside of if(file) condition
because this field has 'OPEN_FRM_ONLY' attribute


mysql-test/r/information_schema.result:
  test result
mysql-test/t/information_schema.test:
  test case
sql/sql_show.cc:
  move 'table_collation' field filling outside of if(file) condition
  because this field has 'OPEN_FRM_ONLY' attribute
2007-10-17 14:08:03 +05:00
unknown
9e1604a46c Fix for BUG#24923: Functions with ENUM issues.
The problem was that the RETURNS column in the mysql.proc was of
CHAR(64). That was not enough for storing long-named datatypes.

The fix is to change CHAR(64) to LONGBLOB, and to throw warnings
at the time a stored routine is created if some data is truncated
during writing into mysql.proc.


mysql-test/r/sp.result:
  Update test result.
mysql-test/t/sp.test:
  Add a test case for BUG#24923.
scripts/mysql_system_tables.sql:
  Change the data type of column 'returns' from char(64) to longblob.
scripts/mysql_system_tables_fix.sql:
  Change the data type of column 'returns' from char(64) to longblob.
sql/sp.cc:
  Produce warnings if any data was truncated during writing
  into mysql.proc.
sql/sp.h:
  Add new error code.
sql/share/errmsg.txt:
  Add new error message.
sql/sql_parse.cc:
  Hande
2007-10-17 12:13:56 +04:00
unknown
3f284594be Removing debug variables from non-debug builds.
sql/rpl_record.cc:
  Turning of declaration of debug variables in non-debug builds.
2007-10-17 09:29:11 +02:00
unknown
04e13b103a Merge kindahl-laptop.dnsalias.net:/home/bkroot/mysql-5.1-rpl
into  kindahl-laptop.dnsalias.net:/home/bk/b29549-mysql-5.1-target-5.1.22
2007-10-17 06:53:19 +02:00
unknown
f3cd8a91b0 Eliminating some valgrind warnings resulting from that some
storage engines do not set the unused null bits (i.e., the
filler bits and the X bit) correctly. Also adding some casts
to debug printouts to eliminate compiler warnings.


sql/ha_ndbcluster.cc:
  Changing debug enter names to use full names for member functions.
sql/records.cc:
  Emptying records before starting to read records since some engines do
  not set the unused null bits, leading to valgrind errors.
sql/rpl_record.cc:
  Adding casts to debug printouts to eliminate compiler warnings.
2007-10-17 06:50:03 +02:00
unknown
84984f9111 Manual merge of 5.0-runtime to 5.1-runtime
mysql-test/r/sp-error.result:
  Manual merge
mysql-test/r/sp.result:
  Manual merge
mysql-test/r/udf.result:
  Manual merge
mysql-test/t/sp.test:
  Manual merge
mysql-test/t/udf.test:
  Manual merge
sql/item_create.cc:
  Manual merge
sql/sp_head.cc:
  Manual merge
sql/sql_yacc.yy:
  Manual merge
2007-10-16 20:47:08 -06:00
unknown
1dc0efc606 Merge lambda.hsd1.co.comcast.net.:/home/malff/TREE/mysql-5.0-runtime
into  lambda.hsd1.co.comcast.net.:/home/malff/TREE/mysql-5.1-rt-merge


mysql-test/t/sp-error.test:
  Auto merged
mysql-test/t/udf.test:
  Auto merged
sql/item.cc:
  Auto merged
sql/sp.cc:
  Auto merged
sql/sp_head.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_udf.cc:
  Auto merged
mysql-test/r/sp-error.result:
  failed auto merge
mysql-test/r/sp.result:
  failed auto merge
mysql-test/r/udf.result:
  failed auto merge
mysql-test/t/sp.test:
  failed auto merge
sql/sp_head.cc:
  failed auto merge
sql/sql_yacc.yy:
  failed auto merge
2007-10-16 15:43:16 -06:00
unknown
42b6424327 Fixed broken call to my_error
sql/sql_yacc.yy:
  Fixed error message to use char*, not LEX_STRING
2007-10-16 14:27:20 -06:00
unknown
72af57b87b Merge malff@bk-internal.mysql.com:/home/bk/mysql-5.0-runtime
into  lambda.hsd1.co.comcast.net.:/home/malff/TREE/mysql-5.0-28318-rework
2007-10-16 11:17:27 -06:00
unknown
28ef3b2a7f Implementing code review comments
mysql-test/r/sp.result:
  Added tests for coverage
mysql-test/t/sp.test:
  Added tests for coverage
sql/sql_udf.cc:
  Code cleanup
2007-10-16 11:16:31 -06:00
unknown
5254686e53 Merge kpettersson@bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into  adventure.(none):/home/thek/Development/cpp/mysql-5.1-runtime
2007-10-16 14:45:52 +02:00
unknown
1f8126190b Bug#30710 query_cache.test fails on embedded - per-column privs test
The embedded version of the server doesn't use column level grants, and 
the compile directive NO_EMBEDDED_ACCESS_CHECKS should be checked instead of
the redundant HAVE_QUERY_CACHE (which is always the case) to determine if 
column level grants should be compiled or not.


mysql-test/r/query_cache.result:
  Updated result file
mysql-test/r/query_cache_notembedded.result:
  Updated result file
mysql-test/t/query_cache.test:
  Moved test with GRANT to query_cache_notembedded test.
mysql-test/t/query_cache_notembedded.test:
  Moved test with GRANT to query_cache_notembedded test.
sql/sql_cache.cc:
  Changed the conditional compilation directive to only compile column level grant
  checks if NO_EMBEDDED_ACCESS_CHECKS isn't defined.
2007-10-16 14:42:42 +02:00
unknown
faf0f9fb21 Fix bug #31604: server crash when setting slow_query_log_file/global general_log_file variable
Problem: we don't evaluate given expression checking values of the
slow_query_log_file/general_log_file, don't check it for NULL.

Fix: evaluate the expression, check result returned.


mysql-test/r/log_state.result:
  Fix bug #31604: server crash when setting slow_query_log_file/global general_log_file variable
    - test result.
mysql-test/t/log_state.test:
  Fix bug #31604: server crash when setting slow_query_log_file/global general_log_file variable
    - test case.
sql/set_var.cc:
  Fix bug #31604: server crash when setting slow_query_log_file/global general_log_file variable
    - evaluate var->value calling val_str() method;
    - check for null values returned;
    - return proper errors if any.
2007-10-16 17:19:07 +05:00
unknown
d3443ee1c7 Merge mysql.com:/home/bar/mysql-work/mysql-5.0.b31081
into  mysql.com:/home/bar/mysql-work/mysql-5.1.b31081


mysql-test/r/ctype_ucs.result:
  Auto merged
mysql-test/r/ctype_utf8.result:
  Auto merged
mysql-test/r/func_regexp.result:
  Auto merged
mysql-test/t/ctype_uca.test:
  Auto merged
mysql-test/t/ctype_ucs.test:
  Auto merged
mysql-test/t/ctype_utf8.test:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_cmpfunc.h:
  Auto merged
2007-10-16 15:04:04 +05:00
unknown
666155f5e7 Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-5.0-rpl
into  mysql.com:/home/bar/mysql-work/mysql-5.0.b31081


mysql-test/t/ctype_uca.test:
  Auto merged
2007-10-16 14:58:59 +05:00
unknown
6f8fd0a797 Merge mysql.com:/home/gluh/MySQL/Merge/5.0-opt
into  mysql.com:/home/gluh/MySQL/Merge/5.1-opt


mysql-test/r/ctype_utf8.result:
  Auto merged
mysql-test/t/ctype_utf8.test:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
2007-10-16 14:10:07 +05:00
unknown
55a3a64eb1 Merge sgluhov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  mysql.com:/home/gluh/MySQL/Merge/5.0-opt


sql/item.cc:
  Auto merged
sql/item.h:
  manual merge
2007-10-16 13:19:01 +05:00
unknown
f1d7a96b0a Bug#28318 (CREATE FUNCTION (UDF) requires a schema) -- part II
The root cause of the issue was that the CREATE FUNCTION grammar,
for User Defined Functions, was using the sp_name rule.
The sp_name rule is intended for fully qualified stored procedure names,
like either ident.ident, or just ident but with a default database
implicitly selected.

A UDF does not have a fully qualified name, only a name (ident), and should
not use the sp_name grammar fragment during parsing.

The fix is to re-organize the CREATE FUNCTION grammar, to better separate:
- creating UDF (no definer, can have AGGREGATE, simple ident)
- creating Stored Functions (definer, no AGGREGATE, fully qualified name)

With the test case provided, another issue was exposed which is also fixed:
the DROP FUNCTION statement was using sp_name and also failing when no database
is implicitly selected, when droping UDF functions.
The fix is also to change the grammar so that DROP FUNCTION works with
both the ident.ident syntax (to drop a stored function), or just the ident
syntax (to drop either a UDF or a Stored Function, in the current database)


mysql-test/r/sp-error.result:
  Adjust test results
mysql-test/r/udf.result:
  Adjust test results
mysql-test/t/sp-error.test:
  Adjust test results
mysql-test/t/udf.test:
  Adjust test results
sql/sql_parse.cc:
  CREATE UDF FUNCTION does not use a fully qualified name.
sql/sql_yacc.yy:
  Fix grammar for CREATE / DROP FUNCTION, FOR udf
  Improve error messages for select no_such_function()
2007-10-15 19:15:38 -06:00
unknown
44e92639b1 fix problem caused by previous submission for bugs BUG#29589 BUG#29772
sql/set_var.cc:
  fix problem caused by previous submission
2007-10-15 15:53:39 -04:00
unknown
dd1217816c Merge bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into  damien-katzs-computer.local:/Users/dkatz/mysql-5.1-runtime
2007-10-15 13:25:12 -04:00
unknown
520774eae7 Merge bk-internal.mysql.com:/home/bk/mysql-5.0-runtime
into  damien-katzs-computer.local:/Users/dkatz/mysql-5.0-runtime
2007-10-15 13:23:16 -04:00
unknown
048006e2f9 Bug#30986 Character set introducer followed by a HEX string can return bad result(addon)
issue an error if string has illegal characters


mysql-test/r/ctype_utf8.result:
  issue an error if string has illegal characters
mysql-test/t/ctype_utf8.test:
  issue an error if string has illegal characters
sql/item.cc:
  issue an error if string has illegal characters
sql/item.h:
  issue an error if string has illegal characters
sql/sql_yacc.yy:
  issue an error if string has illegal characters
2007-10-15 18:40:58 +05:00
unknown
4db46e26f3 Add comments, tidy up sql_delete.cc to refer to thd->row_count_func
explicitly.


sql/sql_class.cc:
  Add comments.
sql/sql_delete.cc:
  Change syntax to make grepping easier. No semantical change.
2007-10-15 16:42:41 +04:00
unknown
7345835213 Fix broken compilation.
sql/net_serv.cc:
  Fix the build I broke by the previous change.
2007-10-15 15:49:16 +04:00
unknown
c969f78b7c Remove an unused variable that was there since the first implementation
of the stored procedure cursors (materialized on disk).


include/mysql_com.h:
  Remove an unused variable.
sql/protocol.cc:
  net->no_send_eof was not used anywhere.
2007-10-15 15:45:20 +04:00
unknown
35ec70abb5 Merge mskold@bk-internal.mysql.com:/home/bk/mysql-5.1-ndb
into  mysql.com:/windows/Linux_space/MySQL/mysql-5.1-new-ndb
2007-10-15 08:51:35 +02:00
unknown
9458aa48a3 Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-5.1-rpl
into  mysql.com:/home/bar/mysql-work/mysql-5.1.b27287
2007-10-15 11:16:53 +05:00
unknown
e9668a9b55 Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-5.0-maint
into  mysql.com:/home/ram/work/b31154/b31154.5.0
2007-10-15 10:28:58 +05:00
unknown
fbb2d1ff69 Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-5.1-maint
into  mysql.com:/home/ram/work/b31154/b31154.5.1
2007-10-15 10:21:22 +05:00
unknown
173eb806db bug #29801 Federated engine crashes local server
if remote server sends malicious response.

We need to check if the SHOW TABLE STATUS query we issue inside the
FEDERATED engine returned the result with the proper (or just sufficient)
number of rows. Otherwise statements like row[12] can crash the server.


sql/ha_federated.cc:
  bug #29801 Federated engine crashes local server
                 if remote server sends malicious response.
  
  Return with the error if the remote server return fewer rows than we need.
2007-10-15 10:11:52 +05:00
unknown
b777dbfba8 Merge mysql.com:/home/ram/work/b31154/b31154.5.0
into  mysql.com:/home/ram/work/b31154/b31154.5.1


mysql-test/r/func_gconcat.result:
  Auto merged
mysql-test/t/func_gconcat.test:
  Auto merged
sql/item_sum.cc:
  Auto merged
2007-10-15 09:44:22 +05:00
unknown
4ecb2aa4eb Merge magare.gmz:/home/kgeorge/mysql/autopush/B31156-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/autopush/B31156-5.1-opt


sql/item_sum.cc:
  Auto merged
2007-10-14 11:30:28 +03:00
unknown
97a98ff59b item_sum.cc:
Fixed dbug macros usage errors


sql/item_sum.cc:
  Fixed dbug macros usage errors
2007-10-14 11:28:43 +03:00
unknown
bf9eb0f0d7 manual merge for bug_29136, bug#29309.
mysql-test/extra/binlog_tests/mix_innodb_myisam_side_effects.test:
  manual merge from 5.0
mysql-test/r/innodb.result:
  results changed
mysql-test/r/multi_update.result:
  results changed
mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result:
  manual merge: results re-recorded
mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result:
  results changed
mysql-test/suite/manual/r/rpl_replication_delay.result:
  results recorded for 5.1
mysql-test/t/innodb.test:
  removing bug27716 regression test as one exists in binlog suite already.
mysql-test/t/multi_update.test:
  manual merge plus refining for execution in both binlog_format.
sql/log_event.cc:
  bloody manual merge;
  the fact that an event is artificial is encode with setting timestamp argument to zero.
  rli's last_master_timestamp won't be updated in stmt_done in such case.
sql/rpl_rli.cc:
  simulation and the real fixing code.
  Don't update last_master_timestamp with zero.
sql/sql_delete.cc:
  manual merge
2007-10-13 23:12:50 +03:00
unknown
1408095a11 Merge koti.dsl.inet.fi:/home/elkin/MySQL/TEAM/FIXES/5.0/bug29136-mdelete
into  koti.dsl.inet.fi:/home/elkin/MySQL/merge-5.1


mysql-test/t/multi_update.test:
  Auto merged
sql/slave.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_delete.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test:
  manual merge use local; another file has to be changed in 5_1.
mysql-test/r/innodb.result:
  manual merge use local to re-record the results
mysql-test/r/multi_update.result:
  manual merge use local to re-record the results
mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result:
  manual merge use local to re-record the results
mysql-test/t/innodb.test:
  restoring bug#27716 snippet
sql/log_event.cc:
  trasfering simulation to another file: rpl_rli.cc
2007-10-13 16:51:16 +03:00
unknown
c8b6d10509 Bug #29136 erred multi-delete on trans table does not rollback the statement
similar to bug_27716, but it was stressed on in the synopsis on that there is another
side of the artifact affecting behaviour in transaction.

Fixed with deploying multi_delete::send_error() - otherwise never called - and refining its logic
to perform binlogging job if needed.

The changeset includes the following side effects:
- added tests to check bug_23333's scenarios on the mixture of tables for multi_update;
- fixes bug@30763 with two-liner patch and a test coinciding to one added for bug_23333.


mysql-test/r/innodb.result:
  results changed
mysql-test/r/mix_innodb_myisam_binlog.result:
  results changed
mysql-test/r/multi_update.result:
  results changed
mysql-test/t/innodb.test:
  trans table specific test added
mysql-test/t/mix_innodb_myisam_binlog.test:
  multi-update  and multi-delete of mixure of ta and not-ta tables tests added (relates to bug_23333).
mysql-test/t/multi_update.test:
  testing another branch of mult-delete: send_eof() (binloggin there), send_error (early return)
sql/sql_class.h:
  a new flag to designate the fact the statement's error has been handled.
  The flag is checked by ::send_error() methods (multi_update and _delete classes)
sql/sql_delete.cc:
  expanding multi_delete::send_error to 
  1. early return if error_handled == t
  2. binlogging locally if there was a non-trans table modified side effect
sql/sql_parse.cc:
  adding multi_update::send_error which can perform binlogging and rollback job in needed
sql/sql_update.cc:
  issues relating to
   
  1. bug_27716 with zeroing of `updated' to serve as the flag of early return from send_error().
     The flag is changed to be a new member error_handled; also moved outside binlogging branch.
     The reason for this change is that bug_23333 fixes were pushed after the bug_27716's and they
     left this flaw (also no test coverage).
  2. bug_30763 with assertion on trans_safe. I decide to make 2 liner fix for that bug here instead of to remove
     those two assertions. This new bug test case is the same as for multi-update on the mixure of tables.
     The rational for this fix:
     presumption for mutli_update::trans_safe to be set to zero at
     multi_update::multi_update or multi_update::initialize_tables() is incorrect.
  
     trans_safe := false should happen only when a non-transactional table gets modified. 
     Therefore, at initialization the member must be be set to true.
2007-10-13 15:49:42 +03:00
unknown
c62aa5c795 Merge magare.gmz:/home/kgeorge/mysql/autopush/B31156-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/work/B31156-5.1-opt


mysql-test/r/func_group.result:
  Auto merged
mysql-test/t/func_group.test:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_sum.cc:
  Auto merged
2007-10-13 09:22:37 +03:00
unknown
c9141ac580 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/autopush/B31156-5.0-opt
2007-10-13 09:20:23 +03:00
unknown
6c974c673f Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.1-opt
into  magare.gmz:/home/kgeorge/mysql/autopush/B31440-5.1-opt


sql/item_cmpfunc.cc:
  Auto merged
2007-10-13 09:13:00 +03:00
unknown
387d03f574 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/autopush/B31440-5.0-opt


sql/item_cmpfunc.cc:
  Auto merged
2007-10-13 09:12:15 +03:00
unknown
1a5582d422 Merge gshchepa@bk-internal.mysql.com:/home/bk/mysql-5.1-opt
into  gleb.loc:/home/uchum/work/bk/5.1-opt
2007-10-12 22:55:33 +05:00
unknown
b3b01cf48b BUG#29549 (Endians: rpl_ndb_myisam2ndb,rpl_ndb_innodb2ndb and rpl_ndb_mix_innodb failed on):
Post-merge fixes. Setting write bit before calling Field::store() since the function asserts that
the write bit has been set.


sql/field.cc:
  Setting bit in write set to prevent assertion from throwing when calling Field::store().
2007-10-12 18:22:31 +02:00