← Back to team overview

maria-developers team mailing list archive

Re: 0608c273598: MDEV-15966: Behavior for TRUNCATE versioned table is not documented and not covered by tests

 

Hi, Nikita!

On Dec 26, Nikita Malyavin wrote:
> revision-id: 0608c273598 (versioning-1.0.5-112-g0608c273598)
> parent(s): 49d506cd1d7
> author: Nikita Malyavin <nikitamalyavin@xxxxxxxxx>
> committer: Nikita Malyavin <nikitamalyavin@xxxxxxxxx>
> timestamp: 2018-09-05 04:42:17 +1000
> message:
> 
> MDEV-15966: Behavior for TRUNCATE versioned table is not documented and not covered by tests
> 
> * MDEV-15966: Behavior for TRUNCATE versioned table is not documented and not covered by tests
> 
> * add error for truncation of versioned tables: `ER_TRUNCATE_ILLEGAL_VERS`
> * extract reading `extra2` section in function `dd_read_extra2`
> * update `dd_frm_type` and `ha_table_exists` signatures: add new parameter `is_versioned`
> 
> test suites run: main, parts, versioning
> 
> [fixes tempesta-tech/mariadb#261]

I don't quite like that a small and simple function dd_frm_type(), which
used to just read few first bytes of the frm file, gets more and more
complex, growing into a complete frm-open method.

So, perhaps, I'd consider changing TRUNCATE to open the table properly
without all that just-read-few-bytes shortcuts.

Or, may be, simply document that TRUNCATE works on versioning tables
just as DROP+CREATE does. There is no logical reason why it shouldn't -
if one can do SHOW CREATE TABLE and CREATE OR REPLACE, then TRUNCATE
won't add any new functionality on top of that. That's the easiest and
most logical "fix" to this bug. Agree?

Regards,
Sergei
Chief Architect MariaDB
and security@xxxxxxxxxxx


Follow ups