[SqueakDBX] Re: [Pharo-users] DBXTypeNotSupoorted with Glorp
Mariano Martinez Peck
marianopeck at gmail.com
Fri Aug 12 20:28:58 UTC 2011
On Fri, Aug 12, 2011 at 9:39 PM, Alain Rastoul <alr.dev at free.fr> wrote:
> hi Guillermo,
> you are right, I didn't use rawValues , and that was the problem.
> 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)
> I have a simpler test to reproduce than yours (in fact you don't need to
> use UNION in your test):
Hi Alain. First of all, thanks for poiting out the bug.
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.
You will have more news very soon, but I recommend you to migrate to this
new stuff once it is out.
> | settings dbc stmt resultSet coll |
> settings := DBXConnectionSettings
> host: SmalltalkImage current imagePath, '/'
> port: ''
> database: 'testdb.dat'
> userName: ''
> userPassword: ''.
> dbc := DBXConnection platform: DBXSqlitePlatform new settings: settings.
> dbc connect.
> dbc open.
> dbc execute: 'drop table if exists foo'.
> dbc execute: 'create table foo (id int not null, name varchar(64) null )'.
> dbc execute: 'insert into foo values(1, null )'.
> dbc execute: 'insert into foo values(2, ''riptobe'' )'.
> resultSet := dbc execute: 'SELECT * FROM foo'.
> coll := OrderedCollection new.
> "error here for null value in second row"
> resultSet rows do: [ :r | coll add: r values ].
> coll inspect.
> ] ensure: [ dbc close ].
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
We really welcome your test :)
You can add it to: DBXQueryTest. Take a look at to the existing tests there.
> 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 (?)
Can you confirm it is this problem?
If it is...then it seems there is no fix :(
> 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
> I am writing a test case for that,
> and I will also have a look at opendbx source code.
great. Don't be shy to ask to ask and OpenDBX mailing list.
> "Guillermo Polito" <guillermopolito at gmail.com> a écrit dans le message de
> news: CAOBmb52JNRM+xQBx9kqNm9aMero3avyriXWsytbMqK=JBH8KAg at mail.gmail.com
> Hi Alain!
> where did you get GlorpDBX? :) Was it from the DBXTalk repo?
> On Thu, Aug 11, 2011 at 5:28 PM, Alain Rastoul <
> alr.dev-GANU6spQydw at public.gmane.org <alr.dev at free.fr>> wrote:
>> Hi Mariano
>> I may be wrong, but I don't think that this issue is not related, I have
>> first checked that reading my data with squeakdbx is ok.
> How did you read the data? Using values or raw values?
> Can you send us/me the query sent by glorp? Is it a polymorphic or
> inheritance query?
>> After searching a bit I think that the problem is in Glorp in
>> "Creates and returns a map that maps Smalltalk classes to SQL datatypes.
>> The 16r means it is hexadecimal."
>> ^Dictionary new
>> at: 16rFF put: (DBXTypeNotSupported type: #UNKNOWN);
>> Perhaps a solution would be I think it should be something like
>> at: 16rFF put: (DBXTypeNotSupported type: UndefinedObject);
>> with a fromDbxString method defined in UndefinedObject.
>> fromDbxString: aString
>> ^ convert the string to the true column datatype
>> The problem here is that there should be a conversion from the string to
>> the column datatype and the column datatype is unknown here...
>> I don't know either if it is possible to get it from squeakdbx at this
>> point (while fetching data) ?
>> "Mariano Martinez Peck" <marianopeck at gmail.com> a écrit dans le message
>> news:CAA+-=mWQ8y4zLdQbhDx3-hBPXUF_-S9wtvVOD8ia+=6tC8-ufg at mail.gmail.com<news:CAA+-=mWQ8y4zLdQbhDx3-hBPXUF_-S9wtvVOD8ia+=6tC8-ufg-JsoAwUIsXosN+BqQ9rBEUg at public.gmane.org>
>> On Thu, Aug 11, 2011 at 10:02 PM, Alain Rastoul <alr.dev at free.fr> wrote:
>>> I 'm writing a small app with pharo +seaside + glorp + squeakdbx + sqlite
>>> and I have a problem reading null values from my database.
>> Hi Alain. Do you know exactly which query is being sent? Do you think it
>> can be related to this:
>> http://code.google.com/p/dbxtalk/issues/detail?id=10 ?
>>> 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).
>>> Any workaround or advice is welcome before I dig into Glorp code
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SqueakDBX