Skip to content

Commit efeffcc

Browse files
committed
Fixing explain not capturing queries for explain support, and updating change log.
1 parent 9329a3a commit efeffcc

File tree

3 files changed

+109
-69
lines changed

3 files changed

+109
-69
lines changed

CHANGELOG

Lines changed: 82 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
11

2+
* 3.2.13 *
3+
4+
* Fixed teo unit tests due to changes in ActiveRecord that removes blank config values.
5+
* Fixed explain tests that were failing due to changes in ExplainSubscriber, cause was regex
6+
* Fixed change_column to update existing table column rows with new default value if there are any NULL values
7+
and the column does not accept nulls
8+
* Fixed change_column to drop and add indexes if the colun type is changes
9+
* Fixed string_to_binary and binary_to_string in some cases where the binary data is not UTF-8
10+
* Fixing generating profile report to create output dir if needed, and code change for printing report
11+
* Adding ruby-prof to Gemfile, needed when running profile test cases
12+
* Updating mocha to work with newer ActiveRecord test cases
13+
14+
215
* 3.2.10 *
316

417
* Remove connection defaults for host/username/password. Since we want to suppoert Windows Authentication
@@ -67,7 +80,7 @@
6780

6881
* 3.2.0 *
6982

70-
* ActiveRecord explain (SHOWPLAN) support.
83+
* ActiveRecord explain (SHOWPLAN) support.
7184
http://youtu.be/ckb3YYZZZ2Q
7285

7386
* Remove our log_info_schema_queries config since we are not hooking properly into AR's 'SCHEMA' names.
@@ -86,7 +99,7 @@
8699

87100
* 3.1.4 *
88101

89-
* Use INFORMATION_SCHEMA.KEY_COLUMN_USAGE for schema reflection speed.
102+
* Use INFORMATION_SCHEMA.KEY_COLUMN_USAGE for schema reflection speed.
90103
Fixes #125. [Wüthrich Hannes @hwuethrich]
91104

92105
* New deadlock victim retry using the #retry_deadlock_victim config. [Jason Frey, Joe Rafaniello]
@@ -98,10 +111,10 @@
98111

99112
* Add methods for sqlserver's #product_version, #product_level, #edition and include them in inspect.
100113
Fixes #145 [Jason Frey, Joe Rafaniello]
101-
102-
* Handle statements that cannot be retried on a new database connection by not reconnecting.
114+
115+
* Handle statements that cannot be retried on a new database connection by not reconnecting.
103116
Fixes #147 [Jason Frey, Joe Rafaniello]
104-
117+
105118
* Added connection#spid for debugging. Fixes #144 [Jason Frey, Joe Rafaniello]
106119

107120
* Add ENV['TEST_FILES'] to Rakefile for easy single case tests. [Jason Frey, Joe Rafaniello]
@@ -117,7 +130,7 @@
117130

118131
* 3.1.3 *
119132

120-
* Distinguish between identity and primary key key columns during schema reflection. Allows us
133+
* Distinguish between identity and primary key key columns during schema reflection. Allows us
121134
us to only do identity inserts when technically needed. Fixes #139 [chadcf] & [joncanady]
122135

123136

@@ -138,7 +151,7 @@
138151

139152
* Make #rollback_db_transaction smarter.
140153

141-
* Provide a method to override for the quoted string prefix. Not a config because trumping this method will
154+
* Provide a method to override for the quoted string prefix. Not a config because trumping this method will
142155
have drastically bad results. Fixes #124
143156

144157
* Allow :limit/:offset to be used with fully qualified table and column in :select.
@@ -151,12 +164,12 @@
151164
* Make auto reconnect duration configurable. Fixes #109 [David Chelimsky]
152165

153166
* Quote most time objects to use ISO8601 format to be multi-language dateformat compatible. The [datetime] data type is
154-
automatically limited to milliseconds while [time] & [datetimeoffset] have full support. Even included a Date/Time
167+
automatically limited to milliseconds while [time] & [datetimeoffset] have full support. Even included a Date/Time
155168
ActiveSupport formatter that is used per the language settings of the connection.
156169

