Menu

#5 invalid regex substitution for table names in get_tables

v1.0_(example)
open
None
5
2014-10-06
2014-10-06
Alex
No

In get_tables in sqlcockpit.pl there is a regex that should beautify table names:

foreach (@tables) {
    # beautify name
    s/(".+")(.+)/$2/g;
    s/^\.//g;
}

This regex does not work if the prefix and the table names are quoted, e.g. "thisisa"."test".
As a result, the table name is wrong and loading an SQLite database fails.

Exclusing quotes between quotes does the trick (I think).
Just replace
s/(".+")(.+)/$2/g;
by
s/("[^"]+")(.+)/$2/g;

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.