Details
-
Task
-
Status: Closed (View Workflow)
-
Blocker
-
Resolution: Fixed
Description
The SQL parser defines the unary function crc32() that computes the CRC-32 of a string using the ISO 3309 polynomial that is being used by zlib and many others.
Often, CRC is computed in pieces. To faciliate this, we introduce an optional second parameter: crc32('MariaDB') is equal to crc32(crc32('Maria','DB')).
InnoDB files use a different polynomial, which is used by the special instructions that the Intel Nehalem microarchitecture introduced in SSE4.2. This is commonly called CRC-32C.
It would be very convenient to introduce an SQL function crc32c() that would compute CRC-32C checksums. Then we could could define simple SQL function that would generate a logically empty InnoDB redo log corresponding to a particular checkpoint LSN. Starting with MDEV-14425 and MDEV-27199, InnoDB would refuse normal startup if the redo log file was deleted.
Attachments
Issue Links
- causes
-
MCOL-4966 2-argument CRC32 call upon Columnstore table returns a wrong value
-
- Closed
-
-
MDEV-27482 2-argument CRC32 and CRC32C don't work in virtual column expressions
-
- Closed
-
- is part of
-
MDEV-27373 Q1 2022 release merge
-
- Closed
-
- relates to
-
MDEV-27480 Functions don't validate arguments properly and cast/truncate values without warnings or errors
-
- Stalled
-
-
MDEV-19935 Create unified CRC-32 interface
-
- Closed
-
-
MDEV-27199 Require ib_logfile0 to exist unless innodb_force_recovery=6
-
- Closed
-
The handling for the error ER_WRONG_PARAMETERS_TO_NATIVE_FCT is redundant and unreachable:
--error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
#0 my_error (nr=1583, MyFlags=0) at /mariadb/10.8/mysys/my_error.c:109
#1 0x00005635f0b30506 in Create_native_func::create_func (
this=0x5635f1ceb478 <Create_func_crc32c::s_singleton>, thd=0x7f8b34000d48,
name=0x7f8b4a75e6d0, item_list=0x7f8b34016f20)
at /mariadb/10.8/sql/item_create.cc:2653
#2 0x00005635f0a321e0 in MYSQLparse (thd=thd@entry=0x7f8b34000d48)
at /mariadb/10.8/sql/sql_yacc.yy:10441
Item*
Create_native_func::create_func(THD *thd, LEX_CSTRING *name, List<Item> *item_list)
{
{
my_error(ER_WRONG_PARAMETERS_TO_NATIVE_FCT, MYF(0), name->str);
}
}
I will replace those redundant error checks with assertions and include test cases to exercise this.