157170
* Include a visit_Arel_Nodes_UpdateStatement method in our Arel visitor to add a limit/top for update
158171
that has order and no limit/top. https://github.com/rails/rails/commit/787194ee43ab1fb0a7dc8bfbbfbd5079b047d833
159-
172+
160173
* Allow drop_database to be called even when DB does not exist.
161174

162175
* Remove totally broken ADONET connection mode. Want it back, submit a patch.
@@ -218,7 +231,7 @@
218231
* Support for ActiveRecord v3.0.3 and ARel v2.0.7
219232

220233

221-
* 3.0.7 *
234+
* 3.0.7 *
222235

223236
* Properly quote table names when reflecting on views.
224237

@@ -258,7 +271,7 @@
258271

259272
* 3.0.1
260273

261-
* Support DSN'less connections. Resolves ticket 38.
274+
* Support DSN'less connections. Resolves ticket 38.
262275

263276
* Support upcoming ruby odbc 0.99992
264277

@@ -289,14 +302,14 @@
289302

290303
* 2.3.5
291304

292-
* Initial IronRuby ADONET connection mode support baked right in. Removed most &block
293-
parameters, no handle/request object yielded anymore. Better abstraction and compliance
294-
per the ActiveRecord abstract adapter to not yielding handles for #execute and only for
295-
low level #select. Better wrapping of all queries at lowest level in #log so exceptions
296-
at anytime can be handled correctly by core AR. Critical for System::Data's command
297-
readers. Better abstraction for introspecting on #connection_mode. Added support for
305+
* Initial IronRuby ADONET connection mode support baked right in. Removed most &block
306+
parameters, no handle/request object yielded anymore. Better abstraction and compliance
307+
per the ActiveRecord abstract adapter to not yielding handles for #execute and only for
308+
low level #select. Better wrapping of all queries at lowest level in #log so exceptions
309+
at anytime can be handled correctly by core AR. Critical for System::Data's command
310+
readers. Better abstraction for introspecting on #connection_mode. Added support for
298311
running singular test cases via TextMate's Command-R. [Ken Collins]
299-
312+
300313
* Force a binary encoding on values coming in and out of those columns for ruby 1.9.
301314
Fixes ticket #33 [Jeroen Zwartepoorte]
302315

@@ -315,22 +328,22 @@
315328
* For tables that named with schema(ex. rails.users), they could not get length of column.
316329
column of varchar(40) gets length => nil. Ticket #27 & #15 [Ken Tachiya]
317330

318-
* Altered limited_update_conditions regex conditions, the .* would greedily fail
331+
* Altered limited_update_conditions regex conditions, the .* would greedily fail
319332
if the where_sql had WHERE in a table or field, etc. [Ransom Briggs]
320333

321-
* Changing test to allow ENV['ARUNIT_DB_NAME'] as the database name for the test units.
334+
* Changing test to allow ENV['ARUNIT_DB_NAME'] as the database name for the test units.
322335
Matches up with AR conventions. [Ransom Briggs]
323336

324337

325338
2.3.3
326-
327-
* Revert #ad83df82 and again cache column information at the connection's instance. The
339+
340+
* Revert #ad83df82 and again cache column information at the connection's instance. The
328341
previous commit was causing all sorts of view and schema reflection problems. [Ken Collins]
329342

330343

331344
2.3.2
332345

333-
* Insert queries that include the word "insert" as a partial column name with the word
346+
* Insert queries that include the word "insert" as a partial column name with the word
334347
"id" as a value were falsely being matched as identity inserts. [Sean Caffery/bfabry]
335348

336349
* Delegate all low level #raw_connection calls to #raw_connection_run and #raw_connection_do
@@ -348,10 +361,10 @@
348361
* Coerce a few tests that were failing in 2.3.x [Ken Collins]
349362

350363
* Change column/view cache to happen at class level. Allows connection pool to share same
351-
caches as well as the ability to expire the caches when needed. Also fix change_column so
364+
caches as well as the ability to expire the caches when needed. Also fix change_column so
352365
that exceptions are not raised when the column contains an existing default. [Ken Collins]
353366

354-
* Allow query_requires_identity_insert? method to return quoted table name in situations where the
367+
* Allow query_requires_identity_insert? method to return quoted table name in situations where the
355368
INSERT parts are not quoted themselves. [Gary/iawgens, Richard Penwell, Ken Collins]
356369

