NuoDB Migrator Mappings for MySQL Unsigned Types

NuoDB datatypes are always signed (UNSIGNED modifiers are not allowed), therefore allowed ranges for MySQL UNSIGNED and NuoDB signed types will be different:

Column MySQL Type MySQL Range NuoDB Type NuoDB Range

f1

SMALLINT UNSIGNED

SMALLINT

[-32768,32767]

f2

MEDIUMINT UNSIGNED

INTEGER

[-2147483648,2147483647]

f3

INT UNSIGNED

INTEGER

[-2147483648,2147483647]

f4

BIGINT UNSIGNED

BIGINT

[-9223372036854775808,9223372036854775807]

The NuoDB Migrator converts each MySQL UNSIGNED type to the closest NuoDB numeric type, so that value loss and numeric overflow does not happen during data migration. Consider the following MySQL table (note the UNSIGNED modifier):

CREATE TABLE `t2` (`f1` SMALLINT UNSIGNED, `f2` MEDIUMINT UNSIGNED, `f3` INT UNSIGNED, `f4` BIGINT UNSIGNED);
INSERT INTO `t2` VALUES (65535, 16777215, 4294967295, 18446744073709551615);

This will be converted to:

CREATE TABLE "t2" ("f1" INTEGER, "f2" INTEGER, "f3" BIGINT, "f4" NUMERIC(21));

Table data will be migrated properly using the nuodb-migrator dump […​] and nuodb-migrator load […​] commands.