(
mz_acl_items: Datum<'a>,
temp_storage: &'a RowArena,
)
| 3507 | } |
| 3508 | |
| 3509 | fn mz_acl_explode<'a>( |
| 3510 | mz_acl_items: Datum<'a>, |
| 3511 | temp_storage: &'a RowArena, |
| 3512 | ) -> Result<impl Iterator<Item = (Row, Diff)> + 'a, EvalError> { |
| 3513 | let mz_acl_items = mz_acl_items.unwrap_array(); |
| 3514 | let mut res = Vec::new(); |
| 3515 | for mz_acl_item in mz_acl_items.elements().iter() { |
| 3516 | if mz_acl_item.is_null() { |
| 3517 | return Err(EvalError::MzAclArrayNullElement); |
| 3518 | } |
| 3519 | let mz_acl_item = mz_acl_item.unwrap_mz_acl_item(); |
| 3520 | for privilege in mz_acl_item.acl_mode.explode() { |
| 3521 | let row = [ |
| 3522 | Datum::String(temp_storage.push_string(mz_acl_item.grantor.to_string())), |
| 3523 | Datum::String(temp_storage.push_string(mz_acl_item.grantee.to_string())), |
| 3524 | Datum::String(temp_storage.push_string(privilege.to_string())), |
| 3525 | // GRANT OPTION is not implemented, so we hardcode false. |
| 3526 | Datum::False, |
| 3527 | ]; |
| 3528 | res.push((Row::pack_slice(&row), Diff::ONE)); |
| 3529 | } |
| 3530 | } |
| 3531 | Ok(res.into_iter()) |
| 3532 | } |
| 3533 | |
| 3534 | /// When adding a new `TableFunc` variant, please consider adding it to |
| 3535 | /// `TableFunc::with_ordinality`! |
no test coverage detected