357370
* Fixed namespace in calling test_sqlserver_odbc within test_unicode_types. [Gary/iawgens]
@@ -363,7 +376,7 @@
363376

364377
* Support Identity-key-column judgement on multiple schema environment [Ken Tachiya]
365378

366-
* Add support for tinyint data types. In MySQL all these types would be boolean, however in
379+
* Add support for tinyint data types. In MySQL all these types would be boolean, however in
367380
our adapter, they will use the full 1 => 255 Fixnum value as you would expect. [Ken Collins]
368381

369382

@@ -381,10 +394,10 @@
381394

382395
* Implement a new remove_default_constraint method that uses sp_helpconstraint [Ken Collins]
383396

384-
* Use a lazy match in add_order_by_for_association_limiting! to allow sub selects to be used. Resolves
397+
* Use a lazy match in add_order_by_for_association_limiting! to allow sub selects to be used. Resolves
385398
ticket #11.
386399

387-
* Add default rake task back for testing. Runs the namespaced sqlserver:test_sqlserver_odbc.
400+
* Add default rake task back for testing. Runs the namespaced sqlserver:test_sqlserver_odbc.
388401
Resolves ticket #10 [Ken Collins]
389402

390403
* Default value detection in column_definitions is kinder to badly formatted, or long winded user
@@ -397,7 +410,7 @@
397410

398411
* Leave quoted column names as is. Resolves ticket #36 [Vince Puzzella]
399412

400-
* Changing add_limit! in ActiveRecord::Base for SQLServer so that it passes through any scoped :order
413+
* Changing add_limit! in ActiveRecord::Base for SQLServer so that it passes through any scoped :order
401414
parameters. Resolves ticket #35 [Murray Steele]
402415

403416

@@ -410,45 +423,45 @@
410423

411424
* 2.2.17 * (May 14th, 2009)
412425

413-
* Add simplified type recognition for varchar(max) and nvarchar(max) under SQL Server 2005 to be a
426+
* Add simplified type recognition for varchar(max) and nvarchar(max) under SQL Server 2005 to be a
414427
:text type. This ensures schema dumper does the right thing. Fixes ticket #30. [Ken Collins]
415428

416-
* Tested ruby 1.9, ruby-odbc 0.9996, and DBI 0.4.1. Also added correct support for UTF-8 character
417-
encoding going in and out of the DB. See before gist http://gist.github.com/111709 and after gist
429+
* Tested ruby 1.9, ruby-odbc 0.9996, and DBI 0.4.1. Also added correct support for UTF-8 character
430+
encoding going in and out of the DB. See before gist http://gist.github.com/111709 and after gist
418431
http://gist.github.com/111719 [Ken Collins]
419432

420433

421434
* 2.2.16 * (April 21st, 2009)
422435

423-
* Make add_limit_offset! only add locking hints (for tally) when the :lock option is present. Added tests
424-
to make sure tally SQL is augmented correctly and tests to make sure that add_lock! is doing what it needs
436+
* Make add_limit_offset! only add locking hints (for tally) when the :lock option is present. Added tests
437+
to make sure tally SQL is augmented correctly and tests to make sure that add_lock! is doing what it needs
425438
for deep sub selects in paginated results. [Ken Collins]
426439

427-
* Add auto reconnect support utilizing a new #with_auto_reconnect block. By default each query run through
428-
the adapter will automatically reconnect at standard intervals, logging attempts along the way, till success
429-
or the original exception bubbles up. See docs for more details. Resolves ticket #18 [Ken Collins]
440+
* Add auto reconnect support utilizing a new #with_auto_reconnect block. By default each query run through
441+
the adapter will automatically reconnect at standard intervals, logging attempts along the way, till success
442+
or the original exception bubbles up. See docs for more details. Resolves ticket #18 [Ken Collins]
430443

431-
* Update internal helper method #orders_and_dirs_set to cope with an order clause like "description desc". This
444+
* Update internal helper method #orders_and_dirs_set to cope with an order clause like "description desc". This
432445
resolves ticket #26 [Ken Collins]
433446

434-
* Provide support for running queries at different isolation levels using #run_with_isolation_level method
435-
that can take a block or not. Also implement a #user_options method that reflects on the current user
447+
* Provide support for running queries at different isolation levels using #run_with_isolation_level method
448+
that can take a block or not. Also implement a #user_options method that reflects on the current user
436449
session values. Resolves #20 [Murray Steele]
437450

