#2184: MySQL Error during 'v.in.ogr' in GRASS 7 SVN (2014-01-31)
--------------------------------+-------------------------------------------
 Reporter:  justinzane          |       Owner:  grass-dev@…              
     Type:  defect              |      Status:  new                      
 Priority:  normal              |   Milestone:  7.0.0                    
Component:  Vector              |     Version:  svn-trunk                
 Keywords:  MySQL, OGR, import  |    Platform:  Linux                    
      Cpu:  x86-64              |  
--------------------------------+-------------------------------------------
 It seems that there is a failure to properly quote the CREATE TABLE
 command. Simply adding backticks "`" around the table name and all column
 names allows the command to execute.

 This looks like {{{create table `natural` (`cat` integer, `osm_id` varchar
 (11), `name` varchar (48), `type` varchar (16));}}}.

 Additionally, even though the CREATE TABLE failed and therefore the import
 failed, a map is created and cannot be removed since its backing data
 table never existed.

 So, two separate issues need to be fixed. First the quoting. Second is the
 need to wait until the import has succeeded before allocating a 'Map'.

 {{{
 v.in.ogr dsn=/home/justin/downloads/osm_CA/natural.shp
 ...
 DBMI-MySQL driver error:
 Unable to execute:
 create table natural (cat integer, osm_id varchar ( 11 ),
 name varchar ( 48 ), type varchar ( 16 ))
 You have an error in your SQL syntax; check the manual that
 corresponds to your MySQL server version for the right
 syntax to use near 'natural (cat integer, osm_id varchar (
 11 ), name varchar ( 48 ), type varchar (' at line 1
 ERROR: Unable to create table: 'create table natural (cat integer, osm_id
 varchar ( 11 ), name varchar ( 48 ), type varchar ( 16 ))'
 }}}

-- 
Ticket URL: <http://trac.osgeo.org/grass/ticket/2184>
GRASS GIS <http://grass.osgeo.org>

_______________________________________________
grass-dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/grass-dev

Reply via email to