[MonetDB-users] Is it a bug? (insert into ... select command)
Hi I need to insert some null values into a table via a procedure. I created the table and did insert two rows. One with (insert into) command and second with (insert into ..select) command. Both commands work well and I could see two rows added in result. When I used the same (insert into.. select) command in a procedure. It behaves in a strange fashion. It shows that a row has been affected, but does not show the newly added row. If the rows are counted, it gives the correct count which is (3) in this case but still I could not see the last row which is added via a procedure. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' create sequence "ff" as integer start with 1; CREATE TABLE t1(timeid INT DEFAULT NEXT VALUE FOR "ff" PRIMARY KEY, a INT, b INT, c INT, d INT, e INT, f VARCHAR(20), g VARCHAR(20), h INT, i VARCHAR(10), j VARCHAR(10), k VARCHAR(10), l INT, m INT, n VARCHAR(10), o VARCHAR(10), p VARCHAR(10), q VARCHAR(15), r INT ); ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' And then insert a row ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' insert into t1(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r) values(1, 1, 1, 1, 1, 'first row', 'first row',1, 'first row', 'first row', 'first row',1,1, 'first row', 'first row', 'first row', 'first row', 1); select * from t1;sql>sql>sql>sql>more>more>more>more>more>more>more>more>more>more>more>more>more>more>more>more>more>more>more>sql> sql>Rows affected 1 sql> +------+--+--+--+--+--+-----+-----+--+-----+------+------+--+--+------+------+------+------+--+ | time |a |b |c |d |e |f |g |h |i |j |k |l |m |n |o |p |q |r | : id | | | | | | | | | | | | | | | | | | | +======+==+==+==+==+==+=====+=====+==+=====+======+======+==+==+======+======+======+======+==+ | 1 |1 |1 |1 |1 |1 |firs |firs |1 |firs |first |first |1 |1 |first |first |first |first |1 | : | | | | | |t |t | |t |row |row | | |row |row |row |row | | : | | | | | |row |row | |row | | | | | | | | | | +------+--+--+--+--+--+-----+-----+--+-----+------+------+--+--+------+------+------+------+--+ '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Every thing is fine so far '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' sql>insert into t1(a, b, c, d, e, f, g, h) select a, b, c, d, e, f, g, h from t1 where timeid = 1; Rows affected 1 sql>select * from t1; +------+--+--+--+--+--+-----+-----+--+-----+------+------+--+--+------+------+------+------+--+ | time |a |b |c |d |e |f |g |h |i |j |k |l |m |n |o |p |q |r | : id | | | | | | | | | | | | | | | | | | | +======+==+==+==+==+==+=====+=====+==+=====+======+======+==+==+======+======+======+======+==+ | 1 |1 |1 |1 |1 |1 |firs |firs |1 |firs |first |first |1 |1 |first |first |first |first |1 | : | | | | | |t |t | |t |row |row | | |row |row |row |row | | : | | | | | |row |row | |row | | | | | | | | | | | 2 |1 |1 |1 |1 |1 |firs |firs |1 |null |null |null |n |n |null |null |null |null |n | : | | | | | |t |t | | | | |u |u | | | | |u | : | | | | | |row |row | | | | |l |l | | | | |l | : | | | | | | | | | | | |l |l | | | | |l | +------+--+--+--+--+--+-----+-----+--+-----+------+------+--+--+------+------+------+------+--+ ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' inserted another row and it works fine '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' sql>create procedure tt() begin insert into t1(a, b, c, d, e, f, g, h) select a, b, c, d, e, f, g, h from t1 where timeid = 1; end; call tt(); select * from t1; more>more>more> sql>Rows affected 1 sql>+------+--+--+--+--+--+-----+-----+--+-----+------+------+--+--+------+------+------+------+--+ | time |a |b |c |d |e |f |g |h |i |j |k |l |m |n |o |p |q |r | : id | | | | | | | | | | | | | | | | | | | +======+==+==+==+==+==+=====+=====+==+=====+======+======+==+==+======+======+======+======+==+ | 1 |1 |1 |1 |1 |1 |firs |firs |1 |firs |first |first |1 |1 |first |first |first |first |1 | : | | | | | |t |t | |t |row |row | | |row |row |row |row | | : | | | | | |row |row | |row | | | | | | | | | | | 2 |1 |1 |1 |1 |1 |firs |firs |1 |null |null |null |n |n |null |null |null |null |n | : | | | | | |t |t | | | | |u |u | | | | |u | : | | | | | |row |row | | | | |l |l | | | | |l | : | | | | | | | | | | | |l |l | | | | |l | +------+--+--+--+--+--+-----+-----+--+-----+------+------+--+--+------+------+------+------+--+ ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' The problem starts now: when I try to insert the row via a procedure it shows that row effected 1 but does not show the row. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' sql>select count(*) from t1; +--------+ | count_ | +========+ | 3 | +--------+ sql>select timeid from t1; +--------+ | timeid | +========+ | 1 | | 2 | | 3 | +--------+ sql>select * from t1; +------+--+--+--+--+--+-----+-----+--+-----+------+------+--+--+------+------+------+------+--+ | time |a |b |c |d |e |f |g |h |i |j |k |l |m |n |o |p |q |r | : id | | | | | | | | | | | | | | | | | | | +======+==+==+==+==+==+=====+=====+==+=====+======+======+==+==+======+======+======+======+==+ | 1 |1 |1 |1 |1 |1 |firs |firs |1 |firs |first |first |1 |1 |first |first |first |first |1 | : | | | | | |t |t | |t |row |row | | |row |row |row |row | | : | | | | | |row |row | |row | | | | | | | | | | | 2 |1 |1 |1 |1 |1 |firs |firs |1 |null |null |null |n |n |null |null |null |null |n | : | | | | | |t |t | | | | |u |u | | | | |u | : | | | | | |row |row | | | | |l |l | | | | |l | : | | | | | | | | | | | |l |l | | | | |l | +------+--+--+--+--+--+-----+-----+--+-----+------+------+--+--+------+------+------+------+--+ sql> ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' I could not see the 3rd row *********************************** Regards, Nadeem -- View this message in context: http://www.nabble.com/Is-it-a-bug--%28insert-into-...-select-command%29-tp16... Sent from the monetdb-users mailing list archive at Nabble.com.
On Thu, Apr 24, 2008 at 08:12:11AM -0700, Iftikharn wrote:
Hi
I need to insert some null values into a table via a procedure.
I created the table and did insert two rows. One with (insert into) command and second with (insert into ..select) command. Both commands work well and I could see two rows added in result.
When I used the same (insert into.. select) command in a procedure. It behaves in a strange fashion. It shows that a row has been affected, but does not show the newly added row. If the rows are counted, it gives the correct count which is (3) in this case but still I could not see the last row which is added via a procedure.
Indeed this seems a bug. Could you please file it at sourceforge? Niels
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
create sequence "ff" as integer start with 1; CREATE TABLE t1(timeid INT DEFAULT NEXT VALUE FOR "ff" PRIMARY KEY, a INT, b INT, c INT, d INT, e INT, f VARCHAR(20), g VARCHAR(20), h INT, i VARCHAR(10), j VARCHAR(10), k VARCHAR(10), l INT, m INT, n VARCHAR(10), o VARCHAR(10), p VARCHAR(10), q VARCHAR(15), r INT );
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' And then insert a row '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
insert into t1(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r) values(1, 1, 1, 1, 1, 'first row', 'first row',1, 'first row', 'first row', 'first row',1,1, 'first row', 'first row', 'first row', 'first row', 1); select * from t1;sql>sql>sql>sql>more>more>more>more>more>more>more>more>more>more>more>more>more>more>more>more>more>more>more>sql>
sql>Rows affected 1 sql> +------+--+--+--+--+--+-----+-----+--+-----+------+------+--+--+------+------+------+------+--+ | time |a |b |c |d |e |f |g |h |i |j |k |l |m |n |o |p |q |r | : id | | | | | | | | | | | | | | | | | | | +======+==+==+==+==+==+=====+=====+==+=====+======+======+==+==+======+======+======+======+==+ | 1 |1 |1 |1 |1 |1 |firs |firs |1 |firs |first |first |1 |1 |first |first |first |first |1 | : | | | | | |t |t | |t |row |row | | |row |row |row |row | | : | | | | | |row |row | |row | | | | | | | | | | +------+--+--+--+--+--+-----+-----+--+-----+------+------+--+--+------+------+------+------+--+
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Every thing is fine so far ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
sql>insert into t1(a, b, c, d, e, f, g, h) select a, b, c, d, e, f, g, h from t1 where timeid = 1; Rows affected 1
sql>select * from t1; +------+--+--+--+--+--+-----+-----+--+-----+------+------+--+--+------+------+------+------+--+ | time |a |b |c |d |e |f |g |h |i |j |k |l |m |n |o |p |q |r | : id | | | | | | | | | | | | | | | | | | | +======+==+==+==+==+==+=====+=====+==+=====+======+======+==+==+======+======+======+======+==+ | 1 |1 |1 |1 |1 |1 |firs |firs |1 |firs |first |first |1 |1 |first |first |first |first |1 | : | | | | | |t |t | |t |row |row | | |row |row |row |row | | : | | | | | |row |row | |row | | | | | | | | | | | 2 |1 |1 |1 |1 |1 |firs |firs |1 |null |null |null |n |n |null |null |null |null |n | : | | | | | |t |t | | | | |u |u | | | | |u | : | | | | | |row |row | | | | |l |l | | | | |l | : | | | | | | | | | | | |l |l | | | | |l | +------+--+--+--+--+--+-----+-----+--+-----+------+------+--+--+------+------+------+------+--+
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' inserted another row and it works fine ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
sql>create procedure tt() begin insert into t1(a, b, c, d, e, f, g, h) select a, b, c, d, e, f, g, h from t1 where timeid = 1; end;
call tt();
select * from t1;
more>more>more>
sql>Rows affected 1
sql>+------+--+--+--+--+--+-----+-----+--+-----+------+------+--+--+------+------+------+------+--+ | time |a |b |c |d |e |f |g |h |i |j |k |l |m |n |o |p |q |r | : id | | | | | | | | | | | | | | | | | | | +======+==+==+==+==+==+=====+=====+==+=====+======+======+==+==+======+======+======+======+==+ | 1 |1 |1 |1 |1 |1 |firs |firs |1 |firs |first |first |1 |1 |first |first |first |first |1 | : | | | | | |t |t | |t |row |row | | |row |row |row |row | | : | | | | | |row |row | |row | | | | | | | | | | | 2 |1 |1 |1 |1 |1 |firs |firs |1 |null |null |null |n |n |null |null |null |null |n | : | | | | | |t |t | | | | |u |u | | | | |u | : | | | | | |row |row | | | | |l |l | | | | |l | : | | | | | | | | | | | |l |l | | | | |l | +------+--+--+--+--+--+-----+-----+--+-----+------+------+--+--+------+------+------+------+--+
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' The problem starts now: when I try to insert the row via a procedure it shows that row effected 1 but does not show the row. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
sql>select count(*) from t1; +--------+ | count_ | +========+ | 3 | +--------+
sql>select timeid from t1; +--------+ | timeid | +========+ | 1 | | 2 | | 3 | +--------+ sql>select * from t1; +------+--+--+--+--+--+-----+-----+--+-----+------+------+--+--+------+------+------+------+--+ | time |a |b |c |d |e |f |g |h |i |j |k |l |m |n |o |p |q |r | : id | | | | | | | | | | | | | | | | | | | +======+==+==+==+==+==+=====+=====+==+=====+======+======+==+==+======+======+======+======+==+ | 1 |1 |1 |1 |1 |1 |firs |firs |1 |firs |first |first |1 |1 |first |first |first |first |1 | : | | | | | |t |t | |t |row |row | | |row |row |row |row | | : | | | | | |row |row | |row | | | | | | | | | | | 2 |1 |1 |1 |1 |1 |firs |firs |1 |null |null |null |n |n |null |null |null |null |n | : | | | | | |t |t | | | | |u |u | | | | |u | : | | | | | |row |row | | | | |l |l | | | | |l | : | | | | | | | | | | | |l |l | | | | |l | +------+--+--+--+--+--+-----+-----+--+-----+------+------+--+--+------+------+------+------+--+ sql>
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' I could not see the 3rd row ***********************************
Regards,
Nadeem -- View this message in context: http://www.nabble.com/Is-it-a-bug--%28insert-into-...-select-command%29-tp16... Sent from the monetdb-users mailing list archive at Nabble.com.
------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javao... _______________________________________________ MonetDB-users mailing list MonetDB-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-users
-- Niels Nes, Centre for Mathematics and Computer Science (CWI) Kruislaan 413, 1098 SJ Amsterdam, The Netherlands room C0.02, phone ++31 20 592-4098, fax ++31 20 592-4312 url: http://www.cwi.nl/~niels e-mail: Niels.Nes@cwi.nl
participants (2)
-
Iftikharn
-
Niels Nes