mariadb-corporation/mariadb-connector-r2dbc

Can I choose MariadbClientParameterizedQueryStatement even if "call" in SQL

1528110566 opened this issue · 2 comments

#53

if (this.configuration.useServerPrepStmts() || sql.contains("call")) {
        return new MariadbServerParameterizedQueryStatement(this.client, sql, this.configuration);
}
return new MariadbClientParameterizedQueryStatement(this.client, sql, this.configuration);

I understand the driver want's to improve application's performance, but I think driver should give me a chance to choose.
My DBA disabled server parameterization with no reason, and unfortunately, my sql contains call.😭😭😭
Is there any way to solve this problem?

Use of server prepared statement is done because that's the only why to get output parameter resultset.

In next version (1.1.4) there will be a hint addition (command of type "/text/ ") that will force use of text protocol (client side prepared statement). In the case of procedure, sql command will be executed, but as explained, no ouput parameter will then be retrieved.
In case output parameters are needed, this will require additional command, like executing :

// with a procedure like
//CREATE PROCEDURE basic_proc (INOUT param1 INT unsigned)  BEGIN 
//  SET param1 = param1 * 2;
//END

SET @str = 'bla';
/*text*/ CALL basic_proc(@str);
SELECT @str;

Thank you for your reply.