Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements for implicitly GENERATED fields #135

Closed
midenok opened this issue Feb 14, 2017 · 5 comments
Closed

Improvements for implicitly GENERATED fields #135

midenok opened this issue Feb 14, 2017 · 5 comments

Comments

@midenok
Copy link

midenok commented Feb 14, 2017

Currently implicit fields are named sys_trx_start, sys_trx_end. There should be ability to define arbitrary default names for them.

Column names should be mutated by prefixing _ to both sys fields in case of name clash with existing columns until there will be no clash.

In alter.test:
Test adding system versioning when a table already has sys_trx_start column, say, INT or VARCHAR.

@midenok midenok added the task label Feb 14, 2017
@midenok midenok added this to the 1.3: Performance optimizations, syntax extensions II milestone Feb 14, 2017
midenok referenced this issue in MariaDB/server Jun 22, 2017
@vuvova
Copy link

vuvova commented Jun 22, 2017

I don't think you need to bother implementing configurable default names. We have automatic generated names for indexes, foreign keys, check constraints — none of them are configurable. The user either specifies a name in CREATE TABLE or she doesn't, and then the server automatically picks up a non-conflicting name (e.g. with _1, _2, etc suffixes).

I'd suggest to be consistent here and follow existing behavior.

@midenok
Copy link
Author

midenok commented Jun 22, 2017

It may perfectly keep consistency with existing behaviour if f.ex. variable is not set. It would be good for me to have control of these names to spare some typing.

@midenok midenok changed the title Server variable for default implicit GENERATED fields Improvements for implicitly GENERATED fields Jun 23, 2017
@vuvova
Copy link

vuvova commented Jun 23, 2017

if the whole purpose of this variable is to save you some typing, then you can add a variable only in debug mode. Or add it, and at the very end of the project remove it and search-replace tests to use longer name (I've did something like that a couple of times).

@vuvova
Copy link

vuvova commented Jan 2, 2018

Please, no "mutation". First, it does not belong to system versioning feature, these fields are simply created SYSTEM_INVISIBLE and they exhibit all behavior of SYSTEM_INVISIBLE fields.

Second, SYSTEM_INVISIBLE fields have well defined documented names (like ROWID), they are not renamed automatically (otherwise they'd be rather difficult to find and use).

@midenok
Copy link
Author

midenok commented Jan 2, 2018

Too many reserved names leave less freedom for application. This may be especially important for transparent versioning mode. DBMS is system that serves application needs, but not vice versa. But this is not critical and may be postponed until real request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants