Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenStack
oslo
python-oslo.db
Commits
20181ab7
Commit
20181ab7
authored
Nov 12, 2021
by
Zuul
Committed by
Gerrit Code Review
Nov 12, 2021
Browse files
Merge "Don't pass kwargs to connection.execute()"
parents
e3dc6bbf
e1039e08
Changes
4
Hide whitespace changes
Inline
Side-by-side
oslo_db/sqlalchemy/provision.py
View file @
20181ab7
...
...
@@ -604,9 +604,11 @@ class PostgresqlBackendImpl(BackendImpl):
return
bool
(
engine
.
scalar
(
sqlalchemy
.
text
(
"SELECT datname FROM pg_database "
"WHERE datname=:name"
),
name
=
ident
)
"SELECT datname FROM pg_database WHERE datname=:name"
),
{
'name'
:
ident
},
)
)
def
_close_out_database_users
(
self
,
conn
,
ident
):
"""Attempt to guarantee a database can be dropped.
...
...
@@ -630,7 +632,9 @@ class PostgresqlBackendImpl(BackendImpl):
"WHERE usename=current_user AND "
"pid != pg_backend_pid() AND "
"datname=:dname"
),
dname
=
ident
)
),
{
'dname'
:
ident
},
)
def
_random_ident
():
...
...
oslo_db/sqlalchemy/utils.py
View file @
20181ab7
...
...
@@ -1118,7 +1118,7 @@ def get_non_innodb_tables(connectable, skip_tables=('migrate_version',
params
[
'database'
]
=
connectable
.
engine
.
url
.
database
query
=
text
(
query_str
)
noninnodb
=
connectable
.
execute
(
query
,
**
params
)
noninnodb
=
connectable
.
execute
(
query
,
params
)
return
[
i
[
0
]
for
i
in
noninnodb
]
...
...
oslo_db/tests/fixtures.py
View file @
20181ab7
...
...
@@ -52,11 +52,6 @@ class WarningsFixture(fixtures.Fixture):
message
=
r
'The Engine.execute\(\) method is considered legacy .*'
,
category
=
sqla_exc
.
SADeprecationWarning
)
warnings
.
filterwarnings
(
'once'
,
message
=
r
'The connection.execute\(\) method in SQLAlchemy 2.0 .*'
,
category
=
sqla_exc
.
SADeprecationWarning
)
warnings
.
filterwarnings
(
'once'
,
message
=
r
'Calling the mapper\(\) function directly outside .*'
,
...
...
oslo_db/tests/sqlalchemy/test_sqlalchemy.py
View file @
20181ab7
...
...
@@ -324,8 +324,7 @@ class MySQLModeTestCase(db_test_base._MySQLOpportunisticTestCase):
def
_test_string_too_long
(
self
,
value
):
with
self
.
connection
.
begin
():
self
.
connection
.
execute
(
self
.
test_table
.
insert
(),
bar
=
value
)
self
.
connection
.
execute
(
self
.
test_table
.
insert
(),
{
'bar'
:
value
})
result
=
self
.
connection
.
execute
(
self
.
test_table
.
select
())
return
result
.
fetchone
().
bar
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment