<br><br><div class="gmail_quote">On Fri, Aug 12, 2011 at 9:39 PM, Alain Rastoul <span dir="ltr"><<a href="mailto:alr.dev@free.fr" target="_blank">alr.dev@free.fr</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<u></u>
<div bgcolor="#ffffff">
<div><font face="Arial" size="2">hi Guillermo,</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">you are right, I didn't use rawValues , and that
was the problem.</font></div>
<div><font face="Arial" size="2">The problem is not with Glorp but with opendbx and
in fact it is the same as the issue pointed to by Mariano (issue 10) and another
(issue 16)</font></div>
<div><font face="Arial" size="2">I have a simpler test to reproduce than yours (in
fact you don't need to use UNION in your test):</font></div></div></blockquote><div><br>Hi Alain. First of all, thanks for poiting out the bug.<br>Now, Guille asked you how did you install SqueakDBX/GlorpDBX because we are VERY near to release a new version of the new project called DBXTalk in which we will release a new version of SqueakDBX, which will be called OpenDBXDriver and a new release of GlorpDBX and Glorp, which we port the latest version from VW. <br>
You will have more news very soon, but I recommend you to migrate to this new stuff once it is out.<br> </div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">
<div bgcolor="#ffffff"><font face="Arial" size="2">
<div><br> | settings dbc stmt resultSet coll |<br> settings :=
DBXConnectionSettings<br> host: SmalltalkImage current
imagePath, '/'<br> port:
''<br> database:
'testdb.dat'<br> userName:
''<br> userPassword: ''.<br> dbc := DBXConnection
platform: DBXSqlitePlatform new settings:
settings.<br> [<br> dbc connect.<br> dbc open.<br> dbc
execute: 'drop table if exists foo'.<br> dbc execute: 'create table foo (id
int not null, name varchar(64) null )'.<br> dbc execute: 'insert into foo
values(1, null )'.<br> dbc execute: 'insert into foo values(2,
''riptobe'' )'.<br> resultSet := dbc execute: 'SELECT * FROM
foo'.<br> coll := OrderedCollection new.</div>
<div>"error here for null value in second row"<br> resultSet rows do: [ :r
| coll add: r values ].<br> coll inspect.<br> ] ensure: [ dbc close
].</div>
<div> </div></font></div></blockquote><div><br>I am out of time right now, but I would love if you or someone can take this piece of code and "adapt it" as a regular SqueakDBX test. If you do this, please do it directly in the package OpenDBXDriverTests of the repo <a href="http://www.squeaksource.com/DBXTalk" target="_blank">http://www.squeaksource.com/DBXTalk</a>.<br>
We really welcome your test :)<br>You can add it to: DBXQueryTest. Take a look at to the existing tests there.<br><br> </div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">
<div bgcolor="#ffffff"><font face="Arial" size="2">
<div>The problem is that opendbx doesn't return the correct datatype for
columns when they have null values, apparently it keeps the description for the
column that was readen for the first row (?)</div></font></div></blockquote><div><br>Can you confirm it is this problem?<br><a href="http://www.mail-archive.com/libopendbx-devel@lists.sourceforge.net/msg00483.html">http://www.mail-archive.com/libopendbx-devel@lists.sourceforge.net/msg00483.html</a><br>
If it is...then it seems there is no fix :(<br> </div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">
<div bgcolor="#ffffff"><font face="Arial" size="2">
<div>And the same problem exists with MSSQL, it is not related to the special
sqlite UNKNOW datatype but a problem in opendbx (my test also breaks with
mssql)</div>
<div>I am writing a test case for that, </div></font></div></blockquote><div><br>excellent.<br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div bgcolor="#ffffff"><font face="Arial" size="2"><div>and I will also have a look at opendbx
source code.</div>
<div> </div></font></div></blockquote><div><br>great. Don't be shy to ask to ask and OpenDBX mailing list.<br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div bgcolor="#ffffff"><font face="Arial" size="2"><div>Cheers</div>
<div>Alain</div></font></div>
<blockquote style="border-left:#000000 2px solid;padding-left:5px;padding-right:0px;margin-left:5px;margin-right:0px">
<div>"Guillermo Polito" <<a href="mailto:guillermopolito@gmail.com" target="_blank">guillermopolito@gmail.com</a>>
a écrit dans le message de news: <a href="mailto:CAOBmb52JNRM+xQBx9kqNm9aMero3avyriXWsytbMqK=JBH8KAg@mail.gmail.com" target="_blank">CAOBmb52JNRM+xQBx9kqNm9aMero3avyriXWsytbMqK=JBH8KAg@mail.gmail.com</a>...</div><div>
Hi
Alain!<br><br>where did you get GlorpDBX? :) Was it from the DBXTalk
repo?<br><br><br>
</div><div><div></div><div><div class="gmail_quote">On Thu, Aug 11, 2011 at 5:28 PM, Alain Rastoul <span dir="ltr"><<a href="mailto:alr.dev@free.fr" target="_blank">alr.dev-GANU6spQydw@public.gmane.org</a>></span>
wrote:<br>
<blockquote style="border-left:#ccc 1px solid;margin:0px 0px 0px 0.8ex;padding-left:1ex" class="gmail_quote"><u></u>
<div bgcolor="#ffffff">
<div><font face="Arial" size="2">Hi Mariano</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">I may be wrong, but I don't think that this
issue is not related, </font><font face="Arial" size="2">I have first checked
that reading my data with squeakdbx is ok.</font></div></div></blockquote>
<div><br>How did you read the data? Using values or raw
values?<br><br>Can you send us/me the query sent by glorp? Is it a
polymorphic or inheritance query?<br> <br><br>Thanks!<br>Guille<br></div>
<blockquote style="border-left:rgb(204,204,204) 1px solid;margin:0pt 0pt 0pt 0.8ex;padding-left:1ex" class="gmail_quote">
<div bgcolor="#ffffff">
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">After searching a bit I think that the problem
is in Glorp in</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">DBXPlatform>>createDataTypesMap<br> "Creates and
returns a map that maps Smalltalk classes to SQL datatypes.<br> The 16r
means it is hexadecimal."<br> ^Dictionary new</font></div>
<div><font face="Arial" size="2">...</font></div>
<div><font face="Arial" size="2"> at: 16rFF put: (DBXTypeNotSupported
type: #UNKNOWN);<br></font></div>
<div><font face="Arial" size="2">Perhaps a solution would be I think it should
be something like</font></div>
<div><font face="Arial" size="2">at: 16rFF put: (DBXTypeNotSupported type:
UndefinedObject);<br></font></div>
<div><font face="Arial" size="2">with a fromDbxString method defined in
UndefinedObject.</font></div>
<div><font face="Arial" size="2">fromDbxString: aString</font></div>
<div><font face="Arial" size="2"> ^ convert the string to the
true column datatype</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">The problem here is that there should be a
conversion from the string to the column datatype and the column datatype is
unknown here...</font></div>
<div><font face="Arial" size="2">I don't know either if it is possible to get it
from squeakdbx at this point (while fetching data) ?</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2"></font> </div>
<blockquote style="border-left:#000000 2px solid;padding-left:5px;padding-right:0px;margin-left:5px;margin-right:0px">
<div>"Mariano Martinez Peck" <<a href="mailto:marianopeck@gmail.com" target="_blank">marianopeck@gmail.com</a>>
a écrit dans le message de <a href="news:CAA+-=mWQ8y4zLdQbhDx3-hBPXUF_-S9wtvVOD8ia+=6tC8-ufg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org" target="_blank">news:CAA+-=mWQ8y4zLdQbhDx3-hBPXUF_-S9wtvVOD8ia+=6tC8-ufg@mail.gmail.com</a>...</div>
<div>
<div></div>
<div><br><br>
<div class="gmail_quote">On Thu, Aug 11, 2011 at 10:02 PM, Alain Rastoul
<span dir="ltr"><<a href="mailto:alr.dev@free.fr" target="_blank">alr.dev@free.fr</a>></span>
wrote:<br>
<blockquote style="border-left:#ccc 1px solid;margin:0px 0px 0px 0.8ex;padding-left:1ex" class="gmail_quote">Hi<br><br>I 'm writing a small app with pharo +seaside
+ glorp + squeakdbx + sqlite and I have a problem reading null values
from my database.<br></blockquote>
<div><font face="Arial" size="2"></font><font face="Arial" size="2"></font><br>Hi
Alain. Do you know exactly which query is being sent? Do you
think it can be related to this: <a href="http://code.google.com/p/dbxtalk/issues/detail?id=10" target="_blank">http://code.google.com/p/dbxtalk/issues/detail?id=10</a>
?<br><br> </div>
<blockquote style="border-left:rgb(204,204,204) 1px solid;margin:0pt 0pt 0pt 0.8ex;padding-left:1ex" class="gmail_quote">It seems that glorp stores a DbxTypeNotSupported in
the column description for null values when the first row has a null
value (the column datatype is varchar).<br>Any workaround or advice is
welcome before I dig into Glorp code<br>TIA<br><font color="#888888"><br>Alain <br><br><br></font></blockquote></div><br><br clear="all"><br>-- <br>Mariano<br><a href="http://marianopeck.wordpress.com" target="_blank">http://marianopeck.wordpress.com</a><br>
<br></div></div></blockquote></div></blockquote></div><br></div></div></blockquote>
</blockquote></div><br><br clear="all"><br>-- <br>Mariano<br><a href="http://marianopeck.wordpress.com" target="_blank">http://marianopeck.wordpress.com</a><br><br>