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
30a0ad3a
Commit
30a0ad3a
authored
Jun 22, 2005
by
evgen@moonbone.local
Browse files
Options
Browse Files
Download
Plain Diff
Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0
into moonbone.local:/work/mysql-5.0-bug-11298
parents
93d0763b
5097c682
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
50 additions
and
2 deletions
+50
-2
mysql-test/r/view.result
mysql-test/r/view.result
+14
-0
mysql-test/t/view.test
mysql-test/t/view.test
+13
-0
sql/item.cc
sql/item.cc
+22
-0
sql/item.h
sql/item.h
+1
-2
No files found.
mysql-test/r/view.result
View file @
30a0ad3a
...
@@ -1757,6 +1757,20 @@ select * from v1;
...
@@ -1757,6 +1757,20 @@ select * from v1;
cast(1 as decimal)
cast(1 as decimal)
1.00
1.00
drop view v1;
drop view v1;
create table t1(f1 int);
create table t2(f2 int);
insert into t1 values(1),(2),(3);
insert into t2 values(1),(2),(3);
create view v1 as select * from t1,t2 where f1=f2;
create table t3 (f1 int, f2 int);
insert into t3 select * from v1 order by 1;
select * from t3;
f1 f2
1 1
2 2
3 3
drop view v1;
drop table t1,t2,t3;
create view v1 as select '\\','\\shazam';
create view v1 as select '\\','\\shazam';
select * from v1;
select * from v1;
\ \shazam
\ \shazam
...
...
mysql-test/t/view.test
View file @
30a0ad3a
...
@@ -1599,6 +1599,19 @@ drop table t1;
...
@@ -1599,6 +1599,19 @@ drop table t1;
create
view
v1
as
select
cast
(
1
as
decimal
);
create
view
v1
as
select
cast
(
1
as
decimal
);
select
*
from
v1
;
select
*
from
v1
;
drop
view
v1
;
drop
view
v1
;
#
# Bug#11298 insert into select from VIEW produces incorrect result when
# using ORDER BY
create
table
t1
(
f1
int
);
create
table
t2
(
f2
int
);
insert
into
t1
values
(
1
),(
2
),(
3
);
insert
into
t2
values
(
1
),(
2
),(
3
);
create
view
v1
as
select
*
from
t1
,
t2
where
f1
=
f2
;
create
table
t3
(
f1
int
,
f2
int
);
insert
into
t3
select
*
from
v1
order
by
1
;
select
*
from
t3
;
drop
view
v1
;
drop
table
t1
,
t2
,
t3
;
#
#
# Generation unique names for columns, and correct names check (BUG#7448)
# Generation unique names for columns, and correct names check (BUG#7448)
...
...
sql/item.cc
View file @
30a0ad3a
...
@@ -4361,6 +4361,28 @@ my_decimal *Item_ref::val_decimal(my_decimal *decimal_value)
...
@@ -4361,6 +4361,28 @@ my_decimal *Item_ref::val_decimal(my_decimal *decimal_value)
return
val
;
return
val
;
}
}
int
Item_ref
::
save_in_field
(
Field
*
to
,
bool
no_conversions
)
{
int
res
;
if
(
result_field
){
if
(
result_field
->
is_null
())
{
null_value
=
1
;
return
set_field_to_null_with_conversions
(
to
,
no_conversions
);
}
else
{
to
->
set_notnull
();
field_conv
(
to
,
result_field
);
null_value
=
0
;
}
return
0
;
}
res
=
(
*
ref
)
->
save_in_field
(
to
,
no_conversions
);
null_value
=
(
*
ref
)
->
null_value
;
return
res
;
}
void
Item_ref_null_helper
::
print
(
String
*
str
)
void
Item_ref_null_helper
::
print
(
String
*
str
)
{
{
...
...
sql/item.h
View file @
30a0ad3a
...
@@ -1345,8 +1345,7 @@ public:
...
@@ -1345,8 +1345,7 @@ public:
bool
send
(
Protocol
*
prot
,
String
*
tmp
);
bool
send
(
Protocol
*
prot
,
String
*
tmp
);
void
make_field
(
Send_field
*
field
)
{
(
*
ref
)
->
make_field
(
field
);
}
void
make_field
(
Send_field
*
field
)
{
(
*
ref
)
->
make_field
(
field
);
}
bool
fix_fields
(
THD
*
,
struct
st_table_list
*
,
Item
**
);
bool
fix_fields
(
THD
*
,
struct
st_table_list
*
,
Item
**
);
int
save_in_field
(
Field
*
field
,
bool
no_conversions
)
int
save_in_field
(
Field
*
field
,
bool
no_conversions
);
{
return
(
*
ref
)
->
save_in_field
(
field
,
no_conversions
);
}
void
save_org_in_field
(
Field
*
field
)
{
(
*
ref
)
->
save_org_in_field
(
field
);
}
void
save_org_in_field
(
Field
*
field
)
{
(
*
ref
)
->
save_org_in_field
(
field
);
}
enum
Item_result
result_type
()
const
{
return
(
*
ref
)
->
result_type
();
}
enum
Item_result
result_type
()
const
{
return
(
*
ref
)
->
result_type
();
}
enum_field_types
field_type
()
const
{
return
(
*
ref
)
->
field_type
();
}
enum_field_types
field_type
()
const
{
return
(
*
ref
)
->
field_type
();
}
...
...
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