Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
803 views
in Q2A Core by

I just misspelled one of the options in one of my plugins:

    qa_opt('cached_qcount');

instead of correct version:

   qa_opt('cache_qcount');

The result: In the database in table qa_opt I found a newly created entry:

"cached_qcount" with value "1048576"

 

Can this be considered a bug?

 

PS: function qa_db_set_option($name, $value) can be found in qa-db-options.php

Q2A version: 1.6.3
by
Are you sure it was not created beacuse of something like qa_opt('cached_qcount', THE_VALUE);
by
100% sure. See code line above:  qa_opt('cached_qcount');

1 Answer

+1 vote
by

I bet the value had been cached. There is no function to flush the cache AFAIK (I have asked for it in a previous post) but you could try the following to really test this behaviour:

$name 'cached_qcount';
global 
$qa_options_cache;
unset(
$qa_options_cache[$name]);
// Then delete the options from the database...
// I'd go for phpmyadmin or any other client but you can try this anyway

qa_db_query_sub('
    DELETE FROM ^options
    WHERE title = $'
$name);
qa_opt($name);

Then check if the value is in the DB. It should be there with an empty value.

Disclaimer: Previous code is untested. Execute it at your own risk :)

by
Reporting back: I tried this on another installation of v1.6.3, the option was set with an empty value. So I guess you are right, the value was probably cached beforehand.
...