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

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

            ycp Yuchen Pei added a comment -

            Draft patch:

            d0a965a1804 bb-10.5-ycp-mdev-35874 MDEV-35874 Spider: add missing skips when fetching results
            

            ycp Yuchen Pei added a comment - Draft patch: d0a965a1804 bb-10.5-ycp-mdev-35874 MDEV-35874 Spider: add missing skips when fetching results
            ycp Yuchen Pei added a comment -

            The draft patch above changes code in spider_db_store_result_for_reuse_cursor(), which is not covered by the spider test suite, and it is not clear how to reach it.

            ycp Yuchen Pei added a comment - The draft patch above changes code in spider_db_store_result_for_reuse_cursor() , which is not covered by the spider test suite, and it is not clear how to reach it.
            ycp Yuchen Pei added a comment -

            Hi holyfoot, ptal thanks:

            a2d73e15339 upstream/bb-10.5-ycp-mdev-35874 MDEV-35874 Spider: add missing skips when fetching results
            

            Note (also to self) that comments about test coverage in storage/spider/spd_db_conn.cc should be removed before pushing.

            The commit message mentions that spider_db_store_result_for_reuse_cursor() is unused. This is correct in CS. However in ES the guarding limit_mode()==1 is satisfied for the odbc backend and specifically the function is covered in the test spider/odbc/mariadb.bgs_mode_2, though without a non-NULL bitmap because the GBH does not support odbc backends.

            ycp Yuchen Pei added a comment - Hi holyfoot , ptal thanks: a2d73e15339 upstream/bb-10.5-ycp-mdev-35874 MDEV-35874 Spider: add missing skips when fetching results Note (also to self) that comments about test coverage in storage/spider/spd_db_conn.cc should be removed before pushing. The commit message mentions that spider_db_store_result_for_reuse_cursor() is unused. This is correct in CS. However in ES the guarding limit_mode()==1 is satisfied for the odbc backend and specifically the function is covered in the test spider/odbc/mariadb.bgs_mode_2 , though without a non-NULL bitmap because the GBH does not support odbc backends.

            ok to push.

            holyfoot Alexey Botchkov added a comment - ok to push.
            ycp Yuchen Pei added a comment - - edited

            This needs to be pushed to 10.5 because it is a recent regression. Current patch is bb-10.5-mdev-35874 4251714c928a1d141462abc3b449dfbf6bceb7a9

            ycp Yuchen Pei added a comment - - edited This needs to be pushed to 10.5 because it is a recent regression. Current patch is bb-10.5-mdev-35874 4251714c928a1d141462abc3b449dfbf6bceb7a9
            ycp Yuchen Pei added a comment -

            pushed fcfb89a8979862ff06552a5e6cd8329f3d5fed6a to 10.5

            ycp Yuchen Pei added a comment - pushed fcfb89a8979862ff06552a5e6cd8329f3d5fed6a to 10.5

            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.