Commit graph

464 commits

Author SHA1 Message Date
konstantin@mysql.com
33c97a499b Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/media/sda1/mysql/mysql-4.1-6050
2004-10-22 15:59:58 +04:00
konstantin@mysql.com
a7c52d755b A fix and test case for Bug#6050 "EXECUTE stmt reports ambiguous field
names with ident. tables fr. diff. schemata": revise all uses of
Item_field and make them prepared-statements friendly when necessary.
2004-10-22 14:47:35 +04:00
konstantin@mysql.com
a55e6dda22 Manual merge. 2004-10-21 18:44:40 +04:00
konstantin@mysql.com
49a58fc64e A fix and test case for bug#6059 "mysql_stmt_field_count returns
positive numbers when no resultset is available": when sending
result set metadata we need to use virtual select_result::send_fields, 
and not address protocol directly, because select_result descendents may 
intercept result set (it's the case for example for SELECT INTO OUTFILE).
2004-10-21 18:33:53 +04:00
monty@mysql.com
e1218474b8 Merge with 4.0 2004-10-20 16:24:28 +03:00
monty@mysql.com
1f8b3d0f22 Code cleanups (done during review of new code)
Rename innodb_table_locks_old_behavior -> innodb_table_locks
Set innodb_table_locks to off by default to get same behaviour as in MySQL 4.0.20
(This means that Innodb ignore table locks by default, which makes it easier to combine MyISAM and InnoDB to simulate a transaction)
2004-10-20 11:24:08 +03:00
konstantin@mysql.com
7c95fa7085 Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/media/sda1/mysql/mysql-4.1-5985
2004-10-14 02:54:44 +04:00
konstantin@mysql.com
5abc3de22b A fix and test case for Bug#5985 ""prepare stmt from "select rand(?)"
crashes server." The fix makes Item_func_rand prepared-statements
aware plus it fixes the case when RAND is used in prepared
statements and replication is on (as well as several similar issues).
Until now we did not reset THD before every execution of a prepared
statement, so if some execution had set thd->time_zone_used
or thd->rand_used they would not be reset until next mysql_parse.
Some of post-review fixes done.
2004-10-14 02:53:59 +04:00
marko@hundin.mysql.fi
edb93ca441 Added startup option and settable session variable
innodb_table_locks_old_behavior: do not acquire an
InnoDB table lock for LOCK TABLES, as in mysql-4.0.18
and earlier.
2004-10-13 22:54:21 +03:00
konstantin@mysql.com
1ac41c9285 Move Heikki's comment about thd->query comment to proper place
(bad merge from 4.0)
2004-10-13 00:17:37 +04:00
ram@gw.mysql.r18.ru
5e352defa5 Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-4.1
into gw.mysql.r18.ru:/usr/home/ram/work/4.1.gconcat
2004-10-10 12:35:39 +05:00
ram@gw.mysql.r18.ru
5f857a7a82 Blob support for the group_concat() function.
(Bug #4315: GROUP_CONCAT with ORDER BY returns strange results for TEXT fields
 Bug #5564: Strange behaviour with group_concat and distinct
 Bug #5970: group_concat doesn't print warnings)
2004-10-10 12:10:53 +05:00
konstantin@mysql.com
703e396b6e A small simplification: perform two actions at once, register a
change, and perform it (the new Item changes registry).
2004-10-10 03:10:00 +04:00
konstantin@mysql.com
d7bda287de Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/media/sda1/mysql/mysql-4.1-5748-anew
2004-10-08 02:22:40 +04:00
konstantin@mysql.com
2aa7ec0d9d A fix for Bug#5748 "Prepared statement with BETWEEN and bigint values
crashes mysqld": implementation for a generic item tree modifications
registry. Every item tree modification which should be rolled back for
subsequent execution of a prepared statement or stored procedure should
be saved in the registry. All such modifications are rolled back at once
during cleanup stage of PS.
Actual fix for the bug just adds a call to register modifications to
convert_constant_item.
Post review fixes implemented.
2004-10-08 02:21:19 +04:00
monty@mysql.com
62f3cd6a31 Merge with 4.0 for 4.1 release
Noteworthy:
- New HANDLER code
- New multi-update-grant-check code
- Table lock code in ha_innodb.cc was not applied
2004-10-06 19:14:33 +03:00
ingo@mysql.com
c546074e21 Merge mysql.com:/home/mydev/mysql-4.0
into mysql.com:/home/mydev/mysql-4.0-bug4286
2004-10-05 11:33:13 +02:00
konstantin@mysql.com
0cadd78db7 A couple of typos fixed. 2004-10-04 14:14:30 +04:00
ingo@mysql.com
e47decfa7f BUG#4286 - HANDLER tables are closed by FLUSH TABLE(S).
BUG#4335 - one name can be handler open'ed many times.
Reworked the HANDLER functions and interface.
Using a HASH to store information on open tables that
survives FLUSH TABLE.
HANDLER tables alias names must now be unique, though it
is allowed in 4.0 to qualify them with the database name
of the base table.
2004-09-24 18:39:25 +02:00
dlenev@mysql.com
d2a2904719 Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/home/dlenev/src/mysql-4.1-memroot
2004-09-23 13:52:00 +04:00
dlenev@brandersnatch.localdomain
f5d1b711c6 Implementation of Monty's idea about clear_alloc_root() optimization and cleanup of work
with memory roots in THD/Statement/Item_arena.
Added assertions preventing memory allocation on bzero'ed MEM_ROOT since it is worked by 
pure luck and was very ineffective.
2004-09-23 13:48:17 +04:00
konstantin@mysql.com
36548b10ca A fix and test case for Bug#5315 "mysql_change_user() doesn't free
prepared statements."
2004-09-22 15:50:07 +04:00
tomas@poseidon.(none)
21a4b1b4e6 moved all ndb thread specific data into new placeholder
new methods to keep "records" up to date
unset flag HA_NOT_EXACT_COUNT to make handler read "records" field, for count() optim and join optimization
new methods to keep "records" up to datecorrect record field in ndbcluster handler
new method for ndbcluster handler to store/retrieve table and thread specific data
changed local hash to store new table_info object, with placeholders for local data, instead of TableImpl
hanged deleteKey to return ponter to deleted object
moved heavy global cache fetch from inline to separate method
2004-09-14 08:52:21 +00:00
tulin@build.mysql.com
c039c35bba Merge tulin@bk-internal.mysql.com:/home/bk/mysql-4.1
into build.mysql.com:/users/tulin/mysql-4.1-ndb-merge
2004-09-09 10:41:33 +02:00
serg@serg.mylan
413a8753e2 merged 2004-09-07 15:18:53 +02:00
guilhem@mysql.com
99444c3311 Replacing class Disable_binlog by macros. Patch already approved by Monty. 2004-09-06 22:47:26 +02:00
tomas@poseidon.(none)
caf79dacfe renamed ha_recovery_logging to ha_enable_transaction
added tests to alter table for "large" alter tables and truncates in ndbcluster
added debug printout in restart() in ndbcluster
added flag THD::transaction.on to enable/disable transaction
2004-09-03 15:11:09 +00:00
sergefp@mysql.com
5d3dc82daa Change Item_arena::state to enum 2004-08-31 14:07:02 +04:00
konstantin@mysql.com
522a27069f Merge: manual resolve 2004-08-24 23:07:08 +04:00
konstantin@mysql.com
ae18dc3ec8 Fix for Bug#5034 "prepared "select 1 into @arg15", second
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.
2004-08-24 20:17:11 +04:00
sergefp@mysql.com
d970586fef Fix to compile with msvc: converted static const int Item_arena::* to enum members, undefine ERROR 2004-08-24 14:44:15 +04:00
konstantin@mysql.com
75454b0a1d Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/home/kostja/work/mysql-4.1-4912
2004-08-21 02:08:20 +04:00
konstantin@mysql.com
568c6e8526 Fix for bug#4912 "mysqld crashs in case a statement is executed
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.
2004-08-21 02:02:46 +04:00
serg@serg.mylan
050bf6a89f merged 2004-08-20 21:56:29 +02:00
guilhem@mysql.com
5db56a106b Making FLUSH TABLES WITH READ LOCK block COMMITs of existing transactions,
in a deadlock-free manner. This splits locking the global read lock in two steps.
This fixes a consequence of this bug, known as:
BUG#4953 'mysqldump --master-data may report incorrect binlog position if using InnoDB'
And a test.
2004-08-20 16:35:23 +02:00
serg@serg.mylan
43826f0974 merged 2004-08-20 01:38:20 +02:00
serg@serg.mylan
62722e7b05 merged 2004-08-20 00:52:43 +02:00
guilhem@mysql.com
54d43b7b19 sql_class.h:
removing unneeded var left from 4.0
2004-08-20 00:01:00 +02:00
guilhem@mysql.com
0db5b4d202 (manual port from 4.0 - was needed)
Fix for BUG#4971 "CREATE TABLE ... TYPE=HEAP SELECT ... stops slave (wrong DELETE in binlog)":
replacing the no_log argument of mysql_create_table() by some safer method
(temporarily setting OPTION_BIN_LOG to 0) which guarantees that even the automatic
DELETE FROM heap_table does not get into the binlog when a not-yet-existing HEAP table
is opened by mysql_create_table().
2004-08-19 23:24:35 +02:00
guilhem@mysql.com
96a000ae78 cosmetic change 2004-08-19 10:01:01 +02:00
guilhem@mysql.com
42d30b758b Fix for BUG#4971 "CREATE TABLE ... TYPE=HEAP SELECT ... stops slave (wrong DELETE in binlog)":
replacing the no_log argument of mysql_create_table() by some safer method
(temporarily setting OPTION_BIN_LOG to 0) which guarantees that even the automatic
DELETE FROM heap_table does not get into the binlog when a not-yet-existing HEAP table
is opened by mysql_create_table().
2004-08-19 00:29:11 +02:00
serg@serg.mylan
e1237cbc53 manually merged 2004-08-18 19:57:55 +02:00
guilhem@mysql.com
dd023bc878 Fix for:
Bug #4810 "deadlock with KILL when the victim was in a wait state"
(I included mutex unlock into exit_cond() for future safety)
and BUG#4827 "KILL while START SLAVE may lead to replication slave crash"
2004-07-31 22:33:20 +02:00
guilhem@mysql.com
2532adf49b removing assertion (will be moved to 4.1) for non-debug to compile 2004-07-31 09:49:32 +02:00
guilhem@mysql.com
0f20e2fece Avoiding a theoretically possible crash (pthread_mutex_lock(0)) which could (at least in POSIX Threads books)
happen on SMP machines, when a thread is going to wait on a condition and it is KILLed at the
same time.
Cleaning code a bit by adding a test in enter_cond() that we have the mutex (was already the case in all places
where it's called except one which is fixed here).
2004-07-30 00:53:25 +02:00
guilhem@mysql.com
bccf57fbb2 Merge gbichot@213.136.52.20:/home/bk/mysql-4.1
into mysql.com:/home/mysql_src/mysql-4.1-1717
2004-06-23 23:52:49 +02:00
konstantin@mysql.com
3f53a1cb44 Fix for bug#4236 "Server crash on attempt to execute non-prepared
statement": check that statement is not null when accessing it's name.
2004-06-22 11:04:41 +04:00
guilhem@mysql.com
f5d6424487 Robustness feature.
Won't be pushed as is - separate email sent for internal review.
WL#1717 "binlog-innodb consistency".
Now when mysqld starts, if InnoDB does a crash recovery, we use the binlog name
and position retrieved from InnoDB (corresponding to the last transaction
successfully committed by InnoDB) to cut any rolled back transaction from
the binary log. This is triggered by the --innodb-safe-binlog option.
Provided you configure mysqld to fsync() InnoDB at every commit (using
flush_log_at_trx_commit) and to fsync() the binlog at every write
(using --sync-binlog=1), this behaviour guarantees that a master always has
consistency between binlog and InnoDB, whenever the crash happens.
6 tests to verify that it works.
2004-06-20 19:11:02 +02:00
dlenev@brandersnatch.localdomain
09ba29e539 WL#1264 "Per-thread time zone support infrastructure".
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.
2004-06-18 10:11:31 +04:00
sergefp@mysql.com
916579e3fd Merged 2004-06-07 12:21:26 +04:00