We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
В конструктор надо добавить в $options возможность итерации по массиву sql_modes
sql_modes
'ONLY_FULL_GROUP_BY' => true|false
Для true: SET @@sql_mode = CONCAT(@@sql_mode, ',', 'ONLY_FULL_GROUP_BY'); Для false:
SET @@sql_mode = CONCAT(@@sql_mode, ',', 'ONLY_FULL_GROUP_BY');
SET @@sql_mode = REPLACE( REPLACE( REPLACE(@@sql_mode, 'ONLY_FULL_GROUP_BY,', ''), ',ONLY_FULL_GROUP_BY', ''), 'ONLY_FULL_GROUP_BY', '');
и тому подобное для остальных режимов
https://dba.stackexchange.com/questions/112739/session-sql-mode-default-sql-mode https://dba.stackexchange.com/questions/237048/1055-expression-1-of-select-list-is-not-in-group-by-clause-and-contains-nonag
https://dev.mysql.com/doc/refman/5.7/en/group-by-handling.html
https://habr.com/en/articles/166411/
Интересно что: https://www.php.net/manual/en/pdo.construct.php
PDO::__construct() ( string $dsn [, string $username [, string $password [, array $driver_options ]]] )
То есть можно сказать:
$db = new PDO( 'mysql:host=myhost;dbname=mydb', 'login', 'password', array( PDO::MYSQL_ATTR_INIT_COMMAND => "SET sql_mode = 'TRADITIONAL'" ) );
или
$db->setAttribute(PDO::MYSQL_ATTR_INIT_COMMAND, "SET sql_mode = 'TRADITIONAL'");
Сейчас эта возможность просто игнорируется...
The text was updated successfully, but these errors were encountered:
No branches or pull requests
В конструктор надо добавить в $options возможность итерации по массиву
sql_modes
Для true:
SET @@sql_mode = CONCAT(@@sql_mode, ',', 'ONLY_FULL_GROUP_BY');
Для false:
и тому подобное для остальных режимов
https://dba.stackexchange.com/questions/112739/session-sql-mode-default-sql-mode
https://dba.stackexchange.com/questions/237048/1055-expression-1-of-select-list-is-not-in-group-by-clause-and-contains-nonag
https://dev.mysql.com/doc/refman/5.7/en/group-by-handling.html
https://habr.com/en/articles/166411/
Интересно что:
https://www.php.net/manual/en/pdo.construct.php
То есть можно сказать:
или
Сейчас эта возможность просто игнорируется...
The text was updated successfully, but these errors were encountered: