- 13 Feb, 2007 1 commit
-
-
unknown authored
-
- 12 Feb, 2007 2 commits
-
-
unknown authored
into weblab.(none):/home/marcsql/TREE/mysql-5.1-24532-merge mysql-test/r/func_if.result: Auto merged mysql-test/r/view.result: Auto merged sql/item_cmpfunc.cc: Auto merged sql/item_cmpfunc.h: Auto merged
-
unknown authored
operations) Before this change, the boolean predicates: - X IS TRUE, - X IS NOT TRUE, - X IS FALSE, - X IS NOT FALSE were implemented by expanding the Item tree in the parser, by using a construct like: Item_func_if(Item_func_ifnull(X, <value>), <value>, <value>) Each <value> was a constant integer, either 0 or 1. A bug in the implementation of the function IF(a, b, c), in Item_func_if::fix_length_and_dec(), would cause the following : When the arguments b and c are both unsigned, the result type of the function was signed, instead of unsigned. When the result of the if function is signed, space for the sign could be counted twice (in the max() expression for a signed argument, and in the total), causing the member max_length to be too high. An effect of this is that the final type of IF(x, int(1), int(1)) would be int(2) instead of int(1). With this fix, the problems found in Item_func_if::fix_length_and_dec() have been fixed. While it's semantically correct to represent 'X IS TRUE' with Item_func_if(Item_func_ifnull(X, <value>), <value>, <value>), there are however more problems with this construct. a) Building the parse tree involves : - creating 5 Item instances (3 ints, 1 ifnull, 1 if), - creating each Item calls my_pthread_getspecific_ptr() once in the operator new(size), and a second time in the Item::Item() constructor, resulting in a total of 10 calls to get the current thread. Evaluating the expression involves evaluating up to 4 nodes at runtime. This representation could be greatly simplified and improved. b) Transforming the parse tree internally with if(ifnull(...)) is fine as long as this transformation is internal to the server implementation. With views however, the result of the parse tree is later exposed by the ::print() functions, and stored as part of the view definition. Doing this has long term consequences: 1) The original semantic 'X IS TRUE' is lost, and replaced by the if(ifnull(...)) expression. As a result, SHOW CREATE VIEW does not restore the original code. 2) Should a future version of MySQL implement the SQL BOOLEAN data type for example, views created today using 'X IS NULL' can be exported using mysqldump, and imported again. Such views would be converted correctly and automatically to use a BOOLEAN column in the future version. With 'X IS TRUE' and the current implementations, views using these "boolean" predicates would not be converted during the export/import, and would use integer columns instead. The difference traces back to how SHOW CREATE VIEW preserves 'X IS NULL' but does not preserve the 'X IS TRUE' semantic. With this fix, internal representation of 'X IS TRUE' booleans predicates has changed, so that: - dedicated Item classes are created for each predicate, - only 1 Item is created to represent 1 predicate - my_pthread_getspecific_ptr() is invoked 1 time instead of 10 - SHOW CREATE VIEW preserves the original semantic, and prints 'X IS TRUE'. Note that, because of the fix in Item_func_if, views created before this fix will: - correctly use a int(1) type instead of int(2) for boolean predicates, - incorrectly print the if(ifnull(...), ...) expression in SHOW CREATE VIEW, since the original semantic (X IS TRUE) has been lost. - except for the syntax used in SHOW CREATE VIEW, these views will operate properly, no action is needed. Views created after this fix will operate correctly, and will preserve the original code semantic in SHOW CREATE VIEW. mysql-test/r/func_if.result: IF(x, unsigned, unsigned) should be unsigned. mysql-test/r/view.result: Preserve the semantic of 'X IS [NOT] (TRUE|FALSE)' boolean predicates. mysql-test/t/func_if.test: IF(x, unsigned, unsigned) should be unsigned. mysql-test/t/view.test: Preserve the semantic of 'X IS [NOT] (TRUE|FALSE)' boolean predicates. sql/item_cmpfunc.cc: Preserve the semantic of 'X IS [NOT] (TRUE|FALSE)' boolean predicates. IF(x, unsigned, unsigned) should be unsigned. sql/item_cmpfunc.h: Preserve the semantic of 'X IS [NOT] (TRUE|FALSE)' boolean predicates. sql/sql_yacc.yy: Preserve the semantic of 'X IS [NOT] (TRUE|FALSE)' boolean predicates.
-
- 08 Feb, 2007 1 commit
-
-
unknown authored
into moonlight.home:/home/tomash/src/mysql_ab/mysql-5.1-bug16425 sql/sql_yacc.yy: Auto merged
-
- 06 Feb, 2007 2 commits
-
-
unknown authored
into weblab.(none):/home/marcsql/TREE/mysql-5.1-12976-merge mysql-test/r/sp-vars.result: Auto merged mysql-test/t/sp-vars.test: Auto merged sql/sp_head.cc: Auto merged
-
unknown authored
Before this change, a local variables in stored procedures / stored functions or triggers, when declared with a type of bit(N), would not evaluate their value properly. The problem was that the data was incorrectly typed as a string, causing for example bit b'1', implemented as a byte 0x01, to be interpreted as a string starting with the character 0x01. This later would cause implicit conversions to integers or booleans to fail. The root cause of this problem was an incorrect translation between field types, like bit(N), and internal types used when representing values in Item objects. Also, before this change, the function HEX() would sometime print extra "0" characters when invoked with bit(N) values. With this fix, the type translation (sp_map_result_type, sp_map_item_type) has been changed so that bit(N) fields are represented with integer values. A consequence is that, for the function HEX(), when called with a stored procedure local variable of type bit(N) as argument, HEX() is provided with an integer instead of a string, and therefore does not print "0" padding. A test case for Bug 12976 was present in the test suite, and has been updated. mysql-test/r/sp-vars.result: Local stored procedure variables of type bit(N) are integer values. mysql-test/t/sp-vars.test: Local stored procedure variables of type bit(N) are integer values. sql/sp_head.cc: Local stored procedure variables of type bit(N) are integer values.
-
- 05 Feb, 2007 1 commit
-
-
unknown authored
into moonlight.home:/home/tomash/src/mysql_ab/mysql-5.1 mysql-test/r/view.result: Auto merged sql/sql_lex.cc: Auto merged sql/sql_lex.h: Auto merged mysql-test/t/view.test: Manual merge.
-
- 04 Feb, 2007 1 commit
-
-
unknown authored
fails The bug was introduced with the push of the fix for bug#20953: after the error on view creation we never reset the error state, so some valid statements would give the same error after that. The solution is to properly reset the error state. mysql-test/r/view.result: Add result for bug#25897: Some queries are no longer possible after a CREATE VIEW fails. mysql-test/t/view.test: Add test case for bug#25897: Some queries are no longer possible after a CREATE VIEW fails. sql/sql_lex.cc: Add st_parsing_options::reset() method, call it from lex_start(). sql/sql_lex.h: Add st_parsing_options::reset() method, call it from constructor.
-
- 03 Feb, 2007 1 commit
-
-
unknown authored
into moonlight.home:/home/tomash/src/mysql_ab/mysql-5.1-bug23225
-
- 02 Feb, 2007 2 commits
-
-
unknown authored
There was already support for CREATE DEFINER=... EVENT syntax in the parser, but DEFINER information was ignored. This patch adds processing of DEFINER, and a new ALTER DEFINER=... EVENT syntax. mysql-test/r/events_bugs.result: Add result for bug#16425: Events: no DEFINER clause. mysql-test/t/events_bugs.test: Add test case for bug#16425: Events: no DEFINER clause. sql/event_data_objects.cc: Event_parse_data::init_definer() looks for DEFINER in thd->lex->definer, which is always set now. sql/sql_parse.cc: Move DEFINER processing into the sp_process_definer(). Call this function for CREATE EVENT/ALTER EVENT, as well as for CREATE PROCEDURE/FUNCTION. sql/sql_yacc.yy: Add 'alter DEFINER=... event', update rule references accordingly.
-
unknown authored
wrong file After execution of SET GLOBAL SLOW_QUERY_LOG_FILE=...; slow query log data would go into the general log file. The problem was in the bogus cut-n-paste in the code. sql/set_var.cc: Fix cut-n-paste bug.
-
- 01 Feb, 2007 2 commits
-
-
unknown authored
into weblab.(none):/home/marcsql/TREE/mysql-5.1-21904_b-merge mysql-test/r/subselect.result: Auto merged mysql-test/t/subselect.test: Auto merged sql/item_subselect.cc: Auto merged sql/item_subselect.h: Auto merged sql/sql_cache.cc: Auto merged sql/sql_yacc.yy: Auto merged
-
unknown authored
-
- 31 Jan, 2007 1 commit
-
-
unknown authored
Original patch did not have these leaks, they were introduced later during manual applying of the patch. sql/event_data_objects.cc: Original patch was not aware of the requirement to delete lex.sphead before doing anything else (bug#21856), and that was missed when the patch was applied later. sql/event_scheduler.cc: The line was lost during manual patch applying.
-
- 30 Jan, 2007 4 commits
-
-
unknown authored
-
unknown authored
into weblab.(none):/home/marcsql/TREE/mysql-5.0-21904 mysql-test/r/subselect.result: Auto merged mysql-test/t/subselect.test: Auto merged sql/item_subselect.cc: Auto merged sql/item_subselect.h: Auto merged sql/sql_yacc.yy: Auto merged
-
unknown authored
into weblab.(none):/home/marcsql/TREE/mysql-5.1-21904-merge sql/item_subselect.cc: Auto merged sql/item_subselect.h: Auto merged sql/sql_yacc.yy: Auto merged
-
unknown authored
Before this fix, a IN predicate of the form: "IN (( subselect ))", with two parenthesis, would be evaluated as a single row subselect: if the subselect returns more that 1 row, the statement would fail. The SQL:2003 standard defines a special exception in the specification, and mandates that this particular form of IN predicate shall be equivalent to "IN ( subselect )", which involves a table subquery and works with more than 1 row. This fix implements "IN (( subselect ))", "IN ((( subselect )))" etc as per the SQL:2003 requirement. All the details related to the implementation of this change have been commented in the code, and the relevant sections of the SQL:2003 spec are given for reference, so they are not repeated here. Having access to the spec is a requirement to review in depth this patch. mysql-test/r/subselect.result: Implement IN predicate special exceptions with subselects. mysql-test/t/subselect.test: Implement IN predicate special exceptions with subselects. sql/item_subselect.cc: Implement IN predicate special exceptions with subselects. sql/item_subselect.h: Implement IN predicate special exceptions with subselects. sql/sql_yacc.yy: Implement IN predicate special exceptions with subselects, cleanup.
-
- 29 Jan, 2007 3 commits
-
-
unknown authored
into weblab.(none):/home/marcsql/TREE/mysql-5.1-24392
-
unknown authored
This patch implements the idea of the bug report by making Event_queue unaware of Event_db_repository by making a higher level class - Events, which is aware of most of all classes, responsible for passing all data needed for adding/updating/deleting an event to/from the queue. Introduces few new classes : - Event_worker_thread - Event_queue_element_for_exec sql/event_data_objects.cc: Introduced a new class Event_queue_element_for_exec According to Konstantin it should be named Event_name and hold only two LEX_STRINGs but `dropped` is not saved on disk and will require additional logic in Event_worker_thread class, after loading to compute whether the event should be dropped or not. It's easier just to pass this flag around. Removed Event_queue_element::drop(). This method was a source of a race condition. At the place where the event should be dropped we call Events::drop_event() which is the only code-flow for dropping. In addition, because ::drop_event() holds Events::LOCK_metadata there is no source of race conditions. Before this patch dropping from ::drop() wasn't under LOCK_metadata and races were possible. Because Events::open_event_table was removed as a method, provisionally events_event_db_repository was exported from events.cc till a solution is build where Event_queue_element does not access directly mysql.event. sql/event_data_objects.h: New class Event_queue_element_for_exec added which is returned from Event_queue::get_top_if_time() and passed through Event_scheduler to Event_worker_thread. There by using the (db)name Event_job_data is instanciated and executed. Dropped Event_queue_element::drop() thd was moved out of Event_job_data as it is now part of Event_queue_element_for_exec sql/event_queue.cc: Removed dependency of Event_queue on Event_db_repository. The instantiation of Event_job_data was moved to class Event_worker_thread In place is a return of an object of Event_queue_element_for_exec is used later for instantiating Event_job_data. The `dropped` flag of Event_queue_element is passed over Event_queue_element_for_exec to the code in Event_worker_thread. sql/event_queue.h: Removed dependency of Event_queue on Event_db_repository Removed dependency on Event_scheduler sql/event_scheduler.cc: Added class Event_worker_thread, which is used during the execution of an event. It has a static init() method to get a pointer to Event_db_repository to be used for instantiation of Event_job_data object. This object it then executed. sql/event_scheduler.h: Added class Event_worker_thread, which is used during the execution of an event. sql/events.cc: Removed Events::open_event_table() because it was a product of a bad architecture. sql/events.h: Removed friend definition, unneeded. Fixed Events::drop_event() to have the previous signature without bool only_from_disk sql/sql_parse.cc: Fix call
-
unknown authored
into weblab.(none):/home/marcsql/TREE/mysql-5.1-24392 mysql-test/t/show_check.test: Auto merged sql/sql_yacc.yy: Auto merged
-
- 25 Jan, 2007 16 commits
-
-
unknown authored
into moonlight.home:/home/tomash/src/mysql_ab/mysql-5.1-bug23527
-
unknown authored
into mockturtle.local:/home/dlenev/src/mysql-5.1-merge
-
unknown authored
-
unknown authored
into moonlight.home:/home/tomash/src/mysql_ab/mysql-5.0-bug23527 sql/sql_cache.cc: Auto merged
-
unknown authored
into moonlight.home:/home/tomash/src/mysql_ab/mysql-5.1-bug23527 sql/sql_cache.cc: Auto merged
-
unknown authored
high load MySQL server could crash if two or more threads would initiate query cache resize at the moments very close in time. The problem was introduced with the fix of bug 21051 in 5.0 and 5.1: simultaneous query cache resizes would wait for the first one in progress, but then each thread would try to finish the operation, accessing the data that was already reset (attempt to dereference 'bins' pointer, which may be NULL already). The solution is to check after synchronization if another thread has done the reset already (test 'query_cache_size > 0' again). No test case is provided because the bug is a subject to a race. sql/sql_cache.cc: We release 'structure_guard_mutex' in flush_cache(), so after the call we check if another thread had reset the cache before us.
-
unknown authored
Don't use -Wshadow by default yet BUILD/SETUP.sh: Don't use -Wshadow by default yet
-
unknown authored
into mockturtle.local:/home/dlenev/src/mysql-5.1-merge mysql-test/t/sp-error.test: Auto merged sql/sql_table.cc: Auto merged
-
unknown authored
into bk-internal.mysql.com:/data0/bk/mysql-5.1-marvel
-
unknown authored
into bk-internal.mysql.com:/data0/bk/mysql-5.1-marvel mysql-test/t/myisam.test: Auto merged mysql-test/t/ndb_basic.test: Auto merged
-
unknown authored
into poseidon.mysql.com:/home/tomas/mysql-5.1-new-ndb
-
unknown authored
into mockturtle.local:/home/dlenev/src/mysql-5.1-merge
-
unknown authored
into mockturtle.local:/home/dlenev/src/mysql-5.0-merge
-
unknown authored
into mockturtle.local:/home/dlenev/src/mysql-5.1-merge sql/mysqld.cc: Auto merged sql/sql_class.cc: Auto merged
-
unknown authored
into poseidon.mysql.com:/home/tomas/mysql-5.1-new-ndb
-
unknown authored
- added extra cluster connect inicator bit for better handeling of delacation of event operations on cluster disconnect - added extra assert to try to track down valgrind issue
-
- 24 Jan, 2007 3 commits
-
-
unknown authored
into mysql.com:/home/svoj/devel/mysql/merge/mysql-5.1-engines mysql-test/r/symlink.result: Auto merged mysql-test/t/symlink.test: Auto merged sql/ha_ndbcluster.cc: Auto merged sql/mysqld.cc: Auto merged sql/sql_class.cc: Auto merged sql/table.cc: Auto merged mysql-test/r/myisam.result: Use local. mysql-test/t/myisam.test: Use local.
-
unknown authored
into mysql.com:/home/svoj/devel/mysql/merge/mysql-5.1-engines mysql-test/r/symlink.result: Auto merged mysql-test/t/symlink.test: Auto merged sql/lock.cc: Auto merged sql/opt_range.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_insert.cc: Auto merged sql/sql_parse.cc: Auto merged sql/table.cc: Auto merged storage/federated/ha_federated.cc: Auto merged storage/myisam/mi_check.c: Auto merged storage/myisam/mi_packrec.c: Auto merged mysql-test/r/myisam.result: Manually merged. mysql-test/t/myisam.test: Manually merged.
-
unknown authored
into weblab.(none):/home/marcsql/TREE/mysql-5.1-21029 Makefile.am: Auto merged sql/Makefile.am: Auto merged sql/sql_yacc.yy: Auto merged
-