Changeset 3886
- Timestamp:
- 03/16/06 03:00:27 (3 years ago)
- Files:
-
- trunk/activerecord/CHANGELOG (modified) (1 diff)
- trunk/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/activerecord/CHANGELOG
r3882 r3886 106 106 * Documentation fixes for :dependent [robby@planetargon.com] 107 107 108 * Stop the MySQL adapter crashing when views are present. #3782 [Jonathan Viney] 109 108 110 * Allow set_fixture_class to take Classes instead of strings for a class in a module. Raise FixtureClassNotFound if a fixture can't load. [Rick Olson] 109 111 trunk/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
r3674 r3886 237 237 238 238 def structure_dump #:nodoc: 239 select_all("SHOW TABLES").inject("") do |structure, table| 239 if supports_views? 240 sql = "SHOW FULL TABLES WHERE Table_type = 'BASE TABLE'" 241 else 242 sql = "SHOW TABLES" 243 end 244 245 select_all(sql).inject("") do |structure, table| 246 table.delete('Table_type') 240 247 structure += select_one("SHOW CREATE TABLE #{table.to_a.first.last}")["Create Table"] + ";\n\n" 241 248 end … … 335 342 rows 336 343 end 344 345 def supports_views? 346 version[0] >= 5 347 end 348 349 def version 350 @version ||= @connection.server_info.scan(/^(\d+)\.(\d+)\.(\d+)/).flatten.map { |v| v.to_i } 351 end 337 352 end 338 353 end