Closed (won't fix)
Project:
Drupal core
Version:
8.0.x-dev
Component:
postgresql db driver
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
9 Sep 2015 at 10:09 UTC
Updated:
4 Feb 2016 at 12:52 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
alexpottInterestingly
Drupal\system\Tests\Database\SchemaTestpasses regardless of this setting. But also the length in Postgres seems to be correct with this on.Comment #3
alexpottOkay let's see what happens in the entire test suite if
standard_conforming_stringsis off. I think it'll be green.Comment #4
bzrudi71 commentedWell, I think we should keep standard_conforming_strings ON. Since PostgreSQL 9.1 the default is ON, so now for over 4 years, and I'm pretty sure they changed the default to ON for some good reasons. I think it's always best to go with the defaults.
Comment #5
alexpottForgot to update some tests in #3.
Comment #6
dgv commentedThe default for PostgreSQL "
standard_conforming_strings" is to ON since 9.1 because PostgreSQL aims at conforming to the SQL standard by default. The standard says that backslash is a normal character.MySQL has a setting which does exactly the same thing:
NO_BACKSLASH_ESCAPESin sql_mode since version 5.0.1. See http://dev.mysql.com/doc/refman/5.6/en/sql-mode.htmlThe crucial point is that with both defaults, MySQL is the opposite of PostgreSQL 9.1+, meaning that backslash quotes the next character, as in PHP strings.
As Drupal aims at cross-database compatibility, it should adopt settings that make queries compatible across the supported engines. To me it's the PostgreSQL setting that should be aligned to MySQL's default, because MySQL is the majority and most people who produce queries are not even aware that backslash might be something else than a quote character.
Comment #7
alexpott@dgv I understand what you are saying but now we're in the weird situation that Drupal\system\Tests\Update\UpdatePathTestBaseFilledTest passes with standard conforming strings on but not with it off. Maybe #2565259: Some route serializations in update test database dumps are broken will fix this.
Comment #10
jaredsmith commentedI have to agree with @bzrudi71 here. In an ideal world, we'd be able to set "standard_conforming_strings" to ON, and fix up any tests (or code) that wasn't working with it set to ON. It's been the default in PostgreSQL for many years, and given the expected lifespan of Drupal 8, I'd hate to be dependent on deprecated way of handling escaping for the next several years into the future.
I understand that doing that means that it's different than the MySQL default -- which is unfortunate.
I'm trying to requeue the tests now that #2565259: Some route serializations in update test database dumps are broken has been committed, but it seems the Drupal CI system is having problems this morning.
Comment #11
jaredsmith commentedOK, looks like this patch might need a re-roll, as it looks like the patch no longer applies:
Comment #12
jaredsmith commentedRe-rolling the patch from comment 5, as it no longer applies to head.
Comment #13
jaredsmith commentedComment #14
alexpottSo this is cool - core seems to be independent of this setting - which feels correct so now we have to choose was is correct. I think going with the Postgres default sounds sensible.
Comment #15
alexpottI'm closing this as a won't fix - because @jaredsmith and @bzrudi71 have pointed out that going with the postgres default is a good idea and that's what've done. I think as long as people use the database api then we'll be okay even though the MySQL/Maria defaults are different.