IS_UUID

Validates a UUID value.

Syntax

IS_UUID(string_uuid)

Arguments

string_uuid: A string UUID value.

Return Type

TINYINT: Returns 1 or 0 to indicate TRUE or FALSE, respectively.

  • If the argument is a valid string format UUID value, returns 1.

  • If the argument is not a valid UUID value, returns 0.

  • If the argument is a NULL value, returns SQL NULL.

Remarks

  • A UUID is considered valid if it is a 128 bit identifier represented as a 32-character hexadecimal string divided into five fields separated by hyphens in the following format:

    aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee

    where,

    • a ,b,c,d, and e represent hexadecimal characters. Each pair of characters must be in the 00-FF range.

    • The length (number of characters) and size of each field are as follows:

      Field

      Length

      Size

      Field1

      8

      32 bits

      Field2

      4

      16 bits

      Field3

      4

      16 bits

      Field4

      4

      16 bits

      Field5

      12

      48 bits

    • Additional valid UUID formats include:

      • A continuous string of hexadecimal characters without hyphens (e.g., aaaaaaaabbbbccccddddeeeeeeeeeeee).

      • The format with hyphens, enclosed in curly braces (e.g., {aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee}).

Examples

Returns 1 for a valid UUID value.

SELECT IS_UUID('e2a2461e-1a08-456b-9eee-cd5dc0998340')
AS result;
+------------+
|   result   |
+------------+
|          1 |
+------------+

Returns 1 for a valid UUID value.

SELECT IS_UUID('6701a3357fe041b5aca07f5c21c51dcf')
AS result;
+------------+
|   result   |
+------------+
|          1 |
+------------+

Returns 1 for a valid UUID value.

SELECT IS_UUID('{ae0770dd-3d5e-413b-a630-59f2efa3fdd4}')
AS result;
+------------+
|   result   |
+------------+
|          1 |
+------------+

Returns 0 for an invalid UUID value.

SELECT IS_UUID('b34a-4666-a35a-6bbbf349') AS result;
+--------+
| result |
+--------+
|      0 |
+--------+

Last modified: November 19, 2024

Was this article helpful?

Verification instructions

Note: You must install cosign to verify the authenticity of the SingleStore file.

Use the following steps to verify the authenticity of singlestoredb-server, singlestoredb-toolbox, singlestoredb-studio, and singlestore-client SingleStore files that have been downloaded.

You may perform the following steps on any computer that can run cosign, such as the main deployment host of the cluster.

  1. (Optional) Run the following command to view the associated signature files.

    curl undefined
  2. Download the signature file from the SingleStore release server.

    • Option 1: Click the Download Signature button next to the SingleStore file.

    • Option 2: Copy and paste the following URL into the address bar of your browser and save the signature file.

    • Option 3: Run the following command to download the signature file.

      curl -O undefined
  3. After the signature file has been downloaded, run the following command to verify the authenticity of the SingleStore file.

    echo -n undefined |
    cosign verify-blob --certificate-oidc-issuer https://oidc.eks.us-east-1.amazonaws.com/id/CCDCDBA1379A5596AB5B2E46DCA385BC \
    --certificate-identity https://kubernetes.io/namespaces/freya-production/serviceaccounts/job-worker \
    --bundle undefined \
    --new-bundle-format -
    Verified OK