Second call to Database::GetCachedStatement DCHECKs if SQL statement has leading spaces |
|||
Issue descriptionWhen Database::GetCachedStatement is called a second time for the same statement it will DCHECK if it has leading white space (probably trailing too?). Apparently prepared statements have those spaces trimmed out and so the current comparison between the input and returned statements fails.
,
Nov 16
,
Nov 19
,
Nov 20
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/613b4307ff16548c7f23b8c225bcb5724603b9dc commit 613b4307ff16548c7f23b8c225bcb5724603b9dc Author: Victor Costan <pwnall@chromium.org> Date: Tue Nov 20 05:32:43 2018 sql: Restore strict DCHECK of cached statements SQL. https://crrev.com/c/1338177 relaxed the DCHECKs for sql::Database::GetCachedStatment by allowing the SQL statement argument to have leading and trailing whitespace when compared with the SQL statement reported by SQLite. This CL reverts the relaxed restriction. Instead, GetCachedStatement will also DCHECK that the SQL statement argument matches the SQL statement reported by SQLite when preparing the statement. This will help developers discover non-canonical statements on first use. Bug: 894884 Change-Id: I166f8cda8d5a3980d9858a26507f778bc87ee6cc Reviewed-on: https://chromium-review.googlesource.com/c/1341493 Commit-Queue: Victor Costan <pwnall@chromium.org> Reviewed-by: Joshua Bell <jsbell@chromium.org> Cr-Commit-Position: refs/heads/master@{#609605} [modify] https://crrev.com/613b4307ff16548c7f23b8c225bcb5724603b9dc/sql/database.cc [modify] https://crrev.com/613b4307ff16548c7f23b8c225bcb5724603b9dc/sql/database.h [modify] https://crrev.com/613b4307ff16548c7f23b8c225bcb5724603b9dc/sql/database_unittest.cc
,
Nov 28
From this latest CL I am assuming that the trailing/leading white space case is being considered an unsupported way of writing a SQL statement. Is this interpretation correct? |
|||
►
Sign in to add a comment |
|||
Comment 1 by bugdroid1@chromium.org
, Nov 16