Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mysqldump with generated column doesn't work while importing #105

Closed
karthikeayan opened this issue Jun 19, 2019 · 40 comments · Fixed by #258
Closed

mysqldump with generated column doesn't work while importing #105

karthikeayan opened this issue Jun 19, 2019 · 40 comments · Fixed by #258

Comments

@karthikeayan
Copy link

I am getting below error when importing mysqldump taken from this docker image.

ERROR 3105 (HY000) at line 82: The value specified for generated column 'column_name' in table 'table_name' is not allowed.

Source and destination mysql server having same version.

MySQL server version:

mysqld Ver 5.7.26 for Linux on x86_64 (MySQL Community Server (GPL))

MySQL Dump client version:

mysqldump Ver 10.17 Distrib 10.3.12-MariaDB, for Linux (x86_64)

@deitch
Copy link
Collaborator

deitch commented Jun 20, 2019

@karthikeayan can you run the dump manually off the database and see?

Also, if you run the mysql-backup image with debug enabled - DB_DUMP_DEBUG=true - you should see the mysqldump line. If it is possible to pull that line, post it here (omitting credentials, of course), and then see if we can replicate it? It is likely a version mismatch or some mysqldump bug, but let's figure it out and get it fixed either way.

Also, can you paste the relevant part of the dump output, based on the above, line 82 and its surrounding areas? Again, masking any sensitive info.

@karthikeayan
Copy link
Author

I am not sure if this is fixable as this seems an mismatch between mysql and mariadb json functions. Your dockerfile uses alpine and alpine by default install mariadb client not mysql client.

More info: https://dba.stackexchange.com/questions/240880/can-we-use-mariadb-mysqldump-cli-to-take-dump-from-mysql-community-version

I also tried changing the base image to ubuntu in your Dockerfile to take dump. It works with 30MB database but when I use my image on 30GB database, mysqldump was very very slow and after creating 5-6GB of sql file the container got killed.

@deitch
Copy link
Collaborator

deitch commented Jun 20, 2019

mismatch between mysql and mariadb json functions

And so it appears. I would be tempted to ask the MariaDB team to fix it (they are pretty good about it), but this just may be a divergence. We may need to have separate mysql and mariadb images then.

It works with 30MB database but when I use my image on 30GB database, mysqldump was very very slow and after creating 5-6GB of sql file the container got killed.

If you can replicate it without using your own sensitive data, can you open a new issue and put in exact steps to replicate?

@deitch
Copy link
Collaborator

deitch commented Jun 20, 2019

mismatch between mysql and mariadb json functions

I am curious as to why this hasn't been an issue until now. Do only certain scenarios trigger it? If you look at your dump file, what is it that triggered the problem?

@deitch
Copy link
Collaborator

deitch commented Jun 20, 2019

@karthikeayan
Copy link
Author

karthikeayan commented Jun 20, 2019

I am just posting the first few characters from the line 82, as the complete line is too huge.

https://gist.github.com/karthikeayan/2f4e18f204786c78ff2874becf6af260

@deitch
Copy link
Collaborator

deitch commented Jun 20, 2019

Can you put it in a gist or somewhere we can see it?

@karthikeayan
Copy link
Author

Created PR

@prvucetic
Copy link

Hey, what's the status of this? I'm facing this issue when try to restore to the same db server I created backup from.

I have the following:

/# mysql --version mysql Ver 8.0.21 for Linux on x86_64 (MySQL Community Server - GPL)

/# mysqldump --version mysqldump Ver 8.0.21 for Linux on x86_64 (MySQL Community Server - GPL)

Tnx

@deitch
Copy link
Collaborator

deitch commented Nov 1, 2020

There is a PR open, linked in this issue, needs to be rebased and cleaned.

@ToshY
Copy link
Contributor

ToshY commented Dec 13, 2021

@deitch The only thing really needed is to replace mariadb-client in favor for mysql-client.

Submitted a PR, could you take a quick look at it?

@ToshY ToshY mentioned this issue Dec 13, 2021
@Kirgod
Copy link

