Summary of Embedded Development Phase (2018.4)

1. The execution of mysql_real_query() in mysqlAPI called by C language keeps failing.
Solution : When checking the code, it is found that mysql_init() is called before fork(). The phenomenon of multiple processes competing for critical resources makes SQL unable to execute normally, and the error codes reported cannot be found in the user manual. Later, put mysql_ini() into the corresponding single process, and the program runs normally.

2. After the global variable of a process is declared as static, in the .data segment (initialized) or .bss segment (uninitialized), it can only be valid in the source file where it is defined, and other source files cannot access it .

For example, if I declare a static variable in "ah" and initialize it in "main.c", the initialized value is only valid in "main.c", not in other source files.


3. The method of exporting query results to csv format in mysql:
select content from table_name into
outfile 'secure_file_priv/file_name'
fields terminated by ','
optionally enclosed by '"'
escaped by '"'
lines terminated by '\r\n ';

4. An error occurs when mysql exports a file: ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement

Solution: Use "show variables like '%secure%';" in mysql to view the secure_file_priv path, and then change the export path to this directory in the export statement.

※Note: The method of viewing secure_file_priv: show global variables like '%secure%'


5. The role of "!" in ARM assembly language:

    Command: LDR r0, [r1, #100]

     Meaning: read the value in r1+100 into r0

    ·Command: LDR r0, [r1, #100]!

     Meaning: read the value in r1+100 into r0, and write r1+100 into r1

6. ARM instruction set:
    STR: word data storage; LDR: word data load

7. X86 instruction set:
    movzwl: zero extension, by 2 bytes move to 4 bytes

8. Error when cross-compiling: Value too large for defined data type
    The source code itself is fine, it is related to the mount attribute. Since it is ubuntu running with a virtual machine, I mounted a windows folder under the system, and compiling the source code in it will report the fatal error as above. But if you move it to ubuntu's file system, the compilation will pass.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325405592&siteId=291194637