OlafenwaMoses commented on issue #40928:
URL: https://github.com/apache/airflow/issues/40928#issuecomment-2457006072

   I am getting same issue to. I am using MySQL `8.0.32` and any attempt to 
upgrade beyond `2.9.1` on an existing database leads to the error in the trace 
below. I have tried
   
   - Airflow `2.9.1` to `2.9.2` with MySQL `8.0.32` 
   - Airflow `2.9.1` to `2.9.3` MySQL `8.0.32` 
   - Airflow `2.9.1` to `2.9.3` with MySQL `8.0.36`
   
   and apparently all failed with same error despite the fix in [#40314 
](https://github.com/apache/airflow/pull/40314). 
   
   As @JayalakshmiH  mentioned, Airflow `2.9.2` and higher only works when you 
setup with an empty db.
   
   ```
   2024-11-04 22:14:41 sqlalchemy.exc.ProgrammingError: 
(pymysql.err.ProgrammingError) (1064, "You have an error in your SQL syntax; 
check the manual that corresponds to your MySQL server version for the right 
syntax to use near 'prepare stmt from @var;\n        execute stmt;\n        
deallocate prepare stmt' at line 7")
   2024-11-04 22:14:41 [SQL: 
   2024-11-04 22:14:41         set @var=if((SELECT true FROM 
information_schema.TABLE_CONSTRAINTS WHERE
   2024-11-04 22:14:41             CONSTRAINT_SCHEMA = DATABASE() AND
   2024-11-04 22:14:41             TABLE_NAME        = 'connection' AND
   2024-11-04 22:14:41             CONSTRAINT_NAME   = 'unique_conn_id' AND
   2024-11-04 22:14:41             CONSTRAINT_TYPE   = 'UNIQUE') = true,'ALTER 
TABLE connection
   2024-11-04 22:14:41             DROP INDEX unique_conn_id','select 1');
   2024-11-04 22:14:41 
   2024-11-04 22:14:41         prepare stmt from @var;
   2024-11-04 22:14:41         execute stmt;
   2024-11-04 22:14:41         deallocate prepare stmt;
   2024-11-04 22:14:41         ]
   2024-11-04 22:14:41 (Background on this error at: 
https://sqlalche.me/e/14/f405)
   2024-11-04 22:14:41 WARNING: Environment variable '_AIRFLOW_DB_UPGRADE' is 
deprecated please use '_AIRFLOW_DB_MIGRATE' instead
   ```


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