mirror of
https://github.com/dimitri/pgloader.git
synced 2026-05-04 10:31:02 +02:00
Implement default unsigned casting rules for MySQL.
The following casting rules are now the default for MySQL: - 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 Fixes #678.
This commit is contained in:
parent
5c60f8c35c
commit
d69b72053a
16
pgloader.1
16
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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user