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
Merged

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

merged 1 commit into from
Nov 18, 2016

Conversation

alextes
Copy link
Contributor

@alextes 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 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
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
Copy link
Member

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 knex:master Nov 18, 2016
@elhigu
Copy link
Member

elhigu commented Nov 18, 2016

Thanks!

@alextes
Copy link
Contributor Author

alextes commented Nov 18, 2016

Happy to help! Thanks for great module!

@alextes alextes deleted the fix/unsafe-buffer-allocation branch November 18, 2016 11:13
elhigu pushed a commit to elhigu/knex that referenced this pull request Feb 15, 2017
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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DeprecationWarning: Using Buffer without new...
2 participants