Giter Site home page Giter Site logo

Comments (5)

SakiTakamachi avatar SakiTakamachi commented on May 24, 2024 1

If I remember correctly, it is officially supported (albeit deprecated)

https://www.sqlite.org/lang_keywords.html

from php-src.

mvorisek avatar mvorisek commented on May 24, 2024

Citing from https://www.sqlite.org/lang_keywords.html

If a keyword in double quotes (ex: "key" or "glob") is used in a context where it cannot be resolved to an identifier but where a string literal is allowed, then the token is understood to be a string literal instead of an identifier.

probably because of this paragraph.

As shown in the dbfiddle.uk and sqlite.org/fiddle/ repros, the "historical mode" is not always used.

Can this "historical mode" be disabled in current PHP releases thru some flag?

For master (if classified as a feature request), I would expect this "historical mode" to be disabled by default. Suppressing missing columns errors by assuming string literals is very dangerous and unwanted.

from php-src.

mvorisek avatar mvorisek commented on May 24, 2024

based on https://www.sqlite.org/quirks.html#double_quoted_string_literals_are_accepted it can be configured like:

sqlite3_db_config(db, SQLITE_DBCONFIG_DQS_DDL, 0, (void*)0);
sqlite3_db_config(db, SQLITE_DBCONFIG_DQS_DML, 0, (void*)0);

man: https://www.sqlite.org/c3ref/c_dbconfig_defensive.html

As of SQLite 3.41.0 (2023-02-21) SQLITE_DBCONFIG_DQS_DDL and SQLTIE_DBCONFIG_DQS_DML are disabled by default in the CLI.

this also explains why the SQLite/native repro does not suffer with this issue

from php-src.

SakiTakamachi avatar SakiTakamachi commented on May 24, 2024

If php accepts this proposed change, it is expected that it will probably break many user environments.

This is definitely a BC Break, and an RFC is required to prohibit it across the board.

Another option is to allow the user to select this, such as using pdo's setAttribute. I don't think an RFC is needed if the default value is the existing behavior.

from php-src.

SakiTakamachi avatar SakiTakamachi commented on May 24, 2024

IMHO, while SQLite supports this feature, php should also be able to take advantage of this. So instead of banning it outright, I think it would be better to have options.

from php-src.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.