Comments - How to store the string in %s

7 years, 3 months ago Jan Steinman

I do not know of your specific case, but this looks like a format argument to the C printf(3) function.

If you are on UNIX or Linux, I suggest you type "man 3 printf" at a command prompt. that will show (in part): "The format string is composed of zero or more directives: ordinary characters (not %), which are copied unchanged to the output stream; and conversion specifications, each of which results in fetching zero or more subsequent arguments. Each conversion specification is introduced by the % character."

If it is indeed a printf(3) format string, "%s" would mean that a corresponding argument to printf(3) is to be interpreted as a character array, and the "%d" would mean that the corresponding argument is interpreted as a decimal number.

So the function call might look something like this: "printf('%s, %d', databasename, #ENOENT)". There is a list of common error codes in /usr/include/sys/errno.h .

Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.