Created
August 1, 2012 16:44
-
-
Save mbenedettini/3228630 to your computer and use it in GitHub Desktop.
Patio patch to fix default value detection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- /home/mariano/work/patio/lib/adapters/mysql.js 2012-07-31 17:14:08.146130970 -0300 | |
+++ ./node_modules/patio/lib/adapters/mysql.js 2012-08-01 13:39:14.631535958 -0300 | |
@@ -809,10 +809,16 @@ | |
ret.autoIncrement = e.match(/auto_increment/i) !== null; | |
ret.allowNull = allowNull.match(/Yes/i) !== null; | |
ret.primaryKey = key.match(/PRI/i) !== null; | |
- ret["default"] = row[m("Default")]; | |
- if (isEmpty(row["default"])) { | |
- row["default"] = null; | |
+ | |
+ // Default value | |
+ ret.default = row[m("Default")]; | |
+ if (isEmpty(ret.default)) { | |
+ ret.default = null; | |
} | |
+ else if(Buffer.isBuffer(ret.default)) { | |
+ ret.default = ret.default.toString(); | |
+ } | |
+ | |
ret.dbType = row[m("Type")]; | |
if (Buffer.isBuffer(ret.dbType)) { | |
//handle case for field type being returned at 252 (i.e. BLOB) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment