Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use new safe buffer allocation to conform with deprecation of `new Buffer(size)` #1788

Merged
merged 1 commit into from Nov 18, 2016

Conversation

Projects
None yet
2 participants
@alextes
Copy link
Contributor

alextes commented Nov 17, 2016

Use of 'new Buffer' has been deprecated in node v6. This swaps the only
deprecated buffer creation in knex with a safe new way of doing allocation. It uses the
safe-buffer module to stay backwards compatible with node < v4. For the full story see here

I'd also be totally open to switching out the safe-buffer shim with a ponyfill.

The deprecated method of buffer creation concerns the oracle dialect. I tried to run the tests but failed to do so. If someone who can run the DB='oracle' npm test command would try it I'd be very grateful.

To be clear, this doesn't fix #1763. That issue is with knex' dependencies still. In particular node-postgres. However now that new Buffer(size) has also been deprecated this should be merged.

Use safe buffer allocation
Use of 'new Buffer' has been deprecated in node v6. This swaps the only
unsafe buffer allocation in knex with safe allocation. It uses the
safe-buffer module to stay backwards compatible with node < v6.
@alextes

This comment has been minimized.

Copy link
Contributor Author

alextes commented Nov 17, 2016

Locally the tests pass for me against the default db's. Also for node 0.12.7 . Since it concerns a timeout test (I'll carefully put the blame elsewhere and suggest) it might be the hardware difference?

@elhigu

This comment has been minimized.

Copy link
Collaborator

elhigu commented Nov 18, 2016

It was just some random failure. In travis some times DB queries are really slow... btw. CI does run oracle tests automatically with oracledb driver.

@elhigu elhigu merged commit fa48427 into tgriesser:master Nov 18, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@elhigu

This comment has been minimized.

Copy link
Collaborator

elhigu commented Nov 18, 2016

Thanks!

@alextes

This comment has been minimized.

Copy link
Contributor Author

alextes commented Nov 18, 2016

Happy to help! Thanks for great module!

@alextes alextes deleted the alextes:fix/unsafe-buffer-allocation branch Nov 18, 2016

elhigu added a commit to elhigu/knex that referenced this pull request Feb 15, 2017

Use safe buffer allocation (tgriesser#1788)
Use of 'new Buffer' has been deprecated in node v6. This swaps the only
unsafe buffer allocation in knex with safe allocation. It uses the
safe-buffer module to stay backwards compatible with node < v6.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.