不要怂,就是干,撸起袖子干!

Commit 8e602715 by Sushant Committed by Jan Aagaard Meier

BIGINT converted to strings when required (mysql) (#5905)

1 parent 02fb3faa
...@@ -5,7 +5,8 @@ ...@@ -5,7 +5,8 @@
- [CHANGED] Throw `bluebird.AggregateError` instead of array from `bulkCreate` when validation fails - [CHANGED] Throw `bluebird.AggregateError` instead of array from `bulkCreate` when validation fails
- [FIXED] `$notIn: []` is now converted to `NOT IN (NULL)` [#4859](https://github.com/sequelize/sequelize/issues/4859) - [FIXED] `$notIn: []` is now converted to `NOT IN (NULL)` [#4859](https://github.com/sequelize/sequelize/issues/4859)
- [FIXED] Add `raw` support to `instance.get()` [#5815](https://github.com/sequelize/sequelize/issues/5815) - [FIXED] Add `raw` support to `instance.get()` [#5815](https://github.com/sequelize/sequelize/issues/5815)
- [ADDED] Compare deletedAt against current timestamp when using paranoid [#5880](https://github.com/sequelize/sequelize/pull/5880) - [ADDED] Compare `deletedAt` against current timestamp when using paranoid [#5880](https://github.com/sequelize/sequelize/pull/5880)
- [FIXED] `BIGINT` gets truncated [#5176](https://github.com/sequelize/sequelize/issues/5176)
## BC breaks: ## BC breaks:
- `hookValidate` removed in favor of `validate` with `hooks: true | false`. `validate` returns a promise which is rejected if validation fails - `hookValidate` removed in favor of `validate` with `hooks: true | false`. `validate` returns a promise which is rejected if validation fails
...@@ -13,6 +14,7 @@ ...@@ -13,6 +14,7 @@
- Remove default dialect - Remove default dialect
- When `bulkCreate` is rejected because of validation failure it throws a `bluebird.AggregateError` instead of an array. This object is an array-like so length and index access will still work, but `instanceof` array will not - When `bulkCreate` is rejected because of validation failure it throws a `bluebird.AggregateError` instead of an array. This object is an array-like so length and index access will still work, but `instanceof` array will not
- `$notIn: []` will now match all rows instead of none - `$notIn: []` will now match all rows instead of none
- (MySQL) `BIGINT` now gets converted to string when number is too big
# 3.23.2 # 3.23.2
- [FIXED] Type validation now works with non-strings due to updated validator@5.0.0 [#5861](https://github.com/sequelize/sequelize/pull/5861) - [FIXED] Type validation now works with non-strings due to updated validator@5.0.0 [#5861](https://github.com/sequelize/sequelize/pull/5861)
......
...@@ -60,7 +60,9 @@ ConnectionManager.prototype.connect = function(config) { ...@@ -60,7 +60,9 @@ ConnectionManager.prototype.connect = function(config) {
password: config.password, password: config.password,
database: config.database, database: config.database,
timezone: self.sequelize.options.timezone, timezone: self.sequelize.options.timezone,
typeCast: ConnectionManager.$typecast.bind(self) typeCast: ConnectionManager.$typecast.bind(self),
bigNumberStrings: false,
supportBigNumbers: true
}; };
if (config.dialectOptions) { if (config.dialectOptions) {
......
...@@ -364,4 +364,26 @@ describe(Support.getTestDialectTeaser('DataTypes'), function() { ...@@ -364,4 +364,26 @@ describe(Support.getTestDialectTeaser('DataTypes'), function() {
}); });
} }
if (dialect === 'mysql') {
it('should parse BIGINT as string', function () {
var Model = this.sequelize.define('model', {
jewelPurity: Sequelize.BIGINT
});
var sampleData = {
id: 1,
jewelPurity: '9223372036854775807',
};
return Model.sync({ force: true }).then(function () {
return Model.create(sampleData);
}).then(function () {
return Model.find({id: 1});
}).then(function (user) {
expect(user.get('jewelPurity')).to.be.eql(sampleData.jewelPurity);
expect(user.get('jewelPurity')).to.be.string;
});
});
}
}); });
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!