anchor.diff:      NewDoc#sumo_doc.fields
     ),
   
  -  Dql = "INSERT INTO `"
  -    ++ atom_to_list(DocName) ++ "` (" ++ string:join(ColumnDqls, ",") ++ ")"
  -    ++ " VALUES (" ++ string:join(ColumnSqls, ",") ++ ")"
  -    ++ " ON DUPLICATE KEY UPDATE "
  -    ++ string:join(lists:map(
  +  Dql = [
  +    "INSERT INTO ", escape(atom_to_list(DocName)), " (",
  +    string:join(ColumnDqls, ","), ")",
  +    " VALUES (", string:join(ColumnSqls, ","), ")",
  +    " ON DUPLICATE KEY UPDATE ",
  +    string:join(lists:map(
         fun(ColumnName) ->
  -        ColumnName ++ "=?"
  +        [ColumnName, "=?"]
         end,
         ColumnDqls
  -    ), ","),
  +    ), ",")
  +  ],
     emysql:prepare(insert_stmt, list_to_binary(Dql)),
     case execute(Dql, lists:append(ColumnValues, ColumnValues), State) of
       #ok_packet{insert_id = InsertId} ->
  
positive.code:   ),
    {ok, #state{pool=Pool}}.
  
  
negative.code: 
    [ColumnDqls, ColumnSqls, ColumnValues] = lists:foldl(
      fun({Name, Value}, [Dqls, Sqls, Values]) ->
        Dql = [escape(atom_to_list(Name))],
        Sql = "?",
        [[Dql|Dqls], [Sql|Sqls], [Value|Values]]
      end,
  