# i want to ask something about locating log error in mysql code

**URL:** <https://forums.percona.com/t/i-want-to-ask-something-about-locating-log-error-in-mysql-code/1689>\
**Category:** Other MySQL® Questions\
**Created:** [October 20, 2011, 2:36am UTC](https://forums.percona.com/t/i-want-to-ask-something-about-locating-log-error-in-mysql-code/1689 "2011-10-20T02:36:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![justlooks](https://avatars.discourse-cdn.com/v4/letter/j/e274bd/32.png) [@justlooks](https://forums.percona.com/u/justlooks)\
**Post date:** [October 20, 2011, 2:36am UTC](https://forums.percona.com/t/i-want-to-ask-something-about-locating-log-error-in-mysql-code/1689/1 "2011-10-20T02:36:41Z")

</div>

If i get an error like ‘111014 11:10:02 InnoDB: Error: unable to create temporary file; errno: 2’  
i can use grep easily find the innodb code like this:

$ grep ‘unable to create temporary file’ -R \*  
Binary file ha\_innodb\_plugin\_la-os0file.o matches  
os/os0file.c: " InnoDB: Error: unable to create temporary file;"

but i can not find the code cause error like this ‘110514 8:59:48 [ERROR] /usr/libexec/mysqld: Sort aborted’

[09:24 PM] root@mail mysql-5.1.50$ grep ‘Sort aborted’ -R \*  
Docs/mysql.info: Message: Sort aborted  
mysql-test/include/mtr\_warnings.sql: (“Sort aborted”),  
mysql-test/lib/v1/mtr\_report.pl: /Sort aborted/ or  
Binary file sql/share/english/errmsg.sys matches  
sql/share/errmsg.txt: eng “Sort aborted”

and i look the mysqld.cc file ,guess the following code cause the error

sql\_print\_error(“%s: %s”,my\_progname,str);

but i still have no clue ,can anybody help me? thanks

---

<div class="post-metadata">

**Author:** ![gmouse](https://avatars.discourse-cdn.com/v4/letter/g/b9e5f3/32.png) [@gmouse](https://forums.percona.com/u/gmouse)\
**Post date:** [October 20, 2011, 5:42am UTC](https://forums.percona.com/t/i-want-to-ask-something-about-locating-log-error-in-mysql-code/1689/2 "2011-10-20T05:42:29Z")

</div>

Maybe it helps searching for perror.

For this particular error, what is the variable TMPDIR set to, and does that folder exist?

---

<div class="post-metadata">

**Author:** ![justlooks](https://avatars.discourse-cdn.com/v4/letter/j/e274bd/32.png) [@justlooks](https://forums.percona.com/u/justlooks)\
**Post date:** [October 20, 2011, 7:34pm UTC](https://forums.percona.com/t/i-want-to-ask-something-about-locating-log-error-in-mysql-code/1689/3 "2011-10-20T19:34:09Z")

</div>

yes,TMPDIR has been set to a dir which privilege is set correctly in MySQL,and i note when i interrupted sort query manually ,the error will appear,but from the error ,it seems the query is not interrupted manually,so i want to check the code ,see if i can find something useful

111011 16:15:16 [ERROR] /usr/libexec/mysqld: Sort aborted  
111011 16:15:16 [ERROR] /usr/libexec/mysqld: Sort aborted  
111011 16:15:16 [ERROR] /usr/libexec/mysqld: Sort aborted  
111011 16:15:16 [ERROR] /usr/libexec/mysqld: Sort aborted  
111011 16:15:16 [ERROR] /usr/libexec/mysqld: Sort aborted  
111011 16:15:16 [ERROR] /usr/libexec/mysqld: Sort aborted  
111011 16:15:16 [ERROR] /usr/libexec/mysqld: Sort aborted  
111011 16:15:16 [ERROR] /usr/libexec/mysqld: Sort aborted  
111011 16:15:16 [ERROR] /usr/libexec/mysqld: Sort aborted
