diff --git a/include/PgSQL_Connection.h b/include/PgSQL_Connection.h index 9bcf0dba6..8620f3e50 100644 --- a/include/PgSQL_Connection.h +++ b/include/PgSQL_Connection.h @@ -69,6 +69,10 @@ enum PgSQL_Param_Name { PG_SERVICE, // Service name to use for additional parameters PG_TARGET_SESSION_ATTRS, // Determines whether the session must have certain properties to be acceptable PG_LOAD_BALANCE_HOSTS, // Controls the order in which the client tries to connect to the available hosts and addresses + // Environment Options + PG_DATESTYLE, // Sets the value of the DateStyle parameter + PG_TIMEZONE, // Sets the value of the TimeZone parameter + PG_GEQO, // Enables or disables the use of the GEQO query optimizer PG_PARAM_SIZE }; @@ -114,7 +118,11 @@ static const char* PgSQL_Param_Name_Str[] = { "gssdelegation", "service", "target_session_attrs", - "load_balance_hosts" + "load_balance_hosts", + // Environment Options + "datestyle", + "timezone", + "geqo" }; struct Param_Name_Validation { @@ -172,7 +180,10 @@ static const Param_Name_Validation* PgSQL_Param_Name_Accepted_Values[PG_PARAM_SI nullptr, nullptr, &target_session_attrs, - &load_balance_hosts + &load_balance_hosts, + nullptr, + nullptr, + nullptr }; #define PG_EVENT_NONE 0x00 @@ -211,6 +222,7 @@ public: } bool set_value(PgSQL_Param_Name key, const char* val) { + if (key == -1) return false; if (validate(key, val)) { if (param_value[key]) { free(param_value[key]); @@ -249,8 +261,9 @@ public: break; } } - - assert(key != -1); + if (key == -1) { + proxy_warning("Unrecognized connection option. Please report this as a bug for future enhancements:%s\n", name); + } return key; } diff --git a/lib/PgSQL_Session.cpp b/lib/PgSQL_Session.cpp index c454982d1..0131b1afd 100644 --- a/lib/PgSQL_Session.cpp +++ b/lib/PgSQL_Session.cpp @@ -6185,7 +6185,7 @@ void PgSQL_Session::MySQL_Stmt_Result_to_MySQL_wire(MYSQL_STMT* stmt, PgSQL_Conn //query_result->init_with_stmt(myconn); CurrentQuery.rows_sent = query_result->get_num_rows(); const auto _affected_rows = query_result->get_affected_rows(); - if (_affected_rows != -1) { + if (_affected_rows != static_cast(-1)) { CurrentQuery.affected_rows = _affected_rows; CurrentQuery.have_affected_rows = true; } @@ -6234,7 +6234,7 @@ void PgSQL_Session::PgSQL_Result_to_PgSQL_wire(PgSQL_Connection* _conn, PgSQL_Da bool is_tuple = query_result->get_result_packet_type() == (PGSQL_QUERY_RESULT_TUPLE | PGSQL_QUERY_RESULT_COMMAND | PGSQL_QUERY_RESULT_READY); CurrentQuery.rows_sent = query_result->get_num_rows(); const auto _affected_rows = query_result->get_affected_rows(); - if (_affected_rows != -1) { + if (_affected_rows != static_cast(-1)) { CurrentQuery.affected_rows = _affected_rows; CurrentQuery.have_affected_rows = true; }