Commit graph

22791 commits

Author SHA1 Message Date
davi@endora.local
a9da8219f0 Merge endora.local:/Users/davi/mysql/bugs/30882-5.1
into  endora.local:/Users/davi/mysql/mysql-5.1-runtime
2007-11-01 20:48:14 -02:00
davi@endora.local
333b91f8e6 Merge endora.local:/Users/davi/mysql/bugs/31850-5.1
into  endora.local:/Users/davi/mysql/mysql-5.1-runtime
2007-11-01 20:44:09 -02:00
davi@endora.local
cc007acb78 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).
2007-11-01 18:52:56 -02:00
davi@endora.local
968af72150 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.
2007-11-01 17:29:20 -02:00
kostja@bodhi.(none)
8f90f66d43 Cleanup execute_ddl_log_recovery() to not generate an error if
there is nothing to recover.

Discovered while working on Bug#12713
2007-11-01 18:33:51 +03:00
kostja@bodhi.(none)
7e119ec0d1 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.
2007-11-01 18:06:46 +03:00
kostja@bodhi.(none)
6bd9f5c1cb 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.
2007-11-01 17:08:02 +03:00
kostja@bodhi.(none)
f60b890967 Fix a compilation warning. 2007-11-01 17:00:24 +03:00
kostja@bodhi.(none)
5fa9440ade 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-01 14:24:32 +03:00
kostja@bodhi.(none)
26326ed0b7 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.
2007-11-01 00:31:57 +03:00
kostja@bodhi.(none)
c0bb7f8682 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.
2007-11-01 00:10:58 +03:00
kostja@bodhi.(none)
3154b2bee4 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.
2007-10-31 18:33:13 +03:00
thek@adventure.(none)
19f1330e69 Merge adventure.(none):/home/thek/Development/cpp/bug31347/my51-bug31347
into  adventure.(none):/home/thek/Development/cpp/mysql-5.1-runtime
2007-10-31 13:22:19 +01:00
thek@adventure.(none)
5b603aa47a Merge adventure.(none):/home/thek/Development/cpp/bug31347/my50-bug31347
into  adventure.(none):/home/thek/Development/cpp/bug31347/my51-bug31347
2007-10-31 13:12:45 +01:00
thek@adventure.(none)
8549a8ea8f 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.
2007-10-31 12:25:18 +01:00
davi@endora.local
f3e0d95f45 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
davi@endora.local
756a86f06d 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.
2007-10-30 20:51:04 -02:00
kostja@bodhi.(none)
230604f33c 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
2007-10-30 22:35:14 +03:00
kostja@bodhi.(none)
cd72fffa5f Merge bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into  bodhi.(none):/opt/local/work/mysql-5.1-runtime-inc-2
2007-10-30 20:10:11 +03:00
kostja@bodhi.(none)
e4b353c40c 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.
2007-10-30 20:08:16 +03:00
kostja@bodhi.(none)
5a09edd203 Fix failing init_connect.test (5.1-runtime). 2007-10-30 15:39:50 +03:00
malff@lambda.weblab
0909d1f8cb Merge lambda.weblab:/home/malff/TREE/mysql-5.1-base
into  lambda.weblab:/home/malff/TREE/mysql-5.1-rt-merge
2007-10-29 08:07:27 -06:00
anozdrin/alik@station.
ee25b4f56f 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.
2007-10-29 15:42:49 +03:00
malff@lambda.hsd1.co.comcast.net.
2bc41b7e1e 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.
2007-10-24 19:01:08 -06:00
anozdrin/alik@station.
9586784366 Merge station.:/mnt/raid/alik/MySQL/devel/5.0-rt
into  station.:/mnt/raid/alik/MySQL/devel/5.1-rt
2007-10-24 11:43:16 +04:00
gluh@eagle.(none)
17acda6ca8 Merge mysql.com:/home/gluh/MySQL/Merge/5.1
into  mysql.com:/home/gluh/MySQL/Merge/5.1-opt
2007-10-23 19:08:21 +05:00
anozdrin/alik@station.
b2264ff810 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).
2007-10-23 18:03:51 +04:00
kaa@polly.(none)
6832d2cc1b 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
kaa@polly.(none)
17a533e0d0 Merge polly.(none):/home/kaa/src/opt/bug31742/my50-bug28550
into  polly.(none):/home/kaa/src/opt/bug31742/my51-bug28550
2007-10-23 15:52:27 +04:00
gkodinov/kgeorge@magare.gmz
58bce232a8 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
gkodinov/kgeorge@magare.gmz
7c344185bd 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
gkodinov/kgeorge@magare.gmz
3553f6eac2 Merge magare.gmz:/home/kgeorge/mysql/autopush/B30825-new-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/work/B30825-5.1-opt
2007-10-23 11:44:14 +03:00
gkodinov/kgeorge@magare.gmz
d066e2173c 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 11:26:37 +03:00
gkodinov/kgeorge@magare.gmz
0a14d1a19b Merge magare.gmz:/home/kgeorge/mysql/work/B28687-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/work/B28687-5.1-opt
2007-10-23 11:22:59 +03:00
gluh@mysql.com/eagle.(none)
ffea2073b1 Bug#31633 Information schema = NULL queries crash the server
added correct handling of NULL values for lookup fields
2007-10-23 13:20:51 +05:00
gkodinov/kgeorge@magare.gmz
52b35112cf 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.
2007-10-22 19:32:18 +03:00
kaa@polly.(none)
53a9e7f478 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.
2007-10-22 16:10:08 +04:00
holyfoot/hf@hfmain.(none)
5b67dca442 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
holyfoot/hf@hfmain.(none)
bf19259d83 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
tnurnberg@white.intern.koehntopp.de
478079b2e8 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
tnurnberg@white.intern.koehntopp.de
44fbb702b9 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
kaa@polly.(none)
d998b471c9 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
kaa@polly.(none)
f9ba86ee86 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
kaa@polly.(none)
d55d309380 Merge polly.(none):/home/kaa/src/opt/bug28550/my50-bug28550
into  polly.(none):/home/kaa/src/opt/bug28550/my51-bug28550
2007-10-21 21:49:30 +04:00
kaa@polly.(none)
349841118f 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().
2007-10-21 21:45:31 +04:00
anozdrin/alik@station.
9a6f673143 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.
2007-10-20 21:48:15 +04:00
tnurnberg@sin.intern.azundris.com
b8feb23321 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
kostja@bodhi.(none)
62a7103a3d Merge bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into  bodhi.(none):/opt/local/work/mysql-5.1-runtime
2007-10-20 01:21:20 +04:00
kostja@bodhi.(none)
7c00f8a3b4 Rename: query_error -> is_slave_error.
Add comments.
2007-10-20 01:20:38 +04:00
antony@pcg5ppc.xiphis.org
3b95727600 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
2007-10-19 13:06:37 -07:00