anchor.diff:      end,
       if_call_mfa(IsSec, 'drop_index', [SKey,Table,Index]);
   
  +exec(SKey, {'create index',{},{},TableName,[],{},{}} = _ParseTree, _Stmt, _Opts, IsSec) ->
  +    ?LogDebug("Re-Create Index Parse Tree~n~p~n", [_ParseTree]),
  +    {TableSchema, Tbl} = imem_sql_expr:binstr_to_qname2(TableName),
  +    MySchema = imem_meta:schema(),
  +    MySchemaName = ?atom_to_binary(MySchema),
  +    Table = case TableSchema of
  +        MySchemaName -> list_to_existing_atom(binary_to_list(Tbl));
  +        undefined ->    list_to_existing_atom(binary_to_list(Tbl));
  +        _ ->            ?ClientError({"Cannot re-create index on foreign schema table", TableSchema})
  +    end,
  +    ExistingIndexDefs = case imem_meta:read(ddTable, {MySchema,Table}) of
  +        [#ddTable{}=D] ->
  +            case lists:keysearch(index, 1, D#ddTable.opts) of
  +                {value,{index, EID}} -> EID;
  +                false ->                []
  +            end;
  +        [] ->
  +            ?ClientError({"Table dictionary does not exist for",Table})
  +    end,
  +    if_call_mfa(IsSec, create_or_replace_index, [SKey, Table, ExistingIndexDefs]);
   exec(SKey, {'create index', IndexType, IndexName, TableName
               , IndexDefn, NormWithFun, FilterWithFun} = _ParseTree
               , _Stmt, _Opts, IsSec) ->
       ?LogDebug("Create Index Parse Tree~n~p~n", [_ParseTree]),
       MySchema = imem_meta:schema(),
       MySchemaName = ?atom_to_binary(MySchema),
  -    {TableSchema, Tbl} = imem_sql_expr:binstr_to_qname2(TableName),                
  +    {TableSchema, Tbl} = imem_sql_expr:binstr_to_qname2(TableName),
       {IndexSchema, Index} = imem_sql_expr:binstr_to_qname2(IndexName),
       Table = case TableSchema of
  -        MySchemaName -> list_to_existing_atom(binary_to_list(Tbl)); 
  -        undefined ->    list_to_existing_atom(binary_to_list(Tbl)); 
  +        MySchemaName -> list_to_existing_atom(binary_to_list(Tbl));
  +        undefined ->    list_to_existing_atom(binary_to_list(Tbl));
           _ ->            ?ClientError({"Cannot create index on foreign schema table", TableSchema})
       end,
       case IndexSchema of
  -        MySchemaName -> ok; 
  -        undefined ->    ok; 
  +        MySchemaName -> ok;
  +        undefined ->    ok;
           _ ->            ?ClientError({"Cannot create index in foreign schema", IndexSchema})
       end,
       ExistingIndexDefs = case imem_meta:read(ddTable, {MySchema,Table}) of
  -        [#ddTable{}=D] -> 
  +        [#ddTable{}=D] ->
               case lists:keysearch(index, 1, D#ddTable.opts) of
                   {value,{index, EID}} -> EID;
                   false ->                []
  
positive.code: 
  -include_lib("eunit/include/eunit.hrl").
  
  setup() -> 
      ?imem_test_setup.
  
  teardown(_) -> 
      catch imem_meta:drop_table(idx_index_test),
      catch imem_meta:drop_table(index_test),
      ?imem_test_teardown.
  
negative.code:         Class:Reason ->  ?LogDebug("Exception ~p:~p~n~p~n", [Class, Reason, erlang:get_stacktrace()]),
          ?assert( true == "all tests completed")
      end,
      ok.
  
  print_indices(IsSec, SKey, Schema, Table) ->
      [Meta] = if_call_mfa(IsSec, read, [SKey, ddTable, {Schema,Table}]),
  