Hi Sergey,
Patch approved with two minor comments below:
Sergey Glukhov wrote:
> #At file:///home/gluh/MySQL/bazaar/mysql-5.1-bug-36638/
>
> 2674 Sergey Glukhov 2008-08-07
> Bug#36638 mysqld crashes when open file limit is passed and general query log
> enabled(2nd ver)
> The problem:
> CSV storage engine open function returns success even
> thought it failed to open the data file
> The fix:
> return error
> Additional fixes:
> added MY_WME to my_open to avoid mysterious error message
> free share struct if open the file was unsuccesful
unsuccesful -> unsuccessful
> modified:
> mysql-test/r/csv.result
> mysql-test/t/csv.test
> storage/csv/ha_tina.cc
>
> per-file messages:
> mysql-test/r/csv.result
> test result
> mysql-test/t/csv.test
> test case
> storage/csv/ha_tina.cc
> The problem:
> CSV storage engine open function returns success even
> thought it failed to open the data file
> The fix:
> return error
> Additional fixes:
> added MY_WME to my_open to avoid mysterious error message
> free share struct if open the file was unsuccesful
unsuccesful -> unsuccessful
<snip>
> === modified file 'storage/csv/ha_tina.cc'
> --- a/storage/csv/ha_tina.cc 2008-03-29 15:56:33 +0000
> +++ b/storage/csv/ha_tina.cc 2008-08-07 12:04:01 +0000
> @@ -191,8 +191,11 @@ static TINA_SHARE *get_share(const char
> meta-file in the end.
> */
> if ((share->meta_file= my_open(meta_file_name,
> - O_RDWR|O_CREAT, MYF(0))) == -1)
> + O_RDWR|O_CREAT, MYF(MY_WME))) == -1)
> + {
> share->crashed= TRUE;
> + goto error1;
> + }
>
> /*
> If the meta file will not open we assume it is crashed and
> @@ -201,6 +204,8 @@ static TINA_SHARE *get_share(const char
> if (read_meta_file(share->meta_file, &share->rows_recorded))
> share->crashed= TRUE;
> }
> +
> +error1:
> share->use_count++;
> pthread_mutex_unlock(&tina_mutex);
>
This goto and label are not necessary. You can convert the "if (read_.."
part to a "else if" or you can put the two in the same if.
Regards,
-- Davi Arnaut