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

Column containing non-vector values can be modified to VECTOR type without warnings

Details

    Description

      bb-11.6-MDEV-32887-vector 764592a4da2a1b490471732fbefe2ce745ce1f32

      MariaDB [test]> create table t (a blob);
      Query OK, 0 rows affected (0.033 sec)
       
      MariaDB [test]> insert into t values (1),(2);
      Query OK, 2 rows affected (0.013 sec)
      Records: 2  Duplicates: 0  Warnings: 0
       
      MariaDB [test]> alter table t modify a vector(100);
      Query OK, 2 rows affected (0.078 sec)                      
      Records: 2  Duplicates: 0  Warnings: 0
       
      MariaDB [test]> insert into t values (1),(2);
      ERROR 4078 (HY000): Cannot cast 'int' as 'vector' in assignment of `test`.`t`.`a`
      

      So, while new values cannot be inserted, existing values got converted into vectors without warnings.

      MariaDB [test]> select vec_totext(a) from t\G
      *************************** 1. row ***************************
      vec_totext(a): [-8084406208738727000000000000000000000.000000,0.000000,...]
      *************************** 2. row ***************************
      vec_totext(a): [-12181128430122706000000000000000000000.000000,0.000000,...]
      2 rows in set (0.001 sec)
      

      Geometry does not work like that:

      MariaDB [test]> create table ts (a blob);
      Query OK, 0 rows affected (0.033 sec)
       
      MariaDB [test]> insert into ts values (1),(2);
      Query OK, 2 rows affected (0.014 sec)
      Records: 2  Duplicates: 0  Warnings: 0
       
      MariaDB [test]> alter table ts modify a geometry;
      ERROR 1416 (22003): Cannot get geometry object from data you send to the GEOMETRY field
      

      Attachments

        Issue Links

          Activity

            There are no comments yet on this issue.

            People

              serg Sergei Golubchik
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.