Use 'mysqltest' as test database instead of test_$1 or test1,test2 to not accidently delete an important database
Safety fix for mailformed MERGE files
execute crashes server": we were deleting lex->result
after each execute, but prepared statements assumed that
it's left intact.
The fix adds cleanup() method to select_result hierarchy,
so that result objects can be reused.
Plus we now need to delete result objects more wisely.
* When executing EXPLAIN, do the same as for the query: convert join type to JT_CONST if keyuse array covers all key parts and all of them are constants.
* In remove_const, don't remove conditions that depend on some-const-table and current-table.
a second time". The bug was caused by incompatibility of
negations elimination algorithm and PS: during first statement
execute a subtree with negation was replaced with equivalent
subtree without NOTs.
The problem was that although this transformation was permanent,
items of the new subtree were created in execute-local memory.
The patch adds means to check if it is the first execute of a
prepared statement, and if this is the case, to allocate items
in memory of the prepared statement.
The implementation:
- backports Item_arena from 5.0
- adds Item_arena::is_stmt_prepare(),
Item_arena::is_first_stmt_execute().
- deletes THD::allocate_temporary_pool_for_ps_preparing(),
THD::free_temporary_pool_for_ps_preparing(); they
were redundant.
and adds a few invariants:
- thd->free_list never contains junk (= freed items)
- thd->current_arena is never null. If there is no
prepared statement, it points at the thd.
The rest of the patch contains mainly mechanical changes and
cleanups.
When in find_item_in_list() we are looking for item we should take into account unaliased
names of the fields but only if item with such aliased name is not found.
Also we should ignore aliases when looking for fully specified field.
Added a case for bug #4976 when one of the inner tables is empty.
select.result, join.result:
Reversed the previous change of the erronious fix for bug #4976.
sql_select.cc:
The previous fix for bug 4976 was reversed as it
erroniously converted an outer join into an innner join
when on_expression does not refer to outer tables.
This is not valid if inner tables return an empty set.
Setting dependency on outer tables was added for the above cases.
To fix the crash in the test case of bug #4976
a guard was added that blocks running the crashing code for
nested outer joins.
from the select list and TEXT field
make setup_copy_fields to insert Item_copy_string for blobs in
the beginning of the copy_funcs (push_back instead of push_front)
the thing is that Item_copy_string::copy for function can call
Item_copy_string::val_int for blob via Item_ref.
But if Item_copy_string::copy for blob isn't called before,
it's value will be wrong.
So all the Item_copy_string::copy for blobs should be called before
Item_copy_string::copy for functions.
Added test case for bug #4767.
item_sum.cc:
Added a correct setting of the maybe_null flag for a copy of
an Item_sum object where the argument was a field of an inner table
in an outer join read from a temporary table.
It's part of the fix for bug #4767.
sql_select.cc:
Made change_refs_to_tmp_fields work correctly
for test case of bug #4767 where Item_sum::get_tmp_table_item
failed to build a correct copy of an Item_sum object referring
to a field in a temporary table.
It looks like a hack yet.
Fixed bug #4976.
join_nested.result, join_nested.test:
Added a test case for bug #4976.
sql_select.cc:
Applied conversion from an outer join to an inner join
when the on expression does not depend on the outer table.
It fixed bug #4976.
Instead of trying to open time zone tables during calculation of CONVERT_TZ() function
or setting of @@time_zone variable we should open and lock them with the rest of
statement's table (so we should add them to global table list) and after that use such
pre-opened tables for loading info about time zones.
Added a test case for bug #4922.
sql_select.cc:
Blocked an optimization performed by join_read_const_table when
applied to an inner table of a nested outer join.
It was done to fix bug #4922.
sql_yacc.yy:
Fixed a typo bug in the rule for join_table.
- client side part is simple and may be considered stable
- server side part now just joggles with THD state to save execution
state and has no additional locking wisdom.
Lot's of it are to be rewritten.
new tests to ensure that prepared statement *really* work
(and that MySQL not picks up some number from arbitrary location
that happens to match the parameter's value)
if many plans have identical cost, which one will be used depends on how compiler optimizes floating-point calculations
this fix adds repeatability to the optimizer
Note: The following tests fails
- fulltext (Sergei has promised to fix)
- rpl_charset (Guilhem should fix)
- rpl_timezone (Dimitray has promised to fix)
Sanja needs to check out the calling of close_thread_tables() in sp_head.cc
Post-merge fixes for nested joins.
The join_tab_cmp function in sql_select has been changed.
join_nested.result:
Post-merge fixes for nested joins.
The join_tab_cmp function in sql_select has been changed
sql_select.cc:
Post-merge fixes for nested joins.
Avoided re-execution of eliminate_not_funcs and simplify_joins
in optimize_cond.
Changed the join_tab_cmp function to take into account
the dependent relation.
sql_lex.cc, sql_lex.h:
Added the first_cond_optimization flag to st_select_lex to avoid
re-execution of some optimizations in optimize_cond.
sql_base.cc:
Post-merge fixes for nested joins.
Fixed problems with a proper column list substituted for '*' in
queries with natural joins.
Set default max_allowed_packet to be able to read help tables even if an my.cnf file with this option is present. (Bug #3938)
Don't use default arguments for ha_rnd_init()
Simple code cleanups since last pull
more logical table/index_flags
return HA_ERR_WRONG_COMMAND instead of abstract methods where appropriate
max_keys and other limits renamed to max_supported_keys/etc
max_keys/etc are now wrappers to max_supported_keys/etc
ha_index_init/ha_rnd_init/ha_index_end/ha_rnd_end are now wrappers to real {index,rnd}_{init,end} to enforce strict pairing
Added basic per-thread time zone functionality (based on public
domain elsie-code). Now user can select current time zone
(from the list of time zones described in system tables).
All NOW-like functions honor this time zone, values of TIMESTAMP
type are interpreted as values in this time zone, so now
our TIMESTAMP type behaves similar to Oracle's TIMESTAMP WITH
LOCAL TIME ZONE (or proper PostgresSQL type).
WL#1266 "CONVERT_TZ() - basic time with time zone conversion
function".
Fixed problems described in Bug #2336 (Different number of warnings
when inserting bad datetime as string or as number). This required
reworking of datetime realted warning hadling (they now generated
at Field object level not in conversion functions).
Optimization: Now Field class descendants use table->in_use member
instead of current_thd macro.
which occured because we were not lowering case of file names
for temporary tables altough handler assumes so if
lower_case_table_names==2. Now we are lowering case for them.
after Monty's review.
- Item_param was rewritten.
- it turns out that we can't convert string data to character set of
connection on the fly, because they first should be written to the binary
log.
To support efficient conversion we need to rewrite prepared statements
binlogging code first.
New records_in_range() interface (similar to read_range())
Macros for faster bitmap handling
Simplify read_range() code (#WL1786)
New general key_cmp() function to compare keys
HEAP: Copies the key count to a backup variable and sets the key count to zero.
That way, no HEAP function will ever try to touch any index.
Re-enabling is done by copying back the backup variable.
To avoid memory leak at table close, disable deletes all index trees.
Re-enabling must be done with empty indexes and data anyway. Otherwise,
the indexes would need to be repaired, wich HEAP is not capable of.
MyISAM: Only the key_map is cleared and set.
Re-enabling must be done with empty indexes and data. Otherwise, repair needs
to be done which will enable all keys persistently.
The former implementation disabled only non-unique keys and maked this persistent.
The new implementation additionally can disable all keys, but only without
making this persistent. Re-enabling all keys can be done without repair,
if data file and indexes are empty.
Fixed security problem that password was temporarly reset when someone changed GRANT for a user. (Bug #3404)
Fixed problem with PROCEDURE analyse() and impossible WHERE (Bug #2238)
Don't auto-repair tables in mysqlcheck if table type doesn't support 'check' command.
Fix a glitch reported by Philippe Lewicki on the general mailing list: do not print a warning to the .err log if read_key fails with a lock wait timeout error 146
fixed IN subselect with basic constant left expression
SQLCOM_CREATE_TABLE, SQLCOM_UPDATE_MULTI, SQLCOM_REPLACE_SELECT, SQLCOM_INSERT_SELECT, QLCOM_DELETE_MULTI fixed to be compatible with PS (BUG#3398, BUG#3406)
fixed multiupdate privelege check (BUG#3408)
fixed multiupdate tables check (BUG#3411)
unchecked commands now is rejected by PS protocol to avoid serever crash
fixed cleunup procedure to be compatible sith DO/SET (BUG#3393)
Fixed bugs in group_concat with ORDER BY and DISTINCT (Bugs #2695, #3381 and #3319)
Fixed crash when doing rollback in slave and the io thread catched up with the sql thread
Set locked_in_memory properly
result of the test case for FORCE INDEX on ORDER BY
order_by.test:
test case for FORCE INDEX on ORDER BY
sql_select.cc:
Changing behaviour that MySQL server takes FORCE INDEX clause into account when optimising ORDER BY clause
Test case for a #2996 bug fix
multi_update.test:
test case for a #2996 bug fix
sql_select.cc:
Fix for a bug #2996 involving multi-table updates over the const tables
Allow one to force lower_case_table_names to 0, even if the file system is case insensitive. This fixes some issues on Mac OS X (Bug #2994)
Added variables "lower_case_file_system", "version_compile_os" and "license"
Added more DBUG statements
Ensure that we are comparing end space with BINARY strings
Use 'any_db' instead of '' to mean any database. (For HANDLER command)
Only strip ' ' when comparing CHAR, not other space-like characters (like \t)
DROP DATABASE now assumes RAID directories are in hex. (Bug #2627)
Don't increment 'select_full_range' and similar statistics for EXPLAIN queries. (Bug #2506)
Test in configure if pthread_key_delete() exists (to fix compile problem on SCO) (Bug #2461)
The problem was that memory was free'd, but it was referenced
later. This free was unneccessary anyway, because join_free() /
JOIN::cleanup takes care of this later on.
Added test case into t/subselect.test for it.
Regards,
Jani