Skip to content

Conversation

trollfred
Copy link

for niceness

@jlouis
Copy link
Collaborator

jlouis commented Mar 19, 2014

Could you provide a test case where it becomes clear that we support this feature and also gives an example of its use? I want coverage to go up in general in this project.

@jlouis
Copy link
Collaborator

jlouis commented Apr 11, 2014

bump :)

@ddosia
Copy link

ddosia commented Jul 21, 2014

MySQL [mydb]> CREATE TABLE test (is_error boolean not null);

(test@mypc)4> emysql:execute(mypool, "INSERT INTO test VALUES(?)", [true]).

MySQL [mydb]> SELECT * FROM test;
+----------+
| is_error |
+----------+
|        0 |
+----------+

If you do trace emysql_conn:set_params_packet/3 you will see:

(trace@mypc)9> (<6016.207.0>) call emysql_conn:set_params_packet(1,[true],utf8)
(<6016.207.0>) returned from emysql_conn:set_params_packet/3 -> <<3,83,69,84,
                                                                  32,64,49,61,
                                                                  39,116,114,
                                                                  117,101,39>>

It is equivalent to <<"SET @1='true'">>, note: true must not be in single quotes.

@trollfred
Copy link
Author

@ddosia I checked your case, but didn't see any quotes, in my log its
<<"@1=true,@2=false">> <<"@1=true">> <<"@1=false">> etc.
Seems like this bug is already solved, please, check

@ddosia
Copy link

ddosia commented Nov 15, 2014

@kittee I am sorry but it is still reproducible for me with master branch.
And I don't see why it shouldn't, until there is no special clause for atoms true and false in emysql_conn:encode/2

@trollfred
Copy link
Author

@ddosia That's because my PR is not merged into master yet (special clauses are here)

@ddosia
Copy link

ddosia commented Nov 15, 2014

@kittee I understand that, my example show what sout of confusion may occur without proper fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants