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


   > 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.
   
   Yeah. Good one @BasPH -> I am all for "no user/support involvement" if 
needed. We already do a couple of things automatically to deal with MySQL and 
MsSQL "configurability":
   
   * for MySQL we automatically set "utf8-mb3" encoding for IDs (this is the 
primary reason why the DB works at all when you have utf8mb4 set - because of 
index size limits. Here we "transparently" fix that for the user (we have 
configuration parameter for that but it turned out that not everyone reads 
documentation so now IDs are automatically set to utf8_mb3 ;) 
   * for MsSQL we check if READ_COMMITTED_SNAPSHOT is enabled and fail if not 
(because it can lead to deadlocks if not set)
   
   In this case I think just enabling/disabling it for this migration only 
would be best solution (and we can actually test it very easily - 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`


-- 
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