Error in Order By

2005-03-22
2014-01-19
  • Fredrik Larsen

    Fredrik Larsen - 2005-03-22

    Re: BugID: 1167704 (Error in Order By)

    Hi
    Is this bug a "known" architectural limitation of HSQLDB?

    If not, can somebody point out where to look in the source-code for information about ordering-logic?

     
    • Fred Toussi

      Fred Toussi - 2005-03-22

      It works correctly with the current version:

      create table Test(ID Integer, Cost Float);
      insert into test values(1,10);
      insert into test values(2,20);
      insert into test values (3,1);
      SELECT ID, ' kr' + Cost FROM Test ORDER BY Cost;

      ID COST   
      -- -------
      3   kr1.0 
      1   kr10.0
      2   kr20.0

       
      • Fredrik Larsen

        Fredrik Larsen - 2005-03-22

        Try adding "insert into test values (4,2);" at the bottom, and
        you will see the error (String comperator).

        (Tried on ver: 1.7.3.3, 2.0 rc7 and rc9)

        ID COST   
        -- -------
        3   kr1.0 
        1   kr10.0 
        4   kr2.0
        2   kr20.0

         
        • Fred Toussi

          Fred Toussi - 2005-03-28

          Thanks, this has now been fixed in CVS.

           
          • Fredrik Larsen

            Fredrik Larsen - 2005-03-29

            Wow, that was fast.
            Thanks!!

             
    • Bro

      Bro - 2005-03-29

      Does that mean it will start sorting like this:

      3 kr1.0
      4 kr2.0
      1 kr10.0 
      2 kr20.0

      instead of this:

      3 kr1.0
      1 kr10.0 
      4 kr2.0
      2 kr20.0

      with string variables?

       
      • Fredrik Larsen

        Fredrik Larsen - 2005-03-29

        Well, its the other way around. When ordering by Cost i should sort like your first entry, but sorts like the second (String-sorting instead of double-sorting).

        This error is now reported fixed, in CVS, by fredt!

         

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks