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
233e68e2
Commit
233e68e2
authored
Oct 03, 2005
by
timour@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/home/timka/mysql/src/5.0-virgin
into mysql.com:/home/timka/mysql/src/5.0-bug-13410
parents
6728bc92
77cf8418
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
18 additions
and
22 deletions
+18
-22
mysql-test/r/view.result
mysql-test/r/view.result
+10
-0
mysql-test/t/view.test
mysql-test/t/view.test
+2
-0
sql/item.cc
sql/item.cc
+2
-2
sql/item.h
sql/item.h
+1
-1
sql/sql_base.cc
sql/sql_base.cc
+2
-2
sql/table.cc
sql/table.cc
+1
-17
No files found.
mysql-test/r/view.result
View file @
233e68e2
...
...
@@ -2286,5 +2286,15 @@ SELECT v1.a FROM v1 GROUP BY v1.a HAVING v1.a > 1;
a
2
3
SELECT t_1.a FROM t1 AS t_1 GROUP BY t_1.a HAVING t_1.a IN (1,2,3);
a
1
2
3
SELECT v_1.a FROM v1 AS v_1 GROUP BY v_1.a HAVING v_1.a IN (1,2,3);
a
1
2
3
DROP VIEW v1;
DROP TABLE t1;
mysql-test/t/view.test
View file @
233e68e2
...
...
@@ -2162,6 +2162,8 @@ INSERT INTO t1 VALUES (1,1),(2,2),(3,3);
CREATE
VIEW
v1
AS
SELECT
a
,
b
FROM
t1
;
SELECT
t1
.
a
FROM
t1
GROUP
BY
t1
.
a
HAVING
t1
.
a
>
1
;
SELECT
v1
.
a
FROM
v1
GROUP
BY
v1
.
a
HAVING
v1
.
a
>
1
;
SELECT
t_1
.
a
FROM
t1
AS
t_1
GROUP
BY
t_1
.
a
HAVING
t_1
.
a
IN
(
1
,
2
,
3
);
SELECT
v_1
.
a
FROM
v1
AS
v_1
GROUP
BY
v_1
.
a
HAVING
v_1
.
a
IN
(
1
,
2
,
3
);
DROP
VIEW
v1
;
DROP
TABLE
t1
;
sql/item.cc
View file @
233e68e2
...
...
@@ -2973,7 +2973,7 @@ static Item** find_field_in_group_list(Item *find_item, ORDER *group_list)
const
char
*
field_name
;
ORDER
*
found_group
=
NULL
;
int
found_match_degree
=
0
;
Item_
field
*
cur_field
;
Item_
ident
*
cur_field
;
int
cur_match_degree
=
0
;
if
(
find_item
->
type
()
==
Item
::
FIELD_ITEM
||
...
...
@@ -2992,7 +2992,7 @@ static Item** find_field_in_group_list(Item *find_item, ORDER *group_list)
{
if
((
*
(
cur_group
->
item
))
->
real_item
()
->
type
()
==
Item
::
FIELD_ITEM
)
{
cur_field
=
(
Item_
field
*
)
*
cur_group
->
item
;
cur_field
=
(
Item_
ident
*
)
*
cur_group
->
item
;
cur_match_degree
=
0
;
DBUG_ASSERT
(
cur_field
->
field_name
!=
0
);
...
...
sql/item.h
View file @
233e68e2
...
...
@@ -1622,7 +1622,7 @@ class Item_ref :public Item_ident
}
Item
*
real_item
()
{
return
(
*
ref
)
->
real_item
()
;
return
(
ref
&&
*
ref
)
?
(
*
ref
)
->
real_item
()
:
this
;
}
bool
walk
(
Item_processor
processor
,
byte
*
arg
)
{
return
(
*
ref
)
->
walk
(
processor
,
arg
);
}
...
...
sql/sql_base.cc
View file @
233e68e2
...
...
@@ -3353,9 +3353,9 @@ find_item_in_list(Item *find, List<Item> &items, uint *counter,
for
(
uint
i
=
0
;
(
item
=
li
++
);
i
++
)
{
if
(
field_name
&&
item
->
type
()
==
Item
::
FIELD_ITEM
)
if
(
field_name
&&
item
->
real_item
()
->
type
()
==
Item
::
FIELD_ITEM
)
{
Item_
field
*
item_field
=
(
Item_field
*
)
item
;
Item_
ident
*
item_field
=
(
Item_ident
*
)
item
;
/*
In case of group_concat() with ORDER BY condition in the QUERY
...
...
sql/table.cc
View file @
233e68e2
...
...
@@ -2426,22 +2426,6 @@ Field *Natural_join_column::field()
const
char
*
Natural_join_column
::
table_name
()
{
return
table_ref
->
alias
;
/*
TODO:
I think that it is sufficient to return just
table->alias, which is correctly set to either
the view name, the table name, or the alias to
the table reference (view or stored table).
*/
#ifdef NOT_YET
if
(
view_field
)
return
table_ref
->
view_name
.
str
;
DBUG_ASSERT
(
!
strcmp
(
table_ref
->
table_name
,
table_ref
->
table
->
s
->
table_name
));
return
table_ref
->
table_name
;
}
#endif
}
...
...
@@ -2577,7 +2561,7 @@ Item *create_view_field(THD *thd, TABLE_LIST *view, Item **field_ref,
DBUG_RETURN
(
field
);
}
Item
*
item
=
new
Item_direct_view_ref
(
&
view
->
view
->
select_lex
.
context
,
field_ref
,
view
->
view_name
.
str
,
field_ref
,
view
->
alias
,
name
);
DBUG_RETURN
(
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