https://issues.qgis.org/https://issues.qgis.org/favicon.ico2017-07-10T12:39:57ZQGIS Issue TrackingQGIS Application - Bug report #16833: Unicode character in query in db_manager makes appear a never ending hourglasshttps://issues.qgis.org/issues/16833?journal_id=807952017-07-10T12:39:57ZGiovanni Manghigiovanni.manghi@gmail.com
<ul></ul><p>It works as expected up until 2.18.9</p> QGIS Application - Bug report #16833: Unicode character in query in db_manager makes appear a never ending hourglasshttps://issues.qgis.org/issues/16833?journal_id=808002017-07-10T15:27:52ZMartin HOFFMANN
<ul></ul><p>Guess it was time I learn how to downgrade using OSGeo4W...<br />I confirm that downgrading to 2.18.9 solve my issue.</p>
<p>I strongly discourage Windows10 users that need unicode support to upgrade until this is solved.</p> QGIS Application - Bug report #16833: Unicode character in query in db_manager makes appear a never ending hourglasshttps://issues.qgis.org/issues/16833?journal_id=808172017-07-11T07:20:58ZJürgen Fischerjef@norbit.de
<ul><li><strong>Subject</strong> changed from <i>Unicode caracter crash db_manager </i> to <i>Unicode character crashes db_manager </i></li></ul> QGIS Application - Bug report #16833: Unicode character in query in db_manager makes appear a never ending hourglasshttps://issues.qgis.org/issues/16833?journal_id=808202017-07-11T09:12:35ZGiovanni Manghigiovanni.manghi@gmail.com
<ul><li><strong>Subject</strong> changed from <i>Unicode character crashes db_manager </i> to <i>Unicode caracter in query in db_manager makes appear a never ending hourglass</i></li><li><strong>Crashes QGIS or corrupts data</strong> changed from <i>Yes</i> to <i>No</i></li></ul><p>It is also true that neither DB Manager of QGIS crash or are blocked/froze. Just the very annoying hourglass.</p> QGIS Application - Bug report #16833: Unicode character in query in db_manager makes appear a never ending hourglasshttps://issues.qgis.org/issues/16833?journal_id=808372017-07-11T12:28:13ZMartin HOFFMANN
<ul></ul><p>Sorry for the confusion, in fact the hourglass don't prevent manipulating the application and permit for instance to save the current document.<br />What seems to happen is that the query is stuck and never get_back to the preview window or a layer.</p>
<p>Apparently the error is only triggered where the input SQL query contain Unicode character, Unicode character retunned by the database are handled just fine.</p>
<p>Here is a test table to create in your DB using external tool to check that only input is concerned.<br /><pre>
SELECT * INTO test_unicode FROM (VALUES ('ascii','e'),('unicode','é')) foo(test,value)
</pre></p>
<p>So if you try to access to that table through database manager query<br /><pre>
SELECT * FROM test_unicode --This will work
SELECT * FROM test_unicode WHERE value='e' --This as well
SELECT * FROM test_unicode WHERE value='é' --This will never return and start and endless hourglass
</pre></p>
<p>I tested against Debian Jessie and I get the same error, here is the python log for the event</p>
<pre>
2017-07-11T13:50:05 1 Traceback (most recent call last):
File "/usr/share/qgis/python/plugins/db_manager/dlg_sql_window.py", line 169, in loadAsLayerToggled
self.fillColumnCombos()
File "/usr/share/qgis/python/plugins/db_manager/dlg_sql_window.py", line 312, in fillColumnCombos
c = connector._execute(None, sql)
File "/usr/share/qgis/python/plugins/db_manager/db_plugins/connector.py", line 81, in _execute
cursor.execute(str(sql))
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 23: ordinal not in range(128)
</pre>
<p>This seems to confirm that this might actually be the same bug than <a class="issue tracker-1 status-5 priority-5 priority- closed" href="https://issues.qgis.org/issues/16756" title="Encoding error in DB Manager (Closed)">#16756</a><br />Sorry for duplicating I'm more a user than a developer and maybe I don't communicate "the good way".</p> QGIS Application - Bug report #16833: Unicode character in query in db_manager makes appear a never ending hourglasshttps://issues.qgis.org/issues/16833?journal_id=808802017-07-13T13:08:26ZBorys Jurgiel
<ul><li><strong>Operating System</strong> deleted (<del><i>Windows 10 (with OSGeo4W)</i></del>)</li><li><strong>Assignee</strong> set to <i>Sandro Santilli</i></li></ul><p>Assigning to Sandro, as <a class="changeset" href="https://issues.qgis.org/projects/qgis/repository/revisions/14ab5eb0bda9a5993b9ab15a3b7de1af9df8dcba" title="More unicode/utf8 fixes">14ab5eb0bda</a> is the reason of this regression (line 81 of connector.py)</p> QGIS Application - Bug report #16833: Unicode character in query in db_manager makes appear a never ending hourglasshttps://issues.qgis.org/issues/16833?journal_id=809702017-07-18T08:41:10ZJürgen Fischerjef@norbit.de
<ul><li><strong>Subject</strong> changed from <i>Unicode caracter in query in db_manager makes appear a never ending hourglass</i> to <i>Unicode character in query in db_manager makes appear a never ending hourglass</i></li></ul> QGIS Application - Bug report #16833: Unicode character in query in db_manager makes appear a never ending hourglasshttps://issues.qgis.org/issues/16833?journal_id=809802017-07-18T21:13:28ZSandro Santillistrk@kbt.io
<ul></ul><p>I think I made those changes because I could not build otherwise, but trying again now I can build and confirm the revert fixes the issue. PR is here: <a class="external" href="https://github.com/qgis/QGIS/pull/4882">https://github.com/qgis/QGIS/pull/4882</a> -- it would be good to have a testcase for this but I don't know when I'll have time for that.</p> QGIS Application - Bug report #16833: Unicode character in query in db_manager makes appear a never ending hourglasshttps://issues.qgis.org/issues/16833?journal_id=809832017-07-19T08:11:34ZSandro Santillistrk@kbt.io
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>In Progress</i></li></ul> QGIS Application - Bug report #16833: Unicode character in query in db_manager makes appear a never ending hourglasshttps://issues.qgis.org/issues/16833?journal_id=809842017-07-19T08:11:46ZSandro Santillistrk@kbt.io
<ul><li><strong>Pull Request or Patch supplied</strong> changed from <i>No</i> to <i>Yes</i></li></ul> QGIS Application - Bug report #16833: Unicode character in query in db_manager makes appear a never ending hourglasshttps://issues.qgis.org/issues/16833?journal_id=810072017-07-19T18:52:21ZSandro Santillistrk@kbt.io
<ul></ul><p>A second, simpler, pull request is here:<br /><a class="external" href="https://github.com/qgis/QGIS/pull/4888">https://github.com/qgis/QGIS/pull/4888</a></p>
<p>This second one removes some assumptions about the input being ASCII (or encoded utf8).<br />Can the original reporter run some tests with that ?<br />A test is included and I run a manual test, but maybe you have more paths to test..</p> QGIS Application - Bug report #16833: Unicode character in query in db_manager makes appear a never ending hourglasshttps://issues.qgis.org/issues/16833?journal_id=810092017-07-19T20:13:54ZSandro Santillistrk@kbt.io
<ul><li><strong>Status</strong> changed from <i>In Progress</i> to <i>Closed</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li></ul><p>Applied in changeset <a class="changeset" href="https://issues.qgis.org/projects/qgis/repository/revisions/3120068bf108e8929189cd560435f778290a648d" title="Do not assume input SQL is ASCII Fixes #16833">qgis|3120068bf108e8929189cd560435f778290a648d</a>.</p> QGIS Application - Bug report #16833: Unicode character in query in db_manager makes appear a never ending hourglasshttps://issues.qgis.org/issues/16833?journal_id=810112017-07-19T20:17:20ZSandro Santillistrk@kbt.io
<ul></ul><p>Fix is now merged</p>