From ee4de117417e54bc83e1857f6f991cbe21efe7b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?William=20Tisa=CC=88ter?= Date: Thu, 17 Jul 2014 08:38:01 +0200 Subject: [PATCH] Add case-insensitive flag to `MDBIndex` --- consul/mdb_table.go | 13 +++++++------ consul/state_store.go | 1 + 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/consul/mdb_table.go b/consul/mdb_table.go index c4c84b0dc9..53c85d7cf3 100644 --- a/consul/mdb_table.go +++ b/consul/mdb_table.go @@ -45,12 +45,13 @@ type MDBTables []*MDBTable // An Index is named, and uses a series of column values to // map to the row-id containing the table type MDBIndex struct { - AllowBlank bool // Can fields be blank - Unique bool // Controls if values are unique - Fields []string // Fields are used to build the index - IdxFunc IndexFunc // Can be used to provide custom indexing - Virtual bool // Virtual index does not exist, but can be used for queries - RealIndex string // Virtual indexes use a RealIndex for iteration + AllowBlank bool // Can fields be blank + Unique bool // Controls if values are unique + Fields []string // Fields are used to build the index + IdxFunc IndexFunc // Can be used to provide custom indexing + Virtual bool // Virtual index does not exist, but can be used for queries + RealIndex string // Virtual indexes use a RealIndex for iteration + CaseInsensitive bool // Controls if values are case-insensitive table *MDBTable name string diff --git a/consul/state_store.go b/consul/state_store.go index a2f139af1c..39d778850c 100644 --- a/consul/state_store.go +++ b/consul/state_store.go @@ -179,6 +179,7 @@ func (s *StateStore) initialize() error { "id": &MDBIndex{ Unique: true, Fields: []string{"Node"}, + CaseInsensitive: true, }, }, Decoder: func(buf []byte) interface{} {