macOS High Sierra 10.13.6, homebrew install stable 10.4.6 (bottled), mysql --version: mysql Ver 15.1 Distrib 10.4.6-MariaDB, for osx10.13 (x86_64) using readline 5.1
Description
It's common when doing bulk inserts (e.g. when importing an SQL dump) for the table to be locked first. Whenever this happens, apparently only on InnoDB tables, all but the final insert is being ignored.
$ mysqladmin create mariadb_bug
$ mysql mariadb_bug < mariadb-insertion-bug-demo.sql
Here's a demo using a standard WordPress database structure from one table, and three demo rows.
I can confirm that if the inserts are batched, the last batch (of however many rows were in the insert statement) is retained.
If can also confirm the same behaviour if I run the commands manually in SQL, one at at a time, rather than piping the SQL dump in - the table has 3 rows if I omit the lock and unlock statements, but only one if I include them.
When testing in_ MySQL_ (installed via homebrew or other means) in the same environment, rather than mariadb, the bug doesn't appear.
It's possible this began in an earlier version than 10.4.6 (someone mentioned 10.4.4 on the above Drupal issue). I looked at the release notes for 10.4.7 (not available on Homebrew yet) and didn't spot anything related.
Ran mysql_upgrade. Lots of information spit out and I now see the *_stats tables.
Of the three sites that displayed issues as a result, two appear to functioning normally again. The third I likely broke in other ways during my attempts to deal with the issue when it first occurred, so you can mark me down as saying that the fix works. Thanks!
Michael Sypes
added a comment - - edited Ran mysql_upgrade . Lots of information spit out and I now see the *_stats tables.
Of the three sites that displayed issues as a result, two appear to functioning normally again. The third I likely broke in other ways during my attempts to deal with the issue when it first occurred, so you can mark me down as saying that the fix works. Thanks!
I don't know if this is related, but while poking around my instance to see if it's safe to use, I noticed that Sequel Pro can't see all the users and privileges, and also tends to crap out when trying to view them.
For example, mysql.user has 36 rows representing about 30 usernames. However, Sequel Pro is only seeing two of them, and there's nothing obvious that would those two special.
In addition, if I try to look at the schema-specific privileges for them (which I did trying to find out what was special), nothing shows up as available, for any database.
Michael Sypes
added a comment - I don't know if this is related, but while poking around my instance to see if it's safe to use, I noticed that Sequel Pro can't see all the users and privileges, and also tends to crap out when trying to view them.
For example, mysql.user has 36 rows representing about 30 usernames. However, Sequel Pro is only seeing two of them, and there's nothing obvious that would those two special.
In addition, if I try to look at the schema-specific privileges for them (which I did trying to find out what was special), nothing shows up as available, for any database.
mysql_upgrade runs successfully (albeit with errors in phase 3/7 - Fixing views from mysql).
subsequently, I can run my mariadb-insertion-bug-demo.sql statements and no rows are missing
I've also imported a large database (couple of tables with 300,000+ rows each) and that's fine too
not seeing the problems Michael is with Sequel Pro - the number of rows in CLI and Sequel Pro matches for me (however I have fewer records in user. table - 13 vs 36)
Thanks,
William
William Turrell
added a comment - Hello again.
mysql_upgrade runs successfully (albeit with errors in phase 3/7 - Fixing views from mysql).
subsequently, I can run my mariadb-insertion-bug-demo.sql statements and no rows are missing
I've also imported a large database (couple of tables with 300,000+ rows each) and that's fine too
not seeing the problems Michael is with Sequel Pro - the number of rows in CLI and Sequel Pro matches for me (however I have fewer records in user. table - 13 vs 36)
Thanks,
William
Michael Sypes
added a comment - - edited I've done some research on the Sequel Pro issue, and determined that it's unrelated to this this, but is a known issue, that's just new to me:
https://github.com/sequelpro/sequelpro/issues/2982 , https://github.com/sequelpro/sequelpro/issues/3139 , https://github.com/sequelpro/sequelpro/issues/3167
People
Sergei Golubchik
William Turrell
Votes:
1Vote for this issue
Watchers:
9Start 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.
{"report":{"fcp":929.2000000476837,"ttfb":286.09999990463257,"pageVisibility":"visible","entityId":78248,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"320233f7-6204-453c-87cd-7da0b3c3c29a","navigationType":0,"readyForUser":1021.8999998569489,"redirectCount":0,"resourceLoadedEnd":619.7000000476837,"resourceLoadedStart":293.39999985694885,"resourceTiming":[{"duration":39.700000047683716,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":293.39999985694885,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":293.39999985694885,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":333.09999990463257,"responseStart":0,"secureConnectionStart":0},{"duration":43.5,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/2bf333562ca6724060a9d5f1535471f6/_/download/contextbatch/css/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":293.7999999523163,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":293.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":337.2999999523163,"responseStart":0,"secureConnectionStart":0},{"duration":192.59999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":294,"connectEnd":294,"connectStart":294,"domainLookupEnd":294,"domainLookupStart":294,"fetchStart":294,"redirectEnd":0,"redirectStart":0,"requestStart":342.2000000476837,"responseEnd":486.59999990463257,"responseStart":362.2999999523163,"secureConnectionStart":294},{"duration":303.60000014305115,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/2bf333562ca6724060a9d5f1535471f6/_/download/contextbatch/js/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true","startTime":294.09999990463257,"connectEnd":294.09999990463257,"connectStart":294.09999990463257,"domainLookupEnd":294.09999990463257,"domainLookupStart":294.09999990463257,"fetchStart":294.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":342.39999985694885,"responseEnd":597.7000000476837,"responseStart":378.2000000476837,"secureConnectionStart":294.09999990463257},{"duration":72.70000004768372,"initiatorType":"script","name":"https://jira.mariadb.org/s/a9324d6758d385eb45c462685ad88f1d-CDN/lu2cib/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":294.39999985694885,"connectEnd":294.39999985694885,"connectStart":294.39999985694885,"domainLookupEnd":294.39999985694885,"domainLookupStart":294.39999985694885,"fetchStart":294.39999985694885,"redirectEnd":0,"redirectStart":0,"requestStart":342.59999990463257,"responseEnd":367.09999990463257,"responseStart":365.7000000476837,"secureConnectionStart":294.39999985694885},{"duration":77,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":294.59999990463257,"connectEnd":294.59999990463257,"connectStart":294.59999990463257,"domainLookupEnd":294.59999990463257,"domainLookupStart":294.59999990463257,"fetchStart":294.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":348.5,"responseEnd":371.59999990463257,"responseStart":370,"secureConnectionStart":294.59999990463257},{"duration":78.59999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":294.7000000476837,"connectEnd":294.7000000476837,"connectStart":294.7000000476837,"domainLookupEnd":294.7000000476837,"domainLookupStart":294.7000000476837,"fetchStart":294.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":348.89999985694885,"responseEnd":373.2999999523163,"responseStart":372.2000000476837,"secureConnectionStart":294.7000000476837},{"duration":51.5,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2cib/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":295,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":295,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":346.5,"responseStart":0,"secureConnectionStart":0},{"duration":79.5,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":295.2000000476837,"connectEnd":295.2000000476837,"connectStart":295.2000000476837,"domainLookupEnd":295.2000000476837,"domainLookupStart":295.2000000476837,"fetchStart":295.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":350.5,"responseEnd":374.7000000476837,"responseStart":373.7999999523163,"secureConnectionStart":295.2000000476837},{"duration":53.40000009536743,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/css/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.css?jira.create.linked.issue=true","startTime":295.39999985694885,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":295.39999985694885,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":348.7999999523163,"responseStart":0,"secureConnectionStart":0},{"duration":80.70000004768372,"initiatorType":"script","name":"https://jira.mariadb.org/s/5d5e8fe91fbc506585e83ea3b62ccc4b-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/js/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.js?jira.create.linked.issue=true&locale=en","startTime":295.59999990463257,"connectEnd":295.59999990463257,"connectStart":295.59999990463257,"domainLookupEnd":295.59999990463257,"domainLookupStart":295.59999990463257,"fetchStart":295.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":352.7000000476837,"responseEnd":376.2999999523163,"responseStart":375.2999999523163,"secureConnectionStart":295.59999990463257},{"duration":321.89999985694885,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":296.5,"connectEnd":296.5,"connectStart":296.5,"domainLookupEnd":296.5,"domainLookupStart":296.5,"fetchStart":296.5,"redirectEnd":0,"redirectStart":0,"requestStart":400.09999990463257,"responseEnd":618.3999998569489,"responseStart":612.2999999523163,"secureConnectionStart":296.5},{"duration":323.10000014305115,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":296.59999990463257,"connectEnd":296.59999990463257,"connectStart":296.59999990463257,"domainLookupEnd":296.59999990463257,"domainLookupStart":296.59999990463257,"fetchStart":296.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":431.59999990463257,"responseEnd":619.7000000476837,"responseStart":616,"secureConnectionStart":296.59999990463257},{"duration":121.79999995231628,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":617.0999999046326,"connectEnd":617.0999999046326,"connectStart":617.0999999046326,"domainLookupEnd":617.0999999046326,"domainLookupStart":617.0999999046326,"fetchStart":617.0999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":702.0999999046326,"responseEnd":738.8999998569489,"responseStart":737.5999999046326,"secureConnectionStart":617.0999999046326},{"duration":177.5,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":842.5,"connectEnd":842.5,"connectStart":842.5,"domainLookupEnd":842.5,"domainLookupStart":842.5,"fetchStart":842.5,"redirectEnd":0,"redirectStart":0,"requestStart":983.3999998569489,"responseEnd":1020,"responseStart":1019.2999999523163,"secureConnectionStart":842.5}],"fetchStart":0,"domainLookupStart":44,"domainLookupEnd":86,"connectStart":86,"connectEnd":104,"secureConnectionStart":94,"requestStart":106,"responseStart":286,"responseEnd":291,"domLoading":291,"domInteractive":1091,"domContentLoadedEventStart":1091,"domContentLoadedEventEnd":1147,"domComplete":1453,"loadEventStart":1453,"loadEventEnd":1454,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1065.5999999046326},{"name":"bigPipe.sidebar-id.end","time":1066.3999998569489},{"name":"bigPipe.activity-panel-pipe-id.start","time":1066.5},{"name":"bigPipe.activity-panel-pipe-id.end","time":1068.2000000476837},{"name":"activityTabFullyLoaded","time":1163.7000000476837}],"measures":[],"correlationId":"8d2c070a1d6a64","effectiveType":"4g","downlink":9.2,"rtt":0,"serverDuration":111,"dbReadsTimeInMs":14,"dbConnsTimeInMs":23,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
Sorry. Yes, if the tables don't exist, please run mysql_upgrade.