diff --git a/CHANGELOG.md b/CHANGELOG.md index 6fcda3e8..2f1e2b28 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,16 +1,29 @@ -# Changelog +# Change Log +All notable changes to this project will be documented in this file. +This project adheres to [Semantic Versioning](http://semver.org/). -## v0.6.2 - 15 Feb 2015 + +## v0.6.3 - 2015-03-04 +### Added +- Add `IdentifierFormat` optarg to `TableOpts` (#158) + +### Fixed +- Fix struct alignment for ARM and x86-32 builds (#153) +- Fix sprintf format for geometry error message (#157) +- Fix duplicate if block (#159) +- Fix incorrect assertion in decoder tests + +## v0.6.2 - 2015-02-15 - Fixed `writeQuery` being too small when sending large queries -## v0.6.1 - 13 Feb 2015 +## v0.6.1 - 2015-02-13 - Reduce GC by using buffers when reading and writing - Fixed encoding `time.Time` ignoring millseconds - Fixed pointers in structs that implement the `Marshaler`/`Unmarshaler` interfaces being ignored -## v0.6.0 - 1 Feb 2015 +## v0.6.0 - 2015-01-01 There are some major changes to the driver with this release that are not related to the RethinkDB v1.16 release. Please have a read through them: - Improvements to result decoding by caching reflection calls. @@ -35,11 +48,11 @@ With that out the way here are the v1.16 changes: Since this release has a lot of changes and although I have tested these changes sometimes things fall through the gaps. If you discover any bugs please let me know and I will try to fix them as soon as possible. -## Hotfix - 14 Dec 2014 +## v.0.5.1 - 2014-12-14 - Fixed empty slices being returned as `[]T(nil)` not `[]T{}` #138 -## v0.5.0 - 6 Oct 2014 +## v0.5.0 - 2014-10-06 - Added geospatial terms (`Circle`, `Distance`, `Fill`, `Geojson`, `ToGeojson`, `GetIntersecting`, `GetNearest`, `Includes`, `Intersects`, `Line`, `Point`, `Polygon`, `PolygonSub`) - Added `UUID` term for generating unique IDs @@ -48,21 +61,22 @@ Since this release has a lot of changes and although I have tested these changes - Updated the `BatchConf` field in `RunOpts`, now uses the `BatchOpts` type - Removed support for the `FieldMapper` interface -### Internal Changes +Internal Changes + - Fixed encoding performance issues, greatly improves writes/second - Updated `Next` to zero the destination value every time it is called. -## v0.4.2 - 6 Sept 2014 +## v0.4.2 - 2014-09-06 - Fixed issue causing `Close` to start an infinite loop - Tidied up connection closing logic -## v0.4.1 - 5 Sept 2014 +## v0.4.1 - 2014-09-05 - Fixed bug causing Pseudotypes to not be decoded properly (#117) - Updated github.com/fatih/pool to v2 (#118) -## v0.4.0 - 13 Aug 2014 +## v0.4.0 - 2014-08-13 - Updated the driver to support RethinkDB v1.14 (#116) - Added the Binary data type @@ -75,23 +89,23 @@ Since this release has a lot of changes and although I have tested these changes - Added the `IndexRename` command - Updated `Distinct` to now take the `Index` optional argument (using `DistinctOpts`) -### Internal Changes +Internal Changes - Updated to use the new JSON protocol - Switched the connection pool code to use github.com/fatih/pool - Added some benchmarks -## v0.3.2 - 17 Aug 2014 +## v0.3.2 - 2014-08-17 - Fixed issue causing connections not to be closed correctly (#109) - Fixed issue causing terms in optional arguments to be encoded incorrectly (#114) -## v0.3.1 - 14 June 2014 +## v0.3.1 - 2014-06-14 - Fixed "Token ## not in stream cache" error (#103) - Changed Exec to no longer use NoReply. It now waits for the server to respond. -## v0.3 (RethinkDB v1.13) - 26 June 2014 +## v0.3.0 - 2014-06-26 - Replaced `ResultRows`/`ResultRow` with `Cursor`, `Cursor` has the `Next`, `All` and `One` methods which stores the relevant value in the value pointed at by result. For more information check the examples. - Changed the time constants (Days and Months) to package globals instead of functions @@ -103,7 +117,7 @@ Since this release has a lot of changes and although I have tested these changes - `EqJoin` now accepts a function as its first argument - `Nth` now returns a selection -## v0.2 (RethinkDB v1.12) - 13 April 2014 +## v0.2.0 - 2014-04-13 * Changed `Connect` to use `ConnectOpts` instead of `map[string]interface{}` * Migrated to new `Group`/`Ungroup` functions, these replace `GroupedMapReduce` and `GroupBy` @@ -114,7 +128,7 @@ Since this release has a lot of changes and although I have tested these changes * Added `GROUPED_DATA` pseudotype * Fixed query printing -## v0.1 (RethinkDB v1.11) - 27 November 2013 +## v0.1.0 - 2013-11-27 * Added noreply writes * Added the new terms `index_status`, `index_wait` and `sync` diff --git a/README.md b/README.md index 4589cc61..c51b8971 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ [Go](http://golang.org/) driver for [RethinkDB](http://www.rethinkdb.com/) -Current version: v0.6.2 (RethinkDB v1.16) +Current version: v0.6.3 (RethinkDB v1.16) **Version 0.6 introduced some small API changes and some significant internal changes, for more information check the [change log](CHANGELOG.md) and please be aware the driver is not yet stable** diff --git a/connection.go b/connection.go index 076abd38..50ddf064 100644 --- a/connection.go +++ b/connection.go @@ -28,6 +28,7 @@ type Response struct { type Connection struct { conn net.Conn opts *ConnectOpts + _ [4]byte token int64 cursors map[int64]*Cursor bad bool @@ -164,6 +165,7 @@ func (c *Connection) sendQuery(q Query) error { // getToken generates the next query token, used to number requests and match // responses with requests. func (c *Connection) nextToken() int64 { + // requires c.token to be 64-bit aligned on ARM return atomic.AddInt64(&c.token, 1) } diff --git a/cursor.go b/cursor.go index f71018a9..ec4d5058 100644 --- a/cursor.go +++ b/cursor.go @@ -279,10 +279,6 @@ func (c *Cursor) IsNil() bool { return true } - if bufferedItem == nil { - return true - } - return false } diff --git a/doc.go b/doc.go index 4008ea55..66cb0a82 100644 --- a/doc.go +++ b/doc.go @@ -1,6 +1,6 @@ // Go driver for RethinkDB // -// Current version: v0.6.2 (RethinkDB v1.16) +// Current version: v0.6.3 (RethinkDB v1.16) // For more in depth information on how to use RethinkDB check out the API docs // at http://rethinkdb.com/api package gorethink diff --git a/encoding/decoder_test.go b/encoding/decoder_test.go index 90f065f5..52b89b0f 100644 --- a/encoding/decoder_test.go +++ b/encoding/decoder_test.go @@ -3,7 +3,6 @@ package encoding import ( "bytes" "encoding/json" - "fmt" "image" "reflect" "testing" @@ -149,7 +148,7 @@ var decodeTests = []decodeTest{ {in: string("2"), ptr: new(interface{}), out: string("2")}, {in: "a\u1234", ptr: new(string), out: "a\u1234"}, {in: []interface{}{}, ptr: new([]string), out: []string{}}, - {in: map[string]interface{}{"X": []interface{}{1, 2, 3}, "Y": 4}, ptr: new(T), out: T{}, err: &DecodeTypeError{reflect.TypeOf([0]interface{}{}), reflect.TypeOf(""), ""}}, + {in: map[string]interface{}{"X": []interface{}{1, 2, 3}, "Y": 4}, ptr: new(T), out: T{}, err: &DecodeTypeError{reflect.TypeOf(""), reflect.TypeOf([]interface{}{}), ""}}, {in: map[string]interface{}{"x": 1}, ptr: new(tx), out: tx{}}, {in: map[string]interface{}{"F1": float64(1), "F2": 2, "F3": 3}, ptr: new(V), out: V{F1: float64(1), F2: int32(2), F3: string("3")}}, {in: map[string]interface{}{"F1": string("1"), "F2": 2, "F3": 3}, ptr: new(V), out: V{F1: string("1"), F2: int32(2), F3: string("3")}}, @@ -256,9 +255,7 @@ func TestDecode(t *testing.T) { continue } - if !jsonEqual(v.Elem().Interface(), tt.out) { - fmt.Printf("%#v\n", v.Elem().Interface()) - fmt.Printf("%#v\n", tt.out) + if tt.err == nil && !jsonEqual(v.Elem().Interface(), tt.out) { t.Errorf("#%d: mismatch\nhave: %+v\nwant: %+v", i, v.Elem().Interface(), tt.out) continue } diff --git a/pseudotypes.go b/pseudotypes.go index 343d6899..724f32b6 100644 --- a/pseudotypes.go +++ b/pseudotypes.go @@ -214,6 +214,6 @@ func reqlGeometryToNativeGeometry(obj map[string]interface{}) (interface{}, erro }, nil } } else { - return nil, fmt.Errorf("pseudo-type GEOMETRY object %v field has unknown type %s", typ) + return nil, fmt.Errorf("pseudo-type GEOMETRY object %v field has unknown type %s", obj, typ) } } diff --git a/query_select.go b/query_select.go index d4cfb8f6..5f155932 100644 --- a/query_select.go +++ b/query_select.go @@ -11,6 +11,7 @@ func Db(args ...interface{}) Term { type TableOpts struct { UseOutdated interface{} `gorethink:"use_outdated,omitempty"` + IdentifierFormat interface{} `gorethink:"identifier_format,omitempty"` } func (o *TableOpts) toMap() map[string]interface{} {