|
1 | 1 | #------------------------------------------------------------------------------ |
2 | | -# Copyright (c) 2020, 2022, Oracle and/or its affiliates. |
| 2 | +# Copyright (c) 2020, 2023, Oracle and/or its affiliates. |
3 | 3 | # |
4 | 4 | # This software is dual-licensed to you under the Universal Permissive License |
5 | 5 | # (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License |
@@ -826,5 +826,24 @@ def test_4364_binds_between_comment_blocks(self): |
826 | 826 | from dual""") |
827 | 827 | self.assertEqual(self.cursor.bindnames(), ["A", "B"]) |
828 | 828 |
|
| 829 | + def test_4365_add_column_to_cached_query(self): |
| 830 | + "4365 - test addition of column to cached query" |
| 831 | + table_name = "test_4365" |
| 832 | + try: |
| 833 | + self.cursor.execute(f"drop table {table_name}") |
| 834 | + except: |
| 835 | + pass |
| 836 | + data = ('val 1', 'val 2') |
| 837 | + self.cursor.execute(f"create table {table_name} (col1 varchar2(10))") |
| 838 | + self.cursor.execute(f"insert into {table_name} values (:1)", [data[0]]) |
| 839 | + self.connection.commit() |
| 840 | + self.cursor.execute(f"select * from {table_name}") |
| 841 | + self.assertEqual(self.cursor.fetchall(), [(data[0],)]) |
| 842 | + self.cursor.execute(f"alter table {table_name} add col2 varchar2(10)") |
| 843 | + self.cursor.execute(f"update {table_name} set col2 = :1", [data[1]]) |
| 844 | + self.connection.commit() |
| 845 | + self.cursor.execute(f"select * from {table_name}") |
| 846 | + self.assertEqual(self.cursor.fetchall(), [data]) |
| 847 | + |
829 | 848 | if __name__ == "__main__": |
830 | 849 | test_env.run_test_cases() |
0 commit comments