Skip to content

[Bug] wxGUI/dbmgr: allow updating record date column type value with any date format, different from the ISO8601 format, will cause DB data reloading error #6164

@tmszi

Description

@tmszi

Describe the bug

The wxGUI dbmgr component allow updating record date column type value with any date format, different from the ISO8601 format, will cause DB data reloading error. The underlying DBMI driver allows formatting only a date column value in the ISO8601 YYYY-MM-DD format.

e.g SQLite DBMI drive source code:

case DB_SQL_TYPE_DATE:
dt = &value->t;
dt->hour = 0;
dt->minute = 0;
dt->seconds = 0.0;
G_debug(3, "sqlite fetched date: <%s>", text);
ns = sscanf(text, "%4d-%2d-%2d", &dt->year, &dt->month, &dt->day);
if (ns != 3) {
db_d_append_error("%s %s", _("Unable to scan date:"), text);
db_d_report_error();
return DB_FAILED;
}
break;

To reproduce

  1. Open some vector map attribute table with wxGUI dbmgr component e.g. g.gui.dbmgr geology
  2. Try add new column (e.g. test name) with date type
  3. Try update test column date value for cat = 1, with date value with following format 20250803. Right click on the table row with cat = 1 to invoke row menu and choose Edit selected record and type 20250803 value into test name field.
  4. See error dialog
DBMI-SQLite driver error:
Unable to scan date: 20250803

DBMI-SQLite driver error:
Unable to scan date: 20250803

ERROR: Unable to fetch data from table <geology>
  1. It is not possible open vector map attribute table with wxGUI dbmgr component again or refresh data, because you get same error.

Expected behavior

Edit selected record dialog should be has for date column type wx TextCtrl widget date ISO8601 YYYY-MM-DD format validator and hint.

Screenshots

Actual behavior:

wxgui_dbmgr_date_col_type_val_actual_behavior.mp4

Expected behavior:

wxgui_dbmgr_date_col_type_val_expected_behavior.mp4

System description

  • Operating System: all
  • GRASS GIS version: all

Metadata

Metadata

Assignees

Labels

GUIwxGUI relatedbugSomething isn't working

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions