Commit graph

923 commits

Author SHA1 Message Date
kostja@bodhi.local
436e7a2dd9 Post-merge fixes. 2006-07-14 02:07:37 +04:00
kostja@bodhi.local
d7845b74db Merge bodhi.local:/opt/local/work/tmp_merge
into  bodhi.local:/opt/local/work/mysql-5.1-runtime-merge-5.0
2006-07-13 22:09:36 +04:00
kostja@bodhi.local
56353959e7 Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into  bodhi.local:/opt/local/work/mysql-5.1-runtime-merge
2006-07-13 00:18:59 +04:00
mkindahl@dl145k.mysql.com
9415b24139 Merge dl145k.mysql.com:/data0/mkindahl/bkroot/mysql-5.1-new-rpl
into  dl145k.mysql.com:/data0/mkindahl/bk/MERGE/mysql-5.1-merge
2006-07-11 12:17:19 +02:00
guilhem@gbichot3.local
0594e1b84b WL#3146 "less locking in auto_increment":
this is a cleanup patch for our current auto_increment handling:
new names for auto_increment variables in THD, new methods to manipulate them
(see sql_class.h), some move into handler::, causing less backup/restore
work when executing substatements. 
This makes the logic hopefully clearer, less work is is needed in
mysql_insert().
By cleaning up, using different variables for different purposes (instead
of one for 3 things...), we fix those bugs, which someone may want to fix
in 5.0 too:
BUG#20339 "stored procedure using LAST_INSERT_ID() does not replicate
statement-based"
BUG#20341 "stored function inserting into one auto_increment puts bad
data in slave"
BUG#19243 "wrong LAST_INSERT_ID() after ON DUPLICATE KEY UPDATE"
(now if a row is updated, LAST_INSERT_ID() will return its id)
and re-fixes:
BUG#6880 "LAST_INSERT_ID() value changes during multi-row INSERT"
(already fixed differently by Ramil in 4.1)
Test of documented behaviour of mysql_insert_id() (there was no test).
The behaviour changes introduced are:
- LAST_INSERT_ID() now returns "the first autogenerated auto_increment value
successfully inserted", instead of "the first autogenerated auto_increment
value if any row was successfully inserted", see auto_increment.test.
Same for mysql_insert_id(), see mysql_client_test.c.
- LAST_INSERT_ID() returns the id of the updated row if ON DUPLICATE KEY
UPDATE, see auto_increment.test. Same for mysql_insert_id(), see
mysql_client_test.c.
- LAST_INSERT_ID() does not change if no autogenerated value was successfully 
inserted (it used to then be 0), see auto_increment.test.
- if in INSERT SELECT no autogenerated value was successfully inserted,
mysql_insert_id() now returns the id of the last inserted row (it already
did this for INSERT VALUES), see mysql_client_test.c.
- if INSERT SELECT uses LAST_INSERT_ID(X), mysql_insert_id() now returns X
(it already did this for INSERT VALUES), see mysql_client_test.c.
- NDB now behaves like other engines wrt SET INSERT_ID: with INSERT IGNORE,
the id passed in SET INSERT_ID is re-used until a row succeeds; SET INSERT_ID
influences not only the first row now.

Additionally, when unlocking a table we check that the thread is not keeping
a next_insert_id (as the table is unlocked that id is potentially out-of-date);
forgetting about this next_insert_id is done in a new
handler::ha_release_auto_increment().

Finally we prepare for engines capable of reserving finite-length intervals
of auto_increment values: we store such intervals in THD. The next step
(to be done by the replication team in 5.1) is to read those intervals from
THD and actually store them in the statement-based binary log. NDB
will be a good engine to test that.
2006-07-09 17:52:19 +02:00
tomas@poseidon.ndb.mysql.com
4f7df01b4f Bug #20843 tests fails randomly with assertion in completeClusterFailed
Bug #20902 Alter table invalid schema version with statement-based binlogging
(latter caused by the above)
2006-07-08 03:26:13 +02:00
dlenev@jabberwock.site
77f640b1a3 Merge bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into  jabberwock.site:/home/dlenev/mysql-5.1-bg18437
2006-07-07 14:11:35 +04:00
tomas@poseidon.ndb.mysql.com
0a75f5fe0a Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.1
into  poseidon.ndb.mysql.com:/home/tomas/mysql-5.1-ndb
2006-07-05 01:56:38 +02:00
tomas@poseidon.ndb.mysql.com
35938c56f3 Bug #20077 Cluster to only support partition by key, needs to error on others 2006-07-05 01:52:38 +02:00
tomas@poseidon.ndb.mysql.com
d3b52bd475 Bug #20077 Cluster to only support partition by key, needs to error on others 2006-07-04 18:29:21 +02:00
mskold@mysql.com
59d69f6d38 Fix for Bug #18413 Data usage for varsize columns are not correctly reported to mysqld 2006-07-03 17:09:32 +02:00
dlenev@mysql.com
eb3ae6eb79 Merge mysql.com:/home/dlenev/mysql-5.0-bg18437-3
into  mysql.com:/home/dlenev/mysql-5.1-bg18437
2006-07-02 02:12:53 +04:00
dlenev@mysql.com
d4450e6696 Fix for bug#18437 "Wrong values inserted with a before update trigger on
NDB table".

