Bug #107543 | Cannot execute a SELECT statement that writes to an OUTFILE | ||
---|---|---|---|
Submitted: | 13 Jun 2022 1:15 | Modified: | 4 Aug 2022 10:39 |
Reporter: | Ferindo Middleton Jr | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | Connector / J | Severity: | S3 (Non-critical) |
Version: | 8.0.29 | OS: | Windows (10) |
Assigned to: | CPU Architecture: | x86 |
[13 Jun 2022 1:15]
Ferindo Middleton Jr
[13 Jun 2022 10:18]
MySQL Verification Team
Hi, does turning on/off server side prepared statements change anything ? Thanks
[19 Jun 2022 17:57]
Ferindo Middleton Jr
I tried turning on/off server side prepared statements. That didn't help. I still get the same error trying to write the query to a file. The full story is I'm using Java Standard Tag Library (JSTL) in java server pages within a webapp running on Tomcat to perform these operations. So I used to be able to write query results to a file just fine using <sql:update> tag snippets in my JSPs. All my other SQL queries and updates work just fine when I update the driver to mysql-connector-java-8.0.29.jar, except for the ones that try and write to file. I even got loading files to my database tables to work by adding the allowLoadLocalInfile=true parameter to the URL the Tomcat config uses to connect to MySQL. However, adding useServerPrepStmts=true or useServerPrepStmts=false to the connection URL Tomcat uses to connect gives the same error. I even tried using <sql:query> tag with server-side prepared statements turned off and on and I get the other error: "Not a navigable ResultSet." I sifted through the "MySQL Connector/J 8.0 Developer Guide" up on https://dev.mysql.com/. I didn't see much about operations that write to file. Is this just not supported in the newer driver? I've been doing this fine for years since the release of mysql-connector-java-5.1.36-bin.jar. However, I've been using older MySQL, Tomcat, and the Connector/J. I've upgraded all three to the newest versions but the operations I run with writing results to a local file just seem to not be doable with Connector/J 8.0. If there's no way to write to a file on the server using this connector, is there some way to write query results directly into another table column as a stream or binary BLOB of the file output using this connector? I think if I could atleast get the query output saved into another table's column, I have a servlet I put together to manually download a file as input stream from a BLOB value that was previously saved in a table. Ferindo