Fallback: extract predicate text from the uppercased SQL string when USING appears without space-separated parts matching (e.g. `USING(x=1)`).
(upper: &str)
| 152 | /// Fallback: extract predicate text from the uppercased SQL string when |
| 153 | /// USING appears without space-separated parts matching (e.g. `USING(x=1)`). |
| 154 | fn extract_using_from_upper(upper: &str) -> String { |
| 155 | let Some(start) = upper.find("USING") else { |
| 156 | return String::new(); |
| 157 | }; |
| 158 | let after = &upper[start + 5..].trim_start(); |
| 159 | if after.starts_with('(') { |
| 160 | let mut depth = 0usize; |
| 161 | let mut end = 0; |
| 162 | for (i, ch) in after.char_indices() { |
| 163 | match ch { |
| 164 | '(' => depth += 1, |
| 165 | ')' => { |
| 166 | depth -= 1; |
| 167 | if depth == 0 { |
| 168 | end = i; |
| 169 | break; |
| 170 | } |
| 171 | } |
| 172 | _ => {} |
| 173 | } |
| 174 | } |
| 175 | after[1..end].trim().to_string() |
| 176 | } else { |
| 177 | String::new() |
| 178 | } |
| 179 | } |
no test coverage detected