grass icon indicating copy to clipboard operation
grass copied to clipboard

[Feat] db.execute: Detect that SQL statement is longer than DB_SQL_MAX

Open wenzeslaus opened this issue 5 years ago • 0 comments

Is your feature request related to a problem? Please describe. db.execute fails with a too generic message when DB_SQL_MAX is reached. This is extremely confusing when db.execute is used by another module and even when used directly, the message is unclear.

Describe the solution you'd like Something like ERROR: The SQL statement is too long. Try to make it shorter or use different approach. should appear.

Describe alternatives you've considered Implement dynamic allocation for SQL statements. That would be actually preferred since it would solve the issue with the message and with what DB_SQL_MAX should be.

Additional context

  • Trac Ticket #3919 db.dropcolumn and v.db.dropcolumn do not drop columns (for table with a lot of columns)
  • #1124 lib: Increase max size of SQL statements (DB_SQL_MAX)

wenzeslaus avatar Nov 29 '20 02:11 wenzeslaus