Skip to content
GitLab
Next
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Primary navigation
Search or go to…
Project
GitLab
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Privacy statement
Keyboard shortcuts
?
What's new
4
Snippets
Groups
Projects
Show more breadcrumbs
GitLab.org
GitLab
Commits
51a8619a
Commit
51a8619a
authored
8 years ago
by
Robert Speicher
Browse files
Options
Downloads
Plain Diff
Merge branch '17356-remove-monkey_patch' into 'master'
Remove Rails monkey-patches now that we're using Rails 4.2.6 Closes
#17356
. See merge request
!4115
parents
56c8125e
94130133
No related branches found
No related tags found
1 merge request
!398
Sync 8-8-stable-ee to master
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
config/initializers/monkey_patch.rb
+0
-48
0 additions, 48 deletions
config/initializers/monkey_patch.rb
with
0 additions
and
48 deletions
config/initializers/monkey_patch.rb
deleted
100644 → 0
+
0
−
48
View file @
56c8125e
## This patch is from rails 4.2-stable. Remove it when 4.2.6 is released
## https://github.com/rails/rails/issues/21108
module
ActiveRecord
module
ConnectionAdapters
class
AbstractMysqlAdapter
<
AbstractAdapter
# SHOW VARIABLES LIKE 'name'
def
show_variable
(
name
)
variables
=
select_all
(
"select @@
#{
name
}
as 'Value'"
,
'SCHEMA'
)
variables
.
first
[
'Value'
]
unless
variables
.
empty?
rescue
ActiveRecord
::
StatementInvalid
nil
end
# MySQL is too stupid to create a temporary table for use subquery, so we have
# to give it some prompting in the form of a subsubquery. Ugh!
def
subquery_for
(
key
,
select
)
subsubselect
=
select
.
clone
subsubselect
.
projections
=
[
key
]
subselect
=
Arel
::
SelectManager
.
new
(
select
.
engine
)
subselect
.
project
Arel
.
sql
(
key
.
name
)
# Materialized subquery by adding distinct
# to work with MySQL 5.7.6 which sets optimizer_switch='derived_merge=on'
subselect
.
from
subsubselect
.
distinct
.
as
(
'__active_record_temp'
)
end
end
end
end
module
ActiveRecord
module
ConnectionAdapters
class
MysqlAdapter
<
AbstractMysqlAdapter
ADAPTER_NAME
=
'MySQL'
.
freeze
# Get the client encoding for this database
def
client_encoding
return
@client_encoding
if
@client_encoding
result
=
exec_query
(
"select @@character_set_client"
,
'SCHEMA'
)
@client_encoding
=
ENCODINGS
[
result
.
rows
.
last
.
last
]
end
end
end
end
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment