1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// SPDX-License-Identifier: Apache-2.0
//! Effective-column resolution for positional `VALUES`-clause inserts.
use ast;
use crate;
use crate*;
/// Resolve the effective column list for a `VALUES`-clause INSERT/UPSERT.
///
/// A *positional* insert — `INSERT INTO t VALUES (...)` with no explicit
/// column list — must still bind each value to the collection's declared
/// column names. Left alone, `convert_value_rows` falls back to synthetic
/// `col0`, `col1`, ... names for every value (see its `col{i}` fallback
/// below): the row stores fine, but named projections and WHERE predicates
/// can never find it again.
///
/// Named inserts (`columns` already non-empty) and schemaless collections
/// (`info.columns` empty — there is no declared order to bind to) pass
/// through unchanged; the `col{i}` fallback remains the last resort for
/// those.
///
/// Fewer values than declared columns binds by position against the
/// leading columns, consistent with a partial named insert (e.g.
/// `INSERT INTO t (id) VALUES (1)` on a wider table also only binds
/// `id`). More values than declared columns is rejected outright:
/// inventing a `colN` slot for the overflow would reproduce the exact
/// unaddressable-column failure this fix closes.
pub