Login Register Actian.com  

Actian Community Forum


Go Back   Actian Community Forums > Vectorwise > Vectorwise Discussion
 

Reply
 
LinkBack Thread Tools Display Modes
Old 2010-08-09   #1 (permalink)
Ingres Community
 
kuonirat's Avatar
 
Join Date: May 2010
Location: Poland
Posts: 338
Blog Entries: 3
Default POSITION() overflow (RESOLVED)

Hi!

Take a look at this:

Code:
drop table t;
create table t (
    c varchar(255) not null
) with structure = vectorwise;

insert into t values('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxa');

select 
position('a', c) as p,
position('a', c) + 1 as pa,
locate(c, 'a') as l,
locate(c, 'a') + 1 as la
from t

\g
This is the output:

Code:
┌─────────────┬──────────────────────┬─────────────┬──────────────────────┐
│p            │pa                    │l            │la                    │
├─────────────┼──────────────────────┼─────────────┼──────────────────────┤
│          127│                  -128│          127│                   128│
└─────────────┴──────────────────────┴─────────────┴──────────────────────┘
So the POSITION function returns a signed byte, which overflows within the +1 expression. There is no such problem with standard ingres table or when LOCATE function is used instead of POSITION.

Best regards!
__________________
Konrad Procak
kuonirat is offline   Reply With Quote
Old 2010-08-09   #2 (permalink)
Ingres Community
 
marcin's Avatar
 
Join Date: Oct 2008
Location: Amsterdam, NL
Posts: 277
Default

Thanks Konrad, this one is actually improved in the dev trunk, but we'll try to fix it for 1.0 as well.

Mantis #933 for people tracking this.
marcin is offline   Reply With Quote
Old 2010-08-12   #3 (permalink)
Ingres Community
 
marcin's Avatar
 
Join Date: Oct 2008
Location: Amsterdam, NL
Posts: 277
Default

Btw, did I mention this is fixed? But, unfortunately, the latest build did not pick it up yet, so it will come in the following one.
marcin is offline   Reply With Quote
Old 2010-09-02   #4 (permalink)
Moderator
 
Join Date: Aug 2009
Location: Redwood City, CA
Posts: 297
Blog Entries: 1
Default

This issue is fixed in the now available 1.0/11402 build.
zelaine is offline   Reply With Quote

Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


© 2011 Actian Corporation. All Rights Reserved