Login Register Actian.com  

Actian Community Forum


Go Back   Actian Community Forums > Ingres Forums > Database General
 

Reply
 
LinkBack Thread Tools Display Modes
Old 2012-02-09   #1 (permalink)
Ingres Community
 
Join Date: Jul 2010
Location: UK
Posts: 192
Blog Entries: 1
Default It's dumb, but is it a bug?

Hi,
Running the SQL below (in Ingres 10), the first insert into x works, the second gives an integer overflow.
The failure relies on rather a poor design decision that's easily prevented, but just out of interest - a bug or not?
G

Code:
create sequence seq_int8;

create table x(
  a integer not null with default seq_int8.nextval, -- D'oh!
  b integer not null);

create table y (b integer not null);

insert into y values (1);
insert into y values (2);
insert into y values (3);

insert into x(b) select first 1 b from y;
insert into x(b) select first 1 b from y order by 1;
geraintjones is online now   Reply With Quote
Old 2012-02-10   #2 (permalink)
fba
Ingres Community
 
fba's Avatar
 
Join Date: Dec 2009
Location: Belgium/France
Posts: 196
Default

What is the exact release you are working on?
__________________
Frédéric Barbier
fba is online now   Reply With Quote
Old 2012-02-13   #3 (permalink)
Ingres Community
 
Join Date: Jul 2010
Location: UK
Posts: 192
Blog Entries: 1
Default

> What is the exact release you are working on?

Same results in:

10.0.0 (a64.lnx/132)NPTL +p14228
community edition 10.1.0 (pulled from code.ingres.com a few months ago - rev 4717 I think).

I just thought it was interesting that "order by" should trigger the error.
Obviously using an int8 sequence as a default value for an int4 column isn't the greatest idea anyhow. (Although the fact that in Ingres 10 a sequence is created as int8 if not otherwise specified, whereas it was int4 in previous versions, could catch out the unwary).
geraintjones is online now   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