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
1a2ca44e
Commit
1a2ca44e
authored
Mar 29, 2007
by
gkodinov/kgeorge@magare.gmz
Browse files
Options
Browse Files
Download
Plain Diff
Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into magare.gmz:/home/kgeorge/mysql/autopush/B27300-5.0-opt
parents
adc07255
c3eb3f70
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
32 additions
and
12 deletions
+32
-12
mysql-test/r/gis.result
mysql-test/r/gis.result
+11
-0
mysql-test/r/subselect3.result
mysql-test/r/subselect3.result
+0
-6
mysql-test/t/gis.test
mysql-test/t/gis.test
+11
-0
mysql-test/t/subselect3.test
mysql-test/t/subselect3.test
+3
-2
sql/item.cc
sql/item.cc
+4
-1
sql/sql_select.cc
sql/sql_select.cc
+3
-3
No files found.
mysql-test/r/gis.result
View file @
1a2ca44e
...
...
@@ -769,3 +769,14 @@ create table t1 (g geometry not null);
insert into t1 values(default);
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
drop table t1;
CREATE TABLE t1 (a GEOMETRY);
CREATE VIEW v1 AS SELECT GeomFromwkb(ASBINARY(a)) FROM t1;
CREATE VIEW v2 AS SELECT a FROM t1;
DESCRIBE v1;
Field Type Null Key Default Extra
GeomFromwkb(ASBINARY(a)) geometry YES NULL
DESCRIBE v2;
Field Type Null Key Default Extra
a geometry YES NULL
DROP VIEW v1,v2;
DROP TABLE t1;
mysql-test/r/subselect3.result
View file @
1a2ca44e
...
...
@@ -661,12 +661,6 @@ SELECT * FROM t1 GROUP by t1.a
HAVING (MAX(t1.b) > (SELECT MAX(t2.b) FROM t2 WHERE t2.c < t1.c
HAVING MAX(t2.b+t1.a) < 10));
a b c
SELECT a, AVG(b), (SELECT t.c FROM t1 AS t WHERE t1.a=t.a AND t.b=AVG(t1.b))
AS test FROM t1 GROUP BY a;
a AVG(b) test
1 4.0000 NULL
2 2.0000 k
3 2.5000 NULL
SELECT a,b,c FROM t1 WHERE b in (9,3,4) ORDER BY b,c;
a b c
1 3 c
...
...
mysql-test/t/gis.test
View file @
1a2ca44e
...
...
@@ -479,3 +479,14 @@ create table t1 (g geometry not null);
insert
into
t1
values
(
default
);
drop
table
t1
;
#
# Bug #27300: create view with geometry functions lost columns types
#
CREATE
TABLE
t1
(
a
GEOMETRY
);
CREATE
VIEW
v1
AS
SELECT
GeomFromwkb
(
ASBINARY
(
a
))
FROM
t1
;
CREATE
VIEW
v2
AS
SELECT
a
FROM
t1
;
DESCRIBE
v1
;
DESCRIBE
v2
;
DROP
VIEW
v1
,
v2
;
DROP
TABLE
t1
;
mysql-test/t/subselect3.test
View file @
1a2ca44e
...
...
@@ -507,8 +507,9 @@ SELECT a, MAX(b), (SELECT t.c FROM t1 AS t WHERE t1.a=t.a AND t.b=MAX(t1.b))
SELECT
*
FROM
t1
GROUP
by
t1
.
a
HAVING
(
MAX
(
t1
.
b
)
>
(
SELECT
MAX
(
t2
.
b
)
FROM
t2
WHERE
t2
.
c
<
t1
.
c
HAVING
MAX
(
t2
.
b
+
t1
.
a
)
<
10
));
SELECT
a
,
AVG
(
b
),
(
SELECT
t
.
c
FROM
t1
AS
t
WHERE
t1
.
a
=
t
.
a
AND
t
.
b
=
AVG
(
t1
.
b
))
AS
test
FROM
t1
GROUP
BY
a
;
#FIXME: Enable this test after fixing bug #27321
#SELECT a, AVG(b), (SELECT t.c FROM t1 AS t WHERE t1.a=t.a AND t.b=AVG(t1.b))
# AS test FROM t1 GROUP BY a;
SELECT
a
,
b
,
c
FROM
t1
WHERE
b
in
(
9
,
3
,
4
)
ORDER
BY
b
,
c
;
...
...
sql/item.cc
View file @
1a2ca44e
...
...
@@ -4275,7 +4275,6 @@ Field *Item::tmp_table_field_from_field_type(TABLE *table)
case
MYSQL_TYPE_MEDIUM_BLOB
:
case
MYSQL_TYPE_LONG_BLOB
:
case
MYSQL_TYPE_BLOB
:
case
MYSQL_TYPE_GEOMETRY
:
if
(
this
->
type
()
==
Item
::
TYPE_HOLDER
)
return
new
Field_blob
(
max_length
,
maybe_null
,
name
,
table
,
collation
.
collation
,
1
);
...
...
@@ -4283,6 +4282,10 @@ Field *Item::tmp_table_field_from_field_type(TABLE *table)
return
new
Field_blob
(
max_length
,
maybe_null
,
name
,
table
,
collation
.
collation
);
break
;
// Blob handled outside of case
case
MYSQL_TYPE_GEOMETRY
:
return
new
Field_geom
(
max_length
,
maybe_null
,
name
,
table
,
(
Field
::
geometry_type
)
((
Item_geometry_func
*
)
this
)
->
get_geometry_type
());
}
}
...
...
sql/sql_select.cc
View file @
1a2ca44e
...
...
@@ -8793,12 +8793,12 @@ static Field *create_tmp_field_from_item(THD *thd, Item *item, TABLE *table,
enum
enum_field_types
type
;
/*
DATE/TIME
fields have STRING_RESULT result type. To preserve
type they needed to be handled separately.
DATE/TIME
and GEOMETRY fields have STRING_RESULT result type.
To preserve
type they needed to be handled separately.
*/
if
((
type
=
item
->
field_type
())
==
MYSQL_TYPE_DATETIME
||
type
==
MYSQL_TYPE_TIME
||
type
==
MYSQL_TYPE_DATE
||
type
==
MYSQL_TYPE_TIMESTAMP
)
type
==
MYSQL_TYPE_TIMESTAMP
||
type
==
MYSQL_TYPE_GEOMETRY
)
new_field
=
item
->
tmp_table_field_from_field_type
(
table
);
/*
Make sure that the blob fits into a Field_varstring which has
...
...
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