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
ac07828b
Commit
ac07828b
authored
Jan 23, 2007
by
tsmith@quadxeon.mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge
bk://localhost:5556
into quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/maint/51
parents
ca99aa70
d71ae463
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
74 additions
and
39 deletions
+74
-39
mysql-test/r/innodb.result
mysql-test/r/innodb.result
+17
-0
mysql-test/t/innodb.test
mysql-test/t/innodb.test
+16
-0
storage/innobase/buf/buf0flu.c
storage/innobase/buf/buf0flu.c
+1
-2
storage/innobase/dict/dict0load.c
storage/innobase/dict/dict0load.c
+5
-4
storage/innobase/include/ut0ut.h
storage/innobase/include/ut0ut.h
+2
-1
storage/innobase/que/que0que.c
storage/innobase/que/que0que.c
+33
-32
No files found.
mysql-test/r/innodb.result
View file @
ac07828b
...
...
@@ -3456,3 +3456,20 @@ OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
DROP TABLE t1;
CREATE TABLE t1 (id int PRIMARY KEY, f int NOT NULL, INDEX(f)) ENGINE=InnoDB;
CREATE TABLE t2 (id int PRIMARY KEY, f INT NOT NULL,
CONSTRAINT t2_t1 FOREIGN KEY (id) REFERENCES t1 (id)
ON DELETE CASCADE ON UPDATE CASCADE) ENGINE=InnoDB;
ALTER TABLE t2 ADD FOREIGN KEY (f) REFERENCES t1 (f) ON
DELETE CASCADE ON UPDATE CASCADE;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`id` int(11) NOT NULL,
`f` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `f` (`f`),
CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`f`) REFERENCES `t1` (`f`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `t2_t1` FOREIGN KEY (`id`) REFERENCES `t1` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
)
ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t2, t1;
mysql-test/t/innodb.test
View file @
ac07828b
...
...
@@ -2504,6 +2504,22 @@ INSERT INTO t1 VALUES (1);
OPTIMIZE
TABLE
t1
;
DROP
TABLE
t1
;
#
# Bug #24741 (existing cascade clauses disappear when adding foreign keys)
#
CREATE
TABLE
t1
(
id
int
PRIMARY
KEY
,
f
int
NOT
NULL
,
INDEX
(
f
))
ENGINE
=
InnoDB
;
CREATE
TABLE
t2
(
id
int
PRIMARY
KEY
,
f
INT
NOT
NULL
,
CONSTRAINT
t2_t1
FOREIGN
KEY
(
id
)
REFERENCES
t1
(
id
)
ON
DELETE
CASCADE
ON
UPDATE
CASCADE
)
ENGINE
=
InnoDB
;
ALTER
TABLE
t2
ADD
FOREIGN
KEY
(
f
)
REFERENCES
t1
(
f
)
ON
DELETE
CASCADE
ON
UPDATE
CASCADE
;
SHOW
CREATE
TABLE
t2
;
DROP
TABLE
t2
,
t1
;
#######################################################################
# #
# Please, DO NOT TOUCH this file as well as the innodb.result file. #
...
...
storage/innobase/buf/buf0flu.c
View file @
ac07828b
...
...
@@ -977,8 +977,7 @@ buf_flush_batch(
}
#endif
/* UNIV_DEBUG */
if
(
page_count
!=
ULINT_UNDEFINED
)
srv_buf_pool_flushed
+=
page_count
;
srv_buf_pool_flushed
+=
page_count
;
return
(
page_count
);
}
...
...
storage/innobase/dict/dict0load.c
View file @
ac07828b
...
...
@@ -1110,6 +1110,7 @@ dict_load_foreign(
rec_t
*
rec
;
byte
*
field
;
ulint
len
;
ulint
n_fields_and_type
;
mtr_t
mtr
;
#ifdef UNIV_SYNC_DEBUG
...
...
@@ -1172,15 +1173,15 @@ dict_load_foreign(
foreign
=
dict_mem_foreign_create
();
foreign
->
n_fields
=
mach_read_from_4
(
n_fields_and_type
=
mach_read_from_4
(
rec_get_nth_field_old
(
rec
,
5
,
&
len
));
ut_a
(
len
==
4
);
/* We store the type
to the bits 24-31 of n_fields
*/
/* We store the type
in the bits 24..29 of n_fields_and_type.
*/
foreign
->
type
=
foreign
->
n_fields
>>
24
;
foreign
->
n_fields
=
foreign
->
n_fields
&
0xFFFF
FFUL
;
foreign
->
type
=
n_fields_and_type
>>
24
;
foreign
->
n_fields
=
n_fields_and_type
&
0x3
FFUL
;
foreign
->
id
=
mem_heap_strdup
(
foreign
->
heap
,
id
);
...
...
storage/innobase/include/ut0ut.h
View file @
ac07828b
...
...
@@ -119,7 +119,8 @@ ulint
ut_2_power_up
(
/*==========*/
/* out: first power of 2 which is >= n */
ulint
n
);
/* in: number != 0 */
ulint
n
)
/* in: number != 0 */
__attribute__
((
const
));
/****************************************************************
Sort function for ulint arrays. */
...
...
storage/innobase/que/que0que.c
View file @
ac07828b
...
...
@@ -335,6 +335,8 @@ que_fork_start_command(
que_fork_t
*
fork
)
/* in: a query fork */
{
que_thr_t
*
thr
;
que_thr_t
*
suspended_thr
=
NULL
;
que_thr_t
*
completed_thr
=
NULL
;
fork
->
state
=
QUE_FORK_ACTIVE
;
...
...
@@ -344,14 +346,18 @@ que_fork_start_command(
but in a parallelized select, which necessarily is non-scrollable,
there may be several to choose from */
/*---------------------------------------------------------------
First we try to find a query thread in the QUE_THR_COMMAND_WAIT state
*/
/* First we try to find a query thread in the QUE_THR_COMMAND_WAIT
state. Then we try to find a query thread in the QUE_THR_SUSPENDED
state, finally we try to find a query thread in the QUE_THR_COMPLETED
state */
thr
=
UT_LIST_GET_FIRST
(
fork
->
thrs
);
while
(
thr
!=
NULL
)
{
if
(
thr
->
state
==
QUE_THR_COMMAND_WAIT
)
{
/* We make a single pass over the thr list within which we note which
threads are ready to run. */
while
(
thr
)
{
switch
(
thr
->
state
)
{
case
QUE_THR_COMMAND_WAIT
:
/* We have to send the initial message to query thread
to start it */
...
...
@@ -359,49 +365,44 @@ que_fork_start_command(
que_thr_init_command
(
thr
);
return
(
thr
);
}
ut_ad
(
thr
->
state
!=
QUE_THR_LOCK_WAIT
);
thr
=
UT_LIST_GET_NEXT
(
thrs
,
thr
);
case
QUE_THR_SUSPENDED
:
/* In this case the execution of the thread was
suspended: no initial message is needed because
execution can continue from where it was left */
if
(
!
suspended_thr
)
{
suspended_thr
=
thr
;
}
/*----------------------------------------------------------------
Then we try to find a query thread in the QUE_THR_SUSPENDED state */
break
;
thr
=
UT_LIST_GET_FIRST
(
fork
->
thrs
);
case
QUE_THR_COMPLETED
:
if
(
!
completed_thr
)
{
completed_thr
=
thr
;
}
while
(
thr
!=
NULL
)
{
if
(
thr
->
state
==
QUE_THR_SUSPENDED
)
{
/* In this case the execution of the thread was
suspended: no initial message is needed because
execution can continue from where it was left */
break
;
que_thr_move_to_run_state
(
thr
);
case
QUE_THR_LOCK_WAIT
:
ut_error
;
return
(
thr
);
}
thr
=
UT_LIST_GET_NEXT
(
thrs
,
thr
);
}
/*-----------------------------------------------------------------
Then we try to find a query thread in the QUE_THR_COMPLETED state */
thr
=
UT_LIST_GET_FIRST
(
fork
->
thrs
);
if
(
suspended_thr
)
{
while
(
thr
!=
NULL
)
{
if
(
thr
->
state
==
QUE_THR_COMPLETED
)
{
que_thr_init_command
(
thr
);
thr
=
suspended_thr
;
que_thr_move_to_run_state
(
thr
);
return
(
thr
);
}
}
else
if
(
completed_thr
)
{
thr
=
UT_LIST_GET_NEXT
(
thrs
,
thr
);
thr
=
completed_thr
;
que_thr_init_command
(
thr
);
}
/* Else we return NULL */
return
(
NULL
);
return
(
thr
);
}
/**************************************************************************
...
...
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