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
50cfde53
Commit
50cfde53
authored
Nov 27, 2008
by
Tatiana A. Nurnberg
Browse files
Options
Browse Files
Download
Plain Diff
auto-merge
parents
57ead840
1182c097
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
113 additions
and
1 deletion
+113
-1
mysql-test/r/innodb_mysql.result
mysql-test/r/innodb_mysql.result
+6
-0
mysql-test/r/subselect.result
mysql-test/r/subselect.result
+30
-0
mysql-test/t/innodb_mysql.test
mysql-test/t/innodb_mysql.test
+11
-0
mysql-test/t/subselect.test
mysql-test/t/subselect.test
+35
-0
sql/mysql_priv.h
sql/mysql_priv.h
+1
-0
sql/sql_base.cc
sql/sql_base.cc
+3
-0
sql/sql_update.cc
sql/sql_update.cc
+26
-0
tests/mysql_client_test.c
tests/mysql_client_test.c
+1
-1
No files found.
mysql-test/r/innodb_mysql.result
View file @
50cfde53
...
...
@@ -1261,4 +1261,10 @@ a b c
5 1 1
4 1 1
DROP TABLE t1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a char(50)) ENGINE=InnoDB;
CREATE INDEX i1 on t1 (a(3));
SELECT * FROM t1 WHERE a = 'abcde';
a
DROP TABLE t1;
End of 5.0 tests
mysql-test/r/subselect.result
View file @
50cfde53
...
...
@@ -4422,4 +4422,34 @@ id
2
3
DROP TABLE t1, t2;
CREATE TABLE t1 (id int);
CREATE TABLE t2 (id int, c int);
INSERT INTO t1 (id) VALUES (1);
INSERT INTO t2 (id) VALUES (1);
INSERT INTO t1 (id) VALUES (1);
INSERT INTO t2 (id) VALUES (1);
CREATE VIEW v1 AS
SELECT t2.c AS c FROM t1, t2
WHERE t1.id=t2.id AND 1 IN (SELECT id FROM t1) WITH CHECK OPTION;
UPDATE v1 SET c=1;
CREATE VIEW v2 (a,b) AS
SELECT t2.id, t2.c AS c FROM t1, t2
WHERE t1.id=t2.id AND 1 IN (SELECT id FROM t1) WITH CHECK OPTION;
INSERT INTO v2(a,b) VALUES (2,2);
ERROR HY000: CHECK OPTION failed 'test.v2'
INSERT INTO v2(a,b) VALUES (1,2);
SELECT * FROM v1;
c
1
1
1
1
2
2
CREATE VIEW v3 AS
SELECT t2.c AS c FROM t2
WHERE 1 IN (SELECT id FROM t1) WITH CHECK OPTION;
DELETE FROM v3;
DROP VIEW v1,v2,v3;
DROP TABLE t1,t2;
End of 5.0 tests.
mysql-test/t/innodb_mysql.test
View file @
50cfde53
...
...
@@ -1014,4 +1014,15 @@ SELECT a, b, c FROM t1 WHERE b = 1 ORDER BY a DESC LIMIT 5;
DROP
TABLE
t1
;
#
# Bug#37284 Crash in Field_string::type()
#
--
disable_warnings
DROP
TABLE
IF
EXISTS
t1
;
--
enable_warnings
CREATE
TABLE
t1
(
a
char
(
50
))
ENGINE
=
InnoDB
;
CREATE
INDEX
i1
on
t1
(
a
(
3
));
SELECT
*
FROM
t1
WHERE
a
=
'abcde'
;
DROP
TABLE
t1
;
--
echo
End
of
5.0
tests
mysql-test/t/subselect.test
View file @
50cfde53
...
...
@@ -3325,4 +3325,39 @@ INSERT INTO t2 VALUES (2,1),(3,1);
SELECT
*
FROM
t1
i
WHERE
1
IN
(
SELECT
l
.
id2
FROM
t2
l
WHERE
i
.
id
=
l
.
id1
);
DROP
TABLE
t1
,
t2
;
#
# Bug#37460 Assertion failed:
# !table->file || table->file->inited == handler::NONE
#
CREATE
TABLE
t1
(
id
int
);
CREATE
TABLE
t2
(
id
int
,
c
int
);
INSERT
INTO
t1
(
id
)
VALUES
(
1
);
INSERT
INTO
t2
(
id
)
VALUES
(
1
);
INSERT
INTO
t1
(
id
)
VALUES
(
1
);
INSERT
INTO
t2
(
id
)
VALUES
(
1
);
CREATE
VIEW
v1
AS
SELECT
t2
.
c
AS
c
FROM
t1
,
t2
WHERE
t1
.
id
=
t2
.
id
AND
1
IN
(
SELECT
id
FROM
t1
)
WITH
CHECK
OPTION
;
UPDATE
v1
SET
c
=
1
;
CREATE
VIEW
v2
(
a
,
b
)
AS
SELECT
t2
.
id
,
t2
.
c
AS
c
FROM
t1
,
t2
WHERE
t1
.
id
=
t2
.
id
AND
1
IN
(
SELECT
id
FROM
t1
)
WITH
CHECK
OPTION
;
--
error
1369
INSERT
INTO
v2
(
a
,
b
)
VALUES
(
2
,
2
);
INSERT
INTO
v2
(
a
,
b
)
VALUES
(
1
,
2
);
SELECT
*
FROM
v1
;
CREATE
VIEW
v3
AS
SELECT
t2
.
c
AS
c
FROM
t2
WHERE
1
IN
(
SELECT
id
FROM
t1
)
WITH
CHECK
OPTION
;
DELETE
FROM
v3
;
DROP
VIEW
v1
,
v2
,
v3
;
DROP
TABLE
t1
,
t2
;
--
echo
End
of
5.0
tests
.
sql/mysql_priv.h
View file @
50cfde53
...
...
@@ -435,6 +435,7 @@ MY_LOCALE *my_locale_by_number(uint number);
#define UNCACHEABLE_PREPARE 16
/* For uncorrelated SELECT in an UNION with some correlated SELECTs */
#define UNCACHEABLE_UNITED 32
#define UNCACHEABLE_CHECKOPTION 64
/* Used to check GROUP BY list in the MODE_ONLY_FULL_GROUP_BY mode */
#define UNDEF_POS (-1)
...
...
sql/sql_base.cc
View file @
50cfde53
...
...
@@ -2102,7 +2102,10 @@ bool reopen_table(TABLE *table,bool locked)
for
(
key
=
0
;
key
<
table
->
s
->
keys
;
key
++
)
{
for
(
part
=
0
;
part
<
table
->
key_info
[
key
].
usable_key_parts
;
part
++
)
{
table
->
key_info
[
key
].
key_part
[
part
].
field
->
table
=
table
;
table
->
key_info
[
key
].
key_part
[
part
].
field
->
orig_table
=
table
;
}
}
if
(
table
->
triggers
)
table
->
triggers
->
set_table
(
table
);
...
...
sql/sql_update.cc
View file @
50cfde53
...
...
@@ -1249,6 +1249,32 @@ multi_update::initialize_tables(JOIN *join)
}
}
/*
enable uncacheable flag if we update a view with check option
and check option has a subselect, otherwise, the check option
can be evaluated after the subselect was freed as independent
(See full_local in JOIN::join_free()).
*/
if
(
table_ref
->
check_option
&&
!
join
->
select_lex
->
uncacheable
)
{
SELECT_LEX_UNIT
*
tmp_unit
;
SELECT_LEX
*
sl
;
for
(
tmp_unit
=
join
->
select_lex
->
first_inner_unit
();
tmp_unit
;
tmp_unit
=
tmp_unit
->
next_unit
())
{
for
(
sl
=
tmp_unit
->
first_select
();
sl
;
sl
=
sl
->
next_select
())
{
if
(
sl
->
master_unit
()
->
item
)
{
join
->
select_lex
->
uncacheable
|=
UNCACHEABLE_CHECKOPTION
;
goto
loop_end
;
}
}
}
}
loop_end:
if
(
table
==
first_table_for_update
&&
table_ref
->
check_option
)
{
table_map
unupdated_tables
=
table_ref
->
check_option
->
used_tables
()
&
...
...
tests/mysql_client_test.c
View file @
50cfde53
...
...
@@ -16220,7 +16220,7 @@ static void test_bug38486(void)
static
void
test_bug40365
(
void
)
{
uint
rc
,
i
,
count
=
1
;
uint
rc
,
i
;
MYSQL_STMT
*
stmt
=
0
;
MYSQL_BIND
my_bind
[
2
];
my_bool
is_null
[
2
]
=
{
0
};
...
...
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