dupe_keys errors for sqlite are not handle correctly
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
oslo.db |
Confirmed
|
Medium
|
Unassigned |
Bug Description
When we have a lot of unique constraints columns and try to add object twice - somehow we see
"oslo_db.
This bug is mostly related to https:/
Need to add one more regexp in sqlite_
https:/
More details about this error: http://
Steps to reproduce:
>>> from oslo.db.sqlalchemy import session
>>> eng = session.
>>> expr = """CREATE TABLE cron_triggers_v2 (
... created_at DATETIME,
... updated_at DATETIME,
... scope VARCHAR(80),
... project_id VARCHAR(80),
... id VARCHAR(36) NOT NULL,
... name VARCHAR(200),
... pattern VARCHAR(100),
... next_execution_time DATETIME NOT NULL,
... first_execution
... workflow_name VARCHAR(80),
... remaining_
... workflow_id VARCHAR(36),
... workflow_input TEXT,
... workflow_input_hash CHAR(64),
... trust_id VARCHAR(80),
... PRIMARY KEY (id),
... UNIQUE (name, project_id),
... UNIQUE (workflow_
... );"""
>>> eng.execute(expr)
<sqlalchemy.
>>> expr_insert = """
... INSERT INTO cron_triggers_v2 values (
'2015-05-25 13:57:01.325866',
null,
'private',
'
'
'test1',
'*/5 * * * *',
'4242-12-25 13:37:00.000000',
'4242-12-25 13:37:00.000000',
'my_wf',
2,
'
'{}',
'
null
)"""
>>> eng.execute(
<sqlalchemy.
>>> expr_insert2 = """
... INSERT INTO cron_triggers_v2 values (
'2015-05-25 13:57:01.325866',
null,
'private',
'
'
'test2',
'*/5 * * * *',
'4242-12-25 13:37:00.000000',
'4242-12-25 13:37:00.000000',
'my_wf',
2,
'
'{}',
'
null
)"""
>>> eng.execute(
No handlers could be found for logger "oslo_db.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/
return connection.
File "/usr/local/
return self._execute_
File "/usr/local/
statement, parameters
File "/usr/local/
context)
File "oslo_db/
e, statement, parameters, cursor, context)
File "/usr/local/
util.
File "/usr/local/
reraise(
File "/usr/local/
context)
File "/usr/local/
cursor.
oslo_db.
Changed in oslo.db: | |
status: | New → Confirmed |
importance: | Undecided → Medium |