GDAL
December 3, 2015, 7:47pm
1
#2819: v.db.renamecolumn mysql error
---------------------------------+-------------------------
Reporter: fpouw | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 7.0.3
Component: Database | Version: 7.0.2
Keywords: rename column mysql | CPU: x86-64
Platform: Linux |
---------------------------------+-------------------------
The SQL in the v.db.renamecolumn package is not correct for mysql
Adding the following elif command to the "#some tricks" section enables
renaming (at least for varchar column type. I didn't test it for other
types)
elif driver in ['mysql']:
if oldcoltype.upper() == "CHARACTER":
newcoltype = "varchar(%s)" % (oldcollength)
else:
newcoltype = oldcoltype
sql = "ALTER TABLE %s CHANGE %s %s %s" % (table, oldcol, newcol,
newcoltype)
grass.write_command('db.execute', input = '-', database =
database, driver = driver, stdin = sql)
--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2819> ;
GRASS GIS <https://grass.osgeo.org >
GDAL
December 3, 2015, 9:40pm
2
#2819: v.db.renamecolumn mysql error
-----------------------+---------------------------------
Reporter: fpouw | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 7.0.3
Component: Database | Version: 7.0.2
Resolution: | Keywords: rename column mysql
CPU: x86-64 | Platform: Linux
-----------------------+---------------------------------
Changes (by neteler):
* Attachment "v.db.renamecolumn.diff" added.
proposed mysql fix as diff
--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2819> ;
GRASS GIS <https://grass.osgeo.org >
GDAL
December 19, 2015, 10:11pm
3
#2819: v.db.renamecolumn mysql error
-----------------------+---------------------------------
Reporter: fpouw | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 7.0.3
Component: Database | Version: 7.0.2
Resolution: | Keywords: rename column mysql
CPU: x86-64 | Platform: Linux
-----------------------+---------------------------------
Comment (by neteler):
See also #2759
--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2819#comment:1> ;
GRASS GIS <https://grass.osgeo.org >
GDAL
December 22, 2015, 1:50am
4
#2819: v.db.renamecolumn mysql error
-----------------------+---------------------------------
Reporter: fpouw | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 7.0.3
Component: Database | Version: 7.0.2
Resolution: | Keywords: rename column mysql
CPU: x86-64 | Platform: Linux
-----------------------+---------------------------------
Comment (by martinl):
I tested patch and took liberty to apply r67315.
--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2819#comment:2> ;
GRASS GIS <https://grass.osgeo.org >
GDAL
December 24, 2015, 1:04pm
5
#2819: v.db.renamecolumn mysql error
-----------------------+---------------------------------
Reporter: fpouw | Owner: grass-dev@…
Type: defect | Status: closed
Priority: normal | Milestone: 7.0.3
Component: Database | Version: 7.0.2
Resolution: fixed | Keywords: rename column mysql
CPU: x86-64 | Platform: Linux
-----------------------+---------------------------------
Changes (by martinl):
* status: new => closed
* resolution: => fixed
Comment:
Backported in r67360. Closing ticket.
--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2819#comment:3> ;
GRASS GIS <https://grass.osgeo.org >