Skip to content
This repository has been archived by the owner on Oct 22, 2021. It is now read-only.

Commit

Permalink
Merge CouchDB 1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Newson committed Jun 13, 2011
2 parents 266ba88 + 3c1a0d7 commit e9a5a6f
Show file tree
Hide file tree
Showing 110 changed files with 5,998 additions and 1,486 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
*.so *.so
*.Tpo *.Tpo
*.beam *.beam
*~
*.orig
*.rej
erl_crash.dump erl_crash.dump


# building # building
Expand Down
2 changes: 1 addition & 1 deletion apps/couch/AUTHORS
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ documentation or developing software. Some of these people are:
* Mark Hammond <mhammond@skippinet.com.au> * Mark Hammond <mhammond@skippinet.com.au>
* Benoît Chesneau <benoitc@apache.org> * Benoît Chesneau <benoitc@apache.org>
* Filipe Manana <fdmanana@apache.org> * Filipe Manana <fdmanana@apache.org>
* Robert Newson <robert.newson@gmail.com> * Robert Newson <rnewson@apache.org>


For a list of other credits see the `THANKS` file. For a list of other credits see the `THANKS` file.
60 changes: 60 additions & 0 deletions apps/couch/CHANGES
Original file line number Original file line Diff line number Diff line change
@@ -1,6 +1,66 @@
Apache CouchDB CHANGES Apache CouchDB CHANGES
====================== ======================


Version 1.1.1
-------------

This version has not been released yet.

Version 1.1.0
-------------

All CHANGES for 1.0.2 and 1.0.3 also apply to 1.1.0.

HTTP Interface:

* Native SSL support.
* Added support for HTTP range requests for attachments.
* Added built-in filters for `_changes`: `_doc_ids` and `_design`.
* Added configuration option for TCP_NODELAY aka "Nagle".
* Allow POSTing arguments to `_changes`.
* Allow `keys` parameter for GET requests to views.
* Allow wildcards in vhosts definitions.
* More granular ETag support for views.
* More flexible URL rewriter.
* Added support for recognizing "Q values" and media parameters in
HTTP Accept headers.
* Validate doc ids that come from a PUT to a URL.

Externals:

* Added OS Process module to manage daemons outside of CouchDB.
* Added HTTP Proxy handler for more scalable externals.

Replicator:

* Added `_replicator` database to manage replications.
* Fixed issues when an endpoint is a remote database accessible via SSL.
* Added support for continuous by-doc-IDs replication.
* Fix issue where revision info was omitted when replicating attachments.
* Integrity of attachment replication is now verified by MD5.

Storage System:

* Multiple micro-optimizations when reading data.

View Server:

* Added CommonJS support to map functions.
* Added `stale=update_after` query option that triggers a view update after
returning a `stale=ok` response.
* Warn about empty result caused by `startkey` and `endkey` limiting.
* Built-in reduce function `_sum` now accepts lists of integers as input.
* Added view query aliases start_key, end_key, start_key_doc_id and
end_key_doc_id.

Futon:

* Added a "change password"-feature to Futon.

URL Rewriter & Vhosts:

* Fix for variable substituion

Version 1.0.2 Version 1.0.2
------------- -------------


Expand Down
2 changes: 1 addition & 1 deletion apps/couch/INSTALL.Unix
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Dependencies


You will need the following installed: You will need the following installed:


