Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-42970

Introduce N1QL function that generates an error

    XMLWordPrintable

Details

    • 1

    Description

      Consider this function:

      CREATE FUNCTION variadic(...) { CASE WHEN array_length(args) != 1 THEN "wrong args: " || to_string(array_length(args))  WHEN type(args[0]) = "string" THEN args[0] ELSE "wrong type " || type(args[0]) || ": " || to_string(args[0]) END }
      

      Wouldn't it be nice to be able to return errors on wrong arguments?
      Introduce a new predefined function abort(string) which returns nothing and generates an error based on the input string, so that N1QL UDFs (or other statements) can properly generate an error and terminate the request

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          Build couchbase-server-7.0.0-4004 contains query commit a3f047e with commit message:
          MB-42970 new Abort(error message) function

          build-team Couchbase Build Team added a comment - Build couchbase-server-7.0.0-4004 contains query commit a3f047e with commit message: MB-42970 new Abort(error message) function

          Build couchbase-server-7.0.0-4038 contains query commit b52d1f6 with commit message:
          MB-42970 redo Abort()

          build-team Couchbase Build Team added a comment - Build couchbase-server-7.0.0-4038 contains query commit b52d1f6 with commit message: MB-42970 redo Abort()

          verified in 7.0.0-4540, also put in a test to regression

          ajay.bhullar Ajay Bhullar added a comment - verified in 7.0.0-4540, also put in a test to regression

          People

            ajay.bhullar Ajay Bhullar
            marco.greco Marco Greco
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty