general_routines

SYNOPSIS

General routines: general purpose tasks routines.

  • crc64(): Return a 64 bit CRC of given input, as unsigned big integer.
  • query_checksum(): Checksum the result set of a query.
  • random_hash(): Return a 64 bit CRC of given input, as unsigned big integer.
  • shorttime_to_seconds(): Return the number of seconds represented by the given short form.

EXAMPLES

Calculate 64 bit CRC for some text:

mysql> SELECT common_schema.crc64('mysql') AS crc64;
+---------------------+
| crc64               |
+---------------------+
| 9350511318824990686 |
+---------------------+

Use shorttime_to_seconds() to parse '2h', making for 2 hours:

mysql> SELECT shorttime_to_seconds('2h') as seconds;
+---------+
| seconds |
+---------+
|    7200 |
+---------+

 
common_schema documentation