Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed an incompatibility issue with the jdbcmysql adapter that's used for JRuby apps #128

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion lib/lhm/table.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def initialize(table_name, connection)
def ddl
sql = "show create table `#{ @table_name }`"
specification = nil
@connection.execute(sql).each { |row| specification = row.last }
@connection.execute(sql).each { |row| specification = specification(row) }
specification
end

Expand Down Expand Up @@ -111,6 +111,14 @@ def extract_primary_key(schema)

keys.length == 1 ? keys.first : keys
end

def specification(row)
if row.is_a?(Array)
row.last
else
row["Create Table"]
end
end
end
end
end