Bug #1131 com.mysql.Clob.setCharacterStream inefficient
| Submitted: | 25 Aug 2003 3:08 | Modified: | 25 Aug 2003 7:42 |
|---|---|---|---|
| Reporter: | Roland Littwin | Email Updates: | |
| Status: | Closed | Impact on me: | |
| Category: | Connector / J | Severity: | S3 (Non-critical) |
| Version: | 3.0.8 | OS: | Any (All) |
| Assigned to: | CPU Architecture: | Any |
[25 Aug 2003 7:42]
Mark Matthews
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.
If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information
about accessing the source trees is available at
http://www.mysql.com/doc/en/Installing_source_tree.html
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.039 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: In com.mysql.setCharacterStream the first assert checks if indexToWriteAt<1 and throws exception thus the second condition indexToWriteAt>0 is always true. The enclosed statement has only an effect if indexToWriteAt > 1 so a change of the second condition can speed up the method. How to repeat: Results are correct. Only unneccassy if statement Suggested fix: public Writer setCharacterStream(long indexToWriteAt) throws SQLException { if (indexToWriteAt < 1) { throw new SQLException("indexToWriteAt must be >= 1", "S1009"); } WatchableWriter writer = new WatchableWriter(); writer.setWatcher(this); if (indexToWriteAt > 1) { writer.write(this.charData, 0, (int) (indexToWriteAt - 1)); } return writer; }