================================================================
do_test alter2-2.1 {
    execsql {
      CREATE TABLE abc2(a, b, c);
      INSERT INTO abc2 VALUES(1, 2, 10);
      INSERT INTO abc2 VALUES(3, 4, NULL);
      INSERT INTO abc2 VALUES(5, 6, NULL);
      CREATE VIEW abc2_v AS SELECT * FROM abc2;
      SELECT * FROM abc2_v;
    }
  } {1 2 10 3 4 {} 5 6 {}}
  do_test alter2-2.2 {
    # ALTER TABLE abc ADD COLUMN d;
    alter_table abc2 {CREATE TABLE abc2(a, b, c, d);}
    execsql {
      SELECT * FROM abc2_v;
    }
  } {1 2 10 {} 3 4 {} {} 5 6 {} {}}
================================================================
SQLite version 3.5.7
Enter ".help" for instructions
sqlite> CREATE TABLE abc2(a, b, c);
sqlite> INSERT INTO abc2 VALUES(1, 2, 10);
sqlite> INSERT INTO abc2 VALUES(3, 4, NULL);
sqlite> INSERT INTO abc2 VALUES(5, 6, NULL);
sqlite> CREATE VIEW abc2_v AS SELECT * FROM abc2;
sqlite> SELECT * FROM abc2_v;
1|2|10
3|4|
5|6|
sqlite> ALTER TABLE abc2 ADD COLUMN d;
sqlite> SELECT * FROM abc2_v;
1|2|10
3|4|
5|6|
================================================================
I would expect the view to give 4 columns after the alter, not 3.  
as the following direct select shows.

sqlite> SELECT * FROM abc2;
1|2|10|
3|4||
5|6||



Regards,

Noah



CONFIDENTIALITY NOTICE: 
This message may contain confidential and/or privileged information. If you are 
not the addressee or authorized to receive this for the addressee, you must not 
use, copy, disclose, or take any action based on this message or any 
information herein. If you have received this message in error, please advise 
the sender immediately by reply e-mail and delete this message. Thank you for 
your cooperation.


_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to