@@ -3188,6 +3188,57 @@ test_result_t test_lang_update() {
31883188 "t" ,
31893189 "(table [id val] (list [1i 2i 3i] [100i 300i 450i]))" );
31903190
3191+ // ========== SYMBOL/TIMESTAMP UPDATE TESTS (regression for set_ids type handling) ==========
3192+
3193+ // Test 42: Update symbol column with symbol atom value and where clause
3194+ TEST_ASSERT_EQ (
3195+ "(set t (table [id name age] (list [1 2 3] ['alice 'bob 'charlie] [10 20 30])))"
3196+ "(update {name: 'baba from: 't where: (== age 10)})"
3197+ "t" ,
3198+ "(table [id name age] (list [1 2 3] [baba bob charlie] [10 20 30]))" );
3199+
3200+ // Test 43: Update symbol column with symbol atom value (multiple rows match)
3201+ TEST_ASSERT_EQ (
3202+ "(set t (table [id name age] (list [1 2 3] ['alice 'bob 'charlie] [10 20 10])))"
3203+ "(update {name: 'updated from: 't where: (== age 10)})"
3204+ "t" ,
3205+ "(table [id name age] (list [1 2 3] [updated bob updated] [10 20 10]))" );
3206+
3207+ // Test 44: Update symbol column without where clause (all rows)
3208+ TEST_ASSERT_EQ (
3209+ "(set t (table [id name] (list [1 2 3] ['x 'y 'z])))"
3210+ "(update {name: 'same from: 't})"
3211+ "t" ,
3212+ "(table [id name] (list [1 2 3] [same same same]))" );
3213+
3214+ // Test 45: Update timestamp column with timestamp atom value and where clause
3215+ TEST_ASSERT_EQ (
3216+ "(set t (table [id ts val] (list [1 2 3] [2024.01.01D00:00:00.0 2024.01.02D00:00:00.0 2024.01.03D00:00:00.0] [10 20 30])))"
3217+ "(update {ts: 2025.06.15D12:30:00.0 from: 't where: (== val 20)})"
3218+ "t" ,
3219+ "(table [id ts val] (list [1 2 3] [2024.01.01D00:00:00.000000000 2025.06.15D12:30:00.000000000 2024.01.03D00:00:00.000000000] [10 20 30]))" );
3220+
3221+ // Test 46: Update timestamp column with timestamp atom value (multiple rows match)
3222+ TEST_ASSERT_EQ (
3223+ "(set t (table [id ts val] (list [1 2 3] [2024.01.01D00:00:00.0 2024.01.02D00:00:00.0 2024.01.03D00:00:00.0] [10 20 10])))"
3224+ "(update {ts: 2099.12.31D23:59:59.0 from: 't where: (== val 10)})"
3225+ "t" ,
3226+ "(table [id ts val] (list [1 2 3] [2099.12.31D23:59:59.000000000 2024.01.02D00:00:00.000000000 2099.12.31D23:59:59.000000000] [10 20 10]))" );
3227+
3228+ // Test 47: Update timestamp column without where clause (all rows)
3229+ TEST_ASSERT_EQ (
3230+ "(set t (table [id ts] (list [1 2 3] [2024.01.01D00:00:00.0 2024.01.02D00:00:00.0 2024.01.03D00:00:00.0])))"
3231+ "(update {ts: 2000.01.01D00:00:00.0 from: 't})"
3232+ "t" ,
3233+ "(table [id ts] (list [1 2 3] [2000.01.01D00:00:00.000000000 2000.01.01D00:00:00.000000000 2000.01.01D00:00:00.000000000]))" );
3234+
3235+ // Test 48: Update both symbol and timestamp columns in same update
3236+ TEST_ASSERT_EQ (
3237+ "(set t (table [id name ts] (list [1 2] ['alice 'bob] [2024.01.01D00:00:00.0 2024.01.02D00:00:00.0])))"
3238+ "(update {name: 'updated ts: 2025.01.01D00:00:00.0 from: 't where: (== id 1)})"
3239+ "t" ,
3240+ "(table [id name ts] (list [1 2] [updated bob] [2025.01.01D00:00:00.000000000 2024.01.02D00:00:00.000000000]))" );
3241+
31913242 PASS ();
31923243}
31933244
0 commit comments