After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 763534 - Glom won't open a database if a table contains spaces
Glom won't open a database if a table contains spaces
Status: RESOLVED FIXED
Product: glom
Classification: Other
Component: data mode
1.28.x
Other All
: Normal normal
: ---
Assigned To: Murray Cumming
Murray Cumming
Depends on: 763596
Blocks:
 
 
Reported: 2016-03-12 13:37 UTC by m.rick.mac
Modified: 2016-09-29 09:46 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description m.rick.mac 2016-03-12 13:37:45 UTC
If a user create a table with spaces in its name, Glom won't be able to open it at the next launch.

Here is the error message:
(<unknown>:13928): GLib-GIO-ERROR **: g_menu_item_set_detailed_action: Detailed action name 'tables-list.Test Test Test' has invalid format
Trace/BPT trap: 5

Maybe it would force the user not using spaces in the tables names by replacing them with _
Anyhow, it's not really recommended to use spaces in names.
Comment 1 Murray Cumming 2016-03-13 20:18:44 UTC
Thanks.

This is partly fixed by this:
https://git.gnome.org/browse/glom/commit/?id=81098c767894a4e63f27d26414e868c9312d0157
Comment 2 Murray Cumming 2016-03-13 20:25:41 UTC
However, the SQL command then fails, which really shouldn't be happening with GdaSqlBuilder, at this point:

(gdb) bt
  • #0 Glom::DbUtils::query_execute_select
    at glom/libglom/db_utils.cc line 1702
  • #1 Glom::DbUtils::count_rows_returned_by
    at glom/libglom/db_utils.cc line 1975
  • #2 Glom::Frame_Glom::show_table_allow_empty
    at glom/frame_glom.cc line 397
  • #3 Glom::Frame_Glom::show_table
    at glom/frame_glom.cc line 447
  • #4 Glom::Frame_Glom::on_box_tables_selected
    at glom/frame_glom.cc line 264

Comment 3 Murray Cumming 2016-03-13 20:28:37 UTC
With this output:

Glib::RefPtr<Gnome::Gda::DataModel> Glom::DbUtils::query_execute_select(const Glib::RefPtr<const Gnome::Gda::SqlBuilder>&, bool): code=SERVER_PROVIDER_STATEMENT_EXEC_ERROR, message=syntax error at or near "with space"
LINE 1: SELECT COUNT (*) FROM (SELECT with space.with space_id FROM ...
                                      ^
Glib::RefPtr<Gnome::Gda::DataModel> Glom::DbUtils::query_execute_select(const Glib::RefPtr<const Gnome::Gda::SqlBuilder>&, bool): Error while executing SQL: 
  SELECT 
	COUNT (*)
FROM (SELECT 
	with space.with space_id
FROM with space) AS "glomarbitraryalias"

static bool Glom::ConnectionPool::handle_error_cerr_only(): Internal error (Database): syntax error at or near "with space"
LINE 1: SELECT COUNT (*) FROM (SELECT with space.with space_id FROM ...
                                      ^
Comment 4 Murray Cumming 2016-09-29 09:46:52 UTC
For now, I have added a check in the UI for this:
https://git.gnome.org/browse/glom/commit/?id=7b2163c301575a5a6e5d921f07c5d9a648906f1b

I would prefer that this was just possible with libgda.