dataset/query.rb : Fix an error in filter documentation

There was an error in filter documentation example : (1,2,3) was used instead of [1,2,3]
Remove :size and :unsigned options documentation (Fixes #483)

These only work with the specific type support, and their usage
is discouraged in new code.  They will still work in perpetuity
when using specific types, so old migrations are not broken.
Update RDoc in tinytds adapter
Don't set Sequel::Model.db automatically when creating an anonymous class with an associated database object

This change fixes the case where a library wants to create model
classes, but not have Sequel::Model.db set.  Libraries that
create model classes but don't want to modify Sequel::Model.db
should do something like:

  module Library
    Sequel.connect('...') do |db|
      class Foo < Sequel::Model(db[:foos])
      end
    end
  end

Before, the first time Sequel::Model was subclassed, it would
eagerly set the @db instance variable.  Now, that eager setting
is only attempted when creating a named subclass of a model
without a dataset.
Apply :timeout MySQL connection setting on do, jdbc, and swift adapters

This makes the connection setting SQLs consitent across adapters.
As the adapters already implemented the auto_is_null (do internally
the jdbc and swift separately) setting, the only visible effect is
now that the :timeout setting sets the wait_timeout connection
attribute on these adapters.
Fix some RDoc related to default_schema
Support :sql_mode option when connecting to MySQL

MySQL supports numerous SQL modes that change MySQL's syntax and
semantics.  In many ways, enabling a non default mode fixes MySQL's
bad default behavior.

For backwards compatibility, I'm not going to set an sql_mode
by default.  I encourage MySQL users to read the MySQL
documentation and pick an appropriate sql_mode, hopefully one of
the strict modes.

The mysql adapter and integration tests pass without problems using
:sql_mode => :strict_trans_tables.
Make Database#transaction on PostgreSQL accept a :synchronous option to change synchronous_commit setting for that transaction

The synchronous_commit setting is per transaction and allows granular
control for determining when the transaction is considered committed.
The default setting waits until it is stored on disk on both the
current database and any slave databases.  You can set it to
:off or false to return before the transaction has been safely
committed to disk, which improves performance at the expense of
durability.  Newer versions of PostgreSQL also support :local and
:remote_write, read the PostgreSQL documentation for more details
on those settings.
Support more creating/drop index options on PostgreSQL

This supports :concurrently for creating and dropping indexes,
and :if_exists and :cascade for dropping indexes.  All of these
except dropping indexes concurrently have been supported since
8.2.  Dropping indexes concurrently wasn't added until 9.2 (which
is still in beta).
Refactor postgres adapter Database#execute internals
Support :each when preparing statements, useful for iterating over large datasets

Before, only :select and :all were supported, which load the entire
dataset in memory.  On adapters that can use Dataset#each without
loading the entire result set in memory, using :each for pure
iteration should result in better performance.

While here, I discovered a bug that Database#call did not pass the
block it was given.  This could cause unexpected behavior, since
the block would not be called but results would still be returned.
That's because for other prepared statement types, a block is
optional.  For each it is required, which is how I discovered the
bug.
Document some adapter-specific options in the main RDoc

In general, the methods that are overridden to add support for
these options are private, and Sequel doesn't publish RDoc for
private methods.  It also makes sense to document the options
on the methods where the options will be used.
Support partial indexes on Microsoft SQL Server

SQL Server 2008 enables support for partial indexes (which are
referred to as filtered indexes in Microsoft's documentation).
Update CHANGELOG
Fix possible threading issue in a spec

The previous code is wrong in that t1 is not guaranteed to have
exited.  t2 is required to still be alive, though.  So just
join the thread instead of checking that it is dead.
Fix integration test on JRuby 1.7

In JRuby 1.7, java.lang.Exception objects do not descend from
Exception, which broke this spec.  It seems very odd to me, but
this is going to be JRuby's documented behavior going forward,
so the spec should be adjusted.
In the optimistic locking plugin, make refresh and save after a failed save work correctly

Before, since instance filters were only cleared after a successful
save, if you rescued the error raised by save, refreshed and then
saved, it would add the lock column filter twice, once with the
old value and one with the new value.

The simplest way to fix this is just to make refreshing clear
the instance filters, since saving will add the correct one
back.

Note that this potentially could skip the instance filter if you
refreshed your model in a before_update after the instance filter
was added.  I doubt anyone would do that.
Fix incorrect spec description
Add pg_json extension, for working with PostgreSQL 9.2's new json type

This is modeled on the pg_hstore and pg_array extensions, using
the same DelegateClass approach.

It does not currently support plain numbers or strings in a json
column, which PostgreSQL supports.  Support for that could
be added later if there is demand, just be adding custom parsers
and more DelegateClasses.  However, I think PostgreSQL is wrong
in the this case and it shouldn't be accepting those values,
which is why the extension doesn't currently support it.  Another
reason is that typecasting from a string would then be ambiguous,
since you wouldn't know whether it was literal JSON that should
be parsed, or represented a plain string that should be wrapped
in a DelegateClass.
Give better error message for bad JDBC URL usage

At least on PostgreSQL, if you use a bad JDBC URL string,
driver.new.connect can return nil in this case.  You would
get an error later inside setup_connection, but it's better
to raise the error earlier.