-
-
Notifications
You must be signed in to change notification settings - Fork 416
Labels
Milestone
Description
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:
grass/db/drivers/sqlite/fetch.c
Lines 158 to 170 in 523043a
| 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
- Open some vector map attribute table with wxGUI dbmgr component e.g.
g.gui.dbmgrgeology - Try add new column (e.g. test name) with date type
- 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.
- 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>
- 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
Reactions are currently unavailable