Merge lp:~stewart/drizzle/bug738022 into lp:~drizzle-trunk/drizzle/development

Proposed by Stewart Smith
Status: Merged
Approved by: Brian Aker
Approved revision: 2258
Merged at revision: 2258
Proposed branch: lp:~stewart/drizzle/bug738022
Merge into: lp:~drizzle-trunk/drizzle/development
Diff against target: 34 lines (+12/-3)
1 file modified
drizzled/cached_directory.cc (+12/-3)
To merge this branch: bzr merge lp:~stewart/drizzle/bug738022
Reviewer Review Type Date Requested Status
Olaf van der Spek (community) Needs Fixing
Drizzle Merge Team Pending
Review via email: mp+55287@code.launchpad.net

Description of the change

patch separated out from multitenancy tree, fixes a bug we have that you really notice when you start screwing with CATALOG support.

http://hudson.drizzle.org/job/drizzle-param/787/

To post a comment you must log in.
Revision history for this message
Olaf van der Spek (olafvdspek) wrote :

Hi Stewart,

Why is every argument to errmsg_printf on a new line? Should be a single line (IMO).
Why is only one of the two stat calls fixed?
Shouldn't "else if" be used instead of "if (err == 0"?

Greetings

review: Needs Fixing

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'drizzled/cached_directory.cc'
2--- drizzled/cached_directory.cc 2011-03-23 12:07:34 +0000
3+++ drizzled/cached_directory.cc 2011-03-29 06:44:32 +0000
4@@ -39,8 +39,12 @@
5
6 #include <drizzled/cached_directory.h>
7 #include <drizzled/util/find_ptr.h>
8+#include <drizzled/error_t.h>
9+#include <drizzled/error.h>
10+#include <drizzled/errmsg_print.h>
11
12 using namespace std;
13+using namespace drizzled;
14
15 namespace drizzled {
16
17@@ -155,9 +159,14 @@
18
19 buffered_fullpath.append(result->d_name);
20
21- stat(buffered_fullpath.c_str(), &entrystat);
22-
23- if (S_ISDIR(entrystat.st_mode))
24+ int err= stat(buffered_fullpath.c_str(), &entrystat);
25+
26+ if (err != 0)
27+ errmsg_printf(error::WARN, ER(ER_CANT_GET_STAT),
28+ buffered_fullpath.c_str(),
29+ errno);
30+
31+ if (err == 0 && S_ISDIR(entrystat.st_mode))
32 {
33 entries.push_back(new Entry(result->d_name));
34 }