mirror of
https://github.com/dimitri/pgloader.git
synced 2025-08-11 16:57:00 +02:00
Default cast rules for MySQL's text types fixed, see #219
This commit is contained in:
parent
b4bfa18877
commit
3a55d80411
@ -92,14 +92,18 @@
|
|||||||
:target (:type "decimal" :drop-typemod nil))
|
:target (:type "decimal" :drop-typemod nil))
|
||||||
|
|
||||||
;; the text based types
|
;; the text based types
|
||||||
(:source (:type "varchar") :target (:type "text"))
|
(:source (:type "tinytext") :target (:type "text") :using pgloader.transforms::remove-null-characters)
|
||||||
(:source (:type "tinytext") :target (:type "text"))
|
(:source (:type "text") :target (:type "text") :using pgloader.transforms::remove-null-characters)
|
||||||
(:source (:type "text") :target (:type "text"))
|
(:source (:type "mediumtext") :target (:type "text") :using pgloader.transforms::remove-null-characters)
|
||||||
(:source (:type "mediumtext") :target (:type "text"))
|
(:source (:type "longtext") :target (:type "text") :using pgloader.transforms::remove-null-characters)
|
||||||
(:source (:type "longtext") :target (:type "text"))
|
|
||||||
|
(:source (:type "varchar")
|
||||||
|
:target (:type "varchar" :drop-typemod nil)
|
||||||
|
:using pgloader.transforms::remove-null-characters)
|
||||||
|
|
||||||
(:source (:type "char")
|
(:source (:type "char")
|
||||||
:target (:type "varchar" :drop-typemod nil))
|
:target (:type "char" :drop-typemod nil)
|
||||||
|
:using pgloader.transforms::remove-null-characters)
|
||||||
|
|
||||||
;;
|
;;
|
||||||
;; cl-mysql returns binary values as a simple-array of bytes (as in
|
;; cl-mysql returns binary values as a simple-array of bytes (as in
|
||||||
|
@ -212,6 +212,11 @@
|
|||||||
(when string
|
(when string
|
||||||
(string-right-trim '(#\Space) string)))
|
(string-right-trim '(#\Space) string)))
|
||||||
|
|
||||||
|
(defun remove-null-characters (string)
|
||||||
|
"Remove NULL-characters (0x00) from STRING"
|
||||||
|
(when string
|
||||||
|
(remove #\Nul string)))
|
||||||
|
|
||||||
(defun byte-vector-to-bytea (vector)
|
(defun byte-vector-to-bytea (vector)
|
||||||
"Transform a simple array of unsigned bytes to the PostgreSQL bytea
|
"Transform a simple array of unsigned bytes to the PostgreSQL bytea
|
||||||
representation as documented at
|
representation as documented at
|
||||||
|
Loading…
Reference in New Issue
Block a user