Skip to content

*: update QL-LICENSE and STRUTIL-LICENSE. - #74

Merged
qiuyesuifeng merged 2 commits into
masterfrom
qiuyesuifeng/fix-copyright-infringement
Sep 8, 2015
Merged

qiuyesuifeng merged 2 commits into
masterfrom
qiuyesuifeng/fix-copyright-infringement

Conversation

@c4pt0r

@c4pt0r c4pt0r commented Sep 8, 2015

Copy link
Copy Markdown
Member

No description provided.

@coocood

coocood commented Sep 8, 2015

Copy link
Copy Markdown
Member

LGTM

@cznic

cznic commented Sep 8, 2015

Copy link
Copy Markdown

SGTM

@qiuyesuifeng

Copy link
Copy Markdown
Member

LGTM.

qiuyesuifeng added a commit that referenced this pull request Sep 8, 2015
…gement

*: update QL-LICENSE and STRUTIL-LICENSE.
@qiuyesuifeng
qiuyesuifeng merged commit 0db8beb into master Sep 8, 2015
@qiuyesuifeng
qiuyesuifeng deleted the qiuyesuifeng/fix-copyright-infringement branch September 8, 2015 11:39
YuJuncen pushed a commit to YuJuncen/tidb that referenced this pull request Apr 23, 2021
…nd (pingcap#74)

* restore: dump errors while importing each table into the log at the end

* restore: addressed comments to pingcap#74
YuJuncen pushed a commit to YuJuncen/tidb that referenced this pull request Apr 23, 2021
Signed-off-by: Neil Shen <overvenus@gmail.com>
xhebox pushed a commit to xhebox/tidb that referenced this pull request Sep 28, 2021
xhebox pushed a commit to xhebox/tidb that referenced this pull request Oct 8, 2021
okJiang pushed a commit to okJiang/tidb that referenced this pull request Oct 19, 2021
Co-authored-by: Chunzhu Li <lichunzhu@stu.xjtu.edu.cn>
ngaut added a commit to ngaut/tidb that referenced this pull request Aug 2, 2026
…ion point

Go's overflow message ends ` in '<expr>'`. It is built AT THE SIGNATURE
-- builtin_arithmetic.go writes fmt.Sprintf("(%s + %s)", args[0].String(),
args[1].String()) -- so the text is each RESOLVED argument's own String(),
not the statement's source.

Two pieces of plumbing are absent here, and either one alone makes a
hand-written approximation diverge, so this reports the seam rather than
half-building it:

  * a column renders fully qualified, test.t.a. The rewritten
    tidb_expr::Expr::Column holds the path AS WRITTEN; the resolved
    db.table.column lives in the executor's FromScope and the Columns
    trait the evaluator holds cannot be asked for it. The qualifier is
    not unformatted at the raising frame -- it is not there.
  * a literal renders as Go's formatting of the VALUE, not the source
    text: 1e308 comes back as 1e+308. So a restore diverges even for a
    constant-only expression, the case that looks trivially portable.

pingcap#74's generated-column expr_text is NOT reusable: restored with
WITHOUT_SCHEMA_NAME | WITHOUT_TABLE_NAME | NAME_BACK_QUOTES it produces
(`a` + 1), stripping exactly the qualifiers this message needs and
back-quoting the names it leaves bare.

Insertion point recorded in the test doc: tidb_expr::eval_in's
Expr::Binary(op, l, r) arm, which already holds Go's s.args.

The test pins today's class-and-code answer with the target text beside
it, so the divergence is measured rather than forgotten.
@coderabbitai coderabbitai Bot mentioned this pull request Sep 18, 2026
13 tasks
ngaut pushed a commit that referenced this pull request Sep 19, 2026
…m::String

Root-caused the TPC-C ORDER_STATUS latency regression (2-3x vs Go, task
#74): the COM_STMT_EXECUTE decoder collapsed Go's two ExecBinaryParam
families into one PreparedValue::String, and prepared_parameters then
bound every one of them as Datum::Bytes (binary collation). Go splits
these: the BLOB family (TypeBlob/TypeTinyBlob/TypeMediumBlob/
TypeLongBlob) becomes NewBytesDatum, but the string family (TypeVarchar/
TypeString/TypeEnum/TypeSet/TypeGeometry/TypeBit/TypeUnspecified)
becomes NewDatum(string) -- a string datum in the default collation,
the same datum a quoted SQL literal produces.

Binding a prepared `c_last = ?` as a binary-collation Bytes datum made
it incomparable to the coprocessor's own describable form
(PreparedParameterType::of keys the plan cache on the datum kind), so
the predicate was evaluated locally over the whole scanned range
instead of being pushed down -- about 160KB of TiKV rows per query,
roughly 18ms instead of ~1ms.

Fix: split tidb_protocol::PreparedValue::String into String (the
string family) and a new Bytes variant (the BLOB family), matching
Go's own grouping exactly, including the NULL-parameter special case
(BLOB NULL is an empty bytes value, not SQL NULL). prepared_parameters
now binds String parameters through Datum::new_string (default
collation) and Bytes parameters through Datum::new_bytes (binary
collation); Temporal parameters bind through Datum::new_string as well,
since they were already text.

Added a regression test asserting a binary-protocol string parameter
binds the same datum kind a text literal would, and updated the
protocol-level decode tests for the new Bytes variant.

Swept the surrounding parameter-binding, predicate-pushdown, and
index-range code for the same class of bug: none found. The charset-
decode grouping, PreparedParameterType::of, infer_param_type_from_datum,
and the ranger's point-range construction were already written to
Go's exact semantics for both datum kinds; they were only ever fed the
wrong kind from this one boundary.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants