diff --git a/common/lib/mysql_client_wrapper.ts b/common/lib/mysql_client_wrapper.ts index 0d94ee62..c4ae72b3 100644 --- a/common/lib/mysql_client_wrapper.ts +++ b/common/lib/mysql_client_wrapper.ts @@ -47,7 +47,7 @@ export class MySQLClientWrapper implements ClientWrapper { } query(sql: any): Promise { - this.driverDialect.setQueryTimeout(this.properties, sql); + this.driverDialect.setQueryTimeout(this.properties); return this.client?.query(sql); } diff --git a/mysql/lib/dialect/mysql2_driver_dialect.ts b/mysql/lib/dialect/mysql2_driver_dialect.ts index 61b9003d..bf5915a1 100644 --- a/mysql/lib/dialect/mysql2_driver_dialect.ts +++ b/mysql/lib/dialect/mysql2_driver_dialect.ts @@ -68,10 +68,10 @@ export class MySQL2DriverDialect implements DriverDialect { } } - setQueryTimeout(props: Map, sql?: any, wrapperConnectTimeout?: any) { - const timeout = wrapperConnectTimeout ?? props.get(WrapperProperties.WRAPPER_QUERY_TIMEOUT.name); - if (timeout && !sql[MySQL2DriverDialect.QUERY_TIMEOUT_PROPERTY_NAME]) { - sql[MySQL2DriverDialect.QUERY_TIMEOUT_PROPERTY_NAME] = timeout; + setQueryTimeout(props: Map, wrapperQueryTimeout?: any) { + const timeout = wrapperQueryTimeout ?? props.get(WrapperProperties.WRAPPER_QUERY_TIMEOUT.name); + if (timeout) { + props.set(MySQL2DriverDialect.QUERY_TIMEOUT_PROPERTY_NAME, timeout); } } diff --git a/pg/lib/dialect/node_postgres_driver_dialect.ts b/pg/lib/dialect/node_postgres_driver_dialect.ts index dc23f28d..323492ce 100644 --- a/pg/lib/dialect/node_postgres_driver_dialect.ts +++ b/pg/lib/dialect/node_postgres_driver_dialect.ts @@ -71,7 +71,7 @@ export class NodePostgresDriverDialect implements DriverDialect { } } - setQueryTimeout(props: Map, sql?: any, wrapperQueryTimeout?: any) { + setQueryTimeout(props: Map, wrapperQueryTimeout?: any) { const timeout = wrapperQueryTimeout ?? props.get(WrapperProperties.WRAPPER_QUERY_TIMEOUT.name); if (timeout) { props.set(NodePostgresDriverDialect.QUERY_TIMEOUT_PROPERTY_NAME, timeout);