438451

439452
* 2.2.15 * (March 23rd, 2009)
440453

441-
* Better add_lock! method that can add the lock to just about all the elements in the statement. This
442-
could be eager loaded associations, joins, etc. Done so that paginated results can easily add lock
443-
options for performance. Note, the tally count in add_limit_offset! use "WITH (NOLOCK)" explicitly
454+
* Better add_lock! method that can add the lock to just about all the elements in the statement. This
455+
could be eager loaded associations, joins, etc. Done so that paginated results can easily add lock
456+
options for performance. Note, the tally count in add_limit_offset! use "WITH (NOLOCK)" explicitly
444457
as it can not hurt and is needed. [Ken Collins]
445458

446459

447460
* 2.2.14 * (March 17th, 2009)
448461

449-
* Rails2.3 - Back passing tests on 2.2 work. Includes: (1) Created new test helpers that check ActiveRecord
450-
version strings so we can conditionally run 2.2 and 2.3 tests. (2) Making TransactionTestSqlserver use Ship vs
451-
Bird model. Also made it conditional run a few blocks for different versions of ActiveRecord. (3) Previous
462+
* Rails2.3 - Back passing tests on 2.2 work. Includes: (1) Created new test helpers that check ActiveRecord
463+
version strings so we can conditionally run 2.2 and 2.3 tests. (2) Making TransactionTestSqlserver use Ship vs
464+
Bird model. Also made it conditional run a few blocks for different versions of ActiveRecord. (3) Previous
452465
JoinDependency#aliased_table_name_for is now only patched in ActiveRecord equal or greater than 2.3. [Ken Collins]
453466

454467
* Rails2.3 - Implement new savepoint support [Ken Collins]
@@ -460,24 +473,24 @@
460473
* Rails2.3 - Implement a custom ActiveRecord::Associations::ClassMethods::JoinDependency::JoinAssociation#aliased_table_name_for
461474
method that uses a Regexp.escape so that table/column quoting does not get ignored. [Ken Collins]
462475

463-
* Rails2.3 - Implement #outside_transaction? and a new transaction test case to test some SQL Server
476+
* Rails2.3 - Implement #outside_transaction? and a new transaction test case to test some SQL Server
464477
basic support while implementing this method. Future home of some savepoint tests too. [Ken Collins]
465478

466-
* Rails2.3 - Coerced tests that ensure hash conditions on referenced tables are considered when eager
479+
* Rails2.3 - Coerced tests that ensure hash conditions on referenced tables are considered when eager
467480
loading with limit/offset. Information on these changes and the ticket in rails are.
468481
http://github.com/rails/rails/commit/9a4d557713acb0fc8e80f61af18094034aca029a
469482
http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/1404-conditions_tables-doesnt-understand-condition-hashes
470483

471484
* Rails2.3 - Add coerced tests for true/false attributes in selects use SQL Server case statement. [Ken Collins]
472485

473-
* Making sure that smalldatetime types are OK to use. Also fixed a bug in the #view_information method that
474-
checks to see if a view definition is equal to 4000 chars, meaning that it is most likely truncated and
486+
* Making sure that smalldatetime types are OK to use. Also fixed a bug in the #view_information method that
487+
checks to see if a view definition is equal to 4000 chars, meaning that it is most likely truncated and
475488
needs to use the backup method of sp_helptext to get it's view definition. [Ken Collins]
476489

477490

478491
* 2.2.13 * (February 10th, 2009)
479492

480-
* Update #indexes to use unqualified table name. Fixes cases where users may decide to use table
493+
* Update #indexes to use unqualified table name. Fixes cases where users may decide to use table
481494
name prefixes like 'dbo.'. [Ken Collins]
482495

483496

@@ -493,11 +506,11 @@
493506

494507
* 2.2.9 * (January 22nd, 2009)
495508

