zhangsikai123 opened a new issue #12202:
URL: https://github.com/apache/incubator-superset/issues/12202


   when I try to upgrade my superset, I use superset db upgrade, I ran into the 
error:  
   ```
   sqlalchemy.exc.IntegrityError: (pymysql.err.IntegrityError) (1062, 
"Duplicate entry 'xxxx' for key 'uq_saved_query_uuid'")
   [SQL: ALTER TABLE saved_query ADD CONSTRAINT uq_saved_query_uuid UNIQUE 
(uuid)]
   (Background on this error at: http://sqlalche.me/e/13/gkpj)
   ```
   ### Environment
   Mysql-5.7.25
   
   ### Additional context
   I went back to commit d7eb1d47:  on 
96e99fb176a0_add_import_mixing_to_saved_query.py, there is a line of code, 
which is obviously written for acceleration:
   ```
   # Add uuids directly using built-in SQL uuid function
   add_uuids_by_dialect = {
       MySQLDialect: """UPDATE %s SET uuid = UNHEX(REPLACE(uuid(), "-", 
""));""",
       PGDialect: """UPDATE %s SET uuid = uuid_in(md5(random()::text || 
clock_timestamp()::text)::cstring);""",
   }
   
   ```
   I tried this line of code on my table with couple rows, it gives exact same 
uuid for each row. After I deleted this line of code, everything goes on well.


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

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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to