Opened 6 years ago

Closed 6 years ago

#2759 closed defect (fixed)

v.rast.stats and mySQL

Reported by: fpouw Owned by: grass-dev@…
Priority: normal Milestone: 7.0.3
Component: Database Version: 7.0.1
Keywords: v.rast.stats, mysql Cc:
CPU: x86-64 Platform: Linux

Description

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.

Change History (7)

comment:1 Changed 6 years ago by neteler

Component: DefaultDatabase
Keywords: v.rast.stats mysqlv.rast.stats, mysql
Milestone: 7.0.1

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.

comment:2 Changed 6 years ago by martinl

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

comment:3 Changed 6 years ago by neteler

Milestone: 7.0.17.0.3

comment:4 Changed 6 years ago by martinl

Please try out r67371 (trunk).

comment:5 in reply to:  2 ; Changed 6 years ago by martinl

Replying to martinl:

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

Implemented in r67370

comment:6 in reply to:  5 Changed 6 years ago by martinl

Replying to martinl:

Replying to martinl: Implemented in r67370

If no objections I will do backport before 7.0.3RC1.

comment:7 Changed 6 years ago by martinl

Resolution: fixed
Status: newclosed

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

Note: See TracTickets for help on using tickets.