Bug #95093 Feature request: change defaults in innodb_memcache.containers
Submitted: 23 Apr 22:59 Modified: 24 Apr 9:56
Reporter: Maksym Matiukhin Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Memcached Severity:S4 (Feature request)
Version:8.0.12 OS:Any
Assigned to: CPU Architecture:Any
Triage: Needs Triage: D5 (Feature request)

[23 Apr 22:59] Maksym Matiukhin
Description:
Currently table innodb_memcache.containers looks like this:
----
CREATE TABLE `containers` (
  `name` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `db_schema` varchar(250) COLLATE utf8_unicode_ci NOT NULL,
  `db_table` varchar(250) COLLATE utf8_unicode_ci NOT NULL,
  `key_columns` varchar(250) COLLATE utf8_unicode_ci NOT NULL,
  `value_columns` varchar(250) COLLATE utf8_unicode_ci DEFAULT NULL,
  `flags` varchar(250) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0',
  `cas_column` varchar(250) COLLATE utf8_unicode_ci DEFAULT NULL,
  `expire_time_column` varchar(250) COLLATE utf8_unicode_ci DEFAULT NULL,
  `unique_idx_name_on_key` varchar(250) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
---

The problem is that cas_column and expire_time_column have default value NULL. However NULL is not valid value for these columns.

Let suppose I have a table 
---
CREATE TABLE `abc` (
  `name` varchar(250) COLLATE utf8_unicode_ci NOT NULL,
  `counter` varchar(250) COLLATE utf8_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
--
And I want to work with it via memcached.
It's not easy to find how to configure this table in  innodb_memcache.containers  because most exmamples in the documentation assume that your table has 3 extra columns for cas, flags and expire.
So, the most logical first step for the developer is to try something like this:
----
INSERT INTO innodb_memcache.containers SET 
name='tmp',db_schema='test',db_table='abc',key_columns='name', value_columns='counter',unique_idx_name_on_key='PRIMARY';
----
It will create a row in innodb_memcache.containers with cas_column=NULL and expire_time_column=NULL and memcached protocol for this table_id will not work

Documentation doesn't have explicit example for this case.

Would it be possible to change default value for cas_column and  expire_time_column to '0' as we already have it for the flags column?
Or maybe you can allow NULL value and  make the same behaviour for NULL value as for '0'?

Thanks

How to repeat:
not available
It is a feature request
[24 Apr 9:56] Umesh Shastry
Hello Maksym,

Thank you for the feature request!

regards,
Umesh
[24 Apr 9:58] Umesh Shastry
Btw, containers Table details are explained here:

https://dev.mysql.com/doc/refman/8.0/en/innodb-memcached-internals.html