3 Ways to Show the Collation for your Connection in MariaDB

When you run a query against a MariaDB database, MariaDB uses a bunch of system variables to determine which character set and collation to use whenever queries are run. If the client uses a different character set to the server, then MariaDB can translate it into an appropriate character set and collation.

When sending the query results back to the client, MariaDB can translate these results back to a different character set altogether if required. MariaDB uses system variables to determine which character sets and collations to use at each of these steps.

Here are three ways to show the connection collation in MariaDB.

Read more

How EXPORT_SET() Works in MariaDB

In MariaDB, EXPORT_SET() is a built-in string function that returns a string that reflects the bits in the specified value. For every bit set in the specified value, you get an “on” string and for every bit not set in the value, you get an “off” string.

It accepts a minimum of three arguments, plus two optional arguments.

Read more

How FIND_IN_SET() Works in MariaDB

In MariaDB, FIND_IN_SET() is a built-in string function that returns the index position where the given pattern occurs in the specified string list.

It accepts two arguments. The first is the pattern you want to search for. The second argument is a string containing comma-separated values for which to match the pattern against.

Read more

How FIELD() Works in MariaDB

In MariaDB, FIELD() is a built-in string function that returns the index position of the string or number matching the specified pattern.

It accepts two or more arguments. The first is the pattern you want to search for. All subsequent arguments are the strings or numbers for which to match the pattern against.

Read more

How CONCAT_WS() Works in MariaDB

In MariaDB, CONCAT_WS() is a built-in string function that stands for Concatenate With Separator.

CONCAT_WS() performs a string concatenation on its arguments, with the first argument being the separator for the remaining arguments.

Concatenation is the operation of joining two or more strings end-to-end.

CONCAT_WS() accepts two or more arguments (although providing just two arguments would result in nothing being concatenated, due to the first argument being the separator, and the second being a single string to be concatenated with… nothing else).

Read more

How CONCAT() Works in MariaDB

In MariaDB, CONCAT() is a built-in string function that performs a string concatenation on its arguments. It returns the string that results from concatenating its arguments.

Concatenation is the operation of joining two or more strings end-to-end.

CONCAT() accepts one or more arguments, all of which are returned as a single concatenated string.

Read more