[GRASS-dev] [GRASS GIS] #2759: v.rast.stats and mySQL

#2759: v.rast.stats and mySQL
--------------------------------+-------------------------
Reporter: fpouw | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone:
Component: Default | Version: 7.0.1
Keywords: v.rast.stats mysql | CPU: x86-64
Platform: Linux |
--------------------------------+-------------------------
v.rast.stats fails to run when using a mysql database because it attempts
to execute a BEGIN TRANSACTION command.
This syntax is not supported by mysql which uses the syntax: START
TRANSACTION.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2759&gt;
GRASS GIS <https://grass.osgeo.org>

#2759: v.rast.stats and mySQL
-----------------------+---------------------------------
  Reporter: fpouw | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.1
Component: Database | Version: 7.0.1
Resolution: | Keywords: v.rast.stats, mysql
       CPU: x86-64 | Platform: Linux
-----------------------+---------------------------------
Changes (by neteler):

* keywords: v.rast.stats mysql => v.rast.stats, mysql
* component: Default => Database
* milestone: => 7.0.1

Comment:

In several Python scripts (like v.rast.stats)

{{{
"BEGIN TRANSACTION"
}}}
is hardcoded.

The modules written in C use

{{{
./db/drivers/mysql/execute.c: if (mysql_query(connection, "START
TRANSACTION") != 0) {
}}}

All of them need an appropriate mySQL wrapper. Perhaps more code places
are to be identified.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2759#comment:1&gt;
GRASS GIS <https://grass.osgeo.org>

#2759: v.rast.stats and mySQL
-----------------------+---------------------------------
  Reporter: fpouw | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.1
Component: Database | Version: 7.0.1
Resolution: | Keywords: v.rast.stats, mysql
       CPU: x86-64 | Platform: Linux
-----------------------+---------------------------------

Comment (by martinl):

Probably candidate for new functions in Python Scripting Library (`db`
package): `db_begin_transaction()` and `db_commit_transaction()`?

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2759#comment:2&gt;
GRASS GIS <https://grass.osgeo.org>

#2759: v.rast.stats and mySQL
-----------------------+---------------------------------
  Reporter: fpouw | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.3
Component: Database | Version: 7.0.1
Resolution: | Keywords: v.rast.stats, mysql
       CPU: x86-64 | Platform: Linux
-----------------------+---------------------------------
Changes (by neteler):

* milestone: 7.0.1 => 7.0.3

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2759#comment:3&gt;
GRASS GIS <https://grass.osgeo.org>

#2759: v.rast.stats and mySQL
-----------------------+---------------------------------
  Reporter: fpouw | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.3
Component: Database | Version: 7.0.1
Resolution: | Keywords: v.rast.stats, mysql
       CPU: x86-64 | Platform: Linux
-----------------------+---------------------------------

Comment (by martinl):

Please try out r67371 (trunk).

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2759#comment:4&gt;
GRASS GIS <https://grass.osgeo.org>

#2759: v.rast.stats and mySQL
-----------------------+---------------------------------
  Reporter: fpouw | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.3
Component: Database | Version: 7.0.1
Resolution: | Keywords: v.rast.stats, mysql
       CPU: x86-64 | Platform: Linux
-----------------------+---------------------------------

Comment (by martinl):

Replying to [comment:2 martinl]:
> Probably candidate for new functions in Python Scripting Library (`db`
package): `db_begin_transaction()` and `db_commit_transaction()`?

Implemented in r67370

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2759#comment:5&gt;
GRASS GIS <https://grass.osgeo.org>

#2759: v.rast.stats and mySQL
-----------------------+---------------------------------
  Reporter: fpouw | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.3
Component: Database | Version: 7.0.1
Resolution: | Keywords: v.rast.stats, mysql
       CPU: x86-64 | Platform: Linux
-----------------------+---------------------------------

Comment (by martinl):

Replying to [comment:5 martinl]:
> Replying to [comment:2 martinl]:
> Implemented in r67370

If no objections I will do backport before 7.0.3RC1.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2759#comment:6&gt;
GRASS GIS <https://grass.osgeo.org>

#2759: v.rast.stats and mySQL
-----------------------+---------------------------------
  Reporter: fpouw | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: normal | Milestone: 7.0.3
Component: Database | Version: 7.0.1
Resolution: fixed | Keywords: v.rast.stats, mysql
       CPU: x86-64 | Platform: Linux
-----------------------+---------------------------------
Changes (by martinl):

* status: new => closed
* resolution: => fixed

Comment:

Done in r67408 and r67409. Closing the ticket, feel free to re-open if
needed.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2759#comment:7&gt;
GRASS GIS <https://grass.osgeo.org>