Make ToSql more thread safe. #51

Merged
merged 1 commit into from May 11, 2011

Conversation

Projects
None yet
3 participants

cee-dub commented May 10, 2011

Because the ToSql visitor instance is shared across all threads, there is a
race condition around column types for binary nodes. It's possible, for instance,
to end up with ActiveRecord converting a string value in the final SQL to an
integer during heavy concurrent operations.

Damon McCormick + Cameron Walters
Make ToSql more thread safe.
Because the ToSql visitor instance is shared across all threads, there is a
race condition around column types for binary nodes. It's possible, for instance,
to end up with ActiveRecord converting a string value in the final SQL to an
integer during heavy concurrent operations.

tenderlove added a commit that referenced this pull request May 11, 2011

Merge pull request #51 from square/thread-safety
Make ToSql more thread safe.

@tenderlove tenderlove merged commit ede507d into rails:master May 11, 2011

Thanks for the fix. I've started observing strings turn into integers for a number of my queries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment