BIT_LENGTH()

Overview

Returns the length of a string in bits.

USAGE

BIT_LENGTH(string)

Argument Name

Description

string

The string to evaluate

DETAILS

BIT_LENGTH() is a string function that returns the length of the string in bits.

A number is converted into a string before being measured.

The return value is equivalent to CHAR_LENGTH(string)*8.

A 0 is returned if the argument is an empty string (without any whitespace).

A NULL is returned if the argument is NULL.

SYNONYMS

SCHEMA

PARAMETERS

SKYSQL

PRIVILEGES

EXAMPLES

SELECT BIT_LENGTH('foobar'), BIT_LENGTH(-1);
+----------------------+----------------+
| BIT_LENGTH('foobar') | BIT_LENGTH(-1) |
+----------------------+----------------+
|                   48 |             16 |
+----------------------+----------------+
+------------------+
| BIT_LENGTH(NULL) |
+------------------+
|             NULL |
+------------------+

ERROR HANDLING

FEATURE INTERACTION

RESPONSES

DIAGNOSIS

ISO 9075:2016

CHANGE HISTORY

Release Series

History

23.09

  • Present starting in MariaDB Xpand 23.09.1.

6.1

  • Present starting in MariaDB Xpand 6.1.0.

6.0

  • Present starting in MariaDB Xpand 6.0.3.

5.3

  • Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.0

  • Present starting in MariaDB Xpand 6.0.3.

5.3

  • Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.1

  • Present starting in MariaDB Xpand 6.1.0.

EXTERNAL REFERENCES