diff --git a/pgloader.1 b/pgloader.1 index 0f7f6bf..ca894cb 100644 --- a/pgloader.1 +++ b/pgloader.1 @@ -2474,6 +2474,18 @@ type bigint with extra auto_increment to bigserial type tinyint to boolean when (= 1 precision) using tinyint\-to\-boolean . .IP "\(bu" 4 +type tinyint when unsigned to smallint drop typemod +. +.IP "\(bu" 4 +type smallint when unsigned to integer drop typemod +. +.IP "\(bu" 4 +type mediumint when unsigned to integer drop typemod +. +.IP "\(bu" 4 +type integer when unsigned to bigint drop typemod +. +.IP "\(bu" 4 type tinyint to smallint drop typemod . .IP "\(bu" 4 @@ -2486,10 +2498,10 @@ type mediumint to integer drop typemod type integer to integer drop typemod . .IP "\(bu" 4 -type float to float drop typemod +type bigint to bigint drop typemod . .IP "\(bu" 4 -type bigint to bigint drop typemod +type float to float drop typemod . .IP "\(bu" 4 type double to double precision drop typemod diff --git a/pgloader.1.md b/pgloader.1.md index 1a4778c..a0318e0 100644 --- a/pgloader.1.md +++ b/pgloader.1.md @@ -2081,12 +2081,18 @@ Numbers: - type tinyint to boolean when (= 1 precision) using tinyint-to-boolean + - type tinyint when unsigned to smallint drop typemod + - type smallint when unsigned to integer drop typemod + - type mediumint when unsigned to integer drop typemod + - type integer when unsigned to bigint drop typemod + - type tinyint to smallint drop typemod - type smallint to smallint drop typemod - type mediumint to integer drop typemod - type integer to integer drop typemod - - type float to float drop typemod - type bigint to bigint drop typemod + + - type float to float drop typemod - type double to double precision drop typemod - type numeric to numeric keep typemod diff --git a/src/sources/mysql/mysql-cast-rules.lisp b/src/sources/mysql/mysql-cast-rules.lisp index af5ed4c..cb4fa3d 100644 --- a/src/sources/mysql/mysql-cast-rules.lisp +++ b/src/sources/mysql/mysql-cast-rules.lisp @@ -45,6 +45,16 @@ (:source (:type "bigint" :typemod (< 19 precision)) :target (:type "numeric" :drop-typemod t)) + ;; now unsigned types + (:source (:type "tinyint" :unsigned t) + :target (:type "smallint" :drop-typemod t)) + (:source (:type "smallint" :unsigned t) + :target (:type "integer" :drop-typemod t)) + (:source (:type "mediumint" :unsigned t) + :target (:type "integer" :drop-typemod t)) + (:source (:type "integer" :unsigned t) + :target (:type "bigint" :drop-typemod t)) + ;; we need the following to benefit from :drop-typemod (:source (:type "tinyint") :target (:type "smallint" :drop-typemod t)) (:source (:type "smallint") :target (:type "smallint" :drop-typemod t))