Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
857359e7
Commit
857359e7
authored
Jun 16, 2006
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/usr/home/ram/work/mysql-5.0
parents
05e78439
3f2ea5a4
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
82 additions
and
3 deletions
+82
-3
mysql-test/r/archive.result
mysql-test/r/archive.result
+2
-0
mysql-test/r/auto_increment.result
mysql-test/r/auto_increment.result
+22
-0
mysql-test/r/rpl_log.result
mysql-test/r/rpl_log.result
+17
-0
mysql-test/t/archive.test
mysql-test/t/archive.test
+2
-0
mysql-test/t/auto_increment.test
mysql-test/t/auto_increment.test
+17
-0
mysql-test/t/rpl_log.test
mysql-test/t/rpl_log.test
+14
-0
sql/ha_archive.cc
sql/ha_archive.cc
+1
-1
sql/item_func.cc
sql/item_func.cc
+1
-1
sql/sql_class.cc
sql/sql_class.cc
+4
-0
sql/sql_class.h
sql/sql_class.h
+2
-1
No files found.
mysql-test/r/archive.result
View file @
857359e7
...
...
@@ -6254,6 +6254,7 @@ auto fld1 companynr fld3 fld4 fld5 fld6
3 011402 37 Romans scholastics jarring
4 011403 37 intercepted audiology tinily
DELETE FROM t2;
ERROR HY000: Table storage engine for 't2' doesn't have this option
SELECT * FROM t2;
auto fld1 companynr fld3 fld4 fld5 fld6
1 000001 00 Omaha teethe neat
...
...
@@ -8685,6 +8686,7 @@ auto fld1 companynr fld3 fld4 fld5 fld6
3 011402 37 Romans scholastics jarring
4 011403 37 intercepted audiology tinily
TRUNCATE TABLE t2;
ERROR HY000: Table storage engine for 't2' doesn't have this option
SELECT * FROM t2;
auto fld1 companynr fld3 fld4 fld5 fld6
1 000001 00 Omaha teethe neat
...
...
mysql-test/r/auto_increment.result
View file @
857359e7
...
...
@@ -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);
...
...
mysql-test/r/rpl_log.result
View file @
857359e7
...
...
@@ -101,3 +101,20 @@ Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File
# 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 End_log_pos Info
slave-bin.000001 4 Format_desc 2 98 Server ver: VERSION, Binlog ver: 4
slave-bin.000001 98 Intvar 2 126 LAST_INSERT_ID=1
slave-bin.000001 126 Intvar 2 154 INSERT_ID=5
slave-bin.000001 154 Query 2 289 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;
mysql-test/t/archive.test
View file @
857359e7
...
...
@@ -1330,12 +1330,14 @@ SELECT * FROM t2;
#
# For bug #12836
# Delete was allowing all rows to be removed
--
error
1031
DELETE
FROM
t2
;
SELECT
*
FROM
t2
;
INSERT
INTO
t2
VALUES
(
2
,
011401
,
37
,
'breaking'
,
'dreaded'
,
'Steinberg'
,
'W'
);
INSERT
INTO
t2
VALUES
(
3
,
011402
,
37
,
'Romans'
,
'scholastics'
,
'jarring'
,
''
);
INSERT
INTO
t2
VALUES
(
4
,
011403
,
37
,
'intercepted'
,
'audiology'
,
'tinily'
,
''
);
SELECT
*
FROM
t2
;
--
error
1031
TRUNCATE
TABLE
t2
;
SELECT
*
FROM
t2
;
...
...
mysql-test/t/auto_increment.test
View file @
857359e7
...
...
@@ -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
#
...
...
mysql-test/t/rpl_log.test
View file @
857359e7
...
...
@@ -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
sql/ha_archive.cc
View file @
857359e7
...
...
@@ -1131,7 +1131,7 @@ int ha_archive::end_bulk_insert()
int
ha_archive
::
delete_all_rows
()
{
DBUG_ENTER
(
"ha_archive::delete_all_rows"
);
DBUG_RETURN
(
0
);
DBUG_RETURN
(
HA_ERR_WRONG_COMMAND
);
}
/*
...
...
sql/item_func.cc
View file @
857359e7
...
...
@@ -3296,7 +3296,7 @@ longlong Item_func_last_insert_id::val_int()
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 */
...
...
sql/sql_class.cc
View file @
857359e7
...
...
@@ -2050,7 +2050,9 @@ void THD::reset_sub_statement_state(Sub_statement_state *backup,
backup
->
enable_slow_log
=
enable_slow_log
;
backup
->
last_insert_id
=
last_insert_id
;
backup
->
next_insert_id
=
next_insert_id
;
backup
->
current_insert_id
=
current_insert_id
;
backup
->
insert_id_used
=
insert_id_used
;
backup
->
last_insert_id_used
=
last_insert_id_used
;
backup
->
clear_next_insert_id
=
clear_next_insert_id
;
backup
->
limit_found_rows
=
limit_found_rows
;
backup
->
examined_row_count
=
examined_row_count
;
...
...
@@ -2099,7 +2101,9 @@ void THD::restore_sub_statement_state(Sub_statement_state *backup)
enable_slow_log
=
backup
->
enable_slow_log
;
last_insert_id
=
backup
->
last_insert_id
;
next_insert_id
=
backup
->
next_insert_id
;
current_insert_id
=
backup
->
current_insert_id
;
insert_id_used
=
backup
->
insert_id_used
;
last_insert_id_used
=
backup
->
last_insert_id_used
;
clear_next_insert_id
=
backup
->
clear_next_insert_id
;
limit_found_rows
=
backup
->
limit_found_rows
;
sent_row_count
=
backup
->
sent_row_count
;
...
...
sql/sql_class.h
View file @
857359e7
...
...
@@ -1051,12 +1051,13 @@ class Sub_statement_state
{
public:
ulonglong
options
;
ulonglong
last_insert_id
,
next_insert_id
;
ulonglong
last_insert_id
,
next_insert_id
,
current_insert_id
;
ulonglong
limit_found_rows
;
ha_rows
cuted_fields
,
sent_row_count
,
examined_row_count
;
ulong
client_capabilities
;
uint
in_sub_stmt
;
bool
enable_slow_log
,
insert_id_used
,
clear_next_insert_id
;
bool
last_insert_id_used
;
my_bool
no_send_ok
;
SAVEPOINT
*
savepoints
;
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment