Bug 21647 - Select statements with no rows selected problem
Summary: Select statements with no rows selected problem
Status: RESOLVED DUPLICATE of bug 26863
Alias: None
Product: Taglibs
Classification: Unclassified
Component: DBTags Taglib (show other bugs)
Version: 1.0
Hardware: PC All
: P3 normal with 3 votes (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
Depends on:
Reported: 2003-07-16 11:24 UTC by Lukasz Pazdziorek
Modified: 2005-03-20 17:06 UTC (History)
1 user (show)

Test case (based on examples and using hsqldb) (2.55 KB, text/plain)
2004-02-26 19:38 UTC, Felipe Leme
Buggy output (751 bytes, text/html)
2004-02-26 19:39 UTC, Felipe Leme
Right output after the fix (676 bytes, text/html)
2004-02-26 19:40 UTC, Felipe Leme

Note You need to log in before you can comment on or make changes to this bug.
Description Lukasz Pazdziorek 2003-07-16 11:24:30 UTC
I am doning a select statemnet as follows:

                <table align="center" width="590" cellspacing="0"

                  <th align="left">
                  <th align="left">
                  <sql:statement id="stmt4" conn="conn">
                      select RS_ID, RS_DESCRIPTION FROM REQUEST_STATUS where
                  <sql:resultSet id="rset4">
                    <td><sql:getColumn colName="RS_ID"/></td>
                    <td><sql:getColumn colName="RS_DESCRIPTION"/></td>
                  <tr align="center">
        <td colspan="6">
          <sql:wasEmpty>Niestety dupa.</sql:wasEmpty>
          <sql:wasNotEmpty>Tyle wierszy:

Everything works perfect except one thing:

If the select statement returns no rows it prints the sql statetment body in
the output page (befor the table starts).
(If there are some rows the sql statement body is not visible onthe output

The same problem occurs in the dbtags-examples application downloaded from
jackarta website.

Comment 1 Lukasz Pazdziorek 2003-07-16 11:27:51 UTC
Here is an dbtags-example page (sql statement is shown on the page)

Prove that an empty resultset executes the wasEmpty tag

select id, name, description from test_books where id > 1000 

No rows retrieved. 

Comment 2 Felipe Leme 2004-02-26 19:35:51 UTC
That's the same proble as bug 26863 (and it's fixed as well).

I will attached a better test case and results and then mark this bug as duplicated.
Comment 3 Felipe Leme 2004-02-26 19:38:32 UTC
Created attachment 10572 [details]
Test case (based on examples and using hsqldb)
Comment 4 Felipe Leme 2004-02-26 19:39:44 UTC
Created attachment 10573 [details]
Buggy output
Comment 5 Felipe Leme 2004-02-26 19:40:21 UTC
Created attachment 10574 [details]
Right output after the fix
Comment 6 Felipe Leme 2004-02-26 19:42:00 UTC

*** This bug has been marked as a duplicate of 26863 ***