Skip to content
Browse files

Support mysql2 in SQL queries.

  • Loading branch information...
1 parent 6dcd889 commit f74d0563a68ed4fb662ea0824ec443ad77387e09 @oggy oggy committed May 1, 2011
View
10 lib/rack/bug/views/panels/execute_sql.html.erb
@@ -13,8 +13,14 @@
<table class="sortable">
<thead>
<tr>
- <% result.fetch_fields.each do |field| %>
- <th><%= field.name.upcase %></th>
+ <% if defined?(Mysql2) %>
+ <% result.fields.each do |field| %>
+ <th><%= field.upcase %></th>
+ <% end %>
+ <% else %>
+ <% result.fetch_fields.each do |field| %>
+ <th><%= field.name.upcase %></th>
+ <% end %>
<% end %>
</tr>
</thead>
View
12 lib/rack/bug/views/panels/explain_sql.html.erb
@@ -13,10 +13,16 @@
<table class="sortable">
<thead>
<tr>
- <% result.fetch_fields.each do |field| %>
- <th><%= field.name.upcase %></th>
+ <% if defined?(Mysql2) %>
+ <% result.fields.each do |field| %>
+ <th><%= field.upcase %></th>
+ <% end %>
+ <% else %>
+ <% result.fetch_fields.each do |field| %>
+ <th><%= field.name.upcase %></th>
+ <% end %>
<% end %>
- </tr>
+ </tr>
</thead>
<tbody>
<% i = 1 %>
View
10 lib/rack/bug/views/panels/profile_sql.html.erb
@@ -13,8 +13,14 @@
<table class="sortable">
<thead>
<tr>
- <% result.fetch_fields.each do |field| %>
- <th><%= field.name.upcase %></th>
+ <% if defined?(Mysql2) %>
+ <% result.fields.each do |field| %>
+ <th><%= field.upcase %></th>
+ <% end %>
+ <% else %>
+ <% result.fetch_fields.each do |field| %>
+ <th><%= field.name.upcase %></th>
+ <% end %>
<% end %>
</tr>
</thead>

0 comments on commit f74d056

Please sign in to comment.
Something went wrong with that request. Please try again.