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

Unexpected error 1264 'Out of Range Value for Column' when inserting into ... select ... from a spider table

    XMLWordPrintable

Details

    Description

      Fails at 10.5 df602ff7fa5ed9424a1d7ebaba67b665e2f6d1f6 and 10.6 a6ab0e6c0be218761e4dadf8959c7f42e5fea762

      Simplified test case (will test the fix on the original case in MENT-2204):

      --disable_query_log
      --disable_result_log
      --source ../../t/test_init.inc
      --enable_result_log
      --enable_query_log
      --source include/have_innodb.inc
      set spider_same_server_link= 1;
      evalp CREATE SERVER srv FOREIGN DATA WRAPPER mysql
      OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
       
      CREATE TABLE t1 (c6 decimal(6,0)) ENGINE=InnoDB;
       
      CREATE TABLE t1_s (c6 decimal(6,0))
      ENGINE=SPIDER COMMENT='wrapper "mariadb", srv "srv", table "t1"' ;
       
      CREATE TABLE t2 (c8 decimal(8,0), c6 decimal(6,0)) ENGINE=InnoDB;
       
      INSERT INTO t1 VALUES (123456), (654321);
       
      # fail with ER_WARN_DATA_OUT_OF_RANGE (1264): Out of range value for
      # column c6 at row 1
      # success when selecting from t1 or when
      # set statement spider_use_handler=1 for
      INSERT INTO t2 (c8, c6) SELECT 12345678, c6 FROM t1_s GROUP BY c6;
       
      drop table t2, t1_s, t1;
      drop server srv;
      --disable_query_log
      --disable_result_log
      --source ../../t/test_deinit.inc
      --enable_result_log
      --enable_query_log
      

      Attachments

        Issue Links

          Activity

            People

              ycp Yuchen Pei
              ycp Yuchen Pei
              Votes:
              0 Vote for this issue
              Watchers:
              4 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.