Below is the list of changes that have just been committed into a local
5.0 repository of ram. When ram does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.2174 06/06/14 15:19:46 ramil@stripped +11 -0
Merge mysql.com:/usr/home/ram/work/mysql-4.1
into mysql.com:/usr/home/ram/work/mysql-5.0
sql/item_func.cc
1.288 06/06/14 15:19:39 ramil@stripped +1 -4
merging
configure.in
1.393 06/06/14 15:19:39 ramil@stripped +0 -0
merging
tests/mysql_client_test.c
1.185 06/06/14 15:16:34 ramil@stripped +0 -0
Auto merged
sql/sql_lex.cc
1.186 06/06/14 15:16:34 ramil@stripped +0 -0
Auto merged
mysql-test/t/rpl_log.test
1.29 06/06/14 15:16:34 ramil@stripped +0 -0
Auto merged
mysql-test/t/ndb_lock.test
1.12 06/06/14 15:16:34 ramil@stripped +0 -2
Auto merged
mysql-test/t/auto_increment.test
1.26 06/06/14 15:16:34 ramil@stripped +0 -0
Auto merged
mysql-test/r/rpl_log.result
1.64 06/06/14 15:16:34 ramil@stripped +0 -0
Auto merged
mysql-test/r/ndb_lock.result
1.10 06/06/14 15:16:33 ramil@stripped +0 -4
Auto merged
mysql-test/r/auto_increment.result
1.36 06/06/14 15:16:33 ramil@stripped +0 -0
Auto merged
mysql-test/mysql-test-run.pl
1.98 06/06/14 15:16:33 ramil@stripped +0 -0
Auto merged
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: ramil
# Host: myoffice.izhnet.ru
# Root: /usr/home/ram/work/mysql-5.0/RESYNC
--- 1.287/sql/item_func.cc 2006-05-18 01:51:53 +05:00
+++ 1.288/sql/item_func.cc 2006-06-14 15:19:39 +05:00
@@ -3288,6 +3288,7 @@ longlong Item_func_last_insert_id::val_i
{
THD *thd= current_thd;
DBUG_ASSERT(fixed == 1);
+ THD* thd= current_thd;
if (arg_count)
{
longlong value= args[0]->val_int();
@@ -3296,7 +3297,7 @@ longlong Item_func_last_insert_id::val_i
return value; // Avoid side effect of insert_id()
}
thd->lex->uncacheable(UNCACHEABLE_SIDEEFFECT);
- return thd->insert_id();
+ return thd->last_insert_id_used ? thd->current_insert_id : thd->insert_id();
}
/* This function is just used to test speed of different functions */
--- 1.35/mysql-test/r/auto_increment.result 2006-05-04 20:35:52 +05:00
+++ 1.36/mysql-test/r/auto_increment.result 2006-06-14 15:16:33 +05:00
@@ -378,6 +378,28 @@ t1 CREATE TABLE `t1` (
KEY `t1_name` (`t1_name`)
) ENGINE=MyISAM AUTO_INCREMENT=1003 DEFAULT CHARSET=latin1
DROP TABLE `t1`;
+create table t1(a int not null auto_increment primary key);
+create table t2(a int not null auto_increment primary key, t1a int);
+insert into t1 values(NULL);
+insert into t2 values (NULL, LAST_INSERT_ID()), (NULL, LAST_INSERT_ID());
+insert into t1 values (NULL);
+insert into t2 values (NULL, LAST_INSERT_ID()), (NULL, LAST_INSERT_ID()),
+(NULL, LAST_INSERT_ID());
+insert into t1 values (NULL);
+insert into t2 values (NULL, LAST_INSERT_ID()), (NULL, LAST_INSERT_ID()),
+(NULL, LAST_INSERT_ID()), (NULL, LAST_INSERT_ID());
+select * from t2;
+a t1a
+1 1
+2 1
+3 2
+4 2
+5 2
+6 3
+7 3
+8 3
+9 3
+drop table t1, t2;
End of 4.1 tests
CREATE TABLE t1 ( `a` int(11) NOT NULL auto_increment, `b` int(11) default NULL,PRIMARY KEY (`a`),UNIQUE KEY `b` (`b`));
insert into t1 (b) values (1);
--- 1.25/mysql-test/t/auto_increment.test 2006-05-04 20:35:52 +05:00
+++ 1.26/mysql-test/t/auto_increment.test 2006-06-14 15:16:34 +05:00
@@ -238,6 +238,23 @@ SHOW CREATE TABLE `t1`;
DROP TABLE `t1`;
+#
+# Bug #6880: LAST_INSERT_ID() within a statement
+#
+
+create table t1(a int not null auto_increment primary key);
+create table t2(a int not null auto_increment primary key, t1a int);
+insert into t1 values(NULL);
+insert into t2 values (NULL, LAST_INSERT_ID()), (NULL, LAST_INSERT_ID());
+insert into t1 values (NULL);
+insert into t2 values (NULL, LAST_INSERT_ID()), (NULL, LAST_INSERT_ID()),
+(NULL, LAST_INSERT_ID());
+insert into t1 values (NULL);
+insert into t2 values (NULL, LAST_INSERT_ID()), (NULL, LAST_INSERT_ID()),
+(NULL, LAST_INSERT_ID()), (NULL, LAST_INSERT_ID());
+select * from t2;
+drop table t1, t2;
+
--echo End of 4.1 tests
#
--- 1.63/mysql-test/r/rpl_log.result 2006-01-24 11:30:46 +04:00
+++ 1.64/mysql-test/r/rpl_log.result 2006-06-14 15:16:34 +05:00
@@ -101,3 +101,20 @@ Slave_IO_State Master_Host Master_User M
# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 510 # # master-bin.000002 Yes Yes 0 0 510 # None 0 No #
show binlog events in 'slave-bin.000005' from 4;
ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log
+create table t1(a int auto_increment primary key, b int);
+insert into t1 values (NULL, 1);
+reset master;
+set insert_id=5;
+insert into t1 values (NULL, last_insert_id()), (NULL, last_insert_id());
+show binlog events;
+Log_name Pos Event_type Server_id Orig_log_pos Info
+slave-bin.000001 4 Start 2 4 Server ver: VERSION, Binlog ver: 3
+slave-bin.000001 79 Intvar 2 79 LAST_INSERT_ID=1
+slave-bin.000001 107 Intvar 2 107 INSERT_ID=5
+slave-bin.000001 135 Query 2 135 use `test`; insert into t1 values (NULL, last_insert_id()), (NULL, last_insert_id())
+select * from t1;
+a b
+1 1
+5 1
+6 1
+drop table t1;
--- 1.28/mysql-test/t/rpl_log.test 2006-01-24 11:30:49 +04:00
+++ 1.29/mysql-test/t/rpl_log.test 2006-06-14 15:16:34 +05:00
@@ -109,5 +109,19 @@ show slave status;
--error 1220
show binlog events in 'slave-bin.000005' from 4;
+#
+# Bug #6880: LAST_INSERT_ID() within a statement
+#
+
+create table t1(a int auto_increment primary key, b int);
+insert into t1 values (NULL, 1);
+reset master;
+set insert_id=5;
+insert into t1 values (NULL, last_insert_id()), (NULL, last_insert_id());
+--replace_result $VERSION VERSION
+show binlog events;
+select * from t1;
+drop table t1;
+
# End of 4.1 tests
# Adding comment for force manual merge 5.0 -> wl1012: Delete me
| Thread |
|---|
| • bk commit into 5.0 tree (ramil:1.2174) | ramil | 14 Jun |