* Erlang OTP (>=R12B5) (http://erlang.org/) * Erlang OTP (>=R13B2) (http://erlang.org/)
* ICU (http://icu.sourceforge.net/) * ICU (http://icu.sourceforge.net/)
* OpenSSL (http://www.openssl.org/) * OpenSSL (http://www.openssl.org/)
* Mozilla SpiderMonkey (1.8) (http://www.mozilla.org/js/spidermonkey/) * Mozilla SpiderMonkey (1.8) (http://www.mozilla.org/js/spidermonkey/)
Expand Down
19 changes: 12 additions & 7 deletions apps/couch/INSTALL.Windows
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Dependencies


You will need the following installed: You will need the following installed:


* Erlang OTP (>=R12B5) (http://erlang.org/) * Erlang OTP (=14B01) (http://erlang.org/)
* ICU (http://icu.sourceforge.net/) * ICU (http://icu.sourceforge.net/)
* OpenSSL (http://www.openssl.org/) * OpenSSL (http://www.openssl.org/)
* Mozilla SpiderMonkey (1.8) (http://www.mozilla.org/js/spidermonkey/) * Mozilla SpiderMonkey (1.8) (http://www.mozilla.org/js/spidermonkey/)
Expand Down Expand Up @@ -50,12 +50,17 @@ You must check that:


* The `which cl` command points to the Microsoft compiler. * The `which cl` command points to the Microsoft compiler.


If you do not do this, the ones found in `/usr/bin` may be used instead. * The `which mc` command points to the Microsoft message compiler.

* The `which mt` command points to the Microsoft manifest tool.

If you do not do this, the build may fail due to Cygwin ones found in `/usr/bin`
being used instead.


Building Erlang Building Erlang
--------------- ---------------


You must include OpenSSL. You must include Win32 OpenSSL.


However, you can skip the GUI tools by running: However, you can skip the GUI tools by running:


Expand Down Expand Up @@ -89,7 +94,7 @@ Remember to use `/cygdrive/c/` instead of `c:/` as the directory prefix.


To set up your path, run: To set up your path, run:


export PATH=$ERL_TOP/release/win32/erts-5.7.2/bin:$PATH export PATH=$ERL_TOP/release/win32/erts-5.8.2/bin:$PATH


If everything was successful, you should be ready to build CouchDB. If everything was successful, you should be ready to build CouchDB.


Expand All @@ -101,8 +106,8 @@ Building CouchDB
Once you have satisfied the dependencies you should run: Once you have satisfied the dependencies you should run:


./configure \ ./configure \
--with-js-include=/cygdrive/c/path_to_seamonkey_include \ --with-js-include=/cygdrive/c/path_to_spidermonkey_include \
--with-js-lib=/cygdrive/c/path_to_seamonkey_lib \ --with-js-lib=/cygdrive/c/path_to_spidermonkey_lib \
--with-win32-icu-binaries=/cygdrive/c/path_to_icu_binaries_root \ --with-win32-icu-binaries=/cygdrive/c/path_to_icu_binaries_root \
--with-erlang=$ERL_TOP/release/win32/usr/include \ --with-erlang=$ERL_TOP/release/win32/usr/include \
--with-win32-curl=/cygdrive/c/path/to/curl/root/directory \ --with-win32-curl=/cygdrive/c/path/to/curl/root/directory \
Expand Down Expand Up @@ -145,4 +150,4 @@ To check that everything has worked, point your web browser to:


http://127.0.0.1:5984/_utils/index.html http://127.0.0.1:5984/_utils/index.html


From here you should run the test suite. From here you should run the test suite in either Firefox 3.6+ or Safari 4+.
36 changes: 33 additions & 3 deletions apps/couch/NEWS
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -7,6 +7,36 @@ For details about backwards incompatible changes, see:


Each release section notes when backwards incompatible changes have been made. Each release section notes when backwards incompatible changes have been made.


Version 1.1.1
-------------

This version has not been released yet.

Version 1.1.0
-------------

All NEWS for 1.0.2 also apply to 1.1.0.

This release contains backwards incompatible changes.

* Native SSL support.
* Added support for HTTP range requests for attachments.
* Added built-in filters for `_changes`: `_doc_ids` and `_design`.
* Added configuration option for TCP_NODELAY aka "Nagle".
* Allow wildcards in vhosts definitions.
* More granular ETag support for views.
* More flexible URL rewriter.
* Added OS Process module to manage daemons outside of CouchDB.
* Added HTTP Proxy handler for more scalable externals.
* Added `_replicator` database to manage replications.
* Multiple micro-optimizations when reading data.
* Added CommonJS support to map functions.
* Added `stale=update_after` query option that triggers a view update after
returning a `stale=ok` response.
* More explicit error messages when it's not possible to access a file due
to lack of permissions.
* Added a "change password"-feature to Futon.

Version 1.0.2 Version 1.0.2
------------- -------------


Expand Down Expand Up @@ -166,7 +196,7 @@ Version 0.10.1
Version 0.10.0 Version 0.10.0
-------------- --------------


This release contains backwards incompatible changes, please see above for help. This release contains backwards incompatible changes.


* General performance improvements. * General performance improvements.
* View index generation speedups. * View index generation speedups.
Expand Down Expand Up @@ -198,7 +228,7 @@ Version 0.9.1
Version 0.9.0 Version 0.9.0
------------- -------------


This release contains backwards incompatible changes, please see above for help. This release contains backwards incompatible changes.


* Modular configuration. * Modular configuration.
* Performance enhancements for document and view access. * Performance enhancements for document and view access.
Expand All @@ -222,7 +252,7 @@ Version 0.8.1-incubating
Version 0.8.0-incubating Version 0.8.0-incubating
------------------------ ------------------------


This release contains backwards incompatible changes, please see above for help. This release contains backwards incompatible changes.


* Changed core licensing to the Apache Software License 2.0. * Changed core licensing to the Apache Software License 2.0.
* Refactoring of the core view and storage engines. * Refactoring of the core view and storage engines.
Expand Down
6 changes: 5 additions & 1 deletion apps/couch/NOTICE
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ This product also includes the following third-party components:
* jQuery (http://jquery.com/) * jQuery (http://jquery.com/)


Copyright 2010, John Resig Copyright 2010, John Resig

* jQuery UI (http://jqueryui.com)

Copyright 2011, Paul Bakaus


* json2.js (http://www.json.org/) * json2.js (http://www.json.org/)


Expand Down Expand Up @@ -46,6 +50,6 @@ This product also includes the following third-party components:


Copyright 1999, Masanao Izumo <iz@onicos.co.jp> Copyright 1999, Masanao Izumo <iz@onicos.co.jp>


* jspec.js (http://visionmedia.github.com/jspec/) * jspec.js (http://visionmedia.github.com/jspec/)


Copyright 2010 TJ Holowaychuk <tj@vision-media.ca> Copyright 2010 TJ Holowaychuk <tj@vision-media.ca>
11 changes: 11 additions & 0 deletions apps/couch/THANKS
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -63,12 +63,23 @@ suggesting improvements or submitting changes. Some of these people are:
* Paul Bonser <pib@paulbonser.com> * Paul Bonser <pib@paulbonser.com>
* Caleb Land <caleb.land@gmail.com> * Caleb Land <caleb.land@gmail.com>
* Juhani Ränkimies <juhani@juranki.com> * Juhani Ränkimies <juhani@juranki.com>
* Kev Jackson <foamdino@gmail.com>
* Jonathan D. Knezek <jdknezek@gmail.com>
* David Rose <doppler@gmail.com>
* Lim Yue Chuan <shasderias@gmail.com> * Lim Yue Chuan <shasderias@gmail.com>
* David Davis <xantus@xantus.org> * David Davis <xantus@xantus.org>
* Klaus Trainer <klaus.trainer@web.de>
* Dale Harvey <dale@arandomurl.com> * Dale Harvey <dale@arandomurl.com>
* Juuso Väänänen <juuso@vaananen.org> * Juuso Väänänen <juuso@vaananen.org>
* Jeff Zellner <jeff.zellner@gmail.com>
* Benjamin Young <byoung@bigbluehat.com> * Benjamin Young <byoung@bigbluehat.com>
* Gabriel Farrell <gsf747@gmail.com> * Gabriel Farrell <gsf747@gmail.com>
* Mike Leddy <mike@loop.com.br> * Mike Leddy <mike@loop.com.br>
* Felix Hummel <apache@felixhummel.de>
* Tim Smith <tim@couchbase.com>
* Sam Bisbee <sam@sbisbee.com>
* Nathan Vander Wilt <natevw@yahoo.com>
* Caolan McMahon <caolan.mcmahon@googlemail.com>



For a list of authors see the `AUTHORS` file. For a list of authors see the `AUTHORS` file.
32 changes: 11 additions & 21 deletions apps/couch/include/couch_db.hrl
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -25,26 +25,9 @@


-define(DEFAULT_ATTACHMENT_CONTENT_TYPE, <<"application/octet-stream">>). -define(DEFAULT_ATTACHMENT_CONTENT_TYPE, <<"application/octet-stream">>).


-define(LOG_DEBUG(Format, Args), -define(LOG_DEBUG(Format, Args), couch_log:debug(Format, Args)).
case couch_log:debug_on() of -define(LOG_INFO(Format, Args), couch_log:info(Format, Args)).
true -> -define(LOG_ERROR(Format, Args), couch_log:error(Format, Args)).
gen_event:sync_notify(error_logger,
{self(), couch_debug, erlang:get(nonce), {Format, Args}});
false -> ok
end).

-define(LOG_INFO(Format, Args),
case couch_log:info_on() of
true ->
gen_event:sync_notify(error_logger,
{self(), couch_info, erlang:get(nonce), {Format, Args}});
false -> ok
end).

-define(LOG_ERROR(Format, Args),
gen_event:sync_notify(error_logger,
{self(), couch_error, erlang:get(nonce), {Format, Args}})).



-record(rev_info, -record(rev_info,
{ {
Expand Down Expand Up @@ -73,6 +56,7 @@
{mochi_req, {mochi_req,
peer, peer,
method, method,
requested_path_parts,
path_parts, path_parts,
db_url_handlers, db_url_handlers,
user_ctx, user_ctx,
Expand Down Expand Up @@ -194,6 +178,7 @@


view_type = nil, view_type = nil,
include_docs = false, include_docs = false,
conflicts = false,
stale = false, stale = false,
multi_get = false, multi_get = false,
callback = nil, callback = nil,
Expand Down Expand Up @@ -231,6 +216,7 @@
def_lang, def_lang,
design_options=[], design_options=[],
views, views,
lib,
id_btree=nil, id_btree=nil,
current_seq=0, current_seq=0,
purge_seq=0, purge_seq=0,
Expand All @@ -240,6 +226,8 @@


-record(view, -record(view,
{id_num, {id_num,
update_seq=0,
purge_seq=0,
map_names=[], map_names=[],
def, def,
btree=nil, btree=nil,
Expand Down Expand Up @@ -287,7 +275,9 @@
heartbeat, heartbeat,
timeout, timeout,
filter = "", filter = "",
include_docs = false include_docs = false,
conflicts = false,
db_open_options = []
}). }).


-record(proc, { -record(proc, {
Expand Down
4 changes: 4 additions & 0 deletions apps/couch/license.skip
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
^share/www/script/sha1.js ^share/www/script/sha1.js
^share/www/script/base64.js ^share/www/script/base64.js
^share/www/script/test/lorem* ^share/www/script/test/lorem*
^share/www/style/jquery-ui-1.8.11.custom.css
^src/Makefile ^src/Makefile
^src/Makefile.in ^src/Makefile.in
^src/couchdb/.*beam ^src/couchdb/.*beam
Expand All @@ -92,6 +93,9 @@
^test/bench/Makefile ^test/bench/Makefile
^test/bench/Makefile.in ^test/bench/Makefile.in
^test/etap/.*beam ^test/etap/.*beam
^test/etap/.*\.o
^test/etap/.deps/*
^test/etap/test_cfg_register
^test/etap/Makefile ^test/etap/Makefile
^test/etap/Makefile.in ^test/etap/Makefile.in
^test/etap/temp.* ^test/etap/temp.*
Expand Down
2 changes: 1 addition & 1 deletion apps/couch/src/couch_btree.erl
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ query_modify(Bt, LookupKeys, InsertValues, RemoveKeys) ->
{ok, NewRoot, Bt3} = complete_root(Bt2, KeyPointers), {ok, NewRoot, Bt3} = complete_root(Bt2, KeyPointers),
{ok, QueryResults, Bt3#btree{root=NewRoot}}. {ok, QueryResults, Bt3#btree{root=NewRoot}}.


% for ordering different operatations with the same key. % for ordering different operations with the same key.
% fetch < remove < insert % fetch < remove < insert
op_order(fetch) -> 1; op_order(fetch) -> 1;
op_order(remove) -> 2; op_order(remove) -> 2;
Expand Down
Loading

0 comments on commit e9a5a6f

Please sign in to comment.