Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Assertion failed
Forum Updated to NodeBB v4.3 + New Features

Assertion failed

Scheduled Pinned Locked Moved General and Desktop
7 Posts 2 Posters 1.8k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Polina89
    wrote on last edited by
    #1

    Hi. I have a very simple Sql query

    @query.clear();
    query.prepare("select FIO from inspectors where FIO=:FIO");
    query.bindValue(":FIO",text.trimmed());
    query.exec();@

    When it is executed I get this error:
    Assertion failed!
    Program:...
    File:.\libmysql.c

    When I change my Sql statement to
    @"select id from inspectors where FIO=:FIO"@

    the error is gone.
    So, what is the problem?Thanx a lot!

    1 Reply Last reply
    0
    • raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      and which assert is hit? What's it's condition?

      Also IMO your first query doesn't make much sense :)

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      0
      • P Offline
        P Offline
        Polina89
        wrote on last edited by
        #3

        Expression: param->buffer_length!=0
        I just check if I already have a record with this FIO. At the beginnig my query was
        @select *from inspectors where FIO=:FIO@

        But i still had this mistake.And only when I change it to

        @select id from inspectors where FIO=:FIO@

        it works fine

        1 Reply Last reply
        0
        • raven-worxR Offline
          raven-worxR Offline
          raven-worx
          Moderators
          wrote on last edited by
          #4

          @
          select from inspectors where FIO=:FIO
          @
          You are missing a space after the "
          "

          --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
          If you have a question please use the forum so others can benefit from the solution in the future

          1 Reply Last reply
          0
          • P Offline
            P Offline
            Polina89
            wrote on last edited by
            #5

            I'm very sorry. I wrote it wrong only here. In my programm the query is correct=)

            1 Reply Last reply
            0
            • raven-worxR Offline
              raven-worxR Offline
              raven-worx
              Moderators
              wrote on last edited by
              #6

              may it be possible that text.trimmed() results in an empty string in your application?

              --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
              If you have a question please use the forum so others can benefit from the solution in the future

              1 Reply Last reply
              0
              • P Offline
                P Offline
                Polina89
                wrote on last edited by
                #7

                No, it is impossible....May it be connected somehow with the fact that one of the fields in my db has got type TEXT?

                1 Reply Last reply
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved