Suneido

Integrated Application Platform

  • Home
  • Learning
    • Suneido Manual
    • Beginners
      • Inside Suneido
      • The Suneido Programming Language
      • The Suneido Database
      • Installing Suneido
      • Building Suneido
      • IDE Go To Tour
      • Upgrading To A New Release
    • Advanced
      • Canvas Control
      • DrawControl Part 1
      • DrawControl Part 2
      • DrawControl Part 3
      • SAX Like XML Processing
      • A Plug-In Architecture
      • A Simple Wizard Framework
      • An HTML Include Facility
      • An RSS 2 Feed Creator
      • MIME Generation
      • A New Add-on Facility
      • Workspace Improvement Hack
    • Mockito for Suneido
    • The Suneido Task Scheduler
    • Contributing To Suneido
    • Contributor Assignment of Copyright
    • Language Translation
    • Future Directions
    • Interview With Andrew Mckinlay
  • Forum
    • Announcements
    • Internals & Enhancements
    • Cookbook
    • General
  • FAQ
  • Screenshots
  • Downloads
  • Links

Bug in query parser?

Integrated Application Platform › Forums › General › Bug in query parser?

  • This topic has 5 replies, 2 voices, and was last updated 11 years, 7 months ago by gmauro.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • June 23, 2011 at 6:18 pm #703
    gmauro
    Participant

    Hi, I think I have discovered a bug in the Suneido query parsing algorithm.

    The following code in the Workspace:

    a = 0
    a = a - 1 + 1

    of course it will generate 0 as output.

    Now, if you go in a QueryView and do something like:

    create testTable(field1) key(field1)

    insert {field1:0} into testTable

    testTable extend field2 = field1 - 1 + 1

    The output of the query will not be 0, but -2 !!!
    Very strange behaviour…

    June 25, 2011 at 11:12 pm #867
    amckinlay
    Keymaster

    Good one! I can recreate it.

    It appears to be treating it as: field1 – (1 + 1)

    It works if you do: testTable extend field2 = (field1 – 1) + 1

    jSuneido does not appear to have this bug – maybe because it shares the expression parser between the language and the database.

    I will get this fixed. Thanks for reporting it!

    June 28, 2011 at 5:48 pm #868
    amckinlay
    Keymaster

    I found the problem and fixed it.

    The parsing code was incorrect and implemented right associativity instead of left. I am surprised we did not find this before now. I guess we do not usually use complicated expressions in queries.

    The code for parsing expressions in the language was correct, but I did not keep the two version consistent 🙁

    jSuneido does not have this problem because it shares the expression parsing code with both the language and queries.

    I will post a new snapshot but if you need the fix right away, let me know.

    http://suneido.svn.sourceforge.net/viewvc/suneido/trunk/qparser.cpp?r1=1111&r2=1110&pathrev=1111

    July 2, 2011 at 8:50 am #869
    gmauro
    Participant

    Hi Andrew, if you could post a snapshot with the bug fixed it would be very nice. Thanks!

    July 5, 2011 at 10:07 pm #870
    amckinlay
    Keymaster

    done!

    July 7, 2011 at 2:46 pm #871
    gmauro
    Participant

    Thank you for the snapshot but there are some problems… I will explain them in the Announcements section of the forum, in the thread of the snapshot: link.

  • Author
    Posts
Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.
Log In

Search Forums

Log In
Welcome to the new Suneido Web Site and Forum.
Register
Lost Password
users of the previous PHPBB Forum should be able to log in with their previous username and password.

Recent Topics

  • Alpha copy of gSuneido to play with
  • how to start jsuneido ?
  • Problem Starting Suneido…
  • Dialog not showing buttons
  • New link for Suneidojo

Contact Us | Legal Statement | Privacy Statement | SiteMap

Copyright © 2023 Axon® Development Corporation. All Rights Reserved. - Open Source Integrated Database and Programming Language