-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
set_mapistoreURI returning MAPI_E_NOT_FOUND if mapping is alreay in database. #373
Comments
And another possible victim: set_system_idx( |
You're right @qantourisc . I've just added a unit test for this case with the following result:
We have to see which is the right solution. |
New by request by someone else: #379 |
Do you agree with that solution? |
Yes and Hell No: See my patch: #378 Why yes: It looks like it will work. Why no: You have to look @ https://dev.mysql.com/doc/refman/5.5/en/mysql-num-rows.html not @ https://dev.mysql.com/doc/refman/5.5/en/mysql-affected-rows.html. Side thought: We also ought to check for >1 cause that is also wrong, if one wishes to protect against DB-schema bugs, and code bugs. But not really required. |
I obtained the value for sql = talloc_asprintf(mem_ctx,
"UPDATE folders f "
"JOIN mailboxes m ON m.id = f.mailbox_id AND m.name = '%s' "
"SET f.MAPIStoreURI = '%s' "
"WHERE f.folder_id = %"PRIu64,
_sql(mem_ctx, username), mapistoreURL, fid);
OPENCHANGE_RETVAL_IF(!sql, MAPI_E_NOT_ENOUGH_MEMORY, mem_ctx);
retval = status(execute_query(conn, sql));
printf("Count %d affected %d\n", mysql_num_rows(conn), mysql_affected_rows(conn)); The results after running testsuite.
So for me the |
Ok this is where mysql and mariadb differ it seems.So your solution is correct. |
In the file:
mapiproxy/libmapiproxy/backends/openchangedb_mysql.c:323 MAPISTATUS set_mapistoreURI
The query can return
Query OK, 0 rows affected; Rows matched: 1 Changed: 0
Meaning the row is already on the requested value.
I had to change the check
if (mysql_affected_rows(conn) == 0) {
toif (mysql_num_rows(conn) == 0){
Please confirm this bug and I can make a pull request.
The text was updated successfully, but these errors were encountered: