Opened 8 years ago

Closed 8 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 by neteler, 8 years ago

Component: DefaultDatabase
Keywords: v.rast.stats mysql → v.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 by martinl, 8 years ago

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

comment:3 by neteler, 8 years ago

Milestone: 7.0.17.0.3

comment:4 by martinl, 8 years ago

Please try out r67371 (trunk).

in reply to:  2 ; comment:5 by martinl, 8 years ago

Replying to martinl:

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

Implemented in r67370

in reply to:  5 comment:6 by martinl, 8 years ago

Replying to martinl:

Replying to martinl: Implemented in r67370

If no objections I will do backport before 7.0.3RC1.

comment:7 by martinl, 8 years ago

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.