comdb2 icon indicating copy to clipboard operation
comdb2 copied to clipboard

Throw errors from sp for failed inserts

Open adizaimi opened this issue 3 years ago • 2 comments

Throw errors on db:insert() failures in lua/sp.c:

  1. from prepare, ex. wrong column name
  2. from executing insert, ex. bad data conversion
  3. from emitting error out of range -- fetch correct error

Signed-off-by: Adi Zaimi [email protected]

adizaimi avatar May 30 '21 19:05 adizaimi

This needs to be on an option and disabled by legacy_tunables

akshatsikarwar avatar Jun 07 '21 15:06 akshatsikarwar

This needs to be on an option and disabled by legacy_tunables

Should also test how this behaves when an insert fails in the context of a trigger, where handling the return code is the desired behavior. See: https://github.com/bloomberg/comdb2/blame/master/docs/pages/programming/triggers.md#L100

akshatsikarwar avatar Jun 08 '21 15:06 akshatsikarwar