Populate the spid attribute on connect and reset it on disconnect for dblib.

This is useful for debugging client connections.
Add methods for sqlserver's productversion, productlevel, edition and include them in inspect.
Add activity_stats method that mimics the SQL Server Activity Monitor.
Pass AR tests by moving DISTINCT to GROUP BY in windowed SQL.

* Tests now passing.
  test_count_eager_with_has_many_and_limit_and_high_offset
  test_eager_with_has_many_and_limit_and_high_offset

* SQL like this:

  SELECT DISTINCT TOP (2) [__rnt].id
  FROM (
    SELECT ROW_NUMBER() OVER (ORDER BY [posts].[id] ASC) AS [__rn], [posts].id
    FROM [posts]
    LEFT OUTER JOIN [authors] ON [authors].[id] = [posts].[author_id]
    LEFT OUTER JOIN [comments] ON [comments].[post_id] = [posts].[id]
    WHERE (authors.name = N'David')
  ) AS [__rnt]
  WHERE [__rnt].[__rn] > (10)

  Now like this:

  SELECT TOP (2) [__rnt].id
  FROM (
    SELECT ROW_NUMBER() OVER (ORDER BY [posts].[id] ASC) AS [__rn], [posts].id
    FROM [posts]
    LEFT OUTER JOIN [authors] ON [authors].[id] = [posts].[author_id]
    LEFT OUTER JOIN [comments] ON [comments].[post_id] = [posts].[id]
    WHERE (authors.name = N'David')
    GROUP BY [posts].id
  ) AS [__rnt]
  WHERE [__rnt].[__rn] > (10)
Handle statements that cannot be retried on a new database connection by not reconnecting.

For example, retrying commit_db_transaction on a new connection would result in:
The COMMIT TRANSACTION request has no corresponding BEGIN TRANSACTION.: COMMIT TRANSACTION
Accept TEST_FILES env variable as a glob pattern to limit which test(s) are run.
Pass ActiveRecord tests. Made windowed distinct pass all orders to groups.

  * Tests passed
    test_limited_eager_with_multiple_order_columns
    test_limited_eager_with_order

  * Makes SQL like this:

    SELECT TOP (2) [__rnt].id
    FROM (
      SELECT ROW_NUMBER() OVER (ORDER BY UPPER(posts.title) ASC, posts.id ASC) AS [__rn], [posts].id
      FROM [posts]
      LEFT OUTER JOIN [authors] ON [authors].[id] = [posts].[author_id]
      LEFT OUTER JOIN [comments] ON [comments].[post_id] = [posts].[id]
      WHERE (authors.name = 'David')
      GROUP BY [posts].id
    ) AS [__rnt]
    WHERE [__rnt].[__rn] > (1)

    Look like this:

    SELECT TOP (2) [__rnt].id
    FROM (
      SELECT ROW_NUMBER() OVER (ORDER BY UPPER(posts.title) ASC, posts.id ASC) AS [__rn], [posts].id
      FROM [posts]
      LEFT OUTER JOIN [authors] ON [authors].[id] = [posts].[author_id]
      LEFT OUTER JOIN [comments] ON [comments].[post_id] = [posts].[id]
      WHERE (authors.name = 'David')
      GROUP BY UPPER(posts.title), [posts].id
    ) AS [__rnt]
    WHERE [__rnt].[__rn] > (1)
Merge pull request #144 from ManageIQ/add_spid

Populate the spid attribute on connect and reset it on disconnect for dblib
Merge pull request #145 from ManageIQ/detailed_database_version

Add methods for sqlserver's productversion, productlevel, edition and include them in inspect.
Merge pull request #146 from ManageIQ/activity_stats

Add activity_stats method that mimics the SQL Server Activity Monitor.
Merge pull request #147 from ManageIQ/no_retry_on_trans_ops

Handle statements that cannot be retried on a new database connection by not reconnecting.
Merge pull request #148 from ManageIQ/env_var_for_test_files

Accept TEST_FILES env variable as a glob pattern to limit which test(s) are run
Changelog all of Joe's work.
Don't hit the database on inspect and run the selects without retry and log blocks.
Set product_level, product_version, and edition where we get information about the database as opposed to the connection itself.
Handle deadlock victim (1205) exceptions outside of a transactions by retrying the query.
Add SQLServerAdapter.retry_deadlock_victim option to disable this handling.
Copied transaction method from rails 3-1-stable connection_adapters/abstract/database_statements.rb for adding in handling of deadlock victim exception.
Handle deadlock victim errors in the outermost transaction by skipping the rollback_db_transaction (since SQL Server issues it automatically) and retry the whole transaction if the retry_deadlock_victim flag is enabled (default).
Merge pull request #149 from ManageIQ/dont_hit_db_on_inspect

Don't hit the database on inspect and run the selects without retry and log blocks.
If retry_deadlock_victim flag is false, call the original transaction method, otherwise, call our version of the transcation method with deadlock_victim retry logic.