Bug 21647

Summary: Select statements with no rows selected problem
Product: Taglibs Reporter: Lukasz Pazdziorek <pazdzior>
Component: DBTags TaglibAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED DUPLICATE    
Severity: normal CC: pazdzior
Priority: P3    
Version: 1.0   
Target Milestone: ---   
Hardware: PC   
OS: All   
Attachments: Test case (based on examples and using hsqldb)
Buggy output
Right output after the fix

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"
cellpadding="2">

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

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
page)

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

regards,
lukasz
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
Fixed...

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