Bug 18837

Summary: Database panel fails to display tables if any value is NULL
Product: WebKit Reporter: Tom Davis <thos.davis>
Component: Web Inspector (Deprecated)Assignee: Adam Roben (:aroben) <aroben>
Status: RESOLVED FIXED    
Severity: Normal CC: aroben, timothy
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Proposed patch
darin: review-
patch + changelog darin: review+

Tom Davis
Reported 2008-05-01 15:57:25 PDT
An SQL NULL value in an SQLite database is correctly returned in the results as having the javascript null type, which (in file DatabasesPanel.js, function _tableForResult ) either causes the div.textContent or the text.length to throw an exception. The fix is to check for null and then reassign the text value, possible adding a new classname to the div as in: --- DatabasesPanel.js 2008/05/01 22:48:06 1.1 +++ DatabasesPanel.js 2008/05/01 22:51:23 1.2 @@ -204,6 +204,10 @@ var text = row[column]; var div = document.createElement("div"); + if ( text == null ) { + text = "NULL" + div.className = "sql_null"; + } div.textContent = text; div.title = text; td.appendChild(div); To make use of the className = "sql_null", append the following to inspector.js: .sql_null { text-align: center; color: #faa; }
Attachments
Proposed patch (1.89 KB, patch)
2008-05-01 22:03 PDT, Tom Davis
darin: review-
patch + changelog (3.59 KB, patch)
2008-06-08 13:19 PDT, Adam Roben (:aroben)
darin: review+
Matt Lilek
Comment 1 2008-05-01 16:26:03 PDT
Please submit a patch using the instructions at <http://webkit.org/coding/contributing.html>. Our code style guidelines are available at <http://webkit.org/coding/coding-style.html>.
Tom Davis
Comment 2 2008-05-01 22:03:39 PDT
Created attachment 20919 [details] Proposed patch
Maciej Stachowiak
Comment 3 2008-05-02 03:59:07 PDT
Comment on attachment 20919 [details] Proposed patch r=me
Darin Adler
Comment 4 2008-06-08 11:47:41 PDT
Comment on attachment 20919 [details] Proposed patch Sorry. This patch was great, but it wasn't landed. Now the Databases panel has changed too much to land it. It's now using a DataGrid class. I couldn't figure out exactly how to merge this or if the code has this issue any more. For now, setting review to review-. We can close this bug if it's already fixed, or rework the patch if not.
Adam Roben (:aroben)
Comment 5 2008-06-08 13:19:37 PDT
Created attachment 21578 [details] patch + changelog
Darin Adler
Comment 6 2008-06-08 13:21:09 PDT
Comment on attachment 21578 [details] patch + changelog r=me The original patch had special formatting for null values. Did you decide that wasn't worthwhile?
Adam Roben (:aroben)
Comment 7 2008-06-08 13:25:01 PDT
(In reply to comment #6) > The original patch had special formatting for null values. Did you decide that > wasn't worthwhile? It probably is worthwhile, but I didn't want to add that while fixing this bug. I'll file a new bug about special formatting and add a FIXME. Thanks!
Adam Roben (:aroben)
Comment 8 2008-06-08 13:27:51 PDT
(In reply to comment #7) > I'll file a new bug about special formatting Bug 19439
Adam Roben (:aroben)
Comment 9 2008-06-08 13:58:58 PDT
Committed in r34456
Note You need to log in before you can comment on or make changes to this bug.