Bug #63839 MySQL connector ignore 'noAccessToProcedureBodies=true' parameter
Description:
MySQL Version: Ver 14.14 Distrib 5.1.49, for debian-linux-gnu (x86_64) using readline 6.1
I have a mysql user with only execute procedures permissions.
My MyBatis connection config:
<dataSource type="POOLED">
<property name="driver" value="com.mysql.jdbc.Driver"/>
<property name="url" value="jdbc:mysql://localhost:3306/mydatabase?noAccessToProcedureBodies=true"/>
<property name="username" value="testuser"/>
<property name="password" value="test"/>
</dataSource>
After run, I get next exception:
'User does not have access to metadata required to determine stored procedure parameter types. If rights can not be granted, configure connection with "noAccessToProcedureBodies=true" to have driver generate parameters that represent INOUT strings irregardless of actual parameter types.'
But when I change mysql-connector-java version from 5.1.15 to 5.1.10. It's work fine. I also checked connector's 5.1.18 version. I get the same error.
How to repeat:
1.) Run for root user:
CREATE DATABASE mydatabase;
USE mydatabase;
CREATE TABLE TYPES (id INT, name VARCHAR(250));
insert into database_type (id, name) values (1, 'testType1');
insert into database_type (id, name) values (2, 'testType2');
insert into database_type (id, name) values (3, 'testType3');
insert into database_type (id, name) values (4, 'testType4');
create procedure QueryTypes()
SELECT id, name FROM types;
CREATE USER 'testuser'@'localhost' IDENTIFIED BY 'test';
GRANT EXECUTE ON mydatabase.* TO 'testuser'@'localhost' identified by 'test';
2). Configure MyBatis:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
.....
<environments default="development">
<environment id="development">
<transactionManager type="JDBC"/>
<dataSource type="POOLED">
<property name="driver" value="com.mysql.jdbc.Driver"/>
<property name="url" value="jdbc:mysql://localhost:3306/mydatabase?noAccessToProcedureBodies=true"/>
<property name="username" value="testuser"/>
<property name="password" value="test"/>
</dataSource>
</environment>
</environments>
.....
</configuration>
3). Call the stored procedure from your application
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.051 sec. using MySQL 8.4.7-u6-cloud
Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the
respective copyright holders.
It is not reviewed in advance
by Oracle and does not necessarily represent the opinion of
Oracle or any other party.
Description: MySQL Version: Ver 14.14 Distrib 5.1.49, for debian-linux-gnu (x86_64) using readline 6.1 I have a mysql user with only execute procedures permissions. My MyBatis connection config: <dataSource type="POOLED"> <property name="driver" value="com.mysql.jdbc.Driver"/> <property name="url" value="jdbc:mysql://localhost:3306/mydatabase?noAccessToProcedureBodies=true"/> <property name="username" value="testuser"/> <property name="password" value="test"/> </dataSource> After run, I get next exception: 'User does not have access to metadata required to determine stored procedure parameter types. If rights can not be granted, configure connection with "noAccessToProcedureBodies=true" to have driver generate parameters that represent INOUT strings irregardless of actual parameter types.' But when I change mysql-connector-java version from 5.1.15 to 5.1.10. It's work fine. I also checked connector's 5.1.18 version. I get the same error. How to repeat: 1.) Run for root user: CREATE DATABASE mydatabase; USE mydatabase; CREATE TABLE TYPES (id INT, name VARCHAR(250)); insert into database_type (id, name) values (1, 'testType1'); insert into database_type (id, name) values (2, 'testType2'); insert into database_type (id, name) values (3, 'testType3'); insert into database_type (id, name) values (4, 'testType4'); create procedure QueryTypes() SELECT id, name FROM types; CREATE USER 'testuser'@'localhost' IDENTIFIED BY 'test'; GRANT EXECUTE ON mydatabase.* TO 'testuser'@'localhost' identified by 'test'; 2). Configure MyBatis: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd"> <configuration> ..... <environments default="development"> <environment id="development"> <transactionManager type="JDBC"/> <dataSource type="POOLED"> <property name="driver" value="com.mysql.jdbc.Driver"/> <property name="url" value="jdbc:mysql://localhost:3306/mydatabase?noAccessToProcedureBodies=true"/> <property name="username" value="testuser"/> <property name="password" value="test"/> </dataSource> </environment> </environments> ..... </configuration> 3). Call the stored procedure from your application