From 50f7fc690fd4c3696e8892b3ed045f4e4888e766 Mon Sep 17 00:00:00 2001 From: kiho-um Date: Thu, 28 Nov 2024 12:26:43 +0900 Subject: [PATCH] [CBRD-25266] (bugfix) CSQL core dump when an undefined column name in a Static SQL Insert statement --- .../21_insert_column_name_undefined.answer | 15 +++++++++++++++ .../cases/21_insert_column_name_undefined.sql | 17 +++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 sql/_05_plcsql/_01_testspec/_05_bug_fix/answers/21_insert_column_name_undefined.answer create mode 100644 sql/_05_plcsql/_01_testspec/_05_bug_fix/cases/21_insert_column_name_undefined.sql diff --git a/sql/_05_plcsql/_01_testspec/_05_bug_fix/answers/21_insert_column_name_undefined.answer b/sql/_05_plcsql/_01_testspec/_05_bug_fix/answers/21_insert_column_name_undefined.answer new file mode 100644 index 0000000000..d720fef103 --- /dev/null +++ b/sql/_05_plcsql/_01_testspec/_05_bug_fix/answers/21_insert_column_name_undefined.answer @@ -0,0 +1,15 @@ +=================================================== +0 + +=================================================== +0 + +=================================================== +Error:-1360 +In line 3, column 1 +Stored procedure compile error: Semantic: before ' values(1, 2)' +Class of [dba.ttt] does not have attribute j. insert into [dba.ttt] (i, ?:0 ) values (1, 2) + +=================================================== +0 + diff --git a/sql/_05_plcsql/_01_testspec/_05_bug_fix/cases/21_insert_column_name_undefined.sql b/sql/_05_plcsql/_01_testspec/_05_bug_fix/cases/21_insert_column_name_undefined.sql new file mode 100644 index 0000000000..e4f89d8e50 --- /dev/null +++ b/sql/_05_plcsql/_01_testspec/_05_bug_fix/cases/21_insert_column_name_undefined.sql @@ -0,0 +1,17 @@ +--+ server-message on +-- Verified for CBRD-25266 +-- The column name undefined use in a Static SQL Insert statement. +-- error code : +-- [err] Stored procedure compile error: does not have attribute j + +drop table if exists ttt; + +create table ttt (i int); +create or replace procedure poo as +begin + insert into ttt(i, j) values(1, 2); +end; + +drop table ttt; + +--+ server-message off