(&mut self, statement: &Statement)
| 119 | } |
| 120 | |
| 121 | fn pre_visit_statement(&mut self, statement: &Statement) -> ControlFlow<Self::Break> { |
| 122 | if let Statement::ShowCreate { |
| 123 | obj_type: ShowCreateObject::Table | ShowCreateObject::View, |
| 124 | obj_name, |
| 125 | } = statement |
| 126 | { |
| 127 | self.insert_relation(obj_name)?; |
| 128 | } |
| 129 | |
| 130 | // SHOW statements will later be rewritten into a SELECT from the information_schema |
| 131 | let requires_information_schema = matches!( |
| 132 | statement, |
| 133 | Statement::ShowFunctions { .. } |
| 134 | | Statement::ShowVariable { .. } |
| 135 | | Statement::ShowStatus { .. } |
| 136 | | Statement::ShowVariables { .. } |
| 137 | | Statement::ShowCreate { .. } |
| 138 | | Statement::ShowColumns { .. } |
| 139 | | Statement::ShowTables { .. } |
| 140 | | Statement::ShowCollation { .. } |
| 141 | ); |
| 142 | if requires_information_schema { |
| 143 | for s in INFORMATION_SCHEMA_TABLES { |
| 144 | // Information schema references are synthesized here, so convert directly. |
| 145 | let obj = ObjectName::from(vec![ |
| 146 | Ident::new(INFORMATION_SCHEMA), |
| 147 | Ident::new(*s), |
| 148 | ]); |
| 149 | match object_name_to_table_reference(obj, self.enable_ident_normalization) |
| 150 | { |
| 151 | Ok(tbl_ref) => { |
| 152 | self.relations.insert(tbl_ref); |
| 153 | } |
| 154 | Err(e) => return ControlFlow::Break(e), |
| 155 | } |
| 156 | } |
| 157 | } |
| 158 | ControlFlow::Continue(()) |
| 159 | } |
| 160 | } |
| 161 | |
| 162 | fn control_flow_to_result(flow: ControlFlow<DataFusionError>) -> Result<()> { |
nothing calls this directly
no test coverage detected