Skip Menu |

This queue is for tickets about the DBD-mysql CPAN distribution.

Report information
The Basics
Id: 118751
Status: resolved
Priority: 0/
Queue: DBD-mysql

People
Owner: MICHIELB [...] cpan.org
Requestors: mmcclenn [...] geology.wisc.edu
Cc: pali [...] cpan.org
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: column type 'geometry' is not recognized by column_info
Date: Mon, 14 Nov 2016 01:34:49 +0000
To: "bug-DBD-mysql [...] rt.cpan.org" <bug-DBD-mysql [...] rt.cpan.org>
From: MICHAEL J MCCLENNEN <mmcclenn [...] geology.wisc.edu>
Whenever I call $dbh->column_info on a table that contains a column of type 'geometry', the following warning is printed: column_info: unrecognized column type 'geometry' of `pbdb`.`collections`.coordinate treated as varchar This despite the fact that 'geometry' is a recognized column type in MySQL. These messages are littering my error logs. Can you please make them go away? One obvious solution is to silently treat a column of type GEOMETRY as VARCHAR. -- Michael McClennen
On Ned Nov 13 20:35:03 2016, mmcclenn@geology.wisc.edu wrote: Show quoted text
> Whenever I call $dbh->column_info on a table that contains a column of > type 'geometry', the following warning is printed: > > column_info: unrecognized column type 'geometry' of > `pbdb`.`collections`.coordinate treated as varchar > > This despite the fact that 'geometry' is a recognized column type in > MySQL. These messages are littering my error logs. Can you please > make them go away? > > One obvious solution is to silently treat a column of type GEOMETRY as > VARCHAR. > > -- Michael McClennen
Can you try attached patch?
Subject: 0001-In-dbh-column_info-handle-GEOMETRY-mysql-column-type.patch
From c150d0fb27e93c7224b8b5b50bc40f5f90cbbbdc Mon Sep 17 00:00:00 2001 From: Pali <pali@cpan.org> Date: Sat, 19 Nov 2016 21:24:09 +0100 Subject: [PATCH] In $dbh->column_info() handle GEOMETRY mysql column type same as BLOB This will fix warning "column_info: unrecognized column type 'geometry'" --- lib/DBD/mysql.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/DBD/mysql.pm b/lib/DBD/mysql.pm index 191b452..9854fb5 100644 --- a/lib/DBD/mysql.pm +++ b/lib/DBD/mysql.pm @@ -502,7 +502,7 @@ sub column_info { my @type_attr= split / /, $attr||''; $info->{DATA_TYPE}= SQL_VARCHAR(); - if ($basetype =~ /^(char|varchar|\w*text|\w*blob)/) + if ($basetype =~ /^(char|varchar|\w*text|\w*blob|geometry)/) { $info->{DATA_TYPE}= SQL_CHAR() if $basetype eq 'char'; if ($type_params[0]) -- 1.7.9.5
On Sat 19 Nov 2016 15:25:40, PALI wrote: Show quoted text
> On Ned Nov 13 20:35:03 2016, mmcclenn@geology.wisc.edu wrote:
> > Whenever I call $dbh->column_info on a table that contains a column of > > type 'geometry', the following warning is printed: > > > > column_info: unrecognized column type 'geometry' of > > `pbdb`.`collections`.coordinate treated as varchar > > > > This despite the fact that 'geometry' is a recognized column type in > > MySQL. These messages are littering my error logs. Can you please > > make them go away?
> > Can you try attached patch?
Hi Pali, please note we also have a similar ticket https://rt.cpan.org/Ticket/Display.html?id=117846 about the 'json' type. I think we should check all more 'recent' data types in MySQL and add them. For instance, this page: https://dev.mysql.com/doc/refman/5.7/en/spatial-datatypes.html lists apart from 'geometry' also POINT LINESTRING POLYGON MULTIPOINT MULTILINESTRING MULTIPOLYGON GEOMETRYCOLLECTION And there are probably loads more non-spatial datatypes we don't support. What are your ideas on this? -- Michiel
On Ned Nov 20 04:30:41 2016, MICHIELB wrote: Show quoted text
> What are your ideas on this?
IIRC mysql can handle any type via string/varchar. If there are really no exception, then we can easily handle all those unsupported types as string/varchar/blob without any problems. But it is needed to recheck if this is still truth.