leonarduschen commented on issue #18457:
URL: https://github.com/apache/airflow/issues/18457#issuecomment-925744192


   > Seems like more people bumped into this problem: 
[1](https://stackoverflow.com/a/68832568/3066428) and 
[2](https://github.com/laravel/framework/issues/33238). [This 
post](https://github.com/laravel/framework/issues/33238#issuecomment-873322434) 
suggests you can set `SET SESSION sql_require_primary_key=0` to disable it 
within a session, but I would want to properly test that first.
   
   Turns out `SET SESSION <variable>=<value>` and `SET <variable>=<value>` do 
the same thing; both keeps variable within the session/  According to 
https://dev.mysql.com/doc/refman/8.0/en/set-variable.html all the following do 
the same thing 
   ```sql
   SET SESSION sql_mode = 'TRADITIONAL';
   SET LOCAL sql_mode = 'TRADITIONAL';
   SET @@SESSION.sql_mode = 'TRADITIONAL';
   SET @@LOCAL.sql_mode = 'TRADITIONAL';
   SET @@sql_mode = 'TRADITIONAL';
   SET sql_mode = 'TRADITIONAL';
   ```
   
   ---
   
   > ... we could set that option in 
https://github.com/apache/airflow/blob/main/scripts/ci/mysql/conf.d/airflow.cnf 
(providing that it is settable there) and our MySQL tests would create a db 
with sql_require_primary_key=ON
   
   @potiuk I'll go ahead and give it try


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to