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
a5f063e0
Commit
a5f063e0
authored
Aug 25, 2004
by
bell@sanja.is.com.ua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
full text function moving to current select (BUG#4822)
parent
99f92a5c
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
0 deletions
+34
-0
mysql-test/r/view.result
mysql-test/r/view.result
+13
-0
mysql-test/t/view.test
mysql-test/t/view.test
+11
-0
sql/table.cc
sql/table.cc
+10
-0
No files found.
mysql-test/r/view.result
View file @
a5f063e0
...
@@ -1103,3 +1103,16 @@ create view mysqltest.v1 as select a from mysqltest.t1;
...
@@ -1103,3 +1103,16 @@ create view mysqltest.v1 as select a from mysqltest.t1;
alter view mysqltest.v1 as select b from mysqltest.t1;
alter view mysqltest.v1 as select b from mysqltest.t1;
alter view mysqltest.v1 as select a from mysqltest.t1;
alter view mysqltest.v1 as select a from mysqltest.t1;
drop database mysqltest;
drop database mysqltest;
CREATE TABLE t1 (c1 int not null auto_increment primary key, c2 varchar(20), fulltext(c2));
insert into t1 (c2) VALUES ('real Beer'),('Water'),('Kossu'),('Coca-Cola'),('Vodka'),('Wine'),('almost real Beer');
select * from t1 WHERE match (c2) against ('Beer');
c1 c2
1 real Beer
7 almost real Beer
CREATE VIEW v1 AS SELECT * from t1 WHERE match (c2) against ('Beer');
select * from v1;
c1 c2
1 real Beer
7 almost real Beer
drop view v1;
drop table t1;
mysql-test/t/view.test
View file @
a5f063e0
...
@@ -1055,3 +1055,14 @@ create view mysqltest.v1 as select a from mysqltest.t1;
...
@@ -1055,3 +1055,14 @@ create view mysqltest.v1 as select a from mysqltest.t1;
alter
view
mysqltest
.
v1
as
select
b
from
mysqltest
.
t1
;
alter
view
mysqltest
.
v1
as
select
b
from
mysqltest
.
t1
;
alter
view
mysqltest
.
v1
as
select
a
from
mysqltest
.
t1
;
alter
view
mysqltest
.
v1
as
select
a
from
mysqltest
.
t1
;
drop
database
mysqltest
;
drop
database
mysqltest
;
#
# VIEW with full text
#
CREATE
TABLE
t1
(
c1
int
not
null
auto_increment
primary
key
,
c2
varchar
(
20
),
fulltext
(
c2
));
insert
into
t1
(
c2
)
VALUES
(
'real Beer'
),(
'Water'
),(
'Kossu'
),(
'Coca-Cola'
),(
'Vodka'
),(
'Wine'
),(
'almost real Beer'
);
select
*
from
t1
WHERE
match
(
c2
)
against
(
'Beer'
);
CREATE
VIEW
v1
AS
SELECT
*
from
t1
WHERE
match
(
c2
)
against
(
'Beer'
);
select
*
from
v1
;
drop
view
v1
;
drop
table
t1
;
sql/table.cc
View file @
a5f063e0
...
@@ -1603,6 +1603,16 @@ bool st_table_list::setup_ancestor(THD *thd, Item **conds)
...
@@ -1603,6 +1603,16 @@ bool st_table_list::setup_ancestor(THD *thd, Item **conds)
thd
->
restore_backup_item_arena
(
arena
,
&
backup
);
thd
->
restore_backup_item_arena
(
arena
,
&
backup
);
}
}
/* full text function moving to current select */
if
(
view
->
select_lex
.
ftfunc_list
->
elements
)
{
Item_func_match
*
ifm
;
List_iterator_fast
<
Item_func_match
>
li
(
*
(
view
->
select_lex
.
ftfunc_list
));
while
((
ifm
=
li
++
))
current_select_save
->
ftfunc_list
->
push_front
(
ifm
);
}
ok:
ok:
thd
->
lex
->
select_lex
.
no_wrap_view_item
=
save_wrapper
;
thd
->
lex
->
select_lex
.
no_wrap_view_item
=
save_wrapper
;
thd
->
lex
->
current_select
=
current_select_save
;
thd
->
lex
->
current_select
=
current_select_save
;
...
...
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