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

MariaDB server crashes when running insert query containing question mark

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.3.27
    • 10.3(EOL)
    • Server
    • CloudLinux release 7.9

    Description

      One of our customers had an error in their PHP code which produced this SQL-query:

      INSERT IGNORE INTO transaction (meteringpointid, period_start, period_end, transaction_id, override, date_time) VALUES (('735999114011092315', '202010300000', '202010310000', 'SAPP6S00000000005452236060', 0, '1604185511'), ('735999114011092315', '202010290000', '202010300000', 'SAPP6S00000000005452059211', 0, '1604098690'), ('735999114011092315', '202010280000', '202010290000', 'SAPP6S00000000005451878728', 0, '1604012033'), ('735999114011092315', '202010270000', '202010280000', 'SAPP6S00000000005451690110', 0, '1603923617'), ('735999114011092315', '202010260000', '202010270000', 'SAPP6S00000000005451513362', 0, '1603839133'), ('735999114011092315', '202010250000', '202010260000', 'SAPP6S00000000005451263972', 0, '1603755936'), ('735999114011092315', '202010240000', '202010250000', 'SAPP6S00000000005451004661', 0, '1603668441'), ('735999114011092315', '202010230000', '202010240000', 'SAPP6S00000000005451001234', 0, '1603667326'), ('735999114011092315', '202010220000', '202010230000', 'SAPP6S00000000005450997359', 0, '1603666339'), ('735999114011092315', '202010220000', '202010230000', 'SAPP6S00000000005450683396', 0, '1603491816'), ('735999114011092315', '202010210000', '202010220000', 'SAPP6S00000000005450486980', 0, '1603408274'), ('735999114011092315', '202010200000', '202010210000', 'SAPP6S00000000005450459335', 0, '1603401400'), ('735999114011092315', '202010200000', '202010210000', 'SAPP6S00000000005450241769', 0, '1603315052'), ('735999114011092315', '202010190000', '202010200000', 'SAPP6S00000000005450059914', 0, '1603236026'), ('735999114011092315', '202010180000', '202010190000', 'SAPP6S00000000005450023929', 0, '1603228626'), ('735999114011092315', '202010180000', '202010190000', 'SAPP6S00000000005449815178', 0, '1603144250'), ('735999114011092315', '202010170000', '202010180000', 'SAPP6S00000000005449597207', 0, '1603057673'), ('735999114011092315', '202010160000', '202010170000', 'SAPP6S00000000005449446816', 0, '1602986533'), ('735999114011092315', '202010140000', '202010150000', 'SAPP6S00000000005449197042', 0, '1602981499'), ('735999114011092315', '202010150000', '202010160000', 'SAPP6S00000000005449400609', 0, '1602981010'), ('735999114011092315', '202010140000', '202010150000', 'SAPP6S00000000005448994277', 0, '1602796268'), ('735999114011092315', '202010130000', '202010140000', 'SAPP6S00000000005448779974', 0, '1602709915'), ('735999114011092315', '202010120000', '202010130000', 'SAPP6S00000000005448573693', 0, '1602625352'), ('735999114011092315', '202010110000', '202010120000', 'SAPP6S00000000005448348932', 0, '1602538932'), ('735999114011092315', '202010100000', '202010110000', 'SAPP6S00000000005448166218', 0, '1602457852'), ('735999114011092315', '202010090000', '202010100000', 'SAPP6S00000000005448137072', 0, '1602450688'), ('735999114011092315', '202010090000', '202010100000', 'SAPP6S00000000005447946713', 0, '1602366344'), ('735999114011092315', '202010080000', '202010090000', 'SAPP6S00000000005447743476', 0, '1602277635'), ('735999114011092315', '202010070000', '202010080000', 'SAPP6S00000000005447563496', 0, '1602199243'), ('735999114011092315', '202010060000', '202010070000', 'SAPP6S00000000005447526995', 0, '1602191206'), ('735999114011092315', '202010060000', '202010070000', 'SAPP6S00000000005447304415', 0, '1602105219'), ('735999114011092315', '202010050000', '202010060000', 'SAPP6S00000000005447112248', 0, '1602025352'), ('735999114011092315', '202010040000', '202010050000', 'SAPP6S00000000005447084790', 0, '1602018735'), ('735999114011092315', '202010040000', '202010050000', 'SAPP6S00000000005446861286', 0, '1601932290'), ('735999114011092315', '202010030000', '202010040000', 'SAPP6S00000000005446654736', 0, '1601853071'), ('735999114011092315', '202010020000', '202010030000', 'SAPP6S00000000005446628360', 0, '1601846026'), ('735999114011092315', '202010020000', '202010030000', 'SAPP6S00000000005446433656', 0, '1601767244'), ('735999114011092315', '202010010000', '202010020000', 'SAPP6S00000000005446409159', 0, '1601762046'), ('735999114011092315', '202009300000', '202010010000', 'SAPP6S00000000005446046795', 0, '1601676997'), ('735999114011092315', '202010010000', '202010020000', 'SAPP6S00000000005446046814', 0, '1601676996'), ('735999114011092315', '202009300000', '202010010000', 'SAPP6S00000000005445623907', 0, '1601588099'), ?, ?, ?, ?, ?)
      

      Running that query caused the MariaDB server to crash, it then went into a restart loop since cPanel tried to automatically restart MariaDB but it just kept crashing since the customer application was still running. When the customer fixed their code the problem stopped and the query now looks like this:

      INSERT IGNORE INTO transaction (meteringpointid, period_start, period_end, transaction_id, override, date_time) VALUES ('735999114011092315', '202010300000', '202010310000', 'SAPP6S00000000005452236060', 0, '1604185511'), ('735999114011092315', '202010290000', '202010300000', 'SAPP6S00000000005452059211', 0, '1604098690'), ('735999114011092315', '202010280000', '202010290000', 'SAPP6S00000000005451878728', 0, '1604012033'), ('735999114011092315', '202010270000', '202010280000', 'SAPP6S00000000005451690110', 0, '1603923617'), ('735999114011092315', '202010260000', '202010270000', 'SAPP6S00000000005451513362', 0, '1603839133'), ('735999114011092315', '202010250000', '202010260000', 'SAPP6S00000000005451263972', 0, '1603755936'), ('735999114011092315', '202010240000', '202010250000', 'SAPP6S00000000005451004661', 0, '1603668441'), ('735999114011092315', '202010230000', '202010240000', 'SAPP6S00000000005451001234', 0, '1603667326'), ('735999114011092315', '202010220000', '202010230000', 'SAPP6S00000000005450997359', 0, '1603666339'), ('735999114011092315', '202010220000', '202010230000', 'SAPP6S00000000005450683396', 0, '1603491816'), ('735999114011092315', '202010210000', '202010220000', 'SAPP6S00000000005450486980', 0, '1603408274'), ('735999114011092315', '202010200000', '202010210000', 'SAPP6S00000000005450459335', 0, '1603401400'), ('735999114011092315', '202010200000', '202010210000', 'SAPP6S00000000005450241769', 0, '1603315052'), ('735999114011092315', '202010190000', '202010200000', 'SAPP6S00000000005450059914', 0, '1603236026'), ('735999114011092315', '202010180000', '202010190000', 'SAPP6S00000000005450023929', 0, '1603228626'), ('735999114011092315', '202010180000', '202010190000', 'SAPP6S00000000005449815178', 0, '1603144250'), ('735999114011092315', '202010170000', '202010180000', 'SAPP6S00000000005449597207', 0, '1603057673'), ('735999114011092315', '202010160000', '202010170000', 'SAPP6S00000000005449446816', 0, '1602986533'), ('735999114011092315', '202010140000', '202010150000', 'SAPP6S00000000005449197042', 0, '1602981499'), ('735999114011092315', '202010150000', '202010160000', 'SAPP6S00000000005449400609', 0, '1602981010'), ('735999114011092315', '202010140000', '202010150000', 'SAPP6S00000000005448994277', 0, '1602796268'), ('735999114011092315', '202010130000', '202010140000', 'SAPP6S00000000005448779974', 0, '1602709915'), ('735999114011092315', '202010120000', '202010130000', 'SAPP6S00000000005448573693', 0, '1602625352'), ('735999114011092315', '202010110000', '202010120000', 'SAPP6S00000000005448348932', 0, '1602538932'), ('735999114011092315', '202010100000', '202010110000', 'SAPP6S00000000005448166218', 0, '1602457852'), ('735999114011092315', '202010090000', '202010100000', 'SAPP6S00000000005448137072', 0, '1602450688'), ('735999114011092315', '202010090000', '202010100000', 'SAPP6S00000000005447946713', 0, '1602366344'), ('735999114011092315', '202010080000', '202010090000', 'SAPP6S00000000005447743476', 0, '1602277635'), ('735999114011092315', '202010070000', '202010080000', 'SAPP6S00000000005447563496', 0, '1602199243'), ('735999114011092315', '202010060000', '202010070000', 'SAPP6S00000000005447526995', 0, '1602191206'), ('735999114011092315', '202010060000', '202010070000', 'SAPP6S00000000005447304415', 0, '1602105219'), ('735999114011092315', '202010050000', '202010060000', 'SAPP6S00000000005447112248', 0, '1602025352'), ('735999114011092315', '202010040000', '202010050000', 'SAPP6S00000000005447084790', 0, '1602018735'), ('735999114011092315', '202010040000', '202010050000', 'SAPP6S00000000005446861286', 0, '1601932290'), ('735999114011092315', '202010030000', '202010040000', 'SAPP6S00000000005446654736', 0, '1601853071'), ('735999114011092315', '202010020000', '202010030000', 'SAPP6S00000000005446628360', 0, '1601846026'), ('735999114011092315', '202010020000', '202010030000', 'SAPP6S00000000005446433656', 0, '1601767244'), ('735999114011092315', '202010010000', '202010020000', 'SAPP6S00000000005446409159', 0, '1601762046'), ('735999114011092315', '202009300000', '202010010000', 'SAPP6S00000000005446046795', 0, '1601676997'), ('735999114011092315', '202010010000', '202010020000', 'SAPP6S00000000005446046814', 0, '1601676996'), ('735999114011092315', '202009300000', '202010010000', 'SAPP6S00000000005445623907', 0, '1601588099')
      

      Notice the question marks at the end of the first query, once they were replaced with real data the server stopped crashing which makes me think MariaDB crashed because of the above invalid query.

      I have attached part of the mysql-log, it just loops the same thing over and over again since the server keep restarting.

      Attachments

        Issue Links

          Activity

            No workflow transitions have been executed yet.

            People

              sanja Oleksandr Byelkin
              erike Erik Ellsinger
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.