~evarlast/ubuntu/utopic/mongodb/upstart-workaround-debian-bug-718702

« back to all changes in this revision

Viewing changes to src/mongo/db/pipeline/document_source_command_shards.cpp

  • Committer: Package Import Robot
  • Author(s): James Page, James Page, Robie Basak
  • Date: 2013-05-29 17:44:42 UTC
  • mfrom: (44.1.7 sid)
  • Revision ID: package-import@ubuntu.com-20130529174442-z0a4qmoww4y0t458
Tags: 1:2.4.3-1ubuntu1
[ James Page ]
* Merge from Debian unstable, remaining changes:
  - Enable SSL support:
    + d/control: Add libssl-dev to BD's.
    + d/rules: Enabled --ssl option.
    + d/mongodb.conf: Add example SSL configuration options.
  - d/mongodb-server.mongodb.upstart: Add upstart configuration.
  - d/rules: Don't strip binaries during scons build for Ubuntu.
  - d/control: Add armhf to target archs.
  - d/p/SConscript.client.patch: fixup install of client libraries.
  - d/p/0010-install-libs-to-usr-lib-not-usr-lib64-Closes-588557.patch:
    Install libraries to lib not lib64.
* Dropped changes:
  - d/p/arm-support.patch: Included in Debian.
  - d/p/double-alignment.patch: Included in Debian.
  - d/rules,control: Debian also builds with avaliable system libraries
    now.
* Fix FTBFS due to gcc and boost upgrades in saucy:
  - d/p/0008-ignore-unused-local-typedefs.patch: Add -Wno-unused-typedefs
    to unbreak building with g++-4.8.
  - d/p/0009-boost-1.53.patch: Fixup signed/unsigned casting issue.

[ Robie Basak ]
* d/p/0011-Use-a-signed-char-to-store-BSONType-enumerations.patch: Fixup
  build failure on ARM due to missing signed'ness of char cast.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
 
27
27
    bool DocumentSourceCommandShards::eof() {
28
28
        /* if we haven't even started yet, do so */
29
 
        if (!pCurrent.get())
 
29
        if (unstarted)
30
30
            getNextDocument();
31
31
 
32
 
        return (pCurrent.get() == NULL);
 
32
        return !hasCurrent;
33
33
    }
34
34
 
35
35
    bool DocumentSourceCommandShards::advance() {
36
36
        DocumentSource::advance(); // check for interrupts
37
37
 
38
 
        if (eof())
39
 
            return false;
 
38
        if (unstarted)
 
39
            getNextDocument(); // skip first
40
40
 
41
41
        /* advance */
42
42
        getNextDocument();
43
43
 
44
 
        return (pCurrent.get() != NULL);
 
44
        return hasCurrent;
45
45
    }
46
46
 
47
 
    intrusive_ptr<Document> DocumentSourceCommandShards::getCurrent() {
 
47
    Document DocumentSourceCommandShards::getCurrent() {
48
48
        verify(!eof());
49
49
        return pCurrent;
50
50
    }
64
64
        const ShardOutput& shardOutput,
65
65
        const intrusive_ptr<ExpressionContext> &pExpCtx):
66
66
        DocumentSource(pExpCtx),
 
67
        unstarted(true),
 
68
        hasCurrent(false),
67
69
        newSource(false),
68
70
        pBsonSource(),
69
71
        pCurrent(),
81
83
    }
82
84
 
83
85
    void DocumentSourceCommandShards::getNextDocument() {
 
86
        if (unstarted) {
 
87
            unstarted = false;
 
88
            hasCurrent = true;
 
89
        }
 
90
 
84
91
        while(true) {
85
92
            if (!pBsonSource.get()) {
86
93
                /* if there aren't any more futures, we're done */
87
94
                if (iterator == listEnd) {
88
 
                    pCurrent.reset();
 
95
                    pCurrent = Document();
 
96
                    hasCurrent = false;
89
97
                    return;
90
98
                }
91
99