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

mysql 8 UUID_TO_BIN #236

Open
mohamedsharaf opened this issue Aug 15, 2018 · 1 comment
Open

mysql 8 UUID_TO_BIN #236

mohamedsharaf opened this issue Aug 15, 2018 · 1 comment
Labels

Comments

@mohamedsharaf
Copy link

mysql 8 generate ordered uuid before passing it to be saved

does OrderedTimeCodec.php compatible with this function (do same arrangment)

@ramsey ramsey added the question label Oct 1, 2018
@kubatek94
Copy link

According to https://dev.mysql.com/doc/refman/8.0/en/miscellaneous-functions.html#function_uuid-to-bin

The swapping UUID_TO_BIN does is:

If swap_flag is 1, the format of the return value differs: The time-low and time-high parts (the first and third groups of hexadecimal digits, respectively) are swapped. This moves the more rapidly varying part to the right and can improve indexing efficiency if the result is stored in an indexed column.

The order in OrderedTimeCodec is
$optimized = [ $fields['time_hi_and_version'], $fields['time_mid'], $fields['time_low'], $fields['clock_seq_hi_and_reserved'], $fields['clock_seq_low'], $fields['node'], ];
which has the time_hi_and_version and time_low swapped indeed, so it seems to be compatible with MYSQL 8 implementation.

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

No branches or pull requests

3 participants