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
e0b0c5c9
Commit
e0b0c5c9
authored
Jul 12, 2005
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-5.0
into igor-inspiron.creware.com:/home/igor/mysql-5.0
parents
584d8e7b
eeeacce0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
0 deletions
+43
-0
mysql-test/r/view.result
mysql-test/r/view.result
+14
-0
mysql-test/t/view.test
mysql-test/t/view.test
+15
-0
sql/item.h
sql/item.h
+8
-0
sql/sql_base.cc
sql/sql_base.cc
+6
-0
No files found.
mysql-test/r/view.result
View file @
e0b0c5c9
...
@@ -1940,3 +1940,17 @@ s1 s2
...
@@ -1940,3 +1940,17 @@ s1 s2
DROP PROCEDURE p1;
DROP PROCEDURE p1;
DROP VIEW v1;
DROP VIEW v1;
DROP TABLE t1;
DROP TABLE t1;
CREATE TABLE t1 (f1 char) ENGINE = innodb;
INSERT INTO t1 VALUES ('A');
CREATE VIEW v1 AS SELECT * FROM t1;
INSERT INTO t1 VALUES('B');
SELECT * FROM v1;
f1
A
B
SELECT * FROM t1;
f1
A
B
DROP VIEW v1;
DROP TABLE t1;
mysql-test/t/view.test
View file @
e0b0c5c9
...
@@ -1778,3 +1778,18 @@ CALL p1();
...
@@ -1778,3 +1778,18 @@ CALL p1();
DROP
PROCEDURE
p1
;
DROP
PROCEDURE
p1
;
DROP
VIEW
v1
;
DROP
VIEW
v1
;
DROP
TABLE
t1
;
DROP
TABLE
t1
;
#
# Test for bug #11771: wrong query_id in SELECT * FROM <view>
#
CREATE
TABLE
t1
(
f1
char
)
ENGINE
=
innodb
;
INSERT
INTO
t1
VALUES
(
'A'
);
CREATE
VIEW
v1
AS
SELECT
*
FROM
t1
;
INSERT
INTO
t1
VALUES
(
'B'
);
SELECT
*
FROM
v1
;
SELECT
*
FROM
t1
;
DROP
VIEW
v1
;
DROP
TABLE
t1
;
sql/item.h
View file @
e0b0c5c9
...
@@ -641,6 +641,7 @@ class Item {
...
@@ -641,6 +641,7 @@ class Item {
virtual
bool
cleanup_processor
(
byte
*
arg
);
virtual
bool
cleanup_processor
(
byte
*
arg
);
virtual
bool
collect_item_field_processor
(
byte
*
arg
)
{
return
0
;
}
virtual
bool
collect_item_field_processor
(
byte
*
arg
)
{
return
0
;
}
virtual
bool
change_context_processor
(
byte
*
context
)
{
return
0
;
}
virtual
bool
change_context_processor
(
byte
*
context
)
{
return
0
;
}
virtual
bool
reset_query_id_processor
(
byte
*
query_id
)
{
return
0
;
}
virtual
Item
*
equal_fields_propagator
(
byte
*
arg
)
{
return
this
;
}
virtual
Item
*
equal_fields_propagator
(
byte
*
arg
)
{
return
this
;
}
virtual
Item
*
set_no_const_sub
(
byte
*
arg
)
{
return
this
;
}
virtual
Item
*
set_no_const_sub
(
byte
*
arg
)
{
return
this
;
}
...
@@ -895,6 +896,13 @@ class Item_field :public Item_ident
...
@@ -895,6 +896,13 @@ class Item_field :public Item_ident
bool
is_null
()
{
return
field
->
is_null
();
}
bool
is_null
()
{
return
field
->
is_null
();
}
Item
*
get_tmp_table_item
(
THD
*
thd
);
Item
*
get_tmp_table_item
(
THD
*
thd
);
bool
collect_item_field_processor
(
byte
*
arg
);
bool
collect_item_field_processor
(
byte
*
arg
);
bool
reset_query_id_processor
(
byte
*
arg
)
{
field
->
query_id
=
*
((
query_id_t
*
)
arg
);
if
(
result_field
)
result_field
->
query_id
=
field
->
query_id
;
return
0
;
}
void
cleanup
();
void
cleanup
();
Item_equal
*
find_item_equal
(
COND_EQUAL
*
cond_equal
);
Item_equal
*
find_item_equal
(
COND_EQUAL
*
cond_equal
);
Item
*
equal_fields_propagator
(
byte
*
arg
);
Item
*
equal_fields_propagator
(
byte
*
arg
);
...
...
sql/sql_base.cc
View file @
e0b0c5c9
...
@@ -3495,6 +3495,12 @@ insert_fields(THD *thd, Name_resolution_context *context, const char *db_name,
...
@@ -3495,6 +3495,12 @@ insert_fields(THD *thd, Name_resolution_context *context, const char *db_name,
field
->
query_id
=
thd
->
query_id
;
field
->
query_id
=
thd
->
query_id
;
table
->
used_keys
.
intersect
(
field
->
part_of_key
);
table
->
used_keys
.
intersect
(
field
->
part_of_key
);
}
}
else
{
Item
*
item
=
((
Field_iterator_view
*
)
iterator
)
->
item
();
item
->
walk
(
&
Item
::
reset_query_id_processor
,
(
byte
*
)(
&
thd
->
query_id
));
}
}
}
/*
/*
All fields are used in case if usual tables (in case of view used
All fields are used in case if usual tables (in case of view used
...
...
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