← Back to team overview

maria-developers team mailing list archive

Re: JDBC getWarnings and stored procedure

 


On 03/04/17 20:21, jerome brauge wrote:
> Hello,
> 
> When we call a stored procedure in JDBC which emit warnings, 
> getWarnings() always returns null.
> 
> I don’t really think that the problem is in MariaDB Connector J because
> warning flag in the EOF packet is not set to true.
> 

hasWarnings is set:

https://github.com/MariaDB/mariadb-connector-j/blob/master/src/main/java/org/mariadb/jdbc/internal/protocol/AbstractConnectProtocol.java#L745


Its used here:

https://github.com/MariaDB/mariadb-connector-j/blob/master/src/main/java/org/mariadb/jdbc/MariaDbConnection.java#L827

I suspect the bug is warningsCleared has a implicit default of false in
the above class.

As a workaround check, call reenableWarnings() before getWarnings().

> Mysql client behaves in the same way, by default it shows warnings count
> issued by DML command but not for stored procedure.
> 
>  
> 
> Is it a normal behavior ?
> 
>  
> 
> Best regards,
> 
> Jérôme.
> 
>  
> 
>  
> 
>  
> 
>  
> 
>  
> 
> 
> 
> _______________________________________________
> Mailing list: https://launchpad.net/~maria-developers
> Post to     : maria-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~maria-developers
> More help   : https://help.launchpad.net/ListHelp
> 



Follow ups