Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-11935

Queries in stored procedures with and EXISTS(SELECT * FROM VIEW) crashes and closes hte conneciton.

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.1.21, 10.0(EOL), 10.1(EOL), 10.2(EOL)
    • 10.0.30, 10.1.22, 10.2.5
    • Stored routines
    • None
    • Centos 7 x64
    • 10.0.30

    Description

      I am getting an error:

      (conn:7) Could not read packet: unexpected end of stream, read 0 bytes from 4

      I see a reference to a similar problem reported in https://jira.mariadb.org/browse/CONJ-348 for the connector.

      this recommends the solution of adding ?useServerPrepStmts=false to the connection string.

      Unfortunately I am making heavy use of stored procedures and stored procedures automatically have their prepared statemsnts buffered so the second time I use the procedure it crashes with the above error.

      this error comes from a statement similar to:

      SELECT *
      FROM MY_TABLE MT
      WHERE EXISTS ( SELECT *
      FROM MYVIEW MV
      WHERE MV.FIELD1 = MT.FIELD1 )
      AND MT.FIELD2 = V_VALUE;

      The view is quite complicated and essentially implements a security system I have been working on for some months so its a bit of blocker to rolling out a system.

      the text in /CONJ-348 suggests this server error is to be fixed in 10.1.21 so I have upgraded to that but the issue still remains.

      Attachments

        Issue Links

          Activity

            WHERE condition is impossible, so probably subselect also is reboved

            sanja Oleksandr Byelkin added a comment - WHERE condition is impossible, so probably subselect also is reboved

            Problem is that Item taken out of subselect in first execution on second start finding SELECT_LEX from current (which is top SELECT).
            Solution to start from select_lex from name resolution context

            sanja Oleksandr Byelkin added a comment - Problem is that Item taken out of subselect in first execution on second start finding SELECT_LEX from current (which is top SELECT). Solution to start from select_lex from name resolution context

            revision-id: 5eb9c19cfe3d5d0150d63a0fa3d5ea4f7a63f680 (mariadb-10.0.29-34-g5eb9c19)
            parent(s): a0ce92ddc7d3f147c5103b9470d10bad194b41e4
            committer: Oleksandr Byelkin
            timestamp: 2017-02-23 21:50:55 +0100
            message:

            MDEV-11935: Queries in stored procedures with and EXISTS(SELECT * FROM VIEW) crashes and closes hte conneciton.

            Use correct start point even for taken out from subselect items in process of exists2in conversion.

            sanja Oleksandr Byelkin added a comment - revision-id: 5eb9c19cfe3d5d0150d63a0fa3d5ea4f7a63f680 (mariadb-10.0.29-34-g5eb9c19) parent(s): a0ce92ddc7d3f147c5103b9470d10bad194b41e4 committer: Oleksandr Byelkin timestamp: 2017-02-23 21:50:55 +0100 message: MDEV-11935 : Queries in stored procedures with and EXISTS(SELECT * FROM VIEW) crashes and closes hte conneciton. Use correct start point even for taken out from subselect items in process of exists2in conversion. —

            github branch bb-10.0-MDEV-11935

            sanja Oleksandr Byelkin added a comment - github branch bb-10.0- MDEV-11935

            Sanja,

            Ok to push, but see my question in email.

            igor Igor Babaev (Inactive) added a comment - Sanja, Ok to push, but see my question in email.

            People

              sanja Oleksandr Byelkin
              nicholasdenning Nicholas Denning
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.