Bug #57234 asText returns BLOB
Submitted: 5 Oct 2010 1:03 Modified: 5 Oct 2010 16:54
Reporter: Patrick Hayes Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: GIS Severity:S2 (Serious)
Version:5.1.41 OS:Linux (5.1.41-3ubuntu12.3)
Assigned to: CPU Architecture:Any
Tags: astext, BLOB, Geometry, geomfromtext

[5 Oct 2010 1:03] Patrick Hayes
Description:
The following SQL used to work in previous versions:

SELECT asText(GeomFromText('POLYGON((-120 57,-120 57.1,-120.1 57.2,-120.2 57.2,-120 57))')) as weird_blob

However, now, instead of returning WKT text, the SQL above returns a blob. 

How to repeat:

SELECT asText(GeomFromText('POLYGON((-120 57,-120 57.1,-120.1 57.2,-120.2 57.2,-120 57))')) as weird_blob
[5 Oct 2010 3:58] Valeriy Kravchuk
This is what I have in 5.1.52:

macbook-pro:5.1 openxs$ bin/mysql --column-type-info -uroot test
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.1.52-debug Source distribution

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> SELECT asText(GeomFromText('POLYGON((-120 57,-120 57.1,-120.1 57.2,-120.2 57.2,-120
    '> 57))')) as weird_blob
    -> ;
Field   1:  `weird_blob`
Catalog:    `def`
Database:   ``
Table:      ``
Org_table:  ``
Type:       LONG_BLOB
Collation:  binary (63)
Length:     16777216
Max_length: 60
Decimals:   31
Flags:      BINARY 

+--------------------------------------------------------------+
| weird_blob                                                   |
+--------------------------------------------------------------+
| POLYGON((-120 57,-120 57.1,-120.1 57.2,-120.2 57.2,-120 57)) |
+--------------------------------------------------------------+
1 row in set (0.00 sec)

Where is the problem?
[5 Oct 2010 16:54] Patrick Hayes
It looks like you are not having the problem. Marking as closed until I can figure out the problem in more detail.

Thanks for testing..

~P