From eaa8edb6f72c0ef3b8e9900c0b84653b0000ee7b Mon Sep 17 00:00:00 2001 From: Pavan-Nambi Date: Fri, 14 Nov 2025 07:41:41 +0530 Subject: [PATCH] don't overwrite col mappings --- asdfghhjkl | Bin 0 -> 8192 bytes core/translate/insert.rs | 4 +++- idk.text | 1 + testing/insert.test | 8 ++++++++ wth.d | 0 5 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 asdfghhjkl create mode 100644 idk.text create mode 100644 wth.d diff --git a/asdfghhjkl b/asdfghhjkl new file mode 100644 index 0000000000000000000000000000000000000000..192c08d9b60bba3e0c3527a518e17c325ca0b854 GIT binary patch literal 8192 zcmeI#F$w}f429uj5j$B6!P1o4XyFB1Wx8$Dy}$}92#O#nJcF0?DrSnUZLH*fOb8FA z`nnwV^~F0o-ygTuZ7pL_m5rH*XiO2)C-*^LV(0!XD$Cbo6u-25OFV)A0tg_000Iag zfB*srAb6~IRZX&{+SbW@{#@kSJdS>X00IagfB*srAb( register: rowid_register, }); } else { - column_mappings[idx_in_table].value_index = Some(value_index); + if column_mappings[idx_in_table].value_index.is_none() { + column_mappings[idx_in_table].value_index = Some(value_index); + } } } else if ROWID_STRS .iter() diff --git a/idk.text b/idk.text new file mode 100644 index 000000000..8fefeafed --- /dev/null +++ b/idk.text @@ -0,0 +1 @@ +bans ok diff --git a/testing/insert.test b/testing/insert.test index e8c270aeb..5d4f9896e 100755 --- a/testing/insert.test +++ b/testing/insert.test @@ -865,3 +865,11 @@ do_execsql_test_in_memory_any_error wrong-column-count-partial-columns-values-to CREATE TABLE t(a, b, c); INSERT INTO t(a) VALUES (1, 2); } + + +# https://github.com/tursodatabase/turso/issues/3951 +do_execsql_test_on_specific_db 1 {:memory:} insert-999999999 { +create table t(a); +insert into t(a, a) values (2, 3); +select * from t; +}{2} \ No newline at end of file diff --git a/wth.d b/wth.d new file mode 100644 index 000000000..e69de29bb