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
2568c2cf
Commit
2568c2cf
authored
Mar 27, 2006
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-5.0
into rurik.mysql.com:/home/igor/mysql-5.0
parents
4faee665
b0654461
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
7 deletions
+27
-7
mysql-test/r/view.result
mysql-test/r/view.result
+9
-0
mysql-test/t/view.test
mysql-test/t/view.test
+14
-0
sql/item.cc
sql/item.cc
+4
-7
No files found.
mysql-test/r/view.result
View file @
2568c2cf
...
...
@@ -2553,3 +2553,12 @@ a b
3 3
drop view v2, v1;
drop table t1;
CREATE TABLE t1 (a int);
INSERT INTO t1 VALUES (1), (2);
CREATE VIEW v1 AS SELECT SQRT(a) my_sqrt FROM t1;
SELECT my_sqrt FROM v1 ORDER BY my_sqrt;
my_sqrt
1
1.4142135623731
DROP VIEW v1;
DROP TABLE t1;
mysql-test/t/view.test
View file @
2568c2cf
...
...
@@ -2399,3 +2399,17 @@ update v2 set b=3 where a=2;
select
*
from
v2
;
drop
view
v2
,
v1
;
drop
table
t1
;
#
# Bug #18386: select from view over a table with ORDER BY view_col clause
# given view_col is not an image of any column from the base table
CREATE
TABLE
t1
(
a
int
);
INSERT
INTO
t1
VALUES
(
1
),
(
2
);
CREATE
VIEW
v1
AS
SELECT
SQRT
(
a
)
my_sqrt
FROM
t1
;
SELECT
my_sqrt
FROM
v1
ORDER
BY
my_sqrt
;
DROP
VIEW
v1
;
DROP
TABLE
t1
;
sql/item.cc
View file @
2568c2cf
...
...
@@ -5076,11 +5076,8 @@ bool Item_direct_view_ref::fix_fields(THD *thd, Item **reference)
DESCRIPTION
A view column reference is considered equal to another column
reference if the second one is a view column and if both column
references point to the same field. For views 'same field' means
the same Item_field object in the view translation table, where
the view translation table contains all result columns of the
view. This definition ensures that view columns are resolved
in the same manner as table columns.
references resolve to the same item. It is assumed that both
items are of the same type.
RETURN
TRUE Referenced item is equal to given item
...
...
@@ -5096,8 +5093,8 @@ bool Item_direct_view_ref::eq(const Item *item, bool binary_cmp) const
if
(
item_ref
->
ref_type
()
==
VIEW_REF
)
{
Item
*
item_ref_ref
=
*
(
item_ref
->
ref
);
DBUG_ASSERT
((
*
ref
)
->
real_item
()
->
type
()
==
FIELD_ITEM
&&
(
item_ref_ref
->
real_item
()
->
type
()
==
FIELD_ITEM
));
DBUG_ASSERT
((
*
ref
)
->
real_item
()
->
type
()
==
item_ref_ref
->
real_item
()
->
type
(
));
return
((
*
ref
)
->
real_item
()
==
item_ref_ref
->
real_item
());
}
}
...
...
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