Bug 116223

Summary: Remove the incorrectly implemented and unused SQLiteStatement::getColumnBlob().
Product: WebKit Reporter: Lyon Chen <liachen>
Component: PlatformAssignee: Lyon Chen <liachen>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: beidson, darin, joenotcharles
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch for 116223.
none
Remove it instead of fixing it. benjamin: review+

Lyon Chen
Reported 2013-05-16 07:40:55 PDT
In SQLiteStatement::getColumnBlob(), it calls finalize(), prepare(), and step() unconditionally, which makes user can never get blob data out through this method. It should be changed to match method like getColumnBlobAsString() and getColumnBlobAsVector(), which assumes when m_statement is there then prepare() and step() have been called before this being called. And this will match what bindBlob() does, saving any binary data with defined length.
Attachments
Patch for 116223. (1.96 KB, patch)
2013-05-16 07:55 PDT, Lyon Chen
no flags
Remove it instead of fixing it. (2.49 KB, patch)
2013-05-16 10:44 PDT, Lyon Chen
benjamin: review+
Lyon Chen
Comment 1 2013-05-16 07:43:22 PDT
cc: Joe Mason, Darin, Beidson.
Lyon Chen
Comment 2 2013-05-16 07:55:45 PDT
Created attachment 201957 [details] Patch for 116223.
Joe Mason
Comment 3 2013-05-16 08:31:18 PDT
Comment on attachment 201957 [details] Patch for 116223. View in context: https://bugs.webkit.org/attachment.cgi?id=201957&action=review > Source/WebCore/ChangeLog:15 > + No new tests needed as no one use SQLiteStatement::getColumnBlob() yet. Still needs a test, to make sure it's actually working when someone wants to use it.
Lyon Chen
Comment 4 2013-05-16 08:39:02 PDT
(In reply to comment #3) > (From update of attachment 201957 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=201957&action=review > > > Source/WebCore/ChangeLog:15 > > + No new tests needed as no one use SQLiteStatement::getColumnBlob() yet. > > Still needs a test, to make sure it's actually working when someone wants to use it. So it will be a unit test, instead of layout test?
Alexey Proskuryakov
Comment 5 2013-05-16 09:42:38 PDT
I'd say that if SQLiteStatement::getColumnBlob() is never called, we should strongly consider removing it completely.
Lyon Chen
Comment 6 2013-05-16 09:43:51 PDT
(In reply to comment #5) > I'd say that if SQLiteStatement::getColumnBlob() is never called, we should strongly consider removing it completely. But I am planning to use it, and then found the issue.
Lyon Chen
Comment 7 2013-05-16 10:44:28 PDT
Created attachment 201969 [details] Remove it instead of fixing it.
Joe Mason
Comment 8 2013-05-16 11:52:44 PDT
(In reply to comment #7) > Created an attachment (id=201969) [details] > Remove it instead of fixing it. Are you planning to re-add it along with our platform specific patch once we're finished the code that uses it?
Joe Mason
Comment 9 2013-05-16 11:53:37 PDT
(In reply to comment #8) > (In reply to comment #7) > > Created an attachment (id=201969) [details] [details] > > Remove it instead of fixing it. > > Are you planning to re-add it along with our platform specific patch once we're finished the code that uses it? Never mind, I actually looked at the patch and I see your comment now. :)
Lyon Chen
Comment 10 2013-05-16 12:01:38 PDT
(In reply to comment #9) > (In reply to comment #8) > > (In reply to comment #7) > > > Created an attachment (id=201969) [details] [details] [details] > > > Remove it instead of fixing it. > > > > Are you planning to re-add it along with our platform specific patch once we're finished the code that uses it? > > Never mind, I actually looked at the patch and I see your comment now. :) Yeah, I thought getColumnBlob name more correct than getColumnBlobAsVector, and can avoid unnecessary full copy. But then I think maybe this is not that terrible. At least IconDatabase::getImageDataForIconURLFromSQLDatabase() is doing it this way. (I think it should use SharedBuffer::adoptVector() instead of SharedBuffer::create(), but it is another story), and our password is short.
Benjamin Poulain
Comment 11 2013-05-16 16:27:54 PDT
Comment on attachment 201969 [details] Remove it instead of fixing it. View in context: https://bugs.webkit.org/attachment.cgi?id=201969&action=review > Source/WebCore/ChangeLog:12 > + No new tests needed. Whaaaaat? ;)
Benjamin Poulain
Comment 12 2013-05-16 16:30:00 PDT
Comment on attachment 201969 [details] Remove it instead of fixing it. Let's cq- actually: -Please change the title to reflect what is in the patch.
Lyon Chen
Comment 13 2013-05-16 18:40:15 PDT
Comment on attachment 201969 [details] Remove it instead of fixing it. Re-set the commit-queue flag after changing the bug title to reflect the patch. Ben: do you feel the changed title is OK now?
Tim Nguyen (:ntim)
Comment 14 2022-03-14 16:35:44 PDT
Comment on attachment 201969 [details] Remove it instead of fixing it. Bug 127868 made the same change.
Tim Nguyen (:ntim)
Comment 15 2022-03-14 16:36:02 PDT
*** This bug has been marked as a duplicate of bug 127868 ***
Note You need to log in before you can comment on or make changes to this bug.