New to Tsung and Erlan and have run into an issue I haven't been able to find answer to. I'm using erlang-mysql-driver in a Tsung dynvars Erlang function and I seem to be having a problem with escaped quotes.
I'd like to do something like this:
<setdynvars sourcetype="eval"
code='fun({Pid,DynVars})->
mysql:start_link(p1, "localhost", "user", "pass", "db"),
Result = mysql:fetch(p1, "SELECT * FROM consumers WHERE first_name=\'Doonley\'") end.'>
<var name="myres" />
</setdynvars>
but I get a whitespace error:
Douglas-Sparlings-MacBook-Pro:.tsung dsparling$ tsung start
Starting Tsung
"Log directory is: /Users/dsparling/.tsung/log/20091110-16:35"
3284- fatal: {whitespace_required_between_attributes}
["Config Error, aborting ! ",{fatal,{{whitespace_required_between_attributes},{file,"/Users/dsparling/.tsung/tsung.xml"},{line,72},{col,221}}}]
I actually need to use a variable for the select, but I'm not sure of the syntax. Something like the following is what I'm looking for:
<setdynvars sourcetype="eval"
code='fun({Pid,DynVars})->
Val='Doonley",
mysql:start_link(p1, "localhost", "user", "pass", "db"),
Result = mysql:fetch(p1, "SELECT * FROM consumers WHERE first_name=?", Val) end.'>
<var name="myres" />
</setdynvars>