<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to 5: invalid regex substitution for table names in get_tables</title><link>https://sourceforge.net/p/sqlcockpit/bugs/5/</link><description>Recent changes to 5: invalid regex substitution for table names in get_tables</description><atom:link href="https://sourceforge.net/p/sqlcockpit/bugs/5/feed.rss" rel="self"/><language>en</language><lastBuildDate>Mon, 06 Oct 2014 19:02:19 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/sqlcockpit/bugs/5/feed.rss" rel="self" type="application/rss+xml"/><item><title>invalid regex substitution for table names in get_tables</title><link>https://sourceforge.net/p/sqlcockpit/bugs/5/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;In get_tables in sqlcockpit.pl there is a regex that should beautify table names:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="n"&gt;foreach&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="err"&gt;@&lt;/span&gt;&lt;span class="n"&gt;tables&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="err"&gt;#&lt;/span&gt; &lt;span class="n"&gt;beautify&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;
    &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;".+"&lt;/span&gt;&lt;span class="p"&gt;)(.&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="err"&gt;$&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="o"&gt;/^&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="c1"&gt;//g;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This regex does not work if the prefix and the table names are quoted, e.g. "thisisa"."test".&lt;br /&gt;
As a result, the table name is wrong and loading an SQLite database fails.&lt;/p&gt;
&lt;p&gt;Exclusing quotes between quotes does the trick (I think).&lt;br /&gt;
Just replace &lt;br /&gt;
s/(".+")(.+)/$2/g;&lt;br /&gt;
by &lt;br /&gt;
s/("&lt;span&gt;[^"]&lt;/span&gt;+")(.+)/$2/g;&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Alex</dc:creator><pubDate>Mon, 06 Oct 2014 19:02:19 -0000</pubDate><guid>https://sourceforge.net081e5573fcb580adf759953edafa1e3290f09c2d</guid></item></channel></rss>