/usr/lib/ruby/vendor_ruby/sequel/adapters/swift/mysql.rb is in ruby-sequel 3.33.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | Sequel.require 'adapters/shared/mysql'
module Sequel
module Swift
# Database and Dataset instance methods for MySQL specific
# support via Swift.
module MySQL
# Database instance methods for MySQL databases accessed via Swift.
module DatabaseMethods
include Sequel::MySQL::DatabaseMethods
private
# The database name for the given database.
def database_name
opts[:database]
end
# Consider tinyint(1) columns as boolean.
def schema_column_type(db_type)
db_type == 'tinyint(1)' ? :boolean : super
end
# By default, MySQL 'where id is null' selects the last inserted id.
# Turn that off unless explicitly enabled.
def setup_connection(conn)
super
sql = "SET SQL_AUTO_IS_NULL=0"
log_yield(sql){conn.execute(sql)} unless opts[:auto_is_null]
conn
end
end
# Dataset class for MySQL datasets accessed via Swift.
class Dataset < Swift::Dataset
include Sequel::MySQL::DatasetMethods
APOS = Dataset::APOS
# Use execute_insert to execute the replace_sql.
def replace(*args)
execute_insert(replace_sql(*args))
end
private
# Use Swift's escape method for quoting.
def literal_string_append(sql, s)
sql << APOS << db.synchronize{|c| c.escape(s)} << APOS
end
end
end
end
end
|