Details
-
Task
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
Description
SYS_GUID is an Oracle function, similar to the UUID function in mariadb, the document link is:
https://docs.oracle.com/en/database/oracle/oracle-database/12.2/sqlrf/SYS_GUID.html#GUID-761E36B4-32DA-497D-8829-3D4653381F9B
there are two difference between sys_guid and uuid in mariadb :
- output format: the output of sys_guid without '-' character.
- use different algorithms,please note the red font in the example
1. Execute sys_guid multiple times in a session, and add 1 to the 12th byte of output each time
2. execute sys_guid in different sessions, the 6~16 bytes and last 4 bytes of output are different
example for oracle sys_guid
SQL> SELECT SYS_GUID() FROM DUAL;
SYS_GUID()
--------------------------------
B4F9C877B1264B49E05315500A0A222B
SQL> SELECT SYS_GUID() FROM DUAL;
SYS_GUID()
--------------------------------
B4F9C877B1274B49E05315500A0A222B
SQL> SELECT SYS_GUID() FROM DUAL;
SYS_GUID()
--------------------------------
B4F9C877B1284B49E05315500A0A222B
- start new session and execute sys_guid
SQL> SELECT SYS_GUID() FROM DUAL;
SYS_GUID()
--------------------------------
B4F9CCEB9C1A4CBDE05315500A0AA3C2
SQL> SELECT SYS_GUID() FROM DUAL;
SYS_GUID()
--------------------------------
B4F9CCEB9C1B4CBDE05315500A0AA3C2
SQL> SELECT SYS_GUID() FROM DUAL;
SYS_GUID()
--------------------------------
B4F9CCEB9C1C4CBDE05315500A0AA3C2
I have implemented SYS_ GUID, the behavior and algorithms are the same as UUID, but the output format is different.
MariaDB [(none)]> select sys_guid();
|
+----------------------------------+
|
| sys_guid() |
|
+----------------------------------+
|
| 4FE31C7B2F8E11EB8DAAA87EEAED1F75 |
|
+----------------------------------+
|
1 row in set (0.000 sec) |
|
MariaDB [(none)]> select sys_guid();
|
+----------------------------------+
|
| sys_guid() |
|
+----------------------------------+
|
| 50DEAB622F8E11EB8DAAA87EEAED1F75 |
|
+----------------------------------+
|
Attachments
Issue Links
- is part of
-
MDEV-19162 Some basic datatypes and functions in oracle compatibility mode do not work
-
- Open
-
Activity
Field | Original Value | New Value |
---|---|---|
Attachment | sys_guid.patch [ 54881 ] |
Description |
SYS_GUID is an Oracle function, similar to the UUID function in mariadb, the document link is:
https://docs.oracle.com/en/database/oracle/oracle-database/12.2/sqlrf/SYS_GUID.html#GUID-761E36B4-32DA-497D-8829-3D4653381F9B there are two difference between sys_guid and uuid in mariadb : * output format: the output of sys_guid without '-' character. * use different algorithms 1. execute sys_guid more than 1 times in a session, and increase the byte 12 of output by 1, but uuid is not 2. execute sys_guid in different session, the last four bytes of output are different example for oracle sys_guid {code:java} SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9C877B1264B49E05315500A0A222B SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9C877B1274B49E05315500A0A222B SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9C877B1284B49E05315500A0A222B {code} * start new session and execute sys_guid {code:java} SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9CCEB9C1A4CBDE05315500A0AA3C2 SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9CCEB9C1B4CBDE05315500A0AA3C2 SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9CCEB9C1C4CBDE05315500A0AA3C2 {code} I have implemented SYS_ GUID, the behavior and algorithms are the same as UUID, but the output format is different. {code:java} MariaDB [(none)]> select sys_guid(); +----------------------------------+ | sys_guid() | +----------------------------------+ | 4FE31C7B2F8E11EB8DAAA87EEAED1F75 | +----------------------------------+ 1 row in set (0.000 sec) MariaDB [(none)]> select sys_guid(); +----------------------------------+ | sys_guid() | +----------------------------------+ | 50DEAB622F8E11EB8DAAA87EEAED1F75 | +----------------------------------+ {code} |
SYS_GUID is an Oracle function, similar to the UUID function in mariadb, the document link is:
https://docs.oracle.com/en/database/oracle/oracle-database/12.2/sqlrf/SYS_GUID.html#GUID-761E36B4-32DA-497D-8829-3D4653381F9B there are two difference between sys_guid and uuid in mariadb : * output format: the output of sys_guid without '-' character. * use different algorithms 1. Execute sys_guid multiple times in a session, and add 1 to the 12th byte of output each time 2. execute sys_guid in different sessions, the last 4 bytes of output are different example for oracle sys_guid {code:java} SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9C877B1264B49E05315500A0A222B SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9C877B1274B49E05315500A0A222B SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9C877B1284B49E05315500A0A222B {code} * start new session and execute sys_guid {code:java} SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9CCEB9C1A4CBDE05315500A0AA3C2 SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9CCEB9C1B4CBDE05315500A0AA3C2 SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9CCEB9C1C4CBDE05315500A0AA3C2 {code} I have implemented SYS_ GUID, the behavior and algorithms are the same as UUID, but the output format is different. {code:java} MariaDB [(none)]> select sys_guid(); +----------------------------------+ | sys_guid() | +----------------------------------+ | 4FE31C7B2F8E11EB8DAAA87EEAED1F75 | +----------------------------------+ 1 row in set (0.000 sec) MariaDB [(none)]> select sys_guid(); +----------------------------------+ | sys_guid() | +----------------------------------+ | 50DEAB622F8E11EB8DAAA87EEAED1F75 | +----------------------------------+ {code} |
Description |
SYS_GUID is an Oracle function, similar to the UUID function in mariadb, the document link is:
https://docs.oracle.com/en/database/oracle/oracle-database/12.2/sqlrf/SYS_GUID.html#GUID-761E36B4-32DA-497D-8829-3D4653381F9B there are two difference between sys_guid and uuid in mariadb : * output format: the output of sys_guid without '-' character. * use different algorithms 1. Execute sys_guid multiple times in a session, and add 1 to the 12th byte of output each time 2. execute sys_guid in different sessions, the last 4 bytes of output are different example for oracle sys_guid {code:java} SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9C877B1264B49E05315500A0A222B SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9C877B1274B49E05315500A0A222B SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9C877B1284B49E05315500A0A222B {code} * start new session and execute sys_guid {code:java} SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9CCEB9C1A4CBDE05315500A0AA3C2 SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9CCEB9C1B4CBDE05315500A0AA3C2 SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9CCEB9C1C4CBDE05315500A0AA3C2 {code} I have implemented SYS_ GUID, the behavior and algorithms are the same as UUID, but the output format is different. {code:java} MariaDB [(none)]> select sys_guid(); +----------------------------------+ | sys_guid() | +----------------------------------+ | 4FE31C7B2F8E11EB8DAAA87EEAED1F75 | +----------------------------------+ 1 row in set (0.000 sec) MariaDB [(none)]> select sys_guid(); +----------------------------------+ | sys_guid() | +----------------------------------+ | 50DEAB622F8E11EB8DAAA87EEAED1F75 | +----------------------------------+ {code} |
SYS_GUID is an Oracle function, similar to the UUID function in mariadb, the document link is:
https://docs.oracle.com/en/database/oracle/oracle-database/12.2/sqlrf/SYS_GUID.html#GUID-761E36B4-32DA-497D-8829-3D4653381F9B there are two difference between sys_guid and uuid in mariadb : * output format: the output of sys_guid without '-' character. * use different algorithms,please note the red font in the example 1. Execute sys_guid multiple times in a session, and add 1 to the 12th byte of output each time 2. execute sys_guid in different sessions, the last 4 bytes of output are different example for oracle sys_guid {code:java} SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9C877B12{color:red}6{color}4B49E05315500A0A222B SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9C877B12{color:red}7{color}4B49E05315500A0A222B SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9C877B12{color:red}8{color}4B49E05315500A0A{color:red222B{color} {code} * start new session and execute sys_guid {code:java} SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9CCEB9C1A4CBDE05315500A0A{color:red}A3C2{color} SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9CCEB9C1B4CBDE05315500A0AA3C2 SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9CCEB9C1C4CBDE05315500A0AA3C2 {code} I have implemented SYS_ GUID, the behavior and algorithms are the same as UUID, but the output format is different. {code:java} MariaDB [(none)]> select sys_guid(); +----------------------------------+ | sys_guid() | +----------------------------------+ | 4FE31C7B2F8E11EB8DAAA87EEAED1F75 | +----------------------------------+ 1 row in set (0.000 sec) MariaDB [(none)]> select sys_guid(); +----------------------------------+ | sys_guid() | +----------------------------------+ | 50DEAB622F8E11EB8DAAA87EEAED1F75 | +----------------------------------+ {code} |
Description |
SYS_GUID is an Oracle function, similar to the UUID function in mariadb, the document link is:
https://docs.oracle.com/en/database/oracle/oracle-database/12.2/sqlrf/SYS_GUID.html#GUID-761E36B4-32DA-497D-8829-3D4653381F9B there are two difference between sys_guid and uuid in mariadb : * output format: the output of sys_guid without '-' character. * use different algorithms,please note the red font in the example 1. Execute sys_guid multiple times in a session, and add 1 to the 12th byte of output each time 2. execute sys_guid in different sessions, the last 4 bytes of output are different example for oracle sys_guid {code:java} SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9C877B12{color:red}6{color}4B49E05315500A0A222B SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9C877B12{color:red}7{color}4B49E05315500A0A222B SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9C877B12{color:red}8{color}4B49E05315500A0A{color:red222B{color} {code} * start new session and execute sys_guid {code:java} SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9CCEB9C1A4CBDE05315500A0A{color:red}A3C2{color} SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9CCEB9C1B4CBDE05315500A0AA3C2 SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9CCEB9C1C4CBDE05315500A0AA3C2 {code} I have implemented SYS_ GUID, the behavior and algorithms are the same as UUID, but the output format is different. {code:java} MariaDB [(none)]> select sys_guid(); +----------------------------------+ | sys_guid() | +----------------------------------+ | 4FE31C7B2F8E11EB8DAAA87EEAED1F75 | +----------------------------------+ 1 row in set (0.000 sec) MariaDB [(none)]> select sys_guid(); +----------------------------------+ | sys_guid() | +----------------------------------+ | 50DEAB622F8E11EB8DAAA87EEAED1F75 | +----------------------------------+ {code} |
SYS_GUID is an Oracle function, similar to the UUID function in mariadb, the document link is:
https://docs.oracle.com/en/database/oracle/oracle-database/12.2/sqlrf/SYS_GUID.html#GUID-761E36B4-32DA-497D-8829-3D4653381F9B there are two difference between sys_guid and uuid in mariadb : * output format: the output of sys_guid without '-' character. * use different algorithms,please note the red font in the example 1. Execute sys_guid multiple times in a session, and add 1 to the 12th byte of output each time 2. execute sys_guid in different sessions, the last 4 bytes of output are different example for oracle sys_guid {code:java} SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9C877B12{color:#DE350B}6{color}4B49E05315500A0A222B SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9C877B12{color:red}7{color}4B49E05315500A0A222B SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9C877B12{color:red}8{color}4B49E05315500A0A{color:red222B{color} {code} * start new session and execute sys_guid {code:java} SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9CCEB9C1A4CBDE05315500A0A{color:red}A3C2{color} SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9CCEB9C1B4CBDE05315500A0AA3C2 SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9CCEB9C1C4CBDE05315500A0AA3C2 {code} I have implemented SYS_ GUID, the behavior and algorithms are the same as UUID, but the output format is different. {code:java} MariaDB [(none)]> select sys_guid(); +----------------------------------+ | sys_guid() | +----------------------------------+ | 4FE31C7B2F8E11EB8DAAA87EEAED1F75 | +----------------------------------+ 1 row in set (0.000 sec) MariaDB [(none)]> select sys_guid(); +----------------------------------+ | sys_guid() | +----------------------------------+ | 50DEAB622F8E11EB8DAAA87EEAED1F75 | +----------------------------------+ {code} |
Description |
SYS_GUID is an Oracle function, similar to the UUID function in mariadb, the document link is:
https://docs.oracle.com/en/database/oracle/oracle-database/12.2/sqlrf/SYS_GUID.html#GUID-761E36B4-32DA-497D-8829-3D4653381F9B there are two difference between sys_guid and uuid in mariadb : * output format: the output of sys_guid without '-' character. * use different algorithms,please note the red font in the example 1. Execute sys_guid multiple times in a session, and add 1 to the 12th byte of output each time 2. execute sys_guid in different sessions, the last 4 bytes of output are different example for oracle sys_guid {code:java} SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9C877B12{color:#DE350B}6{color}4B49E05315500A0A222B SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9C877B12{color:red}7{color}4B49E05315500A0A222B SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9C877B12{color:red}8{color}4B49E05315500A0A{color:red222B{color} {code} * start new session and execute sys_guid {code:java} SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9CCEB9C1A4CBDE05315500A0A{color:red}A3C2{color} SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9CCEB9C1B4CBDE05315500A0AA3C2 SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9CCEB9C1C4CBDE05315500A0AA3C2 {code} I have implemented SYS_ GUID, the behavior and algorithms are the same as UUID, but the output format is different. {code:java} MariaDB [(none)]> select sys_guid(); +----------------------------------+ | sys_guid() | +----------------------------------+ | 4FE31C7B2F8E11EB8DAAA87EEAED1F75 | +----------------------------------+ 1 row in set (0.000 sec) MariaDB [(none)]> select sys_guid(); +----------------------------------+ | sys_guid() | +----------------------------------+ | 50DEAB622F8E11EB8DAAA87EEAED1F75 | +----------------------------------+ {code} |
SYS_GUID is an Oracle function, similar to the UUID function in mariadb, the document link is:
https://docs.oracle.com/en/database/oracle/oracle-database/12.2/sqlrf/SYS_GUID.html#GUID-761E36B4-32DA-497D-8829-3D4653381F9B there are two difference between sys_guid and uuid in mariadb : * output format: the output of sys_guid without '-' character. * use different algorithms,please note the red font in the example 1. Execute sys_guid multiple times in a session, and add 1 to the 12th byte of output each time 2. execute sys_guid in different sessions, the last 4 bytes of output are different example for oracle sys_guid SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9C877B12{color:red}6{color}4B49E05315500A0A222B SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9C877B12{color:red}7{color}4B49E05315500A0A222B SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9C877B12{color:red}8{color}4B49E05315500A0A{color:red222B{color} * start new session and execute sys_guid SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9CCEB9C1A4CBDE05315500A0A{color:red}A3C2{color} SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9CCEB9C1B4CBDE05315500A0AA3C2 SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9CCEB9C1C4CBDE05315500A0AA3C2 I have implemented SYS_ GUID, the behavior and algorithms are the same as UUID, but the output format is different. {code:java} MariaDB [(none)]> select sys_guid(); +----------------------------------+ | sys_guid() | +----------------------------------+ | 4FE31C7B2F8E11EB8DAAA87EEAED1F75 | +----------------------------------+ 1 row in set (0.000 sec) MariaDB [(none)]> select sys_guid(); +----------------------------------+ | sys_guid() | +----------------------------------+ | 50DEAB622F8E11EB8DAAA87EEAED1F75 | +----------------------------------+ {code} |
Description |
SYS_GUID is an Oracle function, similar to the UUID function in mariadb, the document link is:
https://docs.oracle.com/en/database/oracle/oracle-database/12.2/sqlrf/SYS_GUID.html#GUID-761E36B4-32DA-497D-8829-3D4653381F9B there are two difference between sys_guid and uuid in mariadb : * output format: the output of sys_guid without '-' character. * use different algorithms,please note the red font in the example 1. Execute sys_guid multiple times in a session, and add 1 to the 12th byte of output each time 2. execute sys_guid in different sessions, the last 4 bytes of output are different example for oracle sys_guid SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9C877B12{color:red}6{color}4B49E05315500A0A222B SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9C877B12{color:red}7{color}4B49E05315500A0A222B SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9C877B12{color:red}8{color}4B49E05315500A0A{color:red222B{color} * start new session and execute sys_guid SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9CCEB9C1A4CBDE05315500A0A{color:red}A3C2{color} SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9CCEB9C1B4CBDE05315500A0AA3C2 SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9CCEB9C1C4CBDE05315500A0AA3C2 I have implemented SYS_ GUID, the behavior and algorithms are the same as UUID, but the output format is different. {code:java} MariaDB [(none)]> select sys_guid(); +----------------------------------+ | sys_guid() | +----------------------------------+ | 4FE31C7B2F8E11EB8DAAA87EEAED1F75 | +----------------------------------+ 1 row in set (0.000 sec) MariaDB [(none)]> select sys_guid(); +----------------------------------+ | sys_guid() | +----------------------------------+ | 50DEAB622F8E11EB8DAAA87EEAED1F75 | +----------------------------------+ {code} |
SYS_GUID is an Oracle function, similar to the UUID function in mariadb, the document link is:
https://docs.oracle.com/en/database/oracle/oracle-database/12.2/sqlrf/SYS_GUID.html#GUID-761E36B4-32DA-497D-8829-3D4653381F9B there are two difference between sys_guid and uuid in mariadb : * output format: the output of sys_guid without '-' character. * use different algorithms,please note the red font in the example 1. Execute sys_guid multiple times in a session, and add 1 to the 12th byte of output each time 2. execute sys_guid in different sessions, the last 4 bytes of output are different example for oracle sys_guid SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9C877B12{color:red}6{color}4B49E05315500A0A222B SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9C877B12{color:red}7{color}4B49E05315500A0A222B SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9C877B12{color:red}8{color}4B49E05315500A0A{color:red}222B{color} * start new session and execute sys_guid SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9CCEB9C1A4CBDE05315500A0A{color:red}A3C2{color} SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9CCEB9C1B4CBDE05315500A0AA3C2 SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9CCEB9C1C4CBDE05315500A0AA3C2 I have implemented SYS_ GUID, the behavior and algorithms are the same as UUID, but the output format is different. {code:java} MariaDB [(none)]> select sys_guid(); +----------------------------------+ | sys_guid() | +----------------------------------+ | 4FE31C7B2F8E11EB8DAAA87EEAED1F75 | +----------------------------------+ 1 row in set (0.000 sec) MariaDB [(none)]> select sys_guid(); +----------------------------------+ | sys_guid() | +----------------------------------+ | 50DEAB622F8E11EB8DAAA87EEAED1F75 | +----------------------------------+ {code} |
Description |
SYS_GUID is an Oracle function, similar to the UUID function in mariadb, the document link is:
https://docs.oracle.com/en/database/oracle/oracle-database/12.2/sqlrf/SYS_GUID.html#GUID-761E36B4-32DA-497D-8829-3D4653381F9B there are two difference between sys_guid and uuid in mariadb : * output format: the output of sys_guid without '-' character. * use different algorithms,please note the red font in the example 1. Execute sys_guid multiple times in a session, and add 1 to the 12th byte of output each time 2. execute sys_guid in different sessions, the last 4 bytes of output are different example for oracle sys_guid SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9C877B12{color:red}6{color}4B49E05315500A0A222B SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9C877B12{color:red}7{color}4B49E05315500A0A222B SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9C877B12{color:red}8{color}4B49E05315500A0A{color:red}222B{color} * start new session and execute sys_guid SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9CCEB9C1A4CBDE05315500A0A{color:red}A3C2{color} SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9CCEB9C1B4CBDE05315500A0AA3C2 SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9CCEB9C1C4CBDE05315500A0AA3C2 I have implemented SYS_ GUID, the behavior and algorithms are the same as UUID, but the output format is different. {code:java} MariaDB [(none)]> select sys_guid(); +----------------------------------+ | sys_guid() | +----------------------------------+ | 4FE31C7B2F8E11EB8DAAA87EEAED1F75 | +----------------------------------+ 1 row in set (0.000 sec) MariaDB [(none)]> select sys_guid(); +----------------------------------+ | sys_guid() | +----------------------------------+ | 50DEAB622F8E11EB8DAAA87EEAED1F75 | +----------------------------------+ {code} |
SYS_GUID is an Oracle function, similar to the UUID function in mariadb, the document link is:
https://docs.oracle.com/en/database/oracle/oracle-database/12.2/sqlrf/SYS_GUID.html#GUID-761E36B4-32DA-497D-8829-3D4653381F9B there are two difference between sys_guid and uuid in mariadb : * output format: the output of sys_guid without '-' character. * use different algorithms,please note the red font in the example 1. Execute sys_guid multiple times in a session, and add 1 to the 12th byte of output each time 2. execute sys_guid in different sessions, the last 4 bytes of output are different example for oracle sys_guid SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9C877B12{color:red}6{color}4B49E05315500A0A222B SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9C877B12{color:red}7{color}4B49E05315500A0A222B SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9C877B12{color:red}8{color}4B49E05315500A0A{color:red}222B{color} * start new session and execute sys_guid SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9CCEB9C1{color:red}A{color}4CBDE05315500A0A{color:red}A3C2{color} SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9CCEB9C1{color:red}B{color}4CBDE05315500A0AA3C2 SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9CCEB9C1{color:red}C{color}4CBDE05315500A0AA3C2 I have implemented SYS_ GUID, the behavior and algorithms are the same as UUID, but the output format is different. {code:java} MariaDB [(none)]> select sys_guid(); +----------------------------------+ | sys_guid() | +----------------------------------+ | 4FE31C7B2F8E11EB8DAAA87EEAED1F75 | +----------------------------------+ 1 row in set (0.000 sec) MariaDB [(none)]> select sys_guid(); +----------------------------------+ | sys_guid() | +----------------------------------+ | 50DEAB622F8E11EB8DAAA87EEAED1F75 | +----------------------------------+ {code} |
Description |
SYS_GUID is an Oracle function, similar to the UUID function in mariadb, the document link is:
https://docs.oracle.com/en/database/oracle/oracle-database/12.2/sqlrf/SYS_GUID.html#GUID-761E36B4-32DA-497D-8829-3D4653381F9B there are two difference between sys_guid and uuid in mariadb : * output format: the output of sys_guid without '-' character. * use different algorithms,please note the red font in the example 1. Execute sys_guid multiple times in a session, and add 1 to the 12th byte of output each time 2. execute sys_guid in different sessions, the last 4 bytes of output are different example for oracle sys_guid SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9C877B12{color:red}6{color}4B49E05315500A0A222B SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9C877B12{color:red}7{color}4B49E05315500A0A222B SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9C877B12{color:red}8{color}4B49E05315500A0A{color:red}222B{color} * start new session and execute sys_guid SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9CCEB9C1{color:red}A{color}4CBDE05315500A0A{color:red}A3C2{color} SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9CCEB9C1{color:red}B{color}4CBDE05315500A0AA3C2 SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9CCEB9C1{color:red}C{color}4CBDE05315500A0AA3C2 I have implemented SYS_ GUID, the behavior and algorithms are the same as UUID, but the output format is different. {code:java} MariaDB [(none)]> select sys_guid(); +----------------------------------+ | sys_guid() | +----------------------------------+ | 4FE31C7B2F8E11EB8DAAA87EEAED1F75 | +----------------------------------+ 1 row in set (0.000 sec) MariaDB [(none)]> select sys_guid(); +----------------------------------+ | sys_guid() | +----------------------------------+ | 50DEAB622F8E11EB8DAAA87EEAED1F75 | +----------------------------------+ {code} |
SYS_GUID is an Oracle function, similar to the UUID function in mariadb, the document link is:
https://docs.oracle.com/en/database/oracle/oracle-database/12.2/sqlrf/SYS_GUID.html#GUID-761E36B4-32DA-497D-8829-3D4653381F9B there are two difference between sys_guid and uuid in mariadb : * output format: the output of sys_guid without '-' character. * use different algorithms,please note the red font in the example 1. Execute sys_guid multiple times in a session, and add 1 to the 12th byte of output each time 2. execute sys_guid in different sessions, the 6~16 bytes and last 4 bytes of output are different example for oracle sys_guid SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9C877B12{color:red}6{color}4B49E05315500A0A222B SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9C877B12{color:red}7{color}4B49E05315500A0A222B SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9C{color:red}877B1284B49{color}E05315500A0A{color:red}222B{color} * start new session and execute sys_guid SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9C{color:red}CEB9C1A4CBD{color}E05315500A0A{color:red}A3C2{color} SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9CCEB9C1{color:red}B{color}4CBDE05315500A0AA3C2 SQL> SELECT SYS_GUID() FROM DUAL; SYS_GUID() -------------------------------- B4F9CCEB9C1{color:red}C{color}4CBDE05315500A0AA3C2 I have implemented SYS_ GUID, the behavior and algorithms are the same as UUID, but the output format is different. {code:java} MariaDB [(none)]> select sys_guid(); +----------------------------------+ | sys_guid() | +----------------------------------+ | 4FE31C7B2F8E11EB8DAAA87EEAED1F75 | +----------------------------------+ 1 row in set (0.000 sec) MariaDB [(none)]> select sys_guid(); +----------------------------------+ | sys_guid() | +----------------------------------+ | 50DEAB622F8E11EB8DAAA87EEAED1F75 | +----------------------------------+ {code} |
Assignee | Michael Widenius [ monty ] |
Link | This issue is part of MDEV-19162 [ MDEV-19162 ] |
Fix Version/s | 10.6 [ 24028 ] |
Status | Open [ 1 ] | In Progress [ 3 ] |
issue.field.resolutiondate | 2021-05-20 09:28:29.0 | 2021-05-20 09:28:29.615 |
Component/s | Server [ 13907 ] | |
Component/s | OTHER [ 10125 ] | |
Fix Version/s | 10.6.1 [ 24437 ] | |
Fix Version/s | 10.6 [ 24028 ] | |
Resolution | Fixed [ 1 ] | |
Status | In Progress [ 3 ] | Closed [ 6 ] |
Workflow | MariaDB v3 [ 116153 ] | MariaDB v4 [ 134365 ] |
add my patch