Problem with TakePage linq extension method (Sybase ASE)

Posts   
 
    
Posts: 22
Joined: 01-Feb-2011
# Posted on: 10-Feb-2011 10:23:46   

I'm having problems with the TakePage extension method in combination with the Sybase ASE driver.

The query that is build dynamically, creates a temporary table with a nullable bit field. However. Howver, because sybase doesn't allow nullable bit fields, an exception is thrown.

Is there a work around for this Sybase shortcoming or does this mean that I cannot use the TakePage method (and probably other methods as well)?

Thanks in advance

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 10-Feb-2011 10:46:08   

Which LLBLGen Pro runtime library version (build number) are you using?

Posts: 22
Joined: 01-Feb-2011
# Posted on: 10-Feb-2011 11:42:12   

Version 3.0.0.0.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39908
Joined: 17-Aug-2003
# Posted on: 10-Feb-2011 11:51:24   

This is a bug in our DQE for Sybase ASE it seems, it generates a nullable column for bit typed fields.

Is the 'bit' type the only type which isn't nullable in Sybase, do you perhaps have a link to ASE documentation which describes this, so we can adjust these as well?

It could give problems though: if due to a left join or inheritance fetch (which uses left joins) the bit field is NULL, paging will fail because of this as a NULL value is inserted into the column. The temptable should then perhaps get a default constraint, but I don't know for sure if these are allowed on a temptable in sybase ASE

Frans Bouma | Lead developer LLBLGen Pro
Posts: 22
Joined: 01-Feb-2011
# Posted on: 10-Feb-2011 13:19:20   

I've looked in the sybase ase documentation, and it seems that only the bit datatype cannot be NULL.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39908
Joined: 17-Aug-2003
# Posted on: 10-Feb-2011 13:35:28   

ipaqlinux48 wrote:

I've looked in the sybase ase documentation, and it seems that only the bit datatype cannot be NULL.

Ok.

We can fix this for you, however it can crash in left join / inheritance paging because it can insert NULL values into the temp table. I'll see whether we can introduce a default constraint in the temp table definition. Not likely, but hey, it's Sybase so you'll never know wink

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39908
Joined: 17-Aug-2003
# Posted on: 10-Feb-2011 15:43:04   

When I specify a default constraint (like BitField bit default 0 not null), I get: "Variable is not allowed in default", but 0 isn't a variable... disappointed

Anyway, avoiding the default constraint it works. I can't find info whether default constraints are allowed or not, but considering the fact specifying 0 as a default doesn't work, leaves me the suspicion it isn't supported in sybase. Anyway, will build a release build for you.

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39908
Joined: 17-Aug-2003
# Posted on: 10-Feb-2011 15:47:47   

See attached dll for the fix.

Frans Bouma | Lead developer LLBLGen Pro