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

select @@warning_count returns wrong result

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Minor
    • Resolution: Unresolved
    • 10.10.3
    • 10.11
    • None
    • None

    Description

      If the number of warnings is greater than max_error_count, session variable @@warning_count has incorrect value.

      How to repeat:

      delimiter $$
      CREATE PROCEDURE p1() BEGIN  DROP TABLE whichdoesnotexist; END $$
      CREATE PROCEDURE p2() BEGIN  CALL p1(); END  $$
      CREATE PROCEDURE p3() BEGIN  CALL p2(); END  $$
      delimiter ;
       
      SET @@max_error_count=2;
      CALL  p3();
      SELECT @@warning_count;
      +-----------------+
      | @@warning_count |
      +-----------------+
      |               3 |
      +-----------------+
      SHOW WARNINGS;
      +-------+------+----------------------------------------+
      | Level | Code | Message                                |
      +-------+------+----------------------------------------+
      | Error | 1051 | Unknown table 'test.whichdoesnotexist' |
      | Note  | 4094 | At line 2 in test.p1                   |
      +-------+------+----------------------------------------+
       
      set @@max_error_count=4;
      call p3();
      select @@warning_count;
      +-----------------+
      | @@warning_count |
      +-----------------+
      |               4 |
      +-----------------+
      show warnings;
      +-------+------+----------------------------------------+
      | Level | Code | Message                                |
      +-------+------+----------------------------------------+
      | Error | 1051 | Unknown table 'test.whichdoesnotexist' |
      | Note  | 4094 | At line 2 in test.p1                   |
      | Note  | 4094 | At line 2 in test.p2                   |
      | Note  | 4094 | At line 2 in test.p3                   |
      +-------+------+----------------------------------------+
      

      Attachments

        Activity

          People

            sanja Oleksandr Byelkin
            georg Georg Richter
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

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