SQL-layer was not marking fields which were used in triggers as such. As
result these fields were not always properly retrieved/stored by handler
layer. So one might got wrong values or lost changes in triggers for NDB,
Federated and possibly InnoDB tables.
This fix solves the problem by marking fields used in triggers
appropriately.

Also this patch contains the following cleanup of ha_ndbcluster code:

We no longer rely on reading LEX::sql_command value in handler in order
to determine if we can enable optimization which allows us to handle REPLACE
statement in more efficient way by doing replaces directly in write_row()
method without reporting error to SQL-layer.
Instead we rely on SQL-layer informing us whether this optimization
applicable by calling handler::extra() method with
HA_EXTRA_WRITE_CAN_REPLACE flag.
As result we no longer apply this optimzation in cases when it should not
be used (e.g. if we have on delete triggers on table) and use in some
additional cases when it is applicable (e.g. for LOAD DATA REPLACE).

Finally this patch includes fix for bug#20728 "REPLACE does not work
correctly for NDB table with PK and unique index".
  
This was yet another problem which was caused by improper field mark-up.
During row replacement fields which weren't explicity used in REPLACE
statement were not marked as fields to be saved (updated) so they have
retained values from old row version. The fix is to mark all table
fields as set for REPLACE statement. Note that in 5.1 we already solve
this problem by notifying handler that it should save values from all
fields only in case when real replacement happens.
2006-07-02 01:51:10 +04:00
monty@mysql.com
f62829636b After merge fixes 2006-06-30 20:07:33 +03:00
monty@mysql.com
2f86009c9e Merge mysql.com:/home/my/mysql-4.1
into  mysql.com:/home/my/mysql-5.0
2006-06-30 19:15:18 +03:00
tomas@poseidon.ndb.mysql.com
e61bfafaa9 Merge poseidon.ndb.mysql.com:/home/tomas/mysql-4.1
into  poseidon.ndb.mysql.com:/home/tomas/mysql-4.1-main
2006-06-30 16:26:33 +02:00
tomas@poseidon.ndb.mysql.com
9f542ef0f4 adopted ndb handler code for tables without primary key and with unique index
- added missing retrieval of hidden primary key
2006-06-30 16:25:07 +02:00
monty@mysql.com
a267b8f33c Don't read ~/.my.cnf in mysqldump.test 2006-06-30 04:10:27 +03:00
tomas@poseidon.ndb.mysql.com
5f5c3f9ceb Merge poseidon.ndb.mysql.com:/home/tomas/mysql-5.0-main
into  poseidon.ndb.mysql.com:/home/tomas/5.0-merge
2006-06-30 00:02:17 +02:00
tomas@poseidon.ndb.mysql.com
97a19c1b9b Merge poseidon.ndb.mysql.com:/home/tomas/mysql-5.0
into  poseidon.ndb.mysql.com:/home/tomas/mysql-5.0-main
2006-06-29 22:54:49 +02:00
monty@hasky.mysql.fi
0b00ae6bc5 Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into  mysql.com:/home/my/mysql-5.1
2006-06-29 23:41:33 +03:00
monty@mysql.com
8eb9c06d70 Replaced assert with argument checking, as rpl_ndb_UUID caused slave to fail on x86 64 bit
(It failed even if test was marked as skipped)
2006-06-29 23:22:55 +03:00
tomas@poseidon.ndb.mysql.com
3b3dde6f4e Merge poseidon.ndb.mysql.com:/home/tomas/mysql-5.0
into  poseidon.ndb.mysql.com:/home/tomas/mysql-5.1-new-ndb
2006-06-29 22:13:19 +02:00
tomas@poseidon.ndb.mysql.com
5d67b05203 corrected merge error 2006-06-29 22:11:29 +02:00
tomas@poseidon.ndb.mysql.com
9d902d4cf8 manual merge 2006-06-29 21:25:37 +02:00
tomas@poseidon.ndb.mysql.com
65cec4da00 Merge poseidon.ndb.mysql.com:/home/tomas/mysql-5.0
into  poseidon.ndb.mysql.com:/home/tomas/mysql-5.0-main
2006-06-29 21:07:07 +02:00
tomas@poseidon.ndb.mysql.com
6f318d1658 Merge poseidon.ndb.mysql.com:/home/tomas/mysql-4.1-main
into  poseidon.ndb.mysql.com:/home/tomas/mysql-5.0
2006-06-29 21:05:43 +02:00
tomas@poseidon.ndb.mysql.com
87460ec76a Bug #19202 Incorrect errorhandling in select count(*) wrt temporary error 2006-06-29 20:55:21 +02:00
stewart@mysql.com
4e59b43512 Merge mysql.com:/home/stewart/Documents/MySQL/5.0/ndb
into  mysql.com:/home/stewart/Documents/MySQL/5.0/main
2006-06-29 22:00:50 +10:00
stewart@willster.(none)
1cc537d9fd Merge bk-internal.mysql.com:/home/bk/mysql-5.1-new-ndb
into  mysql.com:/home/stewart/Documents/MySQL/5.1/bug20725
2006-06-28 22:47:25 +10:00
stewart@mysql.com
11c38b0f9e Merge mysql.com:/home/stewart/Documents/MySQL/5.0/ndb
into  mysql.com:/home/stewart/Documents/MySQL/5.0/merge
2006-06-28 22:25:41 +10:00
stewart@willster.(none)
c19578fbfd Merge mysql.com:/home/stewart/Documents/MySQL/5.1/ndb
into  mysql.com:/home/stewart/Documents/MySQL/5.1/merge
2006-06-28 22:16:04 +10:00
stewart@willster.(none)
a61cf1116e Merge mysql.com:/home/stewart/Documents/MySQL/5.0/bug11459
into  mysql.com:/home/stewart/Documents/MySQL/5.1/merge
2006-06-28 18:21:37 +10:00
jonas@perch.ndb.mysql.com
b26e651f98 Merge perch.ndb.mysql.com:/home/jonas/src/51-work
into  perch.ndb.mysql.com:/home/jonas/src/mysql-5.1-new
2006-06-28 08:47:43 +02:00
tomas@poseidon.ndb.mysql.com
9791d53445 partition functions to pass create_info, not only max_rows 2006-06-27 22:19:27 +02:00
stewart@mysql.com
bd54e6769b BUG#20725 MySQLD cluster use "fast count" is broken
fix based on review by tomas.

conform to bug we haven't fixed yet.
2006-06-28 01:28:07 +10:00
stewart@mysql.com
bc91efe0ae BUG#20725 MySQLD cluster use "fast count" is broken
Post recent handler changes, fast count(*) for cluster was broken.

Seeing as we maintain an exact count for ndb, we can easily use this for an optimisation.

With this patch, and use_exact_count DISABLED, we will use the fast way
of getting count(*) but not use the exact count for the optimiser.

With this patch and use_exact_count ENABLED, we will use the fast way of
getting count(*) and use the exact count for the optimiser.
2006-06-28 01:07:44 +10:00
tomas@poseidon.ndb.mysql.com
6283d8fd5a Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.0
into  poseidon.ndb.mysql.com:/home/tomas/mysql-5.0-main
2006-06-27 14:56:20 +02:00
tomas@poseidon.ndb.mysql.com
08bec7b954 changed signature of get_default_no_partitions 2006-06-27 14:31:34 +02:00
tomas@poseidon.ndb.mysql.com
18e008a1ba Bug #19852 Restoring backup made from cluster with full data memory fails
- correction of previous patch
2006-06-27 11:26:00 +02:00
tomas@poseidon.ndb.mysql.com
f923d6395d Merge poseidon.ndb.mysql.com:/home/tomas/mysql-5.0-main
into  poseidon.ndb.mysql.com:/home/tomas/mysql-5.1-new-ndb
2006-06-27 11:22:42 +02:00
tomas@poseidon.ndb.mysql.com
95447f9d1a Bug #19852 Restoring backup made from cluster with full data memory fails
- make sure to allocate just enough pages in the fragments by using the actual
  row count from the backup, to avoid over allocation of pages to fragments, and
  thus avoid the bug
2006-06-27 10:02:58 +02:00
stewart@mysql.com
78dd9d12bb BUG#11459 ndb status variables not updated
change names of some undocumented ndb status variables to better reflect what
their values mean
2006-06-26 23:31:10 +10:00
jonas@perch.ndb.mysql.com
33339fdf40 ndb - bug#20053
make sure we can only drop files from correct file group
2006-06-26 15:08:09 +02:00
jonas@perch.ndb.mysql.com
50b8eb8538 Merge perch.ndb.mysql.com:/home/jonas/src/mysql-5.1-new
into  perch.ndb.mysql.com:/home/jonas/src/mysql-5.1-new-ndb
2006-06-26 10:02:03 +02:00
knielsen@rt.int.sifira.dk
4966090d3f Merge mysql.com:/usr/local/mysql/mysql-5.1-vg-apr2
into  mysql.com:/usr/local/mysql/tmp-5.1
2006-06-23 15:05:15 +02:00
monty@mysql.com
649157954b Fixed failure with rpl_truncate_7ndb.test when using statement based replication.
is_injective -> table_flag() HA_HAS_OWN_BINLOGGING
(Faster and easier to understand)
Allow cluster_binlogging also in mixed replication mode.
2006-06-22 22:44:21 +03:00
jonas@perch.ndb.mysql.com
f618c9ed8f Merge perch.ndb.mysql.com:/home/jonas/src/51-work
into  perch.ndb.mysql.com:/home/jonas/src/mysql-5.1-new-ndb
2006-06-22 10:52:45 +02:00
jonas@perch.ndb.mysql.com
dc75269965 ndb - bug#16341
create tablespace/logfile group should "back out changes"
2006-06-22 10:24:44 +02:00
monty@narttu.mysql.fi
20c00662eb Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into  mysql.com:/home/my/mysql-5.1
2006-06-21 13:24:56 +03:00