Kirgod commented Nov 6, 2023

Still facing with same error :(

@deitch
Copy link
Collaborator

deitch commented Dec 31, 2023

What happens with the go-based one? You can download the actual binary from GitHub releases page, or run the docker image with the 1.0.0-rc1 tag. Be aware that the env vars have been revamped.

@dabico
Copy link

dabico commented Jan 2, 2024

Unfortunately, I'm still facing the same issue. I tested this out with databack/mysql-backup:latest. Here's the compose file I used:

version: '3.9'

services:

  test-database:
    image: mysql:8.2.0
    container_name: test-database
    restart: "always"
    volumes:
      - data:/var/lib/mysql
      - ./mysql.cnf:/etc/mysql/conf.d/mysql.cnf
    environment:
      MYSQL_ALLOW_EMPTY_PASSWORD: yes
      MYSQL_DATABASE: test
      MYSQL_USER: testadmin
      MYSQL_PASSWORD: L33Th4Xx0r
      TZ: UTC
    healthcheck:
      test: mysqladmin ping -h localhost
      start_period: 10s
      interval: 10s
      timeout: 5s
      retries: 5

  test-backup:
    image: databack/mysql-backup:latest
    container_name: test-backup
    restart: "no"
    volumes:
      - backup:/backup
      - ./bkpdb/pre:/scripts.d/pre-backup
      - ./bkpdb/post:/scripts.d/post-backup
    environment:
      TZ: UTC
      DB_NAMES: test
      DB_PORT: 3306
      DB_USER: testadmin
      DB_PASS: L33Th4Xx0r
      DB_SERVER: test-database
      DB_DUMP_TARGET: /backup
      DB_DUMP_DEBUG: true
      DB_DUMP_SAFECHARS: true
      DB_DUMP_BEGIN: "0"
      RUN_ONCE: true
    depends_on:
      gse-database:
        condition: service_healthy

volumes:
  data:
    name: test-data
  backup:
    name: test-data-backups

Assume that the test-data volume already contains a test database with at least one table containing generated columns. Looking at the top of the dump, it seems like MariaDB is still being used:

-- MariaDB dump 10.19  Distrib 10.6.12-MariaDB, for Linux (x86_64)
--
-- Host: test-database    Database: test
-- ------------------------------------------------------
-- Server version	8.2.0

Performing dumps manually from the mysql container works as intended. I think that the only way to solve this is to use the mysql-client, which is not available on Alpine Linux.

@deitch
Copy link
Collaborator

deitch commented Jan 2, 2024

latest won't do it. latest explicitly points at the most recent semver tag, i.e. not including -beta* or -rc* or any of that. You would need to use the explicit 1.0.0-rc1 tag.

@dabico
Copy link

dabico commented Jan 2, 2024

Okay got it, I thought latest pointed to that release. I updated the image and tried running with the config I posted above, but it only prints the mysql-backup description. Do I also have to specify a command in my compose config?

@deitch
Copy link
Collaborator

deitch commented Jan 2, 2024

Yeah, it only points to the most recent semver. Having it point to not-yet-released versions (beta or release candidates, etc.) would put out a version that is not ready. Like the current go-based one. Very close, but not there yet.

Do I also have to specify a command in my compose config?

Yes. Took advantage of the major version release to clean up and make much more consistent CLI flags and env vars and names, and add a config file option.

$ mysql-backup
Backup or restore one or more mysql-compatible databases.
		In addition to the provided command-line flag options and environment variables,
		when using s3-storage, supports the standard AWS options:

		AWS_ACCESS_KEY_ID: AWS Key ID
		AWS_SECRET_ACCESS_KEY: AWS Secret Access Key
		AWS_REGION: Region in which the bucket resides

Usage:
  mysql-backup [command]

Available Commands:
  dump        backup a database
  help        Help about any command
  restore     restore a dump

Flags:
      --aws-access-key-id string       Access Key for s3 and s3 interoperable systems; ignored if not using s3.
      --aws-endpoint-url string        Specify an alternative endpoint for s3 interoperable systems e.g. Digitalocean; ignored if not using s3.
      --aws-region string              Region for s3 and s3 interoperable systems; ignored if not using s3.
      --aws-secret-access-key string   Secret Access Key for s3 and s3 interoperable systems; ignored if not using s3.
  -h, --help                           help for mysql-backup
      --pass string                    password for database server
      --port int                       port for database server (default 3306)
      --server string                  hostname for database server
      --smb-domain string              SMB domain
      --smb-pass string                SMB username
      --smb-user string                SMB username
      --tmp string                     temporary directory base for working directory, defaults to OS (default "/var/folders/7k/011x7ywd3ss305ntyxldy6mc0000gn/T/")
      --user string                    username for database server
  -v, --verbose int                    set log level, 1 is debug, 2 is trace

Use "mysql-backup [command] --help" for more information about a command.

@dabico
Copy link

dabico commented Jan 2, 2024

After specifying the command I get the following error:

2024-01-02T12:16:10.030319627Z time="2024-01-02T12:16:10Z" level=debug msg="starting dump"
2024-01-02T12:16:10.030480544Z time="2024-01-02T12:16:10Z" level=info msg="beginning dump 2024-01-02T12:16:10Z"
2024-01-02T12:16:10.033349259Z panic: runtime error: invalid memory address or nil pointer dereference
2024-01-02T12:16:10.033373050Z [signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0xad36e7]
2024-01-02T12:16:10.033376740Z 
2024-01-02T12:16:10.033379895Z goroutine 1 [running]:
2024-01-02T12:16:10.033382536Z github.com/databacker/mysql-backup/pkg/core.Dump({{0xc0001dcbc0, 0x1, 0x1}, 0x1, {0xc0001dcc50, 0x1, 0x1}, {{0x0, 0x0}, {0x0, ...}, ...}, ...})
2024-01-02T12:16:10.033385802Z 	/src/mysql-backup/pkg/core/dump.go:61 +0x1e7
2024-01-02T12:16:10.033388719Z github.com/databacker/mysql-backup/pkg/core.TimerDump({{0xc0001dcbc0, 0x1, 0x1}, 0x1, {0xc0001dcc50, 0x1, 0x1}, {{0x0, 0x0}, {0x0, ...}, ...}, ...}, ...)
2024-01-02T12:16:10.033391978Z 	/src/mysql-backup/pkg/core/dump.go:31 +0x13e
2024-01-02T12:16:10.033395016Z github.com/databacker/mysql-backup/cmd.dumpCmd.func2(0xc0000d3340?, {0xc659f8?, 0x8?, 0x8?})
2024-01-02T12:16:10.033397790Z 	/src/mysql-backup/cmd/dump.go:144 +0x7d7
2024-01-02T12:16:10.033400388Z github.com/spf13/cobra.(*Command).execute(0xc0000d3340, {0xc0000ada00, 0x8, 0x8})
2024-01-02T12:16:10.033403509Z 	/go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:842 +0x67c
2024-01-02T12:16:10.033406301Z github.com/spf13/cobra.(*Command).ExecuteC(0xc0000d3080)
2024-01-02T12:16:10.033409451Z 	/go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:950 +0x39d
2024-01-02T12:16:10.033412621Z github.com/spf13/cobra.(*Command).Execute(...)
2024-01-02T12:16:10.033415643Z 	/go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:887
2024-01-02T12:16:10.033418367Z github.com/databacker/mysql-backup/cmd.Execute()
2024-01-02T12:16:10.033421320Z 	/src/mysql-backup/cmd/root.go:227 +0x68
2024-01-02T12:16:10.033424226Z main.main()
2024-01-02T12:16:10.033426621Z 	/src/mysql-backup/main.go:8 +0x17

I only added a dump command to the existing configuration. Is some combination of the environment variables causing this? Do I need to also change those, either by renaming them or changing their values?

@deitch
Copy link
Collaborator

deitch commented Jan 2, 2024

Yes and no. Yes, (some of) the env vars have been renamed. No, it should not crash no matter what. Well, that is why it is a "release candidate" and not "generally available".

Any way I can recreate that?

@dabico
Copy link

dabico commented Jan 2, 2024

Here's a repository with an MRE: https://github.com/dabico/mysql-backup-issue-105

@deitch
Copy link
Collaborator

deitch commented Jan 4, 2024

Here's a repository with an MRE: https://github.com/dabico/mysql-backup-issue-105

Did you just create the database, load it with the test.sql, and then run the backup? Seems pretty simple. I will try to recreate.

Hmm, there were some bugs fixed between rc1 and now, (rc2 not yet released), I wonder if this is one of them. Should be able to find out pretty quickly.

@dabico
Copy link

dabico commented Jan 4, 2024

Did you just create the database, load it with the test.sql, and then run the backup? Seems pretty simple. I will try to recreate.

Yeah, you just have to run docker-compose up. The data import is done automatically thanks to the bind mount. The backup does not start until the database is healthy.

Edit: Should this be another issue?

@deitch
Copy link
Collaborator

deitch commented Jan 4, 2024

Yeah, you just have to run docker-compose up. The data import is done automatically thanks to the bind mount. The backup does not start until the database is healthy.

I figured it out once I read how your compose was configured. I didn't use compose in the end. Started mysql in docker with same config, but ran mysql-backup via CLI.

Can confirm it is an issue, not resolved by latest commit. Working on it.

Should this be another issue?

I was going to say no, but I think this is best as a new issue. Thanks.

@dabico
Copy link

dabico commented Jan 4, 2024

I was going to say no, but I think this is best as a new issue. Thanks.

Here is is #250

@deitch
Copy link
Collaborator

deitch commented Jan 4, 2024

That fix was merged in. A new rc is not being cut yet, but once the post-merge pipeline finishes running, you should be able to address the image by tag and run again. See what new surprises it brings for us. 😁

I will post here once it is ready.

@deitch
Copy link
Collaborator

deitch commented Jan 4, 2024

Ready. Try the tag 9ccbe20615bdeeefd759e820ecf3158b6a8c3c0c

@dabico
Copy link

dabico commented Jan 4, 2024

I updated the image tag in the MRE. The previous issue has been resolved, but now I get an error saying:

Error: error backing up: failed to list database schemas: could not get schemas: dial tcp :0: connect: connection refused

I find this odd, especially since DB_NAMES is specified in my compose config. Am I missing something in the configuration?

@deitch
Copy link
Collaborator

deitch commented Jan 4, 2024

Am I missing something in the configuration?

Probably not. But once we get this all working, time to cut a new release candidate 😁

@deitch
Copy link
Collaborator

deitch commented Jan 4, 2024

Do you mind opening a new issue for it? I see the problem, want to track it, but not sure going to get to it today.

@dabico
Copy link

dabico commented Jan 7, 2024

I updated the image tag in the MRE to cf11d58e1bc01aedb99da1437cf0e852f874520f. The error is the same but the cause is now reported as a denial of access from the database:

Error: error backing up: failed to list database schemas: could not get schemas: Error 1045 (28000): Access denied for user 'testadmin'@'172.19.0.3' (using password: NO)

Again, this is strange because the password is specified in the compose config.

@deitch
Copy link
Collaborator

deitch commented Jan 7, 2024

I had that at one point, turned out to be a copy-paste error in my case. I am running it on command-line, so I missed pasting part of it.

Are you sure you have the right var for the password? I would check the README, but I think it is DB_PASS instead of DB_PASSWORD.

in the MRE

Every you time you write that, my first reaction is, "Meals Ready to Eat"? (US Army combat rations). They are on my mind because there was a whole issue with them that made the business press a few years back. Funny what sticks in your mind.

@dabico
Copy link

dabico commented Jan 7, 2024

Are you sure you have the right var for the password? I would check the README, but I think it is DB_PASS instead of DB_PASSWORD.

Yeah, my bad I was using the wrong environment variable. I'll give it another go.

@dabico
Copy link

dabico commented Jan 7, 2024

Well, the good news is that it executes without any errors! 🥳

Unfortunately, the dump still contains the generated column values in the insert statements. 😢

Here's the output from the reproduction repository:

-- Go SQL Dump 0.6.0
--
-- Host: test-database    Database: test
-- ------------------------------------------------------
-- Server version	8.2.0

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!50503 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Current Database: `test`
--

CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci */ /*!80016 DEFAULT ENCRYPTION='N' */;

USE `test`;

--
-- Table structure for table `ignore`
--

DROP TABLE IF EXISTS `ignore`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `ignore` (
  `id` int NOT NULL AUTO_INCREMENT,
  `value` int NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `ignore`
--

LOCK TABLES `ignore` WRITE;
/*!40000 ALTER TABLE `ignore` DISABLE KEYS */;
INSERT INTO `ignore` VALUES (1,10),(2,11),(3,12),(4,13),(5,14),(6,15),(7,16),(8,17),(9,18),(10,19);
/*!40000 ALTER TABLE `ignore` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `test`
--

DROP TABLE IF EXISTS `test`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `test` (
  `id` int NOT NULL AUTO_INCREMENT,
  `value` int NOT NULL,
  `generated` int GENERATED ALWAYS AS ((`value` + 1)) STORED NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `test`
--

LOCK TABLES `test` WRITE;
/*!40000 ALTER TABLE `test` DISABLE KEYS */;
INSERT INTO `test` VALUES (1,0,1),(2,1,2),(3,2,3),(4,3,4),(5,4,5),(6,5,6),(7,6,7),(8,7,8),(9,8,9),(10,9,10);
/*!40000 ALTER TABLE `test` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2024-01-07 15:09:19

I'm not familiar with what the Go driver for MySQL uses under the hood, but to me, it seems that only the mysqldump command can produce a correct output...

@deitch
Copy link
Collaborator

deitch commented Jan 7, 2024

No way "bad news", this is very good news. We have something we can work with now.

@deitch
Copy link
Collaborator

deitch commented Jan 7, 2024

Now that we recreated it with the latest commits, can we review how to recreate this? Does the replication in the repo your provided do this? What are the steps to recreate it now?

@dabico
Copy link

dabico commented Jan 7, 2024

Now that we recreated it with the latest commits, can we review how to recreate this? Does the replication in the repo your provided do this? What are the steps to recreate it now?

Yes, same repository, just run docker-compose up.

Btw, forgot to mention that I had to add to the user: "0" in the service configuration because of permission issues. I got this suggestion from your docs, but I was just wondering how it can be avoided.

@deitch
Copy link
Collaborator

deitch commented Jan 7, 2024

What would the "control group" be, then? Run mysqldump from within the image? I want to compare the .sql dump files.

@dabico
Copy link

dabico commented Jan 7, 2024

What would the "control group" be, then? Run mysqldump from within the image? I want to compare the .sql dump files.

That's how I tested it. I ran: mysqldump -u root test > test.sql in the container, and got the following:

-- MySQL dump 10.13  Distrib 8.2.0, for Linux (x86_64)
--
-- Host: localhost    Database: test
-- ------------------------------------------------------
-- Server version       8.2.0

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!50503 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `test`
--

DROP TABLE IF EXISTS `test`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `test` (
  `id` int NOT NULL AUTO_INCREMENT,
  `value` int NOT NULL,
  `generated` int GENERATED ALWAYS AS ((`value` + 1)) STORED NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `test`
--

LOCK TABLES `test` WRITE;
/*!40000 ALTER TABLE `test` DISABLE KEYS */;
INSERT INTO `test` (`id`, `value`) VALUES (1,0),(2,1),(3,2),(4,3),(5,4),(6,5),(7,6),(8,7),(9,8),(10,9);
/*!40000 ALTER TABLE `test` ENABLE KEYS */;
UNLOCK TABLES;
/*!50003 SET @saved_cs_client      = @@character_set_client */ ;
/*!50003 SET @saved_cs_results     = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client  = latin1 */ ;
/*!50003 SET character_set_results = latin1 */ ;
/*!50003 SET collation_connection  = latin1_swedish_ci */ ;
/*!50003 SET @saved_sql_mode       = @@sql_mode */ ;
/*!50003 SET sql_mode              = 'ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `test_before_insert` BEFORE INSERT ON `test` FOR EACH ROW BEGIN END */;;
DELIMITER ;
/*!50003 SET sql_mode              = @saved_sql_mode */ ;
/*!50003 SET character_set_client  = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection  = @saved_col_connection */ ;
/*!50003 SET @saved_cs_client      = @@character_set_client */ ;
/*!50003 SET @saved_cs_results     = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client  = latin1 */ ;
/*!50003 SET character_set_results = latin1 */ ;
/*!50003 SET collation_connection  = latin1_swedish_ci */ ;
/*!50003 SET @saved_sql_mode       = @@sql_mode */ ;
/*!50003 SET sql_mode              = 'ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `test_after_insert` AFTER INSERT ON `test` FOR EACH ROW BEGIN END */;;
DELIMITER ;
/*!50003 SET sql_mode              = @saved_sql_mode */ ;
/*!50003 SET character_set_client  = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection  = @saved_col_connection */ ;

--
-- Dumping events for database 'test'
--
/*!50106 SET @save_time_zone= @@TIME_ZONE */ ;
/*!50106 DROP EVENT IF EXISTS `event_stub` */;
DELIMITER ;;
/*!50003 SET @saved_cs_client      = @@character_set_client */ ;;
/*!50003 SET @saved_cs_results     = @@character_set_results */ ;;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;;
/*!50003 SET character_set_client  = latin1 */ ;;
/*!50003 SET character_set_results = latin1 */ ;;
/*!50003 SET collation_connection  = latin1_swedish_ci */ ;;
/*!50003 SET @saved_sql_mode       = @@sql_mode */ ;;
/*!50003 SET sql_mode              = 'ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION' */ ;;
/*!50003 SET @saved_time_zone      = @@time_zone */ ;;
/*!50003 SET time_zone             = 'SYSTEM' */ ;;
/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `event_stub` ON SCHEDULE EVERY 1 MINUTE STARTS '2024-01-07 15:26:12' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN END */ ;;
/*!50003 SET time_zone             = @saved_time_zone */ ;;
/*!50003 SET sql_mode              = @saved_sql_mode */ ;;
/*!50003 SET character_set_client  = @saved_cs_client */ ;;
/*!50003 SET character_set_results = @saved_cs_results */ ;;
/*!50003 SET collation_connection  = @saved_col_connection */ ;;
DELIMITER ;
/*!50106 SET TIME_ZONE= @save_time_zone */ ;

--
-- Dumping routines for database 'test'
--
/*!50003 DROP PROCEDURE IF EXISTS `procedure_stub` */;
/*!50003 SET @saved_cs_client      = @@character_set_client */ ;
/*!50003 SET @saved_cs_results     = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client  = latin1 */ ;
/*!50003 SET character_set_results = latin1 */ ;
/*!50003 SET collation_connection  = latin1_swedish_ci */ ;
/*!50003 SET @saved_sql_mode       = @@sql_mode */ ;
/*!50003 SET sql_mode              = 'ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `procedure_stub`()
BEGIN END ;;
DELIMITER ;
/*!50003 SET sql_mode              = @saved_sql_mode */ ;
/*!50003 SET character_set_client  = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection  = @saved_col_connection */ ;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2024-01-07 18:03:35

@deitch
Copy link
Collaborator

deitch commented Jan 8, 2024

That helps. We have a good comparison here. Going to work with it.

@deitch
Copy link
Collaborator

deitch commented Jan 8, 2024

With all of that out of the way, and some additional fixes, we can get to the core issue here. You should not really restore (or dump) a generated column. It is calculated, not stored. We just need to filter those columns out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants