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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
93875e07
Commit
93875e07
authored
Sep 30, 2005
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysqldev@production.mysql.com:my/mysql-5.0-release
into mysql.com:/Users/kent/mysql/bk/mysql-5.0-release
parents
8e7fe376
f69c1867
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
107 additions
and
53 deletions
+107
-53
mysql-test/r/innodb.result
mysql-test/r/innodb.result
+37
-18
mysql-test/t/innodb.test
mysql-test/t/innodb.test
+44
-13
sql/ha_berkeley.cc
sql/ha_berkeley.cc
+1
-1
sql/ha_berkeley.h
sql/ha_berkeley.h
+1
-1
sql/ha_innodb.cc
sql/ha_innodb.cc
+3
-2
sql/ha_innodb.h
sql/ha_innodb.h
+1
-1
sql/ha_ndbcluster.cc
sql/ha_ndbcluster.cc
+1
-1
sql/ha_ndbcluster.h
sql/ha_ndbcluster.h
+1
-1
sql/handler.h
sql/handler.h
+1
-1
sql/sql_base.cc
sql/sql_base.cc
+1
-1
sql/sql_view.cc
sql/sql_view.cc
+16
-13
No files found.
mysql-test/r/innodb.result
View file @
93875e07
...
...
@@ -2616,31 +2616,50 @@ SET FOREIGN_KEY_CHECKS=1;
INSERT INTO t2 VALUES(3);
ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test/t2`, CONSTRAINT `c1` FOREIGN KEY (`v`) REFERENCES `t1` (`id`))
DROP TABLE t2;
create table t
est_checksum
(a int not null) engine=innodb DEFAULT CHARSET=latin1;
insert into t
est_checksum
values (1),(2);
create table t
1
(a int not null) engine=innodb DEFAULT CHARSET=latin1;
insert into t
1
values (1),(2);
set autocommit=0;
checksum table t
est_checksum
;
checksum table t
1
;
Table Checksum
test.t
est_checksum
1531596814
insert into t
est_checksum
values(3);
checksum table t
est_checksum
;
test.t
1
1531596814
insert into t
1
values(3);
checksum table t
1
;
Table Checksum
test.t
est_checksum
2605035534
test.t
1
2605035534
commit;
checksum table t
est_checksum
;
checksum table t
1
;
Table Checksum
test.t
est_checksum
127268899
test.t
1
127268899
commit;
drop table t
est_checksum
;
create table t
est_checksum
(a int not null) engine=innodb DEFAULT CHARSET=latin1;
insert into t
est_checksum
values (1),(2);
drop table t
1
;
create table t
1
(a int not null) engine=innodb DEFAULT CHARSET=latin1;
insert into t
1
values (1),(2);
set autocommit=1;
checksum table t
est_checksum
;
checksum table t
1
;
Table Checksum
test.t
est_checksum
1531596814
test.t
1
1531596814
set autocommit=1;
insert into t
est_checksum
values(3);
checksum table t
est_checksum
;
insert into t
1
values(3);
checksum table t
1
;
Table Checksum
test.test_checksum 127268899
drop table test_checksum;
test.t1 127268899
drop table t1;
create table t1 (col1 integer primary key, col2 integer) engine=innodb;
insert t1 values (1,100);
create function f1 () returns integer begin
declare var1 int;
select col2 into var1 from t1 where col1=1 for update;
return var1;
end|
start transaction;
select f1();
f1()
100
update t1 set col2=0 where col1=1;
select * from t1;
col1 col2
1 100
rollback;
rollback;
drop table t1;
drop function f1;
mysql-test/t/innodb.test
View file @
93875e07
...
...
@@ -1571,36 +1571,67 @@ DROP TABLE t2;
connect
(
a
,
localhost
,
root
,,);
connect
(
b
,
localhost
,
root
,,);
connection
a
;
create
table
t
est_checksum
(
a
int
not
null
)
engine
=
innodb
DEFAULT
CHARSET
=
latin1
;
insert
into
t
est_checksum
values
(
1
),(
2
);
create
table
t
1
(
a
int
not
null
)
engine
=
innodb
DEFAULT
CHARSET
=
latin1
;
insert
into
t
1
values
(
1
),(
2
);
set
autocommit
=
0
;
checksum
table
t
est_checksum
;
checksum
table
t
1
;
connection
b
;
insert
into
t
est_checksum
values
(
3
);
insert
into
t
1
values
(
3
);
connection
a
;
#
# Here checksum should not see insert
#
checksum
table
t
est_checksum
;
checksum
table
t
1
;
connection
a
;
commit
;
checksum
table
t
est_checksum
;
checksum
table
t
1
;
commit
;
drop
table
t
est_checksum
;
drop
table
t
1
;
#
# autocommit = 1
#
connection
a
;
create
table
t
est_checksum
(
a
int
not
null
)
engine
=
innodb
DEFAULT
CHARSET
=
latin1
;
insert
into
t
est_checksum
values
(
1
),(
2
);
create
table
t
1
(
a
int
not
null
)
engine
=
innodb
DEFAULT
CHARSET
=
latin1
;
insert
into
t
1
values
(
1
),(
2
);
set
autocommit
=
1
;
checksum
table
t
est_checksum
;
checksum
table
t
1
;
connection
b
;
set
autocommit
=
1
;
insert
into
t
est_checksum
values
(
3
);
insert
into
t
1
values
(
3
);
connection
a
;
#
# Here checksum sees insert
#
checksum
table
test_checksum
;
drop
table
test_checksum
;
checksum
table
t1
;
drop
table
t1
;
#
# BUG#11238 - in prelocking mode SELECT .. FOR UPDATE is changed to
# non-blocking SELECT
#
create
table
t1
(
col1
integer
primary
key
,
col2
integer
)
engine
=
innodb
;
insert
t1
values
(
1
,
100
);
delimiter
|
;
create
function
f1
()
returns
integer
begin
declare
var1
int
;
select
col2
into
var1
from
t1
where
col1
=
1
for
update
;
return
var1
;
end
|
delimiter
;
|
start
transaction
;
select
f1
();
connection
b
;
send
update
t1
set
col2
=
0
where
col1
=
1
;
connection
default
;
select
*
from
t1
;
connection
a
;
rollback
;
connection
b
;
reap
;
rollback
;
connection
default
;
drop
table
t1
;
drop
function
f1
;
disconnect
a
;
disconnect
b
;
sql/ha_berkeley.cc
View file @
93875e07
...
...
@@ -1894,7 +1894,7 @@ int ha_berkeley::external_lock(THD *thd, int lock_type)
Under LOCK TABLES, each used tables will force a call to start_stmt.
*/
int
ha_berkeley
::
start_stmt
(
THD
*
thd
)
int
ha_berkeley
::
start_stmt
(
THD
*
thd
,
thr_lock_type
lock_type
)
{
int
error
=
0
;
DBUG_ENTER
(
"ha_berkeley::start_stmt"
);
...
...
sql/ha_berkeley.h
View file @
93875e07
...
...
@@ -124,7 +124,7 @@ class ha_berkeley: public handler
int
extra
(
enum
ha_extra_function
operation
);
int
reset
(
void
);
int
external_lock
(
THD
*
thd
,
int
lock_type
);
int
start_stmt
(
THD
*
thd
);
int
start_stmt
(
THD
*
thd
,
thr_lock_type
lock_type
);
void
position
(
byte
*
record
);
int
analyze
(
THD
*
thd
,
HA_CHECK_OPT
*
check_opt
);
int
optimize
(
THD
*
thd
,
HA_CHECK_OPT
*
check_opt
);
...
...
sql/ha_innodb.cc
View file @
93875e07
...
...
@@ -6000,7 +6000,8 @@ int
ha_innobase
::
start_stmt
(
/*====================*/
/* out: 0 or error code */
THD
*
thd
)
/* in: handle to the user thread */
THD
*
thd
,
/* in: handle to the user thread */
thr_lock_type
lock_type
)
{
row_prebuilt_t
*
prebuilt
=
(
row_prebuilt_t
*
)
innobase_prebuilt
;
trx_t
*
trx
;
...
...
@@ -6041,7 +6042,7 @@ ha_innobase::start_stmt(
}
else
{
if
(
trx
->
isolation_level
!=
TRX_ISO_SERIALIZABLE
&&
thd
->
lex
->
sql_command
==
SQLCOM_SELECT
&&
thd
->
lex
->
lock_option
==
TL_READ
)
{
&&
lock_type
==
TL_READ
)
{
/* For other than temporary tables, we obtain
no lock for consistent read (plain SELECT). */
...
...
sql/ha_innodb.h
View file @
93875e07
...
...
@@ -150,7 +150,7 @@ class ha_innobase: public handler
int
extra
(
enum
ha_extra_function
operation
);
int
external_lock
(
THD
*
thd
,
int
lock_type
);
int
transactional_table_lock
(
THD
*
thd
,
int
lock_type
);
int
start_stmt
(
THD
*
thd
);
int
start_stmt
(
THD
*
thd
,
thr_lock_type
lock_type
);
void
position
(
byte
*
record
);
ha_rows
records_in_range
(
uint
inx
,
key_range
*
min_key
,
key_range
...
...
sql/ha_ndbcluster.cc
View file @
93875e07
...
...
@@ -3401,7 +3401,7 @@ int ha_ndbcluster::external_lock(THD *thd, int lock_type)
startTransaction for each transaction/statement.
*/
int
ha_ndbcluster
::
start_stmt
(
THD
*
thd
)
int
ha_ndbcluster
::
start_stmt
(
THD
*
thd
,
thr_lock_type
lock_type
)
{
int
error
=
0
;
DBUG_ENTER
(
"start_stmt"
);
...
...
sql/ha_ndbcluster.h
View file @
93875e07
...
...
@@ -501,7 +501,7 @@ class ha_ndbcluster: public handler
int
extra
(
enum
ha_extra_function
operation
);
int
extra_opt
(
enum
ha_extra_function
operation
,
ulong
cache_size
);
int
external_lock
(
THD
*
thd
,
int
lock_type
);
int
start_stmt
(
THD
*
thd
);
int
start_stmt
(
THD
*
thd
,
thr_lock_type
lock_type
);
const
char
*
table_type
()
const
;
const
char
**
bas_ext
()
const
;
ulong
table_flags
(
void
)
const
;
...
...
sql/handler.h
View file @
93875e07
...
...
@@ -654,7 +654,7 @@ public:
virtual
int
reset
()
{
return
extra
(
HA_EXTRA_RESET
);
}
virtual
int
external_lock
(
THD
*
thd
,
int
lock_type
)
{
return
0
;
}
virtual
void
unlock_row
()
{}
virtual
int
start_stmt
(
THD
*
thd
)
{
return
0
;}
virtual
int
start_stmt
(
THD
*
thd
,
thr_lock_type
lock_type
)
{
return
0
;}
/*
This is called to delete all rows in a table
If the handler don't support this, then this function will
...
...
sql/sql_base.cc
View file @
93875e07
...
...
@@ -2148,7 +2148,7 @@ static bool check_lock_and_start_stmt(THD *thd, TABLE *table,
my_error
(
ER_TABLE_NOT_LOCKED_FOR_WRITE
,
MYF
(
0
),
table
->
alias
);
DBUG_RETURN
(
1
);
}
if
((
error
=
table
->
file
->
start_stmt
(
thd
)))
if
((
error
=
table
->
file
->
start_stmt
(
thd
,
lock_type
)))
{
table
->
file
->
print_error
(
error
,
MYF
(
0
));
DBUG_RETURN
(
1
);
...
...
sql/sql_view.cc
View file @
93875e07
...
...
@@ -482,8 +482,6 @@ err:
/* index of revision number in following table */
static
const
int
revision_number_position
=
8
;
/* index of source */
static
const
int
source_number_position
=
11
;
/* index of last required parameter for making view */
static
const
int
required_view_parameters
=
10
;
/* number of backups */
...
...
@@ -1414,17 +1412,27 @@ mysql_rename_view(THD *thd,
if
((
parser
=
sql_parse_prepare
(
&
pathstr
,
thd
->
mem_root
,
1
))
&&
is_equal
(
&
view_type
,
parser
->
type
()))
{
TABLE_LIST
view_def
;
char
dir_buff
[
FN_REFLEN
],
file_buff
[
FN_REFLEN
];
/*
To be PS-friendly we should either to restore state of
TABLE_LIST object pointed by 'view' after using it for
view definition parsing or use temporary 'view_def'
object for it.
*/
bzero
(
&
view_def
,
sizeof
(
view_def
));
view_def
.
timestamp
.
str
=
view_def
.
timestamp_buffer
;
view_def
.
view_suid
=
TRUE
;
/* get view definition and source */
if
(
mysql_make_view
(
parser
,
view
)
||
parser
->
parse
((
gptr
)
view
,
thd
->
mem_root
,
view_parameters
+
source_number_position
,
1
))
if
(
parser
->
parse
((
gptr
)
&
view_def
,
thd
->
mem_root
,
view_parameters
,
sizeof
(
view_parameters
)
/
sizeof
(
view_parameters
[
0
])
-
1
))
goto
err
;
/* rename view and it's backups */
if
(
rename_in_schema_file
(
view
->
db
,
view
->
table_name
,
new_name
,
view
->
revision
-
1
,
num_view_backups
))
view
_def
.
revision
-
1
,
num_view_backups
))
goto
err
;
strxnmov
(
dir_buff
,
FN_REFLEN
,
mysql_data_home
,
"/"
,
view
->
db
,
"/"
,
NullS
);
...
...
@@ -1438,12 +1446,12 @@ mysql_rename_view(THD *thd,
-
file_buff
);
if
(
sql_create_definition_file
(
&
pathstr
,
&
file
,
view_file_type
,
(
gptr
)
view
,
view_parameters
,
(
gptr
)
&
view_def
,
view_parameters
,
num_view_backups
))
{
/* restore renamed view in case of error */
rename_in_schema_file
(
view
->
db
,
new_name
,
view
->
table_name
,
view
->
revision
-
1
,
num_view_backups
);
view_def
.
revision
-
1
,
num_view_backups
);
goto
err
;
}
}
else
...
...
@@ -1455,10 +1463,5 @@ mysql_rename_view(THD *thd,
error
=
FALSE
;
err:
/*
We have to explicitly call destructor for view's LEX since it won't
be called otherwise.
*/
delete
view
->
view
;
DBUG_RETURN
(
error
);
}
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