aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb
Commit message (Collapse)AuthorAgeFilesLines
* Add support for FULLTEXT and SPATIAL indexes using the :type flag for MySQL.Ken Mazaika2013-03-271-2/+8
|
* Merge pull request #9928 from vipulnsward/fix_rename_auto_increment_mysqlRafael Mendonça França2013-03-261-6/+7
|\ | | | | respect auto_increment in rename_column for mysql
| * respect auto_increment in rename_column for mysqlVipul A M2013-03-271-6/+7
| |
* | Adds support for concurrent indexing in PostgreSQL adapterDan McClain2013-03-251-6/+6
|/ | | | | | | | Adds support for algorithm option in MySQL indexes Moves USING and algorithm options upstream The syntax is still specific to the Adapter, so the actual executed string happens in the corresponding adapter
* Created a layer of abstraction for the valid type checking in schema dumper. ↵Ranjay Krishna2013-03-251-0/+4
| | | | Now, connection handles the check for valid types so that each database can handle the changes individually.
* Custom index type support with :using.doabit2013-03-241-0/+10
|
* push the mysql add_column up to the abstract adapterAaron Patterson2013-03-221-4/+21
|
* Unprepared Visitor + unprepared_statementCédric FABIANSKI2013-03-081-1/+1
|
* `Connection#structure_dump` is no longer used. #9518Yves Senn2013-03-061-14/+0
| | | | | | | As of ccc6910c we use `mysqldump` to create the `structure.sql`. The old `#structure_dump` code is still in AR but never used. I removed all relevant parts from the code-base.
* Revert "Merge pull request #9207 from dylanahsmith/mysql-quote-numeric"Steve Klabnik2013-02-271-0/+2
| | | | | This reverts commit 408227d9c5ed7de26310d72a1a99c1ee02311c63, reversing changes made to dca0b57d03deffc933763482e615c3cf0b9a1d97.
* Do not type cast all the database url values.Rafael Mendonça França2013-02-241-4/+4
| | | | | | We should only type cast when we need to use. Related to 4b005fb371c2e7af80df7da63be94509b1db038c
* also rename indexes when a table or column is renamedYves Senn2013-02-201-0/+2
| | | | When a table or a column is renamed related indexes kept their name. This will lead to confusing names. This patch renames related indexes when a column or a table is renamed. Only indexes with names generated by rails will be renamed. Indexes with custom names will not be renamed.
* Remove valid_type? methodJon Leighton2013-02-151-4/+0
| | | | | It was supposed to be removed by the preceding two reversions but I did them in the wrong order.
* Revert "Make valid_type? public"Jon Leighton2013-02-151-4/+4
| | | | | | This reverts commit 5d528f835e871f5f9d4b68e8a81cfbe900b7e718. Relates to f8c8ad5 which is also getting reverted due to failing test.
* Make valid_type? publicSam Ruby2013-02-141-4/+4
|
* Merge pull request #9204 from ranjaykrishna/col-probAaron Patterson2013-02-121-0/+3
|\ | | | | schema dumper tests now conducted by ActiveRecord::Base.Connection
| * checking in the abstractions for valid type checking:Ranjay Krishna2013-02-121-0/+3
| |
* | active_record: Quote numeric values compared to string columns.Dylan Smith2013-02-071-2/+0
|/
* small refactoring, added blob_or_text_colum? in AbstractMysqlAdapterAngelo Capilleri2012-12-281-2/+6
|
* Fixes for PR [#8267]Marc-Andre Lafortune2012-12-221-3/+6
| | | | | | | | * Fix Migration#reversible by not using `transaction`. * Adapt mysql adapter to updated api for remove_column * Update test after aedcd683684d08eaf30623a4b48ce31a31426372
* Session variables for mysql, mysql2, and postgresql adapters can be setAaron Stone2012-12-081-0/+39
| | | | | | | | | in the new 'variables:' hash in each database config section in database.yml. The key-value pairs of this hash will be sent in a 'SET key = value, ...' query on new database connections. The configure_connection methods from mysql and mysql2 into are consolidated into the abstract_mysql base class.
* Merge branch 'master' of github.com:lifo/docrailsVijay Dev2012-11-031-2/+2
|\ | | | | | | | | | | | | Conflicts: actionpack/lib/action_controller/metal/mime_responds.rb activerecord/lib/active_record/attribute_methods.rb guides/source/working_with_javascript_in_rails.md
| * Migration of docs to 1.9 hash syntaxAvnerCohen2012-10-231-2/+2
| |
* | Use the MySQL varbinary type when appropriate in migrations.Victor Costan2012-10-271-0/+7
|/
* The default value of a text/blob in mysql strict mode should be nilJon Leighton2012-10-191-8/+10
| | | | | | | | | In non-strict mode it is '', but if someone is in strict mode then we should honour the strict semantics. Also, this removes the need for a completely horrible hack in dirty.rb. Closes #7780
* Revert "Use flat_map { } instead of map {}.flatten"Santiago Pastorino2012-10-051-2/+2
| | | | | | | | | | | This reverts commit abf8de85519141496a6773310964ec03f6106f3f. We should take a deeper look to those cases flat_map doesn't do deep flattening. irb(main):002:0> [[[1,3], [1,2]]].map{|i| i}.flatten => [1, 3, 1, 2] irb(main):003:0> [[[1,3], [1,2]]].flat_map{|i| i} => [[1, 3], [1, 2]]
* Use flat_map { } instead of map {}.flattenSantiago Pastorino2012-10-051-2/+2
|
* Support for partial inserts.Jon Leighton2012-09-281-0/+8
| | | | | | | | | | | When inserting new records, only the fields which have been changed from the defaults will actually be included in the INSERT statement. The other fields will be populated by the database. This is more efficient, and also means that it will be safe to remove database columns without getting subsequent errors in running app processes (so long as the code in those processes doesn't contain any references to the removed column).
* Support for specifying transaction isolation levelJon Leighton2012-09-211-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If your database supports setting the isolation level for a transaction, you can set it like so: Post.transaction(isolation: :serializable) do # ... end Valid isolation levels are: * `:read_uncommitted` * `:read_committed` * `:repeatable_read` * `:serializable` You should consult the documentation for your database to understand the semantics of these different levels: * http://www.postgresql.org/docs/9.1/static/transaction-iso.html * https://dev.mysql.com/doc/refman/5.0/en/set-transaction.html An `ActiveRecord::TransactionIsolationError` will be raised if: * The adapter does not support setting the isolation level * You are joining an existing open transaction * You are creating a nested (savepoint) transaction The mysql, mysql2 and postgresql adapters support setting the transaction isolation level. However, support is disabled for mysql versions below 5, because they are affected by a bug (http://bugs.mysql.com/bug.php?id=39170) which means the isolation level gets persisted outside the transaction.
* load active_support/core_ext/object/blank in active_support/railsXavier Noria2012-08-021-1/+0
|
* Fixing texts; down to three failing tests.Jeremy Cole2012-07-131-1/+1
| | | | | Conflicts: activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb
* fix: limit of enum columns of mysqlYamada Masaki2012-06-281-0/+2
|
* Avoid unnecessary catching of Exception instead of StandardError.Dylan Smith2012-06-171-3/+3
|
* Fix logs name consistency.kennyj2012-05-191-4/+4
|
* missplelling error in abstract_mysql_adapterAngelo Capilleri2012-05-121-1/+1
|
* be sure to currectly fetch PK name from MySQL even if the PK has some custom ↵Akira Matsuda2012-04-191-1/+1
| | | | option
* Fix delete_all when chained with joins.Rafael Mendonça França2012-04-101-11/+13
| | | | Closes #5202 and #919
* Merge pull request #4843 from seamusabshere/patch-1Xavier Noria2012-03-281-1/+1
|\ | | | | Possibly clearer way of getting rid of ` and "
| * thanks to @jurriaanSeamus Abshere2012-02-141-1/+1
| |
| * Possibly clearer way of getting rid of ` and " Seamus Abshere2012-02-011-1/+1
| | | | | | | | | | | | | | | | Incidentally it's also faster... >> a = 'hello "id` world'; Benchmark.realtime { 500_000.times { a.tr('`"', "") } } => 0.7388770580291748 >> a = 'hello "id` world'; Benchmark.realtime { 500_000.times { a.gsub(/[`"]/, "") } } => 1.7843739986419678
* | Fix GH #3163. Should quote database on mysql/mysql2.kennyj2012-03-051-1/+1
| |
* | Fix type_to_sql with text and limit on mysql/mysql2. Fix GH #3931.kennyj2012-02-261-9/+20
| |
* | prepared statements can be disabledAaron Patterson2012-02-211-1/+11
| |
* | more ruby 2.0 respond_to? changesAaron Patterson2012-02-211-1/+1
| |
* | Remove useless argument in #columns.Sebastian Martinez2012-02-021-1/+1
|/
* Fix GH #4754. Remove double-quote when using ANSI_QUOTESkennyj2012-01-311-1/+1
|
* Handle nil in add_index :length option in MySQLPaul Sadauskas2012-01-241-1/+1
| | | | | | | | | | | | | | | | | Our schema.rb is being generated with an `add_index` line similar to this: add_index "foo", ["foo", "bar"], :name => "xxx", :length => {"foo"=>8, "bar=>nil} This is the same as it was on Rails 3.1.3, however, now when that schema.rb is evaluated, its generating bad SQL in MySQL: Mysql::Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '))' at line 1: CREATE UNIQUE INDEX `xxx` ON `foo` (`foo`(8), `bar`()) This commit adds a check for nil on the length attribute to prevent the empty parens from being output.
* Revert naive O(1) table_exists? implementation.Jon Leighton2011-12-131-5/+8
| | | | | | | | | | It was a bad idea to rescue exceptions here. This can interfere with transaction rollbacks which seems to be the cause of current CI failure. Instead, each adapter should implement its own DB-specific O(1) implementation, and we fall back on the generic, slower, implementation otherwise.
* Use show create table.kennyj2011-12-031-3/+8
|
* implements automatic EXPLAIN logging for slow queriesXavier Noria2011-12-021-74/+0
|