mirror of
https://github.com/scylladb/scylladb.git
synced 2026-06-05 22:43:15 +00:00
When a role is created through the `create role` statement, the 'is_superuser' and 'can_login' columns are set to false by default. Likewise, `list roles`, `alter roles` and `* roles` operations expect to find a boolean when reading the same columns. This is not the case, though, when a user directly inserts to `system_auth.roles` and doesn't set those columns. Even though manually creating roles is not a desired day-to-day operation, it is an insert just like any other and it should work. `* roles` operations, on the other hand, are not prepared for this deviations. If a user manually creates a role and doesn't set boolean values to those columns, `* roles` will return all sorts of errors. This happens because `* roles` is explicitly expecting a boolean and casting for it. This patch makes `* roles` more friendly by considering the boolean variable `false` - inside `* roles` context - if the actual value is `null`; it won't change the `null` value. Fixes #4280 Signed-off-by: Juliana Oliveira <juliana@scylladb.com> Message-Id: <20190816032617.61680-1-juliana@scylladb.com>