diff --git a/src/catalog/src/information_schema/tables.rs b/src/catalog/src/information_schema/tables.rs index 9957f6715458..ef8eee267289 100644 --- a/src/catalog/src/information_schema/tables.rs +++ b/src/catalog/src/information_schema/tables.rs @@ -304,10 +304,11 @@ impl InformationSchemaTablesBuilder { self.update_time.push(None); self.check_time.push(None); + // use mariadb default table version number here self.version.push(Some(11)); self.table_comment.push(table_info.desc.as_deref()); self.create_options - .push(Some(format!("{:?}", table_info.meta.options).as_ref())); + .push(Some(table_info.meta.options.to_string().as_ref())); self.create_time .push(Some(table_info.meta.created_on.timestamp_millis().into())); diff --git a/src/table/src/requests.rs b/src/table/src/requests.rs index 519ee2adb62b..a00b25eacb13 100644 --- a/src/table/src/requests.rs +++ b/src/table/src/requests.rs @@ -15,6 +15,7 @@ //! Table and TableEngine requests use std::collections::HashMap; +use std::fmt; use std::str::FromStr; use std::time::Duration; @@ -128,6 +129,25 @@ impl TableOptions { } } +impl fmt::Display for TableOptions { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + let mut key_vals = vec![]; + if let Some(size) = self.write_buffer_size { + key_vals.push(format!("{}={}", WRITE_BUFFER_SIZE_KEY, size)); + } + + if let Some(ttl) = self.ttl { + key_vals.push(format!("{}={}", TTL_KEY, humantime::Duration::from(ttl))); + } + + for (k, v) in &self.extra_options { + key_vals.push(format!("{}={}", k, v)); + } + + write!(f, "{}", key_vals.join(" ")) + } +} + impl From<&TableOptions> for HashMap { fn from(opts: &TableOptions) -> Self { let mut res = HashMap::with_capacity(2 + opts.extra_options.len()); @@ -345,4 +365,29 @@ mod tests { let serialized = TableOptions::try_from_iter(&serialized_map).unwrap(); assert_eq!(options, serialized); } + + #[test] + fn test_table_options_to_string() { + let options = TableOptions { + write_buffer_size: Some(ReadableSize::mb(128)), + ttl: Some(Duration::from_secs(1000)), + extra_options: HashMap::new(), + }; + + assert_eq!( + "write_buffer_size=128.0MiB ttl=16m 40s", + options.to_string() + ); + + let options = TableOptions { + write_buffer_size: Some(ReadableSize::mb(128)), + ttl: Some(Duration::from_secs(1000)), + extra_options: HashMap::from([("a".to_string(), "A".to_string())]), + }; + + assert_eq!( + "write_buffer_size=128.0MiB ttl=16m 40s a=A", + options.to_string() + ); + } } diff --git a/tests/cases/standalone/common/system/information_schema.result b/tests/cases/standalone/common/system/information_schema.result index ea8963e475f3..3f38df1c43ed 100644 --- a/tests/cases/standalone/common/system/information_schema.result +++ b/tests/cases/standalone/common/system/information_schema.result @@ -10,40 +10,40 @@ from information_schema.tables where table_name != 'scripts' order by table_schema, table_name; -+---------------+--------------------+---------------------------------------+-----------------+----------+-------------+-----------------+--------------+------------------+----------------+-------------+---------+------------+------------+-----------+----------------+-------------------------+-------------+------------+-----------------+----------+------------------------------------------------------------------------+---------------+-----------+ -| table_catalog | table_schema | table_name | table_type | table_id | data_length | max_data_length | index_length | max_index_length | avg_row_length | engine | version | row_format | table_rows | data_free | auto_increment | create_time | update_time | check_time | table_collation | checksum | create_options | table_comment | temporary | -+---------------+--------------------+---------------------------------------+-----------------+----------+-------------+-----------------+--------------+------------------+----------------+-------------+---------+------------+------------+-----------+----------------+-------------------------+-------------+------------+-----------------+----------+------------------------------------------------------------------------+---------------+-----------+ -| greptime | information_schema | build_info | LOCAL TEMPORARY | 8 | 0 | 0 | 0 | 0 | 0 | | 11 | Fixed | 0 | 0 | 0 | DATETIME | | | | 0 | TableOptions { write_buffer_size: None, ttl: None, extra_options: {} } | | Y | -| greptime | information_schema | character_sets | LOCAL TEMPORARY | 9 | 0 | 0 | 0 | 0 | 0 | | 11 | Fixed | 0 | 0 | 0 | DATETIME | | | | 0 | TableOptions { write_buffer_size: None, ttl: None, extra_options: {} } | | Y | -| greptime | information_schema | check_constraints | LOCAL TEMPORARY | 12 | 0 | 0 | 0 | 0 | 0 | | 11 | Fixed | 0 | 0 | 0 | DATETIME | | | | 0 | TableOptions { write_buffer_size: None, ttl: None, extra_options: {} } | | Y | -| greptime | information_schema | cluster_info | LOCAL TEMPORARY | 31 | 0 | 0 | 0 | 0 | 0 | | 11 | Fixed | 0 | 0 | 0 | DATETIME | | | | 0 | TableOptions { write_buffer_size: None, ttl: None, extra_options: {} } | | Y | -| greptime | information_schema | collation_character_set_applicability | LOCAL TEMPORARY | 11 | 0 | 0 | 0 | 0 | 0 | | 11 | Fixed | 0 | 0 | 0 | DATETIME | | | | 0 | TableOptions { write_buffer_size: None, ttl: None, extra_options: {} } | | Y | -| greptime | information_schema | collations | LOCAL TEMPORARY | 10 | 0 | 0 | 0 | 0 | 0 | | 11 | Fixed | 0 | 0 | 0 | DATETIME | | | | 0 | TableOptions { write_buffer_size: None, ttl: None, extra_options: {} } | | Y | -| greptime | information_schema | column_privileges | LOCAL TEMPORARY | 6 | 0 | 0 | 0 | 0 | 0 | | 11 | Fixed | 0 | 0 | 0 | DATETIME | | | | 0 | TableOptions { write_buffer_size: None, ttl: None, extra_options: {} } | | Y | -| greptime | information_schema | column_statistics | LOCAL TEMPORARY | 7 | 0 | 0 | 0 | 0 | 0 | | 11 | Fixed | 0 | 0 | 0 | DATETIME | | | | 0 | TableOptions { write_buffer_size: None, ttl: None, extra_options: {} } | | Y | -| greptime | information_schema | columns | LOCAL TEMPORARY | 4 | 0 | 0 | 0 | 0 | 0 | | 11 | Fixed | 0 | 0 | 0 | DATETIME | | | | 0 | TableOptions { write_buffer_size: None, ttl: None, extra_options: {} } | | Y | -| greptime | information_schema | engines | LOCAL TEMPORARY | 5 | 0 | 0 | 0 | 0 | 0 | | 11 | Fixed | 0 | 0 | 0 | DATETIME | | | | 0 | TableOptions { write_buffer_size: None, ttl: None, extra_options: {} } | | Y | -| greptime | information_schema | events | LOCAL TEMPORARY | 13 | 0 | 0 | 0 | 0 | 0 | | 11 | Fixed | 0 | 0 | 0 | DATETIME | | | | 0 | TableOptions { write_buffer_size: None, ttl: None, extra_options: {} } | | Y | -| greptime | information_schema | files | LOCAL TEMPORARY | 14 | 0 | 0 | 0 | 0 | 0 | | 11 | Fixed | 0 | 0 | 0 | DATETIME | | | | 0 | TableOptions { write_buffer_size: None, ttl: None, extra_options: {} } | | Y | -| greptime | information_schema | global_status | LOCAL TEMPORARY | 25 | 0 | 0 | 0 | 0 | 0 | | 11 | Fixed | 0 | 0 | 0 | DATETIME | | | | 0 | TableOptions { write_buffer_size: None, ttl: None, extra_options: {} } | | Y | -| greptime | information_schema | key_column_usage | LOCAL TEMPORARY | 16 | 0 | 0 | 0 | 0 | 0 | | 11 | Fixed | 0 | 0 | 0 | DATETIME | | | | 0 | TableOptions { write_buffer_size: None, ttl: None, extra_options: {} } | | Y | -| greptime | information_schema | optimizer_trace | LOCAL TEMPORARY | 17 | 0 | 0 | 0 | 0 | 0 | | 11 | Fixed | 0 | 0 | 0 | DATETIME | | | | 0 | TableOptions { write_buffer_size: None, ttl: None, extra_options: {} } | | Y | -| greptime | information_schema | parameters | LOCAL TEMPORARY | 18 | 0 | 0 | 0 | 0 | 0 | | 11 | Fixed | 0 | 0 | 0 | DATETIME | | | | 0 | TableOptions { write_buffer_size: None, ttl: None, extra_options: {} } | | Y | -| greptime | information_schema | partitions | LOCAL TEMPORARY | 28 | 0 | 0 | 0 | 0 | 0 | | 11 | Fixed | 0 | 0 | 0 | DATETIME | | | | 0 | TableOptions { write_buffer_size: None, ttl: None, extra_options: {} } | | Y | -| greptime | information_schema | profiling | LOCAL TEMPORARY | 19 | 0 | 0 | 0 | 0 | 0 | | 11 | Fixed | 0 | 0 | 0 | DATETIME | | | | 0 | TableOptions { write_buffer_size: None, ttl: None, extra_options: {} } | | Y | -| greptime | information_schema | referential_constraints | LOCAL TEMPORARY | 20 | 0 | 0 | 0 | 0 | 0 | | 11 | Fixed | 0 | 0 | 0 | DATETIME | | | | 0 | TableOptions { write_buffer_size: None, ttl: None, extra_options: {} } | | Y | -| greptime | information_schema | region_peers | LOCAL TEMPORARY | 29 | 0 | 0 | 0 | 0 | 0 | | 11 | Fixed | 0 | 0 | 0 | DATETIME | | | | 0 | TableOptions { write_buffer_size: None, ttl: None, extra_options: {} } | | Y | -| greptime | information_schema | routines | LOCAL TEMPORARY | 21 | 0 | 0 | 0 | 0 | 0 | | 11 | Fixed | 0 | 0 | 0 | DATETIME | | | | 0 | TableOptions { write_buffer_size: None, ttl: None, extra_options: {} } | | Y | -| greptime | information_schema | runtime_metrics | LOCAL TEMPORARY | 27 | 0 | 0 | 0 | 0 | 0 | | 11 | Fixed | 0 | 0 | 0 | DATETIME | | | | 0 | TableOptions { write_buffer_size: None, ttl: None, extra_options: {} } | | Y | -| greptime | information_schema | schema_privileges | LOCAL TEMPORARY | 22 | 0 | 0 | 0 | 0 | 0 | | 11 | Fixed | 0 | 0 | 0 | DATETIME | | | | 0 | TableOptions { write_buffer_size: None, ttl: None, extra_options: {} } | | Y | -| greptime | information_schema | schemata | LOCAL TEMPORARY | 15 | 0 | 0 | 0 | 0 | 0 | | 11 | Fixed | 0 | 0 | 0 | DATETIME | | | | 0 | TableOptions { write_buffer_size: None, ttl: None, extra_options: {} } | | Y | -| greptime | information_schema | session_status | LOCAL TEMPORARY | 26 | 0 | 0 | 0 | 0 | 0 | | 11 | Fixed | 0 | 0 | 0 | DATETIME | | | | 0 | TableOptions { write_buffer_size: None, ttl: None, extra_options: {} } | | Y | -| greptime | information_schema | table_constraints | LOCAL TEMPORARY | 30 | 0 | 0 | 0 | 0 | 0 | | 11 | Fixed | 0 | 0 | 0 | DATETIME | | | | 0 | TableOptions { write_buffer_size: None, ttl: None, extra_options: {} } | | Y | -| greptime | information_schema | table_privileges | LOCAL TEMPORARY | 23 | 0 | 0 | 0 | 0 | 0 | | 11 | Fixed | 0 | 0 | 0 | DATETIME | | | | 0 | TableOptions { write_buffer_size: None, ttl: None, extra_options: {} } | | Y | -| greptime | information_schema | tables | LOCAL TEMPORARY | 3 | 0 | 0 | 0 | 0 | 0 | | 11 | Fixed | 0 | 0 | 0 | DATETIME | | | | 0 | TableOptions { write_buffer_size: None, ttl: None, extra_options: {} } | | Y | -| greptime | information_schema | triggers | LOCAL TEMPORARY | 24 | 0 | 0 | 0 | 0 | 0 | | 11 | Fixed | 0 | 0 | 0 | DATETIME | | | | 0 | TableOptions { write_buffer_size: None, ttl: None, extra_options: {} } | | Y | -| greptime | public | numbers | LOCAL TEMPORARY | 2 | 0 | 0 | 0 | 0 | 0 | test_engine | 11 | Fixed | 0 | 0 | 0 | DATETIME | | | | 0 | TableOptions { write_buffer_size: None, ttl: None, extra_options: {} } | | Y | -+---------------+--------------------+---------------------------------------+-----------------+----------+-------------+-----------------+--------------+------------------+----------------+-------------+---------+------------+------------+-----------+----------------+-------------------------+-------------+------------+-----------------+----------+------------------------------------------------------------------------+---------------+-----------+ ++---------------+--------------------+---------------------------------------+-----------------+----------+-------------+-----------------+--------------+------------------+----------------+-------------+---------+------------+------------+-----------+----------------+-------------------------+-------------+------------+-----------------+----------+----------------+---------------+-----------+ +| table_catalog | table_schema | table_name | table_type | table_id | data_length | max_data_length | index_length | max_index_length | avg_row_length | engine | version | row_format | table_rows | data_free | auto_increment | create_time | update_time | check_time | table_collation | checksum | create_options | table_comment | temporary | ++---------------+--------------------+---------------------------------------+-----------------+----------+-------------+-----------------+--------------+------------------+----------------+-------------+---------+------------+------------+-----------+----------------+-------------------------+-------------+------------+-----------------+----------+----------------+---------------+-----------+ +| greptime | information_schema | build_info | LOCAL TEMPORARY | 8 | 0 | 0 | 0 | 0 | 0 | | 11 | Fixed | 0 | 0 | 0 | DATETIME | | | | 0 | | | Y | +| greptime | information_schema | character_sets | LOCAL TEMPORARY | 9 | 0 | 0 | 0 | 0 | 0 | | 11 | Fixed | 0 | 0 | 0 | DATETIME | | | | 0 | | | Y | +| greptime | information_schema | check_constraints | LOCAL TEMPORARY | 12 | 0 | 0 | 0 | 0 | 0 | | 11 | Fixed | 0 | 0 | 0 | DATETIME | | | | 0 | | | Y | +| greptime | information_schema | cluster_info | LOCAL TEMPORARY | 31 | 0 | 0 | 0 | 0 | 0 | | 11 | Fixed | 0 | 0 | 0 | DATETIME | | | | 0 | | | Y | +| greptime | information_schema | collation_character_set_applicability | LOCAL TEMPORARY | 11 | 0 | 0 | 0 | 0 | 0 | | 11 | Fixed | 0 | 0 | 0 | DATETIME | | | | 0 | | | Y | +| greptime | information_schema | collations | LOCAL TEMPORARY | 10 | 0 | 0 | 0 | 0 | 0 | | 11 | Fixed | 0 | 0 | 0 | DATETIME | | | | 0 | | | Y | +| greptime | information_schema | column_privileges | LOCAL TEMPORARY | 6 | 0 | 0 | 0 | 0 | 0 | | 11 | Fixed | 0 | 0 | 0 | DATETIME | | | | 0 | | | Y | +| greptime | information_schema | column_statistics | LOCAL TEMPORARY | 7 | 0 | 0 | 0 | 0 | 0 | | 11 | Fixed | 0 | 0 | 0 | DATETIME | | | | 0 | | | Y | +| greptime | information_schema | columns | LOCAL TEMPORARY | 4 | 0 | 0 | 0 | 0 | 0 | | 11 | Fixed | 0 | 0 | 0 | DATETIME | | | | 0 | | | Y | +| greptime | information_schema | engines | LOCAL TEMPORARY | 5 | 0 | 0 | 0 | 0 | 0 | | 11 | Fixed | 0 | 0 | 0 | DATETIME | | | | 0 | | | Y | +| greptime | information_schema | events | LOCAL TEMPORARY | 13 | 0 | 0 | 0 | 0 | 0 | | 11 | Fixed | 0 | 0 | 0 | DATETIME | | | | 0 | | | Y | +| greptime | information_schema | files | LOCAL TEMPORARY | 14 | 0 | 0 | 0 | 0 | 0 | | 11 | Fixed | 0 | 0 | 0 | DATETIME | | | | 0 | | | Y | +| greptime | information_schema | global_status | LOCAL TEMPORARY | 25 | 0 | 0 | 0 | 0 | 0 | | 11 | Fixed | 0 | 0 | 0 | DATETIME | | | | 0 | | | Y | +| greptime | information_schema | key_column_usage | LOCAL TEMPORARY | 16 | 0 | 0 | 0 | 0 | 0 | | 11 | Fixed | 0 | 0 | 0 | DATETIME | | | | 0 | | | Y | +| greptime | information_schema | optimizer_trace | LOCAL TEMPORARY | 17 | 0 | 0 | 0 | 0 | 0 | | 11 | Fixed | 0 | 0 | 0 | DATETIME | | | | 0 | | | Y | +| greptime | information_schema | parameters | LOCAL TEMPORARY | 18 | 0 | 0 | 0 | 0 | 0 | | 11 | Fixed | 0 | 0 | 0 | DATETIME | | | | 0 | | | Y | +| greptime | information_schema | partitions | LOCAL TEMPORARY | 28 | 0 | 0 | 0 | 0 | 0 | | 11 | Fixed | 0 | 0 | 0 | DATETIME | | | | 0 | | | Y | +| greptime | information_schema | profiling | LOCAL TEMPORARY | 19 | 0 | 0 | 0 | 0 | 0 | | 11 | Fixed | 0 | 0 | 0 | DATETIME | | | | 0 | | | Y | +| greptime | information_schema | referential_constraints | LOCAL TEMPORARY | 20 | 0 | 0 | 0 | 0 | 0 | | 11 | Fixed | 0 | 0 | 0 | DATETIME | | | | 0 | | | Y | +| greptime | information_schema | region_peers | LOCAL TEMPORARY | 29 | 0 | 0 | 0 | 0 | 0 | | 11 | Fixed | 0 | 0 | 0 | DATETIME | | | | 0 | | | Y | +| greptime | information_schema | routines | LOCAL TEMPORARY | 21 | 0 | 0 | 0 | 0 | 0 | | 11 | Fixed | 0 | 0 | 0 | DATETIME | | | | 0 | | | Y | +| greptime | information_schema | runtime_metrics | LOCAL TEMPORARY | 27 | 0 | 0 | 0 | 0 | 0 | | 11 | Fixed | 0 | 0 | 0 | DATETIME | | | | 0 | | | Y | +| greptime | information_schema | schema_privileges | LOCAL TEMPORARY | 22 | 0 | 0 | 0 | 0 | 0 | | 11 | Fixed | 0 | 0 | 0 | DATETIME | | | | 0 | | | Y | +| greptime | information_schema | schemata | LOCAL TEMPORARY | 15 | 0 | 0 | 0 | 0 | 0 | | 11 | Fixed | 0 | 0 | 0 | DATETIME | | | | 0 | | | Y | +| greptime | information_schema | session_status | LOCAL TEMPORARY | 26 | 0 | 0 | 0 | 0 | 0 | | 11 | Fixed | 0 | 0 | 0 | DATETIME | | | | 0 | | | Y | +| greptime | information_schema | table_constraints | LOCAL TEMPORARY | 30 | 0 | 0 | 0 | 0 | 0 | | 11 | Fixed | 0 | 0 | 0 | DATETIME | | | | 0 | | | Y | +| greptime | information_schema | table_privileges | LOCAL TEMPORARY | 23 | 0 | 0 | 0 | 0 | 0 | | 11 | Fixed | 0 | 0 | 0 | DATETIME | | | | 0 | | | Y | +| greptime | information_schema | tables | LOCAL TEMPORARY | 3 | 0 | 0 | 0 | 0 | 0 | | 11 | Fixed | 0 | 0 | 0 | DATETIME | | | | 0 | | | Y | +| greptime | information_schema | triggers | LOCAL TEMPORARY | 24 | 0 | 0 | 0 | 0 | 0 | | 11 | Fixed | 0 | 0 | 0 | DATETIME | | | | 0 | | | Y | +| greptime | public | numbers | LOCAL TEMPORARY | 2 | 0 | 0 | 0 | 0 | 0 | test_engine | 11 | Fixed | 0 | 0 | 0 | DATETIME | | | | 0 | | | Y | ++---------------+--------------------+---------------------------------------+-----------------+----------+-------------+-----------------+--------------+------------------+----------------+-------------+---------+------------+------------+-----------+----------------+-------------------------+-------------+------------+-----------------+----------+----------------+---------------+-----------+ select * from information_schema.columns order by table_schema, table_name, column_name; diff --git a/tests/cases/standalone/common/view/create.result b/tests/cases/standalone/common/view/create.result index 5d098bbec572..bfbff6b970eb 100644 --- a/tests/cases/standalone/common/view/create.result +++ b/tests/cases/standalone/common/view/create.result @@ -73,51 +73,51 @@ SHOW FULL TABLES; -- SQLNESS REPLACE (\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}) DATETIME SELECT * FROM INFORMATION_SCHEMA.TABLES ORDER BY TABLE_NAME, TABLE_TYPE; -+---------------+----------------------+---------------------------------------+-----------------+----------+-------------+-----------------+--------------+------------------+----------------+-------------+---------+------------+------------+-----------+----------------+-------------------------+-------------+------------+-----------------+----------+------------------------------------------------------------------------+---------------+-----------+ -| table_catalog | table_schema | table_name | table_type | table_id | data_length | max_data_length | index_length | max_index_length | avg_row_length | engine | version | row_format | table_rows | data_free | auto_increment | create_time | update_time | check_time | table_collation | checksum | create_options | table_comment | temporary | -+---------------+----------------------+---------------------------------------+-----------------+----------+-------------+-----------------+--------------+------------------+----------------+-------------+---------+------------+------------+-----------+----------------+-------------------------+-------------+------------+-----------------+----------+------------------------------------------------------------------------+---------------+-----------+ -| greptime | information_schema | build_info | LOCAL TEMPORARY |ID |ID |ID |ID |ID |ID | |ID | Fixed |ID |ID |ID | DATETIME | | | |ID | TableOptions { write_buffer_size: None, ttl: None, extra_options: {} } | | Y | -| greptime | information_schema | character_sets | LOCAL TEMPORARY |ID |ID |ID |ID |ID |ID | |ID | Fixed |ID |ID |ID | DATETIME | | | |ID | TableOptions { write_buffer_size: None, ttl: None, extra_options: {} } | | Y | -| greptime | information_schema | check_constraints | LOCAL TEMPORARY |ID |ID |ID |ID |ID |ID | |ID | Fixed |ID |ID |ID | DATETIME | | | |ID | TableOptions { write_buffer_size: None, ttl: None, extra_options: {} } | | Y | -| greptime | information_schema | cluster_info | LOCAL TEMPORARY |ID |ID |ID |ID |ID |ID | |ID | Fixed |ID |ID |ID | DATETIME | | | |ID | TableOptions { write_buffer_size: None, ttl: None, extra_options: {} } | | Y | -| greptime | information_schema | collation_character_set_applicability | LOCAL TEMPORARY |ID |ID |ID |ID |ID |ID | |ID | Fixed |ID |ID |ID | DATETIME | | | |ID | TableOptions { write_buffer_size: None, ttl: None, extra_options: {} } | | Y | -| greptime | information_schema | collations | LOCAL TEMPORARY |ID |ID |ID |ID |ID |ID | |ID | Fixed |ID |ID |ID | DATETIME | | | |ID | TableOptions { write_buffer_size: None, ttl: None, extra_options: {} } | | Y | -| greptime | information_schema | column_privileges | LOCAL TEMPORARY |ID |ID |ID |ID |ID |ID | |ID | Fixed |ID |ID |ID | DATETIME | | | |ID | TableOptions { write_buffer_size: None, ttl: None, extra_options: {} } | | Y | -| greptime | information_schema | column_statistics | LOCAL TEMPORARY |ID |ID |ID |ID |ID |ID | |ID | Fixed |ID |ID |ID | DATETIME | | | |ID | TableOptions { write_buffer_size: None, ttl: None, extra_options: {} } | | Y | -| greptime | information_schema | columns | LOCAL TEMPORARY |ID |ID |ID |ID |ID |ID | |ID | Fixed |ID |ID |ID | DATETIME | | | |ID | TableOptions { write_buffer_size: None, ttl: None, extra_options: {} } | | Y | -| greptime | information_schema | engines | LOCAL TEMPORARY |ID |ID |ID |ID |ID |ID | |ID | Fixed |ID |ID |ID | DATETIME | | | |ID | TableOptions { write_buffer_size: None, ttl: None, extra_options: {} } | | Y | -| greptime | information_schema | events | LOCAL TEMPORARY |ID |ID |ID |ID |ID |ID | |ID | Fixed |ID |ID |ID | DATETIME | | | |ID | TableOptions { write_buffer_size: None, ttl: None, extra_options: {} } | | Y | -| greptime | information_schema | files | LOCAL TEMPORARY |ID |ID |ID |ID |ID |ID | |ID | Fixed |ID |ID |ID | DATETIME | | | |ID | TableOptions { write_buffer_size: None, ttl: None, extra_options: {} } | | Y | -| greptime | information_schema | global_status | LOCAL TEMPORARY |ID |ID |ID |ID |ID |ID | |ID | Fixed |ID |ID |ID | DATETIME | | | |ID | TableOptions { write_buffer_size: None, ttl: None, extra_options: {} } | | Y | -| greptime | information_schema | key_column_usage | LOCAL TEMPORARY |ID |ID |ID |ID |ID |ID | |ID | Fixed |ID |ID |ID | DATETIME | | | |ID | TableOptions { write_buffer_size: None, ttl: None, extra_options: {} } | | Y | -| greptime | public | numbers | LOCAL TEMPORARY |ID |ID |ID |ID |ID |ID | test_engine |ID | Fixed |ID |ID |ID | DATETIME | | | |ID | TableOptions { write_buffer_size: None, ttl: None, extra_options: {} } | | Y | -| greptime | information_schema | optimizer_trace | LOCAL TEMPORARY |ID |ID |ID |ID |ID |ID | |ID | Fixed |ID |ID |ID | DATETIME | | | |ID | TableOptions { write_buffer_size: None, ttl: None, extra_options: {} } | | Y | -| greptime | information_schema | parameters | LOCAL TEMPORARY |ID |ID |ID |ID |ID |ID | |ID | Fixed |ID |ID |ID | DATETIME | | | |ID | TableOptions { write_buffer_size: None, ttl: None, extra_options: {} } | | Y | -| greptime | information_schema | partitions | LOCAL TEMPORARY |ID |ID |ID |ID |ID |ID | |ID | Fixed |ID |ID |ID | DATETIME | | | |ID | TableOptions { write_buffer_size: None, ttl: None, extra_options: {} } | | Y | -| greptime | information_schema | profiling | LOCAL TEMPORARY |ID |ID |ID |ID |ID |ID | |ID | Fixed |ID |ID |ID | DATETIME | | | |ID | TableOptions { write_buffer_size: None, ttl: None, extra_options: {} } | | Y | -| greptime | information_schema | referential_constraints | LOCAL TEMPORARY |ID |ID |ID |ID |ID |ID | |ID | Fixed |ID |ID |ID | DATETIME | | | |ID | TableOptions { write_buffer_size: None, ttl: None, extra_options: {} } | | Y | -| greptime | information_schema | region_peers | LOCAL TEMPORARY |ID |ID |ID |ID |ID |ID | |ID | Fixed |ID |ID |ID | DATETIME | | | |ID | TableOptions { write_buffer_size: None, ttl: None, extra_options: {} } | | Y | -| greptime | information_schema | routines | LOCAL TEMPORARY |ID |ID |ID |ID |ID |ID | |ID | Fixed |ID |ID |ID | DATETIME | | | |ID | TableOptions { write_buffer_size: None, ttl: None, extra_options: {} } | | Y | -| greptime | information_schema | runtime_metrics | LOCAL TEMPORARY |ID |ID |ID |ID |ID |ID | |ID | Fixed |ID |ID |ID | DATETIME | | | |ID | TableOptions { write_buffer_size: None, ttl: None, extra_options: {} } | | Y | -| greptime | information_schema | schema_privileges | LOCAL TEMPORARY |ID |ID |ID |ID |ID |ID | |ID | Fixed |ID |ID |ID | DATETIME | | | |ID | TableOptions { write_buffer_size: None, ttl: None, extra_options: {} } | | Y | -| greptime | information_schema | schemata | LOCAL TEMPORARY |ID |ID |ID |ID |ID |ID | |ID | Fixed |ID |ID |ID | DATETIME | | | |ID | TableOptions { write_buffer_size: None, ttl: None, extra_options: {} } | | Y | -| greptime | information_schema | session_status | LOCAL TEMPORARY |ID |ID |ID |ID |ID |ID | |ID | Fixed |ID |ID |ID | DATETIME | | | |ID | TableOptions { write_buffer_size: None, ttl: None, extra_options: {} } | | Y | -| greptime | information_schema | table_constraints | LOCAL TEMPORARY |ID |ID |ID |ID |ID |ID | |ID | Fixed |ID |ID |ID | DATETIME | | | |ID | TableOptions { write_buffer_size: None, ttl: None, extra_options: {} } | | Y | -| greptime | information_schema | table_privileges | LOCAL TEMPORARY |ID |ID |ID |ID |ID |ID | |ID | Fixed |ID |ID |ID | DATETIME | | | |ID | TableOptions { write_buffer_size: None, ttl: None, extra_options: {} } | | Y | -| greptime | information_schema | tables | LOCAL TEMPORARY |ID |ID |ID |ID |ID |ID | |ID | Fixed |ID |ID |ID | DATETIME | | | |ID | TableOptions { write_buffer_size: None, ttl: None, extra_options: {} } | | Y | -| greptime | schema_for_view_test | test_table | BASE TABLE |ID |ID |ID |ID |ID |ID | mito |ID | Fixed |ID |ID |ID | DATETIME | | | |ID | TableOptions { write_buffer_size: None, ttl: None, extra_options: {} } | | N | -| greptime | schema_for_view_test | test_view | VIEW |ID |ID |ID |ID |ID |ID | |ID | Fixed |ID |ID |ID | 1970-01-01T00:00:00 | | | |ID | TableOptions { write_buffer_size: None, ttl: None, extra_options: {} } | | N | -| greptime | information_schema | triggers | LOCAL TEMPORARY |ID |ID |ID |ID |ID |ID | |ID | Fixed |ID |ID |ID | DATETIME | | | |ID | TableOptions { write_buffer_size: None, ttl: None, extra_options: {} } | | Y | -+---------------+----------------------+---------------------------------------+-----------------+----------+-------------+-----------------+--------------+------------------+----------------+-------------+---------+------------+------------+-----------+----------------+-------------------------+-------------+------------+-----------------+----------+------------------------------------------------------------------------+---------------+-----------+ ++---------------+----------------------+---------------------------------------+-----------------+----------+-------------+-----------------+--------------+------------------+----------------+-------------+---------+------------+------------+-----------+----------------+-------------------------+-------------+------------+-----------------+----------+----------------+---------------+-----------+ +| table_catalog | table_schema | table_name | table_type | table_id | data_length | max_data_length | index_length | max_index_length | avg_row_length | engine | version | row_format | table_rows | data_free | auto_increment | create_time | update_time | check_time | table_collation | checksum | create_options | table_comment | temporary | ++---------------+----------------------+---------------------------------------+-----------------+----------+-------------+-----------------+--------------+------------------+----------------+-------------+---------+------------+------------+-----------+----------------+-------------------------+-------------+------------+-----------------+----------+----------------+---------------+-----------+ +| greptime | information_schema | build_info | LOCAL TEMPORARY |ID |ID |ID |ID |ID |ID | |ID | Fixed |ID |ID |ID | DATETIME | | | |ID | | | Y | +| greptime | information_schema | character_sets | LOCAL TEMPORARY |ID |ID |ID |ID |ID |ID | |ID | Fixed |ID |ID |ID | DATETIME | | | |ID | | | Y | +| greptime | information_schema | check_constraints | LOCAL TEMPORARY |ID |ID |ID |ID |ID |ID | |ID | Fixed |ID |ID |ID | DATETIME | | | |ID | | | Y | +| greptime | information_schema | cluster_info | LOCAL TEMPORARY |ID |ID |ID |ID |ID |ID | |ID | Fixed |ID |ID |ID | DATETIME | | | |ID | | | Y | +| greptime | information_schema | collation_character_set_applicability | LOCAL TEMPORARY |ID |ID |ID |ID |ID |ID | |ID | Fixed |ID |ID |ID | DATETIME | | | |ID | | | Y | +| greptime | information_schema | collations | LOCAL TEMPORARY |ID |ID |ID |ID |ID |ID | |ID | Fixed |ID |ID |ID | DATETIME | | | |ID | | | Y | +| greptime | information_schema | column_privileges | LOCAL TEMPORARY |ID |ID |ID |ID |ID |ID | |ID | Fixed |ID |ID |ID | DATETIME | | | |ID | | | Y | +| greptime | information_schema | column_statistics | LOCAL TEMPORARY |ID |ID |ID |ID |ID |ID | |ID | Fixed |ID |ID |ID | DATETIME | | | |ID | | | Y | +| greptime | information_schema | columns | LOCAL TEMPORARY |ID |ID |ID |ID |ID |ID | |ID | Fixed |ID |ID |ID | DATETIME | | | |ID | | | Y | +| greptime | information_schema | engines | LOCAL TEMPORARY |ID |ID |ID |ID |ID |ID | |ID | Fixed |ID |ID |ID | DATETIME | | | |ID | | | Y | +| greptime | information_schema | events | LOCAL TEMPORARY |ID |ID |ID |ID |ID |ID | |ID | Fixed |ID |ID |ID | DATETIME | | | |ID | | | Y | +| greptime | information_schema | files | LOCAL TEMPORARY |ID |ID |ID |ID |ID |ID | |ID | Fixed |ID |ID |ID | DATETIME | | | |ID | | | Y | +| greptime | information_schema | global_status | LOCAL TEMPORARY |ID |ID |ID |ID |ID |ID | |ID | Fixed |ID |ID |ID | DATETIME | | | |ID | | | Y | +| greptime | information_schema | key_column_usage | LOCAL TEMPORARY |ID |ID |ID |ID |ID |ID | |ID | Fixed |ID |ID |ID | DATETIME | | | |ID | | | Y | +| greptime | public | numbers | LOCAL TEMPORARY |ID |ID |ID |ID |ID |ID | test_engine |ID | Fixed |ID |ID |ID | DATETIME | | | |ID | | | Y | +| greptime | information_schema | optimizer_trace | LOCAL TEMPORARY |ID |ID |ID |ID |ID |ID | |ID | Fixed |ID |ID |ID | DATETIME | | | |ID | | | Y | +| greptime | information_schema | parameters | LOCAL TEMPORARY |ID |ID |ID |ID |ID |ID | |ID | Fixed |ID |ID |ID | DATETIME | | | |ID | | | Y | +| greptime | information_schema | partitions | LOCAL TEMPORARY |ID |ID |ID |ID |ID |ID | |ID | Fixed |ID |ID |ID | DATETIME | | | |ID | | | Y | +| greptime | information_schema | profiling | LOCAL TEMPORARY |ID |ID |ID |ID |ID |ID | |ID | Fixed |ID |ID |ID | DATETIME | | | |ID | | | Y | +| greptime | information_schema | referential_constraints | LOCAL TEMPORARY |ID |ID |ID |ID |ID |ID | |ID | Fixed |ID |ID |ID | DATETIME | | | |ID | | | Y | +| greptime | information_schema | region_peers | LOCAL TEMPORARY |ID |ID |ID |ID |ID |ID | |ID | Fixed |ID |ID |ID | DATETIME | | | |ID | | | Y | +| greptime | information_schema | routines | LOCAL TEMPORARY |ID |ID |ID |ID |ID |ID | |ID | Fixed |ID |ID |ID | DATETIME | | | |ID | | | Y | +| greptime | information_schema | runtime_metrics | LOCAL TEMPORARY |ID |ID |ID |ID |ID |ID | |ID | Fixed |ID |ID |ID | DATETIME | | | |ID | | | Y | +| greptime | information_schema | schema_privileges | LOCAL TEMPORARY |ID |ID |ID |ID |ID |ID | |ID | Fixed |ID |ID |ID | DATETIME | | | |ID | | | Y | +| greptime | information_schema | schemata | LOCAL TEMPORARY |ID |ID |ID |ID |ID |ID | |ID | Fixed |ID |ID |ID | DATETIME | | | |ID | | | Y | +| greptime | information_schema | session_status | LOCAL TEMPORARY |ID |ID |ID |ID |ID |ID | |ID | Fixed |ID |ID |ID | DATETIME | | | |ID | | | Y | +| greptime | information_schema | table_constraints | LOCAL TEMPORARY |ID |ID |ID |ID |ID |ID | |ID | Fixed |ID |ID |ID | DATETIME | | | |ID | | | Y | +| greptime | information_schema | table_privileges | LOCAL TEMPORARY |ID |ID |ID |ID |ID |ID | |ID | Fixed |ID |ID |ID | DATETIME | | | |ID | | | Y | +| greptime | information_schema | tables | LOCAL TEMPORARY |ID |ID |ID |ID |ID |ID | |ID | Fixed |ID |ID |ID | DATETIME | | | |ID | | | Y | +| greptime | schema_for_view_test | test_table | BASE TABLE |ID |ID |ID |ID |ID |ID | mito |ID | Fixed |ID |ID |ID | DATETIME | | | |ID | | | N | +| greptime | schema_for_view_test | test_view | VIEW |ID |ID |ID |ID |ID |ID | |ID | Fixed |ID |ID |ID | 1970-01-01T00:00:00 | | | |ID | | | N | +| greptime | information_schema | triggers | LOCAL TEMPORARY |ID |ID |ID |ID |ID |ID | |ID | Fixed |ID |ID |ID | DATETIME | | | |ID | | | Y | ++---------------+----------------------+---------------------------------------+-----------------+----------+-------------+-----------------+--------------+------------------+----------------+-------------+---------+------------+------------+-----------+----------------+-------------------------+-------------+------------+-----------------+----------+----------------+---------------+-----------+ -- SQLNESS REPLACE (\s\d+\s) ID SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'VIEW'; -+---------------+----------------------+------------+------------+----------+-------------+-----------------+--------------+------------------+----------------+--------+---------+------------+------------+-----------+----------------+---------------------+-------------+------------+-----------------+----------+------------------------------------------------------------------------+---------------+-----------+ -| table_catalog | table_schema | table_name | table_type | table_id | data_length | max_data_length | index_length | max_index_length | avg_row_length | engine | version | row_format | table_rows | data_free | auto_increment | create_time | update_time | check_time | table_collation | checksum | create_options | table_comment | temporary | -+---------------+----------------------+------------+------------+----------+-------------+-----------------+--------------+------------------+----------------+--------+---------+------------+------------+-----------+----------------+---------------------+-------------+------------+-----------------+----------+------------------------------------------------------------------------+---------------+-----------+ -| greptime | schema_for_view_test | test_view | VIEW |ID |ID |ID |ID |ID |ID | |ID | Fixed |ID |ID |ID | 1970-01-01T00:00:00 | | | |ID | TableOptions { write_buffer_size: None, ttl: None, extra_options: {} } | | N | -+---------------+----------------------+------------+------------+----------+-------------+-----------------+--------------+------------------+----------------+--------+---------+------------+------------+-----------+----------------+---------------------+-------------+------------+-----------------+----------+------------------------------------------------------------------------+---------------+-----------+ ++---------------+----------------------+------------+------------+----------+-------------+-----------------+--------------+------------------+----------------+--------+---------+------------+------------+-----------+----------------+---------------------+-------------+------------+-----------------+----------+----------------+---------------+-----------+ +| table_catalog | table_schema | table_name | table_type | table_id | data_length | max_data_length | index_length | max_index_length | avg_row_length | engine | version | row_format | table_rows | data_free | auto_increment | create_time | update_time | check_time | table_collation | checksum | create_options | table_comment | temporary | ++---------------+----------------------+------------+------------+----------+-------------+-----------------+--------------+------------------+----------------+--------+---------+------------+------------+-----------+----------------+---------------------+-------------+------------+-----------------+----------+----------------+---------------+-----------+ +| greptime | schema_for_view_test | test_view | VIEW |ID |ID |ID |ID |ID |ID | |ID | Fixed |ID |ID |ID | 1970-01-01T00:00:00 | | | |ID | | | N | ++---------------+----------------------+------------+------------+----------+-------------+-----------------+--------------+------------------+----------------+--------+---------+------------+------------+-----------+----------------+---------------------+-------------+------------+-----------------+----------+----------------+---------------+-----------+ SHOW COLUMNS FROM test_view;