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

Nil return on subquery in IS

    XMLWordPrintable

Details

    Description

      Randomly i get such issue

      Could not fetch master tables sql: Scan error on column index 6: converting driver.Value type <nil> ("<nil>") to a uint64:
       
      SELECT a.TABLE_SCHEMA as Table_schema ,  a.TABLE_NAME as Table_name ,a.ENGINE as Engine,a.TABLE_ROWS as Table_rows ,COALESCE(a.DATA_LENGTH,0) as Data_length,COALESCE(a.INDEX_LENGTH,0) as Index_length ,(select CONV(LEFT(MD5(group_concat(concat(b.column_name,b.column_type,COALESCE(b.is_nullable,''),COALESCE(b.CHARACTER_SET_NAME,''), COALESCE(b.COLLATION_NAME,''),COALESCE(b.COLUMN_DEFAULT,''),COALESCE(c.CONSTRAINT_NAME,''),COALESCE(c.ORDINAL_POSITION,'')))), 16), 16, 10)    FROM information_schema.COLUMNS b left join information_schema.KEY_COLUMN_USAGE c ON b.table_schema=c.table_schema  and  b.table_name=c.table_name where b.table_schema=a.table_schema  and  b.table_name=a.table_name ) as Table_crc FROM information_schema.TABLES a WHERE a.TABLE_TYPE='BASE TABLE' and a.TABLE_SCHEMA NOT IN('information_schema','mysql','performance_schema')
      

      This is SQL is tracking schema changes an works on many workload but i guess return wrong nil value on rename or create or replace table as the only specific processing is a scheduler job similar to this

      set sql_log_bin=0;  
      CREATE DATABASE IF NOT EXISTS geonames;
      USE geonames;
       
       
      CREATE OR REPLACE TABLE `geo_name_new` ( 
      `geonameid` int(10) unsigned NOT NULL default '0', 
      `name` varchar(200) NOT NULL default '', 
      `ansiname` varchar(200) NOT NULL default '', 
      `alternatenames` varchar(2000) NOT NULL default '', 
      `latitude` double NOT NULL default '0', 
      `longitude` double NOT NULL default '0', 
      `feature_class` char(1) , 
      `feature_code` varchar(10) , 
      `country_code` char(2), 
      `cc2` varchar(60), 
      `admin1_code` varchar(20) default '', 
      `admin2_code` varchar(80) default '', 
      `admin3_code` varchar(20) default '', 
      `admin4_code` varchar(20) default '', 
      `population` bigint(11) default '0', 
      `elevation` int(11) default '0', 
      `gtopo30` int(11) default '0', 
      `timezone` varchar(40), 
      `modification_date` date default '0000-00-00', 
      PRIMARY KEY (`geonameid`) 
      ) CHARACTER SET utf8 ; 
       
      set global local_infile=1; 
      load data local infile 'allCountries.txt' INTO TABLE geo_name_new; 
      alter table geo_name_new add column gis_point POINT NOT NULL DEFAULT  (POINT(latitude,longitude)), add spatial index geo(gis_point) ;
      drop table if exists geo_name_old;
      RENAME TABLE geo_filter to geo_name_old , geo_name_new to geo_name; 
        
      

      Attachments

        Activity

          People

            holyfoot Alexey Botchkov
            stephane@skysql.com VAROQUI Stephane
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.