496-
* Fixing a small bug in the deprecated DBI::Timestamp conversion so it correctly converts nanosecond whole
497-
numbers to back to pre type cast SQL Server milliseconds, ultimately allow ruby's Time#usec which is
509+
* Fixing a small bug in the deprecated DBI::Timestamp conversion so it correctly converts nanosecond whole
510+
numbers to back to pre type cast SQL Server milliseconds, ultimately allow ruby's Time#usec which is
498511
microseconds to be correct. [Ken Collins]
499-
500-
* Sometimes views are more than 4000 chars long and will return NULL for the VIEW_DEFINITION. If so, use
512+
513+
* Sometimes views are more than 4000 chars long and will return NULL for the VIEW_DEFINITION. If so, use
501514
sp_helptext procedure as a backup method. [Ken Collins]
502515

503516

@@ -508,13 +521,13 @@
508521

509522
* 2.2.7 (January 9th, 2009)
510523

511-
* Created a connection#execute_procedure method that takes can take any number of ruby objects as variables
512-
and quotes them according to the connection's rules. Also added an ActiveRecord::Base class level core
513-
extension that hooks into this. It also checks if the connection responds to #execute_procedure and if
524+
* Created a connection#execute_procedure method that takes can take any number of ruby objects as variables
525+
and quotes them according to the connection's rules. Also added an ActiveRecord::Base class level core
526+
extension that hooks into this. It also checks if the connection responds to #execute_procedure and if
514527
not returns an empty array. [Ken Collins]
515528

516-
* Added a #enable_default_unicode_types class attribute access to make all new added or changed string types
517-
like :string/:text default to unicode/national data types. See the README for full details. Added a rake
529+
* Added a #enable_default_unicode_types class attribute access to make all new added or changed string types
530+
like :string/:text default to unicode/national data types. See the README for full details. Added a rake
518531
task that assists setting this to true when running tests. [Ken Collins]
519532

520533

@@ -525,15 +538,15 @@
525538

526539
* 2.2.5 (January 4th, 2009)
527540

528-
* Added a log_info_schema_queries class attribute and make all queries to INFORMATION_SCHEMA silent by
541+
* Added a log_info_schema_queries class attribute and make all queries to INFORMATION_SCHEMA silent by
529542
default. [Ken Collins]
530543

531544
* Fix millisecond support in datetime columns. ODBC::Timestamp incorrectly takes SQL Server milliseconds
532-
and applies them as nanoseconds. We cope with this at the DBI layer by using SQLServerDBI::Type::SqlserverTimestamp
533-
class to parse the before type cast value appropriately. Also update the adapters #quoted_date method
545+
and applies them as nanoseconds. We cope with this at the DBI layer by using SQLServerDBI::Type::SqlserverTimestamp
546+
class to parse the before type cast value appropriately. Also update the adapters #quoted_date method
534547
to work more simply by converting ruby's #usec milliseconds to SQL Server microseconds. [Ken Collins]
535548

536-
* Core extensions for ActiveRecord now reflect on the connection before doing SQL Server things. Now
549+
* Core extensions for ActiveRecord now reflect on the connection before doing SQL Server things. Now
537550
this adapter is compatible for using with other adapters. [Ken Collins]
538551

539552

@@ -544,9 +557,9 @@
544557

545558
* 2.2.3 (December 5th, 2008)
546559

547-
* Changing back to using real table name in column_definitions. Makes sure views get back only the columns
548-
that are defined for them with correct names, etc. Now supporting views by looking for NULL default and
549-
then if table name is a view, perform a targeted with sub select to the real table name and column name
560+
* Changing back to using real table name in column_definitions. Makes sure views get back only the columns
561+
that are defined for them with correct names, etc. Now supporting views by looking for NULL default and
562+
then if table name is a view, perform a targeted with sub select to the real table name and column name
550563
to find true default. [Ken Collins]
551564

552565
* Ensure that add_limit_offset! does not alter sub queries. [Erik Bryn]
@@ -561,10 +574,10 @@
561574

562575
2.2.1 (November 25th, 2008)
563576

564-
* Add identity insert support for views. Cache #views so that identity #table_name_or_views_table_name
577+
* Add identity insert support for views. Cache #views so that identity #table_name_or_views_table_name
565578
will run quickly. [Ken Collins]
566579

567-
* Add views support. ActiveRecord classes can use views. The connection now has a #views method and
580+
* Add views support. ActiveRecord classes can use views. The connection now has a #views method and
568581
#table_exists? will now fall back to checking views too. [Ken Collins]
569582

570583

0 commit comments

Comments
 (0)