Discussion:
unknown
1970-01-01 00:00:00 UTC
Permalink
--047d7b343aa8300cc104d9d5421f
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable <div dir="ltr">yes I&#39;ll try. But not today. Can you wait a couple of days?<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/4/8 <a href="mailto:***@mailme.dk">***@mailme.dk</a> <span dir="ltr">&lt;<a href="mailto:***@mailme.dk" target="_blank">***@mailme.dk</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Ok good, I take it you are on master branch. Could you please try the<br>
hotfix/3.2.1 branch ?<br>
<div class="HOEnZb"><div class="h5"><br>
&gt; I use soci from git download of about 1 week ago<br>
&gt;<br>
&gt;<br>
&gt; 2013/4/8 <a href="mailto:***@mailme.dk">***@mailme.dk</a> &lt;<a href="mailto:***@mailme.dk">***@mailme.dk</a>&gt;<br>
&gt;<br>
&gt;&gt; Hi Bruno<br>
&gt;&gt;<br>
&gt;&gt; What version of soci are you using ?<br>
&gt;&gt;<br>
&gt;&gt; It looks a bit like the Postgres regression that went into 3.2.0<br>
&gt;&gt;<br>
&gt;&gt; See commit c8ad2a884 for details. It should be fixed in 3.2.1.<br>
&gt;&gt;<br>
&gt;&gt; Poul<br>
&gt;&gt;<br>
&gt;&gt; &gt; I tried with the escape beckslash \ (that is \:\:box3d) but the error<br>
&gt;&gt; was<br>
&gt;&gt; &gt; the same.<br>
&gt;&gt; &gt; Then I tried to change the cast syntax as suggested by Mateusz and the<br>
&gt;&gt; &gt; query worked.<br>
&gt;&gt; &gt; Could be a good idea to add an escape strategy like that one of the<br>
&gt;&gt; &gt; backslash (\) for parsing the colons.<br>
&gt;&gt; &gt; Do I add the feature request on github?<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; thanks for the replies,<br>
&gt;&gt; &gt; Bruno<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; 2013/4/6 Vadim Zeitlin &lt;<a href="mailto:vz-***@zeitlins.org">vz-***@zeitlins.org</a>&gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; On Sat, 6 Apr 2013 14:02:09 +0100 Mateusz Loskot &lt;<a href="mailto:***@loskot.net">***@loskot.net</a>&gt;<br>
&gt;&gt; &gt;&gt; wrote:<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; ML&gt; &gt; the application gives my the following error:<br>
&gt;&gt; &gt;&gt; ML&gt; &gt;<br>
&gt;&gt; &gt;&gt; ML&gt; &gt; &quot;Wt: fatal error: ERROR: syntax error at or near &quot;&quot;$1&quot;&quot;<br>
&gt;&gt; &gt;&gt; ML&gt; &gt; LINE 1: ...etsrid(&#39;BOX3D(15.0118 37.4667, 15.2118<br>
&gt;&gt; 37,6667)&#39;::$1,<br>
&gt;&gt; &gt;&gt; 4326) ...<br>
&gt;&gt; &gt;&gt; ML&gt; &gt;<br>
&gt;&gt; &gt;&gt; ML&gt; &gt; the error is given in place of $1 that in the query is ::box3d.<br>
&gt;&gt; &gt;&gt; Why?<br>
&gt;&gt; &gt;&gt; there<br>
&gt;&gt; &gt;&gt; ML&gt; &gt; was this traslation?<br>
&gt;&gt; &gt;&gt; ML&gt;<br>
&gt;&gt; &gt;&gt; ML&gt; I haven&#39;t tested your query in action, but I suppose there may be<br>
&gt;&gt; &gt;&gt; conflict<br>
&gt;&gt; &gt;&gt; ML&gt; between casting operators and how SOCI parses query to handle<br>
&gt;&gt; &gt;&gt; ML&gt; placeholders bound by name:<br>
&gt;&gt; &gt;&gt; ML&gt;<br>
&gt;&gt; &gt;&gt; ML&gt; <a href="http://soci.sourceforge.net/doc/3.2.0/exchange.html#bind_name" target="_blank">http://soci.sourceforge.net/doc/3.2.0/exchange.html#bind_name</a><br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;  FWIW the code in PostgreSQL backend clearly tries to detect the cast<br>
&gt;&gt; &gt;&gt; operators, there are even several cases for this there.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; ML&gt; &gt; Maybe is the double colons that gives the problem? How<br>
&gt;&gt; &gt;&gt; ML&gt; &gt; I can fix? How to pass a colon in the sql string?<br>
&gt;&gt; &gt;&gt; ML&gt;<br>
&gt;&gt; &gt;&gt; ML&gt; Can you try the alternative [1], SQL conformant, syntax for the<br>
&gt;&gt; &gt;&gt; cast:<br>
&gt;&gt; &gt;&gt; ML&gt;<br>
&gt;&gt; &gt;&gt; ML&gt; SetSRID(CAST(&#39;BOX3D(15.0118 37.4667, 15.2118 37,6667)&#39; AS box3d),<br>
&gt;&gt; &gt;&gt; 4326)<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;  

Loading...