Fix a crash issue occurring when debugging a function with arguments when using pgAdmin with external config database. #6904

This commit is contained in:
Aditya Toshniwal 2023-11-15 17:42:58 +05:30
parent 75a2d880f6
commit c4a5f8d707
2 changed files with 6 additions and 5 deletions

View File

@ -13,7 +13,7 @@ Revision ID: 9426ad06a63b
Revises: f656e56dfdc8
Create Date: 2023-10-09 15:09:50.773035
"""
from alembic import op
from alembic import op, context
import sqlalchemy as sa
@ -31,7 +31,8 @@ def upgrade():
# batch_alter_table
with op.batch_alter_table(
"server", table_kwargs={'sqlite_autoincrement': True}) as batch_op:
batch_op.alter_column('id', autoincrement=True)
if context.get_impl().bind.dialect.name == "sqlite":
batch_op.alter_column('id', autoincrement=True)
batch_op.add_column(sa.Column('shared_username', sa.String(64), nullable=True))

View File

@ -1844,7 +1844,7 @@ def set_arguments_sqlite(sid, did, scid, func_id):
for i in range(0, len(data)):
dbg_func_args_exists = int(
DebuggerFunctionArguments.query.filter_by(
server_id=data[i]['server_id'],
server_id=int(data[i]['server_id']),
database_id=data[i]['database_id'],
schema_id=data[i]['schema_id'],
function_id=data[i]['function_id'],
@ -1863,7 +1863,7 @@ def set_arguments_sqlite(sid, did, scid, func_id):
# existing value otherwise add the new value
if dbg_func_args_exists:
dbg_func_args = DebuggerFunctionArguments.query.filter_by(
server_id=data[i]['server_id'],
server_id=int(data[i]['server_id']),
database_id=data[i]['database_id'],
schema_id=data[i]['schema_id'],
function_id=data[i]['function_id'],
@ -1876,7 +1876,7 @@ def set_arguments_sqlite(sid, did, scid, func_id):
dbg_func_args.value = array_string
else:
debugger_func_args = DebuggerFunctionArguments(
server_id=data[i]['server_id'],
server_id=int(data[i]['server_id']),
database_id=data[i]['database_id'],
schema_id=data[i]['schema_id'],
function_id=data[i]['function_id'],