Posted about 8 years ago by Henning Koch.

...AJAX request completes before launching the debugger. A starved server thread can cause unexpected MySQL deadlocks. E.g. your test triggers a server request, locks some rows (MySQL automatically locks rows...

...starves the server thread. If you now run a query on the locked table, MySQL will explode with a detected deadlock. Again you need to wait_until the AJAX request...

Posted over 8 years ago by Andreas Robecke.

Active Record's select method allows you to make use of the power of MySQL select statements. On the one hand it allows you to select specific fields. Post.select("content...

...allows you to include additional data in your models such as the results of MySQL functions. Those function resulst then are accessible like any other attribute of your model. Lets...

Posted over 10 years ago by Dominik Schöler.

...get this error message Couldn't create database for {"encoding"=>"utf8", "username"=>"root", "adapter"=>"mysql", "database"=>"project_development", "password"=>"topsecret"}, charset: utf8, collation: utf8_unicode_ci (if you set the...

...make sure the user you have specified (root/topsecret) in your database.yml has access to MySQL. You can check this by running mysql -uroot -p...

Posted over 5 years ago by Henning Koch. github.com

...versions (e.g. Ruby 2.1.8, Ruby 2.3.1). Test one codebase against multiple database types (currently MySQL or PostgreSQL). Compute a matrix of all possible dependency permutations (Ruby, gem set, database type...

...does not work with Ruby 2.1). Let developers enter their local credentials for MySQL and PostgreSQL in a database.yml file. Define default Ruby version, gem dependencies and database for developers...

Posted over 5 years ago by Henning Koch. github.com

...s query parsing and LIKE query functionality. Minidusen can no longer index text in MySQL FULLTEXT columns, which was hardly used and didn't always help performance due to the...

...cost of reindexing. Minidusen is currently compatible with MySQL, PostgreSQL, Rails 3.2, Rails 4.2 and Rails 5.0. Basic Usage Our example will be a simple address book: class Contact < ActiveRecord...

Posted almost 8 years ago by Henning Koch.

You might have a table without a primary key set in MySQL. You can fix this by adding a primary key index to the guilty MySQL table, or by setting...

Posted about 10 years ago by Arne Hartherz.

...can lead to NULL distances in edge cases. The reason for this is that MySQL is performing several sine and cosine computations which can result in slight rounding errors – which...

...to compute the arc cosine of a result like 1.0000000001. Since this is undefined, MySQL correctly returns NULL (instead of the expected distance of 0 for the circle's center...

Posted almost 9 years ago by Andreas Robecke.

Be careful with the Active Record where method. When you accidentally pass an empty array to the where method using...

Posted over 5 years ago by Arne Hartherz. guides.rubyonrails.org

...will resemble your database's EXPLAIN style. For example, it looks like this on MySQL: User.where(id: 1).includes(:articles).explain EXPLAIN for: SELECT `users`.* FROM `users`  WHERE `users`.`id...

Posted almost 10 years ago by Henning Koch.

...invoice.products # => [# ] How the :uniq option works In the example above it changes the MySQL query for Invoice#products to something like SELECT DISTINCT * FROM products ... Issues with PostgreSQL

Posted over 5 years ago by Tobias Kraze.

PostgreSQL, unlike MySQL, treats strings as case sensitive in all circumstances. This includes comparison with = and LIKE collision detection in unique indexes Usually this is fine, but some strings (like...

Posted almost 11 years ago by Henning Koch.

...mix dates and times incomparisons, mind to not compare datetimes with date ranges in MySQL. Visualisation 1. ------- ------- AAA AAA BBB BBB ------- ------- 2. ------- AAA B ------- 3. ------- A BBB ------- 4. ------- AAA

Posted almost 9 years ago by Arne Hartherz.

...because those times will also be converted using to_s(:db) and sent to MySQL. The database itself does not care about the (longer) value and just stores the date...

Posted about 5 years ago by Judith Roth. api.rubyonrails.org

...support nested transaction, this behaviour will be simulated with Savepoints (this is done for MySQL and Postgres). If a custom transaction lives inside another transaction, which we can not control...

Posted almost 11 years ago by Thomas Eisenbarth. wiki.debian.org

...not found", "Can't open file or directory", ...) after configuration changes, e.g. when changing MySQL's data directory. Remember to have a look at AppArmor's daemon configuration (usually at...

Posted almost 8 years ago by Henning Koch.

Like in any language, a FLOAT will eventually corrupt data due to rounding errors. Please use DECIMAL, which has well...

Posted over 9 years ago by Thomas Eisenbarth.

...wide mutex on something that is not a row, check out Simple database mutex (MySQL lock...

Posted over 4 years ago by Henning Koch.

This card compares patterns to store trees in a relation database like MySQL or PostgreSQL. Implementation examples are for the ActiveRecord ORM used with Ruby on Rails, but the techniques...

This website uses short-lived cookies to improve usability.
Accept or learn more